17 lines
537 KiB
JavaScript
17 lines
537 KiB
JavaScript
import{a as M0}from"./chunk-PXW3NTQX.js";import{a as Pg,b as Tg,c as kg,d as Ug,e as qg,f as Rg}from"./chunk-YUSIJWOC.js";import{a as Eg}from"./chunk-YHVKZE66.js";import{k as Og}from"./chunk-2DSLTDTL.js";import{a as Cg}from"./chunk-UVIVAH5I.js";import{a as A0,b as Ig}from"./chunk-ALIHWT7Z.js";import{a as _g,b as xg,e as Sg,g as Bg,h as Ag,k as B0,l as Mg,m as Mo}from"./chunk-IAFVNOEB.js";import{a as _c}from"./chunk-DUYWEMAT.js";import{d as vg,e as wg}from"./chunk-WMCBVXPA.js";import{c as W,g as S0,n as process,o as x,p as v,q as S}from"./chunk-QTLWQ5AJ.js";var xc=W(da=>{"use strict";x();S();Object.defineProperty(da,"__esModule",{value:!0});da.SignType=void 0;var Ng;(function(t){t[t.Secp256k1=1]="Secp256k1",t[t.ECDSA_P256=2]="ECDSA_P256",t[t.ED25519=3]="ED25519",t[t.StarknetSignType=4]="StarknetSignType",t[t.TezosSignType=5]="TezosSignType"})(Ng=da.SignType||(da.SignType={}))});var E0=W(Qr=>{"use strict";x();S();Object.defineProperty(Qr,"__esModule",{value:!0});Qr.CoinCurveMap=Qr.MultiAddressCoins=Qr.segwitType=Qr.Currency=void 0;var st;(function(t){t[t.NULL=-1]="NULL",t[t.BTC=0]="BTC",t[t.TBTC=1]="TBTC",t[t.ETH=60]="ETH",t[t.LTC=2]="LTC",t[t.DOGE=3]="DOGE",t[t.BCH=145]="BCH",t[t.BSV=236]="BSV",t[t.TRX=195]="TRX",t[t.SOL=501]="SOL",t[t.APTOS=637]="APTOS",t[t.OMNI_USDT=20001]="OMNI_USDT",t[t.OMNI_USDT_TEST=20002]="OMNI_USDT_TEST",t[t.SUI=784]="SUI",t[t.ATOM=118]="ATOM",t[t.OSMO=1e3]="OSMO",t[t.EVMOS=1001]="EVMOS",t[t.AXL=1002]="AXL",t[t.CRO=1003]="CRO",t[t.Iris=1004]="Iris",t[t.Juno=1005]="Juno",t[t.Kava=1006]="Kava",t[t.Kujira=1007]="Kujira",t[t.SCRT=1008]="SCRT",t[t.Stargaze=1009]="Stargaze",t[t.Terra=1010]="Terra",t[t.ZKSPACE=1011]="ZKSPACE",t[t.ZKSYNC=804]="ZKSYNC",t[t.Stx=5757]="Stx",t[t.SEI=2837]="SEI",t[t.WAX=14001]="WAX",t[t.Starknet=9004]="Starknet",t[t.ADA=1815]="ADA",t[t.INJ=2892]="INJ",t[t.Celestia=2854]="Celestia",t[t.DYDX=2897]="DYDX",t[t.Kaspa=111111]="Kaspa",t[t.TON=607]="TON",t[t.NostrAssets=1237]="NostrAssets",t[t.Near=397]="Near"})(st=Qr.Currency||(Qr.Currency={}));var Lg;(function(t){t[t.SEGWIT_NESTED=1]="SEGWIT_NESTED",t[t.SEGWIT_NESTED_49=2]="SEGWIT_NESTED_49",t[t.SEGWIT_NATIVE=3]="SEGWIT_NATIVE",t[t.SEGWIT_TAPROOT=4]="SEGWIT_TAPROOT"})(Lg=Qr.segwitType||(Qr.segwitType={}));Qr.MultiAddressCoins=[st.BTC,st.TBTC,st.LTC,st.DOGE,st.BSV,st.OMNI_USDT,st.OMNI_USDT_TEST];var Ut="secp256k1",cf="ed25519";Qr.CoinCurveMap=new Map([[st.BTC,Ut],[st.TBTC,Ut],[st.ETH,Ut],[st.LTC,Ut],[st.DOGE,Ut],[st.BCH,Ut],[st.BSV,Ut],[st.TRX,Ut],[st.OMNI_USDT,Ut],[st.OMNI_USDT_TEST,Ut],[st.ATOM,Ut],[st.OSMO,Ut],[st.EVMOS,Ut],[st.AXL,Ut],[st.CRO,Ut],[st.Iris,Ut],[st.Juno,Ut],[st.Kava,Ut],[st.Kujira,Ut],[st.SCRT,Ut],[st.Stargaze,Ut],[st.Terra,Ut],[st.SEI,Ut],[st.Celestia,Ut],[st.DYDX,Ut],[st.SOL,cf],[st.APTOS,cf],[st.SUI,cf],[st.TON,cf]])});var Sc=W(Oe=>{"use strict";x();S();Object.defineProperty(Oe,"__esModule",{value:!0});Oe.SignCommonMsgError=Oe.EstimateFeeError=Oe.validSignedTransactionError=Oe.GetPayLoadError=Oe.HardwareDerivePubKeyError=Oe.CalcTxHashError=Oe.SignMsgStep3Error=Oe.SignMsgSetupError=Oe.Ed25519Step3Error=Oe.Ed25519Step2Error=Oe.Ed25519Step1Error=Oe.Ed25519SetupError=Oe.EcdsaStep3Error=Oe.EcdsaStep2Error=Oe.EcdsaStep1Error=Oe.EcdsaSetupError=Oe.MPCShakeHandsError=Oe.MPCStepError=Oe.MPCAesKeyMissError=Oe.GetHardWareMessageHashError=Oe.GetHardwareSignedTransactionError=Oe.GetHardwareRawTransactionError=Oe.GetMpcTransactionError=Oe.GetMpcRawTransactionError=Oe.DerivePathError=Oe.GenMnemonicError=Oe.GenPrivateKeyError=Oe.UnsupportedCoinError=Oe.SignMsgError=Oe.SignTxError=Oe.ValidAddressError=Oe.NewAddressError=Oe.NotImplementedError=void 0;Oe.NotImplementedError="no implementation method";Oe.NewAddressError="generate address error";Oe.ValidAddressError="valid address error";Oe.SignTxError="sign tx error";Oe.SignMsgError="sign message error";Oe.UnsupportedCoinError="unsupported currency";Oe.GenPrivateKeyError="generate private key error";Oe.GenMnemonicError="generate mnemonic error";Oe.DerivePathError="derive hdPath error";Oe.GetMpcRawTransactionError="get mpc raw transaction error";Oe.GetMpcTransactionError="get mpc transaction error";Oe.GetHardwareRawTransactionError="get hardware raw transaction error";Oe.GetHardwareSignedTransactionError="get hardware signed transaction error";Oe.GetHardWareMessageHashError="get hardware message hash error";Oe.MPCAesKeyMissError="mpc get aes key error";Oe.MPCStepError="mpc step error";Oe.MPCShakeHandsError="mpc shake hands error";Oe.EcdsaSetupError="ecdsa setup error";Oe.EcdsaStep1Error="ecdsa step1 error";Oe.EcdsaStep2Error="ecdsa step2 error";Oe.EcdsaStep3Error="ecdsa step3 error";Oe.Ed25519SetupError="ed25519 setup error";Oe.Ed25519Step1Error="ed25519 step1 error";Oe.Ed25519Step2Error="ed25519 step2 error";Oe.Ed25519Step3Error="ed25519 step3 error";Oe.SignMsgSetupError="sign message setup error";Oe.SignMsgStep3Error="sign message step3 error";Oe.CalcTxHashError="calculate tx hash error";Oe.HardwareDerivePubKeyError="derive sub pub key error";Oe.GetPayLoadError="get payload error";Oe.validSignedTransactionError="valid signed transaction error";Oe.EstimateFeeError="estimate fee error";Oe.SignCommonMsgError="sign common msg error"});var Xi=W(Le=>{"use strict";x();S();Object.defineProperty(Le,"__esModule",{value:!0});Le.bytes=Le.stringToBytes=Le.str=Le.bytesToString=Le.hex=Le.utf8=Le.bech32m=Le.bech32=Le.base58check=Le.base58xmr=Le.base58xrp=Le.base58flickr=Le.base58=Le.base64url=Le.base64=Le.base32crockford=Le.base32hex=Le.base32=Le.base16=Le.utils=Le.assertNumber=void 0;function ui(t){if(!Number.isSafeInteger(t))throw new Error(`Wrong integer: ${t}`)}Le.assertNumber=ui;function gn(...t){let e=(i,o)=>a=>i(o(a)),r=Array.from(t).reverse().reduce((i,o)=>i?e(i,o.encode):o.encode,void 0),n=t.reduce((i,o)=>i?e(i,o.decode):o.decode,void 0);return{encode:r,decode:n}}function En(t){return{encode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return e.map(r=>{if(ui(r),r<0||r>=t.length)throw new Error(`Digit index outside alphabet: ${r} (alphabet: ${t.length})`);return t[r]})},decode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="string")throw new Error("alphabet.decode input should be array of strings");return e.map(r=>{if(typeof r!="string")throw new Error(`alphabet.decode: not string element=${r}`);let n=t.indexOf(r);if(n===-1)throw new Error(`Unknown letter: "${r}". Allowed: ${t}`);return n})}}}function In(t=""){if(typeof t!="string")throw new Error("join separator should be string");return{encode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="string")throw new Error("join.encode input should be array of strings");for(let r of e)if(typeof r!="string")throw new Error(`join.encode: non-string input=${r}`);return e.join(t)},decode:e=>{if(typeof e!="string")throw new Error("join.decode input should be string");return e.split(t)}}}function pa(t,e="="){if(ui(t),typeof e!="string")throw new Error("padding chr should be string");return{encode(r){if(!Array.isArray(r)||r.length&&typeof r[0]!="string")throw new Error("padding.encode input should be array of strings");for(let n of r)if(typeof n!="string")throw new Error(`padding.encode: non-string input=${n}`);for(;r.length*t%8;)r.push(e);return r},decode(r){if(!Array.isArray(r)||r.length&&typeof r[0]!="string")throw new Error("padding.encode input should be array of strings");for(let i of r)if(typeof i!="string")throw new Error(`padding.decode: non-string input=${i}`);let n=r.length;if(n*t%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;n>0&&r[n-1]===e;n--)if(!((n-1)*t%8))throw new Error("Invalid padding: string has too much padding");return r.slice(0,n)}}}function k0(t){if(typeof t!="function")throw new Error("normalize fn should be function");return{encode:e=>e,decode:e=>t(e)}}function I0(t,e,r){if(e<2)throw new Error(`convertRadix: wrong from=${e}, base cannot be less than 2`);if(r<2)throw new Error(`convertRadix: wrong to=${r}, base cannot be less than 2`);if(!Array.isArray(t))throw new Error("convertRadix: data should be array");if(!t.length)return[];let n=0,i=[],o=Array.from(t);for(o.forEach(a=>{if(ui(a),a<0||a>=e)throw new Error(`Wrong integer: ${a}`)});;){let a=0,s=!0;for(let u=n;u<o.length;u++){let h=o[u],w=e*a+h;if(!Number.isSafeInteger(w)||e*a/e!==a||w-h!==e*a)throw new Error("convertRadix: carry overflow");if(a=w%r,o[u]=Math.floor(w/r),!Number.isSafeInteger(o[u])||o[u]*r+a!==w)throw new Error("convertRadix: carry overflow");if(s)o[u]?s=!1:n=u;else continue}if(i.push(a),s)break}for(let a=0;a<t.length-1&&t[a]===0;a++)i.push(0);return i.reverse()}var U0=(t,e)=>e?U0(e,t%e):t,lf=(t,e)=>t+(e-U0(t,e));function Bc(t,e,r,n){if(!Array.isArray(t))throw new Error("convertRadix2: data should be array");if(e<=0||e>32)throw new Error(`convertRadix2: wrong from=${e}`);if(r<=0||r>32)throw new Error(`convertRadix2: wrong to=${r}`);if(lf(e,r)>32)throw new Error(`convertRadix2: carry overflow from=${e} to=${r} carryBits=${lf(e,r)}`);let i=0,o=0,a=2**r-1,s=[];for(let u of t){if(ui(u),u>=2**e)throw new Error(`convertRadix2: invalid data word=${u} from=${e}`);if(i=i<<e|u,o+e>32)throw new Error(`convertRadix2: carry overflow pos=${o} from=${e}`);for(o+=e;o>=r;o-=r)s.push((i>>o-r&a)>>>0);i&=2**o-1}if(i=i<<r-o&a,!n&&o>=e)throw new Error("Excess padding");if(!n&&i)throw new Error(`Non-zero padding: ${i}`);return n&&o>0&&s.push(i>>>0),s}function q0(t){return ui(t),{encode:e=>{if(!(e instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return I0(Array.from(e),2**8,t)},decode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(I0(e,t,2**8))}}}function Yn(t,e=!1){if(ui(t),t<=0||t>32)throw new Error("radix2: bits should be in (0..32]");if(lf(8,t)>32||lf(t,8)>32)throw new Error("radix2: carry overflow");return{encode:r=>{if(!(r instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return Bc(Array.from(r),8,t,!e)},decode:r=>{if(!Array.isArray(r)||r.length&&typeof r[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(Bc(r,t,8,e))}}}function P0(t){if(typeof t!="function")throw new Error("unsafeWrapper fn should be function");return function(...e){try{return t.apply(null,e)}catch{}}}function R0(t,e){if(ui(t),typeof e!="function")throw new Error("checksum fn should be function");return{encode(r){if(!(r instanceof Uint8Array))throw new Error("checksum.encode: input should be Uint8Array");let n=e(r).slice(0,t),i=new Uint8Array(r.length+t);return i.set(r),i.set(n,r.length),i},decode(r){if(!(r instanceof Uint8Array))throw new Error("checksum.decode: input should be Uint8Array");let n=r.slice(0,-t),i=e(n).slice(0,t),o=r.slice(-t);for(let a=0;a<t;a++)if(i[a]!==o[a])throw new Error("Invalid checksum");return n}}}Le.utils={alphabet:En,chain:gn,checksum:R0,radix:q0,radix2:Yn,join:In,padding:pa};Le.base16=gn(Yn(4),En("0123456789ABCDEF"),In(""));Le.base32=gn(Yn(5),En("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),pa(5),In(""));Le.base32hex=gn(Yn(5),En("0123456789ABCDEFGHIJKLMNOPQRSTUV"),pa(5),In(""));Le.base32crockford=gn(Yn(5),En("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),In(""),k0(t=>t.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));Le.base64=gn(Yn(6),En("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),pa(6),In(""));Le.base64url=gn(Yn(6),En("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),pa(6),In(""));var Mc=t=>gn(q0(58),En(t),In(""));Le.base58=Mc("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");Le.base58flickr=Mc("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ");Le.base58xrp=Mc("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");var T0=[0,2,3,5,6,7,9,10,11];Le.base58xmr={encode(t){let e="";for(let r=0;r<t.length;r+=8){let n=t.subarray(r,r+8);e+=Le.base58.encode(n).padStart(T0[n.length],"1")}return e},decode(t){let e=[];for(let r=0;r<t.length;r+=11){let n=t.slice(r,r+11),i=T0.indexOf(n.length),o=Le.base58.decode(n);for(let a=0;a<o.length-i;a++)if(o[a]!==0)throw new Error("base58xmr: wrong padding");e=e.concat(Array.from(o.slice(o.length-i)))}return Uint8Array.from(e)}};var jg=t=>gn(R0(4,e=>t(t(e))),Le.base58);Le.base58check=jg;var Ac=gn(En("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),In("")),O0=[996825010,642813549,513874426,1027748829,705979059];function ha(t){let e=t>>25,r=(t&33554431)<<5;for(let n=0;n<O0.length;n++)(e>>n&1)===1&&(r^=O0[n]);return r}function C0(t,e,r=1){let n=t.length,i=1;for(let o=0;o<n;o++){let a=t.charCodeAt(o);if(a<33||a>126)throw new Error(`Invalid prefix (${t})`);i=ha(i)^a>>5}i=ha(i);for(let o=0;o<n;o++)i=ha(i)^t.charCodeAt(o)&31;for(let o of e)i=ha(i)^o;for(let o=0;o<6;o++)i=ha(i);return i^=r,Ac.encode(Bc([i%2**30],30,5,!1))}function N0(t){let e=t==="bech32"?1:734539939,r=Yn(5),n=r.decode,i=r.encode,o=P0(n);function a(w,p,M=90){if(typeof w!="string")throw new Error(`bech32.encode prefix should be string, not ${typeof w}`);if(!Array.isArray(p)||p.length&&typeof p[0]!="number")throw new Error(`bech32.encode words should be array of numbers, not ${typeof p}`);let A=w.length+7+p.length;if(M!==!1&&A>M)throw new TypeError(`Length ${A} exceeds limit ${M}`);return w=w.toLowerCase(),`${w}1${Ac.encode(p)}${C0(w,p,e)}`}function s(w,p=90){if(typeof w!="string")throw new Error(`bech32.decode input should be string, not ${typeof w}`);if(w.length<8||p!==!1&&w.length>p)throw new TypeError(`Wrong string length: ${w.length} (${w}). Expected (8..${p})`);let M=w.toLowerCase();if(w!==M&&w!==w.toUpperCase())throw new Error("String must be lowercase or uppercase");w=M;let A=w.lastIndexOf("1");if(A===0||A===-1)throw new Error('Letter "1" must be present between prefix and data only');let[P,E]=[w.slice(0,A),w.slice(A+1)];if(E.length<6)throw new Error("Data must be at least 6 characters long");let q=Ac.decode(E).slice(0,-6),z=C0(P,q,e);if(!E.endsWith(z))throw new Error(`Invalid checksum in ${w}: expected "${z}"`);return{prefix:P,words:q}}let u=P0(s);function h(w){let{prefix:p,words:M}=s(w,!1);return{prefix:p,words:M,bytes:n(M)}}return{encode:a,decode:s,decodeToBytes:h,decodeUnsafe:u,fromWords:n,fromWordsUnsafe:o,toWords:i}}Le.bech32=N0("bech32");Le.bech32m=N0("bech32m");Le.utf8={encode:t=>new TextDecoder().decode(t),decode:t=>new TextEncoder().encode(t)};Le.hex=gn(Yn(4),En("0123456789abcdef"),In(""),k0(t=>{if(typeof t!="string"||t.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof t} with length ${t.length}`);return t.toLowerCase()}));var ba={utf8:Le.utf8,hex:Le.hex,base16:Le.base16,base32:Le.base32,base64:Le.base64,base64url:Le.base64url,base58:Le.base58,base58xmr:Le.base58xmr},L0=`Invalid encoding type. Available types: ${Object.keys(ba).join(", ")}`,Hg=(t,e)=>{if(typeof t!="string"||!ba.hasOwnProperty(t))throw new TypeError(L0);if(!(e instanceof Uint8Array))throw new TypeError("bytesToString() expects Uint8Array");return ba[t].encode(e)};Le.bytesToString=Hg;Le.str=Le.bytesToString;var Kg=(t,e)=>{if(!ba.hasOwnProperty(t))throw new TypeError(L0);if(typeof e!="string")throw new TypeError("stringToBytes() expects string");return ba[t].decode(e)};Le.stringToBytes=Kg;Le.bytes=Le.stringToBytes});var j0=W(ci=>{"use strict";x();S();Object.defineProperty(ci,"__esModule",{value:!0});ci.base58=ci.fromBase58=ci.toBase58=void 0;var Ec=Xi();Object.defineProperty(ci,"base58",{enumerable:!0,get:function(){return Ec.base58}});function Dg(t){let e=v.Buffer.from(t);return Ec.base58.encode(Uint8Array.from(e))}ci.toBase58=Dg;function Vg(t){return Ec.base58.decode(t)}ci.fromBase58=Vg});var H0=W(df=>{"use strict";x();S();Object.defineProperty(df,"__esModule",{value:!0});df.crypto=void 0;df.crypto={node:void 0,web:typeof self=="object"&&"crypto"in self?self.crypto:void 0}});var vr=W((Ze,ga)=>{"use strict";x();S();Object.defineProperty(Ze,"__esModule",{value:!0});Ze.randomBytes=Ze.wrapConstructorWithOpts=Ze.wrapConstructor=Ze.checkOpts=Ze.Hash=Ze.assertHash=Ze.assertBytes=Ze.assertBool=Ze.assertNumber=Ze.concatBytes=Ze.toBytes=Ze.utf8ToBytes=Ze.asyncLoop=Ze.nextTick=Ze.hexToBytes=Ze.bytesToHex=Ze.isLE=Ze.rotr=Ze.createView=Ze.u32=Ze.u8=void 0;var hf=H0(),Fg=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength);Ze.u8=Fg;var zg=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4));Ze.u32=zg;var Wg=t=>new DataView(t.buffer,t.byteOffset,t.byteLength);Ze.createView=Wg;var $g=(t,e)=>t<<32-e|t>>>e;Ze.rotr=$g;Ze.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Ze.isLE)throw new Error("Non little-endian hardware is not supported");var Gg=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Zg(t){let e="";for(let r=0;r<t.length;r++)e+=Gg[t[r]];return e}Ze.bytesToHex=Zg;function Yg(t){if(typeof t!="string")throw new TypeError("hexToBytes: expected string, got "+typeof t);if(t.length%2)throw new Error("hexToBytes: received invalid unpadded hex");let e=new Uint8Array(t.length/2);for(let r=0;r<e.length;r++){let n=r*2,i=t.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o))throw new Error("Invalid byte sequence");e[r]=o}return e}Ze.hexToBytes=Yg;Ze.nextTick=(()=>{let t=typeof ga<"u"&&typeof ga.require=="function"&&ga.require.bind(ga);try{if(t){let{setImmediate:e}=t("timers");return()=>new Promise(r=>e(r))}}catch{}return()=>new Promise(e=>setTimeout(e,0))})();async function Xg(t,e,r){let n=Date.now();for(let i=0;i<t;i++){r(i);let o=Date.now()-n;o>=0&&o<e||(await(0,Ze.nextTick)(),n+=o)}}Ze.asyncLoop=Xg;function K0(t){if(typeof t!="string")throw new TypeError(`utf8ToBytes expected string, got ${typeof t}`);return new TextEncoder().encode(t)}Ze.utf8ToBytes=K0;function Tc(t){if(typeof t=="string"&&(t=K0(t)),!(t instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof t})`);return t}Ze.toBytes=Tc;function Qg(...t){if(!t.every(n=>n instanceof Uint8Array))throw new Error("Uint8Array list expected");if(t.length===1)return t[0];let e=t.reduce((n,i)=>n+i.length,0),r=new Uint8Array(e);for(let n=0,i=0;n<t.length;n++){let o=t[n];r.set(o,i),i+=o.length}return r}Ze.concatBytes=Qg;function Ic(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}Ze.assertNumber=Ic;function Jg(t){if(typeof t!="boolean")throw new Error(`Expected boolean, not ${t}`)}Ze.assertBool=Jg;function e6(t,...e){if(!(t instanceof Uint8Array&&(!e.length||e.includes(t.length))))throw new TypeError(`Expected ${e} bytes, not ${typeof t} with length=${t.length}`)}Ze.assertBytes=e6;function t6(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Ic(t.outputLen),Ic(t.blockLen)}Ze.assertHash=t6;var Pc=class{clone(){return this._cloneInto()}};Ze.Hash=Pc;var r6=t=>Object.prototype.toString.call(t)==="[object Object]"&&t.constructor===Object;function n6(t,e){if(e!==void 0&&(typeof e!="object"||!r6(e)))throw new TypeError("Options should be object or undefined");return Object.assign(t,e)}Ze.checkOpts=n6;function i6(t){let e=n=>t().update(Tc(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}Ze.wrapConstructor=i6;function o6(t){let e=(n,i)=>t(i).update(Tc(n)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=n=>t(n),e}Ze.wrapConstructorWithOpts=o6;function s6(t=32){if(hf.crypto.web)return hf.crypto.web.getRandomValues(new Uint8Array(t));if(hf.crypto.node)return new Uint8Array(hf.crypto.node.randomBytes(t).buffer);throw new Error("The environment doesn't have randomBytes function")}Ze.randomBytes=s6});var pf=W(bf=>{"use strict";x();S();Object.defineProperty(bf,"__esModule",{value:!0});bf.SHA2=void 0;var ya=vr();function a6(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let i=BigInt(32),o=BigInt(4294967295),a=Number(r>>i&o),s=Number(r&o),u=n?4:0,h=n?0:4;t.setUint32(e+u,a,n),t.setUint32(e+h,s,n)}var Oc=class extends ya.Hash{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,ya.createView)(this.buffer)}update(e){if(this.destroyed)throw new Error("instance is destroyed");let{view:r,buffer:n,blockLen:i,finished:o}=this;if(o)throw new Error("digest() was already called");e=(0,ya.toBytes)(e);let a=e.length;for(let s=0;s<a;){let u=Math.min(i-this.pos,a-s);if(u===i){let h=(0,ya.createView)(e);for(;i<=a-s;s+=i)this.process(h,s);continue}n.set(e.subarray(s,s+u),this.pos),this.pos+=u,s+=u,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){if(this.destroyed)throw new Error("instance is destroyed");if(!(e instanceof Uint8Array)||e.length<this.outputLen)throw new Error("_Sha2: Invalid output buffer");if(this.finished)throw new Error("digest() was already called");this.finished=!0;let{buffer:r,view:n,blockLen:i,isLE:o}=this,{pos:a}=this;r[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>i-a&&(this.process(n,0),a=0);for(let u=a;u<i;u++)r[u]=0;a6(n,i-8,BigInt(this.length*8),o),this.process(n,0);let s=(0,ya.createView)(e);this.get().forEach((u,h)=>s.setUint32(4*h,u,o))}digest(){let{buffer:e,outputLen:r}=this;this.digestInto(e);let n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:r,buffer:n,length:i,finished:o,destroyed:a,pos:s}=this;return e.length=i,e.pos=s,e.finished=o,e.destroyed=a,i%r&&e.buffer.set(n),e}};bf.SHA2=Oc});var Eo=W(gf=>{"use strict";x();S();Object.defineProperty(gf,"__esModule",{value:!0});gf.sha256=void 0;var f6=pf(),yn=vr(),u6=(t,e,r)=>t&e^~t&r,c6=(t,e,r)=>t&e^t&r^e&r,l6=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),li=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),di=new Uint32Array(64),Cc=class extends f6.SHA2{constructor(){super(64,32,8,!1),this.A=li[0]|0,this.B=li[1]|0,this.C=li[2]|0,this.D=li[3]|0,this.E=li[4]|0,this.F=li[5]|0,this.G=li[6]|0,this.H=li[7]|0}get(){let{A:e,B:r,C:n,D:i,E:o,F:a,G:s,H:u}=this;return[e,r,n,i,o,a,s,u]}set(e,r,n,i,o,a,s,u){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=o|0,this.F=a|0,this.G=s|0,this.H=u|0}process(e,r){for(let p=0;p<16;p++,r+=4)di[p]=e.getUint32(r,!1);for(let p=16;p<64;p++){let M=di[p-15],A=di[p-2],P=(0,yn.rotr)(M,7)^(0,yn.rotr)(M,18)^M>>>3,E=(0,yn.rotr)(A,17)^(0,yn.rotr)(A,19)^A>>>10;di[p]=E+di[p-7]+P+di[p-16]|0}let{A:n,B:i,C:o,D:a,E:s,F:u,G:h,H:w}=this;for(let p=0;p<64;p++){let M=(0,yn.rotr)(s,6)^(0,yn.rotr)(s,11)^(0,yn.rotr)(s,25),A=w+M+u6(s,u,h)+l6[p]+di[p]|0,E=((0,yn.rotr)(n,2)^(0,yn.rotr)(n,13)^(0,yn.rotr)(n,22))+c6(n,i,o)|0;w=h,h=u,u=s,s=a+A|0,a=o,o=i,i=n,n=A+E|0}n=n+this.A|0,i=i+this.B|0,o=o+this.C|0,a=a+this.D|0,s=s+this.E|0,u=u+this.F|0,h=h+this.G|0,w=w+this.H|0,this.set(n,i,o,a,s,u,h,w)}roundClean(){di.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};gf.sha256=(0,yn.wrapConstructor)(()=>new Cc)});var Io=W(Ye=>{"use strict";x();S();Object.defineProperty(Ye,"__esModule",{value:!0});Ye.add5H=Ye.add5L=Ye.add4H=Ye.add4L=Ye.add3H=Ye.add3L=Ye.add=Ye.rotlBL=Ye.rotlBH=Ye.rotlSL=Ye.rotlSH=Ye.rotr32L=Ye.rotr32H=Ye.rotrBL=Ye.rotrBH=Ye.rotrSL=Ye.rotrSH=Ye.shrSL=Ye.shrSH=Ye.toBig=Ye.split=Ye.fromBig=void 0;var yf=BigInt(2**32-1),kc=BigInt(32);function D0(t,e=!1){return e?{h:Number(t&yf),l:Number(t>>kc&yf)}:{h:Number(t>>kc&yf)|0,l:Number(t&yf)|0}}Ye.fromBig=D0;function d6(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;i<t.length;i++){let{h:o,l:a}=D0(t[i],e);[r[i],n[i]]=[o,a]}return[r,n]}Ye.split=d6;var h6=(t,e)=>BigInt(t>>>0)<<kc|BigInt(e>>>0);Ye.toBig=h6;var b6=(t,e,r)=>t>>>r;Ye.shrSH=b6;var p6=(t,e,r)=>t<<32-r|e>>>r;Ye.shrSL=p6;var g6=(t,e,r)=>t>>>r|e<<32-r;Ye.rotrSH=g6;var y6=(t,e,r)=>t<<32-r|e>>>r;Ye.rotrSL=y6;var m6=(t,e,r)=>t<<64-r|e>>>r-32;Ye.rotrBH=m6;var v6=(t,e,r)=>t>>>r-32|e<<64-r;Ye.rotrBL=v6;var w6=(t,e)=>e;Ye.rotr32H=w6;var _6=(t,e)=>t;Ye.rotr32L=_6;var x6=(t,e,r)=>t<<r|e>>>32-r;Ye.rotlSH=x6;var S6=(t,e,r)=>e<<r|t>>>32-r;Ye.rotlSL=S6;var B6=(t,e,r)=>e<<r-32|t>>>64-r;Ye.rotlBH=B6;var A6=(t,e,r)=>t<<r-32|e>>>64-r;Ye.rotlBL=A6;function M6(t,e,r,n){let i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}Ye.add=M6;var E6=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0);Ye.add3L=E6;var I6=(t,e,r,n)=>e+r+n+(t/2**32|0)|0;Ye.add3H=I6;var P6=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0);Ye.add4L=P6;var T6=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0;Ye.add4H=T6;var O6=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0);Ye.add5L=O6;var C6=(t,e,r,n,i,o)=>e+r+n+i+o+(t/2**32|0)|0;Ye.add5H=C6});var mf=W(Mr=>{"use strict";x();S();var k6=Mr&&Mr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),U6=Mr&&Mr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),q6=Mr&&Mr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&k6(e,t,r);return U6(e,t),e};Object.defineProperty(Mr,"__esModule",{value:!0});Mr.sha384=Mr.sha512_256=Mr.sha512=Mr.SHA512=void 0;var R6=pf(),it=q6(Io()),Rc=vr(),[N6,L6]=it.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(t=>BigInt(t))),hi=new Uint32Array(80),bi=new Uint32Array(80),Po=class extends R6.SHA2{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:e,Al:r,Bh:n,Bl:i,Ch:o,Cl:a,Dh:s,Dl:u,Eh:h,El:w,Fh:p,Fl:M,Gh:A,Gl:P,Hh:E,Hl:q}=this;return[e,r,n,i,o,a,s,u,h,w,p,M,A,P,E,q]}set(e,r,n,i,o,a,s,u,h,w,p,M,A,P,E,q){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=o|0,this.Cl=a|0,this.Dh=s|0,this.Dl=u|0,this.Eh=h|0,this.El=w|0,this.Fh=p|0,this.Fl=M|0,this.Gh=A|0,this.Gl=P|0,this.Hh=E|0,this.Hl=q|0}process(e,r){for(let $=0;$<16;$++,r+=4)hi[$]=e.getUint32(r),bi[$]=e.getUint32(r+=4);for(let $=16;$<80;$++){let ee=hi[$-15]|0,Y=bi[$-15]|0,Z=it.rotrSH(ee,Y,1)^it.rotrSH(ee,Y,8)^it.shrSH(ee,Y,7),ne=it.rotrSL(ee,Y,1)^it.rotrSL(ee,Y,8)^it.shrSL(ee,Y,7),re=hi[$-2]|0,ye=bi[$-2]|0,U=it.rotrSH(re,ye,19)^it.rotrBH(re,ye,61)^it.shrSH(re,ye,6),f=it.rotrSL(re,ye,19)^it.rotrBL(re,ye,61)^it.shrSL(re,ye,6),b=it.add4L(ne,f,bi[$-7],bi[$-16]),g=it.add4H(b,Z,U,hi[$-7],hi[$-16]);hi[$]=g|0,bi[$]=b|0}let{Ah:n,Al:i,Bh:o,Bl:a,Ch:s,Cl:u,Dh:h,Dl:w,Eh:p,El:M,Fh:A,Fl:P,Gh:E,Gl:q,Hh:z,Hl:J}=this;for(let $=0;$<80;$++){let ee=it.rotrSH(p,M,14)^it.rotrSH(p,M,18)^it.rotrBH(p,M,41),Y=it.rotrSL(p,M,14)^it.rotrSL(p,M,18)^it.rotrBL(p,M,41),Z=p&A^~p&E,ne=M&P^~M&q,re=it.add5L(J,Y,ne,L6[$],bi[$]),ye=it.add5H(re,z,ee,Z,N6[$],hi[$]),U=re|0,f=it.rotrSH(n,i,28)^it.rotrBH(n,i,34)^it.rotrBH(n,i,39),b=it.rotrSL(n,i,28)^it.rotrBL(n,i,34)^it.rotrBL(n,i,39),g=n&o^n&s^o&s,d=i&a^i&u^a&u;z=E|0,J=q|0,E=A|0,q=P|0,A=p|0,P=M|0,{h:p,l:M}=it.add(h|0,w|0,ye|0,U|0),h=s|0,w=u|0,s=o|0,u=a|0,o=n|0,a=i|0;let _=it.add3L(U,b,d);n=it.add3H(_,ye,f,g),i=_|0}({h:n,l:i}=it.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:o,l:a}=it.add(this.Bh|0,this.Bl|0,o|0,a|0),{h:s,l:u}=it.add(this.Ch|0,this.Cl|0,s|0,u|0),{h,l:w}=it.add(this.Dh|0,this.Dl|0,h|0,w|0),{h:p,l:M}=it.add(this.Eh|0,this.El|0,p|0,M|0),{h:A,l:P}=it.add(this.Fh|0,this.Fl|0,A|0,P|0),{h:E,l:q}=it.add(this.Gh|0,this.Gl|0,E|0,q|0),{h:z,l:J}=it.add(this.Hh|0,this.Hl|0,z|0,J|0),this.set(n,i,o,a,s,u,h,w,p,M,A,P,E,q,z,J)}roundClean(){hi.fill(0),bi.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)}};Mr.SHA512=Po;var Uc=class extends Po{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}},qc=class extends Po{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}};Mr.sha512=(0,Rc.wrapConstructor)(()=>new Po);Mr.sha512_256=(0,Rc.wrapConstructor)(()=>new Uc);Mr.sha384=(0,Rc.wrapConstructor)(()=>new qc)});var jc=W(To=>{"use strict";x();S();Object.defineProperty(To,"__esModule",{value:!0});To.ripemd160=To.RIPEMD160=void 0;var j6=pf(),H6=vr(),K6=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),F0=Uint8Array.from({length:16},(t,e)=>e),D6=F0.map(t=>(9*t+5)%16),Nc=[F0],Lc=[D6];for(let t=0;t<4;t++)for(let e of[Nc,Lc])e.push(e[t].map(r=>K6[r]));var z0=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(t=>new Uint8Array(t)),V6=Nc.map((t,e)=>t.map(r=>z0[e][r])),F6=Lc.map((t,e)=>t.map(r=>z0[e][r])),z6=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),W6=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),vf=(t,e)=>t<<e|t>>>32-e;function V0(t,e,r,n){return t===0?e^r^n:t===1?e&r|~e&n:t===2?(e|~r)^n:t===3?e&n|r&~n:e^(r|~n)}var wf=new Uint32Array(16),_f=class extends j6.SHA2{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){let{h0:e,h1:r,h2:n,h3:i,h4:o}=this;return[e,r,n,i,o]}set(e,r,n,i,o){this.h0=e|0,this.h1=r|0,this.h2=n|0,this.h3=i|0,this.h4=o|0}process(e,r){for(let A=0;A<16;A++,r+=4)wf[A]=e.getUint32(r,!0);let n=this.h0|0,i=n,o=this.h1|0,a=o,s=this.h2|0,u=s,h=this.h3|0,w=h,p=this.h4|0,M=p;for(let A=0;A<5;A++){let P=4-A,E=z6[A],q=W6[A],z=Nc[A],J=Lc[A],$=V6[A],ee=F6[A];for(let Y=0;Y<16;Y++){let Z=vf(n+V0(A,o,s,h)+wf[z[Y]]+E,$[Y])+p|0;n=p,p=h,h=vf(s,10)|0,s=o,o=Z}for(let Y=0;Y<16;Y++){let Z=vf(i+V0(P,a,u,w)+wf[J[Y]]+q,ee[Y])+M|0;i=M,M=w,w=vf(u,10)|0,u=a,a=Z}}this.set(this.h1+s+w|0,this.h2+h+M|0,this.h3+p+i|0,this.h4+n+a|0,this.h0+o+u|0)}roundClean(){wf.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}};To.RIPEMD160=_f;To.ripemd160=(0,H6.wrapConstructor)(()=>new _f)});var xf=W(vt=>{"use strict";x();S();var $6=vt&&vt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),G6=vt&&vt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Z6=vt&&vt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&$6(e,t,r);return G6(e,t),e};Object.defineProperty(vt,"__esModule",{value:!0});vt.shake256=vt.shake128=vt.keccak_512=vt.keccak_384=vt.keccak_256=vt.keccak_224=vt.sha3_512=vt.sha3_384=vt.sha3_256=vt.sha3_224=vt.Keccak=vt.keccakP=void 0;var va=Z6(Io()),Qi=vr(),[G0,Z0,Y0]=[[],[],[]],Y6=BigInt(0),ma=BigInt(1),X6=BigInt(2),Q6=BigInt(7),J6=BigInt(256),ey=BigInt(113);for(let t=0,e=ma,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],G0.push(2*(5*n+r)),Z0.push((t+1)*(t+2)/2%64);let i=Y6;for(let o=0;o<7;o++)e=(e<<ma^(e>>Q6)*ey)%J6,e&X6&&(i^=ma<<(ma<<BigInt(o))-ma);Y0.push(i)}var[ty,ry]=va.split(Y0,!0),W0=(t,e,r)=>r>32?va.rotlBH(t,e,r):va.rotlSH(t,e,r),$0=(t,e,r)=>r>32?va.rotlBL(t,e,r):va.rotlSL(t,e,r);function X0(t,e=24){let r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let a=0;a<10;a++)r[a]=t[a]^t[a+10]^t[a+20]^t[a+30]^t[a+40];for(let a=0;a<10;a+=2){let s=(a+8)%10,u=(a+2)%10,h=r[u],w=r[u+1],p=W0(h,w,1)^r[s],M=$0(h,w,1)^r[s+1];for(let A=0;A<50;A+=10)t[a+A]^=p,t[a+A+1]^=M}let i=t[2],o=t[3];for(let a=0;a<24;a++){let s=Z0[a],u=W0(i,o,s),h=$0(i,o,s),w=G0[a];i=t[w],o=t[w+1],t[w]=u,t[w+1]=h}for(let a=0;a<50;a+=10){for(let s=0;s<10;s++)r[s]=t[a+s];for(let s=0;s<10;s++)t[a+s]^=~r[(s+2)%10]&r[(s+4)%10]}t[0]^=ty[n],t[1]^=ry[n]}r.fill(0)}vt.keccakP=X0;var Ji=class extends Qi.Hash{constructor(e,r,n,i=!1,o=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,Qi.assertNumber)(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,Qi.u32)(this.state)}keccak(){X0(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){if(this.destroyed)throw new Error("instance is destroyed");if(this.finished)throw new Error("digest() was already called");let{blockLen:r,state:n}=this;e=(0,Qi.toBytes)(e);let i=e.length;for(let o=0;o<i;){let a=Math.min(r-this.pos,i-o);for(let s=0;s<a;s++)n[this.pos++]^=e[o++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:r,pos:n,blockLen:i}=this;e[n]^=r,(r&128)!==0&&n===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){if(this.destroyed)throw new Error("instance is destroyed");if(!(e instanceof Uint8Array))throw new Error("Keccak: invalid output buffer");this.finish();for(let r=0,n=e.length;r<n;){this.posOut>=this.blockLen&&this.keccak();let i=Math.min(this.blockLen-this.posOut,n-r);e.set(this.state.subarray(this.posOut,this.posOut+i),r),this.posOut+=i,r+=i}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,Qi.assertNumber)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(e.length<this.outputLen)throw new Error("Keccak: invalid output buffer");if(this.finished)throw new Error("digest() was already called");return this.finish(),this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){let{blockLen:r,suffix:n,outputLen:i,rounds:o,enableXOF:a}=this;return e||(e=new Ji(r,n,i,a,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=n,e.outputLen=i,e.enableXOF=a,e.destroyed=this.destroyed,e}};vt.Keccak=Ji;var pi=(t,e,r)=>(0,Qi.wrapConstructor)(()=>new Ji(e,t,r));vt.sha3_224=pi(6,144,224/8);vt.sha3_256=pi(6,136,256/8);vt.sha3_384=pi(6,104,384/8);vt.sha3_512=pi(6,72,512/8);vt.keccak_224=pi(1,144,224/8);vt.keccak_256=pi(1,136,256/8);vt.keccak_384=pi(1,104,384/8);vt.keccak_512=pi(1,72,512/8);var Q0=(t,e,r)=>(0,Qi.wrapConstructorWithOpts)((n={})=>new Ji(e,t,n.dkLen!==void 0?n.dkLen:r,!0));vt.shake128=Q0(31,168,128/8);vt.shake256=Q0(31,136,256/8)});var Sf=W(Oo=>{"use strict";x();S();Object.defineProperty(Oo,"__esModule",{value:!0});Oo.BLAKE2=Oo.SIGMA=void 0;var eo=vr();Oo.SIGMA=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3]);var Hc=class extends eo.Hash{constructor(e,r,n={},i,o,a){if(super(),this.blockLen=e,this.outputLen=r,this.length=0,this.pos=0,this.finished=!1,this.destroyed=!1,(0,eo.assertNumber)(e),(0,eo.assertNumber)(r),(0,eo.assertNumber)(i),r<0||r>i)throw new Error("Blake2: outputLen bigger than keyLen");if(n.key!==void 0&&(n.key.length<1||n.key.length>i))throw new Error(`Key should be up 1..${i} byte long or undefined`);if(n.salt!==void 0&&n.salt.length!==o)throw new Error(`Salt should be ${o} byte long or undefined`);if(n.personalization!==void 0&&n.personalization.length!==a)throw new Error(`Personalization should be ${a} byte long or undefined`);this.buffer32=(0,eo.u32)(this.buffer=new Uint8Array(e))}update(e){if(this.destroyed)throw new Error("instance is destroyed");let{finished:r,blockLen:n,buffer:i,buffer32:o}=this;if(r)throw new Error("digest() was already called");e=(0,eo.toBytes)(e);let a=e.length;for(let s=0;s<a;){this.pos===n&&(this.compress(o,0,!1),this.pos=0);let u=Math.min(n-this.pos,a-s),h=e.byteOffset+s;if(u===n&&!(h%4)&&s+u<a){let w=new Uint32Array(e.buffer,h,Math.floor((a-s)/4));for(let p=0;s+n<a;p+=o.length,s+=n)this.length+=n,this.compress(w,p,!1);continue}i.set(e.subarray(s,s+u),this.pos),this.pos+=u,this.length+=u,s+=u}return this}digestInto(e){if(this.destroyed)throw new Error("instance is destroyed");if(!(e instanceof Uint8Array)||e.length<this.outputLen)throw new Error("_Blake2: Invalid output buffer");let{finished:r,pos:n,buffer32:i}=this;if(r)throw new Error("digest() was already called");this.finished=!0,this.buffer.subarray(n).fill(0),this.compress(i,0,!0);let o=(0,eo.u32)(e);this.get().forEach((a,s)=>o[s]=a)}digest(){let{buffer:e,outputLen:r}=this;this.digestInto(e);let n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){let{buffer:r,length:n,finished:i,destroyed:o,outputLen:a,pos:s}=this;return e||(e=new this.constructor({dkLen:a})),e.set(...this.get()),e.length=n,e.finished=i,e.destroyed=o,e.outputLen=a,e.buffer.set(r),e.pos=s,e}};Oo.BLAKE2=Hc});var Dc=W(Pn=>{"use strict";x();S();var ny=Pn&&Pn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),iy=Pn&&Pn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),eh=Pn&&Pn.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&ny(e,t,r);return iy(e,t),e};Object.defineProperty(Pn,"__esModule",{value:!0});Pn.blake2b=void 0;var J0=eh(Sf()),qr=eh(Io()),Co=vr(),ar=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),Me=new Uint32Array(32);function gi(t,e,r,n,i,o){let a=i[o],s=i[o+1],u=Me[2*t],h=Me[2*t+1],w=Me[2*e],p=Me[2*e+1],M=Me[2*r],A=Me[2*r+1],P=Me[2*n],E=Me[2*n+1],q=qr.add3L(u,w,a);h=qr.add3H(q,h,p,s),u=q|0,{Dh:E,Dl:P}={Dh:E^h,Dl:P^u},{Dh:E,Dl:P}={Dh:qr.rotr32H(E,P),Dl:qr.rotr32L(E,P)},{h:A,l:M}=qr.add(A,M,E,P),{Bh:p,Bl:w}={Bh:p^A,Bl:w^M},{Bh:p,Bl:w}={Bh:qr.rotrSH(p,w,24),Bl:qr.rotrSL(p,w,24)},Me[2*t]=u,Me[2*t+1]=h,Me[2*e]=w,Me[2*e+1]=p,Me[2*r]=M,Me[2*r+1]=A,Me[2*n]=P,Me[2*n+1]=E}function yi(t,e,r,n,i,o){let a=i[o],s=i[o+1],u=Me[2*t],h=Me[2*t+1],w=Me[2*e],p=Me[2*e+1],M=Me[2*r],A=Me[2*r+1],P=Me[2*n],E=Me[2*n+1],q=qr.add3L(u,w,a);h=qr.add3H(q,h,p,s),u=q|0,{Dh:E,Dl:P}={Dh:E^h,Dl:P^u},{Dh:E,Dl:P}={Dh:qr.rotrSH(E,P,16),Dl:qr.rotrSL(E,P,16)},{h:A,l:M}=qr.add(A,M,E,P),{Bh:p,Bl:w}={Bh:p^A,Bl:w^M},{Bh:p,Bl:w}={Bh:qr.rotrBH(p,w,63),Bl:qr.rotrBL(p,w,63)},Me[2*t]=u,Me[2*t+1]=h,Me[2*e]=w,Me[2*e+1]=p,Me[2*r]=M,Me[2*r+1]=A,Me[2*n]=P,Me[2*n+1]=E}var Kc=class extends J0.BLAKE2{constructor(e={}){super(128,e.dkLen===void 0?64:e.dkLen,e,64,16,16),this.v0l=ar[0]|0,this.v0h=ar[1]|0,this.v1l=ar[2]|0,this.v1h=ar[3]|0,this.v2l=ar[4]|0,this.v2h=ar[5]|0,this.v3l=ar[6]|0,this.v3h=ar[7]|0,this.v4l=ar[8]|0,this.v4h=ar[9]|0,this.v5l=ar[10]|0,this.v5h=ar[11]|0,this.v6l=ar[12]|0,this.v6h=ar[13]|0,this.v7l=ar[14]|0,this.v7h=ar[15]|0;let r=e.key?e.key.length:0;if(this.v0l^=this.outputLen|r<<8|1<<16|1<<24,e.salt){let n=(0,Co.u32)((0,Co.toBytes)(e.salt));this.v4l^=n[0],this.v4h^=n[1],this.v5l^=n[2],this.v5h^=n[3]}if(e.personalization){let n=(0,Co.u32)((0,Co.toBytes)(e.personalization));this.v6l^=n[0],this.v6h^=n[1],this.v7l^=n[2],this.v7h^=n[3]}if(e.key){let n=new Uint8Array(this.blockLen);n.set((0,Co.toBytes)(e.key)),this.update(n)}}get(){let{v0l:e,v0h:r,v1l:n,v1h:i,v2l:o,v2h:a,v3l:s,v3h:u,v4l:h,v4h:w,v5l:p,v5h:M,v6l:A,v6h:P,v7l:E,v7h:q}=this;return[e,r,n,i,o,a,s,u,h,w,p,M,A,P,E,q]}set(e,r,n,i,o,a,s,u,h,w,p,M,A,P,E,q){this.v0l=e|0,this.v0h=r|0,this.v1l=n|0,this.v1h=i|0,this.v2l=o|0,this.v2h=a|0,this.v3l=s|0,this.v3h=u|0,this.v4l=h|0,this.v4h=w|0,this.v5l=p|0,this.v5h=M|0,this.v6l=A|0,this.v6h=P|0,this.v7l=E|0,this.v7h=q|0}compress(e,r,n){this.get().forEach((u,h)=>Me[h]=u),Me.set(ar,16);let{h:i,l:o}=qr.fromBig(BigInt(this.length));Me[24]=ar[8]^o,Me[25]=ar[9]^i,n&&(Me[28]=~Me[28],Me[29]=~Me[29]);let a=0,s=J0.SIGMA;for(let u=0;u<12;u++)gi(0,4,8,12,e,r+2*s[a++]),yi(0,4,8,12,e,r+2*s[a++]),gi(1,5,9,13,e,r+2*s[a++]),yi(1,5,9,13,e,r+2*s[a++]),gi(2,6,10,14,e,r+2*s[a++]),yi(2,6,10,14,e,r+2*s[a++]),gi(3,7,11,15,e,r+2*s[a++]),yi(3,7,11,15,e,r+2*s[a++]),gi(0,5,10,15,e,r+2*s[a++]),yi(0,5,10,15,e,r+2*s[a++]),gi(1,6,11,12,e,r+2*s[a++]),yi(1,6,11,12,e,r+2*s[a++]),gi(2,7,8,13,e,r+2*s[a++]),yi(2,7,8,13,e,r+2*s[a++]),gi(3,4,9,14,e,r+2*s[a++]),yi(3,4,9,14,e,r+2*s[a++]);this.v0l^=Me[0]^Me[16],this.v0h^=Me[1]^Me[17],this.v1l^=Me[2]^Me[18],this.v1h^=Me[3]^Me[19],this.v2l^=Me[4]^Me[20],this.v2h^=Me[5]^Me[21],this.v3l^=Me[6]^Me[22],this.v3h^=Me[7]^Me[23],this.v4l^=Me[8]^Me[24],this.v4h^=Me[9]^Me[25],this.v5l^=Me[10]^Me[26],this.v5h^=Me[11]^Me[27],this.v6l^=Me[12]^Me[28],this.v6h^=Me[13]^Me[29],this.v7l^=Me[14]^Me[30],this.v7h^=Me[15]^Me[31],Me.fill(0)}destroy(){this.destroyed=!0,this.buffer32.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};Pn.blake2b=(0,Co.wrapConstructorWithOpts)(t=>new Kc(t))});var wa=W(qt=>{"use strict";x();S();Object.defineProperty(qt,"__esModule",{value:!0});qt.sha3_512=qt.sha3_256=qt.ripemd160=qt.sha512=qt.sha256=qt.magicHash=qt.blake2=qt.keccak256=qt.keccak=qt.hash160=qt.doubleSha256=void 0;var Bf=Eo();Object.defineProperty(qt,"sha256",{enumerable:!0,get:function(){return Bf.sha256}});var oy=mf();Object.defineProperty(qt,"sha512",{enumerable:!0,get:function(){return oy.sha512}});var rh=jc();Object.defineProperty(qt,"ripemd160",{enumerable:!0,get:function(){return rh.ripemd160}});var ko=xf();Object.defineProperty(qt,"sha3_256",{enumerable:!0,get:function(){return ko.sha3_256}});Object.defineProperty(qt,"sha3_512",{enumerable:!0,get:function(){return ko.sha3_512}});var sy=Dc();function nh(t){let e=(0,Bf.sha256)(t);return(0,Bf.sha256)(e)}qt.doubleSha256=nh;function ay(t){let e=(0,Bf.sha256)(t);return(0,rh.ripemd160)(e)}qt.hash160=ay;var fy=function(t,e=256){let r=v.Buffer.from(t);switch(e){case 224:return v.Buffer.from((0,ko.keccak_224)(r));case 256:return v.Buffer.from((0,ko.keccak_256)(r));case 384:return v.Buffer.from((0,ko.keccak_384)(r));case 512:return v.Buffer.from((0,ko.keccak_512)(r));default:throw new Error(`Invald algorithm: keccak${e}`)}};qt.keccak=fy;var uy=function(t){return(0,qt.keccak)(t)};qt.keccak256=uy;function cy(t,e,r){let n=Math.ceil(e/8);return(0,sy.blake2b)(t,{dkLen:n,key:r})}qt.blake2=cy;function th(t){let e;return t<253?(e=v.Buffer.alloc(1),e.writeUInt8(t,0)):t<65536?(e=v.Buffer.alloc(1+2),e.writeUInt8(253,0),e.writeUInt16LE(t,1)):t<4294967296?(e=v.Buffer.alloc(1+4),e.writeUInt8(254,0),e.writeUInt32LE(t,1)):(e=v.Buffer.alloc(1+8),e.writeUInt8(255,0),e.writeInt32LE(t&-1,1),e.writeUInt32LE(Math.floor(t/4294967296),5)),e}var ly=v.Buffer.from(`Bitcoin Signed Message:
|
||
`);function dy(t,e){let r=e?v.Buffer.from(e,"utf8"):ly,n=th(r.length),i=v.Buffer.from(t),o=th(i.length),a=v.Buffer.concat([n,r,o,i]);return nh(a)}qt.magicHash=dy});var sh=W(Uo=>{"use strict";x();S();Object.defineProperty(Uo,"__esModule",{value:!0});Uo.fromBase58Check=Uo.toBase58Check=void 0;var ih=wa(),MM=xg(),oh=Xi();function hy(t){return(0,oh.base58check)(ih.sha256).encode(v.Buffer.from(t))}Uo.toBase58Check=hy;function by(t){let e=(0,oh.base58check)(ih.sha256);return v.Buffer.from(e.decode(t))}Uo.fromBase58Check=by});var ah=W(qo=>{"use strict";x();S();Object.defineProperty(qo,"__esModule",{value:!0});qo.fromBech32=qo.toBech32=void 0;var Af=Xi();function py(t,e,r){let n=v.Buffer.from(e),i=Af.bech32.toWords(Uint8Array.from(n));return Af.bech32.encode(t,i,r)}qo.toBech32=py;function gy(t,e){let r=Af.bech32.decode(t,e),n=Af.bech32.fromWords(r.words);return[r.prefix,v.Buffer.from(n)]}qo.fromBech32=gy});var fh=W(Tn=>{"use strict";x();S();Object.defineProperty(Tn,"__esModule",{value:!0});Tn.isHexPrefixed=Tn.stripHexPrefix=Tn.fromHex=Tn.toHex=void 0;function yy(t,e=!1){let r=v.Buffer.from(t);return e?"0x"+r.toString("hex"):r.toString("hex")}Tn.toHex=yy;function my(t){return t.startsWith("0x")&&(t=t.substring(2)),v.Buffer.from(t,"hex")}Tn.fromHex=my;function vy(t){return t.startsWith("0x")?t.substring(2):t}Tn.stripHexPrefix=vy;function wy(t){return t.startsWith("0x")}Tn.isHexPrefixed=wy});var ch=W(Ro=>{"use strict";x();S();Object.defineProperty(Ro,"__esModule",{value:!0});Ro.fromBase64=Ro.toBase64=void 0;var uh=Xi();function _y(t){let e=v.Buffer.from(t);return uh.base64.encode(Uint8Array.from(e))}Ro.toBase64=_y;function xy(t){return uh.base64.decode(t)}Ro.fromBase64=xy});var xa=W(_a=>{"use strict";x();S();Object.defineProperty(_a,"__esModule",{value:!0});_a.hmac=void 0;var Mf=vr(),Ef=class extends Mf.Hash{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,(0,Mf.assertHash)(e);let n=(0,Mf.toBytes)(r);if(this.iHash=e.create(),!(this.iHash instanceof Mf.Hash))throw new TypeError("Expected instance of class which extends utils.Hash");let i=this.blockLen=this.iHash.blockLen;this.outputLen=this.iHash.outputLen;let o=new Uint8Array(i);o.set(n.length>this.iHash.blockLen?e.create().update(n).digest():n);for(let a=0;a<o.length;a++)o[a]^=54;this.iHash.update(o),this.oHash=e.create();for(let a=0;a<o.length;a++)o[a]^=106;this.oHash.update(o),o.fill(0)}update(e){if(this.destroyed)throw new Error("instance is destroyed");return this.iHash.update(e),this}digestInto(e){if(this.destroyed)throw new Error("instance is destroyed");if(!(e instanceof Uint8Array)||e.length!==this.outputLen)throw new Error("HMAC: Invalid output buffer");if(this.finished)throw new Error("digest() was already called");this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));let{oHash:r,iHash:n,finished:i,destroyed:o,blockLen:a,outputLen:s}=this;return e=e,e.finished=i,e.destroyed=o,e.blockLen=a,e.outputLen=s,e.oHash=r._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},Sy=(t,e,r)=>new Ef(t,e).update(r).digest();_a.hmac=Sy;_a.hmac.create=(t,e)=>new Ef(t,e)});var hh=W(No=>{"use strict";x();S();Object.defineProperty(No,"__esModule",{value:!0});No.hmacSHA512=No.hmacSHA256=void 0;var lh=xa(),dh=wa();function By(t,e){return v.Buffer.from((0,lh.hmac)(dh.sha256,t,e))}No.hmacSHA256=By;function Ay(t,e){return v.Buffer.from((0,lh.hmac)(dh.sha512,t,e))}No.hmacSHA512=Ay});var bh=W(Lo=>{"use strict";x();S();Object.defineProperty(Lo,"__esModule",{value:!0});Lo.fromUtf8=Lo.toUtf8=void 0;function My(t){return new TextEncoder().encode(t)}Lo.toUtf8=My;function Ey(t){return new TextDecoder("utf-8",{fatal:!0}).decode(t)}Lo.fromUtf8=Ey});var Fc=W(mi=>{"use strict";x();S();Object.defineProperty(mi,"__esModule",{value:!0});mi.checkIsUndefined=mi.checkIsDefined=mi.check=void 0;var Vc=(t,e)=>{if(!t)throw e=e||"Invalid statement",e=e instanceof Error?e:new Error(e),e};mi.check=Vc;var Iy=(t,e)=>(Vc(typeof t<"u",e||"Expect defined but actually undefined"),t);mi.checkIsDefined=Iy;var Py=(t,e)=>{Vc(typeof t>"u",e||`Expect undefined but actually ${t}`)};mi.checkIsUndefined=Py});var gh=W(On=>{"use strict";x();S();Object.defineProperty(On,"__esModule",{value:!0});On.string2BigNumber=On.bigNumber2String=On.fromBigIntHex=On.toBigIntHex=void 0;var ph=Xn(),Ty=Fc(),Oy=t=>{let e=t.integerValue().toString(16);return e="0x"+e,e};On.toBigIntHex=Oy;var Cy=t=>((0,Ty.check)(t&&t.startsWith("0x"),`Invalid hex string. value: ${t}`),new ph.BigNumber(t).integerValue());On.fromBigIntHex=Cy;var ky=(t,e)=>t.integerValue().toString(e);On.bigNumber2String=ky;var Uy=(t,e)=>new ph.BigNumber(t,e);On.string2BigNumber=Uy});var fr=W((yh,zc)=>{x();S();(function(t,e){"use strict";function r(U,f){if(!U)throw new Error(f||"Assertion failed")}function n(U,f){U.super_=f;var b=function(){};b.prototype=f.prototype,U.prototype=new b,U.prototype.constructor=U}function i(U,f,b){if(i.isBN(U))return U;this.negative=0,this.words=null,this.length=0,this.red=null,U!==null&&((f==="le"||f==="be")&&(b=f,f=10),this._init(U||0,f||10,b||"be"))}typeof t=="object"?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=vg().Buffer}catch{}i.isBN=function(f){return f instanceof i?!0:f!==null&&typeof f=="object"&&f.constructor.wordSize===i.wordSize&&Array.isArray(f.words)},i.max=function(f,b){return f.cmp(b)>0?f:b},i.min=function(f,b){return f.cmp(b)<0?f:b},i.prototype._init=function(f,b,g){if(typeof f=="number")return this._initNumber(f,b,g);if(typeof f=="object")return this._initArray(f,b,g);b==="hex"&&(b=16),r(b===(b|0)&&b>=2&&b<=36),f=f.toString().replace(/\s+/g,"");var d=0;f[0]==="-"&&(d++,this.negative=1),d<f.length&&(b===16?this._parseHex(f,d,g):(this._parseBase(f,b,d),g==="le"&&this._initArray(this.toArray(),b,g)))},i.prototype._initNumber=function(f,b,g){f<0&&(this.negative=1,f=-f),f<67108864?(this.words=[f&67108863],this.length=1):f<4503599627370496?(this.words=[f&67108863,f/67108864&67108863],this.length=2):(r(f<9007199254740992),this.words=[f&67108863,f/67108864&67108863,1],this.length=3),g==="le"&&this._initArray(this.toArray(),b,g)},i.prototype._initArray=function(f,b,g){if(r(typeof f.length=="number"),f.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(f.length/3),this.words=new Array(this.length);for(var d=0;d<this.length;d++)this.words[d]=0;var _,k,H=0;if(g==="be")for(d=f.length-1,_=0;d>=0;d-=3)k=f[d]|f[d-1]<<8|f[d-2]<<16,this.words[_]|=k<<H&67108863,this.words[_+1]=k>>>26-H&67108863,H+=24,H>=26&&(H-=26,_++);else if(g==="le")for(d=0,_=0;d<f.length;d+=3)k=f[d]|f[d+1]<<8|f[d+2]<<16,this.words[_]|=k<<H&67108863,this.words[_+1]=k>>>26-H&67108863,H+=24,H>=26&&(H-=26,_++);return this.strip()};function a(U,f){var b=U.charCodeAt(f);return b>=65&&b<=70?b-55:b>=97&&b<=102?b-87:b-48&15}function s(U,f,b){var g=a(U,b);return b-1>=f&&(g|=a(U,b-1)<<4),g}i.prototype._parseHex=function(f,b,g){this.length=Math.ceil((f.length-b)/6),this.words=new Array(this.length);for(var d=0;d<this.length;d++)this.words[d]=0;var _=0,k=0,H;if(g==="be")for(d=f.length-1;d>=b;d-=2)H=s(f,b,d)<<_,this.words[k]|=H&67108863,_>=18?(_-=18,k+=1,this.words[k]|=H>>>26):_+=8;else{var T=f.length-b;for(d=T%2===0?b+1:b;d<f.length;d+=2)H=s(f,b,d)<<_,this.words[k]|=H&67108863,_>=18?(_-=18,k+=1,this.words[k]|=H>>>26):_+=8}this.strip()};function u(U,f,b,g){for(var d=0,_=Math.min(U.length,b),k=f;k<_;k++){var H=U.charCodeAt(k)-48;d*=g,H>=49?d+=H-49+10:H>=17?d+=H-17+10:d+=H}return d}i.prototype._parseBase=function(f,b,g){this.words=[0],this.length=1;for(var d=0,_=1;_<=67108863;_*=b)d++;d--,_=_/b|0;for(var k=f.length-g,H=k%d,T=Math.min(k,k-H)+g,c=0,O=g;O<T;O+=d)c=u(f,O,O+d,b),this.imuln(_),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(H!==0){var N=1;for(c=u(f,O,f.length,b),O=0;O<H;O++)N*=b;this.imuln(N),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this.strip()},i.prototype.copy=function(f){f.words=new Array(this.length);for(var b=0;b<this.length;b++)f.words[b]=this.words[b];f.length=this.length,f.negative=this.negative,f.red=this.red},i.prototype.clone=function(){var f=new i(null);return this.copy(f),f},i.prototype._expand=function(f){for(;this.length<f;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],w=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(f,b){f=f||10,b=b|0||1;var g;if(f===16||f==="hex"){g="";for(var d=0,_=0,k=0;k<this.length;k++){var H=this.words[k],T=((H<<d|_)&16777215).toString(16);_=H>>>24-d&16777215,_!==0||k!==this.length-1?g=h[6-T.length]+T+g:g=T+g,d+=2,d>=26&&(d-=26,k--)}for(_!==0&&(g=_.toString(16)+g);g.length%b!==0;)g="0"+g;return this.negative!==0&&(g="-"+g),g}if(f===(f|0)&&f>=2&&f<=36){var c=w[f],O=p[f];g="";var N=this.clone();for(N.negative=0;!N.isZero();){var le=N.modn(O).toString(f);N=N.idivn(O),N.isZero()?g=le+g:g=h[c-le.length]+le+g}for(this.isZero()&&(g="0"+g);g.length%b!==0;)g="0"+g;return this.negative!==0&&(g="-"+g),g}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var f=this.words[0];return this.length===2?f+=this.words[1]*67108864:this.length===3&&this.words[2]===1?f+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-f:f},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(f,b){return r(typeof o<"u"),this.toArrayLike(o,f,b)},i.prototype.toArray=function(f,b){return this.toArrayLike(Array,f,b)},i.prototype.toArrayLike=function(f,b,g){var d=this.byteLength(),_=g||Math.max(1,d);r(d<=_,"byte array longer than desired length"),r(_>0,"Requested array length <= 0"),this.strip();var k=b==="le",H=new f(_),T,c,O=this.clone();if(k){for(c=0;!O.isZero();c++)T=O.andln(255),O.iushrn(8),H[c]=T;for(;c<_;c++)H[c]=0}else{for(c=0;c<_-d;c++)H[c]=0;for(c=0;!O.isZero();c++)T=O.andln(255),O.iushrn(8),H[_-c-1]=T}return H},Math.clz32?i.prototype._countBits=function(f){return 32-Math.clz32(f)}:i.prototype._countBits=function(f){var b=f,g=0;return b>=4096&&(g+=13,b>>>=13),b>=64&&(g+=7,b>>>=7),b>=8&&(g+=4,b>>>=4),b>=2&&(g+=2,b>>>=2),g+b},i.prototype._zeroBits=function(f){if(f===0)return 26;var b=f,g=0;return(b&8191)===0&&(g+=13,b>>>=13),(b&127)===0&&(g+=7,b>>>=7),(b&15)===0&&(g+=4,b>>>=4),(b&3)===0&&(g+=2,b>>>=2),(b&1)===0&&g++,g},i.prototype.bitLength=function(){var f=this.words[this.length-1],b=this._countBits(f);return(this.length-1)*26+b};function M(U){for(var f=new Array(U.bitLength()),b=0;b<f.length;b++){var g=b/26|0,d=b%26;f[b]=(U.words[g]&1<<d)>>>d}return f}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var f=0,b=0;b<this.length;b++){var g=this._zeroBits(this.words[b]);if(f+=g,g!==26)break}return f},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(f){return this.negative!==0?this.abs().inotn(f).iaddn(1):this.clone()},i.prototype.fromTwos=function(f){return this.testn(f-1)?this.notn(f).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(f){for(;this.length<f.length;)this.words[this.length++]=0;for(var b=0;b<f.length;b++)this.words[b]=this.words[b]|f.words[b];return this.strip()},i.prototype.ior=function(f){return r((this.negative|f.negative)===0),this.iuor(f)},i.prototype.or=function(f){return this.length>f.length?this.clone().ior(f):f.clone().ior(this)},i.prototype.uor=function(f){return this.length>f.length?this.clone().iuor(f):f.clone().iuor(this)},i.prototype.iuand=function(f){var b;this.length>f.length?b=f:b=this;for(var g=0;g<b.length;g++)this.words[g]=this.words[g]&f.words[g];return this.length=b.length,this.strip()},i.prototype.iand=function(f){return r((this.negative|f.negative)===0),this.iuand(f)},i.prototype.and=function(f){return this.length>f.length?this.clone().iand(f):f.clone().iand(this)},i.prototype.uand=function(f){return this.length>f.length?this.clone().iuand(f):f.clone().iuand(this)},i.prototype.iuxor=function(f){var b,g;this.length>f.length?(b=this,g=f):(b=f,g=this);for(var d=0;d<g.length;d++)this.words[d]=b.words[d]^g.words[d];if(this!==b)for(;d<b.length;d++)this.words[d]=b.words[d];return this.length=b.length,this.strip()},i.prototype.ixor=function(f){return r((this.negative|f.negative)===0),this.iuxor(f)},i.prototype.xor=function(f){return this.length>f.length?this.clone().ixor(f):f.clone().ixor(this)},i.prototype.uxor=function(f){return this.length>f.length?this.clone().iuxor(f):f.clone().iuxor(this)},i.prototype.inotn=function(f){r(typeof f=="number"&&f>=0);var b=Math.ceil(f/26)|0,g=f%26;this._expand(b),g>0&&b--;for(var d=0;d<b;d++)this.words[d]=~this.words[d]&67108863;return g>0&&(this.words[d]=~this.words[d]&67108863>>26-g),this.strip()},i.prototype.notn=function(f){return this.clone().inotn(f)},i.prototype.setn=function(f,b){r(typeof f=="number"&&f>=0);var g=f/26|0,d=f%26;return this._expand(g+1),b?this.words[g]=this.words[g]|1<<d:this.words[g]=this.words[g]&~(1<<d),this.strip()},i.prototype.iadd=function(f){var b;if(this.negative!==0&&f.negative===0)return this.negative=0,b=this.isub(f),this.negative^=1,this._normSign();if(this.negative===0&&f.negative!==0)return f.negative=0,b=this.isub(f),f.negative=1,b._normSign();var g,d;this.length>f.length?(g=this,d=f):(g=f,d=this);for(var _=0,k=0;k<d.length;k++)b=(g.words[k]|0)+(d.words[k]|0)+_,this.words[k]=b&67108863,_=b>>>26;for(;_!==0&&k<g.length;k++)b=(g.words[k]|0)+_,this.words[k]=b&67108863,_=b>>>26;if(this.length=g.length,_!==0)this.words[this.length]=_,this.length++;else if(g!==this)for(;k<g.length;k++)this.words[k]=g.words[k];return this},i.prototype.add=function(f){var b;return f.negative!==0&&this.negative===0?(f.negative=0,b=this.sub(f),f.negative^=1,b):f.negative===0&&this.negative!==0?(this.negative=0,b=f.sub(this),this.negative=1,b):this.length>f.length?this.clone().iadd(f):f.clone().iadd(this)},i.prototype.isub=function(f){if(f.negative!==0){f.negative=0;var b=this.iadd(f);return f.negative=1,b._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(f),this.negative=1,this._normSign();var g=this.cmp(f);if(g===0)return this.negative=0,this.length=1,this.words[0]=0,this;var d,_;g>0?(d=this,_=f):(d=f,_=this);for(var k=0,H=0;H<_.length;H++)b=(d.words[H]|0)-(_.words[H]|0)+k,k=b>>26,this.words[H]=b&67108863;for(;k!==0&&H<d.length;H++)b=(d.words[H]|0)+k,k=b>>26,this.words[H]=b&67108863;if(k===0&&H<d.length&&d!==this)for(;H<d.length;H++)this.words[H]=d.words[H];return this.length=Math.max(this.length,H),d!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(f){return this.clone().isub(f)};function A(U,f,b){b.negative=f.negative^U.negative;var g=U.length+f.length|0;b.length=g,g=g-1|0;var d=U.words[0]|0,_=f.words[0]|0,k=d*_,H=k&67108863,T=k/67108864|0;b.words[0]=H;for(var c=1;c<g;c++){for(var O=T>>>26,N=T&67108863,le=Math.min(c,f.length-1),ce=Math.max(0,c-U.length+1);ce<=le;ce++){var Te=c-ce|0;d=U.words[Te]|0,_=f.words[ce]|0,k=d*_+N,O+=k/67108864|0,N=k&67108863}b.words[c]=N|0,T=O|0}return T!==0?b.words[c]=T|0:b.length--,b.strip()}var P=function(f,b,g){var d=f.words,_=b.words,k=g.words,H=0,T,c,O,N=d[0]|0,le=N&8191,ce=N>>>13,Te=d[1]|0,qe=Te&8191,Fe=Te>>>13,at=d[2]|0,He=at&8191,Pe=at>>>13,jt=d[3]|0,yt=jt&8191,ft=jt>>>13,xr=d[4]|0,mt=xr&8191,At=xr>>>13,$r=d[5]|0,kt=$r&8191,Ht=$r>>>13,Yi=d[6]|0,It=Yi&8191,St=Yi>>>13,Xr=d[7]|0,Tt=Xr&8191,Et=Xr>>>13,Zn=d[8]|0,Pt=Zn&8191,V=Zn>>>13,C=d[9]|0,K=C&8191,D=C>>>13,G=_[0]|0,R=G&8191,te=G>>>13,oe=_[1]|0,ie=oe&8191,fe=oe>>>13,ke=_[2]|0,se=ke&8191,he=ke>>>13,B=_[3]|0,m=B&8191,I=B>>>13,l=_[4]|0,y=l&8191,L=l>>>13,F=_[5]|0,X=F&8191,j=F>>>13,be=_[6]|0,we=be&8191,de=be>>>13,Re=_[7]|0,Be=Re&8191,ve=Re>>>13,Ke=_[8]|0,Ie=Ke&8191,Ee=Ke>>>13,ze=_[9]|0,Ae=ze&8191,_e=ze>>>13;g.negative=f.negative^b.negative,g.length=19,T=Math.imul(le,R),c=Math.imul(le,te),c=c+Math.imul(ce,R)|0,O=Math.imul(ce,te);var De=(H+T|0)+((c&8191)<<13)|0;H=(O+(c>>>13)|0)+(De>>>26)|0,De&=67108863,T=Math.imul(qe,R),c=Math.imul(qe,te),c=c+Math.imul(Fe,R)|0,O=Math.imul(Fe,te),T=T+Math.imul(le,ie)|0,c=c+Math.imul(le,fe)|0,c=c+Math.imul(ce,ie)|0,O=O+Math.imul(ce,fe)|0;var et=(H+T|0)+((c&8191)<<13)|0;H=(O+(c>>>13)|0)+(et>>>26)|0,et&=67108863,T=Math.imul(He,R),c=Math.imul(He,te),c=c+Math.imul(Pe,R)|0,O=Math.imul(Pe,te),T=T+Math.imul(qe,ie)|0,c=c+Math.imul(qe,fe)|0,c=c+Math.imul(Fe,ie)|0,O=O+Math.imul(Fe,fe)|0,T=T+Math.imul(le,se)|0,c=c+Math.imul(le,he)|0,c=c+Math.imul(ce,se)|0,O=O+Math.imul(ce,he)|0;var Ne=(H+T|0)+((c&8191)<<13)|0;H=(O+(c>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,T=Math.imul(yt,R),c=Math.imul(yt,te),c=c+Math.imul(ft,R)|0,O=Math.imul(ft,te),T=T+Math.imul(He,ie)|0,c=c+Math.imul(He,fe)|0,c=c+Math.imul(Pe,ie)|0,O=O+Math.imul(Pe,fe)|0,T=T+Math.imul(qe,se)|0,c=c+Math.imul(qe,he)|0,c=c+Math.imul(Fe,se)|0,O=O+Math.imul(Fe,he)|0,T=T+Math.imul(le,m)|0,c=c+Math.imul(le,I)|0,c=c+Math.imul(ce,m)|0,O=O+Math.imul(ce,I)|0;var ae=(H+T|0)+((c&8191)<<13)|0;H=(O+(c>>>13)|0)+(ae>>>26)|0,ae&=67108863,T=Math.imul(mt,R),c=Math.imul(mt,te),c=c+Math.imul(At,R)|0,O=Math.imul(At,te),T=T+Math.imul(yt,ie)|0,c=c+Math.imul(yt,fe)|0,c=c+Math.imul(ft,ie)|0,O=O+Math.imul(ft,fe)|0,T=T+Math.imul(He,se)|0,c=c+Math.imul(He,he)|0,c=c+Math.imul(Pe,se)|0,O=O+Math.imul(Pe,he)|0,T=T+Math.imul(qe,m)|0,c=c+Math.imul(qe,I)|0,c=c+Math.imul(Fe,m)|0,O=O+Math.imul(Fe,I)|0,T=T+Math.imul(le,y)|0,c=c+Math.imul(le,L)|0,c=c+Math.imul(ce,y)|0,O=O+Math.imul(ce,L)|0;var ue=(H+T|0)+((c&8191)<<13)|0;H=(O+(c>>>13)|0)+(ue>>>26)|0,ue&=67108863,T=Math.imul(kt,R),c=Math.imul(kt,te),c=c+Math.imul(Ht,R)|0,O=Math.imul(Ht,te),T=T+Math.imul(mt,ie)|0,c=c+Math.imul(mt,fe)|0,c=c+Math.imul(At,ie)|0,O=O+Math.imul(At,fe)|0,T=T+Math.imul(yt,se)|0,c=c+Math.imul(yt,he)|0,c=c+Math.imul(ft,se)|0,O=O+Math.imul(ft,he)|0,T=T+Math.imul(He,m)|0,c=c+Math.imul(He,I)|0,c=c+Math.imul(Pe,m)|0,O=O+Math.imul(Pe,I)|0,T=T+Math.imul(qe,y)|0,c=c+Math.imul(qe,L)|0,c=c+Math.imul(Fe,y)|0,O=O+Math.imul(Fe,L)|0,T=T+Math.imul(le,X)|0,c=c+Math.imul(le,j)|0,c=c+Math.imul(ce,X)|0,O=O+Math.imul(ce,j)|0;var xe=(H+T|0)+((c&8191)<<13)|0;H=(O+(c>>>13)|0)+(xe>>>26)|0,xe&=67108863,T=Math.imul(It,R),c=Math.imul(It,te),c=c+Math.imul(St,R)|0,O=Math.imul(St,te),T=T+Math.imul(kt,ie)|0,c=c+Math.imul(kt,fe)|0,c=c+Math.imul(Ht,ie)|0,O=O+Math.imul(Ht,fe)|0,T=T+Math.imul(mt,se)|0,c=c+Math.imul(mt,he)|0,c=c+Math.imul(At,se)|0,O=O+Math.imul(At,he)|0,T=T+Math.imul(yt,m)|0,c=c+Math.imul(yt,I)|0,c=c+Math.imul(ft,m)|0,O=O+Math.imul(ft,I)|0,T=T+Math.imul(He,y)|0,c=c+Math.imul(He,L)|0,c=c+Math.imul(Pe,y)|0,O=O+Math.imul(Pe,L)|0,T=T+Math.imul(qe,X)|0,c=c+Math.imul(qe,j)|0,c=c+Math.imul(Fe,X)|0,O=O+Math.imul(Fe,j)|0,T=T+Math.imul(le,we)|0,c=c+Math.imul(le,de)|0,c=c+Math.imul(ce,we)|0,O=O+Math.imul(ce,de)|0;var pe=(H+T|0)+((c&8191)<<13)|0;H=(O+(c>>>13)|0)+(pe>>>26)|0,pe&=67108863,T=Math.imul(Tt,R),c=Math.imul(Tt,te),c=c+Math.imul(Et,R)|0,O=Math.imul(Et,te),T=T+Math.imul(It,ie)|0,c=c+Math.imul(It,fe)|0,c=c+Math.imul(St,ie)|0,O=O+Math.imul(St,fe)|0,T=T+Math.imul(kt,se)|0,c=c+Math.imul(kt,he)|0,c=c+Math.imul(Ht,se)|0,O=O+Math.imul(Ht,he)|0,T=T+Math.imul(mt,m)|0,c=c+Math.imul(mt,I)|0,c=c+Math.imul(At,m)|0,O=O+Math.imul(At,I)|0,T=T+Math.imul(yt,y)|0,c=c+Math.imul(yt,L)|0,c=c+Math.imul(ft,y)|0,O=O+Math.imul(ft,L)|0,T=T+Math.imul(He,X)|0,c=c+Math.imul(He,j)|0,c=c+Math.imul(Pe,X)|0,O=O+Math.imul(Pe,j)|0,T=T+Math.imul(qe,we)|0,c=c+Math.imul(qe,de)|0,c=c+Math.imul(Fe,we)|0,O=O+Math.imul(Fe,de)|0,T=T+Math.imul(le,Be)|0,c=c+Math.imul(le,ve)|0,c=c+Math.imul(ce,Be)|0,O=O+Math.imul(ce,ve)|0;var ge=(H+T|0)+((c&8191)<<13)|0;H=(O+(c>>>13)|0)+(ge>>>26)|0,ge&=67108863,T=Math.imul(Pt,R),c=Math.imul(Pt,te),c=c+Math.imul(V,R)|0,O=Math.imul(V,te),T=T+Math.imul(Tt,ie)|0,c=c+Math.imul(Tt,fe)|0,c=c+Math.imul(Et,ie)|0,O=O+Math.imul(Et,fe)|0,T=T+Math.imul(It,se)|0,c=c+Math.imul(It,he)|0,c=c+Math.imul(St,se)|0,O=O+Math.imul(St,he)|0,T=T+Math.imul(kt,m)|0,c=c+Math.imul(kt,I)|0,c=c+Math.imul(Ht,m)|0,O=O+Math.imul(Ht,I)|0,T=T+Math.imul(mt,y)|0,c=c+Math.imul(mt,L)|0,c=c+Math.imul(At,y)|0,O=O+Math.imul(At,L)|0,T=T+Math.imul(yt,X)|0,c=c+Math.imul(yt,j)|0,c=c+Math.imul(ft,X)|0,O=O+Math.imul(ft,j)|0,T=T+Math.imul(He,we)|0,c=c+Math.imul(He,de)|0,c=c+Math.imul(Pe,we)|0,O=O+Math.imul(Pe,de)|0,T=T+Math.imul(qe,Be)|0,c=c+Math.imul(qe,ve)|0,c=c+Math.imul(Fe,Be)|0,O=O+Math.imul(Fe,ve)|0,T=T+Math.imul(le,Ie)|0,c=c+Math.imul(le,Ee)|0,c=c+Math.imul(ce,Ie)|0,O=O+Math.imul(ce,Ee)|0;var me=(H+T|0)+((c&8191)<<13)|0;H=(O+(c>>>13)|0)+(me>>>26)|0,me&=67108863,T=Math.imul(K,R),c=Math.imul(K,te),c=c+Math.imul(D,R)|0,O=Math.imul(D,te),T=T+Math.imul(Pt,ie)|0,c=c+Math.imul(Pt,fe)|0,c=c+Math.imul(V,ie)|0,O=O+Math.imul(V,fe)|0,T=T+Math.imul(Tt,se)|0,c=c+Math.imul(Tt,he)|0,c=c+Math.imul(Et,se)|0,O=O+Math.imul(Et,he)|0,T=T+Math.imul(It,m)|0,c=c+Math.imul(It,I)|0,c=c+Math.imul(St,m)|0,O=O+Math.imul(St,I)|0,T=T+Math.imul(kt,y)|0,c=c+Math.imul(kt,L)|0,c=c+Math.imul(Ht,y)|0,O=O+Math.imul(Ht,L)|0,T=T+Math.imul(mt,X)|0,c=c+Math.imul(mt,j)|0,c=c+Math.imul(At,X)|0,O=O+Math.imul(At,j)|0,T=T+Math.imul(yt,we)|0,c=c+Math.imul(yt,de)|0,c=c+Math.imul(ft,we)|0,O=O+Math.imul(ft,de)|0,T=T+Math.imul(He,Be)|0,c=c+Math.imul(He,ve)|0,c=c+Math.imul(Pe,Be)|0,O=O+Math.imul(Pe,ve)|0,T=T+Math.imul(qe,Ie)|0,c=c+Math.imul(qe,Ee)|0,c=c+Math.imul(Fe,Ie)|0,O=O+Math.imul(Fe,Ee)|0,T=T+Math.imul(le,Ae)|0,c=c+Math.imul(le,_e)|0,c=c+Math.imul(ce,Ae)|0,O=O+Math.imul(ce,_e)|0;var Je=(H+T|0)+((c&8191)<<13)|0;H=(O+(c>>>13)|0)+(Je>>>26)|0,Je&=67108863,T=Math.imul(K,ie),c=Math.imul(K,fe),c=c+Math.imul(D,ie)|0,O=Math.imul(D,fe),T=T+Math.imul(Pt,se)|0,c=c+Math.imul(Pt,he)|0,c=c+Math.imul(V,se)|0,O=O+Math.imul(V,he)|0,T=T+Math.imul(Tt,m)|0,c=c+Math.imul(Tt,I)|0,c=c+Math.imul(Et,m)|0,O=O+Math.imul(Et,I)|0,T=T+Math.imul(It,y)|0,c=c+Math.imul(It,L)|0,c=c+Math.imul(St,y)|0,O=O+Math.imul(St,L)|0,T=T+Math.imul(kt,X)|0,c=c+Math.imul(kt,j)|0,c=c+Math.imul(Ht,X)|0,O=O+Math.imul(Ht,j)|0,T=T+Math.imul(mt,we)|0,c=c+Math.imul(mt,de)|0,c=c+Math.imul(At,we)|0,O=O+Math.imul(At,de)|0,T=T+Math.imul(yt,Be)|0,c=c+Math.imul(yt,ve)|0,c=c+Math.imul(ft,Be)|0,O=O+Math.imul(ft,ve)|0,T=T+Math.imul(He,Ie)|0,c=c+Math.imul(He,Ee)|0,c=c+Math.imul(Pe,Ie)|0,O=O+Math.imul(Pe,Ee)|0,T=T+Math.imul(qe,Ae)|0,c=c+Math.imul(qe,_e)|0,c=c+Math.imul(Fe,Ae)|0,O=O+Math.imul(Fe,_e)|0;var rt=(H+T|0)+((c&8191)<<13)|0;H=(O+(c>>>13)|0)+(rt>>>26)|0,rt&=67108863,T=Math.imul(K,se),c=Math.imul(K,he),c=c+Math.imul(D,se)|0,O=Math.imul(D,he),T=T+Math.imul(Pt,m)|0,c=c+Math.imul(Pt,I)|0,c=c+Math.imul(V,m)|0,O=O+Math.imul(V,I)|0,T=T+Math.imul(Tt,y)|0,c=c+Math.imul(Tt,L)|0,c=c+Math.imul(Et,y)|0,O=O+Math.imul(Et,L)|0,T=T+Math.imul(It,X)|0,c=c+Math.imul(It,j)|0,c=c+Math.imul(St,X)|0,O=O+Math.imul(St,j)|0,T=T+Math.imul(kt,we)|0,c=c+Math.imul(kt,de)|0,c=c+Math.imul(Ht,we)|0,O=O+Math.imul(Ht,de)|0,T=T+Math.imul(mt,Be)|0,c=c+Math.imul(mt,ve)|0,c=c+Math.imul(At,Be)|0,O=O+Math.imul(At,ve)|0,T=T+Math.imul(yt,Ie)|0,c=c+Math.imul(yt,Ee)|0,c=c+Math.imul(ft,Ie)|0,O=O+Math.imul(ft,Ee)|0,T=T+Math.imul(He,Ae)|0,c=c+Math.imul(He,_e)|0,c=c+Math.imul(Pe,Ae)|0,O=O+Math.imul(Pe,_e)|0;var Qe=(H+T|0)+((c&8191)<<13)|0;H=(O+(c>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,T=Math.imul(K,m),c=Math.imul(K,I),c=c+Math.imul(D,m)|0,O=Math.imul(D,I),T=T+Math.imul(Pt,y)|0,c=c+Math.imul(Pt,L)|0,c=c+Math.imul(V,y)|0,O=O+Math.imul(V,L)|0,T=T+Math.imul(Tt,X)|0,c=c+Math.imul(Tt,j)|0,c=c+Math.imul(Et,X)|0,O=O+Math.imul(Et,j)|0,T=T+Math.imul(It,we)|0,c=c+Math.imul(It,de)|0,c=c+Math.imul(St,we)|0,O=O+Math.imul(St,de)|0,T=T+Math.imul(kt,Be)|0,c=c+Math.imul(kt,ve)|0,c=c+Math.imul(Ht,Be)|0,O=O+Math.imul(Ht,ve)|0,T=T+Math.imul(mt,Ie)|0,c=c+Math.imul(mt,Ee)|0,c=c+Math.imul(At,Ie)|0,O=O+Math.imul(At,Ee)|0,T=T+Math.imul(yt,Ae)|0,c=c+Math.imul(yt,_e)|0,c=c+Math.imul(ft,Ae)|0,O=O+Math.imul(ft,_e)|0;var ut=(H+T|0)+((c&8191)<<13)|0;H=(O+(c>>>13)|0)+(ut>>>26)|0,ut&=67108863,T=Math.imul(K,y),c=Math.imul(K,L),c=c+Math.imul(D,y)|0,O=Math.imul(D,L),T=T+Math.imul(Pt,X)|0,c=c+Math.imul(Pt,j)|0,c=c+Math.imul(V,X)|0,O=O+Math.imul(V,j)|0,T=T+Math.imul(Tt,we)|0,c=c+Math.imul(Tt,de)|0,c=c+Math.imul(Et,we)|0,O=O+Math.imul(Et,de)|0,T=T+Math.imul(It,Be)|0,c=c+Math.imul(It,ve)|0,c=c+Math.imul(St,Be)|0,O=O+Math.imul(St,ve)|0,T=T+Math.imul(kt,Ie)|0,c=c+Math.imul(kt,Ee)|0,c=c+Math.imul(Ht,Ie)|0,O=O+Math.imul(Ht,Ee)|0,T=T+Math.imul(mt,Ae)|0,c=c+Math.imul(mt,_e)|0,c=c+Math.imul(At,Ae)|0,O=O+Math.imul(At,_e)|0;var lt=(H+T|0)+((c&8191)<<13)|0;H=(O+(c>>>13)|0)+(lt>>>26)|0,lt&=67108863,T=Math.imul(K,X),c=Math.imul(K,j),c=c+Math.imul(D,X)|0,O=Math.imul(D,j),T=T+Math.imul(Pt,we)|0,c=c+Math.imul(Pt,de)|0,c=c+Math.imul(V,we)|0,O=O+Math.imul(V,de)|0,T=T+Math.imul(Tt,Be)|0,c=c+Math.imul(Tt,ve)|0,c=c+Math.imul(Et,Be)|0,O=O+Math.imul(Et,ve)|0,T=T+Math.imul(It,Ie)|0,c=c+Math.imul(It,Ee)|0,c=c+Math.imul(St,Ie)|0,O=O+Math.imul(St,Ee)|0,T=T+Math.imul(kt,Ae)|0,c=c+Math.imul(kt,_e)|0,c=c+Math.imul(Ht,Ae)|0,O=O+Math.imul(Ht,_e)|0;var bt=(H+T|0)+((c&8191)<<13)|0;H=(O+(c>>>13)|0)+(bt>>>26)|0,bt&=67108863,T=Math.imul(K,we),c=Math.imul(K,de),c=c+Math.imul(D,we)|0,O=Math.imul(D,de),T=T+Math.imul(Pt,Be)|0,c=c+Math.imul(Pt,ve)|0,c=c+Math.imul(V,Be)|0,O=O+Math.imul(V,ve)|0,T=T+Math.imul(Tt,Ie)|0,c=c+Math.imul(Tt,Ee)|0,c=c+Math.imul(Et,Ie)|0,O=O+Math.imul(Et,Ee)|0,T=T+Math.imul(It,Ae)|0,c=c+Math.imul(It,_e)|0,c=c+Math.imul(St,Ae)|0,O=O+Math.imul(St,_e)|0;var je=(H+T|0)+((c&8191)<<13)|0;H=(O+(c>>>13)|0)+(je>>>26)|0,je&=67108863,T=Math.imul(K,Be),c=Math.imul(K,ve),c=c+Math.imul(D,Be)|0,O=Math.imul(D,ve),T=T+Math.imul(Pt,Ie)|0,c=c+Math.imul(Pt,Ee)|0,c=c+Math.imul(V,Ie)|0,O=O+Math.imul(V,Ee)|0,T=T+Math.imul(Tt,Ae)|0,c=c+Math.imul(Tt,_e)|0,c=c+Math.imul(Et,Ae)|0,O=O+Math.imul(Et,_e)|0;var We=(H+T|0)+((c&8191)<<13)|0;H=(O+(c>>>13)|0)+(We>>>26)|0,We&=67108863,T=Math.imul(K,Ie),c=Math.imul(K,Ee),c=c+Math.imul(D,Ie)|0,O=Math.imul(D,Ee),T=T+Math.imul(Pt,Ae)|0,c=c+Math.imul(Pt,_e)|0,c=c+Math.imul(V,Ae)|0,O=O+Math.imul(V,_e)|0;var $e=(H+T|0)+((c&8191)<<13)|0;H=(O+(c>>>13)|0)+($e>>>26)|0,$e&=67108863,T=Math.imul(K,Ae),c=Math.imul(K,_e),c=c+Math.imul(D,Ae)|0,O=Math.imul(D,_e);var Ge=(H+T|0)+((c&8191)<<13)|0;return H=(O+(c>>>13)|0)+(Ge>>>26)|0,Ge&=67108863,k[0]=De,k[1]=et,k[2]=Ne,k[3]=ae,k[4]=ue,k[5]=xe,k[6]=pe,k[7]=ge,k[8]=me,k[9]=Je,k[10]=rt,k[11]=Qe,k[12]=ut,k[13]=lt,k[14]=bt,k[15]=je,k[16]=We,k[17]=$e,k[18]=Ge,H!==0&&(k[19]=H,g.length++),g};Math.imul||(P=A);function E(U,f,b){b.negative=f.negative^U.negative,b.length=U.length+f.length;for(var g=0,d=0,_=0;_<b.length-1;_++){var k=d;d=0;for(var H=g&67108863,T=Math.min(_,f.length-1),c=Math.max(0,_-U.length+1);c<=T;c++){var O=_-c,N=U.words[O]|0,le=f.words[c]|0,ce=N*le,Te=ce&67108863;k=k+(ce/67108864|0)|0,Te=Te+H|0,H=Te&67108863,k=k+(Te>>>26)|0,d+=k>>>26,k&=67108863}b.words[_]=H,g=k,k=d}return g!==0?b.words[_]=g:b.length--,b.strip()}function q(U,f,b){var g=new z;return g.mulp(U,f,b)}i.prototype.mulTo=function(f,b){var g,d=this.length+f.length;return this.length===10&&f.length===10?g=P(this,f,b):d<63?g=A(this,f,b):d<1024?g=E(this,f,b):g=q(this,f,b),g};function z(U,f){this.x=U,this.y=f}z.prototype.makeRBT=function(f){for(var b=new Array(f),g=i.prototype._countBits(f)-1,d=0;d<f;d++)b[d]=this.revBin(d,g,f);return b},z.prototype.revBin=function(f,b,g){if(f===0||f===g-1)return f;for(var d=0,_=0;_<b;_++)d|=(f&1)<<b-_-1,f>>=1;return d},z.prototype.permute=function(f,b,g,d,_,k){for(var H=0;H<k;H++)d[H]=b[f[H]],_[H]=g[f[H]]},z.prototype.transform=function(f,b,g,d,_,k){this.permute(k,f,b,g,d,_);for(var H=1;H<_;H<<=1)for(var T=H<<1,c=Math.cos(2*Math.PI/T),O=Math.sin(2*Math.PI/T),N=0;N<_;N+=T)for(var le=c,ce=O,Te=0;Te<H;Te++){var qe=g[N+Te],Fe=d[N+Te],at=g[N+Te+H],He=d[N+Te+H],Pe=le*at-ce*He;He=le*He+ce*at,at=Pe,g[N+Te]=qe+at,d[N+Te]=Fe+He,g[N+Te+H]=qe-at,d[N+Te+H]=Fe-He,Te!==T&&(Pe=c*le-O*ce,ce=c*ce+O*le,le=Pe)}},z.prototype.guessLen13b=function(f,b){var g=Math.max(b,f)|1,d=g&1,_=0;for(g=g/2|0;g;g=g>>>1)_++;return 1<<_+1+d},z.prototype.conjugate=function(f,b,g){if(!(g<=1))for(var d=0;d<g/2;d++){var _=f[d];f[d]=f[g-d-1],f[g-d-1]=_,_=b[d],b[d]=-b[g-d-1],b[g-d-1]=-_}},z.prototype.normalize13b=function(f,b){for(var g=0,d=0;d<b/2;d++){var _=Math.round(f[2*d+1]/b)*8192+Math.round(f[2*d]/b)+g;f[d]=_&67108863,_<67108864?g=0:g=_/67108864|0}return f},z.prototype.convert13b=function(f,b,g,d){for(var _=0,k=0;k<b;k++)_=_+(f[k]|0),g[2*k]=_&8191,_=_>>>13,g[2*k+1]=_&8191,_=_>>>13;for(k=2*b;k<d;++k)g[k]=0;r(_===0),r((_&-8192)===0)},z.prototype.stub=function(f){for(var b=new Array(f),g=0;g<f;g++)b[g]=0;return b},z.prototype.mulp=function(f,b,g){var d=2*this.guessLen13b(f.length,b.length),_=this.makeRBT(d),k=this.stub(d),H=new Array(d),T=new Array(d),c=new Array(d),O=new Array(d),N=new Array(d),le=new Array(d),ce=g.words;ce.length=d,this.convert13b(f.words,f.length,H,d),this.convert13b(b.words,b.length,O,d),this.transform(H,k,T,c,d,_),this.transform(O,k,N,le,d,_);for(var Te=0;Te<d;Te++){var qe=T[Te]*N[Te]-c[Te]*le[Te];c[Te]=T[Te]*le[Te]+c[Te]*N[Te],T[Te]=qe}return this.conjugate(T,c,d),this.transform(T,c,ce,k,d,_),this.conjugate(ce,k,d),this.normalize13b(ce,d),g.negative=f.negative^b.negative,g.length=f.length+b.length,g.strip()},i.prototype.mul=function(f){var b=new i(null);return b.words=new Array(this.length+f.length),this.mulTo(f,b)},i.prototype.mulf=function(f){var b=new i(null);return b.words=new Array(this.length+f.length),q(this,f,b)},i.prototype.imul=function(f){return this.clone().mulTo(f,this)},i.prototype.imuln=function(f){r(typeof f=="number"),r(f<67108864);for(var b=0,g=0;g<this.length;g++){var d=(this.words[g]|0)*f,_=(d&67108863)+(b&67108863);b>>=26,b+=d/67108864|0,b+=_>>>26,this.words[g]=_&67108863}return b!==0&&(this.words[g]=b,this.length++),this},i.prototype.muln=function(f){return this.clone().imuln(f)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(f){var b=M(f);if(b.length===0)return new i(1);for(var g=this,d=0;d<b.length&&b[d]===0;d++,g=g.sqr());if(++d<b.length)for(var _=g.sqr();d<b.length;d++,_=_.sqr())b[d]!==0&&(g=g.mul(_));return g},i.prototype.iushln=function(f){r(typeof f=="number"&&f>=0);var b=f%26,g=(f-b)/26,d=67108863>>>26-b<<26-b,_;if(b!==0){var k=0;for(_=0;_<this.length;_++){var H=this.words[_]&d,T=(this.words[_]|0)-H<<b;this.words[_]=T|k,k=H>>>26-b}k&&(this.words[_]=k,this.length++)}if(g!==0){for(_=this.length-1;_>=0;_--)this.words[_+g]=this.words[_];for(_=0;_<g;_++)this.words[_]=0;this.length+=g}return this.strip()},i.prototype.ishln=function(f){return r(this.negative===0),this.iushln(f)},i.prototype.iushrn=function(f,b,g){r(typeof f=="number"&&f>=0);var d;b?d=(b-b%26)/26:d=0;var _=f%26,k=Math.min((f-_)/26,this.length),H=67108863^67108863>>>_<<_,T=g;if(d-=k,d=Math.max(0,d),T){for(var c=0;c<k;c++)T.words[c]=this.words[c];T.length=k}if(k!==0)if(this.length>k)for(this.length-=k,c=0;c<this.length;c++)this.words[c]=this.words[c+k];else this.words[0]=0,this.length=1;var O=0;for(c=this.length-1;c>=0&&(O!==0||c>=d);c--){var N=this.words[c]|0;this.words[c]=O<<26-_|N>>>_,O=N&H}return T&&O!==0&&(T.words[T.length++]=O),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(f,b,g){return r(this.negative===0),this.iushrn(f,b,g)},i.prototype.shln=function(f){return this.clone().ishln(f)},i.prototype.ushln=function(f){return this.clone().iushln(f)},i.prototype.shrn=function(f){return this.clone().ishrn(f)},i.prototype.ushrn=function(f){return this.clone().iushrn(f)},i.prototype.testn=function(f){r(typeof f=="number"&&f>=0);var b=f%26,g=(f-b)/26,d=1<<b;if(this.length<=g)return!1;var _=this.words[g];return!!(_&d)},i.prototype.imaskn=function(f){r(typeof f=="number"&&f>=0);var b=f%26,g=(f-b)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=g)return this;if(b!==0&&g++,this.length=Math.min(g,this.length),b!==0){var d=67108863^67108863>>>b<<b;this.words[this.length-1]&=d}return this.strip()},i.prototype.maskn=function(f){return this.clone().imaskn(f)},i.prototype.iaddn=function(f){return r(typeof f=="number"),r(f<67108864),f<0?this.isubn(-f):this.negative!==0?this.length===1&&(this.words[0]|0)<f?(this.words[0]=f-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(f),this.negative=1,this):this._iaddn(f)},i.prototype._iaddn=function(f){this.words[0]+=f;for(var b=0;b<this.length&&this.words[b]>=67108864;b++)this.words[b]-=67108864,b===this.length-1?this.words[b+1]=1:this.words[b+1]++;return this.length=Math.max(this.length,b+1),this},i.prototype.isubn=function(f){if(r(typeof f=="number"),r(f<67108864),f<0)return this.iaddn(-f);if(this.negative!==0)return this.negative=0,this.iaddn(f),this.negative=1,this;if(this.words[0]-=f,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var b=0;b<this.length&&this.words[b]<0;b++)this.words[b]+=67108864,this.words[b+1]-=1;return this.strip()},i.prototype.addn=function(f){return this.clone().iaddn(f)},i.prototype.subn=function(f){return this.clone().isubn(f)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(f,b,g){var d=f.length+g,_;this._expand(d);var k,H=0;for(_=0;_<f.length;_++){k=(this.words[_+g]|0)+H;var T=(f.words[_]|0)*b;k-=T&67108863,H=(k>>26)-(T/67108864|0),this.words[_+g]=k&67108863}for(;_<this.length-g;_++)k=(this.words[_+g]|0)+H,H=k>>26,this.words[_+g]=k&67108863;if(H===0)return this.strip();for(r(H===-1),H=0,_=0;_<this.length;_++)k=-(this.words[_]|0)+H,H=k>>26,this.words[_]=k&67108863;return this.negative=1,this.strip()},i.prototype._wordDiv=function(f,b){var g=this.length-f.length,d=this.clone(),_=f,k=_.words[_.length-1]|0,H=this._countBits(k);g=26-H,g!==0&&(_=_.ushln(g),d.iushln(g),k=_.words[_.length-1]|0);var T=d.length-_.length,c;if(b!=="mod"){c=new i(null),c.length=T+1,c.words=new Array(c.length);for(var O=0;O<c.length;O++)c.words[O]=0}var N=d.clone()._ishlnsubmul(_,1,T);N.negative===0&&(d=N,c&&(c.words[T]=1));for(var le=T-1;le>=0;le--){var ce=(d.words[_.length+le]|0)*67108864+(d.words[_.length+le-1]|0);for(ce=Math.min(ce/k|0,67108863),d._ishlnsubmul(_,ce,le);d.negative!==0;)ce--,d.negative=0,d._ishlnsubmul(_,1,le),d.isZero()||(d.negative^=1);c&&(c.words[le]=ce)}return c&&c.strip(),d.strip(),b!=="div"&&g!==0&&d.iushrn(g),{div:c||null,mod:d}},i.prototype.divmod=function(f,b,g){if(r(!f.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var d,_,k;return this.negative!==0&&f.negative===0?(k=this.neg().divmod(f,b),b!=="mod"&&(d=k.div.neg()),b!=="div"&&(_=k.mod.neg(),g&&_.negative!==0&&_.iadd(f)),{div:d,mod:_}):this.negative===0&&f.negative!==0?(k=this.divmod(f.neg(),b),b!=="mod"&&(d=k.div.neg()),{div:d,mod:k.mod}):(this.negative&f.negative)!==0?(k=this.neg().divmod(f.neg(),b),b!=="div"&&(_=k.mod.neg(),g&&_.negative!==0&&_.isub(f)),{div:k.div,mod:_}):f.length>this.length||this.cmp(f)<0?{div:new i(0),mod:this}:f.length===1?b==="div"?{div:this.divn(f.words[0]),mod:null}:b==="mod"?{div:null,mod:new i(this.modn(f.words[0]))}:{div:this.divn(f.words[0]),mod:new i(this.modn(f.words[0]))}:this._wordDiv(f,b)},i.prototype.div=function(f){return this.divmod(f,"div",!1).div},i.prototype.mod=function(f){return this.divmod(f,"mod",!1).mod},i.prototype.umod=function(f){return this.divmod(f,"mod",!0).mod},i.prototype.divRound=function(f){var b=this.divmod(f);if(b.mod.isZero())return b.div;var g=b.div.negative!==0?b.mod.isub(f):b.mod,d=f.ushrn(1),_=f.andln(1),k=g.cmp(d);return k<0||_===1&&k===0?b.div:b.div.negative!==0?b.div.isubn(1):b.div.iaddn(1)},i.prototype.modn=function(f){r(f<=67108863);for(var b=(1<<26)%f,g=0,d=this.length-1;d>=0;d--)g=(b*g+(this.words[d]|0))%f;return g},i.prototype.idivn=function(f){r(f<=67108863);for(var b=0,g=this.length-1;g>=0;g--){var d=(this.words[g]|0)+b*67108864;this.words[g]=d/f|0,b=d%f}return this.strip()},i.prototype.divn=function(f){return this.clone().idivn(f)},i.prototype.egcd=function(f){r(f.negative===0),r(!f.isZero());var b=this,g=f.clone();b.negative!==0?b=b.umod(f):b=b.clone();for(var d=new i(1),_=new i(0),k=new i(0),H=new i(1),T=0;b.isEven()&&g.isEven();)b.iushrn(1),g.iushrn(1),++T;for(var c=g.clone(),O=b.clone();!b.isZero();){for(var N=0,le=1;(b.words[0]&le)===0&&N<26;++N,le<<=1);if(N>0)for(b.iushrn(N);N-- >0;)(d.isOdd()||_.isOdd())&&(d.iadd(c),_.isub(O)),d.iushrn(1),_.iushrn(1);for(var ce=0,Te=1;(g.words[0]&Te)===0&&ce<26;++ce,Te<<=1);if(ce>0)for(g.iushrn(ce);ce-- >0;)(k.isOdd()||H.isOdd())&&(k.iadd(c),H.isub(O)),k.iushrn(1),H.iushrn(1);b.cmp(g)>=0?(b.isub(g),d.isub(k),_.isub(H)):(g.isub(b),k.isub(d),H.isub(_))}return{a:k,b:H,gcd:g.iushln(T)}},i.prototype._invmp=function(f){r(f.negative===0),r(!f.isZero());var b=this,g=f.clone();b.negative!==0?b=b.umod(f):b=b.clone();for(var d=new i(1),_=new i(0),k=g.clone();b.cmpn(1)>0&&g.cmpn(1)>0;){for(var H=0,T=1;(b.words[0]&T)===0&&H<26;++H,T<<=1);if(H>0)for(b.iushrn(H);H-- >0;)d.isOdd()&&d.iadd(k),d.iushrn(1);for(var c=0,O=1;(g.words[0]&O)===0&&c<26;++c,O<<=1);if(c>0)for(g.iushrn(c);c-- >0;)_.isOdd()&&_.iadd(k),_.iushrn(1);b.cmp(g)>=0?(b.isub(g),d.isub(_)):(g.isub(b),_.isub(d))}var N;return b.cmpn(1)===0?N=d:N=_,N.cmpn(0)<0&&N.iadd(f),N},i.prototype.gcd=function(f){if(this.isZero())return f.abs();if(f.isZero())return this.abs();var b=this.clone(),g=f.clone();b.negative=0,g.negative=0;for(var d=0;b.isEven()&&g.isEven();d++)b.iushrn(1),g.iushrn(1);do{for(;b.isEven();)b.iushrn(1);for(;g.isEven();)g.iushrn(1);var _=b.cmp(g);if(_<0){var k=b;b=g,g=k}else if(_===0||g.cmpn(1)===0)break;b.isub(g)}while(!0);return g.iushln(d)},i.prototype.invm=function(f){return this.egcd(f).a.umod(f)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(f){return this.words[0]&f},i.prototype.bincn=function(f){r(typeof f=="number");var b=f%26,g=(f-b)/26,d=1<<b;if(this.length<=g)return this._expand(g+1),this.words[g]|=d,this;for(var _=d,k=g;_!==0&&k<this.length;k++){var H=this.words[k]|0;H+=_,_=H>>>26,H&=67108863,this.words[k]=H}return _!==0&&(this.words[k]=_,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(f){var b=f<0;if(this.negative!==0&&!b)return-1;if(this.negative===0&&b)return 1;this.strip();var g;if(this.length>1)g=1;else{b&&(f=-f),r(f<=67108863,"Number is too big");var d=this.words[0]|0;g=d===f?0:d<f?-1:1}return this.negative!==0?-g|0:g},i.prototype.cmp=function(f){if(this.negative!==0&&f.negative===0)return-1;if(this.negative===0&&f.negative!==0)return 1;var b=this.ucmp(f);return this.negative!==0?-b|0:b},i.prototype.ucmp=function(f){if(this.length>f.length)return 1;if(this.length<f.length)return-1;for(var b=0,g=this.length-1;g>=0;g--){var d=this.words[g]|0,_=f.words[g]|0;if(d!==_){d<_?b=-1:d>_&&(b=1);break}}return b},i.prototype.gtn=function(f){return this.cmpn(f)===1},i.prototype.gt=function(f){return this.cmp(f)===1},i.prototype.gten=function(f){return this.cmpn(f)>=0},i.prototype.gte=function(f){return this.cmp(f)>=0},i.prototype.ltn=function(f){return this.cmpn(f)===-1},i.prototype.lt=function(f){return this.cmp(f)===-1},i.prototype.lten=function(f){return this.cmpn(f)<=0},i.prototype.lte=function(f){return this.cmp(f)<=0},i.prototype.eqn=function(f){return this.cmpn(f)===0},i.prototype.eq=function(f){return this.cmp(f)===0},i.red=function(f){return new re(f)},i.prototype.toRed=function(f){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),f.convertTo(this)._forceRed(f)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(f){return this.red=f,this},i.prototype.forceRed=function(f){return r(!this.red,"Already a number in reduction context"),this._forceRed(f)},i.prototype.redAdd=function(f){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,f)},i.prototype.redIAdd=function(f){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,f)},i.prototype.redSub=function(f){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,f)},i.prototype.redISub=function(f){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,f)},i.prototype.redShl=function(f){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,f)},i.prototype.redMul=function(f){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.mul(this,f)},i.prototype.redIMul=function(f){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.imul(this,f)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(f){return r(this.red&&!f.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,f)};var J={k256:null,p224:null,p192:null,p25519:null};function $(U,f){this.name=U,this.p=new i(f,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}$.prototype._tmp=function(){var f=new i(null);return f.words=new Array(Math.ceil(this.n/13)),f},$.prototype.ireduce=function(f){var b=f,g;do this.split(b,this.tmp),b=this.imulK(b),b=b.iadd(this.tmp),g=b.bitLength();while(g>this.n);var d=g<this.n?-1:b.ucmp(this.p);return d===0?(b.words[0]=0,b.length=1):d>0?b.isub(this.p):b.strip!==void 0?b.strip():b._strip(),b},$.prototype.split=function(f,b){f.iushrn(this.n,0,b)},$.prototype.imulK=function(f){return f.imul(this.k)};function ee(){$.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(ee,$),ee.prototype.split=function(f,b){for(var g=4194303,d=Math.min(f.length,9),_=0;_<d;_++)b.words[_]=f.words[_];if(b.length=d,f.length<=9){f.words[0]=0,f.length=1;return}var k=f.words[9];for(b.words[b.length++]=k&g,_=10;_<f.length;_++){var H=f.words[_]|0;f.words[_-10]=(H&g)<<4|k>>>22,k=H}k>>>=22,f.words[_-10]=k,k===0&&f.length>10?f.length-=10:f.length-=9},ee.prototype.imulK=function(f){f.words[f.length]=0,f.words[f.length+1]=0,f.length+=2;for(var b=0,g=0;g<f.length;g++){var d=f.words[g]|0;b+=d*977,f.words[g]=b&67108863,b=d*64+(b/67108864|0)}return f.words[f.length-1]===0&&(f.length--,f.words[f.length-1]===0&&f.length--),f};function Y(){$.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(Y,$);function Z(){$.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(Z,$);function ne(){$.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(ne,$),ne.prototype.imulK=function(f){for(var b=0,g=0;g<f.length;g++){var d=(f.words[g]|0)*19+b,_=d&67108863;d>>>=26,f.words[g]=_,b=d}return b!==0&&(f.words[f.length++]=b),f},i._prime=function(f){if(J[f])return J[f];var b;if(f==="k256")b=new ee;else if(f==="p224")b=new Y;else if(f==="p192")b=new Z;else if(f==="p25519")b=new ne;else throw new Error("Unknown prime "+f);return J[f]=b,b};function re(U){if(typeof U=="string"){var f=i._prime(U);this.m=f.p,this.prime=f}else r(U.gtn(1),"modulus must be greater than 1"),this.m=U,this.prime=null}re.prototype._verify1=function(f){r(f.negative===0,"red works only with positives"),r(f.red,"red works only with red numbers")},re.prototype._verify2=function(f,b){r((f.negative|b.negative)===0,"red works only with positives"),r(f.red&&f.red===b.red,"red works only with red numbers")},re.prototype.imod=function(f){return this.prime?this.prime.ireduce(f)._forceRed(this):f.umod(this.m)._forceRed(this)},re.prototype.neg=function(f){return f.isZero()?f.clone():this.m.sub(f)._forceRed(this)},re.prototype.add=function(f,b){this._verify2(f,b);var g=f.add(b);return g.cmp(this.m)>=0&&g.isub(this.m),g._forceRed(this)},re.prototype.iadd=function(f,b){this._verify2(f,b);var g=f.iadd(b);return g.cmp(this.m)>=0&&g.isub(this.m),g},re.prototype.sub=function(f,b){this._verify2(f,b);var g=f.sub(b);return g.cmpn(0)<0&&g.iadd(this.m),g._forceRed(this)},re.prototype.isub=function(f,b){this._verify2(f,b);var g=f.isub(b);return g.cmpn(0)<0&&g.iadd(this.m),g},re.prototype.shl=function(f,b){return this._verify1(f),this.imod(f.ushln(b))},re.prototype.imul=function(f,b){return this._verify2(f,b),this.imod(f.imul(b))},re.prototype.mul=function(f,b){return this._verify2(f,b),this.imod(f.mul(b))},re.prototype.isqr=function(f){return this.imul(f,f.clone())},re.prototype.sqr=function(f){return this.mul(f,f)},re.prototype.sqrt=function(f){if(f.isZero())return f.clone();var b=this.m.andln(3);if(r(b%2===1),b===3){var g=this.m.add(new i(1)).iushrn(2);return this.pow(f,g)}for(var d=this.m.subn(1),_=0;!d.isZero()&&d.andln(1)===0;)_++,d.iushrn(1);r(!d.isZero());var k=new i(1).toRed(this),H=k.redNeg(),T=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);this.pow(c,T).cmp(H)!==0;)c.redIAdd(H);for(var O=this.pow(c,d),N=this.pow(f,d.addn(1).iushrn(1)),le=this.pow(f,d),ce=_;le.cmp(k)!==0;){for(var Te=le,qe=0;Te.cmp(k)!==0;qe++)Te=Te.redSqr();r(qe<ce);var Fe=this.pow(O,new i(1).iushln(ce-qe-1));N=N.redMul(Fe),O=Fe.redSqr(),le=le.redMul(O),ce=qe}return N},re.prototype.invm=function(f){var b=f._invmp(this.m);return b.negative!==0?(b.negative=0,this.imod(b).redNeg()):this.imod(b)},re.prototype.pow=function(f,b){if(b.isZero())return new i(1).toRed(this);if(b.cmpn(1)===0)return f.clone();var g=4,d=new Array(1<<g);d[0]=new i(1).toRed(this),d[1]=f;for(var _=2;_<d.length;_++)d[_]=this.mul(d[_-1],f);var k=d[0],H=0,T=0,c=b.bitLength()%26;for(c===0&&(c=26),_=b.length-1;_>=0;_--){for(var O=b.words[_],N=c-1;N>=0;N--){var le=O>>N&1;if(k!==d[0]&&(k=this.sqr(k)),le===0&&H===0){T=0;continue}H<<=1,H|=le,T++,!(T!==g&&(_!==0||N!==0))&&(k=this.mul(k,d[H]),T=0,H=0)}c=26}return k},re.prototype.convertTo=function(f){var b=f.umod(this.m);return b===f?b.clone():b},re.prototype.convertFrom=function(f){var b=f.clone();return b.red=null,b},i.mont=function(f){return new ye(f)};function ye(U){re.call(this,U),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(ye,re),ye.prototype.convertTo=function(f){return this.imod(f.ushln(this.shift))},ye.prototype.convertFrom=function(f){var b=this.imod(f.mul(this.rinv));return b.red=null,b},ye.prototype.imul=function(f,b){if(f.isZero()||b.isZero())return f.words[0]=0,f.length=1,f;var g=f.imul(b),d=g.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=g.isub(d).iushrn(this.shift),k=_;return _.cmp(this.m)>=0?k=_.isub(this.m):_.cmpn(0)<0&&(k=_.iadd(this.m)),k._forceRed(this)},ye.prototype.mul=function(f,b){if(f.isZero()||b.isZero())return new i(0)._forceRed(this);var g=f.mul(b),d=g.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=g.isub(d).iushrn(this.shift),k=_;return _.cmp(this.m)>=0?k=_.isub(this.m):_.cmpn(0)<0&&(k=_.iadd(this.m)),k._forceRed(this)},ye.prototype.invm=function(f){var b=this.imod(f._invmp(this.m).mul(this.r2));return b._forceRed(this)}})(typeof zc>"u"||zc,yh)});var _h=W(Lr=>{"use strict";x();S();var qy=Lr&&Lr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Lr,"__esModule",{value:!0});Lr.stripHexPrefix=Lr.isHexPrefixed=Lr.getLength=Lr.decode=Lr.encode=void 0;var Ry=qy(fr());function vh(t){if(Array.isArray(t)){let e=[];for(let n=0;n<t.length;n++)e.push(vh(t[n]));let r=v.Buffer.concat(e);return v.Buffer.concat([mh(r.length,192),r])}else{let e=Yc(t);return e.length===1&&e[0]<128?e:v.Buffer.concat([mh(e.length,128),e])}}Lr.encode=vh;function Wc(t,e){if(t[0]==="0"&&t[1]==="0")throw new Error("invalid RLP: extra zeros");return parseInt(t,e)}function mh(t,e){if(t<56)return v.Buffer.from([t+e]);{let r=Gc(t),n=r.length/2,i=Gc(e+55+n);return v.Buffer.from(i+r,"hex")}}function Ny(t,e=!1){if(!t||t.length===0)return v.Buffer.from([]);let r=Yc(t),n=$c(r);if(e)return n;if(n.remainder.length!==0)throw new Error("invalid remainder");return n.data}Lr.decode=Ny;function Ly(t){if(!t||t.length===0)return v.Buffer.from([]);let e=Yc(t),r=e[0];if(r<=127)return e.length;if(r<=183)return r-127;if(r<=191)return r-182;if(r<=247)return r-191;{let n=r-246,i=Wc(e.slice(1,n).toString("hex"),16);return n+i}}Lr.getLength=Ly;function $c(t){let e,r,n,i,o,a=[],s=t[0];if(s<=127)return{data:t.slice(0,1),remainder:t.slice(1)};if(s<=183){if(e=s-127,s===128?n=v.Buffer.from([]):n=t.slice(1,e),e===2&&n[0]<128)throw new Error("invalid rlp encoding: byte must be less 0x80");return{data:n,remainder:t.slice(e)}}else if(s<=191){if(r=s-182,t.length-1<r)throw new Error("invalid RLP: not enough bytes for string length");if(e=Wc(t.slice(1,r).toString("hex"),16),e<=55)throw new Error("invalid RLP: expected string length to be greater than 55");if(n=t.slice(r,e+r),n.length<e)throw new Error("invalid RLP: not enough bytes for string");return{data:n,remainder:t.slice(e+r)}}else if(s<=247){for(e=s-191,i=t.slice(1,e);i.length;)o=$c(i),a.push(o.data),i=o.remainder;return{data:a,remainder:t.slice(e)}}else{r=s-246,e=Wc(t.slice(1,r).toString("hex"),16);let u=r+e;if(u>t.length)throw new Error("invalid rlp: total length is larger than the data");if(i=t.slice(r,u),i.length===0)throw new Error("invalid rlp, List has a invalid length");for(;i.length;)o=$c(i),a.push(o.data),i=o.remainder;return{data:a,remainder:t.slice(u)}}}function Zc(t){return t.slice(0,2)==="0x"}Lr.isHexPrefixed=Zc;function wh(t){return Zc(t)?t.slice(2):t}Lr.stripHexPrefix=wh;function Gc(t){if(t<0)throw new Error("Invalid integer as argument, must be unsigned!");let e=t.toString(16);return e.length%2?`0${e}`:e}function jy(t){return t.length%2?`0${t}`:t}function Hy(t){let e=Gc(t);return v.Buffer.from(e,"hex")}function Yc(t){if(!v.Buffer.isBuffer(t)){if(typeof t=="string")return Zc(t)?v.Buffer.from(jy(wh(t)),"hex"):v.Buffer.from(t);if(typeof t=="number"||typeof t=="bigint")return t?Hy(t):v.Buffer.from([]);if(t==null)return v.Buffer.from([]);if(t instanceof Uint8Array)return v.Buffer.from(t);if(Ry.default.isBN(t))return v.Buffer.from(t.toArray());throw new Error("invalid type")}return t}});var xh=W(jo=>{"use strict";x();S();Object.defineProperty(jo,"__esModule",{value:!0});jo.validateHexString=jo.isHexString=void 0;function Ky(t,e){return t.match(/^0x[0-9A-Fa-f]*$/)?!(e&&t.length!==2+2*e):!1}jo.isHexString=Ky;function Dy(t){if(!t)return!1;let e=t.toLowerCase().startsWith("0x")?t.substring(2).toLowerCase():t.toLowerCase();return!(e.length===0||e.length%2!==0||!e.match(/^[0-9A-Fa-f]*$/))}jo.validateHexString=Dy});var Sh=W(If=>{"use strict";x();S();Object.defineProperty(If,"__esModule",{value:!0});If.encode=void 0;function Vy(t){var e="0123456789abcdef";function r(Y){var Z,ne="";for(Z=0;Z<=3;Z++)ne+=e.charAt(Y>>Z*8+4&15)+e.charAt(Y>>Z*8&15);return ne}function n(Y,Z){var ne=(Y&65535)+(Z&65535),re=(Y>>16)+(Z>>16)+(ne>>16);return re<<16|ne&65535}function i(Y,Z){return Y<<Z|Y>>>32-Z}function o(Y,Z,ne,re,ye,U){return n(i(n(n(Z,Y),n(re,U)),ye),ne)}function a(Y,Z,ne,re,ye,U,f){return o(Z&ne|~Z&re,Y,Z,ye,U,f)}function s(Y,Z,ne,re,ye,U,f){return o(Z&re|ne&~re,Y,Z,ye,U,f)}function u(Y,Z,ne,re,ye,U,f){return o(Z^ne^re,Y,Z,ye,U,f)}function h(Y,Z,ne,re,ye,U,f){return o(ne^(Z|~re),Y,Z,ye,U,f)}function w(Y){var Z,ne=(Y.length+8>>6)+1,re=new Array(ne*16);for(Z=0;Z<ne*16;Z++)re[Z]=0;for(Z=0;Z<Y.length;Z++)re[Z>>2]|=Y.charCodeAt(Z)<<Z%4*8;return re[Z>>2]|=128<<Z%4*8,re[ne*16-2]=Y.length*8,re}var p,M=w(""+t),A=1732584193,P=-271733879,E=-1732584194,q=271733878,z,J,$,ee;for(p=0;p<M.length;p+=16)z=A,J=P,$=E,ee=q,A=a(A,P,E,q,M[p+0],7,-680876936),q=a(q,A,P,E,M[p+1],12,-389564586),E=a(E,q,A,P,M[p+2],17,606105819),P=a(P,E,q,A,M[p+3],22,-1044525330),A=a(A,P,E,q,M[p+4],7,-176418897),q=a(q,A,P,E,M[p+5],12,1200080426),E=a(E,q,A,P,M[p+6],17,-1473231341),P=a(P,E,q,A,M[p+7],22,-45705983),A=a(A,P,E,q,M[p+8],7,1770035416),q=a(q,A,P,E,M[p+9],12,-1958414417),E=a(E,q,A,P,M[p+10],17,-42063),P=a(P,E,q,A,M[p+11],22,-1990404162),A=a(A,P,E,q,M[p+12],7,1804603682),q=a(q,A,P,E,M[p+13],12,-40341101),E=a(E,q,A,P,M[p+14],17,-1502002290),P=a(P,E,q,A,M[p+15],22,1236535329),A=s(A,P,E,q,M[p+1],5,-165796510),q=s(q,A,P,E,M[p+6],9,-1069501632),E=s(E,q,A,P,M[p+11],14,643717713),P=s(P,E,q,A,M[p+0],20,-373897302),A=s(A,P,E,q,M[p+5],5,-701558691),q=s(q,A,P,E,M[p+10],9,38016083),E=s(E,q,A,P,M[p+15],14,-660478335),P=s(P,E,q,A,M[p+4],20,-405537848),A=s(A,P,E,q,M[p+9],5,568446438),q=s(q,A,P,E,M[p+14],9,-1019803690),E=s(E,q,A,P,M[p+3],14,-187363961),P=s(P,E,q,A,M[p+8],20,1163531501),A=s(A,P,E,q,M[p+13],5,-1444681467),q=s(q,A,P,E,M[p+2],9,-51403784),E=s(E,q,A,P,M[p+7],14,1735328473),P=s(P,E,q,A,M[p+12],20,-1926607734),A=u(A,P,E,q,M[p+5],4,-378558),q=u(q,A,P,E,M[p+8],11,-2022574463),E=u(E,q,A,P,M[p+11],16,1839030562),P=u(P,E,q,A,M[p+14],23,-35309556),A=u(A,P,E,q,M[p+1],4,-1530992060),q=u(q,A,P,E,M[p+4],11,1272893353),E=u(E,q,A,P,M[p+7],16,-155497632),P=u(P,E,q,A,M[p+10],23,-1094730640),A=u(A,P,E,q,M[p+13],4,681279174),q=u(q,A,P,E,M[p+0],11,-358537222),E=u(E,q,A,P,M[p+3],16,-722521979),P=u(P,E,q,A,M[p+6],23,76029189),A=u(A,P,E,q,M[p+9],4,-640364487),q=u(q,A,P,E,M[p+12],11,-421815835),E=u(E,q,A,P,M[p+15],16,530742520),P=u(P,E,q,A,M[p+2],23,-995338651),A=h(A,P,E,q,M[p+0],6,-198630844),q=h(q,A,P,E,M[p+7],10,1126891415),E=h(E,q,A,P,M[p+14],15,-1416354905),P=h(P,E,q,A,M[p+5],21,-57434055),A=h(A,P,E,q,M[p+12],6,1700485571),q=h(q,A,P,E,M[p+3],10,-1894986606),E=h(E,q,A,P,M[p+10],15,-1051523),P=h(P,E,q,A,M[p+1],21,-2054922799),A=h(A,P,E,q,M[p+8],6,1873313359),q=h(q,A,P,E,M[p+15],10,-30611744),E=h(E,q,A,P,M[p+6],15,-1560198380),P=h(P,E,q,A,M[p+13],21,1309151649),A=h(A,P,E,q,M[p+4],6,-145523070),q=h(q,A,P,E,M[p+11],10,-1120210379),E=h(E,q,A,P,M[p+2],15,718787259),P=h(P,E,q,A,M[p+9],21,-343485551),A=n(A,z),P=n(P,J),E=n(E,$),q=n(q,ee);return r(A)+r(P)+r(E)+r(q)}If.encode=Vy});var Qc=W(xt=>{"use strict";x();S();var Fy=xt&&xt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),zy=xt&&xt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Ah=xt&&xt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Fy(e,t,r);return zy(e,t),e};Object.defineProperty(xt,"__esModule",{value:!0});xt.blake2s=xt.compress=xt.IV=void 0;var Wy=Ah(Io()),Bh=Ah(Sf()),Cn=vr();xt.IV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);function vi(t,e,r,n,i){return t=t+e+i|0,n=(0,Cn.rotr)(n^t,16),r=r+n|0,e=(0,Cn.rotr)(e^r,12),{a:t,b:e,c:r,d:n}}function wi(t,e,r,n,i){return t=t+e+i|0,n=(0,Cn.rotr)(n^t,8),r=r+n|0,e=(0,Cn.rotr)(e^r,7),{a:t,b:e,c:r,d:n}}function Mh(t,e,r,n,i,o,a,s,u,h,w,p,M,A,P,E,q,z,J,$){let ee=0;for(let Y=0;Y<n;Y++)({a:i,b:u,c:M,d:q}=vi(i,u,M,q,r[e+t[ee++]])),{a:i,b:u,c:M,d:q}=wi(i,u,M,q,r[e+t[ee++]]),{a:o,b:h,c:A,d:z}=vi(o,h,A,z,r[e+t[ee++]]),{a:o,b:h,c:A,d:z}=wi(o,h,A,z,r[e+t[ee++]]),{a,b:w,c:P,d:J}=vi(a,w,P,J,r[e+t[ee++]]),{a,b:w,c:P,d:J}=wi(a,w,P,J,r[e+t[ee++]]),{a:s,b:p,c:E,d:$}=vi(s,p,E,$,r[e+t[ee++]]),{a:s,b:p,c:E,d:$}=wi(s,p,E,$,r[e+t[ee++]]),{a:i,b:h,c:P,d:$}=vi(i,h,P,$,r[e+t[ee++]]),{a:i,b:h,c:P,d:$}=wi(i,h,P,$,r[e+t[ee++]]),{a:o,b:w,c:E,d:q}=vi(o,w,E,q,r[e+t[ee++]]),{a:o,b:w,c:E,d:q}=wi(o,w,E,q,r[e+t[ee++]]),{a,b:p,c:M,d:z}=vi(a,p,M,z,r[e+t[ee++]]),{a,b:p,c:M,d:z}=wi(a,p,M,z,r[e+t[ee++]]),{a:s,b:u,c:A,d:J}=vi(s,u,A,J,r[e+t[ee++]]),{a:s,b:u,c:A,d:J}=wi(s,u,A,J,r[e+t[ee++]]);return{v0:i,v1:o,v2:a,v3:s,v4:u,v5:h,v6:w,v7:p,v8:M,v9:A,v10:P,v11:E,v12:q,v13:z,v14:J,v15:$}}xt.compress=Mh;var Xc=class extends Bh.BLAKE2{constructor(e={}){super(64,e.dkLen===void 0?32:e.dkLen,e,32,8,8),this.v0=xt.IV[0]|0,this.v1=xt.IV[1]|0,this.v2=xt.IV[2]|0,this.v3=xt.IV[3]|0,this.v4=xt.IV[4]|0,this.v5=xt.IV[5]|0,this.v6=xt.IV[6]|0,this.v7=xt.IV[7]|0;let r=e.key?e.key.length:0;if(this.v0^=this.outputLen|r<<8|1<<16|1<<24,e.salt){let n=(0,Cn.u32)((0,Cn.toBytes)(e.salt));this.v4^=n[0],this.v5^=n[1]}if(e.personalization){let n=(0,Cn.u32)((0,Cn.toBytes)(e.personalization));this.v6^=n[0],this.v7^=n[1]}if(e.key){let n=new Uint8Array(this.blockLen);n.set((0,Cn.toBytes)(e.key)),this.update(n)}}get(){let{v0:e,v1:r,v2:n,v3:i,v4:o,v5:a,v6:s,v7:u}=this;return[e,r,n,i,o,a,s,u]}set(e,r,n,i,o,a,s,u){this.v0=e|0,this.v1=r|0,this.v2=n|0,this.v3=i|0,this.v4=o|0,this.v5=a|0,this.v6=s|0,this.v7=u|0}compress(e,r,n){let{h:i,l:o}=Wy.fromBig(BigInt(this.length)),{v0:a,v1:s,v2:u,v3:h,v4:w,v5:p,v6:M,v7:A,v8:P,v9:E,v10:q,v11:z,v12:J,v13:$,v14:ee,v15:Y}=Mh(Bh.SIGMA,r,e,10,this.v0,this.v1,this.v2,this.v3,this.v4,this.v5,this.v6,this.v7,xt.IV[0],xt.IV[1],xt.IV[2],xt.IV[3],o^xt.IV[4],i^xt.IV[5],n?~xt.IV[6]:xt.IV[6],xt.IV[7]);this.v0^=a^P,this.v1^=s^E,this.v2^=u^q,this.v3^=h^z,this.v4^=w^J,this.v5^=p^$,this.v6^=M^ee,this.v7^=A^Y}destroy(){this.destroyed=!0,this.buffer32.fill(0),this.set(0,0,0,0,0,0,0,0)}};xt.blake2s=(0,Cn.wrapConstructorWithOpts)(t=>new Xc(t))});var Pf=W(Ho=>{"use strict";x();S();Object.defineProperty(Ho,"__esModule",{value:!0});Ho.pbkdf2Async=Ho.pbkdf2=void 0;var $y=xa(),kn=vr();function Eh(t,e,r,n){(0,kn.assertHash)(t);let i=(0,kn.checkOpts)({dkLen:32,asyncTick:10},n),{c:o,dkLen:a,asyncTick:s}=i;if((0,kn.assertNumber)(o),(0,kn.assertNumber)(a),(0,kn.assertNumber)(s),o<1)throw new Error("PBKDF2: iterations (c) should be >= 1");let u=(0,kn.toBytes)(e),h=(0,kn.toBytes)(r),w=new Uint8Array(a),p=$y.hmac.create(t,u),M=p._cloneInto().update(h);return{c:o,dkLen:a,asyncTick:s,DK:w,PRF:p,PRFSalt:M}}function Ih(t,e,r,n,i){return t.destroy(),e.destroy(),n&&n.destroy(),i.fill(0),r}function Gy(t,e,r,n){let{c:i,dkLen:o,DK:a,PRF:s,PRFSalt:u}=Eh(t,e,r,n),h,w=new Uint8Array(4),p=(0,kn.createView)(w),M=new Uint8Array(s.outputLen);for(let A=1,P=0;P<o;A++,P+=s.outputLen){let E=a.subarray(P,P+s.outputLen);p.setInt32(0,A,!1),(h=u._cloneInto(h)).update(w).digestInto(M),E.set(M.subarray(0,E.length));for(let q=1;q<i;q++){s._cloneInto(h).update(M).digestInto(M);for(let z=0;z<E.length;z++)E[z]^=M[z]}}return Ih(s,u,a,h,M)}Ho.pbkdf2=Gy;async function Zy(t,e,r,n){let{c:i,dkLen:o,asyncTick:a,DK:s,PRF:u,PRFSalt:h}=Eh(t,e,r,n),w,p=new Uint8Array(4),M=(0,kn.createView)(p),A=new Uint8Array(u.outputLen);for(let P=1,E=0;E<o;P++,E+=u.outputLen){let q=s.subarray(E,E+u.outputLen);M.setInt32(0,P,!1),(w=h._cloneInto(w)).update(p).digestInto(A),q.set(A.subarray(0,q.length)),await(0,kn.asyncLoop)(i-1,a,z=>{u._cloneInto(w).update(A).digestInto(A);for(let J=0;J<q.length;J++)q[J]^=A[J]})}return Ih(u,h,s,w,A)}Ho.pbkdf2Async=Zy});var Uh=W(Do=>{"use strict";x();S();Object.defineProperty(Do,"__esModule",{value:!0});Do.scryptAsync=Do.scrypt=void 0;var Th=Eo(),Oh=Pf(),Jr=vr(),wt=(t,e)=>t<<e|t>>>32-e;function Ph(t,e,r,n,i,o){let a=t[e++]^r[n++],s=t[e++]^r[n++],u=t[e++]^r[n++],h=t[e++]^r[n++],w=t[e++]^r[n++],p=t[e++]^r[n++],M=t[e++]^r[n++],A=t[e++]^r[n++],P=t[e++]^r[n++],E=t[e++]^r[n++],q=t[e++]^r[n++],z=t[e++]^r[n++],J=t[e++]^r[n++],$=t[e++]^r[n++],ee=t[e++]^r[n++],Y=t[e++]^r[n++],Z=a,ne=s,re=u,ye=h,U=w,f=p,b=M,g=A,d=P,_=E,k=q,H=z,T=J,c=$,O=ee,N=Y;for(let le=0;le<8;le+=2)U^=wt(Z+T|0,7),d^=wt(U+Z|0,9),T^=wt(d+U|0,13),Z^=wt(T+d|0,18),_^=wt(f+ne|0,7),c^=wt(_+f|0,9),ne^=wt(c+_|0,13),f^=wt(ne+c|0,18),O^=wt(k+b|0,7),re^=wt(O+k|0,9),b^=wt(re+O|0,13),k^=wt(b+re|0,18),ye^=wt(N+H|0,7),g^=wt(ye+N|0,9),H^=wt(g+ye|0,13),N^=wt(H+g|0,18),ne^=wt(Z+ye|0,7),re^=wt(ne+Z|0,9),ye^=wt(re+ne|0,13),Z^=wt(ye+re|0,18),b^=wt(f+U|0,7),g^=wt(b+f|0,9),U^=wt(g+b|0,13),f^=wt(U+g|0,18),H^=wt(k+_|0,7),d^=wt(H+k|0,9),_^=wt(d+H|0,13),k^=wt(_+d|0,18),T^=wt(N+O|0,7),c^=wt(T+N|0,9),O^=wt(c+T|0,13),N^=wt(O+c|0,18);i[o++]=a+Z|0,i[o++]=s+ne|0,i[o++]=u+re|0,i[o++]=h+ye|0,i[o++]=w+U|0,i[o++]=p+f|0,i[o++]=M+b|0,i[o++]=A+g|0,i[o++]=P+d|0,i[o++]=E+_|0,i[o++]=q+k|0,i[o++]=z+H|0,i[o++]=J+T|0,i[o++]=$+c|0,i[o++]=ee+O|0,i[o++]=Y+N|0}function Ko(t,e,r,n,i){let o=n+0,a=n+16*i;for(let s=0;s<16;s++)r[a+s]=t[e+(2*i-1)*16+s];for(let s=0;s<i;s++,o+=16,e+=16)Ph(r,a,t,e,r,o),s>0&&(a+=16),Ph(r,o,t,e+=16,r,a)}function Ch(t,e,r){let n=(0,Jr.checkOpts)({dkLen:32,asyncTick:10,maxmem:1073742848},r),{N:i,r:o,p:a,dkLen:s,asyncTick:u,maxmem:h,onProgress:w}=n;if((0,Jr.assertNumber)(i),(0,Jr.assertNumber)(o),(0,Jr.assertNumber)(a),(0,Jr.assertNumber)(s),(0,Jr.assertNumber)(u),(0,Jr.assertNumber)(h),w!==void 0&&typeof w!="function")throw new Error("progressCb should be function");let p=128*o,M=p/4;if(i<=1||(i&i-1)!==0||i>=2**(p/8)||i>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(a<0||a>(2**32-1)*32/p)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(s<0||s>(2**32-1)*32)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");let A=p*(i+a);if(A>h)throw new Error(`Scrypt: parameters too large, ${A} (128 * r * (N + p)) > ${h} (maxmem)`);let P=(0,Oh.pbkdf2)(Th.sha256,t,e,{c:1,dkLen:p*a}),E=(0,Jr.u32)(P),q=(0,Jr.u32)(new Uint8Array(p*i)),z=(0,Jr.u32)(new Uint8Array(p)),J=()=>{};if(w){let $=2*i*a,ee=Math.max(Math.floor($/1e4),1),Y=0;J=()=>{Y++,w&&(!(Y%ee)||Y===$)&&w(Y/$)}}return{N:i,r:o,p:a,dkLen:s,blockSize32:M,V:q,B32:E,B:P,tmp:z,blockMixCb:J,asyncTick:u}}function kh(t,e,r,n,i){let o=(0,Oh.pbkdf2)(Th.sha256,t,r,{c:1,dkLen:e});return r.fill(0),n.fill(0),i.fill(0),o}function Yy(t,e,r){let{N:n,r:i,p:o,dkLen:a,blockSize32:s,V:u,B32:h,B:w,tmp:p,blockMixCb:M}=Ch(t,e,r);for(let A=0;A<o;A++){let P=s*A;for(let E=0;E<s;E++)u[E]=h[P+E];for(let E=0,q=0;E<n-1;E++)Ko(u,q,u,q+=s,i),M();Ko(u,(n-1)*s,h,P,i),M();for(let E=0;E<n;E++){let q=h[P+s-16]%n;for(let z=0;z<s;z++)p[z]=h[P+z]^u[q*s+z];Ko(p,0,h,P,i),M()}}return kh(t,a,w,u,p)}Do.scrypt=Yy;async function Xy(t,e,r){let{N:n,r:i,p:o,dkLen:a,blockSize32:s,V:u,B32:h,B:w,tmp:p,blockMixCb:M,asyncTick:A}=Ch(t,e,r);for(let P=0;P<o;P++){let E=s*P;for(let z=0;z<s;z++)u[z]=h[E+z];let q=0;await(0,Jr.asyncLoop)(n-1,A,z=>{Ko(u,q,u,q+=s,i),M()}),Ko(u,(n-1)*s,h,E,i),M(),await(0,Jr.asyncLoop)(n,A,z=>{let J=h[E+s-16]%n;for(let $=0;$<s;$++)p[$]=h[E+$]^u[J*s+$];Ko(p,0,h,E,i),M()})}return kh(t,a,w,u,p)}Do.scryptAsync=Xy});var Nh=W(Un=>{"use strict";x();S();var Qy=Un&&Un.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Jy=Un&&Un.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Jc=Un&&Un.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Qy(e,t,r);return Jy(e,t),e};Object.defineProperty(Un,"__esModule",{value:!0});Un.blake3=void 0;var qh=Jc(Io()),e8=Jc(Sf()),mn=Jc(Qc()),to=vr(),en;(function(t){t[t.CHUNK_START=1]="CHUNK_START",t[t.CHUNK_END=2]="CHUNK_END",t[t.PARENT=4]="PARENT",t[t.ROOT=8]="ROOT",t[t.KEYED_HASH=16]="KEYED_HASH",t[t.DERIVE_KEY_CONTEXT=32]="DERIVE_KEY_CONTEXT",t[t.DERIVE_KEY_MATERIAL=64]="DERIVE_KEY_MATERIAL"})(en||(en={}));var Rh=(()=>{let t=Array.from({length:16},(n,i)=>i),e=n=>[2,6,3,10,7,0,4,13,1,11,12,5,9,14,15,8].map(i=>n[i]),r=[];for(let n=0,i=t;n<7;n++,i=e(i))r.push(...i);return Uint8Array.from(r)})(),Sa=class extends e8.BLAKE2{constructor(e={},r=0){if(super(64,e.dkLen===void 0?32:e.dkLen,{},Number.MAX_SAFE_INTEGER,0,0),this.flags=0,this.chunkPos=0,this.chunksDone=0,this.stack=[],this.posOut=0,this.bufferOut32=new Uint32Array(16),this.chunkOut=0,this.enableXOF=!0,this.outputLen=e.dkLen===void 0?32:e.dkLen,(0,to.assertNumber)(this.outputLen),e.key!==void 0&&e.context!==void 0)throw new Error("Blake3: only key or context can be specified at same time");if(e.key!==void 0){let n=(0,to.toBytes)(e.key);if(n.length!==32)throw new Error("Blake3: key should be 32 byte");this.IV=(0,to.u32)(n),this.flags=r|en.KEYED_HASH}else if(e.context!==void 0){let n=new Sa({dkLen:32},en.DERIVE_KEY_CONTEXT).update(e.context).digest();this.IV=(0,to.u32)(n),this.flags=r|en.DERIVE_KEY_MATERIAL}else this.IV=mn.IV.slice(),this.flags=r;this.state=this.IV.slice(),this.bufferOut=(0,to.u8)(this.bufferOut32)}get(){return[]}set(){}b2Compress(e,r,n,i=0){let{state:o,pos:a}=this,{h:s,l:u}=qh.fromBig(BigInt(e),!0),{v0:h,v1:w,v2:p,v3:M,v4:A,v5:P,v6:E,v7:q,v8:z,v9:J,v10:$,v11:ee,v12:Y,v13:Z,v14:ne,v15:re}=mn.compress(Rh,i,n,7,o[0],o[1],o[2],o[3],o[4],o[5],o[6],o[7],mn.IV[0],mn.IV[1],mn.IV[2],mn.IV[3],s,u,a,r);o[0]=h^z,o[1]=w^J,o[2]=p^$,o[3]=M^ee,o[4]=A^Y,o[5]=P^Z,o[6]=E^ne,o[7]=q^re}compress(e,r=0,n=!1){let i=this.flags;if(this.chunkPos||(i|=en.CHUNK_START),(this.chunkPos===15||n)&&(i|=en.CHUNK_END),n||(this.pos=this.blockLen),this.b2Compress(this.chunksDone,i,e,r),this.chunkPos+=1,this.chunkPos===16||n){let o=this.state;this.state=this.IV.slice();for(let a,s=this.chunksDone+1;(n||!(s&1))&&(a=this.stack.pop());s>>=1)this.buffer32.set(a,0),this.buffer32.set(o,8),this.pos=this.blockLen,this.b2Compress(0,this.flags|en.PARENT,this.buffer32,0),o=this.state,this.state=this.IV.slice();this.chunksDone++,this.chunkPos=0,this.stack.push(o)}this.pos=0}_cloneInto(e){e=super._cloneInto(e);let{IV:r,flags:n,state:i,chunkPos:o,posOut:a,chunkOut:s,stack:u,chunksDone:h}=this;return e.state.set(i.slice()),e.stack=u.map(w=>Uint32Array.from(w)),e.IV.set(r),e.flags=n,e.chunkPos=o,e.chunksDone=h,e.posOut=a,e.chunkOut=s,e.enableXOF=this.enableXOF,e.bufferOut32.set(this.bufferOut32),e}destroy(){this.destroyed=!0,this.state.fill(0),this.buffer32.fill(0),this.IV.fill(0),this.bufferOut32.fill(0);for(let e of this.stack)e.fill(0)}b2CompressOut(){let{state:e,pos:r,flags:n,buffer32:i,bufferOut32:o}=this,{h:a,l:s}=qh.fromBig(BigInt(this.chunkOut++)),{v0:u,v1:h,v2:w,v3:p,v4:M,v5:A,v6:P,v7:E,v8:q,v9:z,v10:J,v11:$,v12:ee,v13:Y,v14:Z,v15:ne}=mn.compress(Rh,0,i,7,e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],mn.IV[0],mn.IV[1],mn.IV[2],mn.IV[3],s,a,r,n);o[0]=u^q,o[1]=h^z,o[2]=w^J,o[3]=p^$,o[4]=M^ee,o[5]=A^Y,o[6]=P^Z,o[7]=E^ne,o[8]=e[0]^q,o[9]=e[1]^z,o[10]=e[2]^J,o[11]=e[3]^$,o[12]=e[4]^ee,o[13]=e[5]^Y,o[14]=e[6]^Z,o[15]=e[7]^ne,this.posOut=0}finish(){if(this.finished)return;this.finished=!0,this.buffer.fill(0,this.pos);let e=this.flags|en.ROOT;this.stack.length?(e|=en.PARENT,this.compress(this.buffer32,0,!0),this.chunksDone=0,this.pos=this.blockLen):e|=(this.chunkPos?0:en.CHUNK_START)|en.CHUNK_END,this.flags=e,this.b2CompressOut()}writeInto(e){if(this.destroyed)throw new Error("instance is destroyed");if(!(e instanceof Uint8Array))throw new Error("Blake3: Invalid output buffer");this.finish();let{blockLen:r,bufferOut:n}=this;for(let i=0,o=e.length;i<o;){this.posOut>=r&&this.b2CompressOut();let a=Math.min(this.blockLen-this.posOut,o-i);e.set(n.subarray(this.posOut,this.posOut+a),i),this.posOut+=a,i+=a}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF impossible after digest call");return this.writeInto(e)}xof(e){return(0,to.assertNumber)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(e.length<this.outputLen)throw new Error("Blake3: Invalid output buffer");if(this.finished)throw new Error("digest() was already called");return this.enableXOF=!1,this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}};Un.blake3=(0,to.wrapConstructorWithOpts)(t=>new Sa(t))});var ro=W(tt=>{"use strict";x();S();var Lh=tt&&tt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),t8=tt&&tt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),zt=tt&&tt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Lh(e,t,r)},el=tt&&tt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Lh(e,t,r);return t8(e,t),e};Object.defineProperty(tt,"__esModule",{value:!0});tt.randomBytes=tt.concatBytes=tt.reverseBuffer=tt.md5=tt.rlp=void 0;zt(j0(),tt);zt(sh(),tt);zt(ah(),tt);zt(fh(),tt);zt(ch(),tt);zt(wa(),tt);zt(hh(),tt);zt(bh(),tt);zt(gh(),tt);zt(Fc(),tt);tt.rlp=el(_h());zt(xh(),tt);tt.md5=el(Sh());zt(Xi(),tt);zt(Eo(),tt);zt(xa(),tt);zt(jc(),tt);zt(mf(),tt);zt(xf(),tt);zt(Dc(),tt);zt(Qc(),tt);zt(Pf(),tt);zt(Uh(),tt);zt(Nh(),tt);var r8=el(vr()),n8=_g();function i8(t){if(t.length<1)return t;let e=t.length-1,r=0;for(let n=0;n<t.length/2;n++)r=t[n],t[n]=t[e],t[e]=r,e--;return t}tt.reverseBuffer=i8;function o8(t,e){return r8.concatBytes(Uint8Array.from(t),Uint8Array.from(e))}tt.concatBytes=o8;function s8(t){return n8(t)}tt.randomBytes=s8});var Gr=W(jh=>{"use strict";x();S();var vn=jh,a8=fr(),f8=Sg(),Tf=Ag();vn.assert=f8;vn.toArray=Tf.toArray;vn.zero2=Tf.zero2;vn.toHex=Tf.toHex;vn.encode=Tf.encode;function u8(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<<e+1,o=t.clone(),a=0;a<n.length;a++){var s,u=o.andln(i-1);o.isOdd()?(u>(i>>1)-1?s=(i>>1)-u:s=u,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n}vn.getNAF=u8;function c8(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n=0,i=0,o;t.cmpn(-n)>0||e.cmpn(-i)>0;){var a=t.andln(3)+n&3,s=e.andln(3)+i&3;a===3&&(a=-1),s===3&&(s=-1);var u;(a&1)===0?u=0:(o=t.andln(7)+n&7,(o===3||o===5)&&s===2?u=-a:u=a),r[0].push(u);var h;(s&1)===0?h=0:(o=e.andln(7)+i&7,(o===3||o===5)&&a===2?h=-s:h=s),r[1].push(h),2*n===u+1&&(n=1-n),2*i===h+1&&(i=1-i),t.iushrn(1),e.iushrn(1)}return r}vn.getJSF=c8;function l8(t,e,r){var n="_"+e;t.prototype[e]=function(){return this[n]!==void 0?this[n]:this[n]=r.call(this)}}vn.cachedProperty=l8;function d8(t){return typeof t=="string"?vn.toArray(t,"hex"):t}vn.parseBytes=d8;function h8(t){return new a8(t,"hex","le")}vn.intFromLE=h8});var Aa=W((PE,Hh)=>{"use strict";x();S();var Ba=Gr(),no=fr(),Of=Ba.getNAF,b8=Ba.getJSF,Cf=Ba.assert;function _i(t,e){this.type=t,this.p=new no(e.p,16),this.red=e.prime?no.red(e.prime):no.mont(this.p),this.zero=new no(0).toRed(this.red),this.one=new no(1).toRed(this.red),this.two=new no(2).toRed(this.red),this.n=e.n&&new no(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}Hh.exports=_i;_i.prototype.point=function(){throw new Error("Not implemented")};_i.prototype.validate=function(){throw new Error("Not implemented")};_i.prototype._fixedNafMul=function(e,r){Cf(e.precomputed);var n=e._getDoubles(),i=Of(r,1,this._bitLength),o=(1<<n.step+1)-(n.step%2===0?2:1);o/=3;var a=[],s,u;for(s=0;s<i.length;s+=n.step){u=0;for(var h=s+n.step-1;h>=s;h--)u=(u<<1)+i[h];a.push(u)}for(var w=this.jpoint(null,null,null),p=this.jpoint(null,null,null),M=o;M>0;M--){for(s=0;s<a.length;s++)u=a[s],u===M?p=p.mixedAdd(n.points[s]):u===-M&&(p=p.mixedAdd(n.points[s].neg()));w=w.add(p)}return w.toP()};_i.prototype._wnafMul=function(e,r){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var o=i.points,a=Of(r,n,this._bitLength),s=this.jpoint(null,null,null),u=a.length-1;u>=0;u--){for(var h=0;u>=0&&a[u]===0;u--)h++;if(u>=0&&h++,s=s.dblp(h),u<0)break;var w=a[u];Cf(w!==0),e.type==="affine"?w>0?s=s.mixedAdd(o[w-1>>1]):s=s.mixedAdd(o[-w-1>>1].neg()):w>0?s=s.add(o[w-1>>1]):s=s.add(o[-w-1>>1].neg())}return e.type==="affine"?s.toP():s};_i.prototype._wnafMulAdd=function(e,r,n,i,o){var a=this._wnafT1,s=this._wnafT2,u=this._wnafT3,h=0,w,p,M;for(w=0;w<i;w++){M=r[w];var A=M._getNAFPoints(e);a[w]=A.wnd,s[w]=A.points}for(w=i-1;w>=1;w-=2){var P=w-1,E=w;if(a[P]!==1||a[E]!==1){u[P]=Of(n[P],a[P],this._bitLength),u[E]=Of(n[E],a[E],this._bitLength),h=Math.max(u[P].length,h),h=Math.max(u[E].length,h);continue}var q=[r[P],null,null,r[E]];r[P].y.cmp(r[E].y)===0?(q[1]=r[P].add(r[E]),q[2]=r[P].toJ().mixedAdd(r[E].neg())):r[P].y.cmp(r[E].y.redNeg())===0?(q[1]=r[P].toJ().mixedAdd(r[E]),q[2]=r[P].add(r[E].neg())):(q[1]=r[P].toJ().mixedAdd(r[E]),q[2]=r[P].toJ().mixedAdd(r[E].neg()));var z=[-3,-1,-5,-7,0,7,5,1,3],J=b8(n[P],n[E]);for(h=Math.max(J[0].length,h),u[P]=new Array(h),u[E]=new Array(h),p=0;p<h;p++){var $=J[0][p]|0,ee=J[1][p]|0;u[P][p]=z[($+1)*3+(ee+1)],u[E][p]=0,s[P]=q}}var Y=this.jpoint(null,null,null),Z=this._wnafT4;for(w=h;w>=0;w--){for(var ne=0;w>=0;){var re=!0;for(p=0;p<i;p++)Z[p]=u[p][w]|0,Z[p]!==0&&(re=!1);if(!re)break;ne++,w--}if(w>=0&&ne++,Y=Y.dblp(ne),w<0)break;for(p=0;p<i;p++){var ye=Z[p];ye!==0&&(ye>0?M=s[p][ye-1>>1]:ye<0&&(M=s[p][-ye-1>>1].neg()),M.type==="affine"?Y=Y.mixedAdd(M):Y=Y.add(M))}}for(w=0;w<i;w++)s[w]=null;return o?Y:Y.toP()};function tn(t,e){this.curve=t,this.type=e,this.precomputed=null}_i.BasePoint=tn;tn.prototype.eq=function(){throw new Error("Not implemented")};tn.prototype.validate=function(){return this.curve.validate(this)};_i.prototype.decodePoint=function(e,r){e=Ba.toArray(e,r);var n=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*n){e[0]===6?Cf(e[e.length-1]%2===0):e[0]===7&&Cf(e[e.length-1]%2===1);var i=this.point(e.slice(1,1+n),e.slice(1+n,1+2*n));return i}else if((e[0]===2||e[0]===3)&&e.length-1===n)return this.pointFromX(e.slice(1,1+n),e[0]===3);throw new Error("Unknown point format")};tn.prototype.encodeCompressed=function(e){return this.encode(e,!0)};tn.prototype._encode=function(e){var r=this.curve.p.byteLength(),n=this.getX().toArray("be",r);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",r))};tn.prototype.encode=function(e,r){return Ba.encode(this._encode(r),e)};tn.prototype.precompute=function(e){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,e),r.beta=this._getBeta(),this.precomputed=r,this};tn.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return r?r.points.length>=Math.ceil((e.bitLength()+1)/r.step):!1};tn.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,o=0;o<r;o+=e){for(var a=0;a<e;a++)i=i.dbl();n.push(i)}return{step:e,points:n}};tn.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var r=[this],n=(1<<e)-1,i=n===1?null:this.dbl(),o=1;o<n;o++)r[o]=r[o-1].add(i);return{wnd:e,points:r}};tn.prototype._getBeta=function(){return null};tn.prototype.dblp=function(e){for(var r=this,n=0;n<e;n++)r=r.dbl();return r}});var Dh=W((CE,Kh)=>{"use strict";x();S();var p8=Gr(),Wt=fr(),tl=_c(),Vo=Aa(),g8=p8.assert;function rn(t){Vo.call(this,"short",t),this.a=new Wt(t.a,16).toRed(this.red),this.b=new Wt(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}tl(rn,Vo);Kh.exports=rn;rn.prototype._getEndomorphism=function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,n;if(e.beta)r=new Wt(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);r=i[0].cmp(i[1])<0?i[0]:i[1],r=r.toRed(this.red)}if(e.lambda)n=new Wt(e.lambda,16);else{var o=this._getEndoRoots(this.n);this.g.mul(o[0]).x.cmp(this.g.x.redMul(r))===0?n=o[0]:(n=o[1],g8(this.g.mul(n).x.cmp(this.g.x.redMul(r))===0))}var a;return e.basis?a=e.basis.map(function(s){return{a:new Wt(s.a,16),b:new Wt(s.b,16)}}):a=this._getEndoBasis(n),{beta:r,lambda:n,basis:a}}};rn.prototype._getEndoRoots=function(e){var r=e===this.p?this.red:Wt.mont(e),n=new Wt(2).toRed(r).redInvm(),i=n.redNeg(),o=new Wt(3).toRed(r).redNeg().redSqrt().redMul(n),a=i.redAdd(o).fromRed(),s=i.redSub(o).fromRed();return[a,s]};rn.prototype._getEndoBasis=function(e){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=e,i=this.n.clone(),o=new Wt(1),a=new Wt(0),s=new Wt(0),u=new Wt(1),h,w,p,M,A,P,E,q=0,z,J;n.cmpn(0)!==0;){var $=i.div(n);z=i.sub($.mul(n)),J=s.sub($.mul(o));var ee=u.sub($.mul(a));if(!p&&z.cmp(r)<0)h=E.neg(),w=o,p=z.neg(),M=J;else if(p&&++q===2)break;E=z,i=n,n=z,s=o,o=J,u=a,a=ee}A=z.neg(),P=J;var Y=p.sqr().add(M.sqr()),Z=A.sqr().add(P.sqr());return Z.cmp(Y)>=0&&(A=h,P=w),p.negative&&(p=p.neg(),M=M.neg()),A.negative&&(A=A.neg(),P=P.neg()),[{a:p,b:M},{a:A,b:P}]};rn.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],o=i.b.mul(e).divRound(this.n),a=n.b.neg().mul(e).divRound(this.n),s=o.mul(n.a),u=a.mul(i.a),h=o.mul(n.b),w=a.mul(i.b),p=e.sub(s).sub(u),M=h.add(w).neg();return{k1:p,k2:M}};rn.prototype.pointFromX=function(e,r){e=new Wt(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var o=i.fromRed().isOdd();return(r&&!o||!r&&o)&&(i=i.redNeg()),this.point(e,i)};rn.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),o=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(o).cmpn(0)===0};rn.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,o=this._endoWnafT2,a=0;a<e.length;a++){var s=this._endoSplit(r[a]),u=e[a],h=u._getBeta();s.k1.negative&&(s.k1.ineg(),u=u.neg(!0)),s.k2.negative&&(s.k2.ineg(),h=h.neg(!0)),i[a*2]=u,i[a*2+1]=h,o[a*2]=s.k1,o[a*2+1]=s.k2}for(var w=this._wnafMulAdd(1,i,o,a*2,n),p=0;p<a*2;p++)i[p]=null,o[p]=null;return w};function dr(t,e,r,n){Vo.BasePoint.call(this,t,"affine"),e===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new Wt(e,16),this.y=new Wt(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}tl(dr,Vo.BasePoint);rn.prototype.point=function(e,r,n){return new dr(this,e,r,n)};rn.prototype.pointFromJSON=function(e,r){return dr.fromJSON(this,e,r)};dr.prototype._getBeta=function(){if(!!this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,i=function(o){return n.point(o.x.redMul(n.endo.beta),o.y)};e.beta=r,r.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(i)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(i)}}}return r}};dr.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]};dr.fromJSON=function(e,r,n){typeof r=="string"&&(r=JSON.parse(r));var i=e.point(r[0],r[1],n);if(!r[2])return i;function o(s){return e.point(s[0],s[1],n)}var a=r[2];return i.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[i].concat(a.doubles.points.map(o))},naf:a.naf&&{wnd:a.naf.wnd,points:[i].concat(a.naf.points.map(o))}},i};dr.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};dr.prototype.isInfinity=function(){return this.inf};dr.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};dr.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),o=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),a=o.redSqr().redISub(this.x.redAdd(this.x)),s=o.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,s)};dr.prototype.getX=function(){return this.x.fromRed()};dr.prototype.getY=function(){return this.y.fromRed()};dr.prototype.mul=function(e){return e=new Wt(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};dr.prototype.mulAdd=function(e,r,n){var i=[this,r],o=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,o):this.curve._wnafMulAdd(1,i,o,2)};dr.prototype.jmulAdd=function(e,r,n){var i=[this,r],o=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,o,!0):this.curve._wnafMulAdd(1,i,o,2,!0)};dr.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};dr.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(o){return o.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};dr.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function wr(t,e,r,n){Vo.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Wt(0)):(this.x=new Wt(e,16),this.y=new Wt(r,16),this.z=new Wt(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}tl(wr,Vo.BasePoint);rn.prototype.jpoint=function(e,r,n){return new wr(this,e,r,n)};wr.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};wr.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};wr.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),o=e.x.redMul(n),a=this.y.redMul(r.redMul(e.z)),s=e.y.redMul(n.redMul(this.z)),u=i.redSub(o),h=a.redSub(s);if(u.cmpn(0)===0)return h.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var w=u.redSqr(),p=w.redMul(u),M=i.redMul(w),A=h.redSqr().redIAdd(p).redISub(M).redISub(M),P=h.redMul(M.redISub(A)).redISub(a.redMul(p)),E=this.z.redMul(e.z).redMul(u);return this.curve.jpoint(A,P,E)};wr.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),o=this.y,a=e.y.redMul(r).redMul(this.z),s=n.redSub(i),u=o.redSub(a);if(s.cmpn(0)===0)return u.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var h=s.redSqr(),w=h.redMul(s),p=n.redMul(h),M=u.redSqr().redIAdd(w).redISub(p).redISub(p),A=u.redMul(p.redISub(M)).redISub(o.redMul(w)),P=this.z.redMul(s);return this.curve.jpoint(M,A,P)};wr.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r<e;r++)n=n.dbl();return n}var i=this.curve.a,o=this.curve.tinv,a=this.x,s=this.y,u=this.z,h=u.redSqr().redSqr(),w=s.redAdd(s);for(r=0;r<e;r++){var p=a.redSqr(),M=w.redSqr(),A=M.redSqr(),P=p.redAdd(p).redIAdd(p).redIAdd(i.redMul(h)),E=a.redMul(M),q=P.redSqr().redISub(E.redAdd(E)),z=E.redISub(q),J=P.redMul(z);J=J.redIAdd(J).redISub(A);var $=w.redMul(u);r+1<e&&(h=h.redMul(A)),a=q,u=$,w=J}return this.curve.jpoint(a,w.redMul(o),u)};wr.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};wr.prototype._zeroDbl=function(){var e,r,n;if(this.zOne){var i=this.x.redSqr(),o=this.y.redSqr(),a=o.redSqr(),s=this.x.redAdd(o).redSqr().redISub(i).redISub(a);s=s.redIAdd(s);var u=i.redAdd(i).redIAdd(i),h=u.redSqr().redISub(s).redISub(s),w=a.redIAdd(a);w=w.redIAdd(w),w=w.redIAdd(w),e=h,r=u.redMul(s.redISub(h)).redISub(w),n=this.y.redAdd(this.y)}else{var p=this.x.redSqr(),M=this.y.redSqr(),A=M.redSqr(),P=this.x.redAdd(M).redSqr().redISub(p).redISub(A);P=P.redIAdd(P);var E=p.redAdd(p).redIAdd(p),q=E.redSqr(),z=A.redIAdd(A);z=z.redIAdd(z),z=z.redIAdd(z),e=q.redISub(P).redISub(P),r=E.redMul(P.redISub(e)).redISub(z),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,r,n)};wr.prototype._threeDbl=function(){var e,r,n;if(this.zOne){var i=this.x.redSqr(),o=this.y.redSqr(),a=o.redSqr(),s=this.x.redAdd(o).redSqr().redISub(i).redISub(a);s=s.redIAdd(s);var u=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),h=u.redSqr().redISub(s).redISub(s);e=h;var w=a.redIAdd(a);w=w.redIAdd(w),w=w.redIAdd(w),r=u.redMul(s.redISub(h)).redISub(w),n=this.y.redAdd(this.y)}else{var p=this.z.redSqr(),M=this.y.redSqr(),A=this.x.redMul(M),P=this.x.redSub(p).redMul(this.x.redAdd(p));P=P.redAdd(P).redIAdd(P);var E=A.redIAdd(A);E=E.redIAdd(E);var q=E.redAdd(E);e=P.redSqr().redISub(q),n=this.y.redAdd(this.z).redSqr().redISub(M).redISub(p);var z=M.redSqr();z=z.redIAdd(z),z=z.redIAdd(z),z=z.redIAdd(z),r=P.redMul(E.redISub(e)).redISub(z)}return this.curve.jpoint(e,r,n)};wr.prototype._dbl=function(){var e=this.curve.a,r=this.x,n=this.y,i=this.z,o=i.redSqr().redSqr(),a=r.redSqr(),s=n.redSqr(),u=a.redAdd(a).redIAdd(a).redIAdd(e.redMul(o)),h=r.redAdd(r);h=h.redIAdd(h);var w=h.redMul(s),p=u.redSqr().redISub(w.redAdd(w)),M=w.redISub(p),A=s.redSqr();A=A.redIAdd(A),A=A.redIAdd(A),A=A.redIAdd(A);var P=u.redMul(M).redISub(A),E=n.redAdd(n).redMul(i);return this.curve.jpoint(p,P,E)};wr.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr(),i=r.redSqr(),o=e.redAdd(e).redIAdd(e),a=o.redSqr(),s=this.x.redAdd(r).redSqr().redISub(e).redISub(i);s=s.redIAdd(s),s=s.redAdd(s).redIAdd(s),s=s.redISub(a);var u=s.redSqr(),h=i.redIAdd(i);h=h.redIAdd(h),h=h.redIAdd(h),h=h.redIAdd(h);var w=o.redIAdd(s).redSqr().redISub(a).redISub(u).redISub(h),p=r.redMul(w);p=p.redIAdd(p),p=p.redIAdd(p);var M=this.x.redMul(u).redISub(p);M=M.redIAdd(M),M=M.redIAdd(M);var A=this.y.redMul(w.redMul(h.redISub(w)).redISub(s.redMul(u)));A=A.redIAdd(A),A=A.redIAdd(A),A=A.redIAdd(A);var P=this.z.redAdd(s).redSqr().redISub(n).redISub(u);return this.curve.jpoint(M,A,P)};wr.prototype.mul=function(e,r){return e=new Wt(e,r),this.curve._wnafMul(this,e)};wr.prototype.eq=function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var r=this.z.redSqr(),n=e.z.redSqr();if(this.x.redMul(n).redISub(e.x.redMul(r)).cmpn(0)!==0)return!1;var i=r.redMul(this.z),o=n.redMul(e.z);return this.y.redMul(o).redISub(e.y.redMul(i)).cmpn(0)===0};wr.prototype.eqXToP=function(e){var r=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(r);if(this.x.cmp(n)===0)return!0;for(var i=e.clone(),o=this.curve.redN.redMul(r);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(o),this.x.cmp(n)===0)return!0}};wr.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};wr.prototype.isInfinity=function(){return this.z.cmpn(0)===0}});var zh=W((qE,Fh)=>{"use strict";x();S();var Fo=fr(),Vh=_c(),kf=Aa(),y8=Gr();function zo(t){kf.call(this,"mont",t),this.a=new Fo(t.a,16).toRed(this.red),this.b=new Fo(t.b,16).toRed(this.red),this.i4=new Fo(4).toRed(this.red).redInvm(),this.two=new Fo(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}Vh(zo,kf);Fh.exports=zo;zo.prototype.validate=function(e){var r=e.normalize().x,n=r.redSqr(),i=n.redMul(r).redAdd(n.redMul(this.a)).redAdd(r),o=i.redSqrt();return o.redSqr().cmp(i)===0};function hr(t,e,r){kf.BasePoint.call(this,t,"projective"),e===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Fo(e,16),this.z=new Fo(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}Vh(hr,kf.BasePoint);zo.prototype.decodePoint=function(e,r){return this.point(y8.toArray(e,r),1)};zo.prototype.point=function(e,r){return new hr(this,e,r)};zo.prototype.pointFromJSON=function(e){return hr.fromJSON(this,e)};hr.prototype.precompute=function(){};hr.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};hr.fromJSON=function(e,r){return new hr(e,r[0],r[1]||e.one)};hr.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"};hr.prototype.isInfinity=function(){return this.z.cmpn(0)===0};hr.prototype.dbl=function(){var e=this.x.redAdd(this.z),r=e.redSqr(),n=this.x.redSub(this.z),i=n.redSqr(),o=r.redSub(i),a=r.redMul(i),s=o.redMul(i.redAdd(this.curve.a24.redMul(o)));return this.curve.point(a,s)};hr.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};hr.prototype.diffAdd=function(e,r){var n=this.x.redAdd(this.z),i=this.x.redSub(this.z),o=e.x.redAdd(e.z),a=e.x.redSub(e.z),s=a.redMul(n),u=o.redMul(i),h=r.z.redMul(s.redAdd(u).redSqr()),w=r.x.redMul(s.redISub(u).redSqr());return this.curve.point(h,w)};hr.prototype.mul=function(e){for(var r=e.clone(),n=this,i=this.curve.point(null,null),o=this,a=[];r.cmpn(0)!==0;r.iushrn(1))a.push(r.andln(1));for(var s=a.length-1;s>=0;s--)a[s]===0?(n=n.diffAdd(i,o),i=i.dbl()):(i=n.diffAdd(i,o),n=n.dbl());return i};hr.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};hr.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};hr.prototype.eq=function(e){return this.getX().cmp(e.getX())===0};hr.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};hr.prototype.getX=function(){return this.normalize(),this.x.fromRed()}});var Gh=W((LE,$h)=>{"use strict";x();S();var m8=Gr(),Qn=fr(),Wh=_c(),Uf=Aa(),v8=m8.assert;function qn(t){this.twisted=(t.a|0)!==1,this.mOneA=this.twisted&&(t.a|0)===-1,this.extended=this.mOneA,Uf.call(this,"edwards",t),this.a=new Qn(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Qn(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Qn(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),v8(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(t.c|0)===1}Wh(qn,Uf);$h.exports=qn;qn.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)};qn.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)};qn.prototype.jpoint=function(e,r,n,i){return this.point(e,r,n,i)};qn.prototype.pointFromX=function(e,r){e=new Qn(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=this.c2.redSub(this.a.redMul(n)),o=this.one.redSub(this.c2.redMul(this.d).redMul(n)),a=i.redMul(o.redInvm()),s=a.redSqrt();if(s.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");var u=s.fromRed().isOdd();return(r&&!u||!r&&u)&&(s=s.redNeg()),this.point(e,s)};qn.prototype.pointFromY=function(e,r){e=new Qn(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=n.redSub(this.c2),o=n.redMul(this.d).redMul(this.c2).redSub(this.a),a=i.redMul(o.redInvm());if(a.cmp(this.zero)===0){if(r)throw new Error("invalid point");return this.point(this.zero,e)}var s=a.redSqrt();if(s.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");return s.fromRed().isOdd()!==r&&(s=s.redNeg()),this.point(s,e)};qn.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var r=e.x.redSqr(),n=e.y.redSqr(),i=r.redMul(this.a).redAdd(n),o=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(n)));return i.cmp(o)===0};function Ot(t,e,r,n,i){Uf.BasePoint.call(this,t,"projective"),e===null&&r===null&&n===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new Qn(e,16),this.y=new Qn(r,16),this.z=n?new Qn(n,16):this.curve.one,this.t=i&&new Qn(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}Wh(Ot,Uf.BasePoint);qn.prototype.pointFromJSON=function(e){return Ot.fromJSON(this,e)};qn.prototype.point=function(e,r,n,i){return new Ot(this,e,r,n,i)};Ot.fromJSON=function(e,r){return new Ot(e,r[0],r[1],r[2])};Ot.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"};Ot.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};Ot.prototype._extDbl=function(){var e=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var i=this.curve._mulA(e),o=this.x.redAdd(this.y).redSqr().redISub(e).redISub(r),a=i.redAdd(r),s=a.redSub(n),u=i.redSub(r),h=o.redMul(s),w=a.redMul(u),p=o.redMul(u),M=s.redMul(a);return this.curve.point(h,w,M,p)};Ot.prototype._projDbl=function(){var e=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),n=this.y.redSqr(),i,o,a,s,u,h;if(this.curve.twisted){s=this.curve._mulA(r);var w=s.redAdd(n);this.zOne?(i=e.redSub(r).redSub(n).redMul(w.redSub(this.curve.two)),o=w.redMul(s.redSub(n)),a=w.redSqr().redSub(w).redSub(w)):(u=this.z.redSqr(),h=w.redSub(u).redISub(u),i=e.redSub(r).redISub(n).redMul(h),o=w.redMul(s.redSub(n)),a=w.redMul(h))}else s=r.redAdd(n),u=this.curve._mulC(this.z).redSqr(),h=s.redSub(u).redSub(u),i=this.curve._mulC(e.redISub(s)).redMul(h),o=this.curve._mulC(s).redMul(r.redISub(n)),a=s.redMul(h);return this.curve.point(i,o,a)};Ot.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};Ot.prototype._extAdd=function(e){var r=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),o=this.z.redMul(e.z.redAdd(e.z)),a=n.redSub(r),s=o.redSub(i),u=o.redAdd(i),h=n.redAdd(r),w=a.redMul(s),p=u.redMul(h),M=a.redMul(h),A=s.redMul(u);return this.curve.point(w,p,A,M)};Ot.prototype._projAdd=function(e){var r=this.z.redMul(e.z),n=r.redSqr(),i=this.x.redMul(e.x),o=this.y.redMul(e.y),a=this.curve.d.redMul(i).redMul(o),s=n.redSub(a),u=n.redAdd(a),h=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(o),w=r.redMul(s).redMul(h),p,M;return this.curve.twisted?(p=r.redMul(u).redMul(o.redSub(this.curve._mulA(i))),M=s.redMul(u)):(p=r.redMul(u).redMul(o.redSub(i)),M=this.curve._mulC(s).redMul(u)),this.curve.point(w,p,M)};Ot.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)};Ot.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)};Ot.prototype.mulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!1)};Ot.prototype.jmulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!0)};Ot.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this};Ot.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};Ot.prototype.getX=function(){return this.normalize(),this.x.fromRed()};Ot.prototype.getY=function(){return this.normalize(),this.y.fromRed()};Ot.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0};Ot.prototype.eqXToP=function(e){var r=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(r)===0)return!0;for(var n=e.clone(),i=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),this.x.cmp(r)===0)return!0}};Ot.prototype.toP=Ot.prototype.normalize;Ot.prototype.mixedAdd=Ot.prototype.add});var rl=W(Zh=>{"use strict";x();S();var qf=Zh;qf.base=Aa();qf.short=Dh();qf.mont=zh();qf.edwards=Gh()});var Xh=W((FE,Yh)=>{"use strict";x();S();Yh.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}});var Rf=W(e1=>{"use strict";x();S();var il=e1,xi=B0(),nl=rl(),w8=Gr(),Qh=w8.assert;function Jh(t){t.type==="short"?this.curve=new nl.short(t):t.type==="edwards"?this.curve=new nl.edwards(t):this.curve=new nl.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,Qh(this.g.validate(),"Invalid curve"),Qh(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}il.PresetCurve=Jh;function Si(t,e){Object.defineProperty(il,t,{configurable:!0,enumerable:!0,get:function(){var r=new Jh(e);return Object.defineProperty(il,t,{configurable:!0,enumerable:!0,value:r}),r}})}Si("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:xi.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});Si("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:xi.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});Si("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:xi.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});Si("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:xi.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]});Si("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:xi.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]});Si("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:xi.sha256,gRed:!1,g:["9"]});Si("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:xi.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var ol;try{ol=Xh()}catch{ol=void 0}Si("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:xi.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",ol]})});var r1=W((YE,t1)=>{"use strict";x();S();var _8=fr(),x8=Gr(),sl=x8.assert;function Er(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}t1.exports=Er;Er.fromPublic=function(e,r,n){return r instanceof Er?r:new Er(e,{pub:r,pubEnc:n})};Er.fromPrivate=function(e,r,n){return r instanceof Er?r:new Er(e,{priv:r,privEnc:n})};Er.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};Er.prototype.getPublic=function(e,r){return typeof e=="string"&&(r=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,e):this.pub};Er.prototype.getPrivate=function(e){return e==="hex"?this.priv.toString(16,2):this.priv};Er.prototype._importPrivate=function(e,r){this.priv=new _8(e,r||16),this.priv=this.priv.umod(this.ec.curve.n)};Er.prototype._importPublic=function(e,r){if(e.x||e.y){this.ec.curve.type==="mont"?sl(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&sl(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,r)};Er.prototype.derive=function(e){return e.validate()||sl(e.validate(),"public point not validated"),e.mul(this.priv).getX()};Er.prototype.sign=function(e,r,n){return this.ec.sign(e,this,r,n)};Er.prototype.verify=function(e,r){return this.ec.verify(e,r,this)};Er.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}});var o1=W((JE,i1)=>{"use strict";x();S();var Nf=fr(),ul=Gr(),S8=ul.assert;function Ma(t,e,r){if(e instanceof Ma)return e;this._importDER(e,r)||(S8(e.r&&e.s,"Signature without r or s"),this.r=new Nf(e.r,16),this.s=new Nf(e.s,16),e.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=e.recoveryParam,this.curve=t,this.byteLength=this.curve.n.byteLength())}i1.exports=Ma;function B8(){this.place=0}function al(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,o=0,a=e.place;o<n;o++,a++)i<<=8,i|=t[a],i>>>=0;return i<=127?!1:(e.place=a,i)}function n1(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e<r;)e++;return e===0?t:t.slice(e)}Ma.prototype._importDER=function(e,r){e=ul.toArray(e,r);var n=new B8;if(e[n.place++]!==48)return!1;var i=al(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var o=al(e,n);if(o===!1)return!1;var a=e.slice(n.place,o+n.place);if(n.place+=o,e[n.place++]!==2)return!1;var s=al(e,n);if(s===!1||e.length!==s+n.place)return!1;var u=e.slice(n.place,s+n.place);if(a[0]===0)if(a[1]&128)a=a.slice(1);else return!1;if(u[0]===0)if(u[1]&128)u=u.slice(1);else return!1;return this.r=new Nf(a),this.s=new Nf(u),this.recoveryParam=null,!0};function fl(t,e){if(e<128){t.push(e);return}var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}Ma.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=n1(r),n=n1(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];fl(i,r.length),i=i.concat(r),i.push(2),fl(i,n.length);var o=i.concat(n),a=[48];return fl(a,o.length),a=a.concat(o),ul.encode(a,e)};Ma.prototype.toBytes=function(){let e=this.r.toArray("be",this.byteLength),r=this.s.toArray("be",this.byteLength);return e.concat(r)}});var u1=W((rI,f1)=>{"use strict";x();S();var io=fr(),s1=Mg(),A8=Gr(),cl=Rf(),M8=Bg(),a1=A8.assert,ll=r1(),Lf=o1();function nn(t){if(!(this instanceof nn))return new nn(t);typeof t=="string"&&(a1(Object.prototype.hasOwnProperty.call(cl,t),"Unknown curve "+t),t=cl[t]),t instanceof cl.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}f1.exports=nn;nn.prototype.keyPair=function(e){return new ll(this,e)};nn.prototype.keyFromPrivate=function(e,r){return ll.fromPrivate(this,e,r)};nn.prototype.keyFromPublic=function(e,r){return ll.fromPublic(this,e,r)};nn.prototype.genKeyPair=function(e){e||(e={});for(var r=new s1({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||M8(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new io(2));;){var o=new io(r.generate(n));if(!(o.cmp(i)>0))return o.iaddn(1),this.keyFromPrivate(o)}};nn.prototype._truncateToN=function(e,r){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};nn.prototype.sign=function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new io(e,16));for(var o=this.n.byteLength(),a=r.getPrivate().toArray("be",o),s=e.toArray("be",o),u=new s1({hash:this.hash,entropy:a,nonce:s,pers:i.pers,persEnc:i.persEnc||"utf8"}),h=this.n.sub(new io(1)),w=0;;w++){var p=i.k?i.k(w):new io(u.generate(this.n.byteLength()));if(p=this._truncateToN(p,!0),!(p.cmpn(1)<=0||p.cmp(h)>=0)){var M=this.g.mul(p);if(!M.isInfinity()){var A=M.getX(),P=A.umod(this.n);if(P.cmpn(0)!==0){var E=p.invm(this.n).mul(P.mul(r.getPrivate()).iadd(e));if(E=E.umod(this.n),E.cmpn(0)!==0){var q=(M.getY().isOdd()?1:0)|(A.cmp(P)!==0?2:0);return i.canonical&&E.cmp(this.nh)>0&&(E=this.n.sub(E),q^=1),new Lf(this.curve,{r:P,s:E,recoveryParam:q})}}}}}};nn.prototype.verify=function(e,r,n,i){e=this._truncateToN(new io(e,16)),n=this.keyFromPublic(n,i),r=new Lf(this.curve,r,"hex");var o=r.r,a=r.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s=a.invm(this.n),u=s.mul(e).umod(this.n),h=s.mul(o).umod(this.n),w;return this.curve._maxwellTrick?(w=this.g.jmulAdd(u,n.getPublic(),h),w.isInfinity()?!1:w.eqXToP(o)):(w=this.g.mulAdd(u,n.getPublic(),h),w.isInfinity()?!1:w.getX().umod(this.n).cmp(o)===0)};nn.prototype.recoverPubKey=function(t,e,r,n){a1((3&r)===r,"The recovery param is more than two bits"),e=new Lf(this.curve,e,n);var i=this.n,o=new io(t),a=e.r,s=e.s,u=r&1,h=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");h?a=this.curve.pointFromX(a.add(this.curve.n),u):a=this.curve.pointFromX(a,u);var w=e.r.invm(i),p=i.sub(o).mul(w).umod(i),M=s.mul(w).umod(i);return this.g.mulAdd(p,a,M)};nn.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new Lf(this.curve,e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch{continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}});var h1=W((oI,d1)=>{"use strict";x();S();var Ea=Gr(),l1=Ea.assert,c1=Ea.parseBytes,Wo=Ea.cachedProperty;function br(t,e){this.eddsa=t,this._secret=c1(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=c1(e.pub)}br.fromPublic=function(e,r){return r instanceof br?r:new br(e,{pub:r})};br.fromSecret=function(e,r){return r instanceof br?r:new br(e,{secret:r})};br.prototype.secret=function(){return this._secret};Wo(br,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});Wo(br,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});Wo(br,"privBytes",function(){var e=this.eddsa,r=this.hash(),n=e.encodingLength-1,i=r.slice(0,e.encodingLength);return i[0]&=248,i[n]&=127,i[n]|=64,i});Wo(br,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});Wo(br,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});Wo(br,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});br.prototype.sign=function(e){return l1(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)};br.prototype.verify=function(e,r){return this.eddsa.verify(e,r,this)};br.prototype.getSecret=function(e){return l1(this._secret,"KeyPair is public only"),Ea.encode(this.secret(),e)};br.prototype.getPublic=function(e){return Ea.encode(this.pubBytes(),e)};d1.exports=br});var p1=W((fI,b1)=>{"use strict";x();S();var E8=fr(),jf=Gr(),I8=jf.assert,Hf=jf.cachedProperty,P8=jf.parseBytes;function oo(t,e){this.eddsa=t,typeof e!="object"&&(e=P8(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),I8(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof E8&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}Hf(oo,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});Hf(oo,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});Hf(oo,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});Hf(oo,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});oo.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};oo.prototype.toHex=function(){return jf.encode(this.toBytes(),"hex").toUpperCase()};b1.exports=oo});var w1=W((lI,v1)=>{"use strict";x();S();var T8=B0(),O8=Rf(),$o=Gr(),C8=$o.assert,y1=$o.parseBytes,m1=h1(),g1=p1();function jr(t){if(C8(t==="ed25519","only tested with ed25519 so far"),!(this instanceof jr))return new jr(t);t=O8[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=T8.sha512}v1.exports=jr;jr.prototype.sign=function(e,r){e=y1(e);var n=this.keyFromSecret(r),i=this.hashInt(n.messagePrefix(),e),o=this.g.mul(i),a=this.encodePoint(o),s=this.hashInt(a,n.pubBytes(),e).mul(n.priv()),u=i.add(s).umod(this.curve.n);return this.makeSignature({R:o,S:u,Rencoded:a})};jr.prototype.verify=function(e,r,n){e=y1(e),r=this.makeSignature(r);var i=this.keyFromPublic(n),o=this.hashInt(r.Rencoded(),i.pubBytes(),e),a=this.g.mul(r.S()),s=r.R().add(i.pub().mul(o));return s.eq(a)};jr.prototype.hashInt=function(){for(var e=this.hash(),r=0;r<arguments.length;r++)e.update(arguments[r]);return $o.intFromLE(e.digest()).umod(this.curve.n)};jr.prototype.keyFromPublic=function(e){return m1.fromPublic(this,e)};jr.prototype.keyFromSecret=function(e){return m1.fromSecret(this,e)};jr.prototype.makeSignature=function(e){return e instanceof g1?e:new g1(this,e)};jr.prototype.encodePoint=function(e){var r=e.getY().toArray("le",this.encodingLength);return r[this.encodingLength-1]|=e.getX().isOdd()?128:0,r};jr.prototype.decodePoint=function(e){e=$o.parseBytes(e);var r=e.length-1,n=e.slice(0,r).concat(e[r]&-129),i=(e[r]&128)!==0,o=$o.intFromLE(n);return this.curve.pointFromY(o,i)};jr.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)};jr.prototype.decodeInt=function(e){return $o.intFromLE(e)};jr.prototype.isPoint=function(e){return e instanceof this.pointClass}});var Go=W(on=>{"use strict";x();S();Object.defineProperty(on,"__esModule",{value:!0});on.utils=on.curves=on.curve=on.eddsa=on.ec=void 0;var k8=rl();on.curve=k8;var U8=Rf();on.curves=U8;var q8=u1();on.ec=q8;var R8=w1();on.eddsa=R8;var N8=Gr();on.utils=N8});var S1=W((_1,x1)=>{"use strict";x();S();Object.defineProperty(_1,"__esModule",{value:!0});var L8=Go(),Rn=new L8.ec("secp256k1"),dt=Rn.curve,Ct=fr();function j8(t,e){let r=new Ct(e);if(r.cmp(dt.p)>=0)return null;r=r.toRed(dt.red);let n=r.redSqr().redIMul(r).redIAdd(dt.b).redSqrt();t===3!==n.isOdd()&&(n=n.redNeg());let i=r.redSqr().redIMul(r);return n.redSqr().redISub(i.redIAdd(dt.b)).isZero()?Rn.keyPair({pub:{x:r,y:n}}):null}function H8(t,e,r){let n=new Ct(e),i=new Ct(r);if(n.cmp(dt.p)>=0||i.cmp(dt.p)>=0||(n=n.toRed(dt.red),i=i.toRed(dt.red),(t===6||t===7)&&i.isOdd()!==(t===7)))return null;let o=n.redSqr().redIMul(n);return i.redSqr().redISub(o.redIAdd(dt.b)).isZero()?Rn.keyPair({pub:{x:n,y:i}}):null}function Bi(t){let e=t[0];switch(e){case 2:case 3:return t.length!==33?null:j8(e,t.subarray(1,33));case 4:case 6:case 7:return t.length!==65?null:H8(e,t.subarray(1,33),t.subarray(33,65));default:return null}}x1.exports={contextRandomize(){return 0},privateKeyVerify(t){let e=new Ct(t);return e.cmp(dt.n)<0&&!e.isZero()},privateKeyNegate(t){let e=new Ct(t);return v.Buffer.from(dt.n.sub(e).umod(dt.n).toArray("be",32))},privateKeyTweakAdd(t,e){let r=new Ct(e);return r.cmp(dt.n)>=0||(r.iadd(new Ct(t)),r.cmp(dt.n)>=0&&r.isub(dt.n),r.isZero())?null:v.Buffer.from(r.toArray("be",32))},privateKeyTweakMul(t,e){let r=new Ct(e);return r.cmp(dt.n)>=0||r.isZero()?1:(r.imul(new Ct(t)),r.cmp(dt.n)>=0&&(r=r.umod(dt.n)),v.Buffer.from(r.toArray("be",32)))},publicKeyVerify(t){let e=Bi(t);return e==null?null:e.validate().result},publicKeyCreate(t,e){let r=new Ct(t);if(r.cmp(dt.n)>=0||r.isZero())return null;let n=Rn.keyFromPrivate(t,null).getPublic();return v.Buffer.from(n.encode(null,e))},publicKeyConvert(t,e){let n=Bi(t).getPublic();return v.Buffer.from(n.encode(null,e))},publicKeyNegate(t,e){let r=Bi(t);if(r===null)return 1;let n=r.getPublic();return n.y=n.y.redNeg(),v.Buffer.from(n.encode(null,e))},publicKeyCombine(t,e){let r=new Array(t.length);for(let i=0;i<t.length;++i)if(r[i]=Bi(t[i]),r[i]===null)return null;let n=r[0].getPublic();for(let i=1;i<r.length;++i)n=n.add(r[i].pub);return n.isInfinity()?null:v.Buffer.from(n.encode(null,e))},publicKeyTweakAdd(t,e,r){let n=Bi(t);if(n===null||new Ct(e).cmp(dt.n)>=0)return null;let o=n.getPublic().add(dt.g.mul(e));return o.isInfinity()?null:v.Buffer.from(o.encode(null,r))},publicKeyTweakMul(t,e,r){let n=Bi(t);if(n===null)return null;let i=new Ct(e);if(i.cmp(dt.n)>=0||i.isZero())return null;let o=n.getPublic().mul(e);return v.Buffer.from(o.encode(null,r))},signatureNormalize(t){let e=new Ct(t.subarray(0,32)),r=new Ct(t.subarray(32,64));return e.cmp(dt.n)>=0||r.cmp(dt.n)>=0?null:(r.cmp(Rn.nh)===1&&t.set(dt.n.sub(r).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(t,e){let r=e.subarray(0,32),n=e.subarray(32,64);if(new Ct(r).cmp(dt.n)>=0||new Ct(n).cmp(dt.n)>=0)return 1;let{output:i}=t,o=i.subarray(4,4+33);o[0]=0,o.set(r,1);let a=33,s=0;for(;a>1&&o[s]===0&&!(o[s+1]&128);--a,++s);if(o=o.subarray(s),o[0]&128||a>1&&o[0]===0&&!(o[1]&128))return 1;let u=i.subarray(6+33,6+33+33);u[0]=0,u.set(n,1);let h=33,w=0;for(;h>1&&u[w]===0&&!(u[w+1]&128);--h,++w);return u=u.subarray(w),u[0]&128||h>1&&u[0]===0&&!(u[1]&128)?1:(t.outputlen=6+a+h,i[0]=48,i[1]=t.outputlen-2,i[2]=2,i[3]=o.length,i.set(o,4),i[4+a]=2,i[5+a]=u.length,i.set(u,6+a),0)},signatureImport(t,e){if(e.length<8||e.length>72||e[0]!==48||e[1]!==e.length-2||e[2]!==2)return 1;let r=e[3];if(r===0||5+r>=e.length||e[4+r]!==2)return 1;let n=e[5+r];if(n===0||6+r+n!==e.length||e[4]&128||r>1&&e[4]===0&&!(e[5]&128)||e[r+6]&128||n>1&&e[r+6]===0&&!(e[r+7]&128))return 1;let i=e.subarray(4,4+r);if(i.length===33&&i[0]===0&&(i=i.subarray(1)),i.length>32)return 1;let o=e.subarray(6+r);if(o.length===33&&o[0]===0&&(o=o.slice(1)),o.length>32)throw new Error("S length is too long");let a=new Ct(i);a.cmp(dt.n)>=0&&(a=new Ct(0));let s=new Ct(e.subarray(6+r));return s.cmp(dt.n)>=0&&(s=new Ct(0)),t.set(a.toArrayLike(Uint8Array,"be",32),0),t.set(s.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(t,e){let r=new Ct(e);return r.cmp(dt.n)>=0||r.isZero()?null:Rn.sign(t,e,{canonical:!0}).toBytes()},ecdsaVerify(t,e,r){let n={r:t.subarray(0,32),s:t.subarray(32,64)},i=new Ct(n.r),o=new Ct(n.s);if(i.cmp(dt.n)>=0||o.cmp(dt.n)>=0)return 1;if(o.cmp(Rn.nh)===1||i.isZero()||o.isZero())return 3;let a=Bi(r);if(a===null)return 2;let s=a.getPublic();return Rn.verify(e,n,s)},ecdsaRecover(t,e,r,n){let i={r:t.slice(0,32),s:t.slice(32,64)},o=new Ct(i.r),a=new Ct(i.s);if(o.cmp(dt.n)>=0||a.cmp(dt.n)>=0)return 1;if(o.isZero()||a.isZero())return 2;let s;try{s=Rn.recoverPubKey(r,i,e,null)}catch{return 2}return v.Buffer.from(s.encode(null,n))},ecdh(t,e,r,n,i,o,a){let s=Bi(e);if(s===null)return 1;let u=new Ct(r);if(u.cmp(dt.n)>=0||u.isZero())return 2;let h=s.getPublic().mul(u);if(i===void 0){let w=h.encode(null,!0),p=Rn.hash().update(w).digest();for(let M=0;M<32;++M)t[M]=p[M]}else{o||(o=new Uint8Array(32));let w=h.getX().toArray("be",32);for(let P=0;P<32;++P)o[P]=w[P];a||(a=new Uint8Array(32));let p=h.getY().toArray("be",32);for(let P=0;P<32;++P)a[P]=p[P];let M=i(o,a,n);if(!(M instanceof Uint8Array&&M.length===t.length))return 2;t.set(M)}return 0}}});var I1=W(pr=>{"use strict";x();S();var K8=pr&&pr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),D8=pr&&pr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),V8=pr&&pr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&K8(e,t,r);return D8(e,t),e};Object.defineProperty(pr,"__esModule",{value:!0});pr.fromSeed=pr.fromPublicKey=pr.fromPrivateKey=pr.fromBase58=pr.tinySecp256k1Interface=void 0;var dl=V8(ro()),F8=Xi(),z8=wa(),A1=(0,F8.base58check)(z8.sha256),M1=S1(),_r=A0(),W8=Ig();function $8(t){return{isPoint:e=>t.publicKeyVerify(e),isPrivate:e=>t.privateKeyVerify(e),pointAddScalar:(e,r,n)=>t.publicKeyTweakAdd(e,r,n),pointFromScalar:(e,r)=>t.publicKeyCreate(e,r),privateAdd:(e,r)=>t.privateKeyTweakAdd(new Uint8Array(e),r),sign:(e,r)=>t.ecdsaSign(e,r),verify:(e,r,n)=>t.ecdsaVerify(n,e,r)}}function G8(t){return{isPoint:e=>t.publicKeyVerify(e),pointCompress:(e,r)=>Uint8Array.from(t.publicKeyConvert(e,r??!0)),isPrivate:e=>t.privateKeyVerify(e),pointFromScalar:(e,r)=>{let n=t.publicKeyCreate(e,r??!0);return n==null?null:Uint8Array.from(n)},sign:(e,r,n)=>Uint8Array.from(t.ecdsaSign(e,r)),verify:(e,r,n,i)=>t.ecdsaVerify(n,e,r)}}var Ai=$8(M1);pr.tinySecp256k1Interface=G8(M1);var hl=_r.BufferN(32),Z8=_r.compile({wif:_r.UInt8,bip32:{public:_r.UInt32,private:_r.UInt32}}),Vf={messagePrefix:`Bitcoin Signed Message:
|
||
`,bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},B1=2147483648,Y8=Math.pow(2,31)-1;function X8(t){return _r.String(t)&&t.match(/^(m\/)?(\d+'?\/)*\d+'?$/)!==null}function Q8(t){return _r.UInt32(t)&&t<=Y8}var Kf=class{constructor(e,r,n,i,o=0,a=0,s=0){this.__D=e,this.__Q=r,this.chainCode=n,this.network=i,this.__DEPTH=o,this.__INDEX=a,this.__PARENT_FINGERPRINT=s,_r(Z8,i),this.lowR=!1}get depth(){return this.__DEPTH}get index(){return this.__INDEX}get parentFingerprint(){return this.__PARENT_FINGERPRINT}get publicKey(){return this.__Q===void 0&&(this.__Q=v.Buffer.from(Ai.pointFromScalar(this.__D,!0))),this.__Q}get privateKey(){return this.__D}get identifier(){return v.Buffer.from(dl.hash160(this.publicKey))}get fingerprint(){return this.identifier.slice(0,4)}get compressed(){return!0}isNeutered(){return this.__D===void 0}neutered(){return Df(this.publicKey,this.chainCode,this.network,this.depth,this.index,this.parentFingerprint)}toBase58(){let e=this.network,r=this.isNeutered()?e.bip32.public:e.bip32.private,n=v.Buffer.allocUnsafe(78);return n.writeUInt32BE(r,0),n.writeUInt8(this.depth,4),n.writeUInt32BE(this.parentFingerprint,5),n.writeUInt32BE(this.index,9),this.chainCode.copy(n,13),this.isNeutered()?this.publicKey.copy(n,45):(n.writeUInt8(0,45),this.privateKey.copy(n,46)),A1.encode(n)}toWIF(){if(!this.privateKey)throw new TypeError("Missing private key");return W8.encode(this.network.wif,this.privateKey,!0)}derive(e){_r(_r.UInt32,e);let r=e>=B1,n=v.Buffer.allocUnsafe(37);if(r){if(this.isNeutered())throw new TypeError("Missing private key for hardened child key");n[0]=0,this.privateKey.copy(n,1),n.writeUInt32BE(e,33)}else this.publicKey.copy(n,0),n.writeUInt32BE(e,33);let i=dl.hmacSHA512(this.chainCode,n),o=i.slice(0,32),a=i.slice(32);if(!Ai.isPrivate(o))return this.derive(e+1);let s;if(this.isNeutered()){let u=Ai.pointAddScalar(this.publicKey,o,!0);if(u===null)return this.derive(e+1);s=Df(u,a,this.network,this.depth+1,e,this.fingerprint.readUInt32BE(0))}else{let u=Ai.privateAdd(this.privateKey,o);if(u==null)return this.derive(e+1);s=bl(u,a,this.network,this.depth+1,e,this.fingerprint.readUInt32BE(0))}return s}deriveHardened(e){return _r(Q8,e),this.derive(e+B1)}derivePath(e){_r(X8,e);let r=e.split("/");if(r[0]==="m"){if(this.parentFingerprint)throw new TypeError("Expected master, got child");r=r.slice(1)}return r.reduce((n,i)=>{let o;return i.slice(-1)==="'"?(o=parseInt(i.slice(0,-1),10),n.deriveHardened(o)):(o=parseInt(i,10),n.derive(o))},this)}sign(e){if(!this.privateKey)throw new Error("Missing private key");return Ai.sign(e,this.privateKey)}verify(e,r){return Ai.verify(e,this.publicKey,r)}};function J8(t,e){let r=v.Buffer.from(A1.decode(t));if(r.length!==78)throw new TypeError("Invalid buffer length");e=e||Vf;let n=r.readUInt32BE(0);if(n!==e.bip32.private&&n!==e.bip32.public)throw new TypeError("Invalid network version");let i=r[4],o=r.readUInt32BE(5);if(i===0&&o!==0)throw new TypeError("Invalid parent fingerprint");let a=r.readUInt32BE(9);if(i===0&&a!==0)throw new TypeError("Invalid index");let s=r.slice(13,45),u;if(n===e.bip32.private){if(r.readUInt8(45)!==0)throw new TypeError("Invalid private key");let h=r.slice(46,78);u=bl(h,s,e,i,a,o)}else{let h=r.slice(45,78);u=Df(h,s,e,i,a,o)}return u}pr.fromBase58=J8;function E1(t,e,r){return bl(t,e,r)}pr.fromPrivateKey=E1;function bl(t,e,r,n,i,o){if(_r({privateKey:hl,chainCode:hl},{privateKey:t,chainCode:e}),r=r||Vf,!Ai.isPrivate(t))throw new TypeError("Private key not in range [1, n)");return new Kf(t,void 0,e,r,n,i,o)}function e4(t,e,r){return Df(t,e,r)}pr.fromPublicKey=e4;function Df(t,e,r,n,i,o){if(_r({publicKey:_r.BufferN(33),chainCode:hl},{publicKey:t,chainCode:e}),r=r||Vf,!Ai.isPoint(t))throw new TypeError("Point is not on the curve");return new Kf(void 0,t,e,r,n,i,o)}function t4(t,e){if(_r(_r.Buffer,t),t.length<16)throw new TypeError("Seed should be at least 128 bits");if(t.length>64)throw new TypeError("Seed should be at most 512 bits");e=e||Vf;let r=dl.hmacSHA512(v.Buffer.from("Bitcoin seed","utf8"),t),n=r.slice(0,32),i=r.slice(32);return E1(n,i,e)}pr.fromSeed=t4});var P1=W(sn=>{"use strict";x();S();Object.defineProperty(sn,"__esModule",{value:!0});sn.fromPrivateKey=sn.fromPublicKey=sn.fromBase58=sn.fromSeed=sn.tinySecp256k1Interface=void 0;var Ia=I1();Object.defineProperty(sn,"tinySecp256k1Interface",{enumerable:!0,get:function(){return Ia.tinySecp256k1Interface}});Object.defineProperty(sn,"fromSeed",{enumerable:!0,get:function(){return Ia.fromSeed}});Object.defineProperty(sn,"fromBase58",{enumerable:!0,get:function(){return Ia.fromBase58}});Object.defineProperty(sn,"fromPublicKey",{enumerable:!0,get:function(){return Ia.fromPublicKey}});Object.defineProperty(sn,"fromPrivateKey",{enumerable:!0,get:function(){return Ia.fromPrivateKey}})});var T1=W((AI,r4)=>{r4.exports=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"]});var gl=W(so=>{"use strict";x();S();Object.defineProperty(so,"__esModule",{value:!0});so._default=so.wordlists=void 0;var pl={};so.wordlists=pl;var Ff;so._default=Ff;try{so._default=Ff=T1(),pl.english=Ff,pl.EN=Ff}catch{}});var yl=W(Jt=>{"use strict";x();S();Object.defineProperty(Jt,"__esModule",{value:!0});Jt.wordlists=Jt.getDefaultWordlist=Jt.setDefaultWordlist=Jt.validateMnemonic=Jt.generateMnemonic=Jt.entropyToMnemonic=Jt.mnemonicToEntropy=Jt.mnemonicToSeed=Jt.mnemonicToSeedSync=void 0;var C1=ro(),k1=Pf(),zf=gl(),U1=mf(),Pa=zf._default,O1="Invalid mnemonic",ao="Invalid entropy",n4="Invalid mnemonic checksum",q1=`A wordlist is required but a default could not be found.
|
||
Please pass a 2048 word array explicitly.`;function i4(t,e,r,n,i){let o=(0,k1.pbkdf2)(U1.sha512,t,e,{c:r,dkLen:n});return Promise.resolve(v.Buffer.from(o))}function Ta(t){return(t||"").normalize("NFKD")}function R1(t,e,r){for(;t.length<r;)t=e+t;return t}function N1(t){return parseInt(t,2)}function L1(t){return t.map(e=>R1(e.toString(2),"0",8)).join("")}function j1(t){let r=t.length*8/32,n=(0,C1.sha256)(t);return L1(Array.from(n)).slice(0,r)}function H1(t){return"mnemonic"+(t||"")}function o4(t,e){let r=v.Buffer.from(Ta(t),"utf8"),n=v.Buffer.from(H1(Ta(e)),"utf8"),i=(0,k1.pbkdf2)(U1.sha512,r,n,{c:2048,dkLen:64});return v.Buffer.from(i)}Jt.mnemonicToSeedSync=o4;function s4(t,e){return Promise.resolve().then(()=>{let r=v.Buffer.from(Ta(t),"utf8"),n=v.Buffer.from(H1(Ta(e)),"utf8");return i4(r,n,2048,64,"sha512")})}Jt.mnemonicToSeed=s4;function K1(t,e){if(e=e||Pa,!e)throw new Error(q1);let r=Ta(t).split(" ");if(r.length%3!==0)throw new Error(O1);let n=r.map(w=>{let p=e.indexOf(w);if(p===-1)throw new Error(O1);return R1(p.toString(2),"0",11)}).join(""),i=Math.floor(n.length/33)*32,o=n.slice(0,i),a=n.slice(i),s=o.match(/(.{1,8})/g).map(N1);if(s.length<16)throw new Error(ao);if(s.length>32)throw new Error(ao);if(s.length%4!==0)throw new Error(ao);let u=v.Buffer.from(s);if(j1(u)!==a)throw new Error(n4);return u.toString("hex")}Jt.mnemonicToEntropy=K1;function D1(t,e){if(v.Buffer.isBuffer(t)||(t=v.Buffer.from(t,"hex")),e=e||Pa,!e)throw new Error(q1);if(t.length<16)throw new TypeError(ao);if(t.length>32)throw new TypeError(ao);if(t.length%4!==0)throw new TypeError(ao);let r=L1(Array.from(t)),n=j1(t),a=(r+n).match(/(.{1,11})/g).map(s=>{let u=N1(s);return e[u]});return e[0]==="\u3042\u3044\u3053\u304F\u3057\u3093"?a.join("\u3000"):a.join(" ")}Jt.entropyToMnemonic=D1;function a4(t,e,r){if(t=t||128,t%32!==0)throw new TypeError(ao);return e=e||C1.randomBytes,D1(e(t/8),r)}Jt.generateMnemonic=a4;function f4(t,e){try{K1(t,e)}catch{return!1}return!0}Jt.validateMnemonic=f4;function u4(t){let e=zf.wordlists[t];if(e)Pa=e;else throw new Error('Could not find wordlist for language "'+t+'"')}Jt.setDefaultWordlist=u4;function c4(){if(!Pa)throw new Error("No Default Wordlist set");return Object.keys(zf.wordlists).filter(t=>t==="JA"||t==="EN"?!1:zf.wordlists[t].every((e,r)=>e===Pa[r]))[0]}Jt.getDefaultWordlist=c4;var l4=gl();Object.defineProperty(Jt,"wordlists",{enumerable:!0,get:function(){return l4.wordlists}})});var F1=W(Ir=>{"use strict";x();S();Object.defineProperty(Ir,"__esModule",{value:!0});Ir.unpadBuffer=Ir.stripZeros=Ir.setLengthRight=Ir.setLengthLeft=Ir.zeros=Ir.assertIsBuffer=void 0;var d4=function(t){if(!v.Buffer.isBuffer(t)){let e=`This method only supports Buffer but input was: ${t}`;throw new Error(e)}};Ir.assertIsBuffer=d4;var h4=function(t){return v.Buffer.allocUnsafe(t).fill(0)};Ir.zeros=h4;var V1=function(t,e,r){let n=(0,Ir.zeros)(e);return r?t.length<e?(t.copy(n),n):t.slice(0,e):t.length<e?(t.copy(n,e-t.length),n):t.slice(-e)},b4=function(t,e){return v.Buffer.isBuffer(t)||(t=v.Buffer.from(t)),V1(t,e,!1)};Ir.setLengthLeft=b4;var p4=function(t,e){return v.Buffer.isBuffer(t)||(t=v.Buffer.from(t)),V1(t,e,!0)};Ir.setLengthRight=p4;var g4=function(t){let e=t[0];for(;t.length>0&&e.toString()==="0";)t=t.slice(1),e=t[0];return t};Ir.stripZeros=g4;var y4=function(t){return v.Buffer.isBuffer(t)||(t=v.Buffer.from(t)),(0,Ir.stripZeros)(t)};Ir.unpadBuffer=y4});var Wf=W($t=>{"use strict";x();S();Object.defineProperty($t,"__esModule",{value:!0});$t.isHexString=$t.getKeys=$t.fromAscii=$t.fromUtf8=$t.toAscii=$t.arrayContainsArray=$t.getBinarySize=$t.padToEven=$t.stripHexPrefix=$t.isHexPrefixed=void 0;function z1(t){if(typeof t!="string")throw new Error(`[isHexPrefixed] input must be type 'string', received type ${typeof t}`);return t[0]==="0"&&t[1]==="x"}$t.isHexPrefixed=z1;var m4=t=>{if(typeof t!="string")throw new Error(`[stripHexPrefix] input must be type 'string', received ${typeof t}`);return z1(t)?t.slice(2):t};$t.stripHexPrefix=m4;function W1(t){let e=t;if(typeof e!="string")throw new Error(`[padToEven] value must be type 'string', received ${typeof e}`);return e.length%2&&(e=`0${e}`),e}$t.padToEven=W1;function v4(t){if(typeof t!="string")throw new Error(`[getBinarySize] method requires input type 'string', received ${typeof t}`);return v.Buffer.byteLength(t,"utf8")}$t.getBinarySize=v4;function w4(t,e,r){if(Array.isArray(t)!==!0)throw new Error(`[arrayContainsArray] method requires input 'superset' to be an array, got type '${typeof t}'`);if(Array.isArray(e)!==!0)throw new Error(`[arrayContainsArray] method requires input 'subset' to be an array, got type '${typeof e}'`);return e[r===!0?"some":"every"](n=>t.indexOf(n)>=0)}$t.arrayContainsArray=w4;function _4(t){let e="",r=0,n=t.length;for(t.substring(0,2)==="0x"&&(r=2);r<n;r+=2){let i=parseInt(t.substr(r,2),16);e+=String.fromCharCode(i)}return e}$t.toAscii=_4;function x4(t){let e=v.Buffer.from(t,"utf8");return`0x${W1(e.toString("hex")).replace(/^0+|0+$/g,"")}`}$t.fromUtf8=x4;function S4(t){let e="";for(let r=0;r<t.length;r++){let i=t.charCodeAt(r).toString(16);e+=i.length<2?`0${i}`:i}return`0x${e}`}$t.fromAscii=S4;function B4(t,e,r){if(!Array.isArray(t))throw new Error(`[getKeys] method expects input 'params' to be an array, got ${typeof t}`);if(typeof e!="string")throw new Error(`[getKeys] method expects input 'key' to be type 'string', got ${typeof t}`);let n=[];for(let i=0;i<t.length;i++){let o=t[i][e];if(r===!0&&!o)o="";else if(typeof o!="string")throw new Error(`invalid abi - expected type 'string', received ${typeof o}`);n.push(o)}return n}$t.getKeys=B4;function A4(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||typeof e<"u"&&e>0&&t.length!==2+2*e)}$t.isHexString=A4});var $1=W(Nn=>{"use strict";x();S();Object.defineProperty(Nn,"__esModule",{value:!0});Nn.assertIsString=Nn.assertIsArray=Nn.assertIsBuffer=Nn.assertIsHexString=void 0;var M4=Wf(),E4=function(t){if(!(0,M4.isHexString)(t)){let e=`This method only supports 0x-prefixed hex strings but input was: ${t}`;throw new Error(e)}};Nn.assertIsHexString=E4;var I4=function(t){if(!v.Buffer.isBuffer(t)){let e=`This method only supports Buffer but input was: ${t}`;throw new Error(e)}};Nn.assertIsBuffer=I4;var P4=function(t){if(!Array.isArray(t)){let e=`This method only supports number arrays but input was: ${t}`;throw new Error(e)}};Nn.assertIsArray=P4;var T4=function(t){if(typeof t!="string"){let e=`This method only supports strings but input was: ${t}`;throw new Error(e)}};Nn.assertIsString=T4});var X1=W(Ue=>{"use strict";x();S();Object.defineProperty(Ue,"__esModule",{value:!0});Ue.intToUnpaddedBuffer=Ue.bigIntToUnpaddedBuffer=Ue.bigIntToHex=Ue.bufArrToArr=Ue.arrToBufArr=Ue.validateNoLeadingZeroes=Ue.baToJSON=Ue.toUtf8=Ue.short=Ue.addHexPrefix=Ue.toUnsigned=Ue.fromSigned=Ue.bufferToInt=Ue.bigIntToBuffer=Ue.bufferToBigInt=Ue.bufferToHex=Ue.toBuffer=Ue.unpadHexString=Ue.unpadArray=Ue.unpadBuffer=Ue.setLengthRight=Ue.setLengthLeft=Ue.zeros=Ue.intToBuffer=Ue.intToHex=void 0;var Oa=$1(),fo=Wf(),O4=function(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Received an invalid integer type: ${t}`);return`0x${t.toString(16)}`};Ue.intToHex=O4;var C4=function(t){let e=(0,Ue.intToHex)(t);return v.Buffer.from((0,fo.padToEven)(e.slice(2)),"hex")};Ue.intToBuffer=C4;var k4=function(t){return v.Buffer.allocUnsafe(t).fill(0)};Ue.zeros=k4;var G1=function(t,e,r){let n=(0,Ue.zeros)(e);return r?t.length<e?(t.copy(n),n):t.slice(0,e):t.length<e?(t.copy(n,e-t.length),n):t.slice(-e)},U4=function(t,e){return(0,Oa.assertIsBuffer)(t),G1(t,e,!1)};Ue.setLengthLeft=U4;var q4=function(t,e){return(0,Oa.assertIsBuffer)(t),G1(t,e,!0)};Ue.setLengthRight=q4;var ml=function(t){let e=t[0];for(;t.length>0&&e.toString()==="0";)t=t.slice(1),e=t[0];return t},R4=function(t){return(0,Oa.assertIsBuffer)(t),ml(t)};Ue.unpadBuffer=R4;var N4=function(t){return(0,Oa.assertIsArray)(t),ml(t)};Ue.unpadArray=N4;var L4=function(t){return(0,Oa.assertIsHexString)(t),t=(0,fo.stripHexPrefix)(t),"0x"+ml(t)};Ue.unpadHexString=L4;var j4=function(t){if(t==null)return v.Buffer.allocUnsafe(0);if(v.Buffer.isBuffer(t))return v.Buffer.from(t);if(Array.isArray(t)||t instanceof Uint8Array)return v.Buffer.from(t);if(typeof t=="string"){if(!(0,fo.isHexString)(t))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${t}`);return v.Buffer.from((0,fo.padToEven)((0,fo.stripHexPrefix)(t)),"hex")}if(typeof t=="number")return(0,Ue.intToBuffer)(t);if(typeof t=="bigint"){if(t<BigInt(0))throw new Error(`Cannot convert negative bigint to buffer. Given: ${t}`);let e=t.toString(16);return e.length%2&&(e="0"+e),v.Buffer.from(e,"hex")}if(t.toArray)return v.Buffer.from(t.toArray());if(t.toBuffer)return v.Buffer.from(t.toBuffer());throw new Error("invalid type")};Ue.toBuffer=j4;var H4=function(t){return t=(0,Ue.toBuffer)(t),"0x"+t.toString("hex")};Ue.bufferToHex=H4;function vl(t){let e=(0,Ue.bufferToHex)(t);return BigInt(e==="0x"?0:e)}Ue.bufferToBigInt=vl;function wl(t){return(0,Ue.toBuffer)("0x"+t.toString(16))}Ue.bigIntToBuffer=wl;var K4=function(t){let e=Number(vl(t));if(!Number.isSafeInteger(e))throw new Error("Number exceeds 53 bits");return e};Ue.bufferToInt=K4;var D4=function(t){return BigInt.asIntN(256,vl(t))};Ue.fromSigned=D4;var V4=function(t){return wl(BigInt.asUintN(256,t))};Ue.toUnsigned=V4;var F4=function(t){return typeof t!="string"||(0,fo.isHexPrefixed)(t)?t:"0x"+t};Ue.addHexPrefix=F4;function z4(t,e=50){let r=v.Buffer.isBuffer(t)?t.toString("hex"):t;return r.length<=e?r:r.slice(0,e)+"\u2026"}Ue.short=z4;var W4=function(t){let e=/^(00)+|(00)+$/g;if(t=(0,fo.stripHexPrefix)(t),t.length%2!==0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return v.Buffer.from(t.replace(e,""),"hex").toString("utf8")};Ue.toUtf8=W4;var $4=function(t){if(v.Buffer.isBuffer(t))return`0x${t.toString("hex")}`;if(t instanceof Array){let e=[];for(let r=0;r<t.length;r++)e.push((0,Ue.baToJSON)(t[r]));return e}};Ue.baToJSON=$4;var G4=function(t){for(let[e,r]of Object.entries(t))if(r!==void 0&&r.length>0&&r[0]===0)throw new Error(`${e} cannot have leading zeroes, received: ${r.toString("hex")}`)};Ue.validateNoLeadingZeroes=G4;function Z1(t){return Array.isArray(t)?t.map(e=>Z1(e)):v.Buffer.from(t)}Ue.arrToBufArr=Z1;function Y1(t){return Array.isArray(t)?t.map(e=>Y1(e)):Uint8Array.from(t??[])}Ue.bufArrToArr=Y1;var Z4=t=>"0x"+t.toString(16);Ue.bigIntToHex=Z4;function Y4(t){return(0,Ue.unpadBuffer)(wl(t))}Ue.bigIntToUnpaddedBuffer=Y4;function X4(t){return(0,Ue.unpadBuffer)((0,Ue.intToBuffer)(t))}Ue.intToUnpaddedBuffer=X4});var t2=W((FI,e2)=>{"use strict";x();S();var $f=F1(),Zo=ro(),Hr=fr(),{isHexString:Q4,stripHexPrefix:J4,padToEven:em}=Wf(),{intToBuffer:tm,addHexPrefix:rm,bufferToHex:nm}=X1(),Kt=function(){};function Gf(t){return t.startsWith("int[")?"int256"+t.slice(3):t==="int"?"int256":t.startsWith("uint[")?"uint256"+t.slice(4):t==="uint"?"uint256":t.startsWith("fixed[")?"fixed128x128"+t.slice(5):t==="fixed"?"fixed128x128":t.startsWith("ufixed[")?"ufixed128x128"+t.slice(6):t==="ufixed"?"ufixed128x128":t}function _l(t){if(t==null)return v.Buffer.allocUnsafe(0);if(v.Buffer.isBuffer(t))return v.Buffer.from(t);if(Array.isArray(t)||t instanceof Uint8Array)return v.Buffer.from(t);if(typeof t=="string"){if(!Q4(t))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${t}`);return v.Buffer.from(em(J4(t)),"hex")}if(typeof t=="number")return tm(t);if(typeof t=="bigint"){if(t<BigInt(0))throw new Error(`Cannot convert negative bigint to buffer. Given: ${t}`);let e=t.toString(16);return e.length%2&&(e="0"+e),v.Buffer.from(e,"hex")}if(t.toArray)return v.Buffer.from(t.toArray());if(t.toBuffer)return v.Buffer.from(t.toBuffer());throw new Error("invalid type")}function im(t){if(!!t){if(typeof t=="number"){if(t<0)return"0x";let e=_l(t);t=nm(e)}if(typeof t!="string"){let e="eth-sig-util.normalize() requires hex string or integer input.";throw e+=` received ${typeof t}: ${t}`,new Error(e)}return rm(t.toLowerCase())}}Kt.eventID=function(t,e){var r=t+"("+e.map(Gf).join(",")+")";return Zo.keccak256(v.Buffer.from(r))};Kt.methodID=function(t,e){return Kt.eventID(t,e).slice(0,4)};function Mi(t){return parseInt(/^\D+(\d+)$/.exec(t)[1],10)}function xl(t){var e=/^\D+(\d+)x(\d+)$/.exec(t);return[parseInt(e[1],10),parseInt(e[2],10)]}function ka(t){var e=t.match(/(.*)\[(.*?)\]$/);return e?e[2]===""?"dynamic":parseInt(e[2],10):null}function uo(t){var e=typeof t;if(e==="string")return Zo.isHexPrefixed(t)?new Hr(Zo.stripHexPrefix(t),16):new Hr(t,10);if(e==="number")return new Hr(t);if(t.toArray)return t;throw new Error("Argument is not a number")}function J1(t){var e=/^(\w+)\((.*)\)$/.exec(t);if(e.length!==3)throw new Error("Invalid method signature");var r=/^(.+)\):\((.+)$/.exec(e[2]);if(r!==null&&r.length===3)return{method:e[1],args:r[1].split(","),retargs:r[2].split(",")};var n=e[2].split(",");return n.length===1&&n[0]===""&&(n=[]),{method:e[1],args:n}}function Ln(t,e){var r,n,i,o;if(t==="address")return Ln("uint160",uo(e));if(t==="bool")return Ln("uint8",e?1:0);if(t==="string")return Ln("bytes",v.Buffer.from(e,"utf8"));if(Ca(t)){if(typeof e.length>"u")throw new Error("Not an array?");if(r=ka(t),r!=="dynamic"&&r!==0&&e.length>r)throw new Error("Elements exceed array size: "+r);i=[],t=t.slice(0,t.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(o in e)i.push(Ln(t,e[o]));if(r==="dynamic"){var a=Ln("uint256",e.length);i.unshift(a)}return v.Buffer.concat(i)}else{if(t==="bytes")return e=v.Buffer.from(e),i=v.Buffer.concat([Ln("uint256",e.length),e]),e.length%32!==0&&(i=v.Buffer.concat([i,$f.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(r=Mi(t),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return $f.setLengthRight(e,32)}else if(t.startsWith("uint")){if(r=Mi(t),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=uo(e),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(v.Buffer,"be",32)}else if(t.startsWith("int")){if(r=Mi(t),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=uo(e),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(v.Buffer,"be",32)}else if(t.startsWith("ufixed")){if(r=xl(t),n=uo(e),n<0)throw new Error("Supplied ufixed is negative");return Ln("uint256",n.mul(new Hr(2).pow(new Hr(r[1]))))}else if(t.startsWith("fixed"))return r=xl(t),Ln("int256",uo(e).mul(new Hr(2).pow(new Hr(r[1]))))}throw new Error("Unsupported or invalid type: "+t)}function wn(t,e,r){typeof t=="string"&&(t=Sl(t));var n,i,o,a;if(t.name==="address")return wn(t.rawType,e,r).toArrayLike(v.Buffer,"be",20).toString("hex");if(t.name==="bool")return wn(t.rawType,e,r).toString()===new Hr(1).toString();if(t.name==="string"){var s=wn(t.rawType,e,r);return v.Buffer.from(s,"utf8").toString()}else if(t.isArray){for(o=[],n=t.size,t.size==="dynamic"&&(r=wn("uint256",e,r).toNumber(),n=wn("uint256",e,r).toNumber(),r=r+32),a=0;a<n;a++){var u=wn(t.subArray,e,r);o.push(u),r+=t.subArray.memoryUsage}return o}else{if(t.name==="bytes")return r=wn("uint256",e,r).toNumber(),n=wn("uint256",e,r).toNumber(),e.slice(r+32,r+32+n);if(t.name.startsWith("bytes"))return e.slice(r,r+t.size);if(t.name.startsWith("uint")){if(i=new Hr(e.slice(r,r+32),16,"be"),i.bitLength()>t.size)throw new Error("Decoded int exceeds width: "+t.size+" vs "+i.bitLength());return i}else if(t.name.startsWith("int")){if(i=new Hr(e.slice(r,r+32),16,"be").fromTwos(256),i.bitLength()>t.size)throw new Error("Decoded uint exceeds width: "+t.size+" vs "+i.bitLength());return i}else if(t.name.startsWith("ufixed")){if(n=new Hr(2).pow(new Hr(t.size[1])),i=wn("uint256",e,r),!i.mod(n).isZero())throw new Error("Decimals not supported yet");return i.div(n)}else if(t.name.startsWith("fixed")){if(n=new Hr(2).pow(new Hr(t.size[1])),i=wn("int256",e,r),!i.mod(n).isZero())throw new Error("Decimals not supported yet");return i.div(n)}}throw new Error("Unsupported or invalid type: "+t.name)}function Sl(t){var e,r;if(Ca(t)){e=ka(t);var n=t.slice(0,t.lastIndexOf("["));return n=Sl(n),r={isArray:!0,name:t,size:e,memoryUsage:e==="dynamic"?32:n.memoryUsage*e,subArray:n},r}else{var i;switch(t){case"address":i="uint160";break;case"bool":i="uint8";break;case"string":i="bytes";break}if(r={rawType:i,name:t,memoryUsage:32},t.startsWith("bytes")&&t!=="bytes"||t.startsWith("uint")||t.startsWith("int")?r.size=Mi(t):(t.startsWith("ufixed")||t.startsWith("fixed"))&&(r.size=xl(t)),t.startsWith("bytes")&&t!=="bytes"&&(r.size<1||r.size>32))throw new Error("Invalid bytes<N> width: "+r.size);if((t.startsWith("uint")||t.startsWith("int"))&&(r.size%8||r.size<8||r.size>256))throw new Error("Invalid int/uint<N> width: "+r.size);return r}}function om(t){return t==="string"||t==="bytes"||ka(t)==="dynamic"}function Ca(t){return t.lastIndexOf("]")===t.length-1}Kt.rawEncode=function(t,e){var r=[],n=[],i=0;t.forEach(function(h){if(Ca(h)){var w=ka(h);w!=="dynamic"?i+=32*w:i+=32}else i+=32});for(var o=0;o<t.length;o++){var a=Gf(t[o]),s=e[o],u=Ln(a,s);om(a)?(r.push(Ln("uint256",i)),n.push(u),i+=u.length):r.push(u)}return v.Buffer.concat(r.concat(n))};Kt.rawDecode=function(t,e){var r=[];e=v.Buffer.from(e);for(var n=0,i=0;i<t.length;i++){var o=Gf(t[i]),a=Sl(o,e,n),s=wn(a,e,n);n+=a.memoryUsage,r.push(s)}return r};Kt.simpleEncode=function(t){var e=Array.prototype.slice.call(arguments).slice(1),r=J1(t);if(e.length!==r.args.length)throw new Error("Argument count mismatch");return v.Buffer.concat([Kt.methodID(r.method,r.args),Kt.rawEncode(r.args,e)])};Kt.simpleDecode=function(t,e){var r=J1(t);if(!r.retargs)throw new Error("No return values in method");return Kt.rawDecode(r.retargs,e)};function Q1(t,e){return t.startsWith("address")||t.startsWith("bytes")?"0x"+e.toString("hex"):e.toString()}Kt.stringify=function(t,e){var r=[];for(var n in t){var i=t[n],o=e[n];/^[^\[]+\[.*\]$/.test(i)?o=o.map(function(a){return Q1(i,a)}).join(", "):o=Q1(i,o),r.push(o)}return r};Kt.solidityHexValue=function(t,e,r){var n,i;if(Ca(t)){var o=t.replace(/\[.*?\]/,"");if(!Ca(o)){var a=ka(t);if(a!=="dynamic"&&a!==0&&e.length>a)throw new Error("Elements exceed array size: "+a)}var s=e.map(function(w){return Kt.solidityHexValue(o,w,256)});return v.Buffer.concat(s)}else{if(t==="bytes")return e;if(t==="string")return v.Buffer.from(e,"utf8");if(t==="bool"){r=r||8;var u=Array(r/4).join("0");return v.Buffer.from(e?u+"1":u+"0","hex")}else if(t==="address"){var h=20;return r&&(h=r/8),$f.setLengthLeft(_l(e),h)}else if(t.startsWith("bytes")){if(n=Mi(t),n<1||n>32)throw new Error("Invalid bytes<N> width: "+n);return typeof e=="number"&&(e=im(e)),$f.setLengthRight(_l(e),n)}else if(t.startsWith("uint")){if(n=Mi(t),n%8||n<8||n>256)throw new Error("Invalid uint<N> width: "+n);if(i=uo(e),i.bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+i.bitLength());return r=r||n,i.toArrayLike(v.Buffer,"be",r/8)}else if(t.startsWith("int")){if(n=Mi(t),n%8||n<8||n>256)throw new Error("Invalid int<N> width: "+n);if(i=uo(e),i.bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+i.bitLength());return r=r||n,i.toTwos(n).toArrayLike(v.Buffer,"be",r/8)}else throw new Error("Unsupported or invalid type: "+t)}};Kt.solidityPack=function(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var r=[],n=0;n<t.length;n++){var i=Gf(t[n]),o=e[n];r.push(Kt.solidityHexValue(i,o,null))}return v.Buffer.concat(r)};Kt.soliditySHA3=function(t,e){return Zo.keccak256(Kt.solidityPack(t,e))};Kt.soliditySHA256=function(t,e){return Zo.sha256(Kt.solidityPack(t,e))};Kt.solidityRIPEMD160=function(t,e){return Zo.ripemd160(Kt.solidityPack(t,e),!0)};function sm(t){return t>="0"&&t<="9"}Kt.fromSerpent=function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];if(n==="s")e.push("bytes");else if(n==="b"){for(var i="bytes",o=r+1;o<t.length&&sm(t[o]);)i+=t[o]-"0",o++;r=o-1,e.push(i)}else if(n==="i")e.push("int256");else if(n==="a")e.push("int256[]");else throw new Error("Unsupported or invalid type: "+n)}return e};Kt.toSerpent=function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];if(n==="bytes")e.push("s");else if(n.startsWith("bytes"))e.push("b"+Mi(n));else if(n==="int256")e.push("i");else if(n==="int256[]")e.push("a");else throw new Error("Unsupported or invalid type: "+n)}return e.join("")};e2.exports=Kt});var r2=W(Ei=>{"use strict";x();S();Object.defineProperty(Ei,"__esModule",{value:!0});Ei.SoliditySHA3=Ei.RawEncode=Ei.ABI=void 0;var Bl=t2();Ei.ABI=Bl;function am(t,e){return Bl.rawEncode(t,e)}Ei.RawEncode=am;function fm(t,e){return Bl.soliditySHA3(t,e)}Ei.SoliditySHA3=fm});var f2=W(gt=>{"use strict";x();S();var um=gt&>.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),cm=gt&>.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),lm=gt&>.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&um(e,t,r);return cm(e,t),e},dm=gt&>.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(gt,"__esModule",{value:!0});gt.loadUncompressedPublicKey=gt.loadCompressedPublicKey=gt.publicKeyConvert=gt.publicKeyCreate=gt.publicKeyVerify=gt.privateKeyVerify=gt.loadPublicKey=gt.recover=gt.verifyWithNoRecovery=gt.verify=gt.getV=gt.sign=void 0;var hm=lm(Go()),ur=new hm.ec("secp256k1"),n2=ro(),Yo=dm(fr());function bm(t,e,r=!0){let n=ur.sign(Array.from(t),v.Buffer.from(e),{canonical:r});return{signature:n.toBytes(),recovery:n.recoveryParam}}gt.sign=bm;function pm(t,e,r,n,i=!0){let o=Ua(n);if(o==null)throw new Error("pubkey error");let a=ur.keyPair({pub:{x:o.x,y:o.y}}).getPublic();return ur.getKeyRecoveryParam(t,{r:e,s:r},a,i)}gt.getV=pm;function gm(t,e,r,n){let i=i2(e,r,t,!0);if(i==null)return!1;let o=o2(n,!0);return o==null?!1:i.equals(o)}gt.verify=gm;function ym(t,e,r){let n=Ua(r);if(n==null)throw new Error("pubkey error");let i=ur.keyPair({pub:{x:n.x,y:n.y}}),o={r:(0,n2.toHex)(e.slice(0,32)),s:(0,n2.toHex)(e.slice(32,64))};return i.verify(t,o)}gt.verifyWithNoRecovery=ym;function i2(t,e,r,n){let i={r:Array.from(t.slice(0,32)),s:Array.from(t.slice(32,64))},o=new Yo.default(i.r),a=new Yo.default(i.s);if(o.cmp(ur.curve.n)>=0||a.cmp(ur.curve.n)>=0||o.isZero()||a.isZero())return null;let s;try{s=ur.recoverPubKey(Array.from(r),i,e,null)}catch{return null}return v.Buffer.from(s.encode(null,n))}gt.recover=i2;function Ua(t){let e=v.Buffer.from(t),r=e[0];switch(r){case 2:case 3:return e.length!==33?null:s2(r,e.subarray(1,33));case 4:case 6:case 7:return e.length!==65?null:a2(r,e.subarray(1,33),e.subarray(33,65));default:return null}}gt.loadPublicKey=Ua;function mm(t){let e=new Yo.default(Array.from(t));return e.cmp(ur.curve.n)<0&&!e.isZero()}gt.privateKeyVerify=mm;function vm(t){return Ua(t)!==null}gt.publicKeyVerify=vm;function wm(t,e){let r=ur.keyFromPrivate(Array.from(t),"bytes").getPublic();return v.Buffer.from(r.encode(null,e))}gt.publicKeyCreate=wm;function o2(t,e){let r=Ua(t);if(r==null)return null;let n=ur.keyPair({pub:{x:r.x,y:r.y}}).getPublic();return v.Buffer.from(n.encode(null,e))}gt.publicKeyConvert=o2;function s2(t,e){let r=new Yo.default(Array.from(e));if(r.cmp(ur.curve.p)>=0)return null;let n=r.toRed(ur.curve.red),i=n.redSqr().redIMul(n).redIAdd(ur.curve.b).redSqrt();t===3!==i.isOdd()&&(i=i.redNeg());let o=n.redSqr().redIMul(n);return i.redSqr().redISub(o.redIAdd(ur.curve.b)).isZero()?{x:n,y:i}:null}gt.loadCompressedPublicKey=s2;function a2(t,e,r){let n=new Yo.default(Array.from(e)),i=new Yo.default(Array.from(r));if(n.cmp(ur.curve.p)>=0||i.cmp(ur.curve.p)>=0)return null;let o=n.toRed(ur.curve.red),a=i.toRed(ur.curve.red);if((t===6||t===7)&&a.isOdd()!==(t===7))return null;let s=o.redSqr().redIMul(o);return a.redSqr().redISub(s.redIAdd(ur.curve.b)).isZero()?{x:o,y:a}:null}gt.loadUncompressedPublicKey=a2});var g2=W(ht=>{"use strict";x();S();var _m=ht&&ht.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),xm=ht&&ht.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Sm=ht&&ht.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&_m(e,t,r);return xm(e,t),e},Bm=ht&&ht.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ht,"__esModule",{value:!0});ht.ed25519_getDerivedPrivateKey=ht.isValidPath=ht.ed25519_getRandomPrivateKey=ht.ed25519SignTest=ht.fromSecret=ht.fromSeed=ht.privateKeyVerify=ht.publicKeyVerify=ht.publicKeyCreate=ht.verify=ht.sign=ht.ed25519MulBase=void 0;var u2=Sm(Go()),_n=ro(),Am=Bm(fr()),Mm=yl(),Jn=new u2.eddsa("ed25519"),c2=Jn.curve;function Em(t){let e=Jn.curve.g;return Jn.encodePoint(e.mul(u2.utils.intFromLE(t)))}ht.ed25519MulBase=Em;function l2(t,e){let r=e;r.length==64&&(r=r.slice(0,32));let i=Jn.keyFromSecret(Array.from(r)).sign(Array.from(t)).toBytes();return Uint8Array.from(i)}ht.sign=l2;function d2(t,e,r){return Jn.keyFromPublic(Array.from(r)).verify(Array.from(t),Array.from(e))}ht.verify=d2;function Zf(t){let e=t;e.length==64&&(e=e.slice(0,32));let n=Jn.keyFromSecret(Array.from(e)).getPublic();if(t.length==64&&!Im(t.slice(32,64),n))throw new Error("invalid public key");return Uint8Array.from(n)}ht.publicKeyCreate=Zf;function Im(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function Pm(t){let e=Jn.decodePoint(Array.from(t));return c2.validate(e)}ht.publicKeyVerify=Pm;function h2(t){let e=new Am.default(Array.from(t));return e.cmp(c2.n)<0&&!e.isZero()}ht.privateKeyVerify=h2;function Tm(t){let e=Jn.keyFromSecret(Array.from(t)),r=Uint8Array.from(e.getPublic());return{publicKey:r,secretKey:(0,_n.concatBytes)(t,r)}}ht.fromSeed=Tm;function Om(t){let e=t.slice(0,32),r=Jn.keyFromSecret(Array.from(e));return{publicKey:Uint8Array.from(r.getPublic()),secretKey:Uint8Array.from(e)}}ht.fromSecret=Om;function b2(t){let e=(0,_n.sha256)("ed25519-test"),r=Zf(t),n=l2(e,t);return d2(e,n,r)}ht.ed25519SignTest=b2;function Cm(t,e){for(;;){let r=(0,_n.randomBytes)(32);if(h2(r)&&b2(r)){let n=Zf(r),i=t?(0,_n.concatBytes)(r,n):r;return e==="base58"?(0,_n.toBase58)(i):(0,_n.toHex)(i)}}}ht.ed25519_getRandomPrivateKey=Cm;var km=new RegExp("^m(\\/[0-9]+')+$"),p2=t=>t.replace("'",""),Um=2147483648;function qm(t){let e=(0,_n.hmacSHA512)("ed25519 seed",t),r=e.slice(0,32),n=e.slice(32);return{key:r,chainCode:n}}function Rm({key:t,chainCode:e},r){let n=v.Buffer.allocUnsafe(4);n.writeUInt32BE(r,0);let i=v.Buffer.concat([v.Buffer.alloc(1,0),t,n]),o=(0,_n.hmacSHA512)(e,i),a=o.slice(0,32),s=o.slice(32);return{key:a,chainCode:s}}var Nm=t=>km.test(t)?!t.split("/").slice(1).map(p2).some(isNaN):!1;ht.isValidPath=Nm;function Lm(t,e,r=Um){if(!(0,ht.isValidPath)(t))throw new Error("Invalid derivation path");let{key:n,chainCode:i}=qm(e);return t.split("/").slice(1).map(p2).map(a=>parseInt(a,10)).reduce((a,s)=>Rm(a,s+r),{key:n,chainCode:i})}async function jm(t,e,r,n){let i=await(0,Mm.mnemonicToSeed)(t),o=Lm(e,i).key,a=Zf(o),s=r?(0,_n.concatBytes)(o,a):o;return n==="base58"?Promise.resolve((0,_n.toBase58)(s)):Promise.resolve((0,_n.toHex)(s))}ht.ed25519_getDerivedPrivateKey=jm});var w2=W(Bt=>{"use strict";x();S();var Hm=Bt&&Bt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Km=Bt&&Bt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Dm=Bt&&Bt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Hm(e,t,r);return Km(e,t),e},Vm=Bt&&Bt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Bt,"__esModule",{value:!0});Bt.loadUncompressedPublicKey=Bt.loadCompressedPublicKey=Bt.publicKeyConvert=Bt.publicKeyCreate=Bt.publicKeyVerify=Bt.privateKeyVerify=Bt.loadPublicKey=Bt.recover=Bt.verify=Bt.sign=void 0;var Fm=Dm(Go()),Rr=new Fm.ec("p256"),Xo=Vm(fr());function zm(t,e,r=!0){let n=Rr.sign(Array.from(t),v.Buffer.from(e),{canonical:r});return{signature:n.toBytes(),recovery:n.recoveryParam}}Bt.sign=zm;function Wm(t,e,r,n){let i=y2(e,r,t,!1);return i==null?!1:i.equals(n)}Bt.verify=Wm;function y2(t,e,r,n){let i={r:Array.from(t.slice(0,32)),s:Array.from(t.slice(32,64))},o=new Xo.default(i.r),a=new Xo.default(i.s);if(o.cmp(Rr.curve.n)>=0||a.cmp(Rr.curve.n)>=0||o.isZero()||a.isZero())return null;let s;try{s=Rr.recoverPubKey(Array.from(r),i,e,null)}catch{return null}return v.Buffer.from(s.encode(null,n))}Bt.recover=y2;function Al(t){let e=v.Buffer.from(t),r=e[0];switch(r){case 2:case 3:return e.length!==33?null:m2(r,e.subarray(1,33));case 4:case 6:case 7:return e.length!==65?null:v2(r,e.subarray(1,33),e.subarray(33,65));default:return null}}Bt.loadPublicKey=Al;function $m(t){let e=new Xo.default(Array.from(t));return e.cmp(Rr.curve.n)<0&&!e.isZero()}Bt.privateKeyVerify=$m;function Gm(t){return Al(t)!==null}Bt.publicKeyVerify=Gm;function Zm(t,e){let r=Rr.keyFromPrivate(Array.from(t),"bytes").getPublic();return v.Buffer.from(r.encode(null,e))}Bt.publicKeyCreate=Zm;function Ym(t,e){let r=Al(t);if(r==null)return null;let n=Rr.keyPair({pub:{x:r.x,y:r.y}}).getPublic();return v.Buffer.from(n.encode(null,e))}Bt.publicKeyConvert=Ym;function m2(t,e){let r=new Xo.default(Array.from(e));if(r.cmp(Rr.curve.p)>=0)return null;let n=r.toRed(Rr.curve.red),i=n.redSqr().redIMul(n).redIAdd(Rr.curve.b).redSqrt();return t===3!==i.isOdd()&&(i=i.redNeg()),{x:n,y:i}}Bt.loadCompressedPublicKey=m2;function v2(t,e,r){let n=new Xo.default(Array.from(e)),i=new Xo.default(Array.from(r));if(n.cmp(Rr.curve.p)>=0||i.cmp(Rr.curve.p)>=0)return null;let o=n.toRed(Rr.curve.red),a=i.toRed(Rr.curve.red);if((t===6||t===7)&&a.isOdd()!==(t===7))return null;let s=o.redSqr().redIMul(o);return a.redSqr().redISub(s.redIAdd(Rr.curve.b)).isZero()?{x:o,y:a}:null}Bt.loadUncompressedPublicKey=v2});var ei=W(nt=>{"use strict";x();S();Object.defineProperty(nt,"__esModule",{value:!0});nt.validateObject=nt.createHmacDrbg=nt.bitMask=nt.bitSet=nt.bitGet=nt.bitLen=nt.utf8ToBytes=nt.equalBytes=nt.concatBytes=nt.ensureBytes=nt.numberToVarBytesBE=nt.numberToBytesLE=nt.numberToBytesBE=nt.bytesToNumberLE=nt.bytesToNumberBE=nt.hexToBytes=nt.hexToNumber=nt.numberToHexUnpadded=nt.bytesToHex=void 0;var x2=BigInt(0),Yf=BigInt(1),Xm=BigInt(2),Xf=t=>t instanceof Uint8Array,Qm=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function El(t){if(!Xf(t))throw new Error("Uint8Array expected");let e="";for(let r=0;r<t.length;r++)e+=Qm[t[r]];return e}nt.bytesToHex=El;function S2(t){let e=t.toString(16);return e.length&1?`0${e}`:e}nt.numberToHexUnpadded=S2;function Il(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return BigInt(t===""?"0":`0x${t}`)}nt.hexToNumber=Il;function Qf(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);if(t.length%2)throw new Error("hex string is invalid: unpadded "+t.length);let e=new Uint8Array(t.length/2);for(let r=0;r<e.length;r++){let n=r*2,i=t.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("invalid byte sequence");e[r]=o}return e}nt.hexToBytes=Qf;function Jm(t){return Il(El(t))}nt.bytesToNumberBE=Jm;function ev(t){if(!Xf(t))throw new Error("Uint8Array expected");return Il(El(Uint8Array.from(t).reverse()))}nt.bytesToNumberLE=ev;var tv=(t,e)=>Qf(t.toString(16).padStart(e*2,"0"));nt.numberToBytesBE=tv;var rv=(t,e)=>(0,nt.numberToBytesBE)(t,e).reverse();nt.numberToBytesLE=rv;var nv=t=>Qf(S2(t));nt.numberToVarBytesBE=nv;function iv(t,e,r){let n;if(typeof e=="string")try{n=Qf(e)}catch(o){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${o}`)}else if(Xf(e))n=Uint8Array.from(e);else throw new Error(`${t} must be hex string or Uint8Array`);let i=n.length;if(typeof r=="number"&&i!==r)throw new Error(`${t} expected ${r} bytes, got ${i}`);return n}nt.ensureBytes=iv;function B2(...t){let e=new Uint8Array(t.reduce((n,i)=>n+i.length,0)),r=0;return t.forEach(n=>{if(!Xf(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}nt.concatBytes=B2;function ov(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}nt.equalBytes=ov;function sv(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new TextEncoder().encode(t)}nt.utf8ToBytes=sv;function av(t){let e;for(e=0;t>x2;t>>=Yf,e+=1);return e}nt.bitLen=av;var fv=(t,e)=>t>>BigInt(e)&Yf;nt.bitGet=fv;var uv=(t,e,r)=>t|(r?Yf:x2)<<BigInt(e);nt.bitSet=uv;var cv=t=>(Xm<<BigInt(t-1))-Yf;nt.bitMask=cv;var Ml=t=>new Uint8Array(t),_2=t=>Uint8Array.from(t);function lv(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=Ml(t),i=Ml(t),o=0,a=()=>{n.fill(1),i.fill(0),o=0},s=(...p)=>r(i,n,...p),u=(p=Ml())=>{i=s(_2([0]),p),n=s(),p.length!==0&&(i=s(_2([1]),p),n=s())},h=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let p=0,M=[];for(;p<e;){n=s();let A=n.slice();M.push(A),p+=n.length}return B2(...M)};return(p,M)=>{a(),u(p);let A;for(;!(A=M(h()));)u();return a(),A}}nt.createHmacDrbg=lv;var dv={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function hv(t,e,r={}){let n=(i,o,a)=>{let s=dv[o];if(typeof s!="function")throw new Error(`Invalid validator "${o}", expected function`);let u=t[i];if(!(a&&u===void 0)&&!s(u,t))throw new Error(`Invalid param ${String(i)}=${u} (${typeof u}), expected ${o}`)};for(let[i,o]of Object.entries(e))n(i,o,!1);for(let[i,o]of Object.entries(r))n(i,o,!0);return t}nt.validateObject=hv});var co=W(ct=>{"use strict";x();S();Object.defineProperty(ct,"__esModule",{value:!0});ct.hashToPrivateScalar=ct.FpSqrtEven=ct.FpSqrtOdd=ct.Field=ct.nLength=ct.FpIsSquare=ct.FpDiv=ct.FpInvertBatch=ct.FpPow=ct.validateField=ct.isNegativeLE=ct.FpSqrt=ct.tonelliShanks=ct.invert=ct.pow2=ct.pow=ct.mod=void 0;var ti=ei(),cr=BigInt(0),Rt=BigInt(1),Ii=BigInt(2),bv=BigInt(3),Pl=BigInt(4),A2=BigInt(5),M2=BigInt(8),pv=BigInt(9),gv=BigInt(16);function an(t,e){let r=t%e;return r>=cr?r:e+r}ct.mod=an;function E2(t,e,r){if(r<=cr||e<cr)throw new Error("Expected power/modulo > 0");if(r===Rt)return cr;let n=Rt;for(;e>cr;)e&Rt&&(n=n*t%r),t=t*t%r,e>>=Rt;return n}ct.pow=E2;function yv(t,e,r){let n=t;for(;e-- >cr;)n*=n,n%=r;return n}ct.pow2=yv;function Jf(t,e){if(t===cr||e<=cr)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=an(t,e),n=e,i=cr,o=Rt,a=Rt,s=cr;for(;r!==cr;){let h=n/r,w=n%r,p=i-a*h,M=o-s*h;n=r,r=w,i=a,o=s,a=p,s=M}if(n!==Rt)throw new Error("invert: does not exist");return an(i,e)}ct.invert=Jf;function I2(t){let e=(t-Rt)/Ii,r,n,i;for(r=t-Rt,n=0;r%Ii===cr;r/=Ii,n++);for(i=Ii;i<t&&E2(i,e,t)!==t-Rt;i++);if(n===1){let a=(t+Rt)/Pl;return function(u,h){let w=u.pow(h,a);if(!u.eql(u.sqr(w),h))throw new Error("Cannot find square root");return w}}let o=(r+Rt)/Ii;return function(s,u){if(s.pow(u,e)===s.neg(s.ONE))throw new Error("Cannot find square root");let h=n,w=s.pow(s.mul(s.ONE,i),r),p=s.pow(u,o),M=s.pow(u,r);for(;!s.eql(M,s.ONE);){if(s.eql(M,s.ZERO))return s.ZERO;let A=1;for(let E=s.sqr(M);A<h&&!s.eql(E,s.ONE);A++)E=s.sqr(E);let P=s.pow(w,Rt<<BigInt(h-A-1));w=s.sqr(P),p=s.mul(p,P),M=s.mul(M,w),h=A}return p}}ct.tonelliShanks=I2;function P2(t){if(t%Pl===bv){let e=(t+Rt)/Pl;return function(n,i){let o=n.pow(i,e);if(!n.eql(n.sqr(o),i))throw new Error("Cannot find square root");return o}}if(t%M2===A2){let e=(t-A2)/M2;return function(n,i){let o=n.mul(i,Ii),a=n.pow(o,e),s=n.mul(i,a),u=n.mul(n.mul(s,Ii),a),h=n.mul(s,n.sub(u,n.ONE));if(!n.eql(n.sqr(h),i))throw new Error("Cannot find square root");return h}}return t%gv,I2(t)}ct.FpSqrt=P2;var mv=(t,e)=>(an(t,e)&Rt)===Rt;ct.isNegativeLE=mv;var vv=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function wv(t){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=vv.reduce((n,i)=>(n[i]="function",n),e);return(0,ti.validateObject)(t,r)}ct.validateField=wv;function T2(t,e,r){if(r<cr)throw new Error("Expected power > 0");if(r===cr)return t.ONE;if(r===Rt)return e;let n=t.ONE,i=e;for(;r>cr;)r&Rt&&(n=t.mul(n,i)),i=t.sqr(i),r>>=Rt;return n}ct.FpPow=T2;function O2(t,e){let r=new Array(e.length),n=e.reduce((o,a,s)=>t.is0(a)?o:(r[s]=o,t.mul(o,a)),t.ONE),i=t.inv(n);return e.reduceRight((o,a,s)=>t.is0(a)?o:(r[s]=t.mul(o,r[s]),t.mul(o,a)),i),r}ct.FpInvertBatch=O2;function _v(t,e,r){return t.mul(e,typeof r=="bigint"?Jf(r,t.ORDER):t.inv(r))}ct.FpDiv=_v;function xv(t){let e=(t.ORDER-Rt)/Ii;return r=>{let n=t.pow(r,e);return t.eql(n,t.ZERO)||t.eql(n,t.ONE)}}ct.FpIsSquare=xv;function Tl(t,e){let r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}ct.nLength=Tl;function Sv(t,e,r=!1,n={}){if(t<=cr)throw new Error(`Expected Fp ORDER > 0, got ${t}`);let{nBitLength:i,nByteLength:o}=Tl(t,e);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");let a=P2(t),s=Object.freeze({ORDER:t,BITS:i,BYTES:o,MASK:(0,ti.bitMask)(i),ZERO:cr,ONE:Rt,create:u=>an(u,t),isValid:u=>{if(typeof u!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof u}`);return cr<=u&&u<t},is0:u=>u===cr,isOdd:u=>(u&Rt)===Rt,neg:u=>an(-u,t),eql:(u,h)=>u===h,sqr:u=>an(u*u,t),add:(u,h)=>an(u+h,t),sub:(u,h)=>an(u-h,t),mul:(u,h)=>an(u*h,t),pow:(u,h)=>T2(s,u,h),div:(u,h)=>an(u*Jf(h,t),t),sqrN:u=>u*u,addN:(u,h)=>u+h,subN:(u,h)=>u-h,mulN:(u,h)=>u*h,inv:u=>Jf(u,t),sqrt:n.sqrt||(u=>a(s,u)),invertBatch:u=>O2(s,u),cmov:(u,h,w)=>w?h:u,toBytes:u=>r?(0,ti.numberToBytesLE)(u,o):(0,ti.numberToBytesBE)(u,o),fromBytes:u=>{if(u.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${u.length}`);return r?(0,ti.bytesToNumberLE)(u):(0,ti.bytesToNumberBE)(u)}});return Object.freeze(s)}ct.Field=Sv;function Bv(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");let r=t.sqrt(e);return t.isOdd(r)?r:t.neg(r)}ct.FpSqrtOdd=Bv;function Av(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");let r=t.sqrt(e);return t.isOdd(r)?t.neg(r):r}ct.FpSqrtEven=Av;function Mv(t,e,r=!1){t=(0,ti.ensureBytes)("privateHash",t);let n=t.length,i=Tl(e).nByteLength+8;if(i<24||n<i||n>1024)throw new Error(`hashToPrivateScalar: expected ${i}-1024 bytes of input, got ${n}`);let o=r?(0,ti.bytesToNumberLE)(t):(0,ti.bytesToNumberBE)(t);return an(o,e-Rt)+Rt}ct.hashToPrivateScalar=Mv});var k2=W(Qo=>{"use strict";x();S();Object.defineProperty(Qo,"__esModule",{value:!0});Qo.validateBasic=Qo.wNAF=void 0;var C2=co(),Ev=ei(),Iv=BigInt(0),Ol=BigInt(1);function Pv(t,e){let r=(i,o)=>{let a=o.negate();return i?a:o},n=i=>{let o=Math.ceil(e/i)+1,a=2**(i-1);return{windows:o,windowSize:a}};return{constTimeNegate:r,unsafeLadder(i,o){let a=t.ZERO,s=i;for(;o>Iv;)o&Ol&&(a=a.add(s)),s=s.double(),o>>=Ol;return a},precomputeWindow(i,o){let{windows:a,windowSize:s}=n(o),u=[],h=i,w=h;for(let p=0;p<a;p++){w=h,u.push(w);for(let M=1;M<s;M++)w=w.add(h),u.push(w);h=w.double()}return u},wNAF(i,o,a){let{windows:s,windowSize:u}=n(i),h=t.ZERO,w=t.BASE,p=BigInt(2**i-1),M=2**i,A=BigInt(i);for(let P=0;P<s;P++){let E=P*u,q=Number(a&p);a>>=A,q>u&&(q-=M,a+=Ol);let z=E,J=E+Math.abs(q)-1,$=P%2!==0,ee=q<0;q===0?w=w.add(r($,o[z])):h=h.add(r(ee,o[J]))}return{p:h,f:w}},wNAFCached(i,o,a,s){let u=i._WINDOW_SIZE||1,h=o.get(i);return h||(h=this.precomputeWindow(i,u),u!==1&&o.set(i,s(h))),this.wNAF(u,h,a)}}}Qo.wNAF=Pv;function Tv(t){return(0,C2.validateField)(t.Fp),(0,Ev.validateObject)(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,C2.nLength)(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}Qo.validateBasic=Tv});var tu=W(Nt=>{"use strict";x();S();var Ov=Nt&&Nt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Cv=Nt&&Nt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),q2=Nt&&Nt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Ov(e,t,r);return Cv(e,t),e};Object.defineProperty(Nt,"__esModule",{value:!0});Nt.mapToCurveSimpleSWU=Nt.SWUFpSqrtRatio=Nt.weierstrass=Nt.weierstrassPoints=Nt.DER=void 0;var qa=q2(co()),er=q2(ei()),jn=ei(),Cl=k2();function kv(t){let e=(0,Cl.validateBasic)(t);er.validateObject(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}var{bytesToNumberBE:Uv,hexToBytes:qv}=er;Nt.DER={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){let{Err:e}=Nt.DER;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");let r=t[1],n=t.subarray(2,r+2);if(!r||n.length!==r)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:Uv(n),l:t.subarray(r+2)}},toSig(t){let{Err:e}=Nt.DER,r=typeof t=="string"?qv(t):t;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||r[0]!=48)throw new e("Invalid signature tag");if(r[1]!==n-2)throw new e("Invalid signature: incorrect length");let{d:i,l:o}=Nt.DER._parseInt(r.subarray(2)),{d:a,l:s}=Nt.DER._parseInt(o);if(s.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:a}},hexFromSig(t){let e=h=>Number.parseInt(h[0],16)&8?"00"+h:h,r=h=>{let w=h.toString(16);return w.length&1?`0${w}`:w},n=e(r(t.s)),i=e(r(t.r)),o=n.length/2,a=i.length/2,s=r(o),u=r(a);return`30${r(a+o+4)}02${u}${i}02${s}${n}`}};var xn=BigInt(0),Gt=BigInt(1),Pi=BigInt(2),eu=BigInt(3),U2=BigInt(4);function R2(t){let e=kv(t),{Fp:r}=e,n=e.toBytes||((P,E,q)=>{let z=E.toAffine();return er.concatBytes(Uint8Array.from([4]),r.toBytes(z.x),r.toBytes(z.y))}),i=e.fromBytes||(P=>{let E=P.subarray(1),q=r.fromBytes(E.subarray(0,r.BYTES)),z=r.fromBytes(E.subarray(r.BYTES,2*r.BYTES));return{x:q,y:z}});function o(P){let{a:E,b:q}=e,z=r.sqr(P),J=r.mul(z,P);return r.add(r.add(J,r.mul(P,E)),q)}if(!r.eql(r.sqr(e.Gy),o(e.Gx)))throw new Error("bad generator point: equation left != right");function a(P){return typeof P=="bigint"&&xn<P&&P<e.n}function s(P){if(!a(P))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function u(P){let{allowedPrivateKeyLengths:E,nByteLength:q,wrapPrivateKey:z,n:J}=e;if(E&&typeof P!="bigint"){if(P instanceof Uint8Array&&(P=er.bytesToHex(P)),typeof P!="string"||!E.includes(P.length))throw new Error("Invalid key");P=P.padStart(q*2,"0")}let $;try{$=typeof P=="bigint"?P:er.bytesToNumberBE((0,jn.ensureBytes)("private key",P,q))}catch{throw new Error(`private key must be ${q} bytes, hex or bigint, not ${typeof P}`)}return z&&($=qa.mod($,J)),s($),$}let h=new Map;function w(P){if(!(P instanceof p))throw new Error("ProjectivePoint expected")}class p{constructor(E,q,z){if(this.px=E,this.py=q,this.pz=z,E==null||!r.isValid(E))throw new Error("x required");if(q==null||!r.isValid(q))throw new Error("y required");if(z==null||!r.isValid(z))throw new Error("z required")}static fromAffine(E){let{x:q,y:z}=E||{};if(!E||!r.isValid(q)||!r.isValid(z))throw new Error("invalid affine point");if(E instanceof p)throw new Error("projective point not allowed");let J=$=>r.eql($,r.ZERO);return J(q)&&J(z)?p.ZERO:new p(q,z,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(E){let q=r.invertBatch(E.map(z=>z.pz));return E.map((z,J)=>z.toAffine(q[J])).map(p.fromAffine)}static fromHex(E){let q=p.fromAffine(i((0,jn.ensureBytes)("pointHex",E)));return q.assertValidity(),q}static fromPrivateKey(E){return p.BASE.multiply(u(E))}_setWindowSize(E){this._WINDOW_SIZE=E,h.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint)return;throw new Error("bad point: ZERO")}let{x:E,y:q}=this.toAffine();if(!r.isValid(E)||!r.isValid(q))throw new Error("bad point: x or y not FE");let z=r.sqr(q),J=o(E);if(!r.eql(z,J))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:E}=this.toAffine();if(r.isOdd)return!r.isOdd(E);throw new Error("Field doesn't support isOdd")}equals(E){w(E);let{px:q,py:z,pz:J}=this,{px:$,py:ee,pz:Y}=E,Z=r.eql(r.mul(q,Y),r.mul($,J)),ne=r.eql(r.mul(z,Y),r.mul(ee,J));return Z&&ne}negate(){return new p(this.px,r.neg(this.py),this.pz)}double(){let{a:E,b:q}=e,z=r.mul(q,eu),{px:J,py:$,pz:ee}=this,Y=r.ZERO,Z=r.ZERO,ne=r.ZERO,re=r.mul(J,J),ye=r.mul($,$),U=r.mul(ee,ee),f=r.mul(J,$);return f=r.add(f,f),ne=r.mul(J,ee),ne=r.add(ne,ne),Y=r.mul(E,ne),Z=r.mul(z,U),Z=r.add(Y,Z),Y=r.sub(ye,Z),Z=r.add(ye,Z),Z=r.mul(Y,Z),Y=r.mul(f,Y),ne=r.mul(z,ne),U=r.mul(E,U),f=r.sub(re,U),f=r.mul(E,f),f=r.add(f,ne),ne=r.add(re,re),re=r.add(ne,re),re=r.add(re,U),re=r.mul(re,f),Z=r.add(Z,re),U=r.mul($,ee),U=r.add(U,U),re=r.mul(U,f),Y=r.sub(Y,re),ne=r.mul(U,ye),ne=r.add(ne,ne),ne=r.add(ne,ne),new p(Y,Z,ne)}add(E){w(E);let{px:q,py:z,pz:J}=this,{px:$,py:ee,pz:Y}=E,Z=r.ZERO,ne=r.ZERO,re=r.ZERO,ye=e.a,U=r.mul(e.b,eu),f=r.mul(q,$),b=r.mul(z,ee),g=r.mul(J,Y),d=r.add(q,z),_=r.add($,ee);d=r.mul(d,_),_=r.add(f,b),d=r.sub(d,_),_=r.add(q,J);let k=r.add($,Y);return _=r.mul(_,k),k=r.add(f,g),_=r.sub(_,k),k=r.add(z,J),Z=r.add(ee,Y),k=r.mul(k,Z),Z=r.add(b,g),k=r.sub(k,Z),re=r.mul(ye,_),Z=r.mul(U,g),re=r.add(Z,re),Z=r.sub(b,re),re=r.add(b,re),ne=r.mul(Z,re),b=r.add(f,f),b=r.add(b,f),g=r.mul(ye,g),_=r.mul(U,_),b=r.add(b,g),g=r.sub(f,g),g=r.mul(ye,g),_=r.add(_,g),f=r.mul(b,_),ne=r.add(ne,f),f=r.mul(k,_),Z=r.mul(d,Z),Z=r.sub(Z,f),f=r.mul(d,b),re=r.mul(k,re),re=r.add(re,f),new p(Z,ne,re)}subtract(E){return this.add(E.negate())}is0(){return this.equals(p.ZERO)}wNAF(E){return A.wNAFCached(this,h,E,q=>{let z=r.invertBatch(q.map(J=>J.pz));return q.map((J,$)=>J.toAffine(z[$])).map(p.fromAffine)})}multiplyUnsafe(E){let q=p.ZERO;if(E===xn)return q;if(s(E),E===Gt)return this;let{endo:z}=e;if(!z)return A.unsafeLadder(this,E);let{k1neg:J,k1:$,k2neg:ee,k2:Y}=z.splitScalar(E),Z=q,ne=q,re=this;for(;$>xn||Y>xn;)$&Gt&&(Z=Z.add(re)),Y&Gt&&(ne=ne.add(re)),re=re.double(),$>>=Gt,Y>>=Gt;return J&&(Z=Z.negate()),ee&&(ne=ne.negate()),ne=new p(r.mul(ne.px,z.beta),ne.py,ne.pz),Z.add(ne)}multiply(E){s(E);let q=E,z,J,{endo:$}=e;if($){let{k1neg:ee,k1:Y,k2neg:Z,k2:ne}=$.splitScalar(q),{p:re,f:ye}=this.wNAF(Y),{p:U,f}=this.wNAF(ne);re=A.constTimeNegate(ee,re),U=A.constTimeNegate(Z,U),U=new p(r.mul(U.px,$.beta),U.py,U.pz),z=re.add(U),J=ye.add(f)}else{let{p:ee,f:Y}=this.wNAF(q);z=ee,J=Y}return p.normalizeZ([z,J])[0]}multiplyAndAddUnsafe(E,q,z){let J=p.BASE,$=(Y,Z)=>Z===xn||Z===Gt||!Y.equals(J)?Y.multiplyUnsafe(Z):Y.multiply(Z),ee=$(this,q).add($(E,z));return ee.is0()?void 0:ee}toAffine(E){let{px:q,py:z,pz:J}=this,$=this.is0();E==null&&(E=$?r.ONE:r.inv(J));let ee=r.mul(q,E),Y=r.mul(z,E),Z=r.mul(J,E);if($)return{x:r.ZERO,y:r.ZERO};if(!r.eql(Z,r.ONE))throw new Error("invZ was invalid");return{x:ee,y:Y}}isTorsionFree(){let{h:E,isTorsionFree:q}=e;if(E===Gt)return!0;if(q)return q(p,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:E,clearCofactor:q}=e;return E===Gt?this:q?q(p,this):this.multiplyUnsafe(e.h)}toRawBytes(E=!0){return this.assertValidity(),n(p,this,E)}toHex(E=!0){return er.bytesToHex(this.toRawBytes(E))}}p.BASE=new p(e.Gx,e.Gy,r.ONE),p.ZERO=new p(r.ZERO,r.ONE,r.ZERO);let M=e.nBitLength,A=(0,Cl.wNAF)(p,e.endo?Math.ceil(M/2):M);return{CURVE:e,ProjectivePoint:p,normPrivateKeyToScalar:u,weierstrassEquation:o,isWithinCurveOrder:a}}Nt.weierstrassPoints=R2;function Rv(t){let e=(0,Cl.validateBasic)(t);return er.validateObject(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function Nv(t){let e=Rv(t),{Fp:r,n}=e,i=r.BYTES+1,o=2*r.BYTES+1;function a(_){return xn<_&&_<r.ORDER}function s(_){return qa.mod(_,n)}function u(_){return qa.invert(_,n)}let{ProjectivePoint:h,normPrivateKeyToScalar:w,weierstrassEquation:p,isWithinCurveOrder:M}=R2({...e,toBytes(_,k,H){let T=k.toAffine(),c=r.toBytes(T.x),O=er.concatBytes;return H?O(Uint8Array.from([k.hasEvenY()?2:3]),c):O(Uint8Array.from([4]),c,r.toBytes(T.y))},fromBytes(_){let k=_.length,H=_[0],T=_.subarray(1);if(k===i&&(H===2||H===3)){let c=er.bytesToNumberBE(T);if(!a(c))throw new Error("Point is not on curve");let O=p(c),N=r.sqrt(O),le=(N&Gt)===Gt;return(H&1)===1!==le&&(N=r.neg(N)),{x:c,y:N}}else if(k===o&&H===4){let c=r.fromBytes(T.subarray(0,r.BYTES)),O=r.fromBytes(T.subarray(r.BYTES,2*r.BYTES));return{x:c,y:O}}else throw new Error(`Point of length ${k} was invalid. Expected ${i} compressed bytes or ${o} uncompressed bytes`)}}),A=_=>er.bytesToHex(er.numberToBytesBE(_,e.nByteLength));function P(_){let k=n>>Gt;return _>k}function E(_){return P(_)?s(-_):_}let q=(_,k,H)=>er.bytesToNumberBE(_.slice(k,H));class z{constructor(k,H,T){this.r=k,this.s=H,this.recovery=T,this.assertValidity()}static fromCompact(k){let H=e.nByteLength;return k=(0,jn.ensureBytes)("compactSignature",k,H*2),new z(q(k,0,H),q(k,H,2*H))}static fromDER(k){let{r:H,s:T}=Nt.DER.toSig((0,jn.ensureBytes)("DER",k));return new z(H,T)}assertValidity(){if(!M(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!M(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(k){return new z(this.r,this.s,k)}recoverPublicKey(k){let{r:H,s:T,recovery:c}=this,O=ne((0,jn.ensureBytes)("msgHash",k));if(c==null||![0,1,2,3].includes(c))throw new Error("recovery id invalid");let N=c===2||c===3?H+e.n:H;if(N>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");let le=(c&1)===0?"02":"03",ce=h.fromHex(le+A(N)),Te=u(N),qe=s(-O*Te),Fe=s(T*Te),at=h.BASE.multiplyAndAddUnsafe(ce,qe,Fe);if(!at)throw new Error("point at infinify");return at.assertValidity(),at}hasHighS(){return P(this.s)}normalizeS(){return this.hasHighS()?new z(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return er.hexToBytes(this.toDERHex())}toDERHex(){return Nt.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return er.hexToBytes(this.toCompactHex())}toCompactHex(){return A(this.r)+A(this.s)}}let J={isValidPrivateKey(_){try{return w(_),!0}catch{return!1}},normPrivateKeyToScalar:w,randomPrivateKey:()=>{let _=e.randomBytes(r.BYTES+8),k=qa.hashToPrivateScalar(_,n);return er.numberToBytesBE(k,e.nByteLength)},precompute(_=8,k=h.BASE){return k._setWindowSize(_),k.multiply(BigInt(3)),k}};function $(_,k=!0){return h.fromPrivateKey(_).toRawBytes(k)}function ee(_){let k=_ instanceof Uint8Array,H=typeof _=="string",T=(k||H)&&_.length;return k?T===i||T===o:H?T===2*i||T===2*o:_ instanceof h}function Y(_,k,H=!0){if(ee(_))throw new Error("first arg must be private key");if(!ee(k))throw new Error("second arg must be public key");return h.fromHex(k).multiply(w(_)).toRawBytes(H)}let Z=e.bits2int||function(_){let k=er.bytesToNumberBE(_),H=_.length*8-e.nBitLength;return H>0?k>>BigInt(H):k},ne=e.bits2int_modN||function(_){return s(Z(_))},re=er.bitMask(e.nBitLength);function ye(_){if(typeof _!="bigint")throw new Error("bigint expected");if(!(xn<=_&&_<re))throw new Error(`bigint expected < 2^${e.nBitLength}`);return er.numberToBytesBE(_,e.nByteLength)}function U(_,k,H=f){if(["recovered","canonical"].some(Pe=>Pe in H))throw new Error("sign() legacy options not supported");let{hash:T,randomBytes:c}=e,{lowS:O,prehash:N,extraEntropy:le}=H;O==null&&(O=!0),_=(0,jn.ensureBytes)("msgHash",_),N&&(_=(0,jn.ensureBytes)("prehashed msgHash",T(_)));let ce=ne(_),Te=w(k),qe=[ye(Te),ye(ce)];if(le!=null){let Pe=le===!0?c(r.BYTES):le;qe.push((0,jn.ensureBytes)("extraEntropy",Pe,r.BYTES))}let Fe=er.concatBytes(...qe),at=ce;function He(Pe){let jt=Z(Pe);if(!M(jt))return;let yt=u(jt),ft=h.BASE.multiply(jt).toAffine(),xr=s(ft.x);if(xr===xn)return;let mt=s(yt*s(at+xr*Te));if(mt===xn)return;let At=(ft.x===xr?0:2)|Number(ft.y&Gt),$r=mt;return O&&P(mt)&&($r=E(mt),At^=1),new z(xr,$r,At)}return{seed:Fe,k2sig:He}}let f={lowS:e.lowS,prehash:!1},b={lowS:e.lowS,prehash:!1};function g(_,k,H=f){let{seed:T,k2sig:c}=U(_,k,H),O=e;return er.createHmacDrbg(O.hash.outputLen,O.nByteLength,O.hmac)(T,c)}h.BASE._setWindowSize(8);function d(_,k,H,T=b){let c=_;if(k=(0,jn.ensureBytes)("msgHash",k),H=(0,jn.ensureBytes)("publicKey",H),"strict"in T)throw new Error("options.strict was renamed to lowS");let{lowS:O,prehash:N}=T,le,ce;try{if(typeof c=="string"||c instanceof Uint8Array)try{le=z.fromDER(c)}catch(ft){if(!(ft instanceof Nt.DER.Err))throw ft;le=z.fromCompact(c)}else if(typeof c=="object"&&typeof c.r=="bigint"&&typeof c.s=="bigint"){let{r:ft,s:xr}=c;le=new z(ft,xr)}else throw new Error("PARSE");ce=h.fromHex(H)}catch(ft){if(ft.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(O&&le.hasHighS())return!1;N&&(k=e.hash(k));let{r:Te,s:qe}=le,Fe=ne(k),at=u(qe),He=s(Fe*at),Pe=s(Te*at),jt=h.BASE.multiplyAndAddUnsafe(ce,He,Pe)?.toAffine();return jt?s(jt.x)===Te:!1}return{CURVE:e,getPublicKey:$,getSharedSecret:Y,sign:g,verify:d,ProjectivePoint:h,Signature:z,utils:J}}Nt.weierstrass=Nv;function N2(t,e){let r=t.ORDER,n=xn;for(let P=r-Gt;P%Pi===xn;P/=Pi)n+=Gt;let i=n,o=Pi<<i-Gt-Gt,a=o*Pi,s=(r-Gt)/a,u=(s-Gt)/Pi,h=a-Gt,w=o,p=t.pow(e,s),M=t.pow(e,(s+Gt)/Pi),A=(P,E)=>{let q=p,z=t.pow(E,h),J=t.sqr(z);J=t.mul(J,E);let $=t.mul(P,J);$=t.pow($,u),$=t.mul($,z),z=t.mul($,E),J=t.mul($,P);let ee=t.mul(J,z);$=t.pow(ee,w);let Y=t.eql($,t.ONE);z=t.mul(J,M),$=t.mul(ee,q),J=t.cmov(z,J,Y),ee=t.cmov($,ee,Y);for(let Z=i;Z>Gt;Z--){let ne=Z-Pi;ne=Pi<<ne-Gt;let re=t.pow(ee,ne),ye=t.eql(re,t.ONE);z=t.mul(J,q),q=t.mul(q,q),re=t.mul(ee,q),J=t.cmov(z,J,ye),ee=t.cmov(re,ee,ye)}return{isValid:Y,value:J}};if(t.ORDER%U2===eu){let P=(t.ORDER-eu)/U2,E=t.sqrt(t.neg(e));A=(q,z)=>{let J=t.sqr(z),$=t.mul(q,z);J=t.mul(J,$);let ee=t.pow(J,P);ee=t.mul(ee,$);let Y=t.mul(ee,E),Z=t.mul(t.sqr(ee),z),ne=t.eql(Z,q),re=t.cmov(Y,ee,ne);return{isValid:ne,value:re}}}return A}Nt.SWUFpSqrtRatio=N2;function Lv(t,e){if(qa.validateField(t),!t.isValid(e.A)||!t.isValid(e.B)||!t.isValid(e.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");let r=N2(t,e.Z);if(!t.isOdd)throw new Error("Fp.isOdd is not implemented!");return n=>{let i,o,a,s,u,h,w,p;i=t.sqr(n),i=t.mul(i,e.Z),o=t.sqr(i),o=t.add(o,i),a=t.add(o,t.ONE),a=t.mul(a,e.B),s=t.cmov(e.Z,t.neg(o),!t.eql(o,t.ZERO)),s=t.mul(s,e.A),o=t.sqr(a),h=t.sqr(s),u=t.mul(h,e.A),o=t.add(o,u),o=t.mul(o,a),h=t.mul(h,s),u=t.mul(h,e.B),o=t.add(o,u),w=t.mul(i,a);let{isValid:M,value:A}=r(o,h);p=t.mul(i,n),p=t.mul(p,A),w=t.cmov(w,a,M),p=t.cmov(p,A,M);let P=t.isOdd(n)===t.isOdd(p);return p=t.cmov(t.neg(p),p,P),w=t.div(w,s),{x:w,y:p}}}Nt.mapToCurveSimpleSWU=Lv});var H2=W(fn=>{"use strict";x();S();Object.defineProperty(fn,"__esModule",{value:!0});fn.createHasher=fn.isogenyMap=fn.hash_to_field=fn.expand_message_xof=fn.expand_message_xmd=void 0;var jv=co(),Sn=ei();function Hv(t){if(t instanceof Uint8Array)return t;if(typeof t=="string")return(0,Sn.utf8ToBytes)(t);throw new Error("DST must be Uint8Array or string")}var Kv=Sn.bytesToNumberBE;function Ti(t,e){if(t<0||t>=1<<8*e)throw new Error(`bad I2OSP call: value=${t} length=${e}`);let r=Array.from({length:e}).fill(0);for(let n=e-1;n>=0;n--)r[n]=t&255,t>>>=8;return new Uint8Array(r)}function Dv(t,e){let r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t[n]^e[n];return r}function Ra(t){if(!(t instanceof Uint8Array))throw new Error("Uint8Array expected")}function Ul(t){if(!Number.isSafeInteger(t))throw new Error("number expected")}function L2(t,e,r,n){Ra(t),Ra(e),Ul(r),e.length>255&&(e=n((0,Sn.concatBytes)((0,Sn.utf8ToBytes)("H2C-OVERSIZE-DST-"),e)));let{outputLen:i,blockLen:o}=n,a=Math.ceil(r/i);if(a>255)throw new Error("Invalid xmd length");let s=(0,Sn.concatBytes)(e,Ti(e.length,1)),u=Ti(0,o),h=Ti(r,2),w=new Array(a),p=n((0,Sn.concatBytes)(u,t,h,Ti(0,1),s));w[0]=n((0,Sn.concatBytes)(p,Ti(1,1),s));for(let A=1;A<=a;A++){let P=[Dv(p,w[A-1]),Ti(A+1,1),s];w[A]=n((0,Sn.concatBytes)(...P))}return(0,Sn.concatBytes)(...w).slice(0,r)}fn.expand_message_xmd=L2;function j2(t,e,r,n,i){if(Ra(t),Ra(e),Ul(r),e.length>255){let o=Math.ceil(2*n/8);e=i.create({dkLen:o}).update((0,Sn.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(e).digest()}if(r>65535||e.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return i.create({dkLen:r}).update(t).update(Ti(r,2)).update(e).update(Ti(e.length,1)).digest()}fn.expand_message_xof=j2;function kl(t,e,r){(0,Sn.validateObject)(r,{DST:"string",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});let{p:n,k:i,m:o,hash:a,expand:s,DST:u}=r;Ra(t),Ul(e);let h=Hv(u),w=n.toString(2).length,p=Math.ceil((w+i)/8),M=e*o*p,A;if(s==="xmd")A=L2(t,h,M,a);else if(s==="xof")A=j2(t,h,M,i,a);else if(s==="_internal_pass")A=t;else throw new Error('expand must be "xmd" or "xof"');let P=new Array(e);for(let E=0;E<e;E++){let q=new Array(o);for(let z=0;z<o;z++){let J=p*(z+E*o),$=A.subarray(J,J+p);q[z]=(0,jv.mod)(Kv($),n)}P[E]=q}return P}fn.hash_to_field=kl;function Vv(t,e){let r=e.map(n=>Array.from(n).reverse());return(n,i)=>{let[o,a,s,u]=r.map(h=>h.reduce((w,p)=>t.add(t.mul(w,n),p)));return n=t.div(o,a),i=t.mul(i,t.div(s,u)),{x:n,y:i}}}fn.isogenyMap=Vv;function Fv(t,e,r){if(typeof e!="function")throw new Error("mapToCurve() must be defined");return{hashToCurve(n,i){let o=kl(n,2,{...r,DST:r.DST,...i}),a=t.fromAffine(e(o[0])),s=t.fromAffine(e(o[1])),u=a.add(s).clearCofactor();return u.assertValidity(),u},encodeToCurve(n,i){let o=kl(n,1,{...r,DST:r.encodeDST,...i}),a=t.fromAffine(e(o[0])).clearCofactor();return a.assertValidity(),a}}}fn.createHasher=Fv});var ql=W(Jo=>{"use strict";x();S();Object.defineProperty(Jo,"__esModule",{value:!0});Jo.createCurve=Jo.getHash=void 0;var zv=xa(),K2=vr(),Wv=tu();function D2(t){return{hash:t,hmac:(e,...r)=>(0,zv.hmac)(t,e,(0,K2.concatBytes)(...r)),randomBytes:K2.randomBytes}}Jo.getHash=D2;function $v(t,e){let r=n=>(0,Wv.weierstrass)({...t,...D2(n)});return Object.freeze({...r(e),create:r})}Jo.createCurve=$v});var Q2=W(tr=>{"use strict";x();S();var Gv=tr&&tr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Zv=tr&&tr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Yv=tr&&tr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Gv(e,t,r);return Zv(e,t),e},Rl;Object.defineProperty(tr,"__esModule",{value:!0});tr.encodeToCurve=tr.hashToCurve=tr.schnorr=tr.secp256k1=void 0;var ru=Eo(),Xv=vr(),gr=co(),Qv=tu(),Pr=ei(),z2=Yv(H2()),Jv=ql(),su=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),nu=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),W2=BigInt(1),iu=BigInt(2),V2=(t,e)=>(t+e/iu)/e;function $2(t){let e=su,r=BigInt(3),n=BigInt(6),i=BigInt(11),o=BigInt(22),a=BigInt(23),s=BigInt(44),u=BigInt(88),h=t*t*t%e,w=h*h*t%e,p=(0,gr.pow2)(w,r,e)*w%e,M=(0,gr.pow2)(p,r,e)*w%e,A=(0,gr.pow2)(M,iu,e)*h%e,P=(0,gr.pow2)(A,i,e)*A%e,E=(0,gr.pow2)(P,o,e)*P%e,q=(0,gr.pow2)(E,s,e)*E%e,z=(0,gr.pow2)(q,u,e)*q%e,J=(0,gr.pow2)(z,s,e)*E%e,$=(0,gr.pow2)(J,r,e)*w%e,ee=(0,gr.pow2)($,a,e)*P%e,Y=(0,gr.pow2)(ee,n,e)*h%e,Z=(0,gr.pow2)(Y,iu,e);if(!Oi.eql(Oi.sqr(Z),t))throw new Error("Cannot find square root");return Z}var Oi=(0,gr.Field)(su,void 0,void 0,{sqrt:$2});tr.secp256k1=(0,Jv.createCurve)({a:BigInt(0),b:BigInt(7),Fp:Oi,n:nu,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{let e=nu,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-W2*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,a=BigInt("0x100000000000000000000000000000000"),s=V2(o*t,e),u=V2(-n*t,e),h=(0,gr.mod)(t-s*r-u*i,e),w=(0,gr.mod)(-s*n-u*o,e),p=h>a,M=w>a;if(p&&(h=e-h),M&&(w=e-w),h>a||w>a)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:p,k1:h,k2neg:M,k2:w}}}},ru.sha256);var au=BigInt(0),G2=t=>typeof t=="bigint"&&au<t&&t<su,ew=t=>typeof t=="bigint"&&au<t&&t<nu,F2={};function ou(t,...e){let r=F2[t];if(r===void 0){let n=(0,ru.sha256)(Uint8Array.from(t,i=>i.charCodeAt(0)));r=(0,Pr.concatBytes)(n,n),F2[t]=r}return(0,ru.sha256)((0,Pr.concatBytes)(r,...e))}var Hl=t=>t.toRawBytes(!0).slice(1),Ll=t=>(0,Pr.numberToBytesBE)(t,32),Nl=t=>(0,gr.mod)(t,su),Na=t=>(0,gr.mod)(t,nu),Kl=tr.secp256k1.ProjectivePoint,tw=(t,e,r)=>Kl.BASE.multiplyAndAddUnsafe(t,e,r);function jl(t){let e=tr.secp256k1.utils.normPrivateKeyToScalar(t),r=Kl.fromPrivateKey(e);return{scalar:r.hasEvenY()?e:Na(-e),bytes:Hl(r)}}function Z2(t){if(!G2(t))throw new Error("bad x: need 0 < x < p");let e=Nl(t*t),r=Nl(e*t+BigInt(7)),n=$2(r);n%iu!==au&&(n=Nl(-n));let i=new Kl(t,n,W2);return i.assertValidity(),i}function Y2(...t){return Na((0,Pr.bytesToNumberBE)(ou("BIP0340/challenge",...t)))}function rw(t){return jl(t).bytes}function nw(t,e,r=(0,Xv.randomBytes)(32)){let n=(0,Pr.ensureBytes)("message",t),{bytes:i,scalar:o}=jl(e),a=(0,Pr.ensureBytes)("auxRand",r,32),s=Ll(o^(0,Pr.bytesToNumberBE)(ou("BIP0340/aux",a))),u=ou("BIP0340/nonce",s,i,n),h=Na((0,Pr.bytesToNumberBE)(u));if(h===au)throw new Error("sign failed: k is zero");let{bytes:w,scalar:p}=jl(h),M=Y2(w,i,n),A=new Uint8Array(64);if(A.set(w,0),A.set(Ll(Na(p+M*o)),32),!X2(A,n,i))throw new Error("sign: Invalid signature produced");return A}function X2(t,e,r){let n=(0,Pr.ensureBytes)("signature",t,64),i=(0,Pr.ensureBytes)("message",e),o=(0,Pr.ensureBytes)("publicKey",r,32);try{let a=Z2((0,Pr.bytesToNumberBE)(o)),s=(0,Pr.bytesToNumberBE)(n.subarray(0,32));if(!G2(s))return!1;let u=(0,Pr.bytesToNumberBE)(n.subarray(32,64));if(!ew(u))return!1;let h=Y2(Ll(s),Hl(a),i),w=tw(a,u,Na(-h));return!(!w||!w.hasEvenY()||w.toAffine().x!==s)}catch{return!1}}tr.schnorr={getPublicKey:rw,sign:nw,verify:X2,utils:{randomPrivateKey:tr.secp256k1.utils.randomPrivateKey,lift_x:Z2,pointToBytes:Hl,numberToBytesBE:Pr.numberToBytesBE,bytesToNumberBE:Pr.bytesToNumberBE,taggedHash:ou,mod:gr.mod}};var iw=z2.isogenyMap(Oi,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(t=>t.map(e=>BigInt(e)))),ow=(0,Qv.mapToCurveSimpleSWU)(Oi,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:Oi.create(BigInt("-11"))});Rl=z2.createHasher(tr.secp256k1.ProjectivePoint,t=>{let{x:e,y:r}=ow(Oi.create(t[0]));return iw(e,r)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:Oi.ORDER,m:1,k:128,expand:"xmd",hash:ru.sha256}),tr.hashToCurve=Rl.hashToCurve,tr.encodeToCurve=Rl.encodeToCurve});var tb=W(Ci=>{"use strict";x();S();Object.defineProperty(Ci,"__esModule",{value:!0});Ci.poseidon=Ci.splitConstants=Ci.validateOpts=void 0;var J2=co();function eb(t){let{Fp:e}=t;(0,J2.validateField)(e);for(let u of["t","roundsFull","roundsPartial"])if(typeof t[u]!="number"||!Number.isSafeInteger(t[u]))throw new Error(`Poseidon: invalid param ${u}=${t[u]} (${typeof t[u]})`);if(t.reversePartialPowIdx!==void 0&&typeof t.reversePartialPowIdx!="boolean")throw new Error(`Poseidon: invalid param reversePartialPowIdx=${t.reversePartialPowIdx}`);let r=t.sboxPower;if(r===void 0&&(r=5),typeof r!="number"||!Number.isSafeInteger(r))throw new Error(`Poseidon wrong sboxPower=${r}`);let n=BigInt(r),i=u=>(0,J2.FpPow)(e,u,n);if(r===3?i=u=>e.mul(e.sqrN(u),u):r===5&&(i=u=>e.mul(e.sqrN(e.sqrN(u)),u)),t.roundsFull%2!==0)throw new Error(`Poseidon roundsFull is not even: ${t.roundsFull}`);let o=t.roundsFull+t.roundsPartial;if(!Array.isArray(t.roundConstants)||t.roundConstants.length!==o)throw new Error("Poseidon: wrong round constants");let a=t.roundConstants.map(u=>{if(!Array.isArray(u)||u.length!==t.t)throw new Error(`Poseidon wrong round constants: ${u}`);return u.map(h=>{if(typeof h!="bigint"||!e.isValid(h))throw new Error(`Poseidon wrong round constant=${h}`);return e.create(h)})});if(!Array.isArray(t.mds)||t.mds.length!==t.t)throw new Error("Poseidon: wrong MDS matrix");let s=t.mds.map(u=>{if(!Array.isArray(u)||u.length!==t.t)throw new Error(`Poseidon MDS matrix row: ${u}`);return u.map(h=>{if(typeof h!="bigint")throw new Error(`Poseidon MDS matrix value=${h}`);return e.create(h)})});return Object.freeze({...t,rounds:o,sboxFn:i,roundConstants:a,mds:s})}Ci.validateOpts=eb;function sw(t,e){if(typeof e!="number")throw new Error("poseidonSplitConstants: wrong t");if(!Array.isArray(t)||t.length%e)throw new Error("poseidonSplitConstants: wrong rc");let r=[],n=[];for(let i=0;i<t.length;i++)n.push(t[i]),n.length===e&&(r.push(n),n=[]);return r}Ci.splitConstants=sw;function aw(t){let{t:e,Fp:r,rounds:n,sboxFn:i,reversePartialPowIdx:o}=eb(t),a=Math.floor(t.roundsFull/2),s=o?e-1:0,u=(w,p,M)=>(w=w.map((A,P)=>r.add(A,t.roundConstants[M][P])),p?w=w.map(A=>i(A)):w[s]=i(w[s]),w=t.mds.map(A=>A.reduce((P,E,q)=>r.add(P,r.mulN(E,w[q])),r.ZERO)),w),h=function(p){if(!Array.isArray(p)||p.length!==e)throw new Error(`Poseidon: wrong values (expected array of bigints with length ${e})`);p=p.map(A=>{if(typeof A!="bigint")throw new Error(`Poseidon: wrong value=${A} (${typeof A})`);return r.create(A)});let M=0;for(let A=0;A<a;A++)p=u(p,!0,M++);for(let A=0;A<t.roundsPartial;A++)p=u(p,!1,M++);for(let A=0;A<a;A++)p=u(p,!0,M++);if(M!==n)throw new Error(`Poseidon: wrong number of rounds: last round=${M}, total=${n}`);return p};return h.roundConstants=t.roundConstants,h}Ci.poseidon=aw});var bb=W(Ce=>{"use strict";x();S();var fw=Ce&&Ce.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),uw=Ce&&Ce.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),cw=Ce&&Ce.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&fw(e,t,r);return uw(e,t),e};Object.defineProperty(Ce,"__esModule",{value:!0});Ce.poseidonHashMany=Ce.poseidonHashSingle=Ce.poseidonHashFunc=Ce.poseidonHash=Ce.poseidonSmall=Ce.poseidonCreate=Ce.poseidonBasic=Ce._poseidonMDS=Ce.Fp251=Ce.Fp253=Ce.keccak=Ce.computeHashOnElements=Ce.hashChain=Ce.pedersen=Ce.getAccountPath=Ce.ethSigToPrivate=Ce.getStarkKey=Ce.grindKey=Ce.utils=Ce.Signature=Ce.ProjectivePoint=Ce.CURVE=Ce.verify=Ce.sign=Ce.getSharedSecret=Ce.getPublicKey=Ce._starkCurve=void 0;var lw=xf(),Fl=Eo(),dw=vr(),ho=co(),hw=tb(),bw=tu(),Tr=cw(ei()),pw=ql(),uu=BigInt("3618502788666131213697322783095070105526743751716087489154079457884512865583"),ib=252;function rb(t){for(;t[0]===0;)t=t.subarray(1);let e=t.length*8-ib,r=Tr.bytesToNumberBE(t);return e>0?r>>BigInt(e):r}function ob(t){return typeof t=="string"&&(t=Wl(t),t.length&1&&(t="0"+t)),Tr.hexToBytes(t)}var bo=(0,bw.weierstrass)({a:BigInt(1),b:BigInt("3141592653589793238462643383279502884197169399375105820974944592307816406665"),Fp:(0,ho.Field)(BigInt("0x800000000000011000000000000000000000000000000000000000000000001")),n:uu,nBitLength:ib,Gx:BigInt("874739451078007766457464989774322083649278607533249481151382481072868806602"),Gy:BigInt("152666792071518830868575557812948353041420400780739481342941381225525861407"),h:BigInt(1),lowS:!1,...(0,pw.getHash)(Fl.sha256),bits2int:rb,bits2int_modN:t=>{let e=Tr.bytesToNumberBE(t).toString(16);return e.length===63&&(t=ob(e+"0")),(0,ho.mod)(rb(t),uu)}});Ce._starkCurve=bo;function lo(t){return Tr.ensureBytes("",typeof t=="string"?ob(t):t)}function zl(t){return Tr.bytesToHex(lo(t)).padStart(64,"0")}function sb(t,e=!1){return bo.getPublicKey(zl(t),e)}Ce.getPublicKey=sb;function gw(t,e){return bo.getSharedSecret(zl(t),e)}Ce.getSharedSecret=gw;function yw(t,e,r){return bo.sign(lo(t),zl(e),r)}Ce.sign=yw;function mw(t,e,r){let n=t instanceof ab?t:lo(t);return bo.verify(n,lo(e),lo(r))}Ce.verify=mw;var{CURVE:vw,ProjectivePoint:es,Signature:ab,utils:ww}=bo;Ce.CURVE=vw;Ce.ProjectivePoint=es;Ce.Signature=ab;Ce.utils=ww;function fb(t){return`0x${Tr.bytesToHex(t.subarray(1)).replace(/^0+/gm,"")}`}function Wl(t){return t.replace(/^0x/i,"")}function _w(t){return`0x${t.toString(16)}`}function ub(t){let e=lo(t),r=2n**256n,n=r-(0,ho.mod)(r,uu);for(let i=0;;i++){let o=Dl(Tr.concatBytes(e,Tr.numberToVarBytesBE(BigInt(i))));if(o<n)return(0,ho.mod)(o,uu).toString(16);if(i===1e5)throw new Error("grindKey is broken: tried 100k vals")}}Ce.grindKey=ub;function xw(t){return fb(sb(t,!0))}Ce.getStarkKey=xw;function Sw(t){if(t=Wl(t),t.length!==130)throw new Error("Wrong ethereum signature");return ub(t.substring(0,64))}Ce.ethSigToPrivate=Sw;var Bw=2n**31n-1n,fu=t=>Number(t&Bw);function Aw(t,e,r,n){let i=fu(Dl(t)),o=fu(Dl(e)),a=Tr.hexToNumber(Wl(r));return`m/2645'/${i}'/${o}'/${fu(a)}'/${fu(a>>31n)}'/${n}`}Ce.getAccountPath=Aw;var La=[new es(2089986280348253421170679821480865132823066470938446095505822317253594081284n,1713931329540660377023406109199410414810705867260802078187082345529207694986n,1n),new es(996781205833008774514500082376783249102396023663454813447423147977397232763n,1668503676786377725805489344771023921079126552019160156920634619255970485781n,1n),new es(2251563274489750535117886426533222435294046428347329203627021249169616184184n,1798716007562728905295480679789526322175868328062420237419143593021674992973n,1n),new es(2138414695194151160943305727036575959195309218611738193261179310511854807447n,113410276730064486255102093846540133784865286929052426931474106396135072156n,1n),new es(2379962749567351885752724891227938183011949129833673362440656643086021394946n,776496453633298175483985398648758586525933812536653089401905292063708816422n,1n)];function cb(t,e){let r=[],n=t;for(let i=0;i<248;i++)r.push(n),n=n.double();n=e;for(let i=0;i<4;i++)r.push(n),n=n.double();return r}var Mw=cb(La[1],La[2]),Ew=cb(La[3],La[4]);function lb(t){let e;if(typeof t=="bigint")e=t;else if(typeof t=="number"){if(!Number.isSafeInteger(t))throw new Error(`Invalid pedersenArg: ${t}`);e=BigInt(t)}else e=Tr.bytesToNumberBE(lo(t));if(!(0n<=e&&e<bo.CURVE.Fp.ORDER))throw new Error(`PedersenArg should be 0 <= value < CURVE.P: ${e}`);return e}function nb(t,e,r){let n=lb(e);for(let i=0;i<252;i++){let o=r[i];if(o.equals(t))throw new Error("Same point");(n&1n)!==0n&&(t=t.add(o)),n>>=1n}return t}function $l(t,e){let r=La[0];return r=nb(r,t,Mw),r=nb(r,e,Ew),fb(r.toRawBytes(!0))}Ce.pedersen=$l;function Iw(t,e=$l){if(!Array.isArray(t)||t.length<1)throw new Error("data should be array of at least 1 element");return t.length===1?_w(lb(t[0])):Array.from(t).reverse().reduce((r,n)=>e(n,r))}Ce.hashChain=Iw;var Pw=(t,e=$l)=>[0,...t,t.length].reduce((r,n)=>e(r,n));Ce.computeHashOnElements=Pw;var Tw=Tr.bitMask(250),Ow=t=>Tr.bytesToNumberBE((0,lw.keccak_256)(t))&Tw;Ce.keccak=Ow;var Dl=t=>Tr.bytesToNumberBE((0,Fl.sha256)(t));Ce.Fp253=(0,ho.Field)(BigInt("14474011154664525231415395255581126252639794253786371766033694892385558855681"));Ce.Fp251=(0,ho.Field)(BigInt("3618502788666131213697322783095070105623107215331596699973092056135872020481"));function Vl(t,e,r){let n=t.fromBytes((0,Fl.sha256)((0,dw.utf8ToBytes)(`${e}${r}`)));return t.create(n)}function db(t,e,r,n=0){let i=[],o=[];for(let a=0;a<r;a++)i.push(Vl(t,`${e}x`,n*r+a)),o.push(Vl(t,`${e}y`,n*r+a));if(new Set([...i,...o]).size!==2*r)throw new Error("X and Y values are not distinct");return i.map(a=>o.map(s=>t.inv(t.sub(a,s))))}Ce._poseidonMDS=db;var Cw=[[3,1,1],[1,-1,1],[1,1,-2]].map(t=>t.map(BigInt));function Gl(t,e){if((0,ho.validateField)(t.Fp),!Number.isSafeInteger(t.rate)||!Number.isSafeInteger(t.capacity))throw new Error(`Wrong poseidon opts: ${t}`);let r=t.rate+t.capacity,n=t.roundsFull+t.roundsPartial,i=[];for(let a=0;a<n;a++){let s=[];for(let u=0;u<r;u++)s.push(Vl(t.Fp,"Hades",r*a+u));i.push(s)}let o=(0,hw.poseidon)({...t,t:r,sboxPower:3,reversePartialPowIdx:!0,mds:e,roundConstants:i});return o.m=r,o.rate=t.rate,o.capacity=t.capacity,o}Ce.poseidonBasic=Gl;function kw(t,e=0){let r=t.rate+t.capacity;if(!Number.isSafeInteger(e))throw new Error(`Wrong mdsAttempt=${e}`);return Gl(t,db(t.Fp,"HadesMDS",r,e))}Ce.poseidonCreate=kw;Ce.poseidonSmall=Gl({Fp:Ce.Fp251,rate:2,capacity:1,roundsFull:8,roundsPartial:83},Cw);function hb(t,e,r=Ce.poseidonSmall){return r([t,e,2n])[0]}Ce.poseidonHash=hb;function Uw(t,e,r=Ce.poseidonSmall){return Tr.numberToVarBytesBE(hb(Tr.bytesToNumberBE(t),Tr.bytesToNumberBE(e),r))}Ce.poseidonHashFunc=Uw;function qw(t,e=Ce.poseidonSmall){return e([t,0n,1n])[0]}Ce.poseidonHashSingle=qw;function Rw(t,e=Ce.poseidonSmall){let{m:r,rate:n}=e;if(!Array.isArray(t))throw new Error("bigint array expected in values");let i=Array.from(t);for(i.push(1n);i.length%n!==0;)i.push(0n);let o=new Array(r).fill(0n);for(let a=0;a<i.length;a+=n){for(let s=0;s<n;s++)o[s]+=i[a+s];o=e(o)}return o[0]}Ce.poseidonHashMany=Rw});var yb=W(Or=>{"use strict";x();S();var Nw=Or&&Or.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Lw=Or&&Or.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),pb=Or&&Or.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Nw(e,t,r);return Lw(e,t),e};Object.defineProperty(Or,"__esModule",{value:!0});Or.bytesToHex=Or.hexToBytes=Or.stark=Or.secp256k1=void 0;Or.secp256k1=pb(Q2());Or.stark=pb(bb());var gb=ei();Object.defineProperty(Or,"hexToBytes",{enumerable:!0,get:function(){return gb.hexToBytes}});Object.defineProperty(Or,"bytesToHex",{enumerable:!0,get:function(){return gb.bytesToHex}})});var mb=W(Cr=>{"use strict";x();S();var jw=Cr&&Cr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Hw=Cr&&Cr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),cu=Cr&&Cr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&jw(e,t,r);return Hw(e,t),e};Object.defineProperty(Cr,"__esModule",{value:!0});Cr.schnorr=Cr.p256=Cr.ed25519=Cr.secp256k1=void 0;Cr.secp256k1=cu(f2());Cr.ed25519=cu(g2());Cr.p256=cu(w2());Cr.schnorr=cu(yb())});var wb=W(ts=>{"use strict";x();S();var Kw=ts&&ts.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ts,"__esModule",{value:!0});ts.Decimal=void 0;var po=Kw(fr()),vb=100,rr=class{static fromUserInput(e,r){rr.verifyFractionalDigits(r);let n=e.match(/[^0-9.]/);if(n)throw new Error(`Invalid character at position ${n.index+1}`);let i,o;if(e.search(/\./)===-1)i=e,o="";else{let s=e.split(".");switch(s.length){case 0:case 1:throw new Error("Fewer than two elements in split result. This must not happen here.");case 2:if(!s[1])throw new Error("Fractional part missing");i=s[0],o=s[1].replace(/0+$/,"");break;default:throw new Error("More than one separator found")}}if(o.length>r)throw new Error("Got more fractional digits than supported");let a=`${i}${o.padEnd(r,"0")}`;return new rr(a,r)}static fromAtomics(e,r){return rr.verifyFractionalDigits(r),new rr(e,r)}static zero(e){return rr.verifyFractionalDigits(e),new rr("0",e)}static one(e){return rr.verifyFractionalDigits(e),new rr("1"+"0".repeat(e),e)}static verifyFractionalDigits(e){if(!Number.isInteger(e))throw new Error("Fractional digits is not an integer");if(e<0)throw new Error("Fractional digits must not be negative");if(e>vb)throw new Error(`Fractional digits must not exceed ${vb}`)}static compare(e,r){if(e.fractionalDigits!==r.fractionalDigits)throw new Error("Fractional digits do not match");return e.data.atomics.cmp(new po.default(r.atomics))}get atomics(){return this.data.atomics.toString()}get fractionalDigits(){return this.data.fractionalDigits}constructor(e,r){this.data={atomics:new po.default(e),fractionalDigits:r}}toString(){let e=new po.default(10).pow(new po.default(this.data.fractionalDigits)),r=this.data.atomics.div(e),n=this.data.atomics.mod(e);if(n.isZero())return r.toString();{let o=n.toString().padStart(this.data.fractionalDigits,"0").replace(/0+$/,"");return`${r.toString()}.${o}`}}toFloatApproximation(){let e=Number(this.toString());if(Number.isNaN(e))throw new Error("Conversion to number failed");return e}plus(e){if(this.fractionalDigits!==e.fractionalDigits)throw new Error("Fractional digits do not match");let r=this.data.atomics.add(new po.default(e.atomics));return new rr(r.toString(),this.fractionalDigits)}minus(e){if(this.fractionalDigits!==e.fractionalDigits)throw new Error("Fractional digits do not match");let r=this.data.atomics.sub(new po.default(e.atomics));if(r.ltn(0))throw new Error("Difference must not be negative");return new rr(r.toString(),this.fractionalDigits)}multiply(e){let r=this.data.atomics.mul(new po.default(e.toString()));return new rr(r.toString(),this.fractionalDigits)}equals(e){return rr.compare(this,e)===0}isLessThan(e){return rr.compare(this,e)<0}isLessThanOrEqual(e){return rr.compare(this,e)<=0}isGreaterThan(e){return rr.compare(this,e)>0}isGreaterThanOrEqual(e){return rr.compare(this,e)>=0}};ts.Decimal=rr});var _b=W(un=>{"use strict";x();S();var Dw=un&&un.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(un,"__esModule",{value:!0});un.Uint64=un.Uint53=un.Int53=un.Uint32=void 0;var lu=Dw(fr()),Vw=new lu.default("18446744073709551615",10,"be"),go=class{static fromBigEndianBytes(e){return go.fromBytes(e)}static fromBytes(e,r="be"){if(e.length!==4)throw new Error("Invalid input length. Expected 4 bytes.");for(let i=0;i<e.length;++i)if(!Number.isInteger(e[i])||e[i]>255||e[i]<0)throw new Error("Invalid value in byte. Found: "+e[i]);let n=r==="be"?e:Array.from(e).reverse();return new go(n[0]*2**24+n[1]*2**16+n[2]*2**8+n[3])}static fromString(e){if(!e.match(/^[0-9]+$/))throw new Error("Invalid string format");return new go(Number.parseInt(e,10))}constructor(e){if(Number.isNaN(e))throw new Error("Input is not a number");if(!Number.isInteger(e))throw new Error("Input is not an integer");if(e<0||e>4294967295)throw new Error("Input not in uint32 range: "+e.toString());this.data=e}toBytesBigEndian(){return new Uint8Array([Math.floor(this.data/2**24)&255,Math.floor(this.data/2**16)&255,Math.floor(this.data/2**8)&255,Math.floor(this.data/2**0)&255])}toBytesLittleEndian(){return new Uint8Array([Math.floor(this.data/2**0)&255,Math.floor(this.data/2**8)&255,Math.floor(this.data/2**16)&255,Math.floor(this.data/2**24)&255])}toNumber(){return this.data}toString(){return this.data.toString()}};un.Uint32=go;var yo=class{static fromString(e){if(!e.match(/^-?[0-9]+$/))throw new Error("Invalid string format");return new yo(Number.parseInt(e,10))}constructor(e){if(Number.isNaN(e))throw new Error("Input is not a number");if(!Number.isInteger(e))throw new Error("Input is not an integer");if(e<Number.MIN_SAFE_INTEGER||e>Number.MAX_SAFE_INTEGER)throw new Error("Input not in int53 range: "+e.toString());this.data=e}toNumber(){return this.data}toString(){return this.data.toString()}};un.Int53=yo;var ja=class{static fromString(e){let r=yo.fromString(e);return new ja(r.toNumber())}constructor(e){let r=new yo(e);if(r.toNumber()<0)throw new Error("Input is negative");this.data=r}toNumber(){return this.data.toNumber()}toString(){return this.data.toString()}};un.Uint53=ja;var ki=class{static fromBytesBigEndian(e){return ki.fromBytes(e)}static fromBytes(e,r="be"){if(e.length!==8)throw new Error("Invalid input length. Expected 8 bytes.");for(let i=0;i<e.length;++i)if(!Number.isInteger(e[i])||e[i]>255||e[i]<0)throw new Error("Invalid value in byte. Found: "+e[i]);let n=r==="be"?Array.from(e):Array.from(e).reverse();return new ki(new lu.default(n))}static fromString(e){if(!e.match(/^[0-9]+$/))throw new Error("Invalid string format");return new ki(new lu.default(e,10,"be"))}static fromNumber(e){if(Number.isNaN(e))throw new Error("Input is not a number");if(!Number.isInteger(e))throw new Error("Input is not an integer");let r;try{r=new lu.default(e)}catch{throw new Error("Input is not a safe integer")}return new ki(r)}constructor(e){if(e.isNeg())throw new Error("Input is negative");if(e.gt(Vw))throw new Error("Input exceeds uint64 range");this.data=e}toBytesBigEndian(){return Uint8Array.from(this.data.toArray("be",8))}toBytesLittleEndian(){return Uint8Array.from(this.data.toArray("le",8))}toString(){return this.data.toString(10)}toNumber(){return this.data.toNumber()}};un.Uint64=ki});var xb=W(cn=>{"use strict";x();S();Object.defineProperty(cn,"__esModule",{value:!0});cn.Uint64=cn.Uint53=cn.Uint32=cn.Int53=cn.Decimal=void 0;var Fw=wb();Object.defineProperty(cn,"Decimal",{enumerable:!0,get:function(){return Fw.Decimal}});var du=_b();Object.defineProperty(cn,"Int53",{enumerable:!0,get:function(){return du.Int53}});Object.defineProperty(cn,"Uint32",{enumerable:!0,get:function(){return du.Uint32}});Object.defineProperty(cn,"Uint53",{enumerable:!0,get:function(){return du.Uint53}});Object.defineProperty(cn,"Uint64",{enumerable:!0,get:function(){return du.Uint64}})});var Ab=W((Bb,Zl)=>{x();S();var Sb=function(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=null;try{e=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function r(g,d,_){this.low=g|0,this.high=d|0,this.unsigned=!!_}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0});function n(g){return(g&&g.__isLong__)===!0}function i(g){var d=Math.clz32(g&-g);return g?31-d:d}r.isLong=n;var o={},a={};function s(g,d){var _,k,H;return d?(g>>>=0,(H=0<=g&&g<256)&&(k=a[g],k)?k:(_=h(g,0,!0),H&&(a[g]=_),_)):(g|=0,(H=-128<=g&&g<128)&&(k=o[g],k)?k:(_=h(g,g<0?-1:0,!1),H&&(o[g]=_),_))}r.fromInt=s;function u(g,d){if(isNaN(g))return d?ee:$;if(d){if(g<0)return ee;if(g>=q)return ye}else{if(g<=-z)return U;if(g+1>=z)return re}return g<0?u(-g,d).neg():h(g%E|0,g/E|0,d)}r.fromNumber=u;function h(g,d,_){return new r(g,d,_)}r.fromBits=h;var w=Math.pow;function p(g,d,_){if(g.length===0)throw Error("empty string");if(typeof d=="number"?(_=d,d=!1):d=!!d,g==="NaN"||g==="Infinity"||g==="+Infinity"||g==="-Infinity")return d?ee:$;if(_=_||10,_<2||36<_)throw RangeError("radix");var k;if((k=g.indexOf("-"))>0)throw Error("interior hyphen");if(k===0)return p(g.substring(1),d,_).neg();for(var H=u(w(_,8)),T=$,c=0;c<g.length;c+=8){var O=Math.min(8,g.length-c),N=parseInt(g.substring(c,c+O),_);if(O<8){var le=u(w(_,O));T=T.mul(le).add(u(N))}else T=T.mul(H),T=T.add(u(N))}return T.unsigned=d,T}r.fromString=p;function M(g,d){return typeof g=="number"?u(g,d):typeof g=="string"?p(g,d):h(g.low,g.high,typeof d=="boolean"?d:g.unsigned)}r.fromValue=M;var A=1<<16,P=1<<24,E=A*A,q=E*E,z=q/2,J=s(P),$=s(0);r.ZERO=$;var ee=s(0,!0);r.UZERO=ee;var Y=s(1);r.ONE=Y;var Z=s(1,!0);r.UONE=Z;var ne=s(-1);r.NEG_ONE=ne;var re=h(-1,2147483647,!1);r.MAX_VALUE=re;var ye=h(-1,-1,!0);r.MAX_UNSIGNED_VALUE=ye;var U=h(0,-2147483648,!1);r.MIN_VALUE=U;var f=r.prototype;f.toInt=function(){return this.unsigned?this.low>>>0:this.low},f.toNumber=function(){return this.unsigned?(this.high>>>0)*E+(this.low>>>0):this.high*E+(this.low>>>0)},f.toString=function(d){if(d=d||10,d<2||36<d)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(U)){var _=u(d),k=this.div(_),H=k.mul(_).sub(this);return k.toString(d)+H.toInt().toString(d)}else return"-"+this.neg().toString(d);for(var T=u(w(d,6),this.unsigned),c=this,O="";;){var N=c.div(T),le=c.sub(N.mul(T)).toInt()>>>0,ce=le.toString(d);if(c=N,c.isZero())return ce+O;for(;ce.length<6;)ce="0"+ce;O=""+ce+O}},f.getHighBits=function(){return this.high},f.getHighBitsUnsigned=function(){return this.high>>>0},f.getLowBits=function(){return this.low},f.getLowBitsUnsigned=function(){return this.low>>>0},f.getNumBitsAbs=function(){if(this.isNegative())return this.eq(U)?64:this.neg().getNumBitsAbs();for(var d=this.high!=0?this.high:this.low,_=31;_>0&&(d&1<<_)==0;_--);return this.high!=0?_+33:_+1},f.isZero=function(){return this.high===0&&this.low===0},f.eqz=f.isZero,f.isNegative=function(){return!this.unsigned&&this.high<0},f.isPositive=function(){return this.unsigned||this.high>=0},f.isOdd=function(){return(this.low&1)===1},f.isEven=function(){return(this.low&1)===0},f.equals=function(d){return n(d)||(d=M(d)),this.unsigned!==d.unsigned&&this.high>>>31===1&&d.high>>>31===1?!1:this.high===d.high&&this.low===d.low},f.eq=f.equals,f.notEquals=function(d){return!this.eq(d)},f.neq=f.notEquals,f.ne=f.notEquals,f.lessThan=function(d){return this.comp(d)<0},f.lt=f.lessThan,f.lessThanOrEqual=function(d){return this.comp(d)<=0},f.lte=f.lessThanOrEqual,f.le=f.lessThanOrEqual,f.greaterThan=function(d){return this.comp(d)>0},f.gt=f.greaterThan,f.greaterThanOrEqual=function(d){return this.comp(d)>=0},f.gte=f.greaterThanOrEqual,f.ge=f.greaterThanOrEqual,f.compare=function(d){if(n(d)||(d=M(d)),this.eq(d))return 0;var _=this.isNegative(),k=d.isNegative();return _&&!k?-1:!_&&k?1:this.unsigned?d.high>>>0>this.high>>>0||d.high===this.high&&d.low>>>0>this.low>>>0?-1:1:this.sub(d).isNegative()?-1:1},f.comp=f.compare,f.negate=function(){return!this.unsigned&&this.eq(U)?U:this.not().add(Y)},f.neg=f.negate,f.add=function(d){n(d)||(d=M(d));var _=this.high>>>16,k=this.high&65535,H=this.low>>>16,T=this.low&65535,c=d.high>>>16,O=d.high&65535,N=d.low>>>16,le=d.low&65535,ce=0,Te=0,qe=0,Fe=0;return Fe+=T+le,qe+=Fe>>>16,Fe&=65535,qe+=H+N,Te+=qe>>>16,qe&=65535,Te+=k+O,ce+=Te>>>16,Te&=65535,ce+=_+c,ce&=65535,h(qe<<16|Fe,ce<<16|Te,this.unsigned)},f.subtract=function(d){return n(d)||(d=M(d)),this.add(d.neg())},f.sub=f.subtract,f.multiply=function(d){if(this.isZero())return this;if(n(d)||(d=M(d)),e){var _=e.mul(this.low,this.high,d.low,d.high);return h(_,e.get_high(),this.unsigned)}if(d.isZero())return this.unsigned?ee:$;if(this.eq(U))return d.isOdd()?U:$;if(d.eq(U))return this.isOdd()?U:$;if(this.isNegative())return d.isNegative()?this.neg().mul(d.neg()):this.neg().mul(d).neg();if(d.isNegative())return this.mul(d.neg()).neg();if(this.lt(J)&&d.lt(J))return u(this.toNumber()*d.toNumber(),this.unsigned);var k=this.high>>>16,H=this.high&65535,T=this.low>>>16,c=this.low&65535,O=d.high>>>16,N=d.high&65535,le=d.low>>>16,ce=d.low&65535,Te=0,qe=0,Fe=0,at=0;return at+=c*ce,Fe+=at>>>16,at&=65535,Fe+=T*ce,qe+=Fe>>>16,Fe&=65535,Fe+=c*le,qe+=Fe>>>16,Fe&=65535,qe+=H*ce,Te+=qe>>>16,qe&=65535,qe+=T*le,Te+=qe>>>16,qe&=65535,qe+=c*N,Te+=qe>>>16,qe&=65535,Te+=k*ce+H*le+T*N+c*O,Te&=65535,h(Fe<<16|at,Te<<16|qe,this.unsigned)},f.mul=f.multiply,f.divide=function(d){if(n(d)||(d=M(d)),d.isZero())throw Error("division by zero");if(e){if(!this.unsigned&&this.high===-2147483648&&d.low===-1&&d.high===-1)return this;var _=(this.unsigned?e.div_u:e.div_s)(this.low,this.high,d.low,d.high);return h(_,e.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?ee:$;var k,H,T;if(this.unsigned){if(d.unsigned||(d=d.toUnsigned()),d.gt(this))return ee;if(d.gt(this.shru(1)))return Z;T=ee}else{if(this.eq(U)){if(d.eq(Y)||d.eq(ne))return U;if(d.eq(U))return Y;var c=this.shr(1);return k=c.div(d).shl(1),k.eq($)?d.isNegative()?Y:ne:(H=this.sub(d.mul(k)),T=k.add(H.div(d)),T)}else if(d.eq(U))return this.unsigned?ee:$;if(this.isNegative())return d.isNegative()?this.neg().div(d.neg()):this.neg().div(d).neg();if(d.isNegative())return this.div(d.neg()).neg();T=$}for(H=this;H.gte(d);){k=Math.max(1,Math.floor(H.toNumber()/d.toNumber()));for(var O=Math.ceil(Math.log(k)/Math.LN2),N=O<=48?1:w(2,O-48),le=u(k),ce=le.mul(d);ce.isNegative()||ce.gt(H);)k-=N,le=u(k,this.unsigned),ce=le.mul(d);le.isZero()&&(le=Y),T=T.add(le),H=H.sub(ce)}return T},f.div=f.divide,f.modulo=function(d){if(n(d)||(d=M(d)),e){var _=(this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,d.low,d.high);return h(_,e.get_high(),this.unsigned)}return this.sub(this.div(d).mul(d))},f.mod=f.modulo,f.rem=f.modulo,f.not=function(){return h(~this.low,~this.high,this.unsigned)},f.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},f.clz=f.countLeadingZeros,f.countTrailingZeros=function(){return this.low?i(this.low):i(this.high)+32},f.ctz=f.countTrailingZeros,f.and=function(d){return n(d)||(d=M(d)),h(this.low&d.low,this.high&d.high,this.unsigned)},f.or=function(d){return n(d)||(d=M(d)),h(this.low|d.low,this.high|d.high,this.unsigned)},f.xor=function(d){return n(d)||(d=M(d)),h(this.low^d.low,this.high^d.high,this.unsigned)},f.shiftLeft=function(d){return n(d)&&(d=d.toInt()),(d&=63)===0?this:d<32?h(this.low<<d,this.high<<d|this.low>>>32-d,this.unsigned):h(0,this.low<<d-32,this.unsigned)},f.shl=f.shiftLeft,f.shiftRight=function(d){return n(d)&&(d=d.toInt()),(d&=63)===0?this:d<32?h(this.low>>>d|this.high<<32-d,this.high>>d,this.unsigned):h(this.high>>d-32,this.high>=0?0:-1,this.unsigned)},f.shr=f.shiftRight,f.shiftRightUnsigned=function(d){return n(d)&&(d=d.toInt()),(d&=63)===0?this:d<32?h(this.low>>>d|this.high<<32-d,this.high>>>d,this.unsigned):d===32?h(this.high,0,this.unsigned):h(this.high>>>d-32,0,this.unsigned)},f.shru=f.shiftRightUnsigned,f.shr_u=f.shiftRightUnsigned,f.rotateLeft=function(d){var _;return n(d)&&(d=d.toInt()),(d&=63)===0?this:d===32?h(this.high,this.low,this.unsigned):d<32?(_=32-d,h(this.low<<d|this.high>>>_,this.high<<d|this.low>>>_,this.unsigned)):(d-=32,_=32-d,h(this.high<<d|this.low>>>_,this.low<<d|this.high>>>_,this.unsigned))},f.rotl=f.rotateLeft,f.rotateRight=function(d){var _;return n(d)&&(d=d.toInt()),(d&=63)===0?this:d===32?h(this.high,this.low,this.unsigned):d<32?(_=32-d,h(this.high<<_|this.low>>>d,this.low<<_|this.high>>>d,this.unsigned)):(d-=32,_=32-d,h(this.low<<_|this.high>>>d,this.high<<_|this.low>>>d,this.unsigned))},f.rotr=f.rotateRight,f.toSigned=function(){return this.unsigned?h(this.low,this.high,!1):this},f.toUnsigned=function(){return this.unsigned?this:h(this.low,this.high,!0)},f.toBytes=function(d){return d?this.toBytesLE():this.toBytesBE()},f.toBytesLE=function(){var d=this.high,_=this.low;return[_&255,_>>>8&255,_>>>16&255,_>>>24,d&255,d>>>8&255,d>>>16&255,d>>>24]},f.toBytesBE=function(){var d=this.high,_=this.low;return[d>>>24,d>>>16&255,d>>>8&255,d&255,_>>>24,_>>>16&255,_>>>8&255,_&255]},r.fromBytes=function(d,_,k){return k?r.fromBytesLE(d,_):r.fromBytesBE(d,_)},r.fromBytesLE=function(d,_){return new r(d[0]|d[1]<<8|d[2]<<16|d[3]<<24,d[4]|d[5]<<8|d[6]<<16|d[7]<<24,_)},r.fromBytesBE=function(d,_){return new r(d[4]<<24|d[5]<<16|d[6]<<8|d[7],d[0]<<24|d[1]<<16|d[2]<<8|d[3],_)};var b=r;return t.default=b,"default"in t?t.default:t}({});typeof define=="function"&&define.amd?define([],function(){return Sb}):typeof Zl=="object"&&typeof Bb=="object"&&(Zl.exports=Sb)});var Xn=W(Xe=>{"use strict";x();S();var Mb=Xe&&Xe.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),zw=Xe&&Xe.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Bn=Xe&&Xe.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Mb(e,t,r);return zw(e,t),e},Eb=Xe&&Xe.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Mb(e,t,r)},hu=Xe&&Xe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Xe,"__esModule",{value:!0});Xe.secp256k1=Xe.ed25519=Xe.Long=Xe._m0=Xe.protobuf=Xe.typeforce=Xe.safeBuffer=Xe.BigNumber=Xe.BN=Xe.math=Xe.signUtil=Xe.abi=Xe.elliptic=Xe.bip39=Xe.bip32=Xe.base=void 0;Xe.base=Bn(ro());Xe.bip32=Bn(P1());Xe.bip39=Bn(yl());Xe.elliptic=Bn(Go());Xe.abi=Bn(r2());Xe.signUtil=Bn(mb());Xe.math=Bn(xb());var Ww=hu(fr());Xe.BN=Ww.default;var $w=hu(Eg());Xe.BigNumber=$w.default;var Gw=hu(wg());Xe.safeBuffer=Gw.default;var Zw=A0();Xe.typeforce=Zw;Xe.protobuf=Bn(Pg());Xe._m0=Bn(Tg());var Yw=hu(Ab());Xe.Long=Yw.default;Xe.ed25519=Bn(Og());Xe.secp256k1=Bn(Cg());Eb((Ug(),S0(kg)),Xe);Eb((Rg(),S0(qg)),Xe)});var Ib=W(Kr=>{"use strict";x();S();Object.defineProperty(Kr,"__esModule",{value:!0});Kr.jsonStringifyUniform=Kr.cloneObject=Kr.assertBufferLength=Kr.convert2BigNumber=Kr.convert2Number=Kr.buildCommonSignMsg=void 0;var bu=Xn();function Xw(t,e){return`OKX Wallet Sign In
|
||
|
||
publicKey: ${t}
|
||
walletId: ${e}
|
||
host: api.wallet.okx
|
||
OKX Wallet Sign In`}Kr.buildCommonSignMsg=Xw;function Qw(t){if(t!=null)return typeof t=="string"?parseInt(t):t}Kr.convert2Number=Qw;function Jw(t){if(t!=null)return bu.BigNumber.isBigNumber(t)?t:new bu.BigNumber(t)}Kr.convert2BigNumber=Jw;function e7(t,e){if(t.length!=e)throw Error("buffer length is illegal")}Kr.assertBufferLength=e7;function t7(t){return JSON.parse(JSON.stringify(t))}Kr.cloneObject=t7;function r7(t){return JSON.stringify(t,(e,r)=>r&&(r.type==="Buffer"||r instanceof Uint8Array?bu.base.toHex(r):typeof r=="bigint"?r.toString():r))}Kr.jsonStringifyUniform=r7});var Yl=W(mo=>{"use strict";x();S();var n7=mo&&mo.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),i7=mo&&mo.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&n7(e,t,r)};Object.defineProperty(mo,"__esModule",{value:!0});i7(Ib(),mo)});var kb=W(Dt=>{"use strict";x();S();Object.defineProperty(Dt,"__esModule",{value:!0});Dt.SimpleWallet=Dt.BaseWallet=Dt.ecdsaSign=Dt.fromSigned=Dt.padWithZeroes=Dt.toUnsigned=Dt.intToHex=Dt.makeSignature=Dt.secp256k1SignTest=void 0;var nr=Sc(),rs=xc(),ir=Xn(),o7=Yl();function Pb(t){let e=ir.base.sha256("secp256k1-test"),r=ir.signUtil.secp256k1.publicKeyCreate(t,!1),{signature:n,recovery:i}=ir.signUtil.secp256k1.sign(v.Buffer.from(e),t);return ir.signUtil.secp256k1.verify(e,n,i,r)}Dt.secp256k1SignTest=Pb;function Tb(t,e,r){let n=(0,Dt.fromSigned)(e),i=(0,Dt.fromSigned)(r),o=t,a=Xl((0,Dt.toUnsigned)(n).toString("hex"),64),s=Xl((0,Dt.toUnsigned)(i).toString("hex"),64);return ir.base.stripHexPrefix(Ob(o)).concat(a,s)}Dt.makeSignature=Tb;function Ob(t){return`0x${t.toString(16)}`}Dt.intToHex=Ob;var s7=function(t){return v.Buffer.from(t.toTwos(256).toArray())};Dt.toUnsigned=s7;function Xl(t,e){if(t!==""&&!/^[a-f0-9]+$/iu.test(t))throw new Error(`Expected an unprefixed hex string. Received: ${t}`);if(e<0)throw new Error(`Expected a non-negative integer target length. Received: ${e}`);return String.prototype.padStart.call(t,e,"0")}Dt.padWithZeroes=Xl;var a7=function(t){return new ir.BN(t).fromTwos(256)};Dt.fromSigned=a7;function Cb(t,e,r){let{signature:n,recovery:i}=ir.signUtil.secp256k1.sign(t,e),o=v.Buffer.from(n.slice(0,32)),a=v.Buffer.from(n.slice(32,64));if(r&&!Number.isSafeInteger(r))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");return{v:r?i+(r*2+35):i+27,r:o,s:a}}Dt.ecdsaSign=Cb;var pu=class{getRandomPrivateKey(){try{for(;;){let e=ir.base.randomBytes(32);if(Pb(e))return Promise.resolve(ir.base.toHex(e,!0))}}catch{}return Promise.reject(nr.GenPrivateKeyError)}getDerivedPrivateKey(e){return ir.bip39.mnemonicToSeed(e.mnemonic).then(r=>{let n=ir.bip32.fromSeed(r).derivePath(e.hdPath);if(n.privateKey){let i=ir.base.toHex(n.privateKey);return Promise.resolve("0x"+i)}else return Promise.reject(nr.GenPrivateKeyError)}).catch(r=>Promise.reject(nr.GenPrivateKeyError))}getDerivedPath(e){return Promise.reject(nr.NotImplementedError)}validPrivateKey(e){return Promise.reject(nr.NotImplementedError)}signMessage(e){return Promise.reject(nr.NotImplementedError)}async signCommonMsg(e){e.signType||(e.signType=rs.SignType.Secp256k1);let r;if(e.message.text)r=e.message.text;else{let s;if(e.publicKey?s=e.publicKey:s=(await this.getNewAddress({privateKey:e.privateKey,addressType:e.addressType,hrp:e.hrp,version:e.version})).publicKey,s.startsWith("0x")&&(s=s.substring(2)),!e.message.walletId)return Promise.reject("invalid walletId");r=(0,o7.buildCommonSignMsg)(s,e.message.walletId)}let n=ir.base.magicHash(r),i=e.privateKeyHex?e.privateKeyHex:e.privateKey,o=ir.base.fromHex(i);var a;switch(e.signType){case rs.SignType.Secp256k1:let{v:s,r:u,s:h}=Cb(v.Buffer.from(n),o);return Promise.resolve(Tb(s,u,h));case rs.SignType.ECDSA_P256:return a=ir.signUtil.p256.sign(v.Buffer.from(n),o).signature,Promise.resolve(ir.base.toHex(a));case rs.SignType.ED25519:return a=ir.signUtil.ed25519.sign(n,o),Promise.resolve(ir.base.toHex(a));case rs.SignType.StarknetSignType:return a=ir.signUtil.schnorr.stark.sign(n,o).toCompactRawBytes(),Promise.resolve(ir.base.toHex(a));case rs.SignType.TezosSignType:return Promise.reject("not support")}}verifyMessage(e){return Promise.reject(nr.NotImplementedError)}ecRecover(e,r){return Promise.reject(nr.NotImplementedError)}getAddressByPublicKey(e){return Promise.reject(nr.NotImplementedError)}getMPCRawTransaction(e){return Promise.reject(nr.NotImplementedError)}getMPCTransaction(e){return Promise.reject(nr.NotImplementedError)}getMPCRawMessage(e){return Promise.reject(nr.NotImplementedError)}getMPCSignedMessage(e){return Promise.reject(nr.NotImplementedError)}getHardWareRawTransaction(e){return Promise.reject(nr.NotImplementedError)}getHardWareSignedTransaction(e){return Promise.reject(nr.NotImplementedError)}getHardWareMessageHash(e){return Promise.reject(nr.NotImplementedError)}calcTxHash(e){return Promise.reject(nr.NotImplementedError)}getRawTransaction(e){return Promise.reject(nr.NotImplementedError)}validSignedTransaction(e){return Promise.reject(nr.NotImplementedError)}estimateFee(e){return Promise.reject(nr.NotImplementedError)}};Dt.BaseWallet=pu;var Ql=class extends pu{mockData(e,r){this.mockAddress=e,this.mockPublicKey=r}getNewAddress(e){return Promise.resolve({address:this.mockAddress,publicKey:this.mockPublicKey})}validAddress(e){throw new Error("Method not implemented.")}signTransaction(e){throw new Error("Method not implemented.")}};Dt.SimpleWallet=Ql});var Ub=W(An=>{"use strict";x();S();var f7=An&&An.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Ha=An&&An.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&f7(e,t,r)};Object.defineProperty(An,"__esModule",{value:!0});Ha(xc(),An);Ha(E0(),An);Ha(Sc(),An);Ha(kb(),An);Ha(Yl(),An)});var Rb=W((lT,qb)=>{"use strict";x();S();qb.exports=Symbol.for("nodejs.util.inspect.custom")});var vo=W((bT,Nb)=>{"use strict";x();S();typeof process<"u",Nb.exports=Rb()});var yu=W(gu=>{"use strict";x();S();Object.defineProperty(gu,"__esModule",{value:!0});gu.crc16=void 0;function u7(t){let r=0,n=v.Buffer.alloc(t.length+2);n.set(t);for(let i of n){let o=128;for(;o>0;)r<<=1,i&o&&(r+=1),o>>=1,r>65535&&(r&=65535,r^=4129)}return v.Buffer.from([Math.floor(r/256),r%256])}gu.crc16=u7});var ri=W(Ui=>{"use strict";x();S();var c7=Ui&&Ui.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},jb;Object.defineProperty(Ui,"__esModule",{value:!0});Ui.address=Ui.Address=void 0;var l7=c7(vo()),Hb=yu(),Jl=17,Kb=81,ed=128;function Lb(t){if(typeof t=="string"&&!Zr.isFriendly(t))throw new Error("Unknown address type");let e=v.Buffer.isBuffer(t)?t:v.Buffer.from(t,"base64");if(e.length!==36)throw new Error("Unknown address type: byte length is not equal to 36");let r=e.subarray(0,34),n=e.subarray(34,36),i=(0,Hb.crc16)(r);if(!(i[0]===n[0]&&i[1]===n[1]))throw new Error("Invalid checksum: "+t);let o=r[0],a=!1,s=!1;if(o&ed&&(a=!0,o=o^ed),o!==Jl&&o!==Kb)throw"Unknown address tag";s=o===Jl;let u=null;r[1]===255?u=-1:u=r[1];let h=r.subarray(2,34);return{isTestOnly:a,isBounceable:s,workchain:u,hashPart:h}}var Zr=class{static isAddress(e){return e instanceof Zr}static isFriendly(e){return!(e.length!==48||!/[A-Za-z0-9+/_-]+/.test(e))}static isRaw(e){if(e.indexOf(":")===-1)return!1;let[r,n]=e.split(":");return!(!Number.isInteger(parseFloat(r))||!/[a-f0-9]+/.test(n.toLowerCase())||n.length!==64)}static normalize(e){return typeof e=="string"?Zr.parse(e).toString():e.toString()}static parse(e){if(Zr.isFriendly(e))return this.parseFriendly(e).address;if(Zr.isRaw(e))return this.parseRaw(e);throw new Error("Unknown address type: "+e)}static parseRaw(e){let r=parseInt(e.split(":")[0]),n=v.Buffer.from(e.split(":")[1],"hex");return new Zr(r,n)}static parseFriendly(e){if(v.Buffer.isBuffer(e)){let r=Lb(e);return{isBounceable:r.isBounceable,isTestOnly:r.isTestOnly,address:new Zr(r.workchain,r.hashPart)}}else{let r=e.replace(/\-/g,"+").replace(/_/g,"/"),n=Lb(r);return{isBounceable:n.isBounceable,isTestOnly:n.isTestOnly,isUrlSafe:!(e.includes("/")||e.includes("+")),address:new Zr(n.workchain,n.hashPart)}}}constructor(e,r){if(this.toRawString=()=>this.workChain+":"+this.hash.toString("hex"),this.toRaw=()=>{let n=v.Buffer.alloc(36);return n.set(this.hash),n.set([this.workChain,this.workChain,this.workChain,this.workChain],32),n},this.toStringBuffer=n=>{let i=n&&n.testOnly!==void 0?n.testOnly:!1,a=(n&&n.bounceable!==void 0?n.bounceable:!0)?Jl:Kb;i&&(a|=ed);let s=v.Buffer.alloc(34);s[0]=a,s[1]=this.workChain,s.set(this.hash,2);let u=v.Buffer.alloc(36);return u.set(s),u.set((0,Hb.crc16)(s),34),u},this.toString=n=>{let i=n&&n.urlSafe!==void 0?n.urlSafe:!0,o=this.toStringBuffer(n);return i?o.toString("base64").replace(/\+/g,"-").replace(/\//g,"_"):o.toString("base64")},this[jb]=()=>this.toString(),r.length!==32)throw new Error("Invalid address hash length: "+r.length);this.workChain=e,this.hash=r,Object.freeze(this)}equals(e){return e.workChain!==this.workChain?!1:e.hash.equals(this.hash)}};Ui.Address=Zr;jb=l7.default;function d7(t){return Zr.parse(t)}Ui.address=d7});var mu=W(ns=>{"use strict";x();S();var h7=ns&&ns.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},Db;Object.defineProperty(ns,"__esModule",{value:!0});ns.ExternalAddress=void 0;var b7=h7(vo()),Ka=class{static isAddress(e){return e instanceof Ka}constructor(e,r){this[Db]=()=>this.toString(),this.value=e,this.bits=r}toString(){return`External<${this.bits}:${this.value}>`}};ns.ExternalAddress=Ka;Db=b7.default});var rd=W(is=>{"use strict";x();S();Object.defineProperty(is,"__esModule",{value:!0});is.base32Decode=is.base32Encode=void 0;var td="abcdefghijklmnopqrstuvwxyz234567";function p7(t){let e=t.byteLength,r=0,n=0,i="";for(let o=0;o<e;o++)for(n=n<<8|t[o],r+=8;r>=5;)i+=td[n>>>r-5&31],r-=5;return r>0&&(i+=td[n<<5-r&31]),i}is.base32Encode=p7;function g7(t,e){let r=t.indexOf(e);if(r===-1)throw new Error("Invalid character found: "+e);return r}function y7(t){let e;e=t.toLowerCase();let{length:r}=e,n=0,i=0,o=0,a=v.Buffer.alloc(r*5/8|0);for(let s=0;s<r;s++)i=i<<5|g7(td,e[s]),n+=5,n>=8&&(a[o++]=i>>>n-8&255,n-=8);return a}is.base32Decode=y7});var Wb=W(ss=>{"use strict";x();S();var m7=ss&&ss.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},zb;Object.defineProperty(ss,"__esModule",{value:!0});ss.ADNLAddress=void 0;var v7=m7(vo()),Vb=rd(),Fb=yu(),os=class{static parseFriendly(e){if(e.length!==55)throw Error("Invalid address");e="f"+e;let r=(0,Vb.base32Decode)(e);if(r[0]!==45)throw Error("Invalid address");let n=r.slice(33);if(!(0,Fb.crc16)(r.slice(0,33)).equals(n))throw Error("Invalid address");return new os(r.slice(1,33))}static parseRaw(e){let r=v.Buffer.from(e,"base64");return new os(r)}constructor(e){if(this.toRaw=()=>this.address.toString("hex").toUpperCase(),this.toString=()=>{let r=v.Buffer.concat([v.Buffer.from([45]),this.address]),n=(0,Fb.crc16)(r);return r=v.Buffer.concat([r,n]),(0,Vb.base32Encode)(r).slice(1)},this[zb]=()=>this.toString(),e.length!==32)throw Error("Invalid address");this.address=e}equals(e){return this.address.equals(e.address)}};ss.ADNLAddress=os;zb=v7.default});var Da=W(as=>{"use strict";x();S();Object.defineProperty(as,"__esModule",{value:!0});as.paddedBufferToBits=as.bitsToPaddedBuffer=void 0;var w7=Va(),_7=ni();function x7(t){let e=new w7.BitBuilder(Math.ceil(t.length/8)*8);e.writeBits(t);let r=Math.ceil(t.length/8)*8-t.length;for(let n=0;n<r;n++)n===0?e.writeBit(1):e.writeBit(0);return e.buffer()}as.bitsToPaddedBuffer=x7;function S7(t){let e=0;for(let r=t.length-1;r>=0;r--)if(t[r]!==0){let n=t[r],i=n&-n;(i&1)==0&&(i=Math.log2(i)+1),r>0&&(e=r<<3),e+=8-i;break}return new _7.BitString(t,0,e)}as.paddedBufferToBits=S7});var ni=W(fs=>{"use strict";x();S();var B7=fs&&fs.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},$b;Object.defineProperty(fs,"__esModule",{value:!0});fs.BitString=void 0;var A7=Da(),M7=B7(vo()),ii=class{static isBitString(e){return e instanceof ii}constructor(e,r,n){if(this[$b]=()=>this.toString(),n<0)throw new Error(`Length ${n} is out of bounds`);this._length=n,this._data=e,this._offset=r}get length(){return this._length}at(e){if(e>=this._length)throw new Error(`Index ${e} > ${this._length} is out of bounds`);if(e<0)throw new Error(`Index ${e} < 0 is out of bounds`);let r=this._offset+e>>3,n=7-(this._offset+e)%8;return(this._data[r]&1<<n)!==0}substring(e,r){if(e>this._length)throw new Error(`Offset(${e}) > ${this._length} is out of bounds`);if(e<0)throw new Error(`Offset(${e}) < 0 is out of bounds`);if(r===0)return ii.EMPTY;if(e+r>this._length)throw new Error(`Offset ${e} + Length ${r} > ${this._length} is out of bounds`);return new ii(this._data,this._offset+e,r)}subbuffer(e,r){if(e>this._length)throw new Error(`Offset ${e} is out of bounds`);if(e<0)throw new Error(`Offset ${e} is out of bounds`);if(e+r>this._length)throw new Error(`Offset + Lenght = ${e+r} is out of bounds`);if(r%8!==0||(this._offset+e)%8!==0)return null;let n=this._offset+e>>3,i=n+(r>>3);return this._data.subarray(n,i)}equals(e){if(this._length!==e._length)return!1;for(let r=0;r<this._length;r++)if(this.at(r)!==e.at(r))return!1;return!0}toString(){let e=(0,A7.bitsToPaddedBuffer)(this);if(this._length%4===0){let r=e.subarray(0,Math.ceil(this._length/8)).toString("hex").toUpperCase();return this._length%8===0?r:r.substring(0,r.length-1)}else{let r=e.toString("hex").toUpperCase();return this._length%8<=4?r.substring(0,r.length-1)+"_":r+"_"}}};fs.BitString=ii;$b=M7.default;ii.EMPTY=new ii(v.Buffer.alloc(0),0,0)});var Va=W(vu=>{"use strict";x();S();Object.defineProperty(vu,"__esModule",{value:!0});vu.BitBuilder=void 0;var E7=ri(),I7=mu(),P7=ni(),nd=class{constructor(e=1023){this._buffer=v.Buffer.alloc(Math.ceil(e/8)),this._length=0}get length(){return this._length}writeBit(e){let r=this._length;if(r>this._buffer.length*8)throw new Error("BitBuilder overflow");(typeof e=="boolean"&&e===!0||typeof e=="number"&&e>0)&&(this._buffer[r/8|0]|=1<<7-r%8),this._length++}writeBits(e){for(let r=0;r<e.length;r++)this.writeBit(e.at(r))}writeBuffer(e){if(this._length%8===0){if(this._length+e.length*8>this._buffer.length*8)throw new Error("BitBuilder overflow");e.copy(this._buffer,this._length/8),this._length+=e.length*8}else for(let r=0;r<e.length;r++)this.writeUint(e[r],8)}writeUint(e,r){if(r<0||!Number.isSafeInteger(r))throw Error(`invalid bit length. Got ${r}`);let n=BigInt(e);if(r===0){if(n!==0n)throw Error(`value is not zero for ${r} bits. Got ${e}`);return}let i=1n<<BigInt(r);if(n<0||n>=i)throw Error(`bitLength is too small for a value ${e}. Got ${r}`);if(this._length+r>this._buffer.length*8)throw new Error("BitBuilder overflow");let o=8-this._length%8;if(o>0){let a=Math.floor(this._length/8);if(r<o){let s=Number(n);this._buffer[a]|=s<<o-r,this._length+=r}else{let s=Number(n>>BigInt(r-o));this._buffer[a]|=s,this._length+=o}}for(r-=o;r>0;)r>=8?(this._buffer[this._length/8]=Number(n>>BigInt(r-8)&0xffn),this._length+=8,r-=8):(this._buffer[this._length/8]=Number(n<<BigInt(8-r)&0xffn),this._length+=r,r=0)}writeInt(e,r){let n=BigInt(e);if(r<0||!Number.isSafeInteger(r))throw Error(`invalid bit length. Got ${r}`);if(r===0){if(e!==0n)throw Error(`value is not zero for ${r} bits. Got ${e}`);return}if(r===1){if(e!==-1n&&e!==0n)throw Error(`value is not zero or -1 for ${r} bits. Got ${e}`);this.writeBit(e===-1n);return}let i=1n<<BigInt(r)-1n;if(n<-i||n>=i)throw Error(`value is out of range for ${r} bits. Got ${e}`);n<0?(this.writeBit(!0),n=i+n):this.writeBit(!1),this.writeUint(n,r-1)}writeVarUint(e,r){let n=BigInt(e);if(r<0||!Number.isSafeInteger(r))throw Error(`invalid bit length. Got ${r}`);if(n<0)throw Error(`value is negative. Got ${e}`);if(n===0n){this.writeUint(0,r);return}let i=Math.ceil(n.toString(2).length/8),o=i*8;this.writeUint(i,r),this.writeUint(n,o)}writeVarInt(e,r){let n=BigInt(e);if(r<0||!Number.isSafeInteger(r))throw Error(`invalid bit length. Got ${r}`);if(n===0n){this.writeUint(0,r);return}let i=n>0?n:-n,o=1+Math.ceil(i.toString(2).length/8),a=o*8;this.writeUint(o,r),this.writeInt(n,a)}writeCoins(e){this.writeVarUint(e,4)}writeAddress(e){if(e==null){this.writeUint(0,2);return}if(E7.Address.isAddress(e)){this.writeUint(2,2),this.writeUint(0,1),this.writeInt(e.workChain,8),this.writeBuffer(e.hash);return}if(I7.ExternalAddress.isAddress(e)){this.writeUint(1,2),this.writeUint(e.bits,9),this.writeUint(e.value,e.bits);return}throw Error(`Invalid address. Got ${e}`)}build(){return new P7.BitString(this._buffer,0,this._length)}buffer(){if(this._length%8!==0)throw new Error("BitBuilder buffer is not byte aligned");return this._buffer.subarray(0,this._length/8)}};vu.BitBuilder=nd});var us=W(Fa=>{"use strict";x();S();Object.defineProperty(Fa,"__esModule",{value:!0});Fa.CellType=void 0;var T7;(function(t){t[t.Ordinary=-1]="Ordinary",t[t.PrunedBranch=1]="PrunedBranch",t[t.Library=2]="Library",t[t.MerkleProof=3]="MerkleProof",t[t.MerkleUpdate=4]="MerkleUpdate"})(T7=Fa.CellType||(Fa.CellType={}))});var Gb=W(wu=>{"use strict";x();S();Object.defineProperty(wu,"__esModule",{value:!0});wu.readUnaryLength=void 0;function O7(t){let e=0;for(;t.loadBit();)e++;return e}wu.readUnaryLength=O7});var oi=W(_u=>{"use strict";x();S();Object.defineProperty(_u,"__esModule",{value:!0});_u.BitReader=void 0;var C7=ri(),k7=mu(),za=class{constructor(e,r=0){this._checkpoints=[],this._bits=e,this._offset=r}get offset(){return this._offset}get remaining(){return this._bits.length-this._offset}skip(e){if(e<0||this._offset+e>this._bits.length)throw new Error(`Index ${this._offset+e} is out of bounds`);this._offset+=e}reset(){this._checkpoints.length>0?this._offset=this._checkpoints.pop():this._offset=0}save(){this._checkpoints.push(this._offset)}loadBit(){let e=this._bits.at(this._offset);return this._offset++,e}preloadBit(){return this._bits.at(this._offset)}loadBits(e){let r=this._bits.substring(this._offset,e);return this._offset+=e,r}preloadBits(e){return this._bits.substring(this._offset,e)}loadBuffer(e){let r=this._preloadBuffer(e,this._offset);return this._offset+=e*8,r}preloadBuffer(e){return this._preloadBuffer(e,this._offset)}loadUint(e){return Number(this.loadUintBig(e))}loadUintBig(e){let r=this.preloadUintBig(e);return this._offset+=e,r}preloadUint(e){return Number(this._preloadUint(e,this._offset))}preloadUintBig(e){return this._preloadUint(e,this._offset)}loadInt(e){let r=this._preloadInt(e,this._offset);return this._offset+=e,Number(r)}loadIntBig(e){let r=this._preloadInt(e,this._offset);return this._offset+=e,r}preloadInt(e){return Number(this._preloadInt(e,this._offset))}preloadIntBig(e){return this._preloadInt(e,this._offset)}loadVarUint(e){let r=Number(this.loadUint(e));return Number(this.loadUintBig(r*8))}loadVarUintBig(e){let r=Number(this.loadUint(e));return this.loadUintBig(r*8)}preloadVarUint(e){let r=Number(this._preloadUint(e,this._offset));return Number(this._preloadUint(r*8,this._offset+e))}preloadVarUintBig(e){let r=Number(this._preloadUint(e,this._offset));return this._preloadUint(r*8,this._offset+e)}loadVarInt(e){let r=Number(this.loadUint(e));return Number(this.loadIntBig(r*8))}loadVarIntBig(e){let r=Number(this.loadUint(e));return this.loadIntBig(r*8)}preloadVarInt(e){let r=Number(this._preloadUint(e,this._offset));return Number(this._preloadInt(r*8,this._offset+e))}preloadVarIntBig(e){let r=Number(this._preloadUint(e,this._offset));return this._preloadInt(r*8,this._offset+e)}loadCoins(){return this.loadVarUintBig(4)}preloadCoins(){return this.preloadVarUintBig(4)}loadAddress(){let e=Number(this._preloadUint(2,this._offset));if(e===2)return this._loadInternalAddress();throw new Error("Invalid address: "+e)}loadMaybeAddress(){let e=Number(this._preloadUint(2,this._offset));if(e===0)return this._offset+=2,null;if(e===2)return this._loadInternalAddress();throw new Error("Invalid address")}loadExternalAddress(){if(Number(this._preloadUint(2,this._offset))===1)return this._loadExternalAddress();throw new Error("Invalid address")}loadMaybeExternalAddress(){let e=Number(this._preloadUint(2,this._offset));if(e===0)return this._offset+=2,null;if(e===1)return this._loadExternalAddress();throw new Error("Invalid address")}loadAddressAny(){let e=Number(this._preloadUint(2,this._offset));if(e===0)return this._offset+=2,null;if(e===2)return this._loadInternalAddress();if(e===1)return this._loadExternalAddress();throw Error(e===3?"Unsupported":"Unreachable")}loadPaddedBits(e){if(e%8!==0)throw new Error("Invalid number of bits");let r=e;for(;;)if(this._bits.at(this._offset+r-1)){r--;break}else r--;let n=this._bits.substring(this._offset,r);return this._offset+=e,n}clone(){return new za(this._bits,this._offset)}_preloadInt(e,r){if(e==0)return 0n;let n=this._bits.at(r),i=0n;for(let o=0;o<e-1;o++)this._bits.at(r+1+o)&&(i+=1n<<BigInt(e-o-1-1));return n&&(i=i-(1n<<BigInt(e-1))),i}_preloadUint(e,r){if(e==0)return 0n;let n=0n;for(let i=0;i<e;i++)this._bits.at(r+i)&&(n+=1n<<BigInt(e-i-1));return n}_preloadBuffer(e,r){let n=this._bits.subbuffer(r,e*8);if(n)return n;let i=v.Buffer.alloc(e);for(let o=0;o<e;o++)i[o]=Number(this._preloadUint(8,r+o*8));return i}_loadInternalAddress(){if(Number(this._preloadUint(2,this._offset))!==2||this._preloadUint(1,this._offset+2)!==0n)throw Error("Invalid address");let r=Number(this._preloadInt(8,this._offset+3)),n=this._preloadBuffer(32,this._offset+11);return this._offset+=267,new C7.Address(r,n)}_loadExternalAddress(){if(Number(this._preloadUint(2,this._offset))!==1)throw Error("Invalid address");let r=Number(this._preloadUint(9,this._offset+2)),n=this._preloadUint(r,this._offset+11);return this._offset+=11+r,new k7.ExternalAddress(n,r)}};_u.BitReader=za});var Wa=W(cs=>{"use strict";x();S();Object.defineProperty(cs,"__esModule",{value:!0});cs.convertToMerkleProof=cs.exoticMerkleProof=void 0;var U7=oi(),q7=Qt();function R7(t,e){let r=new U7.BitReader(t),n=8+256+16;if(t.length!==n)throw new Error(`Merkle Proof cell must have exactly (8 + 256 + 16) bits, got "${t.length}"`);if(e.length!==1)throw new Error(`Merkle Proof cell must have exactly 1 ref, got "${e.length}"`);let i=r.loadUint(8);if(i!==3)throw new Error(`Merkle Proof cell must have type 3, got "${i}"`);let o=r.loadBuffer(32),a=r.loadUint(16),s=e[0].hash(0),u=e[0].depth(0);if(a!==u)throw new Error(`Merkle Proof cell ref depth must be exactly "${a}", got "${u}"`);if(!o.equals(s))throw new Error(`Merkle Proof cell ref hash must be exactly "${o.toString("hex")}", got "${s.toString("hex")}"`);return{proofDepth:a,proofHash:o}}cs.exoticMerkleProof=R7;function N7(t){return(0,q7.beginCell)().storeUint(3,8).storeBuffer(t.hash(0)).storeUint(t.depth(0),16).storeRef(t).endCell({exotic:!0})}cs.convertToMerkleProof=N7});var xu=W(ls=>{"use strict";x();S();Object.defineProperty(ls,"__esModule",{value:!0});ls.generateMerkleProof=ls.generateMerkleProofDirect=void 0;var od=Qt(),L7=Gb(),j7=Wa();function H7(t){return(0,od.beginCell)().storeUint(1,8).storeUint(1,8).storeBuffer(t.hash(0)).storeUint(t.depth(0),16).endCell({exotic:!0})}function id(t,e,r,n){let i=e.asCell();if(n.length==0)return H7(i);let o=e.loadBit()?1:0,a=0,s=t;if(o===0){a=(0,L7.readUnaryLength)(e);for(let u=0;u<a;u++)s+=e.loadBit()?"1":"0"}else if((e.loadBit()?1:0)===0){a=e.loadUint(Math.ceil(Math.log2(r+1)));for(let h=0;h<a;h++)s+=e.loadBit()?"1":"0"}else{let h=e.loadBit()?"1":"0";a=e.loadUint(Math.ceil(Math.log2(r+1)));for(let w=0;w<a;w++)s+=h}if(r-a===0)return i;{let u=i.beginParse(),h=u.loadRef(),w=u.loadRef();if(!h.isExotic){let p=n.filter(M=>s+"0"===M.slice(0,s.length+1));h=id(s+"0",h.beginParse(),r-a-1,p)}if(!w.isExotic){let p=n.filter(M=>s+"1"===M.slice(0,s.length+1));w=id(s+"1",w.beginParse(),r-a-1,p)}return(0,od.beginCell)().storeSlice(u).storeRef(h).storeRef(w).endCell()}}function Zb(t,e,r){e.forEach(i=>{if(!t.has(i))throw new Error(`Trying to generate merkle proof for a missing key "${i}"`)});let n=(0,od.beginCell)().storeDictDirect(t).asSlice();return id("",n,r.bits,e.map(i=>r.serialize(i).toString(2).padStart(r.bits,"0")))}ls.generateMerkleProofDirect=Zb;function K7(t,e,r){return(0,j7.convertToMerkleProof)(Zb(t,e,r))}ls.generateMerkleProof=K7});var sd=W(Su=>{"use strict";x();S();Object.defineProperty(Su,"__esModule",{value:!0});Su.generateMerkleUpdate=void 0;var D7=Qt(),Yb=xu();function V7(t,e){return(0,D7.beginCell)().storeUint(4,8).storeBuffer(t.hash(0)).storeBuffer(e.hash(0)).storeUint(t.depth(0),16).storeUint(e.depth(0),16).storeRef(t).storeRef(e).endCell({exotic:!0})}function F7(t,e,r,n){let i=(0,Yb.generateMerkleProof)(t,[e],r).refs[0];t.set(e,n);let o=(0,Yb.generateMerkleProof)(t,[e],r).refs[0];return V7(i,o)}Su.generateMerkleUpdate=F7});var Xb=W(Bu=>{"use strict";x();S();Object.defineProperty(Bu,"__esModule",{value:!0});Bu.parseDict=void 0;function z7(t){let e=0;for(;t.loadBit();)e++;return e}function ad(t,e,r,n,i){let o=e.loadBit()?1:0,a=0,s=t;if(o===0){a=z7(e);for(let u=0;u<a;u++)s+=e.loadBit()?"1":"0"}else if((e.loadBit()?1:0)===0){a=e.loadUint(Math.ceil(Math.log2(r+1)));for(let h=0;h<a;h++)s+=e.loadBit()?"1":"0"}else{let h=e.loadBit()?"1":"0";a=e.loadUint(Math.ceil(Math.log2(r+1)));for(let w=0;w<a;w++)s+=h}if(r-a===0)n.set(BigInt("0b"+s),i(e));else{let u=e.loadRef(),h=e.loadRef();u.isExotic||ad(s+"0",u.beginParse(),r-a-1,n,i),h.isExotic||ad(s+"1",h.beginParse(),r-a-1,n,i)}}function W7(t,e,r){let n=new Map;return t&&ad("",t,e,n,r),n}Bu.parseDict=W7});var Qb=W(Au=>{"use strict";x();S();Object.defineProperty(Au,"__esModule",{value:!0});Au.findCommonPrefix=void 0;function $7(t,e=0){if(t.length===0)return"";let r=t[0].slice(e);for(let n=1;n<t.length;n++){let i=t[n];for(;i.indexOf(r,e)!==e;)if(r=r.substring(0,r.length-1),r==="")return r}return r}Au.findCommonPrefix=$7});var o5=W(Dr=>{"use strict";x();S();Object.defineProperty(Dr,"__esModule",{value:!0});Dr.serializeDict=Dr.detectLabelType=Dr.writeLabelSame=Dr.writeLabelLong=Dr.writeLabelShort=Dr.buildTree=void 0;var Jb=Qt(),G7=Qb();function Z7(t,e){for(;t.length<e;)t="0"+t;return t}function Y7(t,e){if(t.size===0)throw Error("Internal inconsistency");let r=new Map,n=new Map;for(let[i,o]of t.entries())i[e]==="0"?r.set(i,o):n.set(i,o);if(r.size===0)throw Error("Internal inconsistency. Left emtpy.");if(n.size===0)throw Error("Internal inconsistency. Right emtpy.");return{left:r,right:n}}function X7(t,e){if(t.size===0)throw Error("Internal inconsistency");if(t.size===1)return{type:"leaf",value:Array.from(t.values())[0]};let{left:r,right:n}=Y7(t,e);return{type:"fork",left:fd(r,e+1),right:fd(n,e+1)}}function fd(t,e=0){if(t.size===0)throw Error("Internal inconsistency");let r=(0,G7.findCommonPrefix)(Array.from(t.keys()),e);return{label:r,node:X7(t,r.length+e)}}function e5(t,e){let r=new Map;for(let n of Array.from(t.keys())){let i=Z7(n.toString(2),e);r.set(i,t.get(n))}return fd(r)}Dr.buildTree=e5;function t5(t,e){e.storeBit(0);for(let r=0;r<t.length;r++)e.storeBit(1);return e.storeBit(0),t.length>0&&e.storeUint(BigInt("0b"+t),t.length),e}Dr.writeLabelShort=t5;function Q7(t){return 1+t.length+1+t.length}function r5(t,e,r){r.storeBit(1),r.storeBit(0);let n=Math.ceil(Math.log2(e+1));return r.storeUint(t.length,n),t.length>0&&r.storeUint(BigInt("0b"+t),t.length),r}Dr.writeLabelLong=r5;function J7(t,e){return 1+1+Math.ceil(Math.log2(e+1))+t.length}function n5(t,e,r,n){n.storeBit(1),n.storeBit(1),n.storeBit(t);let i=Math.ceil(Math.log2(r+1));n.storeUint(e,i)}Dr.writeLabelSame=n5;function e9(t){return 1+1+1+Math.ceil(Math.log2(t+1))}function t9(t){if(t.length===0||t.length===1)return!0;for(let e=1;e<t.length;e++)if(t[e]!==t[0])return!1;return!0}function i5(t,e){let r="short",n=Q7(t),i=J7(t,e);if(i<n&&(n=i,r="long"),t9(t)){let o=e9(e);o<n&&(n=o,r="same")}return r}Dr.detectLabelType=i5;function r9(t,e,r){let n=i5(t,e);n==="short"?t5(t,r):n==="long"?r5(t,e,r):n==="same"&&n5(t[0]==="1",t.length,e,r)}function n9(t,e,r,n){if(t.type==="leaf"&&r(t.value,n),t.type==="fork"){let i=(0,Jb.beginCell)(),o=(0,Jb.beginCell)();ud(t.left,e-1,r,i),ud(t.right,e-1,r,o),n.storeRef(i),n.storeRef(o)}}function ud(t,e,r,n){r9(t.label,e,n),n9(t.node,e-t.label.length,r,n)}function i9(t,e,r,n){let i=e5(t,e);ud(i,e,r,n)}Dr.serializeDict=i9});var a5=W(ds=>{"use strict";x();S();Object.defineProperty(ds,"__esModule",{value:!0});ds.deserializeInternalKey=ds.serializeInternalKey=void 0;var s5=ri(),cd=ni(),o9=Da();function s9(t){if(typeof t=="number"){if(!Number.isSafeInteger(t))throw Error("Invalid key type: not a safe integer: "+t);return"n:"+t.toString(10)}else{if(typeof t=="bigint")return"b:"+t.toString(10);if(s5.Address.isAddress(t))return"a:"+t.toString();if(v.Buffer.isBuffer(t))return"f:"+t.toString("hex");if(cd.BitString.isBitString(t))return"B:"+t.toString();throw Error("Invalid key type")}}ds.serializeInternalKey=s9;function a9(t){let e=t.slice(0,2),r=t.slice(2);if(e==="n:")return parseInt(r,10);if(e==="b:")return BigInt(r);if(e==="a:")return s5.Address.parse(r);if(e==="f:")return v.Buffer.from(r,"hex");if(e==="B:"){let n=r.slice(-1)=="_";if(n||r.length%2!=0){let o=n?r.length-1:r.length,a=r.substr(0,o)+"0";return!n&&(o&1)!==0?new cd.BitString(v.Buffer.from(a,"hex"),0,o<<2):(0,o9.paddedBufferToBits)(v.Buffer.from(a,"hex"))}else return new cd.BitString(v.Buffer.from(r,"hex"),0,r.length<<2)}throw Error("Invalid key type: "+e)}ds.deserializeInternalKey=a9});var qi=W(Mu=>{"use strict";x();S();Object.defineProperty(Mu,"__esModule",{value:!0});Mu.Dictionary=void 0;var f9=ri(),Nr=Qt(),f5=Ri(),u9=ni(),u5=xu(),c9=sd(),l9=Xb(),c5=o5(),si=a5(),Vr=class{static empty(e,r){return e&&r?new Vr(new Map,e,r):new Vr(new Map,null,null)}static load(e,r,n){let i;if(n instanceof f5.Cell){if(n.isExotic)return Vr.empty(e,r);i=n.beginParse()}else i=n;let o=i.loadMaybeRef();return o&&!o.isExotic?Vr.loadDirect(e,r,o.beginParse()):Vr.empty(e,r)}static loadDirect(e,r,n){if(!n)return Vr.empty(e,r);let i;n instanceof f5.Cell?i=n.beginParse():i=n;let o=(0,l9.parseDict)(i,e.bits,r.parse),a=new Map;for(let[s,u]of o)a.set((0,si.serializeInternalKey)(e.parse(s)),u);return new Vr(a,e,r)}constructor(e,r,n){this._key=r,this._value=n,this._map=e}get size(){return this._map.size}get(e){return this._map.get((0,si.serializeInternalKey)(e))}has(e){return this._map.has((0,si.serializeInternalKey)(e))}set(e,r){return this._map.set((0,si.serializeInternalKey)(e),r),this}delete(e){let r=(0,si.serializeInternalKey)(e);return this._map.delete(r)}clear(){this._map.clear()}*[Symbol.iterator](){for(let[e,r]of this._map)yield[(0,si.deserializeInternalKey)(e),r]}keys(){return Array.from(this._map.keys()).map(e=>(0,si.deserializeInternalKey)(e))}values(){return Array.from(this._map.values())}store(e,r,n){if(this._map.size===0)e.storeBit(0);else{let i=this._key;r!=null&&(i=r);let o=this._value;if(n!=null&&(o=n),!i)throw Error("Key serializer is not defined");if(!o)throw Error("Value serializer is not defined");let a=new Map;for(let[u,h]of this._map)a.set(i.serialize((0,si.deserializeInternalKey)(u)),h);e.storeBit(1);let s=(0,Nr.beginCell)();(0,c5.serializeDict)(a,i.bits,o.serialize,s),e.storeRef(s.endCell())}}storeDirect(e,r,n){if(this._map.size===0)throw Error("Cannot store empty dictionary directly");let i=this._key;r!=null&&(i=r);let o=this._value;if(n!=null&&(o=n),!i)throw Error("Key serializer is not defined");if(!o)throw Error("Value serializer is not defined");let a=new Map;for(let[s,u]of this._map)a.set(i.serialize((0,si.deserializeInternalKey)(s)),u);(0,c5.serializeDict)(a,i.bits,o.serialize,e)}generateMerkleProof(e){return(0,u5.generateMerkleProof)(this,e,this._key)}generateMerkleProofDirect(e){return(0,u5.generateMerkleProofDirect)(this,e,this._key)}generateMerkleUpdate(e,r){return(0,c9.generateMerkleUpdate)(this,e,this._key,r)}};Mu.Dictionary=Vr;Vr.Keys={Address:()=>d9(),BigInt:t=>h9(t),Int:t=>b9(t),BigUint:t=>p9(t),Uint:t=>g9(t),Buffer:t=>y9(t),BitString:t=>m9(t)};Vr.Values={BigInt:t=>w9(t),Int:t=>v9(t),BigVarInt:t=>_9(t),BigUint:t=>B9(t),Uint:t=>S9(t),BigVarUint:t=>x9(t),Bool:()=>A9(),Address:()=>M9(),Cell:()=>E9(),Buffer:t=>P9(t),BitString:t=>T9(t),Dictionary:(t,e)=>I9(t,e)};function d9(){return{bits:267,serialize:t=>{if(!f9.Address.isAddress(t))throw Error("Key is not an address");return(0,Nr.beginCell)().storeAddress(t).endCell().beginParse().preloadUintBig(267)},parse:t=>(0,Nr.beginCell)().storeUint(t,267).endCell().beginParse().loadAddress()}}function h9(t){return{bits:t,serialize:e=>{if(typeof e!="bigint")throw Error("Key is not a bigint");return(0,Nr.beginCell)().storeInt(e,t).endCell().beginParse().loadUintBig(t)},parse:e=>(0,Nr.beginCell)().storeUint(e,t).endCell().beginParse().loadIntBig(t)}}function b9(t){return{bits:t,serialize:e=>{if(typeof e!="number")throw Error("Key is not a number");if(!Number.isSafeInteger(e))throw Error("Key is not a safe integer: "+e);return(0,Nr.beginCell)().storeInt(e,t).endCell().beginParse().loadUintBig(t)},parse:e=>(0,Nr.beginCell)().storeUint(e,t).endCell().beginParse().loadInt(t)}}function p9(t){return{bits:t,serialize:e=>{if(typeof e!="bigint")throw Error("Key is not a bigint");if(e<0)throw Error("Key is negative: "+e);return(0,Nr.beginCell)().storeUint(e,t).endCell().beginParse().loadUintBig(t)},parse:e=>(0,Nr.beginCell)().storeUint(e,t).endCell().beginParse().loadUintBig(t)}}function g9(t){return{bits:t,serialize:e=>{if(typeof e!="number")throw Error("Key is not a number");if(!Number.isSafeInteger(e))throw Error("Key is not a safe integer: "+e);if(e<0)throw Error("Key is negative: "+e);return(0,Nr.beginCell)().storeUint(e,t).endCell().beginParse().loadUintBig(t)},parse:e=>Number((0,Nr.beginCell)().storeUint(e,t).endCell().beginParse().loadUint(t))}}function y9(t){return{bits:t*8,serialize:e=>{if(!v.Buffer.isBuffer(e))throw Error("Key is not a buffer");return(0,Nr.beginCell)().storeBuffer(e).endCell().beginParse().loadUintBig(t*8)},parse:e=>(0,Nr.beginCell)().storeUint(e,t*8).endCell().beginParse().loadBuffer(t)}}function m9(t){return{bits:t,serialize:e=>{if(!u9.BitString.isBitString(e))throw Error("Key is not a BitString");return(0,Nr.beginCell)().storeBits(e).endCell().beginParse().loadUintBig(t)},parse:e=>(0,Nr.beginCell)().storeUint(e,t).endCell().beginParse().loadBits(t)}}function v9(t){return{serialize:(e,r)=>{r.storeInt(e,t)},parse:e=>e.loadInt(t)}}function w9(t){return{serialize:(e,r)=>{r.storeInt(e,t)},parse:e=>e.loadIntBig(t)}}function _9(t){return{serialize:(e,r)=>{r.storeVarInt(e,t)},parse:e=>e.loadVarIntBig(t)}}function x9(t){return{serialize:(e,r)=>{r.storeVarUint(e,t)},parse:e=>e.loadVarUintBig(t)}}function S9(t){return{serialize:(e,r)=>{r.storeUint(e,t)},parse:e=>e.loadUint(t)}}function B9(t){return{serialize:(e,r)=>{r.storeUint(e,t)},parse:e=>e.loadUintBig(t)}}function A9(){return{serialize:(t,e)=>{e.storeBit(t)},parse:t=>t.loadBit()}}function M9(){return{serialize:(t,e)=>{e.storeAddress(t)},parse:t=>t.loadAddress()}}function E9(){return{serialize:(t,e)=>{e.storeRef(t)},parse:t=>t.loadRef()}}function I9(t,e){return{serialize:(r,n)=>{r.store(n)},parse:r=>Vr.load(t,e,r)}}function P9(t){return{serialize:(e,r)=>{if(e.length!==t)throw Error("Invalid buffer size");r.storeBuffer(e)},parse:e=>e.loadBuffer(t)}}function T9(t){return{serialize:(e,r)=>{if(e.length!==t)throw Error("Invalid BitString size");r.storeBits(e)},parse:e=>e.loadBits(t)}}});var dd=W(Ni=>{"use strict";x();S();Object.defineProperty(Ni,"__esModule",{value:!0});Ni.writeString=Ni.stringToCell=Ni.readString=void 0;var l5=Qt();function d5(t){if(t.remainingBits%8!==0)throw new Error(`Invalid string length: ${t.remainingBits}`);if(t.remainingRefs!==0&&t.remainingRefs!==1)throw new Error(`invalid number of refs: ${t.remainingRefs}`);let e;return t.remainingBits===0?e=v.Buffer.alloc(0):e=t.loadBuffer(t.remainingBits/8),t.remainingRefs===1&&(e=v.Buffer.concat([e,d5(t.loadRef().beginParse())])),e}function O9(t){return d5(t).toString()}Ni.readString=O9;function ld(t,e){if(t.length>0){let r=Math.floor(e.availableBits/8);if(t.length>r){let n=t.subarray(0,r),i=t.subarray(r);e=e.storeBuffer(n);let o=(0,l5.beginCell)();ld(i,o),e=e.storeRef(o.endCell())}else e=e.storeBuffer(t)}}function C9(t){let e=(0,l5.beginCell)();return ld(v.Buffer.from(t),e),e.endCell()}Ni.stringToCell=C9;function k9(t,e){ld(v.Buffer.from(t),e)}Ni.writeString=k9});var Iu=W(bs=>{"use strict";x();S();var U9=bs&&bs.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},p5;Object.defineProperty(bs,"__esModule",{value:!0});bs.Slice=void 0;var q9=U9(vo()),h5=qi(),b5=Qt(),Eu=dd(),hs=class{constructor(e,r){this[p5]=()=>this.toString(),this._reader=e.clone(),this._refs=[...r],this._refsOffset=0}get remainingBits(){return this._reader.remaining}get offsetBits(){return this._reader.offset}get remainingRefs(){return this._refs.length-this._refsOffset}get offsetRefs(){return this._refsOffset}skip(e){return this._reader.skip(e),this}loadBit(){return this._reader.loadBit()}preloadBit(){return this._reader.preloadBit()}loadBoolean(){return this.loadBit()}loadMaybeBoolean(){return this.loadBit()?this.loadBoolean():null}loadBits(e){return this._reader.loadBits(e)}preloadBits(e){return this._reader.preloadBits(e)}loadUint(e){return this._reader.loadUint(e)}loadUintBig(e){return this._reader.loadUintBig(e)}preloadUint(e){return this._reader.preloadUint(e)}preloadUintBig(e){return this._reader.preloadUintBig(e)}loadMaybeUint(e){return this.loadBit()?this.loadUint(e):null}loadMaybeUintBig(e){return this.loadBit()?this.loadUintBig(e):null}loadInt(e){return this._reader.loadInt(e)}loadIntBig(e){return this._reader.loadIntBig(e)}preloadInt(e){return this._reader.preloadInt(e)}preloadIntBig(e){return this._reader.preloadIntBig(e)}loadMaybeInt(e){return this.loadBit()?this.loadInt(e):null}loadMaybeIntBig(e){return this.loadBit()?this.loadIntBig(e):null}loadVarUint(e){return this._reader.loadVarUint(e)}loadVarUintBig(e){return this._reader.loadVarUintBig(e)}preloadVarUint(e){return this._reader.preloadVarUint(e)}preloadVarUintBig(e){return this._reader.preloadVarUintBig(e)}loadVarInt(e){return this._reader.loadVarInt(e)}loadVarIntBig(e){return this._reader.loadVarIntBig(e)}preloadVarInt(e){return this._reader.preloadVarInt(e)}preloadVarIntBig(e){return this._reader.preloadVarIntBig(e)}loadCoins(){return this._reader.loadCoins()}preloadCoins(){return this._reader.preloadCoins()}loadMaybeCoins(){return this._reader.loadBit()?this._reader.loadCoins():null}loadAddress(){return this._reader.loadAddress()}loadMaybeAddress(){return this._reader.loadMaybeAddress()}loadExternalAddress(){return this._reader.loadExternalAddress()}loadMaybeExternalAddress(){return this._reader.loadMaybeExternalAddress()}loadAddressAny(){return this._reader.loadAddressAny()}loadRef(){if(this._refsOffset>=this._refs.length)throw new Error("No more references");return this._refs[this._refsOffset++]}preloadRef(){if(this._refsOffset>=this._refs.length)throw new Error("No more references");return this._refs[this._refsOffset]}loadMaybeRef(){return this.loadBit()?this.loadRef():null}preloadMaybeRef(){return this.preloadBit()?this.preloadRef():null}loadBuffer(e){return this._reader.loadBuffer(e)}preloadBuffer(e){return this._reader.preloadBuffer(e)}loadStringTail(){return(0,Eu.readString)(this)}loadMaybeStringTail(){return this.loadBit()?(0,Eu.readString)(this):null}loadStringRefTail(){return(0,Eu.readString)(this.loadRef().beginParse())}loadMaybeStringRefTail(){let e=this.loadMaybeRef();return e?(0,Eu.readString)(e.beginParse()):null}loadDict(e,r){return h5.Dictionary.load(e,r,this)}loadDictDirect(e,r){return h5.Dictionary.loadDirect(e,r,this)}endParse(){if(this.remainingBits>0||this.remainingRefs>0)throw new Error("Slice is not empty")}asCell(){return(0,b5.beginCell)().storeSlice(this).endCell()}asBuilder(){return(0,b5.beginCell)().storeSlice(this)}clone(e=!1){if(e){let r=this._reader.clone();return r.reset(),new hs(r,this._refs)}else{let r=new hs(this._reader,this._refs);return r._refsOffset=this._refsOffset,r}}toString(){return this.asCell().toString()}};bs.Slice=hs;p5=q9.default});var hd=W(Pu=>{"use strict";x();S();Object.defineProperty(Pu,"__esModule",{value:!0});Pu.exoticLibrary=void 0;var R9=oi();function N9(t,e){let r=new R9.BitReader(t),n=8+256;if(t.length!==n)throw new Error(`Library cell must have exactly (8 + 256) bits, got "${t.length}"`);let i=r.loadUint(8);if(i!==2)throw new Error(`Library cell must have type 2, got "${i}"`);return{}}Pu.exoticLibrary=N9});var Ou=W(Tu=>{"use strict";x();S();Object.defineProperty(Tu,"__esModule",{value:!0});Tu.exoticMerkleUpdate=void 0;var L9=oi();function j9(t,e){let r=new L9.BitReader(t),n=8+2*(256+16);if(t.length!==n)throw new Error(`Merkle Update cell must have exactly (8 + (2 * (256 + 16))) bits, got "${t.length}"`);if(e.length!==2)throw new Error(`Merkle Update cell must have exactly 2 refs, got "${e.length}"`);let i=r.loadUint(8);if(i!==4)throw new Error(`Merkle Update cell type must be exactly 4, got "${i}"`);let o=r.loadBuffer(32),a=r.loadBuffer(32),s=r.loadUint(16),u=r.loadUint(16);if(s!==e[0].depth(0))throw new Error(`Merkle Update cell ref depth must be exactly "${s}", got "${e[0].depth(0)}"`);if(!o.equals(e[0].hash(0)))throw new Error(`Merkle Update cell ref hash must be exactly "${o.toString("hex")}", got "${e[0].hash(0).toString("hex")}"`);if(u!==e[1].depth(0))throw new Error(`Merkle Update cell ref depth must be exactly "${u}", got "${e[1].depth(0)}"`);if(!a.equals(e[1].hash(0)))throw new Error(`Merkle Update cell ref hash must be exactly "${a.toString("hex")}", got "${e[1].hash(0).toString("hex")}"`);return{proofDepth1:s,proofDepth2:u,proofHash1:o,proofHash2:a}}Tu.exoticMerkleUpdate=j9});var ku=W(Cu=>{"use strict";x();S();Object.defineProperty(Cu,"__esModule",{value:!0});Cu.LevelMask=void 0;var $a=class{constructor(e=0){this._mask=0,this._mask=e,this._hashIndex=H9(this._mask),this._hashCount=this._hashIndex+1}get value(){return this._mask}get level(){return 32-Math.clz32(this._mask)}get hashIndex(){return this._hashIndex}get hashCount(){return this._hashCount}apply(e){return new $a(this._mask&(1<<e)-1)}isSignificant(e){return e===0||(this._mask>>e-1)%2!==0}};Cu.LevelMask=$a;function H9(t){return t=t-(t>>1&1431655765),t=(t&858993459)+(t>>2&858993459),(t+(t>>4)&252645135)*16843009>>24}});var qu=W(Uu=>{"use strict";x();S();Object.defineProperty(Uu,"__esModule",{value:!0});Uu.exoticPruned=void 0;var K9=oi(),g5=ku();function D9(t,e){let r=new K9.BitReader(t),n=r.loadUint(8);if(n!==1)throw new Error(`Pruned branch cell must have type 1, got "${n}"`);if(e.length!==0)throw new Error(`Pruned Branch cell can't has refs, got "${e.length}"`);let i;if(t.length===280)i=new g5.LevelMask(1);else{if(i=new g5.LevelMask(r.loadUint(8)),i.level<1||i.level>3)throw new Error(`Pruned Branch cell level must be >= 1 and <= 3, got "${i.level}/${i.value}"`);let u=8+8+i.apply(i.level-1).hashCount*(256+16);if(t.length!==u)throw new Error(`Pruned branch cell must have exactly ${u} bits, got "${t.length}"`)}let o=[],a=[],s=[];for(let u=0;u<i.level;u++)a.push(r.loadBuffer(32));for(let u=0;u<i.level;u++)s.push(r.loadUint(16));for(let u=0;u<i.level;u++)o.push({depth:s[u],hash:a[u]});return{mask:i.value,pruned:o}}Uu.exoticPruned=D9});var y5=W(Lu=>{"use strict";x();S();Object.defineProperty(Lu,"__esModule",{value:!0});Lu.resolveExotic=void 0;var V9=oi(),Ru=us(),F9=hd(),z9=Wa(),W9=Ou(),$9=qu(),Nu=ku();function G9(t,e){let r=(0,$9.exoticPruned)(t,e),n=[],i=[],o=new Nu.LevelMask(r.mask);for(let a=0;a<r.pruned.length;a++)n.push(r.pruned[a].depth),i.push(r.pruned[a].hash);return{type:Ru.CellType.PrunedBranch,depths:n,hashes:i,mask:o}}function Z9(t,e){let r=(0,F9.exoticLibrary)(t,e),n=[],i=[],o=new Nu.LevelMask;return{type:Ru.CellType.Library,depths:n,hashes:i,mask:o}}function Y9(t,e){let r=(0,z9.exoticMerkleProof)(t,e),n=[],i=[],o=new Nu.LevelMask(e[0].level()>>1);return{type:Ru.CellType.MerkleProof,depths:n,hashes:i,mask:o}}function X9(t,e){let r=(0,W9.exoticMerkleUpdate)(t,e),n=[],i=[],o=new Nu.LevelMask((e[0].level()|e[1].level())>>1);return{type:Ru.CellType.MerkleUpdate,depths:n,hashes:i,mask:o}}function Q9(t,e){let n=new V9.BitReader(t).preloadUint(8);if(n===1)return G9(t,e);if(n===2)return Z9(t,e);if(n===3)return Y9(t,e);if(n===4)return X9(t,e);throw Error("Invalid exotic cell type: "+n)}Lu.resolveExotic=Q9});var bd=W(Li=>{"use strict";x();S();Object.defineProperty(Li,"__esModule",{value:!0});Li.getRepr=Li.getBitsDescriptor=Li.getRefsDescriptor=void 0;var Ga=us(),J9=Da();function m5(t,e,r){return t.length+(r!==Ga.CellType.Ordinary?1:0)*8+e*32}Li.getRefsDescriptor=m5;function v5(t){let e=t.length;return Math.ceil(e/8)+Math.floor(e/8)}Li.getBitsDescriptor=v5;function e_(t,e,r,n,i,o){let a=Math.ceil(e.length/8),s=v.Buffer.alloc(2+a+(2+32)*r.length),u=0;s[u++]=m5(r,i,o),s[u++]=v5(t),(0,J9.bitsToPaddedBuffer)(e).copy(s,u),u+=a;for(let h of r){let w;o==Ga.CellType.MerkleProof||o==Ga.CellType.MerkleUpdate?w=h.depth(n+1):w=h.depth(n),s[u++]=Math.floor(w/256),s[u++]=w%256}for(let h of r){let w;o==Ga.CellType.MerkleProof||o==Ga.CellType.MerkleUpdate?w=h.hash(n+1):w=h.hash(n),w.copy(s,u),u+=32}return s}Li.getRepr=e_});var ju=W((pd,gd)=>{x();S();(function(t,e){typeof pd=="object"&&typeof gd<"u"?gd.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).jsSHA=e()})(pd,function(){"use strict";var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e="ARRAYBUFFER not supported by this environment",r="UINT8ARRAY not supported by this environment";function n(V,C,K,D){var G,R,te,oe=C||[0],ie=(K=K||0)>>>3,fe=D===-1?3:0;for(G=0;G<V.length;G+=1)R=(te=G+ie)>>>2,oe.length<=R&&oe.push(0),oe[R]|=V[G]<<8*(fe+D*(te%4));return{value:oe,binLen:8*V.length+K}}function i(V,C,K){switch(C){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(V){case"HEX":return function(D,G,R){return function(te,oe,ie,fe){var ke,se,he,B;if(te.length%2!=0)throw new Error("String of HEX type must be in byte increments");var m=oe||[0],I=(ie=ie||0)>>>3,l=fe===-1?3:0;for(ke=0;ke<te.length;ke+=2){if(se=parseInt(te.substr(ke,2),16),isNaN(se))throw new Error("String of HEX type contains invalid characters");for(he=(B=(ke>>>1)+I)>>>2;m.length<=he;)m.push(0);m[he]|=se<<8*(l+fe*(B%4))}return{value:m,binLen:4*te.length+ie}}(D,G,R,K)};case"TEXT":return function(D,G,R){return function(te,oe,ie,fe,ke){var se,he,B,m,I,l,y,L,F=0,X=ie||[0],j=(fe=fe||0)>>>3;if(oe==="UTF8")for(y=ke===-1?3:0,B=0;B<te.length;B+=1)for(he=[],128>(se=te.charCodeAt(B))?he.push(se):2048>se?(he.push(192|se>>>6),he.push(128|63&se)):55296>se||57344<=se?he.push(224|se>>>12,128|se>>>6&63,128|63&se):(B+=1,se=65536+((1023&se)<<10|1023&te.charCodeAt(B)),he.push(240|se>>>18,128|se>>>12&63,128|se>>>6&63,128|63&se)),m=0;m<he.length;m+=1){for(I=(l=F+j)>>>2;X.length<=I;)X.push(0);X[I]|=he[m]<<8*(y+ke*(l%4)),F+=1}else for(y=ke===-1?2:0,L=oe==="UTF16LE"&&ke!==1||oe!=="UTF16LE"&&ke===1,B=0;B<te.length;B+=1){for(se=te.charCodeAt(B),L===!0&&(se=(m=255&se)<<8|se>>>8),I=(l=F+j)>>>2;X.length<=I;)X.push(0);X[I]|=se<<8*(y+ke*(l%4)),F+=2}return{value:X,binLen:8*F+fe}}(D,C,G,R,K)};case"B64":return function(D,G,R){return function(te,oe,ie,fe){var ke,se,he,B,m,I,l=0,y=oe||[0],L=(ie=ie||0)>>>3,F=fe===-1?3:0,X=te.indexOf("=");if(te.search(/^[a-zA-Z0-9=+/]+$/)===-1)throw new Error("Invalid character in base-64 string");if(te=te.replace(/=/g,""),X!==-1&&X<te.length)throw new Error("Invalid '=' found in base-64 string");for(ke=0;ke<te.length;ke+=4){for(B=te.substr(ke,4),he=0,se=0;se<B.length;se+=1)he|=t.indexOf(B.charAt(se))<<18-6*se;for(se=0;se<B.length-1;se+=1){for(m=(I=l+L)>>>2;y.length<=m;)y.push(0);y[m]|=(he>>>16-8*se&255)<<8*(F+fe*(I%4)),l+=1}}return{value:y,binLen:8*l+ie}}(D,G,R,K)};case"BYTES":return function(D,G,R){return function(te,oe,ie,fe){var ke,se,he,B,m=oe||[0],I=(ie=ie||0)>>>3,l=fe===-1?3:0;for(se=0;se<te.length;se+=1)ke=te.charCodeAt(se),he=(B=se+I)>>>2,m.length<=he&&m.push(0),m[he]|=ke<<8*(l+fe*(B%4));return{value:m,binLen:8*te.length+ie}}(D,G,R,K)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch{throw new Error(e)}return function(D,G,R){return function(te,oe,ie,fe){return n(new Uint8Array(te),oe,ie,fe)}(D,G,R,K)};case"UINT8ARRAY":try{new Uint8Array(0)}catch{throw new Error(r)}return function(D,G,R){return n(D,G,R,K)};default:throw new Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function o(V,C,K,D){switch(V){case"HEX":return function(G){return function(R,te,oe,ie){var fe,ke,se="0123456789abcdef",he="",B=te/8,m=oe===-1?3:0;for(fe=0;fe<B;fe+=1)ke=R[fe>>>2]>>>8*(m+oe*(fe%4)),he+=se.charAt(ke>>>4&15)+se.charAt(15&ke);return ie.outputUpper?he.toUpperCase():he}(G,C,K,D)};case"B64":return function(G){return function(R,te,oe,ie){var fe,ke,se,he,B,m="",I=te/8,l=oe===-1?3:0;for(fe=0;fe<I;fe+=3)for(he=fe+1<I?R[fe+1>>>2]:0,B=fe+2<I?R[fe+2>>>2]:0,se=(R[fe>>>2]>>>8*(l+oe*(fe%4))&255)<<16|(he>>>8*(l+oe*((fe+1)%4))&255)<<8|B>>>8*(l+oe*((fe+2)%4))&255,ke=0;ke<4;ke+=1)m+=8*fe+6*ke<=te?t.charAt(se>>>6*(3-ke)&63):ie.b64Pad;return m}(G,C,K,D)};case"BYTES":return function(G){return function(R,te,oe){var ie,fe,ke="",se=te/8,he=oe===-1?3:0;for(ie=0;ie<se;ie+=1)fe=R[ie>>>2]>>>8*(he+oe*(ie%4))&255,ke+=String.fromCharCode(fe);return ke}(G,C,K)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch{throw new Error(e)}return function(G){return function(R,te,oe){var ie,fe=te/8,ke=new ArrayBuffer(fe),se=new Uint8Array(ke),he=oe===-1?3:0;for(ie=0;ie<fe;ie+=1)se[ie]=R[ie>>>2]>>>8*(he+oe*(ie%4))&255;return ke}(G,C,K)};case"UINT8ARRAY":try{new Uint8Array(0)}catch{throw new Error(r)}return function(G){return function(R,te,oe){var ie,fe=te/8,ke=oe===-1?3:0,se=new Uint8Array(fe);for(ie=0;ie<fe;ie+=1)se[ie]=R[ie>>>2]>>>8*(ke+oe*(ie%4))&255;return se}(G,C,K)};default:throw new Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}var a=4294967296,s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],u=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],w="Chosen SHA variant is not supported",p="Cannot set numRounds with MAC";function M(V,C){var K,D,G=V.binLen>>>3,R=C.binLen>>>3,te=G<<3,oe=4-G<<3;if(G%4!=0){for(K=0;K<R;K+=4)D=G+K>>>2,V.value[D]|=C.value[K>>>2]<<te,V.value.push(0),V.value[D+1]|=C.value[K>>>2]>>>oe;return(V.value.length<<2)-4>=R+G&&V.value.pop(),{value:V.value,binLen:V.binLen+C.binLen}}return{value:V.value.concat(C.value),binLen:V.binLen+C.binLen}}function A(V){var C={outputUpper:!1,b64Pad:"=",outputLen:-1},K=V||{},D="Output length must be a multiple of 8";if(C.outputUpper=K.outputUpper||!1,K.b64Pad&&(C.b64Pad=K.b64Pad),K.outputLen){if(K.outputLen%8!=0)throw new Error(D);C.outputLen=K.outputLen}else if(K.shakeLen){if(K.shakeLen%8!=0)throw new Error(D);C.outputLen=K.shakeLen}if(typeof C.outputUpper!="boolean")throw new Error("Invalid outputUpper formatting option");if(typeof C.b64Pad!="string")throw new Error("Invalid b64Pad formatting option");return C}function P(V,C,K,D){var G=V+" must include a value and format";if(!C){if(!D)throw new Error(G);return D}if(C.value===void 0||!C.format)throw new Error(G);return i(C.format,C.encoding||"UTF8",K)(C.value)}var E=function(){function V(C,K,D){var G=D||{};if(this.t=K,this.i=G.encoding||"UTF8",this.numRounds=G.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw new Error("numRounds must a integer >= 1");this.o=C,this.u=[],this.h=0,this.v=!1,this.A=0,this.l=!1,this.S=[],this.H=[]}return V.prototype.update=function(C){var K,D=0,G=this.p>>>5,R=this.m(C,this.u,this.h),te=R.binLen,oe=R.value,ie=te>>>5;for(K=0;K<ie;K+=G)D+this.p<=te&&(this.U=this.R(oe.slice(K,K+G),this.U),D+=this.p);return this.A+=D,this.u=oe.slice(D>>>5),this.h=te%this.p,this.v=!0,this},V.prototype.getHash=function(C,K){var D,G,R=this.T,te=A(K);if(this.C){if(te.outputLen===-1)throw new Error("Output length must be specified in options");R=te.outputLen}var oe=o(C,R,this.F,te);if(this.l&&this.K)return oe(this.K(te));for(G=this.g(this.u.slice(),this.h,this.A,this.L(this.U),R),D=1;D<this.numRounds;D+=1)this.C&&R%32!=0&&(G[G.length-1]&=16777215>>>24-R%32),G=this.g(G,R,0,this.B(this.o),R);return oe(G)},V.prototype.setHMACKey=function(C,K,D){if(!this.k)throw new Error("Variant does not support HMAC");if(this.v)throw new Error("Cannot set MAC key after calling update");var G=i(K,(D||{}).encoding||"UTF8",this.F);this.Y(G(C))},V.prototype.Y=function(C){var K,D=this.p>>>3,G=D/4-1;if(this.numRounds!==1)throw new Error(p);if(this.l)throw new Error("MAC key already set");for(D<C.binLen/8&&(C.value=this.g(C.value,C.binLen,0,this.B(this.o),this.T));C.value.length<=G;)C.value.push(0);for(K=0;K<=G;K+=1)this.S[K]=909522486^C.value[K],this.H[K]=1549556828^C.value[K];this.U=this.R(this.S,this.U),this.A=this.p,this.l=!0},V.prototype.getHMAC=function(C,K){var D=A(K);return o(C,this.T,this.F,D)(this.N())},V.prototype.N=function(){var C;if(!this.l)throw new Error("Cannot call getHMAC without first setting MAC key");var K=this.g(this.u.slice(),this.h,this.A,this.L(this.U),this.T);return C=this.R(this.H,this.B(this.o)),C=this.g(K,this.T,this.p,C,this.T)},V}(),q=function(V,C){return q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(K,D){K.__proto__=D}||function(K,D){for(var G in D)Object.prototype.hasOwnProperty.call(D,G)&&(K[G]=D[G])},q(V,C)};function z(V,C){if(typeof C!="function"&&C!==null)throw new TypeError("Class extends value "+String(C)+" is not a constructor or null");function K(){this.constructor=V}q(V,C),V.prototype=C===null?Object.create(C):(K.prototype=C.prototype,new K)}function J(V,C){return V<<C|V>>>32-C}function $(V,C){return V>>>C|V<<32-C}function ee(V,C){return V>>>C}function Y(V,C,K){return V^C^K}function Z(V,C,K){return V&C^~V&K}function ne(V,C,K){return V&C^V&K^C&K}function re(V){return $(V,2)^$(V,13)^$(V,22)}function ye(V,C){var K=(65535&V)+(65535&C);return(65535&(V>>>16)+(C>>>16)+(K>>>16))<<16|65535&K}function U(V,C,K,D){var G=(65535&V)+(65535&C)+(65535&K)+(65535&D);return(65535&(V>>>16)+(C>>>16)+(K>>>16)+(D>>>16)+(G>>>16))<<16|65535&G}function f(V,C,K,D,G){var R=(65535&V)+(65535&C)+(65535&K)+(65535&D)+(65535&G);return(65535&(V>>>16)+(C>>>16)+(K>>>16)+(D>>>16)+(G>>>16)+(R>>>16))<<16|65535&R}function b(V){return $(V,7)^$(V,18)^ee(V,3)}function g(V){return $(V,6)^$(V,11)^$(V,25)}function d(V){return[1732584193,4023233417,2562383102,271733878,3285377520]}function _(V,C){var K,D,G,R,te,oe,ie,fe=[];for(K=C[0],D=C[1],G=C[2],R=C[3],te=C[4],ie=0;ie<80;ie+=1)fe[ie]=ie<16?V[ie]:J(fe[ie-3]^fe[ie-8]^fe[ie-14]^fe[ie-16],1),oe=ie<20?f(J(K,5),Z(D,G,R),te,1518500249,fe[ie]):ie<40?f(J(K,5),Y(D,G,R),te,1859775393,fe[ie]):ie<60?f(J(K,5),ne(D,G,R),te,2400959708,fe[ie]):f(J(K,5),Y(D,G,R),te,3395469782,fe[ie]),te=R,R=G,G=J(D,30),D=K,K=oe;return C[0]=ye(K,C[0]),C[1]=ye(D,C[1]),C[2]=ye(G,C[2]),C[3]=ye(R,C[3]),C[4]=ye(te,C[4]),C}function k(V,C,K,D){for(var G,R=15+(C+65>>>9<<4),te=C+K;V.length<=R;)V.push(0);for(V[C>>>5]|=128<<24-C%32,V[R]=4294967295&te,V[R-1]=te/a|0,G=0;G<V.length;G+=16)D=_(V.slice(G,G+16),D);return D}typeof SuppressedError=="function"&&SuppressedError;var H=function(V){function C(K,D,G){var R=this;if(K!=="SHA-1")throw new Error(w);var te=G||{};return(R=V.call(this,K,D,G)||this).k=!0,R.K=R.N,R.F=-1,R.m=i(R.t,R.i,R.F),R.R=_,R.L=function(oe){return oe.slice()},R.B=d,R.g=k,R.U=[1732584193,4023233417,2562383102,271733878,3285377520],R.p=512,R.T=160,R.C=!1,te.hmacKey&&R.Y(P("hmacKey",te.hmacKey,R.F)),R}return z(C,V),C}(E);function T(V){return V=="SHA-224"?u.slice():h.slice()}function c(V,C){var K,D,G,R,te,oe,ie,fe,ke,se,he,B,m=[];for(K=C[0],D=C[1],G=C[2],R=C[3],te=C[4],oe=C[5],ie=C[6],fe=C[7],he=0;he<64;he+=1)m[he]=he<16?V[he]:U($(B=m[he-2],17)^$(B,19)^ee(B,10),m[he-7],b(m[he-15]),m[he-16]),ke=f(fe,g(te),Z(te,oe,ie),s[he],m[he]),se=ye(re(K),ne(K,D,G)),fe=ie,ie=oe,oe=te,te=ye(R,ke),R=G,G=D,D=K,K=ye(ke,se);return C[0]=ye(K,C[0]),C[1]=ye(D,C[1]),C[2]=ye(G,C[2]),C[3]=ye(R,C[3]),C[4]=ye(te,C[4]),C[5]=ye(oe,C[5]),C[6]=ye(ie,C[6]),C[7]=ye(fe,C[7]),C}var O=function(V){function C(K,D,G){var R=this;if(K!=="SHA-224"&&K!=="SHA-256")throw new Error(w);var te=G||{};return(R=V.call(this,K,D,G)||this).K=R.N,R.k=!0,R.F=-1,R.m=i(R.t,R.i,R.F),R.R=c,R.L=function(oe){return oe.slice()},R.B=T,R.g=function(oe,ie,fe,ke){return function(se,he,B,m,I){for(var l,y=15+(he+65>>>9<<4),L=he+B;se.length<=y;)se.push(0);for(se[he>>>5]|=128<<24-he%32,se[y]=4294967295&L,se[y-1]=L/a|0,l=0;l<se.length;l+=16)m=c(se.slice(l,l+16),m);return I==="SHA-224"?[m[0],m[1],m[2],m[3],m[4],m[5],m[6]]:m}(oe,ie,fe,ke,K)},R.U=T(K),R.p=512,R.T=K==="SHA-224"?224:256,R.C=!1,te.hmacKey&&R.Y(P("hmacKey",te.hmacKey,R.F)),R}return z(C,V),C}(E),N=function(V,C){this.I=V,this.M=C};function le(V,C){var K;return C>32?(K=64-C,new N(V.M<<C|V.I>>>K,V.I<<C|V.M>>>K)):C!==0?(K=32-C,new N(V.I<<C|V.M>>>K,V.M<<C|V.I>>>K)):V}function ce(V,C){var K;return C<32?(K=32-C,new N(V.I>>>C|V.M<<K,V.M>>>C|V.I<<K)):(K=64-C,new N(V.M>>>C|V.I<<K,V.I>>>C|V.M<<K))}function Te(V,C){return new N(V.I>>>C,V.M>>>C|V.I<<32-C)}function qe(V,C,K){return new N(V.I&C.I^~V.I&K.I,V.M&C.M^~V.M&K.M)}function Fe(V,C,K){return new N(V.I&C.I^V.I&K.I^C.I&K.I,V.M&C.M^V.M&K.M^C.M&K.M)}function at(V){var C=ce(V,28),K=ce(V,34),D=ce(V,39);return new N(C.I^K.I^D.I,C.M^K.M^D.M)}function He(V,C){var K,D;K=(65535&V.M)+(65535&C.M);var G=(65535&(D=(V.M>>>16)+(C.M>>>16)+(K>>>16)))<<16|65535&K;return K=(65535&V.I)+(65535&C.I)+(D>>>16),D=(V.I>>>16)+(C.I>>>16)+(K>>>16),new N((65535&D)<<16|65535&K,G)}function Pe(V,C,K,D){var G,R;G=(65535&V.M)+(65535&C.M)+(65535&K.M)+(65535&D.M);var te=(65535&(R=(V.M>>>16)+(C.M>>>16)+(K.M>>>16)+(D.M>>>16)+(G>>>16)))<<16|65535&G;return G=(65535&V.I)+(65535&C.I)+(65535&K.I)+(65535&D.I)+(R>>>16),R=(V.I>>>16)+(C.I>>>16)+(K.I>>>16)+(D.I>>>16)+(G>>>16),new N((65535&R)<<16|65535&G,te)}function jt(V,C,K,D,G){var R,te;R=(65535&V.M)+(65535&C.M)+(65535&K.M)+(65535&D.M)+(65535&G.M);var oe=(65535&(te=(V.M>>>16)+(C.M>>>16)+(K.M>>>16)+(D.M>>>16)+(G.M>>>16)+(R>>>16)))<<16|65535&R;return R=(65535&V.I)+(65535&C.I)+(65535&K.I)+(65535&D.I)+(65535&G.I)+(te>>>16),te=(V.I>>>16)+(C.I>>>16)+(K.I>>>16)+(D.I>>>16)+(G.I>>>16)+(R>>>16),new N((65535&te)<<16|65535&R,oe)}function yt(V,C){return new N(V.I^C.I,V.M^C.M)}function ft(V){var C=ce(V,1),K=ce(V,8),D=Te(V,7);return new N(C.I^K.I^D.I,C.M^K.M^D.M)}function xr(V){var C=ce(V,14),K=ce(V,18),D=ce(V,41);return new N(C.I^K.I^D.I,C.M^K.M^D.M)}var mt=[new N(s[0],3609767458),new N(s[1],602891725),new N(s[2],3964484399),new N(s[3],2173295548),new N(s[4],4081628472),new N(s[5],3053834265),new N(s[6],2937671579),new N(s[7],3664609560),new N(s[8],2734883394),new N(s[9],1164996542),new N(s[10],1323610764),new N(s[11],3590304994),new N(s[12],4068182383),new N(s[13],991336113),new N(s[14],633803317),new N(s[15],3479774868),new N(s[16],2666613458),new N(s[17],944711139),new N(s[18],2341262773),new N(s[19],2007800933),new N(s[20],1495990901),new N(s[21],1856431235),new N(s[22],3175218132),new N(s[23],2198950837),new N(s[24],3999719339),new N(s[25],766784016),new N(s[26],2566594879),new N(s[27],3203337956),new N(s[28],1034457026),new N(s[29],2466948901),new N(s[30],3758326383),new N(s[31],168717936),new N(s[32],1188179964),new N(s[33],1546045734),new N(s[34],1522805485),new N(s[35],2643833823),new N(s[36],2343527390),new N(s[37],1014477480),new N(s[38],1206759142),new N(s[39],344077627),new N(s[40],1290863460),new N(s[41],3158454273),new N(s[42],3505952657),new N(s[43],106217008),new N(s[44],3606008344),new N(s[45],1432725776),new N(s[46],1467031594),new N(s[47],851169720),new N(s[48],3100823752),new N(s[49],1363258195),new N(s[50],3750685593),new N(s[51],3785050280),new N(s[52],3318307427),new N(s[53],3812723403),new N(s[54],2003034995),new N(s[55],3602036899),new N(s[56],1575990012),new N(s[57],1125592928),new N(s[58],2716904306),new N(s[59],442776044),new N(s[60],593698344),new N(s[61],3733110249),new N(s[62],2999351573),new N(s[63],3815920427),new N(3391569614,3928383900),new N(3515267271,566280711),new N(3940187606,3454069534),new N(4118630271,4000239992),new N(116418474,1914138554),new N(174292421,2731055270),new N(289380356,3203993006),new N(460393269,320620315),new N(685471733,587496836),new N(852142971,1086792851),new N(1017036298,365543100),new N(1126000580,2618297676),new N(1288033470,3409855158),new N(1501505948,4234509866),new N(1607167915,987167468),new N(1816402316,1246189591)];function At(V){return V==="SHA-384"?[new N(3418070365,u[0]),new N(1654270250,u[1]),new N(2438529370,u[2]),new N(355462360,u[3]),new N(1731405415,u[4]),new N(41048885895,u[5]),new N(3675008525,u[6]),new N(1203062813,u[7])]:[new N(h[0],4089235720),new N(h[1],2227873595),new N(h[2],4271175723),new N(h[3],1595750129),new N(h[4],2917565137),new N(h[5],725511199),new N(h[6],4215389547),new N(h[7],327033209)]}function $r(V,C){var K,D,G,R,te,oe,ie,fe,ke,se,he,B,m,I,l,y,L=[];for(K=C[0],D=C[1],G=C[2],R=C[3],te=C[4],oe=C[5],ie=C[6],fe=C[7],he=0;he<80;he+=1)he<16?(B=2*he,L[he]=new N(V[B],V[B+1])):L[he]=Pe((m=L[he-2],I=void 0,l=void 0,y=void 0,I=ce(m,19),l=ce(m,61),y=Te(m,6),new N(I.I^l.I^y.I,I.M^l.M^y.M)),L[he-7],ft(L[he-15]),L[he-16]),ke=jt(fe,xr(te),qe(te,oe,ie),mt[he],L[he]),se=He(at(K),Fe(K,D,G)),fe=ie,ie=oe,oe=te,te=He(R,ke),R=G,G=D,D=K,K=He(ke,se);return C[0]=He(K,C[0]),C[1]=He(D,C[1]),C[2]=He(G,C[2]),C[3]=He(R,C[3]),C[4]=He(te,C[4]),C[5]=He(oe,C[5]),C[6]=He(ie,C[6]),C[7]=He(fe,C[7]),C}var kt=function(V){function C(K,D,G){var R=this;if(K!=="SHA-384"&&K!=="SHA-512")throw new Error(w);var te=G||{};return(R=V.call(this,K,D,G)||this).K=R.N,R.k=!0,R.F=-1,R.m=i(R.t,R.i,R.F),R.R=$r,R.L=function(oe){return oe.slice()},R.B=At,R.g=function(oe,ie,fe,ke){return function(se,he,B,m,I){for(var l,y=31+(he+129>>>10<<5),L=he+B;se.length<=y;)se.push(0);for(se[he>>>5]|=128<<24-he%32,se[y]=4294967295&L,se[y-1]=L/a|0,l=0;l<se.length;l+=32)m=$r(se.slice(l,l+32),m);return I==="SHA-384"?[m[0].I,m[0].M,m[1].I,m[1].M,m[2].I,m[2].M,m[3].I,m[3].M,m[4].I,m[4].M,m[5].I,m[5].M]:[m[0].I,m[0].M,m[1].I,m[1].M,m[2].I,m[2].M,m[3].I,m[3].M,m[4].I,m[4].M,m[5].I,m[5].M,m[6].I,m[6].M,m[7].I,m[7].M]}(oe,ie,fe,ke,K)},R.U=At(K),R.p=1024,R.T=K==="SHA-384"?384:512,R.C=!1,te.hmacKey&&R.Y(P("hmacKey",te.hmacKey,R.F)),R}return z(C,V),C}(E),Ht=[new N(0,1),new N(0,32898),new N(2147483648,32906),new N(2147483648,2147516416),new N(0,32907),new N(0,2147483649),new N(2147483648,2147516545),new N(2147483648,32777),new N(0,138),new N(0,136),new N(0,2147516425),new N(0,2147483658),new N(0,2147516555),new N(2147483648,139),new N(2147483648,32905),new N(2147483648,32771),new N(2147483648,32770),new N(2147483648,128),new N(0,32778),new N(2147483648,2147483658),new N(2147483648,2147516545),new N(2147483648,32896),new N(0,2147483649),new N(2147483648,2147516424)],Yi=[[0,36,3,41,18],[1,44,10,45,2],[62,6,43,15,61],[28,55,25,21,56],[27,20,39,8,14]];function It(V){var C,K=[];for(C=0;C<5;C+=1)K[C]=[new N(0,0),new N(0,0),new N(0,0),new N(0,0),new N(0,0)];return K}function St(V){var C,K=[];for(C=0;C<5;C+=1)K[C]=V[C].slice();return K}function Xr(V,C){var K,D,G,R,te,oe,ie,fe,ke,se=[],he=[];if(V!==null)for(D=0;D<V.length;D+=2)C[(D>>>1)%5][(D>>>1)/5|0]=yt(C[(D>>>1)%5][(D>>>1)/5|0],new N(V[D+1],V[D]));for(K=0;K<24;K+=1){for(R=It(),D=0;D<5;D+=1)se[D]=(te=C[D][0],oe=C[D][1],ie=C[D][2],fe=C[D][3],ke=C[D][4],new N(te.I^oe.I^ie.I^fe.I^ke.I,te.M^oe.M^ie.M^fe.M^ke.M));for(D=0;D<5;D+=1)he[D]=yt(se[(D+4)%5],le(se[(D+1)%5],1));for(D=0;D<5;D+=1)for(G=0;G<5;G+=1)C[D][G]=yt(C[D][G],he[D]);for(D=0;D<5;D+=1)for(G=0;G<5;G+=1)R[G][(2*D+3*G)%5]=le(C[D][G],Yi[D][G]);for(D=0;D<5;D+=1)for(G=0;G<5;G+=1)C[D][G]=yt(R[D][G],new N(~R[(D+1)%5][G].I&R[(D+2)%5][G].I,~R[(D+1)%5][G].M&R[(D+2)%5][G].M));C[0][0]=yt(C[0][0],Ht[K])}return C}function Tt(V){var C,K,D=0,G=[0,0],R=[4294967295&V,V/a&2097151];for(C=6;C>=0;C--)(K=R[C>>2]>>>8*C&255)===0&&D===0||(G[D+1>>2]|=K<<8*(D+1),D+=1);return D=D!==0?D:1,G[0]|=D,{value:D+1>4?G:[G[0]],binLen:8+8*D}}function Et(V){return M(Tt(V.binLen),V)}function Zn(V,C){var K,D=Tt(C),G=C>>>2,R=(G-(D=M(D,V)).value.length%G)%G;for(K=0;K<R;K++)D.value.push(0);return D.value}var Pt=function(V){function C(K,D,G){var R=this,te=6,oe=0,ie=G||{};if((R=V.call(this,K,D,G)||this).numRounds!==1){if(ie.kmacKey||ie.hmacKey)throw new Error(p);if(R.o==="CSHAKE128"||R.o==="CSHAKE256")throw new Error("Cannot set numRounds for CSHAKE variants")}switch(R.F=1,R.m=i(R.t,R.i,R.F),R.R=Xr,R.L=St,R.B=It,R.U=It(),R.C=!1,K){case"SHA3-224":R.p=oe=1152,R.T=224,R.k=!0,R.K=R.N;break;case"SHA3-256":R.p=oe=1088,R.T=256,R.k=!0,R.K=R.N;break;case"SHA3-384":R.p=oe=832,R.T=384,R.k=!0,R.K=R.N;break;case"SHA3-512":R.p=oe=576,R.T=512,R.k=!0,R.K=R.N;break;case"SHAKE128":te=31,R.p=oe=1344,R.T=-1,R.C=!0,R.k=!1,R.K=null;break;case"SHAKE256":te=31,R.p=oe=1088,R.T=-1,R.C=!0,R.k=!1,R.K=null;break;case"KMAC128":te=4,R.p=oe=1344,R.X(G),R.T=-1,R.C=!0,R.k=!1,R.K=R.O;break;case"KMAC256":te=4,R.p=oe=1088,R.X(G),R.T=-1,R.C=!0,R.k=!1,R.K=R.O;break;case"CSHAKE128":R.p=oe=1344,te=R.j(G),R.T=-1,R.C=!0,R.k=!1,R.K=null;break;case"CSHAKE256":R.p=oe=1088,te=R.j(G),R.T=-1,R.C=!0,R.k=!1,R.K=null;break;default:throw new Error(w)}return R.g=function(fe,ke,se,he,B){return function(m,I,l,y,L,F,X){var j,be,we=0,de=[],Re=L>>>5,Be=I>>>5;for(j=0;j<Be&&I>=L;j+=Re)y=Xr(m.slice(j,j+Re),y),I-=L;for(m=m.slice(j),I%=L;m.length<Re;)m.push(0);for(m[(j=I>>>3)>>2]^=F<<j%4*8,m[Re-1]^=2147483648,y=Xr(m,y);32*de.length<X&&(be=y[we%5][we/5|0],de.push(be.M),!(32*de.length>=X));)de.push(be.I),64*(we+=1)%L==0&&(Xr(null,y),we=0);return de}(fe,ke,0,he,oe,te,B)},ie.hmacKey&&R.Y(P("hmacKey",ie.hmacKey,R.F)),R}return z(C,V),C.prototype.j=function(K,D){var G=function(ie){var fe=ie||{};return{funcName:P("funcName",fe.funcName,1,{value:[],binLen:0}),customization:P("Customization",fe.customization,1,{value:[],binLen:0})}}(K||{});D&&(G.funcName=D);var R=M(Et(G.funcName),Et(G.customization));if(G.customization.binLen!==0||G.funcName.binLen!==0){for(var te=Zn(R,this.p>>>3),oe=0;oe<te.length;oe+=this.p>>>5)this.U=this.R(te.slice(oe,oe+(this.p>>>5)),this.U),this.A+=this.p;return 4}return 31},C.prototype.X=function(K){var D=function(te){var oe=te||{};return{kmacKey:P("kmacKey",oe.kmacKey,1),funcName:{value:[1128353099],binLen:32},customization:P("Customization",oe.customization,1,{value:[],binLen:0})}}(K||{});this.j(K,D.funcName);for(var G=Zn(Et(D.kmacKey),this.p>>>3),R=0;R<G.length;R+=this.p>>>5)this.U=this.R(G.slice(R,R+(this.p>>>5)),this.U),this.A+=this.p;this.l=!0},C.prototype.O=function(K){var D=M({value:this.u.slice(),binLen:this.h},function(G){var R,te,oe=0,ie=[0,0],fe=[4294967295&G,G/a&2097151];for(R=6;R>=0;R--)(te=fe[R>>2]>>>8*R&255)==0&&oe===0||(ie[oe>>2]|=te<<8*oe,oe+=1);return ie[(oe=oe!==0?oe:1)>>2]|=oe<<8*oe,{value:oe+1>4?ie:[ie[0]],binLen:8+8*oe}}(K.outputLen));return this.g(D.value,D.binLen,this.A,this.L(this.U),K.outputLen)},C}(E);return function(){function V(C,K,D){if(C=="SHA-1")this._=new H(C,K,D);else if(C=="SHA-224"||C=="SHA-256")this._=new O(C,K,D);else if(C=="SHA-384"||C=="SHA-512")this._=new kt(C,K,D);else{if(C!="SHA3-224"&&C!="SHA3-256"&&C!="SHA3-384"&&C!="SHA3-512"&&C!="SHAKE128"&&C!="SHAKE256"&&C!="CSHAKE128"&&C!="CSHAKE256"&&C!="KMAC128"&&C!="KMAC256")throw new Error(w);this._=new Pt(C,K,D)}}return V.prototype.update=function(C){return this._.update(C),this},V.prototype.getHash=function(C,K){return this._.getHash(C,K)},V.prototype.setHMACKey=function(C,K,D){this._.setHMACKey(C,K,D)},V.prototype.getHMAC=function(C,K){return this._.getHMAC(C,K)},V}()})});var _5=W(ji=>{"use strict";x();S();var t_=ji&&ji.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ji,"__esModule",{value:!0});ji.getSecureRandomWords=ji.getSecureRandomBytes=void 0;var w5=t_(Mo());function r_(t){return w5.default.randomBytes(t)}ji.getSecureRandomBytes=r_;function n_(t){let e=new Uint16Array(t);return w5.default.randomFillSync(e),e}ji.getSecureRandomWords=n_});var x5=W(ps=>{"use strict";x();S();var i_=ps&&ps.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ps,"__esModule",{value:!0});ps.hmac_sha512=void 0;var o_=i_(Mo());async function s_(t,e){let r=typeof t=="string"?v.Buffer.from(t,"utf-8"):t,n=typeof e=="string"?v.Buffer.from(e,"utf-8"):e;return o_.default.createHmac("sha512",r).update(n).digest()}ps.hmac_sha512=s_});var S5=W(gs=>{"use strict";x();S();var a_=gs&&gs.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(gs,"__esModule",{value:!0});gs.pbkdf2_sha512=void 0;var f_=a_(Mo());function u_(t,e,r,n){return new Promise((i,o)=>f_.default.pbkdf2(t,e,r,n,"sha512",(a,s)=>{a?o(a):i(s)}))}gs.pbkdf2_sha512=u_});var B5=W(ys=>{"use strict";x();S();var c_=ys&&ys.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ys,"__esModule",{value:!0});ys.sha256=void 0;var l_=c_(Mo());async function d_(t){return l_.default.createHash("sha256").update(t).digest()}ys.sha256=d_});var A5=W(ms=>{"use strict";x();S();var h_=ms&&ms.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ms,"__esModule",{value:!0});ms.sha512=void 0;var b_=h_(Mo());async function p_(t){return b_.default.createHash("sha512").update(t).digest()}ms.sha512=p_});var vs=W(Fr=>{"use strict";x();S();Object.defineProperty(Fr,"__esModule",{value:!0});Fr.sha512=Fr.sha256=Fr.pbkdf2_sha512=Fr.hmac_sha512=Fr.getSecureRandomWords=Fr.getSecureRandomBytes=void 0;var M5=_5();Object.defineProperty(Fr,"getSecureRandomBytes",{enumerable:!0,get:function(){return M5.getSecureRandomBytes}});Object.defineProperty(Fr,"getSecureRandomWords",{enumerable:!0,get:function(){return M5.getSecureRandomWords}});var g_=x5();Object.defineProperty(Fr,"hmac_sha512",{enumerable:!0,get:function(){return g_.hmac_sha512}});var y_=S5();Object.defineProperty(Fr,"pbkdf2_sha512",{enumerable:!0,get:function(){return y_.pbkdf2_sha512}});var m_=B5();Object.defineProperty(Fr,"sha256",{enumerable:!0,get:function(){return m_.sha256}});var v_=A5();Object.defineProperty(Fr,"sha512",{enumerable:!0,get:function(){return v_.sha512}})});var I5=W(Hn=>{"use strict";x();S();var w_=Hn&&Hn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Hn,"__esModule",{value:!0});Hn.sha256=Hn.sha256_fallback=Hn.sha256_sync=void 0;var __=w_(ju()),x_=vs();function E5(t){let e;typeof t=="string"?e=v.Buffer.from(t,"utf-8").toString("hex"):e=t.toString("hex");let r=new __.default("SHA-256","HEX");r.update(e);let n=r.getHash("HEX");return v.Buffer.from(n,"hex")}Hn.sha256_sync=E5;async function S_(t){return E5(t)}Hn.sha256_fallback=S_;function B_(t){return(0,x_.sha256)(t)}Hn.sha256=B_});var T5=W(Kn=>{"use strict";x();S();var A_=Kn&&Kn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Kn,"__esModule",{value:!0});Kn.sha512=Kn.sha512_fallback=Kn.sha512_sync=void 0;var M_=A_(ju()),E_=vs();function P5(t){let e;typeof t=="string"?e=v.Buffer.from(t,"utf-8").toString("hex"):e=t.toString("hex");let r=new M_.default("SHA-512","HEX");r.update(e);let n=r.getHash("HEX");return v.Buffer.from(n,"hex")}Kn.sha512_sync=P5;async function I_(t){return P5(t)}Kn.sha512_fallback=I_;async function P_(t){return(0,E_.sha512)(t)}Kn.sha512=P_});var O5=W(Hu=>{"use strict";x();S();Object.defineProperty(Hu,"__esModule",{value:!0});Hu.pbkdf2_sha512=void 0;var T_=vs();function O_(t,e,r,n){return(0,T_.pbkdf2_sha512)(t,e,r,n)}Hu.pbkdf2_sha512=O_});var C5=W(Hi=>{"use strict";x();S();var C_=Hi&&Hi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Hi,"__esModule",{value:!0});Hi.hmac_sha512=Hi.hmac_sha512_fallback=void 0;var k_=C_(ju()),U_=vs();async function q_(t,e){let r=typeof t=="string"?v.Buffer.from(t,"utf-8"):t,n=typeof e=="string"?v.Buffer.from(e,"utf-8"):e,i=new k_.default("SHA-512","HEX",{hmacKey:{value:r.toString("hex"),format:"HEX"}});i.update(n.toString("hex"));let o=i.getHash("HEX");return v.Buffer.from(o,"hex")}Hi.hmac_sha512_fallback=q_;function R_(t,e){return(0,U_.hmac_sha512)(t,e)}Hi.hmac_sha512=R_});var q5=W(Ki=>{"use strict";x();S();Object.defineProperty(Ki,"__esModule",{value:!0});Ki.getSecureRandomNumber=Ki.getSecureRandomWords=Ki.getSecureRandomBytes=void 0;var N_=vs();async function k5(t){return(0,N_.getSecureRandomBytes)(t)}Ki.getSecureRandomBytes=k5;async function U5(t){return U5(t)}Ki.getSecureRandomWords=U5;async function L_(t,e){let r=e-t;var n=Math.ceil(Math.log2(r));if(n>53)throw new Error("Range is too large");for(var i=Math.ceil(n/8),o=Math.pow(2,n)-1;;){let s=await k5(n),u=(i-1)*8,h=0;for(var a=0;a<i;a++)h+=s[a]*Math.pow(2,u),u-=8;if(h=h&o,!(h>=r))return t+h}}Ki.getSecureRandomNumber=L_});var yd=W(kr=>{"use strict";x();S();var j_=kr&&kr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(kr,"__esModule",{value:!0});kr.openBox=kr.sealBox=kr.signVerify=kr.sign=kr.keyPairFromSeed=kr.keyPairFromSecretKey=void 0;var ws=j_(M0());function H_(t){let e=ws.default.sign.keyPair.fromSecretKey(new Uint8Array(t));return{publicKey:v.Buffer.from(e.publicKey),secretKey:v.Buffer.from(e.secretKey)}}kr.keyPairFromSecretKey=H_;function K_(t){let e=ws.default.sign.keyPair.fromSeed(new Uint8Array(t));return{publicKey:v.Buffer.from(e.publicKey),secretKey:v.Buffer.from(e.secretKey)}}kr.keyPairFromSeed=K_;function D_(t,e){return v.Buffer.from(ws.default.sign.detached(new Uint8Array(t),new Uint8Array(e)))}kr.sign=D_;function V_(t,e,r){return ws.default.sign.detached.verify(new Uint8Array(t),new Uint8Array(e),new Uint8Array(r))}kr.signVerify=V_;function F_(t,e,r){return v.Buffer.from(ws.default.secretbox(t,e,r))}kr.sealBox=F_;function z_(t,e,r){let n=ws.default.secretbox.open(t,e,r);return n?v.Buffer.from(n):null}kr.openBox=z_});var Za=W(_t=>{"use strict";x();S();Object.defineProperty(_t,"__esModule",{value:!0});_t.signVerify=_t.sign=_t.keyPairFromSecretKey=_t.keyPairFromSeed=_t.openBox=_t.sealBox=_t.getSecureRandomNumber=_t.getSecureRandomWords=_t.getSecureRandomBytes=_t.hmac_sha512=_t.pbkdf2_sha512=_t.sha512_sync=_t.sha512=_t.sha256_sync=_t.sha256=void 0;var R5=I5();Object.defineProperty(_t,"sha256",{enumerable:!0,get:function(){return R5.sha256}});Object.defineProperty(_t,"sha256_sync",{enumerable:!0,get:function(){return R5.sha256_sync}});var N5=T5();Object.defineProperty(_t,"sha512",{enumerable:!0,get:function(){return N5.sha512}});Object.defineProperty(_t,"sha512_sync",{enumerable:!0,get:function(){return N5.sha512_sync}});var W_=O5();Object.defineProperty(_t,"pbkdf2_sha512",{enumerable:!0,get:function(){return W_.pbkdf2_sha512}});var $_=C5();Object.defineProperty(_t,"hmac_sha512",{enumerable:!0,get:function(){return $_.hmac_sha512}});var md=q5();Object.defineProperty(_t,"getSecureRandomBytes",{enumerable:!0,get:function(){return md.getSecureRandomBytes}});Object.defineProperty(_t,"getSecureRandomWords",{enumerable:!0,get:function(){return md.getSecureRandomWords}});Object.defineProperty(_t,"getSecureRandomNumber",{enumerable:!0,get:function(){return md.getSecureRandomNumber}});var L5=yd();Object.defineProperty(_t,"sealBox",{enumerable:!0,get:function(){return L5.sealBox}});Object.defineProperty(_t,"openBox",{enumerable:!0,get:function(){return L5.openBox}});var Ku=yd();Object.defineProperty(_t,"keyPairFromSeed",{enumerable:!0,get:function(){return Ku.keyPairFromSeed}});Object.defineProperty(_t,"keyPairFromSecretKey",{enumerable:!0,get:function(){return Ku.keyPairFromSecretKey}});Object.defineProperty(_t,"sign",{enumerable:!0,get:function(){return Ku.sign}});Object.defineProperty(_t,"signVerify",{enumerable:!0,get:function(){return Ku.signVerify}})});var j5=W(Du=>{"use strict";x();S();Object.defineProperty(Du,"__esModule",{value:!0});Du.wonderCalculator=void 0;var G_=ni(),Dn=us(),Ya=ku(),Z_=qu(),Y_=Wa(),X_=bd(),Q_=Za(),J_=Ou(),ex=hd();function tx(t,e,r){let n,i=null;if(t===Dn.CellType.Ordinary){let M=0;for(let A of r)M=M|A.mask.value;n=new Ya.LevelMask(M)}else if(t===Dn.CellType.PrunedBranch)i=(0,Z_.exoticPruned)(e,r),n=new Ya.LevelMask(i.mask);else if(t===Dn.CellType.MerkleProof){let M=(0,Y_.exoticMerkleProof)(e,r);n=new Ya.LevelMask(r[0].mask.value>>1)}else if(t===Dn.CellType.MerkleUpdate){let M=(0,J_.exoticMerkleUpdate)(e,r);n=new Ya.LevelMask((r[0].mask.value|r[1].mask.value)>>1)}else if(t===Dn.CellType.Library){let M=(0,ex.exoticLibrary)(e,r);n=new Ya.LevelMask}else throw new Error("Unsupported exotic type");let o=[],a=[],s=t===Dn.CellType.PrunedBranch?1:n.hashCount,h=n.hashCount-s;for(let M=0,A=0;M<=n.level;M++){if(!n.isSignificant(M))continue;if(A<h){A++;continue}let P;if(A===h){if(!(M===0||t===Dn.CellType.PrunedBranch))throw Error("Invalid");P=e}else{if(!(M!==0&&t!==Dn.CellType.PrunedBranch))throw Error("Invalid: "+M+", "+t);P=new G_.BitString(a[A-h-1],0,256)}let E=0;for(let $ of r){let ee;t==Dn.CellType.MerkleProof||t==Dn.CellType.MerkleUpdate?ee=$.depth(M+1):ee=$.depth(M),E=Math.max(E,ee)}r.length>0&&E++;let q=(0,X_.getRepr)(e,P,r,M,n.apply(M).value,t),z=(0,Q_.sha256_sync)(q),J=A-h;o[J]=E,a[J]=z,A++}let w=[],p=[];if(i)for(let M=0;M<4;M++){let{hashIndex:A}=n.apply(M),{hashIndex:P}=n;A!==P?(w.push(i.pruned[A].hash),p.push(i.pruned[A].depth)):(w.push(a[0]),p.push(o[0]))}else for(let M=0;M<4;M++)w.push(a[n.apply(M).hashIndex]),p.push(o[n.apply(M).hashIndex]);return{mask:n,hashes:w,depths:p}}Du.wonderCalculator=tx});var H5=W(Vu=>{"use strict";x();S();Object.defineProperty(Vu,"__esModule",{value:!0});Vu.topologicalSort=void 0;function rx(t){let e=[t],r=new Map,n=new Set,i=[];for(;e.length>0;){let h=[...e];e=[];for(let w of h){let p=w.hash().toString("hex");if(!r.has(p)){n.add(p),r.set(p,{cell:w,refs:w.refs.map(M=>M.hash().toString("hex"))});for(let M of w.refs)e.push(M)}}}let o=new Set;function a(h){if(!n.has(h))return;if(o.has(h))throw Error("Not a DAG");o.add(h);let w=r.get(h).refs;for(let p=w.length-1;p>=0;p--)a(w[p]);i.push(h),o.delete(h),n.delete(h)}for(;n.size>0;){let h=Array.from(n)[0];a(h)}let s=new Map;for(let h=0;h<i.length;h++)s.set(i[i.length-h-1],h);let u=[];for(let h=i.length-1;h>=0;h--){let w=i[h],p=r.get(w);u.push({cell:p.cell,refs:p.refs.map(M=>s.get(M))})}return u}Vu.topologicalSort=rx});var K5=W(Fu=>{"use strict";x();S();Object.defineProperty(Fu,"__esModule",{value:!0});Fu.bitsForNumber=void 0;function nx(t,e){let r=BigInt(t);if(e==="int")return r===0n||r===-1n?1:(r>0?r:-r).toString(2).length+1;if(e==="uint"){if(r<0)throw Error(`value is negative. Got ${t}`);return r.toString(2).length}else throw Error(`invalid mode. Got ${e}`)}Fu.bitsForNumber=nx});var vd=W(zu=>{"use strict";x();S();Object.defineProperty(zu,"__esModule",{value:!0});zu.crc32c=void 0;var Di=2197175160;function ix(t){let e=-1;for(let n=0;n<t.length;n++)e^=t[n],e=e&1?e>>>1^Di:e>>>1,e=e&1?e>>>1^Di:e>>>1,e=e&1?e>>>1^Di:e>>>1,e=e&1?e>>>1^Di:e>>>1,e=e&1?e>>>1^Di:e>>>1,e=e&1?e>>>1^Di:e>>>1,e=e&1?e>>>1^Di:e>>>1,e=e&1?e>>>1^Di:e>>>1;e=e^4294967295;let r=v.Buffer.alloc(4);return r.writeInt32LE(e),r}zu.crc32c=ix});var $5=W(Vi=>{"use strict";x();S();Object.defineProperty(Vi,"__esModule",{value:!0});Vi.serializeBoc=Vi.deserializeBoc=Vi.parseBoc=void 0;var z5=oi(),_d=ni(),ox=Ri(),sx=H5(),D5=K5(),ax=Va(),V5=bd(),fx=Da(),wd=vd();function F5(t){return ux(t&7)}function ux(t){let e=0;for(let r=0;r<3;r++)e+=t&1,t=t>>1;return e+1}function cx(t,e){let r=t.loadUint(8),n=r%8,i=!!(r&8),o=t.loadUint(8),a=Math.ceil(o/2),s=!!(o%2),u=r>>5,h=(r&16)!=0,w=32,p=h?F5(u)*w:0,M=h?F5(u)*2:0;t.skip(p*8),t.skip(M*8);let A=_d.BitString.EMPTY;a>0&&(s?A=t.loadPaddedBits(a*8):A=t.loadBits(a*8));let P=[];for(let E=0;E<n;E++)P.push(t.loadUint(e*8));return{bits:A,refs:P,exotic:i}}function lx(t,e){return 2+Math.ceil(t.bits.length/8)+t.refs.length*e}function W5(t){let e=new z5.BitReader(new _d.BitString(t,0,t.length*8)),r=e.loadUint(32);if(r===1761568243){let n=e.loadUint(8),i=e.loadUint(8),o=e.loadUint(n*8),a=e.loadUint(n*8),s=e.loadUint(n*8),u=e.loadUint(i*8),h=e.loadBuffer(o*i),w=e.loadBuffer(u);return{size:n,offBytes:i,cells:o,roots:a,absent:s,totalCellSize:u,index:h,cellData:w,root:[0]}}else if(r===2898503464){let n=e.loadUint(8),i=e.loadUint(8),o=e.loadUint(n*8),a=e.loadUint(n*8),s=e.loadUint(n*8),u=e.loadUint(i*8),h=e.loadBuffer(o*i),w=e.loadBuffer(u),p=e.loadBuffer(4);if(!(0,wd.crc32c)(t.subarray(0,t.length-4)).equals(p))throw Error("Invalid CRC32C");return{size:n,offBytes:i,cells:o,roots:a,absent:s,totalCellSize:u,index:h,cellData:w,root:[0]}}else if(r===3052313714){let n=e.loadUint(1),i=e.loadUint(1),o=e.loadUint(1),a=e.loadUint(2),s=e.loadUint(3),u=e.loadUint(8),h=e.loadUint(s*8),w=e.loadUint(s*8),p=e.loadUint(s*8),M=e.loadUint(u*8),A=[];for(let q=0;q<w;q++)A.push(e.loadUint(s*8));let P=null;n&&(P=e.loadBuffer(h*u));let E=e.loadBuffer(M);if(i){let q=e.loadBuffer(4);if(!(0,wd.crc32c)(t.subarray(0,t.length-4)).equals(q))throw Error("Invalid CRC32C")}return{size:s,offBytes:u,cells:h,roots:w,absent:p,totalCellSize:M,index:P,cellData:E,root:A}}else throw Error("Invalid magic")}Vi.parseBoc=W5;function dx(t){let e=W5(t),r=new z5.BitReader(new _d.BitString(e.cellData,0,e.cellData.length*8)),n=[];for(let o=0;o<e.cells;o++){let a=cx(r,e.size);n.push({...a,result:null})}for(let o=n.length-1;o>=0;o--){if(n[o].result)throw Error("Impossible");let a=[];for(let s of n[o].refs){if(!n[s].result)throw Error("Invalid BOC file");a.push(n[s].result)}n[o].result=new ox.Cell({bits:n[o].bits,refs:a,exotic:n[o].exotic})}let i=[];for(let o=0;o<e.root.length;o++)i.push(n[e.root[o]].result);return i}Vi.deserializeBoc=dx;function hx(t,e,r,n){let i=(0,V5.getRefsDescriptor)(t.refs,t.mask.value,t.type),o=(0,V5.getBitsDescriptor)(t.bits);n.writeUint(i,8),n.writeUint(o,8),n.writeBuffer((0,fx.bitsToPaddedBuffer)(t.bits));for(let a of e)n.writeUint(a,r*8)}function bx(t,e){let r=(0,sx.topologicalSort)(t),n=r.length,i=e.idx,o=e.crc32,a=!1,s=0,u=Math.max(Math.ceil((0,D5.bitsForNumber)(n,"uint")/8),1),h=0,w=[];for(let E of r){let q=lx(E.cell,u);h+=q,w.push(h)}let p=Math.max(Math.ceil((0,D5.bitsForNumber)(h,"uint")/8),1),M=(4+1+1+3*u+p+1*u+(i?n*p:0)+h+(o?4:0))*8,A=new ax.BitBuilder(M);if(A.writeUint(3052313714,32),A.writeBit(i),A.writeBit(o),A.writeBit(a),A.writeUint(s,2),A.writeUint(u,3),A.writeUint(p,8),A.writeUint(n,u*8),A.writeUint(1,u*8),A.writeUint(0,u*8),A.writeUint(h,p*8),A.writeUint(0,u*8),i)for(let E=0;E<n;E++)A.writeUint(w[E],p*8);for(let E=0;E<n;E++)hx(r[E].cell,r[E].refs,u,A);if(o){let E=(0,wd.crc32c)(A.buffer());A.writeBuffer(E)}let P=A.buffer();if(P.length!==M/8)throw Error("Internal error");return P}Vi.serializeBoc=bx});var Ri=W(_s=>{"use strict";x();S();var px=_s&&_s.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},Y5;Object.defineProperty(_s,"__esModule",{value:!0});_s.Cell=void 0;var gx=px(vo()),yx=ni(),wo=us(),mx=Iu(),vx=y5(),G5=j5(),Z5=$5(),wx=oi(),_x=Qt(),_o=class{static fromBoc(e){return(0,Z5.deserializeBoc)(e)}static fromBase64(e){let r=_o.fromBoc(v.Buffer.from(e,"base64"));if(r.length!==1)throw new Error("Deserialized more than one cell");return r[0]}constructor(e){this._hashes=[],this._depths=[],this.beginParse=(u=!1)=>{if(this.isExotic&&!u)throw new Error("Exotic cells cannot be parsed");return new mx.Slice(new wx.BitReader(this.bits),this.refs)},this.hash=(u=3)=>this._hashes[Math.min(this._hashes.length-1,u)],this.depth=(u=3)=>this._depths[Math.min(this._depths.length-1,u)],this.level=()=>this.mask.level,this.equals=u=>this.hash().equals(u.hash()),this[Y5]=()=>this.toString();let r=yx.BitString.EMPTY;e&&e.bits&&(r=e.bits);let n=[];e&&e.refs&&(n=[...e.refs]);let i,o,a,s=wo.CellType.Ordinary;if(e&&e.exotic){let u=(0,vx.resolveExotic)(r,n),h=(0,G5.wonderCalculator)(u.type,r,n);a=h.mask,o=h.depths,i=h.hashes,s=u.type}else{if(n.length>4)throw new Error("Invalid number of references");if(r.length>1023)throw new Error(`Bits overflow: ${r.length} > 1023`);let u=(0,G5.wonderCalculator)(wo.CellType.Ordinary,r,n);a=u.mask,o=u.depths,i=u.hashes,s=wo.CellType.Ordinary}this.type=s,this.bits=r,this.refs=n,this.mask=a,this._depths=o,this._hashes=i,Object.freeze(this),Object.freeze(this.refs),Object.freeze(this.bits),Object.freeze(this.mask),Object.freeze(this._depths),Object.freeze(this._hashes)}get isExotic(){return this.type!==wo.CellType.Ordinary}toBoc(e){let r=e&&e.idx!==null&&e.idx!==void 0?e.idx:!1,n=e&&e.crc32!==null&&e.crc32!==void 0?e.crc32:!0;return(0,Z5.serializeBoc)(this,{idx:r,crc32:n})}toString(e){let r=e||"",n="x";this.isExotic&&(this.type===wo.CellType.MerkleProof?n="p":this.type===wo.CellType.MerkleUpdate?n="u":this.type===wo.CellType.PrunedBranch&&(n="p"));let i=r+(this.isExotic?n:"x")+"{"+this.bits.toString()+"}";for(let o in this.refs){let a=this.refs[o];i+=`
|
||
`+a.toString(r+" ")}return i}asSlice(){return this.beginParse()}asBuilder(){return(0,_x.beginCell)().storeSlice(this.asSlice())}};_s.Cell=_o;Y5=gx.default;_o.EMPTY=new _o});var Qt=W(Ss=>{"use strict";x();S();Object.defineProperty(Ss,"__esModule",{value:!0});Ss.Builder=Ss.beginCell=void 0;var xx=Va(),X5=Ri(),Q5=dd();function J5(){return new xs}Ss.beginCell=J5;var xs=class{constructor(){this._bits=new xx.BitBuilder,this._refs=[]}get bits(){return this._bits.length}get refs(){return this._refs.length}get availableBits(){return 1023-this.bits}get availableRefs(){return 4-this.refs}storeBit(e){return this._bits.writeBit(e),this}storeBits(e){return this._bits.writeBits(e),this}storeBuffer(e,r){if(r!=null&&e.length!==r)throw Error(`Buffer length ${e.length} is not equal to ${r}`);return this._bits.writeBuffer(e),this}storeMaybeBuffer(e,r){return e!==null?(this.storeBit(1),this.storeBuffer(e,r)):this.storeBit(0),this}storeUint(e,r){return this._bits.writeUint(e,r),this}storeMaybeUint(e,r){return e!=null?(this.storeBit(1),this.storeUint(e,r)):this.storeBit(0),this}storeInt(e,r){return this._bits.writeInt(e,r),this}storeMaybeInt(e,r){return e!=null?(this.storeBit(1),this.storeInt(e,r)):this.storeBit(0),this}storeVarUint(e,r){return this._bits.writeVarUint(e,r),this}storeMaybeVarUint(e,r){return e!=null?(this.storeBit(1),this.storeVarUint(e,r)):this.storeBit(0),this}storeVarInt(e,r){return this._bits.writeVarInt(e,r),this}storeMaybeVarInt(e,r){return e!=null?(this.storeBit(1),this.storeVarInt(e,r)):this.storeBit(0),this}storeCoins(e){return this._bits.writeCoins(e),this}storeMaybeCoins(e){return e!=null?(this.storeBit(1),this.storeCoins(e)):this.storeBit(0),this}storeAddress(e){return this._bits.writeAddress(e),this}storeRef(e){if(this._refs.length>=4)throw new Error("Too many references");if(e instanceof X5.Cell)this._refs.push(e);else if(e instanceof xs)this._refs.push(e.endCell());else throw new Error("Invalid argument");return this}storeMaybeRef(e){return e?(this.storeBit(1),this.storeRef(e)):this.storeBit(0),this}storeSlice(e){let r=e.clone();for(r.remainingBits>0&&this.storeBits(r.loadBits(r.remainingBits));r.remainingRefs>0;)this.storeRef(r.loadRef());return this}storeMaybeSlice(e){return e?(this.storeBit(1),this.storeSlice(e)):this.storeBit(0),this}storeBuilder(e){return this.storeSlice(e.endCell().beginParse())}storeMaybeBuilder(e){return e?(this.storeBit(1),this.storeBuilder(e)):this.storeBit(0),this}storeWritable(e){return typeof e=="object"?e.writeTo(this):e(this),this}storeMaybeWritable(e){return e?(this.storeBit(1),this.storeWritable(e)):this.storeBit(0),this}store(e){return this.storeWritable(e),this}storeStringTail(e){return(0,Q5.writeString)(e,this),this}storeMaybeStringTail(e){return e!=null?(this.storeBit(1),(0,Q5.writeString)(e,this)):this.storeBit(0),this}storeStringRefTail(e){return this.storeRef(J5().storeStringTail(e)),this}storeMaybeStringRefTail(e){return e!=null?(this.storeBit(1),this.storeStringRefTail(e)):this.storeBit(0),this}storeDict(e,r,n){return e?e.store(this,r,n):this.storeBit(0),this}storeDictDirect(e,r,n){return e.storeDirect(this,r,n),this}endCell(e){return new X5.Cell({bits:this._bits.build(),refs:this._refs,exotic:e?.exotic})}asCell(){return this.endCell()}asSlice(){return this.endCell().beginParse()}};Ss.Builder=xs});var xd=W(Fi=>{"use strict";x();S();Object.defineProperty(Fi,"__esModule",{value:!0});Fi.SimpleLibraryValue=Fi.storeSimpleLibrary=Fi.loadSimpleLibrary=void 0;function ep(t){return{public:t.loadBit(),root:t.loadRef()}}Fi.loadSimpleLibrary=ep;function tp(t){return e=>{e.storeBit(t.public),e.storeRef(t.root)}}Fi.storeSimpleLibrary=tp;Fi.SimpleLibraryValue={serialize(t,e){tp(t)(e)},parse(t){return ep(t)}}});var Sd=W(Bs=>{"use strict";x();S();Object.defineProperty(Bs,"__esModule",{value:!0});Bs.storeTickTock=Bs.loadTickTock=void 0;function Sx(t){return{tick:t.loadBit(),tock:t.loadBit()}}Bs.loadTickTock=Sx;function Bx(t){return e=>{e.storeBit(t.tick),e.storeBit(t.tock)}}Bs.storeTickTock=Bx});var Ms=W(As=>{"use strict";x();S();Object.defineProperty(As,"__esModule",{value:!0});As.storeStateInit=As.loadStateInit=void 0;var Ax=qi(),Mx=xd(),rp=Sd();function Ex(t){let e;t.loadBit()&&(e=t.loadUint(5));let r;t.loadBit()&&(r=(0,rp.loadTickTock)(t));let n=t.loadMaybeRef(),i=t.loadMaybeRef(),o=t.loadDict(Ax.Dictionary.Keys.BigUint(256),Mx.SimpleLibraryValue);return o.size===0&&(o=void 0),{splitDepth:e,special:r,code:n,data:i,libraries:o}}As.loadStateInit=Ex;function Ix(t){return e=>{t.splitDepth!==null&&t.splitDepth!==void 0?(e.storeBit(!0),e.storeUint(t.splitDepth,5)):e.storeBit(!1),t.special!==null&&t.special!==void 0?(e.storeBit(!0),e.store((0,rp.storeTickTock)(t.special))):e.storeBit(!1),e.storeMaybeRef(t.code),e.storeMaybeRef(t.data),e.storeDict(t.libraries)}}As.storeStateInit=Ix});var np=W(Wu=>{"use strict";x();S();Object.defineProperty(Wu,"__esModule",{value:!0});Wu.contractAddress=void 0;var Px=Qt(),Tx=Ms(),Ox=ri();function Cx(t,e){let r=(0,Px.beginCell)().store((0,Tx.storeStateInit)(e)).endCell().hash();return new Ox.Address(t,r)}Wu.contractAddress=Cx});var sp=W(Es=>{"use strict";x();S();Object.defineProperty(Es,"__esModule",{value:!0});Es.parseTuple=Es.serializeTuple=void 0;var Qa=Qt(),kx=BigInt("-9223372036854775808"),Ux=BigInt("9223372036854775807");function ip(t,e){if(t.type==="null")e.storeUint(0,8);else if(t.type==="int")t.value<=Ux&&t.value>=kx?(e.storeUint(1,8),e.storeInt(t.value,64)):(e.storeUint(256,15),e.storeInt(t.value,257));else if(t.type==="nan")e.storeInt(767,16);else if(t.type==="cell")e.storeUint(3,8),e.storeRef(t.cell);else if(t.type==="slice")e.storeUint(4,8),e.storeUint(0,10),e.storeUint(t.cell.bits.length,10),e.storeUint(0,3),e.storeUint(t.cell.refs.length,3),e.storeRef(t.cell);else if(t.type==="builder")e.storeUint(5,8),e.storeRef(t.cell);else if(t.type==="tuple"){let r=null,n=null;for(let i=0;i<t.items.length;i++){let o=r;r=n,n=o,i>1&&(r=(0,Qa.beginCell)().storeRef(n).storeRef(r).endCell());let a=(0,Qa.beginCell)();ip(t.items[i],a),n=a.endCell()}e.storeUint(7,8),e.storeUint(t.items.length,16),r&&e.storeRef(r),n&&e.storeRef(n)}else throw Error("Invalid value")}function Xa(t){let e=t.loadUint(8);if(e===0)return{type:"null"};if(e===1)return{type:"int",value:t.loadIntBig(64)};if(e===2)return t.loadUint(7)===0?{type:"int",value:t.loadIntBig(257)}:(t.loadBit(),{type:"nan"});if(e===3)return{type:"cell",cell:t.loadRef()};if(e===4){let r=t.loadUint(10),n=t.loadUint(10),i=t.loadUint(3),o=t.loadUint(3),a=t.loadRef().beginParse();a.skip(r);let s=a.loadBits(n-r),u=(0,Qa.beginCell)().storeBits(s);if(i<o){for(let h=0;h<i;h++)a.loadRef();for(let h=0;h<o-i;h++)u.storeRef(a.loadRef())}return{type:"slice",cell:u.endCell()}}else{if(e===5)return{type:"builder",cell:t.loadRef()};if(e===7){let r=t.loadUint(16),n=[];if(r>1){let i=t.loadRef().beginParse(),o=t.loadRef().beginParse();n.unshift(Xa(o));for(let a=0;a<r-2;a++){let s=i;i=s.loadRef().beginParse(),o=s.loadRef().beginParse(),n.unshift(Xa(o))}n.unshift(Xa(i))}else r===1&&n.push(Xa(t.loadRef().beginParse()));return{type:"tuple",items:n}}else throw Error("Unsupported stack item")}}function op(t,e){if(t.length>0){let r=(0,Qa.beginCell)();op(t.slice(0,t.length-1),r),e.storeRef(r.endCell()),ip(t[t.length-1],e)}}function qx(t){let e=(0,Qa.beginCell)();e.storeUint(t.length,24);let r=[...t];return op(r,e),e.endCell()}Es.serializeTuple=qx;function Rx(t){let e=[],r=t.beginParse(),n=r.loadUint(24);for(let i=0;i<n;i++){let o=r.loadRef();e.unshift(Xa(r)),r=o.beginParse()}return e}Es.parseTuple=Rx});var ap=W($u=>{"use strict";x();S();Object.defineProperty($u,"__esModule",{value:!0});$u.TupleReader=void 0;var zi=class{constructor(e){this.items=[...e]}get remaining(){return this.items.length}peek(){if(this.items.length===0)throw Error("EOF");return this.items[0]}pop(){if(this.items.length===0)throw Error("EOF");let e=this.items[0];return this.items.splice(0,1),e}skip(e=1){for(let r=0;r<e;r++)this.pop();return this}readBigNumber(){let e=this.pop();if(e.type!=="int")throw Error("Not a number");return e.value}readBigNumberOpt(){let e=this.pop();if(e.type==="null")return null;if(e.type!=="int")throw Error("Not a number");return e.value}readNumber(){return Number(this.readBigNumber())}readNumberOpt(){let e=this.readBigNumberOpt();return e!==null?Number(e):null}readBoolean(){return this.readNumber()!==0}readBooleanOpt(){let e=this.readNumberOpt();return e!==null?e!==0:null}readAddress(){let e=this.readCell().beginParse().loadAddress();if(e!==null)return e;throw Error("Not an address")}readAddressOpt(){let e=this.readCellOpt();return e!==null?e.beginParse().loadMaybeAddress():null}readCell(){let e=this.pop();if(e.type!=="cell"&&e.type!=="slice"&&e.type!=="builder")throw Error("Not a cell: "+e.type);return e.cell}readCellOpt(){let e=this.pop();if(e.type==="null")return null;if(e.type!=="cell"&&e.type!=="slice"&&e.type!=="builder")throw Error("Not a cell");return e.cell}readTuple(){let e=this.pop();if(e.type!=="tuple")throw Error("Not a tuple");return new zi(e.items)}readTupleOpt(){let e=this.pop();if(e.type==="null")return null;if(e.type!=="tuple")throw Error("Not a tuple");return new zi(e.items)}static readLispList(e){let r=[],n=e;for(;n!==null;){var i=n.pop();if(n.items.length===0||n.items[0].type!=="tuple"&&n.items[0].type!=="null")throw Error("Lisp list consists only from (any, tuple) elements and ends with null");n=n.readTupleOpt(),r.push(i)}return r}readLispListDirect(){return this.items.length===1&&this.items[0].type==="null"?[]:zi.readLispList(this)}readLispList(){return zi.readLispList(this.readTupleOpt())}readBuffer(){let e=this.readCell().beginParse();if(e.remainingRefs!==0||e.remainingBits%8!==0)throw Error("Not a buffer");return e.loadBuffer(e.remainingBits/8)}readBufferOpt(){if(this.peek().type==="null")return null;let r=this.readCell().beginParse();if(r.remainingRefs!==0||r.remainingBits%8!==0)throw Error("Not a buffer");return r.loadBuffer(r.remainingBits/8)}readString(){return this.readCell().beginParse().loadStringTail()}readStringOpt(){return this.peek().type==="null"?null:this.readCell().beginParse().loadStringTail()}};$u.TupleReader=zi});var fp=W(Gu=>{"use strict";x();S();Object.defineProperty(Gu,"__esModule",{value:!0});Gu.TupleBuilder=void 0;var Bd=Qt(),Ad=Ri(),Md=Iu(),Ed=class{constructor(){this._tuple=[]}writeNumber(e){e==null?this._tuple.push({type:"null"}):this._tuple.push({type:"int",value:BigInt(e)})}writeBoolean(e){e==null?this._tuple.push({type:"null"}):this._tuple.push({type:"int",value:e?-1n:0n})}writeBuffer(e){e==null?this._tuple.push({type:"null"}):this._tuple.push({type:"slice",cell:(0,Bd.beginCell)().storeBuffer(e).endCell()})}writeString(e){e==null?this._tuple.push({type:"null"}):this._tuple.push({type:"slice",cell:(0,Bd.beginCell)().storeStringTail(e).endCell()})}writeCell(e){e==null?this._tuple.push({type:"null"}):e instanceof Ad.Cell?this._tuple.push({type:"cell",cell:e}):e instanceof Md.Slice&&this._tuple.push({type:"cell",cell:e.asCell()})}writeSlice(e){e==null?this._tuple.push({type:"null"}):e instanceof Ad.Cell?this._tuple.push({type:"slice",cell:e}):e instanceof Md.Slice&&this._tuple.push({type:"slice",cell:e.asCell()})}writeBuilder(e){e==null?this._tuple.push({type:"null"}):e instanceof Ad.Cell?this._tuple.push({type:"builder",cell:e}):e instanceof Md.Slice&&this._tuple.push({type:"builder",cell:e.asCell()})}writeTuple(e){e==null?this._tuple.push({type:"null"}):this._tuple.push({type:"tuple",items:e})}writeAddress(e){e==null?this._tuple.push({type:"null"}):this._tuple.push({type:"slice",cell:(0,Bd.beginCell)().storeAddress(e).endCell()})}build(){return[...this._tuple]}};Gu.TupleBuilder=Ed});var Id=W(Is=>{"use strict";x();S();Object.defineProperty(Is,"__esModule",{value:!0});Is.fromNano=Is.toNano=void 0;function Nx(t){if(typeof t=="bigint")return t*1000000000n;{if(typeof t=="number"){if(!Number.isFinite(t))throw Error("Invalid number");if(Math.log10(t)<=6)t=t.toLocaleString("en",{minimumFractionDigits:9,useGrouping:!1});else if(t-Math.trunc(t)===0)t=t.toLocaleString("en",{maximumFractionDigits:0,useGrouping:!1});else throw Error("Not enough precision for a number value. Use string value instead")}let e=!1;for(;t.startsWith("-");)e=!e,t=t.slice(1);if(t===".")throw Error("Invalid number");let r=t.split(".");if(r.length>2)throw Error("Invalid number");let n=r[0],i=r[1];if(n||(n="0"),i||(i="0"),i.length>9)throw Error("Invalid number");for(;i.length<9;)i+="0";let o=BigInt(n)*1000000000n+BigInt(i);return e&&(o=-o),o}}Is.toNano=Nx;function Lx(t){let e=BigInt(t),r=!1;e<0&&(r=!0,e=-e);let i=(e%1000000000n).toString();for(;i.length<9;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];let s=`${(e/1000000000n).toString()}${i==="0"?"":`.${i}`}`;return r&&(s="-"+s),s}Is.fromNano=Lx});var lp=W(Wi=>{"use strict";x();S();Object.defineProperty(Wi,"__esModule",{value:!0});Wi.comment=Wi.external=Wi.internal=void 0;var Zu=ri(),up=Ri(),cp=Qt(),jx=Id();function Hx(t){let e=!0;t.bounce!==null&&t.bounce!==void 0&&(e=t.bounce);let r;if(typeof t.to=="string")r=Zu.Address.parse(t.to);else if(Zu.Address.isAddress(t.to))r=t.to;else throw new Error(`Invalid address ${t.to}`);let n;typeof t.value=="string"?n=(0,jx.toNano)(t.value):n=t.value;let i=up.Cell.EMPTY;return typeof t.body=="string"?i=(0,cp.beginCell)().storeUint(0,32).storeStringTail(t.body).endCell():t.body&&(i=t.body),{info:{type:"internal",dest:r,value:{coins:n},bounce:e,ihrDisabled:!0,bounced:!1,ihrFee:0n,forwardFee:0n,createdAt:0,createdLt:0n},init:t.init??void 0,body:i}}Wi.internal=Hx;function Kx(t){let e;if(typeof t.to=="string")e=Zu.Address.parse(t.to);else if(Zu.Address.isAddress(t.to))e=t.to;else throw new Error(`Invalid address ${t.to}`);return{info:{type:"external-in",dest:e,importFee:0n},init:t.init??void 0,body:t.body||up.Cell.EMPTY}}Wi.external=Kx;function Dx(t){return(0,cp.beginCell)().storeUint(0,32).storeStringTail(t).endCell()}Wi.comment=Dx});var Pd=W(Ps=>{"use strict";x();S();Object.defineProperty(Ps,"__esModule",{value:!0});Ps.storeAccountState=Ps.loadAccountState=void 0;var dp=Ms();function Vx(t){return t.loadBit()?{type:"active",state:(0,dp.loadStateInit)(t)}:t.loadBit()?{type:"frozen",stateHash:t.loadUintBig(256)}:{type:"uninit"}}Ps.loadAccountState=Vx;function Fx(t){return e=>{t.type==="active"?(e.storeBit(!0),e.store((0,dp.storeStateInit)(t.state))):t.type==="frozen"?(e.storeBit(!1),e.storeBit(!0),e.storeUint(t.stateHash,256)):t.type==="uninit"&&(e.storeBit(!1),e.storeBit(!1))}}Ps.storeAccountState=Fx});var ai=W(Ts=>{"use strict";x();S();Object.defineProperty(Ts,"__esModule",{value:!0});Ts.storeCurrencyCollection=Ts.loadCurrencyCollection=void 0;var hp=qi();function zx(t){let e=t.loadCoins(),r=t.loadDict(hp.Dictionary.Keys.Uint(32),hp.Dictionary.Values.BigVarUint(5));return r.size===0?{coins:e}:{other:r,coins:e}}Ts.loadCurrencyCollection=zx;function Wx(t){return e=>{e.storeCoins(t.coins),t.other?e.storeDict(t.other):e.storeBit(0)}}Ts.storeCurrencyCollection=Wx});var Td=W(Os=>{"use strict";x();S();Object.defineProperty(Os,"__esModule",{value:!0});Os.storeAccountStorage=Os.loadAccountStorage=void 0;var bp=Pd(),pp=ai();function $x(t){return{lastTransLt:t.loadUintBig(64),balance:(0,pp.loadCurrencyCollection)(t),state:(0,bp.loadAccountState)(t)}}Os.loadAccountStorage=$x;function Gx(t){return e=>{e.storeUint(t.lastTransLt,64),e.store((0,pp.storeCurrencyCollection)(t.balance)),e.store((0,bp.storeAccountState)(t.state))}}Os.storeAccountStorage=Gx});var Od=W(Cs=>{"use strict";x();S();Object.defineProperty(Cs,"__esModule",{value:!0});Cs.storeStorageUsed=Cs.loadStorageUsed=void 0;function Zx(t){return{cells:t.loadVarUintBig(3),bits:t.loadVarUintBig(3),publicCells:t.loadVarUintBig(3)}}Cs.loadStorageUsed=Zx;function Yx(t){return e=>{e.storeVarUint(t.cells,3),e.storeVarUint(t.bits,3),e.storeVarUint(t.publicCells,3)}}Cs.storeStorageUsed=Yx});var Cd=W(ks=>{"use strict";x();S();Object.defineProperty(ks,"__esModule",{value:!0});ks.storeStorageInfo=ks.loadStorageInfo=void 0;var gp=Od();function Xx(t){return{used:(0,gp.loadStorageUsed)(t),lastPaid:t.loadUint(32),duePayment:t.loadMaybeCoins()}}ks.loadStorageInfo=Xx;function Qx(t){return e=>{e.store((0,gp.storeStorageUsed)(t.used)),e.storeUint(t.lastPaid,32),e.storeMaybeCoins(t.duePayment)}}ks.storeStorageInfo=Qx});var kd=W(Us=>{"use strict";x();S();Object.defineProperty(Us,"__esModule",{value:!0});Us.storeAccount=Us.loadAccount=void 0;var yp=Td(),mp=Cd();function Jx(t){return{addr:t.loadAddress(),storageStats:(0,mp.loadStorageInfo)(t),storage:(0,yp.loadAccountStorage)(t)}}Us.loadAccount=Jx;function eS(t){return e=>{e.storeAddress(t.addr),e.store((0,mp.storeStorageInfo)(t.storageStats)),e.store((0,yp.storeAccountStorage)(t.storage))}}Us.storeAccount=eS});var Ud=W(qs=>{"use strict";x();S();Object.defineProperty(qs,"__esModule",{value:!0});qs.storeAccountStatus=qs.loadAccountStatus=void 0;function tS(t){let e=t.loadUint(2);if(e===0)return"uninitialized";if(e===1)return"frozen";if(e===2)return"active";if(e===3)return"non-existing";throw Error("Invalid data")}qs.loadAccountStatus=tS;function rS(t){return e=>{if(t==="uninitialized")e.storeUint(0,2);else if(t==="frozen")e.storeUint(1,2);else if(t==="active")e.storeUint(2,2);else if(t==="non-existing")e.storeUint(3,2);else throw Error("Invalid data");return e}}qs.storeAccountStatus=rS});var Yu=W(Rs=>{"use strict";x();S();Object.defineProperty(Rs,"__esModule",{value:!0});Rs.storeAccountStatusChange=Rs.loadAccountStatusChange=void 0;function nS(t){return t.loadBit()?t.loadBit()?"deleted":"frozen":"unchanged"}Rs.loadAccountStatusChange=nS;function iS(t){return e=>{if(t=="unchanged")e.storeBit(0);else if(t==="frozen")e.storeBit(1),e.storeBit(0);else if(t==="deleted")e.storeBit(1),e.storeBit(1);else throw Error("Invalid account status change")}}Rs.storeAccountStatusChange=iS});var qd=W(Ns=>{"use strict";x();S();Object.defineProperty(Ns,"__esModule",{value:!0});Ns.storeCommonMessageInfoRelaxed=Ns.loadCommonMessageInfoRelaxed=void 0;var vp=ai();function oS(t){if(!t.loadBit()){let o=t.loadBit(),a=t.loadBit(),s=t.loadBit(),u=t.loadMaybeAddress(),h=t.loadAddress(),w=(0,vp.loadCurrencyCollection)(t),p=t.loadCoins(),M=t.loadCoins(),A=t.loadUintBig(64),P=t.loadUint(32);return{type:"internal",ihrDisabled:o,bounce:a,bounced:s,src:u,dest:h,value:w,ihrFee:p,forwardFee:M,createdLt:A,createdAt:P}}if(!t.loadBit())throw Error("External In message is not possible for CommonMessageInfoRelaxed");let e=t.loadMaybeAddress(),r=t.loadMaybeExternalAddress(),n=t.loadUintBig(64),i=t.loadUint(32);return{type:"external-out",src:e,dest:r,createdLt:n,createdAt:i}}Ns.loadCommonMessageInfoRelaxed=oS;function sS(t){return e=>{if(t.type==="internal")e.storeBit(0),e.storeBit(t.ihrDisabled),e.storeBit(t.bounce),e.storeBit(t.bounced),e.storeAddress(t.src),e.storeAddress(t.dest),e.store((0,vp.storeCurrencyCollection)(t.value)),e.storeCoins(t.ihrFee),e.storeCoins(t.forwardFee),e.storeUint(t.createdLt,64),e.storeUint(t.createdAt,32);else if(t.type==="external-out")e.storeBit(1),e.storeBit(1),e.storeAddress(t.src),e.storeAddress(t.dest),e.storeUint(t.createdLt,64),e.storeUint(t.createdAt,32);else throw new Error("Unknown CommonMessageInfo type")}}Ns.storeCommonMessageInfoRelaxed=sS});var Nd=W(Ls=>{"use strict";x();S();Object.defineProperty(Ls,"__esModule",{value:!0});Ls.storeMessageRelaxed=Ls.loadMessageRelaxed=void 0;var aS=Qt(),wp=qd(),Rd=Ms();function fS(t){let e=(0,wp.loadCommonMessageInfoRelaxed)(t),r=null;t.loadBit()&&(t.loadBit()?r=(0,Rd.loadStateInit)(t.loadRef().beginParse()):r=(0,Rd.loadStateInit)(t));let n=t.loadBit()?t.loadRef():t.asCell();return{info:e,init:r,body:n}}Ls.loadMessageRelaxed=fS;function uS(t,e){return r=>{if(r.store((0,wp.storeCommonMessageInfoRelaxed)(t.info)),t.init){r.storeBit(!0);let i=(0,aS.beginCell)().store((0,Rd.storeStateInit)(t.init)),o=!1;e&&e.forceRef?o=!0:r.availableBits-2>=i.bits?o=!1:o=!0,o?(r.storeBit(!0),r.storeRef(i)):(r.storeBit(!1),r.storeBuilder(i))}else r.storeBit(!1);let n=!1;e&&e.forceRef?n=!0:r.availableBits-1>=t.body.bits.length&&r.refs+t.body.refs.length<=4&&!t.body.isExotic?n=!1:n=!0,n?(r.storeBit(!0),r.storeRef(t.body)):(r.storeBit(!1),r.storeBuilder(t.body.asBuilder()))}}Ls.storeMessageRelaxed=uS});var Mp=W(Vn=>{"use strict";x();S();Object.defineProperty(Vn,"__esModule",{value:!0});Vn.loadOutList=Vn.storeOutList=Vn.loadOutAction=Vn.storeOutAction=void 0;var _p=Nd(),Ld=Qt();function xp(t){switch(t.type){case"sendMsg":return cS(t);case"setCode":return lS(t);default:throw new Error(`Unknown action type ${t.type}`)}}Vn.storeOutAction=xp;var Sp=247711853;function cS(t){return e=>{e.storeUint(Sp,32).storeUint(t.mode,8).storeRef((0,Ld.beginCell)().store((0,_p.storeMessageRelaxed)(t.outMsg)).endCell())}}var Bp=2907562126;function lS(t){return e=>{e.storeUint(Bp,32).storeRef(t.newCode)}}function Ap(t){let e=t.loadUint(32);if(e===Sp){let r=t.loadUint(8),n=(0,_p.loadMessageRelaxed)(t.loadRef().beginParse());return{type:"sendMsg",mode:r,outMsg:n}}if(e===Bp)return{type:"setCode",newCode:t.loadRef()};throw new Error(`Unknown out action tag 0x${e.toString(16)}`)}Vn.loadOutAction=Ap;function dS(t){let e=t.reduce((r,n)=>(0,Ld.beginCell)().storeRef(r).store(xp(n)).endCell(),(0,Ld.beginCell)().endCell());return r=>{r.storeSlice(e.beginParse())}}Vn.storeOutList=dS;function hS(t){let e=[];for(;t.remainingRefs;){let r=t.loadRef();e.push(Ap(t)),t=r.beginParse()}return e.reverse()}Vn.loadOutList=hS});var jd=W(js=>{"use strict";x();S();Object.defineProperty(js,"__esModule",{value:!0});js.storeCommonMessageInfo=js.loadCommonMessageInfo=void 0;var Ep=ai();function bS(t){if(!t.loadBit()){let o=t.loadBit(),a=t.loadBit(),s=t.loadBit(),u=t.loadAddress(),h=t.loadAddress(),w=(0,Ep.loadCurrencyCollection)(t),p=t.loadCoins(),M=t.loadCoins(),A=t.loadUintBig(64),P=t.loadUint(32);return{type:"internal",ihrDisabled:o,bounce:a,bounced:s,src:u,dest:h,value:w,ihrFee:p,forwardFee:M,createdLt:A,createdAt:P}}if(!t.loadBit()){let o=t.loadMaybeExternalAddress(),a=t.loadAddress(),s=t.loadCoins();return{type:"external-in",src:o,dest:a,importFee:s}}let e=t.loadAddress(),r=t.loadMaybeExternalAddress(),n=t.loadUintBig(64),i=t.loadUint(32);return{type:"external-out",src:e,dest:r,createdLt:n,createdAt:i}}js.loadCommonMessageInfo=bS;function pS(t){return e=>{if(t.type==="internal")e.storeBit(0),e.storeBit(t.ihrDisabled),e.storeBit(t.bounce),e.storeBit(t.bounced),e.storeAddress(t.src),e.storeAddress(t.dest),e.store((0,Ep.storeCurrencyCollection)(t.value)),e.storeCoins(t.ihrFee),e.storeCoins(t.forwardFee),e.storeUint(t.createdLt,64),e.storeUint(t.createdAt,32);else if(t.type==="external-in")e.storeBit(1),e.storeBit(0),e.storeAddress(t.src),e.storeAddress(t.dest),e.storeCoins(t.importFee);else if(t.type==="external-out")e.storeBit(1),e.storeBit(1),e.storeAddress(t.src),e.storeAddress(t.dest),e.storeUint(t.createdLt,64),e.storeUint(t.createdAt,32);else throw new Error("Unknown CommonMessageInfo type")}}js.storeCommonMessageInfo=pS});var Hd=W(Hs=>{"use strict";x();S();Object.defineProperty(Hs,"__esModule",{value:!0});Hs.storeComputeSkipReason=Hs.loadComputeSkipReason=void 0;function gS(t){let e=t.loadUint(2);if(e===0)return"no-state";if(e===1)return"bad-state";if(e===2)return"no-gas";throw new Error(`Unknown ComputeSkipReason: ${e}`)}Hs.loadComputeSkipReason=gS;function yS(t){return e=>{if(t==="no-state")e.storeUint(0,2);else if(t==="bad-state")e.storeUint(1,2);else if(t==="no-gas")e.storeUint(2,2);else throw new Error(`Unknown ComputeSkipReason: ${t}`)}}Hs.storeComputeSkipReason=yS});var Kd=W(Ks=>{"use strict";x();S();Object.defineProperty(Ks,"__esModule",{value:!0});Ks.storeDepthBalanceInfo=Ks.loadDepthBalanceInfo=void 0;var Ip=ai();function mS(t){return{splitDepth:t.loadUint(5),balance:(0,Ip.loadCurrencyCollection)(t)}}Ks.loadDepthBalanceInfo=mS;function vS(t){return e=>{e.storeUint(t.splitDepth,5),e.store((0,Ip.storeCurrencyCollection)(t.balance))}}Ks.storeDepthBalanceInfo=vS});var Dd=W(Ds=>{"use strict";x();S();Object.defineProperty(Ds,"__esModule",{value:!0});Ds.storeHashUpdate=Ds.loadHashUpdate=void 0;function wS(t){if(t.loadUint(8)!==114)throw Error("Invalid data");let e=t.loadBuffer(32),r=t.loadBuffer(32);return{oldHash:e,newHash:r}}Ds.loadHashUpdate=wS;function _S(t){return e=>{e.storeUint(114,8),e.storeBuffer(t.oldHash),e.storeBuffer(t.newHash)}}Ds.storeHashUpdate=_S});var Fd=W(Xu=>{"use strict";x();S();Object.defineProperty(Xu,"__esModule",{value:!0});Xu.loadMasterchainStateExtra=void 0;var Vd=qi(),xS=ai();function SS(t){if(t.loadUint(16)!==52262)throw Error("Invalid data");t.loadBit()&&t.loadRef();let e=t.loadUintBig(256),r=Vd.Dictionary.load(Vd.Dictionary.Keys.Int(32),Vd.Dictionary.Values.Cell(),t),n=(0,xS.loadCurrencyCollection)(t);return{config:r,configAddress:e,globalBalance:n}}Xu.loadMasterchainStateExtra=SS});var Wd=W($i=>{"use strict";x();S();Object.defineProperty($i,"__esModule",{value:!0});$i.MessageValue=$i.storeMessage=$i.loadMessage=void 0;var Pp=Qt(),Tp=jd(),zd=Ms();function Op(t){let e=(0,Tp.loadCommonMessageInfo)(t),r=null;t.loadBit()&&(t.loadBit()?r=(0,zd.loadStateInit)(t.loadRef().beginParse()):r=(0,zd.loadStateInit)(t));let n=t.loadBit()?t.loadRef():t.asCell();return{info:e,init:r,body:n}}$i.loadMessage=Op;function Cp(t,e){return r=>{if(r.store((0,Tp.storeCommonMessageInfo)(t.info)),t.init){r.storeBit(!0);let i=(0,Pp.beginCell)().store((0,zd.storeStateInit)(t.init)),o=!1;e&&e.forceRef?o=!0:o=r.availableBits-2<i.bits+t.body.bits.length,o?(r.storeBit(!0),r.storeRef(i)):(r.storeBit(!1),r.storeBuilder(i))}else r.storeBit(!1);let n=!1;e&&e.forceRef?n=!0:n=r.availableBits-1<t.body.bits.length||r.refs+t.body.refs.length>4,n?(r.storeBit(!0),r.storeRef(t.body)):(r.storeBit(!1),r.storeBuilder(t.body.asBuilder()))}}$i.storeMessage=Cp;$i.MessageValue={serialize(t,e){e.storeRef((0,Pp.beginCell)().store(Cp(t)))},parse(t){return Op(t.loadRef().beginParse())}}});var kp=W(Ja=>{"use strict";x();S();Object.defineProperty(Ja,"__esModule",{value:!0});Ja.SendMode=void 0;var BS;(function(t){t[t.CARRY_ALL_REMAINING_BALANCE=128]="CARRY_ALL_REMAINING_BALANCE",t[t.CARRY_ALL_REMAINING_INCOMING_VALUE=64]="CARRY_ALL_REMAINING_INCOMING_VALUE",t[t.DESTROY_ACCOUNT_IF_ZERO=32]="DESTROY_ACCOUNT_IF_ZERO",t[t.PAY_GAS_SEPARATELY=1]="PAY_GAS_SEPARATELY",t[t.IGNORE_ERRORS=2]="IGNORE_ERRORS",t[t.NONE=0]="NONE"})(BS=Ja.SendMode||(Ja.SendMode={}))});var $d=W(Vs=>{"use strict";x();S();Object.defineProperty(Vs,"__esModule",{value:!0});Vs.storeShardAccount=Vs.loadShardAccount=void 0;var Up=Qt(),qp=kd();function AS(t){let e=t.loadRef(),r;if(!e.isExotic){let n=e.beginParse();n.loadBit()&&(r=(0,qp.loadAccount)(n))}return{account:r,lastTransactionHash:t.loadUintBig(256),lastTransactionLt:t.loadUintBig(64)}}Vs.loadShardAccount=AS;function MS(t){return e=>{t.account?e.storeRef((0,Up.beginCell)().storeBit(!0).store((0,qp.storeAccount)(t.account))):e.storeRef((0,Up.beginCell)().storeBit(!1)),e.storeUint(t.lastTransactionHash,256),e.storeUint(t.lastTransactionLt,64)}}Vs.storeShardAccount=MS});var Gd=W(fi=>{"use strict";x();S();Object.defineProperty(fi,"__esModule",{value:!0});fi.storeShardAccounts=fi.loadShardAccounts=fi.ShardAccountRefValue=void 0;var Rp=qi(),Np=Kd(),Lp=$d();fi.ShardAccountRefValue={parse:t=>{let e=(0,Np.loadDepthBalanceInfo)(t),r=(0,Lp.loadShardAccount)(t);return{depthBalanceInfo:e,shardAccount:r}},serialize(t,e){e.store((0,Np.storeDepthBalanceInfo)(t.depthBalanceInfo)),e.store((0,Lp.storeShardAccount)(t.shardAccount))}};function ES(t){return Rp.Dictionary.load(Rp.Dictionary.Keys.BigUint(256),fi.ShardAccountRefValue,t)}fi.loadShardAccounts=ES;function IS(t){return e=>{e.storeDict(t)}}fi.storeShardAccounts=IS});var Zd=W(Fs=>{"use strict";x();S();Object.defineProperty(Fs,"__esModule",{value:!0});Fs.storeShardIdent=Fs.loadShardIdent=void 0;function PS(t){if(t.loadUint(2)!==0)throw Error("Invalid data");return{shardPrefixBits:t.loadUint(6),workchainId:t.loadInt(32),shardPrefix:t.loadUintBig(64)}}Fs.loadShardIdent=PS;function TS(t){return e=>{e.storeUint(0,2),e.storeUint(t.shardPrefixBits,6),e.storeInt(t.workchainId,32),e.storeUint(t.shardPrefix,64)}}Fs.storeShardIdent=TS});var jp=W(Qu=>{"use strict";x();S();Object.defineProperty(Qu,"__esModule",{value:!0});Qu.loadShardStateUnsplit=void 0;var OS=Fd(),CS=Gd(),kS=Zd();function US(t){if(t.loadUint(32)!==2418257890)throw Error("Invalid data");let e=t.loadInt(32),r=(0,kS.loadShardIdent)(t),n=t.loadUint(32),i=t.loadUint(32),o=t.loadUint(32),a=t.loadUintBig(64),s=t.loadUint(32);t.loadRef();let u=t.loadBit(),h=t.loadRef(),w;h.isExotic||(w=(0,CS.loadShardAccounts)(h.beginParse())),t.loadRef();let p=t.loadBit(),M=null;if(p){let A=t.loadRef();A.isExotic||(M=(0,OS.loadMasterchainStateExtra)(A.beginParse()))}return{globalId:e,shardId:r,seqno:n,vertSeqNo:i,genUtime:o,genLt:a,minRefMcSeqno:s,beforeSplit:u,accounts:w,extras:M}}Qu.loadShardStateUnsplit=US});var Yd=W(zs=>{"use strict";x();S();Object.defineProperty(zs,"__esModule",{value:!0});zs.storeSplitMergeInfo=zs.loadSplitMergeInfo=void 0;function qS(t){let e=t.loadUint(6),r=t.loadUint(6),n=t.loadUintBig(256),i=t.loadUintBig(256);return{currentShardPrefixLength:e,accountSplitDepth:r,thisAddress:n,siblingAddress:i}}zs.loadSplitMergeInfo=qS;function RS(t){return e=>{e.storeUint(t.currentShardPrefixLength,6),e.storeUint(t.accountSplitDepth,6),e.storeUint(t.thisAddress,256),e.storeUint(t.siblingAddress,256)}}zs.storeSplitMergeInfo=RS});var Ju=W(Ws=>{"use strict";x();S();Object.defineProperty(Ws,"__esModule",{value:!0});Ws.storeStorageUsedShort=Ws.loadStorageUsedShort=void 0;function NS(t){let e=t.loadVarUintBig(3),r=t.loadVarUintBig(3);return{cells:e,bits:r}}Ws.loadStorageUsedShort=NS;function LS(t){return e=>{e.storeVarUint(t.cells,3),e.storeVarUint(t.bits,3)}}Ws.storeStorageUsedShort=LS});var Xd=W($s=>{"use strict";x();S();Object.defineProperty($s,"__esModule",{value:!0});$s.storeTransactionActionPhase=$s.loadTransactionActionPhase=void 0;var Hp=Yu(),Kp=Ju();function jS(t){let e=t.loadBit(),r=t.loadBit(),n=t.loadBit(),i=(0,Hp.loadAccountStatusChange)(t),o=t.loadBit()?t.loadCoins():void 0,a=t.loadBit()?t.loadCoins():void 0,s=t.loadInt(32),u=t.loadBit()?t.loadInt(32):void 0,h=t.loadUint(16),w=t.loadUint(16),p=t.loadUint(16),M=t.loadUint(16),A=t.loadUintBig(256),P=(0,Kp.loadStorageUsedShort)(t);return{success:e,valid:r,noFunds:n,statusChange:i,totalFwdFees:o,totalActionFees:a,resultCode:s,resultArg:u,totalActions:h,specActions:w,skippedActions:p,messagesCreated:M,actionListHash:A,totalMessageSize:P}}$s.loadTransactionActionPhase=jS;function HS(t){return e=>{e.storeBit(t.success),e.storeBit(t.valid),e.storeBit(t.noFunds),e.store((0,Hp.storeAccountStatusChange)(t.statusChange)),e.storeMaybeCoins(t.totalFwdFees),e.storeMaybeCoins(t.totalActionFees),e.storeInt(t.resultCode,32),e.storeMaybeInt(t.resultArg,32),e.storeUint(t.totalActions,16),e.storeUint(t.specActions,16),e.storeUint(t.skippedActions,16),e.storeUint(t.messagesCreated,16),e.storeUint(t.actionListHash,256),e.store((0,Kp.storeStorageUsedShort)(t.totalMessageSize))}}$s.storeTransactionActionPhase=HS});var Qd=W(Gs=>{"use strict";x();S();Object.defineProperty(Gs,"__esModule",{value:!0});Gs.storeTransactionBouncePhase=Gs.loadTransactionBouncePhase=void 0;var ec=Ju();function KS(t){if(t.loadBit()){let e=(0,ec.loadStorageUsedShort)(t),r=t.loadCoins(),n=t.loadCoins();return{type:"ok",messageSize:e,messageFees:r,forwardFees:n}}if(t.loadBit()){let e=(0,ec.loadStorageUsedShort)(t),r=t.loadCoins();return{type:"no-funds",messageSize:e,requiredForwardFees:r}}return{type:"negative-funds"}}Gs.loadTransactionBouncePhase=KS;function DS(t){return e=>{if(t.type==="ok")e.storeBit(!0),e.store((0,ec.storeStorageUsedShort)(t.messageSize)),e.storeCoins(t.messageFees),e.storeCoins(t.forwardFees);else if(t.type==="negative-funds")e.storeBit(!1),e.storeBit(!1);else if(t.type==="no-funds")e.storeBit(!1),e.storeBit(!0),e.store((0,ec.storeStorageUsedShort)(t.messageSize)),e.storeCoins(t.requiredForwardFees);else throw new Error("Invalid TransactionBouncePhase type")}}Gs.storeTransactionBouncePhase=DS});var Jd=W(Zs=>{"use strict";x();S();Object.defineProperty(Zs,"__esModule",{value:!0});Zs.storeTransactionComputePhase=Zs.loadTransactionComputePhase=void 0;var VS=Qt(),Dp=Hd();function FS(t){if(!t.loadBit())return{type:"skipped",reason:(0,Dp.loadComputeSkipReason)(t)};let e=t.loadBit(),r=t.loadBit(),n=t.loadBit(),i=t.loadCoins(),o=t.loadRef().beginParse(),a=o.loadVarUintBig(3),s=o.loadVarUintBig(3),u=o.loadBit()?o.loadVarUintBig(2):void 0,h=o.loadUint(8),w=o.loadInt(32),p=o.loadBit()?o.loadInt(32):void 0,M=o.loadUint(32),A=o.loadUintBig(256),P=o.loadUintBig(256);return{type:"vm",success:e,messageStateUsed:r,accountActivated:n,gasFees:i,gasUsed:a,gasLimit:s,gasCredit:u,mode:h,exitCode:w,exitArg:p,vmSteps:M,vmInitStateHash:A,vmFinalStateHash:P}}Zs.loadTransactionComputePhase=FS;function zS(t){return e=>{if(t.type==="skipped"){e.storeBit(0),e.store((0,Dp.storeComputeSkipReason)(t.reason));return}e.storeBit(1),e.storeBit(t.success),e.storeBit(t.messageStateUsed),e.storeBit(t.accountActivated),e.storeCoins(t.gasFees),e.storeRef((0,VS.beginCell)().storeVarUint(t.gasUsed,3).storeVarUint(t.gasLimit,3).store(r=>t.gasCredit!==void 0&&t.gasCredit!==null?r.storeBit(1).storeVarUint(t.gasCredit,2):r.storeBit(0)).storeUint(t.mode,8).storeInt(t.exitCode,32).store(r=>t.exitArg!==void 0&&t.exitArg!==null?r.storeBit(1).storeInt(t.exitArg,32):r.storeBit(0)).storeUint(t.vmSteps,32).storeUint(t.vmInitStateHash,256).storeUint(t.vmFinalStateHash,256).endCell())}}Zs.storeTransactionComputePhase=zS});var e0=W(Ys=>{"use strict";x();S();Object.defineProperty(Ys,"__esModule",{value:!0});Ys.storeTransactionCreditPhase=Ys.loadTransactionCreditPhase=void 0;var Vp=ai();function WS(t){let e=t.loadBit()?t.loadCoins():void 0,r=(0,Vp.loadCurrencyCollection)(t);return{dueFeesColelcted:e,credit:r}}Ys.loadTransactionCreditPhase=WS;function $S(t){return e=>{t.dueFeesColelcted===null||t.dueFeesColelcted===void 0?e.storeBit(!1):(e.storeBit(!0),e.storeCoins(t.dueFeesColelcted)),e.store((0,Vp.storeCurrencyCollection)(t.credit))}}Ys.storeTransactionCreditPhase=$S});var t0=W(Xs=>{"use strict";x();S();Object.defineProperty(Xs,"__esModule",{value:!0});Xs.storeTransactionsStoragePhase=Xs.loadTransactionStoragePhase=void 0;var Fp=Yu();function GS(t){let e=t.loadCoins(),r;t.loadBit()&&(r=t.loadCoins());let n=(0,Fp.loadAccountStatusChange)(t);return{storageFeesCollected:e,storageFeesDue:r,statusChange:n}}Xs.loadTransactionStoragePhase=GS;function ZS(t){return e=>{e.storeCoins(t.storageFeesCollected),t.storageFeesDue===null||t.storageFeesDue===void 0?e.storeBit(!1):(e.storeBit(!0),e.storeCoins(t.storageFeesDue)),e.store((0,Fp.storeAccountStatusChange)(t.statusChange))}}Xs.storeTransactionsStoragePhase=ZS});var n0=W(ea=>{"use strict";x();S();Object.defineProperty(ea,"__esModule",{value:!0});ea.storeTransactionDescription=ea.loadTransactionDescription=void 0;var r0=Qt(),tc=Yd(),zp=i0(),Qs=Xd(),Wp=Qd(),Js=Jd(),$p=e0(),Gi=t0();function YS(t){let e=t.loadUint(4);if(e===0){let r=t.loadBit(),n;t.loadBit()&&(n=(0,Gi.loadTransactionStoragePhase)(t));let i;t.loadBit()&&(i=(0,$p.loadTransactionCreditPhase)(t));let o=(0,Js.loadTransactionComputePhase)(t),a;t.loadBit()&&(a=(0,Qs.loadTransactionActionPhase)(t.loadRef().beginParse()));let s=t.loadBit(),u;t.loadBit()&&(u=(0,Wp.loadTransactionBouncePhase)(t));let h=t.loadBit();return{type:"generic",creditFirst:r,storagePhase:n,creditPhase:i,computePhase:o,actionPhase:a,bouncePhase:u,aborted:s,destroyed:h}}if(e===1)return{type:"storage",storagePhase:(0,Gi.loadTransactionStoragePhase)(t)};if(e===2||e===3){let r=e===3,n=(0,Gi.loadTransactionStoragePhase)(t),i=(0,Js.loadTransactionComputePhase)(t),o;t.loadBit()&&(o=(0,Qs.loadTransactionActionPhase)(t.loadRef().beginParse()));let a=t.loadBit(),s=t.loadBit();return{type:"tick-tock",isTock:r,storagePhase:n,computePhase:i,actionPhase:o,aborted:a,destroyed:s}}if(e===4){let r=(0,tc.loadSplitMergeInfo)(t),n;t.loadBit()&&(n=(0,Gi.loadTransactionStoragePhase)(t));let i=(0,Js.loadTransactionComputePhase)(t),o;t.loadBit()&&(o=(0,Qs.loadTransactionActionPhase)(t.loadRef().beginParse()));let a=t.loadBit(),s=t.loadBit();return{type:"split-prepare",splitInfo:r,storagePhase:n,computePhase:i,actionPhase:o,aborted:a,destroyed:s}}if(e===5){let r=(0,tc.loadSplitMergeInfo)(t),n=(0,zp.loadTransaction)(t.loadRef().beginParse()),i=t.loadBit();return{type:"split-install",splitInfo:r,prepareTransaction:n,installed:i}}throw Error(`Unsupported transaction description type ${e}`)}ea.loadTransactionDescription=YS;function XS(t){return e=>{if(t.type==="generic")e.storeUint(0,4),e.storeBit(t.creditFirst),t.storagePhase?(e.storeBit(!0),e.store((0,Gi.storeTransactionsStoragePhase)(t.storagePhase))):e.storeBit(!1),t.creditPhase?(e.storeBit(!0),e.store((0,$p.storeTransactionCreditPhase)(t.creditPhase))):e.storeBit(!1),e.store((0,Js.storeTransactionComputePhase)(t.computePhase)),t.actionPhase?(e.storeBit(!0),e.storeRef((0,r0.beginCell)().store((0,Qs.storeTransactionActionPhase)(t.actionPhase)))):e.storeBit(!1),e.storeBit(t.aborted),t.bouncePhase?(e.storeBit(!0),e.store((0,Wp.storeTransactionBouncePhase)(t.bouncePhase))):e.storeBit(!1),e.storeBit(t.destroyed);else if(t.type==="storage")e.storeUint(1,4),e.store((0,Gi.storeTransactionsStoragePhase)(t.storagePhase));else if(t.type==="tick-tock")e.storeUint(t.isTock?3:2,4),e.store((0,Gi.storeTransactionsStoragePhase)(t.storagePhase)),e.store((0,Js.storeTransactionComputePhase)(t.computePhase)),t.actionPhase?(e.storeBit(!0),e.storeRef((0,r0.beginCell)().store((0,Qs.storeTransactionActionPhase)(t.actionPhase)))):e.storeBit(!1),e.storeBit(t.aborted),e.storeBit(t.destroyed);else if(t.type==="split-prepare")e.storeUint(4,4),e.store((0,tc.storeSplitMergeInfo)(t.splitInfo)),t.storagePhase?(e.storeBit(!0),e.store((0,Gi.storeTransactionsStoragePhase)(t.storagePhase))):e.storeBit(!1),e.store((0,Js.storeTransactionComputePhase)(t.computePhase)),t.actionPhase?(e.storeBit(!0),e.store((0,Qs.storeTransactionActionPhase)(t.actionPhase))):e.storeBit(!1),e.storeBit(t.aborted),e.storeBit(t.destroyed);else if(t.type==="split-install")e.storeUint(5,4),e.store((0,tc.storeSplitMergeInfo)(t.splitInfo)),e.storeRef((0,r0.beginCell)().store((0,zp.storeTransaction)(t.prepareTransaction))),e.storeBit(t.installed);else throw Error(`Unsupported transaction description type ${t.type}`)}}ea.storeTransactionDescription=XS});var i0=W(ta=>{"use strict";x();S();Object.defineProperty(ta,"__esModule",{value:!0});ta.storeTransaction=ta.loadTransaction=void 0;var rc=Qt(),QS=qi(),nc=Ud(),Gp=ai(),Zp=Dd(),o0=Wd(),Yp=n0();function JS(t){let e=t.asCell();if(t.loadUint(4)!==7)throw Error("Invalid data");let r=t.loadUintBig(256),n=t.loadUintBig(64),i=t.loadUintBig(256),o=t.loadUintBig(64),a=t.loadUint(32),s=t.loadUint(15),u=(0,nc.loadAccountStatus)(t),h=(0,nc.loadAccountStatus)(t),p=t.loadRef().beginParse(),M=p.loadBit()?(0,o0.loadMessage)(p.loadRef().beginParse()):void 0,A=p.loadDict(QS.Dictionary.Keys.Uint(15),o0.MessageValue);p.endParse();let P=(0,Gp.loadCurrencyCollection)(t),E=(0,Zp.loadHashUpdate)(t.loadRef().beginParse()),q=(0,Yp.loadTransactionDescription)(t.loadRef().beginParse());return{address:r,lt:n,prevTransactionHash:i,prevTransactionLt:o,now:a,outMessagesCount:s,oldStatus:u,endStatus:h,inMessage:M,outMessages:A,totalFees:P,stateUpdate:E,description:q,raw:e,hash:()=>e.hash()}}ta.loadTransaction=JS;function eB(t){return e=>{e.storeUint(7,4),e.storeUint(t.address,256),e.storeUint(t.lt,64),e.storeUint(t.prevTransactionHash,256),e.storeUint(t.prevTransactionLt,64),e.storeUint(t.now,32),e.storeUint(t.outMessagesCount,15),e.store((0,nc.storeAccountStatus)(t.oldStatus)),e.store((0,nc.storeAccountStatus)(t.endStatus));let r=(0,rc.beginCell)();t.inMessage?(r.storeBit(!0),r.storeRef((0,rc.beginCell)().store((0,o0.storeMessage)(t.inMessage)))):r.storeBit(!1),r.storeDict(t.outMessages),e.storeRef(r),e.store((0,Gp.storeCurrencyCollection)(t.totalFees)),e.storeRef((0,rc.beginCell)().store((0,Zp.storeHashUpdate)(t.stateUpdate))),e.storeRef((0,rc.beginCell)().store((0,Yp.storeTransactionDescription)(t.description)))}}ta.storeTransaction=eB});var M3=W(Q=>{"use strict";x();S();Object.defineProperty(Q,"__esModule",{value:!0});Q.loadStorageInfo=Q.storeStateInit=Q.loadStateInit=Q.storeSplitMergeInfo=Q.loadSplitMergeInfo=Q.storeSimpleLibrary=Q.loadSimpleLibrary=Q.loadShardStateUnsplit=Q.storeShardIdent=Q.loadShardIdent=Q.storeShardAccounts=Q.loadShardAccounts=Q.ShardAccountRefValue=Q.storeShardAccount=Q.loadShardAccount=Q.SendMode=Q.storeMessageRelaxed=Q.loadMessageRelaxed=Q.storeMessage=Q.loadMessage=Q.loadMasterchainStateExtra=Q.storeHashUpdate=Q.loadHashUpdate=Q.storeDepthBalanceInfo=Q.loadDepthBalanceInfo=Q.storeCurrencyCollection=Q.loadCurrencyCollection=Q.storeComputeSkipReason=Q.loadComputeSkipReason=Q.storeCommonMessageInfoRelaxed=Q.loadCommonMessageInfoRelaxed=Q.storeCommonMessageInfo=Q.loadCommonMessageInfo=Q.storeOutList=Q.loadOutList=Q.storeOutAction=Q.loadOutAction=Q.storeAccountStorage=Q.loadAccountStorage=Q.storeAccountStatusChange=Q.loadAccountStatusChange=Q.storeAccountStatus=Q.loadAccountStatus=Q.storeAccountState=Q.loadAccountState=Q.storeAccount=Q.loadAccount=Q.comment=Q.external=Q.internal=void 0;Q.storeTransactionsStoragePhase=Q.loadTransactionStoragePhase=Q.storeTransactionDescription=Q.loadTransactionDescription=Q.storeTransactionCreditPhase=Q.loadTransactionCreditPhase=Q.storeTransactionComputePhase=Q.loadTransactionComputePhase=Q.storeTransactionBouncePhase=Q.loadTransactionBouncePhase=Q.storeTransactionActionPhase=Q.loadTransactionActionPhase=Q.storeTransaction=Q.loadTransaction=Q.storeTickTock=Q.loadTickTock=Q.storeStorageUsedShort=Q.loadStorageUsedShort=Q.storeStorageUsed=Q.loadStorageUsed=Q.storeStorageInfo=void 0;var s0=lp();Object.defineProperty(Q,"internal",{enumerable:!0,get:function(){return s0.internal}});Object.defineProperty(Q,"external",{enumerable:!0,get:function(){return s0.external}});Object.defineProperty(Q,"comment",{enumerable:!0,get:function(){return s0.comment}});var Xp=kd();Object.defineProperty(Q,"loadAccount",{enumerable:!0,get:function(){return Xp.loadAccount}});Object.defineProperty(Q,"storeAccount",{enumerable:!0,get:function(){return Xp.storeAccount}});var Qp=Pd();Object.defineProperty(Q,"loadAccountState",{enumerable:!0,get:function(){return Qp.loadAccountState}});Object.defineProperty(Q,"storeAccountState",{enumerable:!0,get:function(){return Qp.storeAccountState}});var Jp=Ud();Object.defineProperty(Q,"loadAccountStatus",{enumerable:!0,get:function(){return Jp.loadAccountStatus}});Object.defineProperty(Q,"storeAccountStatus",{enumerable:!0,get:function(){return Jp.storeAccountStatus}});var e3=Yu();Object.defineProperty(Q,"loadAccountStatusChange",{enumerable:!0,get:function(){return e3.loadAccountStatusChange}});Object.defineProperty(Q,"storeAccountStatusChange",{enumerable:!0,get:function(){return e3.storeAccountStatusChange}});var t3=Td();Object.defineProperty(Q,"loadAccountStorage",{enumerable:!0,get:function(){return t3.loadAccountStorage}});Object.defineProperty(Q,"storeAccountStorage",{enumerable:!0,get:function(){return t3.storeAccountStorage}});var ic=Mp();Object.defineProperty(Q,"loadOutAction",{enumerable:!0,get:function(){return ic.loadOutAction}});Object.defineProperty(Q,"storeOutAction",{enumerable:!0,get:function(){return ic.storeOutAction}});Object.defineProperty(Q,"loadOutList",{enumerable:!0,get:function(){return ic.loadOutList}});Object.defineProperty(Q,"storeOutList",{enumerable:!0,get:function(){return ic.storeOutList}});var r3=jd();Object.defineProperty(Q,"loadCommonMessageInfo",{enumerable:!0,get:function(){return r3.loadCommonMessageInfo}});Object.defineProperty(Q,"storeCommonMessageInfo",{enumerable:!0,get:function(){return r3.storeCommonMessageInfo}});var n3=qd();Object.defineProperty(Q,"loadCommonMessageInfoRelaxed",{enumerable:!0,get:function(){return n3.loadCommonMessageInfoRelaxed}});Object.defineProperty(Q,"storeCommonMessageInfoRelaxed",{enumerable:!0,get:function(){return n3.storeCommonMessageInfoRelaxed}});var i3=Hd();Object.defineProperty(Q,"loadComputeSkipReason",{enumerable:!0,get:function(){return i3.loadComputeSkipReason}});Object.defineProperty(Q,"storeComputeSkipReason",{enumerable:!0,get:function(){return i3.storeComputeSkipReason}});var o3=ai();Object.defineProperty(Q,"loadCurrencyCollection",{enumerable:!0,get:function(){return o3.loadCurrencyCollection}});Object.defineProperty(Q,"storeCurrencyCollection",{enumerable:!0,get:function(){return o3.storeCurrencyCollection}});var s3=Kd();Object.defineProperty(Q,"loadDepthBalanceInfo",{enumerable:!0,get:function(){return s3.loadDepthBalanceInfo}});Object.defineProperty(Q,"storeDepthBalanceInfo",{enumerable:!0,get:function(){return s3.storeDepthBalanceInfo}});var a3=Dd();Object.defineProperty(Q,"loadHashUpdate",{enumerable:!0,get:function(){return a3.loadHashUpdate}});Object.defineProperty(Q,"storeHashUpdate",{enumerable:!0,get:function(){return a3.storeHashUpdate}});var tB=Fd();Object.defineProperty(Q,"loadMasterchainStateExtra",{enumerable:!0,get:function(){return tB.loadMasterchainStateExtra}});var f3=Wd();Object.defineProperty(Q,"loadMessage",{enumerable:!0,get:function(){return f3.loadMessage}});Object.defineProperty(Q,"storeMessage",{enumerable:!0,get:function(){return f3.storeMessage}});var u3=Nd();Object.defineProperty(Q,"loadMessageRelaxed",{enumerable:!0,get:function(){return u3.loadMessageRelaxed}});Object.defineProperty(Q,"storeMessageRelaxed",{enumerable:!0,get:function(){return u3.storeMessageRelaxed}});var rB=kp();Object.defineProperty(Q,"SendMode",{enumerable:!0,get:function(){return rB.SendMode}});var c3=$d();Object.defineProperty(Q,"loadShardAccount",{enumerable:!0,get:function(){return c3.loadShardAccount}});Object.defineProperty(Q,"storeShardAccount",{enumerable:!0,get:function(){return c3.storeShardAccount}});var a0=Gd();Object.defineProperty(Q,"ShardAccountRefValue",{enumerable:!0,get:function(){return a0.ShardAccountRefValue}});Object.defineProperty(Q,"loadShardAccounts",{enumerable:!0,get:function(){return a0.loadShardAccounts}});Object.defineProperty(Q,"storeShardAccounts",{enumerable:!0,get:function(){return a0.storeShardAccounts}});var l3=Zd();Object.defineProperty(Q,"loadShardIdent",{enumerable:!0,get:function(){return l3.loadShardIdent}});Object.defineProperty(Q,"storeShardIdent",{enumerable:!0,get:function(){return l3.storeShardIdent}});var nB=jp();Object.defineProperty(Q,"loadShardStateUnsplit",{enumerable:!0,get:function(){return nB.loadShardStateUnsplit}});var d3=xd();Object.defineProperty(Q,"loadSimpleLibrary",{enumerable:!0,get:function(){return d3.loadSimpleLibrary}});Object.defineProperty(Q,"storeSimpleLibrary",{enumerable:!0,get:function(){return d3.storeSimpleLibrary}});var h3=Yd();Object.defineProperty(Q,"loadSplitMergeInfo",{enumerable:!0,get:function(){return h3.loadSplitMergeInfo}});Object.defineProperty(Q,"storeSplitMergeInfo",{enumerable:!0,get:function(){return h3.storeSplitMergeInfo}});var b3=Ms();Object.defineProperty(Q,"loadStateInit",{enumerable:!0,get:function(){return b3.loadStateInit}});Object.defineProperty(Q,"storeStateInit",{enumerable:!0,get:function(){return b3.storeStateInit}});var p3=Cd();Object.defineProperty(Q,"loadStorageInfo",{enumerable:!0,get:function(){return p3.loadStorageInfo}});Object.defineProperty(Q,"storeStorageInfo",{enumerable:!0,get:function(){return p3.storeStorageInfo}});var g3=Od();Object.defineProperty(Q,"loadStorageUsed",{enumerable:!0,get:function(){return g3.loadStorageUsed}});Object.defineProperty(Q,"storeStorageUsed",{enumerable:!0,get:function(){return g3.storeStorageUsed}});var y3=Ju();Object.defineProperty(Q,"loadStorageUsedShort",{enumerable:!0,get:function(){return y3.loadStorageUsedShort}});Object.defineProperty(Q,"storeStorageUsedShort",{enumerable:!0,get:function(){return y3.storeStorageUsedShort}});var m3=Sd();Object.defineProperty(Q,"loadTickTock",{enumerable:!0,get:function(){return m3.loadTickTock}});Object.defineProperty(Q,"storeTickTock",{enumerable:!0,get:function(){return m3.storeTickTock}});var v3=i0();Object.defineProperty(Q,"loadTransaction",{enumerable:!0,get:function(){return v3.loadTransaction}});Object.defineProperty(Q,"storeTransaction",{enumerable:!0,get:function(){return v3.storeTransaction}});var w3=Xd();Object.defineProperty(Q,"loadTransactionActionPhase",{enumerable:!0,get:function(){return w3.loadTransactionActionPhase}});Object.defineProperty(Q,"storeTransactionActionPhase",{enumerable:!0,get:function(){return w3.storeTransactionActionPhase}});var _3=Qd();Object.defineProperty(Q,"loadTransactionBouncePhase",{enumerable:!0,get:function(){return _3.loadTransactionBouncePhase}});Object.defineProperty(Q,"storeTransactionBouncePhase",{enumerable:!0,get:function(){return _3.storeTransactionBouncePhase}});var x3=Jd();Object.defineProperty(Q,"loadTransactionComputePhase",{enumerable:!0,get:function(){return x3.loadTransactionComputePhase}});Object.defineProperty(Q,"storeTransactionComputePhase",{enumerable:!0,get:function(){return x3.storeTransactionComputePhase}});var S3=e0();Object.defineProperty(Q,"loadTransactionCreditPhase",{enumerable:!0,get:function(){return S3.loadTransactionCreditPhase}});Object.defineProperty(Q,"storeTransactionCreditPhase",{enumerable:!0,get:function(){return S3.storeTransactionCreditPhase}});var B3=n0();Object.defineProperty(Q,"loadTransactionDescription",{enumerable:!0,get:function(){return B3.loadTransactionDescription}});Object.defineProperty(Q,"storeTransactionDescription",{enumerable:!0,get:function(){return B3.storeTransactionDescription}});var A3=t0();Object.defineProperty(Q,"loadTransactionStoragePhase",{enumerable:!0,get:function(){return A3.loadTransactionStoragePhase}});Object.defineProperty(Q,"storeTransactionsStoragePhase",{enumerable:!0,get:function(){return A3.storeTransactionsStoragePhase}})});var I3=W(oc=>{"use strict";x();S();Object.defineProperty(oc,"__esModule",{value:!0});oc.openContract=void 0;var iB=ri(),E3=Ri();function oB(t,e){let r,n=null;if(!iB.Address.isAddress(t.address))throw Error("Invalid address");if(r=t.address,t.init){if(!(t.init.code instanceof E3.Cell))throw Error("Invalid init.code");if(!(t.init.data instanceof E3.Cell))throw Error("Invalid init.data");n=t.init}let i=e({address:r,init:n});return new Proxy(t,{get(o,a){let s=o[a];return typeof a=="string"&&(a.startsWith("get")||a.startsWith("send"))&&typeof s=="function"?(...u)=>s.apply(o,[i,...u]):s}})}oc.openContract=oB});var P3=W(sc=>{"use strict";x();S();Object.defineProperty(sc,"__esModule",{value:!0});sc.ComputeError=void 0;var ef=class extends Error{constructor(e,r,n){super(e),this.exitCode=r,this.debugLogs=n&&n.debugLogs?n.debugLogs:null,this.logs=n&&n.logs?n.logs:null,Object.setPrototypeOf(this,ef.prototype)}};sc.ComputeError=ef});var T3=W(ac=>{"use strict";x();S();Object.defineProperty(ac,"__esModule",{value:!0});ac.getMethodId=void 0;var sB=new Int16Array([0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920]);function aB(t){t instanceof v.Buffer||(t=v.Buffer.from(t));let e=0;for(let r=0;r<t.length;r++){let n=t[r];e=(sB[(e>>8^n)&255]^e<<8)&65535}return e}function fB(t){return aB(t)&65535|65536}ac.getMethodId=fB});var C3=W(ra=>{"use strict";x();S();Object.defineProperty(ra,"__esModule",{value:!0});ra.safeSignVerify=ra.safeSign=void 0;var f0=Za(),uB=8,cB=64;function O3(t,e){let r=v.Buffer.from(e);if(r.length>cB)throw Error("Seed can be longer than 64 bytes");if(r.length<uB)throw Error("Seed must be at least 8 bytes");return(0,f0.sha256_sync)(v.Buffer.concat([v.Buffer.from([255,255]),r,t.hash()]))}function lB(t,e,r="ton-safe-sign-magic"){return(0,f0.sign)(O3(t,r),e)}ra.safeSign=lB;function dB(t,e,r,n="ton-safe-sign-magic"){return(0,f0.signVerify)(O3(t,n),e,r)}ra.safeSignVerify=dB});var Yr=W(Se=>{"use strict";x();S();var hB=Se&&Se.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),bB=Se&&Se.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hB(e,t,r)};Object.defineProperty(Se,"__esModule",{value:!0});Se.safeSignVerify=Se.safeSign=Se.getMethodId=Se.base32Encode=Se.base32Decode=Se.crc32c=Se.crc16=Se.fromNano=Se.toNano=Se.ComputeError=Se.openContract=Se.TupleBuilder=Se.TupleReader=Se.serializeTuple=Se.parseTuple=Se.generateMerkleUpdate=Se.generateMerkleProofDirect=Se.generateMerkleProof=Se.exoticPruned=Se.exoticMerkleUpdate=Se.convertToMerkleProof=Se.exoticMerkleProof=Se.Dictionary=Se.Cell=Se.CellType=Se.Slice=Se.beginCell=Se.Builder=Se.BitBuilder=Se.BitReader=Se.BitString=Se.contractAddress=Se.ADNLAddress=Se.ExternalAddress=Se.address=Se.Address=void 0;var k3=ri();Object.defineProperty(Se,"Address",{enumerable:!0,get:function(){return k3.Address}});Object.defineProperty(Se,"address",{enumerable:!0,get:function(){return k3.address}});var pB=mu();Object.defineProperty(Se,"ExternalAddress",{enumerable:!0,get:function(){return pB.ExternalAddress}});var gB=Wb();Object.defineProperty(Se,"ADNLAddress",{enumerable:!0,get:function(){return gB.ADNLAddress}});var yB=np();Object.defineProperty(Se,"contractAddress",{enumerable:!0,get:function(){return yB.contractAddress}});var mB=ni();Object.defineProperty(Se,"BitString",{enumerable:!0,get:function(){return mB.BitString}});var vB=oi();Object.defineProperty(Se,"BitReader",{enumerable:!0,get:function(){return vB.BitReader}});var wB=Va();Object.defineProperty(Se,"BitBuilder",{enumerable:!0,get:function(){return wB.BitBuilder}});var U3=Qt();Object.defineProperty(Se,"Builder",{enumerable:!0,get:function(){return U3.Builder}});Object.defineProperty(Se,"beginCell",{enumerable:!0,get:function(){return U3.beginCell}});var _B=Iu();Object.defineProperty(Se,"Slice",{enumerable:!0,get:function(){return _B.Slice}});var xB=us();Object.defineProperty(Se,"CellType",{enumerable:!0,get:function(){return xB.CellType}});var SB=Ri();Object.defineProperty(Se,"Cell",{enumerable:!0,get:function(){return SB.Cell}});var BB=qi();Object.defineProperty(Se,"Dictionary",{enumerable:!0,get:function(){return BB.Dictionary}});var q3=Wa();Object.defineProperty(Se,"exoticMerkleProof",{enumerable:!0,get:function(){return q3.exoticMerkleProof}});Object.defineProperty(Se,"convertToMerkleProof",{enumerable:!0,get:function(){return q3.convertToMerkleProof}});var AB=Ou();Object.defineProperty(Se,"exoticMerkleUpdate",{enumerable:!0,get:function(){return AB.exoticMerkleUpdate}});var MB=qu();Object.defineProperty(Se,"exoticPruned",{enumerable:!0,get:function(){return MB.exoticPruned}});var R3=xu();Object.defineProperty(Se,"generateMerkleProof",{enumerable:!0,get:function(){return R3.generateMerkleProof}});Object.defineProperty(Se,"generateMerkleProofDirect",{enumerable:!0,get:function(){return R3.generateMerkleProofDirect}});var EB=sd();Object.defineProperty(Se,"generateMerkleUpdate",{enumerable:!0,get:function(){return EB.generateMerkleUpdate}});var N3=sp();Object.defineProperty(Se,"parseTuple",{enumerable:!0,get:function(){return N3.parseTuple}});Object.defineProperty(Se,"serializeTuple",{enumerable:!0,get:function(){return N3.serializeTuple}});var IB=ap();Object.defineProperty(Se,"TupleReader",{enumerable:!0,get:function(){return IB.TupleReader}});var PB=fp();Object.defineProperty(Se,"TupleBuilder",{enumerable:!0,get:function(){return PB.TupleBuilder}});bB(M3(),Se);var TB=I3();Object.defineProperty(Se,"openContract",{enumerable:!0,get:function(){return TB.openContract}});var OB=P3();Object.defineProperty(Se,"ComputeError",{enumerable:!0,get:function(){return OB.ComputeError}});var L3=Id();Object.defineProperty(Se,"toNano",{enumerable:!0,get:function(){return L3.toNano}});Object.defineProperty(Se,"fromNano",{enumerable:!0,get:function(){return L3.fromNano}});var CB=yu();Object.defineProperty(Se,"crc16",{enumerable:!0,get:function(){return CB.crc16}});var kB=vd();Object.defineProperty(Se,"crc32c",{enumerable:!0,get:function(){return kB.crc32c}});var j3=rd();Object.defineProperty(Se,"base32Decode",{enumerable:!0,get:function(){return j3.base32Decode}});Object.defineProperty(Se,"base32Encode",{enumerable:!0,get:function(){return j3.base32Encode}});var UB=T3();Object.defineProperty(Se,"getMethodId",{enumerable:!0,get:function(){return UB.getMethodId}});var H3=C3();Object.defineProperty(Se,"safeSign",{enumerable:!0,get:function(){return H3.safeSign}});Object.defineProperty(Se,"safeSignVerify",{enumerable:!0,get:function(){return H3.safeSignVerify}})});var K3=W(fc=>{"use strict";x();S();Object.defineProperty(fc,"__esModule",{value:!0});fc.WalletContractV3R2=void 0;var ln=Yr(),qB=Xn(),tf=class{static create(e){return new tf(e.workchain,e.publicKey,e.walletId)}constructor(e,r,n){this.workchain=e,this.publicKey=r,n!=null?this.walletId=n:this.walletId=698983191+e;let i=ln.Cell.fromBoc(v.Buffer.from("te6cckEBAQEAcQAA3v8AIN0gggFMl7ohggEznLqxn3Gw7UTQ0x/THzHXC//jBOCk8mCDCNcYINMf0x/TH/gjE7vyY+1E0NMf0x/T/9FRMrryoVFEuvKiBPkBVBBV+RDyo/gAkyDXSpbTB9QC+wDo0QGkyMsfyx/L/8ntVBC9ba0=","base64"))[0],o=(0,ln.beginCell)().storeUint(0,32).storeUint(this.walletId,32).storeBuffer(r).endCell();this.init={code:i,data:o},this.address=(0,ln.contractAddress)(e,{code:i,data:o})}createTransfer(e){let r=ln.SendMode.PAY_GAS_SEPARATELY+ln.SendMode.IGNORE_ERRORS;e.sendMode!==null&&e.sendMode!==void 0&&(r=e.sendMode);let n=this.createWalletTransferV3({seqno:e.seqno,sendMode:r,secretKey:e.secretKey,messages:e.messages,timeout:e.timeout,walletId:this.walletId}),i=(0,ln.external)({to:this.address,init:e.seqno===0?{code:this.init.code,data:this.init.data}:void 0,body:n});return(0,ln.beginCell)().store((0,ln.storeMessage)(i)).endCell()}createWalletTransferV3(e){if(e.messages.length>4)throw Error("Maximum number of messages in a single transfer is 4");let r=(0,ln.beginCell)().storeUint(e.walletId,32);if(e.seqno===0)for(let i=0;i<32;i++)r.storeBit(1);else r.storeUint(e.timeout||Math.floor(Date.now()/1e3)+600,32);r.storeUint(e.seqno,32);for(let i of e.messages)r.storeUint(e.sendMode,8),r.storeRef((0,ln.beginCell)().store((0,ln.storeMessageRelaxed)(i)));let n=qB.signUtil.ed25519.sign(r.endCell().hash(),e.secretKey);return(0,ln.beginCell)().storeBuffer(v.Buffer.from(n)).storeBuilder(r).endCell()}};fc.WalletContractV3R2=tf});var D3=W(uc=>{"use strict";x();S();Object.defineProperty(uc,"__esModule",{value:!0});uc.signPayload=void 0;var RB=Za();function NB(t,e,r){return"secretKey"in t?r((0,RB.sign)(e.endCell().hash(),t.secretKey),e):t.signer(e.endCell()).then(n=>r(n,e))}uc.signPayload=NB});var z3=W(Zi=>{"use strict";x();S();Object.defineProperty(Zi,"__esModule",{value:!0});Zi.storeWalletIdV5R1=Zi.loadWalletIdV5R1=Zi.isWalletIdV5R1ClientContext=void 0;var na=Yr();function V3(t){return typeof t!="number"}Zi.isWalletIdV5R1ClientContext=V3;var F3={v5r1:0};function LB(t,e){let r=new na.BitReader(new na.BitString(typeof t=="bigint"?v.Buffer.from(t.toString(16),"hex"):t instanceof na.Slice?t.loadBuffer(4):t,0,32)).loadInt(32),n=BigInt(r)^BigInt(e),i=(0,na.beginCell)().storeInt(n,32).endCell().beginParse();if(i.loadUint(1)){let a=i.loadInt(8),s=i.loadUint(8),u=i.loadUint(15),h=Object.entries(F3).find(([w,p])=>p===s)?.[0];if(h===void 0)throw new Error(`Can't deserialize walletId: unknown wallet version ${s}`);return{networkGlobalId:e,context:{walletVersion:h,workchain:a,subwalletNumber:u}}}else{let a=i.loadUint(31);return{networkGlobalId:e,context:a}}}Zi.loadWalletIdV5R1=LB;function jB(t){return e=>{let r;return V3(t.context)?r=(0,na.beginCell)().storeUint(1,1).storeInt(t.context.workchain,8).storeUint(F3[t.context.walletVersion],8).storeUint(t.context.subwalletNumber,15).endCell().beginParse().loadInt(32):r=(0,na.beginCell)().storeUint(0,1).storeUint(t.context,31).endCell().beginParse().loadInt(32),e.storeInt(BigInt(t.networkGlobalId)^BigInt(r),32)}}Zi.storeWalletIdV5R1=jB});var c0=W(cc=>{"use strict";x();S();Object.defineProperty(cc,"__esModule",{value:!0});cc.WalletContractV5R1=void 0;var rf=Yr(),W3=l0(),u0=z3(),ia=class{static create(e){let r=0;return"workchain"in e&&e.workchain!=null&&(r=e.workchain),e.walletId?.context&&(0,u0.isWalletIdV5R1ClientContext)(e.walletId.context)&&e.walletId.context.workchain!=null&&(r=e.walletId.context.workchain),new ia(r,e.publicKey,{networkGlobalId:e.walletId?.networkGlobalId??-239,context:e.walletId?.context??{workchain:0,walletVersion:"v5r1",subwalletNumber:0}})}constructor(e,r,n){this.publicKey=r,this.walletId=n,this.walletId=n;let i=rf.Cell.fromBoc(v.Buffer.from("b5ee9c7241021401000281000114ff00f4a413f4bcf2c80b01020120020d020148030402dcd020d749c120915b8f6320d70b1f2082106578746ebd21821073696e74bdb0925f03e082106578746eba8eb48020d72101d074d721fa4030fa44f828fa443058bd915be0ed44d0810141d721f4058307f40e6fa1319130e18040d721707fdb3ce03120d749810280b99130e070e2100f020120050c020120060902016e07080019adce76a2684020eb90eb85ffc00019af1df6a2684010eb90eb858fc00201480a0b0017b325fb51341c75c875c2c7e00011b262fb513435c280200019be5f0f6a2684080a0eb90fa02c0102f20e011e20d70b1f82107369676ebaf2e08a7f0f01e68ef0eda2edfb218308d722028308d723208020d721d31fd31fd31fed44d0d200d31f20d31fd3ffd70a000af90140ccf9109a28945f0adb31e1f2c087df02b35007b0f2d0845125baf2e0855036baf2e086f823bbf2d0882292f800de01a47fc8ca00cb1f01cf16c9ed542092f80fde70db3cd81003f6eda2edfb02f404216e926c218e4c0221d73930709421c700b38e2d01d72820761e436c20d749c008f2e09320d74ac002f2e09320d71d06c712c2005230b0f2d089d74cd7393001a4e86c128407bbf2e093d74ac000f2e093ed55e2d20001c000915be0ebd72c08142091709601d72c081c12e25210b1e30f20d74a111213009601fa4001fa44f828fa443058baf2e091ed44d0810141d718f405049d7fc8ca0040048307f453f2e08b8e14038307f45bf2e08c22d70a00216e01b3b0f2d090e2c85003cf1612f400c9ed54007230d72c08248e2d21f2e092d200ed44d0d2005113baf2d08f54503091319c01810140d721d70a00f2e08ee2c8ca0058cf16c9ed5493f2c08de20010935bdb31e1d74cd0b4d6c35e","hex"))[0],o=(0,rf.beginCell)().storeUint(1,1).storeUint(0,32).store((0,u0.storeWalletIdV5R1)(this.walletId)).storeBuffer(this.publicKey,32).storeBit(0).endCell();this.init={code:i,data:o},this.address=(0,rf.contractAddress)(e,{code:i,data:o})}createActions(e){return e.messages.map(n=>({type:"sendMsg",mode:e.sendMode,outMsg:n}))}createTransfer(e){let r=rf.SendMode.PAY_GAS_SEPARATELY+rf.SendMode.IGNORE_ERRORS;return e.sendMode!==null&&e.sendMode!==void 0&&(r=e.sendMode),this.createRequest({actions:this.createActions({messages:e.messages,sendMode:r}),...e})}createAddExtension(e){return this.createRequest({actions:[{type:"addExtension",address:e.extensionAddress}],...e})}createRemoveExtension(e){return this.createRequest({actions:[{type:"removeExtension",address:e.extensionAddress}],...e})}createSetIsPublicKeyEnabled(e){return this.createRequest({actions:[{type:"setIsPublicKeyEnabled",isEnabled:e.isEnabled}],...e})}createRequest(e){return e.authType==="extension"?(0,W3.createWalletTransferV5R1)(e):(0,W3.createWalletTransferV5R1)({...e,walletId:(0,u0.storeWalletIdV5R1)(this.walletId)})}};cc.WalletContractV5R1=ia;ia.OpCodes={auth_extension:1702392942,auth_signed_external:1936287598,auth_signed_internal:1936289396}});var G3=W(oa=>{"use strict";x();S();Object.defineProperty(oa,"__esModule",{value:!0});oa.isOutActionBasic=oa.isOutActionExtended=void 0;function $3(t){return t.type==="setIsPublicKeyEnabled"||t.type==="addExtension"||t.type==="removeExtension"}oa.isOutActionExtended=$3;function HB(t){return!$3(t)}oa.isOutActionBasic=HB});var tg=W(zr=>{"use strict";x();S();Object.defineProperty(zr,"__esModule",{value:!0});zr.patchV5R1ActionsSendMode=zr.toSafeV5R1SendMode=zr.loadOutListExtendedV5R1=zr.storeOutListExtendedV5R1=zr.loadOutActionExtendedV5R1=zr.storeOutActionExtendedV5R1=void 0;var nf=Yr(),Z3=G3(),Y3=4;function KB(t){return e=>{e.storeUint(Y3,8).storeUint(t.isEnabled?1:0,1)}}var X3=2;function DB(t){return e=>{e.storeUint(X3,8).storeAddress(t.address)}}var Q3=3;function VB(t){return e=>{e.storeUint(Q3,8).storeAddress(t.address)}}function h0(t){switch(t.type){case"setIsPublicKeyEnabled":return KB(t);case"addExtension":return DB(t);case"removeExtension":return VB(t);default:throw new Error("Unknown action type"+t?.type)}}zr.storeOutActionExtendedV5R1=h0;function d0(t){let e=t.loadUint(8);switch(e){case Y3:return{type:"setIsPublicKeyEnabled",isEnabled:!!t.loadUint(1)};case X3:return{type:"addExtension",address:t.loadAddress()};case Q3:return{type:"removeExtension",address:t.loadAddress()};default:throw new Error(`Unknown extended out action tag 0x${e.toString(16)}`)}}zr.loadOutActionExtendedV5R1=d0;function FB(t){let e=t.filter(Z3.isOutActionExtended),r=t.filter(Z3.isOutActionBasic);return n=>{let i=r.length?(0,nf.beginCell)().store((0,nf.storeOutList)(r.slice().reverse())):null;if(n.storeMaybeRef(i),e.length===0)n.storeUint(0,1);else{let[o,...a]=e;n.storeUint(1,1).store(h0(o)),a.length>0&&n.storeRef(J3(a))}}}zr.storeOutListExtendedV5R1=FB;function J3(t){let[e,...r]=t,n=(0,nf.beginCell)().store(h0(e));return r.length>0&&(n=n.storeRef(J3(r))),n.endCell()}function zB(t){let e=[],r=t.loadMaybeRef();if(r){let n=(0,nf.loadOutList)(r.beginParse());if(n.some(i=>i.type!=="sendMsg"))throw new Error("Can't deserialize actions list: only sendMsg actions are allowed for wallet v5r1");e.push(...n)}if(t.loadBoolean()){let n=d0(t);e.push(n)}for(;t.remainingRefs>0;){t=t.loadRef().beginParse();let n=d0(t);e.push(n)}return e}zr.loadOutListExtendedV5R1=zB;function eg(t,e){return e==="internal"||e==="extension"?t:t|nf.SendMode.IGNORE_ERRORS}zr.toSafeV5R1SendMode=eg;function WB(t,e){return t.map(r=>r.type==="sendMsg"?{...r,mode:eg(r.mode,e)}:r)}zr.patchV5R1ActionsSendMode=WB});var l0=W(dn=>{"use strict";x();S();Object.defineProperty(dn,"__esModule",{value:!0});dn.createWalletTransferV5R1=dn.createWalletTransferV4=dn.createWalletTransferV3=dn.createWalletTransferV2=dn.createWalletTransferV1=void 0;var lr=Yr(),lc=Za(),$B=D3(),b0=c0(),p0=tg();function GB(t,e){return(0,lr.beginCell)().storeBuilder(e).storeBuffer(t).endCell()}function ZB(t){let e=(0,lr.beginCell)().storeUint(t.seqno,32);t.message&&(e.storeUint(t.sendMode,8),e.storeRef((0,lr.beginCell)().store((0,lr.storeMessageRelaxed)(t.message))));let r=(0,lc.sign)(e.endCell().hash(),t.secretKey);return(0,lr.beginCell)().storeBuffer(r).storeBuilder(e).endCell()}dn.createWalletTransferV1=ZB;function YB(t){if(t.messages.length>4)throw Error("Maximum number of messages in a single transfer is 4");let e=(0,lr.beginCell)().storeUint(t.seqno,32);if(t.seqno===0)for(let i=0;i<32;i++)e.storeBit(1);else e.storeUint(t.timeout||Math.floor(Date.now()/1e3)+60,32);for(let i of t.messages)e.storeUint(t.sendMode,8),e.storeRef((0,lr.beginCell)().store((0,lr.storeMessageRelaxed)(i)));let r=(0,lc.sign)(e.endCell().hash(),t.secretKey);return(0,lr.beginCell)().storeBuffer(r).storeBuilder(e).endCell()}dn.createWalletTransferV2=YB;function XB(t){if(t.messages.length>4)throw Error("Maximum number of messages in a single transfer is 4");let e=(0,lr.beginCell)().storeUint(t.walletId,32);if(t.seqno===0)for(let i=0;i<32;i++)e.storeBit(1);else e.storeUint(t.timeout||Math.floor(Date.now()/1e3)+60,32);e.storeUint(t.seqno,32);for(let i of t.messages)e.storeUint(t.sendMode,8),e.storeRef((0,lr.beginCell)().store((0,lr.storeMessageRelaxed)(i)));let r=(0,lc.sign)(e.endCell().hash(),t.secretKey);return(0,lr.beginCell)().storeBuffer(r).storeBuilder(e).endCell()}dn.createWalletTransferV3=XB;function QB(t){if(t.messages.length>4)throw Error("Maximum number of messages in a single transfer is 4");let e=(0,lr.beginCell)().storeUint(t.walletId,32);if(t.seqno===0)for(let i=0;i<32;i++)e.storeBit(1);else e.storeUint(t.timeout||Math.floor(Date.now()/1e3)+600,32);e.storeUint(t.seqno,32),e.storeUint(0,8);for(let i of t.messages)e.storeUint(t.sendMode,8),e.storeRef((0,lr.beginCell)().store((0,lr.storeMessageRelaxed)(i)));let r=(0,lc.sign)(e.endCell().hash(),t.secretKey);return(0,lr.beginCell)().storeBuffer(r).storeBuilder(e).endCell()}dn.createWalletTransferV4=QB;function JB(t){if(t.actions.length>255)throw Error("Maximum number of OutActions in a single request is 255");if(t={...t},t.authType==="extension")return(0,lr.beginCell)().storeUint(b0.WalletContractV5R1.OpCodes.auth_extension,32).storeUint(t.queryId??0,64).store((0,p0.storeOutListExtendedV5R1)(t.actions)).endCell();t.actions=(0,p0.patchV5R1ActionsSendMode)(t.actions,t.authType);let e=(0,lr.beginCell)().storeUint(t.authType==="internal"?b0.WalletContractV5R1.OpCodes.auth_signed_internal:b0.WalletContractV5R1.OpCodes.auth_signed_external,32).store(t.walletId);if(t.seqno===0)for(let r=0;r<32;r++)e.storeBit(1);else e.storeUint(t.timeout||Math.floor(Date.now()/1e3)+60,32);return e.storeUint(t.seqno,32).store((0,p0.storeOutListExtendedV5R1)(t.actions)),(0,$B.signPayload)(t,e,GB)}dn.createWalletTransferV5R1=JB});var rg=W(dc=>{"use strict";x();S();Object.defineProperty(dc,"__esModule",{value:!0});dc.WalletContractV4=void 0;var sa=Yr(),eA=l0(),of=class{static create(e){return new of(e.workchain,e.publicKey,e.walletId)}constructor(e,r,n){this.workchain=e,this.publicKey=r,n!=null?this.walletId=n:this.walletId=698983191+e;let i=sa.Cell.fromBoc(v.Buffer.from("te6ccgECFAEAAtQAART/APSkE/S88sgLAQIBIAIDAgFIBAUE+PKDCNcYINMf0x/THwL4I7vyZO1E0NMf0x/T//QE0VFDuvKhUVG68qIF+QFUEGT5EPKj+AAkpMjLH1JAyx9SMMv/UhD0AMntVPgPAdMHIcAAn2xRkyDXSpbTB9QC+wDoMOAhwAHjACHAAuMAAcADkTDjDQOkyMsfEssfy/8QERITAubQAdDTAyFxsJJfBOAi10nBIJJfBOAC0x8hghBwbHVnvSKCEGRzdHK9sJJfBeAD+kAwIPpEAcjKB8v/ydDtRNCBAUDXIfQEMFyBAQj0Cm+hMbOSXwfgBdM/yCWCEHBsdWe6kjgw4w0DghBkc3RyupJfBuMNBgcCASAICQB4AfoA9AQw+CdvIjBQCqEhvvLgUIIQcGx1Z4MesXCAGFAEywUmzxZY+gIZ9ADLaRfLH1Jgyz8gyYBA+wAGAIpQBIEBCPRZMO1E0IEBQNcgyAHPFvQAye1UAXKwjiOCEGRzdHKDHrFwgBhQBcsFUAPPFiP6AhPLassfyz/JgED7AJJfA+ICASAKCwBZvSQrb2omhAgKBrkPoCGEcNQICEekk30pkQzmkD6f+YN4EoAbeBAUiYcVnzGEAgFYDA0AEbjJftRNDXCx+AA9sp37UTQgQFA1yH0BDACyMoHy//J0AGBAQj0Cm+hMYAIBIA4PABmtznaiaEAga5Drhf/AABmvHfaiaEAQa5DrhY/AAG7SB/oA1NQi+QAFyMoHFcv/ydB3dIAYyMsFywIizxZQBfoCFMtrEszMyXP7AMhAFIEBCPRR8qcCAHCBAQjXGPoA0z/IVCBHgQEI9FHyp4IQbm90ZXB0gBjIywXLAlAGzxZQBPoCFMtqEssfyz/Jc/sAAgBsgQEI1xj6ANM/MFIkgQEI9Fnyp4IQZHN0cnB0gBjIywXLAlAFzxZQA/oCE8tqyx8Syz/Jc/sAAAr0AMntVA==","base64"))[0],o=(0,sa.beginCell)().storeUint(0,32).storeUint(this.walletId,32).storeBuffer(this.publicKey).storeBit(0).endCell();this.init={code:i,data:o},this.address=(0,sa.contractAddress)(e,{code:i,data:o})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){return(await e.getState()).state.type==="active"?(await e.get("seqno",[])).stack.readNumber():0}async send(e,r){await e.external(r)}async sendTransfer(e,r){let n=this.createTransfer(r);await this.send(e,n)}createTransfer(e){let r=sa.SendMode.PAY_GAS_SEPARATELY+sa.SendMode.IGNORE_ERRORS;return e.sendMode!==null&&e.sendMode!==void 0&&(r=e.sendMode),(0,eA.createWalletTransferV4)({seqno:e.seqno,sendMode:r,secretKey:e.secretKey,messages:e.messages,timeout:e.timeout,walletId:this.walletId})}sender(e,r){return{send:async n=>{let i=await this.getSeqno(e),o=this.createTransfer({seqno:i,secretKey:r,sendMode:n.sendMode,messages:[(0,sa.internal)({to:n.to,value:n.value,init:n.init,body:n.body,bounce:n.bounce})]});await this.send(e,o)}}}};dc.WalletContractV4=of});var ng=W(hc=>{"use strict";x();S();Object.defineProperty(hc,"__esModule",{value:!0});hc.VenomWalletV3=void 0;var hn=Yr(),tA=Xn(),sf=class{static create(e){return new sf(e.workchain,e.publicKey,e.walletId)}constructor(e,r,n){this.workchain=e,this.publicKey=r,n!=null?this.walletId=n:this.walletId=1269378442+e;let i=hn.Cell.fromBoc(v.Buffer.from("te6ccgEBAQEAcQAA3v8AIN0gggFMl7ohggEznLqxn3Gw7UTQ0x/THzHXC//jBOCk8mCDCNcYINMf0x/TH/gjE7vyY+1E0NMf0x/T/9FRMrryoVFEuvKiBPkBVBBV+RDyo/gAkyDXSpbTB9QC+wDo0QGkyMsfyx/L/8ntVA==","base64"))[0],o=(0,hn.beginCell)().storeUint(0,32).storeUint(this.walletId,32).storeBuffer(r).endCell();this.init={code:i,data:o},this.address=(0,hn.contractAddress)(e,{code:i,data:o})}createTransfer(e){let r=hn.SendMode.PAY_GAS_SEPARATELY+hn.SendMode.IGNORE_ERRORS;e.sendMode!==null&&e.sendMode!==void 0&&(r=e.sendMode);let n=this.createWalletTransferV3Venom({seqno:e.seqno,sendMode:r,secretKey:e.secretKey,messages:e.messages,timeout:e.timeout,walletId:this.walletId,globalId:e.globalId}),i=(0,hn.external)({to:this.address,init:e.seqno===0?{code:this.init.code,data:this.init.data}:void 0,body:n});return(0,hn.beginCell)().store((0,hn.storeMessage)(i)).endCell()}createWalletTransferV3Venom(e){if(e.messages.length>4)throw Error("Maximum number of messages in a single transfer is 4");let r=(0,hn.beginCell)().storeUint(e.walletId,32);if(e.seqno===0)for(let a=0;a<32;a++)r.storeBit(1);else r.storeUint(e.timeout||Math.floor(Date.now()/1e3)+600,32);r.storeUint(e.seqno,32);for(let a of e.messages)r.storeUint(e.sendMode,8),r.storeRef((0,hn.beginCell)().store((0,hn.storeMessageRelaxed)(a)));let n=v.Buffer.allocUnsafe(4);n.writeInt32BE(e.globalId);let i=v.Buffer.concat([n,r.endCell().hash()],36),o=tA.signUtil.ed25519.sign(i,e.secretKey);return(0,hn.beginCell)().storeBuffer(v.Buffer.from(o)).storeBuilder(r).endCell()}};hc.VenomWalletV3=sf});var aa=W(Fn=>{"use strict";x();S();Object.defineProperty(Fn,"__esModule",{value:!0});Fn.VenomWalletV3=Fn.WalletContractV5R1=Fn.WalletContractV4=Fn.WalletContractV3R2=void 0;var rA=K3();Object.defineProperty(Fn,"WalletContractV3R2",{enumerable:!0,get:function(){return rA.WalletContractV3R2}});var nA=rg();Object.defineProperty(Fn,"WalletContractV4",{enumerable:!0,get:function(){return nA.WalletContractV4}});var iA=c0();Object.defineProperty(Fn,"WalletContractV5R1",{enumerable:!0,get:function(){return iA.WalletContractV5R1}});var oA=ng();Object.defineProperty(Fn,"VenomWalletV3",{enumerable:!0,get:function(){return oA.VenomWalletV3}})});var bc=W(or=>{"use strict";x();S();Object.defineProperty(or,"__esModule",{value:!0});or.toBase64Address=or.convertAddress=or.validateAddress=or.getVenomAddressBySeed=or.parseAddress=or.getAddressBySeed=or.checkSeed=or.getPubKeyBySeed=or.getWalletContract=void 0;var zn=Xn(),sA=aa(),fa=Yr(),ig=aa();function og(t,e,r){if(typeof e=="string"&&(e=zn.base.fromHex(e)),r=r||0,!t||t=="v4r2"||t=="v4R2")return ig.WalletContractV4.create({workchain:r,publicKey:v.Buffer.from(e)});if(t=="v5r1"||t=="v5R1")return ig.WalletContractV5R1.create({workchain:r,publicKey:v.Buffer.from(e)});throw new Error("invalid wallet version")}or.getWalletContract=og;function aA(t){g0(t);let{publicKey:e}=zn.signUtil.ed25519.fromSeed(zn.base.fromHex(t));return zn.base.toHex(e)}or.getPubKeyBySeed=aA;function g0(t){if(!zn.base.validateHexString(t))throw new Error("invalid key");let e=zn.base.fromHex(t.toLowerCase());if(!e||e.length!=32||e.every(r=>r===0))throw new Error("invalid key")}or.checkSeed=g0;function fA(t,e){g0(t);let{publicKey:r}=zn.signUtil.ed25519.fromSeed(zn.base.fromHex(t));return og(e,r).address.toString({bounceable:!1})}or.getAddressBySeed=fA;function sg(t){try{if(fa.Address.isRaw(t))return{address:fa.Address.parseRaw(t),isRaw:!0,isValid:!0};if(fa.Address.isFriendly(t)){let e=fa.Address.parseFriendly(t);return e.isTestOnly?{isValid:!1}:{...e,isUserFriendly:!0,isValid:!0}}}catch{}return{isValid:!1}}or.parseAddress=sg;function uA(t){let{publicKey:e}=zn.signUtil.ed25519.fromSeed(zn.base.fromHex(t));return sA.VenomWalletV3.create({workchain:0,publicKey:v.Buffer.from(e)}).address.toRawString()}or.getVenomAddressBySeed=uA;function cA(t){try{return fa.Address.parse(t)}catch{return!1}}or.validateAddress=cA;function lA(t){let e=sg(t);if(e.isValid){let r=e.address?.toRawString(),n=e.address?.toString({bounceable:!0,urlSafe:!0}),i=e.address?.toString({bounceable:!1,urlSafe:!0});return{raw:r,addrBounceable:{bounceable:!0,urlSafe:!0,userFriendlyBounceable:n},addrUnounceable:{bounceable:!1,urlSafe:!0,userFriendlyUnbounceable:i}}}else return e}or.convertAddress=lA;function dA(t,e=!0,r){return typeof t=="string"&&(t=fa.Address.parse(t)),t.toString({urlSafe:!0,bounceable:e,testOnly:r==="testnet"})}or.toBase64Address=dA});var pc=W(Zt=>{"use strict";x();S();Object.defineProperty(Zt,"__esModule",{value:!0});Zt.NFT_TRANSFER_TONCOIN_FORWARD_AMOUNT=Zt.NFT_TRANSFER_TONCOIN_AMOUNT=Zt.TOKEN_TRANSFER_TONCOIN_FORWARD_AMOUNT=Zt.TOKEN_TRANSFER_TONCOIN_AMOUNT=Zt.NOTCOIN_EXCHANGERS=Zt.NOTCOIN_FORWARD_TON_AMOUNT=Zt.BURN_CHUNK_DURATION_APPROX_SEC=Zt.NOTCOIN_VOUCHERS_ADDRESS=Zt.NFT_BATCH_SIZE=Zt.TRANSFER_TIMEOUT_SEC=void 0;Zt.TRANSFER_TIMEOUT_SEC=600;Zt.NFT_BATCH_SIZE=4;Zt.NOTCOIN_VOUCHERS_ADDRESS="EQDmkj65Ab_m0aZaW8IpKw4kYqIgITw_HRstYEkVQ6NIYCyW";Zt.BURN_CHUNK_DURATION_APPROX_SEC=30;Zt.NOTCOIN_FORWARD_TON_AMOUNT=30000000n;Zt.NOTCOIN_EXCHANGERS=["EQAPZauWVPUcm2hUJT9n36pxznEhl46rEn1bzBXN0RY_yiy2","EQASgm0Qv3h2H2mF0W06ikPqYq2ctT3dyXMJH_svbEKKB3iZ","EQArlmP-RhVIG2yAFGZyPZfM3m0YccxmpvoRi6sgRzWnAA0s","EQA6pL-spYqZp1Ck6o3rpY45Cl-bvLMW_j3qdVejOkUWpLnm","EQBJ_ehYjumQKbXfWUue1KHKXdTm1GuYJB0Fj2ST_DwORvpd","EQBRmYSjxh9xlZpUqEmGjF5UjukI9v_Cm2kCTu4CoBn3XkOD","EQBkiqncd7AFT5_23H-RoA2Vynk-Nzq_dLoeMVRthAU9RF0p","EQB_OzTHXbztABe0QHgr4PtAV8T64LR6aDunXgaAoihOdxwO","EQCL-x5kLg6tKVNGryItTuj6tG3FH5mhUEu0xRqQc-kbEmbe","EQCZh2yJ46RaQH3AYmjEA8SMMXi77Oein4-3lvqkHseIAhD-","EQChKo5IK3iNqUHUGDB9gtzjCjMTPtmsFqekuCA2MdreVEyu","EQC6DNCBv076TIliRMfOt20RpbS7rNKDfSky3WrFEapFt8AH","EQDE_XFZOYae_rl3ZMsgBCtRSmYhl8B4y2BZEP7oiGBDhlgy","EQDddqpGA2ePXQF47A2DSL3GF6ZzIVmimfM2d16cdymy2noT","EQDv0hNNAamhYltCh3pTJrq3oRB9RW2ZhEYkTP6fhj5BtZNu","EQD2mP7zgO7-imUJhqYry3i07aJ_SR53DaokMupfAAobt0Xw"];Zt.TOKEN_TRANSFER_TONCOIN_AMOUNT=100000000n;Zt.TOKEN_TRANSFER_TONCOIN_FORWARD_AMOUNT=1n;Zt.NFT_TRANSFER_TONCOIN_AMOUNT=100000000n;Zt.NFT_TRANSFER_TONCOIN_FORWARD_AMOUNT=1n});var m0=W(Ur=>{"use strict";x();S();Object.defineProperty(Ur,"__esModule",{value:!0});Ur.buildNftTransferPayload=Ur.buildNotcoinVoucherExchange=Ur.packBytesAsSnake=Ur.commentToBytes=Ur.OpCode=Ur.NftOpCode=void 0;var xo=Yr(),y0=pc(),hA=v0(),ag;(function(t){t[t.TransferOwnership=1607220500]="TransferOwnership",t[t.OwnershipAssigned=85167505]="OwnershipAssigned"})(ag=Ur.NftOpCode||(Ur.NftOpCode={}));var fg;(function(t){t[t.Comment=0]="Comment",t[t.Encrypted=560454219]="Encrypted"})(fg=Ur.OpCode||(Ur.OpCode={}));function ug(t){let e=v.Buffer.from(t),r=new Uint8Array(e.length+4),n=v.Buffer.alloc(4);return n.writeUInt32BE(fg.Comment),r.set(n,0),r.set(e,4),r}Ur.commentToBytes=ug;var bA=127;function cg(t,e=bA){let r=v.Buffer.from(t);if(r.length<=e)return t;let n=new xo.Builder,i,o=n;for(let[a,s]of r.entries())o.availableBits<8&&(i?.storeRef(o),i=o,o=new xo.Builder),o=o.storeUint(s,8),a===r.length-1&&i?.storeRef(o);return n.asCell()}Ur.packBytesAsSnake=cg;function pA(t,e,r){let n=xo.Address.parse(e).hash.readUint8()>>4,i=y0.NOTCOIN_EXCHANGERS[n],o=new xo.Builder().storeUint(1609328194,32).storeUint(r,64).endCell();return lg(t,i,o,y0.NOTCOIN_FORWARD_TON_AMOUNT)}Ur.buildNotcoinVoucherExchange=pA;function lg(t,e,r,n=y0.NFT_TRANSFER_TONCOIN_FORWARD_AMOUNT){let i=new xo.Builder().storeUint(ag.TransferOwnership,32).storeUint((0,hA.generateQueryId)(),64).storeAddress(xo.Address.parse(e)).storeAddress(xo.Address.parse(t)).storeBit(!1).storeCoins(n),o;if(r)if(typeof r=="string"){let a=ug(r),s=Math.floor(i.availableBits/8);o=cg(a,s)}else o=r;return o instanceof Uint8Array?(i.storeBit(0),i=i.storeBuffer(v.Buffer.from(o))):i=i.storeMaybeRef(o),i.endCell()}Ur.buildNftTransferPayload=lg});var v0=W(bn=>{"use strict";x();S();Object.defineProperty(bn,"__esModule",{value:!0});bn.bigintRandom=bn.generateQueryId=bn.buildNotcoinVoucherExchange=bn.buildNftTransferPayload=bn.signMultiTransaction=void 0;var gA=Mo(),yA=gc();Object.defineProperty(bn,"signMultiTransaction",{enumerable:!0,get:function(){return yA.signMultiTransaction}});var dg=m0();Object.defineProperty(bn,"buildNftTransferPayload",{enumerable:!0,get:function(){return dg.buildNftTransferPayload}});Object.defineProperty(bn,"buildNotcoinVoucherExchange",{enumerable:!0,get:function(){return dg.buildNotcoinVoucherExchange}});function mA(){return hg(8)}bn.generateQueryId=mA;function hg(t){let e=BigInt(0);for(let r of(0,gA.randomBytes)(t)){let n=BigInt(r);e=(e<<BigInt(8))+n}return e}bn.bigintRandom=hg});var gc=W(yr=>{"use strict";x();S();Object.defineProperty(yr,"__esModule",{value:!0});yr.setSignatureAuth=yr.removeExtension=yr.addExtension=yr.signMultiTransaction=yr.jettonMultiTransfer=yr.jettonTransfer=yr.venomTransfer=yr.transfer=void 0;var ua=aa(),Wr=Xn(),Lt=Yr(),So=bc(),bg=v0(),vA=pc();function Bo(t,e,r){return(0,Lt.beginCell)().storeWritable((0,Lt.storeMessage)((0,Lt.external)({to:t.address,init:e===0?t.init:void 0,body:r}))).endCell()}function ca(t,e){if(!!e){if(t instanceof ua.WalletContractV4)throw new Error("Wallet contract v4 cannot set auth type");if(e!="internal"&&e!="external"&&e!="extension")throw new Error("Auth type can only be 'internal', 'external', or 'extension'");return e}}function Ao(t,e){if(!t&&!e)throw new Error("privateKey or publicKey is required");let r=v.Buffer.alloc(64),n,i=!1;if(t){let{secretKey:o,publicKey:a}=Wr.signUtil.ed25519.fromSeed(Wr.base.fromHex(t));r=v.Buffer.from(o),n=v.Buffer.from(a)}else n=Wr.base.fromHex(e),i=!0;return{secretK:r,publicK:n,isForSimulate:i}}function wA(t){return t.address.toString({bounceable:!1})}function la(t,e,r){if(r==="internal"&&e===0)return(0,Lt.beginCell)().storeWritable((0,Lt.storeStateInit)(t.init)).endCell().toBoc().toString("base64")}function yc(t,e,r,n,i,o,a){let s;if(e=="extension"){if(!(t instanceof ua.WalletContractV5R1))throw new Error("Transfer by extension auth only available for contract v5r1");s=t.createTransfer({seqno:i,messages:r,sendMode:o,timeout:a,authType:e})}else s=t.createTransfer({seqno:i,messages:r,secretKey:n,sendMode:o,timeout:a,authType:e});return s}function _A(t,e){let{secretK:r,publicK:n,isForSimulate:i}=Ao(e,t.publicKey),o=(0,So.getWalletContract)(t.walletVersion,n),a=ca(o,t.authType),s=[(0,Lt.internal)({to:t.to,value:BigInt(t.amount),bounce:!1,body:t.memo})],u=yc(o,a,s,r,t.seqno,t.sendMode,t.expireAt);return!i&&a!="internal"&&a!="extension"&&(u=Bo(o,t.seqno,u)),{boc:Wr.base.toBase64(u.toBoc()),stateInit:la(o,t.seqno,a),address:wA(o)}}yr.transfer=_A;function xA(t,e){let{secretKey:r,publicKey:n}=Wr.signUtil.ed25519.fromSeed(Wr.base.fromHex(e)),i=ua.VenomWalletV3.create({workchain:0,publicKey:v.Buffer.from(n)}),o=[(0,Lt.internal)({to:t.to,value:BigInt(t.amount),bounce:t.toIsInit,body:t.memo})],a=i.createTransfer({seqno:t.seqno,messages:o,secretKey:v.Buffer.from(r),globalId:t.globalId,sendMode:t.sendMode,timeout:t.expireAt});return{id:Wr.base.toBase64(a.hash()),body:Wr.base.toBase64(a.toBoc())}}yr.venomTransfer=xA;function SA(t,e){let{secretK:r,publicK:n,isForSimulate:i}=Ao(e,t.publicKey),o=(0,So.getWalletContract)(t.walletVersion,n),a=ca(o,t.authType),s=t.responseAddr?Lt.Address.parse(t.responseAddr):o.address,u=Lt.Address.parse(t.to),h=Lt.Address.parse(t.fromJettonAccount);if(t.decimal<0)throw new Error("invalid decimal");if(BigInt(t.amount)<0)throw new Error("invalid amount");let p=t.queryId?BigInt(t.queryId):(0,bg.generateQueryId)(),M,A=t.customPayload?Lt.Cell.fromBase64(t.customPayload):void 0,P=(0,Lt.beginCell)().storeUint(260734629,32).storeUint(p,64).storeCoins(BigInt(t.amount)).storeAddress(u).storeAddress(s).storeMaybeRef(A).storeCoins(BigInt(t.invokeNotificationFee||"1"));if(t.memo){let z=(0,Lt.beginCell)().storeUint(0,32).storeStringTail(t.memo).endCell();M=P.storeBit(!0).storeRef(z).endCell()}else M=P.storeBit(!1).endCell();let E=[(0,Lt.internal)({to:h,value:BigInt(t.messageAttachedTons||"50000000"),body:M,bounce:!1})],q=yc(o,a,E,r,t.seqno,t.sendMode,t.expireAt);return!i&&a!=="internal"&&(q=Bo(o,t.seqno,q)),{boc:Wr.base.toBase64(q.toBoc()),stateInit:la(o,t.seqno,a),address:o.address.toString()}}yr.jettonTransfer=SA;function BA(t,e){let{secretK:r,publicK:n,isForSimulate:i}=Ao(e,t.publicKey),o=(0,So.getWalletContract)(t.walletVersion,n),a=ca(o,t.authType),s=t.messages.map(h=>{let w=h.responseAddr?Lt.Address.parse(h.responseAddr):o.address,p=Lt.Address.parse(h.to),M=Lt.Address.parse(h.fromJettonAccount);if(h.decimal<0)throw new Error("invalid decimal");if(BigInt(h.amount)<0)throw new Error("invalid amount");let P=h.queryId?BigInt(h.queryId):(0,bg.generateQueryId)(),E,q=(0,Lt.beginCell)().storeUint(260734629,32).storeUint(P,64).storeCoins(BigInt(h.amount)).storeAddress(p).storeAddress(w).storeBit(!1).storeCoins(BigInt(h.invokeNotificationFee||"1"));if(h.memo){let z=(0,Lt.beginCell)().storeUint(0,32).storeStringTail(h.memo).endCell();E=q.storeBit(!0).storeRef(z).endCell()}else E=q.storeBit(!1).endCell();return(0,Lt.internal)({to:M,value:BigInt(h.messageAttachedTons||"50000000"),body:E,bounce:!1})}),u=yc(o,a,s,r,t.seqno,t.sendMode,t.expireAt);return!i&&a!=="internal"&&(u=Bo(o,t.seqno,u)),{boc:Wr.base.toBase64(u.toBoc()),stateInit:la(o,t.seqno,a),address:o.address.toString()}}yr.jettonMultiTransfer=BA;async function AA(t,e,r,n,i,o,a,s){n||(n=Math.round(Date.now()/1e3)+vA.TRANSFER_TIMEOUT_SEC);let u=e.map(z=>{let{amount:J,toAddress:$,stateInit:ee,isBase64Payload:Y}=z,{payload:Z}=z;if(Y&&typeof Z=="string")Z=Lt.Cell.fromBase64(Z);else if(typeof Z=="string")try{Z=Lt.Cell.fromBase64(Z)}catch{}let ne=ee?{code:ee.refs[0],data:ee.refs[1]}:void 0;return(0,Lt.internal)({value:J,to:$,body:Z,bounce:(0,So.parseAddress)($).isBounceable,init:ne})}),{secretK:h,publicK:w,isForSimulate:p}=Ao(t,o),M=(0,So.getWalletContract)(s,w,i),A=yc(M,void 0,u,h,r,Lt.SendMode.PAY_GAS_SEPARATELY+Lt.SendMode.IGNORE_ERRORS,n);!p&&a!=="internal"&&(A=Bo(M,r,A));let P=Wr.base.toBase64(A.toBoc()),q=Bo(M,r,A).toBoc().toString("base64");return{seqno:r,transaction:P,externalMessage:q}}yr.signMultiTransaction=AA;function MA(t,e){let{secretK:r,publicK:n,isForSimulate:i}=Ao(e,t.publicKey);if(t.walletVersion&&t.walletVersion!="v5r1"&&t.walletVersion!="v5R1")throw new Error("Extension actions only available for wallet contract v5");if(!t.extensionAddress)throw new Error("Adding extension requires extensionAddress");let o=ua.WalletContractV5R1.create({workchain:0,publicKey:v.Buffer.from(n)}),a=ca(o,t.authType),s=(0,So.parseAddress)(t.extensionAddress).address,u;return a=="extension"?u=o.createAddExtension({seqno:t.seqno,timeout:t.expireAt,extensionAddress:s,authType:a}):u=o.createAddExtension({seqno:t.seqno,secretKey:r,timeout:t.expireAt,extensionAddress:s,authType:a}),!i&&a!=="internal"&&(u=Bo(o,t.seqno,u)),{boc:Wr.base.toBase64(u.toBoc()),stateInit:la(o,t.seqno,a),address:o.address.toString()}}yr.addExtension=MA;function EA(t,e){let{secretK:r,publicK:n,isForSimulate:i}=Ao(e,t.publicKey);if(t.walletVersion&&t.walletVersion!="v5r1"&&t.walletVersion!="v5R1")throw new Error("Extension actions only available for wallet contract v5");if(!t.extensionAddress)throw new Error("Removing extension requires extensionAddress");let o=ua.WalletContractV5R1.create({workchain:0,publicKey:v.Buffer.from(n)}),a=ca(o,t.authType),s=(0,So.parseAddress)(t.extensionAddress).address,u;return a=="extension"?u=o.createRemoveExtension({seqno:t.seqno,timeout:t.expireAt,extensionAddress:s,authType:a}):u=o.createRemoveExtension({seqno:t.seqno,secretKey:r,timeout:t.expireAt,extensionAddress:s,authType:a}),!i&&a!=="internal"&&(u=Bo(o,t.seqno,u)),{boc:Wr.base.toBase64(u.toBoc()),stateInit:la(o,t.seqno,a),address:o.address.toString()}}yr.removeExtension=EA;function IA(t){let{publicK:e}=Ao("",t.publicKey);if(t.walletVersion&&t.walletVersion!="v5r1"&&t.walletVersion!="v5R1")throw new Error("Extension actions only available for wallet contract v5");if(t.isSignatureAuthEnabled==null)throw new Error("Setting signature auth requires isSignatureAuthEnabled");let r=ua.WalletContractV5R1.create({workchain:0,publicKey:v.Buffer.from(e)}),n=ca(r,t.authType);if(n!="extension")throw new Error("Setting signature auth requires authType = extension");let i=r.createSetIsPublicKeyEnabled({seqno:t.seqno,timeout:t.expireAt,isEnabled:t.isSignatureAuthEnabled,authType:n});return{boc:Wr.base.toBase64(i.toBoc()),stateInit:la(r,t.seqno,n),address:r.address.toString()}}yr.setSignatureAuth=IA});var pg=W((mc,w0)=>{x();S();(function(t,e){typeof mc=="object"&&typeof w0=="object"?w0.exports=e():typeof define=="function"&&define.amd?define([],e):typeof mc=="object"?mc["tonweb-mnemonic"]=e():(t.TonWeb=t.TonWeb||{},t.TonWeb.mnemonic=e())})(self,function(){return(()=>{var t={780:(i,o,a)=>{(function(s){"use strict";var u=function(B){var m,I=new Float64Array(16);if(B)for(m=0;m<B.length;m++)I[m]=B[m];return I},h=function(){throw new Error("no PRNG")},w=new Uint8Array(16),p=new Uint8Array(32);p[0]=9;var M=u(),A=u([1]),P=u([56129,1]),E=u([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),q=u([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),z=u([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),J=u([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),$=u([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function ee(B,m,I,l){B[m]=I>>24&255,B[m+1]=I>>16&255,B[m+2]=I>>8&255,B[m+3]=255&I,B[m+4]=l>>24&255,B[m+5]=l>>16&255,B[m+6]=l>>8&255,B[m+7]=255&l}function Y(B,m,I,l,y){var L,F=0;for(L=0;L<y;L++)F|=B[m+L]^I[l+L];return(1&F-1>>>8)-1}function Z(B,m,I,l){return Y(B,m,I,l,16)}function ne(B,m,I,l){return Y(B,m,I,l,32)}function re(B,m,I,l){(function(y,L,F,X){for(var j,be=255&X[0]|(255&X[1])<<8|(255&X[2])<<16|(255&X[3])<<24,we=255&F[0]|(255&F[1])<<8|(255&F[2])<<16|(255&F[3])<<24,de=255&F[4]|(255&F[5])<<8|(255&F[6])<<16|(255&F[7])<<24,Re=255&F[8]|(255&F[9])<<8|(255&F[10])<<16|(255&F[11])<<24,Be=255&F[12]|(255&F[13])<<8|(255&F[14])<<16|(255&F[15])<<24,ve=255&X[4]|(255&X[5])<<8|(255&X[6])<<16|(255&X[7])<<24,Ke=255&L[0]|(255&L[1])<<8|(255&L[2])<<16|(255&L[3])<<24,Ie=255&L[4]|(255&L[5])<<8|(255&L[6])<<16|(255&L[7])<<24,Ee=255&L[8]|(255&L[9])<<8|(255&L[10])<<16|(255&L[11])<<24,ze=255&L[12]|(255&L[13])<<8|(255&L[14])<<16|(255&L[15])<<24,Ae=255&X[8]|(255&X[9])<<8|(255&X[10])<<16|(255&X[11])<<24,_e=255&F[16]|(255&F[17])<<8|(255&F[18])<<16|(255&F[19])<<24,De=255&F[20]|(255&F[21])<<8|(255&F[22])<<16|(255&F[23])<<24,et=255&F[24]|(255&F[25])<<8|(255&F[26])<<16|(255&F[27])<<24,Ne=255&F[28]|(255&F[29])<<8|(255&F[30])<<16|(255&F[31])<<24,ae=255&X[12]|(255&X[13])<<8|(255&X[14])<<16|(255&X[15])<<24,ue=be,xe=we,pe=de,ge=Re,me=Be,Je=ve,rt=Ke,Qe=Ie,ut=Ee,lt=ze,bt=Ae,je=_e,We=De,$e=et,Ge=Ne,Ve=ae,ot=0;ot<20;ot+=2)ue^=(j=(We^=(j=(ut^=(j=(me^=(j=ue+We|0)<<7|j>>>25)+ue|0)<<9|j>>>23)+me|0)<<13|j>>>19)+ut|0)<<18|j>>>14,Je^=(j=(xe^=(j=($e^=(j=(lt^=(j=Je+xe|0)<<7|j>>>25)+Je|0)<<9|j>>>23)+lt|0)<<13|j>>>19)+$e|0)<<18|j>>>14,bt^=(j=(rt^=(j=(pe^=(j=(Ge^=(j=bt+rt|0)<<7|j>>>25)+bt|0)<<9|j>>>23)+Ge|0)<<13|j>>>19)+pe|0)<<18|j>>>14,Ve^=(j=(je^=(j=(Qe^=(j=(ge^=(j=Ve+je|0)<<7|j>>>25)+Ve|0)<<9|j>>>23)+ge|0)<<13|j>>>19)+Qe|0)<<18|j>>>14,ue^=(j=(ge^=(j=(pe^=(j=(xe^=(j=ue+ge|0)<<7|j>>>25)+ue|0)<<9|j>>>23)+xe|0)<<13|j>>>19)+pe|0)<<18|j>>>14,Je^=(j=(me^=(j=(Qe^=(j=(rt^=(j=Je+me|0)<<7|j>>>25)+Je|0)<<9|j>>>23)+rt|0)<<13|j>>>19)+Qe|0)<<18|j>>>14,bt^=(j=(lt^=(j=(ut^=(j=(je^=(j=bt+lt|0)<<7|j>>>25)+bt|0)<<9|j>>>23)+je|0)<<13|j>>>19)+ut|0)<<18|j>>>14,Ve^=(j=(Ge^=(j=($e^=(j=(We^=(j=Ve+Ge|0)<<7|j>>>25)+Ve|0)<<9|j>>>23)+We|0)<<13|j>>>19)+$e|0)<<18|j>>>14;ue=ue+be|0,xe=xe+we|0,pe=pe+de|0,ge=ge+Re|0,me=me+Be|0,Je=Je+ve|0,rt=rt+Ke|0,Qe=Qe+Ie|0,ut=ut+Ee|0,lt=lt+ze|0,bt=bt+Ae|0,je=je+_e|0,We=We+De|0,$e=$e+et|0,Ge=Ge+Ne|0,Ve=Ve+ae|0,y[0]=ue>>>0&255,y[1]=ue>>>8&255,y[2]=ue>>>16&255,y[3]=ue>>>24&255,y[4]=xe>>>0&255,y[5]=xe>>>8&255,y[6]=xe>>>16&255,y[7]=xe>>>24&255,y[8]=pe>>>0&255,y[9]=pe>>>8&255,y[10]=pe>>>16&255,y[11]=pe>>>24&255,y[12]=ge>>>0&255,y[13]=ge>>>8&255,y[14]=ge>>>16&255,y[15]=ge>>>24&255,y[16]=me>>>0&255,y[17]=me>>>8&255,y[18]=me>>>16&255,y[19]=me>>>24&255,y[20]=Je>>>0&255,y[21]=Je>>>8&255,y[22]=Je>>>16&255,y[23]=Je>>>24&255,y[24]=rt>>>0&255,y[25]=rt>>>8&255,y[26]=rt>>>16&255,y[27]=rt>>>24&255,y[28]=Qe>>>0&255,y[29]=Qe>>>8&255,y[30]=Qe>>>16&255,y[31]=Qe>>>24&255,y[32]=ut>>>0&255,y[33]=ut>>>8&255,y[34]=ut>>>16&255,y[35]=ut>>>24&255,y[36]=lt>>>0&255,y[37]=lt>>>8&255,y[38]=lt>>>16&255,y[39]=lt>>>24&255,y[40]=bt>>>0&255,y[41]=bt>>>8&255,y[42]=bt>>>16&255,y[43]=bt>>>24&255,y[44]=je>>>0&255,y[45]=je>>>8&255,y[46]=je>>>16&255,y[47]=je>>>24&255,y[48]=We>>>0&255,y[49]=We>>>8&255,y[50]=We>>>16&255,y[51]=We>>>24&255,y[52]=$e>>>0&255,y[53]=$e>>>8&255,y[54]=$e>>>16&255,y[55]=$e>>>24&255,y[56]=Ge>>>0&255,y[57]=Ge>>>8&255,y[58]=Ge>>>16&255,y[59]=Ge>>>24&255,y[60]=Ve>>>0&255,y[61]=Ve>>>8&255,y[62]=Ve>>>16&255,y[63]=Ve>>>24&255})(B,m,I,l)}function ye(B,m,I,l){(function(y,L,F,X){for(var j,be=255&X[0]|(255&X[1])<<8|(255&X[2])<<16|(255&X[3])<<24,we=255&F[0]|(255&F[1])<<8|(255&F[2])<<16|(255&F[3])<<24,de=255&F[4]|(255&F[5])<<8|(255&F[6])<<16|(255&F[7])<<24,Re=255&F[8]|(255&F[9])<<8|(255&F[10])<<16|(255&F[11])<<24,Be=255&F[12]|(255&F[13])<<8|(255&F[14])<<16|(255&F[15])<<24,ve=255&X[4]|(255&X[5])<<8|(255&X[6])<<16|(255&X[7])<<24,Ke=255&L[0]|(255&L[1])<<8|(255&L[2])<<16|(255&L[3])<<24,Ie=255&L[4]|(255&L[5])<<8|(255&L[6])<<16|(255&L[7])<<24,Ee=255&L[8]|(255&L[9])<<8|(255&L[10])<<16|(255&L[11])<<24,ze=255&L[12]|(255&L[13])<<8|(255&L[14])<<16|(255&L[15])<<24,Ae=255&X[8]|(255&X[9])<<8|(255&X[10])<<16|(255&X[11])<<24,_e=255&F[16]|(255&F[17])<<8|(255&F[18])<<16|(255&F[19])<<24,De=255&F[20]|(255&F[21])<<8|(255&F[22])<<16|(255&F[23])<<24,et=255&F[24]|(255&F[25])<<8|(255&F[26])<<16|(255&F[27])<<24,Ne=255&F[28]|(255&F[29])<<8|(255&F[30])<<16|(255&F[31])<<24,ae=255&X[12]|(255&X[13])<<8|(255&X[14])<<16|(255&X[15])<<24,ue=0;ue<20;ue+=2)be^=(j=(De^=(j=(Ee^=(j=(Be^=(j=be+De|0)<<7|j>>>25)+be|0)<<9|j>>>23)+Be|0)<<13|j>>>19)+Ee|0)<<18|j>>>14,ve^=(j=(we^=(j=(et^=(j=(ze^=(j=ve+we|0)<<7|j>>>25)+ve|0)<<9|j>>>23)+ze|0)<<13|j>>>19)+et|0)<<18|j>>>14,Ae^=(j=(Ke^=(j=(de^=(j=(Ne^=(j=Ae+Ke|0)<<7|j>>>25)+Ae|0)<<9|j>>>23)+Ne|0)<<13|j>>>19)+de|0)<<18|j>>>14,ae^=(j=(_e^=(j=(Ie^=(j=(Re^=(j=ae+_e|0)<<7|j>>>25)+ae|0)<<9|j>>>23)+Re|0)<<13|j>>>19)+Ie|0)<<18|j>>>14,be^=(j=(Re^=(j=(de^=(j=(we^=(j=be+Re|0)<<7|j>>>25)+be|0)<<9|j>>>23)+we|0)<<13|j>>>19)+de|0)<<18|j>>>14,ve^=(j=(Be^=(j=(Ie^=(j=(Ke^=(j=ve+Be|0)<<7|j>>>25)+ve|0)<<9|j>>>23)+Ke|0)<<13|j>>>19)+Ie|0)<<18|j>>>14,Ae^=(j=(ze^=(j=(Ee^=(j=(_e^=(j=Ae+ze|0)<<7|j>>>25)+Ae|0)<<9|j>>>23)+_e|0)<<13|j>>>19)+Ee|0)<<18|j>>>14,ae^=(j=(Ne^=(j=(et^=(j=(De^=(j=ae+Ne|0)<<7|j>>>25)+ae|0)<<9|j>>>23)+De|0)<<13|j>>>19)+et|0)<<18|j>>>14;y[0]=be>>>0&255,y[1]=be>>>8&255,y[2]=be>>>16&255,y[3]=be>>>24&255,y[4]=ve>>>0&255,y[5]=ve>>>8&255,y[6]=ve>>>16&255,y[7]=ve>>>24&255,y[8]=Ae>>>0&255,y[9]=Ae>>>8&255,y[10]=Ae>>>16&255,y[11]=Ae>>>24&255,y[12]=ae>>>0&255,y[13]=ae>>>8&255,y[14]=ae>>>16&255,y[15]=ae>>>24&255,y[16]=Ke>>>0&255,y[17]=Ke>>>8&255,y[18]=Ke>>>16&255,y[19]=Ke>>>24&255,y[20]=Ie>>>0&255,y[21]=Ie>>>8&255,y[22]=Ie>>>16&255,y[23]=Ie>>>24&255,y[24]=Ee>>>0&255,y[25]=Ee>>>8&255,y[26]=Ee>>>16&255,y[27]=Ee>>>24&255,y[28]=ze>>>0&255,y[29]=ze>>>8&255,y[30]=ze>>>16&255,y[31]=ze>>>24&255})(B,m,I,l)}var U=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function f(B,m,I,l,y,L,F){var X,j,be=new Uint8Array(16),we=new Uint8Array(64);for(j=0;j<16;j++)be[j]=0;for(j=0;j<8;j++)be[j]=L[j];for(;y>=64;){for(re(we,be,F,U),j=0;j<64;j++)B[m+j]=I[l+j]^we[j];for(X=1,j=8;j<16;j++)X=X+(255&be[j])|0,be[j]=255&X,X>>>=8;y-=64,m+=64,l+=64}if(y>0)for(re(we,be,F,U),j=0;j<y;j++)B[m+j]=I[l+j]^we[j];return 0}function b(B,m,I,l,y){var L,F,X=new Uint8Array(16),j=new Uint8Array(64);for(F=0;F<16;F++)X[F]=0;for(F=0;F<8;F++)X[F]=l[F];for(;I>=64;){for(re(j,X,y,U),F=0;F<64;F++)B[m+F]=j[F];for(L=1,F=8;F<16;F++)L=L+(255&X[F])|0,X[F]=255&L,L>>>=8;I-=64,m+=64}if(I>0)for(re(j,X,y,U),F=0;F<I;F++)B[m+F]=j[F];return 0}function g(B,m,I,l,y){var L=new Uint8Array(32);ye(L,l,y,U);for(var F=new Uint8Array(8),X=0;X<8;X++)F[X]=l[X+16];return b(B,m,I,F,L)}function d(B,m,I,l,y,L,F){var X=new Uint8Array(32);ye(X,L,F,U);for(var j=new Uint8Array(8),be=0;be<8;be++)j[be]=L[be+16];return f(B,m,I,l,y,j,X)}var _=function(B){var m,I,l,y,L,F,X,j;this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,m=255&B[0]|(255&B[1])<<8,this.r[0]=8191&m,I=255&B[2]|(255&B[3])<<8,this.r[1]=8191&(m>>>13|I<<3),l=255&B[4]|(255&B[5])<<8,this.r[2]=7939&(I>>>10|l<<6),y=255&B[6]|(255&B[7])<<8,this.r[3]=8191&(l>>>7|y<<9),L=255&B[8]|(255&B[9])<<8,this.r[4]=255&(y>>>4|L<<12),this.r[5]=L>>>1&8190,F=255&B[10]|(255&B[11])<<8,this.r[6]=8191&(L>>>14|F<<2),X=255&B[12]|(255&B[13])<<8,this.r[7]=8065&(F>>>11|X<<5),j=255&B[14]|(255&B[15])<<8,this.r[8]=8191&(X>>>8|j<<8),this.r[9]=j>>>5&127,this.pad[0]=255&B[16]|(255&B[17])<<8,this.pad[1]=255&B[18]|(255&B[19])<<8,this.pad[2]=255&B[20]|(255&B[21])<<8,this.pad[3]=255&B[22]|(255&B[23])<<8,this.pad[4]=255&B[24]|(255&B[25])<<8,this.pad[5]=255&B[26]|(255&B[27])<<8,this.pad[6]=255&B[28]|(255&B[29])<<8,this.pad[7]=255&B[30]|(255&B[31])<<8};function k(B,m,I,l,y,L){var F=new _(L);return F.update(I,l,y),F.finish(B,m),0}function H(B,m,I,l,y,L){var F=new Uint8Array(16);return k(F,0,I,l,y,L),Z(B,m,F,0)}function T(B,m,I,l,y){var L;if(I<32)return-1;for(d(B,0,m,0,I,l,y),k(B,16,B,32,I-32,B),L=0;L<16;L++)B[L]=0;return 0}function c(B,m,I,l,y){var L,F=new Uint8Array(32);if(I<32||(g(F,0,32,l,y),H(m,16,m,32,I-32,F)!==0))return-1;for(d(B,0,m,0,I,l,y),L=0;L<32;L++)B[L]=0;return 0}function O(B,m){var I;for(I=0;I<16;I++)B[I]=0|m[I]}function N(B){var m,I,l=1;for(m=0;m<16;m++)I=B[m]+l+65535,l=Math.floor(I/65536),B[m]=I-65536*l;B[0]+=l-1+37*(l-1)}function le(B,m,I){for(var l,y=~(I-1),L=0;L<16;L++)l=y&(B[L]^m[L]),B[L]^=l,m[L]^=l}function ce(B,m){var I,l,y,L=u(),F=u();for(I=0;I<16;I++)F[I]=m[I];for(N(F),N(F),N(F),l=0;l<2;l++){for(L[0]=F[0]-65517,I=1;I<15;I++)L[I]=F[I]-65535-(L[I-1]>>16&1),L[I-1]&=65535;L[15]=F[15]-32767-(L[14]>>16&1),y=L[15]>>16&1,L[14]&=65535,le(F,L,1-y)}for(I=0;I<16;I++)B[2*I]=255&F[I],B[2*I+1]=F[I]>>8}function Te(B,m){var I=new Uint8Array(32),l=new Uint8Array(32);return ce(I,B),ce(l,m),ne(I,0,l,0)}function qe(B){var m=new Uint8Array(32);return ce(m,B),1&m[0]}function Fe(B,m){var I;for(I=0;I<16;I++)B[I]=m[2*I]+(m[2*I+1]<<8);B[15]&=32767}function at(B,m,I){for(var l=0;l<16;l++)B[l]=m[l]+I[l]}function He(B,m,I){for(var l=0;l<16;l++)B[l]=m[l]-I[l]}function Pe(B,m,I){var l,y,L=0,F=0,X=0,j=0,be=0,we=0,de=0,Re=0,Be=0,ve=0,Ke=0,Ie=0,Ee=0,ze=0,Ae=0,_e=0,De=0,et=0,Ne=0,ae=0,ue=0,xe=0,pe=0,ge=0,me=0,Je=0,rt=0,Qe=0,ut=0,lt=0,bt=0,je=I[0],We=I[1],$e=I[2],Ge=I[3],Ve=I[4],ot=I[5],pt=I[6],Yt=I[7],Mt=I[8],Vt=I[9],Ft=I[10],Xt=I[11],sr=I[12],Sr=I[13],Br=I[14],Ar=I[15];L+=(l=m[0])*je,F+=l*We,X+=l*$e,j+=l*Ge,be+=l*Ve,we+=l*ot,de+=l*pt,Re+=l*Yt,Be+=l*Mt,ve+=l*Vt,Ke+=l*Ft,Ie+=l*Xt,Ee+=l*sr,ze+=l*Sr,Ae+=l*Br,_e+=l*Ar,F+=(l=m[1])*je,X+=l*We,j+=l*$e,be+=l*Ge,we+=l*Ve,de+=l*ot,Re+=l*pt,Be+=l*Yt,ve+=l*Mt,Ke+=l*Vt,Ie+=l*Ft,Ee+=l*Xt,ze+=l*sr,Ae+=l*Sr,_e+=l*Br,De+=l*Ar,X+=(l=m[2])*je,j+=l*We,be+=l*$e,we+=l*Ge,de+=l*Ve,Re+=l*ot,Be+=l*pt,ve+=l*Yt,Ke+=l*Mt,Ie+=l*Vt,Ee+=l*Ft,ze+=l*Xt,Ae+=l*sr,_e+=l*Sr,De+=l*Br,et+=l*Ar,j+=(l=m[3])*je,be+=l*We,we+=l*$e,de+=l*Ge,Re+=l*Ve,Be+=l*ot,ve+=l*pt,Ke+=l*Yt,Ie+=l*Mt,Ee+=l*Vt,ze+=l*Ft,Ae+=l*Xt,_e+=l*sr,De+=l*Sr,et+=l*Br,Ne+=l*Ar,be+=(l=m[4])*je,we+=l*We,de+=l*$e,Re+=l*Ge,Be+=l*Ve,ve+=l*ot,Ke+=l*pt,Ie+=l*Yt,Ee+=l*Mt,ze+=l*Vt,Ae+=l*Ft,_e+=l*Xt,De+=l*sr,et+=l*Sr,Ne+=l*Br,ae+=l*Ar,we+=(l=m[5])*je,de+=l*We,Re+=l*$e,Be+=l*Ge,ve+=l*Ve,Ke+=l*ot,Ie+=l*pt,Ee+=l*Yt,ze+=l*Mt,Ae+=l*Vt,_e+=l*Ft,De+=l*Xt,et+=l*sr,Ne+=l*Sr,ae+=l*Br,ue+=l*Ar,de+=(l=m[6])*je,Re+=l*We,Be+=l*$e,ve+=l*Ge,Ke+=l*Ve,Ie+=l*ot,Ee+=l*pt,ze+=l*Yt,Ae+=l*Mt,_e+=l*Vt,De+=l*Ft,et+=l*Xt,Ne+=l*sr,ae+=l*Sr,ue+=l*Br,xe+=l*Ar,Re+=(l=m[7])*je,Be+=l*We,ve+=l*$e,Ke+=l*Ge,Ie+=l*Ve,Ee+=l*ot,ze+=l*pt,Ae+=l*Yt,_e+=l*Mt,De+=l*Vt,et+=l*Ft,Ne+=l*Xt,ae+=l*sr,ue+=l*Sr,xe+=l*Br,pe+=l*Ar,Be+=(l=m[8])*je,ve+=l*We,Ke+=l*$e,Ie+=l*Ge,Ee+=l*Ve,ze+=l*ot,Ae+=l*pt,_e+=l*Yt,De+=l*Mt,et+=l*Vt,Ne+=l*Ft,ae+=l*Xt,ue+=l*sr,xe+=l*Sr,pe+=l*Br,ge+=l*Ar,ve+=(l=m[9])*je,Ke+=l*We,Ie+=l*$e,Ee+=l*Ge,ze+=l*Ve,Ae+=l*ot,_e+=l*pt,De+=l*Yt,et+=l*Mt,Ne+=l*Vt,ae+=l*Ft,ue+=l*Xt,xe+=l*sr,pe+=l*Sr,ge+=l*Br,me+=l*Ar,Ke+=(l=m[10])*je,Ie+=l*We,Ee+=l*$e,ze+=l*Ge,Ae+=l*Ve,_e+=l*ot,De+=l*pt,et+=l*Yt,Ne+=l*Mt,ae+=l*Vt,ue+=l*Ft,xe+=l*Xt,pe+=l*sr,ge+=l*Sr,me+=l*Br,Je+=l*Ar,Ie+=(l=m[11])*je,Ee+=l*We,ze+=l*$e,Ae+=l*Ge,_e+=l*Ve,De+=l*ot,et+=l*pt,Ne+=l*Yt,ae+=l*Mt,ue+=l*Vt,xe+=l*Ft,pe+=l*Xt,ge+=l*sr,me+=l*Sr,Je+=l*Br,rt+=l*Ar,Ee+=(l=m[12])*je,ze+=l*We,Ae+=l*$e,_e+=l*Ge,De+=l*Ve,et+=l*ot,Ne+=l*pt,ae+=l*Yt,ue+=l*Mt,xe+=l*Vt,pe+=l*Ft,ge+=l*Xt,me+=l*sr,Je+=l*Sr,rt+=l*Br,Qe+=l*Ar,ze+=(l=m[13])*je,Ae+=l*We,_e+=l*$e,De+=l*Ge,et+=l*Ve,Ne+=l*ot,ae+=l*pt,ue+=l*Yt,xe+=l*Mt,pe+=l*Vt,ge+=l*Ft,me+=l*Xt,Je+=l*sr,rt+=l*Sr,Qe+=l*Br,ut+=l*Ar,Ae+=(l=m[14])*je,_e+=l*We,De+=l*$e,et+=l*Ge,Ne+=l*Ve,ae+=l*ot,ue+=l*pt,xe+=l*Yt,pe+=l*Mt,ge+=l*Vt,me+=l*Ft,Je+=l*Xt,rt+=l*sr,Qe+=l*Sr,ut+=l*Br,lt+=l*Ar,_e+=(l=m[15])*je,F+=38*(et+=l*$e),X+=38*(Ne+=l*Ge),j+=38*(ae+=l*Ve),be+=38*(ue+=l*ot),we+=38*(xe+=l*pt),de+=38*(pe+=l*Yt),Re+=38*(ge+=l*Mt),Be+=38*(me+=l*Vt),ve+=38*(Je+=l*Ft),Ke+=38*(rt+=l*Xt),Ie+=38*(Qe+=l*sr),Ee+=38*(ut+=l*Sr),ze+=38*(lt+=l*Br),Ae+=38*(bt+=l*Ar),L=(l=(L+=38*(De+=l*We))+(y=1)+65535)-65536*(y=Math.floor(l/65536)),F=(l=F+y+65535)-65536*(y=Math.floor(l/65536)),X=(l=X+y+65535)-65536*(y=Math.floor(l/65536)),j=(l=j+y+65535)-65536*(y=Math.floor(l/65536)),be=(l=be+y+65535)-65536*(y=Math.floor(l/65536)),we=(l=we+y+65535)-65536*(y=Math.floor(l/65536)),de=(l=de+y+65535)-65536*(y=Math.floor(l/65536)),Re=(l=Re+y+65535)-65536*(y=Math.floor(l/65536)),Be=(l=Be+y+65535)-65536*(y=Math.floor(l/65536)),ve=(l=ve+y+65535)-65536*(y=Math.floor(l/65536)),Ke=(l=Ke+y+65535)-65536*(y=Math.floor(l/65536)),Ie=(l=Ie+y+65535)-65536*(y=Math.floor(l/65536)),Ee=(l=Ee+y+65535)-65536*(y=Math.floor(l/65536)),ze=(l=ze+y+65535)-65536*(y=Math.floor(l/65536)),Ae=(l=Ae+y+65535)-65536*(y=Math.floor(l/65536)),_e=(l=_e+y+65535)-65536*(y=Math.floor(l/65536)),L=(l=(L+=y-1+37*(y-1))+(y=1)+65535)-65536*(y=Math.floor(l/65536)),F=(l=F+y+65535)-65536*(y=Math.floor(l/65536)),X=(l=X+y+65535)-65536*(y=Math.floor(l/65536)),j=(l=j+y+65535)-65536*(y=Math.floor(l/65536)),be=(l=be+y+65535)-65536*(y=Math.floor(l/65536)),we=(l=we+y+65535)-65536*(y=Math.floor(l/65536)),de=(l=de+y+65535)-65536*(y=Math.floor(l/65536)),Re=(l=Re+y+65535)-65536*(y=Math.floor(l/65536)),Be=(l=Be+y+65535)-65536*(y=Math.floor(l/65536)),ve=(l=ve+y+65535)-65536*(y=Math.floor(l/65536)),Ke=(l=Ke+y+65535)-65536*(y=Math.floor(l/65536)),Ie=(l=Ie+y+65535)-65536*(y=Math.floor(l/65536)),Ee=(l=Ee+y+65535)-65536*(y=Math.floor(l/65536)),ze=(l=ze+y+65535)-65536*(y=Math.floor(l/65536)),Ae=(l=Ae+y+65535)-65536*(y=Math.floor(l/65536)),_e=(l=_e+y+65535)-65536*(y=Math.floor(l/65536)),L+=y-1+37*(y-1),B[0]=L,B[1]=F,B[2]=X,B[3]=j,B[4]=be,B[5]=we,B[6]=de,B[7]=Re,B[8]=Be,B[9]=ve,B[10]=Ke,B[11]=Ie,B[12]=Ee,B[13]=ze,B[14]=Ae,B[15]=_e}function jt(B,m){Pe(B,m,m)}function yt(B,m){var I,l=u();for(I=0;I<16;I++)l[I]=m[I];for(I=253;I>=0;I--)jt(l,l),I!==2&&I!==4&&Pe(l,l,m);for(I=0;I<16;I++)B[I]=l[I]}function ft(B,m){var I,l=u();for(I=0;I<16;I++)l[I]=m[I];for(I=250;I>=0;I--)jt(l,l),I!==1&&Pe(l,l,m);for(I=0;I<16;I++)B[I]=l[I]}function xr(B,m,I){var l,y,L=new Uint8Array(32),F=new Float64Array(80),X=u(),j=u(),be=u(),we=u(),de=u(),Re=u();for(y=0;y<31;y++)L[y]=m[y];for(L[31]=127&m[31]|64,L[0]&=248,Fe(F,I),y=0;y<16;y++)j[y]=F[y],we[y]=X[y]=be[y]=0;for(X[0]=we[0]=1,y=254;y>=0;--y)le(X,j,l=L[y>>>3]>>>(7&y)&1),le(be,we,l),at(de,X,be),He(X,X,be),at(be,j,we),He(j,j,we),jt(we,de),jt(Re,X),Pe(X,be,X),Pe(be,j,de),at(de,X,be),He(X,X,be),jt(j,X),He(be,we,Re),Pe(X,be,P),at(X,X,we),Pe(be,be,X),Pe(X,we,Re),Pe(we,j,F),jt(j,de),le(X,j,l),le(be,we,l);for(y=0;y<16;y++)F[y+16]=X[y],F[y+32]=be[y],F[y+48]=j[y],F[y+64]=we[y];var Be=F.subarray(32),ve=F.subarray(16);return yt(Be,Be),Pe(ve,ve,Be),ce(B,ve),0}function mt(B,m){return xr(B,m,p)}function At(B,m){return h(m,32),mt(B,m)}function $r(B,m,I){var l=new Uint8Array(32);return xr(l,I,m),ye(B,w,l,U)}_.prototype.blocks=function(B,m,I){for(var l,y,L,F,X,j,be,we,de,Re,Be,ve,Ke,Ie,Ee,ze,Ae,_e,De,et=this.fin?0:2048,Ne=this.h[0],ae=this.h[1],ue=this.h[2],xe=this.h[3],pe=this.h[4],ge=this.h[5],me=this.h[6],Je=this.h[7],rt=this.h[8],Qe=this.h[9],ut=this.r[0],lt=this.r[1],bt=this.r[2],je=this.r[3],We=this.r[4],$e=this.r[5],Ge=this.r[6],Ve=this.r[7],ot=this.r[8],pt=this.r[9];I>=16;)Re=de=0,Re+=(Ne+=8191&(l=255&B[m+0]|(255&B[m+1])<<8))*ut,Re+=(ae+=8191&(l>>>13|(y=255&B[m+2]|(255&B[m+3])<<8)<<3))*(5*pt),Re+=(ue+=8191&(y>>>10|(L=255&B[m+4]|(255&B[m+5])<<8)<<6))*(5*ot),Re+=(xe+=8191&(L>>>7|(F=255&B[m+6]|(255&B[m+7])<<8)<<9))*(5*Ve),de=(Re+=(pe+=8191&(F>>>4|(X=255&B[m+8]|(255&B[m+9])<<8)<<12))*(5*Ge))>>>13,Re&=8191,Re+=(ge+=X>>>1&8191)*(5*$e),Re+=(me+=8191&(X>>>14|(j=255&B[m+10]|(255&B[m+11])<<8)<<2))*(5*We),Re+=(Je+=8191&(j>>>11|(be=255&B[m+12]|(255&B[m+13])<<8)<<5))*(5*je),Re+=(rt+=8191&(be>>>8|(we=255&B[m+14]|(255&B[m+15])<<8)<<8))*(5*bt),Be=de+=(Re+=(Qe+=we>>>5|et)*(5*lt))>>>13,Be+=Ne*lt,Be+=ae*ut,Be+=ue*(5*pt),Be+=xe*(5*ot),de=(Be+=pe*(5*Ve))>>>13,Be&=8191,Be+=ge*(5*Ge),Be+=me*(5*$e),Be+=Je*(5*We),Be+=rt*(5*je),de+=(Be+=Qe*(5*bt))>>>13,Be&=8191,ve=de,ve+=Ne*bt,ve+=ae*lt,ve+=ue*ut,ve+=xe*(5*pt),de=(ve+=pe*(5*ot))>>>13,ve&=8191,ve+=ge*(5*Ve),ve+=me*(5*Ge),ve+=Je*(5*$e),ve+=rt*(5*We),Ke=de+=(ve+=Qe*(5*je))>>>13,Ke+=Ne*je,Ke+=ae*bt,Ke+=ue*lt,Ke+=xe*ut,de=(Ke+=pe*(5*pt))>>>13,Ke&=8191,Ke+=ge*(5*ot),Ke+=me*(5*Ve),Ke+=Je*(5*Ge),Ke+=rt*(5*$e),Ie=de+=(Ke+=Qe*(5*We))>>>13,Ie+=Ne*We,Ie+=ae*je,Ie+=ue*bt,Ie+=xe*lt,de=(Ie+=pe*ut)>>>13,Ie&=8191,Ie+=ge*(5*pt),Ie+=me*(5*ot),Ie+=Je*(5*Ve),Ie+=rt*(5*Ge),Ee=de+=(Ie+=Qe*(5*$e))>>>13,Ee+=Ne*$e,Ee+=ae*We,Ee+=ue*je,Ee+=xe*bt,de=(Ee+=pe*lt)>>>13,Ee&=8191,Ee+=ge*ut,Ee+=me*(5*pt),Ee+=Je*(5*ot),Ee+=rt*(5*Ve),ze=de+=(Ee+=Qe*(5*Ge))>>>13,ze+=Ne*Ge,ze+=ae*$e,ze+=ue*We,ze+=xe*je,de=(ze+=pe*bt)>>>13,ze&=8191,ze+=ge*lt,ze+=me*ut,ze+=Je*(5*pt),ze+=rt*(5*ot),Ae=de+=(ze+=Qe*(5*Ve))>>>13,Ae+=Ne*Ve,Ae+=ae*Ge,Ae+=ue*$e,Ae+=xe*We,de=(Ae+=pe*je)>>>13,Ae&=8191,Ae+=ge*bt,Ae+=me*lt,Ae+=Je*ut,Ae+=rt*(5*pt),_e=de+=(Ae+=Qe*(5*ot))>>>13,_e+=Ne*ot,_e+=ae*Ve,_e+=ue*Ge,_e+=xe*$e,de=(_e+=pe*We)>>>13,_e&=8191,_e+=ge*je,_e+=me*bt,_e+=Je*lt,_e+=rt*ut,De=de+=(_e+=Qe*(5*pt))>>>13,De+=Ne*pt,De+=ae*ot,De+=ue*Ve,De+=xe*Ge,de=(De+=pe*$e)>>>13,De&=8191,De+=ge*We,De+=me*je,De+=Je*bt,De+=rt*lt,Ne=Re=8191&(de=(de=((de+=(De+=Qe*ut)>>>13)<<2)+de|0)+(Re&=8191)|0),ae=Be+=de>>>=13,ue=ve&=8191,xe=Ke&=8191,pe=Ie&=8191,ge=Ee&=8191,me=ze&=8191,Je=Ae&=8191,rt=_e&=8191,Qe=De&=8191,m+=16,I-=16;this.h[0]=Ne,this.h[1]=ae,this.h[2]=ue,this.h[3]=xe,this.h[4]=pe,this.h[5]=ge,this.h[6]=me,this.h[7]=Je,this.h[8]=rt,this.h[9]=Qe},_.prototype.finish=function(B,m){var I,l,y,L,F=new Uint16Array(10);if(this.leftover){for(L=this.leftover,this.buffer[L++]=1;L<16;L++)this.buffer[L]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(I=this.h[1]>>>13,this.h[1]&=8191,L=2;L<10;L++)this.h[L]+=I,I=this.h[L]>>>13,this.h[L]&=8191;for(this.h[0]+=5*I,I=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=I,I=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=I,F[0]=this.h[0]+5,I=F[0]>>>13,F[0]&=8191,L=1;L<10;L++)F[L]=this.h[L]+I,I=F[L]>>>13,F[L]&=8191;for(F[9]-=8192,l=(1^I)-1,L=0;L<10;L++)F[L]&=l;for(l=~l,L=0;L<10;L++)this.h[L]=this.h[L]&l|F[L];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),y=this.h[0]+this.pad[0],this.h[0]=65535&y,L=1;L<8;L++)y=(this.h[L]+this.pad[L]|0)+(y>>>16)|0,this.h[L]=65535&y;B[m+0]=this.h[0]>>>0&255,B[m+1]=this.h[0]>>>8&255,B[m+2]=this.h[1]>>>0&255,B[m+3]=this.h[1]>>>8&255,B[m+4]=this.h[2]>>>0&255,B[m+5]=this.h[2]>>>8&255,B[m+6]=this.h[3]>>>0&255,B[m+7]=this.h[3]>>>8&255,B[m+8]=this.h[4]>>>0&255,B[m+9]=this.h[4]>>>8&255,B[m+10]=this.h[5]>>>0&255,B[m+11]=this.h[5]>>>8&255,B[m+12]=this.h[6]>>>0&255,B[m+13]=this.h[6]>>>8&255,B[m+14]=this.h[7]>>>0&255,B[m+15]=this.h[7]>>>8&255},_.prototype.update=function(B,m,I){var l,y;if(this.leftover){for((y=16-this.leftover)>I&&(y=I),l=0;l<y;l++)this.buffer[this.leftover+l]=B[m+l];if(I-=y,m+=y,this.leftover+=y,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(I>=16&&(y=I-I%16,this.blocks(B,m,y),m+=y,I-=y),I){for(l=0;l<I;l++)this.buffer[this.leftover+l]=B[m+l];this.leftover+=I}};var kt=T,Ht=c,Yi=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function It(B,m,I,l){for(var y,L,F,X,j,be,we,de,Re,Be,ve,Ke,Ie,Ee,ze,Ae,_e,De,et,Ne,ae,ue,xe,pe,ge,me,Je=new Int32Array(16),rt=new Int32Array(16),Qe=B[0],ut=B[1],lt=B[2],bt=B[3],je=B[4],We=B[5],$e=B[6],Ge=B[7],Ve=m[0],ot=m[1],pt=m[2],Yt=m[3],Mt=m[4],Vt=m[5],Ft=m[6],Xt=m[7],sr=0;l>=128;){for(et=0;et<16;et++)Ne=8*et+sr,Je[et]=I[Ne+0]<<24|I[Ne+1]<<16|I[Ne+2]<<8|I[Ne+3],rt[et]=I[Ne+4]<<24|I[Ne+5]<<16|I[Ne+6]<<8|I[Ne+7];for(et=0;et<80;et++)if(y=Qe,L=ut,F=lt,X=bt,j=je,be=We,we=$e,Re=Ve,Be=ot,ve=pt,Ke=Yt,Ie=Mt,Ee=Vt,ze=Ft,xe=65535&(ue=Xt),pe=ue>>>16,ge=65535&(ae=Ge),me=ae>>>16,xe+=65535&(ue=(Mt>>>14|je<<18)^(Mt>>>18|je<<14)^(je>>>9|Mt<<23)),pe+=ue>>>16,ge+=65535&(ae=(je>>>14|Mt<<18)^(je>>>18|Mt<<14)^(Mt>>>9|je<<23)),me+=ae>>>16,xe+=65535&(ue=Mt&Vt^~Mt&Ft),pe+=ue>>>16,ge+=65535&(ae=je&We^~je&$e),me+=ae>>>16,xe+=65535&(ue=Yi[2*et+1]),pe+=ue>>>16,ge+=65535&(ae=Yi[2*et]),me+=ae>>>16,ae=Je[et%16],pe+=(ue=rt[et%16])>>>16,ge+=65535&ae,me+=ae>>>16,ge+=(pe+=(xe+=65535&ue)>>>16)>>>16,xe=65535&(ue=De=65535&xe|pe<<16),pe=ue>>>16,ge=65535&(ae=_e=65535&ge|(me+=ge>>>16)<<16),me=ae>>>16,xe+=65535&(ue=(Ve>>>28|Qe<<4)^(Qe>>>2|Ve<<30)^(Qe>>>7|Ve<<25)),pe+=ue>>>16,ge+=65535&(ae=(Qe>>>28|Ve<<4)^(Ve>>>2|Qe<<30)^(Ve>>>7|Qe<<25)),me+=ae>>>16,pe+=(ue=Ve&ot^Ve&pt^ot&pt)>>>16,ge+=65535&(ae=Qe&ut^Qe<^ut<),me+=ae>>>16,de=65535&(ge+=(pe+=(xe+=65535&ue)>>>16)>>>16)|(me+=ge>>>16)<<16,Ae=65535&xe|pe<<16,xe=65535&(ue=Ke),pe=ue>>>16,ge=65535&(ae=X),me=ae>>>16,pe+=(ue=De)>>>16,ge+=65535&(ae=_e),me+=ae>>>16,ut=y,lt=L,bt=F,je=X=65535&(ge+=(pe+=(xe+=65535&ue)>>>16)>>>16)|(me+=ge>>>16)<<16,We=j,$e=be,Ge=we,Qe=de,ot=Re,pt=Be,Yt=ve,Mt=Ke=65535&xe|pe<<16,Vt=Ie,Ft=Ee,Xt=ze,Ve=Ae,et%16==15)for(Ne=0;Ne<16;Ne++)ae=Je[Ne],xe=65535&(ue=rt[Ne]),pe=ue>>>16,ge=65535&ae,me=ae>>>16,ae=Je[(Ne+9)%16],xe+=65535&(ue=rt[(Ne+9)%16]),pe+=ue>>>16,ge+=65535&ae,me+=ae>>>16,_e=Je[(Ne+1)%16],xe+=65535&(ue=((De=rt[(Ne+1)%16])>>>1|_e<<31)^(De>>>8|_e<<24)^(De>>>7|_e<<25)),pe+=ue>>>16,ge+=65535&(ae=(_e>>>1|De<<31)^(_e>>>8|De<<24)^_e>>>7),me+=ae>>>16,_e=Je[(Ne+14)%16],pe+=(ue=((De=rt[(Ne+14)%16])>>>19|_e<<13)^(_e>>>29|De<<3)^(De>>>6|_e<<26))>>>16,ge+=65535&(ae=(_e>>>19|De<<13)^(De>>>29|_e<<3)^_e>>>6),me+=ae>>>16,me+=(ge+=(pe+=(xe+=65535&ue)>>>16)>>>16)>>>16,Je[Ne]=65535&ge|me<<16,rt[Ne]=65535&xe|pe<<16;xe=65535&(ue=Ve),pe=ue>>>16,ge=65535&(ae=Qe),me=ae>>>16,ae=B[0],pe+=(ue=m[0])>>>16,ge+=65535&ae,me+=ae>>>16,me+=(ge+=(pe+=(xe+=65535&ue)>>>16)>>>16)>>>16,B[0]=Qe=65535&ge|me<<16,m[0]=Ve=65535&xe|pe<<16,xe=65535&(ue=ot),pe=ue>>>16,ge=65535&(ae=ut),me=ae>>>16,ae=B[1],pe+=(ue=m[1])>>>16,ge+=65535&ae,me+=ae>>>16,me+=(ge+=(pe+=(xe+=65535&ue)>>>16)>>>16)>>>16,B[1]=ut=65535&ge|me<<16,m[1]=ot=65535&xe|pe<<16,xe=65535&(ue=pt),pe=ue>>>16,ge=65535&(ae=lt),me=ae>>>16,ae=B[2],pe+=(ue=m[2])>>>16,ge+=65535&ae,me+=ae>>>16,me+=(ge+=(pe+=(xe+=65535&ue)>>>16)>>>16)>>>16,B[2]=lt=65535&ge|me<<16,m[2]=pt=65535&xe|pe<<16,xe=65535&(ue=Yt),pe=ue>>>16,ge=65535&(ae=bt),me=ae>>>16,ae=B[3],pe+=(ue=m[3])>>>16,ge+=65535&ae,me+=ae>>>16,me+=(ge+=(pe+=(xe+=65535&ue)>>>16)>>>16)>>>16,B[3]=bt=65535&ge|me<<16,m[3]=Yt=65535&xe|pe<<16,xe=65535&(ue=Mt),pe=ue>>>16,ge=65535&(ae=je),me=ae>>>16,ae=B[4],pe+=(ue=m[4])>>>16,ge+=65535&ae,me+=ae>>>16,me+=(ge+=(pe+=(xe+=65535&ue)>>>16)>>>16)>>>16,B[4]=je=65535&ge|me<<16,m[4]=Mt=65535&xe|pe<<16,xe=65535&(ue=Vt),pe=ue>>>16,ge=65535&(ae=We),me=ae>>>16,ae=B[5],pe+=(ue=m[5])>>>16,ge+=65535&ae,me+=ae>>>16,me+=(ge+=(pe+=(xe+=65535&ue)>>>16)>>>16)>>>16,B[5]=We=65535&ge|me<<16,m[5]=Vt=65535&xe|pe<<16,xe=65535&(ue=Ft),pe=ue>>>16,ge=65535&(ae=$e),me=ae>>>16,ae=B[6],pe+=(ue=m[6])>>>16,ge+=65535&ae,me+=ae>>>16,me+=(ge+=(pe+=(xe+=65535&ue)>>>16)>>>16)>>>16,B[6]=$e=65535&ge|me<<16,m[6]=Ft=65535&xe|pe<<16,xe=65535&(ue=Xt),pe=ue>>>16,ge=65535&(ae=Ge),me=ae>>>16,ae=B[7],pe+=(ue=m[7])>>>16,ge+=65535&ae,me+=ae>>>16,me+=(ge+=(pe+=(xe+=65535&ue)>>>16)>>>16)>>>16,B[7]=Ge=65535&ge|me<<16,m[7]=Xt=65535&xe|pe<<16,sr+=128,l-=128}return l}function St(B,m,I){var l,y=new Int32Array(8),L=new Int32Array(8),F=new Uint8Array(256),X=I;for(y[0]=1779033703,y[1]=3144134277,y[2]=1013904242,y[3]=2773480762,y[4]=1359893119,y[5]=2600822924,y[6]=528734635,y[7]=1541459225,L[0]=4089235720,L[1]=2227873595,L[2]=4271175723,L[3]=1595750129,L[4]=2917565137,L[5]=725511199,L[6]=4215389547,L[7]=327033209,It(y,L,m,I),I%=128,l=0;l<I;l++)F[l]=m[X-I+l];for(F[I]=128,F[(I=256-128*(I<112?1:0))-9]=0,ee(F,I-8,X/536870912|0,X<<3),It(y,L,F,I),l=0;l<8;l++)ee(B,8*l,y[l],L[l]);return 0}function Xr(B,m){var I=u(),l=u(),y=u(),L=u(),F=u(),X=u(),j=u(),be=u(),we=u();He(I,B[1],B[0]),He(we,m[1],m[0]),Pe(I,I,we),at(l,B[0],B[1]),at(we,m[0],m[1]),Pe(l,l,we),Pe(y,B[3],m[3]),Pe(y,y,q),Pe(L,B[2],m[2]),at(L,L,L),He(F,l,I),He(X,L,y),at(j,L,y),at(be,l,I),Pe(B[0],F,X),Pe(B[1],be,j),Pe(B[2],j,X),Pe(B[3],F,be)}function Tt(B,m,I){var l;for(l=0;l<4;l++)le(B[l],m[l],I)}function Et(B,m){var I=u(),l=u(),y=u();yt(y,m[2]),Pe(I,m[0],y),Pe(l,m[1],y),ce(B,l),B[31]^=qe(I)<<7}function Zn(B,m,I){var l,y;for(O(B[0],M),O(B[1],A),O(B[2],A),O(B[3],M),y=255;y>=0;--y)Tt(B,m,l=I[y/8|0]>>(7&y)&1),Xr(m,B),Xr(B,B),Tt(B,m,l)}function Pt(B,m){var I=[u(),u(),u(),u()];O(I[0],z),O(I[1],J),O(I[2],A),Pe(I[3],z,J),Zn(B,I,m)}function V(B,m,I){var l,y=new Uint8Array(64),L=[u(),u(),u(),u()];for(I||h(m,32),St(y,m,32),y[0]&=248,y[31]&=127,y[31]|=64,Pt(L,y),Et(B,L),l=0;l<32;l++)m[l+32]=B[l];return 0}var C=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function K(B,m){var I,l,y,L;for(l=63;l>=32;--l){for(I=0,y=l-32,L=l-12;y<L;++y)m[y]+=I-16*m[l]*C[y-(l-32)],I=Math.floor((m[y]+128)/256),m[y]-=256*I;m[y]+=I,m[l]=0}for(I=0,y=0;y<32;y++)m[y]+=I-(m[31]>>4)*C[y],I=m[y]>>8,m[y]&=255;for(y=0;y<32;y++)m[y]-=I*C[y];for(l=0;l<32;l++)m[l+1]+=m[l]>>8,B[l]=255&m[l]}function D(B){var m,I=new Float64Array(64);for(m=0;m<64;m++)I[m]=B[m];for(m=0;m<64;m++)B[m]=0;K(B,I)}function G(B,m,I,l){var y,L,F=new Uint8Array(64),X=new Uint8Array(64),j=new Uint8Array(64),be=new Float64Array(64),we=[u(),u(),u(),u()];St(F,l,32),F[0]&=248,F[31]&=127,F[31]|=64;var de=I+64;for(y=0;y<I;y++)B[64+y]=m[y];for(y=0;y<32;y++)B[32+y]=F[32+y];for(St(j,B.subarray(32),I+32),D(j),Pt(we,j),Et(B,we),y=32;y<64;y++)B[y]=l[y];for(St(X,B,I+64),D(X),y=0;y<64;y++)be[y]=0;for(y=0;y<32;y++)be[y]=j[y];for(y=0;y<32;y++)for(L=0;L<32;L++)be[y+L]+=X[y]*F[L];return K(B.subarray(32),be),de}function R(B,m,I,l){var y,L=new Uint8Array(32),F=new Uint8Array(64),X=[u(),u(),u(),u()],j=[u(),u(),u(),u()];if(I<64||function(be,we){var de=u(),Re=u(),Be=u(),ve=u(),Ke=u(),Ie=u(),Ee=u();return O(be[2],A),Fe(be[1],we),jt(Be,be[1]),Pe(ve,Be,E),He(Be,Be,be[2]),at(ve,be[2],ve),jt(Ke,ve),jt(Ie,Ke),Pe(Ee,Ie,Ke),Pe(de,Ee,Be),Pe(de,de,ve),ft(de,de),Pe(de,de,Be),Pe(de,de,ve),Pe(de,de,ve),Pe(be[0],de,ve),jt(Re,be[0]),Pe(Re,Re,ve),Te(Re,Be)&&Pe(be[0],be[0],$),jt(Re,be[0]),Pe(Re,Re,ve),Te(Re,Be)?-1:(qe(be[0])===we[31]>>7&&He(be[0],M,be[0]),Pe(be[3],be[0],be[1]),0)}(j,l))return-1;for(y=0;y<I;y++)B[y]=m[y];for(y=0;y<32;y++)B[y+32]=l[y];if(St(F,B,I),D(F),Zn(X,j,F),Pt(j,m.subarray(32)),Xr(X,j),Et(L,X),I-=64,ne(m,0,L,0)){for(y=0;y<I;y++)B[y]=0;return-1}for(y=0;y<I;y++)B[y]=m[y+64];return I}var te,oe=64,ie=32,fe=64;function ke(B,m){if(B.length!==32)throw new Error("bad key size");if(m.length!==24)throw new Error("bad nonce size")}function se(){for(var B=0;B<arguments.length;B++)if(!(arguments[B]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function he(B){for(var m=0;m<B.length;m++)B[m]=0}s.lowlevel={crypto_core_hsalsa20:ye,crypto_stream_xor:d,crypto_stream:g,crypto_stream_salsa20_xor:f,crypto_stream_salsa20:b,crypto_onetimeauth:k,crypto_onetimeauth_verify:H,crypto_verify_16:Z,crypto_verify_32:ne,crypto_secretbox:T,crypto_secretbox_open:c,crypto_scalarmult:xr,crypto_scalarmult_base:mt,crypto_box_beforenm:$r,crypto_box_afternm:kt,crypto_box:function(B,m,I,l,y,L){var F=new Uint8Array(32);return $r(F,y,L),kt(B,m,I,l,F)},crypto_box_open:function(B,m,I,l,y,L){var F=new Uint8Array(32);return $r(F,y,L),Ht(B,m,I,l,F)},crypto_box_keypair:At,crypto_hash:St,crypto_sign:G,crypto_sign_keypair:V,crypto_sign_open:R,crypto_secretbox_KEYBYTES:32,crypto_secretbox_NONCEBYTES:24,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:16,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:32,crypto_box_SECRETKEYBYTES:32,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:24,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:oe,crypto_sign_PUBLICKEYBYTES:ie,crypto_sign_SECRETKEYBYTES:fe,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:u,D:E,L:C,pack25519:ce,unpack25519:Fe,M:Pe,A:at,S:jt,Z:He,pow2523:ft,add:Xr,set25519:O,modL:K,scalarmult:Zn,scalarbase:Pt},s.randomBytes=function(B){var m=new Uint8Array(B);return h(m,B),m},s.secretbox=function(B,m,I){se(B,m,I),ke(I,m);for(var l=new Uint8Array(32+B.length),y=new Uint8Array(l.length),L=0;L<B.length;L++)l[L+32]=B[L];return T(y,l,l.length,m,I),y.subarray(16)},s.secretbox.open=function(B,m,I){se(B,m,I),ke(I,m);for(var l=new Uint8Array(16+B.length),y=new Uint8Array(l.length),L=0;L<B.length;L++)l[L+16]=B[L];return l.length<32||c(y,l,l.length,m,I)!==0?null:y.subarray(32)},s.secretbox.keyLength=32,s.secretbox.nonceLength=24,s.secretbox.overheadLength=16,s.scalarMult=function(B,m){if(se(B,m),B.length!==32)throw new Error("bad n size");if(m.length!==32)throw new Error("bad p size");var I=new Uint8Array(32);return xr(I,B,m),I},s.scalarMult.base=function(B){if(se(B),B.length!==32)throw new Error("bad n size");var m=new Uint8Array(32);return mt(m,B),m},s.scalarMult.scalarLength=32,s.scalarMult.groupElementLength=32,s.box=function(B,m,I,l){var y=s.box.before(I,l);return s.secretbox(B,m,y)},s.box.before=function(B,m){se(B,m),function(l,y){if(l.length!==32)throw new Error("bad public key size");if(y.length!==32)throw new Error("bad secret key size")}(B,m);var I=new Uint8Array(32);return $r(I,B,m),I},s.box.after=s.secretbox,s.box.open=function(B,m,I,l){var y=s.box.before(I,l);return s.secretbox.open(B,m,y)},s.box.open.after=s.secretbox.open,s.box.keyPair=function(){var B=new Uint8Array(32),m=new Uint8Array(32);return At(B,m),{publicKey:B,secretKey:m}},s.box.keyPair.fromSecretKey=function(B){if(se(B),B.length!==32)throw new Error("bad secret key size");var m=new Uint8Array(32);return mt(m,B),{publicKey:m,secretKey:new Uint8Array(B)}},s.box.publicKeyLength=32,s.box.secretKeyLength=32,s.box.sharedKeyLength=32,s.box.nonceLength=24,s.box.overheadLength=s.secretbox.overheadLength,s.sign=function(B,m){if(se(B,m),m.length!==fe)throw new Error("bad secret key size");var I=new Uint8Array(oe+B.length);return G(I,B,B.length,m),I},s.sign.open=function(B,m){if(se(B,m),m.length!==ie)throw new Error("bad public key size");var I=new Uint8Array(B.length),l=R(I,B,B.length,m);if(l<0)return null;for(var y=new Uint8Array(l),L=0;L<y.length;L++)y[L]=I[L];return y},s.sign.detached=function(B,m){for(var I=s.sign(B,m),l=new Uint8Array(oe),y=0;y<l.length;y++)l[y]=I[y];return l},s.sign.detached.verify=function(B,m,I){if(se(B,m,I),m.length!==oe)throw new Error("bad signature size");if(I.length!==ie)throw new Error("bad public key size");var l,y=new Uint8Array(oe+B.length),L=new Uint8Array(oe+B.length);for(l=0;l<oe;l++)y[l]=m[l];for(l=0;l<B.length;l++)y[l+oe]=B[l];return R(L,y,y.length,I)>=0},s.sign.keyPair=function(){var B=new Uint8Array(ie),m=new Uint8Array(fe);return V(B,m),{publicKey:B,secretKey:m}},s.sign.keyPair.fromSecretKey=function(B){if(se(B),B.length!==fe)throw new Error("bad secret key size");for(var m=new Uint8Array(ie),I=0;I<m.length;I++)m[I]=B[32+I];return{publicKey:m,secretKey:new Uint8Array(B)}},s.sign.keyPair.fromSeed=function(B){if(se(B),B.length!==32)throw new Error("bad seed size");for(var m=new Uint8Array(ie),I=new Uint8Array(fe),l=0;l<32;l++)I[l]=B[l];return V(m,I,!0),{publicKey:m,secretKey:I}},s.sign.publicKeyLength=ie,s.sign.secretKeyLength=fe,s.sign.seedLength=32,s.sign.signatureLength=oe,s.hash=function(B){se(B);var m=new Uint8Array(64);return St(m,B,B.length),m},s.hash.hashLength=64,s.verify=function(B,m){return se(B,m),B.length!==0&&m.length!==0&&B.length===m.length&&Y(B,0,m,0,B.length)===0},s.setPRNG=function(B){h=B},(te=typeof self<"u"?self.crypto||self.msCrypto:null)&&te.getRandomValues?s.setPRNG(function(B,m){var I,l=new Uint8Array(m);for(I=0;I<m;I+=65536)te.getRandomValues(l.subarray(I,I+Math.min(m-I,65536)));for(I=0;I<m;I++)B[I]=l[I];he(l)}):(te=a(24))&&te.randomBytes&&s.setPRNG(function(B,m){var I,l=te.randomBytes(m);for(I=0;I<m;I++)B[I]=l[I];he(l)})})(i.exports?i.exports:self.nacl=self.nacl||{})},24:()=>{}},e={};function r(i){var o=e[i];if(o!==void 0)return o.exports;var a=e[i]={exports:{}};return t[i](a,a.exports,r),a.exports}r.n=i=>{var o=i&&i.__esModule?()=>i.default:()=>i;return r.d(o,{a:o}),o},r.d=(i,o)=>{for(var a in o)r.o(o,a)&&!r.o(i,a)&&Object.defineProperty(i,a,{enumerable:!0,get:o[a]})},r.o=(i,o)=>Object.prototype.hasOwnProperty.call(i,o),r.r=i=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{KeyPair:()=>i.KeyPair,generateMnemonic:()=>A,isPasswordNeeded:()=>M,mnemonicToKeyPair:()=>z,mnemonicToSeed:()=>q,validateMnemonic:()=>J,wordlists:()=>o});var i={};r.r(i),r.d(i,{I:()=>z});var o={};r.r(o),r.d(o,{EN:()=>s,default:()=>s,english:()=>s});let a=self.crypto,s=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"];async function u($){return(await w($,"TON seed version",Math.max(1,Math.floor(390.625))))[0]==0}async function h($,ee=""){let Y=$.join(" ");return await async function(Z,ne){let re=p(Z).buffer,ye=ne.length?p(ne).buffer:new ArrayBuffer(0),U={name:"HMAC",hash:"SHA-512"},f=await a.subtle.importKey("raw",re,U,!1,["sign"]);return await a.subtle.sign(U,f,ye)}(Y,ee)}async function w($,ee,Y){let Z=p(ee).buffer,ne=await a.subtle.importKey("raw",$,{name:"PBKDF2"},!1,["deriveBits"]),re=await a.subtle.deriveBits({name:"PBKDF2",hash:"SHA-512",salt:Z,iterations:Y},ne,512);return new Uint8Array(re)}function p($,ee=1){let Y,Z;switch(ee){case 1:Y=new ArrayBuffer($.length),Z=new Uint8Array(Y);break;case 2:Y=new ArrayBuffer(2*$.length),Z=new Uint16Array(Y);break;case 4:Y=new ArrayBuffer(4*$.length),Z=new Uint32Array(Y);break;default:throw new Error(`Incorrect size specified: ${ee}`)}for(let ne=0,re=$.length;ne<re;ne++)Z[ne]=$.charCodeAt(ne);return new Uint8Array(Z.buffer)}async function M($){let ee=await h($,"");return await async function(Y){return(await w(Y,"TON fast seed version",1))[0]==1}(ee)&&!await u(ee)}async function A($=24,ee="",Y=s){let Z=0,ne=[];for(;;){Z+=1,ne=[];let re=a.getRandomValues(new Uint16Array($));for(let ye=0;ye<$;ye++)ne.push(Y[2047&re[ye]]);if((!(ee.length>0)||await M(ne))&&await u(await h(ne,ee)))break}return ne}var P=r(780),E=r.n(P);async function q($,ee=""){let Y=await h($,ee);return(await w(Y,"TON default seed",1e5)).slice(0,32)}async function z($,ee=""){let Y=await q($,ee);return E().sign.keyPair.fromSeed(Y)}async function J($,ee="",Y=s){for(let Z of $)if(Y.indexOf(Z)===-1)return!1;return!(ee.length>0&&!await M($))&&await u(await h($,ee))}})(),n})()})});var mg=W(Gn=>{"use strict";x();S();var PA=Gn&&Gn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Gn,"__esModule",{value:!0});Gn.JettonWallet=Gn.VenomWallet=Gn.TonWallet=void 0;var pn=Ub(),$n=bc(),Wn=gc(),vc=m0(),gg=pc(),yg=pg(),mr=Xn(),wc=aa(),af=Yr(),TA=PA(M0()),ff=class extends pn.BaseWallet{async getRandomPrivateKey(){try{return Promise.resolve(mr.signUtil.ed25519.ed25519_getRandomPrivateKey(!1,"hex"))}catch{return Promise.reject(pn.GenPrivateKeyError)}}async getDerivedPath(e){return`m/44'/607'/${e.index}'`}async getDerivedPrivateKey(e){try{if(e.hdPath)return Promise.resolve(mr.signUtil.ed25519.ed25519_getDerivedPrivateKey(e.mnemonic,e.hdPath,!1,"hex"));{let r=await(0,yg.mnemonicToSeed)(e.mnemonic.split(" ")),n=mr.base.toHex(r);return Promise.resolve(n)}}catch{return Promise.reject(pn.GenPrivateKeyError)}}async getNewAddress(e){try{if(!mr.base.validateHexString(e.privateKey))return Promise.reject(pn.NewAddressError);let r={address:(0,$n.getAddressBySeed)(e.privateKey.toLowerCase(),e.addressType),publicKey:(0,$n.getPubKeyBySeed)(e.privateKey.toLowerCase())};return Promise.resolve(r)}catch{return Promise.reject(pn.NewAddressError)}}async validPrivateKey(e){let r=!0;try{(0,$n.checkSeed)(e.privateKey)}catch{r=!1}let n={isValid:r,privateKey:e.privateKey};return Promise.resolve(n)}async validAddress(e){let r=(0,$n.parseAddress)(e.address);return Promise.resolve(r)}async parseAddress(e){let r=(0,$n.parseAddress)(e.address);return Promise.resolve(r)}async convertAddress(e){let r=(0,$n.convertAddress)(e.address);return Promise.resolve(r)}async validateMnemonicOfTon(e){return(0,yg.validateMnemonic)(e.mnemonicArray,e.password)}async signCommonMsg(e){return super.signCommonMsg({privateKey:e.privateKey,message:e.message,signType:pn.SignType.ED25519})}async signTransaction(e){let r=e.data;try{if(r.type=="transfer")return(0,Wn.transfer)(e.data,e.privateKey);if(r.type=="jettonTransfer")return(0,Wn.jettonTransfer)(e.data,e.privateKey)}catch{return Promise.reject(pn.SignTxError)}}async signJettonTransaction(e){try{return(0,Wn.jettonTransfer)(e.data,e.privateKey)}catch{return Promise.reject(pn.SignTxError)}}async signJettonMultiTransaction(e){try{return(0,Wn.jettonMultiTransfer)(e.data,e.privateKey)}catch{return Promise.reject(pn.SignTxError)}}async getWalletInformation(e){let{workChain:r,publicKey:n,privateKey:i,walletVersion:o}=e,a=r==1?1:0,s;if(n)s=mr.base.fromHex(n);else{let{publicKey:A}=mr.signUtil.ed25519.fromSeed(mr.base.fromHex(i));s=v.Buffer.from(A)}let u;!o||o=="v4r2"||o=="v4R2"?u=wc.WalletContractV4.create({workchain:a,publicKey:s}):(o=="v5r1"||o=="v5R1")&&(u=wc.WalletContractV5R1.create({workchain:a,publicKey:s}));let h=u.init?.code?.toBoc().toString("base64"),w=u.init?.data?.toBoc().toString("base64"),p=u.address,M=(0,af.beginCell)().storeWritable((0,af.storeStateInit)(u.init)).endCell().toBoc().toString("base64");return{publicKey:s.toString("hex"),initCode:h,initData:w,walletStateInit:M,walletAddress:p.toString({bounceable:!1})}}async getTransactionBodyForSimulate(e){if(e.privateKey){let{publicKey:n}=mr.signUtil.ed25519.fromSeed(mr.base.fromHex(e.privateKey)),i=mr.base.toHex(n);if(e.data.publicKey&&e.data.publicKey!=i)throw new Error("public key not pair the private key");e.data.publicKey||(e.data.publicKey=i),e.privateKey=""}else if(!e.data.publicKey)throw new Error("both private key and public key are null");let r=await this.signTransaction(e);return Promise.resolve(r.boc)}async calcTxHash(e){try{let n=af.Cell.fromBase64(e.data).hash().toString("hex");return Promise.resolve(n)}catch{return Promise.reject(pn.CalcTxHashError)}}async signTonProof(e){let{timestamp:r,domain:n,payload:i}=e.proof,o=v.Buffer.allocUnsafe(8);o.writeBigInt64LE(BigInt(r));let a=v.Buffer.from(n),s=v.Buffer.allocUnsafe(4);s.writeInt32LE(a.byteLength);let u=af.Address.parse(e.walletAddress),h=v.Buffer.allocUnsafe(4);h.writeInt32BE(u.workChain);let w=v.Buffer.concat([h,u.hash]),p=v.Buffer.concat([v.Buffer.from(e.tonProofItem,"utf8"),w,s,a,o,v.Buffer.from(i)]),M=v.Buffer.concat([v.Buffer.from(e.messageSalt,"hex"),v.Buffer.from(e.messageAction,"utf8"),v.Buffer.from(await mr.base.sha256(p))]),{secretKey:A}=mr.signUtil.ed25519.fromSeed(mr.base.fromHex(e.privateKey)),P=TA.default.sign.detached(v.Buffer.from(await mr.base.sha256(M)),v.Buffer.from(A));return Promise.resolve(v.Buffer.from(P).toString("base64"))}async signMultiTransaction(e){let r=e.data,n=(0,$n.getWalletContract)(r.walletVersion,e.data.publicKey||mr.base.fromHex((0,$n.getPubKeyBySeed)(e.privateKey)));if(n instanceof wc.WalletContractV4&&r.messages.length>4)throw new Error("Payload contains more than 4 messages, which exceeds limit of WalletContractV4");if(n instanceof wc.WalletContractV5R1&&r.messages.length>255)throw new Error("Payload contains more than 255 messages, which exceeds limit of WalletContractV5");let i=r.valid_until;if(i&&i>10**10&&(i=Math.round(i/1e3)),i&&i<Date.now()/1e3)throw new Error("the confirmation timeout has expired");let o=[];r.messages.map(s=>{o.push({toAddress:s.address,amount:BigInt(s.amount),payload:s.payload,stateInit:s.stateInit?af.Cell.fromBase64(s.stateInit):void 0,isBase64Payload:s.isBase64Payload})});let a=r.network==="1"||r.network==="testnet"?1:0;return await(0,Wn.signMultiTransaction)(e.privateKey,o,r.seqno,i,a,r.publicKey,void 0,r.walletVersion)}async simulateMultiTransaction(e){if(e.privateKey){let{publicKey:r}=mr.signUtil.ed25519.fromSeed(mr.base.fromHex(e.privateKey)),n=mr.base.toHex(r);if(e.data.publicKey&&e.data.publicKey!=n)throw new Error("public key not pair the private key");e.data.publicKey||(e.data.publicKey=n),e.privateKey=""}else if(!e.data.publicKey)throw new Error("both private key and public key are null");return this.signMultiTransaction(e)}async signMultiTransactionForNFT(e){let r=e.data,i=r.nftAddresses.map((o,a)=>{let s=r.nfts?.[a];return{payload:s?.collectionAddress===gg.NOTCOIN_VOUCHERS_ADDRESS?(0,vc.buildNotcoinVoucherExchange)(r.fromNFTAddress,o,s.index):(0,vc.buildNftTransferPayload)(r.fromNFTAddress,r.toAddress,r.comment),amount:gg.NFT_TRANSFER_TONCOIN_AMOUNT,toAddress:o}});return await(0,Wn.signMultiTransaction)(e.privateKey,i,r.seqno,r.expireAt,r.workchain)}async buildNotcoinVoucherExchange(e){let r=(0,vc.buildNotcoinVoucherExchange)(e.fromNFTAddress,e.nftAddress,e.nftIndex);return Promise.resolve(r.toBoc().toString("base64"))}async buildNftTransferPayload(e){let r=(0,vc.buildNftTransferPayload)(e.fromNFTAddress,e.nftAddress,e.comment);return Promise.resolve(r.toBoc().toString("base64"))}async addExtension(e){let r=(0,Wn.addExtension)(e.data,e.privateKey);return Promise.resolve(r)}async removeExtension(e){let r=(0,Wn.removeExtension)(e.data,e.privateKey);return Promise.resolve(r)}async setSignatureAuth(e){let r=(0,Wn.setSignatureAuth)(e);return Promise.resolve(r)}};Gn.TonWallet=ff;var _0=class extends ff{async getNewAddress(e){try{let r={address:(0,$n.getVenomAddressBySeed)(e.privateKey),publicKey:(0,$n.getPubKeyBySeed)(e.privateKey)};return Promise.resolve(r)}catch{return Promise.reject(pn.NewAddressError)}}async signTransaction(e){try{return(0,Wn.venomTransfer)(e.data,e.privateKey)}catch{return Promise.reject(pn.SignTxError)}}};Gn.VenomWallet=_0;var x0=class extends ff{};Gn.JettonWallet=x0});var CA=W(Mn=>{x();S();var OA=Mn&&Mn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),uf=Mn&&Mn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&OA(e,t,r)};Object.defineProperty(Mn,"__esModule",{value:!0});uf(mg(),Mn);uf(bc(),Mn);uf(gc(),Mn);uf(Yr(),Mn);uf(aa(),Mn)});export{CA as a};
|
||
|
||
window.inOKXExtension = true;
|
||
window.inMiniApp = false;
|
||
window.ASSETS_BUILD_TYPE = "publish";
|
||
|
||
//# sourceMappingURL=chunk-GKDBLVIT.js.map
|