1/*! For license information please see web3-core.327ee939.bundle.js.LICENSE.txt */ 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d8c825f2-8ebd-4faa-9cfc-59d8c7fe8ce1",e._sentryDebugIdIdentifier="sentry-dbid-d8c825f2-8ebd-4faa-9cfc-59d8c7fe8ce1")}catch(e){}}();var _global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};_global.SENTRY_RELEASE={id:"871db0f3296988cd7874"},(self.webpackChunksymbiosis_web_app=self.webpackChunksymbiosis_web_app||[]).push([["web3-core"],{"./node_modules/@coinbase/wallet-sdk/node_modules/@noble/hashes/_u64.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toBig=t.shrSL=t.shrSH=t.rotrSL=t.rotrSH=t.rotrBL=t.rotrBH=t.rotr32L=t.rotr32H=t.rotlSL=t.rotlSH=t.rotlBL=t.rotlBH=t.add5L=t.add5H=t.add4L=t.add4H=t.add3L=t.add3H=void 0,t.add=w,t.fromBig=o,t.split=s;const r=BigInt(2**32-1),n=BigInt(32);function o(e,t=!1){return t?{h:Number(e&r),l:Number(e>>n&r)}:{h:0|Number(e>>n&r),l:0|Number(e&r)}}function s(e,t=!1){const r=e.length;let n=new Uint32Array(r),s=new Uint32Array(r);for(let i=0;i<r;i++){const{h:r,l:a}=o(e[i],t);[n[i],s[i]]=[r,a]}return[n,s]}const i=(e,t)=>BigInt(e>>>0)<<n|BigInt(t>>>0);t.toBig=i;const a=(e,t,r)=>e>>>r;t.shrSH=a;const c=(e,t,r)=>e<<32-r|t>>>r;t.shrSL=c;const l=(e,t,r)=>e>>>r|t<<32-r;t.rotrSH=l;const u=(e,t,r)=>e<<32-r|t>>>r;t.rotrSL=u;const d=(e,t,r)=>e<<64-r|t>>>r-32;t.rotrBH=d;const h=(e,t,r)=>e>>>r-32|t<<64-r;t.rotrBL=h;const p=(e,t)=>t;t.rotr32H=p;const f=(e,t)=>e;t.rotr32L=f;const g=(e,t,r)=>e<<r|t>>>32-r;t.rotlSH=g;const m=(e,t,r)=>t<<r|e>>>32-r;t.rotlSL=m;const y=(e,t,r)=>t<<r-32|e>>>64-r;t.rotlBH=y;const b=(e,t,r)=>e<<r-32|t>>>64-r;function w(e,t,r,n){const o=(t>>>0)+(n>>>0);return{h:e+r+(o/2**32|0)|0,l:0|o}}t.rotlBL=b;const v=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);t.add3L=v;const A=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;t.add3H=A;const T=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);t.add4L=T;const P=(e,t,r,n,o)=>t+r+n+o+(e/2**32|0)|0;t.add4H=P;const E=(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0);t.add5L=E;const C=(e,t,r,n,o,s)=>t+r+n+o+s+(e/2**32|0)|0;t.add5H=C;const k={fromBig:o,split:s,toBig:i,shrSH:a,shrSL:c,rotrSH:l,rotrSL:u,rotrBH:d,rotrBL:h,rotr32H:p,rotr32L:f,rotlSH:g,rotlSL:m,rotlBH:y,rotlBL:b,add:w,add3L:v,add3H:A,add4L:T,add4H:P,add5H:C,add5L:E};t.default=k},"./node_modules/@coinbase/wallet-sdk/node_modules/@noble/hashes/crypto.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},"./node_modules/@coinbase/wallet-sdk/node_modules/@noble/hashes/sha3.js"(e,t,r){"use strict";t.keccak_256=void 0;const n=r("./node_modules/@coinbase/wallet-sdk/node_modules/@noble/hashes/_u64.js"),o=r("./node_modules/@coinbase/wallet-sdk/node_modules/@noble/hashes/utils.js"),s=BigInt(0),i=BigInt(1),a=BigInt(2),c=BigInt(7),l=BigInt(256),u=BigInt(113),d=[],h=[],p=[];for(let e=0,t=i,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],d.push(2*(5*n+r)),h.push((e+1)*(e+2)/2%64);let o=s;for(let e=0;e<7;e++)t=(t<<i^(t>>c)*u)%l,t&a&&(o^=i<<(i<<BigInt(e))-i);p.push(o)}const f=(0,n.split)(p,!0),g=f[0],m=f[1],y=(e,t,r)=>r>32?(0,n.rotlBH)(e,t,r):(0,n.rotlSH)(e,t,r),b=(e,t,r)=>r>32?(0,n.rotlBL)(e,t,r):(0,n.rotlSL)(e,t,r);function w(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const n=(t+8)%10,o=(t+2)%10,s=r[o],i=r[o+1],a=y(s,i,1)^r[n],c=b(s,i,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=c}let t=e[2],o=e[3];for(let r=0;r<24;r++){const n=h[r],s=y(t,o,n),i=b(t,o,n),a=d[r];t=e[a],o=e[a+1],e[a]=s,e[a+1]=i}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=g[n],e[1]^=m[n]}(0,o.clean)(r)}class v extends o.Hash{constructor(e,t,r,n=!1,s=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=s,(0,o.anumber)(r),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=(0,o.u32)(this.state)}clone(){return this._cloneInto()}keccak(){(0,o.swap32IfBE)(this.state32),w(this.state32,this.rounds),(0,o.swap32IfBE)(this.state32),this.posOut=0,this.pos=0}update(e){(0,o.aexists)(this),e=(0,o.toBytes)(e),(0,o.abytes)(e);const{blockLen:t,state:r}=this,n=e.length;for(let o=0;o<n;){const s=Math.min(t-this.pos,n-o);for(let t=0;t<s;t++)r[this.pos++]^=e[o++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,128&t&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){(0,o.aexists)(this,!1),(0,o.abytes)(e),this.finish();const t=this.state,{blockLen:r}=this;for(let n=0,o=e.length;n<o;){this.posOut>=r&&this.keccak();const s=Math.min(r-this.posOut,o-n);e.set(t.subarray(this.posOut,this.posOut+s),n),this.posOut+=s,n+=s}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,o.anumber)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,o.aoutput)(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,(0,o.clean)(this.state)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:n,rounds:o,enableXOF:s}=this;return e||(e=new v(t,r,n,s,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=r,e.outputLen=n,e.enableXOF=s,e.destroyed=this.destroyed,e}}const A=(e,t,r)=>(0,o.createHasher)((()=>new v(t,e,r)));A(6,144,28),A(6,136,32),A(6,104,48),A(6,72,64),A(1,144,28),t.keccak_256=A(1,136,32),A(1,104,48),A(1,72,64);const T=(e,t,r)=>(0,o.createXOFer)(((n={})=>new v(t,e,void 0===n.dkLen?r:n.dkLen,!0)));T(31,168,16),T(31,136,32)},"./node_modules/@coinbase/wallet-sdk/node_modules/@noble/hashes/utils.js"(e,t,r){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.Hash=t.nextTick=t.swap32IfBE=t.byteSwapIfBE=t.swap8IfBE=t.isLE=void 0,t.isBytes=o,t.anumber=s,t.abytes=i,t.ahash=function(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.createHasher");s(e.outputLen),s(e.blockLen)},t.aexists=function(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")},t.aoutput=function(e,t){i(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)},t.u8=function(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)},t.u32=function(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))},t.clean=function(...e){for(let t=0;t<e.length;t++)e[t].fill(0)},t.createView=function(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)},t.rotr=function(e,t){return e<<32-t|e>>>t},t.rotl=function(e,t){return e<<t|e>>>32-t>>>0},t.byteSwap=a,t.byteSwap32=c,t.bytesToHex=function(e){if(i(e),l)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=u[e[r]];return t},t.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);if(l)return Uint8Array.fromHex(e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,o=0;t<r;t++,o+=2){const r=y(e.charCodeAt(o)),s=y(e.charCodeAt(o+1));if(void 0===r||void 0===s){const t=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+o)}n[t]=16*r+s}return n},t.asyncLoop=async function(e,r,n){let o=Date.now();for(let s=0;s<e;s++){n(s);const e=Date.now()-o;e>=0&&e<r||(await(0,t.nextTick)(),o+=e)}},t.utf8ToBytes=b,t.bytesToUtf8=function(e){return(new TextDecoder).decode(e)},t.toBytes=w,t.kdfInputToBytes=function(e){"string"==typeof e&&(e=b(e));return i(e),e},t.concatBytes=function(...e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];i(n),t+=n.length}const r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const o=e[t];r.set(o,n),n+=o.length}return r},t.checkOpts=function(e,t){if(void 0!==t&&"[object Object]"!=={}.toString.call(t))throw new Error("options should be object or undefined");return Object.assign(e,t)},t.createHasher=v,t.createOptHasher=A,t.createXOFer=T,t.randomBytes=function(e=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));if(n.crypto&&"function"==typeof n.crypto.randomBytes)return Uint8Array.from(n.crypto.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")};const n=r("./node_modules/@coinbase/wallet-sdk/node_modules/@noble/hashes/crypto.js");function o(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function s(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function i(e,...t){if(!o(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function a(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function c(e){for(let t=0;t<e.length;t++)e[t]=a(e[t]);return e}t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],t.swap8IfBE=t.isLE?e=>e:e=>a(e),t.byteSwapIfBE=t.swap8IfBE,t.swap32IfBE=t.isLE?e=>e:c;const l=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),u=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));const d=48,h=57,p=65,f=70,g=97,m=102;function y(e){return e>=d&&e<=h?e-d:e>=p&&e<=f?e-(p-10):e>=g&&e<=m?e-(g-10):void 0}function b(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))}function w(e){return"string"==typeof e&&(e=b(e)),i(e),e}t.nextTick=async()=>{};function v(e){const t=t=>e().update(w(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function A(e){const t=(t,r)=>e(r).update(w(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}function T(e){const t=(t,r)=>e(r).update(w(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}t.Hash=class{},t.wrapConstructor=v,t.wrapConstructorWithOpts=A,t.wrapXOFConstructorWithOpts=T},"./node_modules/@ethersproject/abi/lib.esm/_version.js"(e,t,r){"use strict";r.d(t,{r:()=>n});const n="abi/5.8.0"},"./node_modules/@ethersproject/abi/lib.esm/abi-coder.js"(e,t,r){"use strict";r.d(t,{y:()=>x,D:()=>B});var n=r("./node_modules/@ethersproject/bytes/lib.esm/index.js"),o=r("./node_modules/@ethersproject/properties/lib.esm/index.js"),s=r("./node_modules/@ethersproject/logger/lib.esm/index.js"),i=r("./node_modules/@ethersproject/abi/lib.esm/_version.js"),a=r("./node_modules/@ethersproject/abi/lib.esm/coders/abstract-coder.js"),c=r("./node_modules/@ethersproject/address/lib.esm/index.js");class l extends a.Ue{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=(0,c.getAddress)(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}decode(e){return(0,c.getAddress)((0,n.hexZeroPad)(e.readValue().toHexString(),20))}}class u extends a.Ue{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}
2defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}const d=new s.Logger(i.r);function h(e,t,r){let n=null;if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let e={};n=t.map((t=>{const n=t.localName;return n||d.throwError("cannot encode object for signature with missing names",s.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]&&d.throwError("cannot encode object for signature with duplicate names",s.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]=!0,r[n]}))}else d.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&d.throwArgumentError("types/value length mismatch","tuple",r);let o=new a.AU(e.wordSize),i=new a.AU(e.wordSize),c=[];t.forEach(((e,t)=>{let r=n[t];if(e.dynamic){let t=i.length;e.encode(i,r);let n=o.writeUpdatableValue();c.push((e=>{n(e+t)}))}else e.encode(o,r)})),c.forEach((e=>{e(o.length)}));let l=e.appendWriter(o);return l+=e.appendWriter(i),l}function p(e,t){let r=[],n=e.subReader(0);t.forEach((t=>{let o=null;if(t.dynamic){let r=e.readValue(),i=n.subReader(r.toNumber());try{o=t.decode(i)}catch(e){if(e.code===s.Logger.errors.BUFFER_OVERRUN)throw e;o=e,o.baseType=t.name,o.name=t.localName,o.type=t.type}}else try{o=t.decode(e)}catch(e){if(e.code===s.Logger.errors.BUFFER_OVERRUN)throw e;o=e,o.baseType=t.name,o.name=t.localName,o.type=t.type}null!=o&&r.push(o)}));const o=t.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});t.forEach(((e,t)=>{let n=e.localName;if(!n||1!==o[n])return;if("length"===n&&(n="_length"),null!=r[n])return;const s=r[t];s instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw s}}):r[n]=s}));for(let e=0;e<r.length;e++){const t=r[e];t instanceof Error&&Object.defineProperty(r,e,{enumerable:!0,get:()=>{throw t}})}return Object.freeze(r)}class f extends a.Ue{constructor(e,t,r){super("array",e.type+"["+(t>=0?t:"")+"]",r,-1===t||e.dynamic),this.coder=e,this.length=t}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let r=0;r<this.length;r++)t.push(e);return t}encode(e,t){Array.isArray(t)||this._throwError("expected array value",t);let r=this.length;-1===r&&(r=t.length,e.writeValue(t.length)),d.checkArgumentCount(t.length,r,"coder array"+(this.localName?" "+this.localName:""));let n=[];for(let e=0;e<t.length;e++)n.push(this.coder);return h(e,n,t)}decode(e){let t=this.length;-1===t&&(t=e.readValue().toNumber(),32*t>e._data.length&&d.throwError("insufficient data length",s.Logger.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let r=[];for(let e=0;e<t;e++)r.push(new u(this.coder));return e.coerce(this.name,p(e,r))}}class g extends a.Ue{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){return e.writeValue(t?1:0)}decode(e){return e.coerce(this.type,!e.readValue().isZero())}}class m extends a.Ue{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=(0,n.arrayify)(t);let r=e.writeValue(t.length);return r+=e.writeBytes(t),r}decode(e){return e.readBytes(e.readValue().toNumber(),!0)}}class y extends m{constructor(e){super("bytes",e)}decode(e){return e.coerce(this.name,(0,n.hexlify)(super.decode(e)))}}class b extends a.Ue{constructor(e,t){let r="bytes"+String(e);super(r,r,t,!1),this.size=e}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(e,t){let r=(0,n.arrayify)(t);return r.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(r)}decode(e){return e.coerce(this.name,(0,n.hexlify)(e.readBytes(this.size)))}}class w extends a.Ue{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return null!=t&&this._throwError("not null",t),e.writeBytes([])}decode(e){return e.readBytes(0),e.coerce(this.name,null)}}var v=r("./node_modules/@ethersproject/bignumber/lib.esm/bignumber.js"),A=r("./node_modules/@ethersproject/constants/lib.esm/bignumbers.js");class T extends a.Ue{constructor(e,t,r){const n=(t?"int":"uint")+8*e;super(n,n,r,!1),this.size=e,this.signed=t}defaultValue(){return 0}encode(e,t){let r=v.gH.from(t),n=A.Is.mask(8*e.wordSize);if(this.signed){let e=n.mask(8*this.size-1);(r.gt(e)||r.lt(e.add(A.pD).mul(A.eR)))&&this._throwError("value out-of-bounds",t)}else(r.lt(A.XK)||r.gt(n.mask(8*this.size)))&&this._throwError("value out-of-bounds",t);return r=r.toTwos(8*this.size).mask(8*this.size),this.signed&&(r=r.fromTwos(8*this.size).toTwos(8*e.wordSize)),e.writeValue(r)}decode(e){let t=e.readValue().mask(8*this.size);return this.signed&&(t=t.fromTwos(8*this.size)),e.coerce(this.name,t)}}var P=r("./node_modules/@ethersproject/strings/lib.esm/utf8.js");class E extends m{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,(0,P.YW)(t))}decode(e){return(0,P._v)(super.decode(e))}}class C extends a.Ue{constructor(e,t){let r=!1;const n=[];e.forEach((e=>{e.dynamic&&(r=!0),n.push(e.type)}));super("tuple","tuple("+n.join(",")+")",t,r),this.coders=e}defaultValue(){const e=[];
2this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});return this.coders.forEach(((r,n)=>{let o=r.localName;o&&1===t[o]&&("length"===o&&(o="_length"),null==e[o]&&(e[o]=e[n]))})),Object.freeze(e)}encode(e,t){return h(e,this.coders,t)}decode(e){return e.coerce(this.name,p(e,this.coders))}}var k=r("./node_modules/@ethersproject/abi/lib.esm/fragments.js");const _=new s.Logger(i.r),I=new RegExp(/^bytes([0-9]*)$/),S=new RegExp(/^(u?int)([0-9]*)$/);class x{constructor(e){(0,o.defineReadOnly)(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new l(e.name);case"bool":return new g(e.name);case"string":return new E(e.name);case"bytes":return new y(e.name);case"array":return new f(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new C((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new w(e.name)}let t=e.type.match(S);if(t){let r=parseInt(t[2]||"256");return(0===r||r>256||r%8!=0)&&_.throwArgumentError("invalid "+t[1]+" bit length","param",e),new T(r/8,"int"===t[1],e.name)}if(t=e.type.match(I),t){let r=parseInt(t[1]);return(0===r||r>32)&&_.throwArgumentError("invalid bytes length","param",e),new b(r,e.name)}return _.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new a.mP(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new a.AU(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder(k.aX.from(e))));return new C(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&_.throwError("types/values length mismatch",s.Logger.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const r=e.map((e=>this._getCoder(k.aX.from(e)))),n=new C(r,"_"),o=this._getWriter();return n.encode(o,t),o.data}decode(e,t,r){const o=e.map((e=>this._getCoder(k.aX.from(e))));return new C(o,"_").decode(this._getReader((0,n.arrayify)(t),r))}}const B=new x},"./node_modules/@ethersproject/abi/lib.esm/coders/abstract-coder.js"(e,t,r){"use strict";r.d(t,{$v:()=>l,AU:()=>d,Ue:()=>u,mP:()=>h});var n=r("./node_modules/@ethersproject/bytes/lib.esm/index.js"),o=r("./node_modules/@ethersproject/bignumber/lib.esm/bignumber.js"),s=r("./node_modules/@ethersproject/properties/lib.esm/index.js"),i=r("./node_modules/@ethersproject/logger/lib.esm/index.js"),a=r("./node_modules/@ethersproject/abi/lib.esm/_version.js");const c=new i.Logger(a.r);function l(e){const t=[],r=function(e,n){if(Array.isArray(n))for(let o in n){const s=e.slice();s.push(o);try{r(s,n[o])}catch(e){t.push({path:s,error:e})}}};return r([],e),t}class u{constructor(e,t,r,n){this.name=e,this.type=t,this.localName=r,this.dynamic=n}_throwError(e,t){c.throwArgumentError(e,this.localName,t)}}class d{constructor(e){(0,s.defineReadOnly)(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return(0,n.hexConcat)(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData((0,n.concat)(e._data))}writeBytes(e){let t=(0,n.arrayify)(e);const r=t.length%this.wordSize;return r&&(t=(0,n.concat)([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=(0,n.arrayify)(o.gH.from(e));return t.length>this.wordSize&&c.throwError("value out-of-bounds",i.Logger.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=(0,n.concat)([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class h{constructor(e,t,r,o){(0,s.defineReadOnly)(this,"_data",(0,n.arrayify)(e)),(0,s.defineReadOnly)(this,"wordSize",t||32),(0,s.defineReadOnly)(this,"_coerceFunc",r),(0,s.defineReadOnly)(this,"allowLoose",o),this._offset=0}get data(){return(0,n.hexlify)(this._data)}get consumed(){return this._offset}static coerce(e,t){let r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):h.coerce(e,t)}_peekBytes(e,t,r){let n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:c.throwError("data out-of-bounds",i.Logger.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(e){return new h(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}readValue(){return o.gH.from(this.readBytes(this.wordSize))}}},"./node_modules/@ethersproject/abi/lib.esm/fragments.js"(e,t,r){"use strict";r.d(t,{$o:()=>p,FK:()=>y,Pw:()=>T,Zp:()=>b,aX:()=>g,bp:()=>C,hc:()=>P});var n=r("./node_modules/@ethersproject/bignumber/lib.esm/bignumber.js"),o=r("./node_modules/@ethersproject/properties/lib.esm/index.js"),s=r("./node_modules/@ethersproject/logger/lib.esm/index.js"),i=r("./node_modules/@ethersproject/abi/lib.esm/_version.js");const a=new s.Logger(i.r),c={};let l={calldata:!0,memory:!0,storage:!0},u={calldata:!0,memory:!0};function d(e,t){if("bytes"===e||"string"===e){if(l[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&u[t])return!0;return(l[t]||"payable"===t)&&a.throwArgumentError("invalid modifier","name",t),!1}function h(e,t){for(let r in t)(0,o.defineReadOnly)(e,r,t[r])}const p=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),f=new RegExp(/^(.*)\[([0-9]*)\]$/);class g{constructor(e,t){e!==c&&a.throwError("use fromString",s.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),h(this,t);
vendor: 8,999 bytes, line 2
2let r=this.type.match(f);h(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:g.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=p.sighash),p[e]||a.throwArgumentError("invalid format type","format",e),e===p.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==p.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===p.full?", ":",")+")"):t+=this.type,e!==p.sighash&&(!0===this.indexed&&(t+=" indexed"),e===p.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"==typeof e?g.fromString(e,t):g.fromObject(e)}static fromObject(e){return g.isParamType(e)?e:new g(c,{name:e.name||null,type:k(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(g.fromObject):null})}static fromString(e,t){return r=function(e,t){let r=e;function n(t){a.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function o(e){let r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");let s={type:"",name:"",state:{allowType:!0}},i=s;for(let r=0;r<e.length;r++){let s=e[r];switch(s){case"(":i.state.allowType&&""===i.type?i.type="tuple":i.state.allowParams||n(r),i.state.allowType=!1,i.type=k(i.type),i.components=[o(i)],i=i.components[0];break;case")":delete i.state,"indexed"===i.name&&(t||n(r),i.indexed=!0,i.name=""),d(i.type,i.name)&&(i.name=""),i.type=k(i.type);let e=i;i=i.parent,i||n(r),delete e.parent,i.state.allowParams=!1,i.state.allowName=!0,i.state.allowArray=!0;break;case",":delete i.state,"indexed"===i.name&&(t||n(r),i.indexed=!0,i.name=""),d(i.type,i.name)&&(i.name=""),i.type=k(i.type);let a=o(i.parent);i.parent.components.push(a),delete i.parent,i=a;break;case" ":i.state.allowType&&""!==i.type&&(i.type=k(i.type),delete i.state.allowType,i.state.allowName=!0,i.state.allowParams=!0),i.state.allowName&&""!==i.name&&("indexed"===i.name?(t||n(r),i.indexed&&n(r),i.indexed=!0,i.name=""):d(i.type,i.name)?i.name="":i.state.allowName=!1);break;case"[":i.state.allowArray||n(r),i.type+=s,i.state.allowArray=!1,i.state.allowName=!1,i.state.readArray=!0;break;case"]":i.state.readArray||n(r),i.type+=s,i.state.readArray=!1,i.state.allowArray=!0,i.state.allowName=!0;break;default:i.state.allowType?(i.type+=s,i.state.allowParams=!0,i.state.allowArray=!0):i.state.allowName?(i.name+=s,delete i.state.allowArray):i.state.readArray?i.type+=s:n(r)}}return i.parent&&a.throwArgumentError("unexpected eof","param",e),delete s.state,"indexed"===i.name?(t||n(r.length-7),i.indexed&&n(r.length-7),i.indexed=!0,i.name=""):d(i.type,i.name)&&(i.name=""),s.type=k(s.type),s}(e,!!t),g.fromObject({name:r.name,type:r.type,indexed:r.indexed,components:r.components});var r}static isParamType(e){return!(null==e||!e._isParamType)}}function m(e,t){return function(e){e=e.trim();let t=[],r="",n=0;for(let o=0;o<e.length;o++){let s=e[o];","===s&&0===n?(t.push(r),r=""):(r+=s,"("===s?n++:")"===s&&(n--,-1===n&&a.throwArgumentError("unbalanced parenthesis","value",e)))}r&&t.push(r);return t}(e).map((e=>g.fromString(e,t)))}class y{constructor(e,t){e!==c&&a.throwError("use a static from method",s.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),h(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return y.isFragment(e)?e:"string"==typeof e?y.fromString(e):y.fromObject(e)}static fromObject(e){if(y.isFragment(e))return e;switch(e.type){case"function":return P.fromObject(e);case"event":return b.fromObject(e);case"constructor":return T.fromObject(e);case"error":return C.fromObject(e);case"fallback":case"receive":return null}return a.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?b.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?P.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?T.fromString(e.trim()):"error"===e.split(" ")[0]?C.fromString(e.substring(5).trim()):a.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class b extends y{format(e){if(e||(e=p.sighash),p[e]||a.throwArgumentError("invalid format type","format",e),e===p.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==p.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===p.full?", ":",")+") ",e!==p.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"==typeof e?b.fromString(e):b.fromObject(e)}static fromObject(e){if(b.isEventFragment(e))return e;"event"!==e.type&&a.throwArgumentError("invalid event object","value",e);const t={name:I(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(g.fromObject):[],type:"event"};return new b(c,t)}static fromString(e){let t=e.match(S);t||a.throwArgumentError("invalid event string","value",e);let r=!1;return t[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":r=!0;break;case"":break;default:a.warn("unknown modifier: "+e)}})),b.fromObject({name:t[1].trim(),anonymous:r,inputs:m(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function w(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&&a.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||a.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=n.gH.from(r[1]),r[0]):e}function v(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function A(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&a.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&a.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||a.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&a.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&a.throwArgumentError("unable to determine stateMutability","value",e),t}class T extends y{format(e){if(e||(e=p.sighash),p[e]||a.throwArgumentError("invalid format type","format",e),e===p.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});e===p.sighash&&a.throwError("cannot format a constructor for sighash",s.Logger.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===p.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?T.fromString(e):T.fromObject(e)}static fromObject(e){if(T.isConstructorFragment(e))return e;"constructor"!==e.type&&a.throwArgumentError("invalid constructor object","value",e);let t=A(e);t.constant&&a.throwArgumentError("constructor cannot be constant","value",e);const r={name:null,type:e.type,inputs:e.inputs?e.inputs.map(g.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?n.gH.from(e.gas):null};return new T(c,r)}static fromString(e){let t={type:"constructor"},r=(e=w(e,t)).match(S);return r&&"constructor"===r[1].trim()||a.throwArgumentError("invalid constructor string","value",e),t.input
2s=m(r[2].trim(),!1),v(r[3].trim(),t),T.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class P extends T{format(e){if(e||(e=p.sighash),p[e]||a.throwArgumentError("invalid format type","format",e),e===p.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==p.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===p.full?", ":",")+") ",e!==p.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((t=>t.format(e))).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return"string"==typeof e?P.fromString(e):P.fromObject(e)}static fromObject(e){if(P.isFunctionFragment(e))return e;"function"!==e.type&&a.throwArgumentError("invalid function object","value",e);let t=A(e);const r={type:e.type,name:I(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(g.fromObject):[],outputs:e.outputs?e.outputs.map(g.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?n.gH.from(e.gas):null};return new P(c,r)}static fromString(e){let t={type:"function"},r=(e=w(e,t)).split(" returns ");r.length>2&&a.throwArgumentError("invalid function string","value",e);let n=r[0].match(S);if(n||a.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&I(t.name),t.inputs=m(n[2],!1),v(n[3].trim(),t),r.length>1){let n=r[1].match(S);""==n[1].trim()&&""==n[3].trim()||a.throwArgumentError("unexpected tokens","value",e),t.outputs=m(n[2],!1)}else t.outputs=[];return P.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function E(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||a.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class C extends y{format(e){if(e||(e=p.sighash),p[e]||a.throwArgumentError("invalid format type","format",e),e===p.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==p.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===p.full?", ":",")+") ",t.trim()}static from(e){return"string"==typeof e?C.fromString(e):C.fromObject(e)}static fromObject(e){if(C.isErrorFragment(e))return e;"error"!==e.type&&a.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:I(e.name),inputs:e.inputs?e.inputs.map(g.fromObject):[]};return E(new C(c,t))}static fromString(e){let t={type:"error"},r=e.match(S);return r||a.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&I(t.name),t.inputs=m(r[2],!1),E(C.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function k(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const _=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function I(e){return e&&e.match(_)||a.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const S=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$")},"./node_modules/@ethersproject/abi/lib.esm/index.js"(e,t,r){"use strict";r.r(t),r.d(t,{AbiCoder:()=>o.y,ConstructorFragment:()=>n.Pw,ErrorFragment:()=>n.bp,EventFragment:()=>n.Zp,FormatTypes:()=>n.$o,Fragment:()=>n.FK,FunctionFragment:()=>n.hc,Indexed:()=>s.wu,Interface:()=>s.KA,LogDescription:()=>s.FW,ParamType:()=>n.aX,TransactionDescription:()=>s.dJ,checkResultErrors:()=>i.$v,defaultAbiCoder:()=>o.D});var n=r("./node_modules/@ethersproject/abi/lib.esm/fragments.js"),o=r("./node_modules/@ethersproject/abi/lib.esm/abi-coder.js"),s=r("./node_modules/@ethersproject/abi/lib.esm/interface.js"),i=r("./node_modules/@ethersproject/abi/lib.esm/coders/abstract-coder.js")},"./node_modules/@ethersproject/abi/lib.esm/interface.js"(e,t,r){"use strict";r.d(t,{FW:()=>f,KA:()=>v,dJ:()=>g,wu:()=>y});var n=r("./node_modules/@ethersproject/address/lib.esm/index.js"),o=r("./node_modules/@ethersproject/bignumber/lib.esm/bignumber.js"),s=r("./node_modules/@ethersproject/bytes/lib.esm/index.js"),i=r("./node_modules/@ethersproject/hash/lib.esm/id.js"),a=r("./node_modules/@ethersproject/keccak256/lib.esm/index.js"),c=r("./node_modules/@ethersproject/properties/lib.esm/index.js"),l=r("./node_modules/@ethersproject/abi/lib.esm/abi-coder.js"),u=r("./node_modules/@ethersproject/abi/lib.esm/fragments.js"),d=r("./node_modules/@ethersproject/logger/lib.esm/index.js"),h=r("./node_modules/@ethersproject/abi/lib.esm/_version.js");const p=new d.Logger(h.r);class f extends c.Description{}class g extends c.Description{}class m extends c.Description{}class y extends c.Description{static isIndexed(e){return!(!e||!e._isIndexed)}}const b={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function w(e,t){const r=new Error(`deferred error during ABI decoding triggered accessing ${e}`);return r.error=t,r}class v{constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,(0,c.defineReadOnly)(this,"fragments",t.map((e=>u.FK.from(e))).filter((e=>null!=e))),(0,c.defineReadOnly)(this,"_abiCoder",(0,c.getStatic)(new.target,"getAbiCoder")()),(0,c.defineReadOnly)(this,"functions",{}),(0,c.defineReadOnly)(this,"errors",{}),(0,c.defineReadOnly)(this,"events",{}),(0,c.defineReadOnly)(this,"structs",{}
2),this.fragments.forEach((e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void p.warn("duplicate definition - constructor"):void(0,c.defineReadOnly)(this,"deploy",e);case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return}let r=e.format();t[r]?p.warn("duplicate definition - "+r):t[r]=e})),this.deploy||(0,c.defineReadOnly)(this,"deploy",u.Pw.from({payable:!1,type:"constructor"})),(0,c.defineReadOnly)(this,"_isInterface",!0)}format(e){e||(e=u.$o.full),e===u.$o.sighash&&p.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===u.$o.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return l.D}static getAddress(e){return(0,n.getAddress)(e)}static getSighash(e){return(0,s.hexDataSlice)((0,i.id)(e.format()),0,4)}static getEventTopic(e){return(0,i.id)(e.format())}getFunction(e){if((0,s.isHexString)(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];p.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.functions).filter((e=>e.split("(")[0]===t));return 0===r.length?p.throwArgumentError("no matching function","name",t):r.length>1&&p.throwArgumentError("multiple matching functions","name",t),this.functions[r[0]]}const t=this.functions[u.hc.fromString(e).format()];return t||p.throwArgumentError("no matching function","signature",e),t}getEvent(e){if((0,s.isHexString)(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];p.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.events).filter((e=>e.split("(")[0]===t));return 0===r.length?p.throwArgumentError("no matching event","name",t):r.length>1&&p.throwArgumentError("multiple matching events","name",t),this.events[r[0]]}const t=this.events[u.Zp.fromString(e).format()];return t||p.throwArgumentError("no matching event","signature",e),t}getError(e){if((0,s.isHexString)(e)){const t=(0,c.getStatic)(this.constructor,"getSighash");for(const r in this.errors){if(e===t(this.errors[r]))return this.errors[r]}p.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.errors).filter((e=>e.split("(")[0]===t));return 0===r.length?p.throwArgumentError("no matching error","name",t):r.length>1&&p.throwArgumentError("multiple matching errors","name",t),this.errors[r[0]]}const t=this.errors[u.hc.fromString(e).format()];return t||p.throwArgumentError("no matching error","signature",e),t}getSighash(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return(0,c.getStatic)(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),(0,c.getStatic)(this.constructor,"getEventTopic")(e)}_decodeParams(e,t){return this._abiCoder.decode(e,t)}_encodeParams(e,t){return this._abiCoder.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){"string"==typeof e&&(e=this.getError(e));const r=(0,s.arrayify)(t);return(0,s.hexlify)(r.slice(0,4))!==this.getSighash(e)&&p.throwArgumentError(`data signature does not match error ${e.name}.`,"data",(0,s.hexlify)(r)),this._decodeParams(e.inputs,r.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),(0,s.hexlify)((0,s.concat)([this.get
2Sighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));const r=(0,s.arrayify)(t);return(0,s.hexlify)(r.slice(0,4))!==this.getSighash(e)&&p.throwArgumentError(`data signature does not match function ${e.name}.`,"data",(0,s.hexlify)(r)),this._decodeParams(e.inputs,r.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),(0,s.hexlify)((0,s.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let r=(0,s.arrayify)(t),n=null,o="",i=null,a=null,c=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(e){}break;case 4:{const e=(0,s.hexlify)(r.slice(0,4)),t=b[e];if(t)i=this._abiCoder.decode(t.inputs,r.slice(4)),a=t.name,c=t.signature,t.reason&&(n=i[0]),"Error"===a?o=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(i[0])}`:"Panic"===a&&(o=`; VM Exception while processing transaction: reverted with panic code ${i[0]}`);else try{const t=this.getError(e);i=this._abiCoder.decode(t.inputs,r.slice(4)),a=t.name,c=t.format()}catch(e){}break}}return p.throwError("call revert exception"+o,d.Logger.errors.CALL_EXCEPTION,{method:e.format(),data:(0,s.hexlify)(t),errorArgs:i,errorName:a,errorSignature:c,reason:n})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),(0,s.hexlify)(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&p.throwError("too many arguments for "+e.format(),d.Logger.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let r=[];e.anonymous||r.push(this.getEventTopic(e));const n=(e,t)=>"string"===e.type?(0,i.id)(t):"bytes"===e.type?(0,a.keccak256)((0,s.hexlify)(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=o.gH.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),(0,s.hexZeroPad)((0,s.hexlify)(t),32));for(t.forEach(((t,o)=>{let s=e.inputs[o];s.indexed?null==t?r.push(null):"array"===s.baseType||"tuple"===s.baseType?p.throwArgumentError("filtering with tuples or arrays not supported","contract."+s.name,t):Array.isArray(t)?r.push(t.map((e=>n(s,e)))):r.push(n(s,t)):null!=t&&p.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+s.name,t)}));r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(e,t){"string"==typeof e&&(e=this.getEvent(e));const r=[],n=[],o=[];return e.anonymous||r.push(this.getEventTopic(e)),t.length!==e.inputs.length&&p.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach(((e,s)=>{const c=t[s];if(e.indexed)if("string"===e.type)r.push((0,i.id)(c));else if("bytes"===e.type)r.push((0,a.keccak256)(c));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");r.push(this._abiCoder.encode([e.type],[c]))}else n.push(e),o.push(c)})),{data:this._abiCoder.encode(n,o),topics:r}}decodeEventLog(e,t,r){if("string"==typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){let t=this.getEventTopic(e);(0,s.isHexString)(r[0],32)&&r[0].toLowerCase()===t||p.throwError("fragment/topic mismatch",d.Logger.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:t,value:r[0]}),r=r.slice(1)}let n=[],o=[],i=[];e.inputs.forEach(((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(n.push(u.aX.fromObject({type:"bytes32",name:e.name})),i.push(!0)):(n.push(e),i.push(!1)):(o.push(e),i.push(!1))}));let a=null!=r?this._abiCoder.decode(n,(0,s.concat)(r)):null,c=this._abiCoder.decode(o,t,!0),l=[],h=0,f=0;e.inputs.forEach(((e,t)=>{if(e.indexed)if(null==a)l[t]=new y({_isIndexed:!0,hash:null});else if(i[t])l[t]=new y({_isIndexed:!0,hash:a[f++]});else try{l[t]=a[f++]}catch(e){l[t]=e}else try{l[t]=c[h++]}catch(e){l[t]=e}if(e.name&&null==l[e.name]){const r=l[t];r instanceof Error?Object.defineProperty(l,e.name,{enumerable:!0,get:()=>{throw w(`property ${JSON.stringify(e.name)}`,r)}}):l[e.name]=r}}));for(let e=0;e<l.length;e++){const t=l[e];t instanceof Error&&Object.defineProperty(l,e,{enumerable:!0,get:()=>{throw w(`index ${e}`,t)}})}return Object.freeze(l)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new g({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:o.gH.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new f({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=(0,s.hexlify)(e);let r=this.getError(t.substring(0,10).toLowerCase());return r?new m({args:this._abiCoder.decode(r.inputs,"0x"+t.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}static isInterface(e){return!(!e||!e._isInterface)}}},"./node_modules/@ethersproject/abstract-provider/lib.esm/index.js"(e,t,r){"use strict";r.d(t,{Rj:()=>c,Kq:()=>l});var n=r("./node_modules/@ethersproject/bignumber/lib.esm/bignumber.js"),o=(r("./node_modules/@ethersproject/bytes/lib.esm/index.js"),r("./node_modules/@ethersproject/properties/lib.esm/index.js")),s=r("./node_modules/@ethersproject/logger/lib.esm/index.js");var i=function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))};const a=new s.Logger("abstract-provider/5.8.0");class c extends o.Description{static isForkEvent(e){return!(!e||!e._isForkEvent)}}class l{constructor(){a.checkAbstract(new.target,l),(0,o.defineReadOnly)(this,"_isProvider",!0)}getFeeData(){return i(this,void 0,void 0,(function*(){const{block:e,gasPrice:t}=yield(0,o.resolveProperties)({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((e=>null))});let r=null,s=null,i=null;return e&&e.baseFeePerGas&&(r=e.baseFeePerGas,i=n.gH.from("1500000000"),s=e.baseFeePerGas.mul(2).add(i)),{lastBaseFeePerGas:r,maxFeePerGas:s,maxPriorityFeePerGas:i,gasPrice:t}}))}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}static isProvider(e){return!(!e||!e._isProvider)}}},"./node_modules/@ethersproject/abstract-signer/lib.esm/index.js"(e,t,r){"use strict";r.d(t,{l:()=>l,J:()=>u});var n=r("./node_modules/@ethersproject/properties/lib.esm/index.js"),o=r("./node_modules/@ethersproject/logger/lib.esm/index.js");var s=function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))};const i=new o.Logger("abstract-signer/5.8.0"),a=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","
2nonce","to","type","value"],c=[o.Logger.errors.INSUFFICIENT_FUNDS,o.Logger.errors.NONCE_EXPIRED,o.Logger.errors.REPLACEMENT_UNDERPRICED];class l{constructor(){i.checkAbstract(new.target,l),(0,n.defineReadOnly)(this,"_isSigner",!0)}getBalance(e){return s(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)}))}getTransactionCount(e){return s(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)}))}estimateGas(e){return s(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const t=yield(0,n.resolveProperties)(this.checkTransaction(e));return yield this.provider.estimateGas(t)}))}call(e,t){return s(this,void 0,void 0,(function*(){this._checkProvider("call");const r=yield(0,n.resolveProperties)(this.checkTransaction(e));return yield this.provider.call(r,t)}))}sendTransaction(e){return s(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const t=yield this.populateTransaction(e),r=yield this.signTransaction(t);return yield this.provider.sendTransaction(r)}))}getChainId(){return s(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return s(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return s(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(e){return s(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)}))}checkTransaction(e){for(const t in e)-1===a.indexOf(t)&&i.throwArgumentError("invalid transaction key: "+t,"transaction",e);const t=(0,n.shallowCopy)(e);return null==t.from?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then((t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&i.throwArgumentError("from address mismatch","transaction",e),t[0]))),t}populateTransaction(e){return s(this,void 0,void 0,(function*(){const t=yield(0,n.resolveProperties)(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then((e=>s(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.resolveName(e);return null==t&&i.throwArgumentError("provided ENS name resolves to null","tx.to",e),t})))),t.to.catch((e=>{})));const r=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!r?0!==t.type&&1!==t.type||!r||i.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):i.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas)if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{const e=yield this.getFeeData();if(null==t.type)if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)if(t.type=2,null!=t.gasPrice){const e=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=e,t.maxPriorityFeePerGas=e}else null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas);else null!=e.gasPrice?(r&&i.throwError("network does not support EIP-1559",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):i.throwError("failed to get consistent fee data",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else t.type=2;return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch((e=>{if(c.indexOf(e.code)>=0)throw e;return i.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",o.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:t})}))),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then((t=>(0!==t[1]&&t[0]!==t[1]&&i.throwArgumentError("chainId address mismatch","transaction",e),t[0]))),yield(0,n.resolveProperties)(t)}))}_checkProvider(e){this.provider||i.throwError("missing provider",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!(!e||!e._isSigner)}}class u extends l{constructor(e,t){super(),(0,n.defineReadOnly)(this,"address",e),(0,n.defineReadOnly)(this,"provider",t||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,t){return Promise.resolve().then((()=>{i.throwError(e,o.Logger.errors.UNSUPPORTED_OPERATION,{operation:t})}))}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,t,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new u(this.address,e)}}},"./node_modules/@ethersproject/address/lib.esm/index.js"(e,t,r){"use strict";r.r(t),r.d(t,{getAddress:()=>p,getContractAddress:()=>m,getCreate2Address:()=>y,getIcapAddress:()=>g,isAddress:()=>f});var n=r("./node_modules/@ethersproject/bytes/lib.esm/index.js"),o=r("./node_modules/@ethersproject/bignumber/lib.esm/bignumber.js"),s=r("./node_modules/@ethersproject/keccak256/lib.esm/index.js"),i=r("./node_modules/@ethersproject/rlp/lib.esm/index.js");const a=new(r("./node_modules/@ethersproject/logger/lib.esm/index.js").Logger)("address/5.8.0");function c(e){(0,n.isHexString)(e,20)||a.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let e=0;e<40;e++)r[e]=t[e].charCodeAt(0);const o=(0,n.arrayify)((0,s.keccak256)(r));for(let e=0;e<40;e+=2)o[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&o[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}const l={};for(let e=0;e<10;e++)l[String(e)]=String(e);for(let e=0;e<26;e++)l[String.fromCharCode(65+e)]=String(10+e);const u=Math.floor((d=9007199254740991,Math.log10?Math.log10(d):Math.log(d)/Math.LN10));var d;function h(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>l[e])).join("");for(;t.length>=u;){let e=t.substring(0,u);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}function p(e){let t=null;if("string"!=typeof e&&a.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=c(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&a.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==h(e)&&a.throwArgumentError("bad icap checksum","address",e),t=(0,o.Os)(e.substring(4));t.length<40;)t="0"+t;t=c("0x"+t)}else a.throwArgumentError("invalid address","address",e);return t}function f(e){try{return p(e),!0}catch(e){}return!1}function g(e){let t=(0,o.ii)(p(e).substring(2)).toUpperCase();for(;t.length<30;)t="0"+t;return"XE"+h("XE00"+t)+t}function m(e){let t=null;try{t=p(e.from)}catch(t){a.throwArgumentError("missing from address","transaction",e)}const r=(0,n.stripZeros)((0,n.arrayify)(o.gH.from(e.nonce).toHexString()));return p((0,n.hexDataSlice)((0,s.keccak256)((0,i.encode)([t,r])),12))}function y(e,t,r){return 32!==(0,n.hexDataLength)(t)&&a.throwArgumentError("salt must be 32 bytes","salt",t),32!==(0,n.hexDataLength)(r)&&a.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),p((0,n.hexDataSlice)((0,s.keccak256)((0,n.concat)(["0xff",p(e),t,r])),12))}}
2,"./node_modules/@ethersproject/base64/lib.esm/base64.js"(e,t,r){"use strict";r.d(t,{D:()=>o,l:()=>s});var n=r("./node_modules/@ethersproject/bytes/lib.esm/index.js");function o(e){e=atob(e);const t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));return(0,n.arrayify)(t)}function s(e){e=(0,n.arrayify)(e);let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}},"./node_modules/@ethersproject/base64/lib.esm/index.js"(e,t,r){"use strict";r.r(t),r.d(t,{decode:()=>n.D,encode:()=>n.l});var n=r("./node_modules/@ethersproject/base64/lib.esm/base64.js")},"./node_modules/@ethersproject/basex/lib.esm/index.js"(e,t,r){"use strict";r.r(t),r.d(t,{Base32:()=>i,Base58:()=>a,BaseX:()=>s});var n=r("./node_modules/@ethersproject/bytes/lib.esm/index.js"),o=r("./node_modules/@ethersproject/properties/lib.esm/index.js");class s{constructor(e){(0,o.defineReadOnly)(this,"alphabet",e),(0,o.defineReadOnly)(this,"base",e.length),(0,o.defineReadOnly)(this,"_alphabetMap",{}),(0,o.defineReadOnly)(this,"_leader",e.charAt(0));for(let t=0;t<e.length;t++)this._alphabetMap[e.charAt(t)]=t}encode(e){let t=(0,n.arrayify)(e);if(0===t.length)return"";let r=[0];for(let e=0;e<t.length;++e){let n=t[e];for(let e=0;e<r.length;++e)n+=r[e]<<8,r[e]=n%this.base,n=n/this.base|0;for(;n>0;)r.push(n%this.base),n=n/this.base|0}let o="";for(let e=0;0===t[e]&&e<t.length-1;++e)o+=this._leader;for(let e=r.length-1;e>=0;--e)o+=this.alphabet[r[e]];return o}decode(e){if("string"!=typeof e)throw new TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let r=0;r<e.length;r++){let n=this._alphabetMap[e[r]];if(void 0===n)throw new Error("Non-base"+this.base+" character");let o=n;for(let e=0;e<t.length;++e)o+=t[e]*this.base,t[e]=255&o,o>>=8;for(;o>0;)t.push(255&o),o>>=8}for(let r=0;e[r]===this._leader&&r<e.length-1;++r)t.push(0);return(0,n.arrayify)(new Uint8Array(t.reverse()))}}const i=new s("abcdefghijklmnopqrstuvwxyz234567"),a=new s("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},"./node_modules/@ethersproject/bignumber/lib.esm/_version.js"(e,t,r){"use strict";r.d(t,{r:()=>n});const n="bignumber/5.8.0"},"./node_modules/@ethersproject/bignumber/lib.esm/bignumber.js"(e,t,r){"use strict";r.d(t,{Os:()=>w,YR:()=>h,gH:()=>f,ii:()=>v});var n=r("./node_modules/bn.js/lib/bn.js"),o=r.n(n),s=r("./node_modules/@ethersproject/bytes/lib.esm/index.js"),i=r("./node_modules/@ethersproject/logger/lib.esm/index.js"),a=r("./node_modules/@ethersproject/bignumber/lib.esm/_version.js"),c=o().BN;const l=new i.Logger(a.r),u={},d=9007199254740991;function h(e){return null!=e&&(f.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||(0,s.isHexString)(e)||"bigint"==typeof e||(0,s.isBytes)(e))}let p=!1;class f{constructor(e,t){e!==u&&l.throwError("cannot call constructor directly; use BigNumber.from",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return m(y(this).fromTwos(e))}toTwos(e){return m(y(this).toTwos(e))}abs(){return"-"===this._hex[0]?f.from(this._hex.substring(1)):this}add(e){return m(y(this).add(y(e)))}sub(e){return m(y(this).sub(y(e)))}div(e){return f.from(e).isZero()&&b("division-by-zero","div"),m(y(this).div(y(e)))}mul(e){return m(y(this).mul(y(e)))}mod(e){const t=y(e);return t.isNeg()&&b("division-by-zero","mod"),m(y(this).umod(t))}pow(e){const t=y(e);return t.isNeg()&&b("negative-power","pow"),m(y(this).pow(t))}and(e){const t=y(e);return(this.isNegative()||t.isNeg())&&b("unbound-bitwise-result","and"),m(y(this).and(t))}or(e){const t=y(e);return(this.isNegative()||t.isNeg())&&b("unbound-bitwise-result","or"),m(y(this).or(t))}xor(e){const t=y(e);return(this.isNegative()||t.isNeg())&&b("unbound-bitwise-result","xor"),m(y(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&b("negative-width","mask"),m(y(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&b("negative-width","shl"),m(y(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&b("negative-width","shr"),m(y(this).shrn(e))}eq(e){return y(this).eq(y(e))}lt(e){return y(this).lt(y(e))}
vendor: 12,512 bytes, line 2
2lte(e){return y(this).lte(y(e))}gt(e){return y(this).gt(y(e))}gte(e){return y(this).gte(y(e))}isNegative(){return"-"===this._hex[0]}isZero(){return y(this).isZero()}toNumber(){try{return y(this).toNumber()}catch(e){b("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return l.throwError("this platform does not support BigInt",i.Logger.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?p||(p=!0,l.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?l.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",i.Logger.errors.UNEXPECTED_ARGUMENT,{}):l.throwError("BigNumber.toString does not accept parameters",i.Logger.errors.UNEXPECTED_ARGUMENT,{})),y(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof f)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new f(u,g(e)):e.match(/^-?[0-9]+$/)?new f(u,g(new c(e))):l.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&b("underflow","BigNumber.from",e),(e>=d||e<=-d)&&b("overflow","BigNumber.from",e),f.from(String(e));const t=e;if("bigint"==typeof t)return f.from(t.toString());if((0,s.isBytes)(t))return f.from((0,s.hexlify)(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"==typeof e)return f.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&((0,s.isHexString)(e)||"-"===e[0]&&(0,s.isHexString)(e.substring(1))))return f.from(e)}return l.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function g(e){if("string"!=typeof e)return g(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&l.throwArgumentError("invalid hex","value",e),"0x00"===(e=g(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function m(e){return f.from(g(e))}function y(e){const t=f.from(e).toHexString();return"-"===t[0]?new c("-"+t.substring(3),16):new c(t.substring(2),16)}function b(e,t,r){const n={fault:e,operation:t};return null!=r&&(n.value=r),l.throwError(e,i.Logger.errors.NUMERIC_FAULT,n)}function w(e){return new c(e,36).toString(16)}function v(e){return new c(e,16).toString(36)}},"./node_modules/@ethersproject/bignumber/lib.esm/fixednumber.js"(e,t,r){"use strict";r.d(t,{I3:()=>y,gn:()=>f,gs:()=>g});var n=r("./node_modules/@ethersproject/bytes/lib.esm/index.js"),o=r("./node_modules/@ethersproject/logger/lib.esm/index.js"),s=r("./node_modules/@ethersproject/bignumber/lib.esm/_version.js"),i=r("./node_modules/@ethersproject/bignumber/lib.esm/bignumber.js");const a=new o.Logger(s.r),c={},l=i.gH.from(0),u=i.gH.from(-1);function d(e,t,r,n){const s={fault:t,operation:r};return void 0!==n&&(s.value=n),a.throwError(e,o.Logger.errors.NUMERIC_FAULT,s)}let h="0";for(;h.length<256;)h+=h;function p(e){if("number"!=typeof e)try{e=i.gH.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+h.substring(0,e):a.throwArgumentError("invalid decimal size","decimals",e)}function f(e,t){null==t&&(t=0);const r=p(t),n=(e=i.gH.from(e)).lt(l);n&&(e=e.mul(u));let o=e.mod(r).toString();for(;o.length<r.length-1;)o="0"+o;o=o.match(/^([0-9]*[1-9]|0)(0*)/)[1];const s=e.div(r).toString();return e=1===r.length?s:s+"."+o,n&&(e="-"+e),e}function g(e,t){null==t&&(t=0);const r=p(t);"string"==typeof e&&e.match(/^-?[0-9.]+$/)||a.throwArgumentError("invalid decimal value","value",e);const n="-"===e.substring(0,1);n&&(e=e.substring(1)),"."===e&&a.throwArgumentError("missing value","value",e);const o=e.split(".");o.length>2&&a.throwArgumentError("too many decimal points","value",e);let s=o[0],c=o[1];for(s||(s="0"),c||(c="0");"0"===c[c.length-1];)c=c.substring(0,c.length-1);for(c.length>r.length-1&&d("fractional component exceeds decimals","underflow","parseFixed"),""===c&&(c="0");c.length<r.length-1;)c+="0";const l=i.gH.from(s),h=i.gH.from(c);let f=l.mul(r).add(h);return n&&(f=f.mul(u)),f}class m{constructor(e,t,r,n){e!==c&&a.throwError("cannot use FixedFormat constructor; use FixedFormat.from",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=t,this.width=r,this.decimals=n,this.name=(t?"":"u")+"fixed"+String(r)+"x"+String(n),this._multiplier=p(n),Object.freeze(this)}static from(e){if(e instanceof m)return e;"number"==typeof e&&(e=`fixed128x${e}`);let t=!0,r=128,n=18;if("string"==typeof e)if("fixed"===e);else if("ufixed"===e)t=!1;else{const o=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);o||a.throwArgumentError("invalid fixed format","format",e),t="u"!==o[1],r=parseInt(o[2]),n=parseInt(o[3])}else if(e){const o=(t,r,n)=>null==e[t]?n:(typeof e[t]!==r&&a.throwArgumentError("invalid fixed format ("+t+" not "+r+")","format."+t,e[t]),e[t]);t=o("signed","boolean",t),r=o("width","number",r),n=o("decimals","number",n)}return r%8&&a.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&a.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new m(c,t,r,n)}}class y{constructor(e,t,r,n){e!==c&&a.throwError("cannot use FixedNumber constructor; use FixedNumber.from",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=t,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&a.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=g(this._value,this.format.decimals),r=g(e._value,e.format.decimals);return y.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=g(this._value,this.format.decimals),r=g(e._value,e.format.decimals);return y.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=g(this._value,this.format.decimals),r=g(e._value,e.format.decimals);return y.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=g(this._value,this.format.decimals),r=g(e._value,e.format.decimals);return y.fromValue(t.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=y.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(b.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=y.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(b.toFormat(t.format))),t}round(e){null==e&&(e=0);const t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&a.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const r=y.from("1"+h.substring(0,e),this.format),n=w.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&a.throwArgumentError("invalid byte width","width",e);const t=i.gH.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return(0,n.hexZeroPad)(t,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return y.fromString(this._value,e)}static fromValue(e,t,r){return null!=r||null==t||(0,i.YR)(t)||(r=t,t=null),null==t&&(t=0),null==r&&(r="fixed"),y.fromString(f(e,t),m.from(r))}static fromString(e,t){null==t&&(t="fixed");const r=m.from(t),o=g(e,r.decimals);!r.signed&&o.lt(l)&&d("unsigned value cannot be negative","overflow","value",e);let s=null;r.signed?s=o.toTwos(r.width).toHexString():(s=o.toHexString(),s=(0,n.hexZeroPad)(s,r.width/8));const i=f(o,r.decimals);return new y(c,s,i,r)}static fromBytes(e,t){null==t&&(t="fixed");const r=m.from(t);if((0,n.arrayify)(e).length>r.width/8)throw new Error("overflow");let o=i.gH.from(e);r.signed&&(o=o.fromTwos(r.width));const s=o.toTwos((r.signed?0:1)+r.width).toHexString(),a=f(o,r.decimals);return new y(c,s,a,r)}static from(e,t){if("string"==typeof e)return y.fromString(e,t);if((0,n.isBytes)(e))return y.fromBytes(e,t);try{return y.fromValue(e,0,t)}catch(e){if(e.code!==o.Logger.errors.INVALID_ARGUMENT)throw e}return a.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const b=y.from(1),w=y.from("0.5")},"./node_modules/@ethersproject/bytes/lib.esm/index.js"(e,t,r){"use strict";r.r(t),r.d(t,{arrayify:()=>l,concat:()=>u,hexConcat:()=>b,hexDataLength:()=>m,hexDataSlice:()=>y,hexStripZeros:()=>v,hexValue:()=>w,hexZeroPad:()=>A,hexlify:()=>g,isBytes:()=>c,isBytesLike:()=>i,isHexString:()=>p,joinSignature:()=>P,splitSignature:()=>T,stripZeros:()=>d,zeroPad:()=>h});const n=new(r("./node_modules/@ethersproject/logger/lib.esm/index.js").Logger)("bytes/5.8.0");function o(e){return!!e.toHexString}function s(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function i(e){return p(e)&&!(e.length%2)||c(e)}function a(e){return"number"==typeof e&&e==e&&e%1==0}function c(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!a(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){const r=e[t];if(!a(r)||r<0||r>=256)return!1}return!0}function l(e,t){if(t||(t={}),"number"==typeof e){n.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),s(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),o(e)&&(e=e.toHexString()),p(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0"+r:"right"===t.hexPad?r+="0":n.throwArgumentError("hex data is odd-length","value",e));const o=[];for(let e=0;e<r.length;e+=2)o.push(parseInt(r.substring(e,e+2),16));return s(new Uint8Array(o))}return c(e)?s(new Uint8Array(e)):n.throwArgumentError("invalid arrayify value","value",e)}function u(e){const t=e.map((e=>l(e))),r=t.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(r);return t.reduce(((e,t)=>(n.set(t,e),e+t.length)),0),s(n)}function d(e){let t=l(e);if(0===t.length)return t;let r=0;for(;r<t.length&&0===t[r];)r++;return r&&(t=t.slice(r)),t}function h(e,t){(e=l(e)).length>t&&n.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),s(r)}function p(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}const f="0123456789abcdef";function g(e,t){if(t||(t={}),"number"==typeof e){n.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=f[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),o(e))return e.toHexString();if(p(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":n.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(c(e)){let t="0x";for(let r=0;r<e.length;r++){let n=e[r];t+=f[(240&n)>>4]+f[15&n]}return t}return n.throwArgumentError("invalid hexlify value","value",e)}function m(e){if("string"!=typeof e)e=g(e);else if(!p(e)||e.length%2)return null;return(e.length-2)/2}function y(e,t,r){return"string"!=typeof e?e=g(e):(!p(e)||e.length%2)&&n.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function b(e){let t="0x";return e.forEach((e=>{t+=g(e).substring(2)})),t}function w(e){const t=v(g(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function v(e){"string"!=typeof e&&(e=g(e)),p(e)||n.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t<e.length&&"0"===e[t];)t++;return"0x"+e.substring(t)}function A(e,t){for("string"!=typeof e?e=g(e):p(e)||n.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&n.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function T(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"
20x"};if(i(e)){let r=l(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=g(r.slice(0,32)),t.s=g(r.slice(32,64))):65===r.length?(t.r=g(r.slice(0,32)),t.s=g(r.slice(32,64)),t.v=r[64]):n.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:n.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=g(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){const r=h(l(t._vs),32);t._vs=g(r);const o=r[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=o:t.recoveryParam!==o&&n.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),r[0]&=127;const s=g(r);null==t.s?t.s=s:t.s!==s&&n.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?n.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{const r=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==r&&n.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&p(t.r)?t.r=A(t.r,32):n.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&p(t.s)?t.s=A(t.s,32):n.throwArgumentError("signature missing or invalid s","signature",e);const r=l(t.s);r[0]>=128&&n.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);const o=g(r);t._vs&&(p(t._vs)||n.throwArgumentError("signature invalid _vs","signature",e),t._vs=A(t._vs,32)),null==t._vs?t._vs=o:t._vs!==o&&n.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function P(e){return g(u([(e=T(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}},"./node_modules/@ethersproject/constants/lib.esm/addresses.js"(e,t,r){"use strict";r.d(t,{L:()=>n});const n="0x0000000000000000000000000000000000000000"},"./node_modules/@ethersproject/constants/lib.esm/bignumbers.js"(e,t,r){"use strict";r.d(t,{Is:()=>l,LV:()=>u,XK:()=>s,d0:()=>a,eR:()=>o,fw:()=>d,lQ:()=>c,pD:()=>i});var n=r("./node_modules/@ethersproject/bignumber/lib.esm/bignumber.js");const o=n.gH.from(-1),s=n.gH.from(0),i=n.gH.from(1),a=n.gH.from(2),c=n.gH.from("1000000000000000000"),l=n.gH.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),u=n.gH.from("-0x8000000000000000000000000000000000000000000000000000000000000000"),d=n.gH.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")},"./node_modules/@ethersproject/constants/lib.esm/hashes.js"(e,t,r){"use strict";r.d(t,{j:()=>n});const n="0x0000000000000000000000000000000000000000000000000000000000000000"},"./node_modules/@ethersproject/contracts/lib.esm/index.js"(e,t,r){"use strict";r.d(t,{Uq:()=>_,NZ:()=>I,PM:()=>S});var n=r("./node_modules/@ethersproject/abi/lib.esm/coders/abstract-coder.js"),o=r("./node_modules/@ethersproject/abi/lib.esm/interface.js"),s=r("./node_modules/@ethersproject/abstract-provider/lib.esm/index.js"),i=r("./node_modules/@ethersproject/abstract-signer/lib.esm/index.js"),a=r("./node_modules/@ethersproject/address/lib.esm/index.js"),c=r("./node_modules/@ethersproject/bignumber/lib.esm/bignumber.js"),l=r("./node_modules/@ethersproject/bytes/lib.esm/index.js"),u=r("./node_modules/@ethersproject/properties/lib.esm/index.js"),d=r("./node_modules/@ethersproject/transactions/lib.esm/index.js"),h=r("./node_modules/@ethersproject/logger/lib.esm/index.js");var p=function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))};const f=new h.Logger("contracts/5.8.0"),g={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0,customData:!0,ccipReadEnabled:!0};function m(e,t){return p(this,void 0,void 0,(function*(){const r=yield t;"string"!=typeof r&&f.throwArgumentError("invalid address or ENS name","name",r);try{return(0,a.getAddress)(r)}catch(e){}e||f.throwError("a provider or signer is needed to resolve ENS names",h.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield e.resolveName(r);return null==n&&f.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n}))}function y(e,t,r){return p(this,void 0,void 0,(function*(){return Array.isArray(r)?yield Promise.all(r.map(((r,n)=>y(e,Array.isArray(t)?t[n]:t[r.name],r)))):"address"===r.type?yield m(e,t):"tuple"===r.type?yield y(e,t,r.components):"array"===r.baseType?Array.isArray(t)?yield Promise.all(t.map((t=>y(e,t,r.arrayChildren)))):Promise.reject(f.makeError("invalid value for array",h.Logger.errors.INVALID_ARGUMENT,{argument:"value",value:t})):t}))}function b(e,t,r){return p(this,void 0,void 0,(function*(){let n={};r.length===t.inputs.length+1&&"object"==typeof r[r.length-1]&&(n=(0,u.shallowCopy)(r.pop())
2),f.checkArgumentCount(r.length,t.inputs.length,"passed to contract"),e.signer?n.from?n.from=(0,u.resolveProperties)({override:m(e.signer,n.from),signer:e.signer.getAddress()}).then((e=>p(this,void 0,void 0,(function*(){return(0,a.getAddress)(e.signer)!==e.override&&f.throwError("Contract with a Signer cannot override from",h.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.override})))):n.from=e.signer.getAddress():n.from&&(n.from=m(e.provider,n.from));const o=yield(0,u.resolveProperties)({args:y(e.signer||e.provider,r,t.inputs),address:e.resolvedAddress,overrides:(0,u.resolveProperties)(n)||{}}),s=e.interface.encodeFunctionData(t,o.args),i={data:s,to:o.address},g=o.overrides;if(null!=g.nonce&&(i.nonce=c.gH.from(g.nonce).toNumber()),null!=g.gasLimit&&(i.gasLimit=c.gH.from(g.gasLimit)),null!=g.gasPrice&&(i.gasPrice=c.gH.from(g.gasPrice)),null!=g.maxFeePerGas&&(i.maxFeePerGas=c.gH.from(g.maxFeePerGas)),null!=g.maxPriorityFeePerGas&&(i.maxPriorityFeePerGas=c.gH.from(g.maxPriorityFeePerGas)),null!=g.from&&(i.from=g.from),null!=g.type&&(i.type=g.type),null!=g.accessList&&(i.accessList=(0,d.accessListify)(g.accessList)),null==i.gasLimit&&null!=t.gas){let e=21e3;const r=(0,l.arrayify)(s);for(let t=0;t<r.length;t++)e+=4,r[t]&&(e+=64);i.gasLimit=c.gH.from(t.gas).add(e)}if(g.value){const e=c.gH.from(g.value);e.isZero()||t.payable||f.throwError("non-payable method cannot override value",h.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:n.value}),i.value=e}g.customData&&(i.customData=(0,u.shallowCopy)(g.customData)),g.ccipReadEnabled&&(i.ccipReadEnabled=!!g.ccipReadEnabled),delete n.nonce,delete n.gasLimit,delete n.gasPrice,delete n.from,delete n.value,delete n.type,delete n.accessList,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.customData,delete n.ccipReadEnabled;const b=Object.keys(n).filter((e=>null!=n[e]));return b.length&&f.throwError(`cannot override ${b.map((e=>JSON.stringify(e))).join(",")}`,h.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:b}),i}))}function w(e,t){const r=t.wait.bind(t);t.wait=t=>r(t).then((t=>(t.events=t.logs.map((r=>{let n=(0,u.deepCopy)(r),o=null;try{o=e.interface.parseLog(r)}catch(e){}return o&&(n.args=o.args,n.decode=(t,r)=>e.interface.decodeEventLog(o.eventFragment,t,r),n.event=o.name,n.eventSignature=o.signature),n.removeListener=()=>e.provider,n.getBlock=()=>e.provider.getBlock(t.blockHash),n.getTransaction=()=>e.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>Promise.resolve(t),n})),t)))}function v(e,t,r){const n=e.signer||e.provider;return function(...o){return p(this,void 0,void 0,(function*(){let s;if(o.length===t.inputs.length+1&&"object"==typeof o[o.length-1]){const e=(0,u.shallowCopy)(o.pop());null!=e.blockTag&&(s=yield e.blockTag),delete e.blockTag,o.push(e)}null!=e.deployTransaction&&(yield e._deployed(s));const i=yield b(e,t,o),a=yield n.call(i,s);try{let n=e.interface.decodeFunctionResult(t,a);return r&&1===t.outputs.length&&(n=n[0]),n}catch(t){throw t.code===h.Logger.errors.CALL_EXCEPTION&&(t.address=e.address,t.args=o,t.transaction=i),t}}))}}function A(e,t,r){return t.constant?v(e,t,r):function(e,t){return function(...r){return p(this,void 0,void 0,(function*(){e.signer||f.throwError("sending a transaction requires a signer",h.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=e.deployTransaction&&(yield e._deployed());const n=yield b(e,t,r),o=yield e.signer.sendTransaction(n);return w(e,o),o}))}}(e,t)}function T(e){return!e.address||null!=e.topics&&0!==e.topics.length?(e.address||"*")+"@"+(e.topics?e.topics.map((e=>Array.isArray(e)?e.join("|"):e)).join(":"):""):"*"}class P{constructor(e,t){(0,u.defineReadOnly)(this,"tag",e),(0,u.defineReadOnly)(this,"filter",t),this._listeners=[]}addListener(e,t){this._listeners.push({listener:e,once:t})}removeListener(e){let t=!1;this._listeners=this._listeners.filter((r=>!(!t&&r.listener===e)||(t=!0,!1)))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map((e=>e.listener))}listenerCount(){return this._listeners.length}run(e){const t=this.listenerCount();return this._listeners=this._listeners.filter((t=>{const r=e.slice();return setTimeout((()=>{t.listener.apply(this,r)}),0),!t.once})),t}prepareEvent(e){}getEmit(e){return[e]}}class E extends P{constructor(){super("error",null)}}class C extends P{constructor(e,t,r,n){const o={address:e};let s=t.getEventTopic(r);n?(s!==n[0]&&f.throwArgumentError("topic mismatch","topics",n),o.topics=n.slice()):o.topics=[s],super(T(o),o),(0,u.defineReadOnly)(this,"address",e),(0,u.defineReadOnly)(this,"interface",t),(0,u.defineReadOnly)(this,"fragment",r)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(e,t)=>this.interface.decodeEventLog(this.fragment,e,t);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(t){e.args=null,e.decodeError=t}}getEmit(e){const t=(0,n.$v)(e.args);if(t.length)throw t[0].error;const r=(e.args||[]).slice();return r.push(e),r}}class k extends P{constructor(e,t){super("*",{address:e}),(0,u.defineReadOnly)(this,"address",e),(0,u.defineReadOnly)(this,"interface",t)}prepareEvent(e){super.prepareEvent(e);try{const t=this.interface.parseLog(e);e.event=t.name,e.eventSignature=t.signature,e.decode=(e,r)=>this.interface.decodeEventLog(t.eventFragment,e,r),e.args=t.args}catch(e){}}}class _{constructor(e,t,r){(0,u.defineReadOnly)(this,"interface",(0,u.getStatic)(new.target,"getInterface")(t)),null==r?((0,u.defineReadOnly)(this,"provider",null),(0,u.defineReadOnly)(this,"signer",null)):i.l.isSigner(r)?((0,u.defineReadOnly)(this,"provider",r.provider||null),(0,u.defineReadOnly)(this,"signer",r)):s.Kq.isProvider(r)?((0,u.defineReadOnly)(this,"provider",r),(0,u.defineReadOnly)(this,"signer",null)):f.throwArgumentError("invalid signer or provider","signerOrProvider",r),(0,u.defineReadOnly)(this,"callStatic",{}),(0,u.defineReadOnly)(this,"estimateGas",{}),(0,u.defineReadOnly)(this,"functions",{}),(0,u.defineReadOnly)(this,"populateTransaction",{}),(0,u.defineReadOnly)(this,"filters",{});{const e={};
2Object.keys(this.interface.events).forEach((t=>{const r=this.interface.events[t];(0,u.defineReadOnly)(this.filters,t,((...e)=>({address:this.address,topics:this.interface.encodeFilterTopics(r,e)}))),e[r.name]||(e[r.name]=[]),e[r.name].push(t)})),Object.keys(e).forEach((t=>{const r=e[t];1===r.length?(0,u.defineReadOnly)(this.filters,t,this.filters[r[0]]):f.warn(`Duplicate definition of ${t} (${r.join(", ")})`)}))}if((0,u.defineReadOnly)(this,"_runningEvents",{}),(0,u.defineReadOnly)(this,"_wrappedEmits",{}),null==e&&f.throwArgumentError("invalid contract address or ENS name","addressOrName",e),(0,u.defineReadOnly)(this,"address",e),this.provider)(0,u.defineReadOnly)(this,"resolvedAddress",m(this.provider,e));else try{(0,u.defineReadOnly)(this,"resolvedAddress",Promise.resolve((0,a.getAddress)(e)))}catch(e){f.throwError("provider is required to use ENS name as contract address",h.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((e=>{}));const n={},o={};Object.keys(this.interface.functions).forEach((e=>{const t=this.interface.functions[e];if(o[e])f.warn(`Duplicate ABI entry for ${JSON.stringify(e)}`);else{o[e]=!0;{const r=t.name;n[`%${r}`]||(n[`%${r}`]=[]),n[`%${r}`].push(e)}null==this[e]&&(0,u.defineReadOnly)(this,e,A(this,t,!0)),null==this.functions[e]&&(0,u.defineReadOnly)(this.functions,e,A(this,t,!1)),null==this.callStatic[e]&&(0,u.defineReadOnly)(this.callStatic,e,v(this,t,!0)),null==this.populateTransaction[e]&&(0,u.defineReadOnly)(this.populateTransaction,e,function(e,t){return function(...r){return b(e,t,r)}}(this,t)),null==this.estimateGas[e]&&(0,u.defineReadOnly)(this.estimateGas,e,function(e,t){const r=e.signer||e.provider;return function(...n){return p(this,void 0,void 0,(function*(){r||f.throwError("estimate require a provider or signer",h.Logger.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const o=yield b(e,t,n);return yield r.estimateGas(o)}))}}(this,t))}})),Object.keys(n).forEach((e=>{const t=n[e];if(t.length>1)return;e=e.substring(1);const r=t[0];try{null==this[e]&&(0,u.defineReadOnly)(this,e,this[r])}catch(e){}null==this.functions[e]&&(0,u.defineReadOnly)(this.functions,e,this.functions[r]),null==this.callStatic[e]&&(0,u.defineReadOnly)(this.callStatic,e,this.callStatic[r]),null==this.populateTransaction[e]&&(0,u.defineReadOnly)(this.populateTransaction,e,this.populateTransaction[r]),null==this.estimateGas[e]&&(0,u.defineReadOnly)(this.estimateGas,e,this.estimateGas[r])}))}static getContractAddress(e){return(0,a.getContractAddress)(e)}static getInterface(e){return o.KA.isInterface(e)?e:new o.KA(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((()=>this)):this._deployedPromise=this.provider.getCode(this.address,e).then((e=>("0x"===e&&f.throwError("contract not deployed",h.Logger.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(e){this.signer||f.throwError("sending a transactions require a signer",h.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const t=(0,u.shallowCopy)(e||{});return["from","to"].forEach((function(e){null!=t[e]&&f.throwError("cannot override "+e,h.Logger.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(t)))}connect(e){"string"==typeof e&&(e=new i.J(e,this.provider));const t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&(0,u.defineReadOnly)(t,"deployTransaction",this.deployTransaction),t}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return o.wu.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if("string"==typeof e){if("error"===e)return this._normalizeRunningEvent(new E);if("event"===e)return this._normalizeRunningEvent(new P("event",null));if("*"===e)return this._normalizeRunningEvent(new k(this.address,this.interface));const t=this.interface.getEvent(e);return this._normalizeRunningEvent(new C(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{const t=e.topics[0];if("string"!=typeof t)throw new Error("invalid topic");const r=this.interface.getEvent(t);return this._normalizeRunningEvent(new C(this.address,this.interface,r,e.topics))}catch(e){}const t={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new P(T(t),t))}return this._normalizeRunningEvent(new k(this.address,this.interface))}_checkRunningEvents(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag];const t=this._wrappedEmits[e.tag];t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,t,r){const n=(0,u.deepCopy)(t);return n.removeListener=()=>{r&&(e.removeListener(r),this._checkRunningEvents(e))},n.getBlock=()=>this.provider.getBlock(t.blockHash),n.getTransaction=()=>this.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>this.provider.getTransactionReceipt(t.transactionHash),e.prepareEvent(n),n}_addEventListener(e,t,r){if(this.provider||f.throwError("events require a provider or a signer with a provider",h.Logger.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,r),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const r=r=>{let n=this._wrapEvent(e,r,t);if(null==n.decodeError)try{const t=e.getEmit(n);
2this.emit(e.filter,...t)}catch(e){n.decodeError=e.error}null!=e.filter&&this.emit("event",n),null!=n.decodeError&&this.emit("error",n.decodeError,n)};this._wrappedEmits[e.tag]=r,null!=e.filter&&this.provider.on(e.filter,r)}}queryFilter(e,t,r){const n=this._getRunningEvent(e),o=(0,u.shallowCopy)(n.filter);return"string"==typeof t&&(0,l.isHexString)(t,32)?(null!=r&&f.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),o.blockHash=t):(o.fromBlock=null!=t?t:0,o.toBlock=null!=r?r:"latest"),this.provider.getLogs(o).then((e=>e.map((e=>this._wrapEvent(n,e,null)))))}on(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}once(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}emit(e,...t){if(!this.provider)return!1;const r=this._getRunningEvent(e),n=r.run(t)>0;return this._checkRunningEvents(r),n}listenerCount(e){return this.provider?null==e?Object.keys(this._runningEvents).reduce(((e,t)=>e+this._runningEvents[t].listenerCount()),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(null==e){const e=[];for(let t in this._runningEvents)this._runningEvents[t].listeners().forEach((t=>{e.push(t)}));return e}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(null==e){for(const e in this._runningEvents){const t=this._runningEvents[e];t.removeAllListeners(),this._checkRunningEvents(t)}return this}const t=this._getRunningEvent(e);return t.removeAllListeners(),this._checkRunningEvents(t),this}off(e,t){if(!this.provider)return this;const r=this._getRunningEvent(e);return r.removeListener(t),this._checkRunningEvents(r),this}removeListener(e,t){return this.off(e,t)}}class I extends _{}class S{constructor(e,t,r){let n=null;n="string"==typeof t?t:(0,l.isBytes)(t)?(0,l.hexlify)(t):t&&"string"==typeof t.object?t.object:"!","0x"!==n.substring(0,2)&&(n="0x"+n),(!(0,l.isHexString)(n)||n.length%2)&&f.throwArgumentError("invalid bytecode","bytecode",t),r&&!i.l.isSigner(r)&&f.throwArgumentError("invalid signer","signer",r),(0,u.defineReadOnly)(this,"bytecode",n),(0,u.defineReadOnly)(this,"interface",(0,u.getStatic)(new.target,"getInterface")(e)),(0,u.defineReadOnly)(this,"signer",r||null)}getDeployTransaction(...e){let t={};if(e.length===this.interface.deploy.inputs.length+1&&"object"==typeof e[e.length-1]){t=(0,u.shallowCopy)(e.pop());for(const e in t)if(!g[e])throw new Error("unknown transaction override "+e)}if(["data","from","to"].forEach((e=>{null!=t[e]&&f.throwError("cannot override "+e,h.Logger.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.value){c.gH.from(t.value).isZero()||this.interface.deploy.payable||f.throwError("non-payable constructor cannot override value",h.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:t.value})}return f.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor"),t.data=(0,l.hexlify)((0,l.concat)([this.bytecode,this.interface.encodeDeploy(e)])),t}deploy(...e){return p(this,void 0,void 0,(function*(){let t={};e.length===this.interface.deploy.inputs.length+1&&(t=e.pop()),f.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor");const r=yield y(this.signer,e,this.interface.deploy.inputs);r.push(t);const n=this.getDeployTransaction(...r),o=yield this.signer.sendTransaction(n),s=(0,u.getStatic)(this.constructor,"getContractAddress")(o),i=(0,u.getStatic)(this.constructor,"getContract")(s,this.interface,this.signer);return w(i,o),(0,u.defineReadOnly)(i,"deployTransaction",o),i}))}attach(e){return this.constructor.getContract(e,this.interface,this.signer)}connect(e){return new this.constructor(this.interface,this.bytecode,e)}static fromSolidity(e,t){null==e&&f.throwError("missing compiler output",h.Logger.errors.MISSING_ARGUMENT,{argument:"compilerOutput"}),"string"==typeof e&&(e=JSON.parse(e));const r=e.abi;let n=null;return e.bytecode?n=e.bytecode:e.evm&&e.evm.bytecode&&(n=e.evm.bytecode),new this(r,n,t)}static getInterface(e){return I.getInterface(e)}static getContractAddress(e){return(0,a.getContractAddress)(e)}static getContract(e,t,r){return new I(e,t,r)}}},"./node_modules/@ethersproject/hash/lib.esm/_version.js"(e,t,r){"use strict";r.d(t,{r:()=>n});const n="hash/5.8.0"},"./node_modules/@ethersproject/hash/lib.esm/id.js"(e,t,r){"use strict";r.d(t,{id:()=>s});var n=r("./node_modules/@ethersproject/keccak256/lib.esm/index.js"),o=r("./node_modules/@ethersproject/strings/lib.esm/utf8.js");function s(e){return(0,n.keccak256)((0,o.YW)(e))}},"./node_modules/@ethersproject/hash/lib.esm/index.js"(e,t,r){"use strict";r.r(t),r.d(t,{_TypedDataEncoder:()=>i.z,dnsEncode:()=>o.Wh,ensNormalize:()=>
2o.Q8,hashMessage:()=>s.A,id:()=>n.id,isValidName:()=>o.uV,messagePrefix:()=>s.o,namehash:()=>o.kM});var n=r("./node_modules/@ethersproject/hash/lib.esm/id.js"),o=r("./node_modules/@ethersproject/hash/lib.esm/namehash.js"),s=r("./node_modules/@ethersproject/hash/lib.esm/message.js"),i=r("./node_modules/@ethersproject/hash/lib.esm/typed-data.js")},"./node_modules/@ethersproject/hash/lib.esm/message.js"(e,t,r){"use strict";r.d(t,{A:()=>a,o:()=>i});var n=r("./node_modules/@ethersproject/bytes/lib.esm/index.js"),o=r("./node_modules/@ethersproject/keccak256/lib.esm/index.js"),s=r("./node_modules/@ethersproject/strings/lib.esm/utf8.js");const i="�Ethereum Signed Message:\n";function a(e){return"string"==typeof e&&(e=(0,s.YW)(e)),(0,o.keccak256)((0,n.concat)([(0,s.YW)(i),(0,s.YW)(String(e.length)),e]))}},"./node_modules/@ethersproject/hash/lib.esm/namehash.js"(e,t,r){"use strict";r.d(t,{Wh:()=>W,Q8:()=>B,uV:()=>O,kM:()=>M});var n=r("./node_modules/@ethersproject/bytes/lib.esm/index.js"),o=r("./node_modules/@ethersproject/strings/lib.esm/utf8.js"),s=r("./node_modules/@ethersproject/keccak256/lib.esm/index.js"),i=r("./node_modules/@ethersproject/logger/lib.esm/index.js"),a=r("./node_modules/@ethersproject/hash/lib.esm/_version.js");function c(e,t){null==t&&(t=1);const r=[],n=r.forEach,o=function(e,t){n.call(e,(function(e){t>0&&Array.isArray(e)?o(e,t-1):r.push(e)}))};return o(e,t),r}function l(e){return function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),o=1,s=[0,1];for(let e=1;e<n;e++)s.push(o+=r());let i=r(),a=t;t+=i;let c=0,l=0;function u(){return 0==c&&(l=l<<8|e[t++],c=8),l>>--c&1}const d=Math.pow(2,31),h=d>>>1,p=h>>1,f=d-1;let g=0;for(let e=0;e<31;e++)g=g<<1|u();let m=[],y=0,b=d;for(;;){let e=Math.floor(((g-y+1)*o-1)/b),t=0,r=n;for(;r-t>1;){let n=t+r>>>1;e<s[n]?r=n:t=n}if(0==t)break;m.push(t);let i=y+Math.floor(b*s[t]/o),a=y+Math.floor(b*s[t+1]/o)-1;for(;!((i^a)&h);)g=g<<1&f|u(),i=i<<1&f,a=a<<1&f|1;for(;i&~a&p;)g=g&h|g<<1&f>>>1|u(),i=i<<1^h,a=(a^h)<<1|h|1;y=i,b=1+a-i}let w=n-4;return m.map((t=>
vendor: 1,096 bytes, line 2
2{switch(t-w){case 3:return w+65792+(e[a++]<<16|e[a++]<<8|e[a++]);case 2:return w+256+(e[a++]<<8|e[a++]);case 1:return w+e[a++];default:return t-1}}))}(e))}function u(e){return 1&e?~e>>1:e>>1}function d(e,t){let r=Array(e);for(let n=0,o=-1;n<e;n++)r[n]=o+=1+t();return r}function h(e,t){let r=Array(e);for(let n=0,o=0;n<e;n++)r[n]=o+=u(t());return r}function p(e,t){let r=d(e(),e),n=e(),o=d(n,e),s=function(e,t){let r=Array(e);for(let n=0;n<e;n++)r[n]=1+t();return r}(n,e);for(let e=0;e<n;e++)for(let t=0;t<s[e];t++)r.push(o[e]+t);return t?r.map((e=>t[e])):r}function f(e,t,r){let n=Array(e).fill(void 0).map((()=>[]));for(let o=0;o<t;o++)h(e,r).forEach(((e,t)=>n[t].push(e)));return n}function g(e,t){let r=1+t(),n=t(),o=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(r)}return t}(t);return c(f(o.length,1+e,t).map(((e,t)=>{const s=e[0],i=e.slice(1);return Array(o[t]).fill(void 0).map(((e,t)=>{let o=t*n;return[s+t*r,i.map((e=>e+o))]}))})))}function m(e,t){return f(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}const y=l((0,r("./node_modules/@ethersproject/base64/lib.esm/base64.js").D)
vendor: 14,758 bytes, line 2
2("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),
vendor: 1,448 bytes, line 2
2b=new Set(p(y)),w=new Set(p(y)),v=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(g(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(m(r,e))}return function(e){const t={};for(let r=0;r<e.length;r++){const n=e[r];t[n[0]]=n[1]}return t}(c(t))}(y),A=function(e){let t=p(e).sort(((e,t)=>e-t));return function r(){let n=[];for(;;){let o=p(e,t);if(0==o.length)break;n.push({set:new Set(o),node:r()})}n.sort(((e,t)=>t.set.size-e.set.size));let o=e(),s=o%3;o=o/3|0;let i=!!(1&o);return o>>=1,{branches:n,valid:s,fe0f:i,save:1==o,check:2==o}}()}(y);function T(e){return(0,o.dg)(e)}function P(e){return e.filter((e=>65039!=e))}function E(e){for(let t of e.split(".")){let e=T(t);try{for(let t=e.lastIndexOf(95)-1;t>=0;t--)if(95!==e[t])throw new Error("underscore only allowed at start");if(e.length>=4&&e.every((e=>e<128))&&45===e[2]&&45===e[3])throw new Error("invalid label extension")}catch(e){throw new Error(`Invalid label "${t}": ${e.message}`)}}return e}function C(e){return E(function(e,t){let r=T(e).reverse(),n=[];for(;r.length;){let e=k(r);if(e){n.push(...t(e));continue}let o=r.pop();if(b.has(o)){n.push(o);continue}if(w.has(o))continue;let s=v[o];if(!s)throw new Error(`Disallowed codepoint: 0x${o.toString(16).toUpperCase()}`);n.push(...s)}return E((o=String.fromCodePoint(...n),o.normalize("NFC")));var o}(e,P))}function k(e,t){var r;let n,o,s=A,i=[],a=e.length;for(t&&(t.length=0);a;){let c=e[--a];if(s=null===(r=s.branches.find((e=>
2e.set.has(c))))||void 0===r?void 0:r.node,!s)break;if(s.save)o=c;else if(s.check&&c===o)break;i.push(c),s.fe0f&&(i.push(65039),a>0&&65039==e[a-1]&&a--),s.valid&&(n=i.slice(),2==s.valid&&n.splice(1,1),t&&t.push(...e.slice(a).reverse()),e.length=a)}return n}const _=new i.Logger(a.r),I=new Uint8Array(32);function S(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function x(e){const t=(0,o.YW)(C(e)),r=[];if(0===e.length)return r;let n=0;for(let e=0;e<t.length;e++){46===t[e]&&(r.push(S(t.slice(n,e))),n=e+1)}if(n>=t.length)throw new Error("invalid ENS name; empty component");return r.push(S(t.slice(n))),r}function B(e){return x(e).map((e=>(0,o._v)(e))).join(".")}function O(e){try{return 0!==x(e).length}catch(e){}return!1}function M(e){"string"!=typeof e&&_.throwArgumentError("invalid ENS name; not a string","name",e);let t=I;const r=x(e);for(;r.length;)t=(0,s.keccak256)((0,n.concat)([t,(0,s.keccak256)(r.pop())]));return(0,n.hexlify)(t)}function W(e){return(0,n.hexlify)((0,n.concat)(x(e).map((e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"}I.fill(0)},"./node_modules/@ethersproject/hash/lib.esm/typed-data.js"(e,t,r){"use strict";r.d(t,{z:()=>k});var n=r("./node_modules/@ethersproject/address/lib.esm/index.js"),o=r("./node_modules/@ethersproject/bignumber/lib.esm/bignumber.js"),s=r("./node_modules/@ethersproject/bytes/lib.esm/index.js"),i=r("./node_modules/@ethersproject/keccak256/lib.esm/index.js"),a=r("./node_modules/@ethersproject/properties/lib.esm/index.js"),c=r("./node_modules/@ethersproject/logger/lib.esm/index.js"),l=r("./node_modules/@ethersproject/hash/lib.esm/_version.js"),u=r("./node_modules/@ethersproject/hash/lib.esm/id.js"),d=function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))};const h=new c.Logger(l.r),p=new Uint8Array(32);p.fill(0);const f=o.gH.from(-1),g=o.gH.from(0),m=o.gH.from(1),y=o.gH.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const b=(0,s.hexZeroPad)(m.toHexString(),32),w=(0,s.hexZeroPad)(g.toHexString(),32),v={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},A=["name","version","chainId","verifyingContract","salt"];function T(e){return function(t){return"string"!=typeof t&&h.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const P={name:T("name"),version:T("version"),chainId:function(e){try{return o.gH.from(e).toString()}catch(e){}return h.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return(0,n.getAddress)(e).toLowerCase()}catch(e){}return h.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{const t=(0,s.arrayify)(e);if(32!==t.length)throw new Error("bad length");return(0,s.hexlify)(t)}catch(e){}return h.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function E(e){{const t=e.match(/^(u?)int(\d*)$/);if(t){const r=""===t[1],n=parseInt(t[2]||"256");(n%8!=0||n>256||t[2]&&t[2]!==String(n))&&h.throwArgumentError("invalid numeric width","type",e);const i=y.mask(r?n-1:n),a=r?i.add(m).mul(f):g;return function(t){const r=o.gH.from(t);return(r.lt(a)||r.gt(i))&&h.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),(0,s.hexZeroPad)(r.toTwos(256).toHexString(),32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return(0===r||r>32||t[1]!==String(r))&&h.throwArgumentError("invalid bytes width","type",e),function(t){return(0,s.arrayify)(t).length!==r&&h.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){const t=(0,s.arrayify)(e),r=t.length%32;return r?(0,s.hexConcat)([t,p.slice(r)]):(0,s.hexlify)(t)}(t)}}}switch(e){case"address":return function(e){return(0,s.hexZeroPad)((0,n.getAddress)(e),32)};case"bool":return function(e){return e?b:w};case"bytes":return function(e){return(0,i.keccak256)(e)};case"string":return function(e){return(0,u.id)(e)}}return null}function C(e,t){return`${e}(${t.map((({name:e,type:t})=>t+" "+e)).join(",")})`}class k{constructor(e){(0,a.defineReadOnly)(this,"types",Object.freeze((0,a.deepCopy)(e))),(0,a.defineReadOnly)(this,"_encoderCache",{}),(0,a.defineReadOnly)(this,"_types",{});const t={},r={},n={};Object.keys(e).forEach((e=>{t[e]={},r[e]=[],n[e]={}}));for(const n in e){const o={};
2e[n].forEach((s=>{o[s.name]&&h.throwArgumentError(`duplicate variable name ${JSON.stringify(s.name)} in ${JSON.stringify(n)}`,"types",e),o[s.name]=!0;const i=s.type.match(/^([^\x5b]*)(\x5b|$)/)[1];i===n&&h.throwArgumentError(`circular type reference to ${JSON.stringify(i)}`,"types",e);E(i)||(r[i]||h.throwArgumentError(`unknown type ${JSON.stringify(i)}`,"types",e),r[i].push(n),t[n][i]=!0)}))}const o=Object.keys(r).filter((e=>0===r[e].length));0===o.length?h.throwArgumentError("missing primary type","types",e):o.length>1&&h.throwArgumentError(`ambiguous primary types or unused types: ${o.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),(0,a.defineReadOnly)(this,"primaryType",o[0]),function o(s,i){i[s]&&h.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",e),i[s]=!0,Object.keys(t[s]).forEach((e=>{r[e]&&(o(e,i),Object.keys(i).forEach((t=>{n[t][e]=!0})))})),delete i[s]}(this.primaryType,{});for(const t in n){const r=Object.keys(n[t]);r.sort(),this._types[t]=C(t,e[t])+r.map((t=>C(t,e[t]))).join("")}}getEncoder(e){let t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}_getEncoder(e){{const t=E(e);if(t)return t}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const e=t[1],r=this.getEncoder(e),n=parseInt(t[3]);return t=>{n>=0&&t.length!==n&&h.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let o=t.map(r);return this._types[e]&&(o=o.map(i.keccak256)),(0,i.keccak256)((0,s.hexConcat)(o))}}const r=this.types[e];if(r){const t=(0,u.id)(this._types[e]);return e=>{const n=r.map((({name:t,type:r})=>{const n=this.getEncoder(r)(e[t]);return this._types[r]?(0,i.keccak256)(n):n}));return n.unshift(t),(0,s.hexConcat)(n)}}return h.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const t=this._types[e];return t||h.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return(0,i.keccak256)(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){if(E(e))return r(e,t);const n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const e=n[1],o=parseInt(n[3]);return o>=0&&t.length!==o&&h.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((t=>this._visit(e,t,r)))}const o=this.types[e];return o?o.reduce(((e,{name:n,type:o})=>(e[n]=this._visit(o,t[n],r),e)),{}):h.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new k(e)}static getPrimaryType(e){return k.from(e).primaryType}static hashStruct(e,t,r){return k.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){const n=v[r];n||h.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:n})}return t.sort(((e,t)=>A.indexOf(e.name)-A.indexOf(t.name))),k.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return(0,s.hexConcat)(["0x1901",k.hashDomain(e),k.from(t).hash(r)])}static hash(e,t,r){return(0,i.keccak256)(k.encode(e,t,r))}static resolveNames(e,t,r,n){return d(this,void 0,void 0,(function*(){e=(0,a.shallowCopy)(e);const o={};e.verifyingContract&&!(0,s.isHexString)(e.verifyingContract,20)&&(o[e.verifyingContract]="0x");const i=k.from(t);i.visit(r,((e,t)=>("address"!==e||(0,s.isHexString)(t,20)||(o[t]="0x"),t)));for(const e in o)o[e]=yield n(e);return e.verifyingContract&&o[e.verifyingContract]&&(e.verifyingContract=o[e.verifyingContract]),r=i.visit(r,((e,t)=>"address"===e&&o[t]?o[t]:t)),{domain:e,value:r}}))}static getPayload(e,t,r){k.hashDomain(e);const n={},i=[];A.forEach((t=>{const r=e[t];null!=r&&(n[t]=P[t](r),i.push({name:t,type:v[t]}))}));const c=k.from(t),l=(0,a.shallowCopy)(t);return l.EIP712Domain?h.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):l.EIP712Domain=i,c.encode(r),{types:l,domain:n,primaryType:c.primaryType,message:c.visit(r,((e,t)=>{if(e.match(/^bytes(\d*)/))return(0,s.hexlify)((0,s.arrayify)(t));if(e.match(/^u?int/))return o.gH.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&h.throwArgumentError("invalid string","value",t),t}return h.throwArgumentError("unsupported type","type",e)}))}}}},"./node_modules/@ethersproject/hdnode/lib.esm/index.js"(e,t,r){"use strict";r.r(t),r.d(t,{HDNode:()=>E,defaultPath:()=>P,entropyToMnemonic:()=>_,getAccountPath:()=>S,isValidMnemonic:()=>I,mnemonicToEntropy:()=>k,mnemonicToSeed:()=>C});var n=r("./node_modules/@ethersproject/basex/lib.esm/index.js"),o=r("./node_modules/@ethersproject/bytes/lib.esm/index.js"),s=r("./node_modules/@ethersproject/bignumber/lib.esm/bignumber.js"),i=r("./node_modules/@ethersproject/strings/lib.esm/utf8.js"),a=r("./node_modules/@ethersproject/pbkdf2/lib.esm/pbkdf2.js"),c=r("./node_modules/@ethersproject/properties/lib.esm/index.js"),l=r("./node_modules/@ethersproject/signing-key/lib.esm/index.js"),u=r("./node_modules/@ethersproject/sha2/lib.esm/sha2.js"),d=r("./node_modules/@ethersproject/sha2/lib.esm/types.js"),h=r("./node_modules/@ethersproject/transactions/lib.esm/index.js"),p=r("./node_modules/@ethersproject/wordlists/lib.esm/wordlists.js");const f=new(r("./node_modules/@ethersproject/logger/lib.esm/index.js").Logger)("hdnode/5.8.0"),g=s.gH.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),m=(0,i.YW)("Bitcoin seed"),y=2147483648;function b(e){return(1<<e)-1<<8-e}function w(e){return(0,o.hexZeroPad)((0,o.hexlify)(e),32)}function v(e){return n.Base58.encode((0,o.concat)([e,(0,o.hexDataSlice)((0,u.sc)((0,u.sc)(e)),0,4)]))}function A(e){if(null==e)return p.Y.en;if("string"==typeof e){const t=p.Y[e];return null==t&&f.throwArgumentError("unknown locale","wordlist",e),t}return e}const T={},P="m/44'/60'/0'/0/0";class E{constructor(e,t,r,n,s,i,a,d){if(e!==T)throw new Error("HDNode constructor cannot be called directly");if(t){const e=new l.SigningKey(t);(0,c.defineReadOnly)(this,"privateKey",e.privateKey),(0,c.defineReadOnly)(this,"publicKey",e.compressedPublicKey)}else(0,c.defineReadOnly)(this,"privateKey",null),(0,c.defineReadOnly)(this,"publicKey",(0,o.hexlify)(r));(0,c.defineReadOnly)(this,"parentFingerprint",n),(0,c.defineReadOnly)(this,"fingerprint",(0,o.hexDataSlice)((0,u.HE)((0,u.sc)(this.publicKey)),0,4)),(0,c.defineReadOnly)(this,"address",(0,h.computeAddress)(this.publicKey)),(0,c.defineReadOnly)(this,"chainCode",s),(0,c.defineReadOnly)(this,"index",i),(0,c.defineReadOnly)(this,"depth",a),null==d?((0,
2c.defineReadOnly)(this,"mnemonic",null),(0,c.defineReadOnly)(this,"path",null)):"string"==typeof d?((0,c.defineReadOnly)(this,"mnemonic",null),(0,c.defineReadOnly)(this,"path",d)):((0,c.defineReadOnly)(this,"mnemonic",d),(0,c.defineReadOnly)(this,"path",d.path))}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return v((0,o.concat)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",(0,o.hexlify)(this.depth),this.parentFingerprint,(0,o.hexZeroPad)((0,o.hexlify)(this.index),4),this.chainCode,null!=this.privateKey?(0,o.concat)(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new E(T,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let t=this.path;t&&(t+="/"+(2147483647&e));const r=new Uint8Array(37);if(e&y){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set((0,o.arrayify)(this.privateKey),1),t&&(t+="'")}else r.set((0,o.arrayify)(this.publicKey));for(let t=24;t>=0;t-=8)r[33+(t>>3)]=e>>24-t&255;const n=(0,o.arrayify)((0,u.L5)(d.q.sha512,this.chainCode,r)),i=n.slice(0,32),a=n.slice(32);let c=null,h=null;if(this.privateKey)c=w(s.gH.from(i).add(this.privateKey).mod(g));else{h=new l.SigningKey((0,o.hexlify)(i))._addPoint(this.publicKey)}let p=t;const f=this.mnemonic;return f&&(p=Object.freeze({phrase:f.phrase,path:t,locale:f.locale||"en"})),new E(T,c,h,this.fingerprint,w(a),e,this.depth+1,p)}derivePath(e){const t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===t[0]&&t.shift();let r=this;for(let e=0;e<t.length;e++){const n=t[e];if(n.match(/^[0-9]+'$/)){const e=parseInt(n.substring(0,n.length-1));if(e>=y)throw new Error("invalid path index - "+n);r=r._derive(y+e)}else{if(!n.match(/^[0-9]+$/))throw new Error("invalid path component - "+n);{const e=parseInt(n);if(e>=y)throw new Error("invalid path index - "+n);r=r._derive(e)}}}return r}static _fromSeed(e,t){const r=(0,o.arrayify)(e);if(r.length<16||r.length>64)throw new Error("invalid seed");const n=(0,o.arrayify)((0,u.L5)(d.q.sha512,m,r));return new E(T,w(n.slice(0,32)),null,"0x00000000",w(n.slice(32)),0,0,t)}static fromMnemonic(e,t,r){return e=_(k(e,r=A(r)),r),E._fromSeed(C(e,t),{phrase:e,path:"m",locale:r.locale})}static fromSeed(e){return E._fromSeed(e,null)}static fromExtendedKey(e){const t=n.Base58.decode(e);82===t.length&&v(t.slice(0,78))===e||f.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const r=t[4],s=(0,o.hexlify)(t.slice(5,9)),i=parseInt((0,o.hexlify)(t.slice(9,13)).substring(2),16),a=(0,o.hexlify)(t.slice(13,45)),c=t.slice(45,78);switch((0,o.hexlify)(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new E(T,null,(0,o.hexlify)(c),s,a,i,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==c[0])break;return new E(T,(0,o.hexlify)(c.slice(1)),null,s,a,i,r,null)}return f.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function C(e,t){t||(t="");const r=(0,i.YW)("mnemonic"+t,i.dz.NFKD);return(0,a.A)((0,i.YW)(e,i.dz.NFKD),r,2048,64,"sha512")}function k(e,t){t=A(t),f.checkNormalize();const r=t.split(e);if(r.length%3!=0)throw new Error("invalid mnemonic");const n=(0,o.arrayify)(new Uint8Array(Math.ceil(11*r.length/8)));let s=0;for(let e=0;e<r.length;e++){let o=t.getWordIndex(r[e].normalize("NFKD"));if(-1===o)throw new Error("invalid mnemonic");for(let e=0;e<11;e++)o&1<<10-e&&(n[s>>3]|=1<<7-s%8),s++}const i=32*r.length/3,a=b(r.length/3);if(((0,o.arrayify)((0,u.sc)(n.slice(0,i/8)))[0]&a)!==(n[n.length-1]&a))throw new Error("invalid checksum");return(0,o.hexlify)(n.slice(0,i/8))}function _(e,t){if(t=A(t),(e=(0,o.arrayify)(e)).length%4!=0||e.length<16||e.length>32)throw new Error("invalid entropy");const r=[0];let n=11;for(let t=0;t<e.length;t++)n>8?(r[r.length-1]<<=8,r[r.length-1]|=e[t],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[t]>>8-n,r.push(e[t]&(1<<8-n)-1),n+=3);const s=e.length/4,i=(0,o.arrayify)((0,u.sc)(e))[0]&b(s);return r[r.length-1]<<=s,r[r.length-1]|=i>>8-s,t.join(r.map((e=>t.getWord(e))))}function I(e,t){try{return k(e,t),!0}catch(e){}return!1}function S(e){return("number"!=typeof e||e<0||e>=y||e%1)&&f.throwArgumentError("invalid account index","index",e),`m/44'/60'/${e}'/0/0`}},"./node_modules/@ethersproject/json-wallets/lib.esm/_version.js"(e,t,r){"use strict";r.d(t,{r:()=>n});const n="json-wallets/5.8.0"},"./node_modules/@ethersproject/json-wallets/lib.esm/index.js"(e,t,r){"use strict";r.r(t),r.d(t,{decryptCrowdsale:()=>m,decryptJsonWallet:()=>w,decryptJsonWalletSync:()=>v,decryptKeystore:()=>b.Yc,decryptKeystoreSync:()=>
2b.xQ,encryptKeystore:()=>b.w,getJsonWalletAddress:()=>y.cZ,isCrowdsaleWallet:()=>y.y2,isKeystoreWallet:()=>y.kZ});var n=r("./node_modules/aes-js/index.js"),o=r.n(n),s=r("./node_modules/@ethersproject/address/lib.esm/index.js"),i=r("./node_modules/@ethersproject/bytes/lib.esm/index.js"),a=r("./node_modules/@ethersproject/keccak256/lib.esm/index.js"),c=r("./node_modules/@ethersproject/pbkdf2/lib.esm/pbkdf2.js"),l=r("./node_modules/@ethersproject/strings/lib.esm/utf8.js"),u=r("./node_modules/@ethersproject/properties/lib.esm/index.js"),d=r("./node_modules/@ethersproject/logger/lib.esm/index.js"),h=r("./node_modules/@ethersproject/json-wallets/lib.esm/_version.js"),p=r("./node_modules/@ethersproject/json-wallets/lib.esm/utils.js");const f=new d.Logger(h.r);class g extends u.Description{isCrowdsaleAccount(e){return!(!e||!e._isCrowdsaleAccount)}}function m(e,t){const r=JSON.parse(e);t=(0,p.Qq)(t);const n=(0,s.getAddress)((0,p.oe)(r,"ethaddr")),u=(0,p.m0)((0,p.oe)(r,"encseed"));u&&u.length%16==0||f.throwArgumentError("invalid encseed","json",e);const d=(0,i.arrayify)((0,c.A)(t,t,2e3,32,"sha256")).slice(0,16),h=u.slice(0,16),m=u.slice(16),y=new(o().ModeOfOperation.cbc)(d,h),b=o().padding.pkcs7.strip((0,i.arrayify)(y.decrypt(m)));let w="";for(let e=0;e<b.length;e++)w+=String.fromCharCode(b[e]);const v=(0,l.YW)(w),A=(0,a.keccak256)(v);return new g({_isCrowdsaleAccount:!0,address:n,privateKey:A})}var y=r("./node_modules/@ethersproject/json-wallets/lib.esm/inspect.js"),b=r("./node_modules/@ethersproject/json-wallets/lib.esm/keystore.js");function w(e,t,r){if((0,y.y2)(e)){r&&r(0);const n=m(e,t);return r&&r(1),Promise.resolve(n)}return(0,y.kZ)(e)?(0,b.Yc)(e,t,r):Promise.reject(new Error("invalid JSON wallet"))}function v(e,t){if((0,y.y2)(e))return m(e,t);if((0,y.kZ)(e))return(0,b.xQ)(e,t);throw new Error("invalid JSON wallet")}},"./node_modules/@ethersproject/json-wallets/lib.esm/inspect.js"(e,t,r){"use strict";r.d(t,{cZ:()=>i,kZ:()=>s,y2:()=>o});var n=r("./node_modules/@ethersproject/address/lib.esm/index.js");function o(e){let t=null;try{t=JSON.parse(e)}catch(e){return!1}return t.encseed&&t.ethaddr}function s(e){let t=null;try{t=JSON.parse(e)}catch(e){return!1}return!(!t.version||parseInt(t.version)!==t.version||3!==parseInt(t.version))}function i(e){if(o(e))try{return(0,n.getAddress)(JSON.parse(e).ethaddr)}catch(e){return null}if(s(e))try{return(0,n.getAddress)(JSON.parse(e).address)}catch(e){return null}return null}},"./node_modules/@ethersproject/json-wallets/lib.esm/keystore.js"(e,t,r){"use strict";r.d(t,{Yc:()=>_,w:()=>I,xQ:()=>k}
2);var n=r("./node_modules/aes-js/index.js"),o=r.n(n),s=r("./node_modules/scrypt-js/scrypt.js"),i=r.n(s),a=r("./node_modules/@ethersproject/address/lib.esm/index.js"),c=r("./node_modules/@ethersproject/bytes/lib.esm/index.js"),l=r("./node_modules/@ethersproject/hdnode/lib.esm/index.js"),u=r("./node_modules/@ethersproject/keccak256/lib.esm/index.js"),d=r("./node_modules/@ethersproject/pbkdf2/lib.esm/pbkdf2.js"),h=r("./node_modules/@ethersproject/random/lib.esm/random.js"),p=r("./node_modules/@ethersproject/properties/lib.esm/index.js"),f=r("./node_modules/@ethersproject/transactions/lib.esm/index.js"),g=r("./node_modules/@ethersproject/json-wallets/lib.esm/utils.js"),m=r("./node_modules/@ethersproject/logger/lib.esm/index.js"),y=r("./node_modules/@ethersproject/json-wallets/lib.esm/_version.js"),b=function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))};const w=new m.Logger(y.r);function v(e){return null!=e&&e.mnemonic&&e.mnemonic.phrase}class A extends p.Description{isKeystoreAccount(e){return!(!e||!e._isKeystoreAccount)}}function T(e,t){const r=(0,g.m0)((0,g.oe)(e,"crypto/ciphertext"));if((0,c.hexlify)((0,u.keccak256)((0,c.concat)([t.slice(16,32),r]))).substring(2)!==(0,g.oe)(e,"crypto/mac").toLowerCase())throw new Error("invalid password");const n=function(e,t,r){if("aes-128-ctr"===(0,g.oe)(e,"crypto/cipher")){const n=(0,g.m0)((0,g.oe)(e,"crypto/cipherparams/iv")),s=new(o().Counter)(n),i=new(o().ModeOfOperation.ctr)(t,s);return(0,c.arrayify)(i.decrypt(r))}return null}(e,t.slice(0,16),r);n||w.throwError("unsupported cipher",m.Logger.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const s=t.slice(32,64),i=(0,f.computeAddress)(n);if(e.address){let t=e.address.toLowerCase();if("0x"!==t.substring(0,2)&&(t="0x"+t),(0,a.getAddress)(t)!==i)throw new Error("address mismatch")}const d={_isKeystoreAccount:!0,address:i,privateKey:(0,c.hexlify)(n)};if("0.1"===(0,g.oe)(e,"x-ethers/version")){const t=(0,g.m0)((0,g.oe)(e,"x-ethers/mnemonicCiphertext")),r=(0,g.m0)((0,g.oe)(e,"x-ethers/mnemonicCounter")),n=new(o().Counter)(r),i=new(o().ModeOfOperation.ctr)(s,n),a=(0,g.oe)(e,"x-ethers/path")||l.defaultPath,u=(0,g.oe)(e,"x-ethers/locale")||"en",h=(0,c.arrayify)(i.decrypt(t));try{const e=(0,l.entropyToMnemonic)(h,u),t=l.HDNode.fromMnemonic(e,null,u).derivePath(a);if(t.privateKey!=d.privateKey)throw new Error("mnemonic mismatch");d.mnemonic=t.mnemonic}catch(e){if(e.code!==m.Logger.errors.INVALID_ARGUMENT||"wordlist"!==e.argument)throw e}}return new A(d)}function P(e,t,r,n,o){return(0,c.arrayify)((0,d.A)(e,t,r,n,o))}function E(e,t,r,n,o){return Promise.resolve(P(e,t,r,n,o))}function C(e,t,r,n,o){const s=(0,g.Qq)(t),i=(0,g.oe)(e,"crypto/kdf");if(i&&"string"==typeof i){const t=function(e,t){return w.throwArgumentError("invalid key-derivation function parameters",e,t)};if("scrypt"===i.toLowerCase()){const r=(0,g.m0)((0,g.oe)(e,"crypto/kdfparams/salt")),a=parseInt((0,g.oe)(e,"crypto/kdfparams/n")),c=parseInt((0,g.oe)(e,"crypto/kdfparams/r")),l=parseInt((0,g.oe)(e,"crypto/kdfparams/p"));a&&c&&l||t("kdf",i),a&a-1&&t("N",a);const u=parseInt((0,g.oe)(e,"crypto/kdfparams/dklen"));return 32!==u&&t("dklen",u),n(s,r,a,c,l,64,o)}if("pbkdf2"===i.toLowerCase()){const n=(0,g.m0)((0,g.oe)(e,"crypto/kdfparams/salt"));let o=null;const i=(0,g.oe)(e,"crypto/kdfparams/prf");"hmac-sha256"===i?o="sha256":"hmac-sha512"===i?o="sha512":t("prf",i);const a=parseInt((0,g.oe)(e,"crypto/kdfparams/c")),c=parseInt((0,g.oe)(e,"crypto/kdfparams/dklen"));return 32!==c&&t("dklen",c),r(s,n,a,c,o)}}return w.throwArgumentError("unsupported key-derivation function","kdf",i)}function k(e,t){const r=JSON.parse(e);return T(r,C(r,t,P,i().syncScrypt))}function _(e,t,r){return b(this,void 0,void 0,(function*(){const n=JSON.parse(e);return T(n,yield C(n,t,E,i().scrypt,r))}))}function I(e,t,r,n){try{if((0,a.getAddress)(e.address)!==(0,f.computeAddress)(e.privateKey))throw new Error("address/privateKey mismatch");if(v(e)){const t=e.mnemonic;if(l.HDNode.fromMnemonic(t.phrase,null,t.locale).derivePath(t.path||l.defaultPath).privateKey!=e.privateKey)throw new Error("mnemonic mismatch")}}catch(e){return Promise.reject(e)}"function"!=typeof r||n||(n=r,r={}),r||(r={});const s=(0,c.arrayify)(e.privateKey),d=(0,g.Qq)(t);let p=null,m=null,y=null;if(v(e)){const t=e.mnemonic;p=(0,c.arrayify)((0,l.mnemonicToEntropy)(t.phrase,t.locale||"en")),m=t.path||l.defaultPath,y=t.locale||"en"}let b=r.client;b||(b="ethers.js");let w=null;w=r.salt?(0,c.arrayify)(r.salt):(0,h.p)(32);let A=null;if(r.iv){if(A=(0,c.arrayify)(r.iv),16!==A.length)throw new Error("invalid iv")}else A=(0,h.p)(16);let T=null;if(r.uuid){if(T=(0,c.arrayify)(r.uuid),16!==T.length)throw new Error("invalid uuid")}else T=(0,h.p)(16);let P=1<<17,E=8,C=1;return r.scrypt&&(r.scrypt.N&&(P=r.scrypt.N),r.scrypt.r&&(E=r.scrypt.r),r.scrypt.p&&(C=r.scrypt.p)),i().scrypt
2(d,w,P,E,C,64,n).then((t=>{const r=(t=(0,c.arrayify)(t)).slice(0,16),n=t.slice(16,32),i=t.slice(32,64),a=new(o().Counter)(A),l=new(o().ModeOfOperation.ctr)(r,a),d=(0,c.arrayify)(l.encrypt(s)),f=(0,u.keccak256)((0,c.concat)([n,d])),v={address:e.address.substring(2).toLowerCase(),id:(0,g.QT)(T),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:(0,c.hexlify)(A).substring(2)},ciphertext:(0,c.hexlify)(d).substring(2),kdf:"scrypt",kdfparams:{salt:(0,c.hexlify)(w).substring(2),n:P,dklen:32,p:C,r:E},mac:f.substring(2)}};if(p){const e=(0,h.p)(16),t=new(o().Counter)(e),r=new(o().ModeOfOperation.ctr)(i,t),n=(0,c.arrayify)(r.encrypt(p)),s=new Date,a=s.getUTCFullYear()+"-"+(0,g.Sp)(s.getUTCMonth()+1,2)+"-"+(0,g.Sp)(s.getUTCDate(),2)+"T"+(0,g.Sp)(s.getUTCHours(),2)+"-"+(0,g.Sp)(s.getUTCMinutes(),2)+"-"+(0,g.Sp)(s.getUTCSeconds(),2)+".0Z";v["x-ethers"]={client:b,gethFilename:"UTC--"+a+"--"+v.address,mnemonicCounter:(0,c.hexlify)(e).substring(2),mnemonicCiphertext:(0,c.hexlify)(n).substring(2),path:m,locale:y,version:"0.1"}}return JSON.stringify(v)}))}},"./node_modules/@ethersproject/json-wallets/lib.esm/utils.js"(e,t,r){"use strict";r.d(t,{QT:()=>l,Qq:()=>a,Sp:()=>i,m0:()=>s,oe:()=>c});var n=r("./node_modules/@ethersproject/bytes/lib.esm/index.js"),o=r("./node_modules/@ethersproject/strings/lib.esm/utf8.js");function s(e){return"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),(0,n.arrayify)(e)}function i(e,t){for(e=String(e);e.length<t;)e="0"+e;return e}function a(e){return"string"==typeof e?(0,o.YW)(e,o.dz.NFKC):(0,n.arrayify)(e)}function c(e,t){let r=e;const n=t.toLowerCase().split("/");for(let e=0;e<n.length;e++){let t=null;for(const o in r)if(o.toLowerCase()===n[e]){t=r[o];break}if(null===t)return null;r=t}return r}function l(e){const t=(0,n.arrayify)(e);t[6]=15&t[6]|64,t[8]=63&t[8]|128;const r=(0,n.hexlify)(t);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}},"./node_modules/@ethersproject/keccak256/lib.esm/index.js"(e,t,r){"use strict";r.r(t),r.d(t,{keccak256:()=>i});var n=r("./node_modules/js-sha3/src/sha3.js"),o=r.n(n),s=r("./node_modules/@ethersproject/bytes/lib.esm/index.js");function i(e){return"0x"+o().keccak_256((0,s.arrayify)(e))}},"./node_modules/@ethersproject/logger/lib.esm/index.js"(e,t,r){"use strict";r.r(t),r.d(t,{ErrorCode:()=>u,LogLevel:()=>l,Logger:()=>h});let n=!1,o=!1;const s={debug:1,default:2,info:2,warning:3,error:4,off:5};let i=s.default,a=null;const c=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(r){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var l,u;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(l||(l={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(u||(u={}));const d="0123456789abcdef";class h{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const r=e.toLowerCase();null==s[r]&&this.throwArgumentError("invalid log level name","logLevel",e),i>s[r]||console.log.apply(console,t)}debug(...e){this._log(h.levels.DEBUG,e)}info(...e){this._log(h.levels.INFO,e)}warn(...e){this._log(h.levels.WARNING,e)}makeError(e,t,r){if(o)return this.makeError("censored error",t,{});t||(t=h.errors.UNKNOWN_ERROR),r||(r={});const n=[];Object.keys(r).forEach((e=>{const t=r[e];try{if(t instanceof Uint8Array){let r="";for(let e=0;e<t.length;e++)r+=d[t[e]>>4],r+=d[15&t[e]];n.push(e+"=Uint8Array(0x"+r+")")}else n.push(e+"="+JSON.stringify(t))}catch(t){n.push(e+"="+JSON.stringify(r[e].toString()))}})),n.push(`code=${t}`),n.push(`version=${this.version}`);const s=e;let i="";switch(t){case u.NUMERIC_FAULT:{i="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":i+="-"+t;break;case"negative-power":case"negative-width":i+="-unsupported";break;case"unbound-bitwise-result":i+="-unbound-result"}break}case u.CALL_EXCEPTION:case u.INSUFFICIENT_FUNDS:case u.MISSING_NEW:case u.NONCE_EXPIRED:case u.REPLACEMENT_UNDERPRICED:case u.TRANSACTION_REPLACED:case u.UNPREDICTABLE_GAS_LIMIT:i=t}i&&(e+=" [ See: https://links.ethers.org/v5-errors-"+i+" ]"),n.length&&(e+=" ("+n.join(", ")+")");const a=new Error(e);return a.reason=s,a.code=t,Object.keys(r).forEach((function(e){a[e]=r[e]})),a}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,h.errors.INVALID_ARGUMENT,{argument:t,value:r})}assert(e,t,r,n){e||this.throwError(t,r,n)}assertArgument(e,t,r,n){e||this.throwArgumentError(t,r,n)}checkNormalize(e){null==e&&(e="platform missing String.prototype.normalize"),c&&this.throwError("platform missing String.prototype.normalize",h.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:c})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,h.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,h.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",e<t&&this.throwError("missing argument"+r,h.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+r,h.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",h.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",h.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",h.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return a||(a=new h("logger/5.8.0")),a}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",h.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),n){if(!e)return;this.globalLogger().throwError("error censorship permanent",h.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}o=!!e,n=!!t}static setLogLevel(e){const t=s[e.toLowerCase()];null!=t?i=t:h.globalLogger().warn("invalid log level - "+e)}static from(e){return new h(e)}}h.errors=u,h.levels=l},"./node_modules/@ethersproject/networks/lib.esm/index.js"(e,t,r){"use strict";r.d(t,{N:()=>u});const n=new(r("./node_modules/@ethersproject/logger/lib.esm/index.js").Logger)("networks/5.8.0");function o(e){const t=function(t,r){null==r&&(r={});const n=[];if(t.InfuraProvider&&"-"!==r.infura)try{n.push(new t.InfuraProvider(e,r.infura))}catch(e){}if(t.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new t.EtherscanProvider(e,r.etherscan))}catch(e){}
2if(t.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new t.AlchemyProvider(e,r.alchemy))}catch(e){}if(t.PocketProvider&&"-"!==r.pocket){const o=["goerli","ropsten","rinkeby","sepolia"];try{const s=new t.PocketProvider(e,r.pocket);s.network&&-1===o.indexOf(s.network.name)&&n.push(s)}catch(e){}}if(t.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new t.CloudflareProvider(e))}catch(e){}if(t.AnkrProvider&&"-"!==r.ankr)try{const o=["ropsten"],s=new t.AnkrProvider(e,r.ankr);s.network&&-1===o.indexOf(s.network.name)&&n.push(s)}catch(e){}if(t.QuickNodeProvider&&"-"!==r.quicknode)try{n.push(new t.QuickNodeProvider(e,r.quicknode))}catch(e){}if(0===n.length)return null;if(t.FallbackProvider){let o=1;return null!=r.quorum?o=r.quorum:"homestead"===e&&(o=2),new t.FallbackProvider(n,o)}return n[0]};return t.renetwork=function(e){return o(e)},t}function s(e,t){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return s(e,t)},r}const i={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:o("homestead")},a={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:o("ropsten")},c={chainId:63,name:"classicMordor",_defaultProvider:s("https://www.ethercluster.com/mordor","classicMordor")},l={unspecified:{chainId:0,name:"unspecified"},homestead:i,mainnet:i,morden:{chainId:2,name:"morden"},ropsten:a,testnet:a,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:o("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:o("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:o("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"sepolia",_defaultProvider:o("sepolia")},holesky:{chainId:17e3,name:"holesky",_defaultProvider:o("holesky")},classic:{chainId:61,name:"classic",_defaultProvider:s("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:c,classicTestnet:c,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:s("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:o("matic")},maticmum:{chainId:80001,name:"maticmum",_defaultProvider:o("maticmum")},optimism:{chainId:10,name:"optimism",_defaultProvider:o("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},"optimism-sepolia":{chainId:11155420,name:"optimism-sepolia"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},"arbitrum-sepolia":{chainId:421614,name:"arbitrum-sepolia"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function u(e){if(null==e)return null;if("number"==typeof e){for(const t in l){const r=l[t];if(r.chainId===e)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"==typeof e){const t=l[e];return null==t?null:{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress,_defaultProvider:t._defaultProvider||null}}const t=l[e.name];if(!t)return"number"!=typeof e.chainId&&n.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==t.chainId&&n.throwArgumentError("network chainId mismatch","network",e);let r=e._defaultProvider||null;var o;return null==r&&t._defaultProvider&&(r=(o=t._defaultProvider)&&"function"==typeof o.renetwork?t._defaultProvider.renetwork(e):t._defaultProvider),{name:e.name,chainId:t.chainId,ensAddress:e.ensAddress||t.ensAddress||null,_defaultProvider:r}}},"./node_modules/@ethersproject/pbkdf2/lib.esm/pbkdf2.js"(e,t,r){"use strict";r.d(t,{A:()=>s});var n=r("./node_modules/@ethersproject/bytes/lib.esm/index.js"),o=r("./node_modules/@ethersproject/sha2/lib.esm/sha2.js");function s(e,t,r,s,i){let a;e=(0,n.arrayify)(e),t=(0,n.arrayify)(t);let c=1;const l=new Uint8Array(s),u=new Uint8Array(t.length+4);let d,h;u.set(t);for(let p=1;p<=c;p++){u[t.length]=p>>24&255,u[t.length+1]=p>>16&255,u[t.length+2]=p>>8&255,u[t.length+3]=255&p;let f=(0,n.arrayify)((0,o.L5)(i,e,u));a||(a=f.length,h=new Uint8Array(a),c=Math.ceil(s/a),d=s-(c-1)*a),h.set(f);for(let t=1;t<r;t++){f=(0,n.arrayify)((0,o.L5)(i,e,f));for(let e=0;e<a;e++)h[e]^=f[e]}const g=(p-1)*a,m=p===c?d:a;l.set((0,n.arrayify)(h).slice(0,m),g)}return(0,n.hexlify)(l)}},"./node_modules/@ethersproject/properties/lib.esm/index.js"(e,t,r){"use strict";r.r(t),r.d(t,{Description:()=>g,checkProperties:()=>l,deepCopy:()=>f,defineReadOnly:()=>
2i,getStatic:()=>a,resolveProperties:()=>c,shallowCopy:()=>u});var n=r("./node_modules/@ethersproject/logger/lib.esm/index.js");var o=function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))};const s=new n.Logger("properties/5.8.0");function i(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function a(e,t){for(let r=0;r<32;r++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function c(e){return o(this,void 0,void 0,(function*(){const t=Object.keys(e).map((t=>{const r=e[t];return Promise.resolve(r).then((e=>({key:t,value:e})))}));return(yield Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}))}function l(e,t){e&&"object"==typeof e||s.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((r=>{t[r]||s.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)}))}function u(e){const t={};for(const r in e)t[r]=e[r];return t}const d={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function h(e){if(null==e||d[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;const t=Object.keys(e);for(let r=0;r<t.length;r++){let n=null;try{n=e[t[r]]}catch(e){continue}if(!h(n))return!1}return!0}return s.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function p(e){if(h(e))return e;if(Array.isArray(e))return Object.freeze(e.map((e=>f(e))));if("object"==typeof e){const t={};for(const r in e){const n=e[r];void 0!==n&&i(t,r,f(n))}return t}return s.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function f(e){return p(e)}class g{constructor(e){for(const t in e)this[t]=f(e[t])}}},"./node_modules/@ethersproject/providers/lib.esm/_version.js"(e,t,r){"use strict";r.d(t,{r:()=>n});const n="providers/5.8.0"},"./node_modules/@ethersproject/providers/lib.esm/base-provider.js"(e,t,r){"use strict";r.d(t,{DJ:()=>V,xR:()=>L});var n=r("./node_modules/@ethersproject/abstract-provider/lib.esm/index.js"),o=r("./node_modules/@ethersproject/base64/lib.esm/base64.js"),s=r("./node_modules/@ethersproject/basex/lib.esm/index.js"),i=r("./node_modules/@ethersproject/bignumber/lib.esm/bignumber.js"),a=r("./node_modules/@ethersproject/bytes/lib.esm/index.js"),c=r("./node_modules/@ethersproject/constants/lib.esm/hashes.js"),l=r("./node_modules/@ethersproject/hash/lib.esm/namehash.js"),u=r("./node_modules/@ethersproject/networks/lib.esm/index.js"),d=r("./node_modules/@ethersproject/properties/lib.esm/index.js"),h=r("./node_modules/@ethersproject/sha2/lib.esm/sha2.js"),p=r("./node_modules/@ethersproject/strings/lib.esm/utf8.js"),f=r("./node_modules/@ethersproject/web/lib.esm/index.js"),g=r("./node_modules/bech32/index.js"),m=r.n(g),y=r("./node_modules/@ethersproject/logger/lib.esm/index.js"),b=r("./node_modules/@ethersproject/providers/lib.esm/_version.js"),w=r("./node_modules/@ethersproject/providers/lib.esm/formatter.js"),v=function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))};const A=new y.Logger(b.r);function T(e){return null==e?"null":(32!==(0,a.hexDataLength)(e)&&A.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function P(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((e=>{if(Array.isArray(e)){const t={};e.forEach((e=>{t[T(e)]=!0}));const r=Object.keys(t);return r.sort(),r.join("|")}return T(e)})).join("&")}function E(e){if("string"==typeof e){if(e=e.toLowerCase(),32===(0,a.hexDataLength)(e))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+P(e);if(n.Rj.isForkEvent(e))throw A.warn("not implemented"),new Error("not implemented");if(e&&"object"==typeof e)return"filter:"+(e.address||"*")+":"+P(e.topics||[])}throw new Error("invalid event - "+e)}function C(){return(new Date).getTime()}function k(e){return new Promise((t=>{setTimeout(t,e)}))}const _=["block","network","pending","poll"];class I{constructor(e,t,r){(0,d.defineReadOnly)(this,"tag",e),(0,d.defineReadOnly)(this,"listener",t),(0,d.defineReadOnly)(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}get filter(){const e=this.tag.split(":");if("filter"!==e[0])return null;const t=e[1],r=""===(n=e[2])?[]:n.split(/&/g).map((e=>{if(""===e)return[];const t=e.split("|").map((e=>"null"===e?null:e));return 1===t.length?t[0]:t}));var n;const o={};return r.length>0&&(o.topics=r),t&&"*"!==t&&(o.address=t),o}pollable(){return this.tag.indexOf(":")>=0||_.indexOf(this.tag)>=0}}
2const S={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function x(e){return(0,a.hexZeroPad)(i.gH.from(e).toHexString(),32)}function B(e){return s.Base58.encode((0,a.concat)([e,(0,a.hexDataSlice)((0,h.sc)((0,h.sc)(e)),0,4)]))}const O=new RegExp("^(ipfs)://(.*)$","i"),M=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),O,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function W(e,t){try{return(0,p._v)(j(e,t))}catch(e){}return null}function j(e,t){if("0x"===e)return null;const r=i.gH.from((0,a.hexDataSlice)(e,t,t+32)).toNumber(),n=i.gH.from((0,a.hexDataSlice)(e,r,r+32)).toNumber();return(0,a.hexDataSlice)(e,r+32,r+32+n)}function R(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):A.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function N(e){const t=(0,a.arrayify)(e);if(t.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(t,32-t.length),r}function U(e){if(e.length%32==0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function D(e){const t=[];let r=0;for(let n=0;n<e.length;n++)t.push(null),r+=32;for(let n=0;n<e.length;n++){const o=(0,a.arrayify)(e[n]);t[n]=N(r),t.push(N(o.length)),t.push(U(o)),r+=32+32*Math.ceil(o.length/32)}return(0,a.hexConcat)(t)}class L{constructor(e,t,r,n){(0,d.defineReadOnly)(this,"provider",e),(0,d.defineReadOnly)(this,"name",r),(0,d.defineReadOnly)(this,"address",e.formatter.address(t)),(0,d.defineReadOnly)(this,"_resolvedAddress",n)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((e=>i.gH.from(e).eq(1))).catch((e=>{if(e.code===y.Logger.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e}))),this._supportsEip2544}_fetch(e,t){return v(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:(0,a.hexConcat)([e,(0,l.kM)(this.name),t||"0x"])};let n=!1;(yield this.supportsWildcard())&&(n=!0,r.data=(0,a.hexConcat)(["0x9061b923",D([(0,l.Wh)(this.name),r.data])]));try{let e=yield this.provider.call(r);return(0,a.arrayify)(e).length%32==4&&A.throwError("resolver threw error",y.Logger.errors.CALL_EXCEPTION,{transaction:r,data:e}),n&&(e=j(e,0)),e}catch(e){if(e.code===y.Logger.errors.CALL_EXCEPTION)return null;throw e}}))}_fetchBytes(e,t){return v(this,void 0,void 0,(function*(){const r=yield this._fetch(e,t);return null!=r?j(r,0):null}))}_getAddress(e,t){const r=S[String(e)];if(null==r&&A.throwError(`unsupported coin type: ${e}`,y.Logger.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===r.ilk)return this.provider.formatter.address(t);const n=(0,a.arrayify)(t);if(null!=r.p2pkh){const e=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return B((0,a.concat)([[r.p2pkh],"0x"+e[2]]))}}if(null!=r.p2sh){const e=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return B((0,a.concat)([[r.p2sh],"0x"+e[2]]))}}if(null!=r.prefix){const e=n[1];let t=n[0];if(0===t?20!==e&&32!==e&&(t=-1):t=-1,t>=0&&n.length===2+e&&e>=1&&e<=75){const e=m().toWords(n.slice(2));return e.unshift(t),m().encode(r.prefix,e)}}return null}getAddress(e){return v(this,void 0,void 0,(function*(){if(null==e&&(e=60),60===e)try{const e=yield this._fetch("0x3b3b57de");return"0x"===e||e===c.j?null:this.provider.formatter.callAddress(e)}catch(e){if(e.code===y.Logger.errors.CALL_EXCEPTION)return null;throw e}const t=yield this._fetchBytes("0xf1cb7e06",x(e));if(null==t||"0x"===t)return null;const r=this._getAddress(e,t);return null==r&&A.throwError("invalid or unsupported coin data",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),r}))}getAvatar(){return v(this,void 0,void 0,(function*(){const e=[{type:"name",content:this.name}];try{const t=yield this.getText("avatar");if(null==t)return null;for(let r=0;r<M.length;r++){const n=t.match(M[r]);if(null==n)continue;const o=n[1].toLowerCase();switch(o){case"https":return e.push({type:"url",content:t}),{linkage:e,url:t};case"data":return e.push({type:"data",content:t}),{linkage:e,url:t};case"ipfs":return e.push({type:"ipfs",content:t}),{linkage:e,url:R(t)};case"erc721":case"erc1155":{const r="erc721"===o?"0xc87b56dd":"0x0e89341c";e.push({type:o,content:t});const s=this._resolvedAddress||(yield this.getAddress()),c=(n[2]||"").split("/");if(2!==c.length)return null;const l=yield this.provider.formatter.address(c[0]),u=(0,a.hexZeroPad)(i.gH.from(c[1]).toHexString(),32);if("erc721"===o){const t=this.provider.formatter.callAddress(yield this.provider.call({to:l,data:(0,a.hexConcat)(["0x6352211e",u])}));if(s!==t)return null;e.push({type:"owner",content:t})}else if("erc1155"===o){const t=i.gH.from(yield this.provider.call({to:l,data:(0,a.hexConcat)(["0x00fdd58e",(0,a.hexZeroPad)(s,32),u])}));if(t.isZero())return null;e.push({type:"balance",content:t.toString()})}const d={to:this.provider.formatter.address(c[0]),data:(0,a.hexConcat)([r,u])};let h=W(yield this.provider.call(d),0);if(null==h)return null;e.push({type:"metadata-url-base",content:h}),"erc1155"===o&&(h=h.replace("{id}",u.substring(2)),e.push({type:"metadata-url-expanded",content:h})),h.match(/^ipfs:/i)&&(h=R(h)),e.push({type:"metadata-url",content:h});const p=yield(0,f.fetchJson)(h);if(!p)return null;e.push({type:"metadata",content:JSON.stringify(p)});let g=p.image;if("string"!=typeof g)return null;if(g.match(/^(https:\/\/|data:)/i));else{if(null==g.match(O))return null;e.push({type:"url-ipfs",content:g}),g=R(g)}return e.push({type:"url",content:g}),{linkage:e,url:g}}}}}catch(e){}return null}))}getContentHash(){return v(this,void 0,void 0,(function*(){const e=yield this._fetchBytes("0xbc1c58d1");if(null==e||"0x"===e)return null;const t=e.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){const e=parseInt(t[3],16);if(t[4].length===2*e)return"ipfs://"+s.Base58.encode("0x"+t[1])}const r=e.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const e=parseInt(r[3],16);if(r[4].length===2*e)return"ipns://"+s.Base58.encode("0x"+r[1])}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&64===n[1].length)return"bzz://"+n[1];const i=e.match(/^0x90b2c605([0-9a-f]*)$/);if(i&&68===i[1].length){const e={"=":"","+":"-","/":"_"};return"sia://"+(0,o.l)("0x"+i[1]).replace(/[=+\/]/g,(t=>e[t]))}return A.throwError("invalid or unsupported content hash data",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})}))}getText(e){return v(this,void 0,void 0,(function*(){let t=(0,p.YW)(e);t=(0,a.concat)([x(64),x(t.length),t]),t.length%32!=0&&(t=(0,a.concat)([t,(0,a.hexZeroPad)("0x",32-e.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",(0,a.hexlify)(t));return null==r||"0x"===r?null:(0,p._v)(r)}))}}let F=null,z=1;class V extends n.Kq{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),(0,d.defineReadOnly)(this,"anyNetwork","any"===e),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch((e=>{})),this._ready().catch((e=>{}));else{const t=(0,d.getStatic)(new.target,"getNetwork")(e);
2t?((0,d.defineReadOnly)(this,"_network",t),this.emit("network",t,null)):A.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return v(this,void 0,void 0,(function*(){if(null==this._network){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch(e){}null==e&&(e=yield this.detectNetwork()),e||A.throwError("no network detected",y.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=e:(0,d.defineReadOnly)(this,"_network",e),this.emit("network",e,null))}return this._network}))}get ready(){return(0,f.poll)((()=>this._ready().then((e=>e),(e=>{if(e.code!==y.Logger.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))))}static getFormatter(){return null==F&&(F=new w.ZA),F}static getNetwork(e){return(0,u.N)(e??"homestead")}ccipReadFetch(e,t,r){return v(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===r.length)return null;const n=e.to.toLowerCase(),o=t.toLowerCase(),s=[];for(let e=0;e<r.length;e++){const t=r[e],i=t.replace("{sender}",n).replace("{data}",o),a=t.indexOf("{data}")>=0?null:JSON.stringify({data:o,sender:n}),c=yield(0,f.fetchJson)({url:i,errorPassThrough:!0},a,((e,t)=>(e.status=t.statusCode,e)));if(c.data)return c.data;const l=c.message||"unknown error";if(c.status>=400&&c.status<500)return A.throwError(`response not found during CCIP fetch: ${l}`,y.Logger.errors.SERVER_ERROR,{url:t,errorMessage:l});s.push(l)}return A.throwError(`error encountered during CCIP fetch: ${s.map((e=>JSON.stringify(e))).join(", ")}`,y.Logger.errors.SERVER_ERROR,{urls:r,errorMessages:s})}))}_getInternalBlockNumber(e){return v(this,void 0,void 0,(function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const t=this._internalBlockNumber;try{const r=yield t;if(C()-r.respTime<=e)return r.blockNumber;break}catch(e){if(this._internalBlockNumber===t)break}}const t=C(),r=(0,d.resolveProperties)({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((e=>null),(e=>e))}).then((({blockNumber:e,networkError:n})=>{if(n)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),n;const o=C();return(e=i.gH.from(e).toNumber())<this._maxInternalBlockNumber&&(e=this._maxInternalBlockNumber),this._maxInternalBlockNumber=e,this._setFastBlockNumber(e),{blockNumber:e,reqTime:t,respTime:o}}));return this._internalBlockNumber=r,r.catch((e=>{this._internalBlockNumber===r&&(this._internalBlockNumber=null)})),(yield r).blockNumber}))}poll(){return v(this,void 0,void 0,(function*(){const e=z++,t=[];let r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(e){return void this.emit("error",e)}if(this._setFastBlockNumber(r),this.emit("poll",e,r),r!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)A.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",A.makeError("network block skew detected",y.Logger.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let e=this._emitted.block+1;e<=r;e++)this.emit("block",e);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach((e=>{if("block"===e)return;const t=this._emitted[e];"pending"!==t&&r-t>12&&delete this._emitted[e]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach((e=>{switch(e.type){case"tx":{const r=e.hash;let n=this.getTransactionReceipt(r).then((e=>e&&null!=e.blockNumber?(this._emitted["t:"+r]=e.blockNumber,this.emit(r,e),null):null)).catch((e=>{this.emit("error",e)}));t.push(n);break}case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=r-1);const n=e.filter;n.fromBlock=e._lastBlockNumber+1,n.toBlock=r;const o=n.toBlock-this._maxFilterBlockRange;o>n.fromBlock&&(n.fromBlock=o),n.fromBlock<0&&(n.fromBlock=0);const s=this.getLogs(n).then((t=>{e._inflight=!1,0!==t.length&&t.forEach((t=>{t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),this._emitted["b:"+t.blockHash]=t.blockNumber,this._emitted["t:"+t.transactionHash]=t.blockNumber,this.emit
vendor: 6,022 bytes, line 2
2(n,t)}))})).catch((t=>{this.emit("error",t),e._inflight=!1}));t.push(s)}}})),this._lastBlockNumber=r,Promise.all(t).then((()=>{this.emit("didPoll",e)})).catch((e=>{this.emit("error",e)}))}else this.emit("didPoll",e)}))}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return v(this,void 0,void 0,(function*(){return A.throwError("provider does not support network detection",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return v(this,void 0,void 0,(function*(){const e=yield this._ready(),t=yield this.detectNetwork();if(e.chainId!==t.chainId){if(this.anyNetwork)return this._network=t,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",t,e),yield k(0),this._network;const r=A.makeError("underlying network changed",y.Logger.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t});throw this.emit("error",r),r}return e}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((e=>{this._setFastBlockNumber(e)}),(e=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(e){e&&!this._poller?(this._poller=setInterval((()=>{this.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((()=>{this.poll(),this._bootstrapPoll=setTimeout((()=>{this._poller||this.poll(),this._bootstrapPoll=null}),this.pollingInterval)}),0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if("number"!=typeof e||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const e=C();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((e=>((null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(e){null!=this._fastBlockNumber&&e<this._fastBlockNumber||(this._fastQueryDate=C(),(null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,r){return v(this,void 0,void 0,(function*(){return this._waitForTransaction(e,t??1,r||0,null)}))}_waitForTransaction(e,t,r,n){return v(this,void 0,void 0,(function*(){const o=yield this.getTransactionReceipt(e);return(o?o.confirmations:0)>=t?o:new Promise(((o,s)=>{const i=[];let a=!1;const c=function(){return!!a||(a=!0,i.forEach((e=>{e()})),!1)},l=e=>{e.confirmations<t||c()||o(e)};if(this.on(e,l),i.push((()=>{this.removeListener(e,l)})),n){let r=n.startBlock,o=null;const l=i=>v(this,void 0,void 0,(function*(){a||(yield k(1e3),this.getTransactionCount(n.from).then((u=>v(this,void 0,void 0,(function*(){if(!a){if(u<=n.nonce)r=i;else{{const t=yield this.getTransaction(e);if(t&&null!=t.blockNumber)return}for(null==o&&(o=r-3,o<n.startBlock&&(o=n.startBlock));o<=i;){if(a)return;const r=yield this.getBlockWithTransactions(o);for(let o=0;o<r.transactions.length;o++){const i=r.transactions[o];if(i.hash===e)return;if(i.from===n.from&&i.nonce===n.nonce){if(a)return;const r=yield this.waitForTransaction(i.hash,t);if(c())return;let o="replaced";return i.data===n.data&&i.to===n.to&&i.value.eq(n.value)?o="repriced":"0x"===i.data&&i.from===i.to&&i.value.isZero()&&(o="cancelled"),void s(A.makeError("transaction was replaced",y.Logger.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===o||"cancelled"===o,reason:o,replacement:this._wrapTransaction(i),hash:e,receipt:r}))}}o++}}a||this.once("block",l)}}))),(e=>{a||this.once("block",l)})))}));if(a)return;this.once("block",l),i.push((()=>{this.removeListener("block",l)}))}if("number"==typeof r&&r>0){const e=setTimeout((()=>{c()||s(A.makeError("timeout exceeded",y.Logger.errors.TIMEOUT,{timeout:r}))}),r);e.unref&&e.unref(),i.push((()=>{clearTimeout(e)}))}}))}))}getBlockNumber(){return v(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return v(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return i.gH.from(e)}catch(t){return A.throwError("bad result from backend",y.Logger.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}}))}getBalance(e,t){return v(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield(0,d.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getBalance",r);try{return i.gH.from(n)}catch(e){return A.throwError("bad result from backend",y.Logger.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:e})}}))}getTransactionCount(e,t){return v(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield(0,d.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getTransactionCount",r);try{return i.gH.from(n).toNumber()}catch(e){return A.throwError("bad result from backend",y.Logger.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:e})}}))}getCode(e,t){return v(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield(0,d.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getCode",r);try{return(0,a.hexlify)(n)}catch(e){return A.throwError("bad result from backend",y.Logger.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:e})}}))}getStorageAt(e,t,r){return v(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield(0,d.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Prom
2ise.resolve(t).then((e=>(0,a.hexValue)(e)))}),o=yield this.perform("getStorageAt",n);try{return(0,a.hexlify)(o)}catch(e){return A.throwError("bad result from backend",y.Logger.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:o,error:e})}}))}_wrapTransaction(e,t,r){if(null!=t&&32!==(0,a.hexDataLength)(t))throw new Error("invalid response - sendTransaction");const n=e;return null!=t&&e.hash!==t&&A.throwError("Transaction hash mismatch from Provider.sendTransaction.",y.Logger.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),n.wait=(t,n)=>v(this,void 0,void 0,(function*(){let o;null==t&&(t=1),null==n&&(n=0),0!==t&&null!=r&&(o={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r});const s=yield this._waitForTransaction(e.hash,t,n,o);return null==s&&0===t?null:(this._emitted["t:"+e.hash]=s.blockNumber,0===s.status&&A.throwError("transaction failed",y.Logger.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:s}),s)})),n}sendTransaction(e){return v(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then((e=>(0,a.hexlify)(e))),r=this.formatter.transaction(e);null==r.confirmations&&(r.confirmations=0);const n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const e=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(r,e,n)}catch(e){throw e.transaction=r,e.transactionHash=r.hash,e}}))}_getTransactionRequest(e){return v(this,void 0,void 0,(function*(){const t=yield e,r={};return["from","to"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?this._getAddress(e):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?i.gH.from(e):null)))})),["type"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>null!=e?e:null)))})),t.accessList&&(r.accessList=this.formatter.accessList(t.accessList)),["data"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?(0,a.hexlify)(e):null)))})),this.formatter.transactionRequest(yield(0,d.resolveProperties)(r))}))}_getFilter(e){return v(this,void 0,void 0,(function*(){e=yield e;const t={};return null!=e.address&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach((r=>{null!=e[r]&&(t[r]=e[r])})),["fromBlock","toBlock"].forEach((r=>{null!=e[r]&&(t[r]=this._getBlockTag(e[r]))})),this.formatter.filter(yield(0,d.resolveProperties)(t))}))}_call(e,t,r){return v(this,void 0,void 0,(function*(){r>=10&&A.throwError("CCIP read exceeded maximum redirections",y.Logger.errors.SERVER_ERROR,{redirects:r,transaction:e});const n=e.to,o=yield this.perform("call",{transaction:e,blockTag:t});if(r>=0&&"latest"===t&&null!=n&&"0x556f1830"===o.substring(0,10)&&(0,a.hexDataLength)(o)%32==4)try{const s=(0,a.hexDataSlice)(o,4),c=(0,a.hexDataSlice)(s,0,32);i.gH.from(c).eq(n)||A.throwError("CCIP Read sender did not match",y.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o});const l=[],u=i.gH.from((0,a.hexDataSlice)(s,32,64)).toNumber(),d=i.gH.from((0,a.hexDataSlice)(s,u,u+32)).toNumber(),h=(0,a.hexDataSlice)(s,u+32);for(let t=0;t<d;t++){const r=W(h,32*t);null==r&&A.throwError("CCIP Read contained corrupt URL string",y.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o}),l.push(r)}const p=j(s,64);i.gH.from((0,a.hexDataSlice)(s,100,128)).isZero()||A.throwError("CCIP Read callback selector included junk",y.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o});const f=(0,a.hexDataSlice)(s,96,100),g=j(s,128),m=yield this.ccipReadFetch(e,p,l);null==m&&A.throwError("CCIP Read disabled or provided no URLs",y.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o});const b={to:n,data:(0,a.hexConcat)([f,D([m,g])])};return this._call(b,t,r+1)}catch(e){if(e.code===y.Logger.errors.SERVER_ERROR)throw e}try{return(0,a.hexlify)(o)}catch(r){return A.throwError("bad result from backend",y.Logger.errors.SERVER_ERROR,{method:"call",params:{transaction:e,blockTag:t},result:o,error:r})}}))}call(e,t){return v(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield(0,d.resolveProperties)({transaction:this._getTransactionRequest(e),blockTag:this._getBlockTag(t),ccipReadEnabled:Promise.resolve(e.cci
2pReadEnabled)});return this._call(r.transaction,r.blockTag,r.ccipReadEnabled?0:-1)}))}estimateGas(e){return v(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield(0,d.resolveProperties)({transaction:this._getTransactionRequest(e)}),r=yield this.perform("estimateGas",t);try{return i.gH.from(r)}catch(e){return A.throwError("bad result from backend",y.Logger.errors.SERVER_ERROR,{method:"estimateGas",params:t,result:r,error:e})}}))}_getAddress(e){return v(this,void 0,void 0,(function*(){"string"!=typeof(e=yield e)&&A.throwArgumentError("invalid address or ENS name","name",e);const t=yield this.resolveName(e);return null==t&&A.throwError("ENS name not configured",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(e)})`}),t}))}_getBlock(e,t){return v(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;let r=-128;const n={includeTransactions:!!t};if((0,a.isHexString)(e,32))n.blockHash=e;else try{n.blockTag=yield this._getBlockTag(e),(0,a.isHexString)(n.blockTag)&&(r=parseInt(n.blockTag.substring(2),16))}catch(t){A.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",e)}return(0,f.poll)((()=>v(this,void 0,void 0,(function*(){const e=yield this.perform("getBlock",n);if(null==e)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(t){let t=null;for(let r=0;r<e.transactions.length;r++){const n=e.transactions[r];if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){null==t&&(t=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let e=t-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}}const r=this.formatter.blockWithTransactions(e);return r.transactions=r.transactions.map((e=>this._wrapTransaction(e))),r}return this.formatter.block(e)}))),{oncePoll:this})}))}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return v(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return(0,f.poll)((()=>v(this,void 0,void 0,(function*(){const r=yield this.perform("getTransaction",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;const n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return this._wrapTransaction(n)}))),{oncePoll:this})}))}getTransactionReceipt(e){return v(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return(0,f.poll)((()=>v(this,void 0,void 0,(function*(){const r=yield this.perform("getTransactionReceipt",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;if(null==r.blockHash)return;const n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return n}))),{oncePoll:this})}))}getLogs(e){return v(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield(0,d.resolveProperties)({filter:this._getFilter(e)}),r=yield this.perform("getLogs",t);return r.forEach((e=>{null==e.removed&&(e.removed=!1)})),w.ZA.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return v(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(e){return v(this,void 0,void 0,(function*(){if("number"==typeof(e=yield e)&&e<0){e%1&&A.throwArgumentError("invalid BlockTag","blockTag",e);let t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return t+=e,t<0&&(t=0),this.formatter.blockTag(t)}return this.formatter.blockTag(e)}))}getResolver(e){return v(this,void 0,void 0,(function*(){let t=e;for(;;){if(""===t||"."===t)return null;if("eth"!==e&&"eth"===t)return null;const r=yield this._getResolver(t,"getResolver");if(null!=r){const n=new L(this,r,e);return t===e||(yield n.supportsWildcard())?n:null}t=t.split(".").slice(1).join(".")}}))}_getResolver(e,t){return v(this,void 0,void 0,(function*(){null==t&&(t="ENS");const r=yield this.getNetwork();r.ensAddress||A.throwError("network does not support ENS",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:t,network:r.name});try{const t=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+(0,l.kM)(e).substring(2)});return this.formatter.callAddress(t)}catch(e){}return null}))}resolveName(e){return v(this,void 0,void 0,(function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(t){if((0,a.isHexString)(e))throw t}"string"!=typeof e&&A.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null}))}lookupAddress(e){return v(this,void 0,void 0,(function*(){e=yield e;const t=(e=this.formatter.address(e)).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(t,"lookupAddress");if(null==r)return null;const n=W(yield this.call({to:r,data:"0x691f3431"+(0,l.kM)(t).substring(2)}),0);return(yield this.resolveName(n))!=e?null:n}))}getAvatar(e){return v(this,void 0,void 0,(function*(){let t=null;if((0,a.isHexString)(e)){const r=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"getAvatar");if(!n)return null;t=new L(this,n,r);try{const e=yield t.getAvatar();if(e)return e.url}catch(e){if(e.code!==y.Logger.errors.CALL_EXCEPTION)throw e}try{const e=W(yield this.call({to:n,data:"0x691f3431"+(0,l.kM)(r).substring(2)}),0);t=yield this.getResolver(e)}catch(e){if(e.code!==y.Logger.errors.CALL_EXCEPTION)throw e;return null}}else if(t=yield this.getResolver(e),!t)return null;const r=yield t.getAvatar();return null==r?null:r.url}))}perform(e,t){return A.throwError(e+" not implemented",y.Logger.errors.NOT_IMPLEMENT
vendor: 4,660 bytes, line 2
2ED,{operation:e})}_startEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_stopEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_addEventListener(e,t,r){const n=new I(E(e),t,r);return this._events.push(n),this._startEvent(n),this}on(e,t){return this._addEventListener(e,t,!1)}once(e,t){return this._addEventListener(e,t,!0)}emit(e,...t){let r=!1,n=[],o=E(e);return this._events=this._events.filter((e=>e.tag!==o||(setTimeout((()=>{e.listener.apply(this,t)}),0),r=!0,!e.once||(n.push(e),!1)))),n.forEach((e=>{this._stopEvent(e)})),r}listenerCount(e){if(!e)return this._events.length;let t=E(e);return this._events.filter((e=>e.tag===t)).length}listeners(e){if(null==e)return this._events.map((e=>e.listener));let t=E(e);return this._events.filter((e=>e.tag===t)).map((e=>e.listener))}off(e,t){if(null==t)return this.removeAllListeners(e);const r=[];let n=!1,o=E(e);return this._events=this._events.filter((e=>e.tag!==o||e.listener!=t||(!!n||(n=!0,r.push(e),!1)))),r.forEach((e=>{this._stopEvent(e)})),this}removeAllListeners(e){let t=[];if(null==e)t=this._events,this._events=[];else{const r=E(e);this._events=this._events.filter((e=>e.tag!==r||(t.push(e),!1)))}return t.forEach((e=>{this._stopEvent(e)})),this}}},"./node_modules/@ethersproject/providers/lib.esm/formatter.js"(e,t,r){"use strict";r.d(t,{ZA:()=>h,Zd:()=>m,fw:()=>p,ws:()=>f});var n=r("./node_modules/@ethersproject/address/lib.esm/index.js"),o=r("./node_modules/@ethersproject/bignumber/lib.esm/bignumber.js"),s=r("./node_modules/@ethersproject/bytes/lib.esm/index.js"),i=r("./node_modules/@ethersproject/constants/lib.esm/addresses.js"),a=r("./node_modules/@ethersproject/properties/lib.esm/index.js"),c=r("./node_modules/@ethersproject/transactions/lib.esm/index.js"),l=r("./node_modules/@ethersproject/logger/lib.esm/index.js"),u=r("./node_modules/@ethersproject/providers/lib.esm/_version.js");const d=new l.Logger(u.r);class h{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},t=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),o=this.data.bind(this),s=this.hash.bind(this),i=this.hex.bind(this),c=this.number.bind(this),l=this.type.bind(this);return e.transaction={hash:s,type:l,accessList:h.allowNull(this.accessList.bind(this),null),blockHash:h.allowNull(s,null),blockNumber:h.allowNull(c,null),transactionIndex:h.allowNull(c,null),confirmations:h.allowNull(c,null),from:t,gasPrice:h.allowNull(r),maxPriorityFeePerGas:h.allowNull(r),maxFeePerGas:h.allowNull(r),gasLimit:r,to:h.allowNull(t,null),value:r,nonce:c,data:o,r:h.allowNull(this.uint256),s:h.allowNull(this.uint256),v:h.allowNull(c),creates:h.allowNull(t,null),raw:h.allowNull(o)},e.transactionRequest={from:h.allowNull(t),nonce:h.allowNull(c),gasLimit:h.allowNull(r),gasPrice:h.allowNull(r),maxPriorityFeePerGas:h.allowNull(r),maxFeePerGas:h.allowNull(r),to:h.allowNull(t),value:h.allowNull(r),data:h.allowNull((e=>this.data(e,!0))),type:h.allowNull(c),accessList:h.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:c,blockNumber:c,transactionHash:s,address:t,topics:h.arrayOf(s),data:o,logIndex:c,blockHash:s},e.receipt={to:h.allowNull(this.address,null),from:h.allowNull(this.address,null),contractAddress:h.allowNull(t,null),transactionIndex:c,root:h.allowNull(i),gasUsed:r,logsBloom:h.allowNull(o),blockHash:s,transactionHash:s,logs:h.arrayOf(this.receiptLog.bind(this)),blockNumber:c,confirmations:h.allowNull(c,null),cumulativeGasUsed:r,effectiveGasPrice:h.allowNull(r),status:h.allowNull(c),type:l},e.block={hash:h.allowNull(s),parentHash:s,number:c,timestamp:c,nonce:h.allowNull(i),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:h.allowNull(t),extraData:o,transactions:h.allowNull(h.arrayOf(s)),baseFeePerGas:h.allowNull(r)},e.blockWithTransactions=(0,a.shallowCopy)(e.block),e.blockWithTransactions.transactions=h.allowNull(h.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:h.allowNull(n,void 0),toBlock:h.allowNull(n,void 0),blockHash:h.allowNull(s,void 0),address:h.allowNull(t,void 0),topics:h.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:h.allowNull(c),blockHash:h.allowNull(s),transactionIndex:c,removed:h.allowNull(this.boolean.bind(this)),address:t,data:h.allowFalsish(o,"0x"),topics:h.arrayOf(s),transactionHash:s,logIndex:c},e}accessList(e){return(0,c.accessListify)(e||[])}number(e){return"0x"===e?0:o.gH.from(e).toNumber()}type(e){return"0x"===e||null==e?0:o.gH.from(e).toNumber()}bigNumber(e){return o.gH.from(e)}boolean(e){if("boolean"==typeof e)return e;if("string"==typeof e){if("true"===(e=e.toLowerCase()))return!0;
2if("false"===e)return!1}throw new Error("invalid boolean - "+e)}hex(e,t){return"string"==typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),(0,s.isHexString)(e))?e.toLowerCase():d.throwArgumentError("invalid hash","value",e)}data(e,t){const r=this.hex(e,t);if(r.length%2!=0)throw new Error("invalid data; odd-length - "+e);return r}address(e){return(0,n.getAddress)(e)}callAddress(e){if(!(0,s.isHexString)(e,32))return null;const t=(0,n.getAddress)((0,s.hexDataSlice)(e,12));return t===i.L?null:t}contractAddress(e){return(0,n.getContractAddress)(e)}blockTag(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"==typeof e||(0,s.isHexString)(e))return(0,s.hexValue)(e);throw new Error("invalid blockTag")}hash(e,t){const r=this.hex(e,t);return 32!==(0,s.hexDataLength)(r)?d.throwArgumentError("invalid hash","value",e):r}difficulty(e){if(null==e)return null;const t=o.gH.from(e);try{return t.toNumber()}catch(e){}return null}uint256(e){if(!(0,s.isHexString)(e))throw new Error("invalid uint256");return(0,s.hexZeroPad)(e,32)}_block(e,t){null!=e.author&&null==e.miner&&(e.miner=e.author);const r=null!=e._difficulty?e._difficulty:e.difficulty,n=h.check(t,e);return n._difficulty=null==r?null:o.gH.from(r),n}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return h.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&o.gH.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),1!==e.type&&2!==e.type||null!=e.accessList||(e.accessList=[]);const t=h.check(this.formats.transaction,e);if(null!=e.chainId){let r=e.chainId;(0,s.isHexString)(r)&&(r=o.gH.from(r).toNumber()),t.chainId=r}else{let r=e.networkId;null==r&&null==t.v&&(r=e.chainId),(0,s.isHexString)(r)&&(r=o.gH.from(r).toNumber()),"number"!=typeof r&&null!=t.v&&(r=(t.v-35)/2,r<0&&(r=0),r=parseInt(r)),"number"!=typeof r&&(r=0),t.chainId=r}return t.blockHash&&"x"===t.blockHash.replace(/0/g,"")&&(t.blockHash=null),t}transaction(e){return(0,c.parse)(e)}receiptLog(e){return h.check(this.formats.receiptLog,e)}receipt(e){const t=h.check(this.formats.receipt,e);if(null!=t.root)if(t.root.length<=4){const e=o.gH.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&d.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):d.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&d.throwArgumentError("invalid root hash","value.root",t.root);return null!=t.status&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map((e=>this.topics(e))):null!=e?this.hash(e,!0):null}filter(e){return h.check(this.formats.filter,e)}filterLog(e){return h.check(this.formats.filterLog,e)}static check(e,t){const r={};for(const n in e)try{const o=e[n](t[n]);void 0!==o&&(r[n]=o)}catch(e){throw e.checkKey=n,e.checkValue=t[n],e}return r}static allowNull(e,t){return function(r){return null==r?t:e(r)}}static allowFalsish(e,t){return function(r){return r?e(r):t}}static arrayOf(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");const r=[];return t.forEach((function(t){r.push(e(t))})),r}}}function p(e){return e&&"function"==typeof e.isCommunityResource}function f(e){return p(e)&&e.isCommunityResource()}let g=!1;function m(){g||(g=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}},"./node_modules/@ethersproject/providers/lib.esm/json-rpc-provider.js"(e,t,r){"use strict";r.d(t,{F:()=>k,c:()=>P});var n=r("./node_modules/@ethersproject/abstract-signer/lib.esm/index.js"),o=r("./node_modules/@ethersproject/bignumber/lib.esm/bignumber.js"),s=r("./node_modules/@ethersproject/bytes/lib.esm/index.js"),i=r("./node_modules/@ethersproject/hash/lib.esm/typed-data.js"),a=r("./node_modules/@ethersproject/properties/lib.esm/index.js"),c=r("./node_modules/@ethersproject/strings/lib.esm/utf8.js"),l=r("./node_modules/@ethersproject/transactions/lib.esm/index.js"),u=r("./node_modules/@ethersproject/web/lib.esm/index.js"),d=r("./node_modules/@ethersproject/logger/lib.esm/index.js"),h=r("./node_modules/@ethersproject/providers/lib.esm/_version.js"),p=r("./node_modules/@ethersproject/providers/lib.esm/base-provider.js"),f=function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))};const g=new d.Logger(h.r),m=["call","estimateGas"];function y(e,t){if(null==e)return null;if("string"==typeof e.message&&e.message.match("reverted")){const r=(0,s.isHexString)(e.data)?e.data:null;if(!t||r)return{message:e.message,data:r}}if("object"==typeof e){for(const r in e){const n=y(e[r],t);if(n)return n}return null}if("string"==typeof e)try{return y(JSON.parse(e),t)}catch(e){}return null}function b(e,t,r){const n=r.transaction||r.signedTransaction;if("call"===e){const e=y(t,!0);if(e)return e.data;g.throwError("missing revert data in call exception; Transaction reverted without a reason string",d.Logger.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if("estimateGas"===e){let r=y(t.body,!1);null==r&&(r=y(t,!1)),r&&g.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",d.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:e,transaction:n,error:t})}let o=t.message;throw t.code===d.Logger.errors.SERVER_ERROR&&t.error&&"string"==typeof t.error.message?o=t.error.message:"string"==typeof t.body?o=t.body:"string"==typeof t.responseText&&(o=t.responseText),o=(o||"").toLowerCase(),o.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&g.throwError("insufficient funds for intrinsic transaction cost",d.Logger.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),o.match(/nonce (is )?too low/i)&&g.throwError("nonce has already been used",d.Logger.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),o.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&g.throwError("replacement fee too low",d.Logger.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),o.match(/only replay-protected/i)&&g.throwError("legacy pre-eip-155 transactions not supported",d.Logger.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),m.indexOf(e)>=0&&o.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&g.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",d.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function w(e){return new Promise((function(t){setTimeout(t,e)}))}function v(e){if(e.error){const t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function A(e){return e?e.toLowerCase():e}const T={};class P extends n.l{constructor(e,t,r){if(super(),e!==T)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");(0,a.defineReadOnly)(this,"provider",t),null==r&&(r=0),"string"==typeof r?((0,a.defineReadOnly)(this,"_address",this.provider.formatter.address(r)),(0,a.defineReadOnly)(this,"_index",null)):"number"==typeof r?((0,a.defineReadOnly)(this,"_index",r),(0,a.defineReadOnly)(this,"_address",null)):g.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(e){return g.throwError("cannot alter JSON-RPC Signer connection",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new E(T,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((e=>(e.length<=this._index&&g.throwError("unknown account #"+this._index,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index]))))}sendUncheckedTransaction(e){e=(0,a.shallowCopy)(e);const t=this.getAddress().then((e=>(e&&(e=e.toLowerCase()),e)));
2if(null==e.gasLimit){const r=(0,a.shallowCopy)(e);r.from=t,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((e=>f(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.provider.resolveName(e);return null==t&&g.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))))),(0,a.resolveProperties)({tx:(0,a.resolveProperties)(e),sender:t}).then((({tx:t,sender:r})=>{null!=t.from?t.from.toLowerCase()!==r&&g.throwArgumentError("from address mismatch","transaction",e):t.from=r;const n=this.provider.constructor.hexlifyTransaction(t,{from:!0});return this.provider.send("eth_sendTransaction",[n]).then((e=>e),(e=>("string"==typeof e.message&&e.message.match(/user denied/i)&&g.throwError("user rejected transaction",d.Logger.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:t}),b("sendTransaction",e,n))))}))}signTransaction(e){return g.throwError("signing transactions is unsupported",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return f(this,void 0,void 0,(function*(){const t=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(e);try{return yield(0,u.poll)((()=>f(this,void 0,void 0,(function*(){const e=yield this.provider.getTransaction(r);if(null!==e)return this.provider._wrapTransaction(e,r,t)}))),{oncePoll:this.provider})}catch(e){throw e.transactionHash=r,e}}))}signMessage(e){return f(this,void 0,void 0,(function*(){const t="string"==typeof e?(0,c.YW)(e):e,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[(0,s.hexlify)(t),r.toLowerCase()])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&g.throwError("user rejected signing",d.Logger.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),t}}))}_legacySignMessage(e){return f(this,void 0,void 0,(function*(){const t="string"==typeof e?(0,c.YW)(e):e,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),(0,s.hexlify)(t)])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&g.throwError("user rejected signing",d.Logger.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),t}}))}_signTypedData(e,t,r){return f(this,void 0,void 0,(function*(){const n=yield i.z.resolveNames(e,t,r,(e=>this.provider.resolveName(e))),o=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[o.toLowerCase(),JSON.stringify(i.z.getPayload(n.domain,t,n.value))])}catch(e){throw"string"==typeof e.message&&e.message.match(/user denied/i)&&g.throwError("user rejected signing",d.Logger.errors.ACTION_REJECTED,{action:"_signTypedData",from:o,messageData:{domain:n.domain,types:t,value:n.value}}),e}}))}unlock(e){return f(this,void 0,void 0,(function*(){const t=this.provider,r=yield this.getAddress();return t.send("personal_unlockAccount",[r.toLowerCase(),e,null])}))}}class E extends P{sendTransaction(e){return this.sendUncheckedTransaction(e).then((e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:t=>this.provider.waitForTransaction(e,t)})))}}const C={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class k extends p.DJ{constructor(e,t){let r=t;null==r&&(r=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then((t=>{e(t)}),(e=>{t(e)}))}),0)}))),super(r),e||(e=(0,a.getStatic)(this.constructor,"defaultUrl")()),"string"==typeof e?(0,a.defineReadOnly)(this,"connection",Object.freeze({url:e})):(0,a.defineReadOnly)(this,"connection",Object.freeze((0,a.shallowCopy)(e))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((()=>{this._cache.detectNetwork=null}),0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return f(this,void 0,void 0,(function*(){yield w(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch(t){try{e=yield this.send("net_version",[])}catch(e){}}if(null!=e){const t=(0,a.getStatic)(this.constructor,"getNetwork");try{return t(o.gH.from(e).toNumber())}catch(t){return g.throwError("could not detect network",d.Logger.errors.NETWORK_E
2RROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return g.throwError("could not detect network",d.Logger.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(e){return new P(T,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((e=>e.map((e=>this.formatter.address(e)))))}send(e,t){const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:(0,a.deepCopy)(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];const o=(0,u.fetchJson)(this.connection,JSON.stringify(r),v).then((e=>(this.emit("debug",{action:"response",request:r,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:r,provider:this}),e}));return n&&(this._cache[e]=o,setTimeout((()=>{this._cache[e]=null}),0)),o}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[A(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[A(t.address),t.blockTag]];case"getCode":return["eth_getCode",[A(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[A(t.address),(0,s.hexZeroPad)(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[(0,a.getStatic)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[(0,a.getStatic)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=A(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return f(this,void 0,void 0,(function*(){if("call"===e||"estimateGas"===e){const e=t.transaction;if(e&&null!=e.type&&o.gH.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((t=(0,a.shallowCopy)(t)).transaction=(0,a.shallowCopy)(e),delete t.transaction.type)}}const r=this.prepareRequest(e,t);null==r&&g.throwError(e+" not implemented",d.Logger.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(r[0],r[1])}catch(r){return b(e,r,t)}}))}_startEvent(e){"pending"===e.tag&&this._startPending(),super._startEvent(e)}_startPending(){if(null!=this._pendingFilter)return;const e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then((function(r){return function n(){e.send("eth_getFilterChanges",[r]).then((function(r){if(e._pendingFilter!=t)return null;let n=Promise.resolve();return r.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",n=n.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),n.then((function(){return w(1e3)}))}
2)).then((function(){if(e._pendingFilter==t)return setTimeout((function(){n()}),0),null;e.send("eth_uninstallFilter",[r])})).catch((e=>{}))}(),r})).catch((e=>{}))}_stopEvent(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){const r=(0,a.shallowCopy)(C);if(t)for(const e in t)t[e]&&(r[e]=!0);(0,a.checkProperties)(e,r);const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null==e[t])return;const r=(0,s.hexValue)(o.gH.from(e[t]));"gasLimit"===t&&(t="gas"),n[t]=r})),["from","to","data"].forEach((function(t){null!=e[t]&&(n[t]=(0,s.hexlify)(e[t]))})),e.accessList&&(n.accessList=(0,l.accessListify)(e.accessList)),n}}},"./node_modules/@ethersproject/providers/lib.esm/url-json-rpc-provider.js"(e,t,r){"use strict";r.d(t,{B:()=>l,M:()=>u});var n=r("./node_modules/@ethersproject/properties/lib.esm/index.js"),o=r("./node_modules/@ethersproject/logger/lib.esm/index.js"),s=r("./node_modules/@ethersproject/providers/lib.esm/_version.js"),i=r("./node_modules/@ethersproject/providers/lib.esm/json-rpc-provider.js"),a=function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))};const c=new o.Logger(s.r);class l extends i.F{detectNetwork(){const e=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return a(this,void 0,void 0,(function*(){let t=this.network;return null==t&&(t=yield e.detectNetwork.call(this),t||c.throwError("no network detected",o.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&((0,n.defineReadOnly)(this,"_network",t),this.emit("network",t,null))),t}))}}class u extends l{constructor(e,t){c.checkAbstract(new.target,u),e=(0,n.getStatic)(new.target,"getNetwork")(e),t=(0,n.getStatic)(new.target,"getApiKey")(t);super((0,n.getStatic)(new.target,"getUrl")(e,t),e),"string"==typeof t?(0,n.defineReadOnly)(this,"apiKey",t):null!=t&&Object.keys(t).forEach((e=>{(0,n.defineReadOnly)(this,e,t[e])}))}_startPending(){c.warn("WARNING: API provider does not support pending filters")}isCommunityResource(){return!1}getSigner(e){return c.throwError("API provider does not support signing",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(e){return e}static getUrl(e,t){return c.throwError("not implemented; sub-classes must override getUrl",o.Logger.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}},"./node_modules/@ethersproject/providers/lib.esm/web3-provider.js"(e,t,r){"use strict";r.d(t,{j:()=>u});var n=r("./node_modules/@ethersproject/properties/lib.esm/index.js"),o=r("./node_modules/@ethersproject/logger/lib.esm/index.js"),s=r("./node_modules/@ethersproject/providers/lib.esm/_version.js"),i=r("./node_modules/@ethersproject/providers/lib.esm/json-rpc-provider.js");const a=new o.Logger(s.r);let c=1;function l(e,t){const r="Web3LegacyFetcher";return function(e,o){const s={method:e,params:o,id:c++,jsonrpc:"2.0"};return new Promise(((e,o)=>{this.emit("debug",{action:"request",fetcher:r,request:(0,n.deepCopy)(s),provider:this}),t(s,((t,n)=>{if(t)return this.emit("debug",{action:"response",fetcher:r,error:t,request:s,provider:this}),o(t);if(this.emit("debug",{action:"response",fetcher:r,request:s,response:n,provider:this}),n.error){const e=new Error(n.error.message);return e.code=n.error.code,e.data=n.error.data,o(e)}e(n.result)}))}))}}class u extends i.F{constructor(e,t){null==e&&a.throwArgumentError("missing provider","provider",e);let r=null,o=null,s=null;"function"==typeof e?(r="unknown:",o=e):(r=e.host||e.path||"",!r&&e.isMetaMask&&(r="metamask"),s=e,e.request?(""===r&&(r="eip-1193:"),o=function(e){return function(t,r){null==r&&(r=[]);const o={method:t,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:(0,n.deepCopy)(o),provider:this}),e.request(o).then((e=>
2(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:o,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:o,error:e,provider:this}),e}))}}(e)):e.sendAsync?o=l(0,e.sendAsync.bind(e)):e.send?o=l(0,e.send.bind(e)):a.throwArgumentError("unsupported provider","provider",e),r||(r="unknown:")),super(r,t),(0,n.defineReadOnly)(this,"jsonRpcFetchFunc",o),(0,n.defineReadOnly)(this,"provider",s)}send(e,t){return this.jsonRpcFetchFunc(e,t)}}},"./node_modules/@ethersproject/random/lib.esm/index.js"(e,t,r){"use strict";r.r(t),r.d(t,{randomBytes:()=>n.p,shuffled:()=>o.A});var n=r("./node_modules/@ethersproject/random/lib.esm/random.js"),o=r("./node_modules/@ethersproject/random/lib.esm/shuffle.js")},"./node_modules/@ethersproject/random/lib.esm/random.js"(e,t,r){"use strict";r.d(t,{p:()=>c});var n=r("./node_modules/@ethersproject/bytes/lib.esm/index.js"),o=r("./node_modules/@ethersproject/logger/lib.esm/index.js");const s=new o.Logger("random/5.8.0");const i=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw new Error("unable to locate global object")}();let a=i.crypto||i.msCrypto;function c(e){(e<=0||e>1024||e%1||e!=e)&&s.throwArgumentError("invalid length","length",e);const t=new Uint8Array(e);return a.getRandomValues(t),(0,n.arrayify)(t)}a&&a.getRandomValues||(s.warn("WARNING: Missing strong random number source"),a={getRandomValues:function(e){return s.throwError("no secure random source avaialble",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}})},"./node_modules/@ethersproject/random/lib.esm/shuffle.js"(e,t,r){"use strict";function n(e){for(let t=(e=e.slice()).length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}r.d(t,{A:()=>n})},"./node_modules/@ethersproject/rlp/lib.esm/index.js"(e,t,r){"use strict";r.r(t),r.d(t,{decode:()=>h,encode:()=>l});var n=r("./node_modules/@ethersproject/bytes/lib.esm/index.js"),o=r("./node_modules/@ethersproject/logger/lib.esm/index.js");const s=new o.Logger("rlp/5.8.0");function i(e){const t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function a(e,t,r){let n=0;for(let o=0;o<r;o++)n=256*n+e[t+o];return n}function c(e){if(Array.isArray(e)){let t=[];if(e.forEach((function(e){t=t.concat(c(e))})),t.length<=55)return t.unshift(192+t.length),t;const r=i(t.length);return r.unshift(247+r.length),r.concat(t)}(0,n.isBytesLike)(e)||s.throwArgumentError("RLP object must be BytesLike","object",e);const t=Array.prototype.slice.call((0,n.arrayify)(e));if(1===t.length&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const r=i(t.length);return r.unshift(183+r.length),r.concat(t)}function l(e){return(0,n.hexlify)(c(e))}function u(e,t,r,n){const i=[];for(;r<t+1+n;){const a=d(e,r);i.push(a.result),(r+=a.consumed)>t+1+n&&s.throwError("child data too short",o.Logger.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function d(e,t){if(0===e.length&&s.throwError("data too short",o.Logger.errors.BUFFER_OVERRUN,{}),e[t]>=248){const r=e[t]-247;t+1+r>e.length&&s.throwError("data short segment too short",o.Logger.errors.BUFFER_OVERRUN,{});const n=a(e,t+1,r);return t+1+r+n>e.length&&s.throwError("data long segment too short",o.Logger.errors.BUFFER_OVERRUN,{}),u(e,t,t+1+r,r+n)}if(e[t]>=192){const r=e[t]-192;return t+1+r>e.length&&s.throwError("data array too short",o.Logger.errors.BUFFER_OVERRUN,{}),u(e,t,t+1,r)}if(e[t]>=184){const r=e[t]-183;t+1+r>e.length&&s.throwError("data array too short",o.Logger.errors.BUFFER_OVERRUN,{});const i=a(e,t+1,r);t+1+r+i>e.length&&s.throwError("data array too short",o.Logger.errors.BUFFER_OVERRUN,{});return{consumed:1+r+i,result:(0,n.hexlify)(e.slice(t+1+r,t+1+r+i))}}if(e[t]>=128){const r=e[t]-128;t+1+r>e.length&&s.throwError("data too short",o.Logger.errors.BUFFER_OVERRUN,{});return{consumed:1+r,result:(0,n.hexlify)(e.slice(t+1,t+1+r))}}return{consumed:1,result:(0,n.hexlify)(e[t])}}function h(e){const t=(0,n.arrayify)(e),r=d(t,0);return r.consumed!==t.length&&s.throwArgumentError("invalid rlp data","data",e),r.result}},"./node_modules/@ethersproject/sha2/lib.esm/index.js"(e,t,r){"use strict";r.r(t),r.d(t,{SupportedAlgorithm:()=>o.q,computeHmac:()=>n.L5,ripemd160:()=>n.HE,sha256:()=>n.sc,sha512:()=>n.Zf});var n=r("./node_modules/@ethersproject/sha2/lib.esm/sha2.js"),o=r("./node_modules/@ethersproject/sha2/lib.esm/types.js")},"./node_modules/@ethersproject/sha2/lib.esm/sha2.js"(e,t,r){"use strict";r.d(t,{L5:()=>h,HE:()=>l,sc:()=>u,Zf:()=>d});var n=r("./node_modules/hash.js/lib/hash.js"),o=r.n(n),s=r("./node_modules/@ethersproject/bytes/lib.esm/index.js"),i=r("./node_modules/@ethersproject/sha2/lib.esm/types.js"),a=r("./node_modules/@ethersproject/logger/lib.esm/index.js");const c=new a.Logger("sha2/5.8.0");function l(e){return"0x"+o().ripemd160().update((0,s.arrayify)(e)).digest("hex")}function u(e){return"0x"+o().sha256().update((0,s.arrayify)(e)).digest("hex")}function d(e){return"0x"+o().sha512().update((0,s.arrayify)(e)).digest("hex")}function h(e,t,r){return i.q[e]||c.throwError("unsupported algorithm "+e,a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:e}),"0x"+o().hmac(o()[e],(0,s.arrayify)(t)).update((0,s.arrayify)(r)).digest("hex")}},"./node_modules/@ethersproject/sha2/lib.esm/types.js"(e,t,r){"use strict";var n;r.d(t,{q:()=>n}),function(e){e.sha256="sha256",e.sha512="sha512"}(n||(n={}))},"./node_modules/@ethersproject/signing-key/lib.esm/index.js"(e,t,r){"use strict";r.r(t),r.d(t,{SigningKey:()=>G,computePublicKey:()=>J,recoverPublicKey:()=>Y});var n=r("./node_modules/bn.js/lib/bn.js"),o=r.n(n),s=r("./node_modules/hash.js/lib/hash.js"),i=r.n(s);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self&&self;function a(e,t,r){return r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(t??r.path)}},e(r,r.exports),r.exports}var c=l;function l(e,t){if(!e)throw new Error(t||"Assertion failed")}l.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var u=a((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function o(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var o=e.charCodeAt(n),s=o>>8,i=255&o;s?r.push(s,i):r.push(i)}return r},r.zero2=n,r.toHex=o,r.encode=function(e,t){return"hex"===t?o(e):e}})),d=a((function(e,t){var r=t;r.assert=c,r.toArray=u.toArray,r.zero2=u.zero2,r.toHex=u.toHex,r.encode=u.encode,r.getNAF=function(e,t,r){var n,o=new Array(Math.max(e.bitLength(),r)+1);for(n=0;n<o.length;n+=1)o[n]=0;var s=1<<t+1,i=e.clone();for(n=0;n<o.length;n++){var a,c=i.andln(s-1);i.isOdd()?(a=c>(s>>1)-1?(s>>1)-c:c,i.isubn(a)):a=0,o[n]=a,i.iushrn(1)}return o},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,o=0,s=0;e.cmpn(-o)>0||t.cmpn(-s)>0;){var i,a,c=e.andln(3)+o&3,l=t.andln(3)+s&3;3===c&&(c=-1),3===l&&(l=-1),i=1&c?3!==(n=e.andln(7)+o&7)&&5!==n||2!==l?c:-c:0,r[0].push(i),a=1&l?3!==(n=t.andln(7)+s&7)&&5!==n||2!==c?l:-l:0,r[1].push(a),2*o===i+1&&(o=1-o),2*s===a+1&&(s=1-s),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new(o())(e,"hex","le")}})),h=d.getNAF,p=d.getJSF,f=d.assert;function g(e,t){this.type=e,this.p=new(o())(t.p,16),this.red=t.prime?o().red(t.prime):o().mont(this.p),this.zero=new(o())(0).toRed(this.red),this.one=new(o())(1).toRed(this.red),this.two=new(o())(2).toRed(this.red),this.n=t.n&&new(o())(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var m=g;
vendor: 6,451 bytes, line 2
2function y(e,t){this.curve=e,this.type=t,this.precomputed=null}g.prototype.point=function(){throw new Error("Not implemented")},g.prototype.validate=function(){throw new Error("Not implemented")},g.prototype._fixedNafMul=function(e,t){f(e.precomputed);var r=e._getDoubles(),n=h(t,1,this._bitLength),o=(1<<r.step+1)-(r.step%2==0?2:1);o/=3;var s,i,a=[];for(s=0;s<n.length;s+=r.step){i=0;for(var c=s+r.step-1;c>=s;c--)i=(i<<1)+n[c];a.push(i)}for(var l=this.jpoint(null,null,null),u=this.jpoint(null,null,null),d=o;d>0;d--){for(s=0;s<a.length;s++)(i=a[s])===d?u=u.mixedAdd(r.points[s]):i===-d&&(u=u.mixedAdd(r.points[s].neg()));l=l.add(u)}return l.toP()},g.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var o=n.points,s=h(t,r,this._bitLength),i=this.jpoint(null,null,null),a=s.length-1;a>=0;a--){for(var c=0;a>=0&&0===s[a];a--)c++;if(a>=0&&c++,i=i.dblp(c),a<0)break;var l=s[a];f(0!==l),i="affine"===e.type?l>0?i.mixedAdd(o[l-1>>1]):i.mixedAdd(o[-l-1>>1].neg()):l>0?i.add(o[l-1>>1]):i.add(o[-l-1>>1].neg())}return"affine"===e.type?i.toP():i},g.prototype._wnafMulAdd=function(e,t,r,n,o){var s,i,a,c=this._wnafT1,l=this._wnafT2,u=this._wnafT3,d=0;for(s=0;s<n;s++){var f=(a=t[s])._getNAFPoints(e);c[s]=f.wnd,l[s]=f.points}for(s=n-1;s>=1;s-=2){var g=s-1,m=s;if(1===c[g]&&1===c[m]){var y=[t[g],null,null,t[m]];0===t[g].y.cmp(t[m].y)?(y[1]=t[g].add(t[m]),y[2]=t[g].toJ().mixedAdd(t[m].neg())):0===t[g].y.cmp(t[m].y.redNeg())?(y[1]=t[g].toJ().mixedAdd(t[m]),y[2]=t[g].add(t[m].neg())):(y[1]=t[g].toJ().mixedAdd(t[m]),y[2]=t[g].toJ().mixedAdd(t[m].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],w=p(r[g],r[m]);for(d=Math.max(w[0].length,d),u[g]=new Array(d),u[m]=new Array(d),i=0;i<d;i++){var v=0|w[0][i],A=0|w[1][i];u[g][i]=b[3*(v+1)+(A+1)],u[m][i]=0,l[g]=y}}else u[g]=h(r[g],c[g],this._bitLength),u[m]=h(r[m],c[m],this._bitLength),d=Math.max(u[g].length,d),d=Math.max(u[m].length,d)}var T=this.jpoint(null,null,null),P=this._wnafT4;for(s=d;s>=0;s--){for(var E=0;s>=0;){var C=!0;for(i=0;i<n;i++)P[i]=0|u[i][s],0!==P[i]&&(C=!1);if(!C)break;E++,s--}if(s>=0&&E++,T=T.dblp(E),s<0)break;for(i=0;i<n;i++){var k=P[i];0!==k&&(k>0?a=l[i][k-1>>1]:k<0&&(a=l[i][-k-1>>1].neg()),T="affine"===a.type?T.mixedAdd(a):T.add(a))}}for(s=0;s<n;s++)l[s]=null;return o?T:T.toP()},g.BasePoint=y,y.prototype.eq=function(){throw new Error("Not implemented")},y.prototype.validate=function(){return this.curve.validate(this)},g.prototype.decodePoint=function(e,t){e=d.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?f(e[e.length-1]%2==0):7===e[0]&&f(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},y.prototype.encodeCompressed=function(e){return this.encode(e,!0)},y.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},y.prototype.encode=function(e,t){return d.encode(this._encode(t),e)},y.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},y.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},y.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,o=0;o<t;o+=e){for(var s=0;s<e;s++)n=n.dbl();r.push(n)}return{step:e,points:r}},y.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),o=1;o<r;o++)t[o]=t[o-1].add(n);return{wnd:e,points:t}},y.prototype._getBeta=function(){return null},y.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var b=a((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}})),w=d.assert;function v(e){m.call(this,"short",e),this.a=new(o())(e.a,16).toRed(this.red),this.b=new(o())(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}b(v,m);var A=v;function T(e,t,r,n){m.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new(o())(t,16),this.y=new(o())(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)}function P(e,t,r,n){m.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new(o())(0)):(this.x=new(o())(t,16),this.y=new(o())(r,16),this.z=new(o())(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}v.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new(o())(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new(o())(e.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(t))?r=s[0]:(r=s[1],w(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new(o())(e.a,16),b:new(o())(e.b,16)}})):this._getEndoBasis(r)}}},v.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:o().mont(e),r=new(o())(2).toRed(t).redInvm(),n=r.redNeg(),s=new(o())(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(s).fromRed(),n.redSub(s).fromRed()]},v.prototype._getEndoBasis=function(e){for(var t,r,n,s,i,a,c,l,u,d=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=e,p=this.n.clone(),f=new(o())(1),g=new(o())(0),m=new(o())(0),y=new(o())(1),b=0;
vendor: 8,951 bytes, line 2
20!==h.cmpn(0);){var w=p.div(h);l=p.sub(w.mul(h)),u=m.sub(w.mul(f));var v=y.sub(w.mul(g));if(!n&&l.cmp(d)<0)t=c.neg(),r=f,n=l.neg(),s=u;else if(n&&2==++b)break;c=l,p=h,h=l,m=f,f=u,y=g,g=v}i=l.neg(),a=u;var A=n.sqr().add(s.sqr());return i.sqr().add(a.sqr()).cmp(A)>=0&&(i=t,a=r),n.negative&&(n=n.neg(),s=s.neg()),i.negative&&(i=i.neg(),a=a.neg()),[{a:n,b:s},{a:i,b:a}]},v.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],o=n.b.mul(e).divRound(this.n),s=r.b.neg().mul(e).divRound(this.n),i=o.mul(r.a),a=s.mul(n.a),c=o.mul(r.b),l=s.mul(n.b);return{k1:e.sub(i).sub(a),k2:c.add(l).neg()}},v.prototype.pointFromX=function(e,t){(e=new(o())(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var s=n.fromRed().isOdd();return(t&&!s||!t&&s)&&(n=n.redNeg()),this.point(e,n)},v.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),o=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(o).cmpn(0)},v.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,o=this._endoWnafT2,s=0;s<e.length;s++){var i=this._endoSplit(t[s]),a=e[s],c=a._getBeta();i.k1.negative&&(i.k1.ineg(),a=a.neg(!0)),i.k2.negative&&(i.k2.ineg(),c=c.neg(!0)),n[2*s]=a,n[2*s+1]=c,o[2*s]=i.k1,o[2*s+1]=i.k2}for(var l=this._wnafMulAdd(1,n,o,2*s,r),u=0;u<2*s;u++)n[u]=null,o[u]=null;return l},b(T,m.BasePoint),v.prototype.point=function(e,t,r){return new T(this,e,t,r)},v.prototype.pointFromJSON=function(e,t){return T.fromJSON(this,e,t)},T.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},T.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]},T.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function o(t){return e.point(t[0],t[1],r)}var s=t[2];return n.precomputed={beta:null,doubles:s.doubles&&{step:s.doubles.step,points:[n].concat(s.doubles.points.map(o))},naf:s.naf&&{wnd:s.naf.wnd,points:[n].concat(s.naf.points.map(o))}},n},T.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)+">"},T.prototype.isInfinity=function(){return this.inf},T.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(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},T.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),o=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),s=o.redSqr().redISub(this.x.redAdd(this.x)),i=o.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,i)},T.prototype.getX=function(){return this.x.fromRed()},T.prototype.getY=function(){return this.y.fromRed()},T.prototype.mul=function(e){return e=new(o())(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)},T.prototype.mulAdd=function(e,t,r){var n=[this,t],o=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,o):this.curve._wnafMulAdd(1,n,o,2)},T.prototype.jmulAdd=function(e,t,r){var n=[this,t],o=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,o,!0):this.curve._wnafMulAdd(1,n,o,2,!0)},T.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},T.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},T.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},b(P,m.BasePoint),v.prototype.jpoint=function(e,t,r){return new P(this,e,t,r)},P.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},P.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},P.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),o=e.x.redMul(r),s=this.y.redMul(t.redMul(e.z)),i=e.y.redMul(r.redMul(this.z)),a=n.redSub(o),c=s.redSub(i);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=a.redSqr(),u=l.redMul(a),d=n.redMul(l),h=c.redSqr().redIAdd(u).redISub(d).redISub(d),p=c.redMul(d.redISub(h)).redISub(s.redMul(u)),f=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(h,p,f)},P.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),o=this.y,s=e.y.redMul(t).redMul(this.z),i=r.redSub(n),a=o.redSub(s);if(0===i.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=i.redSqr(),l=c.redMul(i),u=r.redMul(c),d=a.redSqr().redIAdd(l).redISub(u).redISub(u),h=a.redMul(u.redISub(d)).redISub(o.redMul(l)),p=this.z.redMul(i);return this.curve.jpoint(d,h,p)},P.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,o=this.curve.tinv,s=this.x,i=this.y,a=this.z,c=a.redSqr().redSqr(),l=i.redAdd(i);for(t=0;t<e;t++){var u=s.redSqr(),d=l.redSqr(),h=d.redSqr(),p=u.redAdd(u).redIAdd(u).redIAdd(n.redMul(c)),f=s.redMul(d),g=p.redSqr().redISub(f.redAdd(f)),m=f.redISub(g),y=p.redMul(m);y=y.redIAdd(y).redISub(h);var b=l.redMul(a);t+1<e&&(c=c.redMul(h)),s=g,a=b,l=y}return this.curve.jpoint(s,l.redMul(o),a)},P.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},P.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),s=o.redSqr(),i=this.x.redAdd(o).redSqr().redISub(n).redISub(s);i=i.redIAdd(i);var a=n.redAdd(n).redIAdd(n),c=a.redSqr().redISub(i).redISub(i),l=s.redIAdd(s);l=(l=l.redIAdd(l)).redIAdd(l),e=c,t=a.redMul(i.redISub(c)).redISub(l),r=this.y.redAdd(this.y)}else{var u=this.x.redSqr(),d=this.y.redSqr(),h=d.redSqr(),p=this.x.redAdd(d).redSqr().redISub(u).redISub(h);p=p.redIAdd(p);var f=u.redAdd(u).redIAdd(u),g=f.redSqr(),m=h.redIAdd(h);m=(m=m.redIAdd(m)).redIAdd(m),e=g.redISub(p).redISub(p),t=f.redMul(p.redISub(e)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},P.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),s=o.redSqr(),i=this.x.redAdd(o).redSqr().redISub(n).redISub(s);i=i.redIAdd(i);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),c=a.redSqr().redISub(i).redISub(i);e=c;var l=s.redIAdd(s);l=(l=l.redIAdd(l)).redIAdd(l),t=a.redMul(i.redISub(c)).redISub(l),r=this.y.redAdd(this.y)}else{var u=this.z.redSqr(),d=this.y.redSqr(),h=this.x.redMul(d),p=this.x.redSub(u).redMul(this.x.redAdd(u));p=p.redAdd(p).redIAdd(p);var f=h.redIAdd(h),g=(f=f.redIAdd(f)).redAdd(f);e=p.redSqr().redISub(g),r=this.y.redAdd(this.z).redSqr().redISub(d).redISub(u);var m=d.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=p.redMul(f.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,r)},P.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,o=n.redSqr().redSqr(),s=t.redSqr(),i=r.redSqr(),a=s.redAdd(s).redIAdd(s).redIAdd(e.redMul(o)),c=t.redAdd(t),l=(c=c.redIAdd(c)).redMul(i),u=a.redSqr().redISub(l.redAdd(l)),d=l.redISub(u),h=i.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var p=a.redMul(d).redISub(h),f=r.redAdd(r).redMul(n);return this.curve.jpoint(u,p,f)},P.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);
vendor: 11,496 bytes, line 2
2var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),o=e.redAdd(e).redIAdd(e),s=o.redSqr(),i=this.x.redAdd(t).redSqr().redISub(e).redISub(n),a=(i=(i=(i=i.redIAdd(i)).redAdd(i).redIAdd(i)).redISub(s)).redSqr(),c=n.redIAdd(n);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var l=o.redIAdd(i).redSqr().redISub(s).redISub(a).redISub(c),u=t.redMul(l);u=(u=u.redIAdd(u)).redIAdd(u);var d=this.x.redMul(a).redISub(u);d=(d=d.redIAdd(d)).redIAdd(d);var h=this.y.redMul(l.redMul(c.redISub(l)).redISub(i.redMul(a)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var p=this.z.redAdd(i).redSqr().redISub(r).redISub(a);return this.curve.jpoint(d,h,p)},P.prototype.mul=function(e,t){return e=new(o())(e,t),this.curve._wnafMul(this,e)},P.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),o=r.redMul(e.z);return 0===this.y.redMul(o).redISub(e.y.redMul(n)).cmpn(0)},P.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),o=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(o),0===this.x.cmp(r))return!0}},P.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)+">"},P.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var E=a((function(e,t){var r=t;r.base=m,r.short=A,r.mont=null,r.edwards=null})),C=a((function(e,t){var r,n=t,o=d.assert;function s(e){"short"===e.type?this.curve=new E.short(e):"edwards"===e.type?this.curve=new E.edwards(e):this.curve=new E.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new s(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=s,a("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:i().sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("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:i().sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("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:i().sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("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:i().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"]}),a("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:i().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"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i().sha256,gRed:!1,g:["9"]}),a("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:i().sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(e){r=void 0}a("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:i().sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function k(e){if(!(this instanceof k))return new k(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=u.toArray(e.entropy,e.entropyEnc||"hex"),r=u.toArray(e.nonce,e.nonceEnc||"hex"),n=u.toArray(e.pers,e.persEnc||"hex");c(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var _=k;k.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o<this.V.length;o++)this.K[o]=0,this.V[o]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},k.prototype._hmac=function(){return new(i().hmac)(this.hash,this.K)},k.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},k.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=u.toArray(e,t),r=u.toArray(r,n),c(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},k.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=u.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var s=o.slice(0,e);return this._update(r),this._reseed++,u.encode(s,t)};var I=d.assert;function S(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var x=S;S.fromPublic=function(e,t,r){return t instanceof S?t:new S(e,{pub:t,pubEnc:r})},S.fromPrivate=function(e,t,r){return t instanceof S?t:new S(e,{priv:t,privEnc:r})},S.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"}},S.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},S.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},S.prototype._importPrivate=function(e,t){this.priv=new(o())(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},S.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?I(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||I(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},S.prototype.derive=function(e){return e.validate()||I(e.validate(),"public point not validated"),e.mul(this.priv).getX()},S.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},S.prototype.verify=function(e,t,r){return this.ec.verify(e,t,this,void 0,r)},S.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var B=d.assert;function O(e,t){if(e instanceof O)return e;this._importDER(e,t)||(B(e.r&&e.s,"Signature without r or s"),this.r=new(o())(e.r,16),this.s=new(o())(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var M=O;function W(){this.place=0}function j(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;if(0===e[t.place])return!1;for(var o=0,s=0,i=t.place;s<n;s++,i++)o<<=8,o|=e[i],o>>>=0;return!(o<=127)&&(t.place=i,o)}function R(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function N(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}O.prototype._importDER=function(e,t){e=d.toArray(e,t);var r=new W;if(48!==e[r.place++])return!1;var n=j(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var s=j(e,r);if(!1===s)return!1;if(128&e[r.place])return!1;var i=e.slice(r.place,s+r.place);if(r.place+=s,2!==e[r.place++])return!1;var a=j(e,r);if(!1===a)return!1;if(e.length!==a+r.place)return!1;if(128&e[r.place])return!1;var c=e.slice(r.place,a+r.place);if(0===i[0]){if(!(128&i[1]))return!1;i=i.slice(1)}if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}return this.r=new(o())(i),this.s=new(o())(c),this.recoveryParam=null,!0},O.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=R(t),r=
2R(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];N(n,t.length),(n=n.concat(t)).push(2),N(n,r.length);var o=n.concat(r),s=[48];return N(s,o.length),s=s.concat(o),d.encode(s,e)};var U=function(){throw new Error("unsupported")},D=d.assert;function L(e){if(!(this instanceof L))return new L(e);"string"==typeof e&&(D(Object.prototype.hasOwnProperty.call(C,e),"Unknown curve "+e),e=C[e]),e instanceof C.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var F=L;L.prototype.keyPair=function(e){return new x(this,e)},L.prototype.keyFromPrivate=function(e,t){return x.fromPrivate(this,e,t)},L.prototype.keyFromPublic=function(e,t){return x.fromPublic(this,e,t)},L.prototype.genKeyPair=function(e){e||(e={});for(var t=new _({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||U(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new(o())(2));;){var s=new(o())(t.generate(r));if(!(s.cmp(n)>0))return s.iaddn(1),this.keyFromPrivate(s)}},L.prototype._truncateToN=function(e,t,r){var n;if(o().isBN(e)||"number"==typeof e)n=(e=new(o())(e,16)).byteLength();else if("object"==typeof e)n=e.length,e=new(o())(e,16);else{var s=e.toString();n=s.length+1>>>1,e=new(o())(s,16)}"number"!=typeof r&&(r=8*n);var i=r-this.n.bitLength();return i>0&&(e=e.ushrn(i)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},L.prototype.sign=function(e,t,r,n){if("object"==typeof r&&(n=r,r=null),n||(n={}),"string"!=typeof e&&"number"!=typeof e&&!o().isBN(e)){D("object"==typeof e&&e&&"number"==typeof e.length,"Expected message to be an array-like, a hex string, or a BN instance"),D(e.length>>>0===e.length);for(var s=0;s<e.length;s++)D((255&e[s])===e[s])}t=this.keyFromPrivate(t,r),e=this._truncateToN(e,!1,n.msgBitLength),D(!e.isNeg(),"Can not sign a negative message");var i=this.n.byteLength(),a=t.getPrivate().toArray("be",i),c=e.toArray("be",i);D(new(o())(c).eq(e),"Can not sign message");for(var l=new _({hash:this.hash,entropy:a,nonce:c,pers:n.pers,persEnc:n.persEnc||"utf8"}),u=this.n.sub(new(o())(1)),d=0;;d++){var h=n.k?n.k(d):new(o())(l.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(u)>=0)){var p=this.g.mul(h);if(!p.isInfinity()){var f=p.getX(),g=f.umod(this.n);if(0!==g.cmpn(0)){var m=h.invm(this.n).mul(g.mul(t.getPrivate()).iadd(e));if(0!==(m=m.umod(this.n)).cmpn(0)){var y=(p.getY().isOdd()?1:0)|(0!==f.cmp(g)?2:0);return n.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),y^=1),new M({r:g,s:m,recoveryParam:y})}}}}}},L.prototype.verify=function(e,t,r,n,o){o||(o={}),e=this._truncateToN(e,!1,o.msgBitLength),r=this.keyFromPublic(r,n);var s=(t=new M(t,"hex")).r,i=t.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;var a,c=i.invm(this.n),l=c.mul(e).umod(this.n),u=c.mul(s).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(l,r.getPublic(),u)).isInfinity()&&a.eqXToP(s):!(a=this.g.mulAdd(l,r.getPublic(),u)).isInfinity()&&0===a.getX().umod(this.n).cmp(s)},L.prototype.recoverPubKey=function(e,t,r,n){D((3&r)===r,"The recovery param is more than two bits"),t=new M(t,n);var s=this.n,i=new(o())(e),a=t.r,c=t.s,l=1&r,u=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");a=u?this.curve.pointFromX(a.add(this.curve.n),l):this.curve.pointFromX(a,l);var d=t.r.invm(s),h=s.sub(i).mul(d).umod(s),p=c.mul(d).umod(s);return this.g.mulAdd(h,a,p)},L.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new M(t,n)).recoveryParam)return t.recoveryParam;for(var o=0;o<4;o++){var s;try{s=this.recoverPubKey(e,t,o)}catch(e){continue}if(s.eq(r))return o}throw new Error("Unable to find valid recovery factor")};var z=a((function(e,t){var r=t;r.version="6.6.1",r.utils=d,r.rand=function(){throw new Error("unsupported")},r.curve=E,r.curves=C,r.ec=F,r.eddsa=null})).ec,V=r("./node_modules/@ethersproject/bytes/lib.esm/index.js"),q=r("./node_modules/@ethersproject/properties/lib.esm/index.js");const H=new(r("./node_modules/@ethersproject/logger/lib.esm/index.js").Logger)("signing-key/5.8.0");let K=null;function $(){return K||(K=new z("secp256k1")),K}class G{constructor(e){(0,q.defineReadOnly)(this,"curve","secp256k1"),(0,q.defineReadOnly)(this,"privateKey",(0,V.hexlify)(e)),32!==(0,V.hexDataLength)(this.privateKey)&&H.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=$().keyFromPrivate((0,V.arrayify)(this.privateKey));(0,q.defineReadOnly)(this,"publicKey","0x"+t.getPublic(!1,"hex")),(0,q.defineReadOnly)(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),(0,q.defineReadOnly)(this,"_isSigningKey",!0)}_addPoint(e){const t=$().keyFromPublic((0,V.arrayify)(this.publicKey)),r=$().keyFromPublic((0,V.arrayify)(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}
2signDigest(e){const t=$().keyFromPrivate((0,V.arrayify)(this.privateKey)),r=(0,V.arrayify)(e);32!==r.length&&H.throwArgumentError("bad digest length","digest",e);const n=t.sign(r,{canonical:!0});return(0,V.splitSignature)({recoveryParam:n.recoveryParam,r:(0,V.hexZeroPad)("0x"+n.r.toString(16),32),s:(0,V.hexZeroPad)("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const t=$().keyFromPrivate((0,V.arrayify)(this.privateKey)),r=$().keyFromPublic((0,V.arrayify)(J(e)));return(0,V.hexZeroPad)("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function Y(e,t){const r=(0,V.splitSignature)(t),n={r:(0,V.arrayify)(r.r),s:(0,V.arrayify)(r.s)};return"0x"+$().recoverPubKey((0,V.arrayify)(e),n,r.recoveryParam).encode("hex",!1)}function J(e,t){const r=(0,V.arrayify)(e);if(32===r.length){const e=new G(r);return t?"0x"+$().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?(0,V.hexlify)(r):"0x"+$().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+$().keyFromPublic(r).getPublic(!0,"hex"):(0,V.hexlify)(r):H.throwArgumentError("invalid public or private key","key","[REDACTED]")}},"./node_modules/@ethersproject/solidity/lib.esm/index.js"(e,t,r){"use strict";r.r(t),r.d(t,{keccak256:()=>g,pack:()=>f,sha256:()=>m});var n=r("./node_modules/@ethersproject/bignumber/lib.esm/bignumber.js"),o=r("./node_modules/@ethersproject/bytes/lib.esm/index.js"),s=r("./node_modules/@ethersproject/keccak256/lib.esm/index.js"),i=r("./node_modules/@ethersproject/sha2/lib.esm/sha2.js"),a=r("./node_modules/@ethersproject/strings/lib.esm/utf8.js"),c=r("./node_modules/@ethersproject/logger/lib.esm/index.js");const l=new RegExp("^bytes([0-9]+)$"),u=new RegExp("^(u?int)([0-9]*)$"),d=new RegExp("^(.*)\\[([0-9]*)\\]$"),h=new c.Logger("solidity/5.8.0");function p(e,t,r){switch(e){case"address":return r?(0,o.zeroPad)(t,32):(0,o.arrayify)(t);case"string":return(0,a.YW)(t);case"bytes":return(0,o.arrayify)(t);case"bool":return t=t?"0x01":"0x00",r?(0,o.zeroPad)(t,32):(0,o.arrayify)(t)}let s=e.match(u);if(s){let i=parseInt(s[2]||"256");return(s[2]&&String(i)!==s[2]||i%8!=0||0===i||i>256)&&h.throwArgumentError("invalid number type","type",e),r&&(i=256),t=n.gH.from(t).toTwos(i),(0,o.zeroPad)(t,i/8)}if(s=e.match(l),s){const n=parseInt(s[1]);return(String(n)!==s[1]||0===n||n>32)&&h.throwArgumentError("invalid bytes type","type",e),(0,o.arrayify)(t).byteLength!==n&&h.throwArgumentError(`invalid value for ${e}`,"value",t),r?(0,o.arrayify)((t+"0000000000000000000000000000000000000000000000000000000000000000").substring(0,66)):t}if(s=e.match(d),s&&Array.isArray(t)){const r=s[1];parseInt(s[2]||String(t.length))!=t.length&&h.throwArgumentError(`invalid array length for ${e}`,"value",t);const n=[];return t.forEach((function(e){n.push(p(r,e,!0))})),(0,o.concat)(n)}return h.throwArgumentError("invalid type","type",e)}function f(e,t){e.length!=t.length&&h.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);const r=[];return e.forEach((function(e,n){r.push(p(e,t[n]))})),(0,o.hexlify)((0,o.concat)(r))}function g(e,t){return(0,s.keccak256)(f(e,t))}function m(e,t){return(0,i.sc)(f(e,t))}},"./node_modules/@ethersproject/strings/lib.esm/bytes32.js"(e,t,r){"use strict";r.d(t,{R:()=>i,V:()=>a});var n=r("./node_modules/@ethersproject/constants/lib.esm/hashes.js"),o=r("./node_modules/@ethersproject/bytes/lib.esm/index.js"),s=r("./node_modules/@ethersproject/strings/lib.esm/utf8.js");function i(e){const t=(0,s.YW)(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return(0,o.hexlify)((0,o.concat)([t,n.j]).slice(0,32))}function a(e){const t=(0,o.arrayify)(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;0===t[r-1];)r--;return(0,s._v)(t.slice(0,r))}},"./node_modules/@ethersproject/strings/lib.esm/idna.js"(e,t,r){"use strict";r.d(t,{j9:()=>f});var n=r("./node_modules/@ethersproject/strings/lib.esm/utf8.js");function o(e,t){t||(t=function(e){return[parseInt(e,16)]});let r=0,n={};return e.split(",").forEach((e=>{let o=e.split(":");r+=parseInt(o[0],16),n[r]=t(o[1])})),n}function s(e){let t=0;return e.split(",").map((e=>{let r=e.split("-");1===r.length?r[1]="0":""===r[1]&&(r[1]="1");let n=t+parseInt(r[0],16);return t=parseInt(r[1],16),{l:n,h:t}}))}function i(e,t){let r=0;for(let n=0;n<t.length;n++){let o=t[n];if(r+=o.l,e>=r&&e<=r+o.h&&(e-r)%(o.d||1)==0){if(o.e&&-1!==o.e.indexOf(e-r))continue;return o}}return null}const a=s("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,
2115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),c="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((e=>parseInt(e,16))),l=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],u=o("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),d=o("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),h=o("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!=0)throw new Error("bad data");let t=[];for(let r=0;r<e.length;r+=4)t.push(parseInt(e.substring(r,r+4),16));return t})),p=s("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function f(e){if(e.match(/^[a-z0-9-]*$/i)&&e.length<=59)return e.toLowerCase();let t=(0,n.dg)(e);var r;r=t.map((e=>{if(c.indexOf(e)>=0)return[];if(e>=65024&&e<=65039)return[];let t=function(e){let t=i(e,l);if(t)return[e+t.s];let r=u[e];if(r)return r;let n=d[e];return n?[e+n[0]]:h[e]||null}(e);return t||[e]})),t=r.reduce(((e,t)=>(t.forEach((t=>{e.push(t)})),e)),[]),t=(0,n.dg)((0,n.H5)(t),n.dz.NFKC),t.forEach((e=>{if(i(e,p))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),t.forEach((e=>{if(i(e,a))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));let o=(0,n.H5)(t);if("-"===o.substring(0,1)||"--"===o.substring(2,4)||"-"===o.substring(o.length-1))throw new Error("invalid hyphen");return o}},"./node_modules/@ethersproject/strings/lib.esm/index.js"(e,t,r){"use strict";r.r(t),r.d(t,{UnicodeNormalizationForm:()=>s.dz,Utf8ErrorFuncs:()=>s.d5,Utf8ErrorReason:()=>s._E,_toEscapedUtf8String:()=>s.Wj,formatBytes32String:()=>n.R,nameprep:()=>o.j9,parseBytes32String:()=>n.V,toUtf8Bytes:()=>s.YW,toUtf8CodePoints:()=>s.dg,toUtf8String:()=>s._v});var n=r("./node_modules/@ethersproject/strings/lib.esm/bytes32.js"),o=r("./node_modules/@ethersproject/strings/lib.esm/idna.js"),s=r("./node_modules/@ethersproject/strings/lib.esm/utf8.js")},"./node_modules/@ethersproject/strings/lib.esm/utf8.js"(e,t,r){"use strict";r.d(t,{dz:()=>s,d5:()=>c,_E:()=>i,Wj:()=>h,H5:()=>p,YW:()=>u,dg:()=>g,_v:()=>f});var n=r("./node_modules/@ethersproject/bytes/lib.esm/index.js");const o=new(r("./node_modules/@ethersproject/logger/lib.esm/index.js").Logger)("strings/5.8.0");var s,i;function a(e,t,r,n,o){if(e===i.BAD_PREFIX||e===i.UNEXPECTED_CONTINUE){let e=0;
vendor: 1,747 bytes, line 2
2for(let n=t+1;n<r.length&&r[n]>>6==2;n++)e++;return e}return e===i.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(s||(s={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(i||(i={}));const c=Object.freeze({error:function(e,t,r,n,s){return o.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:a,replace:function(e,t,r,n,o){return e===i.OVERLONG?(n.push(o),0):(n.push(65533),a(e,t,r))}});function l(e,t){null==t&&(t=c.error),e=(0,n.arrayify)(e);const r=[];let o=0;for(;o<e.length;){const n=e[o++];if(!(n>>7)){r.push(n);continue}let s=null,a=null;if(192==(224&n))s=1,a=127;else if(224==(240&n))s=2,a=2047;else{if(240!=(248&n)){o+=t(128==(192&n)?i.UNEXPECTED_CONTINUE:i.BAD_PREFIX,o-1,e,r);continue}s=3,a=65535}if(o-1+s>=e.length){o+=t(i.OVERRUN,o-1,e,r);continue}let c=n&(1<<8-s-1)-1;for(let n=0;n<s;n++){let n=e[o];if(128!=(192&n)){o+=t(i.MISSING_CONTINUE,o,e,r),c=null;break}c=c<<6|63&n,o++}null!==c&&(c>1114111?o+=t(i.OUT_OF_RANGE,o-1-s,e,r,c):c>=55296&&c<=57343?o+=t(i.UTF16_SURROGATE,o-1-s,e,r,c):c<=a?o+=t(i.OVERLONG,o-1-s,e,r,c):r.push(c))}return r}function u(e,t=s.current){t!=s.current&&(o.checkNormalize(),e=e.normalize(t));let r=[];for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<128)r.push(n);else if(n<2048)r.push(n>>6|192),r.push(63&n|128);else if(55296==(64512&n)){t++;const o=e.charCodeAt(t);if(t>=e.length||56320!=(64512&o))throw new Error("invalid utf-8 string");const s=65536+((1023&n)<<10)+(1023&o);
2r.push(s>>18|240),r.push(s>>12&63|128),r.push(s>>6&63|128),r.push(63&s|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return(0,n.arrayify)(r)}function d(e){const t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function h(e,t){return'"'+l(e,t).map((e=>{if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?d(e):d(55296+((e-=65536)>>10&1023))+d(56320+(1023&e))})).join("")+'"'}function p(e){return e.map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}function f(e,t){return p(l(e,t))}function g(e,t=s.current){return l(u(e,t))}},"./node_modules/@ethersproject/transactions/lib.esm/index.js"(e,t,r){"use strict";r.r(t),r.d(t,{TransactionTypes:()=>p,accessListify:()=>T,computeAddress:()=>b,parse:()=>I,recoverAddress:()=>w,serialize:()=>k});var n=r("./node_modules/@ethersproject/address/lib.esm/index.js"),o=r("./node_modules/@ethersproject/bignumber/lib.esm/bignumber.js"),s=r("./node_modules/@ethersproject/bytes/lib.esm/index.js"),i=r("./node_modules/@ethersproject/constants/lib.esm/bignumbers.js"),a=r("./node_modules/@ethersproject/keccak256/lib.esm/index.js"),c=r("./node_modules/@ethersproject/properties/lib.esm/index.js"),l=r("./node_modules/@ethersproject/rlp/lib.esm/index.js"),u=r("./node_modules/@ethersproject/signing-key/lib.esm/index.js"),d=r("./node_modules/@ethersproject/logger/lib.esm/index.js");const h=new d.Logger("transactions/5.8.0");var p;function f(e){return"0x"===e?null:(0,n.getAddress)(e)}function g(e){return"0x"===e?i.XK:o.gH.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(p||(p={}));const m=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],y={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function b(e){const t=(0,u.computePublicKey)(e);return(0,n.getAddress)((0,s.hexDataSlice)((0,a.keccak256)((0,s.hexDataSlice)(t,1)),12))}function w(e,t){return b((0,u.recoverPublicKey)((0,s.arrayify)(e),t))}function v(e,t){const r=(0,s.stripZeros)(o.gH.from(e).toHexString());return r.length>32&&h.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function A(e,t){return{address:(0,n.getAddress)(e),storageKeys:(t||[]).map(((t,r)=>(32!==(0,s.hexDataLength)(t)&&h.throwArgumentError("invalid access list storageKey",`accessList[${e}:${r}]`,t),t.toLowerCase())))}}function T(e){if(Array.isArray(e))return e.map(((e,t)=>Array.isArray(e)?(e.length>2&&h.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),A(e[0],e[1])):A(e.address,e.storageKeys)));const t=Object.keys(e).map((t=>{const r=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return A(t,Object.keys(r).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}function P(e){return T(e).map((e=>[e.address,e.storageKeys]))}function E(e,t){if(null!=e.gasPrice){const t=o.gH.from(e.gasPrice),r=o.gH.from(e.maxFeePerGas||0);t.eq(r)||h.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:r})}const r=[v(e.chainId||0,"chainId"),v(e.nonce||0,"nonce"),v(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),v(e.maxFeePerGas||0,"maxFeePerGas"),v(e.gasLimit||0,"gasLimit"),null!=e.to?(0,n.getAddress)(e.to):"0x",v(e.value||0,"value"),e.data||"0x",P(e.accessList||[])];if(t){const e=(0,s.splitSignature)(t);r.push(v(e.recoveryParam,"recoveryParam")),r.push((0,s.stripZeros)(e.r)),r.push((0,s.stripZeros)(e.s))}return(0,s.hexConcat)(["0x02",l.encode(r)])}function C(e,t){const r=[v(e.chainId||0,"chainId"),v(e.nonce||0,"nonce"),v(e.gasPrice||0,"gasPrice"),v(e.gasLimit||0,"gasLimit"),null!=e.to?(0,n.getAddress)(e.to):"0x",v(e.value||0,"value"),e.data||"0x",P(e.accessList||[])];if(t){const e=(0,s.splitSignature)(t);r.push(v(e.recoveryParam,"recoveryParam")),r.push((0,s.stripZeros)(e.r)),r.push((0,s.stripZeros)(e.s))}return(0,s.hexConcat)(["0x01",l.encode(r)])}function k(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&h.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){(0,c.checkProperties)(e,y);const r=[];m.forEach((function(t){let n=e[t.name]||[];const o={};t.numeric&&(o.hexPad="left"),n=(0,s.arrayify)((0,s.hexlify)(n,o)),t.length&&n.length!==t.length&&n.length>0&&h.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=(0,s.stripZeros)(n),n.length>t.maxLength&&h.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n)),r.push((0,s.hexlify)(n))}));let n=0;if(null!=e.chainId?(n=e.chainId,"number"!=typeof n&&h.throwArgumentError("invalid transaction.chainId","transaction",e)):t&&!(0,s.isBytesLike)(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push((0,s.hexlify)(n)),r.push("0x"),r.push("0x")),!t)return l.encode(r);const o=(0,s.splitSignature)(t);let i=27+o.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),i+=2*n+8,o.v>28&&o.v!==i&&h.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):o.v!==i&&h.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push((0,s.hexlify)(i)),r.push((0,s.stripZeros)((0,s.arrayify)(o.r))),r.push((0,s.stripZeros)((0,s.arrayify)(o.s))),l.encode(r)}(e,t);switch(e.type){case 1:return C(e,t);case 2:return E(e,t)}return h.throwError(`unsupported transaction type: ${e.type}`,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function _(e,t,r){try{const r=g(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r}catch(e){h.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=(0,s.hexZeroPad)(t[1],32),e.s=(0,s.hexZeroPad)(t[2],32);try{const t=(0,a.keccak256)(r(e));e.from=w(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){}}function I(e){const t=(0,s.arrayify)(e);if(t[0]>127)return function(e){const t=l.decode(e);9!==t.length&&6!==t.length&&h.throwArgumentError("invalid raw transaction","rawTransaction",e);const r={nonce:g(t[0]).toNumber(),gasPrice:g(t[1]),gasLimit:g(t[2]),to:f(t[3]),value:g(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=o.gH.from(t[6]).toNumber()}catch(e){return r}if(r.r=(0,s.hexZeroPad)(t[7],32),r.s=(0,s.hexZeroPad)(t[8],32),o.gH.from(r.r).isZero()&&o.gH.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const o=t.slice(0,6);0!==r.chainId&&(o.push((0,s.hexlify)(r.chainId)),o.push("0x"),o.push("0x"),n-=2*r.chainId+8);const i=(0,a.keccak256)(l.encode(o));try{r.from=w(i,{r:(0,s.hexlify)(r.r),s:(0,s.hexlify)(r.s),recoveryParam:n})}catch(e){}r.hash=(0,a.keccak256)(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){const t=l.decode(e.slice(1));8!==t.length&&11!==t.length&&h.throwArgumentError("invalid component count for transaction type: 1","payload",(0,s.hexlify)(e));const r={type:1,chainId:g(t[0]).toNumber(),nonce:g(t[1]).toNumber(),gasPrice:g(t[2]),gasLimit:g(t[3]),to:f(t[4]),value:g(t[5]),data:t[6],accessList:T(t[7])};return 8===t.length||(r.hash=(0,a.keccak256)(e),_(r,t.slice(8),C)),r}(t);case 2:return function(e){const t=l.decode(e.slice(1));9!==t.length&&12!==t.length&&h.throwArgumentError("invalid component count for transaction type: 2","payload",(0,s.hexlify)(e));const r=g(t[2]),n=g(t[3]),o={type:2,chainId:g(t[0]).toNumber(),nonce:g(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:g(t[4]),to:f(t[5]),value:g(t[6]),data:t[7],accessList:T(t[8])};return 9===t.length||(o.hash=(0,a.keccak256)(e),_(o,t.slice(9),E)),o}(t)}return h.throwError(`unsupported transaction type: ${t[0]}`,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}},"./node_modules/@ethersproject/units/lib.esm/index.js"(e,t,r){"use strict";r.r(t),r.d(t,{commify:()=>i,formatEther:()=>l,formatUnits:()=>a,parseEther:()=>u,parseUnits:()=>c});var n=r("./node_modules/@ethersproject/bignumber/lib.esm/fixednumber.js");const o=new(r("./node_modules/@ethersproject/logger/lib.esm/index.js").Logger)("units/5.8.0"),s=["wei","kwei","mwei","gwei","szabo","finney","ether"];function i(e){const t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&o.throwArgumentError("invalid value","value",e);let r=t[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");let s="";for(2===t.length&&(s="."+(t[1]||"0"));s.length>2&&"0"===s[s.length-1];)s=s.substring(0,s.length-1);const i=[];for(;r.length;){if(r.length<=3){i.unshift(r);break}{const e=r.length-3;i.unshift(r.substring(e)),r=r.substring(0,e)}}return n+i.join(",")+s}function a(e,t){if("string"==typeof t){const e=s.indexOf(t);-1!==e&&(t=3*e)}return(0,n.gn)(e,null!=t?t:18)}function c(e,t){if("string"!=typeof e&&o.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=s.indexOf(t);-1!==e&&(t=3*e)}return(0,n.gs)(e,null!=t?t:18)}function l(e){return a(e,18)}function u(e){return c(e,18)}},"./node_modules/@ethersproject/wallet/lib.esm/index.js"(e,t,r){"use strict";r.r(t),r.d(t,{Wallet:()=>v,verifyMessage:()=>A,verifyTypedData:()=>T});var n=r("./node_modules/@ethersproject/address/lib.esm/index.js"),o=r("./node_modules/@ethersproject/abstract-provider/lib.esm/index.js"),s=r("./node_modules/@ethersproject/abstract-signer/lib.esm/index.js"),i=r("./node_modules/@ethersproject/bytes/lib.esm/index.js"),a=r("./node_modules/@ethersproject/hash/lib.esm/message.js"),c=r("./node_modules/@ethersproject/hash/lib.esm/typed-data.js"),l=r("./node_modules/@ethersproject/hdnode/lib.esm/index.js"),u=r("./node_modules/@ethersproject/keccak256/lib.esm/index.js"),d=r("./node_modules/@ethersproject/properties/lib.esm/index.js"),h=r("./node_modules/@ethersproject/random/lib.esm/random.js"),p=r("./node_modules/@ethersproject/signing-key/lib.esm/index.js"),f=r("./node_modules/@ethersproject/json-wallets/lib.esm/keystore.js"),g=r("./node_modules/@ethersproject/json-wallets/lib.esm/index.js"),m=r("./node_modules/@ethersproject/transactions/lib.esm/index.js"),y=r("./node_modules/@ethersproject/logger/lib.esm/index.js");var b=function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))};const w=new y.Logger("wallet/5.8.0");class v extends s.l{constructor(e,t){if(super(),null!=(r=e)&&(0,i.isHexString)(r.privateKey,32)&&null!=r.address){const t=new p.SigningKey(e.privateKey);if((0,d.defineReadOnly)(this,"_signingKey",(()=>t)),(0,d.defineReadOnly)(this,"address",(0,m.computeAddress)(this.publicKey)),this.address!==(0,n.getAddress)(e.address)&&w.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){const t=e.mnemonic;return t&&t.phrase}(e)){const t=e.mnemonic;(0,d.defineReadOnly)(this,"_mnemonic",(()=>({phrase:t.phrase,path:t.path||l.defaultPath,locale:t.locale||"en"})));const r=this.mnemonic,n=l.HDNode.fromMnemonic(r.phrase,null,r.locale).derivePath(r.path);(0,m.computeAddress)(n.privateKey)!==this.address&&w.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else(0,d.defineReadOnly)(this,"_mnemonic",(()=>null))}else{if(p.SigningKey.isSigningKey(e))"secp256k1"!==e.curve&&w.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),(0,d.defineReadOnly)(this,"_signingKey",(()=>e));else{"string"==typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);const t=new p.SigningKey(e);(0,d.defineReadOnly)(this,"_signingKey",(()=>t))}(0,d.defineReadOnly)(this,"_mnemonic",(()=>null)),(0,d.defineReadOnly)(this,"address",(0,m.computeAddress)(this.publicKey))}var r;t&&!o.Kq.isProvider(t)&&w.throwArgumentError("invalid provider","provider",t),(0,d.defineReadOnly)(this,"provider",t||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new v(this,e)}signTransaction(e){return(0,d.resolveProperties)(e).then((t=>{null!=t.from&&((0,n.getAddress)(t.from)!==this.address&&w.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete t.from);
2const r=this._signingKey().signDigest((0,u.keccak256)((0,m.serialize)(t)));return(0,m.serialize)(t,r)}))}signMessage(e){return b(this,void 0,void 0,(function*(){return(0,i.joinSignature)(this._signingKey().signDigest((0,a.A)(e)))}))}_signTypedData(e,t,r){return b(this,void 0,void 0,(function*(){const n=yield c.z.resolveNames(e,t,r,(e=>(null==this.provider&&w.throwError("cannot resolve ENS names without a provider",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),this.provider.resolveName(e))));return(0,i.joinSignature)(this._signingKey().signDigest(c.z.hash(n.domain,t,n.value)))}))}encrypt(e,t,r){if("function"!=typeof t||r||(r=t,t={}),r&&"function"!=typeof r)throw new Error("invalid callback");return t||(t={}),(0,f.w)(this,e,t,r)}static createRandom(e){let t=(0,h.p)(16);e||(e={}),e.extraEntropy&&(t=(0,i.arrayify)((0,i.hexDataSlice)((0,u.keccak256)((0,i.concat)([t,e.extraEntropy])),0,16)));const r=(0,l.entropyToMnemonic)(t,e.locale);return v.fromMnemonic(r,e.path,e.locale)}static fromEncryptedJson(e,t,r){return(0,g.decryptJsonWallet)(e,t,r).then((e=>new v(e)))}static fromEncryptedJsonSync(e,t){return new v((0,g.decryptJsonWalletSync)(e,t))}static fromMnemonic(e,t,r){return t||(t=l.defaultPath),new v(l.HDNode.fromMnemonic(e,null,r).derivePath(t))}}function A(e,t){return(0,m.recoverAddress)((0,a.A)(e),t)}function T(e,t,r,n){return(0,m.recoverAddress)(c.z.hash(e,t,r),n)}},"./node_modules/@ethersproject/web/lib.esm/index.js"(e,t,r){"use strict";r.r(t),r.d(t,{_fetchData:()=>f,fetchJson:()=>g,poll:()=>m});var n=r("./node_modules/@ethersproject/base64/lib.esm/base64.js"),o=r("./node_modules/@ethersproject/bytes/lib.esm/index.js"),s=r("./node_modules/@ethersproject/properties/lib.esm/index.js"),i=r("./node_modules/@ethersproject/strings/lib.esm/utf8.js"),a=r("./node_modules/@ethersproject/logger/lib.esm/index.js");var c=function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))};function l(e,t){return c(this,void 0,void 0,(function*(){null==t&&(t={});const r={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0};
2if(!0!==t.skipFetchSetup&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),null!=t.fetchOptions){const e=t.fetchOptions;e.mode&&(r.mode=e.mode),e.cache&&(r.cache=e.cache),e.credentials&&(r.credentials=e.credentials),e.redirect&&(r.redirect=e.redirect),e.referrer&&(r.referrer=e.referrer)}const n=yield fetch(e,r),s=yield n.arrayBuffer(),i={};return n.headers.forEach?n.headers.forEach(((e,t)=>{i[t.toLowerCase()]=e})):n.headers.keys().forEach((e=>{i[e.toLowerCase()]=n.headers.get(e)})),{headers:i,statusCode:n.status,statusMessage:n.statusText,body:(0,o.arrayify)(new Uint8Array(s))}}))}var u=function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))};const d=new a.Logger("web/5.8.0");function h(e){return new Promise((t=>{setTimeout(t,e)}))}function p(e,t){if(null==e)return null;if("string"==typeof e)return e;if((0,o.isBytesLike)(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return(0,i._v)(e)}catch(e){}return(0,o.hexlify)(e)}return e}function f(e,t,r){const o="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;d.assertArgument(o>0&&o%1==0,"invalid connection throttle limit","connection.throttleLimit",o);const c="object"==typeof e?e.throttleCallback:null,f="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;d.assertArgument(f>0&&f%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",f);const g="object"==typeof e&&!!e.errorPassThrough,m={};let y=null;const b={method:"GET"};let w=!1,v=12e4;if("string"==typeof e)y=e;else if("object"==typeof e){if(null!=e&&null!=e.url||d.throwArgumentError("missing URL","connection.url",e),y=e.url,"number"==typeof e.timeout&&e.timeout>0&&(v=e.timeout),e.headers)for(const t in e.headers)m[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(w=!0);if(b.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==y.substring(0,6)&&!0!==e.allowInsecureAuthentication&&d.throwError("basic authentication requires a secure https url",a.Logger.errors.INVALID_ARGUMENT,{argument:"url",url:y,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;m.authorization={key:"Authorization",value:"Basic "+(0,n.l)((0,i.YW)(t))}}null!=e.skipFetchSetup&&(b.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(b.fetchOptions=(0,s.shallowCopy)(e.fetchOptions))}const A=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),T=y?y.match(A):null;if(T)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":T[1]||"text/plain"},body:T[2]?(0,n.D)(T[3]):(P=T[3],(0,i.YW)(P.replace(/%([0-9a-f][0-9a-f])/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))))};let t=e.body;return r&&(t=r(e.body,e)),Promise.resolve(t)}catch(e){d.throwError("processing response error",a.Logger.errors.SERVER_ERROR,{body:p(T[1],T[2]),error:e,requestBody:null,requestMethod:"GET",url:y})}var P;t&&(b.method="POST",b.body=t,null==m["content-type"]&&(m["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==m["content-length"]&&(m["content-length"]={key:"Content-Length",value:String(t.length)}));const E={};Object.keys(m).forEach((e=>{const t=m[e];E[t.key]=t.value})),b.headers=E;const C=function(){let e=null;return{promise:new Promise((function(t,r){v&&(e=setTimeout((()=>{null!=e&&(e=null,r(d.makeError("timeout",a.Logger.errors.TIMEOUT,{requestBody:p(b.body,E["content-type"]),requestMethod:b.method,timeout:v,url:y})))}),v))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),k=function(){return u(this,void 0,void 0,(function*(){for(let e=0;e<o;e++){let t=null;try{if(t=yield l(y,b),e<o)if(301===t.statusCode||302===t.statusCode){const e=t.headers.location||"";if("GET"===b.method&&e.match(/^https:/)){y=t.headers.location;continue}}else if(429===t.statusCode){let r=!0;if(c&&(r=yield c(e,y)),r){let r=0;const n=t.headers["retry-after"];r="string"==typeof n&&n.match(/^[1-9][0-9]*$/)?1e3*parseInt(n):f*parseInt(String(Math.random()*Math.pow(2,e))),yield h(r);continue}}}catch(e){t=e.response,null==t&&(C.cancel(),d.throwError("missing response",a.Logger.errors.SERVER_ERROR,{requestBody:p(b.body,E["content-type"]),requestMethod:b.method,serverError:e,url:y}))}let n=t.body;if(w&&304===t.statusCode?n=null:!g&&(t.statusCode<200||t.statusCode>=300)&&(C.cancel(),d.throwError("bad response",a.Logger.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:p(n,t.headers?t.headers["content-type"]:null),requestBody:p(b.body,E["content-type"]),requestMethod:b.method,url:y})),r)try{const e=yield r(n,t);return C.cancel(),e}catch(r){if(r.throttleRetry&&e<o){let t=!0;if(c&&(t=yield c(e,y)),t){const t=f*parseInt(String(Math.random()*Math.pow(2,e)));yield h(t);continue}}C.cancel(),d.throwError("processing response error",a.Logger.errors.SERVER_ERROR,{body:p(n,t.headers?t.headers["content-type"]:null),error:r,requestBody:p(b.body,E["content-type"]),requestMethod:b.method,url:y})}return C.cancel(),n}return d.throwError("failed response",a.Logger.errors.SERVER_ERROR,{requestBody:p(b.body,E["content-type"]),requestMethod:b.method,url:y})}))}();return Promise.race([C.promise,k])}function g(e,t,r){let n=null;if(null!=t){n=(0,i.YW)(t);const r="string"==typeof e?{url:e}:(0,s.shallowCopy)(e);if(r.headers){0!==Object.keys(r.headers).filter((e=>"content-type"===e.toLowerCase())).length||(r.headers=(0,s.shallowCopy)(r.headers),r.headers["content-type"]="application/json")}else r.headers={"content-type":"application/json"};e=r}return f(e,n,((e,t)=>{let n=null;if(null!=e)try{n=JSON.parse((0,i._v)(e))}catch(t){d.throwError("invalid JSON",a.Logger.errors.SERVER_ERROR,{body:e,error:t})}return r&&(n=r(n,t)),n}))}function m(e,t){return t||(t={}),null==(t=(0,s.shallowCopy)(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise((function(r,n){let o=null,s=!1;const i=()=>!s&&(s=!0,o&&clearTimeout(o),!0);t.timeout&&(o=setTimeout((()=>{i()&&n(new Error("timeout"))}),t.timeout));const a=t.retryLimit;let c=0;!function o(){return e().then((function(e){if(void 0!==e)i()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",o);else if(t.onceBlock)t.onceBlock.once("block",o);
2else if(!s){if(c++,c>a)return void(i()&&n(new Error("retry limit reached")));let e=t.interval*parseInt(String(Math.random()*Math.pow(2,c)));e<t.floor&&(e=t.floor),e>t.ceiling&&(e=t.ceiling),setTimeout(o,e)}return null}),(function(e){i()&&n(e)}))}()}))}},"./node_modules/@ethersproject/wordlists/lib.esm/wordlist.js"(e,t,r){"use strict";r.d(t,{b:()=>a});var n=r("./node_modules/@ethersproject/hash/lib.esm/id.js"),o=r("./node_modules/@ethersproject/properties/lib.esm/index.js"),s=r("./node_modules/@ethersproject/logger/lib.esm/index.js");const i=new s.Logger("wordlists/5.8.0");class a{constructor(e){i.checkAbstract(new.target,a),(0,o.defineReadOnly)(this,"locale",e)}split(e){return e.toLowerCase().split(/ +/g)}join(e){return e.join(" ")}static check(e){const t=[];for(let r=0;r<2048;r++){const n=e.getWord(r);if(r!==e.getWordIndex(n))return"0x";t.push(n)}return(0,n.id)(t.join("\n")+"\n")}static register(e,t){t||(t=e.locale)}}},"./node_modules/@ethersproject/wordlists/lib.esm/wordlists.js"(e,t,r){"use strict";r.d(t,{Y:()=>c});var n=r("./node_modules/@ethersproject/wordlists/lib.esm/wordlist.js");let o=null;function s(e){if(null==o&&(o="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductC
2onfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMu
2seumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThe
2nTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==n.b.check(e)))throw o=null,new Error("BIP39 Wordlist for en (English) FAILED")}class i extends n.b{constructor(){super("en")}getWord(e){return s(this),o[e]}getWordIndex(e){return s(this),o.indexOf(e)}}const a=new i;n.b.register(a);const c={en:a}},"./node_modules/@reown/appkit-universal-connector/node_modules/@walletconnect/logger/dist/index.es.js"(e,t,r){"use strict";r.d(t,{D5:()=>X,U5:()=>Z,iP:()=>J,oI:()=>Q});var n={exports:{}};function o(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}const s=function(e,t,r){var n=r&&r.stringify||o;if("object"==typeof e&&null!==e){var s=t.length+1;if(1===s)return e;var i=new Array(s);i[0]=n(e);for(var a=1;a<s;a++)i[a]=n(t[a]);return i.join(" ")}if("string"!=typeof e)return e;var c=t.length;if(0===c)return e;for(var l="",u=0,d=-1,h=e&&e.length||0,p=0;p<h;){if(37===e.charCodeAt(p)&&p+1<h){switch(d=d>-1?d:0,e.charCodeAt(p+1)){case 100:case 102:if(u>=c||null==t[u])break;d<p&&(l+=e.slice(d,p)),l+=Number(t[u]),d=p+2,p++;break;case 105:if(u>=c||null==t[u])break;d<p&&(l+=e.slice(d,p)),l+=Math.floor(Number(t[u])),d=p+2,p++;break;case 79:case 111:case 106:if(u>=c||void 0===t[u])break;d<p&&(l+=e.slice(d,p));var f=typeof t[u];if("string"===f){l+="'"+t[u]+"'",d=p+2,p++;break}if("function"===f){l+=t[u].name||"<anonymous>",d=p+2,p++;break}l+=n(t[u]),d=p+2,p++;break;case 115:if(u>=c)break;d<p&&(l+=e.slice(d,p)),l+=String(t[u]),d=p+2,p++;break;case 37:d<p&&(l+=e.slice(d,p)),l+="%",d=p+2,p++,u--}++u}++p}return-1===d?e:(d<h&&(l+=e.slice(d)),l)};n.exports=p;const i=function(){function e(e){return typeof e<"u"&&e}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return e(self)||e(window)||e(this)||{}}}().console||{},a={mapHttpRequest:w,mapHttpResponse:w,wrapRequestSerializer:v,wrapResponseSerializer:v,wrapErrorSerializer:v,req:w,res:w,err:y,errWithCause:y};function c(e,t){return"silent"===e?1/0:t.levels.values[e]}const l=Symbol("pino.logFuncs"),u=Symbol("pino.hierarchy"),d={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function h(e,t){const r={logger:t,parent:e[u]};t[u]=r}function p(e){(e=e||{}).browser=e.browser||{};const t=e.browser.transmit;if(t&&"function"!=typeof t.send)throw Error("pino: transmit option must have a send function");const r=e.browser.write||i;e.browser.write&&(e.browser.asObject=!0);const n=e.serializers||{},o=function(e,t){return Array.isArray(e)?e.filter((function(e){return"!stdSerializers.err"!==e})):!0===e&&Object.keys(t)}(e.browser.serialize,n);let s=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(s=!1);const a=Object.keys(e.customLevels||{}),u=["error","fatal","warn","info","debug","trace"].concat(a);"function"==typeof r&&u.forEach((function(e){r[e]=r})),(!1===e.enabled||e.browser.disabled)&&(e.level="silent");const y=e.level||"info",w=Object.create(r);w.log||(w.log=A),function(e,t,r){const n={};t.forEach((e=>{n[e]=r[e]?r[e]:i[e]||i[d[e]||"log"]||A})),e[l]=n}(w,u,r),h({},w),Object.defineProperty(w,"levelVal",{get:function(){return c(this.level,this)}}),Object.defineProperty(w,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,f(this,v,w,"error"),f(this,v,w,"fatal"),f(this,v,w,"w
2arn"),f(this,v,w,"info"),f(this,v,w,"debug"),f(this,v,w,"trace"),a.forEach((e=>{f(this,v,w,e)}))}});const v={transmit:t,serialize:o,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:u,timestamp:b(e),messageKey:e.messageKey||"msg",onChild:e.onChild||A};function T(r,s,i){if(!s)throw new Error("missing bindings for child Pino");i=i||{},o&&s.serializers&&(i.serializers=s.serializers);const a=i.serializers;if(o&&a){var c=Object.assign({},n,a),l=!0===e.browser.serialize?Object.keys(c):o;delete s.serializers,g([s],l,c,this._stdErrSerialize)}function u(e){this._childLevel=1+(0|e._childLevel),this.bindings=s,c&&(this.serializers=c,this._serialize=l),t&&(this._logEvent=m([].concat(e._logEvent.bindings,s)))}u.prototype=this;const d=new u(this);return h(this,d),d.child=function(...e){return T.call(this,r,...e)},d.level=i.level||this.level,r.onChild(d),d}return w.levels=function(e){const t=e.customLevels||{},r=Object.assign({},p.levels.values,t),n=Object.assign({},p.levels.labels,function(e){const t={};return Object.keys(e).forEach((function(r){t[e[r]]=r})),t}(t));return{values:r,labels:n}}(e),w.level=y,w.isLevelEnabled=function(e){return!!this.levels.values[e]&&this.levels.values[e]>=this.levels.values[this.level]},w.setMaxListeners=w.getMaxListeners=w.emit=w.addListener=w.on=w.prependListener=w.once=w.prependOnceListener=w.removeListener=w.removeAllListeners=w.listeners=w.listenerCount=w.eventNames=w.write=w.flush=A,w.serializers=n,w._serialize=o,w._stdErrSerialize=s,w.child=function(...e){return T.call(this,v,...e)},t&&(w._logEvent=m()),w}function f(e,t,r,n){if(Object.defineProperty(e,n,{value:c(e.level,r)>c(n,r)?A:r[l][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===A){if(!t.transmit)return;const o=c(t.transmit.level||e.level,r);if(c(n,r)<o)return}e[n]=function(e,t,r,n){return function(o){return function(){const a=t.timestamp(),l=new Array(arguments.length),u=Object.getPrototypeOf&&Object.getPrototypeOf(this)===i?i:this;for(var d=0;d<l.length;d++)l[d]=arguments[d];var h=!1;if(t.serialize&&(g(l,this._serialize,this.serializers,this._stdErrSerialize),h=!0),t.asObject||t.formatters?o.call(u,...function(e,t,r,n,o){const{level:i,log:a=e=>e}=o.formatters||{},c=r.slice();let l=c[0];const u={};let d=1+(0|e._childLevel);if(d<1&&(d=1),n&&(u.time=n),i){const r=i(t,e.levels.values[t]);Object.assign(u,r)}else u.level=e.levels.values[t];if(o.asObjectBindingsOnly){if(null!==l&&"object"==typeof l)for(;d--&&"object"==typeof c[0];)Object.assign(u,c.shift());return[a(u),...c]}if(null!==l&&"object"==typeof l){for(;d--&&"object"==typeof c[0];)Object.assign(u,c.shift());l=c.length?s(c.shift(),c):void 0}else"string"==typeof l&&(l=s(c.shift(),c));return void 0!==l&&(u[o.messageKey]=l),[a(u)]}(this,n,l,a,t)):o.apply(u,l),t.transmit){const o=t.transmit.level||e._level,s=c(o,r),i=c(n,r);if(i<s)return;!function(e,t,r,n=!1){const o=t.send,s=t.ts,i=t.methodLevel,a=t.methodValue,c=t.val,l=e._logEvent.bindings;n||g(r,e._serialize||Object.keys(e.serializers),e.serializers,void 0===e._stdErrSerialize||e._stdErrSerialize),e._logEvent.ts=s,e._logEvent.messages=r.filter((function(e){return-1===l.indexOf(e)})),e._logEvent.level.label=i,e._logEvent.level.value=a,o(i,e._logEvent,c),e._logEvent=m(l)}(this,{ts:a,methodLevel:n,methodValue:i,transmitLevel:o,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:c(e._level,r)},l,h)}}}(e[l][n])}(e,t,r,n);const o=function(e){const t=[];e.bindings&&t.push(e.bindings);let r=e[u];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}(e);0!==o.length&&(e[n]=function(e,t){return function(){return t.apply(this,[...e,...arguments])}}(o,e[n]))}function g(e,t,r,n){for(const o in e)if(n&&e[o]instanceof Error)e[o]=p.stdSerializers.err(e[o]);else if("object"==typeof e[o]&&!Array.isArray(e[o])&&t)for(const n in e[o])t.indexOf(n)>-1&&n in r&&(e[o][n]=r[n](e[o][n]))}function m(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function y(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const r in e)void 0===t[r]&&(t[r]=e[r]);return t}function b(e){return"function"==typeof e.timestamp?e.timestamp:!1===e.timestamp?T:P}function w(){return{}}function v(e){return e}function A(){}function T(){return!1}function P(){return Date.now()}p.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},p.stdSerializers=a,p.stdTimeFunctions=Object.assign({},{nullTime:T,epochTime:P,unixTime:function(){return Math.round(Date.now()/1e3)},isoTime:function(){return new Date(Date.now()).toISOString()}}),n.exports.default=p;n.exports.pino=p;const E="info",C="custom_context",k=1024e3;var _=Object.defineProperty,I=(e,t,r)=>((e,t,r)=>t in e?_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class S{constructor(e){I(this,"nodeValue"),I(this,"sizeInBytes"),I(this,"next"),this.nodeValue=e,this.sizeInBytes=(new TextEncoder).encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class x{constructor(e){I(this,"lengthInNodes"),I(this,"sizeInBytes"),I(this,"head"),I(this,"tail"),I(this,"maxSizeInBytes"),this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){const t=new S(e);if(t.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${e} with size ${t.size}`);for(;this.size+t.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=t),this.tail=t):(this.head=t,this.tail=t),this.lengthInNodes++,this.sizeInBytes+=t.size}shift(){if(!this.head)return;const e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){const e=[];let t=this.head;for(;null!==t;)e.push(t.value),t=t.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};const t=e.value;return e=e.next,{done:!1,value:t}}}}}function B(e){return"string"==typeof e?e:(e=>JSON.stringify(e,((e,t)=>
2"bigint"==typeof t?t.toString()+"n":t)))(e)||""}var O=Object.defineProperty,M=(e,t,r)=>((e,t,r)=>t in e?O(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class W{constructor(e,t=k){M(this,"logs"),M(this,"level"),M(this,"levelValue"),M(this,"MAX_LOG_SIZE_IN_BYTES"),this.level=e??"error",this.levelValue=n.exports.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=t,this.logs=new x(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,t){t===n.exports.levels.values.error?console.error(e):t===n.exports.levels.values.warn?console.warn(e):t===n.exports.levels.values.debug?console.debug(e):t===n.exports.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(B({timestamp:(new Date).toISOString(),log:e}));const t="string"==typeof e?JSON.parse(e).level:e.level;t>=this.levelValue&&this.forwardToConsole(e,t)}getLogs(){return this.logs}clearLogs(){this.logs=new x(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const t=this.getLogArray();return t.push(B({extraMetadata:e})),new Blob(t,{type:"application/json"})}}var j=Object.defineProperty,R=(e,t,r)=>((e,t,r)=>t in e?j(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class N{constructor(e,t=k){R(this,"baseChunkLogger"),this.baseChunkLogger=new W(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){const t=URL.createObjectURL(this.logsToBlob(e)),r=document.createElement("a");r.href=t,r.download=`walletconnect-logs-${(new Date).toISOString()}.txt`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(t)}}var U=Object.defineProperty,D=(e,t,r)=>((e,t,r)=>t in e?U(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class L{constructor(e,t=k){D(this,"baseChunkLogger"),this.baseChunkLogger=new W(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}}var F=Object.defineProperty,z=Object.defineProperties,V=Object.getOwnPropertyDescriptors,q=Object.getOwnPropertySymbols,H=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable,$=(e,t,r)=>t in e?F(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,G=(e,t)=>{for(var r in t||(t={}))H.call(t,r)&&$(e,r,t[r]);if(q)for(var r of q(t))K.call(t,r)&&$(e,r,t[r]);return e},Y=(e,t)=>z(e,V(t));function J(e){return Y(G({},e),{level:e?.level||E})}function Q(e,t=C){return e[t]||""}function Z(e,t,r=C){const n=function(e,t,r=C){const n=Q(e,r);return n.trim()?`${n}/${t}`:t}(e,t,r);return function(e,t,r=C){return e[r]=t,e}(e.child({context:n}),n,r)}function X(e){var t;if(typeof e.loggerOverride<"u"&&"string"!=typeof e.loggerOverride)return{logger:e.loggerOverride,chunkLoggerController:null};const r=Y(G({},e.opts),{level:"string"==typeof e.loggerOverride?e.loggerOverride:null==(t=e.opts)?void 0:t.level});return typeof window<"u"?function(e){var t,r;const o=new N(null==(t=e.opts)?void 0:t.level,e.maxSizeInBytes);return{logger:n.exports(Y(G({},e.opts),{level:"trace",browser:Y(G({},null==(r=e.opts)?void 0:r.browser),{write:e=>o.write(e)})})),chunkLoggerController:o}}(Y(G({},e),{opts:r})):function(e){var t,r;const o=new L(null==(t=e.opts)?void 0:t.level,e.maxSizeInBytes);return{logger:n.exports(Y(G({},e.opts),{level:"trace",browser:Y(G({},null==(r=e.opts)?void 0:r.browser),{write:e=>o.write(e)})}),o),chunkLoggerController:o}}(Y(G({},e),{opts:r}))}},"./node_modules/@solana-mobile/mobile-wallet-adapter-protocol-web3js/node_modules/base-x/src/index.js"(e){"use strict";e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<e.length;
2n++){var o=e.charAt(n),s=o.charCodeAt(0);if(255!==t[s])throw new TypeError(o+" is ambiguous");t[s]=n}var i=e.length,a=e.charAt(0),c=Math.log(i)/Math.log(256),l=Math.log(256)/Math.log(i);function u(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;for(var r=0,n=0,o=0;e[r]===a;)n++,r++;for(var s=(e.length-r)*c+1>>>0,l=new Uint8Array(s);e[r];){var u=e.charCodeAt(r);if(u>255)return;var d=t[u];if(255===d)return;for(var h=0,p=s-1;(0!==d||h<o)&&-1!==p;p--,h++)d+=i*l[p]>>>0,l[p]=d%256>>>0,d=d/256>>>0;if(0!==d)throw new Error("Non-zero carry");o=h,r++}for(var f=s-o;f!==s&&0===l[f];)f++;for(var g=new Uint8Array(n+(s-f)),m=n;f!==s;)g[m++]=l[f++];return g}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,o=0,s=t.length;o!==s&&0===t[o];)o++,r++;for(var c=(s-o)*l+1>>>0,u=new Uint8Array(c);o!==s;){for(var d=t[o],h=0,p=c-1;(0!==d||h<n)&&-1!==p;p--,h++)d+=256*u[p]>>>0,u[p]=d%i>>>0,d=d/i>>>0;if(0!==d)throw new Error("Non-zero carry");n=h,o++}for(var f=c-n;f!==c&&0===u[f];)f++;for(var g=a.repeat(r);f<c;++f)g+=e.charAt(u[f]);return g},decodeUnsafe:u,decode:function(e){var t=u(e);if(t)return t;throw new Error("Non-base"+i+" character")}}}},"./node_modules/@solana-mobile/mobile-wallet-adapter-protocol-web3js/node_modules/bs58/index.js"(e,t,r){const n=r("./node_modules/@solana-mobile/mobile-wallet-adapter-protocol-web3js/node_modules/base-x/src/index.js");e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},"./node_modules/@solana/web3.js/lib/index.browser.esm.js"(e,t,r){"use strict";r.r(t),r.d(t,{Account:()=>Ae,AddressLookupTableAccount:()=>Mt,AddressLookupTableInstruction:()=>Mn,AddressLookupTableProgram:()=>Wn,Authorized:()=>Hn,BLOCKHASH_CACHE_TIMEOUT_MS:()=>Dt,BPF_LOADER_DEPRECATED_PROGRAM_ID:()=>Te,BPF_LOADER_PROGRAM_ID:()=>Tt,BpfLoader:()=>Pt,COMPUTE_BUDGET_INSTRUCTION_LAYOUTS:()=>Rn,ComputeBudgetInstruction:()=>jn,ComputeBudgetProgram:()=>Nn,Connection:()=>xn,Ed25519Program:()=>Dn,Enum:()=>fe,EpochSchedule:()=>xt,FeeCalculatorLayout:()=>ht,Keypair:()=>Bn,LAMPORTS_PER_SOL:()=>go,LOOKUP_TABLE_INSTRUCTION_LAYOUTS:()=>On,Loader:()=>At,Lockup:()=>Kn,MAX_SEED_LENGTH:()=>ye,Message:()=>Fe,MessageAccountKeys:()=>Se,MessageV0:()=>ze,NONCE_ACCOUNT_LENGTH:()=>ft,NonceAccount:()=>gt,PACKET_DATA_SIZE:()=>Pe,PUBLIC_KEY_LENGTH:()=>be,PublicKey:()=>ve,SIGNATURE_LENGTH_IN_BYTES:()=>Ce,SOLANA_SCHEMA:()=>ge,STAKE_CONFIG_ID:()=>qn,STAKE_INSTRUCTION_LAYOUTS:()=>Gn,SYSTEM_INSTRUCTION_LAYOUTS:()=>bt,SYSVAR_CLOCK_PUBKEY:()=>Je,SYSVAR_EPOCH_SCHEDULE_PUBKEY:()=>Qe,SYSVAR_INSTRUCTIONS_PUBKEY:()=>Ze,SYSVAR_RECENT_BLOCKHASHES_PUBKEY:()=>Xe,SYSVAR_RENT_PUBKEY:()=>et,SYSVAR_REWARDS_PUBKEY:()=>tt,SYSVAR_SLOT_HASHES_PUBKEY:()=>rt,SYSVAR_SLOT_HISTORY_PUBKEY:()=>nt,SYSVAR_STAKE_HISTORY_PUBKEY:()=>ot,Secp256k1Program:()=>zn,SendTransactionError:()=>st,SolanaJSONRPCError:()=>at,SolanaJSONRPCErrorCode:()=>it,StakeAuthorizationLayout:()=>Yn,StakeInstruction:()=>$n,StakeProgram:()=>Jn,Struct:()=>pe,SystemInstruction:()=>yt,SystemProgram:()=>wt,Transaction:()=>$e,TransactionExpiredBlockheightExceededError:()=>ke,TransactionExpiredNonceInvalidError:()=>Ie,TransactionExpiredTimeoutError:()=>_e,TransactionInstruction:()=>Ke,TransactionMessage:()=>Ge,TransactionStatus:()=>qe,VALIDATOR_INFO_KEY:()=>ro,VERSION_PREFIX_MASK:()=>Ee,VOTE_PROGRAM_ID:()=>so,ValidatorInfo:()=>oo,VersionedMessage:()=>Ve,VersionedTransaction:()=>Ye,VoteAccount:()=>ao,VoteAuthorizationLayout:()=>eo,VoteInit:()=>Qn,VoteInstruction:()=>Zn,VoteProgram:()=>to,clusterApiUrl:()=>po,sendAndConfirmRawTransaction:()=>fo,sendAndConfirmTransaction:()=>ct});var n=r("./node_modules/buffer/index.js"),o=r("./node_modules/@noble/curves/esm/ed25519.js"),s=r("./node_modules/bn.js/lib/bn.js"),i=r.n(s),a=r("./node_modules/bs58/index.js"),c=r.n(a);function l(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function u(e,...t){if(!((r=e)instanceof Uint8Array||ArrayBuffer.isView(r)&&"Uint8Array"===r.constructor.name))throw new Error("Uint8Array expected");var r;if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function d(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function h(e,t){u(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function p(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function f(e,t){return e<<32-t|e>>>t}const g=(()=>68===new Uint8Array(new Uint32Array([287454020]).buffer)[0])();function m(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function y(e){for(let t=0;t<e.length;t++)e[t]=m(e[t])}function b(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),u(e),e}class w{clone(){return this._cloneInto()}}function v(e){const t=t=>e().update(b(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function A(e,t,r){return e&t^e&r^t&r}class T extends w{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=p(this.buffer)}update(e){d(this);const{view:t,buffer:r,blockLen:n}=this,o=(e=b(e)).length;for(let s=0;s<o;){const i=Math.min(n-this.pos,o-s);if(i!==n)r.set(e.subarray(s,s+i),this.pos),this.pos+=i,s+=i,this.pos===n&&(this.process(t,0),this.pos=0);else{const t=p(e);for(;n<=o-s;s+=n)this.process(t,s)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){d(this),h(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:n,isLE:o}=this;let{pos:s}=this;t[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>n-s&&(this.process(r,0),s=0);for(let e=s;e<n;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const o=BigInt(32),s=BigInt(4294967295),i=Number(r>>o&s),a=Number(r&s),c=n?4:0,l=n?0:4;e.setUint32(t+c,i,n),e.setUint32(t+l,a,n)}(r,n-8,BigInt(8*this.length),o),this.process(r,0);const i=p(e),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=a/4,l=this.get();if(c>l.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)i.setUint32(4*e,l[e],o)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:o,destroyed:s,pos:i}=this;return e.length=n,e.pos=i,e.finished=o,e.destroyed=s,n%t&&e.buffer.set(r),e}}const P=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,2756
2734187,3204031479,3329325298]),E=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),C=new Uint32Array(64);class k extends T{constructor(){super(64,32,8,!1),this.A=0|E[0],this.B=0|E[1],this.C=0|E[2],this.D=0|E[3],this.E=0|E[4],this.F=0|E[5],this.G=0|E[6],this.H=0|E[7]}get(){const{A:e,B:t,C:r,D:n,E:o,F:s,G:i,H:a}=this;return[e,t,r,n,o,s,i,a]}set(e,t,r,n,o,s,i,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|o,this.F=0|s,this.G=0|i,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)C[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=C[e-15],r=C[e-2],n=f(t,7)^f(t,18)^t>>>3,o=f(r,17)^f(r,19)^r>>>10;C[e]=o+C[e-7]+n+C[e-16]|0}let{A:r,B:n,C:o,D:s,E:i,F:a,G:c,H:l}=this;for(let e=0;e<64;e++){const t=l+(f(i,6)^f(i,11)^f(i,25))+((u=i)&a^~u&c)+P[e]+C[e]|0,d=(f(r,2)^f(r,13)^f(r,22))+A(r,n,o)|0;l=c,c=a,a=i,i=s+t|0,s=o,o=n,n=r,r=t+d|0}var u;r=r+this.A|0,n=n+this.B|0,o=o+this.C|0,s=s+this.D|0,i=i+this.E|0,a=a+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(r,n,o,s,i,a,c,l)}roundClean(){C.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const _=v((()=>new k));var I=r("./node_modules/borsh/lib/index.js"),S=r("./node_modules/@solana/buffer-layout/lib/Layout.js"),x=r("./node_modules/@solana/codecs-numbers/dist/index.browser.mjs"),B=r("./node_modules/superstruct/dist/index.mjs"),O=r("./node_modules/jayson/lib/client/browser/index.js"),M=r.n(O),W=r("./node_modules/rpc-websockets/dist/index.browser.mjs");const j=BigInt(2**32-1),R=BigInt(32);function N(e,t=!1){return t?{h:Number(e&j),l:Number(e>>R&j)}:{h:0|Number(e>>R&j),l:0|Number(e&j)}}function U(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let o=0;o<e.length;o++){const{h:s,l:i}=N(e[o],t);[r[o],n[o]]=[s,i]}return[r,n]}const D=(e,t,r)=>e<<r|t>>>32-r,L=(e,t,r)=>t<<r|e>>>32-r,F=(e,t,r)=>t<<r-32|e>>>64-r,z=(e,t,r)=>e<<r-32|t>>>64-r;const V=[],q=[],H=[],K=BigInt(0),$=BigInt(1),G=BigInt(2),Y=BigInt(7),J=BigInt(256),Q=BigInt(113);for(let e=0,t=$,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],V.push(2*(5*n+r)),q.push((e+1)*(e+2)/2%64);let o=K;for(let e=0;e<7;e++)t=(t<<$^(t>>Y)*Q)%J,t&G&&(o^=$<<($<<BigInt(e))-$);H.push(o)}const[Z,X]=U(H,!0),ee=(e,t,r)=>r>32?F(e,t,r):D(e,t,r),te=(e,t,r)=>r>32?z(e,t,r):L(e,t,r);class re extends w{constructor(e,t,r,n=!1,o=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,l(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");var s;this.state=new Uint8Array(200),this.state32=(s=this.state,new Uint32Array(s.buffer,s.byteOffset,Math.floor(s.byteLength/4)))}keccak(){g||y(this.state32),function(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const n=(t+8)%10,o=(t+2)%10,s=r[o],i=r[o+1],a=ee(s,i,1)^r[n],c=te(s,i,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=c}let t=e[2],o=e[3];for(let r=0;r<24;r++){const n=q[r],s=ee(t,o,n),i=te(t,o,n),a=V[r];t=e[a],o=e[a+1],e[a]=s,e[a+1]=i}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=Z[n],e[1]^=X[n]}r.fill(0)}(this.state32,this.rounds),g||y(this.state32),this.posOut=0,this.pos=0}update(e){d(this);const{blockLen:t,state:r}=this,n=(e=b(e)).length;for(let o=0;o<n;){const s=Math.min(t-this.pos,n-o);for(let t=0;t<s;t++)r[this.pos++]^=e[o++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,128&t&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){d(this,!1),u(e),this.finish();const t=this.state,{blockLen:r}=this;for(let n=0,o=e.length;n<o;){this.posOut>=r&&this.keccak();const s=Math.min(r-this.posOut,o-n);e.set(t.subarray(this.posOut,this.posOut+s),n),this.posOut+=s,n+=s}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return l(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(h(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:n,rounds:o,enableXOF:s}=this;return e||(e=new re(t,r,n,s,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=r,e.outputLen=n,e.enableXOF=s,e.destroyed=this.destroyed,e}}const ne=(e,t,r)=>v((()=>new re(t,e,r))),oe=ne(1,136,32);var se=r("./node_modules/@noble/curves/esm/secp256k1.js");const ie=o.ev.utils.randomPrivateKey,ae=()=>{const e=o.ev.utils.randomPrivateKey(),t=ce(e),r=new Uint8Array(64);return r.set(e),r.set(t,32),{publicKey:t,secretKey:r}},ce=o.ev.getPublicKey;function le(e){try{return o.ev.ExtendedPoint.fromHex(e),!0}catch{return!1}}const ue=(e,t)=>
2o.ev.sign(e,t.slice(0,32)),de=o.ev.verify,he=e=>n.Buffer.isBuffer(e)?e:e instanceof Uint8Array?n.Buffer.from(e.buffer,e.byteOffset,e.byteLength):n.Buffer.from(e);class pe{constructor(e){Object.assign(this,e)}encode(){return n.Buffer.from((0,I.serialize)(ge,this))}static decode(e){return(0,I.deserialize)(ge,this,e)}static decodeUnchecked(e){return(0,I.deserializeUnchecked)(ge,this,e)}}class fe extends pe{constructor(e){if(super(e),this.enum="",1!==Object.keys(e).length)throw new Error("Enum can only take single value");Object.keys(e).map((e=>{this.enum=e}))}}const ge=new Map;var me;const ye=32,be=32;let we=1;class ve extends pe{constructor(e){if(super({}),this._bn=void 0,function(e){return void 0!==e._bn}(e))this._bn=e._bn;else{if("string"==typeof e){const t=c().decode(e);if(t.length!=be)throw new Error("Invalid public key input");this._bn=new(i())(t)}else this._bn=new(i())(e);if(this._bn.byteLength()>be)throw new Error("Invalid public key input")}}static unique(){const e=new ve(we);return we+=1,new ve(e.toBuffer())}equals(e){return this._bn.eq(e._bn)}toBase58(){return c().encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){const e=this.toBuffer();return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}toBuffer(){const e=this._bn.toArrayLike(n.Buffer);if(e.length===be)return e;const t=n.Buffer.alloc(32);return e.copy(t,32-e.length),t}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(e,t,r){const o=n.Buffer.concat([e.toBuffer(),n.Buffer.from(t),r.toBuffer()]),s=_(o);return new ve(s)}static createProgramAddressSync(e,t){let r=n.Buffer.alloc(0);e.forEach((function(e){if(e.length>ye)throw new TypeError("Max seed length exceeded");r=n.Buffer.concat([r,he(e)])})),r=n.Buffer.concat([r,t.toBuffer(),n.Buffer.from("ProgramDerivedAddress")]);const o=_(r);if(le(o))throw new Error("Invalid seeds, address must fall off the curve");return new ve(o)}static async createProgramAddress(e,t){return this.createProgramAddressSync(e,t)}static findProgramAddressSync(e,t){let r,o=255;for(;0!=o;){try{const s=e.concat(n.Buffer.from([o]));r=this.createProgramAddressSync(s,t)}catch(e){if(e instanceof TypeError)throw e;o--;continue}return[r,o]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(e,t){return this.findProgramAddressSync(e,t)}static isOnCurve(e){return le(new ve(e).toBytes())}}me=ve,ve.default=new me("11111111111111111111111111111111"),ge.set(ve,{kind:"struct",fields:[["_bn","u256"]]});class Ae{constructor(e){if(this._publicKey=void 0,this._secretKey=void 0,e){const t=he(e);if(64!==e.length)throw new Error("bad secret key size");this._publicKey=t.slice(32,64),this._secretKey=t.slice(0,32)}else this._secretKey=he(ie()),this._publicKey=he(ce(this._secretKey))}get publicKey(){return new ve(this._publicKey)}get secretKey(){return n.Buffer.concat([this._secretKey,this._publicKey],64)}}const Te=new ve("BPFLoader1111111111111111111111111111111111"),Pe=1232,Ee=127,Ce=64;class ke extends Error{constructor(e){super(`Signature ${e} has expired: block height exceeded.`),this.signature=void 0,this.signature=e}}Object.defineProperty(ke.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});class _e extends Error{constructor(e,t){super(`Transaction was not confirmed in ${t.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${e} using the Solana Explorer or CLI tools.`),this.signature=void 0,this.signature=e}}Object.defineProperty(_e.prototype,"name",{value:"TransactionExpiredTimeoutError"});class Ie extends Error{constructor(e){super(`Signature ${e} has expired: the nonce is no longer valid.`),this.signature=void 0,this.signature=e}}Object.defineProperty(Ie.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});class Se{constructor(e,t){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=e,this.accountKeysFromLookups=t}keySegments(){const e=[this.staticAccountKeys];return this.accountKeysFromLookups&&(e.push(this.accountKeysFromLookups.writable),e.push(this.accountKeysFromLookups.readonly)),e}get(e){for(const t of this.keySegments()){if(e<t.length)return t[e];e-=t.length}}get length(){return this.keySegments().flat().length}compileInstructions(e){if(this.length>256)throw new Error("Account index overflow encountered during compilation");const t=new Map;
2this.keySegments().flat().forEach(((e,r)=>{t.set(e.toBase58(),r)}));const r=e=>{const r=t.get(e.toBase58());if(void 0===r)throw new Error("Encountered an unknown instruction account key during compilation");return r};return e.map((e=>({programIdIndex:r(e.programId),accountKeyIndexes:e.keys.map((e=>r(e.pubkey))),data:e.data})))}}const xe=(e="publicKey")=>S.av(32,e),Be=(e="signature")=>S.av(64,e),Oe=(e="string")=>{const t=S.w3([S.DH("length"),S.DH("lengthPadding"),S.av(S.cY(S.DH(),-8),"chars")],e),r=t.decode.bind(t),o=t.encode.bind(t),s=t;return s.decode=(e,t)=>r(e,t).chars.toString(),s.encode=(e,t,r)=>{const s={chars:n.Buffer.from(e,"utf8")};return o(s,t,r)},s.alloc=e=>S.DH().span+S.DH().span+n.Buffer.from(e,"utf8").length,s};function Me(e,t){const r=e=>{if(e.span>=0)return e.span;if("function"==typeof e.alloc)return e.alloc(t[e.property]);if("count"in e&&"elementLayout"in e){const n=t[e.property];if(Array.isArray(n))return n.length*r(e.elementLayout)}else if("fields"in e)return Me({layout:e},t[e.property]);return 0};let n=0;return e.layout.fields.forEach((e=>{n+=r(e)})),n}function We(e){let t=0,r=0;for(;;){let n=e.shift();if(t|=(127&n)<<7*r,r+=1,!(128&n))break}return t}function je(e,t){let r=t;for(;;){let t=127&r;if(r>>=7,0==r){e.push(t);break}t|=128,e.push(t)}}function Re(e,t){if(!e)throw new Error(t||"Assertion failed")}class Ne{constructor(e,t){this.payer=void 0,this.keyMetaMap=void 0,this.payer=e,this.keyMetaMap=t}static compile(e,t){const r=new Map,n=e=>{const t=e.toBase58();let n=r.get(t);return void 0===n&&(n={isSigner:!1,isWritable:!1,isInvoked:!1},r.set(t,n)),n},o=n(t);o.isSigner=!0,o.isWritable=!0;for(const t of e){n(t.programId).isInvoked=!0;for(const e of t.keys){const t=n(e.pubkey);t.isSigner||=e.isSigner,t.isWritable||=e.isWritable}}return new Ne(t,r)}getMessageComponents(){const e=[...this.keyMetaMap.entries()];Re(e.length<=256,"Max static account keys length exceeded");const t=e.filter((([,e])=>e.isSigner&&e.isWritable)),r=e.filter((([,e])=>e.isSigner&&!e.isWritable)),n=e.filter((([,e])=>!e.isSigner&&e.isWritable)),o=e.filter((([,e])=>!e.isSigner&&!e.isWritable)),s={numRequiredSignatures:t.length+r.length,numReadonlySignedAccounts:r.length,numReadonlyUnsignedAccounts:o.length};{Re(t.length>0,"Expected at least one writable signer key");const[e]=t[0];Re(e===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}return[s,[...t.map((([e])=>new ve(e))),...r.map((([e])=>new ve(e))),...n.map((([e])=>new ve(e))),...o.map((([e])=>new ve(e)))]]}extractTableLookup(e){const[t,r]=this.drainKeysFoundInLookupTable(e.state.addresses,(e=>!e.isSigner&&!e.isInvoked&&e.isWritable)),[n,o]=this.drainKeysFoundInLookupTable(e.state.addresses,(e=>!e.isSigner&&!e.isInvoked&&!e.isWritable));if(0!==t.length||0!==n.length)return[{accountKey:e.key,writableIndexes:t,readonlyIndexes:n},{writable:r,readonly:o}]}drainKeysFoundInLookupTable(e,t){const r=new Array,n=new Array;for(const[o,s]of this.keyMetaMap.entries())if(t(s)){const t=new ve(o),s=e.findIndex((e=>e.equals(t)));s>=0&&(Re(s<256,"Max lookup table index exceeded"),r.push(s),n.push(t),this.keyMetaMap.delete(o))}return[r,n]}}const Ue="Reached end of buffer unexpectedly";function De(e){if(0===e.length)throw new Error(Ue);return e.shift()}function Le(e,...t){const[r]=t;if(2===t.length?r+(t[1]??0)>e.length:r>=e.length)throw new Error(Ue);return e.splice(...t)}class Fe{constructor(e){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=e.header,this.accountKeys=e.accountKeys.map((e=>new ve(e))),this.recentBlockhash=e.recentBlockhash,this.instructions=e.instructions,this.instructions.forEach((e=>this.indexToProgramIds.set(e.programIdIndex,this.accountKeys[e.programIdIndex])))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map((e=>({programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:c().decode(e.data)})))}get addressTableLookups(){return[]}getAccountKeys(){return new Se(this.staticAccountKeys)}static compile(e){const t=Ne.compile(e.instructions,e.payerKey),[r,n]=t.getMe
2ssageComponents(),o=new Se(n).compileInstructions(e.instructions).map((e=>({programIdIndex:e.programIdIndex,accounts:e.accountKeyIndexes,data:c().encode(e.data)})));return new Fe({header:r,accountKeys:n,recentBlockhash:e.recentBlockhash,instructions:o})}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){const t=this.header.numRequiredSignatures;if(e>=this.header.numRequiredSignatures){return e-t<this.accountKeys.length-t-this.header.numReadonlyUnsignedAccounts}return e<t-this.header.numReadonlySignedAccounts}isProgramId(e){return this.indexToProgramIds.has(e)}programIds(){return[...this.indexToProgramIds.values()]}nonProgramIds(){return this.accountKeys.filter(((e,t)=>!this.isProgramId(t)))}serialize(){const e=this.accountKeys.length;let t=[];je(t,e);const r=this.instructions.map((e=>{const{accounts:t,programIdIndex:r}=e,o=Array.from(c().decode(e.data));let s=[];je(s,t.length);let i=[];return je(i,o.length),{programIdIndex:r,keyIndicesCount:n.Buffer.from(s),keyIndices:t,dataLength:n.Buffer.from(i),data:o}}));let o=[];je(o,r.length);let s=n.Buffer.alloc(Pe);n.Buffer.from(o).copy(s);let i=o.length;r.forEach((e=>{const t=S.w3([S.u8("programIdIndex"),S.av(e.keyIndicesCount.length,"keyIndicesCount"),S.O6(S.u8("keyIndex"),e.keyIndices.length,"keyIndices"),S.av(e.dataLength.length,"dataLength"),S.O6(S.u8("userdatum"),e.data.length,"data")]).encode(e,s,i);i+=t})),s=s.slice(0,i);const a=S.w3([S.av(1,"numRequiredSignatures"),S.av(1,"numReadonlySignedAccounts"),S.av(1,"numReadonlyUnsignedAccounts"),S.av(t.length,"keyCount"),S.O6(xe("key"),e,"keys"),xe("recentBlockhash")]),l={numRequiredSignatures:n.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:n.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:n.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:n.Buffer.from(t),keys:this.accountKeys.map((e=>he(e.toBytes()))),recentBlockhash:c().decode(this.recentBlockhash)};let u=n.Buffer.alloc(2048);const d=a.encode(l,u);return s.copy(u,d),u.slice(0,d+s.length)}static from(e){let t=[...e];const r=De(t);if(r!==(r&Ee))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");const o=De(t),s=De(t),i=We(t);let a=[];for(let e=0;e<i;e++){const e=Le(t,0,be);a.push(new ve(n.Buffer.from(e)))}const l=Le(t,0,be),u=We(t);let d=[];for(let e=0;e<u;e++){const e=De(t),r=Le(t,0,We(t)),o=Le(t,0,We(t)),s=c().encode(n.Buffer.from(o));d.push({programIdIndex:e,accounts:r,data:s})}const h={header:{numRequiredSignatures:r,numReadonlySignedAccounts:o,numReadonlyUnsignedAccounts:s},recentBlockhash:c().encode(n.Buffer.from(l)),accountKeys:a,instructions:d};return new Fe(h)}}class ze{constructor(e){this.header=void 0,this.staticAccountKeys=void 0,this.recentBlockhash=void 0,this.compiledInstructions=void 0,this.addressTableLookups=void 0,this.header=e.header,this.staticAccountKeys=e.staticAccountKeys,this.recentBlockhash=e.recentBlockhash,this.compiledInstructions=e.compiledInstructions,this.addressTableLookups=e.addressTableLookups}get version(){return 0}get numAccountKeysFromLookups(){let e=0;for(const t of this.addressTableLookups)e+=t.readonlyIndexes.length+t.writableIndexes.length;return e}getAccountKeys(e){let t;if(e&&"accountKeysFromLookups"in e&&e.accountKeysFromLookups){if(this.numAccountKeysFromLookups!=e.accountKeysFromLookups.writable.length+e.accountKeysFromLookups.readonly.length)throw new Error("Failed to get account keys because of a mismatch in the number of account keys from lookups");t=e.accountKeysFromLookups}else if(e&&"addressLookupTableAccounts"in e&&e.addressLookupTableAccounts)t=this.resolveAddressTableLookups(e.addressLookupTableAccounts);else if(this.addressTableLookups.length>0)throw new Error("Failed to get account keys because address table lookups were not resolved");return new Se(this.staticAccountKeys,t)}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){const t=this.header.numRequiredSignatures,r=this.staticAccountKeys.length;if(e>=r){return e-r<this.addressTableLookups.reduce(((e,t)=>e+t.writableIndexes.length),0)}if(e>=this.header.numRequiredSignatures){return e-t<r-t-this.header.numReadonlyUnsignedAccounts}return e<t-this.header.numReadonlySignedAccounts}resolveAddressTableLookups(e){const t={writable:[],readonly:[]};for(const r of this.addressTableLookups){const n=e.find((e=>e.key.equals(r.accountKey)));if(!n)throw new Error(`Failed to find address lookup table account for table key ${r.accountKey.toBase58()}`);for(const e of r.writableIndexes){if(!(e<n.state.addresses.length))throw new Error(`Failed to find address for index ${e} in address lookup table ${r.accountKey.toBase58()}`);t.writable.push(n.state.addresses[e])}for(const e of r.readonlyIndexes){if(!(e<n.state.addresses.length))throw new Error(`Failed to find address for index ${e} in address lookup table ${r.accountKey.toBase58()}`);t.readonly.push(n.state.addresses[e])}}return t}static compile(e){const t=Ne.compile(e.instructions,e.payerKey),r=new Array,n={writable:new Array,readonly:new Array},o=e.addressLookupTableAccounts||[];for(const e of o){const o=t.extractTableLookup(e);if(void 0!==o){const[e,{writable:t,readonly:s}]=o;
2r.push(e),n.writable.push(...t),n.readonly.push(...s)}}const[s,i]=t.getMessageComponents(),a=new Se(i,n).compileInstructions(e.instructions);return new ze({header:s,staticAccountKeys:i,recentBlockhash:e.recentBlockhash,compiledInstructions:a,addressTableLookups:r})}serialize(){const e=Array();je(e,this.staticAccountKeys.length);const t=this.serializeInstructions(),r=Array();je(r,this.compiledInstructions.length);const n=this.serializeAddressTableLookups(),o=Array();je(o,this.addressTableLookups.length);const s=S.w3([S.u8("prefix"),S.w3([S.u8("numRequiredSignatures"),S.u8("numReadonlySignedAccounts"),S.u8("numReadonlyUnsignedAccounts")],"header"),S.av(e.length,"staticAccountKeysLength"),S.O6(xe(),this.staticAccountKeys.length,"staticAccountKeys"),xe("recentBlockhash"),S.av(r.length,"instructionsLength"),S.av(t.length,"serializedInstructions"),S.av(o.length,"addressTableLookupsLength"),S.av(n.length,"serializedAddressTableLookups")]),i=new Uint8Array(Pe),a=s.encode({prefix:128,header:this.header,staticAccountKeysLength:new Uint8Array(e),staticAccountKeys:this.staticAccountKeys.map((e=>e.toBytes())),recentBlockhash:c().decode(this.recentBlockhash),instructionsLength:new Uint8Array(r),serializedInstructions:t,addressTableLookupsLength:new Uint8Array(o),serializedAddressTableLookups:n},i);return i.slice(0,a)}serializeInstructions(){let e=0;const t=new Uint8Array(Pe);for(const r of this.compiledInstructions){const n=Array();je(n,r.accountKeyIndexes.length);const o=Array();je(o,r.data.length);e+=S.w3([S.u8("programIdIndex"),S.av(n.length,"encodedAccountKeyIndexesLength"),S.O6(S.u8(),r.accountKeyIndexes.length,"accountKeyIndexes"),S.av(o.length,"encodedDataLength"),S.av(r.data.length,"data")]).encode({programIdIndex:r.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(n),accountKeyIndexes:r.accountKeyIndexes,encodedDataLength:new Uint8Array(o),data:r.data},t,e)}return t.slice(0,e)}serializeAddressTableLookups(){let e=0;const t=new Uint8Array(Pe);for(const r of this.addressTableLookups){const n=Array();je(n,r.writableIndexes.length);const o=Array();je(o,r.readonlyIndexes.length);e+=S.w3([xe("accountKey"),S.av(n.length,"encodedWritableIndexesLength"),S.O6(S.u8(),r.writableIndexes.length,"writableIndexes"),S.av(o.length,"encodedReadonlyIndexesLength"),S.O6(S.u8(),r.readonlyIndexes.length,"readonlyIndexes")]).encode({accountKey:r.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(n),writableIndexes:r.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(o),readonlyIndexes:r.readonlyIndexes},t,e)}return t.slice(0,e)}static deserialize(e){let t=[...e];const r=De(t),n=r&Ee;Re(r!==n,"Expected versioned message but received legacy message");Re(0===n,`Expected versioned message with version 0 but found version ${n}`);const o={numRequiredSignatures:De(t),numReadonlySignedAccounts:De(t),numReadonlyUnsignedAccounts:De(t)},s=[],i=We(t);for(let e=0;e<i;e++)s.push(new ve(Le(t,0,be)));const a=c().encode(Le(t,0,be)),l=We(t),u=[];for(let e=0;e<l;e++){const e=De(t),r=Le(t,0,We(t)),n=We(t),o=new Uint8Array(Le(t,0,n));u.push({programIdIndex:e,accountKeyIndexes:r,data:o})}const d=We(t),h=[];for(let e=0;e<d;e++){const e=new ve(Le(t,0,be)),r=Le(t,0,We(t)),n=Le(t,0,We(t));h.push({accountKey:e,writableIndexes:r,readonlyIndexes:n})}return new ze({header:o,staticAccountKeys:s,recentBlockhash:a,compiledInstructions:u,addressTableLookups:h})}}const Ve={deserializeMessageVersion(e){const t=e[0],r=t&Ee;return r===t?"legacy":r},deserialize:e=>{const t=Ve.deserializeMessageVersion(e);if("legacy"===t)return Fe.from(e);if(0===t)return ze.deserialize(e);throw new Error(`Transaction message version ${t} deserialization is not supported`)}};let qe=function(e){return e[e.BLOCKHEIGHT_EXCEEDED=0]="BLOCKHEIGHT_EXCEEDED",e[e.PROCESSED=1]="PROCESSED",e[e.TIMED_OUT=2]="TIMED_OUT",e[e.NONCE_INVALID=3]="NONCE_INVALID",e}({});const He=n.Buffer.alloc(Ce).fill(0);class Ke{constructor(e){this.keys=void 0,this.programId=void 0,this.data=n.Buffer.alloc(0),this.programId=e.programId,this.keys=e.keys,e.data&&(this.data=e.data)}toJSON(){return{keys:this.keys.map((({pubkey:e,isSigner:t,isWritable:r})=>({pubkey:e.toJSON(),isSigner:t,isWritable:r}))),programId:this.programId.toJSON(),data:[...this.data]}}}class $e{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(e){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,e)if(e.feePayer&&(this.feePayer=e.feePayer),e.signatures&&(this.signatures=e.signatures),Object.prototype.hasOwnProperty.call(e,"nonceInfo")){const{minContextSlot:t,nonceInfo:r}=e;this.minNonceContextSlot=t,this.nonceInfo=r}else if(Object.prototype.hasOwnProperty.call(e,"lastValidBlockHeight")){const{blockhash:t,lastValidBlockHeight:r}=e;this.recentBlockhash=t,this.lastValidBlockHeight=r}else{const{recentBlockhash:t,nonceInfo:r}=e;r&&(this.nonceInfo=r),this.recentBlockhash=t}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstru
2ction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map((e=>e.toJSON())),signers:this.signatures.map((({publicKey:e})=>e.toJSON()))}}add(...e){if(0===e.length)throw new Error("No instructions");return e.forEach((e=>{"instructions"in e?this.instructions=this.instructions.concat(e.instructions):"data"in e&&"programId"in e&&"keys"in e?this.instructions.push(e):this.instructions.push(new Ke(e))})),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let e,t,r;if(this.nonceInfo?(e=this.nonceInfo.nonce,t=this.instructions[0]!=this.nonceInfo.nonceInstruction?[this.nonceInfo.nonceInstruction,...this.instructions]:this.instructions):(e=this.recentBlockhash,t=this.instructions),!e)throw new Error("Transaction recentBlockhash required");if(t.length<1&&console.warn("No instructions provided"),this.feePayer)r=this.feePayer;else{if(!(this.signatures.length>0&&this.signatures[0].publicKey))throw new Error("Transaction fee payer required");r=this.signatures[0].publicKey}for(let e=0;e<t.length;e++)if(void 0===t[e].programId)throw new Error(`Transaction instruction index ${e} has undefined program id`);const n=[],o=[];t.forEach((e=>{e.keys.forEach((e=>{o.push({...e})}));const t=e.programId.toString();n.includes(t)||n.push(t)})),n.forEach((e=>{o.push({pubkey:new ve(e),isSigner:!1,isWritable:!1})}
2));const s=[];o.forEach((e=>{const t=e.pubkey.toString(),r=s.findIndex((e=>e.pubkey.toString()===t));r>-1?(s[r].isWritable=s[r].isWritable||e.isWritable,s[r].isSigner=s[r].isSigner||e.isSigner):s.push(e)})),s.sort((function(e,t){if(e.isSigner!==t.isSigner)return e.isSigner?-1:1;if(e.isWritable!==t.isWritable)return e.isWritable?-1:1;return e.pubkey.toBase58().localeCompare(t.pubkey.toBase58(),"en",{localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"})}));const i=s.findIndex((e=>e.pubkey.equals(r)));if(i>-1){const[e]=s.splice(i,1);e.isSigner=!0,e.isWritable=!0,s.unshift(e)}else s.unshift({pubkey:r,isSigner:!0,isWritable:!0});for(const e of this.signatures){const t=s.findIndex((t=>t.pubkey.equals(e.publicKey)));if(!(t>-1))throw new Error(`unknown signer: ${e.publicKey.toString()}`);s[t].isSigner||(s[t].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."))}let a=0,l=0,u=0;const d=[],h=[];s.forEach((({pubkey:e,isSigner:t,isWritable:r})=>{t?(d.push(e.toString()),a+=1,r||(l+=1)):(h.push(e.toString()),r||(u+=1))}));const p=d.concat(h),f=t.map((e=>{const{data:t,programId:r}=e;return{programIdIndex:p.indexOf(r.toString()),accounts:e.keys.map((e=>p.indexOf(e.pubkey.toString()))),data:c().encode(t)}}));return f.forEach((e=>{Re(e.programIdIndex>=0),e.accounts.forEach((e=>Re(e>=0)))})),new Fe({header:{numRequiredSignatures:a,numReadonlySignedAccounts:l,numReadonlyUnsignedAccounts:u},accountKeys:p,recentBlockhash:e,instructions:f})}_compile(){const e=this.compileMessage(),t=e.accountKeys.slice(0,e.header.numRequiredSignatures);if(this.signatures.length===t.length){if(this.signatures.every(((e,r)=>t[r].equals(e.publicKey))))return e}return this.signatures=t.map((e=>({signature:null,publicKey:e}))),e}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(e){return(await e.getFeeForMessage(this.compileMessage())).value}setSigners(...e){if(0===e.length)throw new Error("No signers");const t=new Set;this.signatures=e.filter((e=>{const r=e.toString();return!t.has(r)&&(t.add(r),!0)})).map((e=>({signature:null,publicKey:e})))}sign(...e){if(0===e.length)throw new Error("No signers");const t=new Set,r=[];for(const n of e){const e=n.publicKey.toString();t.has(e)||(t.add(e),r.push(n))}this.signatures=r.map((e=>({signature:null,publicKey:e.publicKey})));const n=this._compile();this._partialSign(n,...r)}partialSign(...e){if(0===e.length)throw new Error("No signers");const t=new Set,r=[];for(const n of e){const e=n.publicKey.toString();t.has(e)||(t.add(e),r.push(n))}const n=this._compile();this._partialSign(n,...r)}_partialSign(e,...t){const r=e.serialize();t.forEach((e=>{const t=ue(r,e.secretKey);this._addSignature(e.publicKey,he(t))}))}addSignature(e,t){this._compile(),this._addSignature(e,t)}_addSignature(e,t){Re(64===t.length);const r=this.signatures.findIndex((t=>e.equals(t.publicKey)));if(r<0)throw new Error(`unknown signer: ${e.toString()}`);this.signatures[r].signature=n.Buffer.from(t)}verifySignatures(e=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),e)}_getMessageSignednessErrors(e,t){const r={};for(const{signature:n,publicKey:o}of this.signatures)null===n?t&&(r.missing||=[]).push(o):de(n,e,o.toBytes())||(r.invalid||=[]).push(o);return r.invalid||r.missing?r:void 0}serialize(e){const{requireAllSignatures:t,verifySignatures:r}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},e),n=this.serializeMessage();if(r){const e=this._getMessageSignednessErrors(n,t);if(e){let t="Signature verification failed.";throw e.invalid&&(t+=`\nInvalid signature for public key${1===e.invalid.length?"":"(s)"} [\`${e.invalid.map((e=>e.toBase58())).join("`, `")}\`].`),e.missing&&(t+=`\nMissing signature for public key${1===e.missing.length?"":"(s)"} [\`${e.missing.map((e=>e.toBase58())).join("`, `")}\`].`),new Error(t)}}return this._serialize(n)}_serialize(e){const{signatures:t}=this,r=[];je(r,t.length);const o=r.length+64*t.length+e.length,s=n.Buffer.alloc(o);return Re(t.length<256),n.Buffer.from(r).copy(s,0),t.forEach((({signature:e},t)=>
2{null!==e&&(Re(64===e.length,"signature has invalid length"),n.Buffer.from(e).copy(s,r.length+64*t))})),e.copy(s,r.length+64*t.length),Re(s.length<=Pe,`Transaction too large: ${s.length} > ${Pe}`),s}get keys(){return Re(1===this.instructions.length),this.instructions[0].keys.map((e=>e.pubkey))}get programId(){return Re(1===this.instructions.length),this.instructions[0].programId}get data(){return Re(1===this.instructions.length),this.instructions[0].data}static from(e){let t=[...e];const r=We(t);let o=[];for(let e=0;e<r;e++){const e=Le(t,0,Ce);o.push(c().encode(n.Buffer.from(e)))}return $e.populate(Fe.from(t),o)}static populate(e,t=[]){const r=new $e;return r.recentBlockhash=e.recentBlockhash,e.header.numRequiredSignatures>0&&(r.feePayer=e.accountKeys[0]),t.forEach(((t,n)=>{const o={signature:t==c().encode(He)?null:c().decode(t),publicKey:e.accountKeys[n]};r.signatures.push(o)})),e.instructions.forEach((t=>{const n=t.accounts.map((t=>{const n=e.accountKeys[t];return{pubkey:n,isSigner:r.signatures.some((e=>e.publicKey.toString()===n.toString()))||e.isAccountSigner(t),isWritable:e.isAccountWritable(t)}}));r.instructions.push(new Ke({keys:n,programId:e.accountKeys[t.programIdIndex],data:c().decode(t.data)}))})),r._message=e,r._json=r.toJSON(),r}}class Ge{constructor(e){this.payerKey=void 0,this.instructions=void 0,this.recentBlockhash=void 0,this.payerKey=e.payerKey,this.instructions=e.instructions,this.recentBlockhash=e.recentBlockhash}static decompile(e,t){const{header:r,compiledInstructions:n,recentBlockhash:o}=e,{numRequiredSignatures:s,numReadonlySignedAccounts:i,numReadonlyUnsignedAccounts:a}=r,c=s-i;Re(c>0,"Message header is invalid");const l=e.staticAccountKeys.length-s-a;Re(l>=0,"Message header is invalid");const u=e.getAccountKeys(t),d=u.get(0);if(void 0===d)throw new Error("Failed to decompile message because no account keys were found");const h=[];for(const e of n){const t=[];for(const n of e.accountKeyIndexes){const e=u.get(n);if(void 0===e)throw new Error(`Failed to find key for account key index ${n}`);let o;o=n<s?n<c:n<u.staticAccountKeys.length?n-s<l:n-u.staticAccountKeys.length<u.accountKeysFromLookups.writable.length,t.push({pubkey:e,isSigner:n<r.numRequiredSignatures,isWritable:o})}const n=u.get(e.programIdIndex);if(void 0===n)throw new Error(`Failed to find program id for program id index ${e.programIdIndex}`);h.push(new Ke({programId:n,data:he(e.data),keys:t}))}return new Ge({payerKey:d,instructions:h,recentBlockhash:o})}compileToLegacyMessage(){return Fe.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions})}compileToV0Message(e){return ze.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions,addressLookupTableAccounts:e})}}class Ye{get version(){return this.message.version}constructor(e,t){if(this.signatures=void 0,this.message=void 0,void 0!==t)Re(t.length===e.header.numRequiredSignatures,"Expected signatures length to be equal to the number of required signatures"),this.signatures=t;else{const t=[];for(let r=0;r<e.header.numRequiredSignatures;r++)t.push(new Uint8Array(Ce));this.signatures=t}this.message=e}serialize(){const e=this.message.serialize(),t=Array();je(t,this.signatures.length);const r=S.w3([S.av(t.length,"encodedSignaturesLength"),S.O6(Be(),this.signatures.length,"signatures"),S.av(e.length,"serializedMessage")]),n=new Uint8Array(2048),o=r.encode({encodedSignaturesLength:new Uint8Array(t),signatures:this.signatures,serializedMessage:e},n);return n.slice(0,o)}static deserialize(e){let t=[...e];const r=[],n=We(t);for(let e=0;e<n;e++)r.push(new Uint8Array(Le(t,0,Ce)));const o=Ve.deserialize(new Uint8Array(t));return new Ye(o,r)}sign(e){const t=this.message.serialize(),r=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures);for(const n of e){const e=r.findIndex((e=>e.equals(n.publicKey)));Re(e>=0,`Cannot sign with non signer key ${n.publicKey.toBase58()}`),this.signatures[e]=ue(t,n.secretKey)}}addSignature(e,t){Re(64===t.byteLength,"Signature must be 64 bytes long");const r=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex((t=>t.equals(e)));Re(r>=0,`Can not add signature; \`${e.toBase58()}\` is not required to sign this transaction`),this.signatures[r]=t}}const Je=new ve("SysvarC1ock11111111111111111111111111111111"),Qe=new ve("SysvarEpochSchedu1e111111111111111111111111"),Ze=new ve("Sysvar1nstructions1111111111111111111111111"),Xe=new ve("SysvarRecentB1ockHashes11111111111111111111"),et=new ve("SysvarRent111111111111111111111111111111111"),tt=new ve("SysvarRewards111111111111111111111111111111"),rt=new ve("SysvarS1otHashes111111111111111111111111111"),nt=ne
2w ve("SysvarS1otHistory11111111111111111111111111"),ot=new ve("SysvarStakeHistory1111111111111111111111111");class st extends Error{constructor({action:e,signature:t,transactionMessage:r,logs:n}){const o=n?`Logs: \n${JSON.stringify(n.slice(-10),null,2)}. `:"",s="\nCatch the `SendTransactionError` and call `getLogs()` on it for full details.";let i;switch(e){case"send":i=`Transaction ${t} resulted in an error. \n${r}. `+o+s;break;case"simulate":i=`Simulation failed. \nMessage: ${r}. \n`+o+s;break;default:i=`Unknown action '${e}'`}super(i),this.signature=void 0,this.transactionMessage=void 0,this.transactionLogs=void 0,this.signature=t,this.transactionMessage=r,this.transactionLogs=n||void 0}get transactionError(){return{message:this.transactionMessage,logs:Array.isArray(this.transactionLogs)?this.transactionLogs:void 0}}get logs(){const e=this.transactionLogs;if(null==e||"object"!=typeof e||!("then"in e))return e}async getLogs(e){return Array.isArray(this.transactionLogs)||(this.transactionLogs=new Promise(((t,r)=>{e.getTransaction(this.signature).then((e=>{if(e&&e.meta&&e.meta.logMessages){const r=e.meta.logMessages;this.transactionLogs=r,t(r)}else r(new Error("Log messages not found"))})).catch(r)}))),await this.transactionLogs}}const it={JSON_RPC_SERVER_ERROR_BLOCK_CLEANED_UP:-32001,JSON_RPC_SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE:-32002,JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE:-32003,JSON_RPC_SERVER_ERROR_BLOCK_NOT_AVAILABLE:-32004,JSON_RPC_SERVER_ERROR_NODE_UNHEALTHY:-32005,JSON_RPC_SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE:-32006,JSON_RPC_SERVER_ERROR_SLOT_SKIPPED:-32007,JSON_RPC_SERVER_ERROR_NO_SNAPSHOT:-32008,JSON_RPC_SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED:-32009,JSON_RPC_SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX:-32010,JSON_RPC_SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE:-32011,JSON_RPC_SCAN_ERROR:-32012,JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH:-32013,JSON_RPC_SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET:-32014,JSON_RPC_SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION:-32015,JSON_RPC_SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED:-32016};class at extends Error{constructor({code:e,message:t,data:r},n){super(null!=n?`${n}: ${t}`:t),this.code=void 0,this.data=void 0,this.code=e,this.data=r,this.name="SolanaJSONRPCError"}}async function ct(e,t,r,n){const o=n&&{skipPreflight:n.skipPreflight,preflightCommitment:n.preflightCommitment||n.commitment,maxRetries:n.maxRetries,minContextSlot:n.minContextSlot},s=await e.sendTransaction(t,r,o);let i;if(null!=t.recentBlockhash&&null!=t.lastValidBlockHeight)i=(await e.confirmTransaction({abortSignal:n?.abortSignal,signature:s,blockhash:t.recentBlockhash,lastValidBlockHeight:t.lastValidBlockHeight},n&&n.commitment)).value;else if(null!=t.minNonceContextSlot&&null!=t.nonceInfo){const{nonceInstruction:r}=t.nonceInfo,o=r.keys[0].pubkey;i=(await e.confirmTransaction({abortSignal:n?.abortSignal,minContextSlot:t.minNonceContextSlot,nonceAccountPubkey:o,nonceValue:t.nonceInfo.nonce,signature:s},n&&n.commitment)).value}else null!=n?.abortSignal&&console.warn("sendAndConfirmTransaction(): A transaction with a deprecated confirmation strategy was supplied along with an `abortSignal`. Only transactions having `lastValidBlockHeight` or a combination of `nonceInfo` and `minNonceContextSlot` are abortable."),i=(await e.confirmTransaction(s,n&&n.commitment)).value;if(i.err){if(null!=s)throw new st({action:"send",signature:s,transactionMessage:`Status: (${JSON.stringify(i)})`});throw new Error(`Transaction ${s} failed (${JSON.stringify(i)})`)}return s}function lt(e){return new Promise((t=>setTimeout(t,e)))}function ut(e,t){const r=e.layout.span>=0?e.layout.span:Me(e,t),o=n.Buffer.alloc(r),s=Object.assign({instruction:e.index},t);return e.layout.encode(s,o),o}function dt(e,t){let r;try{r=e.layout.decode(t)}catch(e){throw new Error("invalid instruction; "+e)}if(r.instruction!==e.index)throw new Error(`invalid instruction; instruction index mismatch ${r.instruction} != ${e.index}`);return r}const ht=S.I0("lamportsPerSignature"),pt=S.w3([S.DH("version"),S.DH("state"),xe("authorizedPubkey"),xe("nonce"),S.w3([ht],"feeCalculator")]),ft=pt.span;class gt{constructor(e){this.authorizedPubkey=void 0,this.nonce=void 0,this.feeCalculator=void 0,this.authorizedPubkey=e.authorizedPubkey,this.nonce=e.nonce,this.feeCalculator=e.feeCalculator}static fromAccountData(e){const t=pt.decode(he(e),0);return new gt({authorizedPubkey:new ve(t.authorizedPubkey),nonce:new ve(t.nonce).toString(),feeCalculator:t.feeCalculator})}}function mt(e){const t=(0,S.av)(8,e),r=t.decode.bind(t),n=t.encode.bind(t),o=t,s=(0,x.g2)();return o.decode=(e,t)=>{const n=r(e,t);return s.decode(n)},o.encode=(e,t,r)=>{const o=s.encode(e);return n(o,t,r)},o}class yt{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const t=S.DH("instruction").decode(e.data);let r;for(const[e,n]of Object.entries(bt))if(n.index==t){r=e;break}if(!r)throw new Error("Instruction type incorrect; not a SystemInstruction");return r}static decodeCreateAccount(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);
2const{lamports:t,space:r,programId:n}=dt(bt.Create,e.data);return{fromPubkey:e.keys[0].pubkey,newAccountPubkey:e.keys[1].pubkey,lamports:t,space:r,programId:new ve(n)}}static decodeTransfer(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{lamports:t}=dt(bt.Transfer,e.data);return{fromPubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,lamports:t}}static decodeTransferWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{lamports:t,seed:r,programId:n}=dt(bt.TransferWithSeed,e.data);return{fromPubkey:e.keys[0].pubkey,basePubkey:e.keys[1].pubkey,toPubkey:e.keys[2].pubkey,lamports:t,seed:r,programId:new ve(n)}}static decodeAllocate(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{space:t}=dt(bt.Allocate,e.data);return{accountPubkey:e.keys[0].pubkey,space:t}}static decodeAllocateWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{base:t,seed:r,space:n,programId:o}=dt(bt.AllocateWithSeed,e.data);return{accountPubkey:e.keys[0].pubkey,basePubkey:new ve(t),seed:r,space:n,programId:new ve(o)}}static decodeAssign(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{programId:t}=dt(bt.Assign,e.data);return{accountPubkey:e.keys[0].pubkey,programId:new ve(t)}}static decodeAssignWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{base:t,seed:r,programId:n}=dt(bt.AssignWithSeed,e.data);return{accountPubkey:e.keys[0].pubkey,basePubkey:new ve(t),seed:r,programId:new ve(n)}}static decodeCreateWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{base:t,seed:r,lamports:n,space:o,programId:s}=dt(bt.CreateWithSeed,e.data);return{fromPubkey:e.keys[0].pubkey,newAccountPubkey:e.keys[1].pubkey,basePubkey:new ve(t),seed:r,lamports:n,space:o,programId:new ve(s)}}static decodeNonceInitialize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{authorized:t}=dt(bt.InitializeNonceAccount,e.data);return{noncePubkey:e.keys[0].pubkey,authorizedPubkey:new ve(t)}}static decodeNonceAdvance(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),dt(bt.AdvanceNonceAccount,e.data),{noncePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey}}static decodeNonceWithdraw(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,5);const{lamports:t}=dt(bt.WithdrawNonceAccount,e.data);return{noncePubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey,lamports:t}}static decodeNonceAuthorize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{authorized:t}=dt(bt.AuthorizeNonceAccount,e.data);return{noncePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[1].pubkey,newAuthorizedPubkey:new ve(t)}}static checkProgramId(e){if(!e.equals(wt.programId))throw new Error("invalid instruction; programId is not SystemProgram")}static checkKeyLength(e,t){if(e.length<t)throw new Error(`invalid instruction; found ${e.length} keys, expected at least ${t}`)}}const bt=Object.freeze({Create:{index:0,layout:S.w3([S.DH("instruction"),S.Wg("lamports"),S.Wg("space"),xe("programId")])},Assign:{index:1,layout:S.w3([S.DH("instruction"),xe("programId")])},Transfer:{index:2,layout:S.w3([S.DH("instruction"),mt("lamports")])},CreateWithSeed:{index:3,layout:S.w3([S.DH("instruction"),xe("base"),Oe("seed"),S.Wg("lamports"),S.Wg("space"),xe("programId")])},AdvanceNonceAccount:{index:4,layout:S.w3([S.DH("instruction")])},WithdrawNonceAccount:{index:5,layout:S.w3([S.DH("instruction"),S.Wg("lamports")])},InitializeNonceAccount:{index:6,layout:S.w3([S.DH("instruction"),xe("authorized")])},AuthorizeNonceAccount:{index:7,layout:S.w3([S.DH("instruction"),xe("authorized")])},Allocate:{index:8,layout:S.w3([S.DH("instruction"),S.Wg("space")])},AllocateWithSeed:{index:9,layout:S.w3([S.DH("instruction"),xe("base"),Oe("seed"),S.Wg("space"),xe("programId")])},AssignWithSeed:{index:10,layout:S.w3([S.DH("instruction"),xe("base"),Oe("seed"),xe("programId")])},TransferWithSeed:{index:11,layout:S.w3([S.DH("instruction"),mt("lamports"),Oe("seed"),xe("programId")])},UpgradeNonceAccount:{index:12,layout:S.w3([S.DH("instruction")])}});class wt{constructor(){}static createAccount(e){const t=ut(bt.Create,{lamports:e.lamports,space:e.space,programId:he(e.programId.toBuffer())});return new Ke({keys:[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:t})}static transfer(e){let t,r;if("basePubkey"in e){t=ut(bt.TransferWithSeed,{lamports:BigInt(e.lamports),seed:e.seed,programId:he(e.programId.toBuffer())}),r=[{pubkey:e.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}else{t=ut(bt.Transfer,{lamports:BigInt(e.lamports)}),r=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}return new Ke({keys:r,programId:this.programId,data:t})}static assign(e){let t,r;if("basePubkey"in e){t=ut(bt.AssignWithSeed,{base:he(e.basePubkey.toBuffer()),seed:e.seed,programId:he(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{t=ut(bt.Assign,{programId:he(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new Ke({keys:r,programId:this.programId,data:t})}static createAccountWithSeed(e){const t=ut(bt.CreateWithSeed,{base:he(e.basePubkey.toBuffer()),seed:e.seed,lamports:e.lamports,space:e.space,programId:he(e.programId.toBuffer())});let r=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!1,isWritable:!0}];return e.basePubkey.equals(e.fromPubkey)||r.push({pubkey:e.basePubkey,isSigner:!0,isWritable:!1}),new Ke({keys:r,programId:this.programId,data:t})}static createNonceAccount(e){const t=new $e;"basePubkey"in e&&"seed"in e?t.add(wt.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:ft,programId:this.programId})):t.add(wt.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,lamports:e.lamports,space:ft,programId:this.programId}));const r={noncePubkey:e.noncePubkey,authorizedPubkey:e.authorizedPubkey};return t.add(this.nonceInitialize(r)),t}static nonceInitialize(e){const t=ut(bt.InitializeNonceAccount,{authorized:he(e.authorizedPubkey.toBuffer())}),r={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:Xe,isSigner:!1,isWritable:!1},{pubkey:et,isSigner:!1,isWritable:!1}],programId:this.programId,data:t};return new Ke(r)}static nonceAdvance(e){const t=ut(bt.AdvanceNonceAccount),r={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:Xe,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t};return new Ke(r)}static nonceWithdraw(e){const t=ut(bt.WithdrawNonceAccount,{lamports:e.lamports});return new Ke({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0},{pubkey:Xe,isSigner:!1,isWritable:!1},{pubkey:et,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t})}static nonceAuthorize(e){const t=ut(bt.AuthorizeNonceAccount,{authorized:he(e.newAuthorizedPubkey.toBuffer())});return new Ke({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t})}static allocate(e){let t,r;if("basePubkey"in e){t=ut(bt.AllocateWithSeed,{base:he(e.basePubkey.toBuffer()),seed:e.seed,space:e.space,programId:he(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{t=ut(bt.Allocate,{space:e.space}),r=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new Ke({keys:r,programId:this.programId,data:t})}}wt.programId=new ve("11111111111111111111111111111111");const vt=Pe-300;class At{constructor(){}static getMinNumSignatures(e){return 2*(Math.ceil(e/At.chunkSize)+1+1)}static async load(e,t,r,o,s){{const n=await e.getMinimumBalanceForRentExemption(s.length),i=await e.getAccountInfo(r.publicKey,"confirmed");let a=null;if(null!==i){if(i.executable)return console.error("Program load failed, account is already executable"),!1;i.data.length!==s.length&&(a=a||new $e,a.add(wt.allocate({accountPubkey:r.publicKey,space:s.length}))),i.owner.equals(o)||(a=a||new $e,a.add(wt.assign({accountPubkey:r.publicKey,programId:o}))),i.lamports<n&&(a=a||new $e,a.add(wt.transfer({fromPubkey:t.publicKey,toPubkey:r.publicKey,lamports:n-i.lamports})))}else a=(new $e).add(wt.createAccount({fromPubkey:t.publicKey,newAccountPubkey:r.publicKey,lamports:n>0?n:1,space:s.length,programId:o}));null!==a&&await ct(e,a,[t,r],{commitment:"confirmed"})}const i=S.w3([S.DH("instruction"),S.DH("offset"),S.DH("bytesLength"),S.DH("bytesLengthPadding"),S.O6(S.u8("byte"),S.cY(S.DH(),-8),"bytes")]),a=At.chunkSize;let c=0,l=s,u=[];for(;l.length>0;){const s=l.slice(0,a),d=n.Buffer.alloc(a+16);i.encode({instruction:0,offset:c,bytes:s,bytesLength:0,bytesLengthPadding:0},d);const h=(new $e).add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0}],programId:o,data:d});if(u.push(ct(e,h,[t,r],{commitment:"confirmed"})),e._rpcEndpoint.includes("solana.com")){const e=4;await lt(1e3/e)}c+=a,l=l.slice(a)}await Promise.all(u);{const s=S.w3([S.DH("instruction")]),i=n.Buffer.alloc(s.span);s.encode({instruction:1},i);const a=(new $e).add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0},{pubkey:et,isSigner:!1,isWritable:!1}],programId:o,data:i}),c="processed",l=await e.sendTransaction(a,[t,r],{preflightCommitment:c}),{context:u,value:d}=await e.confirmTransaction({signature:l,lastValidBlockHeight:a.lastV
2alidBlockHeight,blockhash:a.recentBlockhash},c);if(d.err)throw new Error(`Transaction ${l} failed (${JSON.stringify(d)})`);for(;;){try{if(await e.getSlot({commitment:c})>u.slot)break}catch{}await new Promise((e=>setTimeout(e,Math.round(200))))}}return!0}}At.chunkSize=vt;const Tt=new ve("BPFLoader2111111111111111111111111111111111");class Pt{static getMinNumSignatures(e){return At.getMinNumSignatures(e)}static load(e,t,r,n,o){return At.load(e,t,r,o,n)}}function Et(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ct,kt;function _t(){if(kt)return Ct;kt=1;var e=Object.prototype.toString,t=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};function r(n,o){var s,i,a,c,l,u,d;if(!0===n)return"true";if(!1===n)return"false";switch(typeof n){case"object":if(null===n)return null;if(n.toJSON&&"function"==typeof n.toJSON)return r(n.toJSON(),o);if("[object Array]"===(d=e.call(n))){for(a="[",i=n.length-1,s=0;s<i;s++)a+=r(n[s],!0)+",";return i>-1&&(a+=r(n[s],!0)),a+"]"}if("[object Object]"===d){for(i=(c=t(n).sort()).length,a="",s=0;s<i;)void 0!==(u=r(n[l=c[s]],!1))&&(a&&(a+=","),a+=JSON.stringify(l)+":"+u),s++;return"{"+a+"}"}return JSON.stringify(n);case"function":case"undefined":return o?null:void 0;case"string":return JSON.stringify(n);default:return isFinite(n)?n:null}}return Ct=function(e){var t=r(e,!1);if(void 0!==t)return""+t}}var It=Et(_t());function St(e){let t=0;for(;e>1;)e/=2,t++;return t}class xt{constructor(e,t,r,n,o){this.slotsPerEpoch=void 0,this.leaderScheduleSlotOffset=void 0,this.warmup=void 0,this.firstNormalEpoch=void 0,this.firstNormalSlot=void 0,this.slotsPerEpoch=e,this.leaderScheduleSlotOffset=t,this.warmup=r,this.firstNormalEpoch=n,this.firstNormalSlot=o}getEpoch(e){return this.getEpochAndSlotIndex(e)[0]}getEpochAndSlotIndex(e){if(e<this.firstNormalSlot){const r=St(0===(t=e+32+1)?1:(t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,1+(t|=t>>32)))-St(32)-1;return[r,e-(this.getSlotsInEpoch(r)-32)]}{const t=e-this.firstNormalSlot,r=Math.floor(t/this.slotsPerEpoch);return[this.firstNormalEpoch+r,t%this.slotsPerEpoch]}var t}getFirstSlotInEpoch(e){return e<=this.firstNormalEpoch?32*(Math.pow(2,e)-1):(e-this.firstNormalEpoch)*this.slotsPerEpoch+this.firstNormalSlot}getLastSlotInEpoch(e){return this.getFirstSlotInEpoch(e)+this.getSlotsInEpoch(e)-1}getSlotsInEpoch(e){return e<this.firstNormalEpoch?Math.pow(2,e+St(32)):this.slotsPerEpoch}}var Bt=globalThis.fetch;class Ot extends W.vE{constructor(e,t,r){super((e=>{const r=(0,W.kb)(e,{autoconnect:!0,max_reconnects:5,reconnect:!0,reconnect_interval:1e3,...t});return this.underlyingSocket="socket"in r?r.socket:r,r}),e,t,r),this.underlyingSocket=void 0}call(...e){const t=this.underlyingSocket?.readyState;return 1===t?super.call(...e):Promise.reject(new Error("Tried to call a JSON-RPC method `"+e[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+t+")"))}notify(...e){const t=this.underlyingSocket?.readyState;return 1===t?super.notify(...e):Promise.reject(new Error("Tried to send a JSON-RPC notification `"+e[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+t+")"))}}class Mt{constructor(e){this.key=void 0,this.state=void 0,this.key=e.key,this.state=e.state}isActive(){const e=BigInt("0xffffffffffffffff");return this.state.deactivationSlot===e}static deserialize(e){const t=function(e,t){let r;try{r=e.layout.decode(t)}catch(e){throw new Error("invalid instruction; "+e)}if(r.typeIndex!==e.index)throw new Error(`invalid account data; account type mismatch ${r.typeIndex} != ${e.index}`);return r}(Wt,e),r=e.length-56;Re(r>=0,"lookup table is invalid"),Re(r%32==0,"lookup table is invalid");const n=r/32,{addresses:o}=S.w3([S.O6(xe(),n,"addresses")]).decode(e.slice(56));return{deactivationSlot:t.deactivationSlot,lastExtendedSlot:t.lastExtendedSlot,lastExtendedSlotStartIndex:t.lastExtendedStartIndex,authority:0!==t.authority.length?new ve(t.authority[0]):void 0,addresses:o.map((e=>new ve(e)))}}}const Wt={index:1,layout:S.w3([S.DH("typeIndex"),mt("deactivationSlot"),S.I0("lastExtendedSlot"),S.u8("lastExtendedStartIndex"),S.u8(),S.O6(xe(),S.cY(S.u8(),-1),"authority")])},jt=/^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i;const Rt=(0,B.au)((0,B.KJ)(ve),(0,B.Yj)(),(e=>new ve(e))),Nt=(0,B.PV)([(0,B.Yj)(),(0,B.eu)("base64")]),Ut=(0,B.au)((0,B.KJ)(n.Buffer),Nt,(e=>n.Buffer.from(e[0],"base64"))),Dt=3e4;function Lt(e){let t,r;if("string"==typeof e)t=e;else if(e){const{commitment:n,...o}=e;t=n,r=o}return{commitment:t,config:r}}function Ft(e){return e.map((e=>"memcmp"in e?{...e,memcmp:{...e.memcmp,encoding:e.memcmp.encoding??"base58"}}:e))}function zt(e){return(0,B.KC)([(0,B.NW)({jsonrpc:(0,B.eu)("2.0"),id:(0,B.Yj)(),result:e}),(0,B.NW)({jsonrpc:(0,B.eu)("2.0"),id:(0,B.Yj)(),error:(0,B.NW)({code:(0,B.L5)(),message:(0,B.Yj)(),data:(0,B.lq)((0,B.bz)())})})])}const Vt=zt((0,B.L5)());function qt(e){return(0,B.au)(zt(e),Vt,(t=>"error"in t?t:{...t,result:(0,B.vt)(t.result,e)}))}function Ht(e){return qt((0,B.NW)({context:(0,B.NW)({slot:(0,B.ai)()}),value:e}))}function Kt(e){return(0,B.NW)({context:(0,B.NW)({slot:(0,B.ai)()}),value:e})}function $t(e,t){return 0===e?new ze({header:t.header,staticAccountKeys:t.accountKeys.map((e=>new ve(e))),recentBlockhash:t.recentBlockhash,compiledInstructions:t.instructions.map((e=>({programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:c().decode(e.data)}))),addressTableLookups:t.addressTableLookups}):new Fe(t)}const Gt=(0,B.NW)({foundation:(0,B.ai)(),foundationTerm:(0,B.ai)(),initial:(0,B.ai)(),taper:(0,B.ai)(),terminal:(0,B.ai)()}),Yt=qt((0,B.YO)((0,B.me)((0,B.NW)({epoch:(0,B.ai)(),effectiveSlot:(0,B.ai)(),amount:(0,B.ai)(),postBalance:(0,B.ai)(),commission:(0,B.lq)((0,B.me)((0,B.ai)()))})))),Jt=(0,B.YO)((0,B.NW)({slot:(0,B.ai)(),prioritizationFee:(0,B.ai)()})),Qt=(0,B.NW)({total:(0,B.ai)(),validator:(0,B.ai)(),foundation:(0,B.ai)(),epoch:(0,B.ai)()}),Zt=(0,B.NW)({epoch:(0,B.ai)(),slotIndex:(0,B.ai)(),slotsInEpoch:(0,B.ai)(),absoluteSlot:(0,B.ai)(),blockHeight:(0,B.lq)((0,B.ai)()),transactionCount:(0,B.lq)((0,B.ai)())}),Xt=(0,B.NW)({slotsPerEpoch:(0,B.ai)(),leaderScheduleSlotOffset:(0,B.ai)(),warmup:(0,B.zM)(),firstNormalEpoch:(0,B.ai)(),firstNormalSlot:(0,B.ai)()}),er=(0,B.g1)((0,B.Yj)(),(0,B.YO)((0,B.ai)())),tr=(0,B.me)((0,B.KC)([(0,B.NW)({}),(0,B.Yj)()])),rr=(0,B.NW)({err:tr}),nr=(0,B.eu)("receivedSignature"),or=(0,B.NW)({"solana-core":(0,B.Yj)(),"feature-set":(0,B.lq)((0,B.ai)())}),sr=(0,B.NW)({program:(0,B.Yj)(),programId:Rt,parsed:(0,B.L5)()}),ir=(0,B.NW)({programId:Rt,accounts:(0,B.YO)(Rt),data:(0,B.Yj)()}),ar=Ht((0,B.NW)({err:(0,B.me)((0,B.KC)([(0,B.NW)({}),(0,B.Yj)()])),logs:(0,B.me)((0,B.YO)((0,B.Yj)())),accounts:(0,B.lq)((0,B.me)((0,B.YO)((0,B.me)((0,B.NW)({executable:(0,B.zM)(),owner:(0,B.Yj)(),lamports:(0,B.ai)(),data:(0,B.YO)((0,B.Yj)()),rentEpoch:(0,B.lq)((0,B.ai)())}))))),unitsConsumed:(0,B.lq)((0,B.ai)()),returnData:(0,B.lq)((0,B.me)((0,B.NW)({programId:(0,B.Yj)(),data:(0,B.PV)([(0,B.Yj)(),(0,B.eu)("base64")])}))),innerInstructions:(0,B.lq)((0,B.me)((0,B.YO)((0,B.NW)({index:(0,B.ai)(),instructions:(0,B.YO)((0,B.KC)([sr,ir]))}))))}
2)),cr=Ht((0,B.NW)({byIdentity:(0,B.g1)((0,B.Yj)(),(0,B.YO)((0,B.ai)())),range:(0,B.NW)({firstSlot:(0,B.ai)(),lastSlot:(0,B.ai)()})}));const lr=qt(Gt),ur=qt(Qt),dr=qt(Jt),hr=qt(Zt),pr=qt(Xt),fr=qt(er),gr=qt((0,B.ai)()),mr=Ht((0,B.NW)({total:(0,B.ai)(),circulating:(0,B.ai)(),nonCirculating:(0,B.ai)(),nonCirculatingAccounts:(0,B.YO)(Rt)})),yr=(0,B.NW)({amount:(0,B.Yj)(),uiAmount:(0,B.me)((0,B.ai)()),decimals:(0,B.ai)(),uiAmountString:(0,B.lq)((0,B.Yj)())}),br=Ht((0,B.YO)((0,B.NW)({address:Rt,amount:(0,B.Yj)(),uiAmount:(0,B.me)((0,B.ai)()),decimals:(0,B.ai)(),uiAmountString:(0,B.lq)((0,B.Yj)())}))),wr=Ht((0,B.YO)((0,B.NW)({pubkey:Rt,account:(0,B.NW)({executable:(0,B.zM)(),owner:Rt,lamports:(0,B.ai)(),data:Ut,rentEpoch:(0,B.ai)()})}))),vr=(0,B.NW)({program:(0,B.Yj)(),parsed:(0,B.L5)(),space:(0,B.ai)()}),Ar=Ht((0,B.YO)((0,B.NW)({pubkey:Rt,account:(0,B.NW)({executable:(0,B.zM)(),owner:Rt,lamports:(0,B.ai)(),data:vr,rentEpoch:(0,B.ai)()})}))),Tr=Ht((0,B.YO)((0,B.NW)({lamports:(0,B.ai)(),address:Rt}))),Pr=(0,B.NW)({executable:(0,B.zM)(),owner:Rt,lamports:(0,B.ai)(),data:Ut,rentEpoch:(0,B.ai)()}),Er=(0,B.NW)({pubkey:Rt,account:Pr}),Cr=(0,B.au)((0,B.KC)([(0,B.KJ)(n.Buffer),vr]),(0,B.KC)([Nt,vr]),(e=>Array.isArray(e)?(0,B.vt)(e,Ut):e)),kr=(0,B.NW)({executable:(0,B.zM)(),owner:Rt,lamports:(0,B.ai)(),data:Cr,rentEpoch:(0,B.ai)()}),_r=(0,B.NW)({pubkey:Rt,account:kr}),Ir=(0,B.NW)({state:(0,B.KC)([(0,B.eu)("active"),(0,B.eu)("inactive"),(0,B.eu)("activating"),(0,B.eu)("deactivating")]),active:(0,B.ai)(),inactive:(0,B.ai)()}),Sr=qt((0,B.YO)((0,B.NW)({signature:(0,B.Yj)(),slot:(0,B.ai)(),err:tr,memo:(0,B.me)((0,B.Yj)()),blockTime:(0,B.lq)((0,B.me)((0,B.ai)()))}))),xr=qt((0,B.YO)((0,B.NW)({signature:(0,B.Yj)(),slot:(0,B.ai)(),err:tr,memo:(0,B.me)((0,B.Yj)()),blockTime:(0,B.lq)((0,B.me)((0,B.ai)()))}))),Br=(0,B.NW)({subscription:(0,B.ai)(),result:Kt(Pr)}),Or=(0,B.NW)({pubkey:Rt,account:Pr}),Mr=(0,B.NW)({subscription:(0,B.ai)(),result:Kt(Or)}),Wr=(0,B.NW)({parent:(0,B.ai)(),slot:(0,B.ai)(),root:(0,B.ai)()}),jr=(0,B.NW)({subscription:(0,B.ai)(),result:Wr}),Rr=(0,B.KC)([(0,B.NW)({type:(0,B.KC)([(0,B.eu)("firstShredReceived"),(0,B.eu)("completed"),(0,B.eu)("optimisticConfirmation"),(0,B.eu)("root")]),slot:(0,B.ai)(),timestamp:(0,B.ai)()}),(0,B.NW)({type:(0,B.eu)("createdBank"),parent:(0,B.ai)(),slot:(0,B.ai)(),timestamp:(0,B.ai)()}),(0,B.NW)({type:(0,B.eu)("frozen"),slot:(0,B.ai)(),timestamp:(0,B.ai)(),stats:(0,B.NW)({numTransactionEntries:(0,B.ai)(),numSuccessfulTransactions:(0,B.ai)(),numFailedTransactions:(0,B.ai)(),maxTransactionsPerEntry:(0,B.ai)()})}),(0,B.NW)({type:(0,B.eu)("dead"),slot:(0,B.ai)(),timestamp:(0,B.ai)(),err:(0,B.Yj)()})]),Nr=(0,B.NW)({subscription:(0,B.ai)(),result:Rr}),Ur=(0,B.NW)({subscription:(0,B.ai)(),result:Kt((0,B.KC)([rr,nr]))}),Dr=(0,B.NW)({subscription:(0,B.ai)(),result:(0,B.ai)()}),Lr=(0,B.NW)({pubkey:(0,B.Yj)(),gossip:(0,B.me)((0,B.Yj)()),tpu:(0,B.me)((0,B.Yj)()),rpc:(0,B.me)((0,B.Yj)()),version:(0,B.me)((0,B.Yj)())}),Fr=(0,B.NW)({votePubkey:(0,B.Yj)(),nodePubkey:(0,B.Yj)(),activatedStake:(0,B.ai)(),epochVoteAccount:(0,B.zM)(),epochCredits:(0,B.YO)((0,B.PV)([(0,B.ai)(),(0,B.ai)(),(0,B.ai)()])),commission:(0,B.ai)(),lastVote:(0,B.ai)(),rootSlot:(0,B.me)((0,B.ai)())}),zr=qt((0,B.NW)({current:(0,B.YO)(Fr),delinquent:(0,B.YO)(Fr)})),Vr=(0,B.KC)([(0,B.eu)("processed"),(0,B.eu)("confirmed"),(0,B.eu)("finalized")]),qr=(0,B.NW)({slot:(0,B.ai)(),confirmations:(0,B.me)((0,B.ai)()),err:tr,confirmationStatus:(0,B.lq)(Vr)}),Hr=Ht((0,B.YO)((0,B.me)(qr))),Kr=qt((0,B.ai)()),$r=(0,B.NW)({accountKey:Rt,writableIndexes:(0,B.YO)((0,B.ai)()),readonlyIndexes:(0,B.YO)((0,B.ai)())}),Gr=(0,B.NW)({signatures:(0,B.YO)((0,B.Yj)()),message:(0,B.NW)({accountKeys:(0,B.YO)((0,B.Yj)()),header:(0,B.NW)({numRequiredSignatures:(0,B.ai)(),numReadonlySignedAccounts:(0,B.ai)(),numReadonlyUnsignedAccounts:(0,B.ai)()}),instructions:(0,B.YO)((0,B.NW)({accounts:(0,B.YO)((0,B.ai)()),data:(0,B.Yj)(),programIdIndex:(0,B.ai)()})),recentBlockhash:(0,B.Yj)(),addressTableLookups:(0,B.lq)((0,B.YO)($r))})}),Yr=(0,B.NW)({pubkey:Rt,signer:(0,B.zM)(),writable:(0,B.zM)(),source:(0,B.lq)((0,B.KC)([(0,B.eu)("transaction"),(0,B.eu)("lookupTable")]))}),Jr=(0,B.NW)({accountKeys:(0,B.YO)(Yr),signatures:(0,B.YO)((0,B.Yj)())}),Qr=(0,B.NW)({parsed:(0,B.L5)(),program:(0,B.Yj)(),programId:Rt}),Zr=(0,B.NW)({accounts:(0,B.YO)(Rt),data:(0,B.Yj)(),programId:Rt}),Xr=(0,B.KC)([Zr,Qr]),en=(0,B.KC)([(0,B.NW)({parsed:(0,B.L5)(),program:(0,B.Yj)(),programId:(0,B.Yj)()}),(0,B.NW)({accounts:(0,B.YO)((0,B.Yj)()),data:(0,B.Yj)(),programId:(0,B.Yj)()})]),tn=(0,B.au)(Xr,en,(e=>"accounts"in e?(0,B.vt)(e,Zr):(0,B.vt)(e,Qr))),rn=(0,B.NW)({signatures:(0,B.YO)((0,B.Yj)()),message:(0,B.NW)({accountKeys:(0,B.YO)(Yr),instructions:(0,B.YO)(tn),recentBlockhash:(0,B.Yj)(),addressTableLookups:(0,B.lq)((0,B.me)((0,B.YO)($r)))})}),nn=(0,B.NW)({accountIndex:(0,B.ai)(),mint:(0,B.Yj)(),owner:(0,B.lq)((0,B.Yj)()),programId:(0,B.lq)((0,B.Yj)()),uiTokenAmount:yr}),on=(0,B.NW)({writable:(0,B.YO)(Rt),readonly:(0,B.YO)(Rt)}),sn=(0,B.NW)({err:tr,fee:(0,B.ai)(),innerInstructions:(0,B.lq)((0,B.me)((0,B.YO)((0,B.NW)({index:(0,B.ai)(),instructions:(0,B.YO)((0,B.NW)({accounts:(0,B.YO)((0,B.ai)()),data:(0,B.Yj)(),programIdIndex:(0,B.ai)()}))})))),preBalances:(0,B.YO)((0,B.ai)()),postBalances:(0,B.YO)((0,B.ai)()),logMessages:(0,B.lq)((0,B.me)((0,B.YO)((0,B.Yj)()))),preTokenBalances:(0,B.lq)((0,B.me)((0,B.YO)(nn))),postTokenBalances:(0,B.lq)((0,B.me)((0,B.YO)(nn))),loadedAddresses:(0,B.lq)(on),computeUnitsConsumed:(0,B.lq)((0,B.ai)()),c
2ostUnits:(0,B.lq)((0,B.ai)())}),an=(0,B.NW)({err:tr,fee:(0,B.ai)(),innerInstructions:(0,B.lq)((0,B.me)((0,B.YO)((0,B.NW)({index:(0,B.ai)(),instructions:(0,B.YO)(tn)})))),preBalances:(0,B.YO)((0,B.ai)()),postBalances:(0,B.YO)((0,B.ai)()),logMessages:(0,B.lq)((0,B.me)((0,B.YO)((0,B.Yj)()))),preTokenBalances:(0,B.lq)((0,B.me)((0,B.YO)(nn))),postTokenBalances:(0,B.lq)((0,B.me)((0,B.YO)(nn))),loadedAddresses:(0,B.lq)(on),computeUnitsConsumed:(0,B.lq)((0,B.ai)()),costUnits:(0,B.lq)((0,B.ai)())}),cn=(0,B.KC)([(0,B.eu)(0),(0,B.eu)("legacy")]),ln=(0,B.NW)({pubkey:(0,B.Yj)(),lamports:(0,B.ai)(),postBalance:(0,B.me)((0,B.ai)()),rewardType:(0,B.me)((0,B.Yj)()),commission:(0,B.lq)((0,B.me)((0,B.ai)()))}),un=qt((0,B.me)((0,B.NW)({blockhash:(0,B.Yj)(),previousBlockhash:(0,B.Yj)(),parentSlot:(0,B.ai)(),transactions:(0,B.YO)((0,B.NW)({transaction:Gr,meta:(0,B.me)(sn),version:(0,B.lq)(cn)})),rewards:(0,B.lq)((0,B.YO)(ln)),blockTime:(0,B.me)((0,B.ai)()),blockHeight:(0,B.me)((0,B.ai)())}))),dn=qt((0,B.me)((0,B.NW)({blockhash:(0,B.Yj)(),previousBlockhash:(0,B.Yj)(),parentSlot:(0,B.ai)(),rewards:(0,B.lq)((0,B.YO)(ln)),blockTime:(0,B.me)((0,B.ai)()),blockHeight:(0,B.me)((0,B.ai)())}))),hn=qt((0,B.me)((0,B.NW)({blockhash:(0,B.Yj)(),previousBlockhash:(0,B.Yj)(),parentSlot:(0,B.ai)(),transactions:(0,B.YO)((0,B.NW)({transaction:Jr,meta:(0,B.me)(sn),version:(0,B.lq)(cn)})),rewards:(0,B.lq)((0,B.YO)(ln)),blockTime:(0,B.me)((0,B.ai)()),blockHeight:(0,B.me)((0,B.ai)())}))),pn=qt((0,B.me)((0,B.NW)({blockhash:(0,B.Yj)(),previousBlockhash:(0,B.Yj)(),parentSlot:(0,B.ai)(),transactions:(0,B.YO)((0,B.NW)({transaction:rn,meta:(0,B.me)(an),version:(0,B.lq)(cn)})),rewards:(0,B.lq)((0,B.YO)(ln)),blockTime:(0,B.me)((0,B.ai)()),blockHeight:(0,B.me)((0,B.ai)())}))),fn=qt((0,B.me)((0,B.NW)({blockhash:(0,B.Yj)(),previousBlockhash:(0,B.Yj)(),parentSlot:(0,B.ai)(),transactions:(0,B.YO)((0,B.NW)({transaction:Jr,meta:(0,B.me)(an),version:(0,B.lq)(cn)})),rewards:(0,B.lq)((0,B.YO)(ln)),blockTime:(0,B.me)((0,B.ai)()),blockHeight:(0,B.me)((0,B.ai)())}))),gn=qt((0,B.me)((0,B.NW)({blockhash:(0,B.Yj)(),previousBlockhash:(0,B.Yj)(),parentSlot:(0,B.ai)(),rewards:(0,B.lq)((0,B.YO)(ln)),blockTime:(0,B.me)((0,B.ai)()),blockHeight:(0,B.me)((0,B.ai)())}))),mn=qt((0,B.me)((0,B.NW)({blockhash:(0,B.Yj)(),previousBlockhash:(0,B.Yj)(),parentSlot:(0,B.ai)(),transactions:(0,B.YO)((0,B.NW)({transaction:Gr,meta:(0,B.me)(sn)})),rewards:(0,B.lq)((0,B.YO)(ln)),blockTime:(0,B.me)((0,B.ai)())}))),yn=qt((0,B.me)((0,B.NW)({blockhash:(0,B.Yj)(),previousBlockhash:(0,B.Yj)(),parentSlot:(0,B.ai)(),signatures:(0,B.YO)((0,B.Yj)()),blockTime:(0,B.me)((0,B.ai)())}))),bn=qt((0,B.me)((0,B.NW)({slot:(0,B.ai)(),meta:(0,B.me)(sn),blockTime:(0,B.lq)((0,B.me)((0,B.ai)())),transaction:Gr,version:(0,B.lq)(cn)}))),wn=qt((0,B.me)((0,B.NW)({slot:(0,B.ai)(),transaction:rn,meta:(0,B.me)(an),blockTime:(0,B.lq)((0,B.me)((0,B.ai)())),version:(0,B.lq)(cn)}))),vn=Ht((0,B.NW)({blockhash:(0,B.Yj)(),lastValidBlockHeight:(0,B.ai)()})),An=Ht((0,B.zM)()),Tn=(0,B.NW)({slot:(0,B.ai)(),numTransactions:(0,B.ai)(),numSlots:(0,B.ai)(),samplePeriodSecs:(0,B.ai)()}),Pn=qt((0,B.YO)(Tn)),En=Ht((0,B.me)((0,B.NW)({feeCalculator:(0,B.NW)({lamportsPerSignature:(0,B.ai)()})}))),Cn=qt((0,B.Yj)()),kn=qt((0,B.Yj)()),_n=(0,B.NW)({err:tr,logs:(0,B.YO)((0,B.Yj)()),signature:(0,B.Yj)()}),In=(0,B.NW)({result:Kt(_n),subscription:(0,B.ai)()}),Sn={"solana-client":"js/1.0.0-maintenance"};class xn{constructor(e,t){let r,n,o,s,i,a;var c;this._commitment=void 0,this._confirmTransactionInitialTimeout=void 0,this._rpcEndpoint=void 0,this._rpcWsEndpoint=void 0,this._rpcClient=void 0,this._rpcRequest=void 0,this._rpcBatchRequest=void 0,this._rpcWebSocket=void 0,this._rpcWebSocketConnected=!1,this._rpcWebSocketHeartbeat=null,this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketGeneration=0,this._disableBlockhashCaching=!1,this._pollingBlockhash=!1,this._blockhashInfo={latestBlockhash:null,lastFetch:0,transactionSignatures:[],simulatedSignatures:[]},this._nextClientSubscriptionId=0,this._subscriptionDisposeFunctionsByClientSubscriptionId={}
2,this._subscriptionHashByClientSubscriptionId={},this._subscriptionStateChangeCallbacksByHash={},this._subscriptionCallbacksByServerSubscriptionId={},this._subscriptionsByHash={},this._subscriptionsAutoDisposedByRpc=new Set,this.getBlockHeight=(()=>{const e={};return async t=>{const{commitment:r,config:n}=Lt(t),o=this._buildArgs([],r,void 0,n),s=It(o);return e[s]=e[s]??(async()=>{try{const e=await this._rpcRequest("getBlockHeight",o),t=(0,B.vt)(e,qt((0,B.ai)()));if("error"in t)throw new at(t.error,"failed to get block height information");return t.result}finally{delete e[s]}})(),await e[s]}})(),t&&"string"==typeof t?this._commitment=t:t&&(this._commitment=t.commitment,this._confirmTransactionInitialTimeout=t.confirmTransactionInitialTimeout,r=t.wsEndpoint,n=t.httpHeaders,o=t.fetch,s=t.fetchMiddleware,i=t.disableRetryOnRateLimit,a=t.httpAgent),this._rpcEndpoint=function(e){if(!1===/^https?:/.test(e))throw new TypeError("Endpoint URL must start with `http:` or `https:`.");return e}(e),this._rpcWsEndpoint=r||function(e){const t=e.match(jt);if(null==t)throw TypeError(`Failed to validate endpoint URL \`${e}\``);const[r,n,o,s]=t,i=e.startsWith("https:")?"wss:":"ws:",a=null==o?null:parseInt(o.slice(1),10);return`${i}//${n}${null==a?"":`:${a+1}`}${s}`}(e),this._rpcClient=function(e,t,r,n,o,s){const i=r||Bt;let a;return null!=s&&console.warn("You have supplied an `httpAgent` when creating a `Connection` in a browser environment.It has been ignored; `httpAgent` is only used in Node environments."),n&&(a=async(e,t)=>{const r=await new Promise(((r,o)=>{try{n(e,t,((e,t)=>r([e,t])))}catch(e){o(e)}}));return await i(...r)}),new(M())((async(r,n)=>{const s={method:"POST",body:r,agent:void 0,headers:Object.assign({"Content-Type":"application/json"},t||{},Sn)};try{let t,r=5,c=500;for(;t=a?await a(e,s):await i(e,s),429===t.status&&!0!==o&&(r-=1,0!==r);)console.error(`Server responded with ${t.status} ${t.statusText}. Retrying after ${c}ms delay...`),await lt(c),c*=2;const l=await t.text();t.ok?n(null,l):n(new Error(`${t.status} ${t.statusText}: ${l}`))}catch(e){e instanceof Error&&n(e)}}),{})}(e,n,o,s,i,a),this._rpcRequest=(c=this._rpcClient,(e,t)=>new Promise(((r,n)=>{c.request(e,t,((e,t)=>{e?n(e):r(t)}))}))),this._rpcBatchRequest=function(e){return t=>new Promise(((r,n)=>{0===t.length&&r([]);const o=t.map((t=>e.request(t.methodName,t.args)));e.request(o,((e,t)=>{e?n(e):r(t)}))}))}(this._rpcClient),this._rpcWebSocket=new Ot(this._rpcWsEndpoint,{autoconnect:!1,max_reconnects:1/0}),this._rpcWebSocket.on("open",this._wsOnOpen.bind(this)),this._rpcWebSocket.on("error",this._wsOnError.bind(this)),this._rpcWebSocket.on("close",this._wsOnClose.bind(this)),this._rpcWebSocket.on("accountNotification",this._wsOnAccountNotification.bind(this)),this._rpcWebSocket.on("programNotification",this._wsOnProgramAccountNotification.bind(this)),this._rpcWebSocket.on("slotNotification",this._wsOnSlotNotification.bind(this)),this._rpcWebSocket.on("slotsUpdatesNotification",this._wsOnSlotUpdatesNotification.bind(this)),this._rpcWebSocket.on("signatureNotification",this._wsOnSignatureNotification.bind(this)),this._rpcWebSocket.on("rootNotification",this._wsOnRootNotification.bind(this)),this._rpcWebSocket.on("logsNotification",this._wsOnLogsNotification.bind(this))}get commitment(){return this._commitment}get rpcEndpoint(){return this._rpcEndpoint}async getBalanceAndContext(e,t){const{commitment:r,config:n}=Lt(t),o=this._buildArgs([e.toBase58()],r,void 0,n),s=await this._rpcRequest("getBalance",o),i=(0,B.vt)(s,Ht((0,B.ai)()));if("error"in i)throw new at(i.error,`failed to get balance for ${e.toBase58()}`);return i.result}async getBalance(e,t){return await this.getBalanceAndContext(e,t).then((e=>e.value)).catch((t=>{throw new Error("failed to get balance of account "+e.toBase58()+": "+t)}))}async getBlockTime(e){const t=await this._rpcRequest("getBlockTime",[e]),r=(0,B.vt)(t,qt((0,B.me)((0,B.ai)())));if("error"in r)throw new at(r.error,`failed to get block time for slot ${e}`);return r.result}async getMinimumLedgerSlot(){const e=await this._rpcRequest("minimumLedgerSlot",[]),t=(0,B.vt)(e,qt((0,B.ai)()));if("error"in t)throw new at(t.error,"failed to get minimum ledger slot");return t.result}async getFirstAvailableBlock(){const e=await this._rpcRequest("getFirstAvailableBlock",[]),t=(0,B.vt)(e,gr);
2if("error"in t)throw new at(t.error,"failed to get first available block");return t.result}async getSupply(e){let t={};t="string"==typeof e?{commitment:e}:e?{...e,commitment:e&&e.commitment||this.commitment}:{commitment:this.commitment};const r=await this._rpcRequest("getSupply",[t]),n=(0,B.vt)(r,mr);if("error"in n)throw new at(n.error,"failed to get supply");return n.result}async getTokenSupply(e,t){const r=this._buildArgs([e.toBase58()],t),n=await this._rpcRequest("getTokenSupply",r),o=(0,B.vt)(n,Ht(yr));if("error"in o)throw new at(o.error,"failed to get token supply");return o.result}async getTokenAccountBalance(e,t){const r=this._buildArgs([e.toBase58()],t),n=await this._rpcRequest("getTokenAccountBalance",r),o=(0,B.vt)(n,Ht(yr));if("error"in o)throw new at(o.error,"failed to get token account balance");return o.result}async getTokenAccountsByOwner(e,t,r){const{commitment:n,config:o}=Lt(r);let s=[e.toBase58()];"mint"in t?s.push({mint:t.mint.toBase58()}):s.push({programId:t.programId.toBase58()});const i=this._buildArgs(s,n,"base64",o),a=await this._rpcRequest("getTokenAccountsByOwner",i),c=(0,B.vt)(a,wr);if("error"in c)throw new at(c.error,`failed to get token accounts owned by account ${e.toBase58()}`);return c.result}async getParsedTokenAccountsByOwner(e,t,r){let n=[e.toBase58()];"mint"in t?n.push({mint:t.mint.toBase58()}):n.push({programId:t.programId.toBase58()});const o=this._buildArgs(n,r,"jsonParsed"),s=await this._rpcRequest("getTokenAccountsByOwner",o),i=(0,B.vt)(s,Ar);if("error"in i)throw new at(i.error,`failed to get token accounts owned by account ${e.toBase58()}`);return i.result}async getLargestAccounts(e){const t={...e,commitment:e&&e.commitment||this.commitment},r=t.filter||t.commitment?[t]:[],n=await this._rpcRequest("getLargestAccounts",r),o=(0,B.vt)(n,Tr);if("error"in o)throw new at(o.error,"failed to get largest accounts");return o.result}async getTokenLargestAccounts(e,t){const r=this._buildArgs([e.toBase58()],t),n=await this._rpcRequest("getTokenLargestAccounts",r),o=(0,B.vt)(n,br);if("error"in o)throw new at(o.error,"failed to get token largest accounts");return o.result}async getAccountInfoAndContext(e,t){const{commitment:r,config:n}=Lt(t),o=this._buildArgs([e.toBase58()],r,"base64",n),s=await this._rpcRequest("getAccountInfo",o),i=(0,B.vt)(s,Ht((0,B.me)(Pr)));if("error"in i)throw new at(i.error,`failed to get info about account ${e.toBase58()}`);return i.result}async getParsedAccountInfo(e,t){const{commitment:r,config:n}=Lt(t),o=this._buildArgs([e.toBase58()],r,"jsonParsed",n),s=await this._rpcRequest("getAccountInfo",o),i=(0,B.vt)(s,Ht((0,B.me)(kr)));if("error"in i)throw new at(i.error,`failed to get info about account ${e.toBase58()}`);return i.result}async getAccountInfo(e,t){try{return(await this.getAccountInfoAndContext(e,t)).value}catch(t){throw new Error("failed to get info about account "+e.toBase58()+": "+t)}}async getMultipleParsedAccounts(e,t){const{commitment:r,config:n}=Lt(t),o=e.map((e=>e.toBase58())),s=this._buildArgs([o],r,"jsonParsed",n),i=await this._rpcRequest("getMultipleAccounts",s),a=(0,B.vt)(i,Ht((0,B.YO)((0,B.me)(kr))));if("error"in a)throw new at(a.error,`failed to get info for accounts ${o}`);return a.result}async getMultipleAccountsInfoAndContext(e,t){const{commitment:r,config:n}=Lt(t),o=e.map((e=>e.toBase58())),s=this._buildArgs([o],r,"base64",n),i=await this._rpcRequest("getMultipleAccounts",s),a=(0,B.vt)(i,Ht((0,B.YO)((0,B.me)(Pr))));if("error"in a)throw new at(a.error,`failed to get info for accounts ${o}`);return a.result}async getMultipleAccountsInfo(e,t){return(await this.getMultipleAccountsInfoAndContext(e,t)).value}async getStakeActivation(e,t,r){const{commitment:n,config:o}=Lt(t),s=this._buildArgs([e.toBase58()],n,void 0,{...o,epoch:null!=r?r:o?.epoch}),i=await this._rpcRequest("getStakeActivation",s),a=(0,B.vt)(i,qt(Ir));if("error"in a)throw new at(a.error,`failed to get Stake Activation ${e.toBase58()}`);return a.result}async getProgramAccounts(e,t){const{commitment:r,config:n}=Lt(t),{encoding:o,...s}=n||{},i=this._buildArgs([e.toBase58()],r,o||"base64",{...s,...s.filters?{filters:Ft(s.filters)}:null}),a=await this._rpcRequest("getProgramAccounts",i),c=(0,B.YO)(Er),l=!0===s.withContext?(0,B.vt)(a,Ht(c)):(0,B.vt)(a,qt(c));if("error"in l)throw new at(l.error,`failed to get accounts owned by program ${e.toBase58()}`);return l.result}async getParsedProgramAccounts(e,t){const{commitment:r,config:n}=Lt(t),o=this._buildArgs([e.toBase58()],r,"jsonParsed",n),s=await this._rpcRequest("getProgramAccounts",o),i=(0,B.vt)(s,qt((0,B.YO)(_r)));if("error"in i)throw new at(i.error,`failed to get accounts owned by program ${e.toBase58()}`);return i.result}async confirmTransaction(e,t){let r,n;if("string"==typeof e)r=e;else{const t=e;if(t.abortSignal?.aborted)return Promise.reject(t.abortSignal.reason);r=t.signature}try{n=c().decode(r)}catch(e){throw new Error("signature must be base58 encoded: "+r)}
2return Re(64===n.length,"signature has invalid length"),"string"==typeof e?await this.confirmTransactionUsingLegacyTimeoutStrategy({commitment:t||this.commitment,signature:r}):"lastValidBlockHeight"in e?await this.confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:t||this.commitment,strategy:e}):await this.confirmTransactionUsingDurableNonceStrategy({commitment:t||this.commitment,strategy:e})}getCancellationPromise(e){return new Promise(((t,r)=>{null!=e&&(e.aborted?r(e.reason):e.addEventListener("abort",(()=>{r(e.reason)})))}))}getTransactionConfirmationPromise({commitment:e,signature:t}){let r,n,o=!1;return{abortConfirmation:()=>{n&&(n(),n=void 0),null!=r&&(this.removeSignatureListener(r),r=void 0)},confirmationPromise:new Promise(((s,i)=>{try{r=this.onSignature(t,((e,t)=>{r=void 0;const n={context:t,value:e};s({__type:qe.PROCESSED,response:n})}),e);const a=new Promise((e=>{null==r?e():n=this._onSubscriptionStateChange(r,(t=>{"subscribed"===t&&e()}))}));(async()=>{if(await a,o)return;const r=await this.get
2SignatureStatus(t);if(o)return;if(null==r)return;const{context:n,value:c}=r;if(null!=c)if(c?.err)i(c.err);else{switch(e){case"confirmed":case"single":case"singleGossip":if("processed"===c.confirmationStatus)return;break;case"finalized":case"max":case"root":if("processed"===c.confirmationStatus||"confirmed"===c.confirmationStatus)return}o=!0,s({__type:qe.PROCESSED,response:{context:n,value:c}})}})()}catch(e){i(e)}}))}}async confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:e,strategy:{abortSignal:t,lastValidBlockHeight:r,signature:n}}){let o=!1;const s=new Promise((t=>{const n=async()=>{try{return await this.getBlockHeight(e)}catch(e){return-1}};(async()=>{let e=await n();if(!o){for(;e<=r;){if(await lt(1e3),o)return;if(e=await n(),o)return}t({__type:qe.BLOCKHEIGHT_EXCEEDED})}})()})),{abortConfirmation:i,confirmationPromise:a}=this.getTransactionConfirmationPromise({commitment:e,signature:n}),c=this.getCancellationPromise(t);let l;try{const e=await Promise.race([c,a,s]);if(e.__type!==qe.PROCESSED)throw new ke(n);l=e.response}finally{o=!0,i()}return l}async confirmTransactionUsingDurableNonceStrategy({commitment:e,strategy:{abortSignal:t,minContextSlot:r,nonceAccountPubkey:n,nonceValue:o,signature:s}}){let i=!1;const a=new Promise((t=>{let s=o,a=null;const c=async()=>{try{const{context:t,value:o}=await this.getNonceAndContext(n,{commitment:e,minContextSlot:r});return a=t.slot,o?.nonce}catch(e){return s}};(async()=>{if(s=await c(),!i)for(;;){if(o!==s)return void t({__type:qe.NONCE_INVALID,slotInWhichNonceDidAdvance:a});if(await lt(2e3),i)return;if(s=await c(),i)return}})()})),{abortConfirmation:c,confirmationPromise:l}=this.getTransactionConfirmationPromise({commitment:e,signature:s}),u=this.getCancellationPromise(t);let d;try{const t=await Promise.race([u,l,a]);if(t.__type===qe.PROCESSED)d=t.response;else{let n;for(;;
2){const e=await this.getSignatureStatus(s);if(null==e)break;if(!(e.context.slot<(t.slotInWhichNonceDidAdvance??r))){n=e;break}await lt(400)}if(!n?.value)throw new Ie(s);{const t=e||"finalized",{confirmationStatus:r}=n.value;switch(t){case"processed":case"recent":if("processed"!==r&&"confirmed"!==r&&"finalized"!==r)throw new Ie(s);break;case"confirmed":case"single":case"singleGossip":if("confirmed"!==r&&"finalized"!==r)throw new Ie(s);break;case"finalized":case"max":case"root":if("finalized"!==r)throw new Ie(s)}d={context:n.context,value:{err:n.value.err}}}}}finally{i=!0,c()}return d}async confirmTransactionUsingLegacyTimeoutStrategy({commitment:e,signature:t}){let r;const n=new Promise((t=>{let n=this._confirmTransactionInitialTimeout||6e4;switch(e){case"processed":case"recent":case"single":case"confirmed":case"singleGossip":n=this._confirmTransactionInitialTimeout||3e4}r=setTimeout((()=>t({__type:qe.TIMED_OUT,timeoutMs:n})),n)})),{abortConfirmation:o,confirmationPromise:s}=this.getTransactionConfirmationPromise({commitment:e,signature:t});let i;try{const e=await Promise.race([s,n]);if(e.__type!==qe.PROCESSED)throw new _e(t,e.timeoutMs/1e3);i=e.response}finally{clearTimeout(r),o()}return i}async getClusterNodes(){const e=await this._rpcRequest("getClusterNodes",[]),t=(0,B.vt)(e,qt((0,B.YO)(Lr)));if("error"in t)throw new at(t.error,"failed to get cluster nodes");return t.result}async getVoteAccounts(e){const t=this._buildArgs([],e),r=await this._rpcRequest("getVoteAccounts",t),n=(0,B.vt)(r,zr);if("error"in n)throw new at(n.error,"failed to get vote accounts");return n.result}async getSlot(e){const{commitment:t,config:r}=Lt(e),n=this._buildArgs([],t,void 0,r),o=await this._rpcRequest("getSlot",n),s=(0,B.vt)(o,qt((0,B.ai)()));if("error"in s)throw new at(s.error,"failed to get slot");return s.result}async getSlotLeader(e){const{commitment:t,config:r}=Lt(e),n=this._buildArgs([],t,void 0,r),o=await this._rpcRequest("getSlotLeader",n),s=(0,B.vt)(o,qt((0,B.Yj)()));if("error"in s)throw new at(s.error,"failed to get slot leader");return s.result}async getSlotLeaders(e,t){const r=[e,t],n=await this._rpcRequest("getSlotLeaders",r),o=(0,B.vt)(n,qt((0,B.YO)(Rt)));if("error"in o)throw new at(o.error,"failed to get slot leaders");return o.result}async getSignatureStatus(e,t){const{context:r,value:n}
2=await this.getSignatureStatuses([e],t);Re(1===n.length);return{context:r,value:n[0]}}async getSignatureStatuses(e,t){const r=[e];t&&r.push(t);const n=await this._rpcRequest("getSignatureStatuses",r),o=(0,B.vt)(n,Hr);if("error"in o)throw new at(o.error,"failed to get signature status");return o.result}async getTransactionCount(e){const{commitment:t,config:r}=Lt(e),n=this._buildArgs([],t,void 0,r),o=await this._rpcRequest("getTransactionCount",n),s=(0,B.vt)(o,qt((0,B.ai)()));if("error"in s)throw new at(s.error,"failed to get transaction count");return s.result}async getTotalSupply(e){return(await this.getSupply({commitment:e,excludeNonCirculatingAccountsList:!0})).value.total}async getInflationGovernor(e){const t=this._buildArgs([],e),r=await this._rpcRequest("getInflationGovernor",t),n=(0,B.vt)(r,lr);if("error"in n)throw new at(n.error,"failed to get inflation");return n.result}async getInflationReward(e,t,r){const{commitment:n,config:o}=Lt(r),s=this._buildArgs([e.map((e=>e.toBase58()))],n,void 0,{...o,epoch:null!=t?t:o?.epoch}),i=await this._rpcRequest("getInflationReward",s),a=(0,B.vt)(i,Yt);if("error"in a)throw new at(a.error,"failed to get inflation reward");return a.result}async getInflationRate(){const e=await this._rpcRequest("getInflationRate",[]),t=(0,B.vt)(e,ur);if("error"in t)throw new at(t.error,"failed to get inflation rate");return t.result}async getEpochInfo(e){const{commitment:t,config:r}=Lt(e),n=this._buildArgs([],t,void 0,r),o=await this._rpcRequest("getEpochInfo",n),s=(0,B.vt)(o,hr);if("error"in s)throw new at(s.error,"failed to get epoch info");return s.result}async getEpochSchedule(){const e=await this._rpcRequest("getEpochSchedule",[]),t=(0,B.vt)(e,pr);if("error"in t)throw new at(t.error,"failed to get epoch schedule");const r=t.result;return new xt(r.slotsPerEpoch,r.leaderScheduleSlotOffset,r.warmup,r.firstNormalEpoch,r.firstNormalSlot)}async getLeaderSchedule(){const e=await this._rpcRequest("getLeaderSchedule",[]),t=(0,B.vt)(e,fr);if("error"in t)throw new at(t.error,"failed to get leader schedule");return t.result}async getMinimumBalanceForRentExemption(e,t){const r=this._buildArgs([e],t),n=await this._rpcRequest("getMinimumBalanceForRentExemption",r),o=(0,B.vt)(n,Kr);return"error"in o?(console.warn("Unable to fetch minimum balance for rent exemption"),0):o.result}async getRecentBlockhashAndContext(e){const{context:t,value:{blockhash:r}}=await this.getLatestBlockhashAndContext(e);return{context:t,value:{blockhash:r,feeCalculator:{get lamportsPerSignature(){throw new Error("The capability to fetch `lamportsPerSignature` using the `getRecentBlockhash` API is no longer offered by the network. Use the `getFeeForMessage` API to obtain the fee for a given message.")},toJSON:()=>({})}}}}async getRecentPerformanceSamples(e){const t=await this._rpcRequest("getRecentPerformanceSamples",e?[e]:[]),r=(0,B.vt)(t,Pn);if("error"in r)throw new at(r.error,"failed to get recent performance samples");return r.result}async getFeeCalculatorForBlockhash(e,t){const r=this._buildArgs([e],t),n=await this._rpcRequest("getFeeCalculatorForBlockhash",r),o=(0,B.vt)(n,En);if("error"in o)throw new at(o.error,"failed to get fee calculator");const{context:s,value:i}=o.result;return{context:s,value:null!==i?i.feeCalculator:null}}async getFeeForMessage(e,t){const r=he(e.serialize()).toString("base64"),n=this._buildArgs([r],t),o=await this._rpcRequest("getFeeForMessage",n),s=(0,B.vt)(o,Ht((0,B.me)((0,B.ai)())));if("error"in s)throw new at(s.error,"failed to get fee for message");if(null===s.result)throw new Error("invalid blockhash");return s.result}async getRecentPrioritizationFees(e){const t=e?.lockedWritableAccounts?.map((e=>e.toBase58())),r=t?.length?[t]:[],n=await this._rpcRequest("getRecentPrioritizationFees",r),o=(0,B.vt)(n,dr);if("error"in o)throw new at(o.error,"failed to get recent prioritization fees");return o.result}async getRecentBlockhash(e){try{return(await this.getRecentBlockhashAndContext(e)).value}catch(e){throw new Error("failed to get recent blockhash: "+e)}}async getLatestBlockhash(e){try{return(await this.getLatestBlockhashAndContext(e)).value}catch(e){throw new Error("failed to get recent blockhash: "+e)}}async getLatestBlockhashAndContext(e){const{commitment:t,config:r}=Lt(e),n=this._buildArgs([],t,void 0,r),o=await this._rpcRequest("getLatestBlockhash",n),s=(0,B.vt)(o,vn);if("error"in s)throw new at(s.error,"failed to get latest blockhash");return s.result}async isBlockhashValid(e,t){const{commitment:r,config:n}=Lt(t),o=this._buildArgs([e],r,void 0,n),s=await this._rpcRequest("isBlockhashValid",o),i=(0,B.vt)(s,An);if("error"in i)throw new at(i.error,"failed to determine if the blockhash `"+e+"`is valid");return i.result}async getVersion(){const e=await this._rpcRequest("getVersion",[]),t=(0,B.vt)(e,qt(or));if("error"in t)throw new at(t.error,"failed to get version");return t.result}async getGenesisHash(){const e=await this._rpcRequest("getGenesisHash",[]),t=(0,B.vt)(e,qt((0,B.Yj)()));if("error"in t)throw new at(t.error,"failed to get genesis hash");return t.result}async getBlock(e,t){const{commitment:r,config:n}=Lt(t),o=this._buildArgsAtLeastConfirmed([e],r,void 0,n),s=await this._rpcRequest("getBlock",o);
2try{switch(n?.transactionDetails){case"accounts":{const e=(0,B.vt)(s,hn);if("error"in e)throw e.error;return e.result}case"none":{const e=(0,B.vt)(s,dn);if("error"in e)throw e.error;return e.result}default:{const e=(0,B.vt)(s,un);if("error"in e)throw e.error;const{result:t}=e;return t?{...t,transactions:t.transactions.map((({transaction:e,meta:t,version:r})=>({meta:t,transaction:{...e,message:$t(r,e.message)},version:r})))}:null}}}catch(e){throw new at(e,"failed to get confirmed block")}}async getParsedBlock(e,t){const{commitment:r,config:n}=Lt(t),o=this._buildArgsAtLeastConfirmed([e],r,"jsonParsed",n),s=await this._rpcRequest("getBlock",o);try{switch(n?.transactionDetails){case"accounts":{const e=(0,B.vt)(s,fn);if("error"in e)throw e.error;return e.result}case"none":{const e=(0,B.vt)(s,gn);if("error"in e)throw e.error;return e.result}default:{const e=(0,B.vt)(s,pn);if("error"in e)throw e.error;return e.result}}}catch(e){throw new at(e,"failed to get block")}}async getBlockProduction(e){let t,r;if("string"==typeof e)r=e;else if(e){const{commitment:n,...o}=e;r=n,t=o}const n=this._buildArgs([],r,"base64",t),o=await this._rpcRequest("getBlockProduction",n),s=(0,B.vt)(o,cr);if("error"in s)throw new at(s.error,"failed to get block production information");return s.result}async getTransaction(e,t){const{commitment:r,config:n}=Lt(t),o=this._buildArgsAtLeastConfirmed([e],r,void 0,n),s=await this._rpcRequest("getTransaction",o),i=(0,B.vt)(s,bn);if("error"in i)throw new at(i.error,"failed to get transaction");const a=i.result;return a?{...a,transaction:{...a.transaction,message:$t(a.version,a.transaction.message)}}:a}async getParsedTransaction(e,t){const{commitment:r,config:n}=Lt(t),o=this._buildArgsAtLeastConfirmed([e],r,"jsonParsed",n),s=await this._rpcRequest("getTransaction",o),i=(0,B.vt)(s,wn);if("error"in i)throw new at(i.error,"failed to get transaction");return i.result}async getParsedTransactions(e,t){const{commitment:r,config:n}=Lt(t),o=e.map((e=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([e],r,"jsonParsed",n)})));return(await this._rpcBatchRequest(o)).map((e=>{const t=(0,B.vt)(e,wn);if("error"in t)throw new at(t.error,"failed to get transactions");return t.result}))}async getTransactions(e,t){const{commitment:r,config:n}=Lt(t),o=e.map((e=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([e],r,void 0,n)})));return(await this._rpcBatchRequest(o)).map((e=>{const t=(0,B.vt)(e,bn);if("error"in t)throw new at(t.error,"failed to get transactions");const r=t.result;return r?{...r,transaction:{...r.transaction,message:$t(r.version,r.transaction.message)}}:r}))}async getConfirmedBlock(e,t){const r=this._buildArgsAtLeastConfirmed([e],t),n=await this._rpcRequest("getBlock",r),o=(0,B.vt)(n,mn);if("error"in o)throw new at(o.error,"failed to get confirmed block");const s=o.result;if(!s)throw new Error("Confirmed block "+e+" not found");const i={...s,transactions:s.transactions.map((({transaction:e,meta:t})=>{const r=new Fe(e.message);return{meta:t,transaction:{...e,message:r}}}))};return{...i,transactions:i.transactions.map((({transaction:e,meta:t})=>({meta:t,transaction:$e.populate(e.message,e.signatures)})))}}async getBlocks(e,t,r){const n=this._buildArgsAtLeastConfirmed(void 0!==t?[e,t]:[e],r),o=await this._rpcRequest("getBlocks",n),s=(0,B.vt)(o,qt((0,B.YO)((0,B.ai)())));if("error"in s)throw new at(s.error,"failed to get blocks");return s.result}async getBlockSignatures(e,t){const r=this._buildArgsAtLeastConfirmed([e],t,void 0,{transactionDetails:"signatures",rewards:!1}),n=await this._rpcRequest("getBlock",r),o=(0,B.vt)(n,yn);if("error"in o)throw new at(o.error,"failed to get block");const s=o.result;if(!s)throw new Error("Block "+e+" not found");return s}async getConfirmedBlockSignatures(e,t){const r=this._buildArgsAtLeastConfirmed([e],t,void 0,{transactionDetails:"signatures",rewards:!1}),n=await this._rpcRequest("getBlock",r),o=(0,B.vt)(n,yn);if("error"in o)throw new at(o.error,"failed to get confirmed block");const s=o.result;if(!s)throw new Error("Confirmed block "+e+" not found");return s}async getConfirmedTransaction(e,t){const r=this._buildArgsAtLeastConfirmed([e],t),n=await this._rpcRequest("getTransaction",r),o=(0,B.vt)(n,bn);if("error"in o)throw new at(o.error,"failed to get transaction");const s=o.result;if(!s)return s;const i=new Fe(s.transaction.message),a=s.transaction.signatures;return{...s,transaction:$e.populate(i,a)}}async getParsedConfirmedTransaction(e,t){const r=this._buildArgsAtLeastConfirmed([e],t,"jsonParsed"),n=await this._rpcRequest("getTransaction",r),o=(0,B.vt)(n,wn);if("error"in o)throw new at(o.error,"failed to get confirmed transaction");return o.result}async getParsedConfirmedTransactions(e,t){const r=e.map((e=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([e],t,"jsonParsed")})));return(await this._rpcBatchRequest(r)).map((e=>{const t=(0,B.vt)(e,wn);if("error"in t)throw new at(t.error,"failed to get confirmed transactions");return t.result}))}async getConfirmedSignaturesForAddress(e,t,r){let n={},o=await this.getFirstAvailableBlock();for(;!("until"in n)&&!(--t<=0||t<o);)try{const e=await this.getConfirmedBlockSignatures(t,"finalized");
2e.signatures.length>0&&(n.until=e.signatures[e.signatures.length-1].toString())}catch(e){if(e instanceof Error&&e.message.includes("skipped"))continue;throw e}let s=await this.getSlot("finalized");for(;!("before"in n||++r>s);)try{const e=await this.getConfirmedBlockSignatures(r);e.signatures.length>0&&(n.before=e.signatures[e.signatures.length-1].toString())}catch(e){if(e instanceof Error&&e.message.includes("skipped"))continue;throw e}return(await this.getConfirmedSignaturesForAddress2(e,n)).map((e=>e.signature))}async getConfirmedSignaturesForAddress2(e,t,r){const n=this._buildArgsAtLeastConfirmed([e.toBase58()],r,void 0,t),o=await this._rpcRequest("getConfirmedSignaturesForAddress2",n),s=(0,B.vt)(o,Sr);if("error"in s)throw new at(s.error,"failed to get confirmed signatures for address");return s.result}async getSignaturesForAddress(e,t,r){const n=this._buildArgsAtLeastConfirmed([e.toBase58()],r,void 0,t),o=await this._rpcRequest("getSignaturesForAddress",n),s=(0,B.vt)(o,xr);if("error"in s)throw new at(s.error,"failed to get signatures for address");return s.result}async getAddressLookupTable(e,t){const{context:r,value:n}=await this.getAccountInfoAndContext(e,t);let o=null;return null!==n&&(o=new Mt({key:e,state:Mt.deserialize(n.data)})),{context:r,value:o}}async getNonceAndContext(e,t){const{context:r,value:n}=await this.getAccountInfoAndContext(e,t);let o=null;return null!==n&&(o=gt.fromAccountData(n.data)),{context:r,value:o}}async getNonce(e,t){return await this.getNonceAndContext(e,t).then((e=>e.value)).catch((t=>{throw new Error("failed to get nonce for account "+e.toBase58()+": "+t)}))}async requestAirdrop(e,t){const r=await this._rpcRequest("requestAirdrop",[e.toBase58(),t]),n=(0,B.vt)(r,Cn);if("error"in n)throw new at(n.error,`airdrop to ${e.toBase58()} failed`);return n.result}async _blockhashWithExpiryBlockHeight(e){if(!e){for(;this._pollingBlockhash;)await lt(100);const e=Date.now()-this._blockhashInfo.lastFetch>=Dt;if(null!==this._blockhashInfo.latestBlockhash&&!e)return this._blockhashInfo.latestBlockhash}return await this._pollNewBlockhash()}async _pollNewBlockhash(){this._pollingBlockhash=!0;try{const e=Date.now(),t=this._blockhashInfo.latestBlockhash,r=t?t.blockhash:null;for(let e=0;e<50;e++){const e=await this.getLatestBlockhash("finalized");if(r!==e.blockhash)return this._blockhashInfo={latestBlockhash:e,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},e;await lt(200)}throw new Error(`Unable to obtain a new blockhash after ${Date.now()-e}ms`)}finally{this._pollingBlockhash=!1}}async getStakeMinimumDelegation(e){const{commitment:t,config:r}=Lt(e),n=this._buildArgs([],t,"base64",r),o=await this._rpcRequest("getStakeMinimumDelegation",n),s=(0,B.vt)(o,Ht((0,B.ai)()));if("error"in s)throw new at(s.error,"failed to get stake minimum delegation");return s.result}async simulateTransaction(e,t,r){if("message"in e){const o=e.serialize(),s=n.Buffer.from(o).toString("base64");if(Array.isArray(t)||void 0!==r)throw new Error("Invalid arguments");const i=t||{};i.encoding="base64","commitment"in i||(i.commitment=this.commitment),t&&"object"==typeof t&&"innerInstructions"in t&&(i.innerInstructions=t.innerInstructions);const a=[s,i],c=await this._rpcRequest("simulateTransaction",a),l=(0,B.vt)(c,ar);if("error"in l)throw new Error("failed to simulate transaction: "+l.error.message);return l.result}let o;if(e instanceof $e){let t=e;o=new $e,o.feePayer=t.feePayer,o.instructions=e.instructions,o.nonceInfo=t.nonceInfo,o.signatures=t.signatures}else o=$e.populate(e),o._message=o._json=void 0;if(void 0!==t&&!Array.isArray(t))throw new Error("Invalid arguments");const s=t;if(o.nonceInfo&&s)o.sign(...s);else{let e=this._disableBlockhashCaching;for(;;){const t=await this._blockhashWithExpiryBlockHeight(e);if(o.lastValidBlockHeight=t.lastValidBlockHeight,o.recentBlockhash=t.blockhash,!s)break;if(o.sign(...s),!o.signature)throw new Error("!signature");const r=o.signature.toString("base64");if(!this._blockhashInfo.simulatedSignatures.includes(r)&&!this._blockhashInfo.transactionSignatures.includes(r)){this._blockhashInfo.simulatedSignatures.push(r);break}e=!0}}const i=o._compile(),a=i.serialize(),c=o._serialize(a).toString("base64"),l={encoding:"base64",commitment:this.commitment};if(r){const e=(Array.isArray(r)?r:i.nonProgramIds()).map((e=>
2e.toBase58()));l.accounts={encoding:"base64",addresses:e}}s&&(l.sigVerify=!0),t&&"object"==typeof t&&"innerInstructions"in t&&(l.innerInstructions=t.innerInstructions);const u=[c,l],d=await this._rpcRequest("simulateTransaction",u),h=(0,B.vt)(d,ar);if("error"in h){let e;if("data"in h.error&&(e=h.error.data.logs,e&&Array.isArray(e))){const t="\n ",r=t+e.join(t);console.error(h.error.message,r)}throw new st({action:"simulate",signature:"",transactionMessage:h.error.message,logs:e})}return h.result}async sendTransaction(e,t,r){if("version"in e){if(t&&Array.isArray(t))throw new Error("Invalid arguments");const r=e.serialize();return await this.sendRawTransaction(r,t)}if(void 0===t||!Array.isArray(t))throw new Error("Invalid arguments");const n=t;if(e.nonceInfo)e.sign(...n);else{let t=this._disableBlockhashCaching;for(;;){const r=await this._blockhashWithExpiryBlockHeight(t);if(e.lastValidBlockHeight=r.lastValidBlockHeight,e.recentBlockhash=r.blockhash,e.sign(...n),!e.signature)throw new Error("!signature");const o=e.signature.toString("base64");if(!this._blockhashInfo.transactionSignatures.includes(o)){this._blockhashInfo.transactionSignatures.push(o);break}t=!0}}const o=e.serialize();return await this.sendRawTransaction(o,r)}async sendRawTransaction(e,t){const r=he(e).toString("base64");return await this.sendEncodedTransaction(r,t)}async sendEncodedTransaction(e,t){const r={encoding:"base64"},n=t&&t.skipPreflight,o=!0===n?"processed":t&&t.preflightCommitment||this.commitment;t&&null!=t.maxRetries&&(r.maxRetries=t.maxRetries),t&&null!=t.minContextSlot&&(r.minContextSlot=t.minContextSlot),n&&(r.skipPreflight=n),o&&(r.preflightCommitment=o);const s=[e,r],i=await this._rpcRequest("sendTransaction",s),a=(0,B.vt)(i,kn);if("error"in a){let e;throw"data"in a.error&&(e=a.error.data.logs),new st({action:n?"send":"simulate",signature:"",transactionMessage:a.error.message,logs:e})}return a.result}_wsOnOpen(){this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval((()=>{(async()=>{try{await this._rpcWebSocket.notify("ping")}catch{}})()}),5e3),this._updateSubscriptions()}_wsOnError(e){this._rpcWebSocketConnected=!1,console.error("ws error:",e.message)}_wsOnClose(e){this._rpcWebSocketConnected=!1,this._rpcWebSocketGeneration=(this._rpcWebSocketGeneration+1)%Number.MAX_SAFE_INTEGER,this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null),this._rpcWebSocketHeartbeat&&(clearInterval(this._rpcWebSocketHeartbeat),this._rpcWebSocketHeartbeat=null),1e3!==e?(this._subscriptionCallbacksByServerSubscriptionId={},Object.entries(this._subscriptionsByHash).forEach((([e,t])=>{this._setSubscription(e,{...t,state:"pending"})}))):this._updateSubscriptions()}_setSubscription(e,t){const r=this._subscriptionsByHash[e]?.state;if(this._subscriptionsByHash[e]=t,r!==t.state){const r=this._subscriptionStateChangeCallbacksByHash[e];r&&r.forEach((e=>{try{e(t.state)}catch{}}))}}_onSubscriptionStateChange(e,t){const r=this._subscriptionHashByClientSubscriptionId[e];if(null==r)return()=>{};const n=this._subscriptionStateChangeCallbacksByHash[r]||=new Set;return n.add(t),()=>{n.delete(t),0===n.size&&delete this._subscriptionStateChangeCallbacksByHash[r]}}async _updateSubscriptions(){if(0===Object.keys(this._subscriptionsByHash).length)return void(this._rpcWebSocketConnected&&(this._rpcWebSocketConnected=!1,this._rpcWebSocketIdleTimeout=setTimeout((()=>{this._rpcWebSocketIdleTimeout=null;try{this._rpcWebSocket.close()}catch(e){e instanceof Error&&console.log(`Error when closing socket connection: ${e.message}`)}}),500)));if(null!==this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),!this._rpcWebSocketConnected)return void this._rpcWebSocket.connect();const e=this._rpcWebSocketGeneration,t=()=>e===this._rpcWebSocketGeneration;await Promise.all(Object.keys(this._subscriptionsByHash).map((async e=>{const r=this._subscriptionsByHash[e];if(void 0!==r)switch(r.state){case"pending":case"unsubscribed":if(0===r.callbacks.size)return delete this._subscriptionsByHash[e],"unsubscribed"===r.state&&delete this._subscriptionCallbacksByServerSubscriptionId[r.serverSubscriptionId],void await this._updateSubscriptions();await(async()=>{const{args:n,method:o}=r;try{this._setSubscription(e,{...r,state:"subscribing"});const t=await this._rpcWebSocket.call(o,n);this._setSubscription(e,{...r,serverSubscriptionId:t,state:"subscribed"}),this._subscriptionCallbacksByServerSubscriptionId[t]=r.callbacks,await this._updateSubscriptions()}catch(s){if(console.error(`Received ${s instanceof Error?"":"JSON-RPC "}error calling \`${o}\``,{args:n,error:s}),!t())return;this._setSubscription(e,{...r,state:"pending"}),await this._updateSubscriptions()}})();break;case"subscribed":0===r.callbacks.size&&await(async()=>{const{serverSubscriptionId:n,unsubscribeMethod:o}=r;if(this._subscriptionsAutoDisposedByRpc.has(n))this._subscriptionsAutoDisposedByRpc.delete(n);else{this._setSubscription(e,{...r,state:"unsubscribing"}),this._setSubscription(e,{...r,state:"unsubscribing"});try{await this._rpcWebSocket.call(o,[n])}catch(n){if(n instanceof Error&&console.error(`${o} error:`,n.message),!t())return;return this._setSubscription(e,{...r,state:"subscribed"}),void await this._updateSubscriptions()}}this._setSubscription(e,{...r,state:"unsubscribed"}),await this._updateSubscriptions()})()}})))}_handleServerNotification(e,t){const r=this._subscriptionCallbacksByServerSubscriptionId[e];void 0!==r&&r.forEach((e=>{try{e(...t)}catch(e){console.error(e)}}))}_wsOnAccountNotification(e){const{result:t,subscription:r}=(0,B.vt)(e,Br);this._handleServerNotification(r,[t.value,t.context])}_makeSubscription(e,t){const r=this._nextClientSubscriptionId++,n=It([e.method,t]),o=this._subscriptionsByHash[n];return void 0===o?this._subscriptionsByHash[n]={...e,args:t,callbacks:new Set([e.callback]),state:"pending"}
2:o.callbacks.add(e.callback),this._subscriptionHashByClientSubscriptionId[r]=n,this._subscriptionDisposeFunctionsByClientSubscriptionId[r]=async()=>{delete this._subscriptionDisposeFunctionsByClientSubscriptionId[r],delete this._subscriptionHashByClientSubscriptionId[r];const t=this._subscriptionsByHash[n];Re(void 0!==t,`Could not find a \`Subscription\` when tearing down client subscription #${r}`),t.callbacks.delete(e.callback),await this._updateSubscriptions()},this._updateSubscriptions(),r}onAccountChange(e,t,r){const{commitment:n,config:o}=Lt(r),s=this._buildArgs([e.toBase58()],n||this._commitment||"finalized","base64",o);return this._makeSubscription({callback:t,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},s)}async removeAccountChangeListener(e){await this._unsubscribeClientSubscription(e,"account change")}_wsOnProgramAccountNotification(e){const{result:t,subscription:r}=(0,B.vt)(e,Mr);this._handleServerNotification(r,[{accountId:t.value.pubkey,accountInfo:t.value.account},t.context])}onProgramAccountChange(e,t,r,n){const{commitment:o,config:s}=Lt(r),i=this._buildArgs([e.toBase58()],o||this._commitment||"finalized","base64",s||(n?{filters:Ft(n)}:void 0));return this._makeSubscription({callback:t,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},i)}async removeProgramAccountChangeListener(e){await this._unsubscribeClientSubscription(e,"program account change")}onLogs(e,t,r){const n=this._buildArgs(["object"==typeof e?{mentions:[e.toString()]}:e],r||this._commitment||"finalized");return this._makeSubscription({callback:t,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},n)}async removeOnLogsListener(e){await this._unsubscribeClientSubscription(e,"logs")}_wsOnLogsNotification(e){const{result:t,subscription:r}=(0,B.vt)(e,In);this._handleServerNotification(r,[t.value,t.context])}_wsOnSlotNotification(e){const{result:t,subscription:r}=(0,B.vt)(e,jr);this._handleServerNotification(r,[t])}onSlotChange(e){return this._makeSubscription({callback:e,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}async removeSlotChangeListener(e){await this._unsubscribeClientSubscription(e,"slot change")}_wsOnSlotUpdatesNotification(e){const{result:t,subscription:r}=(0,B.vt)(e,Nr);this._handleServerNotification(r,[t])}onSlotUpdate(e){return this._makeSubscription({callback:e,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}async removeSlotUpdateListener(e){await this._unsubscribeClientSubscription(e,"slot update")}async _unsubscribeClientSubscription(e,t){const r=this._subscriptionDisposeFunctionsByClientSubscriptionId[e];r?await r():console.warn(`Ignored unsubscribe request because an active subscription with id \`${e}\` for '${t}' events could not be found.`)}_buildArgs(e,t,r,n){const o=t||this._commitment;if(o||r||n){let t={};r&&(t.encoding=r),o&&(t.commitment=o),n&&(t=Object.assign(t,n)),e.push(t)}return e}_buildArgsAtLeastConfirmed(e,t,r,n){const o=t||this._commitment;if(o&&!["confirmed","finalized"].includes(o))throw new Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(e,t,r,n)}_wsOnSignatureNotification(e){const{result:t,subscription:r}=(0,B.vt)(e,Ur);"receivedSignature"!==t.value&&this._subscriptionsAutoDisposedByRpc.add(r),this._handleServerNotification(r,"receivedSignature"===t.value?[{type:"received"},t.context]:[{type:"status",result:t.value},t.context])}onSignature(e,t,r){const n=this._buildArgs([e],r||this._commitment||"finalized"),o=this._makeSubscription({callback:(e,r)=>{if("status"===e.type){t(e.result,r);try{this.removeSignatureListener(o)}catch(e){}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},n);return o}onSignatureWithOptions(e,t,r){const{commitment:n,...o}={...r,commitment:r&&r.commitment||this._commitment||"finalized"},s=this._buildArgs([e],n,void 0,o),i=this._makeSubscription({callback:(e,r)=>{t(e,r);try{this.removeSignatureListener(i)}catch(e){}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},s);return i}async removeSignatureListener(e){await this._unsubscribeClientSubscription(e,"signature result")}_wsOnRootNotification(e){const{result:t,subscription:r}=(0,B.vt)(e,Dr);this._handleServerNotification(r,[t])}onRootChange(e){return this._makeSubscription({callback:e,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}async removeRootChangeListener(e){await this._unsubscribeClientSubscription(e,"root change")}}class Bn{constructor(e){this._keypair=void 0,this._keypair=e??ae()}static generate(){return new Bn(ae())}static fromSecretKey(e,t){if(64!==e.byteLength)throw new Error("bad secret key size");const r=e.slice(32,64);if(!t||!t.skipValidation){const t=e.slice(0,32),n=ce(t);for(let e=0;e<32;e++)if(r[e]!==n[e])throw new Error("provided secretKey is invali
2d")}return new Bn({publicKey:r,secretKey:e})}static fromSeed(e){const t=ce(e),r=new Uint8Array(64);return r.set(e),r.set(t,32),new Bn({publicKey:t,secretKey:r})}get publicKey(){return new ve(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}}const On=Object.freeze({CreateLookupTable:{index:0,layout:S.w3([S.DH("instruction"),mt("recentSlot"),S.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:S.w3([S.DH("instruction")])},ExtendLookupTable:{index:2,layout:S.w3([S.DH("instruction"),mt(),S.O6(xe(),S.cY(S.DH(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:S.w3([S.DH("instruction")])},CloseLookupTable:{index:4,layout:S.w3([S.DH("instruction")])}});class Mn{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const t=S.DH("instruction").decode(e.data);let r;for(const[e,n]of Object.entries(On))if(n.index==t){r=e;break}if(!r)throw new Error("Invalid Instruction. Should be a LookupTable Instruction");return r}static decodeCreateLookupTable(e){this.checkProgramId(e.programId),this.checkKeysLength(e.keys,4);const{recentSlot:t}=dt(On.CreateLookupTable,e.data);return{authority:e.keys[1].pubkey,payer:e.keys[2].pubkey,recentSlot:Number(t)}}static decodeExtendLookupTable(e){if(this.checkProgramId(e.programId),e.keys.length<2)throw new Error(`invalid instruction; found ${e.keys.length} keys, expected at least 2`);const{addresses:t}=dt(On.ExtendLookupTable,e.data);return{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey,payer:e.keys.length>2?e.keys[2].pubkey:void 0,addresses:t.map((e=>new ve(e)))}}static decodeCloseLookupTable(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,3),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey,recipient:e.keys[2].pubkey}}static decodeFreezeLookupTable(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,2),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey}}static decodeDeactivateLookupTable(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,2),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey}}static checkProgramId(e){if(!e.equals(Wn.programId))throw new Error("invalid instruction; programId is not AddressLookupTable Program")}static checkKeysLength(e,t){if(e.length<t)throw new Error(`invalid instruction; found ${e.length} keys, expected at least ${t}`)}}class Wn{constructor(){}static createLookupTable(e){const[t,r]=ve.findProgramAddressSync([e.authority.toBuffer(),(0,x.eC)().encode(e.recentSlot)],this.programId),n=ut(On.CreateLookupTable,{recentSlot:BigInt(e.recentSlot),bumpSeed:r}),o=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:wt.programId,isSigner:!1,isWritable:!1}];return[new Ke({programId:this.programId,keys:o,data:n}),t]}static freezeLookupTable(e){const t=ut(On.FreezeLookupTable),r=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new Ke({programId:this.programId,keys:r,data:t})}static extendLookupTable(e){const t=ut(On.ExtendLookupTable,{addresses:e.addresses.map((e=>e.toBytes()))}),r=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return e.payer&&r.push({pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:wt.programId,isSigner:!1,isWritable:!1}),new Ke({programId:this.programId,keys:r,data:t})}static deactivateLookupTable(e){const t=ut(On.DeactivateLookupTable),r=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new Ke({programId:this.programId,keys:r,data:t})}static closeLookupTable(e){const t=ut(On.CloseLookupTable),r=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.recipient,isSigner:!1,isWritable:!0}];return new Ke({programId:this.programId,keys:r,data:t})}}Wn.programId=new ve("AddressLookupTab1e1111111111111111111111111");class jn{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const t=S.u8("instruction").decode(e.data);let r;for(const[e,n]of Object.entries(Rn))if(n.index==t){r=e;break}if(!r)throw new Error("Instruction type incorrect; not a ComputeBudgetInstruction");return r}static decodeRequestUnits(e){this.checkProgramId(e.programId);const{units:t,additionalFee:r}=dt(Rn.RequestUnits,e.data);return{units:t,additionalFee:r}}static decodeRequestHeapFrame(e){this.checkProgramId(e.programId);const{bytes:t}=dt(Rn.RequestHeapFrame,e.data);return{bytes:t}}static decodeSetComputeUnitLimit(e){this.checkProgramId(e.programId);const{units:t}=dt(Rn.SetComputeUnitLimit,e.data);return{units:t}}static decodeSetComputeUnitPrice(e){this.checkProgramId(e.programId);const{microLamports:t}=dt(Rn.SetComputeUnitPrice,e.data);return{microLamports:t}}static checkProgramId(e){if(!e.equals(Nn.programId))throw new Error("invalid instruction; programId is not ComputeBudgetProgram")}}const Rn=Object.freeze({RequestUnits:{index:0,layout:S.w3([S.u8("instruction"),S.DH("units"),S.DH("additionalFee")])},RequestHeapFrame:{index:1,layout:S.w3([S.u8("instruction"),S.DH("bytes")])},SetComputeUnitLimit:{index:2,layout:S.w3([S.u8("instruction"),S.DH("units")])},SetComputeUnitPrice:{index:3,layout:S.w3([S.u8("instruction"),mt("microLamports")])}});class Nn{constructor(){}static requestUnits(e){const t=ut(Rn.RequestUnits,e);return new Ke({keys:[],programId:this.programId,data:t})}static requestHeapFrame(e){const t=ut(Rn.RequestHeapFrame,e);return new Ke({keys:[],programId:this.programId,data:t})}static setComputeUnitLimit(e){const t=ut(Rn.SetComputeUnitLimit,e);return new Ke({keys:[],programId:this.programId,data:t})}static setComputeUnitPrice(e){const t=ut(Rn.SetComputeUnitPrice,{microLamports:BigInt(e.microLamports)});return new Ke({keys:[],programId:this.programId,data:t})}}Nn.programId=new ve("ComputeBudget111111111111111111111111111111");const Un=S.w3([S.u8("numSignatures"),S.u8("padding"),S.NX("signatureOffset"),S.NX("signatureInstructionIndex"),S.NX("publicKeyOffset"),S.NX("publicKeyInstructionIndex"),S.NX("messageDataOffset"),S.NX("messageDataSize"),S.NX("messageInstructionIndex")]
2);class Dn{constructor(){}static createInstructionWithPublicKey(e){const{publicKey:t,message:r,signature:o,instructionIndex:s}=e;Re(32===t.length,`Public Key must be 32 bytes but received ${t.length} bytes`),Re(64===o.length,`Signature must be 64 bytes but received ${o.length} bytes`);const i=Un.span,a=i+t.length,c=a+o.length,l=n.Buffer.alloc(c+r.length),u=s??65535;return Un.encode({numSignatures:1,padding:0,signatureOffset:a,signatureInstructionIndex:u,publicKeyOffset:i,publicKeyInstructionIndex:u,messageDataOffset:c,messageDataSize:r.length,messageInstructionIndex:u},l),l.fill(t,i),l.fill(o,a),l.fill(r,c),new Ke({keys:[],programId:Dn.programId,data:l})}static createInstructionWithPrivateKey(e){const{privateKey:t,message:r,instructionIndex:n}=e;Re(64===t.length,`Private key must be 64 bytes but received ${t.length} bytes`);try{const e=Bn.fromSecretKey(t),o=e.publicKey.toBytes(),s=ue(r,e.secretKey);return this.createInstructionWithPublicKey({publicKey:o,message:r,signature:s,instructionIndex:n})}catch(e){throw new Error(`Error creating instruction; ${e}`)}}}Dn.programId=new ve("Ed25519SigVerify111111111111111111111111111");se.bI.utils.isValidPrivateKey;const Ln=se.bI.getPublicKey,Fn=S.w3([S.u8("numSignatures"),S.NX("signatureOffset"),S.u8("signatureInstructionIndex"),S.NX("ethAddressOffset"),S.u8("ethAddressInstructionIndex"),S.NX("messageDataOffset"),S.NX("messageDataSize"),S.u8("messageInstructionIndex"),S.av(20,"ethAddress"),S.av(64,"signature"),S.u8("recoveryId")]);class zn{constructor(){}static publicKeyToEthAddress(e){Re(64===e.length,`Public key must be 64 bytes but received ${e.length} bytes`);try{return n.Buffer.from(oe(he(e))).slice(-20)}catch(e){throw new Error(`Error constructing Ethereum address: ${e}`)}}static createInstructionWithPublicKey(e){const{publicKey:t,message:r,signature:n,recoveryId:o,instructionIndex:s}=e;return zn.createInstructionWithEthAddress({ethAddress:zn.publicKeyToEthAddress(t),message:r,signature:n,recoveryId:o,instructionIndex:s})}static createInstructionWithEthAddress(e){const{ethAddress:t,message:r,signature:o,recoveryId:s,instructionIndex:i=0}=e;let a;a="string"==typeof t?t.startsWith("0x")?n.Buffer.from(t.substr(2),"hex"):n.Buffer.from(t,"hex"):t,Re(20===a.length,`Address must be 20 bytes but received ${a.length} bytes`);const c=12+a.length,l=c+o.length+1,u=n.Buffer.alloc(Fn.span+r.length);return Fn.encode({numSignatures:1,signatureOffset:c,signatureInstructionIndex:i,ethAddressOffset:12,ethAddressInstructionIndex:i,messageDataOffset:l,messageDataSize:r.length,messageInstructionIndex:i,signature:he(o),ethAddress:he(a),recoveryId:s},u),u.fill(he(r),Fn.span),new Ke({keys:[],programId:zn.programId,data:u})}static createInstructionWithPrivateKey(e){const{privateKey:t,message:r,instructionIndex:o}=e;Re(32===t.length,`Private key must be 32 bytes but received ${t.length} bytes`);try{const e=he(t),s=Ln(e,!1).slice(1),i=n.Buffer.from(oe(he(r))),[a,c]=((e,t)=>{const r=se.bI.sign(e,t);return[r.toCompactRawBytes(),r.recovery]})(i,e);return this.createInstructionWithPublicKey({publicKey:s,message:r,signature:a,recoveryId:c,instructionIndex:o})}catch(e){throw new Error(`Error creating instruction; ${e}`)}}}var Vn;zn.programId=new ve("KeccakSecp256k11111111111111111111111111111");const qn=new ve("StakeConfig11111111111111111111111111111111");class Hn{constructor(e,t){this.staker=void 0,this.withdrawer=void 0,this.staker=e,this.withdrawer=t}}class Kn{constructor(e,t,r){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=e,this.epoch=t,this.custodian=r}}Vn=Kn,Kn.default=new Vn(0,0,ve.default);class $n{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const t=S.DH("instruction").decode(e.data);let r;for(const[e,n]of Object.entries(Gn))if(n.index==t){r=e;break}if(!r)throw new Error("Instruction type incorrect; not a StakeInstruction");return r}static decodeInitialize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{authorized:t,lockup:r}=dt(Gn.Initialize,e.data);return{stakePubkey:e.keys[0].pubkey,authorized:new Hn(new ve(t.staker),new ve(t.withdrawer)),lockup:new Kn(r.unixTimestamp,r.epoch,new ve(r.custodian))}}static decodeDelegate(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,6),dt(Gn.Delegate,e.data),{stakePubkey:e.keys[0].pubkey,votePubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[5].pubkey}}static decodeAuthorize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{newAuthorized:t,stakeAuthorizationType:r}=dt(Gn.Authorize,e.data),n={stakePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey,newAuthorizedPubkey:new ve(t),stakeAuthorizationType:{index:r}};return e.keys.length>3&&(n.custodianPubkey=e.keys[3].pubkey),n}static decodeAuthorizeWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{newAuthorized:t,stakeAuthorizationType:r,authoritySeed:n,authorityOwner:o}=dt(Gn.AuthorizeWithSeed,e.data),s={stakePubkey:e.keys[0].pubkey,authorityBase:e.keys[1].pubkey,authoritySeed:n,authorityOwner:new ve(o),newAuthorizedPubkey:new ve(t),stakeAuthorizationType:{index:r}};return e.keys.length>3&&(s.custodianPubkey=e.keys[3].pubkey),s}static decodeSplit(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{lamports:t}=dt(Gn.Split,e.data);return{stakePubkey:e.keys[0].pubkey,splitStakePubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[2].pubkey,lamports:t}}static decodeMerge(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),dt(Gn.Merge,e.data),{stakePubkey:e.keys[0].pubkey,sourceStakePubKey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey}}static decodeWithdraw(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,5);const{lamports:t}=dt(Gn.Withdraw,e.data),r={stakePubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey,lamports:t};return e.keys.length>5&&(r.custodianPubkey=e.keys[5].pubkey),r}static decodeDeactivate(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),dt(Gn.Deactivate,e.data),{stakePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey}}static checkProgramId(e){if(!e.equals(Jn.programId))throw new Error("invalid instruction; programId is not StakeProgram")}static checkKeyLength(e,t){if(e.length<t)throw new Error(`invalid instruction; found ${e.length} keys, expected at least ${t}`)}}const Gn=Object.freeze({Initialize:{index:0,layout:S.w3([S.DH("instruction"),((e="authorized")=>S.w3([xe("staker"),xe("withdrawer")],e))(),((e="lockup")=>S.w3([S.Wg("unixTimestamp"),S.Wg("epoch"),xe("custodian")],e))()])},Authorize:{index:1,layout:S.w3([S.DH("instruction"),xe("newAuthorized"),S.DH("stakeAuthorizationType")])},Delegate:{index:2,layout:S.w3([S.DH("instruction")])},Split:{index:3,layout:S.w3([S.DH("instruction"),S.Wg("lamports")])},Withdraw:{index:4,layout:S.w3([S.DH("instruction"),S.Wg("lamports")])},Deactivate:{index:5,layout:S.w3([S.DH("instruction")])},Merge:{index:7,layout:S.w3([S.DH("instruction")])},AuthorizeWithSeed:{index:8,layout:S.w3([S.DH("instruction"),xe("newAuthorized"),S.DH("stakeAuthorizationType"),Oe("authoritySeed"),xe("authorityOwner")])}}),Yn=Object.freeze({Staker:{index:0},Withdrawer:{index:1}});class Jn{constructor(){}static initialize(e){const{stakePubkey:t,authorized:r,lockup:n}=e,o=n||Kn.default,s=ut(Gn.Initialize,{authorized:{staker:he(r.staker.toBuffer()),withdrawer:he(r.withdrawer.toBuffer())},lockup:{unixTimestamp:o.unixTimestamp,epoch:o.epoch,custodian:he(o.custodian.toBuffer())}}),i={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:et,isSigner:!1,isWritable:!1}],programId:this.programId,data:s};return new Ke(i)}static createAccountWithSeed(e){const t=new $e;t.add(wt.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:this.space,programId:this.programId}));const{stakePubkey:r,authorized:n,lockup:o}=e;return t.add(this.initialize({stakePubkey:r,authorized:n,lockup:o}))}static createAccount(e){const t=new $e;t.add(wt.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,lamports:e.lamports,space:this.space,programId:this.programId}));const{stakePubkey:r,authorized:n,lockup:o}=e;return t.add(this.initialize({stakePubkey:r,authorized:n,lockup:o}))}static delegate(e){const{stakePubkey:t,authorizedPubkey:r,votePubkey:n}=e,o=ut(Gn.Delegate);return(new $e).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!1},{pubkey:Je,isSigner:!1,isWritable:!1},{pubkey:ot,isSigner:!1,isWritable:!1},{pubkey:qn,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static authorize(e){const{stakePubkey:t,authorizedPubkey:r,newAuthorizedPubkey:n,stakeAuthorizationType:o,custodianPubkey:s}=e,i=ut(Gn.Authorize,{newAuthorized:he(n.toBuffer()),stakeAuthorizationType:o.index}),a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Je,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}];return s&&a.push({pubkey:s,isSigner:!0,isWritable:!1}),(new $e).add({keys:a,programId:this.programId,data:i})}static authorizeWithSeed(e){const{stakePubkey:t,authorityBase:r,authoritySeed:n,authorityOwner:o,newAuthorizedPubkey:s,stakeAuthorizationType:i,custodianPubkey:a}=e,c=ut(Gn.AuthorizeWithSeed,{newAuthorized:he(s.toBuffer()),stakeAuthorizationType:i.index,authoritySeed:n,authorityOwner:he(o.toBuffer())}),l=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1},{pubkey:Je,isSigner:!1,isWritable:!1}];return a&&l.push({pubkey:a,isSigner:!0,isWritable:!1}),(new $e).add({keys:l,programId:this.programId,data:c})}static splitInstruction(e){const{stakePubkey:t,authorizedPubkey:r,splitStakePubkey:n,lamports:o}=e,s=ut(Gn.Split,{lamports:o});return new Ke({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:s})}static split(e,t){const r=new $e;return r.add(wt.createAccount({fromPubkey:e.authorizedPubkey,newAccountPubkey:e.splitStakePubkey,lamports:t,space
2:this.space,programId:this.programId})),r.add(this.splitInstruction(e))}static splitWithSeed(e,t){const{stakePubkey:r,authorizedPubkey:n,splitStakePubkey:o,basePubkey:s,seed:i,lamports:a}=e,c=new $e;return c.add(wt.allocate({accountPubkey:o,basePubkey:s,seed:i,space:this.space,programId:this.programId})),t&&t>0&&c.add(wt.transfer({fromPubkey:e.authorizedPubkey,toPubkey:o,lamports:t})),c.add(this.splitInstruction({stakePubkey:r,authorizedPubkey:n,splitStakePubkey:o,lamports:a}))}static merge(e){const{stakePubkey:t,sourceStakePubKey:r,authorizedPubkey:n}=e,o=ut(Gn.Merge);return(new $e).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:Je,isSigner:!1,isWritable:!1},{pubkey:ot,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static withdraw(e){const{stakePubkey:t,authorizedPubkey:r,toPubkey:n,lamports:o,custodianPubkey:s}=e,i=ut(Gn.Withdraw,{lamports:o}),a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:Je,isSigner:!1,isWritable:!1},{pubkey:ot,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return s&&a.push({pubkey:s,isSigner:!0,isWritable:!1}),(new $e).add({keys:a,programId:this.programId,data:i})}static deactivate(e){const{stakePubkey:t,authorizedPubkey:r}=e,n=ut(Gn.Deactivate);return(new $e).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Je,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:n})}}Jn.programId=new ve("Stake11111111111111111111111111111111111111"),Jn.space=200;class Qn{constructor(e,t,r,n){this.nodePubkey=void 0,this.authorizedVoter=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.nodePubkey=e,this.authorizedVoter=t,this.authorizedWithdrawer=r,this.commission=n}}class Zn{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const t=S.DH("instruction").decode(e.data);let r;for(const[e,n]of Object.entries(Xn))if(n.index==t){r=e;break}if(!r)throw new Error("Instruction type incorrect; not a VoteInstruction");return r}static decodeInitializeAccount(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,4);const{voteInit:t}=dt(Xn.InitializeAccount,e.data);return{votePubkey:e.keys[0].pubkey,nodePubkey:e.keys[3].pubkey,voteInit:new Qn(new ve(t.nodePubkey),new ve(t.authorizedVoter),new ve(t.authorizedWithdrawer),t.commission)}}static decodeAuthorize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{newAuthorized:t,voteAuthorizationType:r}=dt(Xn.Authorize,e.data);return{votePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey,newAuthorizedPubkey:new ve(t),voteAuthorizationType:{index:r}}}static decodeAuthorizeWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:t,currentAuthorityDerivedKeySeed:r,newAuthorized:n,voteAuthorizationType:o}}=dt(Xn.AuthorizeWithSeed,e.data);return{currentAuthorityDerivedKeyBasePubkey:e.keys[2].pubkey,currentAuthorityDerivedKeyOwnerPubkey:new ve(t),currentAuthorityDerivedKeySeed:r,newAuthorizedPubkey:new ve(n),voteAuthorizationType:{index:o},votePubkey:e.keys[0].pubkey}}static decodeWithdraw(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{lamports:t}=dt(Xn.Withdraw,e.data);return{votePubkey:e.keys[0].pubkey,authorizedWithdrawerPubkey:e.keys[2].pubkey,lamports:t,toPubkey:e.keys[1].pubkey}}static checkProgramId(e){if(!e.equals(to.programId))throw new Error("invalid instruction; programId is not VoteProgram")}static checkKeyLength(e,t){if(e.length<t)throw new Error(`invalid instruction; found ${e.length} keys, expected at least ${t}`)}}const Xn=Object.freeze({InitializeAccount:{index:0,layout:S.w3([S.DH("instruction"),((e="voteInit")=>S.w3([xe("nodePubkey"),xe("authorizedVoter"),xe("authorizedWithdrawer"),S.u8("commission")],e))()])},Authorize:{index:1,layout:S.w3([S.DH("instruction"),xe("newAuthorized"),S.DH("voteAuthorizationType")])},Withdraw:{index:3,layout:S.w3([S.DH("instruction"),S.Wg("lamports")])},UpdateValidatorIdentity:{index:4,layout:S.w3([S.DH("instruction")])},AuthorizeWithSeed:{index:10,layout:S.w3([S.DH("instruction"),((e="voteAuthorizeWithSeedArgs")=>S.w3([S.DH("voteAuthorizationType"),xe("currentAuthorityDerivedKeyOwnerPubkey"),Oe("currentAuthorityDerivedKeySeed"),xe("newAuthorized")],e))()])}}),eo=Object.freeze({Voter:{index:0},Withdrawer:{index:1}});class to{constructor(){}static initializeAccount(e){const{votePubkey:t,nodePubkey:r,voteInit:n}=e,o=ut(Xn.InitializeAccount,{voteInit:{nodePubkey:he(n.nodePubkey.toBuffer()),authorizedVoter:he(n.authorizedVoter.toBuffer()),authorizedWithdrawer:he(n.authorizedWithdrawer.toBuffer()),commission:n.commission}}),s={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:et,isSigner:!1,isWritable:!1},{pubkey:Je,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:o};return new Ke(s)}static createAccount(e){const t=new $e;return t.add(wt.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.votePubkey,lamports:e.lamports,space:this.space,programId:this.programId})),t.add(this.initializeAccount({votePubkey:e.votePubkey,nodePubkey:e.voteInit.nodePubkey,voteInit:e.voteInit}))}static authorize(e){const{votePubkey:t,authorizedPubkey:r,newAuthorizedPubkey:n,voteAuthorizationType:o}=e,s=ut(Xn.Authorize,{newAuthorized:he(n.toBuffer()),voteAuthorizationType:o.index}),i=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Je,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return(new $e).add({keys:i,programId:this.programId,data:s})}static authorizeWithSeed(e){const{currentAuthorityDerivedKeyBasePubkey:t,currentAuthorityDerivedKeyOwnerPubkey:r,currentAuthorityDerivedKeySeed:n,newAuthorizedPubkey:o,voteAuthorizationType:s,votePubkey:i}=e,a=ut(Xn.AuthorizeWithSeed,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:he(r.toBuffer()),currentAuthorityDerivedKeySeed:n,newAuthorized:he(o.toBuffer()),voteAuthorizationType:s.index}}),c=[{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:Je,isSigner:!1,isWritable:!1},{pubkey:t,isSigner:!0,isWritable:!1}];return(new $e).add({keys:c,programId:this.programId,data:a})}static withdraw(e){const{votePubkey:t,authorizedWithdrawerPubkey:r,lamports:n,toPubkey:o}=e,s=ut(Xn.Withdraw,{lamports:n}),i=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:o,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}];return(new $e).add({keys:i,programId:this.programId,data:s})}static safeWithdraw(e,t,r){if(e.lamports>t-r)throw new Error("Withdraw will leave vote account with insufficient funds.");return to.withdraw(e)}static updateValidatorIdentity(e){const{votePubkey:t,authorizedWithdrawerPubkey:r,nodePubkey:n}=e,o=ut(Xn.UpdateValidatorIdentity),s=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return(new $e).add({keys:s,programId:this.programId,data:o})}}to.programId=new ve("Vote111111111111111111111111111111111111111"),to.space=3762;const ro=new ve("Va1idator1nfo111111111111111111111111111111"),no=(0,B.NW)({name:(0,B.Yj)(),website:(0,B.lq)((0,B.Yj)()),details:(0,B.lq)((0,B.Yj)()),iconUrl:(0,B.lq)((0,B.Yj)()),keybaseUsername:(0,B.lq)((0,B.Yj)())});class oo{constructor(e,t){this.key=void 0,this.info=void 0,this.key=e,this.info=t}static fromConfigData(e){let t=[...e];if(2!==We(t))return null;const r=[];for(let e=0;e<2;e++){const e=new ve(Le(t,0,be)),n=1===De(t);r.push({publicKey:e,isSigner:n})}if(r[0].publicKey.equals(ro)&&r[1].isSigner){const e=Oe().decode(n.Buffer.from(t)),o=JSON.parse(e);return(0,B.vA)(o,no),new oo(r[1].publicKey,o)}return null}}const so=new ve("Vote111111111111111111111111111111111111111"),io=S.w3([xe("nodePubkey"),xe("authorizedWithdrawer"),S.u8("commission"),S.I0(),S.O6(S.w3([S.I0("slot"),S.DH("confirmationCount")]),S.cY(S.DH(),-8),"votes"),S.u8("rootSlotValid"),S.I0("rootSlot"),S.I0(),S.O6(S.w3([S.I0("epoch"),xe("authorizedVoter")]),S.cY(S.DH(),-8),"authorizedVoters"),S.w3([S.O6(S.w3([xe("authorizedPubkey"),S.I0("epochOfLastAuthorizedSwitch"),S.I0("targetEpoch")]),32,"buf"),S.I0("idx"),S.u8("isEmpty")],"priorVoters"),S.I0(),S.O6(S.w3([S.I0("epoch"),S.I0("credits"),S.I0("prevCredits")]),S.cY(S.DH(),-8),"epochCredits"),S.w3([S.I0("slot"),S.I0("timestamp")],"lastTimestamp")]);class ao{constructor(e){this.nodePubkey=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.rootSlot=void 0,this.votes=void 0,this.authorizedVoters=void 0,this.priorVoters=void 0,this.epochCredits=void 0,this.lastTimestamp=void 0,this.nodePubkey=e.nodePubkey,this.authorizedWithdrawer=e.authorizedWithdrawer,this.commission=e.commission,this.rootSlot=e.rootSlot,this.votes=e.votes,this.authorizedVoters=e.authorizedVoters,this.priorVoters=e.priorVoters,this.epochCredits=e.epochCredits,this.lastTimestamp=e.lastTimestamp}static fromAccountData(e){const t=io.decode(he(e),4);let r=t.rootSlot;return t.rootSlotValid||(r=null),new ao({nodePubkey:new ve(t.nodePubkey),authorizedWithdrawer:new ve(t.authorizedWithdrawer),commission:t.commission,votes:t.votes,rootSlot:r,authorizedVoters:t.authorizedVoters.map(co),priorVoters:uo(t.priorVoters),epochCredits:t.epochCredits,lastTimestamp:t.lastTimestamp})}}function co({authorizedVoter:e,epoch:t}){return{epoch:t,authorizedVoter:new ve(e)}}function lo({authorizedPubkey:e,epochOfLastAuthorizedSwitch:t,targetEpoch:r}){return{authorizedPubkey:new ve(e),epochOfLastAuthorizedSwitch:t,targetEpoch:r}}function uo({buf:e,idx:t,isEmpty:r}){return r?[]:[...e.slice(t+1).map(lo),...e.slice(0,t).map(lo)]}const ho={http:{devnet:"http://api.devnet.solana.com",testnet:"http://api.testnet.solana.com","mainnet-beta":"http://api.mainnet-beta.solana.com/"},https:{devnet:"https://api.devnet.solana.com",testnet:"https://api.testnet.solana.com","mainnet-beta":"https://api.mainnet-beta.solana.com/"}};function po(e,t){const r=!1===t?"http":"https";if(!e)return ho[r].devnet;const n=ho[r][e];if(!n)throw new Error(`Unknown ${r} cluster: ${e}`);return n}async function fo(e,t,r,n){let o,s;r&&Object.prototype.hasOwnProperty.call(r,"lastValidBlockHeight")||r&&Object.prototype.hasOwnProperty.call(r,"nonceValue")?(o=r,s=n):s=r;
2const i=s&&{skipPreflight:s.skipPreflight,preflightCommitment:s.preflightCommitment||s.commitment,minContextSlot:s.minContextSlot},a=await e.sendRawTransaction(t,i),c=s&&s.commitment,l=o?e.confirmTransaction(o,c):e.confirmTransaction(a,c),u=(await l).value;if(u.err){if(null!=a)throw new st({action:i?.skipPreflight?"send":"simulate",signature:a,transactionMessage:`Status: (${JSON.stringify(u)})`});throw new Error(`Raw transaction ${a} failed (${JSON.stringify(u)})`)}return a}const go=1e9},"./node_modules/@ton/core/dist/address/ADNLAddress.js"(e,t,r){"use strict";var n,o=r("./node_modules/buffer/index.js").Buffer,s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ADNLAddress=void 0;const i=s(r("./node_modules/symbol.inspect/index.js")),a=r("./node_modules/@ton/core/dist/utils/base32.js"),c=r("./node_modules/@ton/core/dist/utils/crc16.js");class l{static parseFriendly(e){if(55!==e.length)throw Error("Invalid address");e="f"+e;let t=(0,a.base32Decode)(e);if(45!==t[0])throw Error("Invalid address");let r=t.slice(33);if(!(0,c.crc16)(t.slice(0,33)).equals(r))throw Error("Invalid address");return new l(t.slice(1,33))}static parseRaw(e){const t=o.from(e,"base64");return new l(t)}constructor(e){if(this.toRaw=()=>this.address.toString("hex").toUpperCase(),this.toString=()=>
2{let e=o.concat([o.from([45]),this.address]),t=(0,c.crc16)(e);return e=o.concat([e,t]),(0,a.base32Encode)(e).slice(1)},this[n]=()=>this.toString(),32!==e.length)throw Error("Invalid address");this.address=e}equals(e){return this.address.equals(e.address)}}t.ADNLAddress=l,n=i.default},"./node_modules/@ton/core/dist/address/Address.js"(e,t,r){"use strict";var n,o=r("./node_modules/buffer/index.js").Buffer,s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.address=t.Address=void 0;const i=s(r("./node_modules/symbol.inspect/index.js")),a=r("./node_modules/@ton/core/dist/utils/crc16.js");function c(e){if("string"==typeof e&&!l.isFriendly(e))throw new Error("Unknown address type");const t=o.isBuffer(e)?e:o.from(e,"base64");if(36!==t.length)throw new Error("Unknown address type: byte length is not equal to 36");const r=t.subarray(0,34),n=t.subarray(34,36),s=(0,a.crc16)(r);if(s[0]!==n[0]||s[1]!==n[1])throw new Error("Invalid checksum: "+e);let i=r[0],c=!1,u=!1;if(128&i&&(c=!0,i^=128),17!==i&&81!==i)throw"Unknown address tag";u=17===i;let d=null;d=255===r[1]?-1:r[1];return{isTestOnly:c,isBounceable:u,workchain:d,hashPart:r.subarray(2,34)}}class l{static isAddress(e){return e instanceof l}static isFriendly(e){return 48===e.length&&!!/[A-Za-z0-9+/_-]+/.test(e)}static isRaw(e){if(-1===e.indexOf(":"))return!1;let[t,r]=e.split(":");return!!Number.isInteger(parseFloat(t))&&(!!/[a-f0-9]+/.test(r.toLowerCase())&&64===r.length)}static normalize(e){return"string"==typeof e?l.parse(e).toString():e.toString()}static parse(e){if(l.isFriendly(e))return this.parseFriendly(e).address;if(l.isRaw(e))return this.parseRaw(e);throw new Error("Unknown address type: "+e)}static parseRaw(e){let t=parseInt(e.split(":")[0]),r=o.from(e.split(":")[1],"hex");return new l(t,r)}static parseFriendly(e){if(o.isBuffer(e)){let t=c(e);return{isBounceable:t.isBounceable,isTestOnly:t.isTestOnly,address:new l(t.workchain,t.hashPart)}}{let t=c(e.replace(/\-/g,"+").replace(/_/g,"/"));return{isBounceable:t.isBounceable,isTestOnly:t.isTestOnly,address:new l(t.workchain,t.hashPart)}}}constructor(e,t){if(this.toRawString=()=>this.workChain+":"+this.hash.toString("hex"),this.toRaw=()=>{const e=o.alloc(36);return e.set(this.hash),e.set([this.workChain,this.workChain,this.workChain,this.workChain],32),e},this.toStringBuffer=e=>{let t=!(!e||void 0===e.testOnly)&&e.testOnly,r=!e||void 0===e.bounceable||e.bounceable?17:81;t&&(r|=128);const n=o.alloc(34);n[0]=r,n[1]=this.workChain,n.set(this.hash,2);const s=o.alloc(36);return s.set(n),s.set((0,a.crc16)(n),34),s},this.toString=e=>{let t=!e||void 0===e.urlSafe||e.urlSafe,r=this.toStringBuffer(e);return t?r.toString("base64").replace(/\+/g,"-").replace(/\//g,"_"):r.toString("base64")},this[n]=()=>this.toString(),32!==t.length)throw new Error("Invalid address hash length: "+t.length);this.workChain=e,this.hash=t,Object.freeze(this)}equals(e){return e.workChain===this.workChain&&e.hash.equals(this.hash)}}t.Address=l,n=i.default,t.address=function(e){return l.parse(e)}},"./node_modules/@ton/core/dist/address/ExternalAddress.js"(e,t,r){"use strict";var n,o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ExternalAddress=void 0;const s=o(r("./node_modules/symbol.inspect/index.js"));class i{static isAddress(e){return e instanceof i}constructor(e,t){this[n]=()=>this.toString(),this.value=e,this.bits=t}toString(){return`External<${this.bits}:${this.value}>`}}t.ExternalAddress=i,n=s.default},"./node_modules/@ton/core/dist/address/contractAddress.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contractAddress=void 0;const n=r("./node_modules/@ton/core/dist/boc/Builder.js"),o=r("./node_modules/@ton/core/dist/types/StateInit.js"),s=r("./node_modules/@ton/core/dist/address/Address.js");t.contractAddress=function(e,t){let r=(0,n.beginCell)().store((0,o.storeStateInit)(t)).endCell().hash();return new s.Address(e,r)}},"./node_modules/@ton/core/dist/boc/BitBuilder.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;
2Object.defineProperty(t,"__esModule",{value:!0}),t.BitBuilder=void 0;const o=r("./node_modules/@ton/core/dist/address/Address.js"),s=r("./node_modules/@ton/core/dist/address/ExternalAddress.js"),i=r("./node_modules/@ton/core/dist/boc/BitString.js");t.BitBuilder=class{constructor(e=1023){this._buffer=n.alloc(Math.ceil(e/8)),this._length=0}get length(){return this._length}writeBit(e){let t=this._length;if(t>8*this._buffer.length)throw new Error("BitBuilder overflow");("boolean"==typeof e&&!0===e||"number"==typeof e&&e>0)&&(this._buffer[t/8|0]|=1<<7-t%8),this._length++}writeBits(e){for(let t=0;t<e.length;t++)this.writeBit(e.at(t))}writeBuffer(e){if(this._length%8==0){if(this._length+8*e.length>8*this._buffer.length)throw new Error("BitBuilder overflow");e.copy(this._buffer,this._length/8),this._length+=8*e.length}else for(let t=0;t<e.length;t++)this.writeUint(e[t],8)}writeUint(e,t){if(t<0||!Number.isSafeInteger(t))throw Error(`invalid bit length. Got ${t}`);const r=BigInt(e);if(0===t){if(0n!==r)throw Error(`value is not zero for ${t} bits. Got ${e}`);return}const n=1n<<BigInt(t);if(r<0||r>=n)throw Error(`bitLength is too small for a value ${e}. Got ${t}`);if(this._length+t>8*this._buffer.length)throw new Error("BitBuilder overflow");const o=8-this._length%8;if(o>0){const e=Math.floor(this._length/8);if(t<o){const n=Number(r);this._buffer[e]|=n<<o-t,this._length+=t}else{const n=Number(r>>BigInt(t-o));this._buffer[e]|=n,this._length+=o}}for(t-=o;t>0;)t>=8?(this._buffer[this._length/8]=Number(r>>BigInt(t-8)&0xffn),this._length+=8,t-=8):(this._buffer[this._length/8]=Number(r<<BigInt(8-t)&0xffn),this._length+=t,t=0)}writeInt(e,t){let r=BigInt(e);if(t<0||!Number.isSafeInteger(t))throw Error(`invalid bit length. Got ${t}`);if(0===t){if(0n!==e)throw Error(`value is not zero for ${t} bits. Got ${e}`);return}if(1===t){if(-1n!==e&&0n!==e)throw Error(`value is not zero or -1 for ${t} bits. Got ${e}`);return void this.writeBit(-1n===e)}let n=1n<<BigInt(t)-1n;if(r<-n||r>=n)throw Error(`value is out of range for ${t} bits. Got ${e}`);r<0?(this.writeBit(!0),r=n+r):this.writeBit(!1),this.writeUint(r,t-1)}writeVarUint(e,t){let r=BigInt(e);if(t<0||!Number.isSafeInteger(t))throw Error(`invalid bit length. Got ${t}`);if(r<0)throw Error(`value is negative. Got ${e}`);if(0n===r)return void this.writeUint(0,t);const n=Math.ceil(r.toString(2).length/8),o=8*n;this.writeUint(n,t),this.writeUint(r,o)}writeVarInt(e,t){let r=BigInt(e);if(t<0||!Number.isSafeInteger(t))throw Error(`invalid bit length. Got ${t}`);if(0n===r)return void this.writeUint(0,t);let n=r>0?r:-r;const o=Math.ceil((n.toString(2).length+1)/8),s=8*o;this.writeUint(o,t),this.writeInt(r,s)}writeCoins(e){this.writeVarUint(e,4)}writeAddress(e){if(null!=e){if(o.Address.isAddress(e))return this.writeUint(2,2),this.writeUint(0,1),this.writeInt(e.workChain,8),void this.writeBuffer(e.hash);if(s.ExternalAddress.isAddress(e))return this.writeUint(1,2),this.writeUint(e.bits,9),void this.writeUint(e.value,e.bits);throw Error(`Invalid address. Got ${e}`)}this.writeUint(0,2)}build(){return new i.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)}}},"./node_modules/@ton/core/dist/boc/BitReader.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.BitReader=void 0;const o=r("./node_modules/@ton/core/dist/address/Address.js"),s=r("./node_modules/@ton/core/dist/address/ExternalAddress.js");class i{constructor(e,t=0){this._checkpoints=[],this._bits=e,this._offset=t}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 t=this._bits.substring(this._offset,e);return this._offset+=e,t}preloadBits(e){return this._bits.substring(this._offset,e)}loadBuffer(e){let t=this._preloadBuffer(e,this._offset);return this._offset+=8*e,t}preloadBuffer(e){return this._preloadBuffer(e,this._offset)}loadUint(e){return this._toSafeInteger(this.loadUintBig(e),"loadUintBig")}loadUintBig(e){let t=this.preloadUintBig(e);return this._offset+=e,t}preloadUint(e){return this._toSafeInteger(this._preloadUint(e,this._offset),"preloadUintBig")}preloadUintBig(e){return this._preloadUint(e,this._offset)}loadInt(e){let t=this._preloadInt(e,this._offset);return this._offset+=e,this._toSafeInteger(t,"loadUintBig")}loadIntBig(e){let t=this._preloadInt(e,this._offset);return this._offset+=e,t}preloadInt(e){return this._toSafeInteger(this._preloadInt(e,this._offset),"preloadIntBig")}preloadIntBig(e){return this._preloadInt(e,this._offset)}loadVarUint(e){let t=Number(this.loadUint(e));return this._toSafeInteger(this.loadUintBig(8*t),"loadVarUintBig")}loadVarUintBig(e){let t=Number(this.loadUint(e));return this.loadUintBig(8*t)}preloadVarUint(e){let t=Number(this._preloadUint(e,this._offset));return this._toSafeInteger(this._preloadUint(8*t,this._offset+e),"preloadVarUintBig")}preloadVarUintBig(e){let t=Number(this._preloadUint(e,this._offset));return this._preloadUint(8*t,this._offset+e)}loadVarInt(e){let t=Number(this.loadUint(e));return this._toSafeInteger(this.loadIntBig(8*t),"loadVarIntBig")}loadVarIntBig(e){let t=Number(this.loadUint(e));return this.loadIntBig(8*t)}preloadVarInt(e){let t=Number(this._preloadUint(e,this._offset));return this._toSafeInteger(this._preloadInt(8*t,this._offset+e),"preloadVarIntBig")}preloadVarIntBig(e){let t=Number(this._preloadUint(e,this._offset));return this._preloadInt(8*t,this._offset+e)}loadCoins(){return this.loadVarUintBig(4)}preloadCoins(){return this.preloadVarUintBig(4)}loadAddress(){let e=Number(this._preloadUint(2,this._offset));if(2===e)return this._loadInternalAddress();throw new Error("Invalid address: "+e)}loadMaybeAddress(){let e=Number(this._preloadUint(2,this._offset));if(0===e)return this._offset+=2,null;if(2===e)return this._loadInternalAddress();throw new Error("Invalid address")}loadExternalAddress(){if(1===Number(this._preloadUint(2,this._offset)))return this._loadExternalAddress();throw new Error("Invalid address")}loadMaybeExternalAddress(){let e=Number(this._preloadUint(2,this._offset));if(0===e)return this._offset+=2,null;if(1===e)return this._loadExternalAddress();throw new Error("Invalid address")}loadAddressAny(){let e=Number(this._preloadUint(2,this._offset));if(0===e)return this._offset+=2,null;if(2===e)return this._loadInternalAddress();if(1===e)return this._loadExternalAddress();throw 3===e?Error("Unsupported"):Error("Unreachable")}loadPaddedBits(e){if(e%8!=0)throw new Error("Invalid number of bits");let t=e;for(;;){if(this._bits.at(this._offset+t-1)){t--;break}t--}let r=this._bits.substring(this._offset,t);return this._offset+=e,r}clone(){return new i(this._bits,this._offset)}_preloadInt(e,t){if(0==e)return 0n;let r=this._bits.at(t),n=0n;for(let r=0;r<e-1;r++)this._bits.at(t+1+r)&&(n+=1n<<BigInt(e-r-1-1));return r&&(n-=1n<<BigInt(e-1)),n}_preloadUint(e,t){if(0==e)return 0n;let r=0n;for(let n=0;n<e;n++)this._bits.at(t+n)&&(r+=1n<<BigInt(e-n-1));return r}_preloadBuffer(e,t){let r=this._bits.subbuffer(t,8*e);if(r)return r;let o=n.alloc(e);for(let r=0;r<e;r++)o[r]=Number(this._preloadUint(8,t+8*r));return o}_loadInternalAddress(){if(2!==Number(this._preloadUint(2,this._offset)))throw Error("Invalid address");if(0n!==this._preloadUint(1,this._offset+2))throw Error("Invalid address");let e=Number(this._preloadInt(8,this._offset+3)),t=this._preloadBuffer(32,this._offset+11);return this._offset+=267,new o.Address(e,t)}_loadExternalAddress(){if(1!==Number(this._preloadUint(2,this._offset)))throw Error("Invalid address");let e=Number(this._preloadUint(9,this._offset+2)),t=this._preloadUint(e,this._offset+11);return this._offset+=11+e,new s.ExternalAddress(t,e)}_toSafeInteger(e,t){if(BigInt(Number.MAX_SAFE_INTEGER)<e||e<BigInt(Number.MIN_SAFE_INTEGER))throw new TypeError(`${e} is out of safe integer range. Use ${t} instead`);return Number(e)}}t.BitReader=i},"./node_modules/@ton/core/dist/boc/BitString.js"(e,t,r){"use strict";var n,o=r("./node_modules/buffer/index.js").Buffer,s=this&&this.__importDefault||function(e){return e&&e.__esMo
2dule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BitString=void 0;const i=r("./node_modules/@ton/core/dist/boc/utils/paddedBits.js"),a=s(r("./node_modules/symbol.inspect/index.js"));class c{static isBitString(e){return e instanceof c}constructor(e,t,r){if(this[n]=()=>this.toString(),r<0)throw new Error(`Length ${r} is out of bounds`);this._length=r,this._data=e,this._offset=t}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 t=this._offset+e>>3,r=7-(this._offset+e)%8;return!!(this._data[t]&1<<r)}substring(e,t){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(0===t)return c.EMPTY;if(e+t>this._length)throw new Error(`Offset ${e} + Length ${t} > ${this._length} is out of bounds`);return new c(this._data,this._offset+e,t)}subbuffer(e,t){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+t>this._length)throw new Error(`Offset + Lenght = ${e+t} is out of bounds`);if(t%8!=0)return null;if((this._offset+e)%8!=0)return null;let r=this._offset+e>>3,n=r+(t>>3);return this._data.subarray(r,n)}equals(e){if(this._length!==e._length)return!1;for(let t=0;t<this._length;t++)if(this.at(t)!==e.at(t))return!1;return!0}toString(){const e=(0,i.bitsToPaddedBuffer)(this);if(this._length%4==0){const t=e.subarray(0,Math.ceil(this._length/8)).toString("hex").toUpperCase();return this._length%8==0?t:t.substring(0,t.length-1)}{const t=e.toString("hex").toUpperCase();return this._length%8<=4?t.substring(0,t.length-1)+"_":t+"_"}}}t.BitString=c,n=a.default,c.EMPTY=new c(o.alloc(0),0,0)},"./node_modules/@ton/core/dist/boc/Builder.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Builder=t.beginCell=void 0;const n=r("./node_modules/@ton/core/dist/boc/BitBuilder.js"),o=r("./node_modules/@ton/core/dist/boc/Cell.js"),s=r("./node_modules/@ton/core/dist/boc/utils/strings.js");function i(){return new a}t.beginCell=i;class a{constructor(){this._bits=new n.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,t){if(null!=t&&e.length!==t)throw Error(`Buffer length ${e.length} is not equal to ${t}`);return this._bits.writeBuffer(e),this}storeMaybeBuffer(e,t){return null!==e?(this.storeBit(1),this.storeBuffer(e,t)):this.storeBit(0),this}storeUint(e,t){return this._bits.writeUint(e,t),this}storeMaybeUint(e,t){return null!=e?(this.storeBit(1),this.storeUint(e,t)):this.storeBit(0),this}storeInt(e,t){return this._bits.writeInt(e,t),this}storeMaybeInt(e,t){return null!=e?(this.storeBit(1),this.storeInt(e,t)):this.storeBit(0),this}storeVarUint(e,t){return this._bits.writeVarUint(e,t),this}storeMaybeVarUint(e,t){return null!=e?(this.storeBit(1),this.storeVarUint(e,t)):this.storeBit(0),this}storeVarInt(e,t){return this._bits.writeVarInt(e,t),this}storeMaybeVarInt(e,t){return null!=e?(this.storeBit(1),this.storeVarInt(e,t)):this.storeBit(0),this}storeCoins(e){return this._bits.writeCoins(e),this}storeMaybeCoins(e){return null!=e?(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 o.Cell)this._refs.push(e);else{if(!(e instanceof a))throw new Error("Invalid argument");this._refs.push(e.endCell())}return this}storeMaybeRef(e){return e?(this.storeBit(1),this.storeRef(e)):this.storeBit(0),this}storeSlice(e){let t=e.clone();for(t.remainingBits>0&&this.storeBits(t.loadBits(t.remainingBits));t.remainingRefs>0;)this.storeRef(t.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"object"==typeof e?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,s.writeString)(e,this),this}storeMaybeStringTail(e){return null!=e?(this.storeBit(1),(0,s.writeString)(e,this)):this.storeBit(0),this}storeStringRefTail(e){return this.storeRef(i().storeStringTail(e)),this}storeMaybeStringRefTail(e){return null!=e?(this.storeBit(1),this.storeStringRefTail(e)):this.storeBit(0),this}storeDict(e,t,r){return e?e.store(this,t,r):this.storeBit(0),this}storeDictDirect(e,t,r){return e.storeDirect(this,t,r),this}endCell(e){return new o.Cell({bits:this._bits.build(),refs:this._refs,exotic:e?.exotic})}asCell(){return this.endCell()}asSlice(){return this.endCell().beginParse()}}t.Builder=a},"./node_modules/@ton/core/dist/boc/Cell.js"(e,t,r){"use strict";var n,o=r("./node_modules/buffer/index.js").Buffer,s=this&&this.__importDefault||function(e){return e&&e.__esMo
2dule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Cell=void 0;const i=s(r("./node_modules/symbol.inspect/index.js")),a=r("./node_modules/@ton/core/dist/boc/BitString.js"),c=r("./node_modules/@ton/core/dist/boc/CellType.js"),l=r("./node_modules/@ton/core/dist/boc/Slice.js"),u=r("./node_modules/@ton/core/dist/boc/cell/resolveExotic.js"),d=r("./node_modules/@ton/core/dist/boc/cell/wonderCalculator.js"),h=r("./node_modules/@ton/core/dist/boc/cell/serialization.js"),p=r("./node_modules/@ton/core/dist/boc/BitReader.js"),f=r("./node_modules/@ton/core/dist/boc/Builder.js");class g{static fromBoc(e){return(0,h.deserializeBoc)(e)}static fromBase64(e){let t=g.fromBoc(o.from(e,"base64"));if(1!==t.length)throw new Error("Deserialized more than one cell");return t[0]}static fromHex(e){let t=g.fromBoc(o.from(e,"hex"));if(1!==t.length)throw new Error("Deserialized more than one cell");return t[0]}constructor(e){this._hashes=[],this._depths=[],this.beginParse=(e=!1)=>{if(this.isExotic&&!e)throw new Error("Exotic cells cannot be parsed");return new l.Slice(new p.BitReader(this.bits),this.refs)},this.hash=(e=3)=>this._hashes[Math.min(this._hashes.length-1,e)],this.depth=(e=3)=>this._depths[Math.min(this._depths.length-1,e)],this.level=()=>this.mask.level,this.equals=e=>this.hash().equals(e.hash()),this[n]=()=>this.toString();let t=a.BitString.EMPTY;e&&e.bits&&(t=e.bits);let r,o,s,i=[];e&&e.refs&&(i=[...e.refs]);let h=c.CellType.Ordinary;if(e&&e.exotic){let e=(0,u.resolveExotic)(t,i),n=(0,d.wonderCalculator)(e.type,t,i);s=n.mask,o=n.depths,r=n.hashes,h=e.type}else{if(i.length>4)throw new Error("Invalid number of references");if(t.length>1023)throw new Error(`Bits overflow: ${t.length} > 1023`);let e=(0,d.wonderCalculator)(c.CellType.Ordinary,t,i);s=e.mask,o=e.depths,r=e.hashes,h=c.CellType.Ordinary}this.type=h,this.bits=t,this.refs=i,this.mask=s,this._depths=o,this._hashes=r,Object.freeze(this),Object.freeze(this.refs),Object.freeze(this.bits),Object.freeze(this.mask),Object.freeze(this._depths),Ob
2ject.freeze(this._hashes)}get isExotic(){return this.type!==c.CellType.Ordinary}toBoc(e){let t=!(!e||null===e.idx||void 0===e.idx)&&e.idx,r=!e||null===e.crc32||void 0===e.crc32||e.crc32;return(0,h.serializeBoc)(this,{idx:t,crc32:r})}toString(e){let t=e||"",r="x";this.isExotic&&(this.type===c.CellType.MerkleProof?r="p":this.type===c.CellType.MerkleUpdate?r="u":this.type===c.CellType.PrunedBranch&&(r="p"));let n=t+(this.isExotic?r:"x")+"{"+this.bits.toString()+"}";for(let e in this.refs){n+="\n"+this.refs[e].toString(t+" ")}return n}asSlice(){return this.beginParse()}asBuilder(){return(0,f.beginCell)().storeSlice(this.asSlice())}}t.Cell=g,n=i.default,g.EMPTY=new g},"./node_modules/@ton/core/dist/boc/CellType.js"(e,t){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.CellType=void 0,function(e){e[e.Ordinary=-1]="Ordinary",e[e.PrunedBranch=1]="PrunedBranch",e[e.Library=2]="Library",e[e.MerkleProof=3]="MerkleProof",e[e.MerkleUpdate=4]="MerkleUpdate"}(r||(t.CellType=r={}))},"./node_modules/@ton/core/dist/boc/Slice.js"(e,t,r){"use strict";var n,o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Slice=void 0;const s=o(r("./node_modules/symbol.inspect/index.js")),i=r("./node_modules/@ton/core/dist/dict/Dictionary.js"),a=r("./node_modules/@ton/core/dist/boc/Builder.js"),c=r("./node_modules/@ton/core/dist/boc/utils/strings.js");class l{constructor(e,t){this[n]=()=>this.toString(),this._reader=e.clone(),this._refs=[...t],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,c.readString)(this)}loadMaybeStringTail(){return this.loadBit()?(0,c.readString)(this):null}loadStringRefTail(){return(0,c.readString)(this.loadRef().beginParse())}loadMaybeStringRefTail(){const e=this.loadMaybeRef();return e?(0,c.readString)(e.beginParse()):null}loadDict(e,t){return i.Dictionary.load(e,t,this)}loadDictDirect(e,t){return i.Dictionary.loadDirect(e,t,this)}
2endParse(){if(this.remainingBits>0||this.remainingRefs>0)throw new Error("Slice is not empty")}asCell(){return(0,a.beginCell)().storeSlice(this).endCell()}asBuilder(){return(0,a.beginCell)().storeSlice(this)}clone(e=!1){if(e){let e=this._reader.clone();return e.reset(),new l(e,this._refs)}{let e=new l(this._reader,this._refs);return e._refsOffset=this._refsOffset,e}}toString(){return this.asCell().toString()}}t.Slice=l,n=s.default},"./node_modules/@ton/core/dist/boc/cell/LevelMask.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LevelMask=void 0;class r{constructor(e=0){var t;this._mask=0,this._mask=e,this._hashIndex=(t=this._mask,16843009*((t=(858993459&(t-=t>>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135)>>24),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 r(this._mask&(1<<e)-1)}isSignificant(e){return 0===e||(this._mask>>e-1)%2!=0}}t.LevelMask=r},"./node_modules/@ton/core/dist/boc/cell/descriptor.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.getRepr=t.getBitsDescriptor=t.getRefsDescriptor=void 0;const o=r("./node_modules/@ton/core/dist/boc/CellType.js"),s=r("./node_modules/@ton/core/dist/boc/utils/paddedBits.js");function i(e,t,r){return e.length+8*(r!==o.CellType.Ordinary?1:0)+32*t}function a(e){let t=e.length;return Math.ceil(t/8)+Math.floor(t/8)}t.getRefsDescriptor=i,t.getBitsDescriptor=a,t.getRepr=function(e,t,r,c,l,u){const d=Math.ceil(t.length/8),h=n.alloc(2+d+34*r.length);let p=0;h[p++]=i(r,l,u),h[p++]=a(e),(0,s.bitsToPaddedBuffer)(t).copy(h,p),p+=d;for(const e of r){let t;t=u==o.CellType.MerkleProof||u==o.CellType.MerkleUpdate?e.depth(c+1):e.depth(c),h[p++]=Math.floor(t/256),h[p++]=t%256}for(const e of r){let t;t=u==o.CellType.MerkleProof||u==o.CellType.MerkleUpdate?e.hash(c+1):e.hash(c),t.copy(h,p),p+=32}return h}},"./node_modules/@ton/core/dist/boc/cell/exoticLibrary.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exoticLibrary=void 0;const n=r("./node_modules/@ton/core/dist/boc/BitReader.js");t.exoticLibrary=function(e,t){const r=new n.BitReader(e);if(264!==e.length)throw new Error(`Library cell must have exactly (8 + 256) bits, got "${e.length}"`);let o=r.loadUint(8);if(2!==o)throw new Error(`Library cell must have type 2, got "${o}"`);return{}}},"./node_modules/@ton/core/dist/boc/cell/exoticMerkleProof.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertToMerkleProof=t.exoticMerkleProof=void 0;const n=r("./node_modules/@ton/core/dist/boc/BitReader.js"),o=r("./node_modules/@ton/core/dist/boc/Builder.js");t.exoticMerkleProof=function(e,t){const r=new n.BitReader(e);if(280!==e.length)throw new Error(`Merkle Proof cell must have exactly (8 + 256 + 16) bits, got "${e.length}"`);if(1!==t.length)throw new Error(`Merkle Proof cell must have exactly 1 ref, got "${t.length}"`);let o=r.loadUint(8);if(3!==o)throw new Error(`Merkle Proof cell must have type 3, got "${o}"`);const s=r.loadBuffer(32),i=r.loadUint(16),a=t[0].hash(0),c=t[0].depth(0);if(i!==c)throw new Error(`Merkle Proof cell ref depth must be exactly "${i}", got "${c}"`);if(!s.equals(a))throw new Error(`Merkle Proof cell ref hash must be exactly "${s.toString("hex")}", got "${a.toString("hex")}"`);return{proofDepth:i,proofHash:s}},t.convertToMerkleProof=function(e){return(0,o.beginCell)().storeUint(3,8).storeBuffer(e.hash(0)).storeUint(e.depth(0),16).storeRef(e).endCell({exotic:!0})}},"./node_modules/@ton/core/dist/boc/cell/exoticMerkleUpdate.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exoticMerkleUpdate=void 0;const n=r("./node_modules/@ton/core/dist/boc/BitReader.js");t.exoticMerkleUpdate=function(e,t){const r=new n.BitReader(e);if(552!==e.length)throw new Error(`Merkle Update cell must have exactly (8 + (2 * (256 + 16))) bits, got "${e.length}"`);if(2!==t.length)throw new Error(`Merkle Update cell must have exactly 2 refs, got "${t.length}"`);let o=r.loadUint(8);if(4!==o)throw new Error(`Merkle Update cell type must be exactly 4, got "${o}"`);const s=r.loadBuffer(32),i=r.loadBuffer(32),a=r.loadUint(16),c=r.loadUint(16);if(a!==t[0].depth(0))throw new Error(`Merkle Update cell ref depth must be exactly "${a}", got "${t[0].depth(0)}"`);if(!s.equals(t[0].hash(0)))throw new Error(`Merkle Update cell ref hash must be exactly "${s.toString("hex")}", got "${t[0].hash(0).toString("hex")}"`);if(c!==t[1].depth(0))throw new Error(`Merkle Update cell ref depth must be exactly "${c}", got "${t[1].depth(0)}"`);if(!i.equals(t[1].hash(0)))throw new Error(`Merkle Update cell ref hash must be exactly "${i.toString("hex")}", got "${t[1].hash(0).toString("hex")}"`);return{proofDepth1:a,proofDepth2:c,proofHash1:s,proofHash2:i}}},"./node_modules/@ton/core/dist/boc/cell/exoticPruned.js"(e,t,r){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.exoticPruned=void 0;const n=r("./node_modules/@ton/core/dist/boc/BitReader.js"),o=r("./node_modules/@ton/core/dist/boc/cell/LevelMask.js");t.exoticPruned=function(e,t){let r,s=new n.BitReader(e),i=s.loadUint(8);if(1!==i)throw new Error(`Pruned branch cell must have type 1, got "${i}"`);if(0!==t.length)throw new Error(`Pruned Branch cell can't has refs, got "${t.length}"`);if(280===e.length)r=new o.LevelMask(1);else{if(r=new o.LevelMask(s.loadUint(8)),r.level<1||r.level>3)throw new Error(`Pruned Branch cell level must be >= 1 and <= 3, got "${r.level}/${r.value}"`);const t=16+272*r.apply(r.level-1).hashCount;if(e.length!==t)throw new Error(`Pruned branch cell must have exactly ${t} bits, got "${e.length}"`)}let a=[],c=[],l=[];for(let e=0;e<r.level;e++)c.push(s.loadBuffer(32));for(let e=0;e<r.level;e++)l.push(s.loadUint(16));for(let e=0;e<r.level;e++)a.push({depth:l[e],hash:c[e]});return{mask:r.value,pruned:a}}},"./node_modules/@ton/core/dist/boc/cell/resolveExotic.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveExotic=void 0;const n=r("./node_modules/@ton/core/dist/boc/BitReader.js"),o=r("./node_modules/@ton/core/dist/boc/CellType.js"),s=r("./node_modules/@ton/core/dist/boc/cell/exoticLibrary.js"),i=r("./node_modules/@ton/core/dist/boc/cell/exoticMerkleProof.js"),a=r("./node_modules/@ton/core/dist/boc/cell/exoticMerkleUpdate.js"),c=r("./node_modules/@ton/core/dist/boc/cell/exoticPruned.js"),l=r("./node_modules/@ton/core/dist/boc/cell/LevelMask.js");t.resolveExotic=function(e,t){let r=new n.BitReader(e).preloadUint(8);if(1===r)return function(e,t){let r=(0,c.exoticPruned)(e,t),n=[],s=[],i=new l.LevelMask(r.mask);for(let e=0;e<r.pruned.length;e++)n.push(r.pruned[e].depth),s.push(r.pruned[e].hash);return{type:o.CellType.PrunedBranch,depths:n,hashes:s,mask:i}}(e,t);if(2===r)return function(e,t){(0,s.exoticLibrary)(e,t);let r=new l.LevelMask;return{type:o.CellType.Library,depths:[],hashes:[],mask:r}}(e,t);if(3===r)return function(e,t){(0,i.exoticMerkleProof)(e,t);let r=new l.LevelMask(t[0].level()>>1);return{type:o.CellType.MerkleProof,depths:[],hashes:[],mask:r}}(e,t);if(4===r)return function(e,t){(0,a.exoticMerkleUpdate)(e,t);let r=new l.LevelMask((t[0].level()|t[1].level())>>1);return{type:o.CellType.MerkleUpdate,depths:[],hashes:[],mask:r}}(e,t);throw Error("Invalid exotic cell type: "+r)}},"./node_modules/@ton/core/dist/boc/cell/serialization.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeBoc=t.deserializeBoc=t.parseBoc=void 0;const n=r("./node_modules/@ton/core/dist/boc/BitReader.js"),o=r("./node_modules/@ton/core/dist/boc/BitString.js"),s=r("./node_modules/@ton/core/dist/boc/Cell.js"),i=r("./node_modules/@ton/core/dist/boc/cell/utils/topologicalSort.js"),a=r("./node_modules/@ton/core/dist/utils/bitsForNumber.js"),c=r("./node_modules/@ton/core/dist/boc/BitBuilder.js"),l=r("./node_modules/@ton/core/dist/boc/cell/descriptor.js"),u=r("./node_modules/@ton/core/dist/boc/utils/paddedBits.js"),d=r("./node_modules/@ton/core/dist/utils/crc32c.js");function h(e){return function(e){let t=0;for(let r=0;r<3;r++)t+=1&e,e>>=1;return t+1}(7&e)}function p(e,t){const r=e.loadUint(8),n=r%8,s=!!(8&r),i=e.loadUint(8),a=Math.ceil(i/2),c=!!(i%2),l=r>>5,u=!!(16&r),d=u?32*h(l):0,p=u?2*h(l):0;e.skip(8*d),e.skip(8*p);let f=o.BitString.EMPTY;a>0&&(f=c?e.loadPaddedBits(8*a):e.loadBits(8*a));let g=[];for(let r=0;r<n;r++)g.push(e.loadUint(8*t));return{bits:f,refs:g,exotic:s}}function f(e,t){return 2+Math.ceil(e.bits.length/8)+e.refs.length*t}function g(e){let t=new n.BitReader(new o.BitString(e,0,8*e.length)),r=t.loadUint(32);if(1761568243===r){let e=t.loadUint(8),r=t.loadUint(8),n=t.loadUint(8*e),o=t.loadUint(8*e),s=t.loadUint(8*e),i=t.loadUint(8*r);return{size:e,offBytes:r,cells:n,roots:o,absent:s,totalCellSize:i,index:t.loadBuffer(n*r),cellData:t.loadBuffer(i),root:[0]}}if(2898503464===r){let r=t.loadUint(8),n=t.loadUint(8),o=t.loadUint(8*r),s=t.loadUint(8*r),i=t.loadUint(8*r),a=t.loadUint(8*n),c=t.loadBuffer(o*n),l=t.loadBuffer(a),u=t.loadBuffer(4);if(!(0,d.crc32c)(e.subarray(0,e.length-4)).equals(u))throw Error("Invalid CRC32C");return{size:r,offBytes:n,cells:o,roots:s,absent:i,totalCellSize:a,index:c,cellData:l,root:[0]}}if(3052313714===r){let r=t.loadUint(1),n=t.loadUint(1),o=(t.loadUint(1),t.loadUint(2),t.loadUint(3)),s=t.loadUint(8),i=t.loadUint(8*o),a=t.loadUint(8*o),c=t.loadUint(8*o),l=t.loadUint(8*s),u=[];for(let e=0;e<a;e++)u.push(t.loadUint(8*o));let h=null;r&&(h=t.loadBuffer(i*s));let p=t.loadBuffer(l);if(n){let r=t.loadBuffer(4);if(!(0,d.crc32c)(e.subarray(0,e.length-4)).equals(r))throw Error("Invalid CRC32C")}return{size:o,offBytes:s,cells:i,roots:a,absent:c,totalCellSize:l,index:h,cellData:p,root:u}}throw Error("Invalid magic")}function m(e,t,r,n){let o=(0,l.getRefsDescriptor)(e.refs,e.mask.value,e.type),s=(0,l.getBitsDescriptor)(e.bits);n.writeUint(o,8),n.writeUint(s,8),n.writeBuffer((0,u.bitsToPaddedBuffer)(e.bits));for(let e of t)n.writeUint(e,8*r)}t.parseBoc=g,t.deserializeBoc=function(e){let t=g(e),r=new n.BitReader(new o.BitString(t.cellData,0,8*t.cellData.length)),i=[];for(let e=0;e<t.cells;e++){let e=p(r,t.size);
2i.push({...e,result:null})}for(let e=i.length-1;e>=0;e--){if(i[e].result)throw Error("Impossible");let t=[];for(let r of i[e].refs){if(!i[r].result)throw Error("Invalid BOC file");t.push(i[r].result)}i[e].result=new s.Cell({bits:i[e].bits,refs:t,exotic:i[e].exotic})}let a=[];for(let e=0;e<t.root.length;e++)a.push(i[t.root[e]].result);return a},t.serializeBoc=function(e,t){let r=(0,i.topologicalSort)(e),n=r.length,o=t.idx,s=t.crc32,l=Math.max(Math.ceil((0,a.bitsForNumber)(n,"uint")/8),1),u=0,h=[];for(let e of r){u+=f(e.cell,l),h.push(u)}let p=Math.max(Math.ceil((0,a.bitsForNumber)(u,"uint")/8),1),g=8*(6+3*l+p+1*l+(o?n*p:0)+u+(s?4:0)),y=new c.BitBuilder(g);if(y.writeUint(3052313714,32),y.writeBit(o),y.writeBit(s),y.writeBit(!1),y.writeUint(0,2),y.writeUint(l,3),y.writeUint(p,8),y.writeUint(n,8*l),y.writeUint(1,8*l),y.writeUint(0,8*l),y.writeUint(u,8*p),y.writeUint(0,8*l),o)for(let e=0;e<n;e++)y.writeUint(h[e],8*p);for(let e=0;e<n;e++)m(r[e].cell,r[e].refs,l,y);if(s){let e=(0,d.crc32c)(y.buffer());y.writeBuffer(e)}let b=y.buffer();if(b.length!==g/8)throw Error("Internal error");return b}},"./node_modules/@ton/core/dist/boc/cell/utils/topologicalSort.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.topologicalSort=void 0,t.topologicalSort=function(e){let t=[e],r=new Map,n=new Set,o=[];for(;t.length>0;){const e=[...t];t=[];for(let o of e){const e=o.hash().toString("hex");if(!r.has(e)){n.add(e),r.set(e,{cell:o,refs:o.refs.map((e=>e.hash().toString("hex")))});for(let e of o.refs)t.push(e)}}}let s=new Set;function i(e){if(!n.has(e))return;if(s.has(e))throw Error("Not a DAG");s.add(e);let t=r.get(e).refs;for(let e=t.length-1;e>=0;e--)i(t[e]);o.push(e),s.delete(e),n.delete(e)}for(;n.size>0;){i(Array.from(n)[0])}let a=new Map;for(let e=0;e<o.length;e++)a.set(o[o.length-e-1],e);let c=[];for(let e=o.length-1;e>=0;e--){let t=o[e];const n=r.get(t);c.push({cell:n.cell,refs:n.refs.map((e=>a.get(e)))})}return c}},"./node_modules/@ton/core/dist/boc/cell/wonderCalculator.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wonderCalculator=void 0;const n=r("./node_modules/@ton/core/dist/boc/BitString.js"),o=r("./node_modules/@ton/core/dist/boc/CellType.js"),s=r("./node_modules/@ton/core/dist/boc/cell/LevelMask.js"),i=r("./node_modules/@ton/core/dist/boc/cell/exoticPruned.js"),a=r("./node_modules/@ton/core/dist/boc/cell/exoticMerkleProof.js"),c=r("./node_modules/@ton/core/dist/boc/cell/descriptor.js"),l=r("./node_modules/@ton/crypto/dist/index.js"),u=r("./node_modules/@ton/core/dist/boc/cell/exoticMerkleUpdate.js"),d=r("./node_modules/@ton/core/dist/boc/cell/exoticLibrary.js");t.wonderCalculator=function(e,t,r){let h,p=null;if(e===o.CellType.Ordinary){let e=0;for(let t of r)e|=t.mask.value;h=new s.LevelMask(e)}else if(e===o.CellType.PrunedBranch)p=(0,i.exoticPruned)(t,r),h=new s.LevelMask(p.mask);else if(e===o.CellType.MerkleProof){(0,a.exoticMerkleProof)(t,r);h=new s.LevelMask(r[0].mask.value>>1)}else if(e===o.CellType.MerkleUpdate){(0,u.exoticMerkleUpdate)(t,r);h=new s.LevelMask((r[0].mask.value|r[1].mask.value)>>1)}else{if(e!==o.CellType.Library)throw new Error("Unsupported exotic type");(0,d.exoticLibrary)(t,r);h=new s.LevelMask}let f=[],g=[],m=e===o.CellType.PrunedBranch?1:h.hashCount,y=h.hashCount-m;for(let s=0,i=0;s<=h.level;s++){if(!h.isSignificant(s))continue;if(i<y){i++;continue}let a;if(i===y){if(0!==s&&e!==o.CellType.PrunedBranch)throw Error("Invalid");a=t}else{if(0===s||e===o.CellType.PrunedBranch)throw Error("Invalid: "+s+", "+e);a=new n.BitString(g[i-y-1],0,256)}let u=0;for(let t of r){let r;r=e==o.CellType.MerkleProof||e==o.CellType.MerkleUpdate?t.depth(s+1):t.depth(s),u=Math.max(u,r)}r.length>0&&u++;let d=(0,c.getRepr)(t,a,r,s,h.apply(s).value,e),p=(0,l.sha256_sync)(d),m=i-y;f[m]=u,g[m]=p,i++}let b=[],w=[];if(p)for(let e=0;e<4;e++){const{hashIndex:t}=h.apply(e),{hashIndex:r}=h;t!==r?(b.push(p.pruned[t].hash),w.push(p.pruned[t].depth)):(b.push(g[0]),w.push(f[0]))}else for(let e=0;e<4;e++)b.push(g[h.apply(e).hashIndex]),w.push(f[h.apply(e).hashIndex]);return{mask:h,hashes:b,depths:w}}},"./node_modules/@ton/core/dist/boc/utils/paddedBits.js"(e,t,r){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.paddedBufferToBits=t.bitsToPaddedBuffer=void 0;const n=r("./node_modules/@ton/core/dist/boc/BitBuilder.js"),o=r("./node_modules/@ton/core/dist/boc/BitString.js");t.bitsToPaddedBuffer=function(e){let t=new n.BitBuilder(8*Math.ceil(e.length/8));t.writeBits(e);let r=8*Math.ceil(e.length/8)-e.length;for(let e=0;e<r;e++)0===e?t.writeBit(1):t.writeBit(0);return t.buffer()},t.paddedBufferToBits=function(e){let t=0;for(let r=e.length-1;r>=0;r--)if(0!==e[r]){const n=e[r];let o=n&-n;1&o||(o=Math.log2(o)+1),r>0&&(t=r<<3),t+=8-o;break}return new o.BitString(e,0,t)}},"./node_modules/@ton/core/dist/boc/utils/strings.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.writeString=t.stringToCell=t.readString=void 0;const o=r("./node_modules/@ton/core/dist/boc/Builder.js");function s(e){if(e.remainingBits%8!=0)throw new Error(`Invalid string length: ${e.remainingBits}`);if(0!==e.remainingRefs&&1!==e.remainingRefs)throw new Error(`invalid number of refs: ${e.remainingRefs}`);let t;return t=0===e.remainingBits?n.alloc(0):e.loadBuffer(e.remainingBits/8),1===e.remainingRefs&&(t=n.concat([t,s(e.loadRef().beginParse())])),t}function i(e,t){if(e.length>0){let r=Math.floor(t.availableBits/8);if(e.length>r){let n=e.subarray(0,r),s=e.subarray(r);t=t.storeBuffer(n);let a=(0,o.beginCell)();i(s,a),t=t.storeRef(a.endCell())}else t=t.storeBuffer(e)}}t.readString=function(e){return s(e).toString()},t.stringToCell=function(e){let t=(0,o.beginCell)();return i(n.from(e),t),t.endCell()},t.writeString=function(e,t){i(n.from(e),t)}},"./node_modules/@ton/core/dist/contract/ComputeError.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ComputeError=void 0;class r extends Error{constructor(e,t,n){super(e),this.exitCode=t,this.debugLogs=n&&n.debugLogs?n.debugLogs:null,this.logs=n&&n.logs?n.logs:null,Object.setPrototypeOf(this,r.prototype)}}t.ComputeError=r},"./node_modules/@ton/core/dist/contract/openContract.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.openContract=void 0;const n=r("./node_modules/@ton/core/dist/address/Address.js"),o=r("./node_modules/@ton/core/dist/boc/Cell.js");t.openContract=function(e,t){let r,s=null;if(!n.Address.isAddress(e.address))throw Error("Invalid address");if(r=e.address,e.init){if(!(e.init.code instanceof o.Cell))throw Error("Invalid init.code");if(!(e.init.data instanceof o.Cell))throw Error("Invalid init.data");s=e.init}let i=t({address:r,init:s});return new Proxy(e,{get(e,t){const r=e[t];return"string"==typeof t&&(t.startsWith("get")||t.startsWith("send")||t.startsWith("is"))&&"function"==typeof r?(...t)=>r.apply(e,[i,...t]):r}})}},"./node_modules/@ton/core/dist/crypto/safeSign.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.safeSignVerify=t.safeSign=void 0;const o=r("./node_modules/@ton/crypto/dist/index.js");function s(e,t){let r=n.from(t);if(r.length>64)throw Error("Seed can\t be longer than 64 bytes");if(r.length<8)throw Error("Seed must be at least 8 bytes");return(0,o.sha256_sync)(n.concat([n.from([255,255]),r,e.hash()]))}t.safeSign=function(e,t,r="ton-safe-sign-magic"){return(0,o.sign)(s(e,r),t)},t.safeSignVerify=function(e,t,r,n="ton-safe-sign-magic"){return(0,o.signVerify)(s(e,n),t,r)}},"./node_modules/@ton/core/dist/dict/Dictionary.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.Dictionary=void 0;const o=r("./node_modules/@ton/core/dist/address/Address.js"),s=r("./node_modules/@ton/core/dist/boc/Builder.js"),i=r("./node_modules/@ton/core/dist/boc/Cell.js"),a=r("./node_modules/@ton/core/dist/boc/BitString.js"),c=r("./node_modules/@ton/core/dist/dict/generateMerkleProof.js"),l=r("./node_modules/@ton/core/dist/dict/generateMerkleUpdate.js"),u=r("./node_modules/@ton/core/dist/dict/parseDict.js"),d=r("./node_modules/@ton/core/dist/dict/serializeDict.js"),h=r("./node_modules/@ton/core/dist/dict/utils/internalKeySerializer.js");class p{static empty(e,t){return e&&t?new p(new Map,e,t):new p(new Map,null,null)}static load(e,t,r){let n;if(r instanceof i.Cell){if(r.isExotic)return p.empty(e,t);n=r.beginParse()}else n=r;let o=n.loadMaybeRef();return o&&!o.isExotic?p.loadDirect(e,t,o.beginParse()):p.empty(e,t)}static loadDirect(e,t,r){if(!r)return p.empty(e,t);let n;n=r instanceof i.Cell?r.beginParse():r;let o=(0,u.parseDict)(n,e.bits,t.parse),s=new Map;for(let[t,r]of o)s.set((0,h.serializeInternalKey)(e.parse(t)),r);return new p(s,e,t)}constructor(e,t,r){this._key=t,this._value=r,this._map=e}get size(){return this._map.size}get(e){return this._map.get((0,h.serializeInternalKey)(e))}has(e){return this._map.has((0,h.serializeInternalKey)(e))}set(e,t){return this._map.set((0,h.serializeInternalKey)(e),t),this}delete(e){const t=(0,h.serializeInternalKey)(e);return this._map.delete(t)}clear(){this._map.clear()}*[Symbol.iterator](){for(const[e,t]of this._map){const r=(0,h.deserializeInternalKey)(e);yield[r,t]}}keys(){return Array.from(this._map.keys()).map((e=>(0,h.deserializeInternalKey)(e)))}values(){return Array.from(this._map.values())}store(e,t,r){if(0===this._map.size)e.storeBit(0);else{let n=this._key;null!=t&&(n=t);let o=this._value;
2if(null!=r&&(o=r),!n)throw Error("Key serializer is not defined");if(!o)throw Error("Value serializer is not defined");let i=new Map;for(const[e,t]of this._map)i.set(n.serialize((0,h.deserializeInternalKey)(e)),t);e.storeBit(1);let a=(0,s.beginCell)();(0,d.serializeDict)(i,n.bits,o.serialize,a),e.storeRef(a.endCell())}}storeDirect(e,t,r){if(0===this._map.size)throw Error("Cannot store empty dictionary directly");let n=this._key;null!=t&&(n=t);let o=this._value;if(null!=r&&(o=r),!n)throw Error("Key serializer is not defined");if(!o)throw Error("Value serializer is not defined");let s=new Map;for(const[e,t]of this._map)s.set(n.serialize((0,h.deserializeInternalKey)(e)),t);(0,d.serializeDict)(s,n.bits,o.serialize,e)}generateMerkleProof(e){return(0,c.generateMerkleProof)(this,e,this._key)}generateMerkleProofDirect(e){return(0,c.generateMerkleProofDirect)(this,e,this._key)}generateMerkleUpdate(e,t){return(0,l.generateMerkleUpdate)(this,e,this._key,t)}}t.Dictionary=p,p.Keys={Address:()=>({bits:267,serialize:e=>{if(!o.Address.isAddress(e))throw Error("Key is not an address");return(0,s.beginCell)().storeAddress(e).endCell().beginParse().preloadUintBig(267)},parse:e=>(0,s.beginCell)().storeUint(e,267).endCell().beginParse().loadAddress()}),BigInt:e=>function(e){return{bits:e,serialize:t=>{if("bigint"!=typeof t)throw Error("Key is not a bigint");return(0,s.beginCell)().storeInt(t,e).endCell().beginParse().loadUintBig(e)},parse:t=>(0,s.beginCell)().storeUint(t,e).endCell().beginParse().loadIntBig(e)}}(e),Int:e=>function(e){return{bits:e,serialize:t=>{if("number"!=typeof t)throw Error("Key is not a number");if(!Number.isSafeInteger(t))throw Error("Key is not a safe integer: "+t);return(0,s.beginCell)().storeInt(t,e).endCell().beginParse().loadUintBig(e)},parse:t=>(0,s.beginCell)().storeUint(t,e).endCell().beginParse().loadInt(e)}}(e),BigUint:e=>function(e){return{bits:e,serialize:t=>{if("bigint"!=typeof t)throw Error("Key is not a bigint");if(t<0)throw Error("Key is negative: "+t);return(0,s.beginCell)().storeUint(t,e).endCell().beginParse().loadUintBig(e)},parse:t=>(0,s.beginCell)().storeUint(t,e).endCell().beginParse().loadUintBig(e)}}(e),Uint:e=>function(e){return{bits:e,serialize:t=>{if("number"!=typeof t)throw Error("Key is not a number");if(!Number.isSafeInteger(t))throw Error("Key is not a safe integer: "+t);if(t<0)throw Error("Key is negative: "+t);return(0,s.beginCell)().storeUint(t,e).endCell().beginParse().loadUintBig(e)},parse:t=>Number((0,s.beginCell)().storeUint(t,e).endCell().beginParse().loadUint(e))}}(e),Buffer:e=>function(e){return{bits:8*e,serialize:t=>{if(!n.isBuffer(t))throw Error("Key is not a buffer");return(0,s.beginCell)().storeBuffer(t).endCell().beginParse().loadUintBig(8*e)},parse:t=>(0,s.beginCell)().storeUint(t,8*e).endCell().beginParse().loadBuffer(e)}}(e),BitString:e=>function(e){return{bits:e,serialize:t=>{if(!a.BitString.isBitString(t))throw Error("Key is not a BitString");return(0,s.beginCell)().storeBits(t).endCell().beginParse().loadUintBig(e)},parse:t=>(0,s.beginCell)().storeUint(t,e).endCell().beginParse().loadBits(e)}}(e)},p.Values={BigInt:e=>function(e){return{serialize:(t,r)=>{r.storeInt(t,e)},parse:t=>{let r=t.loadIntBig(e);return t.endParse(),r}}}(e),Int:e=>function(e){return{serialize:(t,r)=>{r.storeInt(t,e)},parse:t=>{let r=t.loadInt(e);return t.endParse(),r}}}(e),BigVarInt:e=>function(e){return{serialize:(t,r)=>{r.storeVarInt(t,e)},parse:t=>{let r=t.loadVarIntBig(e);return t.endParse(),r}}}(e),BigUint:e=>function(e){return{serialize:(t,r)=>{r.storeUint(t,e)},parse:t=>{let r=t.loadUintBig(e);return t.endParse(),r}}}(e),Uint:e=>function(e){return{serialize:(t,r)=>{r.storeUint(t,e)},parse:t=>{let r=t.loadUint(e);return t.endParse(),r}}}(e),BigVarUint:e=>function(e){return{serialize:(t,r)=>{r.storeVarUint(t,e)},parse:t=>{let r=t.loadVarUintBig(e);return t.endParse(),r}}}(e),Bool:()=>({serialize:(e,t)=>{t.storeBit(e)},parse:e=>{let t=e.loadBit();return e.endParse(),t}}),Address:()=>({serialize:(e,t)=>{t.storeAddress(e)},parse:e=>{let t=e.loadAddress();return e.endParse(),t}}),Cell:()=>({serialize:(e,t)=>
2{t.storeRef(e)},parse:e=>{let t=e.loadRef();return e.endParse(),t}}),Buffer:e=>{return t=e,{serialize:(e,r)=>{if(e.length!==t)throw Error("Invalid buffer size");r.storeBuffer(e)},parse:e=>{let r=e.loadBuffer(t);return e.endParse(),r}};var t},BitString:e=>function(e){return{serialize:(t,r)=>{if(t.length!==e)throw Error("Invalid BitString size");r.storeBits(t)},parse:t=>{let r=t.loadBits(e);return t.endParse(),r}}}(e),Dictionary:(e,t)=>function(e,t){return{serialize:(e,t)=>{e.store(t)},parse:r=>{let n=p.load(e,t,r);return r.endParse(),n}}}(e,t)}},"./node_modules/@ton/core/dist/dict/generateMerkleProof.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateMerkleProof=t.generateMerkleProofDirect=void 0;const n=r("./node_modules/@ton/core/dist/boc/Builder.js"),o=r("./node_modules/@ton/core/dist/dict/utils/readUnaryLength.js"),s=r("./node_modules/@ton/core/dist/boc/cell/exoticMerkleProof.js");function i(e,t,r,s){const a=t.asCell();if(0==s.length)return c=a,(0,n.beginCell)().storeUint(1,8).storeUint(1,8).storeBuffer(c.hash(0)).storeUint(c.depth(0),16).endCell({exotic:!0});var c;let l=t.loadBit()?1:0,u=0,d=e;if(0===l){u=(0,o.readUnaryLength)(t);for(let e=0;e<u;e++)d+=t.loadBit()?"1":"0"}else{if(0===(t.loadBit()?1:0)){u=t.loadUint(Math.ceil(Math.log2(r+1)));for(let e=0;e<u;e++)d+=t.loadBit()?"1":"0"}else{let e=t.loadBit()?"1":"0";u=t.loadUint(Math.ceil(Math.log2(r+1)));for(let t=0;t<u;t++)d+=e}}if(r-u==0)return a;{let e=a.beginParse(),t=e.loadRef(),o=e.loadRef();if(!t.isExotic){const e=s.filter((e=>d+"0"===e.slice(0,d.length+1)));t=i(d+"0",t.beginParse(),r-u-1,e)}if(!o.isExotic){const e=s.filter((e=>d+"1"===e.slice(0,d.length+1)));o=i(d+"1",o.beginParse(),r-u-1,e)}return(0,n.beginCell)().storeSlice(e).storeRef(t).storeRef(o).endCell()}}function a(e,t,r){t.forEach((t=>{if(!e.has(t))throw new Error(`Trying to generate merkle proof for a missing key "${t}"`)}));return i("",(0,n.beginCell)().storeDictDirect(e).asSlice(),r.bits,t.map((e=>r.serialize(e).toString(2).padStart(r.bits,"0"))))}t.generateMerkleProofDirect=a,t.generateMerkleProof=function(e,t,r){return(0,s.convertToMerkleProof)(a(e,t,r))}},"./node_modules/@ton/core/dist/dict/generateMerkleUpdate.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateMerkleUpdate=void 0;const n=r("./node_modules/@ton/core/dist/boc/Builder.js"),o=r("./node_modules/@ton/core/dist/dict/generateMerkleProof.js");t.generateMerkleUpdate=function(e,t,r,s){const i=(0,o.generateMerkleProof)(e,[t],r).refs[0];e.set(t,s);const a=(0,o.generateMerkleProof)(e,[t],r).refs[0];return c=i,l=a,(0,n.beginCell)().storeUint(4,8).storeBuffer(c.hash(0)).storeBuffer(l.hash(0)).storeUint(c.depth(0),16).storeUint(l.depth(0),16).storeRef(c).storeRef(l).endCell({exotic:!0});var c,l}},"./node_modules/@ton/core/dist/dict/parseDict.js"(e,t){"use strict";function r(e,t,n,o,s){let i=0,a=e;if(0===(t.loadBit()?1:0)){i=function(e){let t=0;for(;e.loadBit();)t++;return t}(t);for(let e=0;e<i;e++)a+=t.loadBit()?"1":"0"}else{if(0===(t.loadBit()?1:0)){i=t.loadUint(Math.ceil(Math.log2(n+1)));for(let e=0;e<i;e++)a+=t.loadBit()?"1":"0"}else{let e=t.loadBit()?"1":"0";i=t.loadUint(Math.ceil(Math.log2(n+1)));for(let t=0;t<i;t++)a+=e}}if(n-i==0)o.set(BigInt("0b"+a),s(t));else{let e=t.loadRef(),c=t.loadRef();e.isExotic||r(a+"0",e.beginParse(),n-i-1,o,s),c.isExotic||r(a+"1",c.beginParse(),n-i-1,o,s)}}Object.defineProperty(t,"__esModule",{value:!0}),t.parseDict=void 0,t.parseDict=function(e,t,n){let o=new Map;return e&&r("",e,t,o,n),o}},"./node_modules/@ton/core/dist/dict/serializeDict.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeDict=t.detectLabelType=t.writeLabelSame=t.writeLabelLong=t.writeLabelShort=t.buildTree=void 0;const n=r("./node_modules/@ton/core/dist/boc/Builder.js"),o=r("./node_modules/@ton/core/dist/dict/utils/findCommonPrefix.js");function s(e,t){for(;e.length<t;)e="0"+e;return e}function i(e,t){if(0===e.size)throw Error("Internal inconsistency");if(1===e.size)return{type:"leaf",value:Array.from(e.values())[0]};let{left:r,right:n}=function(e,t){if(0===e.size)throw Error("Internal inconsistency");let r=new Map,n=new Map;for(let[o,s]of e.entries())"0"===o[t]?r.set(o,s):n.set(o,s);
2if(0===r.size)throw Error("Internal inconsistency. Left emtpy.");if(0===n.size)throw Error("Internal inconsistency. Right emtpy.");return{left:r,right:n}}(e,t);return{type:"fork",left:a(r,t+1),right:a(n,t+1)}}function a(e,t=0){if(0===e.size)throw Error("Internal inconsistency");const r=(0,o.findCommonPrefix)(Array.from(e.keys()),t);return{label:r,node:i(e,r.length+t)}}function c(e,t){let r=new Map;for(let n of Array.from(e.keys())){const o=s(n.toString(2),t);r.set(o,e.get(n))}return a(r)}function l(e,t){t.storeBit(0);for(let r=0;r<e.length;r++)t.storeBit(1);return t.storeBit(0),e.length>0&&t.storeUint(BigInt("0b"+e),e.length),t}function u(e,t,r){r.storeBit(1),r.storeBit(0);let n=Math.ceil(Math.log2(t+1));return r.storeUint(e.length,n),e.length>0&&r.storeUint(BigInt("0b"+e),e.length),r}function d(e,t,r,n){n.storeBit(1),n.storeBit(1),n.storeBit(e);let o=Math.ceil(Math.log2(r+1));n.storeUint(t,o)}function h(e,t){let r="short",n=function(e){return 1+e.length+1+e.length}(e),o=function(e,t){return 2+Math.ceil(Math.log2(t+1))+e.length}(e,t);if(o<n&&(n=o,r="long"),function(e){if(0===e.length||1===e.length)return!0;for(let t=1;t<e.length;t++)if(e[t]!==e[0])return!1;return!0}(e)){let e=function(e){return 3+Math.ceil(Math.log2(e+1))}(t);e<n&&(n=e,r="same")}return r}function p(e,t,r,o){!function(e,t,r){let n=h(e,t);"short"===n?l(e,r):"long"===n?u(e,t,r):"same"===n&&d("1"===e[0],e.length,t,r)}(e.label,t,o),function(e,t,r,o){if("leaf"===e.type&&r(e.value,o),"fork"===e.type){const s=(0,n.beginCell)(),i=(0,n.beginCell)();p(e.left,t-1,r,s),p(e.right,t-1,r,i),o.storeRef(s),o.storeRef(i)}}(e.node,t-e.label.length,r,o)}t.buildTree=c,t.writeLabelShort=l,t.writeLabelLong=u,t.writeLabelSame=d,t.detectLabelType=h,t.serializeDict=function(e,t,r,n){p(c(e,t),t,r,n)}},"./node_modules/@ton/core/dist/dict/utils/findCommonPrefix.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findCommonPrefix=void 0,t.findCommonPrefix=function(e,t=0){if(0===e.length)return"";let r=e[0].slice(t);for(let n=1;n<e.length;n++){const o=e[n];for(;o.indexOf(r,t)!==t;)if(r=r.substring(0,r.length-1),""===r)return r}return r}},"./node_modules/@ton/core/dist/dict/utils/internalKeySerializer.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.deserializeInternalKey=t.serializeInternalKey=void 0;const o=r("./node_modules/@ton/core/dist/address/Address.js"),s=r("./node_modules/@ton/core/dist/boc/BitString.js"),i=r("./node_modules/@ton/core/dist/boc/utils/paddedBits.js");t.serializeInternalKey=function(e){if("number"==typeof e){if(!Number.isSafeInteger(e))throw Error("Invalid key type: not a safe integer: "+e);return"n:"+e.toString(10)}if("bigint"==typeof e)return"b:"+e.toString(10);if(o.Address.isAddress(e))return"a:"+e.toString();if(n.isBuffer(e))return"f:"+e.toString("hex");if(s.BitString.isBitString(e))return"B:"+e.toString();throw Error("Invalid key type")},t.deserializeInternalKey=function(e){let t=e.slice(0,2),r=e.slice(2);if("n:"===t)return parseInt(r,10);if("b:"===t)return BigInt(r);if("a:"===t)return o.Address.parse(r);if("f:"===t)return n.from(r,"hex");if("B:"===t){const e="_"==r.slice(-1);if(e||r.length%2!=0){let t=e?r.length-1:r.length;const o=r.substr(0,t)+"0";return!e&&1&t?new s.BitString(n.from(o,"hex"),0,t<<2):(0,i.paddedBufferToBits)(n.from(o,"hex"))}return new s.BitString(n.from(r,"hex"),0,r.length<<2)}throw Error("Invalid key type: "+t)}},"./node_modules/@ton/core/dist/dict/utils/readUnaryLength.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.readUnaryLength=void 0,t.readUnaryLength=function(e){let t=0;for(;e.loadBit();)t++;return t}},"./node_modules/@ton/core/dist/index.js"(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};
2Object.defineProperty(t,"__esModule",{value:!0}),t.safeSignVerify=t.safeSign=t.getMethodId=t.base32Encode=t.base32Decode=t.crc32c=t.crc16=t.fromNano=t.toNano=t.ComputeError=t.openContract=t.TupleBuilder=t.TupleReader=t.serializeTuple=t.parseTuple=t.generateMerkleUpdate=t.generateMerkleProofDirect=t.generateMerkleProof=t.exoticPruned=t.exoticMerkleUpdate=t.convertToMerkleProof=t.exoticMerkleProof=t.Dictionary=t.Cell=t.CellType=t.Slice=t.beginCell=t.Builder=t.BitBuilder=t.BitReader=t.BitString=t.contractAddress=t.ADNLAddress=t.ExternalAddress=t.address=t.Address=void 0;var s=r("./node_modules/@ton/core/dist/address/Address.js");Object.defineProperty(t,"Address",{enumerable:!0,get:function(){return s.Address}}),Object.defineProperty(t,"address",{enumerable:!0,get:function(){return s.address}});var i=r("./node_modules/@ton/core/dist/address/ExternalAddress.js");Object.defineProperty(t,"ExternalAddress",{enumerable:!0,get:function(){return i.ExternalAddress}});var a=r("./node_modules/@ton/core/dist/address/ADNLAddress.js");Object.defineProperty(t,"ADNLAddress",{enumerable:!0,get:function(){return a.ADNLAddress}});var c=r("./node_modules/@ton/core/dist/address/contractAddress.js");Object.defineProperty(t,"contractAddress",{enumerable:!0,get:function(){return c.contractAddress}});var l=r("./node_modules/@ton/core/dist/boc/BitString.js");Object.defineProperty(t,"BitString",{enumerable:!0,get:function(){return l.BitString}});var u=r("./node_modules/@ton/core/dist/boc/BitReader.js");Object.defineProperty(t,"BitReader",{enumerable:!0,get:function(){return u.BitReader}});var d=r("./node_modules/@ton/core/dist/boc/BitBuilder.js");Object.defineProperty(t,"BitBuilder",{enumerable:!0,get:function(){return d.BitBuilder}});var h=r("./node_modules/@ton/core/dist/boc/Builder.js");Object.defineProperty(t,"Builder",{enumerable:!0,get:function(){return h.Builder}}),Object.defineProperty(t,"beginCell",{enumerable:!0,get:function(){return h.beginCell}});var p=r("./node_modules/@ton/core/dist/boc/Slice.js");Object.defineProperty(t,"Slice",{enumerable:!0,get:function(){return p.Slice}});var f=r("./node_modules/@ton/core/dist/boc/CellType.js");Object.defineProperty(t,"CellType",{enumerable:!0,get:function(){return f.CellType}});var g=r("./node_modules/@ton/core/dist/boc/Cell.js");Object.defineProperty(t,"Cell",{enumerable:!0,get:function(){return g.Cell}});var m=r("./node_modules/@ton/core/dist/dict/Dictionary.js");Object.defineProperty(t,"Dictionary",{enumerable:!0,get:function(){return m.Dictionary}});var y=r("./node_modules/@ton/core/dist/boc/cell/exoticMerkleProof.js");Object.defineProperty(t,"exoticMerkleProof",{enumerable:!0,get:function(){return y.exoticMerkleProof}}),Object.defineProperty(t,"convertToMerkleProof",{enumerable:!0,get:function(){return y.convertToMerkleProof}});var b=r("./node_modules/@ton/core/dist/boc/cell/exoticMerkleUpdate.js");Object.defineProperty(t,"exoticMerkleUpdate",{enumerable:!0,get:function(){return b.exoticMerkleUpdate}});var w=r("./node_modules/@ton/core/dist/boc/cell/exoticPruned.js");Object.defineProperty(t,"exoticPruned",{enumerable:!0,get:function(){return w.exoticPruned}});var v=r("./node_modules/@ton/core/dist/dict/generateMerkleProof.js");Object.defineProperty(t,"generateMerkleProof",{enumerable:!0,get:function(){return v.generateMerkleProof}}),Object.defineProperty(t,"generateMerkleProofDirect",{enumerable:!0,get:function(){return v.generateMerkleProofDirect}});var A=r("./node_modules/@ton/core/dist/dict/generateMerkleUpdate.js");Object.defineProperty(t,"generateMerkleUpdate",{enumerable:!0,get:function(){return A.generateMerkleUpdate}});var T=r("./node_modules/@ton/core/dist/tuple/tuple.js");Object.defineProperty(t,"parseTuple",{enumerable:!0,get:function(){return T.parseTuple}}),Object.defineProperty(t,"serializeTuple",{enumerable:!0,get:function(){return T.serializeTuple}});var P=r("./node_modules/@ton/core/dist/tuple/reader.js");Object.defineProperty(t,"TupleReader",{enumerable:!0,get:function(){return P.TupleReader}});var E=r("./node_modules/@ton/core/dist/tuple/builder.js");Object.defineProperty(t,"TupleBuilder",{enumerable:!0,get:function(){return E.TupleBuilder}}),o(r("./node_modules/@ton/core/dist/types/_export.js"),t);var C=r("./node_modules/@ton/core/dist/contract/openContract.js");Object.defineProperty(t,"openContract",{enumerable:!0,get:function(){return C.openContract}});var k=r("./node_modules/@ton/core/dist/contract/ComputeError.js");Object.defineProperty(t,"ComputeError",{enumerable:!0,get:function(){return k.ComputeError}});var _=r("./node_modules/@ton/core/dist/utils/convert.js");Object.defineProperty(t,"toNano",{enumerable:!0,get:function(){return _.toNano}}),Object.defineProperty(t,"fromNano",{enumerable:!0,get:function(){return _.fromNano}});var I=r("./node_modules/@ton/core/dist/utils/crc16.js");Object.defineProperty(t,"crc16",{enumerable:!0,get:function(){return I.crc16}});var S=r("./node_modules/@ton/core/dist/utils/crc32c.js");Object.defineProperty(t,"crc32c",{enumerable:!0,get:function(){return S.crc32c}});var x=r("./node_modules/@ton/core/dist/utils/base32.js");Object.defineProperty(t,"base32Decode",{enumerable:!0,get:function(){return x.base32Decode}}),Object.defineProperty(t,"base32Encode",{enumerable:!0,get:function(){return x.base32Encode}});var B=r("./node_modules/@ton/core/dist/utils/getMethodId.js");Object.defineProperty(t,"getMethodId",{enumerable:!0,get:function(){return B.getMethodId}});var O=r("./node_modules/@ton/core/dist/crypto/safeSign.js");Object.defineProperty(t,"safeSign",{enumerable:!0,get:function(){return O.safeSign}}),Object.defineProperty(t,"safeSignVerify",{enumerable:!0,get:function(){return O.safeSignVerify}})},"./node_modules/@ton/core/dist/tuple/builder.js"(e,t,r){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.TupleBuilder=void 0;const n=r("./node_modules/@ton/core/dist/boc/Builder.js"),o=r("./node_modules/@ton/core/dist/boc/Cell.js"),s=r("./node_modules/@ton/core/dist/boc/Slice.js");t.TupleBuilder=class{constructor(){this._tuple=[]}writeNumber(e){null==e?this._tuple.push({type:"null"}):this._tuple.push({type:"int",value:BigInt(e)})}writeBoolean(e){null==e?this._tuple.push({type:"null"}):this._tuple.push({type:"int",value:e?-1n:0n})}writeBuffer(e){null==e?this._tuple.push({type:"null"}):this._tuple.push({type:"slice",cell:(0,n.beginCell)().storeBuffer(e).endCell()})}writeString(e){null==e?this._tuple.push({type:"null"}):this._tuple.push({type:"slice",cell:(0,n.beginCell)().storeStringTail(e).endCell()})}writeCell(e){null==e?this._tuple.push({type:"null"}):e instanceof o.Cell?this._tuple.push({type:"cell",cell:e}):e instanceof s.Slice&&this._tuple.push({type:"cell",cell:e.asCell()})}writeSlice(e){null==e?this._tuple.push({type:"null"}):e instanceof o.Cell?this._tuple.push({type:"slice",cell:e}):e instanceof s.Slice&&this._tuple.push({type:"slice",cell:e.asCell()})}writeBuilder(e){null==e?this._tuple.push({type:"null"}):e instanceof o.Cell?this._tuple.push({type:"builder",cell:e}):e instanceof s.Slice&&this._tuple.push({type:"builder",cell:e.asCell()})}writeTuple(e){null==e?this._tuple.push({type:"null"}):this._tuple.push({type:"tuple",items:e})}writeAddress(e){null==e?this._tuple.push({type:"null"}):this._tuple.push({type:"slice",cell:(0,n.beginCell)().storeAddress(e).endCell()})}build(){return[...this._tuple]}}},"./node_modules/@ton/core/dist/tuple/reader.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TupleReader=void 0;class r{constructor(e){this.items=[...e]}get remaining(){return this.items.length}peek(){if(0===this.items.length)throw Error("EOF");return this.items[0]}pop(){if(0===this.items.length)throw Error("EOF");let e=this.items[0];return this.items.splice(0,1),e}skip(e=1){for(let t=0;t<e;t++)this.pop();return this}readBigNumber(){let e=this.pop();if("int"!==e.type)throw Error("Not a number");return e.value}readBigNumberOpt(){let e=this.pop();if("null"===e.type)return null;if("int"!==e.type)throw Error("Not a number");return e.value}readNumber(){return Number(this.readBigNumber())}readNumberOpt(){let e=this.readBigNumberOpt();return null!==e?Number(e):null}readBoolean(){return 0!==this.readNumber()}readBooleanOpt(){let e=this.readNumberOpt();return null!==e?0!==e:null}readAddress(){let e=this.readCell().beginParse().loadAddress();if(null!==e)return e;throw Error("Not an address")}readAddressOpt(){let e=this.readCellOpt();return null!==e?e.beginParse().loadMaybeAddress():null}readCell(){let e=this.pop();if("cell"!==e.type&&"slice"!==e.type&&"builder"!==e.type)throw Error("Not a cell: "+e.type);return e.cell}readCellOpt(){let e=this.pop();if("null"===e.type)return null;if("cell"!==e.type&&"slice"!==e.type&&"builder"!==e.type)throw Error("Not a cell");return e.cell}readTuple(){let e=this.pop();if("tuple"!==e.type)throw Error("Not a tuple");return new r(e.items)}readTupleOpt(){let e=this.pop();if("null"===e.type)return null;if("tuple"!==e.type)throw Error("Not a tuple");return new r(e.items)}static readLispList(e){const t=[];let r=e;for(;null!==r;){var n=r.pop();if(0===r.items.length||"tuple"!==r.items[0].type&&"null"!==r.items[0].type)throw Error("Lisp list consists only from (any, tuple) elements and ends with null");r=r.readTupleOpt(),t.push(n)}return t}readLispListDirect(){return 1===this.items.length&&"null"===this.items[0].type?[]:r.readLispList(this)}readLispList(){return r.readLispList(this.readTupleOpt())}readBuffer(){let e=this.readCell().beginParse();if(0!==e.remainingRefs)throw Error("Not a buffer");if(e.remainingBits%8!=0)throw Error("Not a buffer");return e.loadBuffer(e.remainingBits/8)}readBufferOpt(){let e=this.readCellOpt();if(null!==e){let t=e.beginParse();if(0!==t.remainingRefs||t.remainingBits%8!=0)throw Error("Not a buffer");return t.loadBuffer(t.remainingBits/8)}return null}readString(){return this.readCell().beginParse().loadStringTail()}readStringOpt(){let e=this.readCellOpt();if(null!==e){return e.beginParse().loadStringTail()}return null}}t.TupleReader=r},"./node_modules/@ton/core/dist/tuple/tuple.js"(e,t,r){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.parseTuple=t.serializeTuple=void 0;const n=r("./node_modules/@ton/core/dist/boc/Builder.js"),o=BigInt("-9223372036854775808"),s=BigInt("9223372036854775807");function i(e,t){if("null"===e.type)t.storeUint(0,8);else if("int"===e.type)e.value<=s&&e.value>=o?(t.storeUint(1,8),t.storeInt(e.value,64)):(t.storeUint(256,15),t.storeInt(e.value,257));else if("nan"===e.type)t.storeInt(767,16);else if("cell"===e.type)t.storeUint(3,8),t.storeRef(e.cell);else if("slice"===e.type)t.storeUint(4,8),t.storeUint(0,10),t.storeUint(e.cell.bits.length,10),t.storeUint(0,3),t.storeUint(e.cell.refs.length,3),t.storeRef(e.cell);else if("builder"===e.type)t.storeUint(5,8),t.storeRef(e.cell);else{if("tuple"!==e.type)throw Error("Invalid value");{let r=null,o=null;for(let t=0;t<e.items.length;t++){let s=r;r=o,o=s,t>1&&(r=(0,n.beginCell)().storeRef(o).storeRef(r).endCell());let a=(0,n.beginCell)();i(e.items[t],a),o=a.endCell()}t.storeUint(7,8),t.storeUint(e.items.length,16),r&&t.storeRef(r),o&&t.storeRef(o)}}}function a(e){let t=e.loadUint(8);if(0===t)return{type:"null"};if(1===t)return{type:"int",value:e.loadIntBig(64)};if(2===t)return 0===e.loadUint(7)?{type:"int",value:e.loadIntBig(257)}:(e.loadBit(),{type:"nan"});if(3===t)return{type:"cell",cell:e.loadRef()};if(4===t){let t=e.loadUint(10),r=e.loadUint(10),o=e.loadUint(3),s=e.loadUint(3),i=e.loadRef().beginParse();i.skip(t);let a=i.loadBits(r-t),c=(0,n.beginCell)().storeBits(a);if(o<s){for(let e=0;e<o;e++)i.loadRef();for(let e=0;e<s-o;e++)c.storeRef(i.loadRef())}return{type:"slice",cell:c.endCell()}}if(5===t)return{type:"builder",cell:e.loadRef()};if(7===t){let t=e.loadUint(16),r=[];if(t>1){let n=e.loadRef().beginParse(),o=e.loadRef().beginParse();r.unshift(a(o));for(let e=0;e<t-2;e++){let e=n;n=e.loadRef().beginParse(),o=e.loadRef().beginParse(),r.unshift(a(o))}r.unshift(a(n))}else 1===t&&r.push(a(e.loadRef().beginParse()));return{type:"tuple",items:r}}throw Error("Unsupported stack item")}function c(e,t){if(e.length>0){let r=(0,n.beginCell)();c(e.slice(0,e.length-1),r),t.storeRef(r.endCell()),i(e[e.length-1],t)}}t.serializeTuple=function(e){let t=(0,n.beginCell)();return t.storeUint(e.length,24),c([...e],t),t.endCell()},t.parseTuple=function(e){let t=[],r=e.beginParse(),n=r.loadUint(24);for(let e=0;e<n;e++){let e=r.loadRef();t.unshift(a(r)),r=e.beginParse()}return t}},"./node_modules/@ton/core/dist/types/Account.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeAccount=t.loadAccount=void 0;const n=r("./node_modules/@ton/core/dist/types/AccountStorage.js"),o=r("./node_modules/@ton/core/dist/types/StorageInto.js");t.loadAccount=function(e){return{addr:e.loadAddress(),storageStats:(0,o.loadStorageInfo)(e),storage:(0,n.loadAccountStorage)(e)}},t.storeAccount=function(e){return t=>{t.storeAddress(e.addr),t.store((0,o.storeStorageInfo)(e.storageStats)),t.store((0,n.storeAccountStorage)(e.storage))}}},"./node_modules/@ton/core/dist/types/AccountState.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeAccountState=t.loadAccountState=void 0;const n=r("./node_modules/@ton/core/dist/types/StateInit.js");t.loadAccountState=function(e){return e.loadBit()?{type:"active",state:(0,n.loadStateInit)(e)}:e.loadBit()?{type:"frozen",stateHash:e.loadUintBig(256)}:{type:"uninit"}},t.storeAccountState=function(e){return t=>{"active"===e.type?(t.storeBit(!0),t.store((0,n.storeStateInit)(e.state))):"frozen"===e.type?(t.storeBit(!1),t.storeBit(!0),t.storeUint(e.stateHash,256)):"uninit"===e.type&&(t.storeBit(!1),t.storeBit(!1))}}},"./node_modules/@ton/core/dist/types/AccountStatus.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeAccountStatus=t.loadAccountStatus=void 0,t.loadAccountStatus=function(e){const t=e.loadUint(2);if(0===t)return"uninitialized";if(1===t)return"frozen";if(2===t)return"active";if(3===t)return"non-existing";throw Error("Invalid data")},t.storeAccountStatus=function(e){return t=>{if("uninitialized"===e)t.storeUint(0,2);else if("frozen"===e)t.storeUint(1,2);else if("active"===e)t.storeUint(2,2);else{if("non-existing"!==e)throw Error("Invalid data");t.storeUint(3,2)}return t}}},"./node_modules/@ton/core/dist/types/AccountStatusChange.js"(e,t){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.storeAccountStatusChange=t.loadAccountStatusChange=void 0,t.loadAccountStatusChange=function(e){return e.loadBit()?e.loadBit()?"deleted":"frozen":"unchanged"},t.storeAccountStatusChange=function(e){return t=>{if("unchanged"==e)t.storeBit(0);else if("frozen"===e)t.storeBit(1),t.storeBit(0);else{if("deleted"!==e)throw Error("Invalid account status change");t.storeBit(1),t.storeBit(1)}}}},"./node_modules/@ton/core/dist/types/AccountStorage.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeAccountStorage=t.loadAccountStorage=void 0;const n=r("./node_modules/@ton/core/dist/types/AccountState.js"),o=r("./node_modules/@ton/core/dist/types/CurrencyCollection.js");t.loadAccountStorage=function(e){return{lastTransLt:e.loadUintBig(64),balance:(0,o.loadCurrencyCollection)(e),state:(0,n.loadAccountState)(e)}},t.storeAccountStorage=function(e){return t=>{t.storeUint(e.lastTransLt,64),t.store((0,o.storeCurrencyCollection)(e.balance)),t.store((0,n.storeAccountState)(e.state))}}},"./node_modules/@ton/core/dist/types/CommonMessageInfo.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeCommonMessageInfo=t.loadCommonMessageInfo=void 0;const n=r("./node_modules/@ton/core/dist/types/CurrencyCollection.js");t.loadCommonMessageInfo=function(e){if(!e.loadBit()){return{type:"internal",ihrDisabled:e.loadBit(),bounce:e.loadBit(),bounced:e.loadBit(),src:e.loadAddress(),dest:e.loadAddress(),value:(0,n.loadCurrencyCollection)(e),ihrFee:e.loadCoins(),forwardFee:e.loadCoins(),createdLt:e.loadUintBig(64),createdAt:e.loadUint(32)}}if(!e.loadBit()){return{type:"external-in",src:e.loadMaybeExternalAddress(),dest:e.loadAddress(),importFee:e.loadCoins()}}return{type:"external-out",src:e.loadAddress(),dest:e.loadMaybeExternalAddress(),createdLt:e.loadUintBig(64),createdAt:e.loadUint(32)}},t.storeCommonMessageInfo=function(e){return t=>{if("internal"===e.type)t.storeBit(0),t.storeBit(e.ihrDisabled),t.storeBit(e.bounce),t.storeBit(e.bounced),t.storeAddress(e.src),t.storeAddress(e.dest),t.store((0,n.storeCurrencyCollection)(e.value)),t.storeCoins(e.ihrFee),t.storeCoins(e.forwardFee),t.storeUint(e.createdLt,64),t.storeUint(e.createdAt,32);else if("external-in"===e.type)t.storeBit(1),t.storeBit(0),t.storeAddress(e.src),t.storeAddress(e.dest),t.storeCoins(e.importFee);else{if("external-out"!==e.type)throw new Error("Unknown CommonMessageInfo type");t.storeBit(1),t.storeBit(1),t.storeAddress(e.src),t.storeAddress(e.dest),t.storeUint(e.createdLt,64),t.storeUint(e.createdAt,32)}}}},"./node_modules/@ton/core/dist/types/CommonMessageInfoRelaxed.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeCommonMessageInfoRelaxed=t.loadCommonMessageInfoRelaxed=void 0;const n=r("./node_modules/@ton/core/dist/types/CurrencyCollection.js");t.loadCommonMessageInfoRelaxed=function(e){if(!e.loadBit()){return{type:"internal",ihrDisabled:e.loadBit(),bounce:e.loadBit(),bounced:e.loadBit(),src:e.loadMaybeAddress(),dest:e.loadAddress(),value:(0,n.loadCurrencyCollection)(e),ihrFee:e.loadCoins(),forwardFee:e.loadCoins(),createdLt:e.loadUintBig(64),createdAt:e.loadUint(32)}}if(!e.loadBit())throw Error("External In message is not possible for CommonMessageInfoRelaxed");return{type:"external-out",src:e.loadMaybeAddress(),dest:e.loadMaybeExternalAddress(),createdLt:e.loadUintBig(64),createdAt:e.loadUint(32)}},t.storeCommonMessageInfoRelaxed=function(e){return t=>{if("internal"===e.type)t.storeBit(0),t.storeBit(e.ihrDisabled),t.storeBit(e.bounce),t.storeBit(e.bounced),t.storeAddress(e.src),t.storeAddress(e.dest),t.store((0,n.storeCurrencyCollection)(e.value)),t.storeCoins(e.ihrFee),t.storeCoins(e.forwardFee),t.storeUint(e.createdLt,64),t.storeUint(e.createdAt,32);else{if("external-out"!==e.type)throw new Error("Unknown CommonMessageInfo type");t.storeBit(1),t.storeBit(1),t.storeAddress(e.src),t.storeAddress(e.dest),t.storeUint(e.createdLt,64),t.storeUint(e.createdAt,32)}}}},"./node_modules/@ton/core/dist/types/ComputeSkipReason.js"(e,t){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.storeComputeSkipReason=t.loadComputeSkipReason=void 0,t.loadComputeSkipReason=function(e){let t=e.loadUint(2);if(0===t)return"no-state";if(1===t)return"bad-state";if(2===t)return"no-gas";throw new Error(`Unknown ComputeSkipReason: ${t}`)},t.storeComputeSkipReason=function(e){return t=>{if("no-state"===e)t.storeUint(0,2);else if("bad-state"===e)t.storeUint(1,2);else{if("no-gas"!==e)throw new Error(`Unknown ComputeSkipReason: ${e}`);t.storeUint(2,2)}}}},"./node_modules/@ton/core/dist/types/CurrencyCollection.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeCurrencyCollection=t.loadCurrencyCollection=void 0;const n=r("./node_modules/@ton/core/dist/dict/Dictionary.js");t.loadCurrencyCollection=function(e){const t=e.loadCoins(),r=e.loadDict(n.Dictionary.Keys.Uint(32),n.Dictionary.Values.BigVarUint(5));return 0===r.size?{coins:t}:{other:r,coins:t}},t.storeCurrencyCollection=function(e){return t=>{t.storeCoins(e.coins),e.other?t.storeDict(e.other):t.storeBit(0)}}},"./node_modules/@ton/core/dist/types/DepthBalanceInfo.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeDepthBalanceInfo=t.loadDepthBalanceInfo=void 0;const n=r("./node_modules/@ton/core/dist/types/CurrencyCollection.js");t.loadDepthBalanceInfo=function(e){return{splitDepth:e.loadUint(5),balance:(0,n.loadCurrencyCollection)(e)}},t.storeDepthBalanceInfo=function(e){return t=>{t.storeUint(e.splitDepth,5),t.store((0,n.storeCurrencyCollection)(e.balance))}}},"./node_modules/@ton/core/dist/types/ExtraCurrency.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.packExtraCurrencyCell=t.packExtraCurrencyDict=t.storeExtraCurrency=t.loadMaybeExtraCurrency=t.loadExtraCurrency=void 0;const n=r("./node_modules/@ton/core/dist/boc/Builder.js"),o=r("./node_modules/@ton/core/dist/dict/Dictionary.js");function s(e){let t=e instanceof o.Dictionary?e:o.Dictionary.loadDirect(o.Dictionary.Keys.Uint(32),o.Dictionary.Values.BigVarUint(5),e),r={};for(let[e,n]of t)r[e]=n;return r}function i(e){const t=o.Dictionary.empty(o.Dictionary.Keys.Uint(32),o.Dictionary.Values.BigVarUint(5));return Object.entries(e).map((([e,r])=>t.set(Number(e),r))),t}t.loadExtraCurrency=s,t.loadMaybeExtraCurrency=function(e){const t=e.loadMaybeRef();return null===t?t:s(t)},t.storeExtraCurrency=function(e){return t=>{t.storeDict(i(e))}},t.packExtraCurrencyDict=i,t.packExtraCurrencyCell=function(e){return(0,n.beginCell)().storeDictDirect(i(e)).endCell()}},"./node_modules/@ton/core/dist/types/HashUpdate.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeHashUpdate=t.loadHashUpdate=void 0,t.loadHashUpdate=function(e){if(114!==e.loadUint(8))throw Error("Invalid data");return{oldHash:e.loadBuffer(32),newHash:e.loadBuffer(32)}},t.storeHashUpdate=function(e){return t=>{t.storeUint(114,8),t.storeBuffer(e.oldHash),t.storeBuffer(e.newHash)}}},"./node_modules/@ton/core/dist/types/LibRef.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeLibRef=t.loadLibRef=void 0,t.loadLibRef=function(e){return 0===e.loadUint(1)?{type:"hash",libHash:e.loadBuffer(32)}:{type:"ref",library:e.loadRef()}},t.storeLibRef=function(e){return t=>{"hash"===e.type?(t.storeUint(0,1),t.storeBuffer(e.libHash)):(t.storeUint(1,1),t.storeRef(e.library))}}},"./node_modules/@ton/core/dist/types/MasterchainStateExtra.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadMasterchainStateExtra=void 0;const n=r("./node_modules/@ton/core/dist/dict/Dictionary.js"),o=r("./node_modules/@ton/core/dist/types/CurrencyCollection.js");t.loadMasterchainStateExtra=function(e){if(52262!==e.loadUint(16))throw Error("Invalid data");e.loadBit()&&e.loadRef();let t=e.loadUintBig(256);return{config:n.Dictionary.load(n.Dictionary.Keys.Int(32),n.Dictionary.Values.Cell(),e),configAddress:t,globalBalance:(0,o.loadCurrencyCollection)(e)}}},"./node_modules/@ton/core/dist/types/Message.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageValue=t.storeMessage=t.loadMessage=void 0;const n=r("./node_modules/@ton/core/dist/boc/Builder.js"),o=r("./node_modules/@ton/core/dist/types/CommonMessageInfo.js"),s=r("./node_modules/@ton/core/dist/types/StateInit.js");function i(e){const t=(0,o.loadCommonMessageInfo)(e);let r=null;e.loadBit()&&(r=e.loadBit()?(0,s.loadStateInit)(e.loadRef().beginParse()):(0,s.loadStateInit)(e));return{info:t,init:r,body:e.loadBit()?e.loadRef():e.asCell()}}function a(e,t){return r=>{if(r.store((0,o.storeCommonMessageInfo)(e.info)),e.init){r.storeBit(!0);let o=(0,n.beginCell)().store((0,s.storeStateInit)(e.init)),i=!1;i=!(!t||!t.forceRef)||r.availableBits-2<o.bits+e.body.bits.length,i?(r.storeBit(!0),r.storeRef(o)):(r.storeBit(!1),r.storeBuilder(o))}else r.storeBit(!1);let i=!1;i=!(!t||!t.forceRef)||(r.availableBits-1<e.body.bits.length||r.refs+e.body.refs.length>4),i?(r.storeBit(!0),r.storeRef(e.body)):(r.storeBit(!1),r.storeBuilder(e.body.asBuilder()))}}t.loadMessage=i,t.storeMessage=a,t.MessageValue={serialize(e,t){t.storeRef((0,n.beginCell)().store(a(e)))},parse:e=>i(e.loadRef().beginParse())}},"./node_modules/@ton/core/dist/types/MessageRelaxed.js"(e,t,r){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.storeMessageRelaxed=t.loadMessageRelaxed=void 0;const n=r("./node_modules/@ton/core/dist/boc/Builder.js"),o=r("./node_modules/@ton/core/dist/types/CommonMessageInfoRelaxed.js"),s=r("./node_modules/@ton/core/dist/types/StateInit.js");t.loadMessageRelaxed=function(e){const t=(0,o.loadCommonMessageInfoRelaxed)(e);let r=null;return e.loadBit()&&(r=e.loadBit()?(0,s.loadStateInit)(e.loadRef().beginParse()):(0,s.loadStateInit)(e)),{info:t,init:r,body:e.loadBit()?e.loadRef():e.asCell()}},t.storeMessageRelaxed=function(e,t){return r=>{if(r.store((0,o.storeCommonMessageInfoRelaxed)(e.info)),e.init){r.storeBit(!0);let o=(0,n.beginCell)().store((0,s.storeStateInit)(e.init)),i=!1;i=!(!t||!t.forceRef)||!(r.availableBits-2>=o.bits),i?(r.storeBit(!0),r.storeRef(o)):(r.storeBit(!1),r.storeBuilder(o))}else r.storeBit(!1);let i=!1;i=!(!t||!t.forceRef)||!(r.availableBits-1>=e.body.bits.length&&r.refs+e.body.refs.length<=4&&!e.body.isExotic),i?(r.storeBit(!0),r.storeRef(e.body)):(r.storeBit(!1),r.storeBuilder(e.body.asBuilder()))}}},"./node_modules/@ton/core/dist/types/OutList.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadOutList=t.storeOutList=t.loadOutAction=t.storeOutAction=void 0;const n=r("./node_modules/@ton/core/dist/types/MessageRelaxed.js"),o=r("./node_modules/@ton/core/dist/boc/Builder.js"),s=r("./node_modules/@ton/core/dist/types/CurrencyCollection.js"),i=r("./node_modules/@ton/core/dist/types/LibRef.js");function a(e){switch(e.type){case"sendMsg":return function(e){return t=>{t.storeUint(c,32).storeUint(e.mode,8).storeRef((0,o.beginCell)().store((0,n.storeMessageRelaxed)(e.outMsg)).endCell())}}(e);case"setCode":return function(e){return t=>{t.storeUint(l,32).storeRef(e.newCode)}}(e);case"reserve":return function(e){return t=>{t.storeUint(u,32).storeUint(e.mode,8).store((0,s.storeCurrencyCollection)(e.currency))}}(e);case"changeLibrary":return function(e){return t=>{t.storeUint(d,32).storeUint(e.mode,7).store((0,i.storeLibRef)(e.libRef))}}(e);default:throw new Error(`Unknown action type ${e.type}`)}}t.storeOutAction=a;const c=247711853;const l=2907562126;const u=921090057;const d=653925844;function h(e){const t=e.loadUint(32);if(t===c){return{type:"sendMsg",mode:e.loadUint(8),outMsg:(0,n.loadMessageRelaxed)(e.loadRef().beginParse())}}if(t===l){return{type:"setCode",newCode:e.loadRef()}}if(t===u){return{type:"reserve",mode:e.loadUint(8),currency:(0,s.loadCurrencyCollection)(e)}}if(t===d){return{type:"changeLibrary",mode:e.loadUint(7),libRef:(0,i.loadLibRef)(e)}}throw new Error(`Unknown out action tag 0x${t.toString(16)}`)}t.loadOutAction=h,t.storeOutList=function(e){const t=e.reduce(((e,t)=>(0,o.beginCell)().storeRef(e).store(a(t)).endCell()),(0,o.beginCell)().endCell());return e=>{e.storeSlice(t.beginParse())}},t.loadOutList=function(e){const t=[];for(;e.remainingRefs;){const r=e.loadRef();t.push(h(e)),e=r.beginParse()}return t.reverse()}},"./node_modules/@ton/core/dist/types/ReserveMode.js"(e,t){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ReserveMode=void 0,function(e){e[e.THIS_AMOUNT=0]="THIS_AMOUNT",e[e.LEAVE_THIS_AMOUNT=1]="LEAVE_THIS_AMOUNT",e[e.AT_MOST_THIS_AMOUNT=2]="AT_MOST_THIS_AMOUNT",e[e.LEAVE_MAX_THIS_AMOUNT=3]="LEAVE_MAX_THIS_AMOUNT",e[e.BEFORE_BALANCE_PLUS_THIS_AMOUNT=4]="BEFORE_BALANCE_PLUS_THIS_AMOUNT",e[e.LEAVE_BBALANCE_PLUS_THIS_AMOUNT=5]="LEAVE_BBALANCE_PLUS_THIS_AMOUNT",e[e.BEFORE_BALANCE_MINUS_THIS_AMOUNT=12]="BEFORE_BALANCE_MINUS_THIS_AMOUNT",e[e.LEAVE_BEFORE_BALANCE_MINUS_THIS_AMOUNT=13]="LEAVE_BEFORE_BALANCE_MINUS_THIS_AMOUNT"}(r||(t.ReserveMode=r={}))},"./node_modules/@ton/core/dist/types/SendMode.js"(e,t){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SendMode=void 0,function(e){e[e.CARRY_ALL_REMAINING_BALANCE=128]="CARRY_ALL_REMAINING_BALANCE",e[e.CARRY_ALL_REMAINING_INCOMING_VALUE=64]="CARRY_ALL_REMAINING_INCOMING_VALUE",e[e.DESTROY_ACCOUNT_IF_ZERO=32]="DESTROY_ACCOUNT_IF_ZERO",e[e.PAY_GAS_SEPARATELY=1]="PAY_GAS_SEPARATELY",e[e.IGNORE_ERRORS=2]="IGNORE_ERRORS",e[e.NONE=0]="NONE"}(r||(t.SendMode=r={}))},"./node_modules/@ton/core/dist/types/ShardAccount.js"(e,t,r){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.storeShardAccount=t.loadShardAccount=void 0;const n=r("./node_modules/@ton/core/dist/boc/Builder.js"),o=r("./node_modules/@ton/core/dist/types/Account.js");t.loadShardAccount=function(e){let t,r=e.loadRef();if(!r.isExotic){let e=r.beginParse();e.loadBit()&&(t=(0,o.loadAccount)(e))}return{account:t,lastTransactionHash:e.loadUintBig(256),lastTransactionLt:e.loadUintBig(64)}},t.storeShardAccount=function(e){return t=>{e.account?t.storeRef((0,n.beginCell)().storeBit(!0).store((0,o.storeAccount)(e.account))):t.storeRef((0,n.beginCell)().storeBit(!1)),t.storeUint(e.lastTransactionHash,256),t.storeUint(e.lastTransactionLt,64)}}},"./node_modules/@ton/core/dist/types/ShardAccounts.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeShardAccounts=t.loadShardAccounts=t.ShardAccountRefValue=void 0;const n=r("./node_modules/@ton/core/dist/dict/Dictionary.js"),o=r("./node_modules/@ton/core/dist/types/DepthBalanceInfo.js"),s=r("./node_modules/@ton/core/dist/types/ShardAccount.js");t.ShardAccountRefValue={parse:e=>({depthBalanceInfo:(0,o.loadDepthBalanceInfo)(e),shardAccount:(0,s.loadShardAccount)(e)}),serialize(e,t){t.store((0,o.storeDepthBalanceInfo)(e.depthBalanceInfo)),t.store((0,s.storeShardAccount)(e.shardAccount))}},t.loadShardAccounts=function(e){return n.Dictionary.load(n.Dictionary.Keys.BigUint(256),t.ShardAccountRefValue,e)},t.storeShardAccounts=function(e){return t=>{t.storeDict(e)}}},"./node_modules/@ton/core/dist/types/ShardIdent.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeShardIdent=t.loadShardIdent=void 0,t.loadShardIdent=function(e){if(0!==e.loadUint(2))throw Error("Invalid data");return{shardPrefixBits:e.loadUint(6),workchainId:e.loadInt(32),shardPrefix:e.loadUintBig(64)}},t.storeShardIdent=function(e){return t=>{t.storeUint(0,2),t.storeUint(e.shardPrefixBits,6),t.storeInt(e.workchainId,32),t.storeUint(e.shardPrefix,64)}}},"./node_modules/@ton/core/dist/types/ShardStateUnsplit.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadShardStateUnsplit=void 0;const n=r("./node_modules/@ton/core/dist/types/MasterchainStateExtra.js"),o=r("./node_modules/@ton/core/dist/types/ShardAccounts.js"),s=r("./node_modules/@ton/core/dist/types/ShardIdent.js");t.loadShardStateUnsplit=function(e){if(2418257890!==e.loadUint(32))throw Error("Invalid data");let t=e.loadInt(32),r=(0,s.loadShardIdent)(e),i=e.loadUint(32),a=e.loadUint(32),c=e.loadUint(32),l=e.loadUintBig(64),u=e.loadUint(32);e.loadRef();let d,h=e.loadBit(),p=e.loadRef();p.isExotic||(d=(0,o.loadShardAccounts)(p.beginParse())),e.loadRef();let f=null;if(e.loadBit()){let t=e.loadRef();t.isExotic||(f=(0,n.loadMasterchainStateExtra)(t.beginParse()))}return{globalId:t,shardId:r,seqno:i,vertSeqNo:a,genUtime:c,genLt:l,minRefMcSeqno:u,beforeSplit:h,accounts:d,extras:f}}},"./node_modules/@ton/core/dist/types/SimpleLibrary.js"(e,t){"use strict";function r(e){return{public:e.loadBit(),root:e.loadRef()}}function n(e){return t=>{t.storeBit(e.public),t.storeRef(e.root)}}Object.defineProperty(t,"__esModule",{value:!0}),t.SimpleLibraryValue=t.storeSimpleLibrary=t.loadSimpleLibrary=void 0,t.loadSimpleLibrary=r,t.storeSimpleLibrary=n,t.SimpleLibraryValue={serialize(e,t){n(e)(t)},parse:e=>r(e)}},"./node_modules/@ton/core/dist/types/SplitMergeInfo.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeSplitMergeInfo=t.loadSplitMergeInfo=void 0,t.loadSplitMergeInfo=function(e){return{currentShardPrefixLength:e.loadUint(6),accountSplitDepth:e.loadUint(6),thisAddress:e.loadUintBig(256),siblingAddress:e.loadUintBig(256)}},t.storeSplitMergeInfo=function(e){return t=>{t.storeUint(e.currentShardPrefixLength,6),t.storeUint(e.accountSplitDepth,6),t.storeUint(e.thisAddress,256),t.storeUint(e.siblingAddress,256)}}},"./node_modules/@ton/core/dist/types/StateInit.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeStateInit=t.loadStateInit=void 0;const n=r("./node_modules/@ton/core/dist/dict/Dictionary.js"),o=r("./node_modules/@ton/core/dist/types/SimpleLibrary.js"),s=r("./node_modules/@ton/core/dist/types/TickTock.js");t.loadStateInit=function(e){let t,r;e.loadBit()&&(t=e.loadUint(5)),e.loadBit()&&(r=(0,s.loadTickTock)(e));let i=e.loadMaybeRef(),a=e.loadMaybeRef(),c=e.loadDict(n.Dictionary.Keys.BigUint(256),o.SimpleLibraryValue);return 0===c.size&&(c=void 0),{splitDepth:t,special:r,code:i,data:a,libraries:c}},t.storeStateInit=function(e){return t=>{null!==e.splitDepth&&void 0!==e.splitDepth?(t.storeBit(!0),t.storeUint(e.splitDepth,5)):t.storeBit(!1),null!==e.special&&void 0!==e.special?(t.storeBit(!0),t.store((0,s.storeTickTock)(e.special))):t.storeBit(!1),t.storeMaybeRef(e.code),t.storeMaybeRef(e.data),t.storeDict(e.libraries)}}},"./node_modules/@ton/core/dist/types/StorageInto.js"(e,t,r){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.storeStorageInfo=t.loadStorageInfo=void 0;const n=r("./node_modules/@ton/core/dist/types/StorageUsed.js");t.loadStorageInfo=function(e){return{used:(0,n.loadStorageUsed)(e),lastPaid:e.loadUint(32),duePayment:e.loadMaybeCoins()}},t.storeStorageInfo=function(e){return t=>{t.store((0,n.storeStorageUsed)(e.used)),t.storeUint(e.lastPaid,32),t.storeMaybeCoins(e.duePayment)}}},"./node_modules/@ton/core/dist/types/StorageUsed.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeStorageUsed=t.loadStorageUsed=void 0,t.loadStorageUsed=function(e){return{cells:e.loadVarUintBig(3),bits:e.loadVarUintBig(3),publicCells:e.loadVarUintBig(3)}},t.storeStorageUsed=function(e){return t=>{t.storeVarUint(e.cells,3),t.storeVarUint(e.bits,3),t.storeVarUint(e.publicCells,3)}}},"./node_modules/@ton/core/dist/types/StorageUsedShort.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeStorageUsedShort=t.loadStorageUsedShort=void 0,t.loadStorageUsedShort=function(e){return{cells:e.loadVarUintBig(3),bits:e.loadVarUintBig(3)}},t.storeStorageUsedShort=function(e){return t=>{t.storeVarUint(e.cells,3),t.storeVarUint(e.bits,3)}}},"./node_modules/@ton/core/dist/types/TickTock.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeTickTock=t.loadTickTock=void 0,t.loadTickTock=function(e){return{tick:e.loadBit(),tock:e.loadBit()}},t.storeTickTock=function(e){return t=>{t.storeBit(e.tick),t.storeBit(e.tock)}}},"./node_modules/@ton/core/dist/types/Transaction.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeTransaction=t.loadTransaction=void 0;const n=r("./node_modules/@ton/core/dist/boc/Builder.js"),o=r("./node_modules/@ton/core/dist/dict/Dictionary.js"),s=r("./node_modules/@ton/core/dist/types/AccountStatus.js"),i=r("./node_modules/@ton/core/dist/types/CurrencyCollection.js"),a=r("./node_modules/@ton/core/dist/types/HashUpdate.js"),c=r("./node_modules/@ton/core/dist/types/Message.js"),l=r("./node_modules/@ton/core/dist/types/TransactionDescription.js");t.loadTransaction=function(e){let t=e.asCell();if(7!==e.loadUint(4))throw Error("Invalid data");let r=e.loadUintBig(256),n=e.loadUintBig(64),u=e.loadUintBig(256),d=e.loadUintBig(64),h=e.loadUint(32),p=e.loadUint(15),f=(0,s.loadAccountStatus)(e),g=(0,s.loadAccountStatus)(e),m=e.loadRef().beginParse(),y=m.loadBit()?(0,c.loadMessage)(m.loadRef().beginParse()):void 0,b=m.loadDict(o.Dictionary.Keys.Uint(15),c.MessageValue);return m.endParse(),{address:r,lt:n,prevTransactionHash:u,prevTransactionLt:d,now:h,outMessagesCount:p,oldStatus:f,endStatus:g,inMessage:y,outMessages:b,totalFees:(0,i.loadCurrencyCollection)(e),stateUpdate:(0,a.loadHashUpdate)(e.loadRef().beginParse()),description:(0,l.loadTransactionDescription)(e.loadRef().beginParse()),raw:t,hash:()=>t.hash()}},t.storeTransaction=function(e){return t=>{t.storeUint(7,4),t.storeUint(e.address,256),t.storeUint(e.lt,64),t.storeUint(e.prevTransactionHash,256),t.storeUint(e.prevTransactionLt,64),t.storeUint(e.now,32),t.storeUint(e.outMessagesCount,15),t.store((0,s.storeAccountStatus)(e.oldStatus)),t.store((0,s.storeAccountStatus)(e.endStatus));let r=(0,n.beginCell)();e.inMessage?(r.storeBit(!0),r.storeRef((0,n.beginCell)().store((0,c.storeMessage)(e.inMessage)))):r.storeBit(!1),r.storeDict(e.outMessages),t.storeRef(r),t.store((0,i.storeCurrencyCollection)(e.totalFees)),t.storeRef((0,n.beginCell)().store((0,a.storeHashUpdate)(e.stateUpdate))),t.storeRef((0,n.beginCell)().store((0,l.storeTransactionDescription)(e.description)))}}},"./node_modules/@ton/core/dist/types/TransactionActionPhase.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeTransactionActionPhase=t.loadTransactionActionPhase=void 0;const n=r("./node_modules/@ton/core/dist/types/AccountStatusChange.js"),o=r("./node_modules/@ton/core/dist/types/StorageUsedShort.js");t.loadTransactionActionPhase=function(e){return{success:e.loadBit(),valid:e.loadBit(),noFunds:e.loadBit(),statusChange:(0,n.loadAccountStatusChange)(e),totalFwdFees:e.loadBit()?e.loadCoins():void 0,totalActionFees:e.loadBit()?e.loadCoins():void 0,resultCode:e.loadInt(32),resultArg:e.loadBit()?e.loadInt(32):void 0,totalActions:e.loadUint(16),specActions:e.loadUint(16),skippedActions:e.loadUint(16),messagesCreated:e.loadUint(16),actionListHash:e.loadUintBig(256),totalMessageSize:(0,o.loadStorageUsedShort)(e)}},t.storeTransactionActionPhase=function(e){return t=>{t.storeBit(e.success),t.storeBit(e.valid),t.storeBit(e.noFunds),t.store((0,n.storeAccountStatusChange)(e.statusChange)),t.storeMaybeCoins(e.totalFwdFees),t.storeMaybeCoins(e.totalActionFees),t.storeInt(e.resultCode,32),t.storeMaybeInt(e.resultArg,32),t.storeUint(e.totalActions,16),t.storeUint(e.specActions,16),t.storeUint(e.skippedActions,16),t.storeUint(e.messagesCreated,16),t.storeUint(e.actionListHash,256),t.store((0,o.storeStorageUsedShort)(e.totalMessageSize))}}},"./node_modules/@ton/core/dist/types/TransactionBouncePhase.js"(e,t,r){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.storeTransactionBouncePhase=t.loadTransactionBouncePhase=void 0;const n=r("./node_modules/@ton/core/dist/types/StorageUsedShort.js");t.loadTransactionBouncePhase=function(e){if(e.loadBit()){return{type:"ok",messageSize:(0,n.loadStorageUsedShort)(e),messageFees:e.loadCoins(),forwardFees:e.loadCoins()}}if(e.loadBit()){return{type:"no-funds",messageSize:(0,n.loadStorageUsedShort)(e),requiredForwardFees:e.loadCoins()}}return{type:"negative-funds"}},t.storeTransactionBouncePhase=function(e){return t=>{if("ok"===e.type)t.storeBit(!0),t.store((0,n.storeStorageUsedShort)(e.messageSize)),t.storeCoins(e.messageFees),t.storeCoins(e.forwardFees);else if("negative-funds"===e.type)t.storeBit(!1),t.storeBit(!1);else{if("no-funds"!==e.type)throw new Error("Invalid TransactionBouncePhase type");t.storeBit(!1),t.storeBit(!0),t.store((0,n.storeStorageUsedShort)(e.messageSize)),t.storeCoins(e.requiredForwardFees)}}}},"./node_modules/@ton/core/dist/types/TransactionComputePhase.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeTransactionComputePhase=t.loadTransactionComputePhase=void 0;const n=r("./node_modules/@ton/core/dist/boc/Builder.js"),o=r("./node_modules/@ton/core/dist/types/ComputeSkipReason.js");t.loadTransactionComputePhase=function(e){if(!e.loadBit()){return{type:"skipped",reason:(0,o.loadComputeSkipReason)(e)}}let t=e.loadBit(),r=e.loadBit(),n=e.loadBit(),s=e.loadCoins();const i=e.loadRef().beginParse();return{type:"vm",success:t,messageStateUsed:r,accountActivated:n,gasFees:s,gasUsed:i.loadVarUintBig(3),gasLimit:i.loadVarUintBig(3),gasCredit:i.loadBit()?i.loadVarUintBig(2):void 0,mode:i.loadUint(8),exitCode:i.loadInt(32),exitArg:i.loadBit()?i.loadInt(32):void 0,vmSteps:i.loadUint(32),vmInitStateHash:i.loadUintBig(256),vmFinalStateHash:i.loadUintBig(256)}},t.storeTransactionComputePhase=function(e){return t=>{if("skipped"===e.type)return t.storeBit(0),void t.store((0,o.storeComputeSkipReason)(e.reason));t.storeBit(1),t.storeBit(e.success),t.storeBit(e.messageStateUsed),t.storeBit(e.accountActivated),t.storeCoins(e.gasFees),t.storeRef((0,n.beginCell)().storeVarUint(e.gasUsed,3).storeVarUint(e.gasLimit,3).store((t=>void 0!==e.gasCredit&&null!==e.gasCredit?t.storeBit(1).storeVarUint(e.gasCredit,2):t.storeBit(0))).storeUint(e.mode,8).storeInt(e.exitCode,32).store((t=>void 0!==e.exitArg&&null!==e.exitArg?t.storeBit(1).storeInt(e.exitArg,32):t.storeBit(0))).storeUint(e.vmSteps,32).storeUint(e.vmInitStateHash,256).storeUint(e.vmFinalStateHash,256).endCell())}}},"./node_modules/@ton/core/dist/types/TransactionCreditPhase.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeTransactionCreditPhase=t.loadTransactionCreditPhase=void 0;const n=r("./node_modules/@ton/core/dist/types/CurrencyCollection.js");t.loadTransactionCreditPhase=function(e){return{dueFeesColelcted:e.loadBit()?e.loadCoins():void 0,credit:(0,n.loadCurrencyCollection)(e)}},t.storeTransactionCreditPhase=function(e){return t=>{null===e.dueFeesColelcted||void 0===e.dueFeesColelcted?t.storeBit(!1):(t.storeBit(!0),t.storeCoins(e.dueFeesColelcted)),t.store((0,n.storeCurrencyCollection)(e.credit))}}},"./node_modules/@ton/core/dist/types/TransactionDescription.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeTransactionDescription=t.loadTransactionDescription=void 0;const n=r("./node_modules/@ton/core/dist/boc/Builder.js"),o=r("./node_modules/@ton/core/dist/types/SplitMergeInfo.js"),s=r("./node_modules/@ton/core/dist/types/Transaction.js"),i=r("./node_modules/@ton/core/dist/types/TransactionActionPhase.js"),a=r("./node_modules/@ton/core/dist/types/TransactionBouncePhase.js"),c=r("./node_modules/@ton/core/dist/types/TransactionComputePhase.js"),l=r("./node_modules/@ton/core/dist/types/TransactionCreditPhase.js"),u=r("./node_modules/@ton/core/dist/types/TransactionStoragePhase.js");t.loadTransactionDescription=function(e){let t=e.loadUint(4);if(0===t){const t=e.loadBit();let r,n;e.loadBit()&&(r=(0,u.loadTransactionStoragePhase)(e)),e.loadBit()&&(n=(0,l.loadTransactionCreditPhase)(e));let o,s=(0,c.loadTransactionComputePhase)(e);e.loadBit()&&(o=(0,i.loadTransactionActionPhase)(e.loadRef().beginParse()));let d,h=e.loadBit();e.loadBit()&&(d=(0,a.loadTransactionBouncePhase)(e));return{type:"generic",creditFirst:t,storagePhase:r,creditPhase:n,computePhase:s,actionPhase:o,bouncePhase:d,aborted:h,destroyed:e.loadBit()}}if(1===t)return{type:"storage",storagePhase:(0,u.loadTransactionStoragePhase)(e)};if(2===t||3===t){const r=3===t;let n,o=(0,u.loadTransactionStoragePhase)(e),s=(0,c.loadTransactionComputePhase)(e);e.loadBit()&&(n=(0,i.loadTransactionActionPhase)(e.loadRef().beginParse()));return{type:"tick-tock",isTock:r,storagePhase:o,computePhase:s,actionPhase:n,aborted:e.loadBit(),destroyed:e.loadBit()}}if(4===t){let t,r=(0,o.loadSplitMergeInfo)(e);e.loadBit()&&(t=(0,u.loadTransactionStoragePhase)(e));let n,s=(0,c.loadTransactionComputePhase)(e);e.loadBit()&&(n=(0,i.loadTransactionActionPhase)(e.loadRef().beginParse()));return{type:"split-prepare",splitInfo:r,storagePhase:t,computePhase:s,actionPhase:n,aborted:e.loadBit(),destroyed:e.loadBit()}}if(5===t){return{type:"split-install",splitInfo:(0,o.loadSplitMergeInfo)(e),prepareTransaction:(0,s.loadTransaction)(e.loadRef().beginParse()),installed:e.loadBit()}}throw Error(`Unsupported transaction description type ${t}`)},t.storeTransactionDescription=function(e){return t=>{if("generic"===e.type)t.storeUint(0,4),t.storeBit(e.creditFirst),e.storagePhase?(t.storeBit(!0),t.store((0,u.storeTransactionsStoragePhase)(e.storagePhase))):t.storeBit(!1),e.creditPhase?(t.storeBit(!0),t.store((0,l.storeTransactionCreditPhase)(e.creditPhase))):t.storeBit(!1),t.store((0,c.storeTransactionComputePhase)(e.computePhase)),e.actionPhase?(t.storeBit(!0),t.storeRef((0,n.beginCell)().store((0,i.storeTransactionActionPhase)(e.actionPhase)))):t.storeBit(!1),t.storeBit(e.aborted),e.bouncePhase?(t.storeBit(!0),t.store((0,a.storeTransactionBouncePhase)(e.bouncePhase))):t.storeBit(!1),t.storeBit(e.destroyed);else if("storage"===e.type)t.storeUint(1,4),t.store((0,u.storeTransactionsStoragePhase)(e.storagePhase));else if("tick-tock"===e.type)t.storeUint(e.isTock?3:2,4),t.store((0,u.storeTransactionsStoragePhase)(e.storagePhase)),t.store((0,c.storeTransactionComputePhase)(e.computePhase)),e.actionPhase?(t.storeBit(!0),t.storeRef((0,n.beginCell)().store((0,i.storeTransactionActionPhase)(e.actionPhase)))):t.storeBit(!1),t.storeBit(e.aborted),t.storeBit(e.destroyed);else if("split-prepare"===e.type)t.storeUint(4,4),t.store((0,o.storeSplitMergeInfo)(e.splitInfo)),e.storagePhase?(t.storeBit(!0),t.store((0,u.storeTransactionsStoragePhase)(e.storagePhase))):t.storeBit(!1),t.store((0,c.storeTransactionComputePhase)(e.computePhase)),e.actionPhase?(t.storeBit(!0),t.store((0,i.storeTransactionActionPhase)(e.actionPhase))):t.storeBit(!1),t.storeBit(e.aborted),t.storeBit(e.destroyed);else{if("split-install"!==e.type)throw Error(`Unsupported transaction description type ${e.type}`);t.storeUint(5,4),t.store((0,o.storeSplitMergeInfo)(e.splitInfo)),t.storeRef((0,n.beginCell)().store((0,s.storeTransaction)(e.prepareTransaction))),t.storeBit(e.installed)}}}},"./node_modules/@ton/core/dist/types/TransactionStoragePhase.js"(e,t,r){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.storeTransactionsStoragePhase=t.loadTransactionStoragePhase=void 0;const n=r("./node_modules/@ton/core/dist/types/AccountStatusChange.js");t.loadTransactionStoragePhase=function(e){const t=e.loadCoins();let r;return e.loadBit()&&(r=e.loadCoins()),{storageFeesCollected:t,storageFeesDue:r,statusChange:(0,n.loadAccountStatusChange)(e)}},t.storeTransactionsStoragePhase=function(e){return t=>{t.storeCoins(e.storageFeesCollected),null===e.storageFeesDue||void 0===e.storageFeesDue?t.storeBit(!1):(t.storeBit(!0),t.storeCoins(e.storageFeesDue)),t.store((0,n.storeAccountStatusChange)(e.statusChange))}}},"./node_modules/@ton/core/dist/types/_export.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadSimpleLibrary=t.loadShardStateUnsplit=t.storeShardIdent=t.loadShardIdent=t.storeShardAccounts=t.loadShardAccounts=t.ShardAccountRefValue=t.storeShardAccount=t.loadShardAccount=t.ReserveMode=t.SendMode=t.storeMessageRelaxed=t.loadMessageRelaxed=t.storeMessage=t.loadMessage=t.loadMasterchainStateExtra=t.storeHashUpdate=t.loadHashUpdate=t.storeExtraCurrency=t.loadMaybeExtraCurrency=t.loadExtraCurrency=t.packExtraCurrencyDict=t.packExtraCurrencyCell=t.storeDepthBalanceInfo=t.loadDepthBalanceInfo=t.storeCurrencyCollection=t.loadCurrencyCollection=t.storeComputeSkipReason=t.loadComputeSkipReason=t.storeCommonMessageInfoRelaxed=t.loadCommonMessageInfoRelaxed=t.storeCommonMessageInfo=t.loadCommonMessageInfo=t.storeOutList=t.loadOutList=t.storeOutAction=t.loadOutAction=t.storeAccountStorage=t.loadAccountStorage=t.storeAccountStatusChange=t.loadAccountStatusChange=t.storeAccountStatus=t.loadAccountStatus=t.storeAccountState=t.loadAccountState=t.storeAccount=t.loadAccount=t.comment=t.external=t.internal=void 0,t.storeTransactionsStoragePhase=t.loadTransactionStoragePhase=t.storeTransactionDescription=t.loadTransactionDescription=t.storeTransactionCreditPhase=t.loadTransactionCreditPhase=t.storeTransactionComputePhase=t.loadTransactionComputePhase=t.storeTransactionBouncePhase=t.loadTransactionBouncePhase=t.storeTransactionActionPhase=t.loadTransactionActionPhase=t.storeTransaction=t.loadTransaction=t.storeTickTock=t.loadTickTock=t.storeStorageUsedShort=t.loadStorageUsedShort=t.storeStorageUsed=t.loadStorageUsed=t.storeStorageInfo=t.loadStorageInfo=t.storeStateInit=t.loadStateInit=t.storeSplitMergeInfo=t.loadSplitMergeInfo=t.storeLibRef=t.loadLibRef=t.storeSimpleLibrary=void 0;var n=r("./node_modules/@ton/core/dist/types/_helpers.js");Object.defineProperty(t,"internal",{enumerable:!0,get:function(){return n.internal}}),Object.defineProperty(t,"external",{enumerable:!0,get:function(){return n.external}}),Object.defineProperty(t,"comment",{enumerable:!0,get:function(){return n.comment}});var o=r("./node_modules/@ton/core/dist/types/Account.js");Object.defineProperty(t,"loadAccount",{enumerable:!0,get:function(){return o.loadAccount}}),Object.defineProperty(t,"storeAccount",{enumerable:!0,get:function(){return o.storeAccount}});var s=r("./node_modules/@ton/core/dist/types/AccountState.js");Object.defineProperty(t,"loadAccountState",{enumerable:!0,get:function(){return s.loadAccountState}}),Object.defineProperty(t,"storeAccountState",{enumerable:!0,get:function(){return s.storeAccountState}});var i=r("./node_modules/@ton/core/dist/types/AccountStatus.js");Object.defineProperty(t,"loadAccountStatus",{enumerable:!0,get:function(){return i.loadAccountStatus}}),Object.defineProperty(t,"storeAccountStatus",{enumerable:!0,get:function(){return i.storeAccountStatus}});var a=r("./node_modules/@ton/core/dist/types/AccountStatusChange.js");Object.defineProperty(t,"loadAccountStatusChange",{enumerable:!0,get:function(){return a.loadAccountStatusChange}}),Object.defineProperty(t,"storeAccountStatusChange",{enumerable:!0,get:function(){return a.storeAccountStatusChange}});var c=r("./node_modules/@ton/core/dist/types/AccountStorage.js");Object.defineProperty(t,"loadAccountStorage",{enumerable:!0,get:function(){return c.loadAccountStorage}}),Object.defineProperty(t,"storeAccountStorage",{enumerable:!0,get:function(){return c.storeAccountStorage}});var l=r("./node_modules/@ton/core/dist/types/OutList.js");Object.defineProperty(t,"loadOutAction",{enumerable:!0,get:function(){return l.loadOutAction}}),Object.defineProperty(t,"storeOutAction",{enumerable:!0,get:function(){return l.storeOutAction}}),Object.defineProperty(t,"loadOutList",{enumerable:!0,get:function(){return l.loadOutList}}),Object.defineProperty(t,"storeOutList",{enumerable:!0,get:function(){return l.storeOutList}});var u=r("./node_modules/@ton/core/dist/types/CommonMessageInfo.js");Object.defineProperty(t,"loadCommonMessageInfo",{enumerable:!0,get:function(){return u.loadCommonMessageInfo}}),Object.defineProperty(t,"storeCommonMessageInfo",{enumerable:!0,get:function(){return u.storeCommonMessageInfo}});var d=r("./node_modules/@ton/core/dist/types/CommonMessageInfoRelaxed.js");Object.defineProperty(t,"loadCommonMessageInfoRelaxed",{enumerable:!0,get:function(){return d.loadCommonMessageInfoRelaxed}}),Object.defineProperty(t,"storeCommonMessageInfoRelaxed",{enumerable:!0,get:function(){return d.storeCommonMessageInfoRelaxed}});var h=r("./node_modules/@ton/core/dist/types/ComputeSkipReason.js");Object.defineProperty(t,"loadComputeSkipReason",{enumerable:!0,get:function(){return h.loadComputeSkipReason}}),Object.defineProperty(t,"storeComputeSkipReason",{enumerable:!0,get:function(){return h.storeComputeSkipReason}});var p=r("./node_modules/@ton/core/dist/types/CurrencyCollection.js");Object.defineProperty(t,"loadCurrencyCollection",{enumerable:!0,get:function(){return p.loadCurrencyCollection}}),Object.defineProperty(t,"storeCurrencyCollection",{enumerable:!0,get:function(){return p.storeCurrencyCollection}});var f=r("./node_modules/@ton/core/dist/types/DepthBalanceInfo.js");Object.defineProperty(t,"loadDepthBalanceInfo",{enumerable:!0,get:function(){return f.loadDepthBalanceInfo}}),Object.defineProperty(t,"storeDepthBalanceInfo",{enumerable:!0,get:function(){return f.storeDepthBalanceInfo}});var g=r("./node_modules/@ton/core/dist/types/ExtraCurrency.js");Object.defineProperty(t,"packExtraCurrencyCell",{enumerable:!0,get:function(){return g.packExtraCurrencyCell}}),Object.defineProperty(t,"packExtraCurrencyDict",{enumerable:!0,get:function(){return g.packExtraCurrencyDict}}),Object.defineProperty(t,"loadExtraCurrency",{enumerable:!0,get:function(){return g.loadExtraCurrency}}),Object.defineProperty(t,"loadMaybeExtraCurrency",{enumerable:!0,get:function(){return g.loadMaybeExtraCurrency}}),Object.defineProperty(t,"storeExtraCurrency",{enumerable:!0,get:function(){return g.storeExtraCurrency}});var m=r("./node_modules/@ton/core/dist/types/HashUpdate.js");Object.defineProperty(t,"loadHashUpdate",{enumerable:!0,get:function(){return m.loadHashUpdate}}),Object.defineProperty(t,"storeHashUpdate",{enumerable:!0,get:function(){return m.storeHashUpdate}});var y=r("./node_modules/@ton/core/dist/types/MasterchainStateExtra.js");Object.defineProperty(t,"loadMasterchainStateExtra",{enumerable:!0,get:function(){return y.loadMasterchainStateExtra}});var b=r("./node_modules/@ton/core/dist/types/Message.js");Object.defineProperty(t,"loadMessage",{enumerable:!0,get:function(){return b.loadMessage}}),Object.defineProperty(t,"storeMessage",{enumerable:!0,get:function(){return b.storeMessage}});var w=r("./node_modules/@ton/core/dist/types/MessageRelaxed.js");Object.defineProperty(t,"loadMessageRelaxed",{enumerable:!0,get:function(){return w.loadMessageRelaxed}}),Object.defineProperty(t,"storeMessageRelaxed",{enumerable:!0,get:function(){return w.storeMessageRelaxed}});var v=r("./node_modules/@ton/core/dist/types/SendMode.js");Object.defineProperty(t,"SendMode",{enumerable:!0,get:function(){return v.SendMode}});var A=r("./node_modules/@ton/core/dist/types/ReserveMode.js");Object.defineProperty(t,"ReserveMode",{enumerable:!0,get:function(){return A.ReserveMode}});var T=r("./node_modules/@ton/core/dist/types/ShardAccount.js");Object.defineProperty(t,"loadShardAccount",{enumerable:!0,get:function(){return T.loadShardAccount}}),Object.defineProperty(t,"storeShardAccount",{enumerable:!0,get:function(){return T.
2storeShardAccount}});var P=r("./node_modules/@ton/core/dist/types/ShardAccounts.js");Object.defineProperty(t,"ShardAccountRefValue",{enumerable:!0,get:function(){return P.ShardAccountRefValue}}),Object.defineProperty(t,"loadShardAccounts",{enumerable:!0,get:function(){return P.loadShardAccounts}}),Object.defineProperty(t,"storeShardAccounts",{enumerable:!0,get:function(){return P.storeShardAccounts}});var E=r("./node_modules/@ton/core/dist/types/ShardIdent.js");Object.defineProperty(t,"loadShardIdent",{enumerable:!0,get:function(){return E.loadShardIdent}}),Object.defineProperty(t,"storeShardIdent",{enumerable:!0,get:function(){return E.storeShardIdent}});var C=r("./node_modules/@ton/core/dist/types/ShardStateUnsplit.js");Object.defineProperty(t,"loadShardStateUnsplit",{enumerable:!0,get:function(){return C.loadShardStateUnsplit}});var k=r("./node_modules/@ton/core/dist/types/SimpleLibrary.js");Object.defineProperty(t,"loadSimpleLibrary",{enumerable:!0,get:function(){return k.loadSimpleLibrary}}),Object.defineProperty(t,"storeSimpleLibrary",{enumerable:!0,get:function(){return k.storeSimpleLibrary}});var _=r("./node_modules/@ton/core/dist/types/LibRef.js");Object.defineProperty(t,"loadLibRef",{enumerable:!0,get:function(){return _.loadLibRef}}),Object.defineProperty(t,"storeLibRef",{enumerable:!0,get:function(){return _.storeLibRef}});var I=r("./node_modules/@ton/core/dist/types/SplitMergeInfo.js");Object.defineProperty(t,"loadSplitMergeInfo",{enumerable:!0,get:function(){return I.loadSplitMergeInfo}}),Object.defineProperty(t,"storeSplitMergeInfo",{enumerable:!0,get:function(){return I.storeSplitMergeInfo}});var S=r("./node_modules/@ton/core/dist/types/StateInit.js");Object.defineProperty(t,"loadStateInit",{enumerable:!0,get:function(){return S.loadStateInit}}),Object.defineProperty(t,"storeStateInit",{enumerable:!0,get:function(){return S.storeStateInit}});var x=r("./node_modules/@ton/core/dist/types/StorageInto.js");Object.defineProperty(t,"loadStorageInfo",{enumerable:!0,get:function(){return x.loadStorageInfo}}),Object.defineProperty(t,"storeStorageInfo",{enumerable:!0,get:function(){return x.storeStorageInfo}});var B=r("./node_modules/@ton/core/dist/types/StorageUsed.js");Object.defineProperty(t,"loadStorageUsed",{enumerable:!0,get:function(){return B.loadStorageUsed}}),Object.defineProperty(t,"storeStorageUsed",{enumerable:!0,get:function(){return B.storeStorageUsed}});var O=r("./node_modules/@ton/core/dist/types/StorageUsedShort.js");Object.defineProperty(t,"loadStorageUsedShort",{enumerable:!0,get:function(){return O.loadStorageUsedShort}}),Object.defineProperty(t,"storeStorageUsedShort",{enumerable:!0,get:function(){return O.storeStorageUsedShort}});var M=r("./node_modules/@ton/core/dist/types/TickTock.js");Object.defineProperty(t,"loadTickTock",{enumerable:!0,get:function(){return M.loadTickTock}}),Object.defineProperty(t,"storeTickTock",{enumerable:!0,get:function(){return M.storeTickTock}});var W=r("./node_modules/@ton/core/dist/types/Transaction.js");Object.defineProperty(t,"loadTransaction",{enumerable:!0,get:function(){return W.loadTransaction}}),Object.defineProperty(t,"storeTransaction",{enumerable:!0,get:function(){return W.storeTransaction}});var j=r("./node_modules/@ton/core/dist/types/TransactionActionPhase.js");Object.defineProperty(t,"loadTransactionActionPhase",{enumerable:!0,get:function(){return j.loadTransactionActionPhase}}),Object.defineProperty(t,"storeTransactionActionPhase",{enumerable:!0,get:function(){return j.storeTransactionActionPhase}});var R=r("./node_modules/@ton/core/dist/types/TransactionBouncePhase.js");Object.defineProperty(t,"loadTransactionBouncePhase",{enumerable:!0,get:function(){return R.loadTransactionBouncePhase}}),Object.defineProperty(t,"storeTransactionBouncePhase",{enumerable:!0,get:function(){return R.storeTransactionBouncePhase}});var N=r("./node_modules/@ton/core/dist/types/TransactionComputePhase.js");Object.defineProperty(t,"loadTransactionComputePhase",{enumerable:!0,get:function(){return N.loadTransactionComputePhase}}),Object.defineProperty(t,"storeTransactionComputePhase",{enumerable:!0,get:function(){return N.storeTransactionComputePhase}});var U=r("./node_modules/@ton/core/dist/types/TransactionCreditPhase.js");Object.defineProperty(t,"loadTransactionCreditPhase",{enumerable:!0,get:function(){return U.loadTransactionCreditPhase}}),Object.defineProperty(t,"storeTransactionCreditPhase",{enumerable:!0,get:function(){return U.storeTransactionCreditPhase}});var D=r("./node_modules/@ton/core/dist/types/TransactionDescription.js");Object.defineProperty(t,"loadTransactionDescription",{enumerable:!0,get:function(){return D.loadTransactionDescription}}),Object.defineProperty(t,"storeTransactionDescription",{enumerable:!0,get:function(){return D.storeTransactionDescription}});var L=r("./node_modules/@ton/core/dist/types/TransactionStoragePhase.js");Object.defineProperty(t,"loadTransactionStoragePhase",{enumerable:!0,get:function(){return L.loadTransactionStoragePhase}}),Object.defineProperty(t,"storeTransactionsStoragePhase",{enumerable:!0,get:function(){return L.storeTransactionsStoragePhase}})},"./node_modules/@ton/core/dist/types/_helpers.js"(e,t,r){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.comment=t.external=t.internal=void 0;const n=r("./node_modules/@ton/core/dist/address/Address.js"),o=r("./node_modules/@ton/core/dist/boc/Cell.js"),s=r("./node_modules/@ton/core/dist/boc/Builder.js"),i=r("./node_modules/@ton/core/dist/utils/convert.js"),a=r("./node_modules/@ton/core/dist/types/ExtraCurrency.js");t.internal=function(e){let t,r,c,l=!0;if(null!==e.bounce&&void 0!==e.bounce&&(l=e.bounce),"string"==typeof e.to)t=n.Address.parse(e.to);else{if(!n.Address.isAddress(e.to))throw new Error(`Invalid address ${e.to}`);t=e.to}r="string"==typeof e.value?(0,i.toNano)(e.value):e.value,e.extracurrency&&(c=(0,a.packExtraCurrencyDict)(e.extracurrency));let u=o.Cell.EMPTY;return"string"==typeof e.body?u=(0,s.beginCell)().storeUint(0,32).storeStringTail(e.body).endCell():e.body&&(u=e.body),{info:{type:"internal",dest:t,value:{coins:r,other:c},bounce:l,ihrDisabled:!0,bounced:!1,ihrFee:0n,forwardFee:0n,createdAt:0,createdLt:0n},init:e.init??void 0,body:u}},t.external=function(e){let t;if("string"==typeof e.to)t=n.Address.parse(e.to);else{if(!n.Address.isAddress(e.to))throw new Error(`Invalid address ${e.to}`);t=e.to}return{info:{type:"external-in",dest:t,importFee:0n},init:e.init??void 0,body:e.body||o.Cell.EMPTY}},t.comment=function(e){return(0,s.beginCell)().storeUint(0,32).storeStringTail(e).endCell()}},"./node_modules/@ton/core/dist/utils/base32.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.base32Decode=t.base32Encode=void 0;const o="abcdefghijklmnopqrstuvwxyz234567";function s(e,t){const r=e.indexOf(t);if(-1===r)throw new Error("Invalid character found: "+t);return r}t.base32Encode=function(e){const t=e.byteLength;let r=0,n=0,s="";for(let i=0;i<t;i++)for(n=n<<8|e[i],r+=8;r>=5;)s+=o[n>>>r-5&31],r-=5;return r>0&&(s+=o[n<<5-r&31]),s},t.base32Decode=function(e){let t;t=e.toLowerCase();const{length:r}=t;let i=0,a=0,c=0;const l=n.alloc(5*r/8|0);for(let e=0;e<r;e++)a=a<<5|s(o,t[e]),i+=5,i>=8&&(l[c++]=a>>>i-8&255,i-=8);return l}},"./node_modules/@ton/core/dist/utils/bitsForNumber.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitsForNumber=void 0,t.bitsForNumber=function(e,t){let r=BigInt(e);if("int"===t){if(0n===r||-1n===r)return 1;return(r>0?r:-r).toString(2).length+1}if("uint"===t){if(r<0)throw Error(`value is negative. Got ${e}`);return r.toString(2).length}throw Error(`invalid mode. Got ${t}`)}},"./node_modules/@ton/core/dist/utils/convert.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromNano=t.toNano=void 0,t.toNano=function(e){if("bigint"==typeof e)return 1000000000n*e;{if("number"==typeof e){if(!Number.isFinite(e))throw Error("Invalid number");if(Math.log10(e)<=6)e=e.toLocaleString("en",{minimumFractionDigits:9,useGrouping:!1});else{if(e-Math.trunc(e)!=0)throw Error("Not enough precision for a number value. Use string value instead");e=e.toLocaleString("en",{maximumFractionDigits:0,useGrouping:!1})}}let t=!1;for(;e.startsWith("-");)t=!t,e=e.slice(1);if("."===e)throw Error("Invalid number");let r=e.split(".");if(r.length>2)throw Error("Invalid number");let n=r[0],o=r[1];if(n||(n="0"),o||(o="0"),o.length>9)throw Error("Invalid number");for(;o.length<9;)o+="0";let s=1000000000n*BigInt(n)+BigInt(o);return t&&(s=-s),s}},t.fromNano=function(e){let t=BigInt(e),r=!1;t<0&&(r=!0,t=-t);let n=(t%1000000000n).toString();for(;n.length<9;)n="0"+n;n=n.match(/^([0-9]*[1-9]|0)(0*)/)[1];let o=`${(t/1000000000n).toString()}${"0"===n?"":`.${n}`}`;return r&&(o="-"+o),o}},"./node_modules/@ton/core/dist/utils/crc16.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.crc16=void 0,t.crc16=function(e){let t=0;const r=n.alloc(e.length+2);r.set(e);for(let e of r){let r=128;for(;r>0;)t<<=1,e&r&&(t+=1),r>>=1,t>65535&&(t&=65535,t^=4129)}return n.from([Math.floor(t/256),t%256])}},"./node_modules/@ton/core/dist/utils/crc32c.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;
2Object.defineProperty(t,"__esModule",{value:!0}),t.crc32c=void 0;const o=2197175160;t.crc32c=function(e){let t=-1;for(let r=0;r<e.length;r++)t^=e[r],t=1&t?t>>>1^o:t>>>1,t=1&t?t>>>1^o:t>>>1,t=1&t?t>>>1^o:t>>>1,t=1&t?t>>>1^o:t>>>1,t=1&t?t>>>1^o:t>>>1,t=1&t?t>>>1^o:t>>>1,t=1&t?t>>>1^o:t>>>1,t=1&t?t>>>1^o:t>>>1;t^=4294967295;let r=n.alloc(4);return r.writeInt32LE(t),r}},"./node_modules/@ton/core/dist/utils/getMethodId.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.getMethodId=void 0;const o=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]);t.getMethodId=function(e){return 65535&function(e){e instanceof n||(e=n.from(e));let t=0;for(let r=0;r<e.length;r++){const n=e[r];t=65535&(o[255&(t>>8^n)]^t<<8)}return t}(e)|65536}},"./node_modules/@ton/crypto-primitives/dist/browser.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha512=t.sha256=t.pbkdf2_sha512=t.hmac_sha512=t.getSecureRandomWords=t.getSecureRandomBytes=void 0;var n=r("./node_modules/@ton/crypto-primitives/dist/browser/getSecureRandom.js");Object.defineProperty(t,"getSecureRandomBytes",{enumerable:!0,get:function(){return n.getSecureRandomBytes}}),Object.defineProperty(t,"getSecureRandomWords",{enumerable:!0,get:function(){return n.getSecureRandomWords}});var o=r("./node_modules/@ton/crypto-primitives/dist/browser/hmac_sha512.js");Object.defineProperty(t,"hmac_sha512",{enumerable:!0,get:function(){return o.hmac_sha512}});var s=r("./node_modules/@ton/crypto-primitives/dist/browser/pbkdf2_sha512.js");Object.defineProperty(t,"pbkdf2_sha512",{enumerable:!0,get:function(){return s.pbkdf2_sha512}});var i=r("./node_modules/@ton/crypto-primitives/dist/browser/sha256.js");Object.defineProperty(t,"sha256",{enumerable:!0,get:function(){return i.sha256}});var a=r("./node_modules/@ton/crypto-primitives/dist/browser/sha512.js");Object.defineProperty(t,"sha512",{enumerable:!0,get:function(){return a.sha512}})},"./node_modules/@ton/crypto-primitives/dist/browser/getSecureRandom.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.getSecureRandomWords=t.getSecureRandomBytes=void 0,t.getSecureRandomBytes=function(e){return n.from(window.crypto.getRandomValues(new Uint8Array(e)))},t.getSecureRandomWords=function(e){return window.crypto.getRandomValues(new Uint16Array(e))}},"./node_modules/@ton/crypto-primitives/dist/browser/hmac_sha512.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.hmac_sha512=void 0,t.hmac_sha512=async function(e,t){let r="string"==typeof e?n.from(e,"utf-8"):e,o="str
2ing"==typeof t?n.from(t,"utf-8"):t;const s={name:"HMAC",hash:"SHA-512"},i=await window.crypto.subtle.importKey("raw",r,s,!1,["sign"]);return n.from(await crypto.subtle.sign(s,i,o))}},"./node_modules/@ton/crypto-primitives/dist/browser/pbkdf2_sha512.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.pbkdf2_sha512=void 0,t.pbkdf2_sha512=async function(e,t,r,o){const s="string"==typeof e?n.from(e,"utf-8"):e,i="string"==typeof t?n.from(t,"utf-8"):t,a=await window.crypto.subtle.importKey("raw",s,{name:"PBKDF2"},!1,["deriveBits"]),c=await window.crypto.subtle.deriveBits({name:"PBKDF2",hash:"SHA-512",salt:i,iterations:r},a,8*o);return n.from(c)}},"./node_modules/@ton/crypto-primitives/dist/browser/sha256.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.sha256=void 0,t.sha256=async function(e){return"string"==typeof e?n.from(await crypto.subtle.digest("SHA-256",n.from(e,"utf-8"))):n.from(await crypto.subtle.digest("SHA-256",e))}},"./node_modules/@ton/crypto-primitives/dist/browser/sha512.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.sha512=void 0,t.sha512=async function(e){return"string"==typeof e?n.from(await crypto.subtle.digest("SHA-512",n.from(e,"utf-8"))):n.from(await crypto.subtle.digest("SHA-512",e))}},"./node_modules/@ton/crypto/dist/hd/ed25519.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.deriveEd25519Path=t.deriveED25519HardenedKey=t.getED25519MasterKeyFromSeed=void 0;const o=r("./node_modules/@ton/crypto/dist/primitives/hmac_sha512.js"),s=2147483648;async function i(e){const t=await(0,o.hmac_sha512)("ed25519 seed",e);return{key:t.slice(0,32),chainCode:t.slice(32)}}async function a(e,t){if(t>=s)throw Error("Key index must be less than offset");const r=n.alloc(4);r.writeUInt32BE(t+s,0);const i=n.concat([n.alloc(1,0),e.key,r]),a=await(0,o.hmac_sha512)(e.chainCode,i);return{key:a.slice(0,32),chainCode:a.slice(32)}}t.getED25519MasterKeyFromSeed=i,t.deriveED25519HardenedKey=a,t.deriveEd25519Path=async function(e,t){let r=await i(e),n=[...t];for(;n.length>0;){let e=n[0];n=n.slice(1),r=await a(r,e)}return r.key}},"./node_modules/@ton/crypto/dist/hd/mnemonics.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.deriveMnemonicsPath=t.deriveMnemonicHardenedKey=t.getMnemonicsMasterKeyFromSeed=void 0;const o=r("./node_modules/@ton/crypto/dist/mnemonic/mnemonic.js"),s=r("./node_modules/@ton/crypto/dist/primitives/hmac_sha512.js"),i=2147483648;async function a(e){const t=await(0,s.hmac_sha512)("TON Mnemonics HD seed",e);return{key:t.slice(0,32),chainCode:t.slice(32)}}async function c(e,t){if(t>=i)throw Error("Key index must be less than offset");const r=n.alloc(4);r.writeUInt32BE(t+i,0);const o=n.concat([n.alloc(1,0),e.key,r]),a=await(0,s.hmac_sha512)(e.chainCode,o);return{key:a.slice(0,32),chainCode:a.slice(32)}}t.getMnemonicsMasterKeyFromSeed=a,t.deriveMnemonicHardenedKey=c,t.deriveMnemonicsPath=async function(e,t,r=24,n){let s=await a(e),i=[...t];for(;i.length>0;){let e=i[0];i=i.slice(1),s=await c(s,e)}return await(0,o.mnemonicFromRandomSeed)(s.key,r,n)}},"./node_modules/@ton/crypto/dist/hd/symmetric.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.deriveSymmetricPath=t.deriveSymmetricHardenedKey=t.getSymmetricMasterKeyFromSeed=void 0;const o=r("./node_modules/@ton/crypto/dist/primitives/hmac_sha512.js");async function s(e){const t=await(0,o.hmac_sha512)("Symmetric key seed",e);return{key:t.slice(32),chainCode:t.slice(0,32)}}async function i(e,t){const r=n.concat([n.alloc(1,0),n.from(t)]),s=await(0,o.hmac_sha512)(e.chainCode,r);return{key:s.slice(32),chainCode:s.slice(0,32)}}t.getSymmetricMasterKeyFromSeed=s,t.deriveSymmetricHardenedKey=i,t.deriveSymmetricPath=async function(e,t){let r=await s(e),n=[...t];for(;n.length>0;){let e=n[0];n=n.slice(1),r=await i(r,e)}return r.key}},"./node_modules/@ton/crypto/dist/index.js"(e,t,r){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.getMnemonicsMasterKeyFromSeed=t.deriveMnemonicHardenedKey=t.deriveMnemonicsPath=t.deriveSymmetricPath=t.deriveSymmetricHardenedKey=t.getSymmetricMasterKeyFromSeed=t.deriveEd25519Path=t.deriveED25519HardenedKey=t.getED25519MasterKeyFromSeed=t.signVerify=t.sign=t.keyPairFromSecretKey=t.keyPairFromSeed=t.openBox=t.sealBox=t.mnemonicWordList=t.mnemonicToHDSeed=t.mnemonicToSeed=t.mnemonicToWalletKey=t.mnemonicToPrivateKey=t.mnemonicValidate=t.mnemonicNew=t.newSecurePassphrase=t.newSecureWords=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 n=r("./node_modules/@ton/crypto/dist/primitives/sha256.js");Object.defineProperty(t,"sha256",{enumerable:!0,get:function(){return n.sha256}}),Object.defineProperty(t,"sha256_sync",{enumerable:!0,get:function(){return n.sha256_sync}});var o=r("./node_modules/@ton/crypto/dist/primitives/sha512.js");Object.defineProperty(t,"sha512",{enumerable:!0,get:function(){return o.sha512}}),Object.defineProperty(t,"sha512_sync",{enumerable:!0,get:function(){return o.sha512_sync}});var s=r("./node_modules/@ton/crypto/dist/primitives/pbkdf2_sha512.js");Object.defineProperty(t,"pbkdf2_sha512",{enumerable:!0,get:function(){return s.pbkdf2_sha512}});var i=r("./node_modules/@ton/crypto/dist/primitives/hmac_sha512.js");Object.defineProperty(t,"hmac_sha512",{enumerable:!0,get:function(){return i.hmac_sha512}});var a=r("./node_modules/@ton/crypto/dist/primitives/getSecureRandom.js");Object.defineProperty(t,"getSecureRandomBytes",{enumerable:!0,get:function(){return a.getSecureRandomBytes}}),Object.defineProperty(t,"getSecureRandomWords",{enumerable:!0,get:function(){return a.getSecureRandomWords}}),Object.defineProperty(t,"getSecureRandomNumber",{enumerable:!0,get:function(){return a.getSecureRandomNumber}});var c=r("./node_modules/@ton/crypto/dist/passwords/newSecureWords.js");Object.defineProperty(t,"newSecureWords",{enumerable:!0,get:function(){return c.newSecureWords}});var l=r("./node_modules/@ton/crypto/dist/passwords/newSecurePassphrase.js");Object.defineProperty(t,"newSecurePassphrase",{enumerable:!0,get:function(){return l.newSecurePassphrase}});var u=r("./node_modules/@ton/crypto/dist/mnemonic/mnemonic.js");Object.defineProperty(t,"mnemonicNew",{enumerable:!0,get:function(){return u.mnemonicNew}}),Object.defineProperty(t,"mnemonicValidate",{enumerable:!0,get:function(){return u.mnemonicValidate}}),Object.defineProperty(t,"mnemonicToPrivateKey",{enumerable:!0,get:function(){return u.mnemonicToPrivateKey}}),Object.defineProperty(t,"mnemonicToWalletKey",{enumerable:!0,get:function(){return u.mnemonicToWalletKey}}),Object.defineProperty(t,"mnemonicToSeed",{enumerable:!0,get:function(){return u.mnemonicToSeed}}),Object.defineProperty(t,"mnemonicToHDSeed",{enumerable:!0,get:function(){return u.mnemonicToHDSeed}});var d=r("./node_modules/@ton/crypto/dist/mnemonic/wordlist.js");Object.defineProperty(t,"mnemonicWordList",{enumerable:!0,get:function(){return d.wordlist}});var h=r("./node_modules/@ton/crypto/dist/primitives/nacl.js");Object.defineProperty(t,"sealBox",{enumerable:!0,get:function(){return h.sealBox}}),Object.defineProperty(t,"openBox",{enumerable:!0,get:function(){return h.openBox}});var p=r("./node_modules/@ton/crypto/dist/primitives/nacl.js");Object.defineProperty(t,"keyPairFromSeed",{enumerable:!0,get:function(){return p.keyPairFromSeed}}),Object.defineProperty(t,"keyPairFromSecretKey",{enumerable:!0,get:function(){return p.keyPairFromSecretKey}}),Object.defineProperty(t,"sign",{enumerable:!0,get:function(){return p.sign}}),Object.defineProperty(t,"signVerify",{enumerable:!0,get:function(){return p.signVerify}});var f=r("./node_modules/@ton/crypto/dist/hd/ed25519.js");Object.defineProperty(t,"getED25519MasterKeyFromSeed",{enumerable:!0,get:function(){return f.getED25519MasterKeyFromSeed}}),Object.defineProperty(t,"deriveED25519HardenedKey",{enumerable:!0,get:function(){return f.deriveED25519HardenedKey}}),Object.defineProperty(t,"deriveEd25519Path",{enumerable:!0,get:function(){return f.deriveEd25519Path}});var g=r("./node_modules/@ton/crypto/dist/hd/symmetric.js");Object.defineProperty(t,"getSymmetricMasterKeyFromSeed",{enumerable:!0,get:function(){return g.getSymmetricMasterKeyFromSeed}}),Object.defineProperty(t,"deriveSymmetricHardenedKey",{enumerable:!0,get:function(){return g.deriveSymmetricHardenedKey}}),Object.defineProperty(t,"deriveSymmetricPath",{enumerable:!0,get:function(){return g.deriveSymmetricPath}});var m=r("./node_modules/@ton/crypto/dist/hd/mnemonics.js");Object.defineProperty(t,"deriveMnemonicsPath",{enumerable:!0,get:function(){return m.deriveMnemonicsPath}}),Object.defineProperty(t,"deriveMnemonicHardenedKey",{enumerable:!0,get:function(){return m.deriveMnemonicHardenedKey}}),Object.defineProperty(t,"getMnemonicsMasterKeyFromSeed",{enumerable:!0,get:function(){return m.getMnemonicsMasterKeyFromSeed}})},"./node_modules/@ton/crypto/dist/mnemonic/mnemonic.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer,o=this&&this.__importDefault||function(e){return e&&e.__esMo
2dule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.mnemonicFromRandomSeed=t.mnemonicIndexesToBytes=t.bytesToMnemonics=t.bytesToMnemonicIndexes=t.mnemonicNew=t.mnemonicValidate=t.mnemonicToHDSeed=t.mnemonicToWalletKey=t.mnemonicToPrivateKey=t.mnemonicToSeed=t.mnemonicToEntropy=void 0;const s=o(r("./node_modules/tweetnacl/nacl-fast.js")),i=r("./node_modules/@ton/crypto/dist/primitives/getSecureRandom.js"),a=r("./node_modules/@ton/crypto/dist/primitives/hmac_sha512.js"),c=r("./node_modules/@ton/crypto/dist/primitives/pbkdf2_sha512.js"),l=r("./node_modules/@ton/crypto/dist/utils/binary.js"),u=r("./node_modules/@ton/crypto/dist/mnemonic/wordlist.js"),d=1e5;async function h(e){const t=await g(e);return await async function(e){return 1==(await(0,c.pbkdf2_sha512)(e,"TON fast seed version",1,64))[0]}(t)&&!await f(t)}function p(e){return e.map((e=>e.toLowerCase().trim()))}async function f(e){return 0==(await(0,c.pbkdf2_sha512)(e,"TON seed version",Math.max(1,Math.floor(390.625)),64))[0]}async function g(e,t){return await(0,a.hmac_sha512)(e.join(" "),t&&t.length>0?t:"")}async function m(e,t,r){const n=await g(e,r);return await(0,c.pbkdf2_sha512)(n,t,d,64)}async function y(e,t){e=p(e);const r=await m(e,"TON default seed",t);let o=s.default.sign.keyPair.fromSeed(r.slice(0,32));return{publicKey:n.from(o.publicKey),secretKey:n.from(o.secretKey)}}async function b(e,t){e=p(e);for(let t of e)if(u.wordlist.indexOf(t)<0)return!1;return!(t&&t.length>0&&!await h(e))&&await f(await g(e,t))}function w(e,t){let r=(0,l.bytesToBits)(e),n=[];for(let e=0;e<t;e++){let t=r.slice(11*e,11*e+11);n.push(parseInt(t,2))}return n}function v(e,t){let r=w(e,t),n=[];for(let e of r)n.push(u.wordlist[e]);return n}t.mnemonicToEntropy=g,t.mnemonicToSeed=m,t.mnemonicToPrivateKey=y,t.mnemonicToWalletKey=async function(e,t){let r=(await y(e,t)).secretKey.slice(0,32);const o=s.default.sign.keyPair.fromSeed(r);return{publicKey:n.from(o.publicKey),secretKey:n.from(o.secretKey)}},t.mnemonicToHDSeed=async function(e,t){return e=p(e),await m(e,"TON HD Keys seed",t)},t.mnemonicValidate=b,t.mnemonicNew=async function(e=24,t){let r=[];for(;;){r=[];for(let t=0;t<e;t++){let e=await(0,i.getSecureRandomNumber)(0,u.wordlist.length);r.push(u.wordlist[e])}if((!(t&&t.length>0)||await h(r))&&await f(await g(r,t)))break}return r},t.bytesToMnemonicIndexes=w,t.bytesToMnemonics=v,t.mnemonicIndexesToBytes=function(e){let t="";for(let r of e){if(!Number.isSafeInteger(r))throw Error("Invalid input");if(r<0||r>=2028)throw Error("Invalid input");t+=(0,l.lpad)(r.toString(2),"0",11)}for(;t.length%8!=0;)t+="0";return(0,l.bitsToBytes)(t)},t.mnemonicFromRandomSeed=async function(e,t=24,r){const n=Math.ceil(11*t/8);let o=e;for(;;){let e=await(0,c.pbkdf2_sha512)(o,"TON mnemonic seed",Math.max(1,Math.floor(390.625)),n),s=v(e,t);if(await b(s,r))return s;o=e}}},"./node_modules/@ton/crypto/dist/mnemonic/wordlist.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}
2),t.wordlist=void 0;t.wordlist=["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","de
2sk","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","ric
2h","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"]},"./node_modules/@ton/crypto/dist/passwords/newSecurePassphrase.js"(e,t,r){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.newSecurePassphrase=void 0;const n=r("./node_modules/@ton/crypto/dist/index.js");t.newSecurePassphrase=async function(e=6){return(await(0,n.newSecureWords)(e)).join("-")}},"./node_modules/@ton/crypto/dist/passwords/newSecureWords.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.newSecureWords=void 0;const n=r("./node_modules/@ton/crypto/dist/primitives/getSecureRandom.js"),o=r("./node_modules/@ton/crypto/dist/passwords/wordlist.js");t.newSecureWords=async function(e=6){let t=[];for(let r=0;r<e;r++)t.push(o.wordlist[await(0,n.getSecureRandomNumber)(0,o.wordlist.length)]);return t}},"./node_modules/@ton/crypto/dist/passwords/wordlist.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wordlist=void 0,t.wordlist=["abacus","abdomen","abdominal","abide","abiding","ability","ablaze","able","abnormal","abrasion","abrasive","abreast","abridge","abroad","abruptly","absence","absentee","absently","absinthe","absolute","absolve","abstain","abstract","absurd","accent","acclaim","acclimate","accompany","account","accuracy","accurate","accustom","acetone","achiness","aching","acid","acorn","acquaint","acquire","acre","acrobat","acronym","acting","action","activate","activator","active","activism","activist","activity","actress","acts","acutely","acuteness","aeration","aerobics","aerosol","aerospace","afar","affair","affected","affecting","affection","affidavit","affiliate","affirm","affix","afflicted","affluent","afford","affront","aflame","afloat","aflutter","afoot","afraid","afterglow","afterlife","aftermath","aftermost","afternoon","aged","ageless","agency","agenda","agent","aggregate","aghast","agile","agility","aging","agnostic","agonize","agonizing","agony","agreeable","agreeably","agreed","agreeing","agreement","aground","ahead","ahoy","aide","aids","aim","ajar","alabaster","alarm","albatross","album","alfalfa","algebra","algorithm","alias","alibi","alienable","alienate","aliens","alike","alive","alkaline","alkalize","almanac","almighty","almost","aloe","aloft","aloha","alone","alongside","aloof","alphabet","alright","although","altitude","alto","aluminum","alumni","always","amaretto","amaze","amazingly","amber","ambiance","ambiguity","ambiguous","ambition","ambitious","ambulance","ambush","amendable","amendment","amends","amenity","amiable","amicably","amid","am
2igo","amino","amiss","ammonia","ammonium","amnesty","amniotic","among","amount","amperage","ample","amplifier","amplify","amply","amuck","amulet","amusable","amused","amusement","amuser","amusing","anaconda","anaerobic","anagram","anatomist","anatomy","anchor","anchovy","ancient","android","anemia","anemic","aneurism","anew","angelfish","angelic","anger","angled","angler","angles","angling","angrily","angriness","anguished","angular","animal","animate","animating","animation","animator","anime","animosity","ankle","annex","annotate","announcer","annoying","annually","annuity","anointer","another","answering","antacid","antarctic","anteater","antelope","antennae","anthem","anthill","anthology","antibody","antics","antidote","antihero","antiquely","antiques","antiquity","antirust","antitoxic","antitrust","antiviral","antivirus","antler","antonym","antsy","anvil","anybody","anyhow","anymore","anyone","anyplace","anything","anytime","anyway","anywhere","aorta","apache","apostle","appealing","appear","appease","appeasing","appendage","appendix","appetite","appetizer","applaud","applause","apple","appliance","applicant","applied","apply","appointee","appraisal","appraiser","apprehend","approach","approval","approve","apricot","april","apron","aptitude","aptly","aqua","aqueduct","arbitrary","arbitrate","ardently","area","arena","arguable","arguably","argue","arise","armadillo","armband","armchair","armed","armful","armhole","arming","armless","armoire","armored","armory","armrest","army","aroma","arose","around","arousal","arrange","array","arrest","arrival","arrive","arrogance","arrogant","arson","art","ascend","ascension","ascent","ascertain","ashamed","ashen","ashes","ashy","aside","askew","asleep","asparagus","aspect","aspirate","aspire","aspirin","astonish","astound","astride","astrology","astronaut","astronomy","astute","atlantic","atlas","atom","atonable","atop","atrium","atrocious","atrophy","attach","attain","attempt","attendant","attendee","attention","attentive","attest","attic","attire","attitude","attractor","attribute","atypical","auction","audacious","audacity","audible","audibly","audience","audio","audition","augmented","august","authentic","author","autism","autistic","autograph","automaker","automated","automatic","autopilot","available","avalanche","avatar","avenge","avenging","avenue","average","aversion","avert","aviation","aviator","avid","avoid","await","awaken","award","aware","awhile","awkward","awning","awoke","awry","axis","babble","babbling","babied","baboon","backache","backboard","backboned","backdrop","backed","backer","backfield","backfire","backhand","backing","backlands","backlash","backless","backlight","backlit","backlog","backpack","backpedal","backrest","backroom","backshift","backside","backslid","backspace","backspin","backstab","backstage","backtalk","backtrack","backup","backward","backwash","backwater","backyard","bacon","bacteria","bacterium","badass","badge","badland","badly","badness","baffle","baffling","bagel","bagful","baggage","bagged","baggie","bagginess","bagging","baggy","bagpipe","baguette","baked","bakery","bakeshop","baking","balance","balancing","balcony","balmy","balsamic","bamboo","banana","banish","banister","banjo","bankable","bankbook","banked","banker","banking","banknote","bankroll","banner","bannister","banshee","banter","barbecue","barbed","barbell","barber","barcode","barge","bargraph","barista","baritone","barley","barmaid","barman","barn","barometer","barrack","barracuda","barrel","barrette","barricade","barrier","barstool","bartender","barterer","bash","basically","basics","basil","basin","basis","basket","batboy","batch","bath","baton","bats","battalion","battered","battering","battery","batting","battle","bauble","bazooka","blabber","bladder","blade","blah","blame","blaming","blanching","blandness","blank","blaspheme","blasphemy","blast","blatancy","blatantly","blazer","blazing","bleach","bleak","bleep","blemish","blend","bless","blighted","blimp","bling","blinked","blinker","blinking","blinks","blip","blissful","blitz","blizzard","bloated","bloating","blob","blog","bloomers","blooming","blooper","blot","blouse","blubber","bluff","bluish","blunderer","blunt","blurb","blurred","blurry","blurt","blush","blustery","boaster","boastful","boasting","boat","bobbed","bobbing","bobble","bobcat","bobsled","bobtail","bodacious","body","bogged","boggle","bogus","boil","bok","bolster","bolt","bonanza","bonded","bonding","bondless","boned","bonehead","boneless","bonelike","boney","bonfire","bonnet","bonsai","bonus","bony","boogeyman","boogieman","book","boondocks","booted","booth","bootie","booting","bootlace","bootleg","boots","boozy","borax","boring","borough","borrower","borrowing","boss","botanical","botanist","botany","botch","both","bottle","bottling","bottom","bounce","bouncing","bouncy","bounding","boundless","bountiful","bovine","boxcar","boxer","boxing","boxlike","boxy","breach","breath","breeches","breeching","breeder","breeding","breeze","breezy","brethren","brewery","brewing","briar","bribe","brick","bride","bridged","brigade","bright","brilliant","brim","bring","brink","brisket","briskly","briskness","bristle","brittle","broadband","broadcast","broaden","broadly","broadness","broadside","broadways","broiler","broiling","broken","broker","bronchial","bronco","bronze","bronzing","brook","broom","brought","browbeat","brownnose","browse","browsing","bruising","brunch","brunette","brunt","brush","brussels","brute","brutishly","bubble","bubbling","bubbly","buccaneer","bucked","bucket","buckle","buckshot","buckskin","bucktooth","buckwheat","buddhism","buddhist","budding","buddy","budget","buffalo","buffed","buffer","buffing","buffoon","buggy","bulb","bulge","bulginess","bulgur","bulk","bulldog","bulldozer","bullfight","bullfrog","bullhorn","bullion","bullish","bullpen","bullring","bullseye","bullwhip","bully","bunch","bundle","bungee","bunion","bunkbed","bunkhouse","bunkmate","bunny","bunt","busboy","bush","busily","busload","bust","busybody","buzz","cabana","cabbage","cabbie","cabdriver","cable","caboose","cache","cackle","cacti","cactus","caddie","caddy","cadet","cadillac","cadmium","cage","cahoots","cake","calamari","calamity","calcium","calculate","calculus","caliber","calibrate","calm","caloric","calorie","calzone","camcorder","cameo","camera","camisole","camper","campfire","camping","campsite","campus","canal","canary","cancel","candied","candle","candy","cane","canine","canister","cannabis","canned","canning","cannon","cannot","canola","canon","canopener","canopy","canteen","canyon","capable","capably","capacity","cape","capillary","capital","capitol","capped","capricorn","capsize","capsule","caption","captivate","captive","captivity","capture","caramel","carat","caravan","carbon","cardboard","carded","cardiac","cardigan","cardinal","cardstock","carefully","caregiver","careless","caress","caretaker","cargo","caring","carless","carload","carmaker","carnage","carnation","carnival","carnivore","carol","carpenter","carpentry","carpool","carport","carried","carrot","carrousel","carry","cartel","cartload","carton","cartoon","cartridge","cartwheel","carve","carving","carwash","cascade","case","cash","casing","casino","casket","cassette","casually","casualty","catacomb","catalog","catalyst","catalyze","catapult","cataract","catatonic","catcall","catchable","catcher","catching","catchy","caterer","catering","catfight","catfish","cathedral","cathouse","catlike","catnap","catnip","catsup","cattail","cattishly","cattle","catty","catwalk","caucasian","caucus","causal","causation","cause","causing","cauterize","caution","cautious","cavalier","cavalry","caviar","cavity","cedar","celery","celestial","celibacy","celibate","celtic","cement","census","ceramics","ceremony","certainly","certainty","certified","certify","cesarean","cesspool","chafe","chaffing","chain","chair","chalice","challenge","chamber","chamomile","champion","chance","change","channel","chant","chaos","chaperone","chaplain","chapped","chaps","chapter","character","charbroil","charcoal","charger","charging","chariot","charity","charm","charred","charter","charting","chase","chasing","chaste","chastise","chastity","chatroom","chatter","chatting","chatty","cheating","cheddar","cheek","cheer","cheese","cheesy","chef","chemicals","chemist","chemo","cherisher","cherub","chess","chest","chevron","chevy","chewable","chewer","chewing","chewy","chief","chihuahua","childcare","childhood","childish","childless","childlike","chili","chill","chimp","chip","chirping","chirpy","chitchat","chivalry","chive","chloride","chlorine","choice","chokehold","choking","chomp","chooser","choosing","choosy","chop","chosen","chowder","chowtime","chrome","chubby","chuck","chug","chummy","chump","chunk","churn","chute","cider","cilantro","cinch","cinema","cinnamon","circle","circling","circular","circulate","circus","citable","citadel","citation","citizen","citric","citrus","city","civic","civil","clad","claim","clambake","clammy","clamor","clamp","clamshell","clang","clanking","clapped","clapper","clapping","clarify","clarinet","clarity","clash","clasp","class","clatter","clause","clavicle","claw","clay","clean","clear","cleat","cleaver","cleft","clench","clergyman","clerical","clerk","clever","clicker","client","climate","climatic","cling","clinic","clinking","clip","clique","cloak","clobber","clock","clone","cloning","closable","closure","clothes","clothing","cloud","clover","clubbed","clubbing","clubhouse","clump","clumsily","clumsy","clunky","clustered","clutch","clutter","coach","coagulant","coastal","coaster","coasting","coastland","co
2astline","coat","coauthor","cobalt","cobbler","cobweb","cocoa","coconut","cod","coeditor","coerce","coexist","coffee","cofounder","cognition","cognitive","cogwheel","coherence","coherent","cohesive","coil","coke","cola","cold","coleslaw","coliseum","collage","collapse","collar","collected","collector","collide","collie","collision","colonial","colonist","colonize","colony","colossal","colt","coma","come","comfort","comfy","comic","coming","comma","commence","commend","comment","commerce","commode","commodity","commodore","common","commotion","commute","commuting","compacted","compacter","compactly","compactor","companion","company","compare","compel","compile","comply","component","composed","composer","composite","compost","composure","compound","compress","comprised","computer","computing","comrade","concave","conceal","conceded","concept","concerned","concert","conch","concierge","concise","conclude","concrete","concur","condense","condiment","condition","condone","conducive","conductor","conduit","cone","confess","confetti","confidant","confident","confider","confiding","configure","confined","confining","confirm","conflict","conform","confound","confront","confused","confusing","confusion","congenial","congested","congrats","congress","conical","conjoined","conjure","conjuror","connected","connector","consensus","consent","console","consoling","consonant","constable","constant","constrain","constrict","construct","consult","consumer","consuming","contact","container","contempt","contend","contented","contently","contents","contest","context","contort","contour","contrite","control","contusion","convene","convent","copartner","cope","copied","copier","copilot","coping","copious","copper","copy","coral","cork","cornball","cornbread","corncob","cornea","corned","corner","cornfield","cornflake","cornhusk","cornmeal","cornstalk","corny","coronary","coroner","corporal","corporate","corral","correct","corridor","corrode","corroding","corrosive","corsage","corset","cortex","cosigner","cosmetics","cosmic","cosmos","cosponsor","cost","cottage","cotton","couch","cough","could","countable","countdown","counting","countless","country","county","courier","covenant","cover","coveted","coveting","coyness","cozily","coziness","cozy","crabbing","crabgrass","crablike","crabmeat","cradle","cradling","crafter","craftily","craftsman","craftwork","crafty","cramp","cranberry","crane","cranial","cranium","crank","crate","crave","craving","crawfish","crawlers","crawling","crayfish","crayon","crazed","crazily","craziness","crazy","creamed","creamer","creamlike","crease","creasing","creatable","create","creation","creative","creature","credible","credibly","credit","creed","creme","creole","crepe","crept","crescent","crested","cresting","crestless","crevice","crewless","crewman","crewmate","crib","cricket","cried","crier","crimp","crimson","cringe","cringing","crinkle","crinkly","crisped","crisping","crisply","crispness","crispy","criteria","critter","croak","crock","crook","croon","crop","cross","crouch","crouton","crowbar","crowd","crown","crucial","crudely","crudeness","cruelly","cruelness","cruelty","crumb","crummiest","crummy","crumpet","crumpled","cruncher","crunching","crunchy","crusader","crushable","crushed","crusher","crushing","crust","crux","crying","cryptic","crystal","cubbyhole","cube","cubical","cubicle","cucumber","cuddle","cuddly","cufflink","culinary","culminate","culpable","culprit","cultivate","cultural","culture","cupbearer","cupcake","cupid","cupped","cupping","curable","curator","curdle","cure","curfew","curing","curled","curler","curliness","curling","curly","curry","curse","cursive","cursor","curtain","curtly","curtsy","curvature","curve","curvy","cushy","cusp","cussed","custard","custodian","custody","customary","customer","customize","customs","cut","cycle","cyclic","cycling","cyclist","cylinder","cymbal","cytoplasm","cytoplast","dab","dad","daffodil","dagger","daily","daintily","dainty","dairy","daisy","dallying","dance","dancing","dandelion","dander","dandruff","dandy","danger","dangle","dangling","daredevil","dares","daringly","darkened","darkening","darkish","darkness","darkroom","darling","darn","dart","darwinism","dash","dastardly","data","datebook","dating","daughter","daunting","dawdler","dawn","daybed","daybreak","daycare","daydream","daylight","daylong","dayroom","daytime","dazzler","dazzling","deacon","deafening","deafness","dealer","dealing","dealmaker","dealt","dean","debatable","debate","debating","debit","debrief","debtless","debtor","debug","debunk","decade","decaf","decal","decathlon","decay","deceased","deceit","deceiver","deceiving","december","decency","decent","deception","deceptive","decibel","decidable","decimal","decimeter","decipher","deck","declared","decline","decode","decompose","decorated","decorator","decoy","decrease","decree","dedicate","dedicator","deduce","deduct","deed","deem","deepen","deeply","deepness","deface","defacing","defame","default","defeat","defection","defective","defendant","defender","defense","defensive","deferral","deferred","defiance","defiant","defile","defiling","define","definite","deflate","deflation","deflator","deflected","deflector","defog","deforest","defraud","defrost","deftly","defuse","defy","degraded","degrading","degrease","degree","dehydrate","deity","dejected","delay","delegate","delegator","delete","deletion","delicacy","delicate","delicious","delighted","delirious","delirium","deliverer","delivery","delouse","delta","deluge","delusion","deluxe","demanding","demeaning","demeanor","demise","democracy","democrat","demote","demotion","demystify","denatured","deniable","denial","denim","denote","dense","density","dental","dentist","denture","deny","deodorant","deodorize","departed","departure","depict","deplete","depletion","deplored","deploy","deport","depose","depraved","depravity","deprecate","depress","deprive","depth","deputize","deputy","derail","deranged","derby","derived","desecrate","deserve","deserving","designate","designed","designer","designing","deskbound","desktop","deskwork","desolate","despair","despise","despite","destiny","destitute","destruct","detached","detail","detection","detective","detector","detention","detergent","detest","detonate","detonator","detoxify","detract","deuce","devalue","deviancy","deviant","deviate","deviation","deviator","device","devious","devotedly","devotee","devotion","devourer","devouring","devoutly","dexterity","dexterous","diabetes","diabetic","diabolic","diagnoses","diagnosis","diagram","dial","diameter","diaper","diaphragm","diary","dice","dicing","dictate","dictation","dictator","difficult","diffused","diffuser","diffusion","diffusive","dig","dilation","diligence","diligent","dill","dilute","dime","diminish","dimly","dimmed","dimmer","dimness","dimple","diner","dingbat","dinghy","dinginess","dingo","dingy","dining","dinner","diocese","dioxide","diploma","dipped","dipper","dipping","directed","direction","directive","directly","directory","direness","dirtiness","disabled","disagree","disallow","disarm","disarray","disaster","disband","disbelief","disburse","discard","discern","discharge","disclose","discolor","discount","discourse","discover","discuss","disdain","disengage","disfigure","disgrace","dis
2h","disinfect","disjoin","disk","dislike","disliking","dislocate","dislodge","disloyal","dismantle","dismay","dismiss","dismount","disobey","disorder","disown","disparate","disparity","dispatch","dispense","dispersal","dispersed","disperser","displace","display","displease","disposal","dispose","disprove","dispute","disregard","disrupt","dissuade","distance","distant","distaste","distill","distinct","distort","distract","distress","district","distrust","ditch","ditto","ditzy","dividable","divided","dividend","dividers","dividing","divinely","diving","divinity","divisible","divisibly","division","divisive","divorcee","dizziness","dizzy","doable","docile","dock","doctrine","document","dodge","dodgy","doily","doing","dole","dollar","dollhouse","dollop","dolly","dolphin","domain","domelike","domestic","dominion","dominoes","donated","donation","donator","donor","donut","doodle","doorbell","doorframe","doorknob","doorman","doormat","doornail","doorpost","doorstep","doorstop","doorway","doozy","dork","dormitory","dorsal","dosage","dose","dotted","doubling","douche","dove","down","dowry","doze","drab","dragging","dragonfly","dragonish","dragster","drainable","drainage","drained","drainer","drainpipe","dramatic","dramatize","drank","drapery","drastic","draw","dreaded","dreadful","dreadlock","dreamboat","dreamily","dreamland","dreamless","dreamlike","dreamt","dreamy","drearily","dreary","drench","dress","drew","dribble","dried","drier","drift","driller","drilling","drinkable","drinking","dripping","drippy","drivable","driven","driver","driveway","driving","drizzle","drizzly","drone","drool","droop","drop-down","dropbox","dropkick","droplet","dropout","dropper","drove","drown","drowsily","drudge","drum","dry","dubbed","dubiously","duchess","duckbill","ducking","duckling","ducktail","ducky","duct","dude","duffel","dugout","duh","duke","duller","dullness","duly","dumping","dumpling","dumpster","duo","dupe","duplex","duplicate","duplicity","durable","durably","duration","duress","during","dusk","dust","dutiful","duty","duvet","dwarf","dweeb","dwelled","dweller","dwelling","dwindle","dwindling","dynamic","dynamite","dynasty","dyslexia","dyslexic","each","eagle","earache","eardrum","earflap","earful","earlobe","early","earmark","earmuff","earphone","earpiece","earplugs","earring","earshot","earthen","earthlike","earthling","earthly","earthworm","earthy","earwig","easeful","easel","easiest","easily","easiness","easing","eastbound","eastcoast","easter","eastward","eatable","eaten","eatery","eating","eats","ebay","ebony","ebook","ecard","eccentric","echo","eclair","eclipse","ecologist","ecology","economic","economist","economy","ecosphere","ecosystem","edge","edginess","edging","edgy","edition","editor","educated","education","educator","eel","effective","effects","efficient","effort","eggbeater","egging","eggnog","eggplant","eggshell","egomaniac","egotism","egotistic","either","eject","elaborate","elastic","elated","elbow","eldercare","elderly","eldest","electable","election","elective","elephant","elevate","elevating","elevation","elevator","eleven","elf","eligible","eligibly","eliminate","elite","elitism","elixir","elk","ellipse","elliptic","elm","elongated","elope","eloquence","eloquent","elsewhere","elude","elusive","elves","email","embargo","embark","embassy","embattled","embellish","ember","embezzle","emblaze","emblem","embody","embolism","emboss","embroider","emcee","emerald","emergency","emission","emit","emote","emoticon","emotion","empathic","empathy","emperor","emphases","emphasis","emphasize","emphatic","empirical","employed","employee","employer","emporium","empower","emptier","emptiness","empty","emu","enable","enactment","enamel","enchanted","enchilada","encircle","enclose","enclosure","encode","encore","encounter","encourage","encroach","encrust","encrypt","endanger","endeared","endearing","ended","ending","endless","endnote","endocrine","endorphin","endorse","endowment","endpoint","endurable","endurance","enduring","energetic","energize","energy","enforced","enforcer","engaged","engaging","engine","engorge","engraved","engraver","engraving","engross","engulf","enhance","enigmatic","enjoyable","enjoyably","enjoyer","enjoying","enjoyment","enlarged","enlarging","enlighten","enlisted","enquirer","enrage","enrich","enroll","enslave","ensnare","ensure","entail","entangled","entering","entertain","enticing","entire","entitle","entity","entomb","entourage","entrap","entree","entrench","entrust","entryway","entwine","enunciate","envelope","enviable","enviably","envious","envision","envoy","envy","enzyme","epic","epidemic","epidermal","epidermis","epidural","epilepsy","epileptic","epilogue","epiphany","episode","equal","equate","equation","equator","equinox","equipment","equity","equivocal","eradicate","erasable","erased","eraser","erasure","ergonomic","errand","errant","erratic","error","erupt","escalate","escalator","escapable","escapade","escapist","escargot","eskimo","esophagus","espionage","espresso","esquire","essay","essence","essential","establish","estate","esteemed","estimate","estimator","estranged","estrogen","etching","eternal","eternity","ethanol","ether","ethically","ethics","eup
2hemism","evacuate","evacuee","evade","evaluate","evaluator","evaporate","evasion","evasive","even","everglade","evergreen","everybody","everyday","everyone","evict","evidence","evident","evil","evoke","evolution","evolve","exact","exalted","example","excavate","excavator","exceeding","exception","excess","exchange","excitable","exciting","exclaim","exclude","excluding","exclusion","exclusive","excretion","excretory","excursion","excusable","excusably","excuse","exemplary","exemplify","exemption","exerciser","exert","exes","exfoliate","exhale","exhaust","exhume","exile","existing","exit","exodus","exonerate","exorcism","exorcist","expand","expanse","expansion","expansive","expectant","expedited","expediter","expel","expend","expenses","expensive","expert","expire","expiring","explain","expletive","explicit","explode","exploit","explore","exploring","exponent","exporter","exposable","expose","exposure","express","expulsion","exquisite","extended","extending","extent","extenuate","exterior","external","extinct","extortion","extradite","extras","extrovert","extrude","extruding","exuberant","fable","fabric","fabulous","facebook","facecloth","facedown","faceless","facelift","faceplate","faceted","facial","facility","facing","facsimile","faction","factoid","factor","factsheet","factual","faculty","fade","fading","failing","falcon","fall","false","falsify","fame","familiar","family","famine","famished","fanatic","fancied","fanciness","fancy","fanfare","fang","fanning","fantasize","fantastic","fantasy","fascism","fastball","faster","fasting","fastness","faucet","favorable","favorably","favored","favoring","favorite","fax","feast","federal","fedora","feeble","feed","feel","feisty","feline","felt-tip","feminine","feminism","feminist","feminize","femur","fence","fencing","fender","ferment","fernlike","ferocious","ferocity","ferret","ferris","ferry","fervor","fester","festival","festive","festivity","fetal","fetch","fever","fiber","fiction","fiddle","fiddling","fidelity","fidgeting","fidgety","fifteen","fifth","fiftieth","fifty","figment","figure","figurine","filing","filled","filler","filling","film","filter","filth","filtrate","finale","finalist","finalize","finally","finance","financial","finch","fineness","finer","finicky","finished","finisher","finishing","finite","finless","finlike","fiscally","fit","five","flaccid","flagman","flagpole","flagship","flagstick","flagstone","flail","flakily","flaky","flame","flammable","flanked","flanking","flannels","flap","flaring","flashback","flashbulb","flashcard","flashily","flashing","flashy","flask","flatbed","flatfoot","flatly","flatness","flatten","flattered","flatterer","flattery","flattop","flatware","flatworm","flavored","flavorful","flavoring","flaxseed","fled","fleshed","fleshy","flick","flier","flight","flinch","fling","flint","flip","flirt","float","flock","flogging","flop","floral","florist","floss","flounder","flyable","flyaway","flyer","flying","flyover","flypaper","foam","foe","fog","foil","folic","folk","follicle","follow","fondling","fondly","fondness","fondue","font","food","fool","footage","football","footbath","footboard","footer","footgear","foothill","foothold","footing","footless","footman","footnote","footpad","footpath","footprint","footrest","footsie","footsore","footwear","footwork","fossil","foster","founder","founding","fountain","fox","foyer","fraction","fracture","fragile","fragility","fragment","fragrance","fragrant","frail","frame","framing","frantic","fraternal","frayed","fraying","frays","freckled","freckles","freebase","freebee","freebie","freedom","freefall","freehand","freeing","freeload","freely","freemason","freeness","freestyle","freeware","freeway","freewill","freezable","freezing","freight","french","frenzied","frenzy","frequency","frequent","fresh","fretful","fretted","friction","friday","fridge","fried","friend","frighten","frightful","frigidity","frigidly","frill","fringe","frisbee","frisk","fritter","frivolous","frolic","from","front","frostbite","frosted","frostily","frosting","frostlike","frosty","froth","frown","frozen","fructose","frugality","frugally","fruit","frustrate","frying","gab","gaffe","gag","gainfully","gaining","gains","gala","gallantly","galleria","gallery","galley","gallon","gallows","gallstone","galore","galvanize","gambling","game","gaming","gamma","gander","gangly","gangrene","gangway","gap","garage","garbage","garden","gargle","garland","garlic","garment","garnet","garnish","garter","gas","gatherer","gathering","gating","gauging","gauntlet","gauze","gave","gawk","gazing","gear","gecko","geek","geiger","gem","gender","generic","generous","genetics","genre","gentile","gentleman","gently","gents","geography","geologic","geologist","geology","geometric","geometry","geranium","gerbil","geriatric","germicide","germinate","germless","germproof","gestate","gestation","gesture","getaway","getting","getup","giant","gibberish","giblet","giddily","gi
2ddiness","giddy","gift","gigabyte","gigahertz","gigantic","giggle","giggling","giggly","gigolo","gilled","gills","gimmick","girdle","giveaway","given","giver","giving","gizmo","gizzard","glacial","glacier","glade","gladiator","gladly","glamorous","glamour","glance","glancing","glandular","glare","glaring","glass","glaucoma","glazing","gleaming","gleeful","glider","gliding","glimmer","glimpse","glisten","glitch","glitter","glitzy","gloater","gloating","gloomily","gloomy","glorified","glorifier","glorify","glorious","glory","gloss","glove","glowing","glowworm","glucose","glue","gluten","glutinous","glutton","gnarly","gnat","goal","goatskin","goes","goggles","going","goldfish","goldmine","goldsmith","golf","goliath","gonad","gondola","gone","gong","good","gooey","goofball","goofiness","goofy","google","goon","gopher","gore","gorged","gorgeous","gory","gosling","gossip","gothic","gotten","gout","gown","grab","graceful","graceless","gracious","gradation","graded","grader","gradient","grading","gradually","graduate","graffiti","grafted","grafting","grain","granddad","grandkid","grandly","grandma","grandpa","grandson","granite","granny","granola","grant","granular","grape","graph","grapple","grappling","grasp","grass","gratified","gratify","grating","gratitude","gratuity","gravel","graveness","graves","graveyard","gravitate","gravity","gravy","gray","grazing","greasily","greedily","greedless","greedy","green","greeter","greeting","grew","greyhound","grid","grief","grievance","grieving","grievous","grill","grimace","grimacing","grime","griminess","grimy","grinch","grinning","grip","gristle","grit","groggily","groggy","groin","groom","groove","grooving","groovy","grope","ground","grouped","grout","grove","grower","growing","growl","grub","grudge","grudging","grueling","gruffly","grumble","grumbling","grumbly","grumpily","grunge","grunt","guacamole","guidable","guidance","guide","guiding","guileless","guise","gulf","gullible","gully","gulp","gumball","gumdrop","gumminess","gumming","gummy","gurgle","gurgling","guru","gush","gusto","gusty","gutless","guts","gutter","guy","guzzler","gyration","habitable","habitant","habitat","habitual","hacked","hacker","hacking","hacksaw","had","haggler","haiku","half","halogen","halt","halved","halves","hamburger","hamlet","hammock","hamper","hamster","hamstring","handbag","handball","handbook","handbrake","handcart","handclap","handclasp","handcraft","handcuff","handed","handful","handgrip","handgun","handheld","handiness","handiwork","handlebar","handled","handler","handling","handmade","handoff","handpick","handprint","handrail","handsaw","handset","handsfree","handshake","handstand","handwash","handwork","handwoven","handwrite","handyman","hangnail","hangout","hangover","hangup","hankering","hankie","hanky","haphazard","happening","happier","happiest","happily","happiness","happy","harbor","hardcopy","hardcore","hardcover","harddisk","hardened","hardener","hardening","hardhat","hardhead","hardiness","hardly","hardness","hardship","hardware","hardwired","hardwood","hardy","harmful","harmless","harmonica","harmonics","harmonize","harmony","harness","harpist","harsh","harvest","hash","hassle","haste","hastily","hastiness","hasty","hatbox","hatchback","hatchery","hatchet","hatching","hatchling","hate","hatless","hatred","haunt","haven","hazard","hazelnut","hazily","haziness","hazing","hazy","headache","headband","headboard","headcount","headdress","headed","header","headfirst","headgear","heading","headlamp","headless","headlock","headphone","headpiece","headrest","headroom","headscarf","headset","headsman","headstand","headstone","headway","headwear","heap","heat","heave","heavily","heaviness","heaving","hedge","hedging","heftiness","hefty","helium","helmet","helper","helpful","helping","helpless","helpline","hemlock","hemstitch","hence","henchman","henna","herald","herbal","herbicide","herbs","heritage","hermit","heroics","heroism","herring","herself","hertz","hesitancy","hesitant","hesitate","hexagon","hexagram","hubcap","huddle","huddling","huff","hug","hula","hulk","hull","human","humble","humbling","humbly","humid","humiliate","humility","humming","hummus","humongous","humorist","humorless","humorous","humpback","humped","humvee","hunchback","hundredth","hunger","hungr
2ily","hungry","hunk","hunter","hunting","huntress","huntsman","hurdle","hurled","hurler","hurling","hurray","hurricane","hurried","hurry","hurt","husband","hush","husked","huskiness","hut","hybrid","hydrant","hydrated","hydration","hydrogen","hydroxide","hyperlink","hypertext","hyphen","hypnoses","hypnosis","hypnotic","hypnotism","hypnotist","hypnotize","hypocrisy","hypocrite","ibuprofen","ice","iciness","icing","icky","icon","icy","idealism","idealist","idealize","ideally","idealness","identical","identify","identity","ideology","idiocy","idiom","idly","igloo","ignition","ignore","iguana","illicitly","illusion","illusive","image","imaginary","imagines","imaging","imbecile","imitate","imitation","immature","immerse","immersion","imminent","immobile","immodest","immorally","immortal","immovable","immovably","immunity","immunize","impaired","impale","impart","impatient","impeach","impeding","impending","imperfect","imperial","impish","implant","implement","implicate","implicit","implode","implosion","implosive","imply","impolite","important","importer","impose","imposing","impotence","impotency","impotent","impound","imprecise","imprint","imprison","impromptu","improper","improve","improving","improvise","imprudent","impulse","impulsive","impure","impurity","iodine","iodize","ion","ipad","iphone","ipod","irate","irk","iron","irregular","irrigate","irritable","irritably","irritant","irritate","islamic","islamist","isolated","isolating","isolation","isotope","issue","issuing","italicize","italics","item","itinerary","itunes","ivory","ivy","jab","jackal","jacket","jackknife","jackpot","jailbird","jailbreak","jailer","jailhouse","jalapeno","jam","janitor","january","jargon","jarring","jasmine","jaundice","jaunt","java","jawed","jawless","jawline","jaws","jaybird","jaywalker","jazz","jeep","jeeringly","jellied","jelly","jersey","jester","jet","jiffy","jigsaw","jimmy","jingle","jingling","jinx","jitters","jittery","job","jockey","jockstrap","jogger","jogging","john","joining","jokester","jokingly","jolliness","jolly","jolt","jot","jovial","joyfully","joylessly","joyous","joyride","joystick","jubilance","jubilant","judge","judgingly","judicial","judiciary","judo","juggle","juggling","jugular","juice","juiciness","juicy","jujitsu","jukebox","july","jumble","jumbo","jump","junction","juncture","june","junior","juniper","junkie","junkman","
2junkyard","jurist","juror","jury","justice","justifier","justify","justly","justness","juvenile","kabob","kangaroo","karaoke","karate","karma","kebab","keenly","keenness","keep","keg","kelp","kennel","kept","kerchief","kerosene","kettle","kick","kiln","kilobyte","kilogram","kilometer","kilowatt","kilt","kimono","kindle","kindling","kindly","kindness","kindred","kinetic","kinfolk","king","kinship","kinsman","kinswoman","kissable","kisser","kissing","kitchen","kite","kitten","kitty","kiwi","kleenex","knapsack","knee","knelt","knickers","knoll","koala","kooky","kosher","krypton","kudos","kung","labored","laborer","laboring","laborious","labrador","ladder","ladies","ladle","ladybug","ladylike","lagged","lagging","lagoon","lair","lake","lance","landed","landfall","landfill","landing","landlady","landless","landline","landlord","landmark","landmass","landmine","landowner","landscape","landside","landslide","language","lankiness","lanky","lantern","lapdog","lapel","lapped","lapping","laptop","lard","large","lark","lash","lasso","last","latch","late","lather","latitude","latrine","latter","latticed","launch","launder","laundry","laurel","lavender","lavish","laxative","lazily","laziness","lazy","lecturer","left","legacy","legal","legend","legged","leggings","legible","legibly","legislate","lego","legroom","legume","legwarmer","legwork","lemon","lend","length","lens","lent","leotard","lesser","letdown","lethargic","lethargy","letter","lettuce","level","leverage","levers","levitate","levitator","liability","liable","liberty","librarian","library","licking","licorice","lid","life","lifter","lifting","liftoff","ligament","likely","likeness","likewise","liking","lilac","lilly","lily","limb","limeade","limelight","limes","limit","limping","limpness","line","lingo","linguini","linguist","lining","linked","linoleum","linseed","lint","lion","lip","liquefy","liqueur","liquid","lisp","list","litigate","litigator","litmus","litter","little","livable","lived","lively","liver","livestock","lividly","living","lizard","lubricant","lubricate","lucid","luckily","luckiness","luckless","lucrative","ludicrous","lugged","lukewarm","lullaby","lumber","luminance","luminous","lumpiness","lumping","lumpish","lunacy","lunar","lunchbox","luncheon","lunchroom","lunchtime","lung","lurch","lure","luridness","lurk","lushly","lushness","luster","lustfully","lustily","lustiness","lustrous","lusty","luxurious","luxury","lying","lyrically","lyricism","lyricist","lyrics","macarena","macaroni","macaw","mace","machine","machinist","magazine","magenta","maggot","magical","magician","magma","magnesium","magnetic","magnetism","magnetize","magnifier","magnify","magnitude","magnolia","mahogany","maimed","majestic","majesty","majorette","majority","makeover","maker","makeshift","making","malformed","malt","mama","mammal","mammary","mammogram","manager","managing","manatee","mandarin","mandate","mandatory","mandolin","manger","mangle","mango","mangy","manhandle","manhole","manhood","manhunt","manicotti","manicure","manifesto","manila","mankind","manlike","manliness","manly","manmade","manned","mannish","manor","manpower","mantis","mantra","manual","many","map","marathon","marauding","marbled","marbles","marbling","march","mardi","margarine","margarita","margin","marigold","marina","marine","marital","maritime","marlin","marmalade","maroon","married","marrow","marry","marshland","marshy","marsupial","marvelous","marxism","mascot","masculine","mashed","mashing","massager","masses","massive","mastiff","matador","matchbook","matchbox","matcher","matching","matchless","material","maternal","maternity","math","mating","matriarch","matrimony","matrix","matron","matted","matter","maturely","maturing","maturity","mauve","maverick","maximize","maximum","maybe","mayday","mayflower","moaner","moaning","mobile","mobility","mobilize","mobster","mocha","mocker","mockup","modified","modify","modular","modulator","module","moisten","moistness","moisture","molar","molasse
2s","mold","molecular","molecule","molehill","mollusk","mom","monastery","monday","monetary","monetize","moneybags","moneyless","moneywise","mongoose","mongrel","monitor","monkhood","monogamy","monogram","monologue","monopoly","monorail","monotone","monotype","monoxide","monsieur","monsoon","monstrous","monthly","monument","moocher","moodiness","moody","mooing","moonbeam","mooned","moonlight","moonlike","moonlit","moonrise","moonscape","moonshine","moonstone","moonwalk","mop","morale","morality","morally","morbidity","morbidly","morphine","morphing","morse","mortality","mortally","mortician","mortified","mortify","mortuary","mosaic","mossy","most","mothball","mothproof","motion","motivate","motivator","motive","motocross","motor","motto","mountable","mountain","mounted","mounting","mourner","mournful","mouse","mousiness","moustache","mousy","mouth","movable","move","movie","moving","mower","mowing","much","muck","mud","mug","mulberry","mulch","mule","mulled","mullets","multiple","multiply","multitask","multitude","mumble","mumbling","mumbo","mummified","mummify","mummy","mumps","munchkin","mundane","municipal","muppet","mural","murkiness","murky","murmuring","muscular","museum","mushily","mushiness","mushroom","mushy","music","musket","muskiness","musky","mustang","mustard","muster","mustiness","musty","mutable","mutate","mutation","mute","mutilated","mutilator","mutiny","mutt","mutual","muzzle","myself","myspace","mystified","mystify","myth","nacho","nag","nail","name","naming","nanny","nanometer","nape","napkin","napped","napping","nappy","narrow","nastily","nastiness","national","native","nativity","natural","nature","naturist","nautical","navigate","navigator","navy","nearby","nearest","nearly","nearness","neatly","neatness","nebula","nebulizer","nectar","negate","negation","negative","neglector","negligee","negligent","negotiate","nemeses","nemesis","neon","nephew","nerd","nervous","nervy","nest","net","neurology","neuron","neurosis","neurotic","neuter","neutron","never","next","nibble","nickname","nicotine","niece","nifty","nimble","nimbly","nineteen","ninetieth","ninja","nintendo","ninth","nuclear","nuclei","nucleus","nugget","nullify","number","numbing","numbly","numbness","numeral","numerate","numerator","numeric","numerous","nuptials","nursery","nursing","nurture","nutcase","nutlike","nutmeg","nutrient","nutshell","nuttiness","nutty","nuzzle","nylon","oaf","oak","oasis","oat","obedience","obedient","obituary","object","obligate","obliged","oblivion","oblivious","oblong","obnoxious","oboe","obscure","obscurity","observant","observer","observing","obsessed","obsession","obsessive","obsolete","obstacle","obstinate","obstruct","obtain","obtrusive","obtuse","obvious","occultist","occupancy","occupant","occupier","occupy","ocean","ocelot","octagon","octane","october","octopus","ogle","oil","oink","ointment","okay","old","olive","olympics","omega","omen","ominous","omission","omit","omnivore","onboard","oncoming","ongoing","onion","online","onlooker","only","onscreen","onset","onshore","onslaught","onstage","onto","onward","onyx","oops","ooze","oozy","opacity","opal","open","operable","operate","operating","operation","operative","operator","opium","opossum","opponent","oppose","opposing","opposite","oppressed","oppressor","opt","opulently","osmosis","other","otter","ouch","ought","ounce","outage","outback","outbid","outboard","outbound","outbreak","outburst","outcast","outclass","outcome","outdated","outdoors","outer","outfield","outfit","outflank","outgoing","outgrow","outhouse","outing","outlast","outlet","outline","outlook","outlying","outmatch","outmost","outnumber","outplayed","outpost","outpour","output","outrage","outrank","outreach","outright","outscore","outsell","outshine","outshoot","outsider","outskirts","outsmart","outsource","outspoken","outtakes","outthink","outward","outweigh","outwit","oval","ovary","oven","overact","overall","overarch","overbid","overbill","overbite","overblown","overboard","overbook","overbuilt","overcast","overcoat","overcome","overcook","overcrowd","overdraft","overdrawn","overdress","overdrive","overdue","overeager","overeater","overexert","overfed","overfeed","overfill","overflow","overfull","overgrown","overhand","overhang","overhaul","overhead","overhear","overheat","overhung","overjoyed","overkill","overlabor","overlaid","overlap","overlay","overload","overlook","overlord","overlying","overnight","overpass","overpay","overplant","overplay","overpower","overprice","overrate","overreach","overreact","override","overripe","overrule","overrun","overshoot","overshot","oversight","oversized","oversleep","oversold","overspend","overstate","overstay","overstep","overstock","overstuff","oversweet","overtake","overthrow","overtime","overtly","overtone","overture","overturn","overuse","overvalue","overview","overwrite","owl","oxford","oxidant","oxidation","oxidize","oxidizing","oxygen","oxymoron","oyster","ozone","paced","pacemaker","pacific","pacifier","pacifism","pacifist","pacify","padded","padding","paddle","paddling","padlock","pagan","pager","paging","pajamas","palace","palatable","palm","palpable","palpitate","paltry","pampered","pamperer","pampers","pamphlet","panama","pancake","pancreas","panda","pandemic","pang","panhandle","panic","panning","panorama","panoramic","panther","pantomime","pantry","pants","pantyhose","paparazzi","papaya","paper","paprika","papyrus","parabola","parachute","parade","paradox","paragraph","parakeet","paralegal","paralyses","paralysis","paralyze","paramedic","parameter","paramount","parasail","parasite","parasitic","parcel","parched","parchment","pardon","parish","parka","parking","parkway","parlor","parmesan","parole","parrot","parsley","parsnip","partake","parted","parting","partition","partly","partner","partridge","party","passable","passably","passage","passcode","passenger","passerby","passing","passion","passive","passivism","passover","passport","password","pasta","pasted","pastel","pastime","pastor","pastram
2i","pasture","pasty","patchwork","patchy","paternal","paternity","path","patience","patient","patio","patriarch","patriot","patrol","patronage","patronize","pauper","pavement","paver","pavestone","pavilion","paving","pawing","payable","payback","paycheck","payday","payee","payer","paying","payment","payphone","payroll","pebble","pebbly","pecan","pectin","peculiar","peddling","pediatric","pedicure","pedigree","pedometer","pegboard","pelican","pellet","pelt","pelvis","penalize","penalty","pencil","pendant","pending","penholder","penknife","pennant","penniless","penny","penpal","pension","pentagon","pentagram","pep","perceive","percent","perch","percolate","perennial","perfected","perfectly","perfume","periscope","perish","perjurer","perjury","perkiness","perky","perm","peroxide","perpetual","perplexed","persecute","persevere","persuaded","persuader","pesky","peso","pessimism","pessimist","pester","pesticide","petal","petite","petition","petri","petroleum","petted","petticoat","pettiness","petty","petunia","phantom","phobia","phoenix","phonebook","phoney","phonics","phoniness","phony","phosphate","photo","phrase","phrasing","placard","placate","placidly","plank","planner","plant","plasma","plaster","plastic","plated","platform","plating","platinum","platonic","platter","platypus","plausible","plausibly","playable","playback","player","playful","playgroup","playhouse","playing","playlist","playmaker","playmate","playoff","playpen","playroom","playset","plaything","playtime","plaza","pleading","pleat","pledge","plentiful","plenty","plethora","plexiglas","pliable","plod","plop","plot","plow","ploy","pluck","plug","plunder","plunging","plural","plus","plutonium","plywood","poach","pod","poem","poet","pogo","pointed","pointer","pointing","pointless","pointy","poise","poison","poker","poking","polar","police","policy","polio","polish","politely","polka","polo","polyester","polygon","polygraph","polymer","poncho","pond","pony","popcorn","pope","poplar","popper","poppy","popsicle","populace","popular","populate","porcupine","pork","porous","porridge","portable","portal","portfolio","porthole","portion","portly","portside","poser","posh","posing","possible","possibly","possum","postage","postal","postbox","postcard","posted","poster","posting","postnasal","posture","postwar","pouch","pounce","pouncing","pound","pouring","pout","powdered","powdering","powdery","power","powwow","pox","praising","prance","prancing","pranker","prankish","prankster","prayer","praying","preacher","preaching","preachy","preamble","precinct","precise","precision","precook","precut","predator","predefine","predict","preface","prefix","preflight","preformed","pregame","pregnancy","pregnant","preheated","prelaunch","prelaw","prelude","premiere","premises","premium","prenatal","preoccupy","preorder","prepaid","prepay","preplan","preppy","preschool","prescribe","preseason","preset","preshow","president","presoak","press","presume","presuming","preteen","pretended","pretender","pretense","pretext","pretty","pretzel","prevail","prevalent","prevent","preview","previous","prewar","prewashed","prideful","pried","primal","primarily","primary","primate","primer","primp","princess","print","prior","prism","prison","prissy","pristine","privacy","private","privatize","prize","proactive","probable","probably","probation","probe","probing","probiotic","problem","procedure","process","proclaim","procreate","procurer","prodigal","prodigy","produce","product","profane","profanity","professed","professor","profile","profound","profusely","progeny","prognosis","program","progress","projector","prologue","prolonged","promenade","prominent","promoter","promotion","prompter","promptly","prone","prong","pronounce","pronto","proofing","proofread","proofs","propeller","properly","property","proponent","proposal","propose","props","prorate","protector","protegee","proton","prototype","protozoan","protract","protrude","proud","provable","proved","proven","provided","provider","providing","province","proving","provoke","provoking","provolone","prowess","prowler","prowling","proximity","proxy","prozac","prude","prudishly","prune","pruning","pry","psychic","public","publisher","pucker","pueblo","pug","pull","pulmonary","pulp","pulsate","pulse","pulverize","puma","pumice","pummel","punch","punctual","punctuate","punctured","pungent","punisher","punk","pupil","puppet","puppy","purchase","pureblood","purebred","purely","pureness","purgatory","purge","purging","purifier","purify","purist","puritan","purity","purple","purplish","purposely","purr","purse","pursuable","pursuant","pursuit","purveyor","pushcart","pushchair","pusher","pushiness","pushing","pushover","pushpin","pushup","pushy","putdown","putt","puzzle","puzzling","pyramid","pyromania","python","quack","quadrant","quail","quaintly","quake","quaking","qualified","qualifier","qualify","quality","qualm","quantum","quarrel","quarry","quartered","quarterly","quarters","quartet","quench","query","quicken","quickly","quickness","quicksand","quickstep","quiet","quill","quilt","quintet","quintuple","quirk","quit","quiver","quizzical","quotable","quotation","quote","rabid","race","racing","racism","rack","racoon","radar","radial","radiance","radiantly","radiated","radiation","radiator","radio","radish","raffle","raft","rage","ragged","raging","ragweed","raider","railcar","railing","railroad","railway","raisin","rake","raking","rally","ramble","rambling","ramp","ramrod","ranch","rancidity","random","ranged","ranger","ranging","ranked","ranking","ransack","ranting","rants","rare","rarity","rascal","rash","rasping","ravage","raven","ravine","raving","ravioli","ravishing","reabsorb","reach","reacquire","reaction","reactive","reactor","reaffirm","ream","reanalyze","reappear","reapply","reappoint","reapprove","rearrange","rearview","reason","reassign","reassure","reattach","reawake","rebalance","rebate","rebel","rebirth","reboot","reborn","rebound","rebuff","rebuild","rebuilt","reburial","rebuttal","recall","recant","recapture","recast","recede","recent","recess","recharger","recipient","recital","recite","reckless","reclaim","recliner","reclining","recluse","reclusive","recognize","recoil","recollect","recolor","reconcile","reconfirm","reconvene","recopy","record","recount","recoup","recovery","recreate","rectal","rectangle","rectified","rectify","re
2cycled","recycler","recycling","reemerge","reenact","reenter","reentry","reexamine","referable","referee","reference","refill","refinance","refined","refinery","refining","refinish","reflected","reflector","reflex","reflux","refocus","refold","reforest","reformat","reformed","reformer","reformist","refract","refrain","refreeze","refresh","refried","refueling","refund","refurbish","refurnish","refusal","refuse","refusing","refutable","refute","regain","regalia","regally","reggae","regime","region","register","registrar","registry","regress","regretful","regroup","regular","regulate","regulator","rehab","reheat","rehire","rehydrate","reimburse","reissue","reiterate","rejoice","rejoicing","rejoin","rekindle","relapse","relapsing","relatable","related","relation","relative","relax","relay","relearn","release","relenting","reliable","reliably","reliance","reliant","relic","relieve","relieving","relight","relish","relive","reload","relocate","relock","reluctant","rely","remake","remark","remarry","rematch","remedial","remedy","remember","reminder","remindful","remission","remix","remnant","remodeler","remold","remorse","remote","removable","removal","removed","remover","removing","rename","renderer","rendering","rendition","renegade","renewable","renewably","renewal","renewed","renounce","renovate","renovator","rentable","rental","rented","renter","reoccupy","reoccur","reopen","reorder","repackage","repacking","repaint","repair","repave","repaying","repayment","repeal","repeated","repeater","repent","rephrase","replace","replay","replica","reply","reporter","repose","repossess","repost","repressed","reprimand","reprint","reprise","reproach","reprocess","reproduce","reprogram","reps","reptile","reptilian","repugnant","repulsion","repulsive","repurpose","reputable","reputably","request","require","requisite","reroute","rerun","resale","resample","rescuer","reseal","research","reselect","reseller","resemble","resend","resent","reset","reshape","reshoot","reshuffle","residence","residency","resident","residual","residue","resigned","resilient","resistant","resisting","resize","resolute","resolved","resonant","resonate","resort","resource","respect","resubmit","result","resume","resupply","resurface","resurrect","retail","retainer","retaining","retake","retaliate","retention","rethink","retinal","retired","retiree","retiring","retold","retool","retorted","retouch","retrace","retract","retrain","retread","retreat","retrial","retrieval","retriever","retry","return","retying","retype","reunion","reunite","reusable","reuse","reveal","reveler","revenge","revenue","reverb","revered","reverence","reverend","reversal","reverse","reversing","reversion","revert","revisable","revise","revision","revisit","revivable","revival","reviver","reviving","revocable","revoke","revolt","revolver","revolving","reward","rewash","rewind","rewire","reword","rework","rewrap","rewrite","rhyme","ribbon","ribcage","rice","riches","richly","richness","rickety","ricotta","riddance","ridden","ride","riding","rifling","rift","rigging","rigid","rigor","rimless","rimmed","rind","rink","rinse","rinsing","riot","ripcord","ripeness","ripening","ripping","ripple","rippling","riptide","rise","rising","risk","risotto","ritalin","ritzy","rival","riverbank","riverbed","riverboat","riverside","riveter","riveting","roamer","roaming","roast","robbing","robe","robin","robotics","robust","rockband","rocker","rocket","rockfish","rockiness","rocking","rocklike","rockslide","rockstar","rocky","rogue","roman","romp","rope","roping","roster","rosy","rotten","rotting","rotunda","roulette","rounding","roundish","roundness","roundup","roundworm","routine","routing","rover","roving","royal","rubbed","rubber","rubbing","rubble","rubdown","ruby","ruckus","rudder","rug","ruined","rule","rumble","rumbling","rummage","rumor","runaround","rundown","runner","running","runny","runt","runway","rupture","rural","ruse","rush","rust","rut","sabbath","sabotage","sacrament","sacred","sacrifice","sadden","saddlebag","saddled","saddling","sadly","sadness","safari","safeguard","safehouse","safely","safeness","saffron","saga","sage","sagging","saggy","said","saint","sake","salad","salami","salaried","salary","saline","salon","saloon","salsa","salt","salutary","salute","salvage","salvaging","salvation","same","sample","sampling","sanction","sanctity","sanctuary","sandal","sandbag","sandbank","sandbar","sandblast","sandbox","sanded","sandfish","sanding","sandlot","sandpaper","sandpit","sandstone","sandstorm","sandworm","sandy","sanitary","sanitizer","sank","santa","sapling","sappiness","sappy","
2sarcasm","sarcastic","sardine","sash","sasquatch","sassy","satchel","satiable","satin","satirical","satisfied","satisfy","saturate","saturday","sauciness","saucy","sauna","savage","savanna","saved","savings","savior","savor","saxophone","say","scabbed","scabby","scalded","scalding","scale","scaling","scallion","scallop","scalping","scam","scandal","scanner","scanning","scant","scapegoat","scarce","scarcity","scarecrow","scared","scarf","scarily","scariness","scarring","scary","scavenger","scenic","schedule","schematic","scheme","scheming","schilling","schnapps","scholar","science","scientist","scion","scoff","scolding","scone","scoop","scooter","scope","scorch","scorebook","scorecard","scored","scoreless","scorer","scoring","scorn","scorpion","scotch","scoundrel","scoured","scouring","scouting","scouts","scowling","scrabble","scraggly","scrambled","scrambler","scrap","scratch","scrawny","screen","scribble","scribe","scribing","scrimmage","script","scroll","scrooge","scrounger","scrubbed","scrubber","scruffy","scrunch","scrutiny","scuba","scuff","sculptor","sculpture","scurvy","scuttle","secluded","secluding","seclusion","second","secrecy","secret","sectional","sector","secular","securely","security","sedan","sedate","sedation","sedative","sediment","seduce","seducing","segment","seismic","seizing","seldom","selected","selection","selective","selector","self","seltzer","semantic","semester","semicolon","semifinal","seminar","semisoft","semisweet","senate","senator","send","senior","senorita","sensation","sensitive","sensitize","sensually","sensuous","sepia","september","septic","septum","sequel","sequence","sequester","series","sermon","serotonin","serpent","serrated","serve","service","serving","sesame","sessions","setback","setting","settle","settling","setup","sevenfold","seventeen","seventh","seventy","severity","shabby","shack","
2shaded","shadily","shadiness","shading","shadow","shady","shaft","shakable","shakily","shakiness","shaking","shaky","shale","shallot","shallow","shame","shampoo","shamrock","shank","shanty","shape","shaping","share","sharpener","sharper","sharpie","sharply","sharpness","shawl","sheath","shed","sheep","sheet","shelf","shell","shelter","shelve","shelving","sherry","shield","shifter","shifting","shiftless","shifty","shimmer","shimmy","shindig","shine","shingle","shininess","shining","shiny","ship","shirt","shivering","shock","shone","shoplift","shopper","shopping","shoptalk","shore","shortage","shortcake","shortcut","shorten","shorter","shorthand","shortlist","shortly","shortness","shorts","shortwave","shorty","shout","shove","showbiz","showcase","showdown","shower","showgirl","showing","showman","shown","showoff","showpiece","showplace","showroom","showy","shrank","shrapnel","shredder","shredding","shrewdly","shriek","shrill","shrimp","shrine","shrink","shrivel","shrouded","shrubbery","shrubs","shrug","shrunk","shucking","shudder","shuffle","shuffling","shun","shush","shut","shy","siamese","siberian","sibling","siding","sierra","siesta","sift","sighing","silenced","silencer","silent","silica","silicon","silk","silliness","silly","silo","silt","silver","similarly","simile","simmering","simple","simplify","simply","sincere","sincerity","singer","singing","single","singular","sinister","sinless","sinner","sinuous","sip","siren","sister","sitcom","sitter","sitting","situated","situation","sixfold","sixteen","sixth","sixties","sixtieth","sixtyfold","sizable","sizably","size","sizing","sizzle","sizzling","skater","skating","skedaddle","skeletal","skeleton","skeptic","sketch","skewed","skewer","skid","skied","skier","skies","skiing","skilled","skillet","skillful","skimmed","skimmer","skimming","skimpily","skincare","skinhead","skinless","skinning","skinny","skintight","skipper","skipping","skirmish","skirt","skittle","skydiver","skylight","skyline","skype","skyrocket","skyward","slab","slacked","slacker","slacking","slackness","slacks","slain","slam","slander","slang","slapping","slapstick","slashed","slashing","slate","slather","slaw","sled","sleek","sleep","sleet","sleeve","slept","sliceable","sliced","slicer","slicing","slick","slider","slideshow","sliding","slighted","slighting","slightly","slimness","slimy","slinging","slingshot","slinky","slip","slit","sliver","slobbery","slogan","sloped","sloping","sloppily","sloppy","slot","slouching","slouchy","sludge","slug","slum","slurp","slush","sly","small","smartly","smartness","smasher","smashing","smashup","smell","smelting","smile","smilingly","smirk","smite","smith","smitten","smock","smog","smoked","smokeless","smokiness","smoking","smoky","smolder","smooth","smother","smudge","smudgy","smuggler","smuggling","smugly","smugness","snack","snagged","snaking","snap","snare","snarl","snazzy","sneak","sneer","sneeze","sneezing","snide","sniff","snippet","snipping","snitch","snooper","snooze","snore","snoring","snorkel","snort","snout","snowbird","snowboard","snowbound","snowcap","snowdrift","snowdrop","snowfall","snowfield","snowflake","snowiness","snowless","snowman","snowplow","snowshoe","snowstorm","snowsuit","snowy","snub","snuff","snuggle","snugly","snugness","speak","spearfish","spearhead","spearman","spearmint","species","specimen","specked","speckled","specks","spectacle","spectator","spectrum","speculate","speech","speed","spellbind","speller","spelling","spendable","spender","spending","spent","spew","sphere","spherical","sphinx","spider","spied","spiffy","spill","spilt","spinach","spinal","spindle","spinner","spinning","spinout","spinster","spiny","spiral","spirited","spiritism","spirits","spiritual","splashed","splashing","splashy","splatter","spleen","splendid","splendor","splice","splicing","splinter","splotchy","splurge","spoilage","spoiled","spoiler","spoiling","spoils","spoken","spokesman","sponge","spongy","sponsor","spoof","spookily","spooky","spool","spoon","spore","sporting","sports","sporty","spotless","spotlight","spotted","spotter","spotting","spotty","spousal","spouse","spout","sprain","sprang","sprawl","spray","spree","sprig","spring","sprinkled","sprinkler","sprint","sprite","sprout","spruce","sprung","spry","spud","spur","sputter","spyglass","squabble","squad","squall","squander","squash","squatted","squatter","squatting","squeak","squealer","squealing","squeamish","squeegee","squeeze","squeezing","squid","squiggle","squiggly","squint","squire","squirt","squishier","squishy","stability","stabilize","stable","stack","stadium","staff","stage","staging","stagnant","stagnate","stainable","stained","staining","stainless","stalemate","staleness","stalling","stallion","stamina","stammer","stamp","stand","stank","staple","stapling","starboard","starch","stardom","stardust","starfish","stargazer","staring","stark","starless","starlet","starlight","starlit","starring","starry","starship","starter","starting","startle","startling","startup","starved","starving","stash","state","static","statistic","statue","stature","status","statute","statutory","staunch","stays","steadfast","steadier","steadily","steadying","steam","steed","steep","steerable","steering","steersman","stegosaur","stellar","stem","stench","stencil","step","stereo","sterile","sterility","sterilize","sterling","sternness","
2sternum","stew","stick","stiffen","stiffly","stiffness","stifle","stifling","stillness","stilt","stimulant","stimulate","stimuli","stimulus","stinger","stingily","stinging","stingray","stingy","stinking","stinky","stipend","stipulate","stir","stitch","stock","stoic","stoke","stole","stomp","stonewall","stoneware","stonework","stoning","stony","stood","stooge","stool","stoop","stoplight","stoppable","stoppage","stopped","stopper","stopping","stopwatch","storable","storage","storeroom","storewide","storm","stout","stove","stowaway","stowing","straddle","straggler","strained","strainer","straining","strangely","stranger","strangle","strategic","strategy","stratus","straw","stray","streak","stream","street","strength","strenuous","strep","stress","stretch","strewn","stricken","strict","stride","strife","strike","striking","strive","striving","strobe","strode","stroller","strongbox","strongly","strongman","struck","structure","strudel","struggle","strum","strung","strut","stubbed","stubble","stubbly","stubborn","stucco","stuck","student","studied","studio","study","stuffed","stuffing","stuffy","stumble","stumbling","stump","stung","stunned","stunner","stunning","stunt","stupor","sturdily","sturdy","styling","stylishly","stylist","stylized","stylus","suave","subarctic","subatomic","subdivide","subdued","subduing","subfloor","subgroup","subheader","subject","sublease","sublet","sublevel","sublime","submarine","submerge","submersed","submitter","subpanel","subpar","subplot","subprime","subscribe","subscript","subsector","subside","subsiding","subsidize","subsidy","subsoil","subsonic","substance","subsystem","subtext","subtitle","subtly","subtotal","subtract","subtype","suburb","subway","subwoofer","subzero","succulent","such","suction","sudden","sudoku","suds","sufferer","suffering","suffice","suffix","suffocate","suffrage","sugar","suggest","suing","suitable","suitably","suitcase","suitor","sulfate","sulfide","sulfite","sulfur","sulk","sullen","sulphate","sulphuric","sultry","superbowl","superglue","superhero","superior","superjet","superman","supermom","supernova","supervise","supper","supplier","supply","support","supremacy","supreme","surcharge","surely","sureness","surface","surfacing","surfboard","surfer","surgery","surgical","surging","surname","surpass","surplus","surprise","surreal","surrender","surrogate","surround","survey","survival","survive","surviving","survivor","sushi","suspect","suspend","suspense","sustained","sustainer","swab","swaddling","swagger","swampland","swan","swapping","swarm","sway","swear","sweat","sweep","swell","swept","swerve","swifter","swiftly","swiftness","swimmable","swimmer","swimming","swimsuit","swimwear","swinger","swinging","swipe","swirl","switch","swivel","swizzle","swooned","swoop","swoosh","swore","sworn","swung","sycamore","sympathy","symphonic","symphony","symptom","synapse","syndrome","synergy","synopses","synopsis","synthesis","synthetic","syrup","system","t-shirt","tabasco","tabby","tableful","tables","tablet","tableware","tabloid","tackiness","tacking","tackle","tackling","tacky","taco","tactful","tactical","tactics","tactile","tactless","tadpole","taekwondo","tag","tainted","take","taking","talcum","talisman","tall","talon","tamale","tameness","tamer","tamper","tank","tanned","tannery","tanning","tantrum","tapeless","tapered","tapering","tapestry","tapioca","tapping","taps","tarantula","target","tarmac","tarnish","tarot","tartar","tartly","tartness","task","tassel","taste","tastiness","tasting","tasty","tattered","tattle","tattling","tattoo","taunt","tavern","thank","that","thaw","theater","theatrics","thee","theft","theme","theology","theorize","thermal","thermos","thesaurus","these","thesis","thespian","thicken","thicket","thickness","thieving","thievish","thigh","thimble","thing","think","thinly","thinner","thinness","thinning","thirstily","thirsting","thirsty","thirteen","thirty","thong","thorn","those","thousand","thrash","thread","threaten","threefold","thrift","thrill","thrive","thriving","throat","throbbing","throng","throttle","throwaway","throwback","thrower","throwing","thud","thumb","thumping","thursday","thus","thwarting","thyself","tiara","tibia","tidal","tidbit","tidiness","tidings","tidy","tiger","tighten","tightly","tightness","tightrope","tightwad","tigress","tile","tiling","till","tilt","timid","timing","timothy","tinderbox","tinfoil","tingle","t
2ingling","tingly","tinker","tinkling","tinsel","tinsmith","tint","tinwork","tiny","tipoff","tipped","tipper","tipping","tiptoeing","tiptop","tiring","tissue","trace","tracing","track","traction","tractor","trade","trading","tradition","traffic","tragedy","trailing","trailside","train","traitor","trance","tranquil","transfer","transform","translate","transpire","transport","transpose","trapdoor","trapeze","trapezoid","trapped","trapper","trapping","traps","trash","travel","traverse","travesty","tray","treachery","treading","treadmill","treason","treat","treble","tree","trekker","tremble","trembling","tremor","trench","trend","trespass","triage","trial","triangle","tribesman","tribunal","tribune","tributary","tribute","triceps","trickery","trickily","tricking","trickle","trickster","tricky","tricolor","tricycle","trident","tried","trifle","trifocals","trillion","trilogy","trimester","trimmer","trimming","trimness","trinity","trio","tripod","tripping","triumph","trivial","trodden","trolling","trombone","trophy","tropical","tropics","trouble","troubling","trough","trousers","trout","trowel","truce","truck","truffle","trump","trunks","trustable","trustee","trustful","trusting","trustless","truth","try","tubby","tubeless","tubular","tucking","tuesday","tug","tuition","tulip","tumble","tumbling","tummy","turban","turbine","turbofan","turbojet","turbulent","turf","turkey","turmoil","turret","turtle","tusk","tutor","tutu","tux","tweak","tweed","tweet","tweezers","twelve","twentieth","twenty","twerp","twice","twiddle","twiddling","twig","twilight","twine","twins","twirl","twistable","twisted","twister","twisting","twisty","twitch","twitter","tycoon","tying","tyke","udder","ultimate","ultimatum","ultra","umbilical","umbrella","umpire","unabashed","unable","unadorned","unadvised","unafraid","unaired","unaligned","unaltered","unarmored","unashamed","unaudited","unawake","unaware","unbaked","unbalance","unbeaten","unbend","unbent","unbiased","unbitten","unblended","unblessed","unblock","unbolted","unbounded","unboxed","unbraided","unbridle","unbroken","unbuckled","unbundle","unburned","unbutton","uncanny","uncapped","uncaring","uncertain","unchain","unchanged","uncharted","uncheck","uncivil","unclad","unclaimed","unclamped","unclasp","uncle","unclip","uncloak","unclog","unclothed","uncoated","uncoiled","uncolored","uncombed","uncommon","uncooked","uncork","uncorrupt","uncounted","uncouple","uncouth","uncover","uncross","uncrown","uncrushed","uncured","uncurious","uncurled","uncut","undamaged","undated","undaunted","undead","undecided","undefined","underage","underarm","undercoat","undercook","undercut","underdog","underdone","underfed","underfeed","underfoot","undergo","undergrad","underhand","underline","underling","undermine","undermost","underpaid","underpass","underpay","underrate","undertake","undertone","undertook","undertow","underuse","underwear","underwent","underwire","undesired","undiluted","undivided","undocked","undoing","undone","undrafted","undress","undrilled","undusted","undying","unearned","unearth","unease","uneasily","uneasy","uneatable","uneaten","unedited","unelected","unending","unengaged","unenvied","unequal","unethical","uneven","unexpired","unexposed","unfailing","unfair","unfasten","unfazed","unfeeling","unfiled","unfilled","unfitted","unfitting","unfixable","unfixed","unflawed","unfocused","unfold","unfounded","unframed","unfreeze","unfrosted","unfrozen","unfunded","unglazed","ungloved","unglue","ungodly","ungraded","ungreased","unguarded","unguided","unhappily","unhappy","unharmed","unhealthy","unheard","unhearing","unheated","unhelpful","unhidden","unhinge","unhitched","unholy","unhook","unicorn","unicycle","unified","unifier","uniformed","uniformly","unify","unimpeded","uninjured","uninstall","uninsured","uninvited","union","uniquely","unisexual","unison","unissued","unit","universal","universe","unjustly","unkempt","unkind","unknotted","unknowing","unknown","unlaced","unlatch","unlawful","unleaded","unlearned","unleash","unless","unleveled","unlighted","unlikable","unlimited","unlined","unlinked","unlisted","unlit","unlivable","unloaded","unloader","unlocked","unlocking","unlovable","unloved","unlovely","unloving","unluckily","unlucky","unmade","unmanaged","unmanned","unmapped","unmarked","unmasked","unmasking","unmatched","unmindful","unmixable","unmixed","unmolded","unmoral","unmovable","unmoved","unmoving","unnamable","unnamed","unnatural","unneeded","unnerve","unnerving","unnoticed","unopened","unopposed","unpack","unpadded","unpaid","unpainted","unpaired","unpaved","unpeeled","unpicked","unpiloted","unpinned","unplanned","unplanted","unpleased","unpledged","unplowed","unplug","unpopular","unproven","unquote","unranked","unrated","unraveled","unreached","unread","unreal","unreeling","unrefined","unrelated","unrented","unrest","unretired","unrevised","unrigged","unripe","unrivaled","unroasted","unrobed","unroll","unruffled","unruly","unrushed","unsaddle","unsafe","unsaid","unsalted","unsaved","unsavory","unscathed","unscented","unscrew","unsealed","unseated","unsecured","unseeing","unseemly","unseen","unselect","unselfish","unsent","unsettled","unshackle","unshaken","unshaved","unshaven","unsheathe","unshipped","unsightly","unsigned","unskilled","unsliced","unsmooth","unsnap","unsocial","unsoiled","unsold","unsolved","unsorted","unspoiled","unspoken","unstable","unstaffed","unstamped","unsteady","unsterile","unstirred","unstitch","unstopped","unstuck","unstuffed","unstylish","unsubtle","unsubtly","unsuited","unsure","unsworn","untagged","untainted","untaken","untamed","untangled","untapped","untaxed","unthawed","unthread","untidy","untie","until","untimed","untimely","untitled","untoasted","untold","untouched","untracked","untrained","untreated","untried","untrimmed","untrue","untruth","unturned","untwist","untying","unus
2able","unused","unusual","unvalued","unvaried","unvarying","unveiled","unveiling","unvented","unviable","unvisited","unvocal","unwanted","unwarlike","unwary","unwashed","unwatched","unweave","unwed","unwelcome","unwell","unwieldy","unwilling","unwind","unwired","unwitting","unwomanly","unworldly","unworn","unworried","unworthy","unwound","unwoven","unwrapped","unwritten","unzip","upbeat","upchuck","upcoming","upcountry","update","upfront","upgrade","upheaval","upheld","uphill","uphold","uplifted","uplifting","upload","upon","upper","upright","uprising","upriver","uproar","uproot","upscale","upside","upstage","upstairs","upstart","upstate","upstream","upstroke","upswing","uptake","uptight","uptown","upturned","upward","upwind","uranium","urban","urchin","urethane","urgency","urgent","urging","urologist","urology","usable","usage","useable","used","uselessly","user","usher","usual","utensil","utility","utilize","utmost","utopia","utter","vacancy","vacant","vacate","vacation","vagabond","vagrancy","vagrantly","vaguely","vagueness","valiant","valid","valium","valley","valuables","value","vanilla","vanish","vanity","vanquish","vantage","vaporizer","variable","variably","varied","variety","various","varmint","varnish","varsity","varying","vascular","vaseline","vastly","vastness","veal","vegan","veggie","vehicular","velcro","velocity","velvet","vendetta","vending","vendor","veneering","vengeful","venomous","ventricle","venture","venue","venus","verbalize","verbally","verbose","verdict","verify","verse","version","versus","vertebrae","vertical","vertigo","very","vessel","vest","veteran","veto","vexingly","viability","viable","vibes","vice","vicinity","victory","video","viewable","viewer","viewing","viewless","viewpoint","vigorous","village","villain","vindicate","vineyard","vintage","violate","violation","violator","violet","violin","viper","viral","virtual","virtuous","virus","visa","viscosity","viscous","viselike","visible","visibly","vision","visiting","visitor","visor","vista","vitality","vitalize","vitally","vitamins","vivacious","vividly","vividness","vixen","vocalist","vocalize","vocally","vocation","voice","voicing","void","volatile","volley","voltage","volumes","voter","voting","voucher","vowed","vowel","voyage","wackiness","wad","wafer","waffle","waged","wager","wages","waggle","wagon","wake","waking","walk","walmart","walnut","walrus","waltz","wand","wannabe","wanted","wanting","wasabi","washable","washbasin","washboard","washbowl","washcloth","washday","washed","washer","washhouse","washing","washout","washroom","washstand","washtub","wasp","wasting","watch","water","waviness","waving","wavy","whacking","whacky","wham","wharf","wheat","whenever","whiff","whimsical","whinny","whiny","whisking","whoever","whole","whomever","whoopee","whooping","whoops","why","wick","widely","widen","widget","widow","width","wieldable","wielder","wife","wifi","wikipedia","wildcard","wildcat","wilder","wildfire","wildfowl","wildland","wildlife","wildly","wildness","willed","willfully","willing","willow","willpower","wilt","wimp","wince","wincing","wind","wing","winking","winner","winnings","winter","wipe","wired","wireless","wiring","wiry","wisdom","wise","wish","wisplike","wispy","wistful","wizard","wobble","wobbling","wobbly","wok","wolf","wolverine","womanhood","womankind","womanless","womanlike","womanly","womb","woof","wooing","wool","woozy","word","work","worried","worrier","worrisome","worry","worsening","worshiper","worst","wound","woven","wow","wrangle","wrath","wreath","wreckage","wrecker","wrecking","wrench","wriggle","wriggly","wrinkle","wrinkly","wrist","writing","written","wrongdoer","wronged","wrongful","wrongly","wrongness","wrought","xbox","xerox","yahoo","yam","yanking","yapping","yard","yarn","yeah","yearbook","yearling","yearly","yearning","yeast","yelling","yelp","yen","yesterday","yiddish","yield","yin","yippee","yo-yo","yodel","yoga","yogurt","yonder","yoyo","yummy","zap","zealous","zebra","zen","zeppelin","zero","zestfully","zesty","zigzagged","zipfile","zipping","zippy","zips","zit","zodiac","zombie","zone","zoning","zookeeper","zoologist","zoology","zoom"]},"./node_modules/@ton/crypto/dist/primitives/getSecureRandom.js"(e,t,r){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.getSecureRandomNumber=t.getSecureRandomWords=t.getSecureRandomBytes=void 0;const n=r("./node_modules/@ton/crypto-primitives/dist/browser.js");async function o(e){return(0,n.getSecureRandomBytes)(e)}t.getSecureRandomBytes=o,t.getSecureRandomWords=async function e(t){return e(t)},t.getSecureRandomNumber=async function(e,t){let r=t-e;var n=Math.ceil(Math.log2(r));if(n>53)throw new Error("Range is too large");for(var s=Math.ceil(n/8),i=Math.pow(2,n)-1;;){let t=await o(n),c=8*(s-1),l=0;for(var a=0;a<s;a++)l+=t[a]*Math.pow(2,c),c-=8;if(l&=i,!(l>=r))return e+l}}},"./node_modules/@ton/crypto/dist/primitives/hmac_sha512.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer,o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.hmac_sha512=t.hmac_sha512_fallback=void 0;const s=o(r("./node_modules/jssha/dist/sha.js")),i=r("./node_modules/@ton/crypto-primitives/dist/browser.js");t.hmac_sha512_fallback=async function(e,t){let r="string"==typeof e?n.from(e,"utf-8"):e,o="string"==typeof t?n.from(t,"utf-8"):t;const i=new s.default("SHA-512","HEX",{hmacKey:{value:r.toString("hex"),format:"HEX"}});i.update(o.toString("hex"));const a=i.getHash("HEX");return n.from(a,"hex")},t.hmac_sha512=function(e,t){return(0,i.hmac_sha512)(e,t)}},"./node_modules/@ton/crypto/dist/primitives/nacl.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer,o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.openBox=t.sealBox=t.signVerify=t.sign=t.keyPairFromSeed=t.keyPairFromSecretKey=void 0;const s=o(r("./node_modules/tweetnacl/nacl-fast.js"));t.keyPairFromSecretKey=function(e){let t=s.default.sign.keyPair.fromSecretKey(new Uint8Array(e));return{publicKey:n.from(t.publicKey),secretKey:n.from(t.secretKey)}},t.keyPairFromSeed=function(e){let t=s.default.sign.keyPair.fromSeed(new Uint8Array(e));return{publicKey:n.from(t.publicKey),secretKey:n.from(t.secretKey)}},t.sign=function(e,t){return n.from(s.default.sign.detached(new Uint8Array(e),new Uint8Array(t)))},t.signVerify=function(e,t,r){return s.default.sign.detached.verify(new Uint8Array(e),new Uint8Array(t),new Uint8Array(r))},t.sealBox=function(e,t,r){return n.from(s.default.secretbox(e,t,r))},t.openBox=function(e,t,r){let o=s.default.secretbox.open(e,t,r);return o?n.from(o):null}},"./node_modules/@ton/crypto/dist/primitives/pbkdf2_sha512.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pbkdf2_sha512=void 0;const n=r("./node_modules/@ton/crypto-primitives/dist/browser.js");t.pbkdf2_sha512=function(e,t,r,o){return(0,n.pbkdf2_sha512)(e,t,r,o)}},"./node_modules/@ton/crypto/dist/primitives/sha256.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer,o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.sha256=t.sha256_fallback=t.sha256_sync=void 0;const s=o(r("./node_modules/jssha/dist/sha.js")),i=r("./node_modules/@ton/crypto-primitives/dist/browser.js");function a(e){let t;t="string"==typeof e?n.from(e,"utf-8").toString("hex"):e.toString("hex");let r=new s.default("SHA-256","HEX");r.update(t);let o=r.getHash("HEX");return n.from(o,"hex")}t.sha256_sync=a,t.sha256_fallback=async function(e){return a(e)},t.sha256=function(e){return(0,i.sha256)(e)}},"./node_modules/@ton/crypto/dist/primitives/sha512.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer,o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.sha512=t.sha512_fallback=t.sha512_sync=void 0;const s=o(r("./node_modules/jssha/dist/sha.js")),i=r("./node_modules/@ton/crypto-primitives/dist/browser.js");function a(e){let t;t="string"==typeof e?n.from(e,"utf-8").toString("hex"):e.toString("hex");let r=new s.default("SHA-512","HEX");r.update(t);let o=r.getHash("HEX");return n.from(o,"hex")}t.sha512_sync=a,t.sha512_fallback=async function(e){return a(e)},t.sha512=async function(e){return(0,i.sha512)(e)}},"./node_modules/@ton/crypto/dist/utils/binary.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;function o(e,t,r){for(;e.length<r;)e=t+e;return e}
2Object.defineProperty(t,"__esModule",{value:!0}),t.bitsToBytes=t.bytesToBits=t.lpad=void 0,t.lpad=o,t.bytesToBits=function(e){let t="";for(let r=0;r<e.length;r++){t+=o(e.at(r).toString(2),"0",8)}return t},t.bitsToBytes=function(e){if(e.length%8!=0)throw Error("Uneven bits");let t=[];for(;e.length>0;)t.push(parseInt(e.slice(0,8),2)),e=e.slice(8);return n.from(t)}},"./node_modules/@ton/ton/dist/client/TonClient.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.TonClient=void 0;const o=r("./node_modules/@ton/ton/dist/client/api/HttpApi.js"),s=r("./node_modules/@ton/core/dist/index.js");function i(e){const t=e["@type"];switch(t){case"tvm.list":case"tvm.tuple":return e.elements.map(i);case"tvm.cell":case"tvm.slice":return s.Cell.fromBoc(n.from(e.bytes,"base64"))[0];case"tvm.stackEntryCell":return i(e.cell);case"tvm.stackEntrySlice":return i(e.slice);case"tvm.stackEntryTuple":return i(e.tuple);case"tvm.stackEntryList":return i(e.list);case"tvm.stackEntryNumber":return i(e.number);case"tvm.numberDecimal":return BigInt(e.number);default:throw Error("Unsupported item type: "+t)}}function a(e){if("num"===e[0]){let t=e[1];return t.startsWith("-")?{type:"int",value:-BigInt(t.slice(1))}:{type:"int",value:BigInt(t)}}if("null"===e[0])return{type:"null"};if("cell"===e[0])return{type:"cell",cell:s.Cell.fromBoc(n.from(e[1].bytes,"base64"))[0]};if("slice"===e[0])return{type:"slice",cell:s.Cell.fromBoc(n.from(e[1].bytes,"base64"))[0]};if("builder"===e[0])return{type:"builder",cell:s.Cell.fromBoc(n.from(e[1].bytes,"base64"))[0]};if("tuple"===e[0]||"list"===e[0])return 0===e[1].elements.length?{type:"null"}:{type:"tuple",items:e[1].elements.map(i)};throw Error("Unsupported stack item type: "+e[0])}function c(e){let t=[];for(let r of e)t.push(a(r));return new s.TupleReader(t)}function l(e,t,r){return{async getState(){let r,o=await e.getContractState(t),s=o.balance,i=o.lastTransaction?{lt:BigInt(o.lastTransaction.lt),hash:n.from(o.lastTransaction.hash,"base64")}:null,a=null;if("active"===o.state)r={type:"active",code:o.code?o.code:null,data:o.data?o.data:null};else if("uninitialized"===o.state)r={type:"uninit"};else{if("frozen"!==o.state)throw Error("Unsupported state");r={type:"frozen",stateHash:n.alloc(0)}}if(o.extra_currencies&&o.extra_currencies.length>0){a={};for(let e of o.extra_currencies)a[e.id]=BigInt(e.amount)}return{balance:s,extracurrency:a,last:i,state:r}},async get(r,n){if("string"!=typeof r)throw new Error("Method name must be a string for TonClient provider");return{stack:(await e.runMethod(t,r,n)).stack}},async external(n){let o=null;r&&!await e.isContractDeployed(t)&&(o=r);const i=(0,s.external)({to:t,init:o,body:n});let a=(0,s.beginCell)().store((0,s.storeMessage)(i)).endCell().toBoc();await e.sendFile(a)},async internal(n,o){let i=null;r&&!await e.isContractDeployed(t)&&(i=r);let a,c=!0;null!==o.bounce&&void 0!==o.bounce&&(c=o.bounce),a="string"==typeof o.value?(0,s.toNano)(o.value):o.value;let l=null;"string"==typeof o.body?l=(0,s.comment)(o.body):o.body&&(l=o.body),await n.send({to:t,value:a,bounce:c,sendMode:o.sendMode,extracurrency:o.extracurrency,init:i,body:l})},open:t=>(0,s.openContract)(t,(t=>l(e,t.address,t.init??null))),getTransactions:(t,r,n,o)=>e.getTransactions(t,{limit:o??100,lt:r.toString(),hash:n.toString("base64"),inclusive:!0})}}t.TonClient=class{constructor(e){this.parameters={endpoint:e.endpoint},this.api=new o.HttpApi(this.parameters.endpoint,{timeout:e.timeout,apiKey:e.apiKey,adapter:e.httpAdapter})}async getBalance(e){return(await this.getContractState(e)).balance}async runMethod(e,t,r=[]){let n=await this.api.callGetMethod(e,t,r);if(0!==n.exit_code)throw Error("Unable to execute get method. Got exit_code: "+n.exit_code);return{gas_used:n.gas_used,stack:c(n.stack)}}async callGetMethod(e,t,r=[]){return this.runMethod(e,t,r)}async runMethodWithError(e,t,r=[]){let n=await this.api.callGetMethod(e,t,r);return{gas_used:n.gas_used,stack:c(n.stack),exit_code:n.exit_code}}async callGetMethodWithError(e,t,r=[]){return this.runMethodWithError(e,t,r)}async getTransactions(e,t){let r=await this.api.getTransactions(e,t),o=[];for(let e of r)o.push((0,s.loadTransaction)(s.Cell.fromBoc(n.from(e.data,"base64"))[0].beginParse()));return o}async getTransaction(e,t,r){let o=await this.api.getTransaction(e,t,r);return o?(0,s.loadTransaction)(s.Cell.fromBoc(n.from(o.data,"base64"))[0].beginParse()):null}async tryLocateResultTx(e,t,r){let n=await this.api.tryLocateResultTx(e,t,r);return(0,s.loadTransaction)(s.Cell.fromBase64(n.data).beginParse())}async tryLocateSourceTx(e,t,r){let n=await this.api.tryLocateSourceTx(e,t,r);return(0,s.loadTransaction)(s.Cell.fromBase64(n.data).beginParse())}async getMasterchainInfo(){let e=await this.api.getMasterchainInfo();return{workchain:e.init.workchain,shard:e.last.shard,initSeqno:e.init.seqno,latestSeqno:e.last.seqno}}async getWorkchainShards(e){return(await this.api.getShards(e)).map((e=>({workchain:e.workchain,shard:e.shard,seqno:e.seqno})))}async getShardTransactions(e,t,r){let n=await this.api.getBlockTransactions(e,t,r);if(n.incomplete)throw Error("Unsupported");return n.transactions.map((e=>({account:s.Address.parseRaw(e.account),lt:e.lt,hash:e.hash})))}async sendMessage(e){const t=(0,s.beginCell)().store((0,s.storeMessage)(e)).endCell().toBoc();await this.api.sendBoc(t)}async sendFile(e){await this.api.sendBoc(e)}async estimateExternalMessageFee(e,t){return await this.api.estimateFee(e,{body:t.body,initCode:t.initCode,initData:t.initData,ignoreSignature:t.ignoreSignature})}async sendExternalMessage(e,t){if(await this.isContractDeployed(e.address)||!e.init){const r=(0,s.external)({to:e.address,body:t});await this.sendMessage(r)}else{const r=(0,s.external)({to:e.address,init:e.init,body:t});await this.sendMessage(r)}}async isContractDeployed(e){return"active"===(await this.getContractState(e)).state}async getContractState(e){let t=await this.api.getAddressInformation(e),r=BigInt(t.balance),o=t.state;return{balance:r,extra_currencies:t.extra_currencies,state:o,code:""!==t.code?n.from(t.code,"base64"):null,data:""!==t.data?n.from(t.data,"base64"):null,lastTransaction:"0"!==t.last_transaction_id.lt?{lt:t.last_transaction_id.lt,hash:t.last_transaction_id.hash}:null,blockId:{workchain:t.block_id.workchain,shard:t.block_id.shard,seqno:t.block_id.seqno},timestampt:t.sync_utime}}open(e){return(0,s.openContract)(e,(e=>l(this,e.address,e.init)))}provider(e,t){return l(this,e,t??null)}}},"./node_modules/@ton/ton/dist/client/TonClient4.js"(e,t,r){"use strict";var n,o,s,i,a=r("./node_modules/buffer/index.js").Buffer,c=this&&this.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},l=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}
2,u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TonClient4=void 0;const d=u(r("./node_modules/axios/dist/browser/axios.cjs")),h=r("./node_modules/@ton/core/dist/index.js"),p=r("./node_modules/@ton/ton/dist/utils/toUrlSafe.js"),f=r("./node_modules/zod/index.cjs");function g(e,t,r,n){return{async getState(){let n=t;if(null===n){n=(await e.getLastBlock()).last.seqno}let o,s=await e.getAccount(n,r),i=s.account.last?{lt:BigInt(s.account.last.lt),hash:a.from(s.account.last.hash,"base64")}:null;if("active"===s.account.state.type)o={type:"active",code:s.account.state.code?a.from(s.account.state.code,"base64"):null,data:s.account.state.data?a.from(s.account.state.data,"base64"):null};else if("uninit"===s.account.state.type)o={type:"uninit"};else{if("frozen"!==s.account.state.type)throw Error("Unsupported state");o={type:"frozen",stateHash:a.from(s.account.state.stateHash,"base64")}}let c=null;if(s.account.balance.currencies){c={};let e=s.account.balance.currencies;for(let[t,r]of Object.entries(e))c[Number(t)]=BigInt(r)}return{balance:BigInt(s.account.balance.coins),extracurrency:c,last:i,state:o}},async get(n,o){if("string"!=typeof n)throw new Error("Method name must be a string for TonClient4 provider");let s=t;if(null===s){s=(await e.getLastBlock()).last.seqno}let i=await e.runMethod(s,r,n,o);if(0!==i.exitCode&&1!==i.exitCode)throw Error("Exit code: "+i.exitCode);return{stack:new h.TupleReader(i.result)}},async external(t){let o=await e.getLastBlock(),s=null;n&&"active"!==(await e.getAccountLite(o.last.seqno,r)).account.state.type&&(s=n);const i=(0,h.external)({to:r,init:s,body:t});let a=(0,h.beginCell)().store((0,h.storeMessage)(i)).endCell().toBoc();await e.sendMessage(a)},async internal(t,o){let s=await e.getLastBlock(),i=null;n&&"active"!==(await e.getAccountLite(s.last.seqno,r)).account.state.type&&(i=n);let a,c=!0;null!==o.bounce&&void 0!==o.bounce&&(c=o.bounce),a="string"==typeof o.value?(0,h.toNano)(o.value):o.value;let l=null;"string"==typeof o.body?l=(0,h.comment)(o.body):o.body&&(l=o.body),await t.send({to:r,value:a,extracurrency:o.extracurrency,bounce:c,sendMode:o.sendMode,init:i,body:l})},open:r=>(0,h.openContract)(r,(r=>g(e,t,r.address,r.init??null))),async getTransactions(t,r,n,o){const s="number"==typeof o;if(s&&o<=0)return[];let i=[];do{const o=await e.getAccountTransactions(t,r,n),s=o[0].tx,[a,c]=[s.lt,s.hash()];if(i.length>0&&a===r&&c.equals(n)&&o.shift(),0===o.length)break;const l=o[o.length-1].tx,[u,d]=[l.lt,l.hash()];if(u===r&&d.equals(n))break;i.push(...o.map((e=>e.tx))),r=u,n=d}while(s&&i.length<o);return s&&(i=i.slice(0,o)),i}}}t.TonClient4=class{constructor(e){n.set(this,void 0),o.set(this,void 0),s.set(this,void 0),i.set(this,void 0),c(this,i,d.default.create(),"f"),c(this,n,e.endpoint,"f"),c(this,o,e.timeout||5e3,"f"),c(this,s,e.httpAdapter,"f"),e.requestInterceptor&&l(this,i,"f").interceptors.request.use(e.requestInterceptor)}async getLastBlock(){let e=await l(this,i,"f").get(l(this,n,"f")+"/block/latest",{adapter:l(this,s,"f"),timeout:l(this,o,"f")}),t=m.safeParse(e.data);if(!t.success)throw Error("Mailformed response: "+t.error.format()._errors.join(", "));return t.data}async getBlock(e){let t=await l(this,i,"f").get(l(this,n,"f")+"/block/"+e,{adapter:l(this,s,"f"),timeout:l(this,o,"f")}),r=y.safeParse(t.data);if(!r.success)throw Error("Mailformed response");if(!r.data.exist)throw Error("Block is out of scope");return r.data.block}async getBlockByUtime(e){let t=await l(this,i,"f").get(l(this,n,"f")+"/block/utime/"+e,{adapter:l(this,s,"f"),timeout:l(this,o,"f")}),r=y.safeParse(t.data);if(!r.success)throw Error("Mailformed response");if(!r.data.exist)throw Error("Block is out of scope");return r.data.block}async getAccount(e,t){let r=await l(this,i,"f").get(l(this,n,"f")+"/block/"+e+"/"+t.toString({urlSafe:!0}),{adapter:l(this,s,"f"),timeout:l(this,o,"f")}),a=w.safeParse(r.data);if(!a.success)throw Error("Mailformed response");return a.data}async getAccountLite(e,t){let r=await l(this,i,"f").get(l(this,n,"f")+"/block/"+e+"/"+t.toString({urlSafe:!0})+"/lite",{adapter:l(this,s,"f"),timeout:l(this,o,"f")}),a=v.safeParse(r.data);if(!a.success)throw Error("Mailformed response");return a.data}async isContractDeployed(e,t){return"active"===(await this.getAccountLite(e,t)).account.state.type}async isAccountChanged(e,t,r){let a=await l(this,i,"f").get(l(this,n,"f")+"/block/"+e+"/"+t.toString({urlSafe:!0})+"/changed/"+r.toString(10),{adapter:l(this,s,"f"),timeout:l(this,o,"f")}),c=A.safeParse(a.data);if(!c.success)throw Error("Mailformed response");return c.data}async getAccountTransactions(e,t,r){let c=await l(this,i,"f").get(l(this,n,"f")+"/account/"+e.toString({urlSafe:!0})+"/tx/"+t.toString(10)+"/"+(0,p.toUrlSafe)(r.toString("base64")),{adapter:l(this,s,"f"),timeout:l(this,o,"f")}),u=k.safeParse(c.data);if(!u.success)throw Error("Mailformed response");let d=u.data,f=[],g=h.Cell.fromBoc(a.from(d.boc,"base64"));for(let e=0;e<d.blocks.length;e++)f.push({block:d.blocks[e],tx:(0,h.loadTransaction)(g[e].beginParse())});return f}async getAccountTransactionsParsed(e,t,r,a=20){let c=await l(this,i,"f").get(l(this,n,"f")+"/account/"+e.toString({urlSafe:!0})+"/tx/parsed/"+t.toString(10)+"/"+(0,p.toUrlSafe)(r.toString("base64")),{adapter:l(this,s,"f"),timeout:l(this,o,"f"),params:{count:a}}),u=U.safeParse(c.data);if(!u.success)throw Error("Mailformed response");return u.data}async getConfig(e,t){let r="";t&&t.length>0&&(r="/"+[...t].sort().join(","));let a=await l(this,i,"f").get(l(this,n,"f")+"/block/"+e+"/config"+r,{adapter:l(this,s,"f"),timeout:l(this,o,"f")}),c=P.safeParse(a.data);if(!c.success)throw Error("Mailformed response");return c.data}async runMethod(e,t,r,c){let u=c&&c.length>0?"/"+(0,p.toUrlSafe)((0,h.serializeTuple)(c).toBoc({idx:!1,crc32
2:!1}).toString("base64")):"",d=l(this,n,"f")+"/block/"+e+"/"+t.toString({urlSafe:!0})+"/run/"+encodeURIComponent(r)+u,f=await l(this,i,"f").get(d,{adapter:l(this,s,"f"),timeout:l(this,o,"f")}),g=T.safeParse(f.data);if(!g.success)throw Error("Mailformed response");let m=g.data.resultRaw?(0,h.parseTuple)(h.Cell.fromBoc(a.from(g.data.resultRaw,"base64"))[0]):[];return{exitCode:g.data.exitCode,result:m,resultRaw:g.data.resultRaw,block:g.data.block,shardBlock:g.data.shardBlock,reader:new h.TupleReader(m)}}async sendMessage(e){let t=await l(this,i,"f").post(l(this,n,"f")+"/send",{boc:e.toString("base64")},{adapter:l(this,s,"f"),timeout:l(this,o,"f")});if(!E.safeParse(t.data).success)throw Error("Mailformed response");return{status:t.data.status}}open(e){return(0,h.openContract)(e,(e=>g(this,null,e.address,e.init)))}openAt(e,t){return(0,h.openContract)(t,(t=>g(this,e,t.address,t.init)))}provider(e,t){return g(this,null,e,t??null)}providerAt(e,t,r){return g(this,e,t,r??null)}},n=new WeakMap,o=new WeakMap,s=new WeakMap,i=new WeakMap;const m=f.z.object({last:f.z.object({seqno:f.z.number(),shard:f.z.string(),workchain:f.z.number(),fileHash:f.z.string(),rootHash:f.z.string()}),init:f.z.object({fileHash:f.z.string(),rootHash:f.z.string()}),stateRootHash:f.z.string(),now:f.z.number()}),y=f.z.union([f.z.object({exist:f.z.literal(!1)}),f.z.object({exist:f.z.literal(!0),block:f.z.object({shards:f.z.array(f.z.object({workchain:f.z.number(),seqno:f.z.number(),shard:f.z.string(),rootHash:f.z.string(),fileHash:f.z.string(),transactions:f.z.array(f.z.object({account:f.z.string(),hash:f.z.string(),lt:f.z.string()}))}))})})]),b=f.z.object({lastPaid:f.z.number(),duePayment:f.z.union([f.z.null(),f.z.string()]),used:f.z.object({bits:f.z.number(),cells:f.z.number(),publicCells:f.z.number().optional()})}),w=f.z.object({account:f.z.object({state:f.z.union([f.z.object({type:f.z.literal("uninit")}),f.z.object({type:f.z.literal("active"),code:f.z.union([f.z.string(),f.z.null()]),data:f.z.union([f.z.string(),f.z.null()])}),f.z.object({type:f.z.literal("frozen"),stateHash:f.z.string()})]),balance:f.z.object({coins:f.z.string(),currencies:f.z.record(f.z.string(),f.z.string())}),last:f.z.union([f.z.null(),f.z.object({lt:f.z.string(),hash:f.z.string()})]),storageStat:f.z.union([f.z.null(),b])}),block:f.z.object({workchain:f.z.number(),seqno:f.z.number(),shard:f.z.string(),rootHash:f.z.string(),fileHash:f.z.string()})}),v=f.z.object({account:f.z.object({state:f.z.union([f.z.object({type:f.z.literal("uninit")}),f.z.object({type:f.z.literal("active"),codeHash:f.z.string(),dataHash:f.z.string()}),f.z.object({type:f.z.literal("frozen"),stateHash:f.z.string()})]),balance:f.z.object({coins:f.z.string(),currencies:f.z.record(f.z.string(),f.z.string())}),last:f.z.union([f.z.null(),f.z.object({lt:f.z.string(),hash:f.z.string()})]),storageStat:f.z.union([f.z.null(),b])})}),A=f.z.object({changed:f.z.boolean(),block:f.z.object({workchain:f.z.number(),seqno:f.z.number(),shard:f.z.string(),rootHash:f.z.string(),fileHash:f.z.string()})}),T=f.z.object({exitCode:f.z.number(),resultRaw:f.z.union([f.z.string(),f.z.null()]),block:f.z.object({workchain:f.z.number(),seqno:f.z.number(),shard:f.z.string(),rootHash:f.z.string(),fileHash:f.z.string()}),shardBlock:f.z.object({workchain:f.z.number(),seqno:f.z.number(),shard:f.z.string(),rootHash:f.z.string(),fileHash:f.z.string()})}),P=f.z.object({config:f.z.object({cell:f.z.string(),address:f.z.string(),globalBalance:f.z.object({coins:f.z.string()})})}),E=f.z.object({status:f.z.number()}),C=f.z.array(f.z.object({workchain:f.z.number(),seqno:f.z.number(),shard:f.z.string(),rootHash:f.z.string(),fileHash:f.z.string()})),k=f.z.object({blocks:C,boc:f.z.string()}),_=f.z.object({bits:f.z.number(),data:f.z.string()}),I=f.z.union([f.z.object({type:f.z.literal("internal"),value:f.z.string(),dest:f.z.string(),src:f.z.string(),bounced:f.z.boolean(),bounce:f.z.boolean(),ihrDisabled:f.z.boolean(),createdAt:f.z.number(),createdLt:f.z.string(),fwdFee:f.z.string(),ihrFee:f.z.string()}),f.z.object({type:f.z.literal("external-in"),dest:f.z.string(),src:f.z.union([_,f.z.null()]),importFee:f.z.string()}),f.z.object({type:f.z.literal("external-out"),dest:f.z.union([_,f.z.null()])})]),S=f.z.object({splitDepth:f.z.union([f.z.number(),f.z.null()]),code:f.z.union([f.z.string(),f.z.null()]),data:f.z.union([f.z.string(),f.z.null()]),special:f.z.union([f.z.object({tick:f.z.boolean(),tock:f.z.boolean()}),f.z.null()])}),x=f.z.object({body:f.z.string(),info:I,init:f.z.union([S,f.z.null()])}),B=f.z.union([f.z.literal("uninitialized"),f.z.literal("frozen"),f.z.literal("active"),f.z.literal("non-existing")]),O=f.z.union([f.z.object({type:f.z.literal("comment"),comment:f.z.string()}),f.z.object({type:f.z.literal("payload"),cell:f.z.string()})]),M=f.z.union([f.z.object({kind:f.z.literal("ton"),amount:f.z.string()}),f.z.object({kind:f.z.literal("token"),amount:f.z.string()})]),W=f.z.union([f.z.literal("jetton::excesses"),f.z.literal("jetton::transfer"),f.z.literal("jetton::transfer_notification"),f.z.literal("deposit"),f.z.literal("deposit::ok"),f.z.literal("withdraw"),f.z.literal("withdraw::all"),f.z.literal("withdraw::delayed"),f.z.literal("withdraw::ok"),f.z.literal("airdrop")]),j=f.z.object({type:W,options:f.z.optional(f.z.record(f.z.string()))}),R=f.z.object({address:f.z.string(),comment:f.z.optional(f.z.string()),items:f.z.array(M),op:f.z.optional(j)}),N=f.z.object({address:f.z.string(),lt:f.z.string(),hash:f.z.string(),prevTransaction:f.z.object({lt:f.z.string(),hash:f.z.string()}),time:f.z.number(),outMessagesCount:f.z.number(),oldStatus:B,newStatus:B,fees:f.z.string(),update:f.z.object({oldHash:f.z.string(),newHash:f.z.string()}),inMessage:f.z.union([x,f.z.null()]),outMessages:f.z.array(x),parsed:f.z.object({seqno:f.z.union([f.z.number(),f.z.null()]),body:f.z.union([O,f.z.null()]),status:f.z.union([f.z.literal("success"),f.z.literal("failed"),f.z.literal("pending")]),dest:f.z.union([f.z.string(),f.z.null()]),kind:f.z.union([f.z.literal("out"),f.z.literal("in")]),amount:f.z.string(),resolvedAddress:f.z.string(),bounced:f.z.boolean(),mentioned:f.z.array(f.z.string())}),operation:R}),U=f.z.object({blocks:C,transactions:f.z.array(N)})},"./node_modules/@ton/ton/dist/client/api/HttpApi.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer,o=this&&this.__importDefault||function(e){return e&&e.__esMo
2dule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HttpApi=void 0;const s=r("./node_modules/@ton/ton/dist/client/api/TonCache.js"),i=o(r("./node_modules/dataloader/index.js")),a=o(r("./node_modules/axios/dist/browser/axios.cjs")),c=r("./node_modules/zod/index.cjs"),l=r("./node_modules/@ton/ton/package.json").rE,u=c.z.object({"@type":c.z.literal("ton.blockIdExt"),workchain:c.z.number(),shard:c.z.string(),seqno:c.z.number(),root_hash:c.z.string(),file_hash:c.z.string()}),d=c.z.object({balance:c.z.union([c.z.number(),c.z.string()]),extra_currencies:c.z.optional(c.z.array(c.z.object({"@type":c.z.literal("extraCurrency"),id:c.z.number(),amount:c.z.string()}))),state:c.z.union([c.z.literal("active"),c.z.literal("uninitialized"),c.z.literal("frozen")]),data:c.z.string(),code:c.z.string(),last_transaction_id:c.z.object({"@type":c.z.literal("internal.transactionId"),lt:c.z.string(),hash:c.z.string()}),block_id:u,sync_utime:c.z.number()}),h=c.z.object({"@type":c.z.literal("ok")}),p=c.z.object({"@type":c.z.literal("query.fees"),source_fees:c.z.object({"@type":c.z.literal("fees"),in_fwd_fee:c.z.number(),storage_fee:c.z.number(),gas_fee:c.z.number(),fwd_fee:c.z.number()})}),f=c.z.object({gas_used:c.z.number(),exit_code:c.z.number(),stack:c.z.array(c.z.unknown())}),g=c.z.union([c.z.object({"@type":c.z.literal("msg.dataRaw"),body:c.z.string()}),c.z.object({"@type":c.z.literal("msg.dataText"),text:c.z.string()}),c.z.object({"@type":c.z.literal("msg.dataDecryptedText"),text:c.z.string()}),c.z.object({"@type":c.z.literal("msg.dataEncryptedText"),text:c.z.string()})]),m=c.z.object({source:c.z.string(),destination:c.z.string(),value:c.z.string(),fwd_fee:c.z.string(),ihr_fee:c.z.string(),created_lt:c.z.string(),body_hash:c.z.string(),msg_data:g,message:c.z.string().optional()}),y=c.z.object({data:c.z.string(),utime:c.z.number(),transaction_id:c.z.object({lt:c.z.string(),hash:c.z.string()}),fee:c.z.string(),storage_fee:c.z.string(),other_fee:c.z.string(),in_msg:c.z.union([c.z.undefined(),m]),out_msgs:c.z.array(m)}),b=c.z.array(y),w=c.z.object({state_root_hash:c.z.string(),last:u,init:u}),v=c.z.object({shards:c.z.array(u)}),A=c.z.object({"@type":c.z.literal("blocks.shortTxId"),mode:c.z.number(),account:c.z.string(),lt:c.z.string(),hash:c.z.string()}),T=c.z.object({id:u,req_count:c.z.number(),incomplete:c.z.boolean(),transactions:c.z.array(A)});class P{constructor(e,t,r,n){this.namespace=e,this.cache=t,this.codec=r,this.keyEncoder=n}async get(e){let t=await this.cache.get(this.namespace,this.keyEncoder(e));if(t){let e=this.codec.safeParse(JSON.parse(t));if(e.success)return e.data}return null}async set(e,t){null!==t?await this.cache.set(this.namespace,this.keyEncoder(e),JSON.stringify(t)):await this.cache.set(this.namespace,this.keyEncoder(e),null)}}function E(e){let t=[];for(let r of e)if("int"===r.type)t.push(["num",r.value.toString()]);else if("cell"===r.type)t.push(["tvm.Cell",r.cell.toBoc().toString("base64")]);else if("slice"===r.type)t.push(["tvm.Slice",r.cell.toBoc().toString("base64")]);else{if("builder"!==r.type)throw Error("Unsupported stack item type: "+r.type);t.push(["tvm.Builder",r.cell.toBoc().toString("base64")])}return t}t.HttpApi=class{constructor(e,t){this.endpoint=e,this.cache=new s.InMemoryCache,this.parameters={timeout:t?.timeout||3e4,apiKey:t?.apiKey,adapter:t?.adapter},this.shardCache=new P("ton-shard",this.cache,c.z.array(u),(e=>e+"")),this.shardLoader=new i.default((async e=>await Promise.all(e.map((async e=>{const t=await this.shardCache.get(e);if(t)return t;let r=(await this.doCall("shards",{seqno:e},v)).shards;return await this.shardCache.set(e,r),r}))))),this.shardTransactionsCache=new P("ton-shard-tx",this.cache,T,(e=>e.workchain+":"+e.shard+":"+e.seqno)),this.shardTransactionsLoader=new i.default((async e=>await Promise.all(e.map((async e=>{const t=await this.shardTransactionsCache.get(e);if(t)return t;let r=await this.doCall("getBlockTransactions",{workchain:e.workchain,seqno:e.seqno,shard:e.shard},T);return await this.shardTransactionsCache.set(e,r),r})))),{cacheKeyFn:e=>e.workchain+":"+e.shard+":"+e.seqno})}getAddressInformation(e){return this.doCall("getAddressInformation",{address:e.toString()},d)}async getTransactions(e,t){const r=t.inclusive;let o;delete t.inclusive,t.hash&&(o=n.from(t.hash,"base64").toString("hex"));let s=t.limit;t.hash&&t.lt&&!0!==r&&s++;let i=await this.doCall("getTransactions",{address:e.toString(),...t,limit:s,hash:o},b);return i.length>s&&(i=i.slice(0,s)),t.hash&&t.lt&&!0!==r?(i.shift(),i):i}async getMasterchainInfo(){return await this.doCall("getMasterchainInfo",{},w)}async getShards(e){return await this.shardLoader.load(e)}async getBlockTransactions(e,t,r){return await this.shardTransactionsLoader.load({workchain:e,seqno:t,shard:r})}async getTransaction(e,t,r){let o=n.from(r,"base64").toString("hex"),s=(await this.doCall("getTransactions",{address:e.toString(),lt:t,hash:o,limit:1},b)).find((e=>e.transaction_id.lt===t&&e.transaction_id.hash===r));return s||null}async callGetMethod(e,t,r){return await this.doCall("runGetMethod",{address:e.toString(),method:t,stack:E(r)},f)}async sendBoc(e){await this.doCall("sendBoc",{boc:e.toString("base64")},h)}async estimateFee(e,t){return await this.doCall("estimateFee",{address:e.toString(),body:t.body.toBoc().toString("base64"),init_data:t.initData?t.initData.toBoc().toString("base64"):"",init_code:t.initCode?t.initCode.toBoc().toString("base64"):"",ignore_chksig:t.ignoreSignature},p)}async tryLocateResultTx(e,t,r){return await this.doCall("tryLocateResultTx",{source:e.toString(),destination:t.toString(),created_lt:r},y)}async tryLocateSourceTx(e,t,r){return await this.doCall("tryLocateSourceTx",{source:e.toString(),destination:t.toString(),created_lt:r},y)}async doCall(e,t,r){let n={"Content-Type":"application/json","X-Ton-Client-Version":l};this.parameters.apiKey&&(n["X-API-Key"]=this.parameters.apiKey);let o=await a.default.post(this.endpoint,JSON.stringify({id:"1",jsonrpc:"2.0",method:e,params:t}),{headers:n,timeout:this.parameters.timeout,adapter:this.parameters.adapter});if(200!==o.status||!o.data.ok)throw Error("Received error: "+JSON.stringify(o.data));let s=r.safeParse(o.data.result);if(s.success)return s.data;throw Error("Malformed response: "+s.error.format()._errors.join(", "))}}},"./node_modules/@ton/ton/dist/client/api/TonCache.js"(e,t){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.InMemoryCache=void 0;t.InMemoryCache=class{constructor(){this.cache=new Map,this.set=async(e,t,r)=>{null!==r?this.cache.set(e+"$$"+t,r):this.cache.delete(e+"$$"+t)},this.get=async(e,t)=>{let r=this.cache.get(e+"$$"+t);return void 0!==r?r:null}}}},"./node_modules/@ton/ton/dist/config/ConfigParser.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.configParseMasterAddress=o,t.parseValidatorSet=a,t.parseBridge=c,t.configParseMasterAddressRequired=l,t.configParse5=u,t.configParse13=function(e){if(!e)throw Error("Invalid config");if(26===e.loadUint(8)){return{deposit:e.loadCoins(),bitPrice:e.loadCoins(),cellPrice:e.loadCoins()}}throw new Error("Invalid config")},t.configParse15=d,t.configParse16=h,t.configParse17=p,t.configParse18=g,t.configParse8=m,t.configParse40=y,t.configParseWorkchainDescriptor=b,t.configParse12=v,t.configParseValidatorSet=A,t.configParseBridge=T,t.configParseGasLimitsPrices=P,t.configParseMsgPrices=E,t.configParse28=C,t.configParse29=k,t.parseProposalSetup=_,t.parseVotingSetup=I,t.loadConfigParamById=function(e,t){return S(e).get(t)},t.loadConfigParamsAsSlice=function(e){const t=S(e),r=new Map;for(const[e,n]of t)r.set(e,n.beginParse());return r},t.parseFullConfig=function(e){return{configAddress:l(e.get(0)),electorAddress:l(e.get(1)),minterAddress:o(e.get(2)),feeCollectorAddress:o(e.get(3)),dnsRootAddress:o(e.get(4)),burningConfig:u(e.get(5)),globalVersion:m(e.get(8)),workchains:v(e.get(12)),voting:I(e.get(11)),validators:{...d(e.get(15)),...h(e.get(16)),...p(e.get(17))},storagePrices:g(e.get(18)),gasPrices:{masterchain:P(e.get(20)),workchain:P(e.get(21))},msgPrices:{masterchain:E(e.get(24)),workchain:E(e.get(25))},validatorSets:{prevValidators:A(e.get(32)),prevTempValidators:A(e.get(33)),currentValidators:A(e.get(34)),currentTempValidators:A(e.get(35)),nextValidators:A(e.get(36)),nextTempValidators:A(e.get(37))},validatorsPunish:y(e.get(40)),bridges:{ethereum:T(e.get(71)),binance:T(e.get(72)),polygon:T(e.get(73))},catchain:C(e.get(28)),consensus:k(e.get(29))}};const n=r("./node_modules/@ton/core/dist/index.js");function o(e){return e?new n.Address(-1,e.loadBuffer(32)):null}function s(e){if(2390828938!==e.loadUint(32))throw Error("Invalid config");return e.loadBuffer(32)}const i={serialize(e,t){throw Error("not implemented")},parse(e){const t=e.loadUint(8);if(83===t)return{publicKey:s(e),weight:e.loadUintBig(64),adnlAddress:null};if(115===t)return{publicKey:s(e),weight:e.loadUintBig(64),adnlAddress:e.loadBuffer(32)};throw Error("Invalid config")}};function a(e){const t=e.loadUint(8);if(17===t){return{timeSince:e.loadUint(32),timeUntil:e.loadUint(32),total:e.loadUint(16),main:e.loadUint(16),totalWeight:null,list:e.loadDictDirect(n.Dictionary.Keys.Uint(16),i)}}if(18===t){return{timeSince:e.loadUint(32),timeUntil:e.loadUint(32),total:e.loadUint(16),main:e.loadUint(16),totalWeight:e.loadUintBig(64),list:e.loadDict(n.Dictionary.Keys.Uint(16),i)}}}function c(e){const t=new n.Address(-1,e.loadBuffer(32)),r=new n.Address(-1,e.loadBuffer(32)),o=e.loadDict(n.Dictionary.Keys.Buffer(32),n.Dictionary.Values.Buffer(32)),s=new Map;for(const[e,t]of o)s.set(new n.Address(-1,e).toString(),t);return{bridgeAddress:t,oracleMultisigAddress:r,oracles:s,externalChainAddress:e.loadBuffer(32)}}function l(e){if(!e)throw Error("Invalid config");return o(e)}function u(e){if(!e)throw Error("Invalid config");if(1===e.loadUint(8)){return{blackholeAddr:e.loadBit()?new n.Address(-1,e.loadBuffer(32)):null,feeBurnNominator:e.loadUint(32),feeBurnDenominator:e.loadUint(32)}}throw new Error("Invalid config")}function d(e){if(!e)throw Error("Invalid config");return{validatorsElectedFor:e.loadUint(32),electorsStartBefore:e.loadUint(32),electorsEndBefore:e.loadUint(32),stakeHeldFor:e.loadUint(32)}}function h(e){if(!e)throw Error("Invalid config");return{maxValidators:e.loadUint(16),maxMainValidators:e.loadUint(16),minValidators:e.loadUint(16)}}function p(e){if(!e)throw Error("Invalid config");return{minStake:e.loadCoins(),maxStake:e.loadCoins(),minTotalStake:e.loadCoins(),maxStakeFactor:e.loadUint(32)}}const f={serialize(e,t){throw Error("not implemented")},parse(e){if(204!==e.loadUint(8))throw Error("Invalid config");return{utime_since:e.loadUint(32),bit_price_ps:e.loadUintBig(64),cell_price_ps:e.loadUintBig(64),mc_bit_price_ps:e.loadUintBig(64),mc_cell_price_ps:e.loadUintBig(64)}}};function g(e){if(!e)throw Error("Invalid config");return e.loadDictDirect(n.Dictionary.Keys.Buffer(4),f).values()}function m(e){if(!e)return{version:0,capabilities:0n};return{version:e.loadUint(32),capabilities:e.loadUintBig(64)}}function y(e){if(!e)return null;if(1!==e.loadUint(8))throw Error("Invalid config");return{defaultFlatFine:e.loadCoins(),defaultProportionaFine:e.loadCoins(),severityFlatMult:e.loadUint(16),severityProportionalMult:e.loadUint(16),unfunishableInterval:e.loadUint(16),longInterval:e.loadUint(16),longFlatMult:e.loadUint(16),longProportionalMult:e.loadUint(16),mediumInterval:e.loadUint(16),mediumFlatMult:e.loadUint(16),mediumProportionalMult:e.loadUint(16)}}function b(e){const t=e.loadUint(8);if(166!=t&&167!=t)throw Error("Invalid config");const r=e.loadUint(32),n=e.loadUint(8),o=e.loadUint(8),s=e.loadUint(8),i=e.loadBit(),a=e.loadBit(),c=e.loadBit(),l=e.loadUint(13),u=e.loadBuffer(32),d=e.loadBuffer(32),h=e.loadUint(32);if(!e.loadUint(4))throw Error("Invalid config");const p=e.loadInt(32),f=e.loadUintBig(64);let g;if(167==t){const t=function(e){if(0!==e.loadUint(4))throw Error("Invalid WcSplitMergeTimings tag expected 0!");return{split_merge_delay:e.loadUint(32),split_merge_interval:e.loadUint(32),min_split_merge_interval:e.loadUint(32),max_split_merge_delay:e.loadUint(32)}}(e),r=e.loadUint(8);if(r>63)throw RangeError(`Invalid persistent_state_split_depth: ${r} expected <= 63`);g={split_merge_timings:t,persistent_state_split_depth:r}}return{enabledSince:r,actialMinSplit:n,min_split:o,max_split:s,basic:i,active:a,accept_msgs:c,flags:l,zerostateRootHash:u,zerostateFileHash:d,version:h,format:{vmVersion:p,vmMode:f},workchain_v2:g}}const w={serialize(e,t){throw Error("not implemented")},parse:e=>b(e)};function v(e){if(!e)throw Error("Invalid config");const t=e.loadDict(n.Dictionary.Keys.Uint(32),w);if(t)return t;throw Error("No workchains exist")}function A(e){return e?a(e):null}function T(e){return e?c(e):null}function P(e){if(!e)throw Error("Invalid config");
2if(209===e.loadUint(8)){const t=e.loadUintBig(64),r=e.loadUintBig(64),n=function(e){const t=e.loadUint(8);if(222===t)return{gasPrice:e.loadUintBig(64),gasLimit:e.loadUintBig(64),specialGasLimit:e.loadUintBig(64),gasCredit:e.loadUintBig(64),blockGasLimit:e.loadUintBig(64),freezeDueLimit:e.loadUintBig(64),deleteDueLimit:e.loadUintBig(64)};if(221===t)return{gasPrice:e.loadUintBig(64),gasLimit:e.loadUintBig(64),gasCredit:e.loadUintBig(64),blockGasLimit:e.loadUintBig(64),freezeDueLimit:e.loadUintBig(64),deleteDueLimit:e.loadUintBig(64)};throw Error("Invalid config")}(e);return{flatLimit:t,flatGasPrice:r,other:n}}throw Error("Invalid config")}function E(e){if(!e)throw new Error("Invalid config");if(234!==e.loadUint(8))throw new Error("Invalid msg prices param");return{lumpPrice:e.loadUintBig(64),bitPrice:e.loadUintBig(64),cellPrice:e.loadUintBig(64),ihrPriceFactor:e.loadUint(32),firstFrac:e.loadUint(16),nextFrac:e.loadUint(16)}}function C(e){if(!e)throw new Error("Invalid config");const t=e.loadUint(8);if(193===t){return{masterCatchainLifetime:e.loadUint(32),shardCatchainLifetime:e.loadUint(32),shardValidatorsLifetime:e.loadUint(32),shardValidatorsCount:e.loadUint(32)}}if(194===t){return{flags:e.loadUint(7),suffleMasterValidators:e.loadBit(),masterCatchainLifetime:e.loadUint(32),shardCatchainLifetime:e.loadUint(32),shardValidatorsLifetime:e.loadUint(32),shardValidatorsCount:e.loadUint(32)}}throw new Error("Invalid config")}function k(e){if(!e)throw new Error("Invalid config");const t=e.loadUint(8);if(214===t){return{roundCandidates:e.loadUint(32),nextCandidateDelay:e.loadUint(32),consensusTimeout:e.loadUint(32),fastAttempts:e.loadUint(32),attemptDuration:e.loadUint(32),catchainMaxDeps:e.loadUint(32),maxBlockBytes:e.loadUint(32),maxColaltedBytes:e.loadUint(32)}}if(215===t){return{flags:e.loadUint(7),newCatchainIds:e.loadBit(),roundCandidates:e.loadUint(8),nextCandidateDelay:e.loadUint(32),consensusTimeout:e.loadUint(32),fastAttempts:e.loadUint(32),attemptDuration:e.loadUint(32),catchainMaxDeps:e.loadUint(32),maxBlockBytes:e.loadUint(32),maxColaltedBytes:e.loadUint(32)}}if(216===t){return{flags:e.loadUint(7),newCatchainIds:e.loadBit(),roundCandidates:e.loadUint(8),nextCandidateDelay:e.loadUint(32),consensusTimeout:e.loadUint(32),fastAttempts:e.loadUint(32),attemptDuration:e.loadUint(32),catchainMaxDeps:e.loadUint(32),maxBlockBytes:e.loadUint(32),maxColaltedBytes:e.loadUint(32),protoVersion:e.loadUint(16)}}if(217===t){return{flags:e.loadUint(7),newCatchainIds:e.loadBit(),roundCandidates:e.loadUint(8),nextCandidateDelay:e.loadUint(32),consensusTimeout:e.loadUint(32),fastAttempts:e.loadUint(32),attemptDuration:e.loadUint(32),catchainMaxDeps:e.loadUint(32),maxBlockBytes:e.loadUint(32),maxColaltedBytes:e.loadUint(32),protoVersion:e.loadUint(16),catchainMaxBlocksCoeff:e.loadUint(32)}}throw new Error("Invalid config")}function _(e){if(54!==e.loadUint(8))throw new Error("Invalid config");return{minTotalRounds:e.loadUint(8),maxTotalRounds:e.loadUint(8),minWins:e.loadUint(8),maxLoses:e.loadUint(8),minStoreSec:e.loadUint(32),maxStoreSec:e.loadUint(32),bitPrice:e.loadUint(32),cellPrice:e.loadUint(32)}}function I(e){if(!e)throw new Error("Invalid config");if(145!==e.loadUint(8))throw new Error("Invalid config");return{normalParams:_(e.loadRef().beginParse()),criticalParams:_(e.loadRef().beginParse())}}function S(e){return n.Cell.fromBase64(e).beginParse().loadDictDirect(n.Dictionary.Keys.Int(32),n.Dictionary.Values.Cell())}},"./node_modules/@ton/ton/dist/elector/ElectorContract.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.ElectorContract=void 0;const o=r("./node_modules/@ton/core/dist/index.js"),s={serialize(e,t){throw Error("not implemented")},parse:e=>({address:new o.Address(-1,e.loadBuffer(32)),weight:e.loadUintBig(64),stake:e.loadCoins()})},i={serialize(e,t){throw Error("not implemented")},parse(e){const t=e.loadCoins();e.skip(64);return{stake:t,address:new o.Address(-1,e.loadBuffer(32)),adnl:e.loadBuffer(32)}}};class a{static create(){return new a}constructor(){this.address=o.Address.parseRaw("-1:3333333333333333333333333333333333333333333333333333333333333333")}async getReturnedStake(e,t){if(-1!==t.workChain)throw Error("Only masterchain addresses could have stake");return(await e.get("compute_returned_stake",[{type:"int",value:BigInt("0x"+t.hash.toString("hex"))}])).stack.readBigNumber()}async getPastElectionsList(e){const t=await e.get("past_elections_list",[]),r=new o.TupleReader(t.
2stack.readLispList()),n=[];for(;r.remaining>0;){const e=r.readTuple(),t=e.readNumber(),o=e.readNumber();e.pop();const s=e.readNumber();n.push({id:t,unfreezeAt:o,stakeHeld:s})}return n}async getPastElections(e){const t=await e.get("past_elections",[]),r=new o.TupleReader(t.stack.readLispList()),n=[];for(;r.remaining>0;){const e=r.readTuple(),t=e.readNumber(),i=e.readNumber(),a=e.readNumber();e.pop();const c=e.readCell(),l=e.readBigNumber(),u=e.readBigNumber();let d=new Map;const h=c.beginParse().loadDictDirect(o.Dictionary.Keys.Buffer(32),s);for(const[e,t]of h)d.set(BigInt("0x"+e.toString("hex")).toString(10),{address:t.address,weight:t.weight,stake:t.stake});n.push({id:t,unfreezeAt:i,stakeHeld:a,totalStake:l,bonuses:u,frozen:d})}return n}async getElectionEntities(e){const t=await e.getState();if("active"!==t.state.type)throw Error("Unexpected error");const r=o.Cell.fromBoc(t.state.data)[0].beginParse();if(!r.loadBit())return null;const n=r.loadRef().beginParse(),s=n.loadUint(32),a=n.loadUint(32),c=n.loadCoins(),l=n.loadCoins(),u=n.loadDict(o.Dictionary.Keys.Buffer(32),i);let d=[];if(u)for(const[e,t]of u)d.push({pubkey:e,stake:t.stake,address:t.address,adnl:t.adnl});return{minStake:c,allStakes:l,endElectionsTime:a,startWorkTime:s,entities:d}}async getActiveElectionId(e){const t=(await e.get("active_election_id",[])).stack.readNumber();return t>0?t:null}async getComplaints(e,t){const r=new o.TupleBuilder;r.writeNumber(t);const s=await e.get("list_complaints",r.build());if("null"===s.stack.peek().type)return[];const i=new o.TupleReader(s.stack.readLispList()),a=[];for(;i.remaining>0;){const e=i.readTuple(),t=e.readBigNumber(),r=e.readTuple(),s=r.readTuple(),c=n.from(s.readBigNumber().toString(16),"hex"),l=(s.readCell(),s.readNumber()),u=s.readNumber(),d=new o.Address(-1,n.from(s.readBigNumber().toString(16),"hex")),h=s.readBigNumber(),p=s.readBigNumber(),f=s.readBigNumber(),g=[],m=new o.TupleReader(r.readLispList());for(;m.remaining>0;)g.push(m.readNumber());const y=r.readBigNumber(),b=r.readBigNumber();a.push({id:t,publicKey:c,createdAt:l,severity:u,paid:h,suggestedFine:p,suggestedFinePart:f,rewardAddress:d,votes:g,remainingWeight:b,vsetId:y})}return a}}t.ElectorContract=a},"./node_modules/@ton/ton/dist/index.js"(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.computeStorageFees=t.computeMessageForwardFees=t.computeGasPrices=t.computeFwdFees=t.computeExternalMessageFees=t.loadConfigParamsAsSlice=t.loadConfigParamById=t.parseFullConfig=t.parseVotingSetup=t.parseValidatorSet
2=t.parseProposalSetup=t.parseBridge=t.configParseWorkchainDescriptor=t.configParseValidatorSet=t.configParseMsgPrices=t.configParseMasterAddressRequired=t.configParseMasterAddress=t.configParseGasLimitsPrices=t.configParseBridge=t.configParse40=t.configParse29=t.configParse28=t.configParse18=t.configParse17=t.configParse16=t.configParse15=t.configParse13=t.configParse12=t.configParse8=t.configParse5=t.ElectorContract=t.MultisigWallet=t.MultisigOrderBuilder=t.MultisigOrder=t.JettonWallet=t.JettonMaster=t.WalletContractV5R1=t.WalletContractV5Beta=t.WalletContractV4=t.WalletContractV3R2=t.WalletContractV3R1=t.WalletContractV2R2=t.WalletContractV2R1=t.WalletContractV1R3=t.WalletContractV1R2=t.WalletContractV1R1=t.TonClient4=t.TonClient=t.HttpApi=void 0,o(r("./node_modules/@ton/core/dist/index.js"),t);var s=r("./node_modules/@ton/ton/dist/client/api/HttpApi.js");Object.defineProperty(t,"HttpApi",{enumerable:!0,get:function(){return s.HttpApi}});var i=r("./node_modules/@ton/ton/dist/client/TonClient.js");Object.defineProperty(t,"TonClient",{enumerable:!0,get:function(){return i.TonClient}});var a=r("./node_modules/@ton/ton/dist/client/TonClient4.js");Object.defineProperty(t,"TonClient4",{enumerable:!0,get:function(){return a.TonClient4}});var c=r("./node_modules/@ton/ton/dist/wallets/WalletContractV1R1.js");Object.defineProperty(t,"WalletContractV1R1",{enumerable:!0,get:function(){return c.WalletContractV1R1}});var l=r("./node_modules/@ton/ton/dist/wallets/WalletContractV1R2.js");Object.defineProperty(t,"WalletContractV1R2",{enumerable:!0,get:function(){return l.WalletContractV1R2}});var u=r("./node_modules/@ton/ton/dist/wallets/WalletContractV1R3.js");Object.defineProperty(t,"WalletContractV1R3",{enumerable:!0,get:function(){return u.WalletContractV1R3}});var d=r("./node_modules/@ton/ton/dist/wallets/WalletContractV2R1.js");Object.defineProperty(t,"WalletContractV2R1",{enumerable:!0,get:function(){return d.WalletContractV2R1}});var h=r("./node_modules/@ton/ton/dist/wallets/WalletContractV2R2.js");Object.defineProperty(t,"WalletContractV2R2",{enumerable:!0,get:function(){return h.WalletContractV2R2}});var p=r("./node_modules/@ton/ton/dist/wallets/WalletContractV3R1.js");Object.defineProperty(t,"WalletContractV3R1",{enumerable:!0,get:function(){return p.WalletContractV3R1}});var f=r("./node_modules/@ton/ton/dist/wallets/WalletContractV3R2.js");Object.defineProperty(t,"WalletContractV3R2",{enumerable:!0,get:function(){return f.WalletContractV3R2}});var g=r("./node_modules/@ton/ton/dist/wallets/WalletContractV4.js");Object.defineProperty(t,"WalletContractV4",{enumerable:!0,get:function(){return g.WalletContractV4}});var m=r("./node_modules/@ton/ton/dist/wallets/WalletContractV5Beta.js");Object.defineProperty(t,"WalletContractV5Beta",{enumerable:!0,get:function(){return m.WalletContractV5Beta}});var y=r("./node_modules/@ton/ton/dist/wallets/WalletContractV5R1.js");Object.defineProperty(t,"WalletContractV5R1",{enumerable:!0,get:function(){return y.WalletContractV5R1}});var b=r("./node_modules/@ton/ton/dist/jetton/JettonMaster.js");Object.defineProperty(t,"JettonMaster",{enumerable:!0,get:function(){return b.JettonMaster}});var w=r("./node_modules/@ton/ton/dist/jetton/JettonWallet.js");Object.defineProperty(t,"JettonWallet",{enumerable:!0,get:function(){return w.JettonWallet}});var v=r("./node_modules/@ton/ton/dist/multisig/MultisigOrder.js");Object.defineProperty(t,"MultisigOrder",{enumerable:!0,get:function(){return v.MultisigOrder}});var A=r("./node_modules/@ton/ton/dist/multisig/MultisigOrderBuilder.js");Object.defineProperty(t,"MultisigOrderBuilder",{enumerable:!0,get:function(){return A.MultisigOrderBuilder}});var T=r("./node_modules/@ton/ton/dist/multisig/MultisigWallet.js");Object.defineProperty(t,"MultisigWallet",{enumerable:!0,get:function(){return T.MultisigWallet}});var P=r("./node_modules/@ton/ton/dist/elector/ElectorContract.js");Object.defineProperty(t,"ElectorContract",{enumerable:!0,get:function(){return P.ElectorContract}});var E=r("./node_modules/@ton/ton/dist/config/ConfigParser.js");Object.defineProperty(t,"configParse5",{enumerable:!0,get:function(){return E.configParse5}}),Object.defineProperty(t,"configParse8",{enumerable:!0,get:function(){return E.configParse8}}),Object.defineProperty(t,"configParse12",{enumerable:!0,get:function(){return E.configParse12}}),Object.defineProperty(t,"configParse13",{enumerable:!0,get:function(){return E.configParse13}}),Object.defineProperty(t,"configParse15",{enumerable:!0,get:function(){return E.configParse15}}),Object.defineProperty(t,"configParse16",{enumerable:!0,get:function(){return E.configParse16}}),Object.defineProperty(t,"configParse17",{enumerable:!0,get:function(){return E.configParse17}}),Object.defineProperty(t,"configParse18",{enumerable:!0,get:function(){return E.configParse18}}),Object.defineProperty(t,"configParse28",{enumerable:!0,get:function(){return E.configParse28}}),Object.defineProperty(t,"configParse29",{enumerable:!0,get:function(){return E.configParse29}}),Object.defineProperty(t,"configParse40",{enumerable:!0,get:function(){return E.configParse40}}),Object.defineProperty(t,"configParseBridge",{enumerable:!0,get:function(){return E.configParseBridge}}),Object.defineProperty(t,"configParseGasLimitsPrices",{enumerable:!0,get:function(){return E.configParseGasLimitsPrices}}),Object.defineProperty(t,"configParseMasterAddress",{enumerable:!0,get:function(){return E.configParseMasterAddress}}),Object.defineProperty(t,"configParseMasterAddressRequired",{enumerable:!0,get:function(){return E.configParseMasterAddressRequired}}),Object.defineProperty(t,"configParseMsgPrices",{enumerable:!0,get:function(){return E.configParseMsgPrices}}),Object.defineProperty(t,"configParseValidatorSet",{enumerable:!0,get:function(){return E.configParseValidatorSet}}),Object.defineProperty(t,"configParseWorkchainDescriptor",{enumerable:!0,get:function(){return E.configParseWorkchainDescriptor}}),Object.defineProperty(t,"parseBridge",{enumerable:!0,get:function(){return E.parseBridge}}),Object.defineProperty(t,"parseProposalSetup",{enumerable:!0,get:function(){return E.parseProposalSetup}}),Object.defineProperty(t,"parseValidatorSet",{enumerable:!0,get:function(){return E.parseValidatorSet}}),Object.defineProperty(t,"parseVotingSetup",{enumerable:!0,get:function(){return E.parseVotingSetup}}),Object.defineProperty(t,"parseFullConfig",{enumerable:!0,get:function(){return E.parseFullConfig}}),Object.defineProperty(t,"loadConfigParamById",{enumerable:!0,get:function(){return E.loadConfigParamById}}),Object.defineProperty(t,"loadConfigParamsAsSlice",{enumerable:!0,get:function(){return E.loadConfigParamsAsSlice}});var C=r("./node_modules/@ton/ton/dist/utils/fees.js");Object.defineProperty(t,"computeExternalMessageFees",{enumerable:!0,get:function(){return C.computeExternalMessageFees}}),Object.defineProperty(t,"computeFwdFees",{enumerable:!0,get:function(){return C.computeFwdFees}}),Object.defineProperty(t,"computeGasPrices",{enumerable:!0,get:function(){return C.computeGasPrices}}),Object.defineProperty(t,"computeMessageForwardFees",{enumerable:!0,get:function(){return C.computeMessageForwardFees}}),Object.defineProperty(t,"computeStorageFees",{enumerable:!0,get:function(){return C.computeStorageFees}})},"./node_modules/@ton/ton/dist/jetton/JettonMaster.js"(e,t,r){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.JettonMaster=void 0;const n=r("./node_modules/@ton/core/dist/index.js");class o{static create(e){return new o(e)}constructor(e){this.address=e}async getWalletAddress(e,t){return(await e.get("get_wallet_address",[{type:"slice",cell:(0,n.beginCell)().storeAddress(t).endCell()}])).stack.readAddress()}async getJettonData(e){let t=await e.get("get_jetton_data",[]);return{totalSupply:t.stack.readBigNumber(),mintable:t.stack.readBoolean(),adminAddress:t.stack.readAddress(),content:t.stack.readCell(),walletCode:t.stack.readCell()}}}t.JettonMaster=o},"./node_modules/@ton/ton/dist/jetton/JettonWallet.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JettonWallet=void 0;class r{static create(e){return new r(e)}constructor(e){this.address=e}async getBalance(e){return"active"!==(await e.getState()).state.type?0n:(await e.get("get_wallet_data",[])).stack.readBigNumber()}}t.JettonWallet=r},"./node_modules/@ton/ton/dist/multisig/MultisigOrder.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultisigOrder=void 0;const n=r("./node_modules/@ton/crypto/dist/index.js"),o=r("./node_modules/@ton/core/dist/index.js");class s{constructor(e){this.signatures={},this.payload=e}static fromCell(e){let t=e.beginParse(),r=t.loadMaybeRef()?.beginParse();const n=t.asCell();let o=new s(n);if(r){for(;r.remainingBits>0;){const e=r.loadBuffer(64),t=r.loadUint(8);o.signatures[t]=e,r.remainingRefs>0?r=r.loadRef().asSlice():r.skip(1)}r.endParse()}return o}static fromPayload(e){return new s(e)}addSignature(e,t,r){const o=this.payload.hash();if(!(0,n.signVerify)(o,t,r.owners.get(e).slice(0,-1)))throw Error("invalid signature");this.signatures[e]=t}sign(e,t){const r=this.payload.hash();return this.signatures[e]=(0,n.sign)(r,t),r}unionSignatures(e){this.signatures=Object.assign({},this.signatures,e.signatures)}clearSignatures(){this.signatures={}}toCell(e){let t=(0,o.beginCell)().storeBit(0);for(const e in this.signatures){const r=this.signatures[e];t=(0,o.beginCell)().storeBit(1).storeRef((0,o.beginCell)().storeBuffer(r).storeUint(parseInt(e),8).storeBuilder(t).endCell())}return(0,o.beginCell)().storeUint(e,8).storeBuilder(t).storeBuilder(this.payload.asBuilder()).endCell()}}t.MultisigOrder=s},"./node_modules/@ton/ton/dist/multisig/MultisigOrderBuilder.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultisigOrderBuilder=void 0;const n=r("./node_modules/@ton/core/dist/index.js"),o=r("./node_modules/@ton/ton/dist/multisig/MultisigOrder.js");t.MultisigOrderBuilder=class{constructor(e,t){this.messages=(0,n.beginCell)(),this.queryId=0n,this.walletId=e,this.queryOffset=t||7200}addMessage(e,t){if(this.messages.refs>=4)throw Error("only 4 refs are allowed");this.updateQueryId(),this.messages.storeUint(t,8),this.messages.storeRef((0,n.beginCell)().store((0,n.storeMessageRelaxed)(e)).endCell())}clearMessages(){this.messages=(0,n.beginCell)()}build(){return o.MultisigOrder.fromPayload((0,n.beginCell)().storeUint(this.walletId,32).storeUint(this.queryId,64).storeBuilder(this.messages).endCell())}updateQueryId(){const e=BigInt(Math.floor(Date.now()/1e3+this.queryOffset));this.queryId=e<<32n}}},"./node_modules/@ton/ton/dist/multisig/MultisigWallet.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.MultisigWallet=void 0;const o=r("./node_modules/@ton/crypto/dist/index.js"),s=r("./node_modules/@ton/core/dist/index.js"),i=s.Cell.fromBase64("te6ccgECKwEABBgAART/APSkE/S88sgLAQIBIAIDAgFIBAUE2vIgxwCOgzDbPOCDCNcYIPkBAdMH2zwiwAAToVNxePQOb6Hyn9s8VBq6+RDyoAb0BCD5AQHTH1EYuvKq0z9wUwHwCgHCCAGDCryx8mhTFYBA9A5voSCYDqQgwgryZw7f+COqH1NAufJhVCOjU04gIyEiAgLMBgcCASAMDQIBIAgJAgFmCgsAA9GEAiPymAvHoHN9CYbZ5S7Z4BPHohwhJQAtAKkItdJEqCTItdKlwLUAdAT8ArobBKAATwhbpEx4CBukTDgAdAg10rDAJrUAvALyFjPFszJ4HHXI8gBzxb0AMmACASAODwIBIBQVARW77ZbVA0cFUg2zyCoCAUgQEQIBIBITAXOxHXQgwjXGCD5AQHTB4IB1MTtQ9hTIHj0Dm+h8p/XC/9eMfkQ8qCuAfQEIW6TW3Ey4PkBWNs8AaQBgJwA9rtqA6ADoAPoCAXoCEfyAgPyA3XlP+AXkegAA54tkwAAXrhlXP8EA1WZ2oexAAgEgFhcCASAYGQFRtyVbZ4YmRmpGEAgegc30McJNhFpAADMaYeYuAFrgJhwLb+4cC3d0bhAjAYm1WZtnhqvgb+2xxsoicAgej430pBHEoFpAADHDhBACGuQkuuBk9kUWE5kAOeLKhACQCB6IYFImHFImHFImXEA2YlzNijAjAgEgGhsAF7UGtc4QQDVZnah7EAIBIBwdAgOZOB4fARGsGm2eL4G2CUAjABWt+UEAzJV2oewYQAENqTbPBVfBYCMAFa3f3CCAarM7UPYgAiDbPALyZfgAUENxQxPbPO1UIyoACtP/0wcwBKDbPC+uUyCw8mISsQKkJbNTHLmwJYEA4aojoCi8sPJpggGGoPgBBZcCERACPj4wjo0REB/bPEDXePRDEL0F4lQWW1Rz51YQU9zbPFRxClR6vCQlKCYAIO1E0NMf0wfTB9M/9AT0BNEAXgGOGjDSAAHyo9MH0wdQA9cBIPkBBfkBFbrypFAD4GwhI
2ddKqgIi10m68qtwVCATAAwByMv/ywcE1ts87VT4D3AlblOJvrGYEG4QLVDHXwePGzBUJANQTds8UFWgRlAQSRA6SwlTuds8UFQWf+L4AAeDJaGOLCaAQPSWb6UglDBTA7neII4WODk5CNIAAZfTBzAW8AcFkTDifwgHBZJsMeKz5jAGKicoKQBgcI4pA9CDCNcY0wf0BDBTFnj0Dm+h8qXXC/9URUT5EPKmrlIgsVIDvRShI27mbCIyAH5SML6OIF8D+ACTItdKmALTB9QC+wAC6DJwyMoAQBSAQPRDAvAHjhdxyMsAFMsHEssHWM8BWM8WQBOAQPRDAeIBII6KEEUQNEMA2zztVJJfBuIqABzIyx/LB8sHyz/0APQAyQ==");class a{constructor(e,t,r,o,a){this.provider=null,this.owners=s.Dictionary.empty(),this.workchain=t,this.walletId=r,this.k=o;for(let t=0;t<e.length;t+=1)this.owners.set(t,n.concat([e[t],n.alloc(1)]));this.init={code:i,data:(0,s.beginCell)().storeUint(this.walletId,32).storeUint(this.owners.size,8).storeUint(this.k,8).storeUint(0,64).storeDict(this.owners,s.Dictionary.Keys.Uint(8),s.Dictionary.Values.Buffer(33)).storeBit(0).endCell()},this.address=a?.address||(0,s.contractAddress)(t,this.init),a?.provider?this.provider=a.provider:a?.client&&(this.provider=a.client.provider(this.address,{code:this.init.code,data:this.init.data}))}static async fromAddress(e,t){let r;if(t.provider)r=t.provider;else{if(!t.client)throw Error("Either provider or client must be specified");r=t.client.provider(e,{code:null,data:null})}const n=(await r.getState()).state;if("active"!==n.type)throw Error("Contract must be active");const o=s.Cell.fromBoc(n.data)[0].beginParse(),i=o.loadUint(32);o.skip(8);const c=o.loadUint(8);o.skip(64);const l=o.loadDict(s.Dictionary.Keys.Uint(8),s.Dictionary.Values.Buffer(33));let u=[];for(const[e,t]of l){const e=t.subarray(0,32);u.push(e)}return new a(u,e.workChain,i,c,{address:e,provider:r,client:t.client})}async deployExternal(e){if(!e&&!this.provider)throw Error("you must specify provider if there is no such property in MultisigWallet instance");e||(e=this.provider),await e.external(s.Cell.EMPTY)}async deployInternal(e,t=1000000000n){await e.send({sendMode:s.SendMode.PAY_GAS_SEPARATELY+s.SendMode.IGNORE_ERRORS,to:this.address,value:t,init:this.init,body:s.Cell.EMPTY,bounce:!0})}async sendOrder(e,t,r){if(!r&&!this.provider)throw Error("you must specify provider if there is no such property in MultisigWallet instance");r||(r=this.provider);let n=(0,o.keyPairFromSecretKey)(t).publicKey,i=this.getOwnerIdByPubkey(n),a=e.toCell(i),c=(0,o.sign)(a.hash(),t);a=(0,s.beginCell)().storeBuffer(c).storeSlice(a.asSlice()).endCell(),await r.external(a)}async sendOrderWithoutSecretKey(e,t,r,n){if(!n&&!this.provider)throw Error("you must specify provider if there is no such property in MultisigWallet instance");n||(n=this.provider);let o=e.toCell(r);o=(0,s.beginCell)().storeBuffer(t).storeSlice(o.asSlice()).endCell(),await n.external(o)}getOwnerIdByPubkey(e){for(const[t,r]of this.owners)if(r.subarray(0,32).equals(e))return t;throw Error("public key is not an owner")}}t.MultisigWallet=a},"./node_modules/@ton/ton/dist/utils/fees.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.computeStorageFees=function(e){const{lastPaid:t,now:r,storagePrices:n,storageStat:o,special:s,masterchain:a}=e;if(r<=t||0===n.length||r<n[0].utime_since||s)return BigInt(0);let c=Math.max(t,n[0].utime_since),l=BigInt(0);for(let e=0;e<n.length&&c<r;e++){let t=e<n.length-1?Math.min(r,n[e+1].utime_since):r,s=BigInt(0);if(c<t){let r=t-c;s+=BigInt(o.cells)*(a?n[e].mc_cell_price_ps:n[e].cell_price_ps),s+=BigInt(o.bits)*(a?n[e].mc_bit_price_ps:n[e].bit_price_ps),s*=BigInt(r)}c=t,l+=s}return i(l)},t.computeFwdFees=o,t.computeGasPrices=function(e,t){return e<=t.flatLimit?t.flatPrice:t.flatPrice+(t.price*(e-t.flatLimit)>>16n)},t.computeExternalMessageFees=function(e,t){let r=s(t);return r.bits-=t.bits.length,r.cells-=1,o(e,BigInt(r.cells),BigInt(r.bits))},t.computeMessageForwardFees=function(e,t){let r=(0,n.loadMessageRelaxed)(t.beginParse()),i={bits:0,cells:0};if(r.init){const e=(new n.Cell).asBuilder();(0,n.storeStateInit)(r.init)(e);const t=e.endCell();let o=s(t);o.bits-=t.bits.length,o.cells-=1,i.bits+=o.bits,i.cells+=o.cells}let a=s(r.body);a.bits-=r.body.bits.length,a.cells-=1,i.bits+=a.bits,i.cells+=a.cells;let c=o(e,BigInt(i.cells),BigInt(i.bits)),l=c*BigInt(e.firstFrac)>>16n;return{fees:l,remaining:c-l}};const n=r("./node_modules/@ton/core/dist/index.js");function o(e,t,r){return e.lumpPrice+i(e.bitPrice*r+e.cellPrice*t)}function s(e){let t=e.bits.length,r=1;for(let n of e.refs){let e=s(n);r+=e.cells,t+=e.bits}return{bits:t,cells:r}}function i(e){let t=e>>16n;return 0n!==e%65536n&&(t+=1n),t}},"./node_modules/@ton/ton/dist/utils/toUrlSafe.js"(e,t){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.toUrlSafe=function(e){for(;e.indexOf("/")>=0;)e=e.replace("/","_");for(;e.indexOf("+")>=0;)e=e.replace("+","-");for(;e.indexOf("=")>=0;)e=e.replace("=","");return e}},"./node_modules/@ton/ton/dist/wallets/WalletContractV1R1.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletContractV1R1=void 0;const o=r("./node_modules/@ton/core/dist/index.js"),s=r("./node_modules/@ton/ton/dist/wallets/signing/createWalletTransfer.js");class i{static create(e){return new i(e.workchain,e.publicKey)}constructor(e,t){this.workchain=e,this.publicKey=t;let r=o.Cell.fromBoc(n.from("te6cckEBAQEARAAAhP8AIN2k8mCBAgDXGCDXCx/tRNDTH9P/0VESuvKhIvkBVBBE+RDyovgAAdMfMSDXSpbTB9QC+wDe0aTIyx/L/8ntVEH98Ik=","base64"))[0],s=(0,o.beginCell)().storeUint(0,32).storeBuffer(t).endCell();this.init={code:r,data:s},this.address=(0,o.contractAddress)(e,{code:r,data:s})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){let t=await e.getState();return"active"===t.state.type?o.Cell.fromBoc(t.state.data)[0].beginParse().loadUint(32):0}async send(e,t){await e.external(t)}async sendTransfer(e,t){let r=this.createTransfer(t);await this.send(e,r)}createTransfer(e){let t=o.SendMode.PAY_GAS_SEPARATELY;return null!==e.sendMode&&void 0!==e.sendMode&&(t=e.sendMode),(0,s.createWalletTransferV1)({seqno:e.seqno,sendMode:t,secretKey:e.secretKey,message:e.message})}sender(e,t){return{send:async r=>
2{let n=await this.getSeqno(e),s=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode,message:(0,o.internal)({to:r.to,value:r.value,extracurrency:r.extracurrency,init:r.init,body:r.body,bounce:r.bounce})});await this.send(e,s)}}}}t.WalletContractV1R1=i},"./node_modules/@ton/ton/dist/wallets/WalletContractV1R2.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletContractV1R2=void 0;const o=r("./node_modules/@ton/core/dist/index.js"),s=r("./node_modules/@ton/ton/dist/wallets/signing/createWalletTransfer.js");class i{static create(e){return new i(e.workchain,e.publicKey)}constructor(e,t){this.workchain=e,this.publicKey=t;let r=o.Cell.fromBoc(n.from("te6cckEBAQEAUwAAov8AIN0gggFMl7qXMO1E0NcLH+Ck8mCBAgDXGCDXCx/tRNDTH9P/0VESuvKhIvkBVBBE+RDyovgAAdMfMSDXSpbTB9QC+wDe0aTIyx/L/8ntVNDieG8=","base64"))[0],s=(0,o.beginCell)().storeUint(0,32).storeBuffer(t).endCell();this.init={code:r,data:s},this.address=(0,o.contractAddress)(e,{code:r,data:s})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){if("active"===(await e.getState()).state.type){return(await e.get("seqno",[])).stack.readNumber()}return 0}async send(e,t){await e.external(t)}async sendTransfer(e,t){let r=this.createTransfer(t);await this.send(e,r)}createTransfer(e){let t=o.SendMode.PAY_GAS_SEPARATELY;return null!==e.sendMode&&void 0!==e.sendMode&&(t=e.sendMode),(0,s.createWalletTransferV1)({seqno:e.seqno,sendMode:t,secretKey:e.secretKey,message:e.message})}sender(e,t){return{send:async r=>
2{let n=await this.getSeqno(e),s=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode,message:(0,o.internal)({to:r.to,value:r.value,extracurrency:r.extracurrency,init:r.init,body:r.body,bounce:r.bounce})});await this.send(e,s)}}}}t.WalletContractV1R2=i},"./node_modules/@ton/ton/dist/wallets/WalletContractV1R3.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletContractV1R3=void 0;const o=r("./node_modules/@ton/core/dist/index.js"),s=r("./node_modules/@ton/ton/dist/wallets/signing/createWalletTransfer.js");class i{static create(e){return new i(e.workchain,e.publicKey)}constructor(e,t){this.workchain=e,this.publicKey=t;let r=o.Cell.fromBoc(n.from("te6cckEBAQEAXwAAuv8AIN0gggFMl7ohggEznLqxnHGw7UTQ0x/XC//jBOCk8mCBAgDXGCDXCx/tRNDTH9P/0VESuvKhIvkBVBBE+RDyovgAAdMfMSDXSpbTB9QC+wDe0aTIyx/L/8ntVLW4bkI=","base64"))[0],s=(0,o.beginCell)().storeUint(0,32).storeBuffer(t).endCell();this.init={code:r,data:s},this.address=(0,o.contractAddress)(e,{code:r,data:s})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){if("active"===(await e.getState()).state.type){return(await e.get("seqno",[])).stack.readNumber()}return 0}async send(e,t){await e.external(t)}async sendTransfer(e,t){let r=this.createTransfer(t);await this.send(e,r)}createTransfer(e){let t=o.SendMode.PAY_GAS_SEPARATELY;return null!==e.sendMode&&void 0!==e.sendMode&&(t=e.sendMode),(0,s.createWalletTransferV1)({seqno:e.seqno,sendMode:t,secretKey:e.secretKey,message:e.message})}sender(e,t){return{send:async r=>
2{let n=await this.getSeqno(e),s=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode,message:(0,o.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})});await this.send(e,s)}}}}t.WalletContractV1R3=i},"./node_modules/@ton/ton/dist/wallets/WalletContractV2R1.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletContractV2R1=void 0;const o=r("./node_modules/@ton/core/dist/index.js"),s=r("./node_modules/@ton/ton/dist/wallets/signing/createWalletTransfer.js");class i{static create(e){return new i(e.workchain,e.publicKey)}constructor(e,t){this.workchain=e,this.publicKey=t;let r=o.Cell.fromBoc(n.from("te6cckEBAQEAVwAAqv8AIN0gggFMl7qXMO1E0NcLH+Ck8mCDCNcYINMf0x8B+CO78mPtRNDTH9P/0VExuvKhA/kBVBBC+RDyovgAApMg10qW0wfUAvsA6NGkyMsfy//J7VShNwu2","base64"))[0],s=(0,o.beginCell)().storeUint(0,32).storeBuffer(t).endCell();this.init={code:r,data:s},this.address=(0,o.contractAddress)(e,{code:r,data:s})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){if("active"===(await e.getState()).state.type){return(await e.get("seqno",[])).stack.readNumber()}return 0}async send(e,t){await e.external(t)}async sendTransfer(e,t){let r=this.createTransfer(t);await this.send(e,r)}createTransfer(e){let t=o.SendMode.PAY_GAS_SEPARATELY;return null!==e.sendMode&&void 0!==e.sendMode&&(t=e.sendMode),(0,s.createWalletTransferV2)({seqno:e.seqno,sendMode:t,secretKey:e.secretKey,messages:e.messages,timeout:e.timeout})}sender(e,t){return{send:async r=>
2{let n=await this.getSeqno(e),s=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode,messages:[(0,o.internal)({to:r.to,value:r.value,extracurrency:r.extracurrency,init:r.init,body:r.body,bounce:r.bounce})]});await this.send(e,s)}}}}t.WalletContractV2R1=i},"./node_modules/@ton/ton/dist/wallets/WalletContractV2R2.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletContractV2R2=void 0;const o=r("./node_modules/@ton/core/dist/index.js"),s=r("./node_modules/@ton/ton/dist/wallets/signing/createWalletTransfer.js");class i{static create(e){return new i(e.workchain,e.publicKey)}constructor(e,t){this.workchain=e,this.publicKey=t;let r=o.Cell.fromBoc(n.from("te6cckEBAQEAYwAAwv8AIN0gggFMl7ohggEznLqxnHGw7UTQ0x/XC//jBOCk8mCDCNcYINMf0x8B+CO78mPtRNDTH9P/0VExuvKhA/kBVBBC+RDyovgAApMg10qW0wfUAvsA6NGkyMsfy//J7VQETNeh","base64"))[0],s=(0,o.beginCell)().storeUint(0,32).storeBuffer(t).endCell();this.init={code:r,data:s},this.address=(0,o.contractAddress)(e,{code:r,data:s})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){if("active"===(await e.getState()).state.type){return(await e.get("seqno",[])).stack.readNumber()}return 0}async send(e,t){await e.external(t)}async sendTransfer(e,t){let r=this.createTransfer(t);await this.send(e,r)}createTransfer(e){let t=o.SendMode.PAY_GAS_SEPARATELY;return null!==e.sendMode&&void 0!==e.sendMode&&(t=e.sendMode),(0,s.createWalletTransferV2)({seqno:e.seqno,sendMode:t,secretKey:e.secretKey,messages:e.messages,timeout:e.timeout})}sender(e,t){return{send:async r=>
2{let n=await this.getSeqno(e),s=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode,messages:[(0,o.internal)({to:r.to,value:r.value,extracurrency:r.extracurrency,init:r.init,body:r.body,bounce:r.bounce})]});await this.send(e,s)}}}}t.WalletContractV2R2=i},"./node_modules/@ton/ton/dist/wallets/WalletContractV3R1.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletContractV3R1=void 0;const o=r("./node_modules/@ton/core/dist/index.js"),s=r("./node_modules/@ton/ton/dist/wallets/signing/createWalletTransfer.js");class i{static create(e){return new i(e.workchain,e.publicKey,e.walletId)}constructor(e,t,r){this.workchain=e,this.publicKey=t,this.walletId=null!=r?r:698983191+e;let s=o.Cell.fromBoc(n.from("te6cckEBAQEAYgAAwP8AIN0gggFMl7qXMO1E0NcLH+Ck8mCDCNcYINMf0x/TH/gjE7vyY+1E0NMf0x/T/9FRMrryoVFEuvKiBPkBVBBV+RDyo/gAkyDXSpbTB9QC+wDo0QGkyMsfyx/L/8ntVD++buA=","base64"))[0],i=(0,o.beginCell)().storeUint(0,32).storeUint(this.walletId,32).storeBuffer(t).endCell();this.init={code:s,data:i},this.address=(0,o.contractAddress)(e,{code:s,data:i})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){if("active"===(await e.getState()).state.type){return(await e.get("seqno",[])).stack.readNumber()}return 0}async send(e,t){await e.external(t)}async sendTransfer(e,t){let r=this.createTransfer(t);await this.send(e,r)}createTransfer(e){return(0,s.createWalletTransferV3)({...e,sendMode:e.sendMode??o.SendMode.PAY_GAS_SEPARATELY,walletId:this.walletId})}sender(e,t){return{send:async r=>
2{let n=await this.getSeqno(e),s=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode,messages:[(0,o.internal)({to:r.to,value:r.value,extracurrency:r.extracurrency,init:r.init,body:r.body,bounce:r.bounce})]});await this.send(e,s)}}}}t.WalletContractV3R1=i},"./node_modules/@ton/ton/dist/wallets/WalletContractV3R2.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletContractV3R2=void 0;const o=r("./node_modules/@ton/core/dist/index.js"),s=r("./node_modules/@ton/ton/dist/wallets/signing/createWalletTransfer.js");class i{static create(e){return new i(e.workchain,e.publicKey,e.walletId)}constructor(e,t,r){this.workchain=e,this.publicKey=t,this.walletId=null!=r?r:698983191+e;let s=o.Cell.fromBoc(n.from("te6cckEBAQEAcQAA3v8AIN0gggFMl7ohggEznLqxn3Gw7UTQ0x/THzHXC//jBOCk8mCDCNcYINMf0x/TH/gjE7vyY+1E0NMf0x/T/9FRMrryoVFEuvKiBPkBVBBV+RDyo/gAkyDXSpbTB9QC+wDo0QGkyMsfyx/L/8ntVBC9ba0=","base64"))[0],i=(0,o.beginCell)().storeUint(0,32).storeUint(this.walletId,32).storeBuffer(t).endCell();this.init={code:s,data:i},this.address=(0,o.contractAddress)(e,{code:s,data:i})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){if("active"===(await e.getState()).state.type){return(await e.get("seqno",[])).stack.readNumber()}return 0}async send(e,t){await e.external(t)}async sendTransfer(e,t){let r=this.createTransfer(t);await this.send(e,r)}createTransfer(e){return(0,s.createWalletTransferV3)({...e,sendMode:e.sendMode??o.SendMode.PAY_GAS_SEPARATELY,walletId:this.walletId})}sender(e,t){return{send:async r=>
2{let n=await this.getSeqno(e),s=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode,messages:[(0,o.internal)({to:r.to,value:r.value,extracurrency:r.extracurrency,init:r.init,body:r.body,bounce:r.bounce})]});await this.send(e,s)}}}}t.WalletContractV3R2=i},"./node_modules/@ton/ton/dist/wallets/WalletContractV4.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletContractV4=void 0;const o=r("./node_modules/@ton/core/dist/index.js"),s=r("./node_modules/@ton/ton/dist/wallets/signing/createWalletTransfer.js");class i{static create(e){return new i(e.workchain,e.publicKey,e.walletId)}constructor(e,t,r){this.workchain=e,this.publicKey=t,this.walletId=null!=r?r:698983191+e;let s=o.Cell.fromBoc(n.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],i=(0,o.beginCell)().storeUint(0,32).storeUint(this.walletId,32).storeBuffer(this.publicKey).storeBit(0).endCell();this.init={code:s,data:i},this.address=(0,o.contractAddress)(e,{code:s,data:i})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){if("active"===(await e.getState()).state.type){return(await e.get("seqno",[])).stack.readNumber()}return 0}async send(e,t){await e.external(t)}async sendTransfer(e,t){let r=this.createTransfer(t);await this.send(e,r)}createTransfer(e){return(0,s.createWalletTransferV4)({...e,sendMode:e.sendMode??o.SendMode.PAY_GAS_SEPARATELY,walletId:this.walletId})}sender(e,t){return{send:async r=>
2{let n=await this.getSeqno(e),s=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode,messages:[(0,o.internal)({to:r.to,value:r.value,extracurrency:r.extracurrency,init:r.init,body:r.body,bounce:r.bounce})]});await this.send(e,s)}}}}t.WalletContractV4=i},"./node_modules/@ton/ton/dist/wallets/WalletContractV5Beta.js"(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r("./node_modules/@ton/ton/dist/wallets/v5beta/WalletContractV5Beta.js"),t),o(r("./node_modules/@ton/ton/dist/wallets/v5beta/WalletV5BetaActions.js"),t),o(r("./node_modules/@ton/ton/dist/wallets/v5beta/WalletV5BetaWalletId.js"),t)},"./node_modules/@ton/ton/dist/wallets/WalletContractV5R1.js"(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r("./node_modules/@ton/ton/dist/wallets/v5r1/WalletContractV5R1.js"),t),o(r("./node_modules/@ton/ton/dist/wallets/v5r1/WalletV5R1Actions.js"),t),o(r("./node_modules/@ton/ton/dist/wallets/v5r1/WalletV5R1WalletId.js"),t)},"./node_modules/@ton/ton/dist/wallets/signing/createWalletTransfer.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createWalletTransferV1=function(e){let t=(0,n.beginCell)().storeUint(e.seqno,32);e.message&&(t.storeUint(e.sendMode,8),t.storeRef((0,n.beginCell)().store((0,n.storeMessageRelaxed)(e.message))));let r=(0,o.sign)(t.endCell().hash(),e.secretKey);return(0,n.beginCell)().storeBuffer(r).storeBuilder(t).endCell()},t.createWalletTransferV2=function(e){if(e.messages.length>4)throw Error("Maximum number of messages in a single transfer is 4");let t=(0,n.beginCell)().storeUint(e.seqno,32);if(0===e.seqno)for(let e=0;e<32;e++)t.storeBit(1);else t.storeUint(e.timeout||Math.floor(Date.now()/1e3)+60,32);for(let r of e.messages)t.storeUint(e.sendMode,8),t.storeRef((0,n.beginCell)().store((0,n.storeMessageRelaxed)(r)));let r=(0,o.sign)(t.endCell().hash(),e.secretKey);return(0,n.beginCell)().storeBuffer(r).storeBuilder(t).endCell()},t.createWalletTransferV3=function(e){if(e.messages.length>4)throw Error("Maximum number of messages in a single transfer is 4");let t=(0,n.beginCell)().storeUint(e.walletId,32);if(0===e.seqno)for(let e=0;e<32;e++)t.storeBit(1);else t.storeUint(e.timeout||Math.floor(Date.now()/1e3)+60,32);t.storeUint(e.seqno,32);for(let r of e.messages)t.storeUint(e.sendMode,8),t.storeRef((0,n.beginCell)().store((0,n.storeMessageRelaxed)(r)));return(0,a.signPayload)(e,t,u)},t.createWalletTransferV4=function(e){if(e.messages.length>4)throw Error("Maximum number of messages in a single transfer is 4");let t=(0,n.beginCell)().storeUint(e.walletId,32);if(0===e.seqno)for(let e=0;e<32;e++)t.storeBit(1);else t.storeUint(e.timeout||Math.floor(Date.now()/1e3)+60,32);t.storeUint(e.seqno,32),t.storeUint(0,8);for(let r of e.messages)t.storeUint(e.sendMode,8),t.storeRef((0,n.beginCell)().store((0,n.storeMessageRelaxed)(r)));return(0,a.signPayload)(e,t,u)},t.createWalletTransferV5Beta=function(e){if(e.actions.length>255)throw Error("Maximum number of OutActions in a single request is 255");if("extension"===e.authType)return(0,n.beginCell)().storeUint(s.WalletContractV5Beta.OpCodes.auth_extension,32).store((0,i.storeOutListExtendedV5Beta)(e.actions)).endCell();const t=(0,n.beginCell)().storeUint("internal"===e.authType?s.WalletContractV5Beta.OpCodes.auth_signed_internal:s.WalletContractV5Beta.OpCodes.auth_signed_external,32).store(e.walletId);if(0===e.seqno)for(let e=0;e<32;e++)t.storeBit(1);else t.storeUint(e.timeout||Math.floor(Date.now()/1e3)+60,32);return t.storeUint(e.seqno,32).store((0,i.storeOutListExtendedV5Beta)(e.actions)),(0,a.signPayload)(e,t,d)},t.createWalletTransferV5R1=function(e){if(e.actions.length>255)throw Error("Maximum number of OutActions in a single request is 255");if("extension"===(e={...e}).authType)return(0,n.beginCell)().storeUint(c.WalletContractV5R1.OpCodes.auth_extension,32).storeUint(e.queryId??0,64).store((0,l.storeOutListExtendedV5R1)(e.actions)).endCell();e.actions=(0,l.patchV5R1ActionsSendMode)(e.actions,e.authType);const t=(0,n.beginCell)().storeUint("internal"===e.authType?c.WalletContractV5R1.OpCodes.auth_signed_internal:c.WalletContractV5R1.OpCodes.auth_signed_external,32).store(e.walletId);if(0===e.seqno)for(let e=0;e<32;e++)t.storeBit(1);else t.storeUint(e.timeout||Math.floor(Date.now()/1e3)+60,32);return t.storeUint(e.seqno,32).store((0,l.storeOutListExtendedV5R1)(e.actions)),(0,a.signPayload)(e,t,d)};const n=r("./node_modules/@ton/core/dist/index.js"),o=r("./node_modules/@ton/crypto/dist/index.js"),s=r("./node_modules/@ton/ton/dist/wallets/v5beta/WalletContractV5Beta.js"),i=r("./node_modules/@ton/ton/dist/wallets/v5beta/WalletV5BetaActions.js"),a=r("./node_modules/@ton/ton/dist/wallets/signing/singer.js"),c=r("./node_modules/@ton/ton/dist/wallets/v5r1/WalletContractV5R1.js"),l=r("./node_modules/@ton/ton/dist/wallets/v5r1/WalletV5R1Actions.js");function u(e,t){return(0,n.beginCell)().storeBuffer(e).storeBuilder(t).endCell()}function d(e,t){return(0,n.beginCell)().storeBuilder(t).storeBuffer(e).endCell()}},"./node_modules/@ton/ton/dist/wallets/signing/singer.js"(e,t,r){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.signPayload=function(e,t,r){return"secretKey"in e?r((0,n.sign)(t.endCell().hash(),e.secretKey),t):e.signer(t.endCell()).then((e=>r(e,t)))};const n=r("./node_modules/@ton/crypto/dist/index.js")},"./node_modules/@ton/ton/dist/wallets/v5beta/WalletContractV5Beta.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletContractV5Beta=void 0;const o=r("./node_modules/@ton/core/dist/index.js"),s=r("./node_modules/@ton/ton/dist/wallets/signing/createWalletTransfer.js"),i=r("./node_modules/@ton/ton/dist/wallets/v5beta/WalletV5BetaWalletId.js");class a{static create(e){const t={networkGlobalId:e.walletId?.networkGlobalId??-239,workchain:e?.walletId?.workchain??0,subwalletNumber:e?.walletId?.subwalletNumber??0,walletVersion:e?.walletId?.walletVersion??"v5"};return new a(t,e.publicKey)}constructor(e,t){this.walletId=e,this.publicKey=t,this.walletId=e;let r=o.Cell.fromBoc(n.from("te6cckEBAQEAIwAIQgLkzzsvTG1qYeoPK1RH0mZ4WyavNjfbLe7mvNGqgm80Eg3NjhE=","base64"))[0],s=(0,o.beginCell)().storeInt(0,33).store((0,i.storeWalletIdV5Beta)(this.walletId)).storeBuffer(this.publicKey,32).storeBit(0).endCell();this.init={code:r,data:s},this.address=(0,o.contractAddress)(this.walletId.workchain,{code:r,data:s})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){if("active"===(await e.getState()).state.type){return(await e.get("seqno",[])).stack.readNumber()}return 0}async getExtensions(e){if("active"===(await e.getState()).state.type){return(await e.get("get_extensions",[])).stack.readCellOpt()}return null}async getExtensionsArray(e){const t=await this.getExtensions(e);if(!t)return[];const r=o.Dictionary.loadDirect(o.Dictionary.Keys.BigUint(256),o.Dictionary.Values.BigInt(8),t);return r.keys().map((e=>{const t=r.get(e),n=e^t+1n;return o.Address.parseRaw(`${t}:${n.toString(16).padStart(64,"0")}`)}))}async getIsSecretKeyAuthEnabled(e){return 0!==(await e.get("get_is_signature_auth_allowed",[])).stack.readNumber()}async send(e,t){await e.external(t)}async sendTransfer(e,t){const r=await this.createTransfer(t);await this.send(e,r)}async sendAddExtension(e,t){const r=await this.createAddExtension(t);await this.send(e,r)}async sendRemoveExtension(e,t){const r=await this.createRemoveExtension(t);await this.send(e,r)}async sendActionsBatch(e,t){const r=await this.createRequest(t);await this.send(e,r)}createActions(e){return e.messages.map((t=>({type:"sendMsg",mode:e.sendMode,outMsg:t})))}createTransfer(e){return this.createRequest({...e,actions:this.createActions({messages:e.messages,sendMode:e.sendMode})})}createAddExtension(e){return this.createRequest({...e,actions:[{type:"addExtension",address:e.extensionAddress}]})}createRemoveExtension(e){return this.createRequest({...e,actions:[{type:"removeExtension",address:e.extensionAddress}]})}createRequest(e){return"extension"===e.authType?(0,s.createWalletTransferV5Beta)(e):(0,s.createWalletTransferV5Beta)({...e,walletId:(0,i.storeWalletIdV5Beta)(this.walletId)})}sender(e,t){return{send:async r=>
2{let n=await this.getSeqno(e),s=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode??o.SendMode.PAY_GAS_SEPARATELY+o.SendMode.IGNORE_ERRORS,messages:[(0,o.internal)({to:r.to,value:r.value,extracurrency:r.extracurrency,init:r.init,body:r.body,bounce:r.bounce})]});await this.send(e,s)}}}}t.WalletContractV5Beta=a,a.OpCodes={auth_extension:1702392942,auth_signed_external:1936287598,auth_signed_internal:1936289396}},"./node_modules/@ton/ton/dist/wallets/v5beta/WalletV5BetaActions.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeOutActionExtendedV5Beta=c,t.loadOutActionV5BetaExtended=l,t.storeOutListExtendedV5Beta=function e(t){const[r,...s]=t;if(!r||!(0,o.isOutActionExtended)(r)){if(t.some(o.isOutActionExtended))throw new Error("Can't serialize actions list: all extended actions must be placed before out actions");return e=>{e.storeUint(0,1).storeRef((0,n.beginCell)().store((0,n.storeOutList)(t)).endCell())}}return t=>{t.storeUint(1,1).store(c(r)).storeRef((0,n.beginCell)().store(e(s)).endCell())}},t.loadOutListExtendedV5Beta=function(e){const t=[];for(;e.loadUint(1);){const r=l(e);t.push(r),e=e.loadRef().beginParse()}const r=(0,n.loadOutList)(e.loadRef().beginParse());if(r.some((e=>"setCode"===e.type)))throw new Error("Can't deserialize actions list: only sendMsg actions are allowed for wallet v5");return t.concat(r)};const n=r("./node_modules/@ton/core/dist/index.js"),o=r("./node_modules/@ton/ton/dist/wallets/v5beta/WalletV5OutActions.js"),s=550222170;const i=474012575;const a=1588524196;function c(e){switch(e.type){case"setIsPublicKeyEnabled":return function(e){return t=>{t.storeUint(s,32).storeUint(e.isEnabled?1:0,1)}}(e);case"addExtension":return function(e){return t=>{t.storeUint(i,32).storeAddress(e.address)}}(e);case"removeExtension":return function(e){return t=>{t.storeUint(a,32).storeAddress(e.address)}}(e);default:throw new Error("Unknown action type"+e?.type)}}function l(e){const t=e.loadUint(32);switch(t){case s:return{type:"setIsPublicKeyEnabled",isEnabled:!!e.loadUint(1)};case i:return{type:"addExtension",address:e.loadAddress()};case a:return{type:"removeExtension",address:e.loadAddress()};default:throw new Error(`Unknown extended out action tag 0x${t.toString(16)}`)}}},"./node_modules/@ton/ton/dist/wallets/v5beta/WalletV5BetaWalletId.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.loadWalletIdV5Beta=function(e){const t=new o.BitReader(new o.BitString("bigint"==typeof e?n.from(e.toString(16),"hex"):e instanceof o.Slice?e.loadBuffer(10):e,0,80)),r=t.loadInt(32),i=t.loadInt(8),a=t.loadUint(8),c=t.loadUint(32),l=Object.entries(s).find((([e,t])=>t===a))?.[0];if(void 0===l)throw new Error(`Can't deserialize walletId: unknown wallet version ${a}`);return{networkGlobalId:r,workchain:i,walletVersion:l,subwalletNumber:c}},t.storeWalletIdV5Beta=function(e){return t=>{t.storeInt(e.networkGlobalId,32),t.storeInt(e.workchain,8),t.storeUint(s[e.walletVersion],8),t.storeUint(e.subwalletNumber,32)}};const o=r("./node_modules/@ton/core/dist/index.js"),s={v5:0}},"./node_modules/@ton/ton/dist/wallets/v5beta/WalletV5OutActions.js"(e,t){"use strict";function r(e){return"setIsPublicKeyEnabled"===e.type||"addExtension"===e.type||"removeExtension"===e.type}Object.defineProperty(t,"__esModule",{value:!0}),t.isOutActionExtended=r,t.isOutActionBasic=function(e){return!r(e)}},"./node_modules/@ton/ton/dist/wallets/v5r1/WalletContractV5R1.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletContractV5R1=void 0;const o=r("./node_modules/@ton/core/dist/index.js"),s=r("./node_modules/@ton/ton/dist/wallets/signing/createWalletTransfer.js"),i=r("./node_modules/@ton/ton/dist/wallets/v5r1/WalletV5R1WalletId.js");class a{static create(e){let t=0;return"workchain"in e&&null!=e.workchain&&(t=e.workchain),e.walletId?.context&&(0,i.isWalletIdV5R1ClientContext)(e.walletId.context)&&null!=e.walletId.context.workchain&&(t=e.walletId.context.workchain),new a(t,e.publicKey,{networkGlobalId:e.walletId?.networkGlobalId??-239,context:e.walletId?.context??{workchain:0,walletVersion:"v5r1",subwalletNumber:0}})}constructor(e,t,r){this.publicKey=t,this.walletId=r,this.walletId=r;let s=o.Cell.fromBoc(n.from("b5ee9c7241021401000281000114ff00f4a413f4bcf2c80b01020120020d020148030402dcd020d749c120915b8f6320d70b1f2082106578746ebd21821073696e74bdb0925f03e082106578746eba8eb48020d72101d074d721fa4030fa44f828fa443058bd915be0ed44d0810141d721f4058307f40e6fa1319130e18040d721707fdb3ce03120d749810280b99130e070e2100f020120050c020120060902016e07080019adce76a2684020eb90eb85ffc00019af1df6a2684010eb90eb858fc00201480a0b0017b325fb51341c75c875c2c7e00011b262fb513435c280200019be5f0f6a2684080a0eb90fa02c0102f20e011e20d70b1f82107369676ebaf2e08a7f0f01e68ef0eda2edfb218308d722028308d723208020d721d31fd31fd31fed44d0d200d31f20d31fd3ffd70a000af90140ccf9109a28945f0adb31e1f2c087df02b35007b0f2d0845125baf2e0855036baf2e086f823bbf2d0882292f800de01a47fc8ca00cb1f01cf16c9ed542092f80fde70db3cd81003f6eda2edfb02f404216e926c218e4c0221d73930709421c700b38e2d01d72820761e436c20d749c008f2e09320d74ac002f2e09320d71d06c712c2005230b0f2d089d74cd7393001a4e86c128407bbf2e093d74ac000f2e093ed55e2d20001c000915be0ebd72c08142091709601d72c081c12e25210b1e30f20d74a111213009601fa4001fa44f828fa443058baf2e091ed44d0810141d718f405049d7fc8ca0040048307f453f2e08b8e14038307f45bf2e08c22d70a00216e01b3b0f2d090e2c85003cf1612f400c9ed54007230d72c08248e2d21f2e092d200ed44d0d2005113baf2d08f54503091319c01810140d721d70a00f2e08ee2c8ca0058cf16c9ed5493f2c08de20010935bdb31e1d74cd0b4d6c35e","hex"))[0],a=(0,o.beginCell)().storeUint(1,1).storeUint(0,32).store((0,i.storeWalletIdV5R1)(this.walletId)).storeBuffer(this.publicKey,32).storeBit(0).endCell();this.init={code:s,data:a},this.address=(0,o.contractAddress)(e,{code:s,data:a})}async getBalance(e){return(await e.getState()).balance}async getSeqno(e){if("active"===(await e.getState()).state.type){return(await e.get("seqno",[])).stack.readNumber()}return 0}async getExtensions(e){if("active"===(await e.getState()).state.type){return(await e.get("get_extensions",[])).stack.readCellOpt()}return null}async getExtensionsArray(e){const t=await this.getExtensions(e);if(!t)return[];return o.Dictionary.loadDirect(o.Dictionary.Keys.BigUint(256),o.Dictionary.Values.BigInt(1),t).keys().map((e=>{const t=this.address.workChain;return o.Address.parseRaw(`${t}:${e.toString(16).padStart(64,"0")}`)}))}async getIsSecretKeyAuthEnabled(e){return(await e.get("is_signature_allowed",[])).stack.readBoolean()}async send(e,t){await e.external(t)}async sendTransfer(e,t){const r=await this.createTransfer(t);await this.send(e,r)}async sendAddExtension(e,t){const r=await this.createAddExtension(t);await this.send(e,r)}async sendRemoveExtension(e,t){const r=await this.createRemoveExtension(t);await this.send(e,r)}createActions(e){return e.messages.map((t=>({type:"sendMsg",mode:e.sendMode,outMsg:t})))}createTransfer(e){return this.createRequest({actions:this.createActions({messages:e.messages,sendMode:e.sendMode}),...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})}createRequest(e){return"extension"===e.authType?(0,s.createWalletTransferV5R1)(e):(0,s.createWalletTransferV5R1)({...e,walletId:(0,i.storeWalletIdV5R1)(this.walletId)})}sender(e,t){return{send:async r=>
2{let n=await this.getSeqno(e),s=this.createTransfer({seqno:n,secretKey:t,sendMode:r.sendMode??o.SendMode.PAY_GAS_SEPARATELY+o.SendMode.IGNORE_ERRORS,messages:[(0,o.internal)({to:r.to,value:r.value,extracurrency:r.extracurrency,init:r.init,body:r.body,bounce:r.bounce})]});await this.send(e,s)}}}}t.WalletContractV5R1=a,a.OpCodes={auth_extension:1702392942,auth_signed_external:1936287598,auth_signed_internal:1936289396}},"./node_modules/@ton/ton/dist/wallets/v5r1/WalletV5R1Actions.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeOutActionExtendedV5R1=s,t.loadOutActionExtendedV5R1=i,t.storeOutListExtendedV5R1=function(e){const t=e.filter(o.isOutActionExtended),r=e.filter(o.isOutActionBasic);return e=>{const o=r.length?(0,n.beginCell)().store((0,n.storeOutList)(r.slice().reverse())):null;if(e.storeMaybeRef(o),0===t.length)e.storeUint(0,1);else{const[r,...n]=t;e.storeUint(1,1).store(s(r)),n.length>0&&e.storeRef(a(n))}}},t.loadOutListExtendedV5R1=function(e){const t=[],r=e.loadMaybeRef();if(r){const e=(0,n.loadOutList)(r.beginParse());if(e.some((e=>"sendMsg"!==e.type)))throw new Error("Can't deserialize actions list: only sendMsg actions are allowed for wallet v5r1");t.push(...e)}if(e.loadBoolean()){const r=i(e);t.push(r)}for(;e.remainingRefs>0;){const r=i(e=e.loadRef().beginParse());t.push(r)}return t},t.toSafeV5R1SendMode=c,t.patchV5R1ActionsSendMode=function(e,t){return e.map((e=>"sendMsg"===e.type?{...e,mode:c(e.mode,t)}:e))};const n=r("./node_modules/@ton/core/dist/index.js"),o=r("./node_modules/@ton/ton/dist/wallets/v5beta/WalletV5OutActions.js");function s(e){switch(e.type){case"setIsPublicKeyEnabled":return function(e){return t=>{t.storeUint(4,8).storeUint(e.isEnabled?1:0,1)}}(e);case"addExtension":return function(e){return t=>{t.storeUint(2,8).storeAddress(e.address)}}(e);case"removeExtension":return function(e){return t=>{t.storeUint(3,8).storeAddress(e.address)}}(e);default:throw new Error("Unknown action type"+e?.type)}}function i(e){const t=e.loadUint(8);switch(t){case 4:return{type:"setIsPublicKeyEnabled",isEnabled:!!e.loadUint(1)};case 2:return{type:"addExtension",address:e.loadAddress()};case 3:return{type:"removeExtension",address:e.loadAddress()};default:throw new Error(`Unknown extended out action tag 0x${t.toString(16)}`)}}function a(e){const[t,...r]=e;let o=(0,n.beginCell)().store(s(t));return r.length>0&&(o=o.storeRef(a(r))),o.endCell()}function c(e,t){return"internal"===t||"extension"===t?e:e|n.SendMode.IGNORE_ERRORS}},"./node_modules/@ton/ton/dist/wallets/v5r1/WalletV5R1WalletId.js"(e,t,r){"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.isWalletIdV5R1ClientContext=s,t.loadWalletIdV5R1=function(e,t){const r=new o.BitReader(new o.BitString("bigint"==typeof e?n.from(e.toString(16),"hex"):e instanceof o.Slice?e.loadBuffer(4):e,0,32)).loadInt(32),s=BigInt(r)^BigInt(t),a=(0,o.beginCell)().storeInt(s,32).endCell().beginParse();if(a.loadUint(1)){const e=a.loadInt(8),r=a.loadUint(8),n=a.loadUint(15),o=Object.entries(i).find((([e,t])=>t===r))?.[0];if(void 0===o)throw new Error(`Can't deserialize walletId: unknown wallet version ${r}`);return{networkGlobalId:t,context:{walletVersion:o,workchain:e,subwalletNumber:n}}}return{networkGlobalId:t,context:a.loadUint(31)}},t.storeWalletIdV5R1=function(e){return t=>{let r;return r=s(e.context)?(0,o.beginCell)().storeUint(1,1).storeInt(e.context.workchain,8).storeUint(i[e.context.walletVersion],8).storeUint(e.context.subwalletNumber,15).endCell().beginParse().loadInt(32):(0,o.beginCell)().storeUint(0,1).storeUint(e.context,31).endCell().beginParse().loadInt(32),t.storeInt(BigInt(e.networkGlobalId)^BigInt(r),32)}};const o=r("./node_modules/@ton/core/dist/index.js");function s(e){return"number"!=typeof e}const i={v5r1:0}},"./node_modules/@tronweb3/google-protobuf/google-protobuf.js"(e,t,r){var n="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,r){e!=Array.prototype&&e!=Object.prototype&&(e[t]=r.value)},o="undefined"!=typeof window&&window===this?this:void 0!==r.g&&null!=r.g?r.g:this;function s(){s=function(){}
vendor: 27,642 bytes, line 2
2,o.Symbol||(o.Symbol=c)}function i(e,t){this.a=e,n(this,"description",{configurable:!0,writable:!0,value:t})}i.prototype.toString=function(){return this.a};var a,c=(a=0,function e(t){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new i("jscomp_symbol_"+(t||"")+"_"+a++,t)});function l(){s();var e=o.Symbol.iterator;e||(e=o.Symbol.iterator=o.Symbol("Symbol.iterator")),"function"!=typeof Array.prototype[e]&&n(Array.prototype,e,{configurable:!0,writable:!0,value:function(){return function(e){return l(),e={next:e},e[o.Symbol.iterator]=function(){return this},e}(function(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}(this))}}),l=function(){}}!function(e,t){if(t){var r=o;e=e.split(".");for(var s=0;s<e.length-1;s++){var i=e[s];i in r||(r[i]={}),r=r[i]}(t=t(s=r[e=e[e.length-1]]))!=s&&null!=t&&n(r,e,{configurable:!0,writable:!0,value:t})}}("Array.prototype.entries",(function(e){return e||function(){return function(e,t){l(),e instanceof String&&(e+="");var r=0,n={next:function(){if(r<e.length){var o=r++;return{value:t(o,e[o]),done:!1}}return n.next=function(){return{done:!0,value:void 0}},n.next()}};return n[Symbol.iterator]=function(){return n},n}(this,(function(e,t){return[e,t]}))}}));var u=this||self;function d(e,t,r){e=e.split("."),r=r||u,e[0]in r||void 0===r.execScript||r.execScript("var "+e[0]);for(var n;e.length&&(n=e.shift());)e.length||void 0===t?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=t}function h(e){var t=typeof e;if("object"==t){if(!e)return"null";if(e instanceof Array)return"array";if(e instanceof Object)return t;var r=Object.prototype.toString.call(e);if("[object Window]"==r)return"object";if("[object Array]"==r||"number"==typeof e.length&&void 0!==e.splice&&void 0!==e.propertyIsEnumerable&&!e.propertyIsEnumerable("splice"))return"array";if("[object Function]"==r||void 0!==e.call&&void 0!==e.propertyIsEnumerable&&!e.propertyIsEnumerable("call"))return"function"}else if("function"==t&&void 0===e.call)return"object";return t}function p(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}var f="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");var g=Array.prototype.forEach?function(e,t){Array.prototype.forEach.call(e,t,void 0)}:function(e,t){for(var r=e.length,n="string"==typeof e?e.split(""):e,o=0;o<r;o++)o in n&&t.call(void 0,n[o],o,e)},m=Array.prototype.map?function(e,t){return Array.prototype.map.call(e,t,void 0)}:function(e,t){for(var r=e.length,n=Array(r),o="string"==typeof e?e.split(""):e,s=0;s<r;s++)s in o&&(n[s]=t.call(void 0,o[s],s,e));return n};function y(e,t,r){return 2>=arguments.length?Array.prototype.slice.call(e,t):Array.prototype.slice.call(e,t,r)}function b(e,t,r,n){var o="Assertion failed";if(r){o+=": "+r;var s=n}else e&&(o+=": "+e,s=t);throw Error(o,s||[])}function w(e,t,r){for(var n=[],o=2;o<arguments.length;++o)n[o-2]=arguments[o];return e||b("",null,t,n),e}function v(e,t){for(var r=[],n=1;n<arguments.length;++n)r[n-1]=arguments[n];throw Error("Failure"+(e?": "+e:""),r)}function A(e,t,r,n){for(var o=[],s=3;s<arguments.length;++s)o[s-3]=arguments[s];e instanceof t||b("Expected instanceof %s but got %s.",[T(t),T(e)],r,o)}function T(e){return e instanceof Function?e.displayName||e.name||"unknown type name":e instanceof Object?e.constructor.displayName||e.constructor.name||Object.prototype.toString.call(e):null===e?"null":typeof e}function P(e,t){if(this.c=e,this.b=t,this.a={},this.arrClean=!0,0<this.c.length){for(e=0;e<this.c.length;e++){var r=(t=this.c[e])[0];this.a[r.toString()]=new _(r,t[1])}this.arrClean=!0}}function E(e){this.a=0,this.b=e}function C(e,t){return e.b?(t.a||(t.a=new e.b(t.value)),t.a):t.value}function k(e){e=e.a;var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.push(t);return r}function _(e,t){this.key=e,this.value=t,this.a=void 0}function I(e){if(8192>=e.length)return String.fromCharCode.apply(null,e);for(var t="",r=0;r<e.length;r+=8192)t+=String.fromCharCode.apply(null,y(e,r,r+8192));return t}d("jspb.Map",P,void 0),P.prototype.g=function(){if(this.arrClean){if(this.b){var e,t=this.a;for(e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var r=t[e].a;r&&r.g()}}}else{for(this.c.length=0,(t=k(this)).sort(),e=0;e<t.length;e++){var n=this.a[t[e]];(r=n.a)&&r.g(),this.c.push([n.key,n.value])}this.arrClean=!0}return this.c},P.prototype.toArray=P.prototype.g,P.prototype.Mc=function(e,t){for(var r=this.g(),n=[],o=0;o<r.length;o++){var s=this.a[r[o][0].toString()];C(this,s);var i=s.a;i?(w(t),n.push([s.key,t(e,i)])):n.push([s.key,s.value])}return n},P.prototype.toObject=P.prototype.Mc,P.fromObject=function(e,t,r){t=new P([],t);for(var n=0;n<e.length;n++){var o=e[n][0],s=r(e[n][1]);t.set(o,s)}return t},E.prototype.next=function(){return this.a<this.b.length?{done:!1,value:this.b[this.a++]}:{done:!0,value:void 0}},"undefined"!=typeof Symbol&&(E.prototype[Symbol.iterator]=function(){return this}),P.prototype.Jb=function(){return k(this).length},P.prototype.getLength=P.prototype.Jb,P.prototype.clear=function(){this.a={},this.arrClean=!1},P.prototype.clear=P.prototype.clear,P.prototype.Cb=function(e){e=e.toString();var t=this.a.hasOwnProperty(e);return delete this.a[e],this.arrClean=!1,t},P.prototype.del=P.prototype.Cb,P.prototype.Eb=function(){var e=[],t=k(this);t.sort();for(var r=0;r<t.length;r++){var n=this.a[t[r]];e.push([n.key,n.value])}return e},P.prototype.getEntryList=P.prototype.Eb,P.prototype.entries=function(){var e=[],t=k(this);t.sort();for(var r=0;r<t.length;r++){var n=this.a[t[r]];e.push([n.key,C(this,n)])}return new E(e)},P.prototype.entries=P.prototype.entries,P.prototype.keys=function(){var e=[],t=k(this);t.sort();for(var r=0;r<t.length;r++)e.push(this.a[t[r]].key);return new E(e)},P.prototype.keys=P.prototype.keys,P.prototype.values=function(){var e=[],t=k(this);t.sort();for(var r=0;r<t.length;r++)e.push(C(this,this.a[t[r]]));return new E(e)},P.prototype.values=P.prototype.values,P.prototype.forEach=function(e,t){var r=k(this);r.sort();for(var n=0;n<r.length;n++){var o=this.a[r[n]];e.call(t,C(this,o),o.key,this)}},P.prototype.forEach=P.prototype.forEach,P.prototype.set=function(e,t){var r=new _(e);return this.b?(r.a=t,r.value=t.g()):r.value=t,this.a[e.toString()]=r,this.arrClean=!1,this},P.prototype.set=P.prototype.set,P.prototype.get=function(e){if(e=this.a[e.toString()])return C(this,e)},P.prototype.get=P.prototype.get,P.prototype.has=function(e){return e.toString()in this.a},P.prototype.has=P.prototype.has,P.prototype.Jc=function(e,t,r,n,o){var s=k(this);s.sort();for(var i=0;i<s.length;i++){var a=this.a[s[i]];t.Va(e),r.call(t,1,a.key),this.b?n.call(t,2,C(this,a),o):n.call(t,2,a.value),t.Ya()}},P.prototype.serializeBinary=P.prototype.Jc,P.deserializeBinary=function(e,t,r,n,o,s,i){for(;t.oa()&&!t.bb();){var a=t.c;1==a?s=r.call(t):2==a&&(e.b?(w(o),i||(i=new e.b),n.call(t,i,o)):i=n.call(t))}w(null!=s),w(null!=i),e.set(s,i)};var S={"\0":"\\0","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\x0B",'"':'\\"',"\\":"\\\\","<":"\\u003C"},x={"'":"\\'"},B={},O=null;function M(e,t){void 0===t&&(t=0),j(),t=B[t];for(var r=[],n=0;n<e.length;n+=3){var o=e[n],s=n+1<e.length,i=s?e[n+1]:0,a=n+2<e.length,c=a?e[n+2]:0,l=o>>2;o=(3&o)<<4|i>>4,i=(15&i)<<2|c>>6,c&=63,a||(c=64,s||(i=64)),r.push(t[l],t[o],t[i]||"",t[c]||"")}return r.join("")}function W(e){var t=e.length,r=3*t/4;r%3?r=Math.floor(r):-1!="=.".indexOf(e[t-1])&&(r=-1!="=.".indexOf(e[t-2])?r-2:r-1);var n=new Uint8Array(r),o=0;return function(e,t){function r(t){for(;n<e.length;){var r=e.charAt(n++),o=O[r];if(null!=o)return o;if(!/^[\s\xa0]*$/.test(r))throw Error("Unknown base64 encoding at char: "+r)}return t}j();for(var n=0;;){var o=r(-1),s=r(0),i=r(64),a=r(64);if(64===a&&-1===o)break;t(o<<2|s>>4),64!=i&&(t(s<<4&240|i>>2),64!=a&&t(i<<6&192|a))}}(e,(function(e){n[o++]=e})),n.subarray(0,o)}function j(){if(!O){O={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],r=0;5>r;r++){var n=e.concat(t[r].split(""));B[r]=n;for(var o=0;o<n.length;o++){var s=n[o];void 0===O[s]&&(O[s]=o)}}}}d("jspb.ConstBinaryMessage",(function(){}),void 0),d("jspb.BinaryMessage",(function(){}),void 0),d("jspb.BinaryConstants.FieldType",{yb:-1,ee:1,FLOAT:2,ke:3,te:4,je:5,xb:6,wb:7,BOOL:8,re:9,ie:10,le:11,ce:12,se:13,ge:14,me:15,ne:16,oe:17,pe:18,he:30,ve:31},void 0),d("jspb.BinaryConstants.WireType",{yb:-1,ue:0,xb:1,de:2,qe:3,fe:4,wb:5},void 0),d("jspb.BinaryConstants.FieldTypeToWireType",(function(e){switch(e){case 5:case 3:case 13:case 4:case 17:case 18:case 8:case 14:case 31:return 0;case 1:case 6:case 16:case 30:return 1;case 9:case 11:case 12:return 2;case 2:case 7:case 15:return 5;default:return-1}}),void 0),d("jspb.BinaryConstants.INVALID_FIELD_NUMBER",-1,void 0),d("jspb.BinaryConstants.FLOAT32_EPS",1401298464324817e-60,void 0),d("jspb.BinaryConstants.FLOAT32_MIN",11754943508222875e-54,void 0),d("jspb.BinaryConstants.FLOAT32_MAX",34028234663852886e22,void 0),d("jspb.BinaryConstants.FLOAT64_EPS",5e-324,void 0),d("jspb.BinaryConstants.FLOAT64_MIN",22250738585072014e-324,void 0),d("jspb.BinaryConstants.FLOAT64_MAX",17976931348623157e292,void 0),d("jspb.BinaryConstants.TWO_TO_20",1048576,void 0),d("jspb.BinaryConstants.TWO_TO_23",8388608,void 0),d("jspb.BinaryConstants.TWO_TO_31",2147483648,void 0),d("jspb.BinaryConstants.TWO_TO_32",4294967296,void 0),d("jspb.BinaryConstants.TWO_TO_52",4503599627370496,void 0),d("jspb.BinaryConstants.TWO_TO_63",0x8000000000000000,void 0),d("jspb.BinaryConstants.TWO_TO_64",0x10000000000000000,void 0),d("jspb.BinaryConstants.ZERO_HASH","\0\0\0\0\0\0\0\0",void 0);var R=0,N=0;function U(e){var t=e>>>0;e=Math.floor((e-t)/4294967296)>>>0,R=t,N=e}function D(e){var t=0>e,r=(e=Math.abs(e))>>>0;e=Math.floor((e-r)/4294967296),e>>>=0,t&&(e=~e>>>0,4294967295<(r=1+(~r>>>0))&&(r=0,4294967295<++e&&(e=0))),R=r,N=e}function L(e){var t=0>e;U(e=2*Math.abs(e)),e=R;var r=N;t&&(0==e?0==r?r=e=4294967295:(r--,e=4294967295):e--),R=e,N=r}function F(e){var t=0>e?1:0;if(0===(e=t?-e:e))0<1/e?R=N=0:(N=0,R=2147483648);else if(isNaN(e))N=0,R=2147483647;else if(34028234663852886e22<e)N=0,R=(t<<31|2139095040)>>>0;else if(11754943508222875e-54>e)e=Math.round(e/Math.pow(2,-149)),N=0,R=(t<<31|e)>>>0;else{var r=Math.floor(Math.log(e)/Math.LN2);e*=Math.pow(2,-r),16777216<=(e=Math.round(8388608*e))&&++r,N=0,R=(t<<31|r+127<<23|8388607&e)>>>0}}function z(e){var t=0>e?1:0;if(0===(e=t?-e:e))N=0<1/e?0:2147483648,R=0;else if(isNaN(e))N=2147483647,R=4294967295;else if(17976931348623157e292<e)N=(t<<31|2146435072)>>>0,R=0;else if(22250738585072014e-324>e)e/=Math.pow(2,-1074),N=(t<<31|e/4294967296)>>>0,R=e>>>0;else{var r=e,n=0;if(2<=r)for(;2<=r&&1023>n;)n++,r/=2;else for(;1>r&&-1022<n;)r*=2,n--;e*=Math.pow(2,-n),N=(t<<31|n+1023<<20|1048576*e&1048575)>>>0,R=4503599627370496*e>>>0}}function V(e){var t=e.charCodeAt(4),r=e.charCodeAt(5),n=e.charCodeAt(6),o=e.charCodeAt(7);R=e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)>>>0,N=t+(r<<8)+(n<<16)+(o<<24)>>>0}function q(e,t){return 4294967296*t+(e>>>0)}function H(e,t){var r=2147483648&t;return r&&(t=~t>>>0,0==(e=1+~e>>>0)&&(t=t+1>>>0)),e=q(e,t),r?-e:e}function K(e,t,r){var n=t>>31;return r(e<<1^n,(t<<1|e>>>31)^n)}function $(e,t){return G(e,t,H)}function G(e,t,r){var n=-(1&e);return r((e>>>1|t<<31)^n,t>>>1^n)}function Y(e){var t=2*(e>>31)+1,r=e>>>23&255;return e&=8388607,255==r?e?NaN:1/0*t:0==r?t*Math.pow(2,-149)*e:t*Math.pow(2,r-150)*(e+Math.pow(2,23))}function J(e,t){var r=2*(t>>31)+1,n=t>>>20&2047;return e=4294967296*(1048575&t)+e,2047==n?e?NaN:1/0*r:0==n?r*Math.pow(2,-1074)*e:r*Math.pow(2,n-1075)*(e+4503599627370496)}function Q(e,t){return String.fromCharCode(e>>>0&255,e>>>8&255,e>>>16&255,e>>>24&255,t>>>0&255,t>>>8&255,t>>>16&255,t>>>24&255)}function Z(e,t){function r(e,t){return e=e?String(e):"",t?"0000000".slice(e.length)+e:e}if(2097151>=t)return""+q(e,t);var n=(e>>>24|t<<8)>>>0&16777215;return e=(16777215&e)+6777216*n+6710656*(t=t>>16&65535),n+=8147497*t,t*=2,1e7<=e&&(n+=Math.floor(e/1e7),e%=1e7),1e7<=n&&(t+=Math.floor(n/1e7),n%=1e7),r(t,0)+r(n,t)+r(e,1)}function X(e,t){var r=2147483648&t;return r&&(t=~t+(0==(e=1+~e>>>0)?1:0)>>>0),e=Z(e,t),r?"-"+e:e}function ee(e,t){V(e),e=R;var r=N;return t?X(e,r):Z(e,r)}function te(e){function t(e,t){for(var r=0;8>r&&(1!==e||0<t);r++)t=e*n[r]+t,n[r]=255&t,t>>>=8}w(0<e.length);var r=!1;"-"===e[0]&&(r=!0,e=e.slice(1));for(var n=[0,0,0,0,0,0,0,0],o=0;o<e.length;o++)t(10,e.charCodeAt(o)-48);return r&&(function(){for(var e=0;8>e;e++)n[e]=255&~n[e]}(),t(1,1)),I(n)}function re(e){return String.fromCharCode(10>e?48+e:87+e)}function ne(e){return 97<=e?e-97+10:e-48}function oe(e,t,r,n,o){var s=0;if(128>n)for(;t<r&&e[t++]==n;)s++,t+=o;else for(;t<r;){for(var i=n;128<i;){if(e[t++]!=(127&i|128))return s;i>>=7}if(e[t++]!=i)break;s++,t+=o}return s}function se(e){return e.constructor===Uint8Array?e:e.constructor===ArrayBuffer||e.constructor===Array?new Uint8Array(e):e.constructor===String?W(e):e instanceof Uint8Array?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):(v("Type not convertible to Uint8Array."),new Uint8Array(0))}function ie(e,t,r){this.b=null,this.a=this.c=this.h=0,this.v=!1,e&&this.H(e,t,r)}d("jspb.utils.getSplit64Low",(function(){return R}),void 0),d("jspb.utils.getSplit64High",(function(){return N}),void 0),d("jspb.utils.splitUint64",U,void 0),d("jspb.utils.splitInt64",D,void 0),d("jspb.utils.splitZigzag64",L,void 0),d("jspb.utils.splitFloat32",F,void 0),d("jspb.utils.splitFloat64",z,void 0),d("jspb.utils.splitHash64",V,void 0),d("jspb.utils.joinUint64",q,void 0),d("jspb.utils.joinInt64",H,void 0),d("jspb.utils.toZigzag64",K,void 0),d("jspb.utils.joinZigzag64",$,void 0),d("jspb.utils.fromZigzag64",G,void 0),d("jspb.utils.joinFloat32",Y,void 0),d("jspb.utils.joinFloat64",J,void 0),d("jspb.utils.joinHash64",Q,void 0),d("jspb.utils.DIGITS","0123456789abcdef".split(""),void 0),d("jspb.utils.joinUnsignedDecimalString",Z,void 0),d("jspb.utils.joinSignedDecimalString",X,void 0),d("jspb.utils.hash64ToDecimalString",ee,void 0),d("jspb.utils.hash64ArrayToDecimalStrings",(function(e,t){for(var r=Array(e.length),n=0;n<e.length;n++)r[n]=ee(e[n],t);return r}),void 0),d("jspb.utils.decimalStringToHash64",te,void 0),d("jspb.utils.splitDecimalString",(function(e){V(te(e))}),void 0),d("jspb.utils.hash64ToHexString",(function(e){var t=Array(18);t[0]="0",t[1]="x";for(var r=0;8>r;r++){var n=e.charCodeAt(7-r);t[2*r+2]=re(n>>4),t[2*r+3]=re(15&n)}return t.join("")}),void 0),d("jspb.utils.hexStringToHash64",(function(e){w(18==(e=e.toLowerCase()).length),w("0"==e[0]),w("x"==e[1]);for(var t="",r=0;8>r;r++)t=String.fromCharCode(16*ne(e.charCodeAt(2*r+2))+ne(e.charCodeAt(2*r+3)))+t;return t}),void 0),d("jspb.utils.hash64ToNumber",(function(e,t){V(e),e=R;var r=N;return t?H(e,r):q(e,r)}),void 0),d("jspb.utils.numberToHash64",(function(e){return D(e),Q(R,N)}),void 0),d("jspb.utils.countVarints",(function(e,t,r){for(var n=0,o=t;o<r;o++)n+=e[o]>>7;return r-t-n}),void 0),d("jspb.utils.countVarintFields",(function(e,t,r,n){var o=0;if(128>(n*=8))for(;t<r&&e[t++]==n;)for(o++;;){var s=e[t++];if(!(128&s))break}else for(;t<r;){for(s=n;128<s;){if(e[t]!=(127&s|128))return o;t++,s>>=7}if(e[t++]!=s)break;for(o++;128&(s=e[t++]););}return o}),void 0),d("jspb.utils.countFixed32Fields",(function(e,t,r,n){return oe(e,t,r,8*n+5,4)}),void 0),d("jspb.utils.countFixed64Fields",(function(e,t,r,n){return oe(e,t,r,8*n+1,8)}),void 0),d("jspb.utils.countDelimitedFields",(function(e,t,r,n){var o=0;for(n=8*n+2;t<r;){for(var s=n;128<s;){if(e[t++]!=(127&s|128))return o;s>>=7}if(e[t++]!=s)break;o++;for(var i=0,a=1;i+=(127&(s=e[t++]))*a,a*=128,128&s;);t+=i}return o}),void 0),d("jspb.utils.debugBytesToTextFormat",(function(e){var t='"';if(e){e=se(e);for(var r=0;r<e.length;r++)t+="\\x",16>e[r]&&(t+="0"),t+=e[r].toString(16)}return t+'"'}),void 0),d("jspb.utils.debugScalarToTextFormat",(function(e){if("string"==typeof e){e=String(e);for(var t=['"'],r=0;r<e.length;r++){var n,o=e.charAt(r),s=o.charCodeAt(0),i=r+1;(n=S[o])||(31<s&&127>s||((s=o)in x?o=x[s]:s in S?o=x[s]=S[s]:(31<(n=s.charCodeAt(0))&&127>n?o=s:(256>n?(o="\\x",(16>n||256<n)&&(o+="0")):(o="\\u",4096>n&&(o+="0")),o+=n.toString(16).toUpperCase()),o=x[s]=o)),n=o),t[i]=n}t.push('"'),e=t.join("")}else e=e.toString();return e}),void 0),d("jspb.utils.stringToByteArray",(function(e){for(var t=new Uint8Array(e.length),r=0;r<e.length;r++){var n=e.charCodeAt(r);if(255<n)throw Error("Conversion error: string contains codepoint outside of byte range");t[r]=n}return t}),void 0),d("jspb.utils.byteSourceToUint8Array",se,void 0),d("jspb.BinaryDecoder",ie,void 0);var ae=[];function ce(e,t,r){if(ae.length){var n=ae.pop();return e&&n.H(e,t,r),n}return new ie(e,t,r)}function le(e,t,r){this.a=ce(e,t,r),this.O=this.a.B(),this.b=this.c=-1,this.h=!1,this.v=null}ie.getInstanceCacheLength=function(){return ae.length},ie.alloc=ce,ie.prototype.Ca=function(){this.clear(),100>ae.length&&ae.push(this)},ie.prototype.free=ie.prototype.Ca,ie.prototype.clone=function(){return ce(this.b,this.h,this.c-this.h)},ie.prototype.clone=ie.prototype.clone,ie.prototype.clear=function(){this.b=null,this.a=this.c=this.h=0,this.v=!1},ie.prototype.clear=ie.prototype.clear,ie.prototype.Y=function(){return this.b},ie.prototype.getBuffer=ie.prototype.Y,ie.prototype.H=function(e,t,r){this.b=se(e),this.h=void 0!==t?t:0,this.c=void 0!==r?this.h+r:this.b.length,this.a=this.h},ie.prototype.setBlock=ie.prototype.H,ie.prototype.Db=function(){return this.c},ie.prototype.getEnd=ie.prototype.Db,ie.prototype.setEnd=function(e){this.c=e},ie.prototype.setEnd=ie.prototype.setEnd,ie.prototype.reset=function(){this.a=this.h},ie.prototype.reset=ie.prototype.reset,ie.prototype.B=function(){return this.a},ie.prototype.getCursor=ie.prototype.B,ie.prototype.Ma=function(e){this.a=e},ie.prototype.setCursor=ie.prototype.Ma,ie.prototype.advance=function(e){this.a+=e,w(this.a<=this.c)},ie.prototype.advance=ie.prototype.advance,ie.prototype.ya=function(){return this.a==this.c},ie.prototype.atEnd=ie.prototype.ya,ie.prototype.Qb=function(){return this.a>this.c},ie.prototype.pastEnd=ie.prototype.Qb,ie.prototype.getError=function(){return this.v||0>this.a||this.a>this.c},ie.prototype.getError=ie.prototype.getError,ie.prototype.w=function(e){for(var t=128,r=0,n=0,o=0;4>o&&128<=t;o++)r|=(127&(t=this.b[this.a++]))<<7*o;if(128<=t&&(r|=(127&(t=this.b[this.a++]))<<28,n|=(127&t)>>4),128<=t)for(o=0;5>o&&128<=t;o++)n|=(127&(t=this.b[this.a++]))<<7*o+3;if(128>t)return e(r>>>0,n>>>0);v("Failed to read varint, encoding is invalid."),this.v=!0},ie.prototype.readSplitVarint64=ie.prototype.w,ie.prototype.ea=function(e){return this.w((function(t,r){return G(t,r,e)}))},ie.prototype.readSplitZigzagVarint64=ie.prototype.ea,ie.prototype.ta=function(e){var t=this.b,r=this.a;this.a+=8;for(var n=0,o=0,s=r+7;s>=r;s--)n=n<<8|t[s],o=o<<8|t[s+4];return e(n,o)},ie.prototype.readSplitFixed64=ie.prototype.ta,ie.prototype.kb=function(){for(;128&this.b[this.a];)this.a++;this.a++},ie.prototype.skipVarint=ie.prototype.kb,ie.prototype.mb=function(e){for(;128<e;)this.a--,e>>>=7;this.a--},ie.prototype.unskipVarint=ie.prototype.mb,ie.prototype.o=function(){var e=this.b,t=e[this.a],r=127&t;return 128>t?(this.a+=1,w(this.a<=this.c),r):(r|=(127&(t=e[this.a+1]))<<7,128>t?(this.a+=2,w(this.a<=this.c),r):(r|=(127&(t=e[this.a+2]))<<14,128>t?(this.a+=3,w(this.a<=this.c),r):(r|=(127&(t=e[this.a+3]))<<21,128>t?(this.a+=4,w(this.a<=this.c),r):(r|=(15&(t=e[this.a+4]))<<28,128>t?(this.a+=5,w(this.a<=this.c),r>>>0):(this.a+=5,128<=e[this.a++]&&128<=e[this.a++]&&128<=e[this.a++]&&128<=e[this.a++]&&128<=e[this.a++]&&w(!1),w(this.a<=this.c),r)))))},ie.prototype.readUnsignedVarint32=ie.prototype.o,ie.prototype.da=function(){return~~this.o()},ie.prototype.readSignedVarint32=ie.prototype.da,ie.prototype.O=function(){return this.o().toString()},ie.prototype.Ea=function(){return this.da().toString()},ie.prototype.readSignedVarint32String=ie.prototype.Ea,ie.prototype.Ia=function(){var e=this.o();return e>>>1^-(1&e)},ie.prototype.readZigzagVarint32=ie.prototype.Ia,ie.prototype.Ga=function(){return this.w(q)},ie.prototype.readUnsignedVarint64=ie.prototype.Ga,ie.prototype.Ha=function(){return this.w(Z)},ie.prototype.readUnsignedVarint64String=ie.prototype.Ha,ie.prototype.sa=function(){return this.w(H)},ie.prototype.readSignedVarint64=ie.prototype.sa,ie.prototype.Fa=function(){return this.w(X)},ie.prototype.readSignedVarint64String=ie.prototype.Fa,ie.prototype.Ja=function(){return this.w($)},ie.prototype.readZigzagVarint64=ie.prototype.Ja,ie.prototype.fb=function(){return this.ea(Q)},ie.prototype.readZigzagVarintHash64=ie.prototype.fb,ie.prototype.Ka=function(){return this.ea(X)},ie.prototype.readZigzagVarint64String=ie.prototype.Ka,ie.prototype.Gc=function(){var e=this.b[this.a];return this.a+=1,w(this.a<=this.c),e},ie.prototype.readUint8=ie.prototype.Gc,ie.prototype.Ec=function(){var e=this.b[this.a],t=this.b[this.a+1];return this.a+=2,w(this.a<=this.c),e|t<<8},ie.prototype.readUint16=ie.prototype.Ec,ie.prototype.m=function(){var e=this.b[this.a],t=this.b[this.a+1],r=this.b[this.a+2],n=this.b[this.a+3];return this.a+=4,w(this.a<=this.c),(e|t<<8|r<<16|n<<24)>>>0},ie.prototype.readUint32=ie.prototype.m,ie.prototype.ga=function(){return q(this.m(),this.m())},ie.prototype.readUint64=ie.prototype.ga,ie.prototype.ha=function(){return Z(this.m(),this.m())},ie.prototype.readUint64String=ie.prototype.ha,ie.prototype.Xb=function(){var e=this.b[this.a];return this.a+=1,w(this.a<=this.c),e<<24>>24},ie.prototype.readInt8=ie.prototype.Xb,ie.prototype.Vb=function(){var e=this.b[this.a],t=this.b[this.a+1];return this.a+=2,w(this.a<=this.c),(e|t<<8)<<16>>16},ie.prototype.readInt16=ie.prototype.Vb,ie.prototype.P=function(){var e=this.b[this.a],t=this.b[this.a+1],r=this.b[this.a+2],n=this.b[this.a+3];return this.a+=4,w(this.a<=this.c),e|t<<8|r<<16|n<<24},ie.prototype.readInt32=ie.prototype.P,ie.prototype.ba=function(){return H(this.m(),this.m())},ie.prototype.readInt64=ie.prototype.ba,ie.prototype.ca=function(){return X(this.m(),this.m())},ie.prototype.readInt64String=ie.prototype.ca,ie.prototype.aa=function(){return Y(this.m())},ie.prototype.readFloat=ie.prototype.aa,ie.prototype.Z=function(){return J(this.m(),this.m())},ie.prototype.readDouble=ie.prototype.Z,ie.prototype.pa=function(){return!!this.b[this.a++]},ie.prototype.readBool=ie.prototype.pa,ie.prototype.ra=function(){return this.da()},ie.prototype.readEnum=ie.prototype.ra,ie.prototype.fa=function(e){var t=this.b,r=this.a;e=r+e;for(var n=[],o="";r<e;){var s=t[r++];if(128>s)n.push(s);else{if(192>s)continue;if(224>s){var i=t[r++];n.push((31&s)<<6|63&i)}else if(240>s){i=t[r++];var a=t[r++];n.push((15&s)<<12|(63&i)<<6|63&a)}else if(248>s){s=(7&s)<<18|(63&(i=t[r++]))<<12|(63&(a=t[r++]))<<6|63&t[r++],s-=65536,n.push(55296+(s>>10&1023),56320+(1023&s))}}8192<=n.length&&(o+=String.fromCharCode.apply(null,n),n.length=0)}return o+=I(n),this.a=r,o},ie.prototype.readString=ie.prototype.fa,ie.prototype.Dc=function(){var e=this.o();return this.fa(e)},ie.prototype.readStringWithLength=ie.prototype.Dc,ie.prototype.qa=function(e){if(0>e||this.a+e>this.b.length)return this.v=!0,v("Invalid byte length!"),new Uint8Array(0);var t=this.b.subarray(this.a,this.a+e);return this.a+=e,w(this.a<=this.c),t},ie.prototype.readBytes=ie.prototype.qa,ie.prototype.ia=function(){return this.w(Q)},ie.prototype.readVarintHash64=ie.prototype.ia,ie.prototype.$=function(){var e=this.b,t=this.a,r=e[t],n=e[t+1],o=e[t+2],s=e[t+3],i=e[t+4],a=e[t+5],c=e[t+6];return e=e[t+7],this.a+=8,String.fromCharCode(r,n,o,s,i,a,c,e)},ie.prototype.readFixedHash64=ie.prototype.$,d("jspb.BinaryReader",le,void 0);var ue=[];function de(e,t,r){if(ue.length){var n=ue.pop();return e&&n.a.H(e,t,r),n}return new le(e,t,r)}function he(e,t){w(2==e.b);var r=e.a.o();r=e.a.B()+r;for(var n=[];e.a.B()<r;)n.push(t.call(e.a));return n}function pe(e,t,r,n,o){this.ma=e,this.Ba=t,this.la=r,this.Na=n,this.na=o}function fe(e,t,r,n,o,s){this.Za=e,this.za=t,this.Aa=r,this.Wa=n,this.Ab=o,this.Nb=s}function ge(){}le.clearInstanceCache=function(){ue=[]},le.getInstanceCacheLength=function(){return ue.length},le.alloc=de,le.prototype.zb=de,le.prototype.alloc=le.prototype.zb,le.prototype.Ca=function(){this.a.clear(),this.b=this.c=-1,this.h=!1,this.v=null,100>ue.length&&ue.push(this)},le.prototype.free=le.prototype.Ca,le.prototype.Fb=function(){return this.O},le.prototype.getFieldCursor=le.prototype.Fb,le.prototype.B=function(){return this.a.B()},le.prototype.getCursor=le.prototype.B,le.prototype.Y=function(){return this.a.Y()},le.prototype.getBuffer=le.prototype.Y,le.prototype.Hb=function(){return this.c},le.prototype.getFieldNumber=le.prototype.Hb,le.prototype.Lb=function(){return this.b},le.prototype.getWireType=le.prototype.Lb,le.prototype.Mb=function(){return 2==this.b},le.prototype.isDelimited=le.prototype.Mb,le.prototype.bb=function(){return 4==this.b},le.prototype.isEndGroup=le.prototype.bb,le.prototype.getError=function(){return this.h||this.a.getError()},le.prototype.getError=le.prototype.getError,le.prototype.H=function(e,t,r){this.a.H(e,t,r),this.b=this.c=-1},le.prototype.setBlock=le.prototype.H,le.prototype.reset=function(){this.a.reset(),this.b=this.c=-1},le.prototype.reset=le.prototype.reset,le.prototype.advance=function(e){this.a.advance(e)},le.prototype.advance=le.prototype.advance,le.prototype.oa=function(){if(this.a.ya())return!1;if(this.getError())return v("Decoder hit an error"),!1;this.O=this.a.B();var e=this.a.o(),t=e>>>3;return 0!=(e&=7)&&5!=e&&1!=e&&2!=e&&3!=e&&4!=e?(v("Invalid wire type: %s (at position %s)",e,this.O),this.h=!0,!1):(this.c=t,this.b=e,!0)},le.prototype.nextField=le.prototype.oa,le.prototype.Oa=function(){this.a.mb(this.c<<3|this.b)},le.prototype.unskipHeader=le.prototype.Oa,le.prototype.Lc=function(){var e=this.c;for(this.Oa();this.oa()&&this.c==e;)this.C();this.a.ya()||this.Oa()},le.prototype.skipMatchingFields=le.prototype.Lc,le.prototype.lb=function(){0!=this.b?(v("Invalid wire type for skipVarintField"),this.C()):this.a.kb()},le.prototype.skipVarintField=le.prototype.lb,le.prototype.gb=function(){if(2!=this.b)v("Invalid wire type for skipDelimitedField"),this.C();else{var e=this.a.o();this.a.advance(e)}},le.prototype.skipDelimitedField=le.prototype.gb,le.prototype.hb=function(){5!=this.b?(v("Invalid wire type for skipFixed32Field"),this.C()):this.a.advance(4)},le.prototype.skipFixed32Field=le.prototype.hb,le.prototype.ib=function(){1!=this.b?(v("Invalid wire type for skipFixed64Field"),this.C()):this.a.advance(8)},le.prototype.skipFixed64Field=le.prototype.ib,le.prototype.jb=function(){for(var e=this.c;;){if(!this.oa()){v("Unmatched start-group tag: stream EOF"),this.h=!0;break}if(4==this.b){this.c!=e&&(v("Unmatched end-group tag"),this.h=!0);break}this.C()}},le.prototype.skipGroup=le.prototype.jb,le.prototype.C=function(){switch(this.b){case 0:this.lb();break;case 1:this.ib();break;case 2:this.gb();break;case 5:this.hb();break;case 3:this.jb();break;default:v("Invalid wire encoding for field.")}},le.prototype.skipField=le.prototype.C,le.prototype.Hc=function(e,t){null===this.v&&(this.v={}),w(!this.v[e]),this.v[e]=t},le.prototype.registerReadCallback=le.prototype.Hc,le.prototype.Ic=function(e){return w(null!==this.v),w(e=this.v[e]),e(this)},le.prototype.runReadCallback=le.prototype.Ic,le.prototype.Yb=function(e,t){w(2==this.b);var r=this.a.c,n=this.a.o();n=this.a.B()+n,this.a.setEnd(n),t(e,this),this.a.Ma(n),this.a.setEnd(r)},le.prototype.readMessage=le.prototype.Yb,le.prototype.Ub=function(e,t,r){w(3==this.b),w(this.c==e),r(t,this),this.h||4==this.b||(v("Group submessage did n
2ot end with an END_GROUP tag"),this.h=!0)},le.prototype.readGroup=le.prototype.Ub,le.prototype.Gb=function(){w(2==this.b);var e=this.a.o(),t=this.a.B(),r=t+e;return e=ce(this.a.Y(),t,e),this.a.Ma(r),e},le.prototype.getFieldDecoder=le.prototype.Gb,le.prototype.P=function(){return w(0==this.b),this.a.da()},le.prototype.readInt32=le.prototype.P,le.prototype.Wb=function(){return w(0==this.b),this.a.Ea()},le.prototype.readInt32String=le.prototype.Wb,le.prototype.ba=function(){return w(0==this.b),this.a.sa()},le.prototype.readInt64=le.prototype.ba,le.prototype.ca=function(){return w(0==this.b),this.a.Fa()},le.prototype.readInt64String=le.prototype.ca,le.prototype.m=function(){return w(0==this.b),this.a.o()},le.prototype.readUint32=le.prototype.m,le.prototype.Fc=function(){return w(0==this.b),this.a.O()},le.prototype.readUint32String=le.prototype.Fc,le.prototype.ga=function(){return w(0==this.b),this.a.Ga()},le.prototype.readUint64=le.prototype.ga,le.prototype.ha=function(){return w(0==this.b),this.a.Ha()},le.prototype.readUint64String=le.prototype.ha,le.prototype.zc=function(){return w(0==this.b),this.a.Ia()},le.prototype.readSint32=le.prototype.zc,le.prototype.Ac=function(){return w(0==this.b),this.a.Ja()},le.prototype.readSint64=le.prototype.Ac,le.prototype.Bc=function(){return w(0==this.b),this.a.Ka()},le.prototype.readSint64String=le.prototype.Bc,le.prototype.Rb=function(){return w(5==this.b),this.a.m()},le.prototype.readFixed32=le.prototype.Rb,le.prototype.Sb=function(){return w(1==this.b),this.a.ga()},le.prototype.readFixed64=le.prototype.Sb,le.prototype.Tb=function(){return w(1==this.b),this.a.ha()},le.prototype.readFixed64String=le.prototype.Tb,le.prototype.vc=function(){return w(5==this.b),this.a.P()},le.prototype.readSfixed32=le.prototype.vc,le.prototype.wc=function(){return w(5==this.b),this.a.P().toString()},le.prototype.readSfixed32String=le.prototype.wc,le.prototype.xc=function(){return w(1==this.b),this.a.ba()},le.prototype.readSfixed64=le.prototype.xc,le.prototype.yc=function(){return w(1==this.b),this.a.ca()},le.prototype.readSfixed64String=le.prototype.yc,le.prototype.aa=function(){return w(5==this.b),this.a.aa()},le.prototype.readFloat=le.prototype.aa,le.prototype.Z=function(){return w(1==this.b),this.a.Z()},le.prototype.readDouble=le.prototype.Z,le.prototype.pa=function(){return w(0==this.b),!!this.a.o()},le.prototype.readBool=le.prototype.pa,le.prototype.ra=function(){return w(0==this.b),this.a.sa()},le.prototype.readEnum=le.prototype.ra,le.prototype.fa=function(){w(2==this.b);var e=this.a.o();return this.a.fa(e)},le.prototype.readString=le.prototype.fa,le.prototype.qa=function(){w(2==this.b);var e=this.a.o();return this.a.qa(e)},le.prototype.readBytes=le.prototype.qa,le.prototype.ia=function(){return w(0==this.b),this.a.ia()},le.prototype.readVarintHash64=le.prototype.ia,le.prototype.Cc=function(){return w(0==this.b),this.a.fb()},le.prototype.readSintHash64=le.prototype.Cc,le.prototype.w=function(e){return w(0==this.b),this.a.w(e)},le.prototype.readSplitVarint64=le.prototype.w,le.prototype.ea=function(e){return w(0==this.b),this.a.w((function(t,r){return G(t,r,e)}))},le.prototype.readSplitZigzagVarint64=le.prototype.ea,le.prototype.$=function(){return w(1==this.b),this.a.$()},le.prototype.readFixedHash64=le.prototype.$,le.prototype.ta=function(e){return w(1==this.b),this.a.ta(e)},le.prototype.readSplitFixed64=le.prototype.ta,le.prototype.gc=function(){return he(this,this.a.da)},le.prototype.readPackedInt32=le.prototype.gc,le.prototype.hc=function(){return he(this,this.a.Ea)},le.prototype.readPackedInt32String=le.prototype.hc,le.prototype.ic=function(){return he(this,this.a.sa)},le.prototype.readPackedInt64=le.prototype.ic,le.prototype.jc=function(){return he(this,this.a.Fa)},le.prototype.readPackedInt64String=le.prototype.jc,le.prototype.qc=function(){return he(this,this.a.o)},le.prototype.readPackedUint32=le.prototype.qc,le.prototype.rc=function(){return he(this,this.a.O)},le.prototype.readPackedUint32String=le.prototype.rc,le.prototype.sc=function(){return he(this,this.a.Ga)},le.prototype.readPackedUint64=le.prototype.sc,le.prototype.tc=function(){return he(this,this.a.Ha)},le.prototype.readPackedUint64String=le.prototype.tc,le.prototype.nc=function(){return he(this,this.a.Ia)},le.prototype.readPackedSint32=le.prototype.nc,le.prototype.oc=function(){return he(this,this.a.Ja)},le.prototype.readPackedSint64=le.prototype.oc,le.prototype.pc=function(){return he(this,this.a.Ka)},le.prototype.readPackedSint64String=le.prototype.pc,le.prototype.bc=function(){return he(this,this.a.m)},le.prototype.readPackedFixed32=le.prototype.bc,le.prototype.cc=function(){return he(this,this.a.ga)},le.prototype.readPackedFixed64=le.prototype.cc,le.prototype.dc=function(){return he(this,this.a.ha)},le.prototype.readPackedFixed64String=le.prototype.dc,le.prototype.kc=function(){return he(this,this.a.P)},le.prototype.readPackedSfixed32=le.prototype.kc,le.prototype.lc=function(){return he(this,this.a.ba)},le.prototype.readPackedSfixed64=le.prototype.lc,le.prototype.mc=function(){return he(this,this.a.ca)},le.prototype.readPackedSfixed64String=le.prototype.mc,le.prototype.fc=function(){return he(this,this.a.aa)},le.prototype.readPackedFloat=le.prototype.fc,le.prototype.$b=function(){return he(this,this.a.Z)},le.prototype.readPackedDouble=le.prototype.$b,le.prototype.Zb=function(){return he(this,this.a.pa)},le.prototype.readPackedBool=le.prototype.Zb,le.prototype.ac=function(){return he(this,this.a.ra)},le.prototype.readPackedEnum=le.prototype.ac,le.prototype.uc=function(){return he(this,this.a.ia)},le.prototype.readPackedVarintHash64=le.prototype.uc,le.prototype.ec=function(){return he(this,this.a.$)},le.prototype.readPackedFixedHash64=le.prototype.ec,d("jspb.ExtensionFieldInfo",pe,void 0),d("jspb.ExtensionFieldBinaryInfo",fe,void 0),pe.prototype.F=function(){return!!this.la},pe.prototype.isMessageType=pe.prototype.F,d("jspb.Message",ge,void 0),ge.GENERATE_TO_OBJ
vendor: 3,640 bytes, line 2
2ECT=!0,ge.GENERATE_FROM_OBJECT=!0;var me="function"==typeof Uint8Array;ge.prototype.Ib=function(){return this.b},ge.prototype.getJsPbMessageId=ge.prototype.Ib,ge.initialize=function(e,t,r,n,o,s){if(e.f=null,t||(t=r?[r]:[]),e.b=r?String(r):void 0,e.D=0===r?-1:0,e.u=t,t=-1,!(r=e.u.length)||(t=r-1,null===(r=e.u[t])||"object"!=typeof r||Array.isArray(r)||me&&r instanceof Uint8Array)?-1<n?(e.G=Math.max(n,t+1-e.D),e.i=null):e.G=Number.MAX_VALUE:(e.G=t-e.D,e.i=r),e.a={},o)for(n=0;n<o.length;n++)(t=o[n])<e.G?(t+=e.D,e.u[t]=e.u[t]||ye):(be(e),e.i[t]=e.i[t]||ye);if(s&&s.length)for(n=0;n<s.length;n++)xe(e,s[n])};var ye=Object.freeze?Object.freeze([]):[];function be(e){var t=e.G+e.D;e.u[t]||(e.i=e.u[t]={})}function we(e,t,r){for(var n=[],o=0;o<e.length;o++)n[o]=t.call(e[o],r,e[o]);return n}function ve(e,t){if(t<e.G){t+=e.D;var r=e.u[t];return r===ye?e.u[t]=[]:r}if(e.i)return(r=e.i[t])===ye?e.i[t]=[]:r}function Ae(e,t){return null==(e=ve(e,t))?e:+e}function Te(e,t){return null==(e=ve(e,t))?e:!!e}function Pe(e){return null==e||"string"==typeof e?e:me&&e instanceof Uint8Array?M(e):(v("Cannot coerce to b64 string: "+h(e)),null)}function Ee(e){return null==e||e instanceof Uint8Array?e:"string"==typeof e?W(e):(v("Cannot coerce to Uint8Array: "+h(e)),null)}function Ce(e){if(e&&1<e.length){var t=h(e[0]);g(e,(function(e){h(e)!=t&&v("Inconsistent type in JSPB repeated field array. Got "+h(e)+" expected "+t)}))}}function ke(e,t,r){return(e=ve(e,t))??r}function _e(e,t,r){return A(e,ge),t<e.G?e.u[t+e.D]=r:(be(e),e.i[t]=r),e}function Ie(e,t,r,n){return A(e,ge),r!==n?_e(e,t,r):t<e.G?e.u[t+e.D]=null:(be(e),delete e.i[t]),e}function Se(e,t,r,n){return A(e,ge),(r=xe(e,r))&&r!==t&&void 0!==n&&(e.f&&r in e.f&&(e.f[r]=void 0),_e(e,r,void 0)),_e(e,t,n)}function xe(e,t){for(var r,n,o=0;o<t.length;o++){var s=t[o],i=ve(e,s);null!=i&&(r=s,n=i,_e(e,s,void 0))}return r?(_e(e,r,n),r):0}function Be(e,t,r){if(e.f||(e.f={}),!e.f[r]){for(var n=ve(e,r),o=[],s=0;s<n.length;s++)o[s]=new t(n[s]);e.f[r]=o}}function Oe(e){if(e.f)for(var t in e.f){var r=e.f[t];if(Array.isArray(r))for(var n=0;n<r.length;n++)r[n]&&r[n].g();else r&&r.g()}}function Me(e,t){e=e||{},t=t||{};var r,n={};for(r in e)n[r]=0;for(r in t)n[r]=0;for(r in n)if(!We(e[r],t[r]))return!1;return!0}function We(e,t){if(e==t)return!0;if(!p(e)||!p(t))return!!("number"==typeof e&&isNaN(e)||"number"==typeof t&&isNaN(t))&&String(e)==String(t);if(e.constructor!=t.constructor)return!1;if(me&&e.constructor===Uint8Array){if(e.length!=t.length)return!1;for(var r=0;r<e.length;r++)if(e[r]!=t[r])return!1;return!0}if(e.constructor===Array){var n=void 0,o=void 0,s=Math.max(e.length,t.length);for(r=0;r<s;r++){var i=e[r],a=t[r];if(i&&i.constructor==Object&&(w(void 0===n),w(r===e.length-1),n=i,i=void 0),a&&a.constructor==Object&&(w(void 0===o),w(r===t.length-1),o=a,a=void 0),!We(i,a))return!1}return!n&&!o||Me(n=n||{},o=o||{})}if(e.constructor===Object)return Me(e,t);throw Error("Invalid type in JSPB array")}function je(e){return new e.constructor(Re(e.g()))}function Re(e){if(Array.isArray(e)){for(var t=Array(e.length),r=0;r<e.length;r++){var n=e[r];null!=n&&(t[r]="object"==typeof n?Re(w(n)):n)}return t}if(me&&e instanceof Uint8Array)return new Uint8Array(e);for(r in t={},e)null!=(n=e[r])&&(t[r]="object"==typeof n?Re(w(n)):n);return t}ge.toObjectList=we,ge.toObjectExtension=function(e,t,r,n,o){for(var s in r){var i=r[s],a=n.call(e,i);if(null!=a){for(var c in i.Ba)if(i.Ba.hasOwnProperty(c))break;t[c]=i.Na?i.na?we(a,i.Na,o):i.Na(o,a):a}}},ge.serializeBinaryExtensions=function(e,t,r,n){for(var o in r){var s=r[o],i=s.Za;if(!s.Aa)throw Error("Message extension present that was generated
2without binary serialization support");var a=n.call(e,i);if(null!=a)if(i.F()){if(!s.Wa)throw Error("Message extension present holding submessage without binary support enabled, and message is being serialized to binary format");s.Aa.call(t,i.ma,a,s.Wa)}else s.Aa.call(t,i.ma,a)}},ge.readBinaryExtension=function(e,t,r,n,o){var s=r[t.c];if(s){if(r=s.Za,!s.za)throw Error("Deserializing extension whose generated code does not support binary format");if(r.F()){var i=new r.la;s.za.call(t,i,s.Ab)}else i=s.za.call(t);r.na&&!s.Nb?(t=n.call(e,r))?t.push(i):o.call(e,r,[i]):o.call(e,r,i)}else t.C()},ge.getField=ve,ge.getRepeatedField=function(e,t){return ve(e,t)},ge.getOptionalFloatingPointField=Ae,ge.getBooleanField=Te,ge.getRepeatedFloatingPointField=function(e,t){var r=ve(e,t);if(e.a||(e.a={}),!e.a[t]){for(var n=0;n<r.length;n++)r[n]=+r[n];e.a[t]=!0}return r},ge.getRepeatedBooleanField=function(e,t){var r=ve(e,t);if(e.a||(e.a={}),!e.a[t]){for(var n=0;n<r.length;n++)r[n]=!!r[n];e.a[t]=!0}return r},ge.bytesAsB64=Pe,ge.bytesAsU8=Ee,ge.bytesListAsB64=function(e){return Ce(e),e.length&&"string"!=typeof e[0]?m(e,Pe):e},ge.bytesListAsU8=function(e){return Ce(e),!e.length||e[0]instanceof Uint8Array?e:m(e,Ee)},ge.getFieldWithDefault=ke,ge.getBooleanFieldWithDefault=function(e,t,r){return(e=Te(e,t))??r},ge.getFloatingPointFieldWithDefault=function(e,t,r){return(e=Ae(e,t))??r},ge.getFieldProto3=ke,ge.getMapField=function(e,t,r,n){if(e.f||(e.f={}),t in e.f)return e.f[t];var o=ve(e,t);if(!o){if(r)return;_e(e,t,o=[])}return e.f[t]=new P(o,n)},ge.setField=_e,ge.setProto3IntField=function(e,t,r){return Ie(e,t,r,0)},ge.setProto3FloatField=function(e,t,r){return Ie(e,t,r,0)},ge.setProto3BooleanField=function(e,t,r){return Ie(e,t,r,!1)},ge.setProto3StringField=function(e,t,r){return Ie(e,t,r,"")},ge.setProto3BytesField=function(e,t,r){return Ie(e,t,r,"")},ge.setProto3EnumField=function(e,t,r){return Ie(e,t,r,0)},ge.setProto3StringIntField=function(e,t,r){return Ie(e,t,r,"0")},ge.addToRepeatedField=function(e,t,r,n){return A(e,ge),t=ve(e,t),null!=n?t.splice(n,0,r):t.push(r),e},ge.setOneofField=Se,ge.computeOneofCase=xe,ge.getWrapperField=function(e,t,r,n){if(e.f||(e.f={}),!e.f[r]){var o=ve(e,r);(n||o)&&(e.f[r]=new t(o))}return e.f[r]},ge.getRepeatedWrapperField=function(e,t,r){return Be(e,t,r),(t=e.f[r])==ye&&(t=e.f[r]=[]),t},ge.setWrapperField=function(e,t,r){A(e,ge),e.f||(e.f={});var n=r?r.g():r;return e.f[t]=r,_e(e,t,n)},ge.setOneofWrapperField=function(e,t,r,n){A(e,ge),e.f||(e.f={});var o=n?n.g():n;return e.f[t]=n,Se(e,t,r,o)},ge.setRepeatedWrapperField=function(e,t,r){A(e,ge),e.f||(e.f={}),r=r||[];for(var n=[],o=0;o<r.length;o++)n[o]=r[o].g();return e.f[t]=r,_e(e,t,n)},ge.addToRepeatedWrapperField=function(e,t,r,n,o){Be(e,n,t);var s=e.f[t];return s||(s=e.f[t]=[]),r=r||new n,e=ve(e,t),null!=o?(s.splice(o,0,r),e.splice(o,0,r.g())):(s.push(r),e.push(r.g())),r},ge.toMap=function(e,t,r,n){for(var o={},s=0;s<e.length;s++)o[t.call(e[s])]=r?r.call(e[s],n,e[s]):e[s];return o},ge.prototype.g=function(){return Oe(this),this.u},ge.prototype.toArray=ge.prototype.g,ge.prototype.toString=function(){return Oe(this),this.u.toString()},ge.prototype.getExtension=function(e){if(this.i){this.f||(this.f={});var t=e.ma;if(e.na){if(e.F())return this.f[t]||(this.f[t]=m(this.i[t]||[],(function(t){return new e.la(t)}))),this.f[t]}else if(e.F())return!this.f[t]&&this.i[t]&&(this.f[t]=new e.la(this.i[t])),this.f[t];return this.i[t]}},ge.prototype.getExtension=ge.prototype.getExtension,ge.prototype.Kc=function(e,t){this.f||(this.f={}),be(this);var r=e.ma;return e.na?(t=t||[],e.F()?(this.f[r]=t,this.i[r]=m(t,(function(e){return e.g()}))):this.i[r]=t):e.F()?(this.f[r]=t,this.i[r]=t?t.g():t):this.i[r]=t,this},ge.prototype.setExtension=ge.prototype.Kc,ge.difference=function(e,t){if(!(e instanceof t.constructor))throw Error("Messages have different types.");var r=e.g();t=t.g();var n=[],o=0,s=r.length>t.length?r.length:t.length;for(e.b&&(n[0]=e.b,o=1);o<s;o++)We(r[o],t[o])||(n[o]=t[o]);return new e.constructor(n)},ge.equals=function(e,t){return e==t||!(!e||!t)&&e instanceof t.constructor&&We(e.g(),t.g())},ge.compareExtensions=Me,ge.compareFields=We,ge.prototype.Bb=function(){return je(this)},ge.prototype.cloneMessage=ge.prototype.Bb,ge.prototype.clone=function(){return je(this)},ge.prototype.clone=ge.prototype.clone,ge.clone=function(e){return je(e)},ge.copyInto=function(e,t){A(e,ge),A(t,ge),w(e.constructor==t.constructor,"Copy source and target message should have the same type."),e=je(e);for(var r=t.g(),n=e.g(),o=r.length=0;o<n.length;o++)r[o]=n[o];t.f=e.f,t.i=e.i},ge.registerMessageType=function(e,t){t.we=e};var Ne={dump:function(e){return A(e,ge,"jspb.Message instance expected"),w(e.getExtension,"Only unobfuscated and unoptimized compilation modes supported."),Ne.X(e)}};function Ue(){this.a=[]}function De(e,t){this.lo=e,this.hi=t}function Le(e,t){var r=65535&e,n=65535&t,o=t>>>16;for(t=r*n+65536*(r*o&65535)+65536*((e>>>
vendor: 31,153 bytes, line 2
2=16)*n&65535),r=e*o+(r*o>>>16)+(e*n>>>16);4294967296<=t;)t-=4294967296,r+=1;return new De(t>>>0,r>>>0)}function Fe(e){for(var t=new De(0,0),r=new De(0,0),n=0;n<e.length;n++){if("0">e[n]||"9"<e[n])return null;r.lo=parseInt(e[n],10),t=t.eb(10).add(r)}return t}function ze(e,t){this.lo=e,this.hi=t}function Ve(e){var t=0<e.length&&"-"==e[0];return t&&(e=e.substring(1)),null===(e=Fe(e))?null:(t&&(e=new De(0,0).sub(e)),new ze(e.lo,e.hi))}function qe(){this.c=[],this.b=0,this.a=new Ue,this.h=[]}function He(e,t){var r=e.a.end();e.c.push(r),e.c.push(t),e.b+=r.length+t.length}function Ke(e,t){return Ge(e,t,2),t=e.a.end(),e.c.push(t),e.b+=t.length,t.push(e.b),t}function $e(e,t){var r=t.pop();for(w(0<=(r=e.b+e.a.length()-r));127<r;)t.push(127&r|128),r>>>=7,e.b++;t.push(r),e.b++}function Ge(e,t,r){w(1<=t&&t==Math.floor(t)),e.a.j(8*t+r)}function Ye(e,t,r){null!=r&&(Ge(e,t,0),e.a.j(r))}function Je(e,t,r){null!=r&&(Ge(e,t,0),e.a.M(r))}d("jspb.debug.dump",Ne.dump,void 0),Ne.X=function(e){var t=h(e);if("number"==t||"string"==t||"boolean"==t||"null"==t||"undefined"==t||"undefined"!=typeof Uint8Array&&e instanceof Uint8Array)return e;if("array"==t)return function(e,t,r){for(var n=[],o=2;o<arguments.length;++o)n[o-2]=arguments[o];Array.isArray(e)||b("Expected array but got %s: %s.",[h(e),e],t,n)}(e),m(e,Ne.X);if(e instanceof P){for(var r={},n=(e=e.entries()).next();!n.done;n=e.next())r[n.value[0]]=Ne.X(n.value[1]);return r}A(e,ge,"Only messages expected: "+e);var o={$name:(t=e.constructor).name||t.displayName};for(a in t.prototype){var s=/^get([A-Z]\w*)/.exec(a);if(s&&"getExtension"!=a&&"getJsPbMessageId"!=a){var i="has"+s[1];e[i]&&!e[i]()||(i=e[a](),o[Ne.$a(s[1])]=Ne.X(i))}}if(e.extensionObject_)return o.$extensions="Recursive dumping of extensions not supported in compiled code. Switch to uncompiled or dump extension object directly",o;for(n in t.extensions)if(/^\d+$/.test(n)){i=t.extensions[n];var a=e.getExtension(i);s=void 0,i=i.Ba;var c=[],l=0;for(s in i)c[l++]=s;s=c[0],null!=a&&(r||(r=o.$extensions={}),r[Ne.$a(s)]=Ne.X(a))}return o},Ne.$a=function(e){return e.replace(/^[A-Z]/,(function(e){return e.toLowerCase()}))},d("jspb.BinaryEncoder",Ue,void 0),Ue.prototype.length=function(){return this.a.length},Ue.prototype.length=Ue.prototype.length,Ue.prototype.end=function(){var e=this.a;return this.a=[],e},Ue.prototype.end=Ue.prototype.end,Ue.prototype.l=function(e,t){for(w(e==Math.floor(e)),w(t==Math.floor(t)),w(0<=e&&4294967296>e),w(0<=t&&4294967296>t);0<t||127<e;)this.a.push(127&e|128),e=(e>>>7|t<<25)>>>0,t>>>=7;this.a.push(e)},Ue.prototype.writeSplitVarint64=Ue.prototype.l,Ue.prototype.A=function(e,t){w(e==Math.floor(e)),w(t==Math.floor(t)),w(0<=e&&4294967296>e),w(0<=t&&4294967296>t),this.s(e),this.s(t)},Ue.prototype.writeSplitFixed64=Ue.prototype.A,Ue.prototype.j=function(e){for(w(e==Math.floor(e)),w(0<=e&&4294967296>e);127<e;)this.a.push(127&e|128),e>>>=7;this.a.push(e)},Ue.prototype.writeUnsignedVarint32=Ue.prototype.j,Ue.prototype.M=function(e){if(w(e==Math.floor(e)),w(-2147483648<=e&&2147483648>e),0<=e)this.j(e);else{for(var t=0;9>t;t++)this.a.push(127&e|128),e>>=7;this.a.push(1)}},Ue.prototype.writeSignedVarint32=Ue.prototype.M,Ue.prototype.va=function(e){w(e==Math.floor(e)),w(0<=e&&0x10000000000000000>e),D(e),this.l(R,N)},Ue.prototype.writeUnsignedVarint64=Ue.prototype.va,Ue.prototype.ua=function(e){w(e==Math.floor(e)),w(-0x8000000000000000<=e&&0x8000000000000000>e),D(e),this.l(R,N)},Ue.prototype.writeSignedVarint64=Ue.prototype.ua,Ue.prototype.wa=function(e){w(e==Math.floor(e)),w(-2147483648<=e&&2147483648>e),this.j((e<<1^e>>31)>>>0)},Ue.prototype.writeZigzagVarint32=Ue.prototype.wa,Ue.prototype.xa=function(e){w(e==Math.floor(e)),w(-0x8000000000000000<=e&&0x8000000000000000>e),L(e),this.l(R,N)},Ue.prototype.writeZigzagVarint64=Ue.prototype.xa,Ue.prototype.Ta=function(e){this.W(te(e))},Ue.prototype.writeZigzagVarint64String=Ue.prototype.Ta,Ue.prototype.W=function(e){var t=this;V(e),K(R,N,(function(e,r){t.l(e>>>0,r>>>0)}))},Ue.prototype.writeZigzagVarintHash64=Ue.prototype.W,Ue.prototype.be=function(e){w(e==Math.floor(e)),w(0<=e&&256>e),this.a.push(e>>>0&255)},Ue.prototype.writeUint8=Ue.prototype.be,Ue.prototype.ae=function(e){w(e==Math.floor(e)),w(0<=e&&65536>e),this.a.push(e>>>0&255),this.a.push(e>>>8&255)},Ue.prototype.writeUint16=Ue.prototype.ae,Ue.prototype.s=function(e){w(e==Math.floor(e)),w(0<=e&&4294967296>e),this.a.push(e>>>0&255),this.a.push(e>>>8&255),this.a.push(e>>>16&255),this.a.push(e>>>24&255)},Ue.prototype.writeUint32=Ue.prototype.s,Ue.prototype.V=function(e){w(e==Math.floor(e)),w(0<=e&&0x10000000000000000>e),U(e),this.s(R),this.s(N)},Ue.prototype.writeUint64=Ue.prototype.V,Ue.prototype.Qc=function(e){w(e==Math.floor(e)),w(-128<=e&&128>e),this.a.push(e>>>0&255)},Ue.prototype.writeInt8=Ue.prototype.Qc,Ue.prototype.Pc=function(e){w(e==Math.floor(e)),w(-32768<=e&&32768>e),this.a.push(e>>>0&255),this.a.push(e>>>8&255)},Ue.prototype.writeInt16=Ue.prototype.Pc,Ue.prototype.S=function(e){w(e==Math.floor(e)),w(-2147483648<=e&&2147483648>e),this.a.push(e>>>0&255),this.a.push(e>>>8&255),this.a.push(e>>>16&255),this.a.push(e>>>24&255)},Ue.prototype.writeInt32=Ue.prototype.S,Ue.prototype.T=function(e){w(e==Math.floor(e)),w(-0x8000000000000000<=e&&0x8000000000000000>e),D(e),this.A(R,N)},Ue.prototype.writeInt64=Ue.prototype.T,Ue.prototype.ka=function(e){w(e==Math.floor(e)),w(-0x8000000000000000<=+e&&0x8000000000000000>+e),V(te(e)),this.A(R,N)},Ue.prototype.writeInt64String=Ue.prototype.ka,Ue.prototype.L=function(e){w(1/0===e||-1/0===e||isNaN(e)||-34028234663852886e22<=e&&34028234663852886e22>=e),F(e),this.s(R)},Ue.prototype.writeFloat=Ue.prototype.L,Ue.prototype.J=function(e){w(1/0===e||-1/0===e||isNaN(e)||-17976931348623157e292<=e&&17976931348623157e292>=e),z(e),this.s(R),this.s(N)},Ue.prototype.writeDouble=Ue.prototype.J,Ue.prototype.I=function(e){w("boolean"==typeof e||"number"==typeof e),this.a.push(e?1:0)},Ue.prototype.writeBool=Ue.prototype.I,Ue.prototype.R=function(e){w(e==Math.floor(e)),w(-2147483648<=e&&2147483648>e),this.M(e)},Ue.prototype.writeEnum=Ue.prototype.R,Ue.prototype.ja=function(e){this.a.push.apply(this.a,e)},Ue.prototype.writeBytes=Ue.prototype.ja,Ue.prototype.N=function(e){V(e),this.l(R,N)},Ue.prototype.writeVarintHash64=Ue.prototype.N,Ue.prototype.K=function(e){V(e),this.s(R),this.s(N)},Ue.prototype.writeFixedHash64=Ue.prototype.K,Ue.prototype.U=function(e){var t=this.a.length;!function(e,t,r){for(var n=[],o=2;o<arguments.length;++o)n[o-2]=arguments[o];"string"!=typeof e&&b("Expected string but got %s: %s.",[h(e),e],t,n)}(e);for(var r=0;r<e.length;r++){var n=e.charCodeAt(r);if(128>n)this.a.push(n);else if(2048>n)this.a.push(n>>6|192),this.a.push(63&n|128);else if(65536>n)if(55296<=n&&56319>=n&&r+1<e.length){var o=e.charCodeAt(r+1);56320<=o&&57343>=o&&(n=1024*(n-55296)+o-56320+65536,this.a.push(n>>18|240),this.a.push(n>>12&63|128),this.a.push(n>>6&63|128),this.a.push(63&n|128),r++)}else this.a.push(n>>12|224),this.a.push(n>>6&63|128),this.a.push(63&n|128)}return this.a.length-t},Ue.prototype.writeString=Ue.prototype.U,d("jspb.arith.UInt64",De,void 0),De.prototype.cmp=function(e){return this.hi<e.hi||this.hi==e.hi&&this.lo<e.lo?-1:this.hi==e.hi&&this.lo==e.lo?0:1},De.prototype.cmp=De.prototype.cmp,De.prototype.La=function(){return new De((this.lo>>>1|(1&this.hi)<<31)>>>0,this.hi>>>1>>>0)},De.prototype.rightShift=De.prototype.La,De.prototype.Da=function(){return new De(this.lo<<1>>>0,(this.hi<<1|this.lo>>>31)>>>0)},De.prototype.leftShift=De.prototype.Da,De.prototype.cb=function(){return!!(2147483648&this.hi)},De.prototype.msb=De.prototype.cb,De.prototype.Ob=function(){return!!(1&this.lo)},De.prototype.lsb=De.prototype.Ob,De.prototype.Ua=function(){return 0==this.lo&&0==this.hi},De.prototype.zero=De.prototype.Ua,De.prototype.add=function(e){return new De((this.lo+e.lo&4294967295)>>>0>>>0,((this.hi+e.hi&4294967295)>>>0)+(4294967296<=this.lo+e.lo?1:0)>>>0)},De.prototype.add=De.prototype.add,De.prototype.sub=function(e){return new De((this.lo-e.lo&4294967295)>>>0>>>0,((this.hi-e.hi&4294967295)>>>0)-(0>this.lo-e.lo?1:0)>>>0)},De.prototype.sub=De.prototype.sub,De.mul32x32=Le,De.prototype.eb=function(e){var t=Le(this.lo,e);return(e=Le(this.hi,e)).hi=e.lo,e.lo=0,t.add(e)},De.prototype.mul=De.prototype.eb,De.prototype.Xa=function(e){if(0==e)return[];var t=new De(0,0),r=new De(this.lo,this.hi);e=new De(e,0);for(var n=new De(1,0);!e.cb();)e=e.Da(),n=n.Da();for(;!n.Ua();)0>=e.cmp(r)&&(t=t.add(n),r=r.sub(e)),e=e.La(),n=n.La();return[t,r]},De.prototype.div=De.prototype.Xa,De.prototype.toString=function(){for(var e="",t=this;!t.Ua();){var r=(t=t.Xa(10))[0];e=t[1].lo+e,t=r}return""==e&&(e="0"),e},De.prototype.toString=De.prototype.toString,De.fromString=Fe,De.prototype.clone=function(){return new De(this.lo,this.hi)},De.prototype.clone=De.prototype.clone,d("jspb.arith.Int64",ze,void 0),ze.prototype.add=function(e){return new ze((this.lo+e.lo&4294967295)>>>0>>>0,((this.hi+e.hi&4294967295)>>>0)+(4294967296<=this.lo+e.lo?1:0)>>>0)},ze.prototype.add=ze.prototype.add,ze.prototype.sub=function(e){return new ze((this.lo-e.lo&4294967295)>>>0>>>0,((this.hi-e.hi&4294967295)>>>0)-(0>this.lo-e.lo?1:0)>>>0)},ze.prototype.sub=ze.prototype.sub,ze.prototype.clone=function(){return new ze(this.lo,this.hi)},ze.prototype.clone=ze.prototype.clone,ze.prototype.toString=function(){var e=!!(2147483648&this.hi),t=new De(this.lo,this.hi);return e&&(t=new De(0,0).sub(t)),(e?"-":"")+t.toString()},ze.prototype.toString=ze.prototype.toString,ze.fromString=Ve,d("jspb.BinaryWriter",qe,void 0),qe.prototype.pb=function(e,t,r){He(this,e.subarray(t,r))},qe.prototype.writeSerializedMessage=qe.prototype.pb,qe.prototype.Pb=function(e,t,r){null!=e&&null!=t&&null!=r&&this.pb(e,t,r)},qe.prototype.maybeWriteSerializedMessage=qe.prototype.Pb,qe.prototype.reset=function(){this.c=[],this.a.end(),this.b=0,this.h=[]},qe.prototype.reset=qe.prototype.reset,qe.prototype.ab=function(){w(0==this.h.length);for(var e=new Uint8Array(this.b+this.a.length()),t=this.c,r=t.length,n=0,o=0;o<r;o++){var s=t[o];e.set(s,n),n+=s.length}return t=this.a.end(),e.set(t,n),w((n+=t.length)==e.length),this.c=[e],e},qe.prototype.getResultBuffer=qe.prototype.ab,qe.prototype.Kb=function(e){return M(this.ab(),e)},qe.prototype.getResultBase64String=qe.prototype.Kb,qe.prototype.Va=function(e){this.h.push(Ke(this,e))},qe.prototype.beginSubMessage=qe.prototype.Va,qe.prototype.Ya=function(){w(0<=this.h.length),$e(this,this.h.pop())},qe.prototype.endSubMessage=qe.prototype.Ya,qe.prototype.Nc=function(e,t,r){switch(e){case 1:this.J(t,r);break;case 2:this.L(t,r);break;case 3:this.T(t,r);break;case 4:this.V(t,r);break;case 5:this.S(t,r);break;case 6:this.Qa(t,r);break;case 7:this.Pa(t,r);break;case 8:this.I(t,r);break;case 9:this.U(t,r);break;case 10:v("Group field type not supported in writeAny()");break;case 11:v("Message field type not supported in writeAny()");break;case 12:this.ja(t,r);break;case 13:this.s(t,r);break;case 14:this.R(t,r);break;case 15:this.Ra(t,r);break;case 16:this.Sa(t,r);break;case 17:this.rb(t,r);break;case 18:this.sb(t,r);break;case 30:this.K(t,r);break;case 31:this.N(t,r);break;default:v("Invalid field type in writeAny()")}},qe.prototype.writeAny=qe.prototype.Nc,qe.prototype.S=function(e,t){null!=t&&(w(-2147483648<=t&&2147483648>t),Je(this,e,t))},qe.prototype.writeInt32=qe.prototype.S,qe.prototype.ob=function(e,t){null!=t&&(w(-2147483648<=(t=parseInt(t,10))&&2147483648>t),Je(this,e,t))},qe.prototype.writeInt32String=qe.prototype.ob,qe.prototype.T=function(e,t){null!=t&&(w(-0x8000000000000000<=t&&0x8000000000000000>t),null!=t&&(Ge(this,e,0),this.a.ua(t)))},qe.prototype.writeInt64=qe.prototype.T,qe.prototype.ka=function(e,t){null!=t&&(t=Ve(t),Ge(this,e,0),this.a.l(t.lo,t.hi))},qe.prototype.writeInt64String=qe.prototype.ka,qe.prototype.s=function(e,t){null!=t&&(w(0<=t&&4294967296>t),Ye(this,e,t))},qe.prototype.writeUint32=qe.prototype.s,qe.prototype.ub=function(e,t){null!=t&&(w(0<=(t=parseInt(t,10))&&4294967296>t),Ye(this,e,t))},qe.prototype.writeUint32String=qe.prototype.ub,qe.prototype.V=function(e,t){null!=t&&(w(0<=t&&0x10000000000000000>t),null!=t&&(Ge(this,e,0),this.a.va(t)))},qe.prototype.writeUint64=qe.prototype.V,qe.prototype.vb=function(e,t){null!=t&&(t=Fe(t),Ge(this,e,0),this.a.l(t.lo,t.hi))},qe.prototype.writeUint64String=qe.prototype.vb,qe.prototype.rb=function(e,t){null!=t&&(w(-2147483648<=t&&2147483648>t),null!=t&&(Ge(this,e,0),this.a.wa(t)))},qe.prototype.writeSint32=qe.prototype.rb,qe.prototype.sb=function(e,t){null!=t&&(w(-0x8000000000000000<=t&&0x8000000000000000>t),null!=t&&(Ge(this,e,0),this.a.xa(t)))},qe.prototype.writeSint64=qe.prototype.sb,qe.prototype.$d=function(e,t){null!=t&&null!=t&&(Ge(this,e,0),this.a.W(t))},qe.prototype.writeSintHash64=qe.prototype.$d,qe.prototype.Zd=function(e,t){null!=t&&null!=t&&(Ge(this,e,0),this.a.Ta(t))},qe.prototype.writeSint64String=qe.prototype.Zd,qe.prototype.Pa=function(e,t){null!=t&&(w(0<=t&&4294967296>t),Ge(this,e,5),this.a.s(t))},qe.prototype.writeFixed32=qe.prototype.Pa,qe.prototype.Qa=function(e,t){null!=t&&(w(0<=t&&0x10000000000000000>t),Ge(this,e,1),this.a.V(t))},qe.prototype.writeFixed64=qe.prototype.Qa,qe.prototype.nb=function(e,t){null!=t&&(t=Fe(t),Ge(this,e,1),this.a.A(t.lo,t.hi))},qe.prototype.writeFixed64String=qe.prototype.nb,qe.prototype.Ra=function(e,t){null!=t&&(w(-2147483648<=t&&2147483648>t),Ge(this,e,5),this.a.S(t))},qe.prototype.writeSfixed32=qe.prototype.Ra,qe.prototype.Sa=function(e,t){null!=t&&(w(-0x8000000000000000<=t&&0x8000000000000000>t),Ge(this,e,1),this.a.T(t))},qe.prototype.writeSfixed64=qe.prototype.Sa,qe.prototype.qb=function(e,t){null!=t&&(t=Ve(t),Ge(this,e,1),this.a.A(t.lo,t.hi))},qe.prototype.writeSfixed64String=qe.prototype.qb,qe.prototype.L=function(e,t){null!=t&&(Ge(this,e,5),this.a.L(t))},qe.prototype.writeFloat=qe.prototype.L,qe.prototype.J=function(e,t){null!=t&&(Ge(this,e,1),this.a.J(t))},qe.prototype.writeDouble=qe.prototype.J,qe.prototype.I=function(e,t){null!=t&&(w("boolean"==typeof t||"number"==typeof t),Ge(this,e,0),this.a.I(t))},qe.prototype.writeBool=qe.prototype.I,qe.prototype.R=function(e,t){null!=t&&(w(-2147483648<=t&&2147483648>t),Ge(this,e,0),this.a.M(t))},qe.prototype.writeEnum=qe.prototype.R,qe.prototype.U=function(e,t){null!=t&&(e=Ke(this,e),this.a.U(t),$e(this,e))},qe.prototype.writeString=qe.prototype.U,qe.prototype.ja=function(e,t){null!=t&&(t=se(t),Ge(this,e,2),this.a.j(t.length),He(this,t))},qe.prototype.writeBytes=qe.prototype.ja,qe.prototype.Rc=function(e,t,r){null!=t&&(e=Ke(this,e),r(t,this),$e(this,e))},qe.prototype.writeMessage=qe.prototype.Rc,qe.prototype.Sc=function(e,t,r){null!=t&&(Ge(this,1,3),Ge(this,2,0),this.a.M(e),e=Ke(this,3),r(t,this),$e(this,e),Ge(this,1,4))},qe.prototype.writeMessageSet=qe.prototype.Sc,qe.prototype.Oc=function(e,t,r){null!=t&&(Ge(this,e,3),r(t,this),Ge(this,e,4))},qe.prototype.writeGroup=qe.prototype.Oc,qe.prototype.K=function(e,t){null!=t&&(w(8==t.length),Ge(this,e,1),this.a.K(t))},qe.prototype.writeFixedHash64=qe.prototype.K,qe.prototype.N=function(e,t){null!=t&&(w(8==t.length),Ge(this,e,0),this.a.N(t))},qe.prototype.writeVarintHash64=qe.prototype.N,qe.prototype.A=function(e,t,r){Ge(this,e,1),this.a.A(t,r)},qe.prototype.writeSplitFixed64=qe.prototype.A,qe.prototype.l=function(e,t,r){Ge(this,e,0),this.a.l(t,r)},qe.prototype.writeSplitVarint64=qe.prototype.l,qe.prototype.tb=function(e,t,r){Ge(this,e,0);var n=this.a;K(t,r,(function(e,t){n.l(e>>>0,t>>>0)}))},qe.prototype.writeSplitZigzagVarint64=qe.prototype.tb,qe.prototype.Ed=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)Je(this,e,t[r])},qe.prototype.writeRepeatedInt32=qe.prototype.Ed,qe.prototype.Fd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.ob(e,t[r])},qe.prototype.writeRepeatedInt32String=qe.prototype.Fd,qe.prototype.Gd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++){var n=t[r];null!=n&&(Ge(this,e,0),this.a.ua(n))}},qe.prototype.writeRepeatedInt64=qe.prototype.Gd,qe.prototype.Qd=function(e,t,r,n){if(null!=t)for(var o=0;o<t.length;o++)this.A(e,r(t[o]),n(t[o]))},qe.prototype.writeRepeatedSplitFixed64=qe.prototype.Qd,qe.prototype.Rd=function(e,t,r,n){if(null!=t)for(var o=0;o<t.length;o++)this.l(e,r(t[o]),n(t[o]))},qe.prototype.writeRepeatedSplitVarint64=qe.prototype.Rd,qe.prototype.Sd=function(e,t,r,n){if(null!=t)for(var o=0;o<t.length;o++)this.tb(e,r(t[o]),n(t[o]))},qe.prototype.writeRepeatedSplitZigzagVarint64=qe.prototype.Sd,qe.prototype.Hd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.ka(e,t[r])},qe.prototype.writeRepeatedInt64String=qe.prototype.Hd,qe.prototype.Ud=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)Ye(this,e,t[r])},qe.prototype.writeRepeatedUint32=qe.prototype.Ud,qe.prototype.Vd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.ub(e,t[r])},qe.prototype.writeRepeatedUint32String=qe.prototype.Vd,qe.prototype.Wd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++){var n=t[r];null!=n&&(Ge(this,e,0),this.a.va(n))}},qe.prototype.writeRepeatedUint64=qe.prototype.Wd,qe.prototype.Xd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.vb(e,t[r])},qe.prototype.writeRepeatedUint64String=qe.prototype.Xd,qe.prototype.Md=function(e,t){if(null!=t)for(var r=0;r<t.length;r++){var n=t[r];null!=n&&(Ge(this,e,0),this.a.wa(n))}},qe.prototype.writeRepeatedSint32=qe.prototype.Md,qe.prototype.Nd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++){var n=t[r];null!=n&&(Ge(this,e,0),this.a.xa(n))}},qe.prototype.writeRepeatedSint64=qe.prototype.Nd,qe.prototype.Od=function(e,t){if(null!=t)for(var r=0;r<t.length;r++){var n=t[r];null!=n&&(Ge(this,e,0),this.a.Ta(n))}},qe.prototype.writeRepeatedSint64String=qe.prototype.Od,qe.prototype.Pd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++){var n=t[r];null!=n&&(Ge(this,e,0),this.a.W(n))}},qe.prototype.writeRepeatedSintHash64=qe.prototype.Pd,qe.prototype.yd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.Pa(e,t[r])},qe.prototype.writeRepeatedFixed32=qe.prototype.yd,qe.prototype.zd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.Qa(e,t[r])},qe.prototype.writeRepeatedFixed64=qe.prototype.zd,qe.prototype.Ad=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.nb(e,t[r])},qe.prototype.writeRepeatedFixed64String=qe.prototype.Ad,qe.prototype.Jd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.Ra(e,t[r])},qe.prototype.writeRepeatedSfixed32=qe.prototype.Jd,qe.prototype.Kd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.Sa(e,t[r])},qe.prototype.writeRepeatedSfixed64=qe.prototype.Kd,qe.prototype.Ld=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.qb(e,t[r])},qe.prototype.writeRepeatedSfixed64String=qe.prototype.Ld,qe.prototype.Cd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.L(e,t[r])},qe.prototype.writeRepeatedFloat=qe.prototype.Cd,qe.prototype.wd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.J(e,t[r])},qe.prototype.writeRepeatedDouble=qe.prototype.wd,qe.prototype.ud=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.I(e,t[r])},qe.prototype.writeRepeatedBool=qe.prototype.ud,qe.prototype.xd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.R(e,t[r])},qe.prototype.writeRepeatedEnum=qe.prototype.xd,qe.prototype.Td=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.U(e,t[r])},qe.prototype.writeRepeatedString=qe.prototype.Td,qe.prototype.vd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.ja(e,t[r])},qe.prototype.writeRepeatedBytes=qe.prototype.vd,qe.prototype.Id=function(e,t,r){if(null!=t)for(var n=0;n<t.length;n++){var o=Ke(this,e);r(t[n],this),$e(this,o)}},qe.prototype.writeRepeatedMessage=qe.prototype.Id,qe.prototype.Dd=function(e,t,r){if(null!=t)for(var n=0;n<t.length;n++)Ge(this,e,3),r(t[n],this),Ge(this,e,4)},qe.prototype.writeRepeatedGroup=qe.prototype.Dd,qe.prototype.Bd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.K(e,t[r])},qe.prototype.writeRepeatedFixedHash64=qe.prototype.Bd,qe.prototype.Yd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.N(e,t[r])},qe.prototype.writeRepeatedVarintHash64=qe.prototype.Yd,qe.prototype.ad=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.M(t[r]);$e(this,e)}},qe.prototype.writePackedInt32=qe.prototype.ad,qe.prototype.bd=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.M(parseInt(t[r],10));$e(this,e)}},qe.prototype.writePackedInt32String=qe.prototype.bd,qe.prototype.cd=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.ua(t[r]);$e(this,e)}},qe.prototype.writePackedInt64=qe.prototype.cd,qe.prototype.md=function(e,t,r,n){if(null!=t){e=Ke(this,e);for(var o=0;o<t.length;o++)this.a.A(r(t[o]),n(t[o]));$e(this,e)}},qe.prototype.writePackedSplitFixed64=qe.prototype.md,qe.prototype.nd=function(e,t,r,n){if(null!=t){e=Ke(this,e);for(var o=0;o<t.length;o++)this.a.l(r(t[o]),n(t[o]));$e(this,e)}},qe.prototype.writePackedSplitVarint64=qe.prototype.nd,qe.prototype.od=function(e,t,r,n){if(null!=t){e=Ke(this,e);for(var o=this.a,s=0;s<t.length;s++)K(r(t[s]),n(t[s]),(function(e,t){o.l(e>>>0,t>>>0)}));$e(this,e)}},qe.prototype.writePackedSplitZigzagVarint64=qe.prototype.od,qe.prototype.dd=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++){var n=Ve(t[r]);this.a.l(n.lo,n.hi)}$e(this,e)}},qe.prototype.writePackedInt64String=qe.prototype.dd,qe.prototype.pd=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.j(t[r]);$e(this,e)}},qe.prototype.writePackedUint32=qe.prototype.pd,qe.prototype.qd=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.j(parseInt(t[r],10));$e(this,e)}},qe.prototype.writePackedUint32String=qe.prototype.qd,qe.prototype.rd=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.va(t[r]);$e(this,e)}},qe.prototype.writePackedUint64=qe.prototype.rd,qe.prototype.sd=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++){var n=Fe(t[r]);this.a.l(n.lo,n.hi)}$e(this,e)}},qe.prototype.writePackedUint64String=qe.prototype.sd,qe.prototype.hd=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.wa(t[r]);$e(this,e)}},qe.prototype.writePackedSint32=qe.prototype.hd,qe.prototype.jd=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.xa(t[r]);$e(this,e)}},qe.prototype.writePackedSint64=qe.prototype.jd,qe.prototype.kd=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.W(te(t[r]));$e(this,e)}},qe.prototype.writePackedSint64String=qe.prototype.kd,qe.prototype.ld=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.W(t[r]);$e(this,e)}},qe.prototype.writePackedSintHash64=qe.prototype.ld,qe.prototype.Wc=function(e,t){if(null!=t&&t.length)for(Ge(this,e,2),this.a.j(4*t.length),e=0;e<t.length;e++)this.a.s(t[e])},qe.prototype.writePackedFixed32=qe.prototype.Wc,qe.prototype.Xc=function(e,t){if(null!=t&&t.length)for(Ge(this,e,2),this.a.j(8*t.length),e=0;e<t.length;e++)this.a.V(t[e])},qe.prototype.writePackedFixed64=qe.prototype.Xc,qe.prototype.Yc=function(e,t){if(null!=t&&t.length)for(Ge(this,e,2),this.a.j(8*t.length),e=0;e<t.length;e++){var r=Fe(t[e]);this.a.A(r.lo,r.hi)}},qe.prototype.writePackedFixed64String=qe.prototype.Yc,qe.prototype.ed=function(e,t){if(null!=t&&t.length)for(Ge(this,e,2),this.a.j(4*t.length),e=0;e<t.length;e++)this.a.S(t[e])},qe.prototype.writePackedSfixed32=qe.prototype.ed,qe.prototype.fd=function(e,t){if(null!=t&&t.length)for(Ge(this,e,2),this.a.j(8*t.length),e=0;e<t.length;e++)this.a.T(t[e])},qe.prototype.writePackedSfixed64=qe.prototype.fd,qe.prototype.gd=function(e,t){if(null!=t&&t.length)for(Ge(this,e,2),this.a.j(8*t.length),e=0;e<t.length;e++)this.a.ka(t[e])},qe.prototype.writePackedSfixed64String=qe.prototype.gd,qe.prototype.$c=function(e,t){if(null!=t&&t.length)for(Ge(this,e,2),this.a.j(4*t.length),e=0;e<t.length;e++)this.a.L(t[e])},qe.prototype.writePackedFloat=qe.prototype.$c,qe.prototype.Uc=function(e,t){if(null!=t&&t.length)for(Ge(this,e,2),this.a.j(8*t.length),e=0;e<t.length;e++)this.a.J(t[e])},qe.prototype.writePackedDouble=qe.prototype.Uc,qe.prototype.Tc=function(e,t){if(null!=t&&t.length)for(Ge(this,e,2),this.a.j(t.length),e=0;e<t.length;e++)this.a.I(t[e])},qe.prototype.writePackedBool=qe.prototype.Tc,qe.prototype.Vc=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.R(t[r]);$e(this,e)}},qe.prototype.writePackedEnum=qe.prototype.Vc,qe.prototype.Zc=function(e,t){if(null!=t&&t.length)for(Ge(this,e,2),this.a.j(8*t.length),e=0;e<t.length;e++)this.a.K(t[e])},qe.prototype.writePackedFixedHash64=qe.prototype.Zc,qe.prototype.td=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.N(t[r]);$e(this,e)}},qe.prototype.writePackedVarintHash64=qe.prototype.td,t.debug=Ne,t.Map=P,t.Message=ge,t.BinaryReader=le,t.BinaryWriter=qe,t.ExtensionFieldInfo=pe,t.ExtensionFieldBinaryInfo=fe,t.exportSymbol=function(e,t,r){d(e,t,r)},t.inherits=function(e,t){function r(){}r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e},t.object={extend:function(e,t){for(var r,n,o=1;o<arguments.length;o++){for(r in n=arguments[o])e[r]=n[r];for(var s=0;s<f.length;s++)r=f[s],Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}}},t.typeOf=h},"./node_modules/@tronweb3/google-protobuf/google/protobuf/any_pb.js"(e,t,r){var n=r("./node_modules/@tronweb3/google-protobuf/google-protobuf.js"),o=n,s="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof window&&window||void 0!==s&&s||"undefined"!=typeof self&&self||function(){return this}.call(null)||Function("return this")();o.exportSymbol("proto.google.protobuf.Any",null,s),proto.google.protobuf.Any=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(proto.google.protobuf.Any,n.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.Any.displayName="proto.google.protobuf.Any"),n.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.Any.prototype.toObject=function(e){return proto.google.protobuf.Any.toObject(e,this)},proto.google.protobuf.Any.toObject=function(e,t){var r={typeUrl:n.Message.getFieldWithDefault(t,1,""),value:t.getValue_asB64()};return e&&(r.$jspbMessageInstance=t),r}),proto.google.protobuf.Any.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new proto.google.protobuf.Any;return proto.google.protobuf.Any.deserializeBinaryFromReader(r,t)},proto.google.protobuf.Any.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readString();e.setTypeUrl(r);break;case 2:r=t.readBytes();e.setValue(r);break;default:t.skipField()}}return e},proto.google.protobuf.Any.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return proto.google.protobuf.Any.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.google.protobuf.Any.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getTypeUrl()).length>0&&t.writeString(1,r),(r=e.getValue_asU8()).length>0&&t.writeBytes(2,r)},proto.google.protobuf.Any.prototype.getTypeUrl=function(){return n.Message.getFieldWithDefault(this,1,"")},proto.google.protobuf.Any.prototype.setTypeUrl=function(e){return n.Message.setProto3StringField(this,1,e)},proto.google.protobuf.Any.prototype.getValue=function(){return n.Message.getFieldWithDefault(this,2,"")},proto.google.protobuf.Any.prototype.getValue_asB64=function(){return n.Message.bytesAsB64(this.getValue())},proto.google.protobuf.Any.prototype.getValue_asU8=function(){return n.Message.bytesAsU8(this.getValue())},proto.google.protobuf.Any.prototype.setValue=function(e){return n.Message.setProto3BytesField(this,2,e)},o.object.extend(t,proto.google.protobuf),proto.google.protobuf.Any.prototype.getTypeName=function(){return this.getTypeUrl().split("/").pop()},proto.google.protobuf.Any.prototype.pack=function(e,t,r){r||(r="type.googleapis.com/"),"/"!=r.substr(-1)?this.setTypeUrl(r+"/"+t):this.setTypeUrl(r+t),this.setValue(e)},proto.google.protobuf.Any.prototype.unpack=function(e,t){return this.getTypeName()==t?e(this.getValue_asU8()):null}},"./node_modules/@tronweb3/tronwallet-abstract-adapter/node_modules/eventemitter3/index.js"(e){"use strict";var t=Object.prototype.hasOwnProperty,r="~";function n(){}function o(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function s(e,t,n,s,i){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new o(n,s||e,i),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function i(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var e,n,o=[];if(0===this._eventsCount)return o;for(n in e=this._events)t.call(e,n)&&o.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},a.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,s=n.length,i=new Array(s);o<s;o++)i[o]=n[o].fn;return i},a.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,o,s,i){var a=r?r+e:e;if(!this._events[a])return!1;var c,l,u=this._events[a],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,o),!0;case 5:return u.fn.call(u.context,t,n,o,s),!0;case 6:return u.fn.call(u.context,t,n,o,s,i),!0}for(l=1,c=new Array(d-1);l<d;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var h,p=u.length;for(l=0;l<p;l++)switch(u[l].once&&this.removeListener(e,u[l].fn,void 0,!0),d){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,t);break;case 3:u[l].fn.call(u[l].context,t,n);break;case 4:u[l].fn.call(u[l].context,t,n,o);break;default:if(!c)for(h=1,c=new Array(d-1);h<d;h++)c[h-1]=arguments[h];u[l].fn.apply(u[l].context,c)}}return!0},a.prototype.on=function(e,t,r){return s(this,e,t,r,!1)},a.prototype.once=function(e,t,r){return s(this,e,t,r,!0)},a.prototype.removeListener=function(e,t,n,o){var s=r?r+e:e;if(!this._events[s])return this;if(!t)return i(this,s),this;var a=this._events[s];if(a.fn)a.fn!==t||o&&!a.once||n&&a.context!==n||i(this,s);else{for(var c=0,l=[],u=a.length;c<u;c++)(a[c].fn!==t||o&&!a[c].once||n&&a[c].context!==n)&&l.push(a[c]);l.length?this._events[s]=1===l.length?l[0]:l:i(this,s)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&i(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,e.exports=a},"./node_modules/@walletconnect/environment/dist/cjs/crypto.js"(e,t,r){"use strict";function n(){return(null===r.g||void 0===r.g?void 0:r.g.crypto)||(null===r.g||void 0===r.g?void 0:r.g.msCrypto)||{}}function o(){const e=n();return e.subtle||e.webkitSubtle}
2Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowserCryptoAvailable=t.getSubtleCrypto=t.getBrowerCrypto=void 0,t.getBrowerCrypto=n,t.getSubtleCrypto=o,t.isBrowserCryptoAvailable=function(){return!!n()&&!!o()}},"./node_modules/@walletconnect/environment/dist/cjs/env.js"(e,t,r){"use strict";var n=r("./node_modules/process/browser.js");function o(){return"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product}function s(){return void 0!==n&&void 0!==n.versions&&void 0!==n.versions.node}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowser=t.isNode=t.isReactNative=void 0,t.isReactNative=o,t.isNode=s,t.isBrowser=function(){return!o()&&!s()}},"./node_modules/@walletconnect/environment/dist/cjs/index.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r("./node_modules/@walletconnect/environment/node_modules/tslib/tslib.es6.js");n.__exportStar(r("./node_modules/@walletconnect/environment/dist/cjs/crypto.js"),t),n.__exportStar(r("./node_modules/@walletconnect/environment/dist/cjs/env.js"),t)},"./node_modules/@walletconnect/environment/node_modules/tslib/tslib.es6.js"(e,t,r){"use strict";r.r(t),r.d(t,{__assign:()=>s,__asyncDelegator:()=>v,__asyncGenerator:()=>w,__asyncValues:()=>A,__await:()=>b,__awaiter:()=>u,__classPrivateFieldGet:()=>C,__classPrivateFieldSet:()=>k,__createBinding:()=>h,__decorate:()=>a,__exportStar:()=>p,__extends:()=>o,__generator:()=>d,__importDefault:()=>E,__importStar:()=>
vendor: 4,173 bytes, line 2
2P,__makeTemplateObject:()=>T,__metadata:()=>l,__param:()=>c,__read:()=>g,__rest:()=>i,__spread:()=>m,__spreadArrays:()=>y,__values:()=>f});var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)};function o(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var s=function(){return s=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},s.apply(this,arguments)};function i(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function a(e,t,r,n){var o,s=arguments.length,i=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(t,r,i):o(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i}function c(e,t){return function(r,n){t(r,n,e)}}function l(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function u(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))}function d(e,t){var r,n,o,s,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,n=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}function h(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}function p(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||(t[r]=e[r])}function f(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,s=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}return i}function m(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}function y(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var s=arguments[t],i=0,a=s.length;i<a;i++,o++)n[o]=s[i];return n}function b(e){return this instanceof b?(this.v=e,this):new b(e)}function w(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),s=[];return n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n;function i(e){o[e]&&(n[e]=function(t){return new Promise((function(r,n){
2s.push([e,t,r,n])>1||a(e,t)}))})}function a(e,t){try{(r=o[e](t)).value instanceof b?Promise.resolve(r.value.v).then(c,l):u(s[0][2],r)}catch(e){u(s[0][3],e)}var r}function c(e){a("next",e)}function l(e){a("throw",e)}function u(e,t){e(t),s.shift(),s.length&&a(s[0][0],s[0][1])}}function v(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:b(e[n](t)),done:"return"===n}:o?o(t):t}:o}}function A(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=f(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,o){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,o,(t=e[r](t)).done,t.value)}))}}}function T(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function P(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function E(e){return e&&e.__esModule?e:{default:e}}function C(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function k(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}},"./node_modules/@walletconnect/jsonrpc-http-connection/node_modules/cross-fetch/dist/browser-ponyfill.js"(e,t,r){var n="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==r.g&&r.g,o=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();!function(e){!function(t){var n=void 0!==e&&e||"undefined"!=typeof self&&self||void 0!==r.g&&r.g||{},o="URLSearchParams"in n,s="Symbol"in n&&"iterator"in Symbol,i="FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(e){return!1}}(),a="FormData"in n,c="ArrayBuffer"in n;if(c)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(e){return e&&l.indexOf(Object.prototype.toString.call(e))>-1};function d(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function h(e){return"string"!=typeof e&&(e=String(e)),e}function p(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return s&&(t[Symbol.iterator]=function(){return t}),t}function f(e){this.map={},e instanceof f?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){if(2!=e.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function g(e){if(!e._noBody)return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function m(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function y(e){var t=new FileReader,r=m(t);return t.readAsArrayBuffer(e),r}function b(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function w(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:a&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:o&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():c&&i&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=b(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=b(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):o&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=g(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=g(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(i)return this.blob().then(y);throw new Error("could not read as ArrayBuffer")},this.text=function(){var e,t,r,n,o,s=g(this);if(s)return s;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=m(t),n=/charset=([A-Za-z0-9_-]+)/.exec(e.type),o=n?n[1]:"utf-8",t.readAsText(e,o),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a&&(this.formData=function(){return this.text().then(T)}),this.json=function(){return this.text().then(JSON.parse)},this}f.prototype.append=function(e,t){e=d(e),t=h(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},f.prototype.delete=function(e){delete this.map[d(e)]},f.prototype.get=function(e){return e=d(e),this.has(e)?this.map[e]:null},f.prototype.has=function(e){return this.map.hasOwnProperty(d(e))},f.prototype.set=function(e,t){this.map[d(e)]=h(t)},f.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},f.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),p(e)},f.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),p(e)},f.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),p(e)},s&&(f.prototype[Symbol.iterator]=f.prototype.entries);var v=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function A(e,t){if(!(this instanceof A))throw new TypeError('Please use the "new" operator, this DOM object c
2onstructor cannot be called as a function.');var r,o,s=(t=t||{}).body;if(e instanceof A){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new f(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,s||null==e._bodyInit||(s=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new f(t.headers)),this.method=(r=t.method||this.method||"GET",o=r.toUpperCase(),v.indexOf(o)>-1?o:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in n)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&s)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(s),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var i=/([?&])_=[^&]*/;if(i.test(this.url))this.url=this.url.replace(i,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function T(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(o))}})),t}function P(e,t){if(!(this instanceof P))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new f(t.headers),this.url=t.url||"",this._initBody(e)}A.prototype.clone=function(){return new A(this,{body:this._bodyInit})},w.call(A.prototype),w.call(P.prototype),P.prototype.clone=function(){return new P(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},P.error=function(){var e=new P(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var E=[301,302,303,307,308];P.redirect=function(e,t){if(-1===E.indexOf(t))throw new RangeError("Invalid status code");return new P(null,{status:t,headers:{location:e}})},t.DOMException=n.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function C(e,r){return new Promise((function(o,s){var a=new A(e,r);if(a.signal&&a.signal.aborted)return s(new t.DOMException("Aborted","AbortError"));var l=new XMLHttpRequest;function u(){l.abort()}if(l.onload=function(){var e,t,r={statusText:l.statusText,headers:(e=l.getAllResponseHeaders()||"",t=new f,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();try{t.append(n,o)}catch(e){console.warn("Response "+e.message)}}})),t)};0===a.url.indexOf("file://")&&(l.status<200||l.status>599)?r.status=200:r.status=l.status,r.url="responseURL"in l?l.responseURL:r.headers.get("X-Request-URL");var n="response"in l?l.response:l.responseText;setTimeout((function(){o(new P(n,r))}),0)},l.onerror=function(){setTimeout((function(){s(new TypeError("Network request failed"))}),0)},l.ontimeout=function(){setTimeout((function(){s(new TypeError("Network request timed out"))}),0)},l.onabort=function(){setTimeout((function(){s(new t.DOMException("Aborted","AbortError"))}),0)},l.open(a.method,function(e){try{return""===e&&n.location.href?n.location.href:e}catch(t){return e}}(a.url),!0),"include"===a.credentials?l.withCredentials=!0:"omit"===a.credentials&&(l.withCredentials=!1),"responseType"in l&&(i?l.responseType="blob":c&&(l.responseType="arraybuffer")),r&&"object"==typeof r.headers&&!(r.headers instanceof f||n.Headers&&r.headers instanceof n.Headers)){var p=[];
2Object.getOwnPropertyNames(r.headers).forEach((function(e){p.push(d(e)),l.setRequestHeader(e,h(r.headers[e]))})),a.headers.forEach((function(e,t){-1===p.indexOf(t)&&l.setRequestHeader(t,e)}))}else a.headers.forEach((function(e,t){l.setRequestHeader(t,e)}));a.signal&&(a.signal.addEventListener("abort",u),l.onreadystatechange=function(){4===l.readyState&&a.signal.removeEventListener("abort",u)}),l.send(void 0===a._bodyInit?null:a._bodyInit)}))}C.polyfill=!0,n.fetch||(n.fetch=C,n.Headers=f,n.Request=A,n.Response=P),t.Headers=f,t.Request=A,t.Response=P,t.fetch=C,Object.defineProperty(t,"__esModule",{value:!0})}({})}(o),o.fetch.ponyfill=!0,delete o.fetch.polyfill;var s=n.fetch?n:o;(t=s.fetch).default=s.fetch,t.fetch=s.fetch,t.Headers=s.Headers,t.Request=s.Request,t.Response=s.Response,e.exports=t},"./node_modules/@walletconnect/time/dist/cjs/constants/index.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r("./node_modules/@walletconnect/time/node_modules/tslib/tslib.es6.js");n.__exportStar(r("./node_modules/@walletconnect/time/dist/cjs/constants/misc.js"),t),n.__exportStar(r("./node_modules/@walletconnect/time/dist/cjs/constants/time.js"),t)},"./node_modules/@walletconnect/time/dist/cjs/constants/misc.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_THOUSAND=t.ONE_HUNDRED=void 0,t.ONE_HUNDRED=100,t.ONE_THOUSAND=1e3},"./node_modules/@walletconnect/time/dist/cjs/constants/time.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=5*t.ONE_MINUTE,t.TEN_MINUTES=10*t.ONE_MINUTE,t.THIRTY_MINUTES=30*t.ONE_MINUTE,t.SIXTY_MINUTES=60*t.ONE_MINUTE,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=3*t.ONE_HOUR,t.SIX_HOURS=6*t.ONE_HOUR,t.TWELVE_HOURS=12*t.ONE_HOUR,t.TWENTY_FOUR_HOURS=24*t.ONE_HOUR,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=3*t.ONE_DAY,t.FIVE_DAYS=5*t.ONE_DAY,t.SEVEN_DAYS=7*t.ONE_DAY,t.THIRTY_DAYS=30*t.ONE_DAY,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=2*t.ONE_WEEK,t.THREE_WEEKS=3*t.ONE_WEEK,t.FOUR_WEEKS=4*t.ONE_WEEK,t.ONE_YEAR=365*t.ONE_DAY},"./node_modules/@walletconnect/time/dist/cjs/index.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r("./node_modules/@walletconnect/time/node_modules/tslib/tslib.es6.js");n.__exportStar(r("./node_modules/@walletconnect/time/dist/cjs/utils/index.js"),t),n.__exportStar(r("./node_modules/@walletconnect/time/dist/cjs/watch.js"),t),n.__exportStar(r("./node_modules/@walletconnect/time/dist/cjs/types/index.js"),t),n.__exportStar(r("./node_modules/@walletconnect/time/dist/cjs/constants/index.js"),t)},"./node_modules/@walletconnect/time/dist/cjs/types/index.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});r("./node_modules/@walletconnect/time/node_modules/tslib/tslib.es6.js").__exportStar(r("./node_modules/@walletconnect/time/dist/cjs/types/watch.js"),t)},"./node_modules/@walletconnect/time/dist/cjs/types/watch.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IWatch=void 0;t.IWatch=class{}},"./node_modules/@walletconnect/time/dist/cjs/utils/convert.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromMiliseconds=t.toMiliseconds=void 0;const n=r("./node_modules/@walletconnect/time/dist/cjs/constants/index.js");t.toMiliseconds=function(e){return e*n.ONE_THOUSAND},t.fromMiliseconds=function(e){return Math.floor(e/n.ONE_THOUSAND)}},"./node_modules/@walletconnect/time/dist/cjs/utils/delay.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delay=void 0,t.delay=function(e){return new Promise((t=>{setTimeout((()=>{t(!0)}),e)}))}},"./node_modules/@walletconnect/time/dist/cjs/utils/index.js"(e,t,r){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0});const n=r("./node_modules/@walletconnect/time/node_modules/tslib/tslib.es6.js");n.__exportStar(r("./node_modules/@walletconnect/time/dist/cjs/utils/delay.js"),t),n.__exportStar(r("./node_modules/@walletconnect/time/dist/cjs/utils/convert.js"),t)},"./node_modules/@walletconnect/time/dist/cjs/watch.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Watch=void 0;class r{constructor(){this.timestamps=new Map}start(e){if(this.timestamps.has(e))throw new Error(`Watch already started for label: ${e}`);this.timestamps.set(e,{started:Date.now()})}stop(e){const t=this.get(e);if(void 0!==t.elapsed)throw new Error(`Watch already stopped for label: ${e}`);const r=Date.now()-t.started;this.timestamps.set(e,{started:t.started,elapsed:r})}get(e){const t=this.timestamps.get(e);if(void 0===t)throw new Error(`No timestamp found for label: ${e}`);return t}elapsed(e){const t=this.get(e);return t.elapsed||Date.now()-t.started}}t.Watch=r,t.default=r},"./node_modules/@walletconnect/time/node_modules/tslib/tslib.es6.js"(e,t,r){"use strict";r.r(t),r.d(t,{__assign:()=>s,__asyncDelegator:()=>v,__asyncGenerator:()=>w,__asyncValues:()=>A,__await:()=>b,__awaiter:()=>u,__classPrivateFieldGet:()=>C,__classPrivateFieldSet:()=>k,__createBinding:()=>h,__decorate:()=>a,__exportStar:()=>p,__extends:()=>o,__generator:()=>d,__importDefault:()=>E,__importStar:()=>
vendor: 4,173 bytes, line 2
2P,__makeTemplateObject:()=>T,__metadata:()=>l,__param:()=>c,__read:()=>g,__rest:()=>i,__spread:()=>m,__spreadArrays:()=>y,__values:()=>f});var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)};function o(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var s=function(){return s=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},s.apply(this,arguments)};function i(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function a(e,t,r,n){var o,s=arguments.length,i=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(t,r,i):o(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i}function c(e,t){return function(r,n){t(r,n,e)}}function l(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function u(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))}function d(e,t){var r,n,o,s,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,n=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}function h(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}function p(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||(t[r]=e[r])}function f(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,s=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}return i}function m(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}function y(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var s=arguments[t],i=0,a=s.length;i<a;i++,o++)n[o]=s[i];return n}function b(e){return this instanceof b?(this.v=e,this):new b(e)}function w(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),s=[];return n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n;function i(e){o[e]&&(n[e]=function(t){return new Promise((function(r,n){
2s.push([e,t,r,n])>1||a(e,t)}))})}function a(e,t){try{(r=o[e](t)).value instanceof b?Promise.resolve(r.value.v).then(c,l):u(s[0][2],r)}catch(e){u(s[0][3],e)}var r}function c(e){a("next",e)}function l(e){a("throw",e)}function u(e,t){e(t),s.shift(),s.length&&a(s[0][0],s[0][1])}}function v(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:b(e[n](t)),done:"return"===n}:o?o(t):t}:o}}function A(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=f(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,o){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,o,(t=e[r](t)).done,t.value)}))}}}function T(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function P(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function E(e){return e&&e.__esModule?e:{default:e}}function C(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function k(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}},"./node_modules/@walletconnect/window-getters/dist/cjs/index.js"(e,t){"use strict";function r(e){let t;return"undefined"!=typeof window&&void 0!==window[e]&&(t=window[e]),t}function n(e){const t=r(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}Object.defineProperty(t,"__esModule",{value:!0}),t.getLocalStorage=t.getLocalStorageOrThrow=t.getCrypto=t.getCryptoOrThrow=t.getLocation=t.getLocationOrThrow=t.getNavigator=t.getNavigatorOrThrow=t.getDocument=t.getDocumentOrThrow=t.getFromWindowOrThrow=t.getFromWindow=void 0,t.getFromWindow=r,t.getFromWindowOrThrow=n,t.getDocumentOrThrow=function(){return n("document")},t.getDocument=function(){return r("document")},t.getNavigatorOrThrow=function(){return n("navigator")},t.getNavigator=function(){return r("navigator")},t.getLocationOrThrow=function(){return n("location")},t.getLocation=function(){return r("location")},t.getCryptoOrThrow=function(){return n("crypto")},t.getCrypto=function(){return r("crypto")},t.getLocalStorageOrThrow=function(){return n("localStorage")},t.getLocalStorage=function(){return r("localStorage")}},"./node_modules/@walletconnect/window-metadata/dist/cjs/index.js"(e,t,r){"use strict";t.g=void 0;const n=r("./node_modules/@walletconnect/window-getters/dist/cjs/index.js");t.g=function(){let e,t;try{e=n.getDocumentOrThrow(),t=n.getLocationOrThrow()}catch(e){return null}function r(...t){const r=e.getElementsByTagName("meta");for(let e=0;e<r.length;e++){const n=r[e],o=["itemprop","property","name"].map((e=>n.getAttribute(e))).filter((e=>!!e&&t.includes(e)));if(o.length&&o){const e=n.getAttribute("content");if(e)return e}}return""}const o=function(){let t=r("name","og:site_name","og:title","twitter:title");return t||(t=e.title),t}();return{description:r("description","og:description","twitter:description","keywords"),url:t.origin,icons:function(){const r=e.getElementsByTagName("link"),n=[];for(let e=0;e<r.length;e++){const o=r[e],s=o.getAttribute("rel");if(s&&s.toLowerCase().indexOf("icon")>-1){const e=o.getAttribute("href");if(e)if(-1===e.toLowerCase().indexOf("https:")&&-1===e.toLowerCase().indexOf("http:")&&0!==e.indexOf("//")){let r=t.protocol+"//"+t.host;if(0===e.indexOf("/"))r+=e;else{const n=t.pathname.split("/");n.pop();r+=n.join("/")+"/"+e}n.push(r)}else if(0===e.indexOf("//")){const r=t.protocol+e;n.push(r)}else n.push(e)}}return n}(),name:o}}},"./node_modules/ethers/lib.esm/index.js"(e,t,r){"use strict";r.r(t),r.d(t,{BaseContract:()=>a.Uq,BigNumber:()=>c.gH,Contract:()=>a.NZ,ContractFactory:()=>a.PM,FixedNumber:()=>l.I3,Signer:()=>u.l,VoidSigner:()=>u.J,Wallet:()=>d.Wallet,Wordlist:()=>Be.b,constants:()=>n,errors:()=>T.ErrorCode,ethers:()=>i,getDefaultProvider:()=>Se,logger:()=>nt,providers:()=>o,utils:()=>s,version:()=>rt,wordlists:()=>xe.Y});var n={};r.r(n),r.d(n,{AddressZero:()=>h.L,EtherSymbol:()=>g,HashZero:()=>f.j,MaxInt256:()=>p.fw,MaxUint256:()=>p.Is,MinInt256:()=>p.LV,NegativeOne:()=>p.eR,One:()=>p.pD,Two:()=>p.d0,WeiPerEther:()=>p.lQ,Zero:()=>p.XK});var o={};
2r.r(o),r.d(o,{AlchemyProvider:()=>M,AlchemyWebSocketProvider:()=>O,AnkrProvider:()=>N,BaseProvider:()=>b.DJ,CloudflareProvider:()=>L,EtherscanProvider:()=>Q,FallbackProvider:()=>pe,Formatter:()=>v.ZA,InfuraProvider:()=>be,InfuraWebSocketProvider:()=>ye,IpcProvider:()=>fe,JsonRpcBatchProvider:()=>we,JsonRpcProvider:()=>A.F,JsonRpcSigner:()=>A.c,NodesmithProvider:()=>Ae,PocketProvider:()=>Ee,Provider:()=>m.Kq,QuickNodeProvider:()=>ke,Resolver:()=>b.xR,StaticJsonRpcProvider:()=>S.B,UrlJsonRpcProvider:()=>S.M,Web3Provider:()=>_e.j,WebSocketProvider:()=>I,getDefaultProvider:()=>Se,getNetwork:()=>y.N,isCommunityResourcable:()=>v.fw,isCommunityResource:()=>v.ws,showThrottleMessage:()=>v.Zd});var s={};r.r(s),r.d(s,{AbiCoder:()=>Oe.y,ConstructorFragment:()=>Me.Pw,ErrorFragment:()=>Me.bp,EventFragment:()=>Me.Zp,FormatTypes:()=>Me.$o,Fragment:()=>Me.FK,FunctionFragment:()=>Me.hc,HDNode:()=>Ve.HDNode,Indexed:()=>je.wu,Interface:()=>je.KA,LogDescription:()=>je.FW,Logger:()=>T.Logger,ParamType:()=>Me.aX,RLP:()=>Ye,SigningKey:()=>Je.SigningKey,SupportedAlgorithm:()=>tt.q,TransactionDescription:()=>je.dJ,TransactionTypes:()=>z.TransactionTypes,UnicodeNormalizationForm:()=>Ze.dz,Utf8ErrorFuncs:()=>Ze.d5,Utf8ErrorReason:()=>Ze._E,_TypedDataEncoder:()=>ze.z,_fetchData:()=>V._fetchData,_toEscapedUtf8String:()=>Ze.Wj,accessListify:()=>z.accessListify,arrayify:()=>F.arrayify,base58:()=>Ue.Base58,base64:()=>Ne,checkProperties:()=>w.checkProperties,checkResultErrors:()=>We.$v,commify:()=>et.commify,computeAddress:()=>z.computeAddress,computeHmac:()=>Ke.L5,computePublicKey:()=>Je.computePublicKey,concat:()=>F.concat,deepCopy:()=>w.deepCopy,defaultAbiCoder:()=>Oe.D,defaultPath:()=>Ve.defaultPath,defineReadOnly:()=>w.defineReadOnly,dnsEncode:()=>De.Wh,entropyToMnemonic:()=>Ve.entropyToMnemonic,fetchJson:()=>V.fetchJson,formatBytes32String:()=>Xe.R,formatEther:()=>et.formatEther,formatUnits:()=>et.formatUnits,getAccountPath:()=>Ve.getAccountPath,getAddress:()=>Re.getAddress,getContractAddress:()=>Re.getContractAddress,getCreate2Address:()=>Re.getCreate2Address,getIcapAddress:()=>Re.getIcapAddress,getJsonWalletAddress:()=>qe.cZ,getStatic:()=>w.getStatic,hashMessage:()=>Le.A,hexConcat:()=>F.hexConcat,hexDataLength:()=>F.hexDataLength,hexDataSlice:()=>F.hexDataSlice,hexStripZeros:()=>F.hexStripZeros,hexValue:()=>F.hexValue,hexZeroPad:()=>F.hexZeroPad,hexlify:()=>F.hexlify,id:()=>Fe.id,isAddress:()=>Re.isAddress,isBytes:()=>F.isBytes,isBytesLike:()=>F.isBytesLike,isHexString:()=>F.isHexString,isValidMnemonic:()=>Ve.isValidMnemonic,isValidName:()=>De.uV,joinSignature:()=>F.joinSignature,keccak256:()=>He.keccak256,mnemonicToEntropy:()=>Ve.mnemonicToEntropy,mnemonicToSeed:()=>Ve.mnemonicToSeed,namehash:()=>De.kM,nameprep:()=>Qe.j9,parseBytes32String:()=>Xe.V,parseEther:()=>et.parseEther,parseTransaction:()=>z.parse,parseUnits:()=>et.parseUnits,poll:()=>V.poll,randomBytes:()=>Ge.p,recoverAddress:()=>z.recoverAddress,recoverPublicKey:()=>Je.recoverPublicKey,resolveProperties:()=>w.resolveProperties,ripemd160:()=>Ke.HE,serializeTransaction:()=>z.serialize,sha256:()=>Ke.sc,sha512:()=>Ke.Zf,shallowCopy:()=>w.shallowCopy,shuffled:()=>Z.A,solidityKeccak256:()=>$e.keccak256,solidityPack:()=>$e.pack,soliditySha256:()=>$e.sha256,splitSignature:()=>F.splitSignature,stripZeros:()=>F.stripZeros,toUtf8Bytes:()=>Ze.YW,toUtf8CodePoints:()=>Ze.dg,toUtf8String:()=>Ze._v,verifyMessage:()=>d.verifyMessage,verifyTypedData:()=>d.verifyTypedData,zeroPad:()=>F.zeroPad});var i={};r.r(i),r.d(i,{BaseContract:()=>a.Uq,BigNumber:()=>c.gH,Contract:()=>a.NZ,ContractFactory:()=>a.PM,FixedNumber:()=>l.I3,Signer:()=>u.l,VoidSigner:()=>u.J,Wallet:()=>d.Wallet,Wordlist:()=>Be.b,constants:()=>n,errors:()=>T.ErrorCode,getDefaultProvider:()=>Se,logger:()=>nt,providers:()=>o,utils:()=>s,version:()=>rt,wordlists:()=>xe.Y});var a=r("./node_modules/@ethersproject/contracts/lib.esm/index.js"),c=r("./node_modules/@ethersproject/bignumber/lib.esm/bignumber.js"),l=r("./node_modules/@ethersproject/bignumber/lib.esm/fixednumber.js"),u=r("./node_modules/@ethersproject/abstract-signer/lib.esm/index.js"),d=r("./node_modules/@ethersproject/wallet/lib.esm/index.js"),h=r("./node_modules/@ethersproject/constants/lib.esm/addresses.js"),p=r("./node_modules/@ethersproject/constants/lib.esm/bignumbers.js"),f=r("./node_modules/@ethersproject/constants/lib.esm/hashes.js");const g="Î";var m=r("./node_modules/@ethersproject/abstract-provider/lib.esm/index.js"),y=r("./node_modules/@ethersproject/networks/lib.esm/index.js"),b=r("./node_modules/@ethersproject/providers/lib.esm/base-provider.js"),w=r("./node_modules/@ethersproject/properties/lib.esm/index.js"),v=r("./node_modules/@ethersproject/providers/lib.esm/formatter.js"),A=r("./node_modules/@ethersproject/providers/lib.esm/json-rpc-provider.js"),T=r("./node_modules/@ethersproject/logger/lib.esm/index.js"),P=r("./node_modules/@ethersproject/providers/lib.esm/_version.js");let E=null;try{if(E=WebSocket,null==E)throw new Error("inject please")}catch(e){const t=new T.Logger(P.r);E=function(){t.throwError("WebSockets not supported in this environment",T.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var C=function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))};const k=new T.Logger(P.r);let _=1;class I extends A.F{constructor(e,t){"any"===t&&k.throwError("WebSocketProvider does not support 'any' network yet",T.Logger.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),super("string"==typeof e?e:"_websocket",t),this._pollingInterval=-1,this._wsReady=!1,"string"==typeof e?(0,w.defineReadOnly)(this,"_websocket",new E(this.connection.url)):(0,w.defineReadOnly)(this,"_websocket",e),(0,w.defineReadOnly)(this,"_requests",{}),(0,w.defineReadOnly)(this,"_subs",{}),(0,w.defineReadOnly)(this,"_subIds",{}),(0,w.defineReadOnly)(this,"_detectNetwork",super.detectNetwork()),this.websocket.onopen=()=>
2{this._wsReady=!0,Object.keys(this._requests).forEach((e=>{this.websocket.send(this._requests[e].payload)}))},this.websocket.onmessage=e=>{const t=e.data,r=JSON.parse(t);if(null!=r.id){const e=String(r.id),n=this._requests[e];if(delete this._requests[e],void 0!==r.result)n.callback(null,r.result),this.emit("debug",{action:"response",request:JSON.parse(n.payload),response:r.result,provider:this});else{let e=null;r.error?(e=new Error(r.error.message||"unknown error"),(0,w.defineReadOnly)(e,"code",r.error.code||null),(0,w.defineReadOnly)(e,"response",t)):e=new Error("unknown error"),n.callback(e,void 0),this.emit("debug",{action:"response",error:e,request:JSON.parse(n.payload),provider:this})}}else if("eth_subscription"===r.method){const e=this._subs[r.params.subscription];e&&e.processFunc(r.params.result)}else console.warn("this should not happen")};const r=setInterval((()=>{this.emit("poll")}),1e3);r.unref&&r.unref()}get websocket(){return this._websocket}detectNetwork(){return this._detectNetwork}get pollingInterval(){return 0}resetEventsBlock(e){k.throwError("cannot reset events block on WebSocketProvider",T.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}set pollingInterval(e){k.throwError("cannot set polling interval on WebSocketProvider",T.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}poll(){return C(this,void 0,void 0,(function*(){return null}))}set polling(e){e&&k.throwError("cannot set polling on WebSocketProvider",T.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}send(e,t){const r=_++;return new Promise(((n,o)=>{const s=JSON.stringify({method:e,params:t,id:r,jsonrpc:"2.0"});this.emit("debug",{action:"request",request:JSON.parse(s),provider:this}),this._requests[String(r)]={callback:function(e,t){return e?o(e):n(t)},payload:s},this._wsReady&&this.websocket.send(s)}))}static defaultUrl(){return"ws://localhost:8546"}_subscribe(e,t,r){return C(this,void 0,void 0,(function*(){let n=this._subIds[e];null==n&&(n=Promise.all(t).then((e=>this.send("eth_subscribe",e))),this._subIds[e]=n);const o=yield n;this._subs[o]={tag:e,processFunc:r}}))}_startEvent(e){switch(e.type){case"block":this._subscribe("block",["newHeads"],(e=>{const t=c.gH.from(e.number).toNumber();this._emitted.block=t,this.emit("block",t)}));break;case"pending":this._subscribe("pending",["newPendingTransactions"],(e=>{this.emit("pending",e)}));break;case"filter":this._subscribe(e.tag,["logs",this._getFilter(e.filter)],(t=>{null==t.removed&&(t.removed=!1),this.emit(e.filter,this.formatter.filterLog(t))}));break;case"tx":{const t=e=>{const t=e.hash;this.getTransactionReceipt(t).then((e=>{e&&this.emit(t,e)}))};t(e),this._subscribe("tx",["newHeads"],(e=>{this._events.filter((e=>"tx"===e.type)).forEach(t)}));break}case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",e)}}_stopEvent(e){let t=e.tag;if("tx"===e.type){if(this._events.filter((e=>"tx"===e.type)).length)return;t="tx"}else if(this.listenerCount(e.event))return;const r=this._subIds[t];r&&(delete this._subIds[t],r.then((e=>{this._subs[e]&&(delete this._subs[e],this.send("eth_unsubscribe",[e]))})))}destroy(){return C(this,void 0,void 0,(function*(){this.websocket.readyState===E.CONNECTING&&(yield new Promise((e=>{this.websocket.onopen=function(){e(!0)},this.websocket.onerror=function(){e(!1)}}))),this.websocket.close(1e3)}))}}var S=r("./node_modules/@ethersproject/providers/lib.esm/url-json-rpc-provider.js");const x=new T.Logger(P.r),B="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class O extends I{constructor(e,t){const r=new M(e,t);super(r.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi."),r.network),(0,w.defineReadOnly)(this,"apiKey",r.apiKey)}isCommunityResource(){return this.apiKey===B}}class M extends S.M{static getWebSocketProvider(e,t){return new O(e,t)}static getApiKey(e){return null==e?B:(e&&"string"!=typeof e&&x.throwArgumentError("invalid apiKey","apiKey",e),e)}static getUrl(e,t){let r=null;switch(e.name){case"homestead":r="eth-mainnet.alchemyapi.io/v2/";break;case"goerli":r="eth-goerli.g.alchemy.com/v2/";break;case"sepolia":r="eth-sepolia.g.alchemy.com/v2/";break;case"matic":r="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":r="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":r="arb-mainnet.g.alchemy.com/v2/";break;
2case"arbitrum-goerli":r="arb-goerli.g.alchemy.com/v2/";break;case"arbitrum-sepolia":r="arb-sepolia.g.alchemy.com/v2/";break;case"optimism":r="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-goerli":r="opt-goerli.g.alchemy.com/v2/";break;case"optimism-sepolia":r="opt-sepolia.g.alchemy.com/v2/";break;default:x.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+r+t,throttleCallback:(e,r)=>(t===B&&(0,v.Zd)(),Promise.resolve(!0))}}isCommunityResource(){return this.apiKey===B}}const W=new T.Logger(P.r),j="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function R(e){switch(e){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"sepolia":return"rpc.ankr.com/eth_sepolia/";case"matic":return"rpc.ankr.com/polygon/";case"maticmum":return"rpc.ankr.com/polygon_mumbai/";case"optimism":return"rpc.ankr.com/optimism/";case"optimism-goerli":return"rpc.ankr.com/optimism_testnet/";case"optimism-sepolia":return"rpc.ankr.com/optimism_sepolia/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return W.throwArgumentError("unsupported network","name",e)}class N extends S.M{isCommunityResource(){return this.apiKey===j}static getApiKey(e){return e??j}static getUrl(e,t){null==t&&(t=j);const r={allowGzip:!0,url:"https://"+R(e.name)+t,throttleCallback:(e,r)=>(t.apiKey===j&&(0,v.Zd)(),Promise.resolve(!0))};return null!=t.projectSecret&&(r.user="",r.password=t.projectSecret),r}}var U=function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))};const D=new T.Logger(P.r);class L extends S.M{static getApiKey(e){return null!=e&&D.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null}static getUrl(e,t){let r=null;if("homestead"===e.name)r="https://cloudflare-eth.com/";else D.throwArgumentError("unsupported network","network",arguments[0]);return r}perform(e,t){const r=Object.create(null,{perform:{get:()=>super.perform}});return U(this,void 0,void 0,(function*(){if("getBlockNumber"===e){return(yield r.perform.call(this,"getBlock",{blockTag:"latest"})).number}return r.perform.call(this,e,t)}))}}var F=r("./node_modules/@ethersproject/bytes/lib.esm/index.js"),z=r("./node_modules/@ethersproject/transactions/lib.esm/index.js"),V=r("./node_modules/@ethersproject/web/lib.esm/index.js"),q=function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))};const H=new T.Logger(P.r);function K(e){const t={};for(let r in e){if(null==e[r])continue;let n=e[r];"type"===r&&0===n||(n={type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[r]?(0,F.hexValue)((0,F.hexlify)(n)):"accessList"===r?"["+(0,z.accessListify)(n).map((e=>`{address:"${e.address}",storageKeys:["${e.storageKeys.join('","')}"]}`)).join(",")+"]":(0,F.hexlify)(n),t[r]=n)}return t}function $(e){if(0==e.status&&("No records found"===e.message||"No transactions found"===e.message))return e.result;if(1!=e.status||"string"!=typeof e.message||!e.message.match(/^OK/)){const t=new Error("invalid response");throw t.result=JSON.stringify(e),(e.result||"").toLowerCase().indexOf("rate limit")>=0&&(t.throttleRetry=!0),t}return e.result}function G(e){if(e&&0==e.status&&"NOTOK"==e.message&&(e.result||"").toLowerCase().indexOf("rate limit")>=0){const t=new Error("throttled response");throw t.result=JSON.stringify(e),t.throttleRetry=!0,t}if("2.0"!=e.jsonrpc){const t=new Error("invalid response");throw t.result=JSON.stringify(e),t}if(e.error){const t=new Error(e.error.message||"unknown error");throw e.error.code&&(t.code=e.error.code),e.error.data&&(t.data=e.error.data),t}return e.result}function Y(e){if("pending"===e)throw new Error("pending not supported");return"latest"===e?e:parseInt(e.substring(2),16)}function J(e,t,r){if("call"===e&&t.code===T.Logger.errors.SERVER_ERROR){const e=t.error;if(e&&(e.message.match(/reverted/i)||e.message.match(/VM execution error/i))){let r=e.data;if(r&&(r="0x"+r.replace(/^.*0x/i,"")),(0,F.isHexString)(r))return r;H.throwError("missing revert data in call exception",T.Logger.errors.CALL_EXCEPTION,{error:t,data:"0x"})}}let n=t.message;throw t.code===T.Logger.errors.SERVER_ERROR&&(t.error&&"string"==typeof t.error.message?n=t.error.message:"string"==typeof t.body?n=t.body:"string"==typeof t.responseText&&(n=t.responseText)),n=(n||"").toLowerCase(),n.match(/insufficient funds/)&&H.throwError("insufficient funds for intrinsic transaction cost",T.Logger.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:r}),n.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&H.throwError("nonce has already been used",T.Logger.errors.NONCE_EXPIRED,{error:t,method:e,transaction:r}),n.match(/another transaction with same nonce/)&&H.throwError("replacement fee too low",T.Logger.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:r}),n.match(/execution failed due to an exception|execution reverted/)&&H.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",T.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}class Q extends b.DJ{constructor(e,t){super(e),(0,w.defineReadOnly)(this,"baseUrl",this.getBaseUrl()),(0,w.defineReadOnly)(this,"apiKey",t||null)}getBaseUrl(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"matic":return"https://api.polygonscan.com";case"maticmum":return"https://api-testnet.polygonscan.com";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}return H.throwArgumentError("unsupported network","network",this.network.name)}getUrl(e,t){const r=Object.keys(t).reduce(((e,r)=>{const n=t[r];return null!=n&&(e+=`&${r}=${n}`),e}),""),n=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.baseUrl}/api?module=${e}${r}${n}`}getPostUrl(){return`${this.baseUrl}/api`}getPostData(e,t){return t.module=e,t.apikey=this.apiKey,t}fetch(e,t,r){return q(this,void 0,void 0,(function*(){const n=r?this.getPostUrl():this.getUrl(e,t),o=r?this.getPostData(e,t):null,s="proxy"===e?G:$;
2this.emit("debug",{action:"request",request:n,provider:this});const i={url:n,throttleSlotInterval:1e3,throttleCallback:(e,t)=>(this.isCommunityResource()&&(0,v.Zd)(),Promise.resolve(!0))};let a=null;o&&(i.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},a=Object.keys(o).map((e=>`${e}=${o[e]}`)).join("&"));const c=yield(0,V.fetchJson)(i,a,s||G);return this.emit("debug",{action:"response",request:n,response:(0,w.deepCopy)(c),provider:this}),c}))}detectNetwork(){return q(this,void 0,void 0,(function*(){return this.network}))}perform(e,t){const r=Object.create(null,{perform:{get:()=>super.perform}});return q(this,void 0,void 0,(function*(){switch(e){case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getBalance":return this.fetch("account",{action:"balance",address:t.address,tag:t.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:t.address,tag:t.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:t.address,tag:t.blockTag});case"getStorageAt":return this.fetch("proxy",{action:"eth_getStorageAt",address:t.address,position:t.position,tag:t.blockTag});case"sendTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:t.signedTransaction},!0).catch((e=>J("sendTransaction",e,t.signedTransaction)));case"getBlock":if(t.blockTag)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:t.blockTag,boolean:t.includeTransactions?"true":"false"});throw new Error("getBlock by blockHash not implemented");case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:t.transactionHash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:t.transactionHash});case"call":{if("latest"!==t.blockTag)throw new Error("EtherscanProvider does not support blockTag for call");const e=K(t.transaction);e.module="proxy",e.action="eth_call";try{return yield this.fetch("proxy",e,!0)}catch(e){return J("call",e,t.transaction)}}case"estimateGas":{const e=K(t.transaction);e.module="proxy",e.action="eth_estimateGas";try{return yield this.fetch("proxy",e,!0)}catch(e){return J("estimateGas",e,t.transaction)}}case"getLogs":{const e={action:"getLogs"};if(t.filter.fromBlock&&(e.fromBlock=Y(t.filter.fromBlock)),t.filter.toBlock&&(e.toBlock=Y(t.filter.toBlock)),t.filter.address&&(e.address=t.filter.address),t.filter.topics&&t.filter.topics.length>0&&(t.filter.topics.length>1&&H.throwError("unsupported topic count",T.Logger.errors.UNSUPPORTED_OPERATION,{topics:t.filter.topics}),1===t.filter.topics.length)){const r=t.filter.topics[0];"string"==typeof r&&66===r.length||H.throwError("unsupported topic format",T.Logger.errors.UNSUPPORTED_OPERATION,{topic0:r}),e.topic0=r}const r=yield this.fetch("logs",e);let n={};for(let e=0;e<r.length;e++){const t=r[e];if(null==t.blockHash){if(null==n[t.blockNumber]){const e=yield this.getBlock(t.blockNumber);e&&(n[t.blockNumber]=e.hash)}t.blockHash=n[t.blockNumber]}}return r}case"getEtherPrice":return"homestead"!==this.network.name?0:parseFloat((yield this.fetch("stats",{action:"ethprice"})).ethusd)}return r.perform.call(this,e,t)}))}getHistory(e,t,r){return q(this,void 0,void 0,(function*(){const n={action:"txlist",address:yield this.resolveName(e),startblock:t??0,endblock:r??99999999,sort:"asc"};return(yield this.fetch("account",n)).map((e=>{["contractAddress","to"].forEach((function(t){""==e[t]&&delete e[t]})),null==e.creates&&null!=e.contractAddress&&(e.creates=e.contractAddress);const t=this.formatter.transactionResponse(e);return e.timeStamp&&(t.timestamp=parseInt(e.timeStamp)),t}))}))}isCommunityResource(){return null==this.apiKey}}var Z=r("./node_modules/@ethersproject/random/lib.esm/shuffle.js"),X=function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))};
2const ee=new T.Logger(P.r);function te(){return(new Date).getTime()}function re(e){let t=null;for(let r=0;r<e.length;r++){const n=e[r];if(null==n)return null;t?t.name===n.name&&t.chainId===n.chainId&&(t.ensAddress===n.ensAddress||null==t.ensAddress&&null==n.ensAddress)||ee.throwArgumentError("provider mismatch","networks",e):t=n}return t}function ne(e,t){e=e.slice().sort();const r=Math.floor(e.length/2);if(e.length%2)return e[r];const n=e[r-1],o=e[r];return null!=t&&Math.abs(n-o)>t?null:(n+o)/2}function oe(e){if(null===e)return"null";if("number"==typeof e||"boolean"==typeof e)return JSON.stringify(e);if("string"==typeof e)return e;if(c.gH.isBigNumber(e))return e.toString();if(Array.isArray(e))return JSON.stringify(e.map((e=>oe(e))));if("object"==typeof e){const t=Object.keys(e);return t.sort(),"{"+t.map((t=>{let r=e[t];return r="function"==typeof r?"[function]":oe(r),JSON.stringify(t)+":"+r})).join(",")+"}"}throw new Error("unknown value type: "+typeof e)}let se=1;function ie(e){let t=null,r=null,n=new Promise((n=>{t=function(){r&&(clearTimeout(r),r=null),n()},r=setTimeout(t,e)}));return{cancel:t,getPromise:function(){return n},wait:e=>(n=n.then(e),n)}}const ae=[T.Logger.errors.CALL_EXCEPTION,T.Logger.errors.INSUFFICIENT_FUNDS,T.Logger.errors.NONCE_EXPIRED,T.Logger.errors.REPLACEMENT_UNDERPRICED,T.Logger.errors.UNPREDICTABLE_GAS_LIMIT],ce=["address","args","errorArgs","errorSignature","method","transaction"];function le(e,t){const r={weight:e.weight};return Object.defineProperty(r,"provider",{get:()=>e.provider}),e.start&&(r.start=e.start),t&&(r.duration=t-e.start),e.done&&(e.error?r.error=e.error:r.result=e.result||null),r}function ue(e,t,r){let n=oe;switch(t){case"getBlockNumber":return function(t){const r=t.map((e=>e.result));let n=ne(t.map((e=>e.result)),2);if(null!=n)return n=Math.ceil(n),r.indexOf(n+1)>=0&&n++,n>=e._highestBlockNumber&&(e._highestBlockNumber=n),e._highestBlockNumber};case"getGasPrice":return function(e){const t=e.map((e=>e.result));return t.sort(),t[Math.floor(t.length/2)]};case"getEtherPrice":return function(e){return ne(e.map((e=>e.result)))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(e){return null==e?null:((e=(0,w.shallowCopy)(e)).confirmations=-1,oe(e))};break;case"getBlock":n=r.includeTransactions?function(e){return null==e?null:((e=(0,w.shallowCopy)(e)).transactions=e.transactions.map((e=>((e=(0,w.shallowCopy)(e)).confirmations=-1,e))),oe(e))}:function(e){return null==e?null:oe(e)};break;default:throw new Error("unknown method: "+t)}return function(e,t){return function(r){const n={};r.forEach((t=>{const r=e(t.result);n[r]||(n[r]={count:0,result:t.result}),n[r].count++}));const o=Object.keys(n);for(let e=0;e<o.length;e++){const r=n[o[e]];if(r.count>=t)return r.result}}}(n,e.quorum)}function de(e,t){return X(this,void 0,void 0,(function*(){const r=e.provider;return null!=r.blockNumber&&r.blockNumber>=t||-1===t?r:(0,V.poll)((()=>new Promise(((n,o)=>{setTimeout((function(){return r.blockNumber>=t?n(r):e.cancelled?n(null):n(void 0)}),0)}))),{oncePoll:r})}))}function he(e,t,r,n){return X(this,void 0,void 0,(function*(){let o=e.provider;switch(r){case"getBlockNumber":case"getGasPrice":return o[r]();case"getEtherPrice":if(o.getEtherPrice)return o.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return n.blockTag&&(0,F.isHexString)(n.blockTag)&&(o=yield de(e,t)),o[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&(0,F.isHexString)(n.blockTag)&&(o=yield de(e,t)),o.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&(0,F.isHexString)(n.blockTag)&&(o=yield de(e,t)),o[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":return n.blockTag&&(0,F.isHexString)(n.blockTag)&&(o=yield de(e,t)),"call"===r&&n.blockTag?o[r](n.transaction,n.blockTag):o[r](n.transaction);case"getTransaction":case"getTransactionReceipt":return o[r](n.transactionHash);case"getLogs":{let r=n.filter;return(r.fromBlock&&(0,F.isHexString)(r.fromBlock)||r.toBlock&&(0,F.isHexString)(r.toBlock))&&(o=yield de(e,t)),o.getLogs(r)}}return ee.throwError("unknown method error",T.Logger.errors.UNKNOWN_ERROR,{method:r,params:n})}))}class pe extends b.DJ{constructor(e,t){0===e.length&&ee.throwArgumentError("missing providers","providers",e);const r=e.map(((e,t)=>{if(m.Kq.isProvider(e)){const t=(0,v.ws)(e)?2e3:750,r=1;return Object.freeze({provider:e,weight:1,stallTimeout:t,priority:r})}const r=(0,w.shallowCopy)(e);null==r.priority&&(r.priority=1),null==r.stallTimeout&&(r.stallTimeout=(0,v.ws)(e)?2e3:750),null==r.weight&&(r.weight=1);const n=r.weight;return(n%1||n>512||n<1)&&ee.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${t}].weight`,n),Object.freeze(r)})),n=r.reduce(((e,t)=>e+t.weight),0);null==t?t=n/2:t>n&&ee.throwArgumentError("quorum will always fail; larger than total weight","quorum",t);let o=re(r.map((e=>e.provider.network)));null==o&&(o=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then(e,t)}),0)}))),super(o),(0,w.defineReadOnly)(this,"providerConfigs",Object.freeze(r)),(0,w.defineReadOnly)(this,"quorum",t),this._highestBlockNumber=-1}detectNetwork(){return X(this,void 0,void 0,(function*(){return re(yield Promise.all(this.providerConfigs.map((e=>e.provider.getNetwork()))))}
2))}perform(e,t){return X(this,void 0,void 0,(function*(){if("sendTransaction"===e){const e=yield Promise.all(this.providerConfigs.map((e=>e.provider.sendTransaction(t.signedTransaction).then((e=>e.hash),(e=>e)))));for(let t=0;t<e.length;t++){const r=e[t];if("string"==typeof r)return r}throw e[0]}-1===this._highestBlockNumber&&"getBlockNumber"!==e&&(yield this.getBlockNumber());const r=ue(this,e,t),n=(0,Z.A)(this.providerConfigs.map(w.shallowCopy));n.sort(((e,t)=>e.priority-t.priority));const o=this._highestBlockNumber;let s=0,i=!0;for(;;){const a=te();let c=n.filter((e=>e.runner&&a-e.start<e.stallTimeout)).reduce(((e,t)=>e+t.weight),0);for(;c<this.quorum&&s<n.length;){const r=n[s++],i=se++;r.start=te(),r.staller=ie(r.stallTimeout),r.staller.wait((()=>{r.staller=null})),r.runner=he(r,o,e,t).then((n=>{r.done=!0,r.result=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:i,backend:le(r,te()),request:{method:e,params:(0,w.deepCopy)(t)},provider:this})}),(n=>{r.done=!0,r.error=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:i,backend:le(r,te()),request:{method:e,params:(0,w.deepCopy)(t)},provider:this})})),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:i,backend:le(r,null),request:{method:e,params:(0,w.deepCopy)(t)},provider:this}),c+=r.weight}const l=[];n.forEach((e=>{!e.done&&e.runner&&(l.push(e.runner),e.staller&&l.push(e.staller.getPromise()))})),l.length&&(yield Promise.race(l));const u=n.filter((e=>e.done&&null==e.error));if(u.length>=this.quorum){const e=r(u);if(void 0!==e)return n.forEach((e=>{e.staller&&e.staller.cancel(),e.cancelled=!0})),e;i||(yield ie(100).getPromise()),i=!1}const d=n.reduce(((e,t)=>{if(!t.done||null==t.error)return e;const r=t.error.code;return ae.indexOf(r)>=0&&(e[r]||(e[r]={error:t.error,weight:0}),e[r].weight+=t.weight),e}),{});if(Object.keys(d).forEach((e=>{const t=d[e];if(t.weight<this.quorum)return;n.forEach((e=>{e.staller&&e.staller.cancel(),e.cancelled=!0}));const r=t.error,o={};ce.forEach((e=>{null!=r[e]&&(o[e]=r[e])})),ee.throwError(r.reason||r.message,e,o)})),0===n.filter((e=>!e.done)).length)break}return n.forEach((e=>{e.staller&&e.staller.cancel(),e.cancelled=!0})),ee.throwError("failed to meet quorum",T.Logger.errors.SERVER_ERROR,{method:e,params:t,results:n.map((e=>le(e))),provider:this})}))}}const fe=null,ge=new T.Logger(P.r),me="84842078b09946638c03157f83405213";class ye extends I{constructor(e,t){const r=new be(e,t),n=r.connection;n.password&&ge.throwError("INFURA WebSocket project secrets unsupported",T.Logger.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"});super(n.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/"),e),(0,w.defineReadOnly)(this,"apiKey",r.projectId),(0,w.defineReadOnly)(this,"projectId",r.projectId),(0,w.defineReadOnly)(this,"projectSecret",r.projectSecret)}isCommunityResource(){return this.projectId===me}}class be extends S.M{static getWebSocketProvider(e,t){return new ye(e,t)}static getApiKey(e){const t={apiKey:me,projectId:me,projectSecret:null};return null==e||("string"==typeof e?t.projectId=e:null!=e.projectSecret?(ge.assertArgument("string"==typeof e.projectId,"projectSecret requires a projectId","projectId",e.projectId),ge.assertArgument("string"==typeof e.projectSecret,"invalid projectSecret","projectSecret","[REDACTED]"),t.projectId=e.projectId,t.projectSecret=e.projectSecret):e.projectId&&(t.projectId=e.projectId),t.apiKey=t.projectId),t}static getUrl(e,t){let r=null;switch(e?e.name:"unknown"){case"homestead":r="mainnet.infura.io";break;case"goerli":r="goerli.infura.io";break;case"sepolia":r="sepolia.infura.io";break;case"matic":r="polygon-mainnet.infura.io";break;case"maticmum":r="polygon-mumbai.infura.io";break;case"optimism":r="optimism-mainnet.infura.io";break;case"optimism-goerli":r="optimism-goerli.infura.io";break;case"optimism-sepolia":r="optimism-sepolia.infura.io";break;case"arbitrum":r="arbitrum-mainnet.infura.io";break;case"arbitrum-goerli":r="arbitrum-goerli.infura.io";break;case"arbitrum-sepolia":r="arbitrum-sepolia.infura.io";break;default:ge.throwError("unsupported network",T.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:e})}const n={allowGzip:!0,url:"https://"+r+"/v3/"+t.projectId,throttleCallback:(e,r)=>(t.projectId===me&&(0,v.Zd)(),Promise.resolve(!0))};return null!=t.projectSecret&&(n.user="",n.password=t.projectSecret),n}isCommunityResource(){return this.projectId===me}}class we extends A.F{send(e,t){const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};
2null==this._pendingBatch&&(this._pendingBatch=[]);const n={request:r,resolve:null,reject:null},o=new Promise(((e,t)=>{n.resolve=e,n.reject=t}));return this._pendingBatch.push(n),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout((()=>{const e=this._pendingBatch;this._pendingBatch=null,this._pendingBatchAggregator=null;const t=e.map((e=>e.request));return this.emit("debug",{action:"requestBatch",request:(0,w.deepCopy)(t),provider:this}),(0,V.fetchJson)(this.connection,JSON.stringify(t)).then((r=>{this.emit("debug",{action:"response",request:t,response:r,provider:this}),e.forEach(((e,t)=>{const n=r[t];if(n.error){const t=new Error(n.error.message);t.code=n.error.code,t.data=n.error.data,e.reject(t)}else e.resolve(n.result)}))}),(r=>{this.emit("debug",{action:"response",error:r,request:t,provider:this}),e.forEach((e=>{e.reject(r)}))}))}),10)),o}}const ve=new T.Logger(P.r);class Ae extends S.M{static getApiKey(e){return e&&"string"!=typeof e&&ve.throwArgumentError("invalid apiKey","apiKey",e),e||"ETHERS_JS_SHARED"}static getUrl(e,t){ve.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");let r=null;switch(e.name){case"homestead":r="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":r="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":r="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":r="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":r="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:ve.throwArgumentError("unsupported network","network",arguments[0])}return r+"?apiKey="+t}}const Te=new T.Logger(P.r),Pe="62e1ad51b37b8e00394bda3b";class Ee extends S.M{static getApiKey(e){const t={applicationId:null,loadBalancer:!0,applicationSecretKey:null};return null==e?t.applicationId=Pe:"string"==typeof e?t.applicationId=e:null!=e.applicationSecretKey?(t.applicationId=e.applicationId,t.applicationSecretKey=e.applicationSecretKey):e.applicationId?t.applicationId=e.applicationId:Te.throwArgumentError("unsupported PocketProvider apiKey","apiKey",e),t}static getUrl(e,t){let r=null;switch(e?e.name:"unknown"){case"goerli":r="eth-goerli.gateway.pokt.network";break;case"homestead":r="eth-mainnet.gateway.pokt.network";break;case"kovan":r="poa-kovan.gateway.pokt.network";break;case"matic":r="poly-mainnet.gateway.pokt.network";break;case"maticmum":r="polygon-mumbai-rpc.gateway.pokt.network";break;case"rinkeby":r="eth-rinkeby.gateway.pokt.network";break;case"ropsten":r="eth-ropsten.gateway.pokt.network";break;default:Te.throwError("unsupported network",T.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:e})}const n={headers:{},url:`https://${r}/v1/lb/${t.applicationId}`};return null!=t.applicationSecretKey&&(n.user="",n.password=t.applicationSecretKey),n}isCommunityResource(){return this.applicationId===Pe}}const Ce=new T.Logger(P.r);class ke extends S.M{static getApiKey(e){return e&&"string"!=typeof e&&Ce.throwArgumentError("invalid apiKey","apiKey",e),e||"919b412a057b5e9c9b6dce193c5a60242d6efadb"}static getUrl(e,t){let r=null;switch(e.name){case"homestead":r="ethers.quiknode.pro";break;case"goerli":r="ethers.ethereum-goerli.quiknode.pro";break;case"sepolia":r="ethers.ethereum-sepolia.quiknode.pro";break;case"holesky":r="ethers.ethereum-holesky.quiknode.pro";break;case"arbitrum":r="ethers.arbitrum-mainnet.quiknode.pro";break;case"arbitrum-goerli":r="ethers.arbitrum-goerli.quiknode.pro";break;case"arbitrum-sepolia":r="ethers.arbitrum-sepolia.quiknode.pro";break;case"base":r="ethers.base-mainnet.quiknode.pro";break;case"base-goerli":r="ethers.base-goerli.quiknode.pro";break;case"base-spolia":r="ethers.base-sepolia.quiknode.pro";break;case"bnb":r="ethers.bsc.quiknode.pro";break;case"bnbt":r="ethers.bsc-testnet.quiknode.pro";break;case"matic":r="ethers.matic.quiknode.pro";break;case"maticmum":r="ethers.matic-testnet.quiknode.pro";break;case"optimism":r="ethers.optimism.quiknode.pro";break;case"optimism-goerli":r="ethers.optimism-goerli.quiknode.pro";break;case"optimism-sepolia":r="ethers.optimism-sepolia.quiknode.pro";break;case"xdai":r="ethers.xdai.quiknode.pro";break;default:Ce.throwArgumentError("unsupported network","network",arguments[0])}return"https://"+r+"/"+t}}var _e=r("./node_modules/@ethersproject/providers/lib.esm/web3-provider.js");const Ie=new T.Logger(P.r);function Se(e,t){if(null==e&&(e="homestead"),"string"==typeof e){const t=e.match(/^(ws|http)s?:/i);if(t)switch(t[1].toLowerCase()){case"http":case"https":return new A.F(e);case"ws":case"wss":return new I(e);default:Ie.throwArgumentError("unsupported URL scheme","network",e)}}const r=(0,y.N)(e);return r&&r._defaultProvider||Ie.throwError("unsupported getDefaultProvider network",T.Logger.errors.NETWORK_E
2RROR,{operation:"getDefaultProvider",network:e}),r._defaultProvider({FallbackProvider:pe,AlchemyProvider:M,AnkrProvider:N,CloudflareProvider:L,EtherscanProvider:Q,InfuraProvider:be,JsonRpcProvider:A.F,NodesmithProvider:Ae,PocketProvider:Ee,QuickNodeProvider:ke,Web3Provider:_e.j,IpcProvider:fe},t)}var xe=r("./node_modules/@ethersproject/wordlists/lib.esm/wordlists.js"),Be=r("./node_modules/@ethersproject/wordlists/lib.esm/wordlist.js"),Oe=r("./node_modules/@ethersproject/abi/lib.esm/abi-coder.js"),Me=r("./node_modules/@ethersproject/abi/lib.esm/fragments.js"),We=r("./node_modules/@ethersproject/abi/lib.esm/coders/abstract-coder.js"),je=r("./node_modules/@ethersproject/abi/lib.esm/interface.js"),Re=r("./node_modules/@ethersproject/address/lib.esm/index.js"),Ne=r("./node_modules/@ethersproject/base64/lib.esm/index.js"),Ue=r("./node_modules/@ethersproject/basex/lib.esm/index.js"),De=r("./node_modules/@ethersproject/hash/lib.esm/namehash.js"),Le=r("./node_modules/@ethersproject/hash/lib.esm/message.js"),Fe=r("./node_modules/@ethersproject/hash/lib.esm/id.js"),ze=r("./node_modules/@ethersproject/hash/lib.esm/typed-data.js"),Ve=r("./node_modules/@ethersproject/hdnode/lib.esm/index.js"),qe=r("./node_modules/@ethersproject/json-wallets/lib.esm/inspect.js"),He=r("./node_modules/@ethersproject/keccak256/lib.esm/index.js"),Ke=r("./node_modules/@ethersproject/sha2/lib.esm/sha2.js"),$e=r("./node_modules/@ethersproject/solidity/lib.esm/index.js"),Ge=r("./node_modules/@ethersproject/random/lib.esm/random.js"),Ye=r("./node_modules/@ethersproject/rlp/lib.esm/index.js"),Je=r("./node_modules/@ethersproject/signing-key/lib.esm/index.js"),Qe=r("./node_modules/@ethersproject/strings/lib.esm/idna.js"),Ze=r("./node_modules/@ethersproject/strings/lib.esm/utf8.js"),Xe=r("./node_modules/@ethersproject/strings/lib.esm/bytes32.js"),et=r("./node_modules/@ethersproject/units/lib.esm/index.js"),tt=r("./node_modules/@ethersproject/sha2/lib.esm/types.js");const rt="ethers/5.8.0",nt=new T.Logger(rt);try{const e=window;null==e._ethers&&(e._ethers=i)}catch(e){}},"./node_modules/ethers/lib/utils.js"(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.formatBytes32String=t.Utf8ErrorFuncs=t.toUtf8String=t.toUtf8CodePoints=t.toUtf8Bytes=t._toEscapedUtf8String=t.nameprep=t.hexDataSlice=t.hexDataLength=t.hexZeroPad=t.hexValue=t.hexStripZeros=t.hexConcat=t.isHexString=t.hexlify=t.base64=t.base58=t.TransactionDescription=t.LogDescription=t.Interface=t.SigningKey=t.HDNode=t.defaultPath=t.isBytesLike=t.isBytes=t.zeroPad=t.stripZeros=t.concat=t.arrayify=t.shallowCopy=t.resolveProperties=t.getStatic=t.defineReadOnly=t.deepCopy=t.checkProperties=t.poll=t.fetchJson=t._fetchData=t.RLP=t.Logger=t.checkResultErrors=t.FormatTypes=t.ParamType=t.FunctionFragment=t.EventFragment=t.ErrorFragment=t.ConstructorFragment=t.Fragment=t.defaultAbiCoder=t.AbiCoder=void 0,t.Indexed=t.Utf8ErrorReason=t.UnicodeNormalizationForm=t.SupportedAlgorithm=t.mnemonicToSeed=t.isValidMnemonic=t.entropyToMnemonic=t.mnemonicToEntropy=t.getAccountPath=t.verifyTypedData=t.verifyMessage=t.recoverPublicKey=t.computePublicKey=t.recoverAddress=t.computeAddress=t.getJsonWalletAddress=t.TransactionTypes=t.serializeTransaction=t.parseTransaction=t.accessListify=t.joinSignature=t.splitSignature=t.soliditySha256=t.solidityKeccak256=t.solidityPack=t.shuffled=t.randomBytes=t.sha512=t.sha256=t.ripemd160=t.keccak256=t.computeHmac=t.commify=t.parseUnits=t.formatUnits=t.parseEther=t.formatEther=t.isAddress=t.getCreate2Address=t.getContractAddress=t.getIcapAddress=t.getAddress=t._TypedDataEncoder=t.id=t.isValidName=t.namehash=t.hashMessage=t.dnsEncode=t.parseBytes32String=void 0;var i=r("./node_modules/@ethersproject/abi/lib.esm/index.js");Object.defineProperty(t,"AbiCoder",{enumerable:!0,get:function(){return i.AbiCoder}}),Object.defineProperty(t,"checkResultErrors",{enumerable:!0,get:function(){return i.checkResultErrors}}),Object.defineProperty(t,"ConstructorFragment",{enumerable:!0,get:function(){return i.ConstructorFragment}}),Object.defineProperty(t,"defaultAbiCoder",{enumerable:!0,get:function(){return i.defaultAbiCoder}}),Object.defineProperty(t,"ErrorFragment",{enumerable:!0,get:function(){return i.ErrorFragment}}),Object.defineProperty(t,"EventFragment",{enumerable:!0,get:function(){return i.EventFragment}}),Object.defineProperty(t,"FormatTypes",{enumerable:!0,get:function(){return i.FormatTypes}}),Object.defineProperty(t,"Fragment",{enumerable:!0,get:function(){return i.Fragment}}),Object.defineProperty(t,"FunctionFragment",{enumerable:!0,get:function(){return i.FunctionFragment}}),Object.defineProperty(t,"Indexed",{enumerable:!0,get:function(){return i.Indexed}}),Object.defineProperty(t,"Interface",{enumerable:!0,get:function(){return i.Interface}}),Object.defineProperty(t,"LogDescription",{enumerable:!0,get:function(){return i.LogDescription}}),Object.defineProperty(t,"ParamType",{enumerable:!0,get:function(){return i.ParamType}}),Object.defineProperty(t,"TransactionDescription",{enumerable:!0,get:function(){return i.TransactionDescription}});var a=r("./node_modules/@ethersproject/address/lib.esm/index.js");Object.defineProperty(t,"getAddress",{enumerable:!0,get:function(){return a.getAddress}}),Object.defineProperty(t,"getCreate2Address",{enumerable:!0,get:function(){return a.getCreate2Address}}),Object.defineProperty(t,"getContractAddress",{enumerable:!0,get:function(){return a.getContractAddress}}),Object.defineProperty(t,"getIcapAddress",{enumerable:!0,get:function(){return a.getIcapAddress}}),Object.defineProperty(t,"isAddress",{enumerable:!0,get:function(){return a.isAddress}});
2var c=s(r("./node_modules/@ethersproject/base64/lib.esm/index.js"));t.base64=c;var l=r("./node_modules/@ethersproject/basex/lib.esm/index.js");Object.defineProperty(t,"base58",{enumerable:!0,get:function(){return l.Base58}});var u=r("./node_modules/@ethersproject/bytes/lib.esm/index.js");Object.defineProperty(t,"arrayify",{enumerable:!0,get:function(){return u.arrayify}}),Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return u.concat}}),Object.defineProperty(t,"hexConcat",{enumerable:!0,get:function(){return u.hexConcat}}),Object.defineProperty(t,"hexDataSlice",{enumerable:!0,get:function(){return u.hexDataSlice}}),Object.defineProperty(t,"hexDataLength",{enumerable:!0,get:function(){return u.hexDataLength}}),Object.defineProperty(t,"hexlify",{enumerable:!0,get:function(){return u.hexlify}}),Object.defineProperty(t,"hexStripZeros",{enumerable:!0,get:function(){return u.hexStripZeros}}),Object.defineProperty(t,"hexValue",{enumerable:!0,get:function(){return u.hexValue}}),Object.defineProperty(t,"hexZeroPad",{enumerable:!0,get:function(){return u.hexZeroPad}}),Object.defineProperty(t,"isBytes",{enumerable:!0,get:function(){return u.isBytes}}),Object.defineProperty(t,"isBytesLike",{enumerable:!0,get:function(){return u.isBytesLike}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return u.isHexString}}),Object.defineProperty(t,"joinSignature",{enumerable:!0,get:function(){return u.joinSignature}}),Object.defineProperty(t,"zeroPad",{enumerable:!0,get:function(){return u.zeroPad}}),Object.defineProperty(t,"splitSignature",{enumerable:!0,get:function(){return u.splitSignature}}),Object.defineProperty(t,"stripZeros",{enumerable:!0,get:function(){return u.stripZeros}});var d=r("./node_modules/@ethersproject/hash/lib.esm/index.js");Object.defineProperty(t,"_TypedDataEncoder",{enumerable:!0,get:function(){return d._TypedDataEncoder}}),Object.defineProperty(t,"dnsEncode",{enumerable:!0,get:function(){return d.dnsEncode}}),Object.defineProperty(t,"hashMessage",{enumerable:!0,get:function(){return d.hashMessage}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return d.id}}),Object.defineProperty(t,"isValidName",{enumerable:!0,get:function(){return d.isValidName}}),Object.defineProperty(t,"namehash",{enumerable:!0,get:function(){return d.namehash}});var h=r("./node_modules/@ethersproject/hdnode/lib.esm/index.js");Object.defineProperty(t,"defaultPath",{enumerable:!0,get:function(){return h.defaultPath}}),Object.defineProperty(t,"entropyToMnemonic",{enumerable:!0,get:function(){return h.entropyToMnemonic}}),Object.defineProperty(t,"getAccountPath",{enumerable:!0,get:function(){return h.getAccountPath}}),Object.defineProperty(t,"HDNode",{enumerable:!0,get:function(){return h.HDNode}}),Object.defineProperty(t,"isValidMnemonic",{enumerable:!0,get:function(){return h.isValidMnemonic}}),Object.defineProperty(t,"mnemonicToEntropy",{enumerable:!0,get:function(){return h.mnemonicToEntropy}}),Object.defineProperty(t,"mnemonicToSeed",{enumerable:!0,get:function(){return h.mnemonicToSeed}});var p=r("./node_modules/@ethersproject/json-wallets/lib.esm/index.js");Object.defineProperty(t,"getJsonWalletAddress",{enumerable:!0,get:function(){return p.getJsonWalletAddress}});var f=r("./node_modules/@ethersproject/keccak256/lib.esm/index.js");Object.defineProperty(t,"keccak256",{enumerable:!0,get:function(){return f.keccak256}});var g=r("./node_modules/@ethersproject/logger/lib.esm/index.js");Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return g.Logger}});var m=r("./node_modules/@ethersproject/sha2/lib.esm/index.js");Object.defineProperty(t,"computeHmac",{enumerable:!0,get:function(){return m.computeHmac}}),Object.defineProperty(t,"ripemd160",{enumerable:!0,get:function(){return m.ripemd160}}),Object.defineProperty(t,"sha256",{enumerable:!0,get:function(){return m.sha256}}),Object.defineProperty(t,"sha512",{enumerable:!0,get:function(){return m.sha512}});var y=r("./node_modules/@ethersproject/solidity/lib.esm/index.js");Object.defineProperty(t,"solidityKeccak256",{enumerable:!0,get:function(){return y.keccak256}}),Object.defineProperty(t,"solidityPack",{enumerable:!0,get:function(){return y.pack}}),Object.defineProperty(t,"soliditySha256",{enumerable:!0,get:function(){return y.sha256}});var b=r("./node_modules/@ethersproject/random/lib.esm/index.js");Object.defineProperty(t,"randomBytes",{enumerable:!0,get:function(){return b.randomBytes}}),Object.defineProperty(t,"shuffled",{enumerable:!0,get:function(){return b.shuffled}});var w=r("./node_modules/@ethersproject/properties/lib.esm/index.js");Object.defineProperty(t,"checkProperties",{enumerable:!0,get:function(){return w.checkProperties}}),Object.defineProperty(t,"deepCopy",{enumerable:!0,get:function(){return w.deepCopy}}),Object.defineProperty(t,"defineReadOnly",{enumerable:!0,get:function(){return w.defineReadOnly}}),Object.defineProperty(t,"getStatic",{enumerable:!0,get:function(){return w.getStatic}}),Object.defineProperty(t,"resolveProperties",{enumerable:!0,get:function(){return w.resolveProperties}}),Object.defineProperty(t,"shallowCopy",{enumerable:!0,get:function(){return w.shallowCopy}});var v=s(r("./node_modules/@ethersproject/rlp/lib.esm/index.js"));t.RLP=v;var A=r("./node_modules/@ethersproject/signing-key/lib.esm/index.js");Object.defineProperty(t,"computePublicKey",{enumerable:!0,get:function(){return A.computePublicKey}}),Object.defineProperty(t,"recoverPublicKey",{enumerable:!0,get:function(){return A.recoverPublicKey}}),Object.defineProperty(t,"SigningKey",{enumerable:!0,get:function(){return A.SigningKey}});var T=r("./node_modules/@ethersproject/strings/lib.esm/index.js");Object.defineProperty(t,"formatBytes32String",{enumerable:!0,get:function(){return T.formatBytes32String}}),Object.defineProperty(t,"nameprep",{enumerable:!0,get:function(){return T.nameprep}}),Object.defineProperty(t,"parseBytes32String",{enumerable:!0,get:function(){return T.parseBytes32String}}),Object.defineProperty(t,"_toEscapedUtf8String",{enumerable:!0,get:function(){return T._toEscapedUtf8String}}),Object.defineProperty(t,"toUtf8Bytes",{enumerable:!0,get:function(){return T.toUtf8Bytes}}),Object.defineProperty(t,"toUtf8CodePoints",{enumerable:!0,get:function(){return T.toUtf8CodePoints}}),Object.defineProperty(t,"toUtf8String",{enumerable:!0,get:function(){return T.toUtf8String}}),Object.defineProperty(t,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return T.Utf8ErrorFuncs}});var P=r("./node_modules/@ethersproject/transactions/lib.esm/index.js");Object.defineProperty(t,"accessListify",{enumerable:!0,get:function(){return P.accessListify}}),Object.defineProperty(t,"computeAddress",{enumerable:!0,get:function(){return P.computeAddress}}),Object.defineProperty(t,"parseTransaction",{enumerable:!0,get:function(){return P.parse}}),Object.defineProperty(t,"recoverAddress",{enumerable:!0,get:function(){return P.recoverAddress}}),Object.defineProperty(t,"serializeTransaction",{enumerable:!0,get:function(){return P.serialize}}),Object.defineProperty(t,"TransactionTypes",{enumerable:!0,get:function(){return P.TransactionTypes}});var E=r("./node_modules/@ethersproject/units/lib.esm/index.js");Object.defineProperty(t,"commify",{enumerable:!0,get:function(){return E.commify}}),Object.defineProperty(t,"formatEther",{enumerable:!0,get:function(){return E.formatEther}}),Object.defineProperty(t,"parseEther",{enumerable:!0,get:function(){return E.parseEther}}),Object.defineProperty(t,"formatUnits",{enumerable:!0,get:function(){return E.formatUnits}}),Object.defineProperty(t,"parseUnits",{enumerable:!0,get:function(){return E.parseUnits}});var C=r("./node_modules/@ethersproject/wallet/lib.esm/index.js");Object.defineProperty(t,"verifyMessage",{enumerable:!0,get:function(){return C.verifyMessage}}),Object.defineProperty(t,"verifyTypedData",{enumerable:!0,get:function(){return C.verifyTypedData}
vendor: 4,496 bytes, line 2
2});var k=r("./node_modules/@ethersproject/web/lib.esm/index.js");Object.defineProperty(t,"_fetchData",{enumerable:!0,get:function(){return k._fetchData}}),Object.defineProperty(t,"fetchJson",{enumerable:!0,get:function(){return k.fetchJson}}),Object.defineProperty(t,"poll",{enumerable:!0,get:function(){return k.poll}});var _=r("./node_modules/@ethersproject/sha2/lib.esm/index.js");Object.defineProperty(t,"SupportedAlgorithm",{enumerable:!0,get:function(){return _.SupportedAlgorithm}});var I=r("./node_modules/@ethersproject/strings/lib.esm/index.js");Object.defineProperty(t,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return I.UnicodeNormalizationForm}}),Object.defineProperty(t,"Utf8ErrorReason",{enumerable:!0,get:function(){return I.Utf8ErrorReason}})},"./node_modules/tronweb/node_modules/semver/classes/comparator.js"(e,t,r){const n=Symbol("SemVer ANY");class o{static get ANY(){return n}constructor(e,t){if(t=s(t),e instanceof o){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),l("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===n?this.value="":this.value=this.operator+this.semver.version,l("comp",this)}parse(e){const t=this.options.loose?i[a.COMPARATORLOOSE]:i[a.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new u(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(l("Comparator.test",e,this.options.loose),this.semver===n||e===n)return!0;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}return c(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof o))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new d(e.value,t).test(this.value):""===e.operator?""===e.value||new d(this.value,t).test(e.semver):(!(t=s(t)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(c(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(c(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}e.exports=o;const s=r("./node_modules/tronweb/node_modules/semver/internal/parse-options.js"),{safeRe:i,t:a}=r("./node_modules/tronweb/node_modules/semver/internal/re.js"),c=r("./node_modules/tronweb/node_modules/semver/functions/cmp.js"),l=r("./node_modules/tronweb/node_modules/semver/internal/debug.js"),u=r("./node_modules/tronweb/node_modules/semver/classes/semver.js"),d=r("./node_modules/tronweb/node_modules/semver/classes/range.js")},"./node_modules/tronweb/node_modules/semver/classes/range.js"(e,t,r){const n=/\s+/g;class o{constructor(e,t){if(t=i(t),e instanceof o)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new o(e.raw,t);if(e instanceof a)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(n," "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!y(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&b(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&g)|(this.options.loose&&m))+":"+e,r=s.get(t);if(r)return r;const n=this.options.loose,o=n?u[d.HYPHENRANGELOOSE]:u[d.HYPHENRANGE];e=e.replace(o,x(this.options.includePrerelease)),c("hyphen replace",e),e=e.replace(u[d.COMPARATORTRIM],h),c("comparator trim",e),e=e.replace(u[d.TILDETRIM],p),c("tilde trim",e),e=e.replace(u[d.CARETTRIM],f),c("c
2aret trim",e);let i=e.split(" ").map((e=>v(e,this.options))).join(" ").split(/\s+/).map((e=>S(e,this.options)));n&&(i=i.filter((e=>(c("loose invalid filter",e,this.options),!!e.match(u[d.COMPARATORLOOSE]))))),c("range list",i);const l=new Map,b=i.map((e=>new a(e,this.options)));for(const e of b){if(y(e))return[e];l.set(e.value,e)}l.size>1&&l.has("")&&l.delete("");const w=[...l.values()];return s.set(t,w),w}intersects(e,t){if(!(e instanceof o))throw new TypeError("a Range is required");return this.set.some((r=>w(r,t)&&e.set.some((e=>w(e,t)&&r.every((r=>e.every((e=>r.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(B(this.set[t],e,this.options))return!0;return!1}}e.exports=o;const s=new(r("./node_modules/tronweb/node_modules/semver/internal/lrucache.js")),i=r("./node_modules/tronweb/node_modules/semver/internal/parse-options.js"),a=r("./node_modules/tronweb/node_modules/semver/classes/comparator.js"),c=r("./node_modules/tronweb/node_modules/semver/internal/debug.js"),l=r("./node_modules/tronweb/node_modules/semver/classes/semver.js"),{safeRe:u,t:d,comparatorTrimReplace:h,tildeTrimReplace:p,caretTrimReplace:f}=r("./node_modules/tronweb/node_modules/semver/internal/re.js"),{FLAG_INCLUDE_PRERELEASE:g,FLAG_LOOSE:m}=r("./node_modules/tronweb/node_modules/semver/internal/constants.js"),y=e=>"<0.0.0-0"===e.value,b=e=>""===e.value,w=(e,t)=>{let r=!0;const n=e.slice();let o=n.pop();for(;r&&n.length;)r=n.every((e=>o.intersects(e,t))),o=n.pop();return r},v=(e,t)=>(c("comp",e,t),e=E(e,t),c("caret",e),e=T(e,t),c("tildes",e),e=k(e,t),c("xrange",e),e=I(e,t),c("stars",e),e),A=e=>!e||"x"===e.toLowerCase()||"*"===e,T=(e,t)=>e.trim().split(/\s+/).map((e=>P(e,t))).join(" "),P=(e,t)=>{const r=t.loose?u[d.TILDELOOSE]:u[d.TILDE];return e.replace(r,((t,r,n,o,s)=>{let i;return c("tilde",e,t,r,n,o,s),A(r)?i="":A(n)?i=`>=${r}.0.0 <${+r+1}.0.0-0`:A(o)?i=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:s?(c("replaceTilde pr",s),i=`>=${r}.${n}.${o}-${s} <${r}.${+n+1}.0-0`):i=`>=${r}.${n}.${o} <${r}.${+n+1}.0-0`,c("tilde return",i),i}))},E=(e,t)=>e.trim().split(/\s+/).map((e=>C(e,t))).join(" "),C=(e,t)=>{c("caret",e,t);const r=t.loose?u[d.CARETLOOSE]:u[d.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,((t,r,o,s,i)=>{let a;return c("caret",e,t,r,o,s,i),A(r)?a="":A(o)?a=`>=${r}.0.0${n} <${+r+1}.0.0-0`:A(s)?a="0"===r?`>=${r}.${o}.0${n} <${r}.${+o+1}.0-0`:`>=${r}.${o}.0${n} <${+r+1}.0.0-0`:i?(c("replaceCaret pr",i),a="0"===r?"0"===o?`>=${r}.${o}.${s}-${i} <${r}.${o}.${+s+1}-0`:`>=${r}.${o}.${s}-${i} <${r}.${+o+1}.0-0`:`>=${r}.${o}.${s}-${i} <${+r+1}.0.0-0`):(c("no pr"),a="0"===r?"0"===o?`>=${r}.${o}.${s}${n} <${r}.${o}.${+s+1}-0`:`>=${r}.${o}.${s}${n} <${r}.${+o+1}.0-0`:`>=${r}.${o}.${s} <${+r+1}.0.0-0`),c("caret return",a),a}))},k=(e,t)=>(c("replaceXRanges",e,t),e.split(/\s+/).map((e=>_(e,t))).join(" ")),_=(e,t)=>{e=e.trim();const r=t.loose?u[d.XRANGELOOSE]:u[d.XRANGE];return e.replace(r,((r,n,o,s,i,a)=>{c("xRange",e,r,n,o,s,i,a);const l=A(o),u=l||A(s),d=u||A(i),h=d;return"="===n&&h&&(n=""),a=t.includePrerelease?"-0":"",l?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&h?(u&&(s=0),i=0,">"===n?(n=">=",u?(o=+o+1,s=0,i=0):(s=+s+1,i=0)):"<="===n&&(n="<",u?o=+o+1:s=+s+1),"<"===n&&(a="-0"),r=`${n+o}.${s}.${i}${a}`):u?r=`>=${o}.0.0${a} <${+o+1}.0.0-0`:d&&(r=`>=${o}.${s}.0${a} <${o}.${+s+1}.0-0`),c("xRange return",r),r}))},I=(e,t)=>(c("replaceStars",e,t),e.trim().replace(u[d.STAR],"")),S=(e,t)=>(c("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?d.GTE0PRE:d.GTE0],"")),x=e=>(t,r,n,o,s,i,a,c,l,u,d,h)=>`${r=A(n)?"":A(o)?`>=${n}.0.0${e?"-0":""}`:A(s)?`>=${n}.${o}.0${e?"-0":""}`:i?`>=${r}`:`>=${r}${e?"-0":""}`} ${c=A(l)?"":A(u)?`<${+l+1}.0.0-0`:A(d)?`<${l}.${+u+1}.0-0`:h?`<=${l}.${u}.${d}-${h}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`}`.trim(),B=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(c(e[r].semver),e[r].semver!==a.ANY&&e[r].semver.prerelease.length>0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}},"./node_modules/tronweb/node_modules/semver/classes/semver.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/internal/debug.js"),{MAX_LENGTH:o,MAX_SAFE_INTEGER:s}=r("./node_modules/tronweb/node_modules/semver/internal/constants.js"),{safeRe:i,safeSrc:a,t:c}=r("./node_modules/tronweb/node_modules/semver/internal/re.js"),l=r("./node_modules/tronweb/node_modules/semver/internal/parse-options.js"),{compareIdentifiers:u}=r("./node_modules/tronweb/node_modules/semver/internal/identifiers.js");class d{constructor(e,t){if(t=l(t),e instanceof d){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>
vendor: 3,279 bytes, line 2
2o)throw new TypeError(`version is longer than ${o} characters`);n("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?i[c.LOOSE]:i[c.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<s)return t}return e})):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(n("SemVer.compare",this.version,this.options,e),!(e instanceof d)){if("string"==typeof e&&e===this.version)return 0;e=new d(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof d||(e=new d(e,this.options)),u(this.major,e.major)||u(this.minor,e.minor)||u(this.patch,e.patch)}comparePre(e){if(e instanceof d||(e=new d(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const r=this.prerelease[t],o=e.prerelease[t];if(n("prerelease compare",t,r,o),void 0===r&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===r)return-1;if(r!==o)return u(r,o)}while(++t)}compareBuild(e){e instanceof d||(e=new d(e,this.options));let t=0;do{const r=this.build[t],o=e.build[t];if(n("build compare",t,r,o),void 0===r&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===r)return-1;if(r!==o)return u(r,o)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(t){const e=new RegExp(`^${this.options.loose?a[c.PRERELEASELOOSE]:a[c.PRERELEASE]}$`),r=`-${t}`.match(e);if(!r||r[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);
2if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===u(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=d},"./node_modules/tronweb/node_modules/semver/functions/clean.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/functions/parse.js");e.exports=(e,t)=>{const r=n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},"./node_modules/tronweb/node_modules/semver/functions/cmp.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/functions/eq.js"),o=r("./node_modules/tronweb/node_modules/semver/functions/neq.js"),s=r("./node_modules/tronweb/node_modules/semver/functions/gt.js"),i=r("./node_modules/tronweb/node_modules/semver/functions/gte.js"),a=r("./node_modules/tronweb/node_modules/semver/functions/lt.js"),c=r("./node_modules/tronweb/node_modules/semver/functions/lte.js");e.exports=(e,t,r,l)=>
2{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return n(e,r,l);case"!=":return o(e,r,l);case">":return s(e,r,l);case">=":return i(e,r,l);case"<":return a(e,r,l);case"<=":return c(e,r,l);default:throw new TypeError(`Invalid operator: ${t}`)}}},"./node_modules/tronweb/node_modules/semver/functions/coerce.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/classes/semver.js"),o=r("./node_modules/tronweb/node_modules/semver/functions/parse.js"),{safeRe:s,t:i}=r("./node_modules/tronweb/node_modules/semver/internal/re.js");e.exports=(e,t)=>{if(e instanceof n)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){const n=t.includePrerelease?s[i.COERCERTLFULL]:s[i.COERCERTL];let o;for(;(o=n.exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&o.index+o[0].length===r.index+r[0].length||(r=o),n.lastIndex=o.index+o[1].length+o[2].length;n.lastIndex=-1}else r=e.match(t.includePrerelease?s[i.COERCEFULL]:s[i.COERCE]);if(null===r)return null;const a=r[2],c=r[3]||"0",l=r[4]||"0",u=t.includePrerelease&&r[5]?`-${r[5]}`:"",d=t.includePrerelease&&r[6]?`+${r[6]}`:"";return o(`${a}.${c}.${l}${u}${d}`,t)}},"./node_modules/tronweb/node_modules/semver/functions/compare-build.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/classes/semver.js");e.exports=(e,t,r)=>{const o=new n(e,r),s=new n(t,r);return o.compare(s)||o.compareBuild(s)}},"./node_modules/tronweb/node_modules/semver/functions/compare-loose.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/functions/compare.js");e.exports=(e,t)=>n(e,t,!0)},"./node_modules/tronweb/node_modules/semver/functions/compare.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/classes/semver.js");e.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))},"./node_modules/tronweb/node_modules/semver/functions/diff.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/functions/parse.js");e.exports=(e,t)=>{const r=n(e,null,!0),o=n(t,null,!0),s=r.compare(o);if(0===s)return null;const i=s>0,a=i?r:o,c=i?o:r,l=!!a.prerelease.length;if(!!c.prerelease.length&&!l){if(!c.patch&&!c.minor)return"major";if(0===c.compareMain(a))return c.minor&&!c.patch?"minor":"patch"}const u=l?"pre":"";return r.major!==o.major?u+"major":r.minor!==o.minor?u+"minor":r.patch!==o.patch?u+"patch":"prerelease"}},"./node_modules/tronweb/node_modules/semver/functions/eq.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/functions/compare.js");e.exports=(e,t,r)=>0===n(e,t,r)},"./node_modules/tronweb/node_modules/semver/functions/gt.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/functions/compare.js");e.exports=(e,t,r)=>n(e,t,r)>0},"./node_modules/tronweb/node_modules/semver/functions/gte.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/functions/compare.js");e.exports=(e,t,r)=>n(e,t,r)>=0},"./node_modules/tronweb/node_modules/semver/functions/inc.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/classes/semver.js");e.exports=(e,t,r,o,s)=>{"string"==typeof r&&(s=o,o=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,o,s).version}catch(e){return null}}},"./node_modules/tronweb/node_modules/semver/functions/lt.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/functions/compare.js");e.exports=(e,t,r)=>n(e,t,r)<0},"./node_modules/tronweb/node_modules/semver/functions/lte.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/functions/compare.js");e.exports=(e,t,r)=>n(e,t,r)<=0},"./node_modules/tronweb/node_modules/semver/functions/major.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/classes/semver.js");e.exports=(e,t)=>new n(e,t).major},"./node_modules/tronweb/node_modules/semver/functions/minor.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/classes/semver.js");e.exports=(e,t)=>new n(e,t).minor},"./node_modules/tronweb/node_modules/semver/functions/neq.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/functions/compare.js");e.exports=(e,t,r)=>0!==n(e,t,r)},"./node_modules/tronweb/node_modules/semver/functions/parse.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/classes/semver.js");e.exports=(e,t,r=!1)=>
2{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}},"./node_modules/tronweb/node_modules/semver/functions/patch.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/classes/semver.js");e.exports=(e,t)=>new n(e,t).patch},"./node_modules/tronweb/node_modules/semver/functions/prerelease.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/functions/parse.js");e.exports=(e,t)=>{const r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}},"./node_modules/tronweb/node_modules/semver/functions/rcompare.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/functions/compare.js");e.exports=(e,t,r)=>n(t,e,r)},"./node_modules/tronweb/node_modules/semver/functions/rsort.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/functions/compare-build.js");e.exports=(e,t)=>e.sort(((e,r)=>n(r,e,t)))},"./node_modules/tronweb/node_modules/semver/functions/satisfies.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/classes/range.js");e.exports=(e,t,r)=>{try{t=new n(t,r)}catch(e){return!1}return t.test(e)}},"./node_modules/tronweb/node_modules/semver/functions/sort.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/functions/compare-build.js");e.exports=(e,t)=>e.sort(((e,r)=>n(e,r,t)))},"./node_modules/tronweb/node_modules/semver/functions/valid.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/functions/parse.js");e.exports=(e,t)=>{const r=n(e,t);return r?r.version:null}},"./node_modules/tronweb/node_modules/semver/index.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/internal/re.js"),o=r("./node_modules/tronweb/node_modules/semver/internal/constants.js"),s=r("./node_modules/tronweb/node_modules/semver/classes/semver.js"),i=r("./node_modules/tronweb/node_modules/semver/internal/identifiers.js"),a=r("./node_modules/tronweb/node_modules/semver/functions/parse.js"),c=r("./node_modules/tronweb/node_modules/semver/functions/valid.js"),l=r("./node_modules/tronweb/node_modules/semver/functions/clean.js"),u=r("./node_modules/tronweb/node_modules/semver/functions/inc.js"),d=r("./node_modules/tronweb/node_modules/semver/functions/diff.js"),h=r("./node_modules/tronweb/node_modules/semver/functions/major.js"),p=r("./node_modules/tronweb/node_modules/semver/functions/minor.js"),f=r("./node_modules/tronweb/node_modules/semver/functions/patch.js"),g=r("./node_modules/tronweb/node_modules/semver/functions/prerelease.js"),m=r("./node_modules/tronweb/node_modules/semver/functions/compare.js"),y=r("./node_modules/tronweb/node_modules/semver/functions/rcompare.js"),b=r("./node_modules/tronweb/node_modules/semver/functions/compare-loose.js"),w=r("./node_modules/tronweb/node_modules/semver/functions/compare-build.js"),v=r("./node_modules/tronweb/node_modules/semver/functions/sort.js"),A=r("./node_modules/tronweb/node_modules/semver/functions/rsort.js"),T=r("./node_modules/tronweb/node_modules/semver/functions/gt.js"),P=r("./node_modules/tronweb/node_modules/semver/functions/lt.js"),E=r("./node_modules/tronweb/node_modules/semver/functions/eq.js"),C=r("./node_modules/tronweb/node_modules/semver/functions/neq.js"),k=r("./node_modules/tronweb/node_modules/semver/functions/gte.js"),_=r("./node_modules/tronweb/node_modules/semver/functions/lte.js"),I=r("./node_modules/tronweb/node_modules/semver/functions/cmp.js"),S=r("./node_modules/tronweb/node_modules/semver/functions/coerce.js"),x=r("./node_modules/tronweb/node_modules/semver/classes/comparator.js"),B=r("./node_modules/tronweb/node_modules/semver/classes/range.js"),O=r("./node_modules/tronweb/node_modules/semver/functions/satisfies.js"),M=r("./node_modules/tronweb/node_modules/semver/ranges/to-comparators.js"),W=r("./node_modules/tronweb/node_modules/semver/ranges/max-satisfying.js"),j=r("./node_modules/tronweb/node_modules/semver/ranges/min-satisfying.js"),R=r("./node_modules/tronweb/node_modules/semver/ranges/min-version.js"),N=r("./node_modules/tronweb/node_modules/semver/ranges/valid.js"),U=r("./node_modules/tronweb/node_modules/semver/ranges/outside.js"),D=r("./node_modules/tronweb/node_modules/semver/ranges/gtr.js"),L=r("./node_modules/tronweb/node_modules/semver/ranges/ltr.js"),F=r("./node_modules/tronweb/node_modules/semver/ranges/intersects.js"),z=r("./node_modules/tronweb/node_modules/semver/ranges/simplify.js"),V=r("./node_modules/tronweb/node_modules/semver/ranges/subset.js");
2e.exports={parse:a,valid:c,clean:l,inc:u,diff:d,major:h,minor:p,patch:f,prerelease:g,compare:m,rcompare:y,compareLoose:b,compareBuild:w,sort:v,rsort:A,gt:T,lt:P,eq:E,neq:C,gte:k,lte:_,cmp:I,coerce:S,Comparator:x,Range:B,satisfies:O,toComparators:M,maxSatisfying:W,minSatisfying:j,minVersion:R,validRange:N,outside:U,gtr:D,ltr:L,intersects:F,simplifyRange:z,subset:V,SemVer:s,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:o.SEMVER_SPEC_VERSION,RELEASE_TYPES:o.RELEASE_TYPES,compareIdentifiers:i.compareIdentifiers,rcompareIdentifiers:i.rcompareIdentifiers}},"./node_modules/tronweb/node_modules/semver/internal/constants.js"(e){const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},"./node_modules/tronweb/node_modules/semver/internal/debug.js"(e,t,r){var n=r("./node_modules/process/browser.js");const o="object"==typeof n&&n.env&&n.env.NODE_DEBUG&&/\bsemver\b/i.test(n.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=o},"./node_modules/tronweb/node_modules/semver/internal/identifiers.js"(e){const t=/^[0-9]+$/,r=(e,r)=>{const n=t.test(e),o=t.test(r);return n&&o&&(e=+e,r=+r),e===r?0:n&&!o?-1:o&&!n?1:e<r?-1:1};e.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}},"./node_modules/tronweb/node_modules/semver/internal/lrucache.js"(e){e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},"./node_modules/tronweb/node_modules/semver/internal/parse-options.js"(e){const t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},"./node_modules/tronweb/node_modules/semver/internal/re.js"(e,t,r){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:o,MAX_LENGTH:s}=r("./node_modules/tronweb/node_modules/semver/internal/constants.js"),i=r("./node_modules/tronweb/node_modules/semver/internal/debug.js"),a=(t=e.exports={}).re=[],c=t.safeRe=[],l=t.src=[],u=t.safeSrc=[],d=t.t={};let h=0;const p="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",s],[p,o]],g=(e,t,r)=>{const n=(e=>{for(const[t,r]of f)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),o=h++;i(e,o,t),d[e]=o,l[o]=t,u[o]=n,a[o]=new RegExp(t,r?"g":void 0),c[o]=new RegExp(n,r?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*"),g("NUMERICIDENTIFIERLOOSE","\\d+"),g("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${p}*`),g("MAINVERSION",`(${l[d.NUMERICIDENTIFIER]})\\.(${l[d.NUMERICIDENTIFIER]})\\.(${l[d.NUMERICIDENTIFIER]})`),g("MAINVERSIONLOOSE",`(${l[d.NUMERICIDENTIFIERLOOSE]})\\.(${l[d.NUMERICIDENTIFIERLOOSE]})\\.(${l[d.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASEIDENTIFIER",`(?:${l[d.NUMERICIDENTIFIER]}|${l[d.NONNUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${l[d.NUMERICIDENTIFIERLOOSE]}|${l[d.NONNUMERICIDENTIFIER]})`),g("PRERELEASE",`(?:-(${l[d.PRERELEASEIDENTIFIER]}(?:\\.${l[d.PRERELEASEIDENTIFIER]})*))`),g("PRERELEASELOOSE",`(?:-?(${l[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[d.PRERELEASEIDENTIFIERLOOSE]})*))`),g("BUILDIDENTIFIER",`${p}+`),g("BUILD",`(?:\\+(${l[d.BUILDIDENTIFIER]}(?:\\.${l[d.BUILDIDENTIFIER]})*))`),g("FULLPLAIN",`v?${l[d.MAINVERSION]}${l[d.PRERELEASE]}?${l[d.BUILD]}?`),g("FULL",`^${l[d.FULLPLAIN]}$`),g("LOOSEPLAIN",`[v=\\s]*${l[d.MAINVERSIONLOOSE]}${l[d.PRERELEASELOOSE]}?${l[d.BUILD]}?`),g("LOOSE",`^${l[d.LOOSEPLAIN]}$`),g("GTLT","((?:<|>)?=?)"),g("XRANGEIDENTIFIERLOOSE",`${l[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g("XRANGEIDENTIFIER",`${l[d.NUMERICIDENTIFIER]}|x|X|\\*`),g("XRANGEPLAIN",`[v=\\s]*(${l[d.XRANGEIDENTIFIER]})(?:\\.(${l[d.XRANGEIDENTIFIER]})(?:\\.(${l[d.XRANGEIDENTIFIER]})(?:${l[d.PRERELEASE]})?${l[d.BUILD]}?)?)?`),g("XRANGEPLAINLOOSE",`[v=\\s]*(${l[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[d.XRANGEIDENTIFIERLOOSE]})(?:${l[d.PRERELEASELOOSE]})?${l[d.BUILD]}?)?)?`),g("XRANGE",`^${l[d.GTLT]}\\s*${l[d.XRANGEPLAIN]}$`),g("XRANGELOOSE",`^${l[d.GTLT]}\\s*${l[d.XRANGEPLAINLOOSE]}$`),g("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),g("COERCE",`${l[d.COERCEPLAIN]}(?:$|[^\\d])`),g("COERCEFULL",l[d.COERCEPLAIN]+`(?:${l[d.PRERELEASE]})?`+`(?:${l[d.BUILD]})?(?:$|[^\\d])`),g("COERCERTL",l[d.COERCE],!0),g("COERCERTLFULL",l[d.COERCEFULL],!0),g("LONETILDE","(?:~>?)"),g("TILDETRIM",`(\\s*)${l[d.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",g("TILDE",`^${l[d.LONETILDE]}${l[d.XRANGEPLAIN]}$`),g("TILDELOOSE",`^${l[d.LONETILDE]}${l[d.XRANGEPLAINLOOSE]}$`),g("LONECARET","(?:\\^)"),g("CARETTRIM",`(\\s*)${l[d.LONECARET]}
2\\s+`,!0),t.caretTrimReplace="$1^",g("CARET",`^${l[d.LONECARET]}${l[d.XRANGEPLAIN]}$`),g("CARETLOOSE",`^${l[d.LONECARET]}${l[d.XRANGEPLAINLOOSE]}$`),g("COMPARATORLOOSE",`^${l[d.GTLT]}\\s*(${l[d.LOOSEPLAIN]})$|^$`),g("COMPARATOR",`^${l[d.GTLT]}\\s*(${l[d.FULLPLAIN]})$|^$`),g("COMPARATORTRIM",`(\\s*)${l[d.GTLT]}\\s*(${l[d.LOOSEPLAIN]}|${l[d.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",g("HYPHENRANGE",`^\\s*(${l[d.XRANGEPLAIN]})\\s+-\\s+(${l[d.XRANGEPLAIN]})\\s*$`),g("HYPHENRANGELOOSE",`^\\s*(${l[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[d.XRANGEPLAINLOOSE]})\\s*$`),g("STAR","(<|>)?=?\\s*\\*"),g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},"./node_modules/tronweb/node_modules/semver/ranges/gtr.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/ranges/outside.js");e.exports=(e,t,r)=>n(e,t,">",r)},"./node_modules/tronweb/node_modules/semver/ranges/intersects.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/classes/range.js");e.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))},"./node_modules/tronweb/node_modules/semver/ranges/ltr.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/ranges/outside.js");e.exports=(e,t,r)=>n(e,t,"<",r)},"./node_modules/tronweb/node_modules/semver/ranges/max-satisfying.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/classes/semver.js"),o=r("./node_modules/tronweb/node_modules/semver/classes/range.js");e.exports=(e,t,r)=>{let s=null,i=null,a=null;try{a=new o(t,r)}catch(e){return null}return e.forEach((e=>{a.test(e)&&(s&&-1!==i.compare(e)||(s=e,i=new n(s,r)))})),s}},"./node_modules/tronweb/node_modules/semver/ranges/min-satisfying.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/classes/semver.js"),o=r("./node_modules/tronweb/node_modules/semver/classes/range.js");e.exports=(e,t,r)=>{let s=null,i=null,a=null;try{a=new o(t,r)}catch(e){return null}return e.forEach((e=>{a.test(e)&&(s&&1!==i.compare(e)||(s=e,i=new n(s,r)))})),s}},"./node_modules/tronweb/node_modules/semver/ranges/min-version.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/classes/semver.js"),o=r("./node_modules/tronweb/node_modules/semver/classes/range.js"),s=r("./node_modules/tronweb/node_modules/semver/functions/gt.js");e.exports=(e,t)=>{e=new o(e,t);let r=new n("0.0.0");if(e.test(r))return r;if(r=new n("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t<e.set.length;++t){const o=e.set[t];let i=null;o.forEach((e=>{const t=new n(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!s(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!i||r&&!s(r,i)||(r=i)}return r&&e.test(r)?r:null}},"./node_modules/tronweb/node_modules/semver/ranges/outside.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/classes/semver.js"),o=r("./node_modules/tronweb/node_modules/semver/classes/comparator.js"),{ANY:s}=o,i=r("./node_modules/tronweb/node_modules/semver/classes/range.js"),a=r("./node_modules/tronweb/node_modules/semver/functions/satisfies.js"),c=r("./node_modules/tronweb/node_modules/semver/functions/gt.js"),l=r("./node_modules/tronweb/node_modules/semver/functions/lt.js"),u=r("./node_modules/tronweb/node_modules/semver/functions/lte.js"),d=r("./node_modules/tronweb/node_modules/semver/functions/gte.js");e.exports=(e,t,r,h)=>{let p,f,g,m,y;switch(e=new n(e,h),t=new i(t,h),r){case">":p=c,f=u,g=l,m=">",y=">=";break;case"<":p=l,f=d,g=c,m="<",y="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,t,h))return!1;for(let r=0;r<t.set.length;++r){const n=t.set[r];let i=null,a=null;if(n.forEach((e=>{e.semver===s&&(e=new o(">=0.0.0")),i=i||e,a=a||e,p(e.semver,i.semver,h)?i=e:g(e.semver,a.semver,h)&&(a=e)})),i.operator===m||i.operator===y)return!1;if((!a.operator||a.operator===m)&&f(e,a.semver))return!1;if(a.operator===y&&g(e,a.semver))return!1}return!0}},"./node_modules/tronweb/node_modules/semver/ranges/simplify.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/functions/satisfies.js"),o=r("./node_modules/tronweb/node_modules/semver/functions/compare.js");e.exports=(e,t,r)=>{const s=[];let i=null,a=null;const c=e.sort(((e,t)=>o(e,t,r)));
2for(const e of c){n(e,t,r)?(a=e,i||(i=e)):(a&&s.push([i,a]),a=null,i=null)}i&&s.push([i,null]);const l=[];for(const[e,t]of s)e===t?l.push(e):t||e!==c[0]?t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`):l.push("*");const u=l.join(" || "),d="string"==typeof t.raw?t.raw:String(t);return u.length<d.length?u:t}},"./node_modules/tronweb/node_modules/semver/ranges/subset.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/classes/range.js"),o=r("./node_modules/tronweb/node_modules/semver/classes/comparator.js"),{ANY:s}=o,i=r("./node_modules/tronweb/node_modules/semver/functions/satisfies.js"),a=r("./node_modules/tronweb/node_modules/semver/functions/compare.js"),c=[new o(">=0.0.0-0")],l=[new o(">=0.0.0")],u=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===s){if(1===t.length&&t[0].semver===s)return!0;e=r.includePrerelease?c:l}if(1===t.length&&t[0].semver===s){if(r.includePrerelease)return!0;t=l}const n=new Set;let o,u,p,f,g,m,y;for(const t of e)">"===t.operator||">="===t.operator?o=d(o,t,r):"<"===t.operator||"<="===t.operator?u=h(u,t,r):n.add(t.semver);if(n.size>1)return null;if(o&&u){if(p=a(o.semver,u.semver,r),p>0)return null;if(0===p&&(">="!==o.operator||"<="!==u.operator))return null}for(const e of n){if(o&&!i(e,String(o),r))return null;if(u&&!i(e,String(u),r))return null;for(const n of t)if(!i(e,String(n),r))return!1;return!0}let b=!(!u||r.includePrerelease||!u.semver.prerelease.length)&&u.semver,w=!(!o||r.includePrerelease||!o.semver.prerelease.length)&&o.semver;b&&1===b.prerelease.length&&"<"===u.operator&&0===b.prerelease[0]&&(b=!1);for(const e of t){if(y=y||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,o)if(w&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===w.major&&e.semver.minor===w.minor&&e.semver.patch===w.patch&&(w=!1),">"===e.operator||">="===e.operator){if(f=d(o,e,r),f===e&&f!==o)return!1}else if(">="===o.operator&&!i(o.semver,String(e),r))return!1;if(u)if(b&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===b.major&&e.semver.minor===b.minor&&e.semver.patch===b.patch&&(b=!1),"<"===e.operator||"<="===e.operator){if(g=h(u,e,r),g===e&&g!==u)return!1}else if("<="===u.operator&&!i(u.semver,String(e),r))return!1;if(!e.operator&&(u||o)&&0!==p)return!1}return!(o&&m&&!u&&0!==p)&&(!(u&&y&&!o&&0!==p)&&(!w&&!b))},d=(e,t,r)=>{if(!e)return t;const n=a(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},h=(e,t,r)=>{if(!e)return t;const n=a(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let o=!1;e:for(const n of e.set){for(const e of t.set){const t=u(n,e,r);if(o=o||null!==t,t)continue e}if(o)return!1}return!0}},"./node_modules/tronweb/node_modules/semver/ranges/to-comparators.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/classes/range.js");e.exports=(e,t)=>new n(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},"./node_modules/tronweb/node_modules/semver/ranges/valid.js"(e,t,r){const n=r("./node_modules/tronweb/node_modules/semver/classes/range.js");e.exports=(e,t)=>{try{return new n(e,t).range||"*"}catch(e){return null}}},"./node_modules/@coinbase/wallet-sdk/dist/vendor-js/eth-eip712-util/abi.cjs"(e,t,r){var n=r("./node_modules/buffer/index.js").Buffer;const o=r("./node_modules/@coinbase/wallet-sdk/dist/vendor-js/eth-eip712-util/util.cjs");function s(e){return e.startsWith("int[")?"int256"+e.slice(3):"int"===e?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):"uint"===e?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):"fixed"===e?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):"ufixed"===e?"ufixed128x128":e}function i(e){return Number.parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function a(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[Number.parseInt(t[1],10),Number.parseInt(t[2],10)]}function c(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?""===t[2]?"dynamic":Number.parseInt(t[2],10):null}function l(e){var t=typeof e;if("string"===t||"number"===t)return BigInt(e);if("bigint"===t)return e;throw new Error("Argument is not a number")}function u(e,t){var r,s,d,h;if("address"===e)return u("uint160",l(t));if("bool"===e)return u("uint8",t?1:0);if("string"===e)return u("bytes",new n(t,"utf8"));if(function(e){return e.lastIndexOf("]")===e.length-1}(e)){if(void 0===t.length)throw new Error("Not an array?");if("dynamic"!==(r=c(e))&&0!==r&&t.length>r)throw new Error("Elements exceed array size: "+r);for(h in d=[],e=e.slice(0,e.lastIndexOf("[")),"string"==typeof t&&(t=JSON.parse(t)),t)d.push(u(e,t[h]));if("dynamic"===r){var p=u("uint256",t.length);d.unshift(p)}return n.concat(d)}if("bytes"===e)return t=new n(t),d=n.concat([u("uint256",t.length),t]),t.length%32!=0&&(d=n.concat([d,o.zeros(32-t.length%32)])),d;if(e.startsWith("bytes")){if((r=i(e))<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return o.setLengthRight(t,32)}if(e.startsWith("uint")){if((r=i(e))%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);s=l(t);const n=o.bitLengthFromBigInt(s);if(n>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n);if(s<0)throw new Error("Supplied uint is negative");return o.bufferBEFromBigInt(s,32)}if(e.startsWith("int")){if((r=i(e))%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);s=l(t);const n=o.bitLengthFromBigInt(s);if(n>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n);const a=o.twosFromBigInt(s,256);return o.bufferBEFromBigInt(a,32)}if(e.startsWith("ufixed")){if(r=a(e),(s=l(t))<0)throw new Error("Supplied ufixed is negative");return u("uint256",s*BigInt(2)**BigInt(r[1]))}if(e.startsWith("fixed"))return r=a(e),u("int256",l(t)*BigInt(2)**BigInt(r[1]));throw new Error("Unsupported or invalid type: "+e)}function d(e){return"string"===e||"bytes"===e||"dynamic"===c(e)}function h(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var r,a,c=[],u=0;u<e.length;u++){var d=s(e[u]),h=t[u];
2if("bytes"===d)c.push(h);else if("string"===d)c.push(new n(h,"utf8"));else if("bool"===d)c.push(new n(h?"01":"00","hex"));else if("address"===d)c.push(o.setLength(h,20));else if(d.startsWith("bytes")){if((r=i(d))<1||r>32)throw new Error("Invalid bytes<N> width: "+r);c.push(o.setLengthRight(h,r))}else if(d.startsWith("uint")){if((r=i(d))%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);a=l(h);const e=o.bitLengthFromBigInt(a);if(e>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+e);c.push(o.bufferBEFromBigInt(a,r/8))}else{if(!d.startsWith("int"))throw new Error("Unsupported or invalid type: "+d);{if((r=i(d))%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);a=l(h);const e=o.bitLengthFromBigInt(a);if(e>r)throw new Error("Supplied int exceeds width: "+r+" vs "+e);const t=o.twosFromBigInt(a,r);c.push(o.bufferBEFromBigInt(t,r/8))}}}return n.concat(c)}e.exports={rawEncode:function(e,t){var r=[],o=[],i=32*e.length;for(var a in e){var c=s(e[a]),l=u(c,t[a]);d(c)?(r.push(u("uint256",i)),o.push(l),i+=l.length):r.push(l)}return n.concat(r.concat(o))},solidityPack:h,soliditySHA3:function(e,t){return o.keccak(h(e,t))}}},"./node_modules/@coinbase/wallet-sdk/dist/vendor-js/eth-eip712-util/index.cjs"(e,t,r){var n=r("./node_modules/buffer/index.js").Buffer;const o=r("./node_modules/@coinbase/wallet-sdk/dist/vendor-js/eth-eip712-util/util.cjs"),s=r("./node_modules/@coinbase/wallet-sdk/dist/vendor-js/eth-eip712-util/abi.cjs"),i={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},a={encodeData(e,t,r,i=!0){const a=["bytes32"],c=[this.hashType(e,r)];if(i){const l=(e,t,a)=>{if(void 0!==r[t])return["bytes32",null==a?"0x0000000000000000000000000000000000000000000000000000000000000000":o.keccak(this.encodeData(t,a,r,i))];if(void 0===a)throw new Error(`missing value for field ${e} of type ${t}`);if("bytes"===t)return["bytes32",o.keccak(a)];if("string"===t)return"string"==typeof a&&(a=n.from(a,"utf8")),["bytes32",o.keccak(a)];if(t.lastIndexOf("]")===t.length-1){const r=t.slice(0,t.lastIndexOf("[")),n=a.map((t=>l(e,r,t)));return["bytes32",o.keccak(s.rawEncode(n.map((([e])=>e)),n.map((([,e])=>e))))]}return[t,a]};for(const n of r[e]){const[e,r]=l(n.name,n.type,t[n.name]);a.push(e),c.push(r)}}else for(const s of r[e]){let e=t[s.name];if(void 0!==e)if("bytes"===s.type)a.push("bytes32"),e=o.keccak(e),c.push(e);else if("string"===s.type)a.push("bytes32"),"string"==typeof e&&(e=n.from(e,"utf8")),e=o.keccak(e),c.push(e);else if(void 0!==r[s.type])a.push("bytes32"),e=o.keccak(this.encodeData(s.type,e,r,i)),c.push(e);else{if(s.type.lastIndexOf("]")===s.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");a.push(s.type),c.push(e)}}return s.rawEncode(a,c)},encodeType(e,t){let r="",n=this.findTypeDependencies(e,t).filter((t=>t!==e));n=[e].concat(n.sort());for(const e of n){if(!t[e])throw new Error("No type definition specified: "+e);r+=e+"("+t[e].map((({name:e,type:t})=>t+" "+e)).join(",")+")"}return r},findTypeDependencies(e,t,r=[]){if(e=e.match(/^\w*/)[0],r.includes(e)||void 0===t[e])return r;r.push(e);for(const n of t[e])for(const e of this.findTypeDependencies(n.type,t,r))!r.includes(e)&&r.push(e);return r},hashStruct(e,t,r,n=!0){return o.keccak(this.encodeData(e,t,r,n))},hashType(e,t){return o.keccak(this.encodeType(e,t))},sanitizeData(e){const t={};for(const r in i.properties)e[r]&&(t[r]=e[r]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){const r=this.sanitizeData(e),s=[n.from("1901","hex")];return s.push(this.hashStruct("EIP712Domain",r.domain,r.types,t)),"EIP712Domain"!==r.primaryType&&s.push(this.hashStruct(r.primaryType,r.message,r.types,t)),o.keccak(n.concat(s))}};e.exports={TYPED_MESSAGE_SCHEMA:i,TypedDataUtils:a,hashForSignTypedDataLegacy:function(e){return function(e){const t=new Error("Expect argument to be non-empty array");if("object"!=typeof e||!e.length)throw t;const r=e.map((function(e){return"bytes"===e.type?o.toBuffer(e.value):e.value})),n=e.map((function(e){return e.type})),i=e.map((function(e){if(!e.name)throw t;return e.type+" "+e.name}));return s.soliditySHA3(["bytes32","bytes32"],[s.soliditySHA3(new Array(e.length).fill("string"),i),s.soliditySHA3(n,r)])}(e.data)},hashForSignTypedData_v3:function(e){return a.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return a.hash(e.data)}}},"./node_modules/@coinbase/wallet-sdk/dist/vendor-js/eth-eip712-util/util.cjs"(e,t,r){var n=r("./node_modules/buffer/index.js").Buffer;const{keccak_256:o}=r("./node_modules/@coinbase/wallet-sdk/node_modules/@noble/hashes/sha3.js");function s(e){return n.allocUnsafe(e).fill(0)}function i(e,t){let r=e.toString(16);r.length%2!=0&&(r="0"+r);const o=r.match(/.{1,2}/g).map((e=>parseInt(e,16)));for(;o.length<t;)o.unshift(0);return n.from(o)}function a(e,t,r){const n=s(t);return e=c(e),r?e.length<t?(e.copy(n),n):e.slice(0,t):e.length<t?(e.copy(n,t-e.length),n):e.slice(-t)}function c(e){if(!n.isBuffer(e))if(Array.isArray(e))e=n.from(e);else if("string"==typeof e)e=l(e)?n.from((t=u(e)).length%2?"0"+t:t,"hex"):n.from(e);else if("number"==typeof e)e=intToBuffer(e);else if(null==e)e=n.allocUnsafe(0);else if("bigint"==typeof e)e=i(e);else{if(!e.toArray)throw new Error("invalid type");e=n.from(e.toArray())}var t;return e}function l(e){return"string"==typeof e&&e.match(/^0x[0-9A-Fa-f]*$/)}function u(e){return"string"==typeof e&&e.startsWith("0x")?e.slice(2):e}e.exports={zeros:s,setLength:a,setLengthRight:function(e,t){return a(e,t,!0)},isHexString:l,stripHexPrefix:u,toBuffer:c,bufferToHex:function(e){return"0x"+(e=c(e)).toString("hex")},keccak:function(e,t){if(e=c(e),t||(t=256),256!==t)throw new Error("unsupported");return n.from(o(new Uint8Array(e)))},bitLengthFromBigInt:function(e){return e.toString(2).length},bufferBEFromBigInt:i,twosFromBigInt:function(e,t){let r;if(e<0n){r=(~e&(1n<<BigInt(t))-1n)+1n}else r=e;return r&=(1n<<BigInt(t))-1n,r}}},"./node_modules/tronweb/lib/esm/protocol/core/Tron_pb.cjs"(e,t,r){var n=r("./node_modules/google-protobuf/google-protobuf.js"),o=n,s="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof window&&window||void 0!==s&&s||"undefined"!=typeof self&&self||function(){return this}.call(null)||Function("return this")(),i=r("./node_modules/google-protobuf/google/protobuf/any_pb.js");o.object.extend(proto,i
vendor: 5,985 bytes, line 2
2),o.exportSymbol("TronWebProto.Account",null,s),o.exportSymbol("TronWebProto.Account.AccountResource",null,s),o.exportSymbol("TronWebProto.Account.Frozen",null,s),o.exportSymbol("TronWebProto.AccountId",null,s),o.exportSymbol("TronWebProto.AccountType",null,s),o.exportSymbol("TronWebProto.DelegatedResource",null,s),o.exportSymbol("TronWebProto.Exchange",null,s),o.exportSymbol("TronWebProto.Key",null,s),o.exportSymbol("TronWebProto.MarketOrderDetail",null,s),o.exportSymbol("TronWebProto.Permission",null,s),o.exportSymbol("TronWebProto.Permission.PermissionType",null,s),o.exportSymbol("TronWebProto.Proposal",null,s),o.exportSymbol("TronWebProto.Proposal.State",null,s),o.exportSymbol("TronWebProto.Transaction",null,s),o.exportSymbol("TronWebProto.Transaction.Contract",null,s),o.exportSymbol("TronWebProto.Transaction.Contract.ContractType",null,s),o.exportSymbol("TronWebProto.Transaction.Result",null,s),o.exportSymbol("TronWebProto.Transaction.Result.code",null,s),o.exportSymbol("TronWebProto.Transaction.Result.contractResult",null,s),o.exportSymbol("TronWebProto.Transaction.raw",null,s),o.exportSymbol("TronWebProto.Vote",null,s),o.exportSymbol("TronWebProto.Votes",null,s),o.exportSymbol("TronWebProto.Witness",null,s),o.exportSymbol("TronWebProto.authority",null,s),TronWebProto.AccountId=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.AccountId,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.AccountId.displayName="TronWebProto.AccountId"),TronWebProto.Vote=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.Vote,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.Vote.displayName="TronWebProto.Vote"),TronWebProto.Proposal=function(e){n.Message.initialize(this,e,0,-1,TronWebProto.Proposal.repeatedFields_,null)},o.inherits(TronWebProto.Proposal,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.Proposal.displayName="TronWebProto.Proposal"),TronWebProto.Exchange=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.Exchange,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.Exchange.displayName="TronWebProto.Exchange"),TronWebProto.Account=function(e){n.Message.initialize(this,e,0,-1,TronWebProto.Account.repeatedFields_,null)},o.inherits(TronWebProto.Account,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.Account.displayName="TronWebProto.Account"),TronWebProto.Account.Frozen=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.Account.Frozen,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.Account.Frozen.displayName="TronWebProto.Account.Frozen"),TronWebProto.Account.AccountResource=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.Account.AccountResource,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.Account.AccountResource.displayName="TronWebProto.Account.AccountResource"),TronWebProto.Key=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.Key,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.Key.displayName="TronWebProto.Key"),TronWebProto.DelegatedResource=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.DelegatedResource,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.DelegatedResource.displayName="TronWebProto.DelegatedResource"),TronWebProto.authority=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.authority,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.authority.displayName="TronWebProto.authority"),TronWebProto.Permission=function(e){n.Message.initialize(this,e,0,-1,TronWebProto.Permission.repeatedFields_,null)},o.inherits(TronWebProto.Permission,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.Permission.displayName="TronWebProto.Permission"),TronWebProto.Witness=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.Witness,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.Witness.displayName="TronWebProto.Witness"),TronWebProto.Votes=function(e){n.Message.initialize(this,e,0,-1,TronWebProto.Votes.repeatedFields_,null)},o.inherits(TronWebProto.Votes,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.Votes.displayName="TronWebProto.Votes"),TronWebProto.MarketOrderDetail=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.MarketOrderDetail,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.MarketOrderDetail.displayName="TronWebProto.MarketOrderDetail"),TronWebProto.Transaction=function(e){n.Message.initialize(this,e,0,-1,TronWebProto.Transaction.repeatedFields_,null)},o.inherits(TronWebProto.Transaction,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.Transaction.displayName="TronWebProto.Transaction"),TronWebProto.Transaction.Contract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.Transaction.Contract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.Transaction.Contract.displayName="TronWebProto.Transaction.Contract"),TronWebProto.Transaction.Result=function(e){n.Message.initialize(this,e,0,-1,TronWebProto.Transaction.Result.repeatedFields_,null)},o.inherits(TronWebProto.Transaction.Result,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.Transaction.Result.displayName="TronWebProto.Transaction.Result"),TronWebProto.Transaction.raw=function(e){n.Message.initialize(this,e,0,-1,TronWebProto.Transaction.raw.repeatedFields_,null)},o.inherits(TronWebProto.Transaction.raw,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.Transaction.raw.displayName="TronWebProto.Transaction.raw"),n.Message.GENERATE_TO_OBJECT&&(TronWebProto.AccountId.prototype.toObject=function(e){return TronWebProto.AccountId.toObject(e,this)},TronWebProto.AccountId.toObject=function(e,t){var r={name:t.getName_asB64(),address:t.getAddress_asB64()};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.AccountId.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.AccountId;return TronWebProto.AccountId.deserializeBinaryFromReader(r,t)},TronWebProto.AccountId.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)
vendor: 7,339 bytes, line 2
2{switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setName(r);break;case 2:r=t.readBytes();e.setAddress(r);break;default:t.skipField()}}return e},TronWebProto.AccountId.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.AccountId.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.AccountId.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getName_asU8()).length>0&&t.writeBytes(1,r),(r=e.getAddress_asU8()).length>0&&t.writeBytes(2,r)},TronWebProto.AccountId.prototype.getName=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.AccountId.prototype.getName_asB64=function(){return n.Message.bytesAsB64(this.getName())},TronWebProto.AccountId.prototype.getName_asU8=function(){return n.Message.bytesAsU8(this.getName())},TronWebProto.AccountId.prototype.setName=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.AccountId.prototype.getAddress=function(){return n.Message.getFieldWithDefault(this,2,"")},TronWebProto.AccountId.prototype.getAddress_asB64=function(){return n.Message.bytesAsB64(this.getAddress())},TronWebProto.AccountId.prototype.getAddress_asU8=function(){return n.Message.bytesAsU8(this.getAddress())},TronWebProto.AccountId.prototype.setAddress=function(e){return n.Message.setProto3BytesField(this,2,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.Vote.prototype.toObject=function(e){return TronWebProto.Vote.toObject(e,this)},TronWebProto.Vote.toObject=function(e,t){var r={voteAddress:t.getVoteAddress_asB64(),voteCount:n.Message.getFieldWithDefault(t,2,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.Vote.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.Vote;return TronWebProto.Vote.deserializeBinaryFromReader(r,t)},TronWebProto.Vote.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setVoteAddress(r);break;case 2:r=t.readInt64();e.setVoteCount(r);break;default:t.skipField()}}return e},TronWebProto.Vote.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.Vote.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.Vote.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getVoteAddress_asU8()).length>0&&t.writeBytes(1,r),0!==(r=e.getVoteCount())&&t.writeInt64(2,r)},TronWebProto.Vote.prototype.getVoteAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.Vote.prototype.getVoteAddress_asB64=function(){return n.Message.bytesAsB64(this.getVoteAddress())},TronWebProto.Vote.prototype.getVoteAddress_asU8=function(){return n.Message.bytesAsU8(this.getVoteAddress())},TronWebProto.Vote.prototype.setVoteAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.Vote.prototype.getVoteCount=function(){return n.Message.getFieldWithDefault(this,2,0)},TronWebProto.Vote.prototype.setVoteCount=function(e){return n.Message.setProto3IntField(this,2,e)},TronWebProto.Proposal.repeatedFields_=[6],n.Message.GENERATE_TO_OBJECT&&(TronWebProto.Proposal.prototype.toObject=function(e){return TronWebProto.Proposal.toObject(e,this)},TronWebProto.Proposal.toObject=function(e,t){var r,o={proposalId:n.Message.getFieldWithDefault(t,1,0),proposerAddress:t.getProposerAddress_asB64(),parametersMap:(r=t.getParametersMap())?r.toObject(e,void 0):[],expirationTime:n.Message.getFieldWithDefault(t,4,0),createTime:n.Message.getFieldWithDefault(t,5,0),approvalsList:t.getApprovalsList_asB64(),state:n.Message.getFieldWithDefault(t,7,0)};return e&&(o.$jspbMessageInstance=t),o}),TronWebProto.Proposal.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.Proposal;return TronWebProto.Proposal.deserializeBinaryFromReader(r,t)},TronWebProto.Proposal.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readInt64();e.setProposalId(r);break;case 2:r=t.readBytes();e.setProposerAddress(r);break;case 3:r=e.getParametersMap();t.readMessage(r,(function(e,t){n.Map.deserializeBinary(e,t,n.BinaryReader.prototype.readInt64,n.BinaryReader.prototype.readInt64,null,0,0)}));break;case 4:r=t.readInt64();e.setExpirationTime(r);break;case 5:r=t.readInt64();e.setCreateTime(r);break;case 6:r=t.readBytes();e.addApprovals(r);break;case 7:r=t.readEnum();e.setState(r);break;default:t.skipField()}}return e},TronWebProto.Proposal.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.Proposal.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.Proposal.serializeBinaryToWriter=function(e,t){var r=void 0;0!==(r=e.getProposalId())&&t.writeInt64(1,r),(r=e.getProposerAddress_asU8()).length>0&&t.writeBytes(2,r),(r=e.getParametersMap(!0))&&r.getLength()>0&&r.serializeBinary(3,t,n.BinaryWriter.prototype.writeInt64,n.BinaryWriter.prototype.writeInt64),0!==(r=e.getExpirationTime())&&t.writeInt64(4,r),0!==(r=e.getCreateTime())&&t.writeInt64(5,r),(r=e.getApprovalsList_asU8()).length>0&&t.writeRepeatedBytes(6,r),0!==(r=e.getState())&&t.writeEnum(7,r)},TronWebProto.Proposal.State={PENDING:0,DISAPPROVED:1,APPROVED:2,CANCELED:3},TronWebProto.Proposal.prototype.getProposalId=function(){return n.Message.getFieldWithDefault(this,1,0)},TronWebProto.Proposal.prototype.setProposalId=function(e){return n.Message.setProto3IntField(this,1,e)},TronWebProto.Proposal.prototype.getProposerAddress=function(){return n.Message.getFieldWithDefault(this,2,"")},TronWebProto.Proposal.prototype.getProposerAddress_asB64=function(){return n.Message.bytesAsB64(this.getProposerAddress())},TronWebProto.Proposal.prototype.getProposerAddress_asU8=function(){return n.Message.bytesAsU8(this.getProposerAddress())},TronWebProto.Proposal.prototype.setProposerAddress=function(e){return n.Message.setProto3BytesField(this,2,e)},TronWebProto.Proposal.prototype.getParametersMap=function(e){return n.Message.getMapField(this,3,e,null)},TronWebProto.Proposal.prototype.clearParametersMap=function(){return this.getParametersMap().clear(),this},TronWebProto.Proposal.prototype.getExpirationTime=function(){return n.Message.getFieldWithDefault(this,4,0)},TronWebProto.Proposal.prototype.setExpirationTime=function(e){return n.Message.setProto3IntField(this,4,e)},TronWebProto.Proposal.prototype.getCreateTime=function(){return n.Message.getFieldWithDefault(this,5,0)},TronWebProto.Proposal.prototype.setCreateTime=function(e){return n.Message.setProto3IntField(this,5,e)},TronWebProto.Proposal.prototype.getApprovalsList=function(){return n.Message.getRepeatedField(this,6)},TronWebProto.Proposal.prototype.getApprovalsList_asB64=function(){return n.Message.bytesListAsB64(this.getApprovalsList())},TronWebProto.Proposal.prototype.getApprovalsList_asU8=function(){return n.Message.bytesListAsU8(this.getApprovalsList())},TronWebProto.Proposal.prototype.setApprovalsList=function(e){return n.Message.setField(this,6,e||[])},TronWebProto.Proposal.prototype.addApprovals=function(e,t){return n.Message.addToRepeatedField(this,6,e,t)},TronWebProto.Proposal.prototype.clearApprovalsList=function(){return this.setApprovalsList([])},TronWebProto.Proposal.prototype.getState=function(){return n.Message.getFieldWithDefault(this,7,0)},TronWebProto.Proposal.prototype.setState=function(e){return n.Message.setProto3EnumField(this,7,e)}
2,n.Message.GENERATE_TO_OBJECT&&(TronWebProto.Exchange.prototype.toObject=function(e){return TronWebProto.Exchange.toObject(e,this)},TronWebProto.Exchange.toObject=function(e,t){var r={exchangeId:n.Message.getFieldWithDefault(t,1,0),creatorAddress:t.getCreatorAddress_asB64(),createTime:n.Message.getFieldWithDefault(t,3,0),firstTokenId:t.getFirstTokenId_asB64(),firstTokenBalance:n.Message.getFieldWithDefault(t,7,0),secondTokenId:t.getSecondTokenId_asB64(),secondTokenBalance:n.Message.getFieldWithDefault(t,9,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.Exchange.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.Exchange;return TronWebProto.Exchange.deserializeBinaryFromReader(r,t)},TronWebProto.Exchange.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readInt64();e.setExchangeId(r);break;case 2:r=t.readBytes();e.setCreatorAddress(r);break;case 3:r=t.readInt64();e.setCreateTime(r);break;case 6:r=t.readBytes();e.setFirstTokenId(r);break;case 7:r=t.readInt64();e.setFirstTokenBalance(r);break;case 8:r=t.readBytes();e.setSecondTokenId(r);break;case 9:r=t.readInt64();e.setSecondTokenBalance(r);break;default:t.skipField()}
vendor: 5,699 bytes, line 2
2}return e},TronWebProto.Exchange.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.Exchange.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.Exchange.serializeBinaryToWriter=function(e,t){var r=void 0;0!==(r=e.getExchangeId())&&t.writeInt64(1,r),(r=e.getCreatorAddress_asU8()).length>0&&t.writeBytes(2,r),0!==(r=e.getCreateTime())&&t.writeInt64(3,r),(r=e.getFirstTokenId_asU8()).length>0&&t.writeBytes(6,r),0!==(r=e.getFirstTokenBalance())&&t.writeInt64(7,r),(r=e.getSecondTokenId_asU8()).length>0&&t.writeBytes(8,r),0!==(r=e.getSecondTokenBalance())&&t.writeInt64(9,r)},TronWebProto.Exchange.prototype.getExchangeId=function(){return n.Message.getFieldWithDefault(this,1,0)},TronWebProto.Exchange.prototype.setExchangeId=function(e){return n.Message.setProto3IntField(this,1,e)},TronWebProto.Exchange.prototype.getCreatorAddress=function(){return n.Message.getFieldWithDefault(this,2,"")},TronWebProto.Exchange.prototype.getCreatorAddress_asB64=function(){return n.Message.bytesAsB64(this.getCreatorAddress())},TronWebProto.Exchange.prototype.getCreatorAddress_asU8=function(){return n.Message.bytesAsU8(this.getCreatorAddress())},TronWebProto.Exchange.prototype.setCreatorAddress=function(e){return n.Message.setProto3BytesField(this,2,e)},TronWebProto.Exchange.prototype.getCreateTime=function(){return n.Message.getFieldWithDefault(this,3,0)},TronWebProto.Exchange.prototype.setCreateTime=function(e){return n.Message.setProto3IntField(this,3,e)},TronWebProto.Exchange.prototype.getFirstTokenId=function(){return n.Message.getFieldWithDefault(this,6,"")},TronWebProto.Exchange.prototype.getFirstTokenId_asB64=function(){return n.Message.bytesAsB64(this.getFirstTokenId())},TronWebProto.Exchange.prototype.getFirstTokenId_asU8=function(){return n.Message.bytesAsU8(this.getFirstTokenId())},TronWebProto.Exchange.prototype.setFirstTokenId=function(e){return n.Message.setProto3BytesField(this,6,e)},TronWebProto.Exchange.prototype.getFirstTokenBalance=function(){return n.Message.getFieldWithDefault(this,7,0)},TronWebProto.Exchange.prototype.setFirstTokenBalance=function(e){return n.Message.setProto3IntField(this,7,e)},TronWebProto.Exchange.prototype.getSecondTokenId=function(){return n.Message.getFieldWithDefault(this,8,"")},TronWebProto.Exchange.prototype.getSecondTokenId_asB64=function(){return n.Message.bytesAsB64(this.getSecondTokenId())},TronWebProto.Exchange.prototype.getSecondTokenId_asU8=function(){return n.Message.bytesAsU8(this.getSecondTokenId())},TronWebProto.Exchange.prototype.setSecondTokenId=function(e){return n.Message.setProto3BytesField(this,8,e)},TronWebProto.Exchange.prototype.getSecondTokenBalance=function(){return n.Message.getFieldWithDefault(this,9,0)},TronWebProto.Exchange.prototype.setSecondTokenBalance=function(e){return n.Message.setProto3IntField(this,9,e)},TronWebProto.Account.repeatedFields_=[5,7,16,33],n.Message.GENERATE_TO_OBJECT&&(TronWebProto.Account.prototype.toObject=function(e){return TronWebProto.Account.toObject(e,this)},TronWebProto.Account.toObject=function(e,t){var r,o={accountName:t.getAccountName_asB64(),type:n.Message.getFieldWithDefault(t,2,0),address:t.getAddress_asB64(),balance:n.Message.getFieldWithDefault(t,4,0),votesList:n.Message.toObjectList(t.getVotesList(),TronWebProto.Vote.toObject,e),assetMap:(r=t.getAssetMap())?r.toObject(e,void 0):[],assetv2Map:(r=t.getAssetv2Map())?r.toObject(e,void 0):[],frozenList:n.Message.toObjectList(t.getFrozenList(),TronWebProto.Account.Frozen.toObject,e),netUsage:n.Message.getFieldWithDefault(t,8,0),acquiredDelegatedFrozenBalanceForBandwidth:n.Message.getFieldWithDefault(t,41,0),delegatedFrozenBalanceForBandwidth:n.Message.getFieldWithDefault(t,42,0),oldTronPower:n.Message.getFieldWithDefault(t,46,0),tronPower:(r=t.getTronPower())&&TronWebProto.Account.Frozen.toObject(e,r),assetOptimized:n.Message.getBooleanFieldWithDefault(t,60,!1),createTime:n.Message.getFieldWithDefault(t,9,0),latestOprationTime:n.Message.getFieldWithDefault(t,10,0),allowance:n.Message.getFieldWithDefault(t,11,0),latestWithdrawTime:n.Message.getFieldWithDefault(t,12,0),code:t.getCode_asB64(),isWitness:n.Message.getBooleanFieldWithDefault(t,14,!1),isCommittee:n.Message.getBooleanFieldWithDefault(t,15,!1),frozenSupplyList:n.Message.toObjectList(t.getFrozenSupplyList(),TronWebProto.Account.Frozen.toObject,e),assetIssuedName:t.getAssetIssuedName_asB64(),assetIssuedId:t.getAssetIssuedId_asB64(),latestAssetOperationTimeMap:(r=t.getLatestAssetOperationTimeMap())?r.toObject(e,void 0):[],latestAssetOperationTimev2Map:(r=t.getLatestAssetOperationTimev2Map())?r.toObject(e,void 0):[],freeNetUsage:n.Message.getFieldWithDefault(t,19,0),freeAssetNetUsageMap:(r=t.getFreeAssetNetUsageMap())?r.toObject(e,void 0):[],freeAssetNetUsagev2Map:(r=t.getFreeAssetNetUsagev2Map())?r.toObject(e,void 0):[],latestConsumeTime:n.Message.getFieldWithDefault(t,21,0),latestConsumeFreeTime:n.Message.getFieldWithDefault(t,22,0),accountId:t.getAccountId_asB64(),accountResource:(r=t.getAccountResource())&&TronWebProto.Account.AccountResource.toObject(e,r),codehash:t.getCodehash_asB64(),ownerPermission:(r=t.getOwnerPermission())&&TronWebProto.Permission.toObject(e,r),witnessPermission:(r=t.getWitnessPermission())&&TronWebProto.Permission.toObject(e,r),activePermissionList:n.Message.toObjectList(t.getActivePermissionList(),TronWebProto.Permission.toObject,e)};return e&&(o.$jspbMessageInstance=t),o}),TronWebProto.Account.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.Account;return TronWebProto.Account.deserializeBinaryFromReader(r,t)},TronWebProto.Account.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)
2{switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setAccountName(r);break;case 2:r=t.readEnum();e.setType(r);break;case 3:r=t.readBytes();e.setAddress(r);break;case 4:r=t.readInt64();e.setBalance(r);break;case 5:r=new TronWebProto.Vote;t.readMessage(r,TronWebProto.Vote.deserializeBinaryFromReader),e.addVotes(r);break;case 6:r=e.getAssetMap();t.readMessage(r,(function(e,t){n.Map.deserializeBinary(e,t,n.BinaryReader.prototype.readString,n.BinaryReader.prototype.readInt64,null,"",0)}));break;case 56:r=e.getAssetv2Map();t.readMessage(r,(function(e,t){n.Map.deserializeBinary(e,t,n.BinaryReader.prototype.readString,n.BinaryReader.prototype.readInt64,null,"",0)}));break;case 7:r=new TronWebProto.Account.Frozen;t.readMessage(r,TronWebProto.Account.Frozen.deserializeBinaryFromReader),e.addFrozen(r);break;case 8:r=t.readInt64();e.setNetUsage(r);break;case 41:r=t.readInt64();e.setAcquiredDelegatedFrozenBalanceForBandwidth(r);break;case 42:r=t.readInt64();e.setDelegatedFrozenBalanceForBandwidth(r);break;case 46:r=t.readInt64();e.setOldTronPower(r);break;case 47:r=new TronWebProto.Account.Frozen;t.readMessage(r,TronWebProto.Account.Frozen.deserializeBinaryFromReader),e.setTronPower(r);break;case 60:r=t.readBool();e.setAssetOptimized(r);break;case 9:r=t.readInt64();e.setCreateTime(r);break;case 10:r=t.readInt64();e.setLatestOprationTime(r);break;case 11:r=t.readInt64();e.setAllowance(r);break;case 12:r=t.readInt64();e.setLatestWithdrawTime(r);break;case 13:r=t.readBytes();e.setCode(r);break;case 14:r=t.readBool();e.setIsWitness(r);break;case 15:r=t.readBool();e.setIsCommittee(r);break;case 16:r=new TronWebProto.Account.Frozen;t.readMessage(r,TronWebProto.Account.Frozen.deserializeBinaryFromReader),e.addFrozenSupply(r);break;case 17:r=t.readBytes();e.setAssetIssuedName(r);break;case 57:r=t.readBytes();e.setAssetIssuedId(r);break;case 18:r=e.getLatestAssetOperationTimeMap();t.readMessage(r,(function(e,t){n.Map.deserializeBinary(e,t,n.BinaryReader.prototype.readString,n.BinaryReader.prototype.readInt64,null,"",0)}));break;case 58:r=e.getLatestAssetOperationTimev2Map();t.readMessage(r,(function(e,t){n.Map.deserializeBinary(e,t,n.BinaryReader.prototype.readString,n.BinaryReader.prototype.readInt64,null,"",0)}));break;case 19:r=t.readInt64();e.setFreeNetUsage(r);break;case 20:r=e.getFreeAssetNetUsageMap();t.readMessage(r,(function(e,t){n.Map.deserializeBinary(e,t,n.BinaryReader.prototype.readString,n.BinaryReader.prototype.readInt64,null,"",0)}));break;case 59:r=e.getFreeAssetNetUsagev2Map();t.readMessage(r,(function(e,t){n.Map.deserializeBinary(e,t,n.BinaryReader.prototype.readString,n.BinaryReader.prototype.readInt64,null,"",0)}));break;case 21:r=t.readInt64();e.setLatestConsumeTime(r);break;case 22:r=t.readInt64();e.setLatestConsumeFreeTime(r);break;case 23:r=t.readBytes();e.setAccountId(r);break;case 26:r=new TronWebProto.Account.AccountResource;t.readMessage(r,TronWebProto.Account.AccountResource.deserializeBinaryFromReader),e.setAccountResource(r);break;case 30:r=t.readBytes();e.setCodehash(r);break;case 31:r=new TronWebProto.Permission;t.readMessage(r,TronWebProto.Permission.deserializeBinaryFromReader),e.setOwnerPermission(r);break;case 32:r=new TronWebProto.Permission;t.readMessage(r,TronWebProto.Permission.deserializeBinaryFromReader),e.setWitnessPermission(r);break;case 33:r=new TronWebProto.Permission;t.readMessage(r,TronWebProto.Permission.deserializeBinaryFromReader),e.addActivePermission(r);break;default:t.skipField()}}return e},TronWebProto.Account.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.Account.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.Account.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getAccountName_asU8()).length>0&&t.writeBytes(1,r),0!==(r=e.getType())&&t.writeEnum(2,r),(r=e.getAddress_asU8()).length>0&&t.writeBytes(3,r),0!==(r=e.getBalance())&&t.writeInt64(4,r),(r=e.getVotesList()).length>0&&t.writeRepeatedMessage(5,r,TronWebProto.Vote.serializeBinaryToWriter),(r=e.getAssetMap(!0))&&r.getLength()>0&&r.serializeBinary(6,t,n.BinaryWriter.prototype.writeString,n.BinaryWriter.prototype.writeInt64),(r=e.getAssetv2Map(!0))&&r.getLength()>0&&r.serializeBinary(56,t,n.BinaryWriter.prototype.writeString,n.BinaryWriter.prototype.writeInt64),(r=e.getFrozenList()).length>0&&t.writeRepeatedMessage(7,r,TronWebProto.Account.Frozen.serializeBinaryToWriter),0!==(r=e.getNetUsage())&&t.writeInt64(8,r),0!==(r=e.getAcquiredDelegatedFrozenBalanceForBandwidth())&&t.writeInt64(41,r),0!==(r=e.getDelegatedFrozenBalanceForBandwidth())&&t.writeInt64(42,r),0!==(r=e.getOldTronPower())&&t.writeInt64(46,r),null!=(r=e.getTronPower())&&t.writeMessage(47,r,TronWebProto.Account.Frozen.serializeBinaryToWriter),(r=e.getAssetOptimized())&&t.writeBool(60,r),0!==(r=e.getCreateTime())&&t.writeInt64(9,r),0!==(r=e.getLatestOprationTime())&&t.writeInt64(10,r),0!==(r=e.getAllowance())&&t.writeInt64(11,r),0!==(r=e.getLatestWithdrawTime())&&t.writeInt64(12,r),(r=e.getCode_asU8()).length>0&&t.writeBytes(13,r),(r=e.getIsWitness())&&t.writeBool(14,r),(r=e.getIsCommittee())&&t.writeBool(15,r),(r=e.getFrozenSupplyList()).length>0&&t.writeRepeatedMessage(16,r,TronWebProto.Account.Frozen.serializeBinaryToWriter),(r=e.getAssetIssuedName_asU8()).length>0&&t.writeBytes(17,r),(r=e.getAssetIssuedId_asU8()).length>0&&t.writeBytes(57,r),(r=e.getLatestAssetOperationTimeMap(!0))&&r.getLength()>0&&r.serializeBinary(18,t,n.BinaryWriter.prototype.writeString,n.BinaryWriter.prototype.writeInt64),(r=e.getLatestAssetOperationTimev2Map(!0))&&r.getLength()>0&&r.serializeBinary(58,t,n.BinaryWriter.prototype.writeString,n.BinaryWriter.prototype.writeInt64),0!==(r=e.getFreeNetUsage())&&t.writeInt64(19,r),(r=e.getFreeAssetNetUsageMap(!0))&&r.getLength()>0&&r.serializeBinary(20,t,n.BinaryWriter.prototype.writeString,n.BinaryWriter.prototype.writeInt64),(r=e.getFreeAssetNetUsagev2Map(!0))&&r.getLength()>0&&r.serializeBinary(59,t,n.BinaryWriter.prototype.writeString,n.BinaryWriter.prototype.writeInt64),0!==(r=e.getLatestConsumeTime())&&t.writeInt64(21,r),0!==(r=e.getLatestConsumeFreeTime())&&t.writeInt64(22,r),(r=e.getAccountId_asU8()).length>0&&t.writeBytes(23,r),null!=(r=e.getAccountResource())&&t.writeMessage(26,r,TronWebProto.Account.AccountResource.serializeBinaryToWriter),(r=e.getCodehash_asU8()).length>0&&t.writeBytes(30,r),null!=(r=e.getOwnerPermission())&&t.writeMessage(31,r,TronWebProto.Permission.serializeBinaryToWriter),null!=(r=e.getWitnessPermission())&&t.writeMessage(32,r,TronWebProto.Permission.serializeBinaryToWriter),(r=e.getActivePermissionList()).length>0&&t.writeRepeatedMessage(33,r,TronWebProto.Permission.serializeBinaryToWriter)}
vendor: 62,071 bytes, line 2
2,n.Message.GENERATE_TO_OBJECT&&(TronWebProto.Account.Frozen.prototype.toObject=function(e){return TronWebProto.Account.Frozen.toObject(e,this)},TronWebProto.Account.Frozen.toObject=function(e,t){var r={frozenBalance:n.Message.getFieldWithDefault(t,1,0),expireTime:n.Message.getFieldWithDefault(t,2,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.Account.Frozen.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.Account.Frozen;return TronWebProto.Account.Frozen.deserializeBinaryFromReader(r,t)},TronWebProto.Account.Frozen.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readInt64();e.setFrozenBalance(r);break;case 2:r=t.readInt64();e.setExpireTime(r);break;default:t.skipField()}}return e},TronWebProto.Account.Frozen.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.Account.Frozen.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.Account.Frozen.serializeBinaryToWriter=function(e,t){var r=void 0;0!==(r=e.getFrozenBalance())&&t.writeInt64(1,r),0!==(r=e.getExpireTime())&&t.writeInt64(2,r)},TronWebProto.Account.Frozen.prototype.getFrozenBalance=function(){return n.Message.getFieldWithDefault(this,1,0)},TronWebProto.Account.Frozen.prototype.setFrozenBalance=function(e){return n.Message.setProto3IntField(this,1,e)},TronWebProto.Account.Frozen.prototype.getExpireTime=function(){return n.Message.getFieldWithDefault(this,2,0)},TronWebProto.Account.Frozen.prototype.setExpireTime=function(e){return n.Message.setProto3IntField(this,2,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.Account.AccountResource.prototype.toObject=function(e){return TronWebProto.Account.AccountResource.toObject(e,this)},TronWebProto.Account.AccountResource.toObject=function(e,t){var r,o={energyUsage:n.Message.getFieldWithDefault(t,1,0),frozenBalanceForEnergy:(r=t.getFrozenBalanceForEnergy())&&TronWebProto.Account.Frozen.toObject(e,r),latestConsumeTimeForEnergy:n.Message.getFieldWithDefault(t,3,0),acquiredDelegatedFrozenBalanceForEnergy:n.Message.getFieldWithDefault(t,4,0),delegatedFrozenBalanceForEnergy:n.Message.getFieldWithDefault(t,5,0),storageLimit:n.Message.getFieldWithDefault(t,6,0),storageUsage:n.Message.getFieldWithDefault(t,7,0),latestExchangeStorageTime:n.Message.getFieldWithDefault(t,8,0)};return e&&(o.$jspbMessageInstance=t),o}),TronWebProto.Account.AccountResource.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.Account.AccountResource;return TronWebProto.Account.AccountResource.deserializeBinaryFromReader(r,t)},TronWebProto.Account.AccountResource.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readInt64();e.setEnergyUsage(r);break;case 2:r=new TronWebProto.Account.Frozen;t.readMessage(r,TronWebProto.Account.Frozen.deserializeBinaryFromReader),e.setFrozenBalanceForEnergy(r);break;case 3:r=t.readInt64();e.setLatestConsumeTimeForEnergy(r);break;case 4:r=t.readInt64();e.setAcquiredDelegatedFrozenBalanceForEnergy(r);break;case 5:r=t.readInt64();e.setDelegatedFrozenBalanceForEnergy(r);break;case 6:r=t.readInt64();e.setStorageLimit(r);break;case 7:r=t.readInt64();e.setStorageUsage(r);break;case 8:r=t.readInt64();e.setLatestExchangeStorageTime(r);break;default:t.skipField()}}return e},TronWebProto.Account.AccountResource.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.Account.AccountResource.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.Account.AccountResource.serializeBinaryToWriter=function(e,t){var r=void 0;0!==(r=e.getEnergyUsage())&&t.writeInt64(1,r),null!=(r=e.getFrozenBalanceForEnergy())&&t.writeMessage(2,r,TronWebProto.Account.Frozen.serializeBinaryToWriter),0!==(r=e.getLatestConsumeTimeForEnergy())&&t.writeInt64(3,r),0!==(r=e.getAcquiredDelegatedFrozenBalanceForEnergy())&&t.writeInt64(4,r),0!==(r=e.getDelegatedFrozenBalanceForEnergy())&&t.writeInt64(5,r),0!==(r=e.getStorageLimit())&&t.writeInt64(6,r),0!==(r=e.getStorageUsage())&&t.writeInt64(7,r),0!==(r=e.getLatestExchangeStorageTime())&&t.writeInt64(8,r)},TronWebProto.Account.AccountResource.prototype.getEnergyUsage=function(){return n.Message.getFieldWithDefault(this,1,0)},TronWebProto.Account.AccountResource.prototype.setEnergyUsage=function(e){return n.Message.setProto3IntField(this,1,e)},TronWebProto.Account.AccountResource.prototype.getFrozenBalanceForEnergy=function(){return n.Message.getWrapperField(this,TronWebProto.Account.Frozen,2)},TronWebProto.Account.AccountResource.prototype.setFrozenBalanceForEnergy=function(e){return n.Message.setWrapperField(this,2,e)},TronWebProto.Account.AccountResource.prototype.clearFrozenBalanceForEnergy=function(){return this.setFrozenBalanceForEnergy(void 0)},TronWebProto.Account.AccountResource.prototype.hasFrozenBalanceForEnergy=function(){return null!=n.Message.getField(this,2)},TronWebProto.Account.AccountResource.prototype.getLatestConsumeTimeForEnergy=function(){return n.Message.getFieldWithDefault(this,3,0)},TronWebProto.Account.AccountResource.prototype.setLatestConsumeTimeForEnergy=function(e){return n.Message.setProto3IntField(this,3,e)},TronWebProto.Account.AccountResource.prototype.getAcquiredDelegatedFrozenBalanceForEnergy=function(){return n.Message.getFieldWithDefault(this,4,0)},TronWebProto.Account.AccountResource.prototype.setAcquiredDelegatedFrozenBalanceForEnergy=function(e){return n.Message.setProto3IntField(this,4,e)},TronWebProto.Account.AccountResource.prototype.getDelegatedFrozenBalanceForEnergy=function(){return n.Message.getFieldWithDefault(this,5,0)},TronWebProto.Account.AccountResource.prototype.setDelegatedFrozenBalanceForEnergy=function(e){return n.Message.setProto3IntField(this,5,e)},TronWebProto.Account.AccountResource.prototype.getStorageLimit=function(){return n.Message.getFieldWithDefault(this,6,0)},TronWebProto.Account.AccountResource.prototype.setStorageLimit=function(e){return n.Message.setProto3IntField(this,6,e)},TronWebProto.Account.AccountResource.prototype.getStorageUsage=function(){return n.Message.getFieldWithDefault(this,7,0)},TronWebProto.Account.AccountResource.prototype.setStorageUsage=function(e){return n.Message.setProto3IntField(this,7,e)},TronWebProto.Account.AccountResource.prototype.getLatestExchangeStorageTime=function(){return n.Message.getFieldWithDefault(this,8,0)},TronWebProto.Account.AccountResource.prototype.setLatestExchangeStorageTime=function(e){return n.Message.setProto3IntField(this,8,e)},TronWebProto.Account.prototype.getAccountName=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.Account.prototype.getAccountName_asB64=function(){return n.Message.bytesAsB64(this.getAccountName())},TronWebProto.Account.prototype.getAccountName_asU8=function(){return n.Message.bytesAsU8(this.getAccountName())},TronWebProto.Account.prototype.setAccountName=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.Account.prototype.getType=function(){return n.Message.getFieldWithDefault(this,2,0)},TronWebProto.Account.prototype.setType=function(e){return n.Message.setProto3EnumField(this,2,e)},TronWebProto.Account.prototype.getAddress=function(){return n.Message.getFieldWithDefault(this,3,"")},TronWebProto.Account.prototype.getAddress_asB64=function(){return n.Message.bytesAsB64(this.getAddress())},TronWebProto.Account.prototype.getAddress_asU8=function(){return n.Message.bytesAsU8(this.getAddress())},TronWebProto.Account.prototype.setAddress=function(e){return n.Message.setProto3BytesField(this,3,e)},TronWebProto.Account.prototype.getBalance=function(){return n.Message.getFieldWithDefault(this,4,0)},TronWebProto.Account.prototype.setBalance=function(e){return n.Message.setProto3IntField(this,4,e)},TronWebProto.Account.prototype.getVotesList=function(){return n.Message.getRepeatedWrapperField(this,TronWebProto.Vote,5)},TronWebProto.Account.prototype.setVotesList=function(e){return n.Message.setRepeatedWrapperField(this,5,e)},TronWebProto.Account.prototype.addVotes=function(e,t){return n.Message.addToRepeatedWrapperField(this,5,e,TronWebProto.Vote,t)},TronWebProto.Account.prototype.clearVotesList=function(){return this.setVotesList([])},TronWebProto.Account.prototype.getAssetMap=function(e){return n.Message.getMapField(this,6,e,null)},TronWebProto.Account.prototype.clearAssetMap=function(){return this.getAssetMap().clear(),this},TronWebProto.Account.prototype.getAssetv2Map=function(e){return n.Message.getMapField(this,56,e,null)},TronWebProto.Account.prototype.clearAssetv2Map=function(){return this.getAssetv2Map().clear(),this},TronWebProto.Account.prototype.getFrozenList=function(){return n.Message.getRepeatedWrapperField(this,TronWebProto.Account.Frozen,7)},TronWebProto.Account.prototype.setFrozenList=function(e){return n.Message.setRepeatedWrapperField(this,7,e)},TronWebProto.Account.prototype.addFrozen=function(e,t){return n.Message.addToRepeatedWrapperField(this,7,e,TronWebProto.Account.Frozen,t)},TronWebProto.Account.prototype.clearFrozenList=function(){return this.setFrozenList([])},TronWebProto.Account.prototype.getNetUsage=function(){return n.Message.getFieldWithDefault(this,8,0)},TronWebProto.Account.prototype.setNetUsage=function(e){return n.Message.setProto3IntField(this,8,e)},TronWebProto.Account.prototype.getAcquiredDelegatedFrozenBalanceForBandwidth=function(){return n.Message.getFieldWithDefault(this,41,0)},TronWebProto.Account.prototype.setAcquiredDelegatedFrozenBalanceForBandwidth=function(e){return n.Message.setProto3IntField(this,41,e)},TronWebProto.Account.prototype.getDelegatedFrozenBalanceForBandwidth=function(){return n.Message.getFieldWithDefault(this,42,0)},TronWebProto.Account.prototype.setDelegatedFrozenBalanceForBandwidth=function(e){return n.Message.setProto3IntField(this,42,e)},TronWebProto.Account.prototype.getOldTronPower=function(){return n.Message.getFieldWithDefault(this,46,0)},TronWebProto.Account.prototype.setOldTronPower=function(e){return n.Message.setProto3IntField(this,46,e)},TronWebProto.Account.prototype.getTronPower=function(){return n.Message.getWrapperField(this,TronWebProto.Account.Frozen,47)},TronWebProto.Account.prototype.setTronPower=function(e){return n.Message.setWrapperField(this,47,e)},TronWebProto.Account.prototype.clearTronPower=function(){return this.setTronPower(void 0)},TronWebProto.Account.prototype.hasTronPower=function(){return null!=n.Message.getField(this,47)},TronWebProto.Account.prototype.getAssetOptimized=function(){return n.Message.getBooleanFieldWithDefault(this,60,!1)},TronWebProto.Account.prototype.setAssetOptimized=function(e){return n.Message.setProto3BooleanField(this,60,e)},TronWebProto.Account.prototype.getCreateTime=function(){return n.Message.getFieldWithDefault(this,9,0)},TronWebProto.Account.prototype.setCreateTime=function(e){return n.Message.setProto3IntField(this,9,e)},TronWebProto.Account.prototype.getLatestOprationTime=function(){return n.Message.getFieldWithDefault(this,10,0)},TronWebProto.Account.prototype.setLatestOprationTime=function(e){return n.Message.setProto3IntField(this,10,e)},TronWebProto.Account.prototype.getAllowance=function(){return n.Message.getFieldWithDefault(this,11,0)},TronWebProto.Account.prototype.setAllowance=function(e){return n.Message.setProto3IntField(this,11,e)},TronWebProto.Account.prototype.getLatestWithdrawTime=function(){return n.Message.getFieldWithDefault(this,12,0)},TronWebProto.Account.prototype.setLatestWithdrawTime=function(e){return n.Message.setProto3IntField(this,12,e)},TronWebProto.Account.prototype.getCode=function(){return n.Message.getFieldWithDefault(this,13,"")},TronWebProto.Account.prototype.getCode_asB64=function(){return n.Message.bytesAsB64(this.getCode())},TronWebProto.Account.prototype.getCode_asU8=function(){return n.Message.bytesAsU8(this.getCode())},TronWebProto.Account.prototype.setCode=function(e){return n.Message.setProto3BytesField(this,13,e)},TronWebProto.Account.prototype.getIsWitness=function(){return n.Message.getBooleanFieldWithDefault(this,14,!1)},TronWebProto.Account.prototype.setIsWitness=function(e){return n.Message.setProto3BooleanField(this,14,e)},TronWebProto.Account.prototype.getIsCommittee=function(){return n.Message.getBooleanFieldWithDefault(this,15,!1)},TronWebProto.Account.prototype.setIsCommittee=function(e){return n.Message.setProto3BooleanField(this,15,e)},TronWebProto.Account.prototype.getFrozenSupplyList=function(){return n.Message.getRepeatedWrapperField(this,TronWebProto.Account.Frozen,16)},TronWebProto.Account.prototype.setFrozenSupplyList=function(e){return n.Message.setRepeatedWrapperField(this,16,e)},TronWebProto.Account.prototype.addFrozenSupply=function(e,t){return n.Message.addToRepeatedWrapperField(this,16,e,TronWebProto.Account.Frozen,t)},TronWebProto.Account.prototype.clearFrozenSupplyList=function(){return this.setFrozenSupplyList([])},TronWebProto.Account.prototype.getAssetIssuedName=function(){return n.Message.getFieldWithDefault(this,17,"")},TronWebProto.Account.prototype.getAssetIssuedName_asB64=function(){return n.Message.bytesAsB64(this.getAssetIssuedName())},TronWebProto.Account.prototype.getAssetIssuedName_asU8=function(){return n.Message.bytesAsU8(this.getAssetIssuedName())},TronWebProto.Account.prototype.setAssetIssuedName=function(e){return n.Message.setProto3BytesField(this,17,e)},TronWebProto.Account.prototype.getAssetIssuedId=function(){return n.Message.getFieldWithDefault(this,57,"")},TronWebProto.Account.prototype.getAssetIssuedId_asB64=function(){return n.Message.bytesAsB64(this.getAssetIssuedId())},TronWebProto.Account.prototype.getAssetIssuedId_asU8=function(){return n.Message.bytesAsU8(this.getAssetIssuedId())},TronWebProto.Account.prototype.setAssetIssuedId=function(e){return n.Message.setProto3BytesField(this,57,e)},TronWebProto.Account.prototype.getLatestAssetOperationTimeMap=function(e){return n.Message.getMapField(this,18,e,null)},TronWebProto.Account.prototype.clearLatestAssetOperationTimeMap=function(){return this.getLatestAssetOperationTimeMap().clear(),this},TronWebProto.Account.prototype.getLatestAssetOperationTimev2Map=function(e){return n.Message.getMapField(this,58,e,null)},TronWebProto.Account.prototype.clearLatestAssetOperationTimev2Map=function(){return this.getLatestAssetOperationTimev2Map().clear(),this},TronWebProto.Account.prototype.getFreeNetUsage=function(){return n.Message.getFieldWithDefault(this,19,0)},TronWebProto.Account.prototype.setFreeNetUsage=function(e){return n.Message.setProto3IntField(this,19,e)},TronWebProto.Account.prototype.getFreeAssetNetUsageMap=function(e){return n.Message.getMapField(this,20,e,null)},TronWebProto.Account.prototype.clearFreeAssetNetUsageMap=function(){return this.getFreeAssetNetUsageMap().clear(),this},TronWebProto.Account.prototype.getFreeAssetNetUsagev2Map=function(e){return n.Message.getMapField(this,59,e,null)},TronWebProto.Account.prototype.clearFreeAssetNetUsagev2Map=function(){return this.getFreeAssetNetUsagev2Map().clear(),this},TronWebProto.Account.prototype.getLatestConsumeTime=function(){return n.Message.getFieldWithDefault(this,21,0)},TronWebProto.Account.prototype.setLatestConsumeTime=function(e){return n.Message.setProto3IntField(this,21,e)},TronWebProto.Account.prototype.getLatestConsumeFreeTime=function(){return n.Message.getFieldWithDefault(this,22,0)},TronWebProto.Account.prototype.setLatestConsumeFreeTime=function(e){return n.Message.setProto3IntField(this,22,e)},TronWebProto.Account.prototype.getAccountId=function(){return n.Message.getFieldWithDefault(this,23,"")},TronWebProto.Account.prototype.getAccountId_asB64=function(){return n.Message.bytesAsB64(this.getAccountId())},TronWebProto.Account.prototype.getAccountId_asU8=function(){return n.Message.bytesAsU8(this.getAccountId())},TronWebProto.Account.prototype.setAccountId=function(e){return n.Message.setProto3BytesField(this,23,e)},TronWebProto.Account.prototype.getAccountResource=function(){return n.Message.getWrapperField(this,TronWebProto.Account.AccountResource,26)},TronWebProto.Account.prototype.setAccountResource=function(e){return n.Message.setWrapperField(this,26,e)},TronWebProto.Account.prototype.clearAccountResource=function(){return this.setAccountResource(void 0)},TronWebProto.Account.prototype.hasAccountResource=function(){return null!=n.Message.getField(this,26)},TronWebProto.Account.prototype.getCodehash=function(){return n.Message.getFieldWithDefault(this,30,"")},TronWebProto.Account.prototype.getCodehash_asB64=function(){return n.Message.bytesAsB64(this.getCodehash())},TronWebProto.Account.prototype.getCodehash_asU8=function(){return n.Message.bytesAsU8(this.getCodehash())},TronWebProto.Account.prototype.setCodehash=function(e){return n.Message.setProto3BytesField(this,30,e)},TronWebProto.Account.prototype.getOwnerPermission=function(){return n.Message.getWrapperField(this,TronWebProto.Permission,31)},TronWebProto.Account.prototype.setOwnerPermission=function(e){return n.Message.setWrapperField(this,31,e)},TronWebProto.Account.prototype.clearOwnerPermission=function(){return this.setOwnerPermission(void 0)},TronWebProto.Account.prototype.hasOwnerPermission=function(){return null!=n.Message.getField(this,31)},TronWebProto.Account.prototype.getWitnessPermission=function(){return n.Message.getWrapperField(this,TronWebProto.Permission,32)},TronWebProto.Account.prototype.setWitnessPermission=function(e){return n.Message.setWrapperField(this,32,e)},TronWebProto.Account.prototype.clearWitnessPermission=function(){return this.setWitnessPermission(void 0)},TronWebProto.Account.prototype.hasWitnessPermission=function(){return null!=n.Message.getField(this,32)},TronWebProto.Account.prototype.getActivePermissionList=function(){return n.Message.getRepeatedWrapperField(this,TronWebProto.Permission,33)},TronWebProto.Account.prototype.setActivePermissionList=function(e){return n.Message.setRepeatedWrapperField(this,33,e)},TronWebProto.Account.prototype.addActivePermission=function(e,t){return n.Message.addToRepeatedWrapperField(this,33,e,TronWebProto.Permission,t)},TronWebProto.Account.prototype.clearActivePermissionList=function(){return this.setActivePermissionList([])},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.Key.prototype.toObject=function(e){return TronWebProto.Key.toObject(e,this)},TronWebProto.Key.toObject=function(e,t){var r={address:t.getAddress_asB64(),weight:n.Message.getFieldWithDefault(t,2,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.Key.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.Key;return TronWebProto.Key.deserializeBinaryFromReader(r,t)},TronWebProto.Key.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setAddress(r);break;case 2:r=t.readInt64();e.setWeight(r);break;default:t.skipField()}}return e},TronWebProto.Key.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.Key.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.Key.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getAddress_asU8()).length>0&&t.writeBytes(1,r),0!==(r=e.getWeight())&&t.writeInt64(2,r)},TronWebProto.Key.prototype.getAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.Key.prototype.getAddress_asB64=function(){return n.Message.bytesAsB64(this.getAddress())},TronWebProto.Key.prototype.getAddress_asU8=function(){return n.Message.bytesAsU8(this.getAddress())},TronWebProto.Key.prototype.setAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.Key.prototype.getWeight=function(){return n.Message.getFieldWithDefault(this,2,0)},TronWebProto.Key.prototype.setWeight=function(e){return n.Message.setProto3IntField(this,2,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.DelegatedResource.prototype.toObject=function(e){return TronWebProto.DelegatedResource.toObject(e,this)},TronWebProto.DelegatedResource.toObject=function(e,t){var r={from:t.getFrom_asB64(),to:t.getTo_asB64(),frozenBalanceForBandwidth:n.Message.getFieldWithDefault(t,3,0),frozenBalanceForEnergy:n.Message.getFieldWithDefault(t,4,0),expireTimeForBandwidth:n.Message.getFieldWithDefault(t,5,0),expireTimeForEnergy:n.Message.getFieldWithDefault(t,6,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.DelegatedResource.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.DelegatedResource;return TronWebProto.DelegatedResource.deserializeBinaryFromReader(r,t)},TronWebProto.DelegatedResource.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setFrom(r);break;case 2:r=t.readBytes();e.setTo(r);break;case 3:r=t.readInt64();e.setFrozenBalanceForBandwidth(r);break;case 4:r=t.readInt64();e.setFrozenBalanceForEnergy(r);break;case 5:r=t.readInt64();e.setExpireTimeForBandwidth(r);break;case 6:r=t.readInt64();e.setExpireTimeForEnergy(r);break;default:t.skipField()}}return e},TronWebProto.DelegatedResource.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.DelegatedResource.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.DelegatedResource.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getFrom_asU8()).length>0&&t.writeBytes(1,r),(r=e.getTo_asU8()).length>0&&t.writeBytes(2,r),0!==(r=e.getFrozenBalanceForBandwidth())&&t.writeInt64(3,r),0!==(r=e.getFrozenBalanceForEnergy())&&t.writeInt64(4,r),0!==(r=e.getExpireTimeForBandwidth())&&t.writeInt64(5,r),0!==(r=e.getExpireTimeForEnergy())&&t.writeInt64(6,r)},TronWebProto.DelegatedResource.prototype.getFrom=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.DelegatedResource.prototype.getFrom_asB64=function(){return n.Message.bytesAsB64(this.getFrom())},TronWebProto.DelegatedResource.prototype.getFrom_asU8=function(){return n.Message.bytesAsU8(this.getFrom())},TronWebProto.DelegatedResource.prototype.setFrom=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.DelegatedResource.prototype.getTo=function(){return n.Message.getFieldWithDefault(this,2,"")},TronWebProto.DelegatedResource.prototype.getTo_asB64=function(){return n.Message.bytesAsB64(this.getTo())},TronWebProto.DelegatedResource.prototype.getTo_asU8=function(){return n.Message.bytesAsU8(this.getTo())},TronWebProto.DelegatedResource.prototype.setTo=function(e){return n.Message.setProto3BytesField(this,2,e)},TronWebProto.DelegatedResource.prototype.getFrozenBalanceForBandwidth=function(){return n.Message.getFieldWithDefault(this,3,0)},TronWebProto.DelegatedResource.prototype.setFrozenBalanceForBandwidth=function(e){return n.Message.setProto3IntField(this,3,e)},TronWebProto.DelegatedResource.prototype.getFrozenBalanceForEnergy=function(){return n.Message.getFieldWithDefault(this,4,0)},TronWebProto.DelegatedResource.prototype.setFrozenBalanceForEnergy=function(e){return n.Message.setProto3IntField(this,4,e)},TronWebProto.DelegatedResource.prototype.getExpireTimeForBandwidth=function(){return n.Message.getFieldWithDefault(this,5,0)},TronWebProto.DelegatedResource.prototype.setExpireTimeForBandwidth=function(e){return n.Message.setProto3IntField(this,5,e)},TronWebProto.DelegatedResource.prototype.getExpireTimeForEnergy=function(){return n.Message.getFieldWithDefault(this,6,0)},TronWebProto.DelegatedResource.prototype.setExpireTimeForEnergy=function(e){return n.Message.setProto3IntField(this,6,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.authority.prototype.toObject=function(e){return TronWebProto.authority.toObject(e,this)},TronWebProto.authority.toObject=function(e,t){var r,n={account:(r=t.getAccount())&&TronWebProto.AccountId.toObject(e,r),permissionName:t.getPermissionName_asB64()};return e&&(n.$jspbMessageInstance=t),n}),TronWebProto.authority.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.authority;return TronWebProto.authority.deserializeBinaryFromReader(r,t)},TronWebProto.authority.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=new TronWebProto.AccountId;t.readMessage(r,TronWebProto.AccountId.deserializeBinaryFromReader),e.setAccount(r);break;case 2:r=t.readBytes();e.setPermissionName(r);break;default:t.skipField()}}return e},TronWebProto.authority.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.authority.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.authority.serializeBinaryToWriter=function(e,t){var r=void 0;null!=(r=e.getAccount())&&t.writeMessage(1,r,TronWebProto.AccountId.serializeBinaryToWriter),(r=e.getPermissionName_asU8()).length>0&&t.writeBytes(2,r)},TronWebProto.authority.prototype.getAccount=function(){return n.Message.getWrapperField(this,TronWebProto.AccountId,1)},TronWebProto.authority.prototype.setAccount=function(e){return n.Message.setWrapperField(this,1,e)},TronWebProto.authority.prototype.clearAccount=function(){return this.setAccount(void 0)},TronWebProto.authority.prototype.hasAccount=function(){return null!=n.Message.getField(this,1)},TronWebProto.authority.prototype.getPermissionName=function(){return n.Message.getFieldWithDefault(this,2,"")},TronWebProto.authority.prototype.getPermissionName_asB64=function(){return n.Message.bytesAsB64(this.getPermissionName())},TronWebProto.authority.prototype.getPermissionName_asU8=function(){return n.Message.bytesAsU8(this.getPermissionName())},TronWebProto.authority.prototype.setPermissionName=function(e){return n.Message.setProto3BytesField(this,2,e)},TronWebProto.Permission.repeatedFields_=[7],n.Message.GENERATE_TO_OBJECT&&(TronWebProto.Permission.prototype.toObject=function(e){return TronWebProto.Permission.toObject(e,this)},TronWebProto.Permission.toObject=function(e,t){var r={type:n.Message.getFieldWithDefault(t,1,0),id:n.Message.getFieldWithDefault(t,2,0),permissionName:n.Message.getFieldWithDefault(t,3,""),threshold:n.Message.getFieldWithDefault(t,4,0),parentId:n.Message.getFieldWithDefault(t,5,0),operations:t.getOperations_asB64(),keysList:n.Message.toObjectList(t.getKeysList(),TronWebProto.Key.toObject,e)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.Permission.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.Permission;return TronWebProto.Permission.deserializeBinaryFromReader(r,t)},TronWebProto.Permission.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readEnum();e.setType(r);break;case 2:r=t.readInt32();e.setId(r);break;case 3:r=t.readString();e.setPermissionName(r);break;case 4:r=t.readInt64();e.setThreshold(r);break;case 5:r=t.readInt32();e.setParentId(r);break;case 6:r=t.readBytes();e.setOperations(r);break;case 7:r=new TronWebProto.Key;t.readMessage(r,TronWebProto.Key.deserializeBinaryFromReader),e.addKeys(r);break;default:t.skipField()}}return e},TronWebProto.Permission.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.Permission.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.Permission.serializeBinaryToWriter=function(e,t){var r=void 0;0!==(r=e.getType())&&t.writeEnum(1,r),0!==(r=e.getId())&&t.writeInt32(2,r),(r=e.getPermissionName()).length>0&&t.writeString(3,r),0!==(r=e.getThreshold())&&t.writeInt64(4,r),0!==(r=e.getParentId())&&t.writeInt32(5,r),(r=e.getOperations_asU8()).length>0&&t.writeBytes(6,r),(r=e.getKeysList()).length>0&&t.writeRepeatedMessage(7,r,TronWebProto.Key.serializeBinaryToWriter)},TronWebProto.Permission.PermissionType={OWNER:0,WITNESS:1,ACTIVE:2},TronWebProto.Permission.prototype.getType=function(){return n.Message.getFieldWithDefault(this,1,0)},TronWebProto.Permission.prototype.setType=function(e){return n.Message.setProto3EnumField(this,1,e)},TronWebProto.Permission.prototype.getId=function(){return n.Message.getFieldWithDefault(this,2,0)},TronWebProto.Permission.prototype.setId=function(e){return n.Message.setProto3IntField(this,2,e)},TronWebProto.Permission.prototype.getPermissionName=function(){return n.Message.getFieldWithDefault(this,3,"")},TronWebProto.Permission.prototype.setPermissionName=function(e){return n.Message.setProto3StringField(this,3,e)},TronWebProto.Permission.prototype.getThreshold=function(){return n.Message.getFieldWithDefault(this,4,0)},TronWebProto.Permission.prototype.setThreshold=function(e){return n.Message.setProto3IntField(this,4,e)},TronWebProto.Permission.prototype.getParentId=function(){return n.Message.getFieldWithDefault(this,5,0)},TronWebProto.Permission.prototype.setParentId=function(e){return n.Message.setProto3IntField(this,5,e)},TronWebProto.Permission.prototype.getOperations=function(){return n.Message.getFieldWithDefault(this,6,"")},TronWebProto.Permission.prototype.getOperations_asB64=function(){return n.Message.bytesAsB64(this.getOperations())},TronWebProto.Permission.prototype.getOperations_asU8=function(){return n.Message.bytesAsU8(this.getOperations())},TronWebProto.Permission.prototype.setOperations=function(e){return n.Message.setProto3BytesField(this,6,e)},TronWebProto.Permission.prototype.getKeysList=function(){return n.Message.getRepeatedWrapperField(this,TronWebProto.Key,7)},TronWebProto.Permission.prototype.setKeysList=function(e){return n.Message.setRepeatedWrapperField(this,7,e)},TronWebProto.Permission.prototype.addKeys=function(e,t){return n.Message.addToRepeatedWrapperField(this,7,e,TronWebProto.Key,t)},TronWebProto.Permission.prototype.clearKeysList=function(){return this.setKeysList([])},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.Witness.prototype.toObject=function(e){return TronWebProto.Witness.toObject(e,this)},TronWebProto.Witness.toObject=function(e,t){var r={address:t.getAddress_asB64(),votecount:n.Message.getFieldWithDefault(t,2,0),pubkey:t.getPubkey_asB64(),url:n.Message.getFieldWithDefault(t,4,""),totalproduced:n.Message.getFieldWithDefault(t,5,0),totalmissed:n.Message.getFieldWithDefault(t,6,0),latestblocknum:n.Message.getFieldWithDefault(t,7,0),latestslotnum:n.Message.getFieldWithDefault(t,8,0),isjobs:n.Message.getBooleanFieldWithDefault(t,9,!1)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.Witness.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.Witness;return TronWebProto.Witness.deserializeBinaryFromReader(r,t)},TronWebProto.Witness.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setAddress(r);break;case 2:r=t.readInt64();e.setVotecount(r);break;case 3:r=t.readBytes();e.setPubkey(r);break;case 4:r=t.readString();e.setUrl(r);break;case 5:r=t.readInt64();e.setTotalproduced(r);break;case 6:r=t.readInt64();e.setTotalmissed(r);break;case 7:r=t.readInt64();e.setLatestblocknum(r);break;case 8:r=t.readInt64();e.setLatestslotnum(r);break;case 9:r=t.readBool();e.setIsjobs(r);break;default:t.skipField()}}return e},TronWebProto.Witness.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.Witness.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.Witness.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getAddress_asU8()).length>0&&t.writeBytes(1,r),0!==(r=e.getVotecount())&&t.writeInt64(2,r),(r=e.getPubkey_asU8()).length>0&&t.writeBytes(3,r),(r=e.getUrl()).length>0&&t.writeString(4,r),0!==(r=e.getTotalproduced())&&t.writeInt64(5,r),0!==(r=e.getTotalmissed())&&t.writeInt64(6,r),0!==(r=e.getLatestblocknum())&&t.writeInt64(7,r),0!==(r=e.getLatestslotnum())&&t.writeInt64(8,r),(r=e.getIsjobs())&&t.writeBool(9,r)},TronWebProto.Witness.prototype.getAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.Witness.prototype.getAddress_asB64=function(){return n.Message.bytesAsB64(this.getAddress())},TronWebProto.Witness.prototype.getAddress_asU8=function(){return n.Message.bytesAsU8(this.getAddress())},TronWebProto.Witness.prototype.setAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.Witness.prototype.getVotecount=function(){return n.Message.getFieldWithDefault(this,2,0)},TronWebProto.Witness.prototype.setVotecount=function(e){return n.Message.setProto3IntField(this,2,e)},TronWebProto.Witness.prototype.getPubkey=function(){return n.Message.getFieldWithDefault(this,3,"")},TronWebProto.Witness.prototype.getPubkey_asB64=function(){return n.Message.bytesAsB64(this.getPubkey())},TronWebProto.Witness.prototype.getPubkey_asU8=function(){return n.Message.bytesAsU8(this.getPubkey())},TronWebProto.Witness.prototype.setPubkey=function(e){return n.Message.setProto3BytesField(this,3,e)},TronWebProto.Witness.prototype.getUrl=function(){return n.Message.getFieldWithDefault(this,4,"")},TronWebProto.Witness.prototype.setUrl=function(e){return n.Message.setProto3StringField(this,4,e)},TronWebProto.Witness.prototype.getTotalproduced=function(){return n.Message.getFieldWithDefault(this,5,0)},TronWebProto.Witness.prototype.setTotalproduced=function(e){return n.Message.setProto3IntField(this,5,e)},TronWebProto.Witness.prototype.getTotalmissed=function(){return n.Message.getFieldWithDefault(this,6,0)},TronWebProto.Witness.prototype.setTotalmissed=function(e){return n.Message.setProto3IntField(this,6,e)},TronWebProto.Witness.prototype.getLatestblocknum=function(){return n.Message.getFieldWithDefault(this,7,0)},TronWebProto.Witness.prototype.setLatestblocknum=function(e){return n.Message.setProto3IntField(this,7,e)},TronWebProto.Witness.prototype.getLatestslotnum=function(){return n.Message.getFieldWithDefault(this,8,0)},TronWebProto.Witness.prototype.setLatestslotnum=function(e){return n.Message.setProto3IntField(this,8,e)},TronWebProto.Witness.prototype.getIsjobs=function(){return n.Message.getBooleanFieldWithDefault(this,9,!1)},TronWebProto.Witness.prototype.setIsjobs=function(e){return n.Message.setProto3BooleanField(this,9,e)},TronWebProto.Votes.repeatedFields_=[2,3],n.Message.GENERATE_TO_OBJECT&&(TronWebProto.Votes.prototype.toObject=function(e){return TronWebProto.Votes.toObject(e,this)},TronWebProto.Votes.toObject=function(e,t){var r={address:t.getAddress_asB64(),oldVotesList:n.Message.toObjectList(t.getOldVotesList(),TronWebProto.Vote.toObject,e),newVotesList:n.Message.toObjectList(t.getNewVotesList(),TronWebProto.Vote.toObject,e)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.Votes.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.Votes;return TronWebProto.Votes.deserializeBinaryFromReader(r,t)},TronWebProto.Votes.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setAddress(r);break;case 2:r=new TronWebProto.Vote;t.readMessage(r,TronWebProto.Vote.deserializeBinaryFromReader),e.addOldVotes(r);break;case 3:r=new TronWebProto.Vote;t.readMessage(r,TronWebProto.Vote.deserializeBinaryFromReader),e.addNewVotes(r);break;default:t.skipField()}}return e},TronWebProto.Votes.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.Votes.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.Votes.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getAddress_asU8()).length>0&&t.writeBytes(1,r),(r=e.getOldVotesList()).length>0&&t.writeRepeatedMessage(2,r,TronWebProto.Vote.serializeBinaryToWriter),(r=e.getNewVotesList()).length>0&&t.writeRepeatedMessage(3,r,TronWebProto.Vote.serializeBinaryToWriter)},TronWebProto.Votes.prototype.getAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.Votes.prototype.getAddress_asB64=function(){return n.Message.bytesAsB64(this.getAddress())},TronWebProto.Votes.prototype.getAddress_asU8=function(){return n.Message.bytesAsU8(this.getAddress())},TronWebProto.Votes.prototype.setAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.Votes.prototype.getOldVotesList=function(){return n.Message.getRepeatedWrapperField(this,TronWebProto.Vote,2)},TronWebProto.Votes.prototype.setOldVotesList=function(e){return n.Message.setRepeatedWrapperField(this,2,e)},TronWebProto.Votes.prototype.addOldVotes=function(e,t){return n.Message.addToRepeatedWrapperField(this,2,e,TronWebProto.Vote,t)},TronWebProto.Votes.prototype.clearOldVotesList=function(){return this.setOldVotesList([])},TronWebProto.Votes.prototype.getNewVotesList=function(){return n.Message.getRepeatedWrapperField(this,TronWebProto.Vote,3)},TronWebProto.Votes.prototype.setNewVotesList=function(e){return n.Message.setRepeatedWrapperField(this,3,e)},TronWebProto.Votes.prototype.addNewVotes=function(e,t){return n.Message.addToRepeatedWrapperField(this,3,e,TronWebProto.Vote,t)},TronWebProto.Votes.prototype.clearNewVotesList=function(){return this.setNewVotesList([])},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.MarketOrderDetail.prototype.toObject=function(e){return TronWebProto.MarketOrderDetail.toObject(e,this)},TronWebProto.MarketOrderDetail.toObject=function(e,t){var r={makerorderid:t.getMakerorderid_asB64(),takerorderid:t.getTakerorderid_asB64(),fillsellquantity:n.Message.getFieldWithDefault(t,3,0),fillbuyquantity:n.Message.getFieldWithDefault(t,4,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.MarketOrderDetail.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.MarketOrderDetail;return TronWebProto.MarketOrderDetail.deserializeBinaryFromReader(r,t)},TronWebProto.MarketOrderDetail.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setMakerorderid(r);break;case 2:r=t.readBytes();e.setTakerorderid(r);break;case 3:r=t.readInt64();e.setFillsellquantity(r);break;case 4:r=t.readInt64();e.setFillbuyquantity(r);break;default:t.skipField()}}return e},TronWebProto.MarketOrderDetail.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.MarketOrderDetail.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.MarketOrderDetail.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getMakerorderid_asU8()).length>0&&t.writeBytes(1,r),(r=e.getTakerorderid_asU8()).length>0&&t.writeBytes(2,r),0!==(r=e.getFillsellquantity())&&t.writeInt64(3,r),0!==(r=e.getFillbuyquantity())&&t.writeInt64(4,r)},TronWebProto.MarketOrderDetail.prototype.getMakerorderid=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.MarketOrderDetail.prototype.getMakerorderid_asB64=function(){return n.Message.bytesAsB64(this.getMakerorderid())},TronWebProto.MarketOrderDetail.prototype.getMakerorderid_asU8=function(){return n.Message.bytesAsU8(this.getMakerorderid())},TronWebProto.MarketOrderDetail.prototype.setMakerorderid=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.MarketOrderDetail.prototype.getTakerorderid=function(){return n.Message.getFieldWithDefault(this,2,"")},TronWebProto.MarketOrderDetail.prototype.getTakerorderid_asB64=function(){return n.Message.bytesAsB64(this.getTakerorderid())},TronWebProto.MarketOrderDetail.prototype.getTakerorderid_asU8=function(){return n.Message.bytesAsU8(this.getTakerorderid())},TronWebProto.MarketOrderDetail.prototype.setTakerorderid=function(e){return n.Message.setProto3BytesField(this,2,e)},TronWebProto.MarketOrderDetail.prototype.getFillsellquantity=function(){return n.Message.getFieldWithDefault(this,3,0)},TronWebProto.MarketOrderDetail.prototype.setFillsellquantity=function(e){return n.Message.setProto3IntField(this,3,e)},TronWebProto.MarketOrderDetail.prototype.getFillbuyquantity=function(){return n.Message.getFieldWithDefault(this,4,0)},TronWebProto.MarketOrderDetail.prototype.setFillbuyquantity=function(e){return n.Message.setProto3IntField(this,4,e)},TronWebProto.Transaction.repeatedFields_=[2,5],n.Message.GENERATE_TO_OBJECT&&(TronWebProto.Transaction.prototype.toObject=function(e){return TronWebProto.Transaction.toObject(e,this)},TronWebProto.Transaction.toObject=function(e,t){var r,o={rawData:(r=t.getRawData())&&TronWebProto.Transaction.raw.toObject(e,r),signatureList:t.getSignatureList_asB64(),retList:n.Message.toObjectList(t.getRetList(),TronWebProto.Transaction.Result.toObject,e)};return e&&(o.$jspbMessageInstance=t),o}),TronWebProto.Transaction.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.Transaction;return TronWebProto.Transaction.deserializeBinaryFromReader(r,t)},TronWebProto.Transaction.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=new TronWebProto.Transaction.raw;t.readMessage(r,TronWebProto.Transaction.raw.deserializeBinaryFromReader),e.setRawData(r);break;case 2:r=t.readBytes();e.addSignature(r);break;case 5:r=new TronWebProto.Transaction.Result;t.readMessage(r,TronWebProto.Transaction.Result.deserializeBinaryFromReader),e.addRet(r);break;default:t.skipField()}}return e},TronWebProto.Transaction.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.Transaction.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.Transaction.serializeBinaryToWriter=function(e,t){var r=void 0;null!=(r=e.getRawData())&&t.writeMessage(1,r,TronWebProto.Transaction.raw.serializeBinaryToWriter),(r=e.getSignatureList_asU8()).length>0&&t.writeRepeatedBytes(2,r),(r=e.getRetList()).length>0&&t.writeRepeatedMessage(5,r,TronWebProto.Transaction.Result.serializeBinaryToWriter)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.Transaction.Contract.prototype.toObject=function(e){return TronWebProto.Transaction.Contract.toObject(e,this)},TronWebProto.Transaction.Contract.toObject=function(e,t){var r,o={type:n.Message.getFieldWithDefault(t,1,0),parameter:(r=t.getParameter())&&i.Any.toObject(e,r),provider:t.getProvider_asB64(),contractname:t.getContractname_asB64(),permissionId:n.Message.getFieldWithDefault(t,5,0)};return e&&(o.$jspbMessageInstance=t),o}),TronWebProto.Transaction.Contract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.Transaction.Contract;return TronWebProto.Transaction.Contract.deserializeBinaryFromReader(r,t)},TronWebProto.Transaction.Contract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readEnum();e.setType(r);break;case 2:r=new i.Any;t.readMessage(r,i.Any.deserializeBinaryFromReader),e.setParameter(r);break;case 3:r=t.readBytes();e.setProvider(r);break;case 4:r=t.readBytes();e.setContractname(r);break;case 5:r=t.readInt32();e.setPermissionId(r);break;default:t.skipField()}}return e},TronWebProto.Transaction.Contract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.Transaction.Contract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.Transaction.Contract.serializeBinaryToWriter=function(e,t){var r=void 0;0!==(r=e.getType())&&t.writeEnum(1,r),null!=(r=e.getParameter())&&t.writeMessage(2,r,i.Any.serializeBinaryToWriter),(r=e.getProvider_asU8()).length>0&&t.writeBytes(3,r),(r=e.getContractname_asU8()).length>0&&t.writeBytes(4,r),0!==(r=e.getPermissionId())&&t.writeInt32(5,r)},TronWebProto.Transaction.Contract.ContractType={ACCOUNTCREATECONTRACT:0,TRANSFERCONTRACT:1,TRANSFERASSETCONTRACT:2,VOTEASSETCONTRACT:3,VOTEWITNESSCONTRACT:4,WITNESSCREATECONTRACT:5,ASSETISSUECONTRACT:6,WITNESSUPDATECONTRACT:8,PARTICIPATEASSETISSUECONTRACT:9,ACCOUNTUPDATECONTRACT:10,FREEZEBALANCECONTRACT:11,UNFREEZEBALANCECONTRACT:12,WITHDRAWBALANCECONTRACT:13,UNFREEZEASSETCONTRACT:14,UPDATEASSETCONTRACT:15,PROPOSALCREATECONTRACT:16,PROPOSALAPPROVECONTRACT:17,PROPOSALDELETECONTRACT:18,SETACCOUNTIDCONTRACT:19,CUSTOMCONTRACT:20,CREATESMARTCONTRACT:30,TRIGGERSMARTCONTRACT:31,GETCONTRACT:32,UPDATESETTINGCONTRACT:33,EXCHANGECREATECONTRACT:41,EXCHANGEINJECTCONTRACT:42,EXCHANGEWITHDRAWCONTRACT:43,EXCHANGETRANSACTIONCONTRACT:44,UPDATEENERGYLIMITCONTRACT:45,ACCOUNTPERMISSIONUPDATECONTRACT:46,CLEARABICONTRACT:48,UPDATEBROKERAGECONTRACT:49,SHIELDEDTRANSFERCONTRACT:51,MARKETSELLASSETCONTRACT:52,MARKETCANCELORDERCONTRACT:53,FREEZEBALANCEV2CONTRACT:54,UNFREEZEBALANCEV2CONTRACT:55,WITHDRAWEXPIREUNFREEZECONTRACT:56,DELEGATERESOURCECONTRACT:57,UNDELEGATERESOURCECONTRACT:58,CANCELALLUNFREEZEV2CONTRACT:59},TronWebProto.Transaction.Contract.prototype.getType=function(){return n.Message.getFieldWithDefault(this,1,0)},TronWebProto.Transaction.Contract.prototype.setType=function(e){return n.Message.setProto3EnumField(this,1,e)},TronWebProto.Transaction.Contract.prototype.getParameter=function(){return n.Message.getWrapperField(this,i.Any,2)},TronWebProto.Transaction.Contract.prototype.setParameter=function(e){return n.Message.setWrapperField(this,2,e)},TronWebProto.Transaction.Contract.prototype.clearParameter=function(){return this.setParameter(void 0)},TronWebProto.Transaction.Contract.prototype.hasParameter=function(){return null!=n.Message.getField(this,2)},TronWebProto.Transaction.Contract.prototype.getProvider=function(){return n.Message.getFieldWithDefault(this,3,"")},TronWebProto.Transaction.Contract.prototype.getProvider_asB64=function(){return n.Message.bytesAsB64(this.getProvider())},TronWebProto.Transaction.Contract.prototype.getProvider_asU8=function(){return n.Message.bytesAsU8(this.getProvider())},TronWebProto.Transaction.Contract.prototype.setProvider=function(e){return n.Message.setProto3BytesField(this,3,e)},TronWebProto.Transaction.Contract.prototype.getContractname=function(){return n.Message.getFieldWithDefault(this,4,"")},TronWebProto.Transaction.Contract.prototype.getContractname_asB64=function(){return n.Message.bytesAsB64(this.getContractname())},TronWebProto.Transaction.Contract.prototype.getContractname_asU8=function(){return n.Message.bytesAsU8(this.getContractname())},TronWebProto.Transaction.Contract.prototype.setContractname=function(e){return n.Message.setProto3BytesField(this,4,e)},TronWebProto.Transaction.Contract.prototype.getPermissionId=function(){return n.Message.getFieldWithDefault(this,5,0)},TronWebProto.Transaction.Contract.prototype.setPermissionId=function(e){return n.Message.setProto3IntField(this,5,e)},TronWebProto.Transaction.Result.repeatedFields_=[26],n.Message.GENERATE_TO_OBJECT&&(TronWebProto.Transaction.Result.prototype.toObject=function(e){return TronWebProto.Transaction.Result.toObject(e,this)},TronWebProto.Transaction.Result.toObject=function(e,t){var r={fee:n.Message.getFieldWithDefault(t,1,0),ret:n.Message.getFieldWithDefault(t,2,0),contractret:n.Message.getFieldWithDefault(t,3,0),assetissueid:n.Message.getFieldWithDefault(t,14,""),withdrawAmount:n.Message.getFieldWithDefault(t,15,0),unfreezeAmount:n.Message.getFieldWithDefault(t,16,0),exchangeReceivedAmount:n.Message.getFieldWithDefault(t,18,0),exchangeInjectAnotherAmount:n.Message.getFieldWithDefault(t,19,0),exchangeWithdrawAnotherAmount:n.Message.getFieldWithDefault(t,20,0),exchangeId:n.Message.getFieldWithDefault(t,21,0),shieldedTransactionFee:n.Message.getFieldWithDefault(t,22,0),orderid:t.getOrderid_asB64(),orderdetailsList:n.Message.toObjectList(t.getOrderdetailsList(),TronWebProto.MarketOrderDetail.toObject,e)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.Transaction.Result.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.Transaction.Result;return TronWebProto.Transaction.Result.deserializeBinaryFromReader(r,t)},TronWebProto.Transaction.Result.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readInt64();e.setFee(r);break;case 2:r=t.readEnum();e.setRet(r);break;case 3:r=t.readEnum();e.setContractret(r);break;case 14:r=t.readString();e.setAssetissueid(r);break;case 15:r=t.readInt64();e.setWithdrawAmount(r);break;case 16:r=t.readInt64();e.setUnfreezeAmount(r);break;case 18:r=t.readInt64();e.setExchangeReceivedAmount(r);break;case 19:r=t.readInt64();e.setExchangeInjectAnotherAmount(r);break;case 20:r=t.readInt64();e.setExchangeWithdrawAnotherAmount(r);break;case 21:r=t.readInt64();e.setExchangeId(r);break;case 22:r=t.readInt64();e.setShieldedTransactionFee(r);break;case 25:r=t.readBytes();e.setOrderid(r);break;case 26:r=new TronWebProto.MarketOrderDetail;t.readMessage(r,TronWebProto.MarketOrderDetail.deserializeBinaryFromReader),e.addOrderdetails(r);break;default:t.skipField()}}return e},TronWebProto.Transaction.Result.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.Transaction.Result.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.Transaction.Result.serializeBinaryToWriter=function(e,t){var r=void 0;0!==(r=e.getFee())&&t.writeInt64(1,r),0!==(r=e.getRet())&&t.writeEnum(2,r),0!==(r=e.getContractret())&&t.writeEnum(3,r),(r=e.getAssetissueid()).length>0&&t.writeString(14,r),0!==(r=e.getWithdrawAmount())&&t.writeInt64(15,r),0!==(r=e.getUnfreezeAmount())&&t.writeInt64(16,r),0!==(r=e.getExchangeReceivedAmount())&&t.writeInt64(18,r),0!==(r=e.getExchangeInjectAnotherAmount())&&t.writeInt64(19,r),0!==(r=e.getExchangeWithdrawAnotherAmount())&&t.writeInt64(20,r),0!==(r=e.getExchangeId())&&t.writeInt64(21,r),0!==(r=e.getShieldedTransactionFee())&&t.writeInt64(22,r),(r=e.getOrderid_asU8()).length>0&&t.writeBytes(25,r),(r=e.getOrderdetailsList()).length>0&&t.writeRepeatedMessage(26,r,TronWebProto.MarketOrderDetail.serializeBinaryToWriter)},TronWebProto.Transaction.Result.code={SUCESS:0,FAILED:1},TronWebProto.Transaction.Result.contractResult={DEFAULT:0,SUCCESS:1,REVERT:2,BAD_JUMP_DESTINATION:3,OUT_OF_MEMORY:4,PRECOMPILED_CONTRACT:5,STACK_TOO_SMALL:6,STACK_TOO_LARGE:7,ILLEGAL_OPERATION:8,STACK_OVERFLOW:9,OUT_OF_ENERGY:10,OUT_OF_TIME:11,JVM_STACK_OVER_FLOW:12,UNKNOWN:13,TRANSFER_FAILED:14,INVALID_CODE:15},TronWebProto.Transaction.Result.prototype.getFee=function(){return n.Message.getFieldWithDefault(this,1,0)},TronWebProto.Transaction.Result.prototype.setFee=function(e){return n.Message.setProto3IntField(this,1,e)},TronWebProto.Transaction.Result.prototype.getRet=function(){return n.Message.getFieldWithDefault(this,2,0)},TronWebProto.Transaction.Result.prototype.setRet=function(e){return n.Message.setProto3EnumField(this,2,e)},TronWebProto.Transaction.Result.prototype.getContractret=function(){return n.Message.getFieldWithDefault(this,3,0)},TronWebProto.Transaction.Result.prototype.setContractret=function(e){return n.Message.setProto3EnumField(this,3,e)},TronWebProto.Transaction.Result.prototype.getAssetissueid=function(){return n.Message.getFieldWithDefault(this,14,"")},TronWebProto.Transaction.Result.prototype.setAssetissueid=function(e){return n.Message.setProto3StringField(this,14,e)},TronWebProto.Transaction.Result.prototype.getWithdrawAmount=function(){return n.Message.getFieldWithDefault(this,15,0)},TronWebProto.Transaction.Result.prototype.setWithdrawAmount=function(e){return n.Message.setProto3IntField(this,15,e)},TronWebProto.Transaction.Result.prototype.getUnfreezeAmount=function(){return n.Message.getFieldWithDefault(this,16,0)},TronWebProto.Transaction.Result.prototype.setUnfreezeAmount=function(e){return n.Message.setProto3IntField(this,16,e)},TronWebProto.Transaction.Result.prototype.getExchangeReceivedAmount=function(){return n.Message.getFieldWithDefault(this,18,0)},TronWebProto.Transaction.Result.prototype.setExchangeReceivedAmount=function(e){return n.Message.setProto3IntField(this,18,e)},TronWebProto.Transaction.Result.prototype.getExchangeInjectAnotherAmount=function(){return n.Message.getFieldWithDefault(this,19,0)},TronWebProto.Transaction.Result.prototype.setExchangeInjectAnotherAmount=function(e){return n.Message.setProto3IntField(this,19,e)},TronWebProto.Transaction.Result.prototype.getExchangeWithdrawAnotherAmount=function(){return n.Message.getFieldWithDefault(this,20,0)},TronWebProto.Transaction.Result.prototype.setExchangeWithdrawAnotherAmount=function(e){return n.Message.setProto3IntField(this,20,e)},TronWebProto.Transaction.Result.prototype.getExchangeId=function(){return n.Message.getFieldWithDefault(this,21,0)},TronWebProto.Transaction.Result.prototype.setExchangeId=function(e){return n.Message.setProto3IntField(this,21,e)},TronWebProto.Transaction.Result.prototype.getShieldedTransactionFee=function(){return n.Message.getFieldWithDefault(this,22,0)},TronWebProto.Transaction.Result.prototype.setShieldedTransactionFee=function(e){return n.Message.setProto3IntField(this,22,e)},TronWebProto.Transaction.Result.prototype.getOrderid=function(){return n.Message.getFieldWithDefault(this,25,"")},TronWebProto.Transaction.Result.prototype.getOrderid_asB64=function(){return n.Message.bytesAsB64(this.getOrderid())},TronWebProto.Transaction.Result.prototype.getOrderid_asU8=function(){return n.Message.bytesAsU8(this.getOrderid())},TronWebProto.Transaction.Result.prototype.setOrderid=function(e){return n.Message.setProto3BytesField(this,25,e)},TronWebProto.Transaction.Result.prototype.getOrderdetailsList=function(){return n.Message.getRepeatedWrapperField(this,TronWebProto.MarketOrderDetail,26)},TronWebProto.Transaction.Result.prototype.setOrderdetailsList=function(e){return n.Message.setRepeatedWrapperField(this,26,e)},TronWebProto.Transaction.Result.prototype.addOrderdetails=function(e,t){return n.Message.addToRepeatedWrapperField(this,26,e,TronWebProto.MarketOrderDetail,t)},TronWebProto.Transaction.Result.prototype.clearOrderdetailsList=function(){return this.setOrderdetailsList([])},TronWebProto.Transaction.raw.repeatedFields_=[9,11],n.Message.GENERATE_TO_OBJECT&&(TronWebProto.Transaction.raw.prototype.toObject=function(e){return TronWebProto.Transaction.raw.toObject(e,this)},TronWebProto.Transaction.raw.toObject=function(e,t){var r={refBlockBytes:t.getRefBlockBytes_asB64(),refBlockNum:n.Message.getFieldWithDefault(t,3,0),refBlockHash:t.getRefBlockHash_asB64(),expiration:n.Message.getFieldWithDefault(t,8,0),authsList:n.Message.toObjectList(t.getAuthsList(),TronWebProto.authority.toObject,e),data:t.getData_asB64(),contractList:n.Message.toObjectList(t.getContractList(),TronWebProto.Transaction.Contract.toObject,e),scripts:t.getScripts_asB64(),timestamp:n.Message.getFieldWithDefault(t,14,0),feeLimit:n.Message.getFieldWithDefault(t,18,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.Transaction.raw.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.Transaction.raw;return TronWebProto.Transaction.raw.deserializeBinaryFromReader(r,t)},TronWebProto.Transaction.raw.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setRefBlockBytes(r);break;case 3:r=t.readInt64();e.setRefBlockNum(r);break;case 4:r=t.readBytes();e.setRefBlockHash(r);break;case 8:r=t.readInt64();e.setExpiration(r);break;case 9:r=new TronWebProto.authority;t.readMessage(r,TronWebProto.authority.deserializeBinaryFromReader),e.addAuths(r);break;case 10:r=t.readBytes();e.setData(r);break;case 11:r=new TronWebProto.Transaction.Contract;t.readMessage(r,TronWebProto.Transaction.Contract.deserializeBinaryFromReader),e.addContract(r);break;case 12:r=t.readBytes();e.setScripts(r);break;case 14:r=t.readInt64();e.setTimestamp(r);break;case 18:r=t.readInt64();e.setFeeLimit(r);break;default:t.skipField()}}return e},TronWebProto.Transaction.raw.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.Transaction.raw.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.Transaction.raw.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getRefBlockBytes_asU8()).length>0&&t.writeBytes(1,r),0!==(r=e.getRefBlockNum())&&t.writeInt64(3,r),(r=e.getRefBlockHash_asU8()).length>0&&t.writeBytes(4,r),0!==(r=e.getExpiration())&&t.writeInt64(8,r),(r=e.getAuthsList()).length>0&&t.writeRepeatedMessage(9,r,TronWebProto.authority.serializeBinaryToWriter),(r=e.getData_asU8()).length>0&&t.writeBytes(10,r),(r=e.getContractList()).length>0&&t.writeRepeatedMessage(11,r,TronWebProto.Transaction.Contract.serializeBinaryToWriter),(r=e.getScripts_asU8()).length>0&&t.writeBytes(12,r),0!==(r=e.getTimestamp())&&t.writeInt64(14,r),0!==(r=e.getFeeLimit())&&t.writeInt64(18,r)},TronWebProto.Transaction.raw.prototype.getRefBlockBytes=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.Transaction.raw.prototype.getRefBlockBytes_asB64=function(){return n.Message.bytesAsB64(this.getRefBlockBytes())},TronWebProto.Transaction.raw.prototype.getRefBlockBytes_asU8=function(){return n.Message.bytesAsU8(this.getRefBlockBytes())},TronWebProto.Transaction.raw.prototype.setRefBlockBytes=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.Transaction.raw.prototype.getRefBlockNum=function(){return n.Message.getFieldWithDefault(this,3,0)},TronWebProto.Transaction.raw.prototype.setRefBlockNum=function(e){return n.Message.setProto3IntField(this,3,e)},TronWebProto.Transaction.raw.prototype.getRefBlockHash=function(){return n.Message.getFieldWithDefault(this,4,"")},TronWebProto.Transaction.raw.prototype.getRefBlockHash_asB64=function(){return n.Message.bytesAsB64(this.getRefBlockHash())},TronWebProto.Transaction.raw.prototype.getRefBlockHash_asU8=function(){return n.Message.bytesAsU8(this.getRefBlockHash())},TronWebProto.Transaction.raw.prototype.setRefBlockHash=function(e){return n.Message.setProto3BytesField(this,4,e)},TronWebProto.Transaction.raw.prototype.getExpiration=function(){return n.Message.getFieldWithDefault(this,8,0)},TronWebProto.Transaction.raw.prototype.setExpiration=function(e){return n.Message.setProto3IntField(this,8,e)},TronWebProto.Transaction.raw.prototype.getAuthsList=function(){return n.Message.getRepeatedWrapperField(this,TronWebProto.authority,9)},TronWebProto.Transaction.raw.prototype.setAuthsList=function(e){return n.Message.setRepeatedWrapperField(this,9,e)},TronWebProto.Transaction.raw.prototype.addAuths=function(e,t){return n.Message.addToRepeatedWrapperField(this,9,e,TronWebProto.authority,t)},TronWebProto.Transaction.raw.prototype.clearAuthsList=function(){return this.setAuthsList([])},TronWebProto.Transaction.raw.prototype.getData=function(){return n.Message.getFieldWithDefault(this,10,"")},TronWebProto.Transaction.raw.prototype.getData_asB64=function(){return n.Message.bytesAsB64(this.getData())},TronWebProto.Transaction.raw.prototype.getData_asU8=function(){return n.Message.bytesAsU8(this.getData())},TronWebProto.Transaction.raw.prototype.setData=function(e){return n.Message.setProto3BytesField(this,10,e)},TronWebProto.Transaction.raw.prototype.getContractList=function(){return n.Message.getRepeatedWrapperField(this,TronWebProto.Transaction.Contract,11)},TronWebProto.Transaction.raw.prototype.setContractList=function(e){return n.Message.setRepeatedWrapperField(this,11,e)},TronWebProto.Transaction.raw.prototype.addContract=function(e,t){return n.Message.addToRepeatedWrapperField(this,11,e,TronWebProto.Transaction.Contract,t)},TronWebProto.Transaction.raw.prototype.clearContractList=function(){return this.setContractList([])},TronWebProto.Transaction.raw.prototype.getScripts=function(){return n.Message.getFieldWithDefault(this,12,"")},TronWebProto.Transaction.raw.prototype.getScripts_asB64=function(){return n.Message.bytesAsB64(this.getScripts())},TronWebProto.Transaction.raw.prototype.getScripts_asU8=function(){return n.Message.bytesAsU8(this.getScripts())},TronWebProto.Transaction.raw.prototype.setScripts=function(e){return n.Message.setProto3BytesField(this,12,e)},TronWebProto.Transaction.raw.prototype.getTimestamp=function(){return n.Message.getFieldWithDefault(this,14,0)},TronWebProto.Transaction.raw.prototype.setTimestamp=function(e){return n.Message.setProto3IntField(this,14,e)},TronWebProto.Transaction.raw.prototype.getFeeLimit=function(){return n.Message.getFieldWithDefault(this,18,0)},TronWebProto.Transaction.raw.prototype.setFeeLimit=function(e){return n.Message.setProto3IntField(this,18,e)},TronWebProto.Transaction.prototype.getRawData=function(){return n.Message.getWrapperField(this,TronWebProto.Transaction.raw,1)},TronWebProto.Transaction.prototype.setRawData=function(e){return n.Message.setWrapperField(this,1,e)},TronWebProto.Transaction.prototype.clearRawData=function(){return this.setRawData(void 0)},TronWebProto.Transaction.prototype.hasRawData=function(){return null!=n.Message.getField(this,1)},TronWebProto.Transaction.prototype.getSignatureList=function(){return n.Message.getRepeatedField(this,2)},TronWebProto.Transaction.prototype.getSignatureList_asB64=function(){return n.Message.bytesListAsB64(this.getSignatureList())},TronWebProto.Transaction.prototype.getSignatureList_asU8=function(){return n.Message.bytesListAsU8(this.getSignatureList())},TronWebProto.Transaction.prototype.setSignatureList=function(e){return n.Message.setField(this,2,e||[])},TronWebProto.Transaction.prototype.addSignature=function(e,t){return n.Message.addToRepeatedField(this,2,e,t)},TronWebProto.Transaction.prototype.clearSignatureList=function(){return this.setSignatureList([])},TronWebProto.Transaction.prototype.getRetList=function(){return n.Message.getRepeatedWrapperField(this,TronWebProto.Transaction.Result,5)},TronWebProto.Transaction.prototype.setRetList=function(e){return n.Message.setRepeatedWrapperField(this,5,e)},TronWebProto.Transaction.prototype.addRet=function(e,t){return n.Message.addToRepeatedWrapperField(this,5,e,TronWebProto.Transaction.Result,t)},TronWebProto.Transaction.prototype.clearRetList=function(){return this.setRetList([])},TronWebProto.AccountType={NORMAL:0,ASSETISSUE:1,CONTRACT:2},o.object.extend(t,TronWebProto)},"./node_modules/tronweb/lib/esm/protocol/core/contract/account_contract_pb.cjs"(e,t,r){var n=r("./node_modules/google-protobuf/google-protobuf.js"),o=n,s="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof window&&window||void 0!==s&&s||"undefined"!=typeof self&&self||function(){return this}.call(null)||Function("return this")(),i=r("./node_modules/tronweb/lib/esm/protocol/core/Tron_pb.cjs");o.object.extend(proto,i),o.exportSymbol("TronWebProto.AccountCreateContract",null,s),o.exportSymbol("TronWebProto.AccountPermissionUpdateContract",null,s),o.exportSymbol("TronWebProto.AccountUpdate
2Contract",null,s),o.exportSymbol("TronWebProto.SetAccountIdContract",null,s),TronWebProto.AccountCreateContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.AccountCreateContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.AccountCreateContract.displayName="TronWebProto.AccountCreateContract"),TronWebProto.AccountUpdateContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.AccountUpdateContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.AccountUpdateContract.displayName="TronWebProto.AccountUpdateContract"),TronWebProto.SetAccountIdContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.SetAccountIdContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.SetAccountIdContract.displayName="TronWebProto.SetAccountIdContract"),TronWebProto.AccountPermissionUpdateContract=function(e){n.Message.initialize(this,e,0,-1,TronWebProto.AccountPermissionUpdateContract.repeatedFields_,null)},o.inherits(TronWebProto.AccountPermissionUpdateContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.AccountPermissionUpdateContract.displayName="TronWebProto.AccountPermissionUpdateContract"),n.Message.GENERATE_TO_OBJECT&&(TronWebProto.AccountCreateContract.prototype.toObject=function(e){return TronWebProto.AccountCreateContract.toObject(e,this)},TronWebProto.AccountCreateContract.toObject=function(e,t){var r={ownerAddress:t.getOwnerAddress_asB64(),accountAddress:t.getAccountAddress_asB64(),type:n.Message.getFieldWithDefault(t,3,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.AccountCreateContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.AccountCreateContract;return TronWebProto.AccountCreateContract.deserializeBinaryFromReader(r,t)},TronWebProto.AccountCreateContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setOwnerAddress(r);break;case 2:r=t.readBytes();e.setAccountAddress(r);break;case 3:r=t.readEnum();e.setType(r);break;default:t.skipField()}}return e},TronWebProto.AccountCreateContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.AccountCreateContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.AccountCreateContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r),(r=e.getAccountAddress_asU8()).length>0&&t.writeBytes(2,r),0!==(r=e.getType())&&t.writeEnum(3,r)},TronWebProto.AccountCreateContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.AccountCreateContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.AccountCreateContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.AccountCreateContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.AccountCreateContract.prototype.getAccountAddress=function(){return n.Message.getFieldWithDefault(this,2,"")},TronWebProto.AccountCreateContract.prototype.getAccountAddress_asB64=function(){return n.Message.bytesAsB64(this.getAccountAddress())},TronWebProto.AccountCreateContract.prototype.getAccountAddress_asU8=function(){return n.Message.bytesAsU8(this.getAccountAddress())},TronWebProto.AccountCreateContract.prototype.setAccountAddress=function(e){return n.Message.setProto3BytesField(this,2,e)},TronWebProto.AccountCreateContract.prototype.getType=function(){return n.Message.getFieldWithDefault(this,3,0)},TronWebProto.AccountCreateContract.prototype.setType=function(e){return n.Message.setProto3EnumField(this,3,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.AccountUpdateContract.prototype.toObject=function(e){return TronWebProto.AccountUpdateContract.toObject(e,this)},TronWebProto.AccountUpdateContract.toObject=function(e,t){var r={accountName:t.getAccountName_asB64(),ownerAddress:t.getOwnerAddress_asB64()};return e&&(r.$jspbMessageInstance=t),r}
vendor: 72,000 bytes, line 2
2),TronWebProto.AccountUpdateContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.AccountUpdateContract;return TronWebProto.AccountUpdateContract.deserializeBinaryFromReader(r,t)},TronWebProto.AccountUpdateContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setAccountName(r);break;case 2:r=t.readBytes();e.setOwnerAddress(r);break;default:t.skipField()}}return e},TronWebProto.AccountUpdateContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.AccountUpdateContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.AccountUpdateContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getAccountName_asU8()).length>0&&t.writeBytes(1,r),(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(2,r)},TronWebProto.AccountUpdateContract.prototype.getAccountName=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.AccountUpdateContract.prototype.getAccountName_asB64=function(){return n.Message.bytesAsB64(this.getAccountName())},TronWebProto.AccountUpdateContract.prototype.getAccountName_asU8=function(){return n.Message.bytesAsU8(this.getAccountName())},TronWebProto.AccountUpdateContract.prototype.setAccountName=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.AccountUpdateContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,2,"")},TronWebProto.AccountUpdateContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.AccountUpdateContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.AccountUpdateContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,2,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.SetAccountIdContract.prototype.toObject=function(e){return TronWebProto.SetAccountIdContract.toObject(e,this)},TronWebProto.SetAccountIdContract.toObject=function(e,t){var r={accountId:t.getAccountId_asB64(),ownerAddress:t.getOwnerAddress_asB64()};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.SetAccountIdContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.SetAccountIdContract;return TronWebProto.SetAccountIdContract.deserializeBinaryFromReader(r,t)},TronWebProto.SetAccountIdContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setAccountId(r);break;case 2:r=t.readBytes();e.setOwnerAddress(r);break;default:t.skipField()}}return e},TronWebProto.SetAccountIdContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.SetAccountIdContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.SetAccountIdContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getAccountId_asU8()).length>0&&t.writeBytes(1,r),(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(2,r)},TronWebProto.SetAccountIdContract.prototype.getAccountId=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.SetAccountIdContract.prototype.getAccountId_asB64=function(){return n.Message.bytesAsB64(this.getAccountId())},TronWebProto.SetAccountIdContract.prototype.getAccountId_asU8=function(){return n.Message.bytesAsU8(this.getAccountId())},TronWebProto.SetAccountIdContract.prototype.setAccountId=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.SetAccountIdContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,2,"")},TronWebProto.SetAccountIdContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.SetAccountIdContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.SetAccountIdContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,2,e)},TronWebProto.AccountPermissionUpdateContract.repeatedFields_=[4],n.Message.GENERATE_TO_OBJECT&&(TronWebProto.AccountPermissionUpdateContract.prototype.toObject=function(e){return TronWebProto.AccountPermissionUpdateContract.toObject(e,this)},TronWebProto.AccountPermissionUpdateContract.toObject=function(e,t){var r,o={ownerAddress:t.getOwnerAddress_asB64(),owner:(r=t.getOwner())&&i.Permission.toObject(e,r),witness:(r=t.getWitness())&&i.Permission.toObject(e,r),activesList:n.Message.toObjectList(t.getActivesList(),i.Permission.toObject,e)};return e&&(o.$jspbMessageInstance=t),o}),TronWebProto.AccountPermissionUpdateContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.AccountPermissionUpdateContract;return TronWebProto.AccountPermissionUpdateContract.deserializeBinaryFromReader(r,t)},TronWebProto.AccountPermissionUpdateContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setOwnerAddress(r);break;case 2:r=new i.Permission;t.readMessage(r,i.Permission.deserializeBinaryFromReader),e.setOwner(r);break;case 3:r=new i.Permission;t.readMessage(r,i.Permission.deserializeBinaryFromReader),e.setWitness(r);break;case 4:r=new i.Permission;t.readMessage(r,i.Permission.deserializeBinaryFromReader),e.addActives(r);break;default:t.skipField()}}return e},TronWebProto.AccountPermissionUpdateContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.AccountPermissionUpdateContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.AccountPermissionUpdateContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r),null!=(r=e.getOwner())&&t.writeMessage(2,r,i.Permission.serializeBinaryToWriter),null!=(r=e.getWitness())&&t.writeMessage(3,r,i.Permission.serializeBinaryToWriter),(r=e.getActivesList()).length>0&&t.writeRepeatedMessage(4,r,i.Permission.serializeBinaryToWriter)},TronWebProto.AccountPermissionUpdateContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.AccountPermissionUpdateContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.AccountPermissionUpdateContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.AccountPermissionUpdateContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.AccountPermissionUpdateContract.prototype.getOwner=function(){return n.Message.getWrapperField(this,i.Permission,2)},TronWebProto.AccountPermissionUpdateContract.prototype.setOwner=function(e){return n.Message.setWrapperField(this,2,e)},TronWebProto.AccountPermissionUpdateContract.prototype.clearOwner=function(){return this.setOwner(void 0)},TronWebProto.AccountPermissionUpdateContract.prototype.hasOwner=function(){return null!=n.Message.getField(this,2)},TronWebProto.AccountPermissionUpdateContract.prototype.getWitness=function(){return n.Message.getWrapperField(this,i.Permission,3)},TronWebProto.AccountPermissionUpdateContract.prototype.setWitness=function(e){return n.Message.setWrapperField(this,3,e)},TronWebProto.AccountPermissionUpdateContract.prototype.clearWitness=function(){return this.setWitness(void 0)},TronWebProto.AccountPermissionUpdateContract.prototype.hasWitness=function(){return null!=n.Message.getField(this,3)},TronWebProto.AccountPermissionUpdateContract.prototype.getActivesList=function(){return n.Message.getRepeatedWrapperField(this,i.Permission,4)},TronWebProto.AccountPermissionUpdateContract.prototype.setActivesList=function(e){return n.Message.setRepeatedWrapperField(this,4,e)},TronWebProto.AccountPermissionUpdateContract.prototype.addActives=function(e,t){return n.Message.addToRepeatedWrapperField(this,4,e,TronWebProto.Permission,t)},TronWebProto.AccountPermissionUpdateContract.prototype.clearActivesList=function(){return this.setActivesList([])},o.object.extend(t,TronWebProto)},"./node_modules/tronweb/lib/esm/protocol/core/contract/asset_issue_contract_pb.cjs"(e,t,r){var n=r("./node_modules/google-protobuf/google-protobuf.js"),o=n,s="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof window&&window||void 0!==s&&s||"undefined"!=typeof self&&self||function(){return this}.call(null)||Function("return this")();o.exportSymbol("TronWebProto.AssetIssueContract",null,s),o.exportSymbol("TronWebProto.AssetIssueContract.FrozenSupply",null,s),o.exportSymbol("TronWebProto.ParticipateAssetIssueContract",null,s),o.exportSymbol("TronWebProto.TransferAssetContract",null,s),o.exportSymbol("TronWebProto.UnfreezeAssetContract",null,s),o.exportSymbol("TronWebProto.UpdateAssetContract",null,s),TronWebProto.AssetIssueContract=function(e){n.Message.initialize(this,e,0,-1,TronWebProto.AssetIssueContract.repeatedFields_,null)},o.inherits(TronWebProto.AssetIssueContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.AssetIssueContract.displayName="TronWebProto.AssetIssueContract"),TronWebProto.AssetIssueContract.FrozenSupply=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.AssetIssueContract.FrozenSupply,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.AssetIssueContract.FrozenSupply.displayName="TronWebProto.AssetIssueContract.FrozenSupply"),TronWebProto.TransferAssetContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.TransferAssetContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.TransferAssetContract.displayName="TronWebProto.TransferAssetContract"),TronWebProto.UnfreezeAssetContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.UnfreezeAssetContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.UnfreezeAssetContract.displayName="TronWebProto.UnfreezeAssetContract"),TronWebProto.UpdateAssetContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.UpdateAssetContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.UpdateAssetContract.displayName="TronWebProto.UpdateAssetContract"),TronWebProto.ParticipateAssetIssueContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.ParticipateAssetIssueContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.ParticipateAssetIssueContract.displayName="TronWebProto.ParticipateAssetIssueContract"),TronWebProto.AssetIssueContract.repeatedFields_=[5],n.Message.GENERATE_TO_OBJECT&&(TronWebProto.AssetIssueContract.prototype.toObject=function(e){return TronWebProto.AssetIssueContract.toObject(e,this)},TronWebProto.AssetIssueContract.toObject=function(e,t){var r={id:n.Message.getFieldWithDefault(t,41,""),ownerAddress:t.getOwnerAddress_asB64(),name:t.getName_asB64(),abbr:t.getAbbr_asB64(),totalSupply:n.Message.getFieldWithDefault(t,4,0),frozenSupplyList:n.Message.toObjectList(t.getFrozenSupplyList(),TronWebProto.AssetIssueContract.FrozenSupply.toObject,e),trxNum:n.Message.getFieldWithDefault(t,6,0),precision:n.Message.getFieldWithDefault(t,7,0),num:n.Message.getFieldWithDefault(t,8,0),startTime:n.Message.getFieldWithDefault(t,9,0),endTime:n.Message.getFieldWithDefault(t,10,0),order:n.Message.getFieldWithDefault(t,11,0),voteScore:n.Message.getFieldWithDefault(t,16,0),description:t.getDescription_asB64(),url:t.getUrl_asB64(),freeAssetNetLimit:n.Message.getFieldWithDefault(t,22,0),publicFreeAssetNetLimit:n.Message.getFieldWithDefault(t,23,0),publicFreeAssetNetUsage:n.Message.getFieldWithDefault(t,24,0),publicLatestFreeNetTime:n.Message.getFieldWithDefault(t,25,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.AssetIssueContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.AssetIssueContract;return TronWebProto.AssetIssueContract.deserializeBinaryFromReader(r,t)},TronWebProto.AssetIssueContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 41:var r=t.readString();e.setId(r);break;case 1:r=t.readBytes();e.setOwnerAddress(r);break;case 2:r=t.readBytes();e.setName(r);break;case 3:r=t.readBytes();e.setAbbr(r);break;case 4:r=t.readInt64();e.setTotalSupply(r);break;case 5:r=new TronWebProto.AssetIssueContract.FrozenSupply;t.readMessage(r,TronWebProto.AssetIssueContract.FrozenSupply.deserializeBinaryFromReader),e.addFrozenSupply(r);break;case 6:r=t.readInt32();e.setTrxNum(r);break;case 7:r=t.readInt32();e.setPrecision(r);break;case 8:r=t.readInt32();e.setNum(r);break;case 9:r=t.readInt64();e.setStartTime(r);break;case 10:r=t.readInt64();e.setEndTime(r);break;case 11:r=t.readInt64();e.setOrder(r);break;case 16:r=t.readInt32();e.setVoteScore(r);break;case 20:r=t.readBytes();e.setDescription(r);break;case 21:r=t.readBytes();e.setUrl(r);break;case 22:r=t.readInt64();e.setFreeAssetNetLimit(r);break;case 23:r=t.readInt64();e.setPublicFreeAssetNetLimit(r);break;case 24:r=t.readInt64();e.setPublicFreeAssetNetUsage(r);break;case 25:r=t.readInt64();e.setPublicLatestFreeNetTime(r);break;default:t.skipField()}}return e},TronWebProto.AssetIssueContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.AssetIssueContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.AssetIssueContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getId()).length>0&&t.writeString(41,r),(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r),(r=e.getName_asU8()).length>0&&t.writeBytes(2,r),(r=e.getAbbr_asU8()).length>0&&t.writeBytes(3,r),0!==(r=e.getTotalSupply())&&t.writeInt64(4,r),(r=e.getFrozenSupplyList()).length>0&&t.writeRepeatedMessage(5,r,TronWebProto.AssetIssueContract.FrozenSupply.serializeBinaryToWriter),0!==(r=e.getTrxNum())&&t.writeInt32(6,r),0!==(r=e.getPrecision())&&t.writeInt32(7,r),0!==(r=e.getNum())&&t.writeInt32(8,r),0!==(r=e.getStartTime())&&t.writeInt64(9,r),0!==(r=e.getEndTime())&&t.writeInt64(10,r),0!==(r=e.getOrder())&&t.writeInt64(11,r),0!==(r=e.getVoteScore())&&t.writeInt32(16,r),(r=e.getDescription_asU8()).length>0&&t.writeBytes(20,r),(r=e.getUrl_asU8()).length>0&&t.writeBytes(21,r),0!==(r=e.getFreeAssetNetLimit())&&t.writeInt64(22,r),0!==(r=e.getPublicFreeAssetNetLimit())&&t.writeInt64(23,r),0!==(r=e.getPublicFreeAssetNetUsage())&&t.writeInt64(24,r),0!==(r=e.getPublicLatestFreeNetTime())&&t.writeInt64(25,r)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.AssetIssueContract.FrozenSupply.prototype.toObject=function(e){return TronWebProto.AssetIssueContract.FrozenSupply.toObject(e,this)},TronWebProto.AssetIssueContract.FrozenSupply.toObject=function(e,t){var r={frozenAmount:n.Message.getFieldWithDefault(t,1,0),frozenDays:n.Message.getFieldWithDefault(t,2,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.AssetIssueContract.FrozenSupply.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.AssetIssueContract.FrozenSupply;return TronWebProto.AssetIssueContract.FrozenSupply.deserializeBinaryFromReader(r,t)},TronWebProto.AssetIssueContract.FrozenSupply.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readInt64();e.setFrozenAmount(r);break;case 2:r=t.readInt64();e.setFrozenDays(r);break;default:t.skipField()}}return e},TronWebProto.AssetIssueContract.FrozenSupply.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.AssetIssueContract.FrozenSupply.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.AssetIssueContract.FrozenSupply.serializeBinaryToWriter=function(e,t){var r=void 0;0!==(r=e.getFrozenAmount())&&t.writeInt64(1,r),0!==(r=e.getFrozenDays())&&t.writeInt64(2,r)},TronWebProto.AssetIssueContract.FrozenSupply.prototype.getFrozenAmount=function(){return n.Message.getFieldWithDefault(this,1,0)},TronWebProto.AssetIssueContract.FrozenSupply.prototype.setFrozenAmount=function(e){return n.Message.setProto3IntField(this,1,e)},TronWebProto.AssetIssueContract.FrozenSupply.prototype.getFrozenDays=function(){return n.Message.getFieldWithDefault(this,2,0)},TronWebProto.AssetIssueContract.FrozenSupply.prototype.setFrozenDays=function(e){return n.Message.setProto3IntField(this,2,e)},TronWebProto.AssetIssueContract.prototype.getId=function(){return n.Message.getFieldWithDefault(this,41,"")},TronWebProto.AssetIssueContract.prototype.setId=function(e){return n.Message.setProto3StringField(this,41,e)},TronWebProto.AssetIssueContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.AssetIssueContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.AssetIssueContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.AssetIssueContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.AssetIssueContract.prototype.getName=function(){return n.Message.getFieldWithDefault(this,2,"")},TronWebProto.AssetIssueContract.prototype.getName_asB64=function(){return n.Message.bytesAsB64(this.getName())},TronWebProto.AssetIssueContract.prototype.getName_asU8=function(){return n.Message.bytesAsU8(this.getName())},TronWebProto.AssetIssueContract.prototype.setName=function(e){return n.Message.setProto3BytesField(this,2,e)},TronWebProto.AssetIssueContract.prototype.getAbbr=function(){return n.Message.getFieldWithDefault(this,3,"")},TronWebProto.AssetIssueContract.prototype.getAbbr_asB64=function(){return n.Message.bytesAsB64(this.getAbbr())},TronWebProto.AssetIssueContract.prototype.getAbbr_asU8=function(){return n.Message.bytesAsU8(this.getAbbr())},TronWebProto.AssetIssueContract.prototype.setAbbr=function(e){return n.Message.setProto3BytesField(this,3,e)},TronWebProto.AssetIssueContract.prototype.getTotalSupply=function(){return n.Message.getFieldWithDefault(this,4,0)},TronWebProto.AssetIssueContract.prototype.setTotalSupply=function(e){return n.Message.setProto3IntField(this,4,e)},TronWebProto.AssetIssueContract.prototype.getFrozenSupplyList=function(){return n.Message.getRepeatedWrapperField(this,TronWebProto.AssetIssueContract.FrozenSupply,5)},TronWebProto.AssetIssueContract.prototype.setFrozenSupplyList=function(e){return n.Message.setRepeatedWrapperField(this,5,e)},TronWebProto.AssetIssueContract.prototype.addFrozenSupply=function(e,t){return n.Message.addToRepeatedWrapperField(this,5,e,TronWebProto.AssetIssueContract.FrozenSupply,t)},TronWebProto.AssetIssueContract.prototype.clearFrozenSupplyList=function(){return this.setFrozenSupplyList([])},TronWebProto.AssetIssueContract.prototype.getTrxNum=function(){return n.Message.getFieldWithDefault(this,6,0)},TronWebProto.AssetIssueContract.prototype.setTrxNum=function(e){return n.Message.setProto3IntField(this,6,e)},TronWebProto.AssetIssueContract.prototype.getPrecision=function(){return n.Message.getFieldWithDefault(this,7,0)},TronWebProto.AssetIssueContract.prototype.setPrecision=function(e){return n.Message.setProto3IntField(this,7,e)},TronWebProto.AssetIssueContract.prototype.getNum=function(){return n.Message.getFieldWithDefault(this,8,0)},TronWebProto.AssetIssueContract.prototype.setNum=function(e){return n.Message.setProto3IntField(this,8,e)},TronWebProto.AssetIssueContract.prototype.getStartTime=function(){return n.Message.getFieldWithDefault(this,9,0)},TronWebProto.AssetIssueContract.prototype.setStartTime=function(e){return n.Message.setProto3IntField(this,9,e)},TronWebProto.AssetIssueContract.prototype.getEndTime=function(){return n.Message.getFieldWithDefault(this,10,0)},TronWebProto.AssetIssueContract.prototype.setEndTime=function(e){return n.Message.setProto3IntField(this,10,e)},TronWebProto.AssetIssueContract.prototype.getOrder=function(){return n.Message.getFieldWithDefault(this,11,0)},TronWebProto.AssetIssueContract.prototype.setOrder=function(e){return n.Message.setProto3IntField(this,11,e)},TronWebProto.AssetIssueContract.prototype.getVoteScore=function(){return n.Message.getFieldWithDefault(this,16,0)},TronWebProto.AssetIssueContract.prototype.setVoteScore=function(e){return n.Message.setProto3IntField(this,16,e)},TronWebProto.AssetIssueContract.prototype.getDescription=function(){return n.Message.getFieldWithDefault(this,20,"")},TronWebProto.AssetIssueContract.prototype.getDescription_asB64=function(){return n.Message.bytesAsB64(this.getDescription())},TronWebProto.AssetIssueContract.prototype.getDescription_asU8=function(){return n.Message.bytesAsU8(this.getDescription())},TronWebProto.AssetIssueContract.prototype.setDescription=function(e){return n.Message.setProto3BytesField(this,20,e)},TronWebProto.AssetIssueContract.prototype.getUrl=function(){return n.Message.getFieldWithDefault(this,21,"")},TronWebProto.AssetIssueContract.prototype.getUrl_asB64=function(){return n.Message.bytesAsB64(this.getUrl())},TronWebProto.AssetIssueContract.prototype.getUrl_asU8=function(){return n.Message.bytesAsU8(this.getUrl())},TronWebProto.AssetIssueContract.prototype.setUrl=function(e){return n.Message.setProto3BytesField(this,21,e)},TronWebProto.AssetIssueContract.prototype.getFreeAssetNetLimit=function(){return n.Message.getFieldWithDefault(this,22,0)},TronWebProto.AssetIssueContract.prototype.setFreeAssetNetLimit=function(e){return n.Message.setProto3IntField(this,22,e)},TronWebProto.AssetIssueContract.prototype.getPublicFreeAssetNetLimit=function(){return n.Message.getFieldWithDefault(this,23,0)},TronWebProto.AssetIssueContract.prototype.setPublicFreeAssetNetLimit=function(e){return n.Message.setProto3IntField(this,23,e)},TronWebProto.AssetIssueContract.prototype.getPublicFreeAssetNetUsage=function(){return n.Message.getFieldWithDefault(this,24,0)},TronWebProto.AssetIssueContract.prototype.setPublicFreeAssetNetUsage=function(e){return n.Message.setProto3IntField(this,24,e)},TronWebProto.AssetIssueContract.prototype.getPublicLatestFreeNetTime=function(){return n.Message.getFieldWithDefault(this,25,0)},TronWebProto.AssetIssueContract.prototype.setPublicLatestFreeNetTime=function(e){return n.Message.setProto3IntField(this,25,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.TransferAssetContract.prototype.toObject=function(e){return TronWebProto.TransferAssetContract.toObject(e,this)},TronWebProto.TransferAssetContract.toObject=function(e,t){var r={assetName:t.getAssetName_asB64(),ownerAddress:t.getOwnerAddress_asB64(),toAddress:t.getToAddress_asB64(),amount:n.Message.getFieldWithDefault(t,4,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.TransferAssetContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.TransferAssetContract;return TronWebProto.TransferAssetContract.deserializeBinaryFromReader(r,t)},TronWebProto.TransferAssetContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setAssetName(r);break;case 2:r=t.readBytes();e.setOwnerAddress(r);break;case 3:r=t.readBytes();e.setToAddress(r);break;case 4:r=t.readInt64();e.setAmount(r);break;default:t.skipField()}}return e},TronWebProto.TransferAssetContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.TransferAssetContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.TransferAssetContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getAssetName_asU8()).length>0&&t.writeBytes(1,r),(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(2,r),(r=e.getToAddress_asU8()).length>0&&t.writeBytes(3,r),0!==(r=e.getAmount())&&t.writeInt64(4,r)},TronWebProto.TransferAssetContract.prototype.getAssetName=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.TransferAssetContract.prototype.getAssetName_asB64=function(){return n.Message.bytesAsB64(this.getAssetName())},TronWebProto.TransferAssetContract.prototype.getAssetName_asU8=function(){return n.Message.bytesAsU8(this.getAssetName())},TronWebProto.TransferAssetContract.prototype.setAssetName=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.TransferAssetContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,2,"")},TronWebProto.TransferAssetContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.TransferAssetContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.TransferAssetContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,2,e)},TronWebProto.TransferAssetContract.prototype.getToAddress=function(){return n.Message.getFieldWithDefault(this,3,"")},TronWebProto.TransferAssetContract.prototype.getToAddress_asB64=function(){return n.Message.bytesAsB64(this.getToAddress())},TronWebProto.TransferAssetContract.prototype.getToAddress_asU8=function(){return n.Message.bytesAsU8(this.getToAddress())},TronWebProto.TransferAssetContract.prototype.setToAddress=function(e){return n.Message.setProto3BytesField(this,3,e)},TronWebProto.TransferAssetContract.prototype.getAmount=function(){return n.Message.getFieldWithDefault(this,4,0)},TronWebProto.TransferAssetContract.prototype.setAmount=function(e){return n.Message.setProto3IntField(this,4,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.UnfreezeAssetContract.prototype.toObject=function(e){return TronWebProto.UnfreezeAssetContract.toObject(e,this)},TronWebProto.UnfreezeAssetContract.toObject=function(e,t){var r={ownerAddress:t.getOwnerAddress_asB64()};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.UnfreezeAssetContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.UnfreezeAssetContract;return TronWebProto.UnfreezeAssetContract.deserializeBinaryFromReader(r,t)},TronWebProto.UnfreezeAssetContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){if(1===t.getFieldNumber()){var r=t.readBytes();e.setOwnerAddress(r)}else t.skipField()}return e},TronWebProto.UnfreezeAssetContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.UnfreezeAssetContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.UnfreezeAssetContract.serializeBinaryToWriter=function(e,t){var r;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r)},TronWebProto.UnfreezeAssetContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.UnfreezeAssetContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.UnfreezeAssetContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.UnfreezeAssetContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.UpdateAssetContract.prototype.toObject=function(e){return TronWebProto.UpdateAssetContract.toObject(e,this)},TronWebProto.UpdateAssetContract.toObject=function(e,t){var r={ownerAddress:t.getOwnerAddress_asB64(),description:t.getDescription_asB64(),url:t.getUrl_asB64(),newLimit:n.Message.getFieldWithDefault(t,4,0),newPublicLimit:n.Message.getFieldWithDefault(t,5,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.UpdateAssetContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.UpdateAssetContract;return TronWebProto.UpdateAssetContract.deserializeBinaryFromReader(r,t)},TronWebProto.UpdateAssetContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setOwnerAddress(r);break;case 2:r=t.readBytes();e.setDescription(r);break;case 3:r=t.readBytes();e.setUrl(r);break;case 4:r=t.readInt64();e.setNewLimit(r);break;case 5:r=t.readInt64();e.setNewPublicLimit(r);break;default:t.skipField()}}return e},TronWebProto.UpdateAssetContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.UpdateAssetContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.UpdateAssetContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r),(r=e.getDescription_asU8()).length>0&&t.writeBytes(2,r),(r=e.getUrl_asU8()).length>0&&t.writeBytes(3,r),0!==(r=e.getNewLimit())&&t.writeInt64(4,r),0!==(r=e.getNewPublicLimit())&&t.writeInt64(5,r)},TronWebProto.UpdateAssetContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.UpdateAssetContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.UpdateAssetContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.UpdateAssetContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.UpdateAssetContract.prototype.getDescription=function(){return n.Message.getFieldWithDefault(this,2,"")},TronWebProto.UpdateAssetContract.prototype.getDescription_asB64=function(){return n.Message.bytesAsB64(this.getDescription())},TronWebProto.UpdateAssetContract.prototype.getDescription_asU8=function(){return n.Message.bytesAsU8(this.getDescription())},TronWebProto.UpdateAssetContract.prototype.setDescription=function(e){return n.Message.setProto3BytesField(this,2,e)},TronWebProto.UpdateAssetContract.prototype.getUrl=function(){return n.Message.getFieldWithDefault(this,3,"")},TronWebProto.UpdateAssetContract.prototype.getUrl_asB64=function(){return n.Message.bytesAsB64(this.getUrl())},TronWebProto.UpdateAssetContract.prototype.getUrl_asU8=function(){return n.Message.bytesAsU8(this.getUrl())},TronWebProto.UpdateAssetContract.prototype.setUrl=function(e){return n.Message.setProto3BytesField(this,3,e)},TronWebProto.UpdateAssetContract.prototype.getNewLimit=function(){return n.Message.getFieldWithDefault(this,4,0)},TronWebProto.UpdateAssetContract.prototype.setNewLimit=function(e){return n.Message.setProto3IntField(this,4,e)},TronWebProto.UpdateAssetContract.prototype.getNewPublicLimit=function(){return n.Message.getFieldWithDefault(this,5,0)},TronWebProto.UpdateAssetContract.prototype.setNewPublicLimit=function(e){return n.Message.setProto3IntField(this,5,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.ParticipateAssetIssueContract.prototype.toObject=function(e){return TronWebProto.ParticipateAssetIssueContract.toObject(e,this)},TronWebProto.ParticipateAssetIssueContract.toObject=function(e,t){var r={ownerAddress:t.getOwnerAddress_asB64(),toAddress:t.getToAddress_asB64(),assetName:t.getAssetName_asB64(),amount:n.Message.getFieldWithDefault(t,4,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.ParticipateAssetIssueContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.ParticipateAssetIssueContract;return TronWebProto.ParticipateAssetIssueContract.deserializeBinaryFromReader(r,t)},TronWebProto.ParticipateAssetIssueContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setOwnerAddress(r);break;case 2:r=t.readBytes();e.setToAddress(r);break;case 3:r=t.readBytes();e.setAssetName(r);break;case 4:r=t.readInt64();e.setAmount(r);break;default:t.skipField()}}return e},TronWebProto.ParticipateAssetIssueContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.ParticipateAssetIssueContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.ParticipateAssetIssueContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r),(r=e.getToAddress_asU8()).length>0&&t.writeBytes(2,r),(r=e.getAssetName_asU8()).length>0&&t.writeBytes(3,r),0!==(r=e.getAmount())&&t.writeInt64(4,r)},TronWebProto.ParticipateAssetIssueContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.ParticipateAssetIssueContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.ParticipateAssetIssueContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.ParticipateAssetIssueContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.ParticipateAssetIssueContract.prototype.getToAddress=function(){return n.Message.getFieldWithDefault(this,2,"")},TronWebProto.ParticipateAssetIssueContract.prototype.getToAddress_asB64=function(){return n.Message.bytesAsB64(this.getToAddress())},TronWebProto.ParticipateAssetIssueContract.prototype.getToAddress_asU8=function(){return n.Message.bytesAsU8(this.getToAddress())},TronWebProto.ParticipateAssetIssueContract.prototype.setToAddress=function(e){return n.Message.setProto3BytesField(this,2,e)},TronWebProto.ParticipateAssetIssueContract.prototype.getAssetName=function(){return n.Message.getFieldWithDefault(this,3,"")},TronWebProto.ParticipateAssetIssueContract.prototype.getAssetName_asB64=function(){return n.Message.bytesAsB64(this.getAssetName())},TronWebProto.ParticipateAssetIssueContract.prototype.getAssetName_asU8=function(){return n.Message.bytesAsU8(this.getAssetName())},TronWebProto.ParticipateAssetIssueContract.prototype.setAssetName=function(e){return n.Message.setProto3BytesField(this,3,e)},TronWebProto.ParticipateAssetIssueContract.prototype.getAmount=function(){return n.Message.getFieldWithDefault(this,4,0)},TronWebProto.ParticipateAssetIssueContract.prototype.setAmount=function(e){return n.Message.setProto3IntField(this,4,e)},o.object.extend(t,TronWebProto)},"./node_modules/tronweb/lib/esm/protocol/core/contract/balance_contract_pb.cjs"(e,t,r){var n=r("./node_modules/google-protobuf/google-protobuf.js"),o=n,s="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof window&&window||void 0!==s&&s||"undefined"!=typeof self&&self||function(){return this}.call(null)||Function("return this")(),i=r("./node_modules/tronweb/lib/esm/protocol/core/contract/common_pb.cjs");o.object.extend(proto,i),o.exportSymbol("TronWebProto.AccountBalanceRequest",null,s),o.exportSymbol("TronWebProto.AccountBalanceResponse",null,s),o.exportSymbol("TronWebProto.AccountIdentifier",null,s),o.exportSymbol("TronWebProto.AccountTrace",null,s),o.exportSymbol("TronWebProto.BlockBalanceTrace",null,s),o.exportSymbol("TronWebProto.BlockBalanceTrace.BlockIdentifier",null,s),o.exportSymbol("TronWebProto.CancelAllUnfreezeV2Contract",null,s),o.exportSymbol("TronWebProto.DelegateResourceContract",null,s),o.exportSymbol("TronWebProto.FreezeBalanceContract",null,s),o.exportSymbol("TronWebProto.FreezeBalanceV2Contract",null,s),o.exportSymbol("TronWebProto.TransactionBalanceTrace",null,s),o.exportSymbol("TronWebProto.TransactionBalanceTrace.Operation",null,s),o.exportSymbol("TronWebProto.TransferContract",null,s),o.exportSymbol("TronWebProto.UnDelegateResourceContract",null,s),o.exportSymbol("TronWebProto.UnfreezeBalanceContract",null,s),o.exportSymbol("TronWebProto.UnfreezeBalanceV2Contract",null,s),o.exportSymbol("TronWebProto.WithdrawBalanceContract",null,s),o.exportSymbol("TronWebProto.WithdrawExpireUnfreezeContract",null,s),TronWebProto.FreezeBalanceContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.FreezeBalanceContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.FreezeBalanceContract.displayName="TronWebProto.FreezeBalanceContract"),TronWebProto.UnfreezeBalanceContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.UnfreezeBalanceContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.UnfreezeBalanceContract.displayName="TronWebProto.UnfreezeBalanceContract"),TronWebProto.WithdrawBalanceContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.WithdrawBalanceContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.WithdrawBalanceContract.displayName="TronWebProto.WithdrawBalanceContract"),TronWebProto.TransferContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.TransferContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.TransferContract.displayName="TronWebProto.TransferContract"),TronWebProto.TransactionBalanceTrace=function(e){n.Message.initialize(this,e,0,-1,TronWebProto.TransactionBalanceTrace.repeatedFields_,null)},o.inherits(TronWebProto.TransactionBalanceTrace,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.TransactionBalanceTrace.displayName="TronWebProto.TransactionBalanceTrace"),TronWebProto.TransactionBalanceTrace.Operation=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.TransactionBalanceTrace.Operation,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.TransactionBalanceTrace.Operation.displayName="TronWebProto.TransactionBalanceTrace.Operation"),TronWebProto.BlockBalanceTrace=function(e){n.Message.initialize(this,e,0,-1,TronWebProto.BlockBalanceTrace.repeatedFields_,null)},o.inherits(TronWebProto.BlockBalanceTrace,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.BlockBalanceTrace.displayName="TronWebProto.BlockBalanceTrace"),TronWebProto.BlockBalanceTrace.BlockIdentifier=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.BlockBalanceTrace.BlockIdentifier,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.BlockBalanceTrace.BlockIdentifier.displayName="TronWebProto.BlockBalanceTrace.BlockIdentifier"),TronWebProto.AccountTrace=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.AccountTrace,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.AccountTrace.displayName="TronWebProto.AccountTrace"),TronWebProto.AccountIdentifier=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.AccountIdentifier,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.AccountIdentifier.displayName="TronWebProto.AccountIdentifier"),TronWebProto.AccountBalanceRequest=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.AccountBalanceRequest,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.AccountBalanceRequest.displayName="TronWebProto.AccountBalanceRequest"),TronWebProto.AccountBalanceResponse=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.AccountBalanceResponse,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.AccountBalanceResponse.displayName="TronWebProto.AccountBalanceResponse"),TronWebProto.FreezeBalanceV2Contract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.FreezeBalanceV2Contract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.FreezeBalanceV2Contract.displayName="TronWebProto.FreezeBalanceV2Contract"),TronWebProto.UnfreezeBalanceV2Contract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.UnfreezeBalanceV2Contract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.UnfreezeBalanceV2Contract.displayName="TronWebProto.UnfreezeBalanceV2Contract"),TronWebProto.WithdrawExpireUnfreezeContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.WithdrawExpireUnfreezeContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.WithdrawExpireUnfreezeContract.displayName="TronWebProto.WithdrawExpireUnfreezeContract"),TronWebProto.DelegateResourceContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.DelegateResourceContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.DelegateResourceContract.displayName="TronWebProto.DelegateResourceContract"),TronWebProto.UnDelegateResourceContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.UnDelegateResourceContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.UnDelegateResourceContract.displayName="TronWebProto.UnDelegateResourceContract"),TronWebProto.CancelAllUnfreezeV2Contract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.CancelAllUnfreezeV2Contract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.CancelAllUnfreezeV2Contract.displayName="TronWebProto.CancelAllUnfreezeV2Contract"),n.Message.GENERATE_TO_OBJECT&&(TronWebProto.FreezeBalanceContract.prototype.toObject=function(e){return TronWebProto.FreezeBalanceContract.toObject(e,this)},TronWebProto.FreezeBalanceContract.toObject=function(e,t){var r={ownerAddress:t.getOwnerAddress_asB64(),frozenBalance:n.Message.getFieldWithDefault(t,2,0),frozenDuration:n.Message.getFieldWithDefault(t,3,0),resource:n.Message.getFieldWithDefault(t,10,0),receiverAddress:t.getReceiverAddress_asB64()};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.FreezeBalanceContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.FreezeBalanceContract;return TronWebProto.FreezeBalanceContract.deserializeBinaryFromReader(r,t)},TronWebProto.FreezeBalanceContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setOwnerAddress(r);break;case 2:r=t.readInt64();e.setFrozenBalance(r);break;case 3:r=t.readInt64();e.setFrozenDuration(r);break;case 10:r=t.readEnum();e.setResource(r);break;case 15:r=t.readBytes();e.setReceiverAddress(r);break;default:t.skipField()}}return e},TronWebProto.FreezeBalanceContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.FreezeBalanceContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.FreezeBalanceContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r),0!==(r=e.getFrozenBalance())&&t.writeInt64(2,r),0!==(r=e.getFrozenDuration())&&t.writeInt64(3,r),0!==(r=e.getResource())&&t.writeEnum(10,r),(r=e.getReceiverAddress_asU8()).length>0&&t.writeBytes(15,r)},TronWebProto.FreezeBalanceContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.FreezeBalanceContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.FreezeBalanceContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.FreezeBalanceContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.FreezeBalanceContract.prototype.getFrozenBalance=function(){return n.Message.getFieldWithDefault(this,2,0)},TronWebProto.FreezeBalanceContract.prototype.setFrozenBalance=function(e){return n.Message.setProto3IntField(this,2,e)},TronWebProto.FreezeBalanceContract.prototype.getFrozenDuration=function(){return n.Message.getFieldWithDefault(this,3,0)},TronWebProto.FreezeBalanceContract.prototype.setFrozenDuration=function(e){return n.Message.setProto3IntField(this,3,e)},TronWebProto.FreezeBalanceContract.prototype.getResource=function(){return n.Message.getFieldWithDefault(this,10,0)},TronWebProto.FreezeBalanceContract.prototype.setResource=function(e){return n.Message.setProto3EnumField(this,10,e)},TronWebProto.FreezeBalanceContract.prototype.getReceiverAddress=function(){return n.Message.getFieldWithDefault(this,15,"")},TronWebProto.FreezeBalanceContract.prototype.getReceiverAddress_asB64=function(){return n.Message.bytesAsB64(this.getReceiverAddress())},TronWebProto.FreezeBalanceContract.prototype.getReceiverAddress_asU8=function(){return n.Message.bytesAsU8(this.getReceiverAddress())},TronWebProto.FreezeBalanceContract.prototype.setReceiverAddress=function(e){return n.Message.setProto3BytesField(this,15,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.UnfreezeBalanceContract.prototype.toObject=function(e){return TronWebProto.UnfreezeBalanceContract.toObject(e,this)},TronWebProto.UnfreezeBalanceContract.toObject=function(e,t){var r={ownerAddress:t.getOwnerAddress_asB64(),resource:n.Message.getFieldWithDefault(t,10,0),receiverAddress:t.getReceiverAddress_asB64()};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.UnfreezeBalanceContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.UnfreezeBalanceContract;return TronWebProto.UnfreezeBalanceContract.deserializeBinaryFromReader(r,t)},TronWebProto.UnfreezeBalanceContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setOwnerAddress(r);break;case 10:r=t.readEnum();e.setResource(r);break;case 15:r=t.readBytes();e.setReceiverAddress(r);break;default:t.skipField()}}return e},TronWebProto.UnfreezeBalanceContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.UnfreezeBalanceContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.UnfreezeBalanceContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r),0!==(r=e.getResource())&&t.writeEnum(10,r),(r=e.getReceiverAddress_asU8()).length>0&&t.writeBytes(15,r)},TronWebProto.UnfreezeBalanceContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.UnfreezeBalanceContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.UnfreezeBalanceContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.UnfreezeBalanceContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.UnfreezeBalanceContract.prototype.getResource=function(){return n.Message.getFieldWithDefault(this,10,0)},TronWebProto.UnfreezeBalanceContract.prototype.setResource=function(e){return n.Message.setProto3EnumField(this,10,e)},TronWebProto.UnfreezeBalanceContract.prototype.getReceiverAddress=function(){return n.Message.getFieldWithDefault(this,15,"")},TronWebProto.UnfreezeBalanceContract.prototype.getReceiverAddress_asB64=function(){return n.Message.bytesAsB64(this.getReceiverAddress())},TronWebProto.UnfreezeBalanceContract.prototype.getReceiverAddress_asU8=function(){return n.Message.bytesAsU8(this.getReceiverAddress())},TronWebProto.UnfreezeBalanceContract.prototype.setReceiverAddress=function(e){return n.Message.setProto3BytesField(this,15,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.WithdrawBalanceContract.prototype.toObject=function(e){return TronWebProto.WithdrawBalanceContract.toObject(e,this)},TronWebProto.WithdrawBalanceContract.toObject=function(e,t){var r={ownerAddress:t.getOwnerAddress_asB64()};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.WithdrawBalanceContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.WithdrawBalanceContract;return TronWebProto.WithdrawBalanceContract.deserializeBinaryFromReader(r,t)},TronWebProto.WithdrawBalanceContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){if(1===t.getFieldNumber()){var r=t.readBytes();e.setOwnerAddress(r)}else t.skipField()}return e},TronWebProto.WithdrawBalanceContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.WithdrawBalanceContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.WithdrawBalanceContract.serializeBinaryToWriter=function(e,t){var r;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r)},TronWebProto.WithdrawBalanceContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.WithdrawBalanceContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.WithdrawBalanceContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.WithdrawBalanceContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.TransferContract.prototype.toObject=function(e){return TronWebProto.TransferContract.toObject(e,this)},TronWebProto.TransferContract.toObject=function(e,t){var r={ownerAddress:t.getOwnerAddress_asB64(),toAddress:t.getToAddress_asB64(),amount:n.Message.getFieldWithDefault(t,3,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.TransferContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.TransferContract;return TronWebProto.TransferContract.deserializeBinaryFromReader(r,t)},TronWebProto.TransferContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setOwnerAddress(r);break;case 2:r=t.readBytes();e.setToAddress(r);break;case 3:r=t.readInt64();e.setAmount(r);break;default:t.skipField()}}return e},TronWebProto.TransferContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.TransferContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.TransferContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r),(r=e.getToAddress_asU8()).length>0&&t.writeBytes(2,r),0!==(r=e.getAmount())&&t.writeInt64(3,r)},TronWebProto.TransferContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.TransferContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.TransferContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.TransferContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.TransferContract.prototype.getToAddress=function(){return n.Message.getFieldWithDefault(this,2,"")},TronWebProto.TransferContract.prototype.getToAddress_asB64=function(){return n.Message.bytesAsB64(this.getToAddress())},TronWebProto.TransferContract.prototype.getToAddress_asU8=function(){return n.Message.bytesAsU8(this.getToAddress())},TronWebProto.TransferContract.prototype.setToAddress=function(e){return n.Message.setProto3BytesField(this,2,e)},TronWebProto.TransferContract.prototype.getAmount=function(){return n.Message.getFieldWithDefault(this,3,0)},TronWebProto.TransferContract.prototype.setAmount=function(e){return n.Message.setProto3IntField(this,3,e)},TronWebProto.TransactionBalanceTrace.repeatedFields_=[2],n.Message.GENERATE_TO_OBJECT&&(TronWebProto.TransactionBalanceTrace.prototype.toObject=function(e){return TronWebProto.TransactionBalanceTrace.toObject(e,this)},TronWebProto.TransactionBalanceTrace.toObject=function(e,t){var r={transactionIdentifier:t.getTransactionIdentifier_asB64(),operationList:n.Message.toObjectList(t.getOperationList(),TronWebProto.TransactionBalanceTrace.Operation.toObject,e),type:n.Message.getFieldWithDefault(t,3,""),status:n.Message.getFieldWithDefault(t,4,"")};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.TransactionBalanceTrace.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.TransactionBalanceTrace;return TronWebProto.TransactionBalanceTrace.deserializeBinaryFromReader(r,t)},TronWebProto.TransactionBalanceTrace.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setTransactionIdentifier(r);break;case 2:r=new TronWebProto.TransactionBalanceTrace.Operation;t.readMessage(r,TronWebProto.TransactionBalanceTrace.Operation.deserializeBinaryFromReader),e.addOperation(r);break;case 3:r=t.readString();e.setType(r);break;case 4:r=t.readString();e.setStatus(r);break;default:t.skipField()}}return e},TronWebProto.TransactionBalanceTrace.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.TransactionBalanceTrace.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.TransactionBalanceTrace.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getTransactionIdentifier_asU8()).length>0&&t.writeBytes(1,r),(r=e.getOperationList()).length>0&&t.writeRepeatedMessage(2,r,TronWebProto.TransactionBalanceTrace.Operation.serializeBinaryToWriter),(r=e.getType()).length>0&&t.writeString(3,r),(r=e.getStatus()).length>0&&t.writeString(4,r)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.TransactionBalanceTrace.Operation.prototype.toObject=function(e){return TronWebProto.TransactionBalanceTrace.Operation.toObject(e,this)},TronWebProto.TransactionBalanceTrace.Operation.toObject=function(e,t){var r={operationIdentifier:n.Message.getFieldWithDefault(t,1,0),address:t.getAddress_asB64(),amount:n.Message.getFieldWithDefault(t,3,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.TransactionBalanceTrace.Operation.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.TransactionBalanceTrace.Operation;return TronWebProto.TransactionBalanceTrace.Operation.deserializeBinaryFromReader(r,t)},TronWebProto.TransactionBalanceTrace.Operation.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readInt64();e.setOperationIdentifier(r);break;case 2:r=t.readBytes();e.setAddress(r);break;case 3:r=t.readInt64();e.setAmount(r);break;default:t.skipField()}}return e},TronWebProto.TransactionBalanceTrace.Operation.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.TransactionBalanceTrace.Operation.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.TransactionBalanceTrace.Operation.serializeBinaryToWriter=function(e,t){var r=void 0;0!==(r=e.getOperationIdentifier())&&t.writeInt64(1,r),(r=e.getAddress_asU8()).length>0&&t.writeBytes(2,r),0!==(r=e.getAmount())&&t.writeInt64(3,r)},TronWebProto.TransactionBalanceTrace.Operation.prototype.getOperationIdentifier=function(){return n.Message.getFieldWithDefault(this,1,0)},TronWebProto.TransactionBalanceTrace.Operation.prototype.setOperationIdentifier=function(e){return n.Message.setProto3IntField(this,1,e)},TronWebProto.TransactionBalanceTrace.Operation.prototype.getAddress=function(){return n.Message.getFieldWithDefault(this,2,"")},TronWebProto.TransactionBalanceTrace.Operation.prototype.getAddress_asB64=function(){return n.Message.bytesAsB64(this.getAddress())},TronWebProto.TransactionBalanceTrace.Operation.prototype.getAddress_asU8=function(){return n.Message.bytesAsU8(this.getAddress())},TronWebProto.TransactionBalanceTrace.Operation.prototype.setAddress=function(e){return n.Message.setProto3BytesField(this,2,e)},TronWebProto.TransactionBalanceTrace.Operation.prototype.getAmount=function(){return n.Message.getFieldWithDefault(this,3,0)},TronWebProto.TransactionBalanceTrace.Operation.prototype.setAmount=function(e){return n.Message.setProto3IntField(this,3,e)},TronWebProto.TransactionBalanceTrace.prototype.getTransactionIdentifier=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.TransactionBalanceTrace.prototype.getTransactionIdentifier_asB64=function(){return n.Message.bytesAsB64(this.getTransactionIdentifier())},TronWebProto.TransactionBalanceTrace.prototype.getTransactionIdentifier_asU8=function(){return n.Message.bytesAsU8(this.getTransactionIdentifier())},TronWebProto.TransactionBalanceTrace.prototype.setTransactionIdentifier=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.TransactionBalanceTrace.prototype.getOperationList=function(){return n.Message.getRepeatedWrapperField(this,TronWebProto.TransactionBalanceTrace.Operation,2)},TronWebProto.TransactionBalanceTrace.prototype.setOperationList=function(e){return n.Message.setRepeatedWrapperField(this,2,e)},TronWebProto.TransactionBalanceTrace.prototype.addOperation=function(e,t){return n.Message.addToRepeatedWrapperField(this,2,e,TronWebProto.TransactionBalanceTrace.Operation,t)},TronWebProto.TransactionBalanceTrace.prototype.clearOperationList=function(){return this.setOperationList([])},TronWebProto.TransactionBalanceTrace.prototype.getType=function(){return n.Message.getFieldWithDefault(this,3,"")},TronWebProto.TransactionBalanceTrace.prototype.setType=function(e){return n.Message.setProto3StringField(this,3,e)},TronWebProto.TransactionBalanceTrace.prototype.getStatus=function(){return n.Message.getFieldWithDefault(this,4,"")},TronWebProto.TransactionBalanceTrace.prototype.setStatus=function(e){return n.Message.setProto3StringField(this,4,e)},TronWebProto.BlockBalanceTrace.repeatedFields_=[3],n.Message.GENERATE_TO_OBJECT&&(TronWebProto.BlockBalanceTrace.prototype.toObject=function(e){return TronWebProto.BlockBalanceTrace.toObject(e,this)},TronWebProto.BlockBalanceTrace.toObject=function(e,t){var r,o={blockIdentifier:(r=t.getBlockIdentifier())&&TronWebProto.BlockBalanceTrace.BlockIdentifier.toObject(e,r),timestamp:n.Message.getFieldWithDefault(t,2,0),transactionBalanceTraceList:n.Message.toObjectList(t.getTransactionBalanceTraceList(),TronWebProto.TransactionBalanceTrace.toObject,e)};return e&&(o.$jspbMessageInstance=t),o}),TronWebProto.BlockBalanceTrace.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.BlockBalanceTrace;return TronWebProto.BlockBalanceTrace.deserializeBinaryFromReader(r,t)},TronWebProto.BlockBalanceTrace.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=new TronWebProto.BlockBalanceTrace.BlockIdentifier;t.readMessage(r,TronWebProto.BlockBalanceTrace.BlockIdentifier.deserializeBinaryFromReader),e.setBlockIdentifier(r);break;case 2:r=t.readInt64();e.setTimestamp(r);break;case 3:r=new TronWebProto.TransactionBalanceTrace;t.readMessage(r,TronWebProto.TransactionBalanceTrace.deserializeBinaryFromReader),e.addTransactionBalanceTrace(r);break;default:t.skipField()}}return e},TronWebProto.BlockBalanceTrace.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.BlockBalanceTrace.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.BlockBalanceTrace.serializeBinaryToWriter=function(e,t){var r=void 0;null!=(r=e.getBlockIdentifier())&&t.writeMessage(1,r,TronWebProto.BlockBalanceTrace.BlockIdentifier.serializeBinaryToWriter),0!==(r=e.getTimestamp())&&t.writeInt64(2,r),(r=e.getTransactionBalanceTraceList()).length>0&&t.writeRepeatedMessage(3,r,TronWebProto.TransactionBalanceTrace.serializeBinaryToWriter)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.BlockBalanceTrace.BlockIdentifier.prototype.toObject=function(e){return TronWebProto.BlockBalanceTrace.BlockIdentifier.toObject(e,this)},TronWebProto.BlockBalanceTrace.BlockIdentifier.toObject=function(e,t){var r={hash:t.getHash_asB64(),number:n.Message.getFieldWithDefault(t,2,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.BlockBalanceTrace.BlockIdentifier.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.BlockBalanceTrace.BlockIdentifier;return TronWebProto.BlockBalanceTrace.BlockIdentifier.deserializeBinaryFromReader(r,t)},TronWebProto.BlockBalanceTrace.BlockIdentifier.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setHash(r);break;case 2:r=t.readInt64();e.setNumber(r);break;default:t.skipField()}}return e},TronWebProto.BlockBalanceTrace.BlockIdentifier.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.BlockBalanceTrace.BlockIdentifier.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.BlockBalanceTrace.BlockIdentifier.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getHash_asU8()).length>0&&t.writeBytes(1,r),0!==(r=e.getNumber())&&t.writeInt64(2,r)},TronWebProto.BlockBalanceTrace.BlockIdentifier.prototype.getHash=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.BlockBalanceTrace.BlockIdentifier.prototype.getHash_asB64=function(){return n.Message.bytesAsB64(this.getHash())},TronWebProto.BlockBalanceTrace.BlockIdentifier.prototype.getHash_asU8=function(){return n.Message.bytesAsU8(this.getHash())},TronWebProto.BlockBalanceTrace.BlockIdentifier.prototype.setHash=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.BlockBalanceTrace.BlockIdentifier.prototype.getNumber=function(){return n.Message.getFieldWithDefault(this,2,0)},TronWebProto.BlockBalanceTrace.BlockIdentifier.prototype.setNumber=function(e){return n.Message.setProto3IntField(this,2,e)},TronWebProto.BlockBalanceTrace.prototype.getBlockIdentifier=function(){return n.Message.getWrapperField(this,TronWebProto.BlockBalanceTrace.BlockIdentifier,1)},TronWebProto.BlockBalanceTrace.prototype.setBlockIdentifier=function(e){return n.Message.setWrapperField(this,1,e)},TronWebProto.BlockBalanceTrace.prototype.clearBlockIdentifier=function(){return this.setBlockIdentifier(void 0)},TronWebProto.BlockBalanceTrace.prototype.hasBlockIdentifier=function(){return null!=n.Message.getField(this,1)},TronWebProto.BlockBalanceTrace.prototype.getTimestamp=function(){return n.Message.getFieldWithDefault(this,2,0)},TronWebProto.BlockBalanceTrace.prototype.setTimestamp=function(e){return n.Message.setProto3IntField(this,2,e)},TronWebProto.BlockBalanceTrace.prototype.getTransactionBalanceTraceList=function(){return n.Message.getRepeatedWrapperField(this,TronWebProto.TransactionBalanceTrace,3)},TronWebProto.BlockBalanceTrace.prototype.setTransactionBalanceTraceList=function(e){return n.Message.setRepeatedWrapperField(this,3,e)},TronWebProto.BlockBalanceTrace.prototype.addTransactionBalanceTrace=function(e,t){return n.Message.addToRepeatedWrapperField(this,3,e,TronWebProto.TransactionBalanceTrace,t)},TronWebProto.BlockBalanceTrace.prototype.clearTransactionBalanceTraceList=function(){return this.setTransactionBalanceTraceList([])},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.AccountTrace.prototype.toObject=function(e){return TronWebProto.AccountTrace.toObject(e,this)},TronWebProto.AccountTrace.toObject=function(e,t){var r={balance:n.Message.getFieldWithDefault(t,1,0),placeholder:n.Message.getFieldWithDefault(t,99,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.AccountTrace.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.AccountTrace;return TronWebProto.AccountTrace.deserializeBinaryFromReader(r,t)},TronWebProto.AccountTrace.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readInt64();e.setBalance(r);break;case 99:r=t.readInt64();e.setPlaceholder(r);break;default:t.skipField()}}return e},TronWebProto.AccountTrace.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.AccountTrace.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.AccountTrace.serializeBinaryToWriter=function(e,t){var r=void 0;0!==(r=e.getBalance())&&t.writeInt64(1,r),0!==(r=e.getPlaceholder())&&t.writeInt64(99,r)},TronWebProto.AccountTrace.prototype.getBalance=function(){return n.Message.getFieldWithDefault(this,1,0)},TronWebProto.AccountTrace.prototype.setBalance=function(e){return n.Message.setProto3IntField(this,1,e)},TronWebProto.AccountTrace.prototype.getPlaceholder=function(){return n.Message.getFieldWithDefault(this,99,0)},TronWebProto.AccountTrace.prototype.setPlaceholder=function(e){return n.Message.setProto3IntField(this,99,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.AccountIdentifier.prototype.toObject=function(e){return TronWebProto.AccountIdentifier.toObject(e,this)},TronWebProto.AccountIdentifier.toObject=function(e,t){var r={address:t.getAddress_asB64()};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.AccountIdentifier.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.AccountIdentifier;return TronWebProto.AccountIdentifier.deserializeBinaryFromReader(r,t)},TronWebProto.AccountIdentifier.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){if(1===t.getFieldNumber()){var r=t.readBytes();e.setAddress(r)}else t.skipField()}return e},TronWebProto.AccountIdentifier.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.AccountIdentifier.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.AccountIdentifier.serializeBinaryToWriter=function(e,t){var r;(r=e.getAddress_asU8()).length>0&&t.writeBytes(1,r)},TronWebProto.AccountIdentifier.prototype.getAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.AccountIdentifier.prototype.getAddress_asB64=function(){return n.Message.bytesAsB64(this.getAddress())},TronWebProto.AccountIdentifier.prototype.getAddress_asU8=function(){return n.Message.bytesAsU8(this.getAddress())},TronWebProto.AccountIdentifier.prototype.setAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.AccountBalanceRequest.prototype.toObject=function(e){return TronWebProto.AccountBalanceRequest.toObject(e,this)},TronWebProto.AccountBalanceRequest.toObject=function(e,t){var r,n={accountIdentifier:(r=t.getAccountIdentifier())&&TronWebProto.AccountIdentifier.toObject(e,r),blockIdentifier:(r=t.getBlockIdentifier())&&TronWebProto.BlockBalanceTrace.BlockIdentifier.toObject(e,r)};return e&&(n.$jspbMessageInstance=t),n}),TronWebProto.AccountBalanceRequest.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.AccountBalanceRequest;return TronWebProto.AccountBalanceRequest.deserializeBinaryFromReader(r,t)},TronWebProto.AccountBalanceRequest.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=new TronWebProto.AccountIdentifier;t.readMessage(r,TronWebProto.AccountIdentifier.deserializeBinaryFromReader),e.setAccountIdentifier(r);break;case 2:r=new TronWebProto.BlockBalanceTrace.BlockIdentifier;t.readMessage(r,TronWebProto.BlockBalanceTrace.BlockIdentifier.deserializeBinaryFromReader),e.setBlockIdentifier(r);break;default:t.skipField()}}return e},TronWebProto.AccountBalanceRequest.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.AccountBalanceRequest.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.AccountBalanceRequest.serializeBinaryToWriter=function(e,t){var r=void 0;null!=(r=e.getAccountIdentifier())&&t.writeMessage(1,r,TronWebProto.AccountIdentifier.serializeBinaryToWriter),null!=(r=e.getBlockIdentifier())&&t.writeMessage(2,r,TronWebProto.BlockBalanceTrace.BlockIdentifier.serializeBinaryToWriter)},TronWebProto.AccountBalanceRequest.prototype.getAccountIdentifier=function(){return n.Message.getWrapperField(this,TronWebProto.AccountIdentifier,1)},TronWebProto.AccountBalanceRequest.prototype.setAccountIdentifier=function(e){return n.Message.setWrapperField(this,1,e)},TronWebProto.AccountBalanceRequest.prototype.clearAccountIdentifier=function(){return this.setAccountIdentifier(void 0)},TronWebProto.AccountBalanceRequest.prototype.hasAccountIdentifier=function(){return null!=n.Message.getField(this,1)},TronWebProto.AccountBalanceRequest.prototype.getBlockIdentifier=function(){return n.Message.getWrapperField(this,TronWebProto.BlockBalanceTrace.BlockIdentifier,2)},TronWebProto.AccountBalanceRequest.prototype.setBlockIdentifier=function(e){return n.Message.setWrapperField(this,2,e)},TronWebProto.AccountBalanceRequest.prototype.clearBlockIdentifier=function(){return this.setBlockIdentifier(void 0)},TronWebProto.AccountBalanceRequest.prototype.hasBlockIdentifier=function(){return null!=n.Message.getField(this,2)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.AccountBalanceResponse.prototype.toObject=function(e){return TronWebProto.AccountBalanceResponse.toObject(e,this)},TronWebProto.AccountBalanceResponse.toObject=function(e,t){var r,o={balance:n.Message.getFieldWithDefault(t,1,0),blockIdentifier:(r=t.getBlockIdentifier())&&TronWebProto.BlockBalanceTrace.BlockIdentifier.toObject(e,r)};return e&&(o.$jspbMessageInstance=t),o}),TronWebProto.AccountBalanceResponse.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.AccountBalanceResponse;return TronWebProto.AccountBalanceResponse.deserializeBinaryFromReader(r,t)},TronWebProto.AccountBalanceResponse.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readInt64();e.setBalance(r);break;case 2:r=new TronWebProto.BlockBalanceTrace.BlockIdentifier;t.readMessage(r,TronWebProto.BlockBalanceTrace.BlockIdentifier.deserializeBinaryFromReader),e.setBlockIdentifier(r);break;default:t.skipField()}}return e},TronWebProto.AccountBalanceResponse.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.AccountBalanceResponse.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.AccountBalanceResponse.serializeBinaryToWriter=function(e,t){var r=void 0;0!==(r=e.getBalance())&&t.writeInt64(1,r),null!=(r=e.getBlockIdentifier())&&t.writeMessage(2,r,TronWebProto.BlockBalanceTrace.BlockIdentifier.serializeBinaryToWriter)},TronWebProto.AccountBalanceResponse.prototype.getBalance=function(){return n.Message.getFieldWithDefault(this,1,0)},TronWebProto.AccountBalanceResponse.prototype.setBalance=function(e){return n.Message.setProto3IntField(this,1,e)},TronWebProto.AccountBalanceResponse.prototype.getBlockIdentifier=function(){return n.Message.getWrapperField(this,TronWebProto.BlockBalanceTrace.BlockIdentifier,2)},TronWebProto.AccountBalanceResponse.prototype.setBlockIdentifier=function(e){return n.Message.setWrapperField(this,2,e)},TronWebProto.AccountBalanceResponse.prototype.clearBlockIdentifier=function(){return this.setBlockIdentifier(void 0)},TronWebProto.AccountBalanceResponse.prototype.hasBlockIdentifier=function(){return null!=n.Message.getField(this,2)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.FreezeBalanceV2Contract.prototype.toObject=function(e){return TronWebProto.FreezeBalanceV2Contract.toObject(e,this)},TronWebProto.FreezeBalanceV2Contract.toObject=function(e,t){var r={ownerAddress:t.getOwnerAddress_asB64(),frozenBalance:n.Message.getFieldWithDefault(t,2,0),resource:n.Message.getFieldWithDefault(t,3,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.FreezeBalanceV2Contract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.FreezeBalanceV2Contract;return TronWebProto.FreezeBalanceV2Contract.deserializeBinaryFromReader(r,t)},TronWebProto.FreezeBalanceV2Contract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setOwnerAddress(r);break;case 2:r=t.readInt64();e.setFrozenBalance(r);break;case 3:r=t.readEnum();e.setResource(r);break;default:t.skipField()}}return e},TronWebProto.FreezeBalanceV2Contract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.FreezeBalanceV2Contract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.FreezeBalanceV2Contract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r),0!==(r=e.getFrozenBalance())&&t.writeInt64(2,r),0!==(r=e.getResource())&&t.writeEnum(3,r)},TronWebProto.FreezeBalanceV2Contract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.FreezeBalanceV2Contract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.FreezeBalanceV2Contract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.FreezeBalanceV2Contract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.FreezeBalanceV2Contract.prototype.getFrozenBalance=function(){return n.Message.getFieldWithDefault(this,2,0)},TronWebProto.FreezeBalanceV2Contract.prototype.setFrozenBalance=function(e){return n.Message.setProto3IntField(this,2,e)},TronWebProto.FreezeBalanceV2Contract.prototype.getResource=function(){return n.Message.getFieldWithDefault(this,3,0)},TronWebProto.FreezeBalanceV2Contract.prototype.setResource=function(e){return n.Message.setProto3EnumField(this,3,e)}
2,n.Message.GENERATE_TO_OBJECT&&(TronWebProto.UnfreezeBalanceV2Contract.prototype.toObject=function(e){return TronWebProto.UnfreezeBalanceV2Contract.toObject(e,this)},TronWebProto.UnfreezeBalanceV2Contract.toObject=function(e,t){var r={ownerAddress:t.getOwnerAddress_asB64(),unfreezeBalance:n.Message.getFieldWithDefault(t,2,0),resource:n.Message.getFieldWithDefault(t,3,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.UnfreezeBalanceV2Contract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.UnfreezeBalanceV2Contract;return TronWebProto.UnfreezeBalanceV2Contract.deserializeBinaryFromReader(r,t)},TronWebProto.UnfreezeBalanceV2Contract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setOwnerAddress(r);break;case 2:r=t.readInt64();e.setUnfreezeBalance(r);break;case 3:r=t.readEnum();e.setResource(r);break;default:t.skipField()}}return e},TronWebProto.UnfreezeBalanceV2Contract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.UnfreezeBalanceV2Contract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.UnfreezeBalanceV2Contract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r),0!==(r=e.getUnfreezeBalance())&&t.writeInt64(2,r),0!==(r=e.getResource())&&t.writeEnum(3,r)},TronWebProto.UnfreezeBalanceV2Contract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.UnfreezeBalanceV2Contract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.UnfreezeBalanceV2Contract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.UnfreezeBalanceV2Contract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.UnfreezeBalanceV2Contract.prototype.getUnfreezeBalance=function(){return n.Message.getFieldWithDefault(this,2,0)},TronWebProto.UnfreezeBalanceV2Contract.prototype.setUnfreezeBalance=function(e){return n.Message.setProto3IntField(this,2,e)},TronWebProto.UnfreezeBalanceV2Contract.prototype.getResource=function(){return n.Message.getFieldWithDefault(this,3,0)},TronWebProto.UnfreezeBalanceV2Contract.prototype.setResource=function(e){return n.Message.setProto3EnumField(this,3,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.WithdrawExpireUnfreezeContract.prototype.toObject=function(e){return TronWebProto.WithdrawExpireUnfreezeContract.toObject(e,this)},TronWebProto.WithdrawExpireUnfreezeContract.toObject=function(e,t){var r={ownerAddress:t.getOwnerAddress_asB64()};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.WithdrawExpireUnfreezeContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.WithdrawExpireUnfreezeContract;return TronWebProto.WithdrawExpireUnfreezeContract.deserializeBinaryFromReader(r,t)},TronWebProto.WithdrawExpireUnfreezeContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){if(1===t.getFieldNumber()){var r=t.readBytes();e.setOwnerAddress(r)}else t.skipField()}return e},TronWebProto.WithdrawExpireUnfreezeContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.WithdrawExpireUnfreezeContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.WithdrawExpireUnfreezeContract.serializeBinaryToWriter=function(e,t){var r;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r)},TronWebProto.WithdrawExpireUnfreezeContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.WithdrawExpireUnfreezeContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.WithdrawExpireUnfreezeContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.WithdrawExpireUnfreezeContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)}
vendor: 4,701 bytes, line 2
2,n.Message.GENERATE_TO_OBJECT&&(TronWebProto.DelegateResourceContract.prototype.toObject=function(e){return TronWebProto.DelegateResourceContract.toObject(e,this)},TronWebProto.DelegateResourceContract.toObject=function(e,t){var r={ownerAddress:t.getOwnerAddress_asB64(),resource:n.Message.getFieldWithDefault(t,2,0),balance:n.Message.getFieldWithDefault(t,3,0),receiverAddress:t.getReceiverAddress_asB64(),lock:n.Message.getBooleanFieldWithDefault(t,5,!1),lockPeriod:n.Message.getFieldWithDefault(t,6,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.DelegateResourceContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.DelegateResourceContract;return TronWebProto.DelegateResourceContract.deserializeBinaryFromReader(r,t)},TronWebProto.DelegateResourceContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setOwnerAddress(r);break;case 2:r=t.readEnum();e.setResource(r);break;case 3:r=t.readInt64();e.setBalance(r);break;case 4:r=t.readBytes();e.setReceiverAddress(r);break;case 5:r=t.readBool();e.setLock(r);break;case 6:r=t.readInt64();e.setLockPeriod(r);break;default:t.skipField()}}return e},TronWebProto.DelegateResourceContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.DelegateResourceContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.DelegateResourceContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r),0!==(r=e.getResource())&&t.writeEnum(2,r),0!==(r=e.getBalance())&&t.writeInt64(3,r),(r=e.getReceiverAddress_asU8()).length>0&&t.writeBytes(4,r),(r=e.getLock())&&t.writeBool(5,r),0!==(r=e.getLockPeriod())&&t.writeInt64(6,r)},TronWebProto.DelegateResourceContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.DelegateResourceContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.DelegateResourceContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.DelegateResourceContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.DelegateResourceContract.prototype.getResource=function(){return n.Message.getFieldWithDefault(this,2,0)},TronWebProto.DelegateResourceContract.prototype.setResource=function(e){return n.Message.setProto3EnumField(this,2,e)},TronWebProto.DelegateResourceContract.prototype.getBalance=function(){return n.Message.getFieldWithDefault(this,3,0)},TronWebProto.DelegateResourceContract.prototype.setBalance=function(e){return n.Message.setProto3IntField(this,3,e)},TronWebProto.DelegateResourceContract.prototype.getReceiverAddress=function(){return n.Message.getFieldWithDefault(this,4,"")},TronWebProto.DelegateResourceContract.prototype.getReceiverAddress_asB64=function(){return n.Message.bytesAsB64(this.getReceiverAddress())},TronWebProto.DelegateResourceContract.prototype.getReceiverAddress_asU8=function(){return n.Message.bytesAsU8(this.getReceiverAddress())},TronWebProto.DelegateResourceContract.prototype.setReceiverAddress=function(e){return n.Message.setProto3BytesField(this,4,e)},TronWebProto.DelegateResourceContract.prototype.getLock=function(){return n.Message.getBooleanFieldWithDefault(this,5,!1)},TronWebProto.DelegateResourceContract.prototype.setLock=function(e){return n.Message.setProto3BooleanField(this,5,e)},TronWebProto.DelegateResourceContract.prototype.getLockPeriod=function(){return n.Message.getFieldWithDefault(this,6,0)},TronWebProto.DelegateResourceContract.prototype.setLockPeriod=function(e){return n.Message.setProto3IntField(this,6,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.UnDelegateResourceContract.prototype.toObject=function(e){return TronWebProto.UnDelegateResourceContract.toObject(e,this)},TronWebProto.UnDelegateResourceContract.toObject=function(e,t){var r={ownerAddress:t.getOwnerAddress_asB64(),resource:n.Message.getFieldWithDefault(t,2,0),balance:n.Message.getFieldWithDefault(t,3,0),receiverAddress:t.getReceiverAddress_asB64()};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.UnDelegateResourceContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.UnDelegateResourceContract;return TronWebProto.UnDelegateResourceContract.deserializeBinaryFromReader(r,t)},TronWebProto.UnDelegateResourceContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setOwnerAddress(r);break;case 2:r=t.readEnum();
2e.setResource(r);break;case 3:r=t.readInt64();e.setBalance(r);break;case 4:r=t.readBytes();e.setReceiverAddress(r);break;default:t.skipField()}}return e},TronWebProto.UnDelegateResourceContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.UnDelegateResourceContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.UnDelegateResourceContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r),0!==(r=e.getResource())&&t.writeEnum(2,r),0!==(r=e.getBalance())&&t.writeInt64(3,r),(r=e.getReceiverAddress_asU8()).length>0&&t.writeBytes(4,r)},TronWebProto.UnDelegateResourceContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.UnDelegateResourceContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.UnDelegateResourceContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.UnDelegateResourceContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.UnDelegateResourceContract.prototype.getResource=function(){return n.Message.getFieldWithDefault(this,2,0)},TronWebProto.UnDelegateResourceContract.prototype.setResource=function(e){return n.Message.setProto3EnumField(this,2,e)},TronWebProto.UnDelegateResourceContract.prototype.getBalance=function(){return n.Message.getFieldWithDefault(this,3,0)},TronWebProto.UnDelegateResourceContract.prototype.setBalance=function(e){return n.Message.setProto3IntField(this,3,e)},TronWebProto.UnDelegateResourceContract.prototype.getReceiverAddress=function(){return n.Message.getFieldWithDefault(this,4,"")},TronWebProto.UnDelegateResourceContract.prototype.getReceiverAddress_asB64=function(){return n.Message.bytesAsB64(this.getReceiverAddress())},TronWebProto.UnDelegateResourceContract.prototype.getReceiverAddress_asU8=function(){return n.Message.bytesAsU8(this.getReceiverAddress())},TronWebProto.UnDelegateResourceContract.prototype.setReceiverAddress=function(e){return n.Message.setProto3BytesField(this,4,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.CancelAllUnfreezeV2Contract.prototype.toObject=function(e){return TronWebProto.CancelAllUnfreezeV2Contract.toObject(e,this)},TronWebProto.CancelAllUnfreezeV2Contract.toObject=function(e,t){var r={ownerAddress:t.getOwnerAddress_asB64()};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.CancelAllUnfreezeV2Contract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.CancelAllUnfreezeV2Contract;return TronWebProto.CancelAllUnfreezeV2Contract.deserializeBinaryFromReader(r,t)},TronWebProto.CancelAllUnfreezeV2Contract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){if(1===t.getFieldNumber()){var r=t.readBytes();e.setOwnerAddress(r)}else t.skipField()}return e},TronWebProto.CancelAllUnfreezeV2Contract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.CancelAllUnfreezeV2Contract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.CancelAllUnfreezeV2Contract.serializeBinaryToWriter=function(e,t){var r;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r)},TronWebProto.CancelAllUnfreezeV2Contract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.CancelAllUnfreezeV2Contract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.CancelAllUnfreezeV2Contract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.CancelAllUnfreezeV2Contract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},o.object.extend(t,TronWebProto)},"./node_modules/tronweb/lib/esm/protocol/core/contract/common_pb.cjs"(e,t,r){var n=r("./node_modules/google-protobuf/google-protobuf.js"),o="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof window&&window||void 0!==o&&o||"undefined"!=typeof self&&self||function(){return this}.call(null)||Function("return this")();n.exportSymbol("TronWebProto.ResourceCode",null,o),TronWebProto.ResourceCode={BANDWIDTH:0,ENERGY:1,TRON_POWER:2},n.object.extend(t,TronWebProto)},"./node_modules/tronweb/lib/esm/protocol/core/contract/exchange_contract_pb.cjs"(e,t,r){var n=r("./node_modules/google-protobuf/google-protobuf.js"),o=n,s="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof window&&window||void 0!==s&&s||"undefined"!=typeof self&&self||function(){return this}.call(null)||Function("return this")();o.exportSymbol("TronWebProto.ExchangeCreateContract",null,s),o.exportSymbol("TronWebProto.ExchangeInjectContract",null,s),o.exportSymbol("TronWebProto.ExchangeTransactionContract",null,s),o.exportSymbol("TronWebProto.ExchangeWithdrawContract",null,s),TronWebProto.ExchangeCreateContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.ExchangeCreateContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.ExchangeCreateContract.displayName="TronWebProto.ExchangeCreateContract"),TronWebProto.ExchangeInjectContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.ExchangeInjectContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.ExchangeInjectContract.displayName="TronWebProto.ExchangeInjectContract"),TronWebProto.ExchangeWithdrawContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.ExchangeWithdrawContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.ExchangeWithdrawContract.displayName="TronWebProto.ExchangeWithdrawContract"),TronWebProto.ExchangeTransactionContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.ExchangeTransactionContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.ExchangeTransactionContract.displayName="TronWebProto.ExchangeTransactionContract"),n.Message.GENERATE_TO_OBJ
vendor: 32,819 bytes, line 2
2ECT&&(TronWebProto.ExchangeCreateContract.prototype.toObject=function(e){return TronWebProto.ExchangeCreateContract.toObject(e,this)},TronWebProto.ExchangeCreateContract.toObject=function(e,t){var r={ownerAddress:t.getOwnerAddress_asB64(),firstTokenId:t.getFirstTokenId_asB64(),firstTokenBalance:n.Message.getFieldWithDefault(t,3,0),secondTokenId:t.getSecondTokenId_asB64(),secondTokenBalance:n.Message.getFieldWithDefault(t,5,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.ExchangeCreateContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.ExchangeCreateContract;return TronWebProto.ExchangeCreateContract.deserializeBinaryFromReader(r,t)},TronWebProto.ExchangeCreateContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setOwnerAddress(r);break;case 2:r=t.readBytes();e.setFirstTokenId(r);break;case 3:r=t.readInt64();e.setFirstTokenBalance(r);break;case 4:r=t.readBytes();e.setSecondTokenId(r);break;case 5:r=t.readInt64();e.setSecondTokenBalance(r);break;default:t.skipField()}}return e},TronWebProto.ExchangeCreateContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.ExchangeCreateContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.ExchangeCreateContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r),(r=e.getFirstTokenId_asU8()).length>0&&t.writeBytes(2,r),0!==(r=e.getFirstTokenBalance())&&t.writeInt64(3,r),(r=e.getSecondTokenId_asU8()).length>0&&t.writeBytes(4,r),0!==(r=e.getSecondTokenBalance())&&t.writeInt64(5,r)},TronWebProto.ExchangeCreateContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.ExchangeCreateContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.ExchangeCreateContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.ExchangeCreateContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.ExchangeCreateContract.prototype.getFirstTokenId=function(){return n.Message.getFieldWithDefault(this,2,"")},TronWebProto.ExchangeCreateContract.prototype.getFirstTokenId_asB64=function(){return n.Message.bytesAsB64(this.getFirstTokenId())},TronWebProto.ExchangeCreateContract.prototype.getFirstTokenId_asU8=function(){return n.Message.bytesAsU8(this.getFirstTokenId())},TronWebProto.ExchangeCreateContract.prototype.setFirstTokenId=function(e){return n.Message.setProto3BytesField(this,2,e)},TronWebProto.ExchangeCreateContract.prototype.getFirstTokenBalance=function(){return n.Message.getFieldWithDefault(this,3,0)},TronWebProto.ExchangeCreateContract.prototype.setFirstTokenBalance=function(e){return n.Message.setProto3IntField(this,3,e)},TronWebProto.ExchangeCreateContract.prototype.getSecondTokenId=function(){return n.Message.getFieldWithDefault(this,4,"")},TronWebProto.ExchangeCreateContract.prototype.getSecondTokenId_asB64=function(){return n.Message.bytesAsB64(this.getSecondTokenId())},TronWebProto.ExchangeCreateContract.prototype.getSecondTokenId_asU8=function(){return n.Message.bytesAsU8(this.getSecondTokenId())},TronWebProto.ExchangeCreateContract.prototype.setSecondTokenId=function(e){return n.Message.setProto3BytesField(this,4,e)},TronWebProto.ExchangeCreateContract.prototype.getSecondTokenBalance=function(){return n.Message.getFieldWithDefault(this,5,0)},TronWebProto.ExchangeCreateContract.prototype.setSecondTokenBalance=function(e){return n.Message.setProto3IntField(this,5,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.ExchangeInjectContract.prototype.toObject=function(e){return TronWebProto.ExchangeInjectContract.toObject(e,this)},TronWebProto.ExchangeInjectContract.toObject=function(e,t){var r={ownerAddress:t.getOwnerAddress_asB64(),exchangeId:n.Message.getFieldWithDefault(t,2,0),tokenId:t.getTokenId_asB64(),quant:n.Message.getFieldWithDefault(t,4,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.ExchangeInjectContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.ExchangeInjectContract;return TronWebProto.ExchangeInjectContract.deserializeBinaryFromReader(r,t)},TronWebProto.ExchangeInjectContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setOwnerAddress(r);break;case 2:r=t.readInt64();e.setExchangeId(r);break;case 3:r=t.readBytes();e.setTokenId(r);break;case 4:r=t.readInt64();e.setQuant(r);break;default:t.skipField()}}return e},TronWebProto.ExchangeInjectContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.ExchangeInjectContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.ExchangeInjectContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r),0!==(r=e.getExchangeId())&&t.writeInt64(2,r),(r=e.getTokenId_asU8()).length>0&&t.writeBytes(3,r),0!==(r=e.getQuant())&&t.writeInt64(4,r)},TronWebProto.ExchangeInjectContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.ExchangeInjectContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.ExchangeInjectContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.ExchangeInjectContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.ExchangeInjectContract.prototype.getExchangeId=function(){return n.Message.getFieldWithDefault(this,2,0)},TronWebProto.ExchangeInjectContract.prototype.setExchangeId=function(e){return n.Message.setProto3IntField(this,2,e)},TronWebProto.ExchangeInjectContract.prototype.getTokenId=function(){return n.Message.getFieldWithDefault(this,3,"")},TronWebProto.ExchangeInjectContract.prototype.getTokenId_asB64=function(){return n.Message.bytesAsB64(this.getTokenId())},TronWebProto.ExchangeInjectContract.prototype.getTokenId_asU8=function(){return n.Message.bytesAsU8(this.getTokenId())},TronWebProto.ExchangeInjectContract.prototype.setTokenId=function(e){return n.Message.setProto3BytesField(this,3,e)},TronWebProto.ExchangeInjectContract.prototype.getQuant=function(){return n.Message.getFieldWithDefault(this,4,0)},TronWebProto.ExchangeInjectContract.prototype.setQuant=function(e){return n.Message.setProto3IntField(this,4,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.ExchangeWithdrawContract.prototype.toObject=function(e){return TronWebProto.ExchangeWithdrawContract.toObject(e,this)},TronWebProto.ExchangeWithdrawContract.toObject=function(e,t){var r={ownerAddress:t.getOwnerAddress_asB64(),exchangeId:n.Message.getFieldWithDefault(t,2,0),tokenId:t.getTokenId_asB64(),quant:n.Message.getFieldWithDefault(t,4,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.ExchangeWithdrawContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.ExchangeWithdrawContract;return TronWebProto.ExchangeWithdrawContract.deserializeBinaryFromReader(r,t)},TronWebProto.ExchangeWithdrawContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setOwnerAddress(r);break;case 2:r=t.readInt64();e.setExchangeId(r);break;case 3:r=t.readBytes();e.setTokenId(r);break;case 4:r=t.readInt64();e.setQuant(r);break;default:t.skipField()}}return e},TronWebProto.ExchangeWithdrawContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.ExchangeWithdrawContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.ExchangeWithdrawContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r),0!==(r=e.getExchangeId())&&t.writeInt64(2,r),(r=e.getTokenId_asU8()).length>0&&t.writeBytes(3,r),0!==(r=e.getQuant())&&t.writeInt64(4,r)},TronWebProto.ExchangeWithdrawContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.ExchangeWithdrawContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.ExchangeWithdrawContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.ExchangeWithdrawContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.ExchangeWithdrawContract.prototype.getExchangeId=function(){return n.Message.getFieldWithDefault(this,2,0)},TronWebProto.ExchangeWithdrawContract.prototype.setExchangeId=function(e){return n.Message.setProto3IntField(this,2,e)},TronWebProto.ExchangeWithdrawContract.prototype.getTokenId=function(){return n.Message.getFieldWithDefault(this,3,"")},TronWebProto.ExchangeWithdrawContract.prototype.getTokenId_asB64=function(){return n.Message.bytesAsB64(this.getTokenId())},TronWebProto.ExchangeWithdrawContract.prototype.getTokenId_asU8=function(){return n.Message.bytesAsU8(this.getTokenId())},TronWebProto.ExchangeWithdrawContract.prototype.setTokenId=function(e){return n.Message.setProto3BytesField(this,3,e)},TronWebProto.ExchangeWithdrawContract.prototype.getQuant=function(){return n.Message.getFieldWithDefault(this,4,0)},TronWebProto.ExchangeWithdrawContract.prototype.setQuant=function(e){return n.Message.setProto3IntField(this,4,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.ExchangeTransactionContract.prototype.toObject=function(e){return TronWebProto.ExchangeTransactionContract.toObject(e,this)},TronWebProto.ExchangeTransactionContract.toObject=function(e,t){var r={ownerAddress:t.getOwnerAddress_asB64(),exchangeId:n.Message.getFieldWithDefault(t,2,0),tokenId:t.getTokenId_asB64(),quant:n.Message.getFieldWithDefault(t,4,0),expected:n.Message.getFieldWithDefault(t,5,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.ExchangeTransactionContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.ExchangeTransactionContract;return TronWebProto.ExchangeTransactionContract.deserializeBinaryFromReader(r,t)},TronWebProto.ExchangeTransactionContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setOwnerAddress(r);break;case 2:r=t.readInt64();e.setExchangeId(r);break;case 3:r=t.readBytes();e.setTokenId(r);break;case 4:r=t.readInt64();e.setQuant(r);break;case 5:r=t.readInt64();e.setExpected(r);break;default:t.skipField()}}return e},TronWebProto.ExchangeTransactionContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.ExchangeTransactionContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.ExchangeTransactionContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r),0!==(r=e.getExchangeId())&&t.writeInt64(2,r),(r=e.getTokenId_asU8()).length>0&&t.writeBytes(3,r),0!==(r=e.getQuant())&&t.writeInt64(4,r),0!==(r=e.getExpected())&&t.writeInt64(5,r)},TronWebProto.ExchangeTransactionContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.ExchangeTransactionContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.ExchangeTransactionContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.ExchangeTransactionContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.ExchangeTransactionContract.prototype.getExchangeId=function(){return n.Message.getFieldWithDefault(this,2,0)},TronWebProto.ExchangeTransactionContract.prototype.setExchangeId=function(e){return n.Message.setProto3IntField(this,2,e)},TronWebProto.ExchangeTransactionContract.prototype.getTokenId=function(){return n.Message.getFieldWithDefault(this,3,"")},TronWebProto.ExchangeTransactionContract.prototype.getTokenId_asB64=function(){return n.Message.bytesAsB64(this.getTokenId())},TronWebProto.ExchangeTransactionContract.prototype.getTokenId_asU8=function(){return n.Message.bytesAsU8(this.getTokenId())},TronWebProto.ExchangeTransactionContract.prototype.setTokenId=function(e){return n.Message.setProto3BytesField(this,3,e)},TronWebProto.ExchangeTransactionContract.prototype.getQuant=function(){return n.Message.getFieldWithDefault(this,4,0)},TronWebProto.ExchangeTransactionContract.prototype.setQuant=function(e){return n.Message.setProto3IntField(this,4,e)},TronWebProto.ExchangeTransactionContract.prototype.getExpected=function(){return n.Message.getFieldWithDefault(this,5,0)},TronWebProto.ExchangeTransactionContract.prototype.setExpected=function(e){return n.Message.setProto3IntField(this,5,e)},o.object.extend(t,TronWebProto)},"./node_modules/tronweb/lib/esm/protocol/core/contract/proposal_contract_pb.cjs"(e,t,r){var n=r("./node_modules/google-protobuf/google-protobuf.js"),o=n,s="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof window&&window||void 0!==s&&s||"undefined"!=typeof self&&self||function(){return this}.call(null)||Function("return this")();o.exportSymbol("TronWebProto.ProposalApproveContract",null,s),o.exportSymbol("TronWebProto.ProposalCreateContract",null,s),o.exportSymbol("TronWebProto.ProposalDeleteContract",null,s),TronWebProto.ProposalApproveContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.ProposalApproveContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.ProposalApproveContract.displayName="TronWebProto.ProposalApproveContract"),TronWebProto.ProposalCreateContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.ProposalCreateContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.ProposalCreateContract.displayName="TronWebProto.ProposalCreateContract"),TronWebProto.ProposalDeleteContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.ProposalDeleteContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.ProposalDeleteContract.displayName="TronWebProto.ProposalDeleteContract"),n.Message.GENERATE_TO_OBJECT&&(TronWebProto.ProposalApproveContract.prototype.toObject=function(e){return TronWebProto.ProposalApproveContract.toObject(e,this)},TronWebProto.ProposalApproveContract.toObject=function(e,t){var r={ownerAddress:t.getOwnerAddress_asB64(),proposalId:n.Message.getFieldWithDefault(t,2,0),isAddApproval:n.Message.getBooleanFieldWithDefault(t,3,!1)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.ProposalApproveContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.ProposalApproveContract;return TronWebProto.ProposalApproveContract.deserializeBinaryFromReader(r,t)},TronWebProto.ProposalApproveContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setOwnerAddress(r);break;case 2:r=t.readInt64();e.setProposalId(r);break;case 3:r=t.readBool();e.setIsAddApproval(r);break;default:t.skipField()}}return e},TronWebProto.ProposalApproveContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.ProposalApproveContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.ProposalApproveContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r),0!==(r=e.getProposalId())&&t.writeInt64(2,r),(r=e.getIsAddApproval())&&t.writeBool(3,r)},TronWebProto.ProposalApproveContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.ProposalApproveContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.ProposalApproveContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.ProposalApproveContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.ProposalApproveContract.prototype.getProposalId=function(){return n.Message.getFieldWithDefault(this,2,0)},TronWebProto.ProposalApproveContract.prototype.setProposalId=function(e){return n.Message.setProto3IntField(this,2,e)},TronWebProto.ProposalApproveContract.prototype.getIsAddApproval=function(){return n.Message.getBooleanFieldWithDefault(this,3,!1)},TronWebProto.ProposalApproveContract.prototype.setIsAddApproval=function(e){return n.Message.setProto3BooleanField(this,3,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.ProposalCreateContract.prototype.toObject=function(e){return TronWebProto.ProposalCreateContract.toObject(e,this)},TronWebProto.ProposalCreateContract.toObject=function(e,t){var r,n={ownerAddress:t.getOwnerAddress_asB64(),parametersMap:(r=t.getParametersMap())?r.toObject(e,void 0):[]};return e&&(n.$jspbMessageInstance=t),n}),TronWebProto.ProposalCreateContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.ProposalCreateContract;return TronWebProto.ProposalCreateContract.deserializeBinaryFromReader(r,t)},TronWebProto.ProposalCreateContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setOwnerAddress(r);break;case 2:r=e.getParametersMap();t.readMessage(r,(function(e,t){n.Map.deserializeBinary(e,t,n.BinaryReader.prototype.readInt64,n.BinaryReader.prototype.readInt64,null,0,0)}));break;default:t.skipField()}}return e},TronWebProto.ProposalCreateContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.ProposalCreateContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.ProposalCreateContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r),(r=e.getParametersMap(!0))&&r.getLength()>0&&r.serializeBinary(2,t,n.BinaryWriter.prototype.writeInt64,n.BinaryWriter.prototype.writeInt64)},TronWebProto.ProposalCreateContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.ProposalCreateContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.ProposalCreateContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.ProposalCreateContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.ProposalCreateContract.prototype.getParametersMap=function(e){return n.Message.getMapField(this,2,e,null)},TronWebProto.ProposalCreateContract.prototype.clearParametersMap=function(){return this.getParametersMap().clear(),this},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.ProposalDeleteContract.prototype.toObject=function(e){return TronWebProto.ProposalDeleteContract.toObject(e,this)},TronWebProto.ProposalDeleteContract.toObject=function(e,t){var r={ownerAddress:t.getOwnerAddress_asB64(),proposalId:n.Message.getFieldWithDefault(t,2,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.ProposalDeleteContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.ProposalDeleteContract;return TronWebProto.ProposalDeleteContract.deserializeBinaryFromReader(r,t)},TronWebProto.ProposalDeleteContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setOwnerAddress(r);break;case 2:r=t.readInt64();e.setProposalId(r);break;default:t.skipField()}}return e},TronWebProto.ProposalDeleteContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.ProposalDeleteContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.ProposalDeleteContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r),0!==(r=e.getProposalId())&&t.writeInt64(2,r)},TronWebProto.ProposalDeleteContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.ProposalDeleteContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.ProposalDeleteContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.ProposalDeleteContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.ProposalDeleteContract.prototype.getProposalId=function(){return n.Message.getFieldWithDefault(this,2,0)},TronWebProto.ProposalDeleteContract.prototype.setProposalId=function(e){return n.Message.setProto3IntField(this,2,e)},o.object.extend(t,TronWebProto)},"./node_modules/tronweb/lib/esm/protocol/core/contract/smart_contract_pb.cjs"(e,t,r){var n=r("./node_modules/google-protobuf/google-protobuf.js"),o=n,s="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof window&&window||void 0!==s&&s||"undefined"!=typeof self&&self||function(){return this}.call(null)||Function("return this")(),i=r("./node_modules/tronweb/lib/esm/protocol/core/Tron_pb.cjs");o.object.extend(proto,i),o.exportSymbol("TronWebProto.ClearABIContract",null,s),o.exportSymbol("TronWebProto.ContractState",null,s),o.exportSymbol("TronWebProto.CreateSmartContract",null,s),o.exportSymbol("TronWebProto.SmartContract",null,s),o.exportSymbol("TronWebProto.SmartContract.ABI",null,s),o.exportSymbol("TronWebProto.SmartContract.ABI.Entry",null,s),o.exportSymbol("TronWebProto.SmartContract.ABI.Entry.EntryType",null,s),o.exportSymbol("TronWebProto.SmartContract.ABI.Entry.Param",null,s),o.exportSymbol("TronWebProto.SmartContract.ABI.Entry.StateMutabilityType",null,s),o.exportSymbol("TronWebProto.SmartContractDataWrapper",null,s),o.exportSymbol("TronWebProto.TriggerSmartContract",null,s),o.exportSymbol("TronWebProto.UpdateEnergyLimitContract",null,s),o.exportSymbol("TronWebProto.UpdateSettingContract",null,s),TronWebProto.SmartContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.SmartContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.SmartContract.displayName="TronWebProto.SmartContract"),TronWebProto.SmartContract.ABI=function(e){n.Message.initialize(this,e,0,-1,TronWebProto.SmartContract.ABI.repeatedFields_,null)},o.inherits(TronWebProto.SmartContract.ABI,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.SmartContract.ABI.displayName="TronWebProto.SmartContract.ABI"),TronWebProto.SmartContract.ABI.Entry=function(e){n.Message.initialize(this,e,0,-1,TronWebProto.SmartContract.ABI.Entry.repeatedFields_,null)},o.inherits(TronWebProto.SmartContract.ABI.Entry,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.SmartContract.ABI.Entry.displayName="TronWebProto.SmartContract.ABI.Entry"),TronWebProto.SmartContract.ABI.Entry.Param=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.SmartContract.ABI.Entry.Param,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.SmartContract.ABI.Entry.Param.displayName="TronWebProto.SmartContract.ABI.Entry.Param"),TronWebProto.ContractState=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.ContractState,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.ContractState.displayName="TronWebProto.ContractState"),TronWebProto.CreateSmartContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.CreateSmartContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.CreateSmartContract.displayName="TronWebProto.CreateSmartContract"),TronWebProto.TriggerSmartContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.TriggerSmartContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.TriggerSmartContract.displayName="TronWebProto.TriggerSmartContract"),TronWebProto.ClearABIContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.ClearABIContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.ClearABIContract.displayName="TronWebProto.ClearABIContract"),TronWebProto.UpdateSettingContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.UpdateSettingContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.UpdateSettingContract.displayName="TronWebProto.UpdateSettingContract"),TronWebProto.UpdateEnergyLimitContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.UpdateEnergyLimitContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.UpdateEnergyLimitContract.displayName="TronWebProto.UpdateEnergyLimitContract"),TronWebProto.SmartContractDataWrapper=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.SmartContractDataWrapper,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.SmartContractDataWrapper.displayName="TronWebProto.SmartContractDataWrapper"),n.Message.GENERATE_TO_OBJECT&&(TronWebProto.SmartContract.prototype.toObject=function(e){return TronWebProto.SmartContract.toObject(e,this)},TronWebProto.SmartContract.toObject=function(e,t){var r,o={originAddress:t.getOriginAddress_asB64(),contractAddress:t.getContractAddress_asB64(),abi:(r=t.getAbi())&&TronWebProto.SmartContract.ABI.toObject(e,r),bytecode:t.getBytecode_asB64(),callValue:n.Message.getFieldWithDefault(t,5,0),consumeUserResourcePercent:n.Message.getFieldWithDefault(t,6,0),name:n.Message.getFieldWithDefault(t,7,""),originEnergyLimit:n.Message.getFieldWithDefault(t,8,0),codeHash:t.getCodeHash_asB64(),trxHash:t.getTrxHash_asB64(),version:n.Message.getFieldWithDefault(t,11,0)};return e&&(o.$jspbMessageInstance=t),o}),TronWebProto.SmartContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.SmartContract;return TronWebProto.SmartContract.deserializeBinaryFromReader(r,t)},TronWebProto.SmartContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setOriginAddress(r);break;case 2:r=t.readBytes();e.setContractAddress(r);break;case 3:r=new TronWebProto.SmartContract.ABI;t.readMessage(r,TronWebProto.SmartContract.ABI.deserializeBinaryFromReader),e.setAbi(r);break;case 4:r=t.readBytes();e.setBytecode(r);break;case 5:r=t.readInt64();e.setCallValue(r);break;case 6:r=t.readInt64();e.setConsumeUserResourcePercent(r);break;case 7:r=t.readString();e.setName(r);break;case 8:r=t.readInt64();e.setOriginEnergyLimit(r);break;case 9:r=t.readBytes();e.setCodeHash(r);break;case 10:r=t.readBytes();e.setTrxHash(r);break;case 11:r=t.readInt32();e.setVersion(r);break;default:t.skipField()}}return e},TronWebProto.SmartContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.SmartContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.SmartContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getOriginAddress_asU8()).length>0&&t.writeBytes(1,r),(r=e.getContractAddress_asU8()).length>0&&t.writeBytes(2,r),null!=(r=e.getAbi())&&t.writeMessage(3,r,TronWebProto.SmartContract.ABI.serializeBinaryToWriter),(r=e.getBytecode_asU8()).length>0&&t.writeBytes(4,r),0!==(r=e.getCallValue())&&t.writeInt64(5,r),0!==(r=e.getConsumeUserResourcePercent())&&t.writeInt64(6,r),(r=e.getName()).length>0&&t.writeString(7,r),0!==(r=e.getOriginEnergyLimit())&&t.writeInt64(8,r),(r=e.getCodeHash_asU8()).length>0&&t.writeBytes(9,r),(r=e.getTrxHash_asU8()).length>0&&t.writeBytes(10,r),0!==(r=e.getVersion())&&t.writeInt32(11,r)},TronWebProto.SmartContract.ABI.repeatedFields_=[1],n.Message.GENERATE_TO_OBJECT&&(TronWebProto.SmartContract.ABI.prototype.toObject=function(e){return TronWebProto.SmartContract.ABI.toObject(e,this)},TronWebProto.SmartContract.ABI.toObject=function(e,t){var r={entrysList:n.Message.toObjectList(t.getEntrysList(),TronWebProto.SmartContract.ABI.Entry.toObject,e)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.SmartContract.ABI.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.SmartContract.ABI;return TronWebProto.SmartContract.ABI.deserializeBinaryFromReader(r,t)},TronWebProto.SmartContract.ABI.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){if(1===t.getFieldNumber()){var r=new TronWebProto.SmartContract.ABI.Entry;t.readMessage(r,TronWebProto.SmartContract.ABI.Entry.deserializeBinaryFromReader),e.addEntrys(r)}else t.skipField()}return e},TronWebProto.SmartContract.ABI.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.SmartContract.ABI.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.SmartContract.ABI.serializeBinaryToWriter=function(e,t){var r;(r=e.getEntrysList()).length>0&&t.writeRepeatedMessage(1,r,TronWebProto.SmartContract.ABI.Entry.serializeBinaryToWriter)},TronWebProto.SmartContract.ABI.Entry.repeatedFields_=[4,5],n.Message.GENERATE_TO_OBJECT&&(TronWebProto.SmartContract.ABI.Entry.prototype.toObject=function(e){return TronWebProto.SmartContract.ABI.Entry.toObject(e,this)},TronWebProto.SmartContract.ABI.Entry.toObject=function(e,t){var r={anonymous:n.Message.getBooleanFieldWithDefault(t,1,!1),constant:n.Message.getBooleanFieldWithDefault(t,2,!1),name:n.Message.getFieldWithDefault(t,3,""),inputsList:n.Message.toObjectList(t.getInputsList(),TronWebProto.SmartContract.ABI.Entry.Param.toObject,e),outputsList:n.Message.toObjectList(t.getOutputsList(),TronWebProto.SmartContract.ABI.Entry.Param.toObject,e),type:n.Message.getFieldWithDefault(t,6,0),payable:n.Message.getBooleanFieldWithDefault(t,7,!1),statemutability:n.Message.getFieldWithDefault(t,8,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.SmartContract.ABI.Entry.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.SmartContract.ABI.Entry;return TronWebProto.SmartContract.ABI.Entry.deserializeBinaryFromReader(r,t)},TronWebProto.SmartContract.ABI.Entry.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBool();e.setAnonymous(r);break;case 2:r=t.readBool();e.setConstant(r);break;case 3:r=t.readString();e.setName(r);break;case 4:r=new TronWebProto.SmartContract.ABI.Entry.Param;t.readMessage(r,TronWebProto.SmartContract.ABI.Entry.Param.deserializeBinaryFromReader),e.addInputs(r);break;case 5:r=new TronWebProto.SmartContract.ABI.Entry.Param;t.readMessage(r,TronWebProto.SmartContract.ABI.Entry.Param.deserializeBinaryFromReader),e.addOutputs(r);break;case 6:r=t.readEnum();e.setType(r);break;case 7:r=t.readBool();e.setPayable(r);break;case 8:r=t.readEnum();e.setStatemutability(r);break;default:t.skipField()}}return e},TronWebProto.SmartContract.ABI.Entry.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.SmartContract.ABI.Entry.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.SmartContract.ABI.Entry.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getAnonymous())&&t.writeBool(1,r),(r=e.getConstant())&&t.writeBool(2,r),(r=e.getName()).length>0&&t.writeString(3,r),(r=e.getInputsList()).length>0&&t.writeRepeatedMessage(4,r,TronWebProto.SmartContract.ABI.Entry.Param.serializeBinaryToWriter),(r=e.getOutputsList()).length>0&&t.writeRepeatedMessage(5,r,TronWebProto.SmartContract.ABI.Entry.Param.serializeBinaryToWriter),0!==(r=e.getType())&&t.writeEnum(6,r),(r=e.getPayable())&&t.writeBool(7,r),0!==(r=e.getStatemutability())&&t.writeEnum(8,r)},TronWebProto.SmartContract.ABI.Entry.EntryType={UNKNOWNENTRYTYPE:0,CONSTRUCTOR:1,FUNCTION:2,EVENT:3,FALLBACK:4,RECEIVE:5,ERROR:6},TronWebProto.SmartContract.ABI.Entry.StateMutabilityType={UNKNOWNMUTABILITYTYPE:0,PURE:1,VIEW:2,NONPAYABLE:3,PAYABLE:4},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.SmartContract.ABI.Entry.Param.prototype.toObject=function(e){return TronWebProto.SmartContract.ABI.Entry.Param.toObject(e,this)},TronWebProto.SmartContract.ABI.Entry.Param.toObject=function(e,t){var r={indexed:n.Message.getBooleanFieldWithDefault(t,1,!1),name:n.Message.getFieldWithDefault(t,2,""),type:n.Message.getFieldWithDefault(t,3,"")};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.SmartContract.ABI.Entry.Param.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.SmartContract.ABI.Entry.Param;return TronWebProto.SmartContract.ABI.Entry.Param.deserializeBinaryFromReader(r,t)},TronWebProto.SmartContract.ABI.Entry.Param.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBool();e.setIndexed(r);break;case 2:r=t.readString();e.setName(r);break;case 3:r=t.readString();e.setType(r);break;default:t.skipField()}
vendor: 8,812 bytes, line 2
2}return e},TronWebProto.SmartContract.ABI.Entry.Param.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.SmartContract.ABI.Entry.Param.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.SmartContract.ABI.Entry.Param.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getIndexed())&&t.writeBool(1,r),(r=e.getName()).length>0&&t.writeString(2,r),(r=e.getType()).length>0&&t.writeString(3,r)},TronWebProto.SmartContract.ABI.Entry.Param.prototype.getIndexed=function(){return n.Message.getBooleanFieldWithDefault(this,1,!1)},TronWebProto.SmartContract.ABI.Entry.Param.prototype.setIndexed=function(e){return n.Message.setProto3BooleanField(this,1,e)},TronWebProto.SmartContract.ABI.Entry.Param.prototype.getName=function(){return n.Message.getFieldWithDefault(this,2,"")},TronWebProto.SmartContract.ABI.Entry.Param.prototype.setName=function(e){return n.Message.setProto3StringField(this,2,e)},TronWebProto.SmartContract.ABI.Entry.Param.prototype.getType=function(){return n.Message.getFieldWithDefault(this,3,"")},TronWebProto.SmartContract.ABI.Entry.Param.prototype.setType=function(e){return n.Message.setProto3StringField(this,3,e)},TronWebProto.SmartContract.ABI.Entry.prototype.getAnonymous=function(){return n.Message.getBooleanFieldWithDefault(this,1,!1)},TronWebProto.SmartContract.ABI.Entry.prototype.setAnonymous=function(e){return n.Message.setProto3BooleanField(this,1,e)},TronWebProto.SmartContract.ABI.Entry.prototype.getConstant=function(){return n.Message.getBooleanFieldWithDefault(this,2,!1)},TronWebProto.SmartContract.ABI.Entry.prototype.setConstant=function(e){return n.Message.setProto3BooleanField(this,2,e)},TronWebProto.SmartContract.ABI.Entry.prototype.getName=function(){return n.Message.getFieldWithDefault(this,3,"")},TronWebProto.SmartContract.ABI.Entry.prototype.setName=function(e){return n.Message.setProto3StringField(this,3,e)},TronWebProto.SmartContract.ABI.Entry.prototype.getInputsList=function(){return n.Message.getRepeatedWrapperField(this,TronWebProto.SmartContract.ABI.Entry.Param,4)},TronWebProto.SmartContract.ABI.Entry.prototype.setInputsList=function(e){return n.Message.setRepeatedWrapperField(this,4,e)},TronWebProto.SmartContract.ABI.Entry.prototype.addInputs=function(e,t){return n.Message.addToRepeatedWrapperField(this,4,e,TronWebProto.SmartContract.ABI.Entry.Param,t)},TronWebProto.SmartContract.ABI.Entry.prototype.clearInputsList=function(){return this.setInputsList([])},TronWebProto.SmartContract.ABI.Entry.prototype.getOutputsList=function(){return n.Message.getRepeatedWrapperField(this,TronWebProto.SmartContract.ABI.Entry.Param,5)},TronWebProto.SmartContract.ABI.Entry.prototype.setOutputsList=function(e){return n.Message.setRepeatedWrapperField(this,5,e)},TronWebProto.SmartContract.ABI.Entry.prototype.addOutputs=function(e,t){return n.Message.addToRepeatedWrapperField(this,5,e,TronWebProto.SmartContract.ABI.Entry.Param,t)},TronWebProto.SmartContract.ABI.Entry.prototype.clearOutputsList=function(){return this.setOutputsList([])},TronWebProto.SmartContract.ABI.Entry.prototype.getType=function(){return n.Message.getFieldWithDefault(this,6,0)},TronWebProto.SmartContract.ABI.Entry.prototype.setType=function(e){return n.Message.setProto3EnumField(this,6,e)},TronWebProto.SmartContract.ABI.Entry.prototype.getPayable=function(){return n.Message.getBooleanFieldWithDefault(this,7,!1)},TronWebProto.SmartContract.ABI.Entry.prototype.setPayable=function(e){return n.Message.setProto3BooleanField(this,7,e)},TronWebProto.SmartContract.ABI.Entry.prototype.getStatemutability=function(){return n.Message.getFieldWithDefault(this,8,0)},TronWebProto.SmartContract.ABI.Entry.prototype.setStatemutability=function(e){return n.Message.setProto3EnumField(this,8,e)},TronWebProto.SmartContract.ABI.prototype.getEntrysList=function(){return n.Message.getRepeatedWrapperField(this,TronWebProto.SmartContract.ABI.Entry,1)},TronWebProto.SmartContract.ABI.prototype.setEntrysList=function(e){return n.Message.setRepeatedWrapperField(this,1,e)},TronWebProto.SmartContract.ABI.prototype.addEntrys=function(e,t){return n.Message.addToRepeatedWrapperField(this,1,e,TronWebProto.SmartContract.ABI.Entry,t)},TronWebProto.SmartContract.ABI.prototype.clearEntrysList=function(){return this.setEntrysList([])},TronWebProto.SmartContract.prototype.getOriginAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.SmartContract.prototype.getOriginAddress_asB64=function(){return n.Message.bytesAsB64(this.getOriginAddress())},TronWebProto.SmartContract.prototype.getOriginAddress_asU8=function(){return n.Message.bytesAsU8(this.getOriginAddress())},TronWebProto.SmartContract.prototype.setOriginAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.SmartContract.prototype.getContractAddress=function(){return n.Message.getFieldWithDefault(this,2,"")},TronWebProto.SmartContract.prototype.getContractAddress_asB64=function(){return n.Message.bytesAsB64(this.getContractAddress())},TronWebProto.SmartContract.prototype.getContractAddress_asU8=function(){return n.Message.bytesAsU8(this.getContractAddress())},TronWebProto.SmartContract.prototype.setContractAddress=function(e){return n.Message.setProto3BytesField(this,2,e)},TronWebProto.SmartContract.prototype.getAbi=function(){return n.Message.getWrapperField(this,TronWebProto.SmartContract.ABI,3)},TronWebProto.SmartContract.prototype.setAbi=function(e){return n.Message.setWrapperField(this,3,e)},TronWebProto.SmartContract.prototype.clearAbi=function(){return this.setAbi(void 0)},TronWebProto.SmartContract.prototype.hasAbi=function(){return null!=n.Message.getField(this,3)},TronWebProto.SmartContract.prototype.getBytecode=function(){return n.Message.getFieldWithDefault(this,4,"")},TronWebProto.SmartContract.prototype.getBytecode_asB64=function(){return n.Message.bytesAsB64(this.getBytecode())},TronWebProto.SmartContract.prototype.getBytecode_asU8=function(){return n.Message.bytesAsU8(this.getBytecode())},TronWebProto.SmartContract.prototype.setBytecode=function(e){return n.Message.setProto3BytesField(this,4,e)},TronWebProto.SmartContract.prototype.getCallValue=function(){return n.Message.getFieldWithDefault(this,5,0)},TronWebProto.SmartContract.prototype.setCallValue=function(e){return n.Message.setProto3IntField(this,5,e)},TronWebProto.SmartContract.prototype.getConsumeUserResourcePercent=function(){return n.Message.getFieldWithDefault(this,6,0)},TronWebProto.SmartContract.prototype.setConsumeUserResourcePercent=function(e){return n.Message.setProto3IntField(this,6,e)},TronWebProto.SmartContract.prototype.getName=function(){return n.Message.getFieldWithDefault(this,7,"")},TronWebProto.SmartContract.prototype.setName=function(e){return n.Message.setProto3StringField(this,7,e)},TronWebProto.SmartContract.prototype.getOriginEnergyLimit=function(){return n.Message.getFieldWithDefault(this,8,0)},TronWebProto.SmartContract.prototype.setOriginEnergyLimit=function(e){return n.Message.setProto3IntField(this,8,e)},TronWebProto.SmartContract.prototype.getCodeHash=function(){return n.Message.getFieldWithDefault(this,9,"")},TronWebProto.SmartContract.prototype.getCodeHash_asB64=function(){return n.Message.bytesAsB64(this.getCodeHash())},TronWebProto.SmartContract.prototype.getCodeHash_asU8=function(){return n.Message.bytesAsU8(this.getCodeHash())},TronWebProto.SmartContract.prototype.setCodeHash=function(e){return n.Message.setProto3BytesField(this,9,e)},TronWebProto.SmartContract.prototype.getTrxHash=function(){return n.Message.getFieldWithDefault(this,10,"")},TronWebProto.SmartContract.prototype.getTrxHash_asB64=function(){return n.Message.bytesAsB64(this.getTrxHash())},TronWebProto.SmartContract.prototype.getTrxHash_asU8=function(){return n.Message.bytesAsU8(this.getTrxHash())},TronWebProto.SmartContract.prototype.setTrxHash=function(e){return n.Message.setProto3BytesField(this,10,e)},TronWebProto.SmartContract.prototype.getVersion=function(){return n.Message.getFieldWithDefault(this,11,0)},TronWebProto.SmartContract.prototype.setVersion=function(e){return n.Message.setProto3IntField(this,11,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.ContractState.prototype.toObject=function(e){return TronWebProto.ContractState.toObject(e,this)},TronWebProto.ContractState.toObject=function(e,t){var r={energyUsage:n.Message.getFieldWithDefault(t,1,0),energyFactor:n.Message.getFieldWithDefault(t,2,0),updateCycle:n.Message.getFieldWithDefault(t,3,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.ContractState.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.ContractState;return TronWebProto.ContractState.deserializeBinaryFromReader(r,t)},TronWebProto.ContractState.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)
vendor: 39,232 bytes, line 2
2{switch(t.getFieldNumber()){case 1:var r=t.readInt64();e.setEnergyUsage(r);break;case 2:r=t.readInt64();e.setEnergyFactor(r);break;case 3:r=t.readInt64();e.setUpdateCycle(r);break;default:t.skipField()}}return e},TronWebProto.ContractState.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.ContractState.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.ContractState.serializeBinaryToWriter=function(e,t){var r=void 0;0!==(r=e.getEnergyUsage())&&t.writeInt64(1,r),0!==(r=e.getEnergyFactor())&&t.writeInt64(2,r),0!==(r=e.getUpdateCycle())&&t.writeInt64(3,r)},TronWebProto.ContractState.prototype.getEnergyUsage=function(){return n.Message.getFieldWithDefault(this,1,0)},TronWebProto.ContractState.prototype.setEnergyUsage=function(e){return n.Message.setProto3IntField(this,1,e)},TronWebProto.ContractState.prototype.getEnergyFactor=function(){return n.Message.getFieldWithDefault(this,2,0)},TronWebProto.ContractState.prototype.setEnergyFactor=function(e){return n.Message.setProto3IntField(this,2,e)},TronWebProto.ContractState.prototype.getUpdateCycle=function(){return n.Message.getFieldWithDefault(this,3,0)},TronWebProto.ContractState.prototype.setUpdateCycle=function(e){return n.Message.setProto3IntField(this,3,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.CreateSmartContract.prototype.toObject=function(e){return TronWebProto.CreateSmartContract.toObject(e,this)},TronWebProto.CreateSmartContract.toObject=function(e,t){var r,o={ownerAddress:t.getOwnerAddress_asB64(),newContract:(r=t.getNewContract())&&TronWebProto.SmartContract.toObject(e,r),callTokenValue:n.Message.getFieldWithDefault(t,3,0),tokenId:n.Message.getFieldWithDefault(t,4,0)};return e&&(o.$jspbMessageInstance=t),o}),TronWebProto.CreateSmartContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.CreateSmartContract;return TronWebProto.CreateSmartContract.deserializeBinaryFromReader(r,t)},TronWebProto.CreateSmartContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setOwnerAddress(r);break;case 2:r=new TronWebProto.SmartContract;t.readMessage(r,TronWebProto.SmartContract.deserializeBinaryFromReader),e.setNewContract(r);break;case 3:r=t.readInt64();e.setCallTokenValue(r);break;case 4:r=t.readInt64();e.setTokenId(r);break;default:t.skipField()}}return e},TronWebProto.CreateSmartContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.CreateSmartContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.CreateSmartContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r),null!=(r=e.getNewContract())&&t.writeMessage(2,r,TronWebProto.SmartContract.serializeBinaryToWriter),0!==(r=e.getCallTokenValue())&&t.writeInt64(3,r),0!==(r=e.getTokenId())&&t.writeInt64(4,r)},TronWebProto.CreateSmartContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.CreateSmartContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.CreateSmartContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.CreateSmartContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.CreateSmartContract.prototype.getNewContract=function(){return n.Message.getWrapperField(this,TronWebProto.SmartContract,2)},TronWebProto.CreateSmartContract.prototype.setNewContract=function(e){return n.Message.setWrapperField(this,2,e)},TronWebProto.CreateSmartContract.prototype.clearNewContract=function(){return this.setNewContract(void 0)},TronWebProto.CreateSmartContract.prototype.hasNewContract=function(){return null!=n.Message.getField(this,2)},TronWebProto.CreateSmartContract.prototype.getCallTokenValue=function(){return n.Message.getFieldWithDefault(this,3,0)},TronWebProto.CreateSmartContract.prototype.setCallTokenValue=function(e){return n.Message.setProto3IntField(this,3,e)},TronWebProto.CreateSmartContract.prototype.getTokenId=function(){return n.Message.getFieldWithDefault(this,4,0)},TronWebProto.CreateSmartContract.prototype.setTokenId=function(e){return n.Message.setProto3IntField(this,4,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.TriggerSmartContract.prototype.toObject=function(e){return TronWebProto.TriggerSmartContract.toObject(e,this)},TronWebProto.TriggerSmartContract.toObject=function(e,t){var r={ownerAddress:t.getOwnerAddress_asB64(),contractAddress:t.getContractAddress_asB64(),callValue:n.Message.getFieldWithDefault(t,3,0),data:t.getData_asB64(),callTokenValue:n.Message.getFieldWithDefault(t,5,0),tokenId:n.Message.getFieldWithDefault(t,6,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.TriggerSmartContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.TriggerSmartContract;return TronWebProto.TriggerSmartContract.deserializeBinaryFromReader(r,t)},TronWebProto.TriggerSmartContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setOwnerAddress(r);break;case 2:r=t.readBytes();e.setContractAddress(r);break;case 3:r=t.readInt64();e.setCallValue(r);break;case 4:r=t.readBytes();e.setData(r);break;case 5:r=t.readInt64();e.setCallTokenValue(r);break;case 6:r=t.readInt64();e.setTokenId(r);break;default:t.skipField()}}return e},TronWebProto.TriggerSmartContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.TriggerSmartContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.TriggerSmartContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r),(r=e.getContractAddress_asU8()).length>0&&t.writeBytes(2,r),0!==(r=e.getCallValue())&&t.writeInt64(3,r),(r=e.getData_asU8()).length>0&&t.writeBytes(4,r),0!==(r=e.getCallTokenValue())&&t.writeInt64(5,r),0!==(r=e.getTokenId())&&t.writeInt64(6,r)},TronWebProto.TriggerSmartContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.TriggerSmartContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.TriggerSmartContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.TriggerSmartContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.TriggerSmartContract.prototype.getContractAddress=function(){return n.Message.getFieldWithDefault(this,2,"")},TronWebProto.TriggerSmartContract.prototype.getContractAddress_asB64=function(){return n.Message.bytesAsB64(this.getContractAddress())},TronWebProto.TriggerSmartContract.prototype.getContractAddress_asU8=function(){return n.Message.bytesAsU8(this.getContractAddress())},TronWebProto.TriggerSmartContract.prototype.setContractAddress=function(e){return n.Message.setProto3BytesField(this,2,e)},TronWebProto.TriggerSmartContract.prototype.getCallValue=function(){return n.Message.getFieldWithDefault(this,3,0)},TronWebProto.TriggerSmartContract.prototype.setCallValue=function(e){return n.Message.setProto3IntField(this,3,e)},TronWebProto.TriggerSmartContract.prototype.getData=function(){return n.Message.getFieldWithDefault(this,4,"")},TronWebProto.TriggerSmartContract.prototype.getData_asB64=function(){return n.Message.bytesAsB64(this.getData())},TronWebProto.TriggerSmartContract.prototype.getData_asU8=function(){return n.Message.bytesAsU8(this.getData())},TronWebProto.TriggerSmartContract.prototype.setData=function(e){return n.Message.setProto3BytesField(this,4,e)},TronWebProto.TriggerSmartContract.prototype.getCallTokenValue=function(){return n.Message.getFieldWithDefault(this,5,0)},TronWebProto.TriggerSmartContract.prototype.setCallTokenValue=function(e){return n.Message.setProto3IntField(this,5,e)},TronWebProto.TriggerSmartContract.prototype.getTokenId=function(){return n.Message.getFieldWithDefault(this,6,0)},TronWebProto.TriggerSmartContract.prototype.setTokenId=function(e){return n.Message.setProto3IntField(this,6,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.ClearABIContract.prototype.toObject=function(e){return TronWebProto.ClearABIContract.toObject(e,this)},TronWebProto.ClearABIContract.toObject=function(e,t){var r={ownerAddress:t.getOwnerAddress_asB64(),contractAddress:t.getContractAddress_asB64()};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.ClearABIContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.ClearABIContract;return TronWebProto.ClearABIContract.deserializeBinaryFromReader(r,t)},TronWebProto.ClearABIContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setOwnerAddress(r);break;case 2:r=t.readBytes();e.setContractAddress(r);break;default:t.skipField()}}return e},TronWebProto.ClearABIContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.ClearABIContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.ClearABIContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r),(r=e.getContractAddress_asU8()).length>0&&t.writeBytes(2,r)},TronWebProto.ClearABIContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.ClearABIContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.ClearABIContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.ClearABIContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.ClearABIContract.prototype.getContractAddress=function(){return n.Message.getFieldWithDefault(this,2,"")},TronWebProto.ClearABIContract.prototype.getContractAddress_asB64=function(){return n.Message.bytesAsB64(this.getContractAddress())},TronWebProto.ClearABIContract.prototype.getContractAddress_asU8=function(){return n.Message.bytesAsU8(this.getContractAddress())},TronWebProto.ClearABIContract.prototype.setContractAddress=function(e){return n.Message.setProto3BytesField(this,2,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.UpdateSettingContract.prototype.toObject=function(e){return TronWebProto.UpdateSettingContract.toObject(e,this)},TronWebProto.UpdateSettingContract.toObject=function(e,t){var r={ownerAddress:t.getOwnerAddress_asB64(),contractAddress:t.getContractAddress_asB64(),consumeUserResourcePercent:n.Message.getFieldWithDefault(t,3,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.UpdateSettingContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.UpdateSettingContract;return TronWebProto.UpdateSettingContract.deserializeBinaryFromReader(r,t)},TronWebProto.UpdateSettingContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setOwnerAddress(r);break;case 2:r=t.readBytes();e.setContractAddress(r);break;case 3:r=t.readInt64();e.setConsumeUserResourcePercent(r);break;default:t.skipField()}}return e},TronWebProto.UpdateSettingContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.UpdateSettingContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.UpdateSettingContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r),(r=e.getContractAddress_asU8()).length>0&&t.writeBytes(2,r),0!==(r=e.getConsumeUserResourcePercent())&&t.writeInt64(3,r)},TronWebProto.UpdateSettingContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.UpdateSettingContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.UpdateSettingContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.UpdateSettingContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.UpdateSettingContract.prototype.getContractAddress=function(){return n.Message.getFieldWithDefault(this,2,"")},TronWebProto.UpdateSettingContract.prototype.getContractAddress_asB64=function(){return n.Message.bytesAsB64(this.getContractAddress())},TronWebProto.UpdateSettingContract.prototype.getContractAddress_asU8=function(){return n.Message.bytesAsU8(this.getContractAddress())},TronWebProto.UpdateSettingContract.prototype.setContractAddress=function(e){return n.Message.setProto3BytesField(this,2,e)},TronWebProto.UpdateSettingContract.prototype.getConsumeUserResourcePercent=function(){return n.Message.getFieldWithDefault(this,3,0)},TronWebProto.UpdateSettingContract.prototype.setConsumeUserResourcePercent=function(e){return n.Message.setProto3IntField(this,3,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.UpdateEnergyLimitContract.prototype.toObject=function(e){return TronWebProto.UpdateEnergyLimitContract.toObject(e,this)},TronWebProto.UpdateEnergyLimitContract.toObject=function(e,t){var r={ownerAddress:t.getOwnerAddress_asB64(),contractAddress:t.getContractAddress_asB64(),originEnergyLimit:n.Message.getFieldWithDefault(t,3,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.UpdateEnergyLimitContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.UpdateEnergyLimitContract;return TronWebProto.UpdateEnergyLimitContract.deserializeBinaryFromReader(r,t)},TronWebProto.UpdateEnergyLimitContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setOwnerAddress(r);break;case 2:r=t.readBytes();e.setContractAddress(r);break;case 3:r=t.readInt64();e.setOriginEnergyLimit(r);break;default:t.skipField()}}return e},TronWebProto.UpdateEnergyLimitContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.UpdateEnergyLimitContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.UpdateEnergyLimitContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r),(r=e.getContractAddress_asU8()).length>0&&t.writeBytes(2,r),0!==(r=e.getOriginEnergyLimit())&&t.writeInt64(3,r)},TronWebProto.UpdateEnergyLimitContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.UpdateEnergyLimitContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.UpdateEnergyLimitContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.UpdateEnergyLimitContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.UpdateEnergyLimitContract.prototype.getContractAddress=function(){return n.Message.getFieldWithDefault(this,2,"")},TronWebProto.UpdateEnergyLimitContract.prototype.getContractAddress_asB64=function(){return n.Message.bytesAsB64(this.getContractAddress())},TronWebProto.UpdateEnergyLimitContract.prototype.getContractAddress_asU8=function(){return n.Message.bytesAsU8(this.getContractAddress())},TronWebProto.UpdateEnergyLimitContract.prototype.setContractAddress=function(e){return n.Message.setProto3BytesField(this,2,e)},TronWebProto.UpdateEnergyLimitContract.prototype.getOriginEnergyLimit=function(){return n.Message.getFieldWithDefault(this,3,0)},TronWebProto.UpdateEnergyLimitContract.prototype.setOriginEnergyLimit=function(e){return n.Message.setProto3IntField(this,3,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.SmartContractDataWrapper.prototype.toObject=function(e){return TronWebProto.SmartContractDataWrapper.toObject(e,this)},TronWebProto.SmartContractDataWrapper.toObject=function(e,t){var r,n={smartContract:(r=t.getSmartContract())&&TronWebProto.SmartContract.toObject(e,r),runtimecode:t.getRuntimecode_asB64(),contractState:(r=t.getContractState())&&TronWebProto.ContractState.toObject(e,r)};return e&&(n.$jspbMessageInstance=t),n}),TronWebProto.SmartContractDataWrapper.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.SmartContractDataWrapper;return TronWebProto.SmartContractDataWrapper.deserializeBinaryFromReader(r,t)},TronWebProto.SmartContractDataWrapper.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=new TronWebProto.SmartContract;t.readMessage(r,TronWebProto.SmartContract.deserializeBinaryFromReader),e.setSmartContract(r);break;case 2:r=t.readBytes();e.setRuntimecode(r);break;case 3:r=new TronWebProto.ContractState;t.readMessage(r,TronWebProto.ContractState.deserializeBinaryFromReader),e.setContractState(r);break;default:t.skipField()}}return e},TronWebProto.SmartContractDataWrapper.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.SmartContractDataWrapper.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.SmartContractDataWrapper.serializeBinaryToWriter=function(e,t){var r=void 0;null!=(r=e.getSmartContract())&&t.writeMessage(1,r,TronWebProto.SmartContract.serializeBinaryToWriter),(r=e.getRuntimecode_asU8()).length>0&&t.writeBytes(2,r),null!=(r=e.getContractState())&&t.writeMessage(3,r,TronWebProto.ContractState.serializeBinaryToWriter)},TronWebProto.SmartContractDataWrapper.prototype.getSmartContract=function(){return n.Message.getWrapperField(this,TronWebProto.SmartContract,1)},TronWebProto.SmartContractDataWrapper.prototype.setSmartContract=function(e){return n.Message.setWrapperField(this,1,e)},TronWebProto.SmartContractDataWrapper.prototype.clearSmartContract=function(){return this.setSmartContract(void 0)},TronWebProto.SmartContractDataWrapper.prototype.hasSmartContract=function(){return null!=n.Message.getField(this,1)},TronWebProto.SmartContractDataWrapper.prototype.getRuntimecode=function(){return n.Message.getFieldWithDefault(this,2,"")},TronWebProto.SmartContractDataWrapper.prototype.getRuntimecode_asB64=function(){return n.Message.bytesAsB64(this.getRuntimecode())},TronWebProto.SmartContractDataWrapper.prototype.getRuntimecode_asU8=function(){return n.Message.bytesAsU8(this.getRuntimecode())},TronWebProto.SmartContractDataWrapper.prototype.setRuntimecode=function(e){return n.Message.setProto3BytesField(this,2,e)},TronWebProto.SmartContractDataWrapper.prototype.getContractState=function(){return n.Message.getWrapperField(this,TronWebProto.ContractState,3)},TronWebProto.SmartContractDataWrapper.prototype.setContractState=function(e){return n.Message.setWrapperField(this,3,e)},TronWebProto.SmartContractDataWrapper.prototype.clearContractState=function(){return this.setContractState(void 0)},TronWebProto.SmartContractDataWrapper.prototype.hasContractState=function(){return null!=n.Message.getField(this,3)},o.object.extend(t,TronWebProto)},"./node_modules/tronweb/lib/esm/protocol/core/contract/storage_contract_pb.cjs"(e,t,r){var n=r("./node_modules/google-protobuf/google-protobuf.js"),o=n,s="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof window&&window||void 0!==s&&s||"undefined"!=typeof self&&self||function(){return this}.call(null)||Function("return this")();o.exportSymbol("TronWebProto.BuyStorageBytesContract",null,s),o.exportSymbol("TronWebProto.BuyStorageContract",null,s),o.exportSymbol("TronWebProto.SellStorageContract",null,s),o.exportSymbol("TronWebProto.UpdateBrokerageContract",null,s),TronWebProto.BuyStorageBytesContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.BuyStorageBytesContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.BuyStorageBytesContract.displayName="TronWebProto.BuyStorageBytesContract"),TronWebProto.BuyStorageContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.BuyStorageContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.BuyStorageContract.displayName="TronWebProto.BuyStorageContract"),TronWebProto.SellStorageContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.SellStorageContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.SellStorageContract.displayName="TronWebProto.SellStorageContract"),TronWebProto.UpdateBrokerageContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.UpdateBrokerageContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.UpdateBrokerageContract.displayName="TronWebProto.UpdateBrokerageContract"),n.Message.GENERATE_TO_OBJECT&&(TronWebProto.BuyStorageBytesContract.prototype.toObject=function(e){return TronWebProto.BuyStorageBytesContract.toObject(e,this)},TronWebProto.BuyStorageBytesContract.toObject=function(e,t){var r={ownerAddress:t.getOwnerAddress_asB64(),bytes:n.Message.getFieldWithDefault(t,2,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.BuyStorageBytesContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.BuyStorageBytesContract;return TronWebProto.BuyStorageBytesContract.deserializeBinaryFromReader(r,t)},TronWebProto.BuyStorageBytesContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setOwnerAddress(r);break;case 2:r=t.readInt64();e.setBytes(r);break;default:t.skipField()}}return e},TronWebProto.BuyStorageBytesContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.BuyStorageBytesContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.BuyStorageBytesContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r),0!==(r=e.getBytes())&&t.writeInt64(2,r)},TronWebProto.BuyStorageBytesContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.BuyStorageBytesContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.BuyStorageBytesContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.BuyStorageBytesContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.BuyStorageBytesContract.prototype.getBytes=function(){return n.Message.getFieldWithDefault(this,2,0)},TronWebProto.BuyStorageBytesContract.prototype.setBytes=function(e){return n.Message.setProto3IntField(this,2,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.BuyStorageContract.prototype.toObject=function(e){return TronWebProto.BuyStorageContract.toObject(e,this)},TronWebProto.BuyStorageContract.toObject=function(e,t){var r={ownerAddress:t.getOwnerAddress_asB64(),quant:n.Message.getFieldWithDefault(t,2,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.BuyStorageContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.BuyStorageContract;return TronWebProto.BuyStorageContract.deserializeBinaryFromReader(r,t)},TronWebProto.BuyStorageContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setOwnerAddress(r);break;case 2:r=t.readInt64();e.setQuant(r);break;default:t.skipField()}}return e},TronWebProto.BuyStorageContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.BuyStorageContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.BuyStorageContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r),0!==(r=e.getQuant())&&t.writeInt64(2,r)},TronWebProto.BuyStorageContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.BuyStorageContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.BuyStorageContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.BuyStorageContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.BuyStorageContract.prototype.getQuant=function(){return n.Message.getFieldWithDefault(this,2,0)},TronWebProto.BuyStorageContract.prototype.setQuant=function(e){return n.Message.setProto3IntField(this,2,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.SellStorageContract.prototype.toObject=function(e){return TronWebProto.SellStorageContract.toObject(e,this)},TronWebProto.SellStorageContract.toObject=function(e,t){var r={ownerAddress:t.getOwnerAddress_asB64(),storageBytes:n.Message.getFieldWithDefault(t,2,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.SellStorageContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.SellStorageContract;return TronWebProto.SellStorageContract.deserializeBinaryFromReader(r,t)},TronWebProto.SellStorageContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setOwnerAddress(r);break;case 2:r=t.readInt64();e.setStorageBytes(r);break;default:t.skipField()}}return e},TronWebProto.SellStorageContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.SellStorageContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.SellStorageContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r),0!==(r=e.getStorageBytes())&&t.writeInt64(2,r)},TronWebProto.SellStorageContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.SellStorageContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.SellStorageContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.SellStorageContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.SellStorageContract.prototype.getStorageBytes=function(){return n.Message.getFieldWithDefault(this,2,0)},TronWebProto.SellStorageContract.prototype.setStorageBytes=function(e){return n.Message.setProto3IntField(this,2,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.UpdateBrokerageContract.prototype.toObject=function(e){return TronWebProto.UpdateBrokerageContract.toObject(e,this)},TronWebProto.UpdateBrokerageContract.toObject=function(e,t){var r={ownerAddress:t.getOwnerAddress_asB64(),brokerage:n.Message.getFieldWithDefault(t,2,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.UpdateBrokerageContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.UpdateBrokerageContract;return TronWebProto.UpdateBrokerageContract.deserializeBinaryFromReader(r,t)},TronWebProto.UpdateBrokerageContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setOwnerAddress(r);break;case 2:r=t.readInt32();e.setBrokerage(r);break;default:t.skipField()}}return e},TronWebProto.UpdateBrokerageContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.UpdateBrokerageContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.UpdateBrokerageContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r),0!==(r=e.getBrokerage())&&t.writeInt32(2,r)},TronWebProto.UpdateBrokerageContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.UpdateBrokerageContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.UpdateBrokerageContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.UpdateBrokerageContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.UpdateBrokerageContract.prototype.getBrokerage=function(){return n.Message.getFieldWithDefault(this,2,0)},TronWebProto.UpdateBrokerageContract.prototype.setBrokerage=function(e){return n.Message.setProto3IntField(this,2,e)},o.object.extend(t,TronWebProto)},"./node_modules/tronweb/lib/esm/protocol/core/contract/witness_contract_pb.cjs"(e,t,r){var n=r("./node_modules/google-protobuf/google-protobuf.js"),o=n,s="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof window&&window||void 0!==s&&s||"undefined"!=typeof self&&self||function(){return this}.call(null)||Function("return this")();o.exportSymbol("TronWebProto.VoteWitnessContract",null,s),o.exportSymbol("TronWebProto.VoteWitnessContract.Vote",null,s),o.exportSymbol("TronWebProto.WitnessCreateContract",null,s),o.exportSymbol("TronWebProto.WitnessUpdateContract",null,s),TronWebProto.WitnessCreateContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.WitnessCreateContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.WitnessCreateContract.displayName="TronWebProto.WitnessCreateContract"),TronWebProto.WitnessUpdateContract=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.WitnessUpdateContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.WitnessUpdateContract.displayName="TronWebProto.WitnessUpdateContract"),TronWebProto.VoteWitnessContract=function(e){n.Message.initialize(this,e,0,-1,TronWebProto.VoteWitnessContract.repeatedFields_,null)},o.inherits(TronWebProto.VoteWitnessContract,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.VoteWitnessContract.displayName="TronWebProto.VoteWitnessContract"),TronWebProto.VoteWitnessContract.Vote=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(TronWebProto.VoteWitnessContract.Vote,n.Message),o.DEBUG&&!COMPILED&&(TronWebProto.VoteWitnessContract.Vote.displayName="TronWebProto.VoteWitnessContract.Vote"),n.Message.GENERATE_TO_OBJECT&&(TronWebProto.WitnessCreateContract.prototype.toObject=function(e){return TronWebProto.WitnessCreateContract.toObject(e,this)},TronWebProto.WitnessCreateContract.toObject=function(e,t){var r={ownerAddress:t.getOwnerAddress_asB64(),url:t.getUrl_asB64()};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.WitnessCreateContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.WitnessCreateContract;return TronWebProto.WitnessCreateContract.deserializeBinaryFromReader(r,t)},TronWebProto.WitnessCreateContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setOwnerAddress(r);break;case 2:r=t.readBytes();e.setUrl(r);break;default:t.skipField()}}return e},TronWebProto.WitnessCreateContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.WitnessCreateContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.WitnessCreateContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r),(r=e.getUrl_asU8()).length>0&&t.writeBytes(2,r)},TronWebProto.WitnessCreateContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.WitnessCreateContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.WitnessCreateContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.WitnessCreateContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.WitnessCreateContract.prototype.getUrl=function(){return n.Message.getFieldWithDefault(this,2,"")},TronWebProto.WitnessCreateContract.prototype.getUrl_asB64=function(){return n.Message.bytesAsB64(this.getUrl())},TronWebProto.WitnessCreateContract.prototype.getUrl_asU8=function(){return n.Message.bytesAsU8(this.getUrl())},TronWebProto.WitnessCreateContract.prototype.setUrl=function(e){return n.Message.setProto3BytesField(this,2,e)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.WitnessUpdateContract.prototype.toObject=function(e){return TronWebProto.WitnessUpdateContract.toObject(e,this)},TronWebProto.WitnessUpdateContract.toObject=function(e,t){var r={ownerAddress:t.getOwnerAddress_asB64(),updateUrl:t.getUpdateUrl_asB64()};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.WitnessUpdateContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.WitnessUpdateContract;return TronWebProto.WitnessUpdateContract.deserializeBinaryFromReader(r,t)},TronWebProto.WitnessUpdateContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setOwnerAddress(r);break;case 12:r=t.readBytes();e.setUpdateUrl(r);break;default:t.skipField()}}return e},TronWebProto.WitnessUpdateContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.WitnessUpdateContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.WitnessUpdateContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r),(r=e.getUpdateUrl_asU8()).length>0&&t.writeBytes(12,r)},TronWebProto.WitnessUpdateContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.WitnessUpdateContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.WitnessUpdateContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.WitnessUpdateContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.WitnessUpdateContract.prototype.getUpdateUrl=function(){return n.Message.getFieldWithDefault(this,12,"")},TronWebProto.WitnessUpdateContract.prototype.getUpdateUrl_asB64=function(){return n.Message.bytesAsB64(this.getUpdateUrl())},TronWebProto.WitnessUpdateContract.prototype.getUpdateUrl_asU8=function(){return n.Message.bytesAsU8(this.getUpdateUrl())},TronWebProto.WitnessUpdateContract.prototype.setUpdateUrl=function(e){return n.Message.setProto3BytesField(this,12,e)},TronWebProto.VoteWitnessContract.repeatedFields_=[2],n.Message.GENERATE_TO_OBJECT&&(TronWebProto.VoteWitnessContract.prototype.toObject=function(e){return TronWebProto.VoteWitnessContract.toObject(e,this)},TronWebProto.VoteWitnessContract.toObject=function(e,t){var r={ownerAddress:t.getOwnerAddress_asB64(),votesList:n.Message.toObjectList(t.getVotesList(),TronWebProto.VoteWitnessContract.Vote.toObject,e),support:n.Message.getBooleanFieldWithDefault(t,3,!1)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.VoteWitnessContract.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.VoteWitnessContract;return TronWebProto.VoteWitnessContract.deserializeBinaryFromReader(r,t)},TronWebProto.VoteWitnessContract.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setOwnerAddress(r);break;case 2:r=new TronWebProto.VoteWitnessContract.Vote;t.readMessage(r,TronWebProto.VoteWitnessContract.Vote.deserializeBinaryFromReader),e.addVotes(r);break;case 3:r=t.readBool();e.setSupport(r);break;default:t.skipField()}}return e},TronWebProto.VoteWitnessContract.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.VoteWitnessContract.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.VoteWitnessContract.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getOwnerAddress_asU8()).length>0&&t.writeBytes(1,r),(r=e.getVotesList()).length>0&&t.writeRepeatedMessage(2,r,TronWebProto.VoteWitnessContract.Vote.serializeBinaryToWriter),(r=e.getSupport())&&t.writeBool(3,r)},n.Message.GENERATE_TO_OBJECT&&(TronWebProto.VoteWitnessContract.Vote.prototype.toObject=function(e){return TronWebProto.VoteWitnessContract.Vote.toObject(e,this)},TronWebProto.VoteWitnessContract.Vote.toObject=function(e,t){var r={voteAddress:t.getVoteAddress_asB64(),voteCount:n.Message.getFieldWithDefault(t,2,0)};return e&&(r.$jspbMessageInstance=t),r}),TronWebProto.VoteWitnessContract.Vote.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new TronWebProto.VoteWitnessContract.Vote;return TronWebProto.VoteWitnessContract.Vote.deserializeBinaryFromReader(r,t)},TronWebProto.VoteWitnessContract.Vote.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setVoteAddress(r);break;case 2:r=t.readInt64();e.setVoteCount(r);break;default:t.skipField()}}return e},TronWebProto.VoteWitnessContract.Vote.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return TronWebProto.VoteWitnessContract.Vote.serializeBinaryToWriter(this,e),e.getResultBuffer()},TronWebProto.VoteWitnessContract.Vote.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getVoteAddress_asU8()).length>0&&t.writeBytes(1,r),0!==(r=e.getVoteCount())&&t.writeInt64(2,r)},TronWebProto.VoteWitnessContract.Vote.prototype.getVoteAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.VoteWitnessContract.Vote.prototype.getVoteAddress_asB64=function(){return n.Message.bytesAsB64(this.getVoteAddress())},TronWebProto.VoteWitnessContract.Vote.prototype.getVoteAddress_asU8=function(){return n.Message.bytesAsU8(this.getVoteAddress())},TronWebProto.VoteWitnessContract.Vote.prototype.setVoteAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.VoteWitnessContract.Vote.prototype.getVoteCount=function(){return n.Message.getFieldWithDefault(this,2,0)},TronWebProto.VoteWitnessContract.Vote.prototype.setVoteCount=function(e){return n.Message.setProto3IntField(this,2,e)},TronWebProto.VoteWitnessContract.prototype.getOwnerAddress=function(){return n.Message.getFieldWithDefault(this,1,"")},TronWebProto.VoteWitnessContract.prototype.getOwnerAddress_asB64=function(){return n.Message.bytesAsB64(this.getOwnerAddress())},TronWebProto.VoteWitnessContract.prototype.getOwnerAddress_asU8=function(){return n.Message.bytesAsU8(this.getOwnerAddress())},TronWebProto.VoteWitnessContract.prototype.setOwnerAddress=function(e){return n.Message.setProto3BytesField(this,1,e)},TronWebProto.VoteWitnessContract.prototype.getVotesList=function(){return n.Message.getRepeatedWrapperField(this,TronWebProto.VoteWitnessContract.Vote,2)},TronWebProto.VoteWitnessContract.prototype.setVotesList=function(e){return n.Message.setRepeatedWrapperField(this,2,e)},TronWebProto.VoteWitnessContract.prototype.addVotes=function(e,t){return n.Message.addToRepeatedWrapperField(this,2,e,TronWebProto.VoteWitnessContract.Vote,t)},TronWebProto.VoteWitnessContract.prototype.clearVotesList=function(){return this.setVotesList([])}
2,TronWebProto.VoteWitnessContract.prototype.getSupport=function(){return n.Message.getBooleanFieldWithDefault(this,3,!1)},TronWebProto.VoteWitnessContract.prototype.setSupport=function(e){return n.Message.setProto3BooleanField(this,3,e)},o.object.extend(t,TronWebProto)},"./node_modules/@chainflip/sdk/node_modules/ethers/lib.esm/address/checks.js"(e,t,r){"use strict";r.d(t,{PW:()=>E});var n=r("./node_modules/@noble/hashes/esm/sha3.js");function o(e,t,r){const n=t.split("|").map((e=>e.trim()));for(let r=0;r<n.length;r++)switch(t){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof e===t)return}const o=new Error(`invalid value for type ${t}`);throw o.code="INVALID_ARGUMENT",o.argument=`value.${r}`,o.value=e,o}function s(e,t,r){for(let n in t){let s=t[n];const i=r?r[n]:null;i&&o(s,i,n),Object.defineProperty(e,n,{enumerable:!0,value:s,writable:!1})}}function i(e,t){if(null==e)return"null";if(null==t&&(t=new Set),"object"==typeof e){if(t.has(e))return"[Circular]";t.add(e)}if(Array.isArray(e))return"[ "+e.map((e=>i(e,t))).join(", ")+" ]";if(e instanceof Uint8Array){const t="0123456789abcdef";let r="0x";for(let n=0;n<e.length;n++)r+=t[e[n]>>4],r+=t[15&e[n]];return r}if("object"==typeof e&&"function"==typeof e.toJSON)return i(e.toJSON(),t);switch(typeof e){case"boolean":case"number":case"symbol":return e.toString();case"bigint":return BigInt(e).toString();case"string":return JSON.stringify(e);case"object":{const r=Object.keys(e);return r.sort(),"{ "+r.map((r=>`${i(r,t)}: ${i(e[r],t)}`)).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function a(e,t,r,n){if(!e)throw function(e,t,r){let n,o=e;{const n=[];if(r){if("message"in r||"code"in r||"name"in r)throw new Error(`value will overwrite populated values: ${i(r)}`);for(const e in r){if("shortMessage"===e)continue;const t=r[e];n.push(e+"="+i(t))}}n.push(`code=${t}`),n.push("version=6.16.0"),n.length&&(e+=" ("+n.join(", ")+")")}switch(t){case"INVALID_ARGUMENT":n=new TypeError(e);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":n=new RangeError(e);break;default:n=new Error(e)}return s(n,{code:t}),r&&Object.assign(n,r),null==n.shortMessage&&s(n,{shortMessage:o}),n}(t,r,n)}function c(e,t,r,n){a(e,t,"INVALID_ARGUMENT",{argument:r,value:n})}["NFD","NFC","NFKD","NFKC"].reduce(((e,t)=>{try{if("test"!=="test".normalize(t))throw new Error("bad");if("NFD"===t){const e=String.fromCharCode(233).normalize("NFD");if(e!==String.fromCharCode(101,769))throw new Error("broken")}e.push(t)}catch(e){}return e}),[]);function l(e,t,r){if(e instanceof Uint8Array)return r?new Uint8Array(e):e;if("string"==typeof e&&e.length%2==0&&e.match(/^0x[0-9a-f]*$/i)){const t=new Uint8Array((e.length-2)/2);let r=2;for(let n=0;n<t.length;n++)t[n]=parseInt(e.substring(r,r+2),16),r+=2;return t}c(!1,"invalid BytesLike value",t||"value",e)}function u(e,t){return l(e,t,!1)}const d="0123456789abcdef";function h(e){const t=u(e);let r="0x";for(let e=0;e<t.length;e++){const n=t[e];r+=d[(240&n)>>4]+d[15&n]}return r}let p=!1;const f=function(e){return(0,n.lY)(e)};let g=f;function m(e){const t=u(e,"data");return h(g(t))}m._=f,m.lock=function(){p=!0},m.register=function(e){if(p)throw new TypeError("keccak256 is locked");g=e},Object.freeze(m);const y=BigInt(0),b=BigInt(36);function w(e){const t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let e=0;e<40;e++)r[e]=t[e].charCodeAt(0);const n=u(m(r));for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&n[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}const v={};for(let e=0;e<10;e++)v[String(e)]=String(e);for(let e=0;e<26;e++)v[String.fromCharCode(65+e)]=String(10+e);function A(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>v[e])).join("");for(;t.length>=15;){let e=t.substring(0,15);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}const T=function(){const e={};for(let t=0;t<36;t++){e["0123456789abcdefghijklmnopqrstuvwxyz"[t]]=BigInt(t)}return e}();function P(e){if(c("string"==typeof e,"invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/)){e.startsWith("0x")||(e="0x"+e);const t=w(e);return c(!e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||t===e,"bad address checksum","address",e),t}if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){c(e.substring(2,4)===A(e),"bad icap checksum","address",e);let t=function(e){e=e.toLowerCase();let t=y;for(let r=0;r<e.length;r++)t=t*b+T[e[r]];return t}(e.substring(4)).toString(16);for(;t.length<40;)t="0"+t;return w("0x"+t)}c(!1,"invalid address","address",e)}function E(e){try{return P(e),!0}catch(e){}return!1}},"./node_modules/@coinbase/wallet-sdk/dist/index.js"(e,t,r){"use strict";r.r(t),r.d(t,{CoinbaseWalletSDK:()=>Ct,createCoinbaseWalletSDK:()=>_t,default:()=>It});var n=r("./node_modules/viem/_esm/utils/address/isAddressEqual.js"),o=r("./node_modules/viem/_esm/utils/encoding/fromHex.js");class s{constructor(e,t){this.scope=e,this.module=t}storeObject(e,t){this.setItem(e,JSON.stringify(t))}loadObject(e){const t=this.getItem(e);return t?JSON.parse(t):void 0}setItem(e,t){localStorage.setItem(this.scopedKey(e),t)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),t=[];for(let r=0;r<localStorage.length;r++){const n=localStorage.key(r);"string"==typeof n&&n.startsWith(e)&&t.push(n)}t.forEach((e=>localStorage.removeItem(e)))}scopedKey(e){return`-${this.scope}${this.module?`:${this.module}`:""}:${e}`}static clearAll(){new s("CBWSDK").clear(),new s("walletlink").clear()}}const i={invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},a={userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902},c={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}},l="Unspecified error message.";function u(e,t=l){if(e&&Number.isInteger(e)){const t=e.toString();if(f(c,t))return c[t].message;if(h(e))return"Unspecified server error."}return t}function d(e,{shouldIncludeStack:t=!1}={}){const r={};if(e&&"object"==typeof e&&!Array.isArray(e)&&f(e,"code")&&function(e){if(!Number.isInteger(e))return!1;const t=e.toString();return!!c[t]||!!h(e)}(e.code)){const t=e;r.code=t.code,t.message&&"string"==typeof t.message?(r.message=t.message,f(t,"data")&&(r.data=t.data)):(r.message=u(r.code),r.data={originalError:p(e)})}else r.code=i.internal,r.message=g(e,"message")?e.message:l,r.data={originalError:p(e)};return t&&(r.stack=g(e,"stack")?e.stack:void 0),r}function h(e){return e>=-32099&&e<=-32e3}function p(e){return e&&"object"==typeof e&&!Array.isArray(e)?Object.assign({},e):e}function f(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function g(e,t){return"object"==typeof e&&null!==e&&t in e&&"string"==typeof e[t]}const m={parse:e=>b(i.parse,e),invalidRequest:e=>b(i.invalidRequest,e),invalidParams:e=>b(i.invalidParams,e),methodNotFound:e=>b(i.methodNotFound,e),internal:e=>b(i.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code
2<= -32005');return b(t,e)},invalidInput:e=>b(i.invalidInput,e),resourceNotFound:e=>b(i.resourceNotFound,e),resourceUnavailable:e=>b(i.resourceUnavailable,e),transactionRejected:e=>b(i.transactionRejected,e),methodNotSupported:e=>b(i.methodNotSupported,e),limitExceeded:e=>b(i.limitExceeded,e)},y={userRejectedRequest:e=>w(a.userRejectedRequest,e),unauthorized:e=>w(a.unauthorized,e),unsupportedMethod:e=>w(a.unsupportedMethod,e),disconnected:e=>w(a.disconnected,e),chainDisconnected:e=>w(a.chainDisconnected,e),unsupportedChain:e=>w(a.unsupportedChain,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||"string"!=typeof r)throw new Error('"message" must be a nonempty string');return new T(t,r,n)}};function b(e,t){const[r,n]=v(t);return new A(e,r||u(e),n)}function w(e,t){const[r,n]=v(t);return new T(e,r||u(e),n)}function v(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:r}=e;
2if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}class A extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw new Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==r&&(this.data=r)}}class T extends A{constructor(e,t,r){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}}const P=e=>e,E=e=>e,C=e=>e;function k(e){return Math.floor(e)}var _=r("./node_modules/buffer/index.js").Buffer;const I=/^[0-9]*$/,S=/^[a-f0-9]*$/;function x(e){return B(crypto.getRandomValues(new Uint8Array(e)))}function B(e){return[...e].map((e=>e.toString(16).padStart(2,"0"))).join("")}function O(e){return new Uint8Array(e.match(/.{1,2}/g).map((e=>Number.parseInt(e,16))))}function M(e,t=!1){const r=e.toString("hex");return P(t?`0x${r}`:r)}function W(e){return M(V(e),!0)}function j(e){return C(e.toString(10))}function R(e){return P(`0x${BigInt(e).toString(16)}`)}function N(e){return e.startsWith("0x")||e.startsWith("0X")}function U(e){return N(e)?e.slice(2):e}function D(e){return N(e)?`0x${e.slice(2)}`:`0x${e}`}function L(e){if("string"!=typeof e)return!1;const t=U(e).toLowerCase();return S.test(t)}function F(e,t=!1){let r=function(e,t=!1){if("string"==typeof e){const r=U(e).toLowerCase();if(S.test(r))return P(t?`0x${r}`:r)}throw m.invalidParams(`"${String(e)}" is not a hexadecimal string`)}(e,!1);return r.length%2==1&&(r=P(`0${r}`)),t?P(`0x${r}`):r}function z(e){if("string"==typeof e){const t=U(e).toLowerCase();if(L(t)&&40===t.length)return E(D(t))}throw m.invalidParams(`Invalid Ethereum address: ${String(e)}`)}function V(e){if(_.isBuffer(e))return e;if("string"==typeof e){if(L(e)){const t=F(e,!1);return _.from(t,"hex")}return _.from(e,"utf8")}throw m.invalidParams(`Not binary data: ${String(e)}`)}function q(e){if("number"==typeof e&&Number.isInteger(e))return k(e);if("string"==typeof e){if(I.test(e))return k(Number(e));if(L(e))return k(Number(BigInt(F(e,!0))))}throw m.invalidParams(`Not an integer: ${String(e)}`)}function H(e){if(null!==e&&("bigint"==typeof e||function(e){if(null==e||"function"!=typeof e.constructor)return!1;const{constructor:t}=e;return"function"==typeof t.config&&"number"==typeof t.EUCLID}(e)))return BigInt(e.toString(10));if("number"==typeof e)return BigInt(q(e));if("string"==typeof e){if(I.test(e))return BigInt(e);if(L(e))return BigInt(F(e,!0))}throw m.invalidParams(`Not an integer: ${String(e)}`)}function K(e){if("string"==typeof e)return JSON.parse(e);if("object"==typeof e)return e;throw m.invalidParams(`Not a JSON string or an object: ${String(e)}`)}function $(){const e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:r}=document.location,n=e?e.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?`${t}//${r}/favicon.ico`:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?t+n:`${t}//${r}${n}`}function G(e){switch(e){case"public":return"spki";case"private":return"pkcs8"}}async function Y(e,t){const r=G(e),n=await crypto.subtle.exportKey(r,t);return B(new Uint8Array(n))}async function J(e,t){const r=G(e),n=O(t).buffer;return await crypto.subtle.importKey(r,new Uint8Array(n),{name:"ECDH",namedCurve:"P-256"},!0,"private"===e?["deriveKey"]:[])}async function Q(e,t){return async function(e,t){const r=crypto.getRandomValues(new Uint8Array(12));return{iv:r,cipherText:await crypto.subtle.encrypt({name:"AES-GCM",iv:r},e,(new TextEncoder).encode(t))}}(t,JSON.stringify(e,((e,t)=>{if(!(t instanceof Error))return t;const r=t;return Object.assign(Object.assign({},r.code?{code:r.code}:{}),{message:r.message})})))}async function Z(e,t){return JSON.parse(await async function(e,{iv:t,cipherText:r}){const n=await crypto.subtle.decrypt({name:"AES-GCM",iv:t},e,r);return(new TextDecoder).decode(n)}(t,e))}const X={storageKey:"ownPrivateKey",keyType:"private"},ee={storageKey:"ownPublicKey",keyType:"public"},te={storageKey:"peerPublicKey",keyType:"public"};
2class re{constructor(){this.storage=new s("CBWSDK","SCWKeyManager"),this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null}async getOwnPublicKey(){return await this.loadKeysIfNeeded(),this.ownPublicKey}async getSharedSecret(){return await this.loadKeysIfNeeded(),this.sharedSecret}async setPeerPublicKey(e){this.sharedSecret=null,this.peerPublicKey=e,await this.storeKey(te,e),await this.loadKeysIfNeeded()}async clear(){this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null,this.storage.removeItem(ee.storageKey),this.storage.removeItem(X.storageKey),this.storage.removeItem(te.storageKey)}async generateKeyPair(){const e=await async function(){return crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveKey"])}();this.ownPrivateKey=e.privateKey,this.ownPublicKey=e.publicKey,await this.storeKey(X,e.privateKey),await this.storeKey(ee,e.publicKey)}async loadKeysIfNeeded(){if(null===this.ownPrivateKey&&(this.ownPrivateKey=await this.loadKey(X)),null===this.ownPublicKey&&(this.ownPublicKey=await this.loadKey(ee)),null!==this.ownPrivateKey&&null!==this.ownPublicKey||await this.generateKeyPair(),null===this.peerPublicKey&&(this.peerPublicKey=await this.loadKey(te)),null===this.sharedSecret){if(null===this.ownPrivateKey||null===this.peerPublicKey)return;this.sharedSecret=await async function(e,t){return crypto.subtle.deriveKey({name:"ECDH",public:t},e,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}(this.ownPrivateKey,this.peerPublicKey)}}async loadKey(e){const t=this.storage.getItem(e.storageKey);return t?J(e.keyType,t):null}async storeKey(e,t){const r=await Y(e.keyType,t);this.storage.setItem(e.storageKey,r)}}var ne=r("./node_modules/viem/_esm/utils/address/isAddress.js");const oe="4.3.7",se="@coinbase/wallet-sdk";async function ie(e,t){const r=Object.assign(Object.assign({},e),{jsonrpc:"2.0",id:crypto.randomUUID()}),n=await window.fetch(t,{method:"POST",body:JSON.stringify(r),mode:"cors",headers:{"Content-Type":"application/json","X-Cbw-Sdk-Version":oe,"X-Cbw-Sdk-Platform":se}}),{result:o,error:s}=await n.json();if(s)throw s;return o}function ae({metadata:e,preference:t}){var r,n;const{appName:o,appLogoUrl:s,appChainIds:i}=e;if("smartWalletOnly"!==t.options){const e=globalThis.coinbaseWalletExtension;if(e)return null===(r=e.setAppInfo)||void 0===r||r.call(e,o,s,i,t),e}const a=function(){var e,t;try{const r=globalThis;return null!==(t=null===(e=r.top)||void 0===e?void 0:e.ethereum)&&void 0!==t?t:r.ethereum}catch(e){return}}();if(null==a?void 0:a.isCoinbaseBrowser)return null===(n=a.setAppInfo)||void 0===n||n.call(a,o,s,i,t),a}const ce="accounts",le="activeChain",ue="availableChains",de="walletCapabilities";class he{constructor(e){var t,r,n;this.metadata=e.metadata,this.communicator=e.communicator,this.callback=e.callback,this.keyManager=new re,this.storage=new s("CBWSDK","SCWStateManager"),this.accounts=null!==(t=this.storage.loadObject(ce))&&void 0!==t?t:[],this.chain=this.storage.loadObject(le)||{id:null!==(n=null===(r=e.metadata.appChainIds)||void 0===r?void 0:r[0])&&void 0!==n?n:1},this.handshake=this.handshake.bind(this),this.request=this.request.bind(this),this.createRequestMessage=this.createRequestMessage.bind(this),this.decryptResponseMessage=this.decryptResponseMessage.bind(this)}async handshake(e){var t,r,n,o;await(null===(r=(t=this.communicator).waitForPopupLoaded)||void 0===r?void 0:r.call(t));const s=await this.createRequestMessage({handshake:{method:e.method,params:Object.assign({},this.metadata,null!==(n=e.params)&&void 0!==n?n:{})}}),i=await this.communicator.postRequestAndWaitForResponse(s);if("failure"in i.content)throw i.content.failure;const a=await J("public",i.sender);await this.keyManager.setPeerPublicKey(a);const c=(await this.decryptResponseMessage(i)).result;if("error"in c)throw c.error;switch(e.method){case"eth_requestAccounts":{const e=c.value;this.accounts=e,this.storage.storeObject(ce,e),null===(o=this.callback)||void 0===o||o.call(this,"accountsChanged",e);break}}}async request(e){var t;if(0===this.accounts.length){if("wallet_sendCalls"===e.method)return this.sendRequestToPopup(e);throw y.unauthorized()}switch(e.method){case"eth_requestAccounts":return null===(t=this.callback)||void 0===t||t.call(this,"connect",{chainId:R(this.chain.id)}),this.accounts;case"eth_accounts":return this.accounts;case"eth_coinbase":return this.accounts[0];case"net_version":return this.chain.id;case"eth_chainId":return R(this.chain.id);case"wallet_getCapabilities":return this.handleGetCapabilitiesRequest(e);case"wallet_switchEthereumChain":return this.handleSwitchChainRequest(e);case"eth_ecRecover":case"personal_sign":case"wallet_sign":case"personal_ecRecover":case"eth_signTransaction":case"eth_sendTransaction":case"eth_signTypedData_v1":case"eth_signTypedData_v3":case"eth_signTypedData_v4":case"eth_signTypedData":case"wallet_addEthereumChain":case"wallet_watchAsset":case"wallet_sendCalls":case"wallet_showCallsStatus":case"wallet_grantPermissions":return this.sendRequestToPopup(e);default:if(!this.chain.rpcUrl)throw m.internal("No RPC URL set for chain");return ie(e,this.chain.rpcUrl)}}async sendRequestToPopup(e){var t,r;await(null===(r=(t=this.communicator).waitForPopupLoaded)||void 0===r?void 0:r.call(t));const n=await this.sendEncryptedRequest(e),o=(await this.decryptResponseMessage(n)).result;if("error"in o)throw o.error;return o.value}async cleanup(){var e,t;this.storage.clear(),await this.keyManager.clear(),this.accounts=[],this.chain={id:null!==(t=null===(e=this.metadata.appChainIds)||void 0===e?void 0:e[0])&&void 0!==t?t:1}}async handleSwitchChainRequest(e){var t;const r=e.params;if(!r||!(null===(t=r[0])||void 0===t?void 0:t.chainId))throw m.invali
2dParams();const n=q(r[0].chainId);if(this.updateChain(n))return null;const o=await this.sendRequestToPopup(e);return null===o&&this.updateChain(n),o}async handleGetCapabilitiesRequest(e){!function(e){if(!e||!Array.isArray(e)||1!==e.length&&2!==e.length)throw m.invalidParams();if("string"!=typeof e[0]||!(0,ne.P)(e[0]))throw m.invalidParams();if(2===e.length){if(!Array.isArray(e[1]))throw m.invalidParams();for(const t of e[1])if("string"!=typeof t||!t.startsWith("0x"))throw m.invalidParams()}}(e.params);const t=e.params[0],r=e.params[1];if(!this.accounts.some((e=>(0,n.h)(e,t))))throw y.unauthorized("no active account found");const s=this.storage.loadObject(de);if(!s)return{};if(!r||0===r.length)return s;const i=new Set(r.map((e=>(0,o.ME)(e))));return Object.fromEntries(Object.entries(s).filter((([e])=>{try{const t=(0,o.ME)(e);return i.has(t)}catch(e){return!1}})))}async sendEncryptedRequest(e){const t=await this.keyManager.getSharedSecret();if(!t)throw y.unauthorized("No valid session found, try requestAccounts before other methods");const r=await Q({action:e,chainId:this.chain.id},t),n=await this.createRequestMessage({encrypted:r});return this.communicator.postRequestAndWaitForResponse(n)}async createRequestMessage(e){const t=await Y("public",await this.keyManager.getOwnPublicKey());return{id:crypto.randomUUID(),sender:t,content:e,timestamp:new Date}}async decryptResponseMessage(e){var t,r;const n=e.content;if("failure"in n)throw n.failure;const o=await this.keyManager.getSharedSecret();if(!o)throw y.unauthorized("Invalid session");const s=await Z(n.encrypted,o),i=null===(t=s.data)||void 0===t?void 0:t.chains;if(i){const e=Object.entries(i).map((([e,t])=>({id:Number(e),rpcUrl:t})));this.storage.storeObject(ue,e),this.updateChain(this.chain.id,e)}const a=null===(r=s.data)||void 0===r?void 0:r.capabilities;return a&&this.storage.storeObject(de,a),s}updateChain(e,t){var r;const n=null!=t?t:this.storage.loadObject(ue),o=null==n?void 0:n.find((t=>t.id===e));return!!o&&(o!==this.chain&&(this.chain=o,this.storage.storeObject(le,o),null===(r=this.callback)||void 0===r||r.call(this,"chainChanged",R(o.id))),!0)}}var pe=r("./node_modules/@coinbase/wallet-sdk/dist/vendor-js/eth-eip712-util/index.cjs");const fe="Addresses";function ge(e){return void 0!==e.errorMessage}class me{constructor(e){this.secret=e}async encrypt(e){const t=this.secret;if(64!==t.length)throw Error("secret must be 256 bits");const r=crypto.getRandomValues(new Uint8Array(12)),n=await crypto.subtle.importKey("raw",O(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),o=new TextEncoder,s=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:r},n,o.encode(e)),i=s.slice(s.byteLength-16),a=s.slice(0,s.byteLength-16),c=new Uint8Array(i),l=new Uint8Array(a);return B(new Uint8Array([...r,...c,...l]))}async decrypt(e){const t=this.secret;if(64!==t.length)throw Error("secret must be 256 bits");return new Promise(((r,n)=>{!async function(){const o=await crypto.subtle.importKey("raw",O(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=O(e),i=s.slice(0,12),a=s.slice(12,28),c=s.slice(28),l=new Uint8Array([...c,...a]),u={name:"AES-GCM",iv:new Uint8Array(i)};try{const e=await window.crypto.subtle.decrypt(u,o,l),t=new TextDecoder;r(t.decode(e))}catch(e){n(e)}}()}))}}class ye{constructor(e,t,r){this.linkAPIUrl=e,this.sessionId=t;const n=`${t}:${r}`;this.auth=`Basic ${btoa(n)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map((e=>fetch(`${this.linkAPIUrl}/events/${e.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}})))).catch((e=>console.error("Unabled to mark event as failed:",e)))}async fetchUnseenEvents(){var e;const t=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(t.ok){const{events:r,error:n}=await t.json();if(n)throw new Error(`Check unseen events failed: ${n}`);const o=null!==(e=null==r?void 0:r.filter((e=>"Web3Response"===e.event)).map((e=>({type:"Event",sessionId:this.sessionId,eventId:e.id,event:e.event,data:e.data}))))&&void 0!==e?e:[];return this.markUnseenEventsAsSeen(o),o}throw new Error(`Check unseen events failed: ${t.status}`)}}var be;!function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"}(be||(be={}));class we{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,t=WebSocket){this.WebSocketClass=t,this.webSocket=null,this.isDisconnecting=!1,this.url=e.replace(/^http/,"ws"),this.instanceId=we.instanceCounter++,we.activeInstances.add(this.instanceId)}
2async connect(){if(this.webSocket)throw new Error("webSocket object is not null");if(this.isDisconnecting)throw new Error("WebSocket is disconnecting, cannot reconnect on same instance");return new Promise(((e,t)=>{var r;let n;try{this.webSocket=n=new this.WebSocketClass(this.url)}catch(e){return void t(e)}null===(r=this.connectionStateListener)||void 0===r||r.call(this,be.CONNECTING),n.onclose=e=>{var r;this.clearWebSocket(),n.readyState!==WebSocket.OPEN&&t(new Error(`websocket error ${e.code}: ${e.reason}`)),null===(r=this.connectionStateListener)||void 0===r||r.call(this,be.DISCONNECTED)},n.onopen=t=>{var r;if(e(),null===(r=this.connectionStateListener)||void 0===r||r.call(this,be.CONNECTED),we.pendingData.length>0){[...we.pendingData].forEach((e=>this.sendData(e))),we.pendingData=[]}},n.onmessage=e=>{var t,r;if("h"===e.data)null===(t=this.incomingDataListener)||void 0===t||t.call(this,{type:"Heartbeat"});else try{const t=JSON.parse(e.data);null===(r=this.incomingDataListener)||void 0===r||r.call(this,t)}catch(e){}}}))}disconnect(){var e;const{webSocket:t}=this;if(t){this.isDisconnecting=!0,this.clearWebSocket(),null===(e=this.connectionStateListener)||void 0===e||e.call(this,be.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{t.close()}catch(e){}}}sendData(e){const{webSocket:t}=this;if(!t)return we.pendingData.push(e),void(this.isDisconnecting||this.connect());t.readyState===WebSocket.OPEN?t.send(e):we.pendingData.push(e)}clearWebSocket(){const{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}cleanup(){we.activeInstances.delete(this.instanceId)}}we.instanceCounter=0,we.activeInstances=new Set,we.pendingData=[];class ve{constructor({session:e,linkAPIUrl:t,listener:r}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=k(1),this.reconnectAttempts=0,this.isReconnecting=!1,this._connected=!1,this._linked=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=e=>{if(!e)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",t=>e.JsonRpcUrl&&this.handleChainUpdated(t,e.JsonRpcUrl)]]).forEach(((t,r)=>{const n=e[r];void 0!==n&&t(n)}))},this.handleDestroyed=e=>{var t;"1"===e&&(null===(t=this.listener)||void 0===t||t.resetAndReload())},this.handleAccountUpdated=async e=>{var t;try{const r=await this.cipher.decrypt(e);null===(t=this.listener)||void 0===t||t.accountUpdated(r)}catch(e){}},this.handleMetadataUpdated=async(e,t)=>{var r;try{const n=await this.cipher.decrypt(t);null===(r=this.listener)||void 0===r||r.metadataUpdated(e,n)}catch(e){}},this.handleWalletUsernameUpdated=async e=>{this.handleMetadataUpdated("walletUsername",e)},this.handleAppVersionUpdated=async e=>{this.handleMetadataUpdated("AppVersion",e)},this.handleChainUpdated=async(e,t)=>{var r;try{const n=await this.cipher.decrypt(e),o=await this.cipher.decrypt(t);null===(r=this.listener)||void 0===r||r.chainUpdated(n,o)}catch(e){}},this.session=e,this.cipher=new me(e.secret),this.listener=r,this.linkAPIUrl=t,this.WebSocketClass=WebSocket;const n=this.createWebSocket();this.ws=n,this.http=new ye(t,e.id,e.key),this.setupVisibilityChangeHandler()}createWebSocket(){const e=new we(`${this.linkAPIUrl}/rpc`,this.WebSocketClass);return this.activeWsInstance=e,e.setConnectionStateListener((async t=>{if(e!==this.activeWsInstance)return;let r=!1;switch(t){case be.DISCONNECTED:if(this.heartbeatIntervalId&&(clearInterval(this.heartbeatIntervalId),this.heartbeatIntervalId=void 0),this.lastHeartbeatResponse=0,r=!1,!this.destroyed){(async()=>{if(this.isReconnecting)return;this.isReconnecting=!0;const t=0===this.reconnectAttempts?0:3e3;await new Promise((e=>setTimeout(e,t))),this.destroyed||e!==this.activeWsInstance?this.isReconnecting=!1:(this.reconnectAttempts++,"cleanup"in this.ws&&"function"==typeof this.ws.cleanup&&this.ws.cleanup(),this.ws=this.createWebSocket(),this.ws.connect().catch((()=>{})).finally((()=>{this.isReconnecting=!1})))})()}break;case be.CONNECTED:this.reconnectAttempts=0;try{r=await this.handleConnected(),this.fetchUnseenEventsAPI().catch((()=>{}))}catch(e){break}this.connected=r,this.updateLastHeartbeat(),this.heartbeatIntervalId&&clearInterval(this.heartbeatIntervalId),this.heartbeatIntervalId=window.setInterval((()=>{this.heartbeat()}),1e4),setTimeout((()=>{this.heartbeat()}),100);case be.CONNECTING:}t!==be.CONNECTED&&(this.connected=r)})),e.setIncomingDataListener((e=>{var t;switch(e.type){case"Heartbeat":return void this.updateLastHeartbeat();case"IsLinkedOK":case"Linked":{const t="IsLinkedOK"===e.type?e.linked:void 0;this.linked=t||e.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":this.handleSessionMetadataUpdated(e.metadata);break;case"Event":this.handleIncomingEvent(e)}void 0!==e.id&&(null===(t=this.requestResolutions.get(e.id))||void 0===t||t(e))})),e}setupVisibilityChangeHandler(){this.visibilityChangeHandler=()=>{document.hidden||this.destroyed||(this.connected?this.heartbeat():this.reconnectWithFreshWebSocket())},this.focusHandler=()=>{this.destroyed||this.connected||this.reconnectWithFreshWebSocket()},document.addEventListener("visibilitychange",this.visibilityChangeHandler),window.addEventListener("focus",this.focusHandler),window.addEventListener("pageshow",(e=>{e.persisted&&this.focusHandler&&this.focusHandler()}))}reconnectWithFreshWebSocket(){if(this.destroyed)return;const e=this.ws;this.activeWsInstance=void 0,e.disconnect(),"cleanup"in e&&"function"==typeof e.cleanup&&e.cleanup(),this.ws=this.createWebSocket(),this.ws.connect().catch((()=>{}))}connect(){if(this.destroyed)throw new Error("instance is destroyed");this.ws.connect()}
2async destroy(){this.destroyed||(await this.makeRequest({type:"SetSessionConfig",id:k(this.nextReqId++),sessionId:this.session.id,metadata:{__destroyed:"1"}},{timeout:1e3}),this.destroyed=!0,this.activeWsInstance=void 0,this.heartbeatIntervalId&&(clearInterval(this.heartbeatIntervalId),this.heartbeatIntervalId=void 0),this.visibilityChangeHandler&&document.removeEventListener("visibilitychange",this.visibilityChangeHandler),this.focusHandler&&window.removeEventListener("focus",this.focusHandler),this.ws.disconnect(),"cleanup"in this.ws&&"function"==typeof this.ws.cleanup&&this.ws.cleanup(),this.listener=void 0)}get connected(){return this._connected}set connected(e){this._connected=e}get linked(){return this._linked}set linked(e){var t,r;this._linked=e,e&&(null===(t=this.onceLinked)||void 0===t||t.call(this)),null===(r=this.listener)||void 0===r||r.linkedUpdated(e)}setOnceLinked(e){return new Promise((t=>{this.linked?e().then(t):this.onceLinked=()=>{e().then(t),this.onceLinked=void 0}}))}async handleIncomingEvent(e){var t;if("Event"===e.type&&"Web3Response"===e.event)try{const r=await this.cipher.decrypt(e.data),n=JSON.parse(r);if("WEB3_RESPONSE"!==n.type)return;null===(t=this.listener)||void 0===t||t.handleWeb3ResponseMessage(n.id,n.response)}catch(e){}}async checkUnseenEvents(){await new Promise((e=>setTimeout(e,250)));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){try{(await this.http.fetchUnseenEvents()).forEach((e=>{this.handleIncomingEvent(e)}))}catch(e){}}async publishEvent(e,t,r=!1){const n=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},t),{origin:location.origin,location:location.href,relaySource:"coinbaseWalletExtension"in window&&window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),o={type:"PublishEvent",id:k(this.nextReqId++),sessionId:this.session.id,event:e,data:n,callWebhook:r};return this.setOnceLinked((async()=>{const e=await this.makeRequest(o);if("Fail"===e.type)throw new Error(e.error||"failed to publish event");return e.eventId}))}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>2e4)this.ws.disconnect();else if(this.connected)try{this.ws.sendData("h")}catch(e){}}async makeRequest(e,t={timeout:6e4}){const r=e.id;let n;return this.sendData(e),Promise.race([new Promise(((e,o)=>{n=window.setTimeout((()=>{o(new Error(`request ${r} timed out`))}),t.timeout)})),new Promise((e=>{this.requestResolutions.set(r,(t=>{clearTimeout(n),e(t),this.requestResolutions.delete(r)}))}))])}async handleConnected(){return"Fail"!==(await this.makeRequest({type:"HostSession",id:k(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key})).type&&(this.sendData({type:"IsLinked",id:k(this.nextReqId++),sessionId:this.session.id}),this.sendData({type:"GetSessionConfig",id:k(this.nextReqId++),sessionId:this.session.id}),!0)}}class Ae{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,t=D(e.toString(16));return this.callbacks.get(t)&&this.callbacks.delete(t),e}}function Te(e,...t){if(!((r=e)instanceof Uint8Array||ArrayBuffer.isView(r)&&"Uint8Array"===r.constructor.name))throw new Error("Uint8Array expected");var r;if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Pe(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Ee(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Ce(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function ke(e,t){return e<<32-t|e>>>t}const _e=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),Ie=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function Se(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))}function xe(e){return"string"==typeof e&&(e=Se(e)),Te(e),e}class Be{}function Oe(e){const t=t=>e().update(xe(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Me(e,t,r){return e&t^e&r^t&r}class We extends Be{constructor(e,t,r,n){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(e),this.view=Ce(this.buffer)}update(e){Pe(this),Te(e=xe(e));const{view:t,buffer:r,blockLen:n}=this,o=e.length;for(let s=0;s<o;){const i=Math.min(n-this.pos,o-s);if(i!==n)r.set(e.subarray(s,s+i),this.pos),this.pos+=i,s+=i,this.pos===n&&(this.process(t,0),this.pos=0);else{const t=Ce(e);for(;n<=o-s;s+=n)this.process(t,s)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){Pe(this),function(e,t){Te(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:n,isLE:o}=this;let{pos:s}=this;t[s++]=128,Ee(this.buffer.subarray(s)),this.padOffset>n-s&&(this.process(r,0),s=0);for(let e=s;e<n;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const o=BigInt(32),s=BigInt(4294967295),i=Number(r>>o&s),a=Number(r&s),c=n?4:0,l=n?0:4;e.setUint32(t+c,i,n),e.setUint32(t+l,a,n)}(r,n-8,BigInt(8*this.length),o),this.process(r,0);const i=Ce(e),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=a/4,l=this.get();if(c>l.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)i.setUint32(4*e,l[e],o)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:o,destroyed:s,pos:i}=this;return e.destroyed=s,e.finished=o,e.length=n,e.pos=i,n%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}const je=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);const Re=Uint32Array.from([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,2756
2734187,3204031479,3329325298]),Ne=new Uint32Array(64);class Ue extends We{constructor(e=32){super(64,e,8,!1),this.A=0|je[0],this.B=0|je[1],this.C=0|je[2],this.D=0|je[3],this.E=0|je[4],this.F=0|je[5],this.G=0|je[6],this.H=0|je[7]}get(){const{A:e,B:t,C:r,D:n,E:o,F:s,G:i,H:a}=this;return[e,t,r,n,o,s,i,a]}set(e,t,r,n,o,s,i,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|o,this.F=0|s,this.G=0|i,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)Ne[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=Ne[e-15],r=Ne[e-2],n=ke(t,7)^ke(t,18)^t>>>3,o=ke(r,17)^ke(r,19)^r>>>10;Ne[e]=o+Ne[e-7]+n+Ne[e-16]|0}let{A:r,B:n,C:o,D:s,E:i,F:a,G:c,H:l}=this;for(let e=0;e<64;e++){const t=l+(ke(i,6)^ke(i,11)^ke(i,25))+((u=i)&a^~u&c)+Re[e]+Ne[e]|0,d=(ke(r,2)^ke(r,13)^ke(r,22))+Me(r,n,o)|0;l=c,c=a,a=i,i=s+t|0,s=o,o=n,n=r,r=t+d|0}var u;r=r+this.A|0,n=n+this.B|0,o=o+this.C|0,s=s+this.D|0,i=i+this.E|0,a=a+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(r,n,o,s,i,a,c,l)}roundClean(){Ee(Ne)}destroy(){this.set(0,0,0,0,0,0,0,0),Ee(this.buffer)}}const De=Oe((()=>new Ue)),Le="session:id",Fe="session:secret",ze="session:linked";class Ve{constructor(e,t,r,n=!1){this.storage=e,this.id=t,this.secret=r,this.key=function(e){if(Te(e),_e)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=Ie[e[r]];return t}(De(`${t}, ${r} WalletLink`)),this._linked=!!n}static create(e){const t=x(16),r=x(32);return new Ve(e,t,r).save()}static load(e){const t=e.getItem(Le),r=e.getItem(ze),n=e.getItem(Fe);return t&&n?new Ve(e,t,n,"1"===r):null}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this.storage.setItem(Le,this.id),this.storage.setItem(Fe,this.secret),this.persistLinked(),this}persistLinked(){this.storage.setItem(ze,this._linked?"1":"0")}}function qe(){try{return function(){try{return null!==window.frameElement}catch(e){return!1}}()&&window.top?window.top.location:window.location}catch(e){return window.location}}function He(){var e,t;return null!==(t=null===(e=null===window||void 0===window?void 0:window.matchMedia)||void 0===e?void 0:e.call(window,"(prefers-color-scheme: dark)").matches)&&void 0!==t&&t}function Ke(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode('@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}')),document.documentElement.appendChild(e)}var $e=r("./node_modules/clsx/dist/clsx.m.js"),Ge=r("./node_modules/preact/dist/preact.module.js"),Ye=r("./node_modules/preact/hooks/dist/hooks.module.js");class Je{constructor(){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=He()}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",e.appendChild(this.root),this.render()}presentItem(e){const t=this.nextItemKey++;return this.items.set(t,e),this.render(),()=>{this.items.delete(t),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,Ge.XX)((0,Ge.h)("div",null,(0,Ge.h)(Qe,{darkMode:this.darkMode},Array.from(this.items.entries()).map((([e,t])=>(0,Ge.h)(Ze,Object.assign({},t,{key:e})))))),this.root)}}const Qe=e=>(0,Ge.h)("div",{class:(0,$e.$)("-cbwsdk-snackbar-container")},(0,Ge.h)("style",null,".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;
2cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}"),(0,Ge.h)("div",{class:"-cbwsdk-snackbar"},e.children)),Ze=({autoExpand:e,message:t,menuItems:r})=>{const[n,o]=(0,Ye.J0)(!0),[s,i]=(0,Ye.J0)(null!=e&&e);(0,Ye.vJ)((()=>{const e=[window.setTimeout((()=>{o(!1)}),1),window.setTimeout((()=>{i(!0)}),1e4)];return()=>{e.forEach(window.clearTimeout)}}));return(0,Ge.h)("div",{class:(0,$e.$)("-cbwsdk-snackbar-instance",n&&"-cbwsdk-snackbar-instance-hidden",s&&"-cbwsdk-snackbar-instance-expanded")},(0,Ge.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:()=>{i(!s)}},(0,Ge.h)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,Ge.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},t),(0,Ge.h)("div",{class:"-gear-container"},!s&&(0,Ge.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,Ge.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,Ge.h)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwu
2NTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=",class:"-gear-icon",title:"Expand"}))),r&&r.length>0&&(0,Ge.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},r.map(((e,t)=>(0,Ge.h)("div",{class:(0,$e.$)("-cbwsdk-snackbar-instance-menu-item",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:e.onClick,key:t},(0,Ge.h)("svg",{width:e.svgWidth,height:e.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,Ge.h)("path",{"fill-rule":e.defaultFillRule,"clip-rule":e.defaultClipRule,d:e.path,fill:"#AAAAAA"})),(0,Ge.h)("span",{class:(0,$e.$)("-cbwsdk-snackbar-instance-menu-item-info",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},e.info))))))},Xe="M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z";class et{constructor(){this.attached=!1,this.snackbar=new Je}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,t=document.createElement("div");t.className="-cbwsdk-css-reset",e.appendChild(t),this.snackbar.attach(t),this.attached=!0,Ke()}showConnecting(e){let t;return t=e.isUnlinkedErrorState?{autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:{message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:Xe,defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(t)}}class tt{constructor(){this.root=null,this.darkMode=He()}attach(){const e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),Ke()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&((0,Ge.XX)(null,this.root),e&&(0,Ge.XX)((0,Ge.h)(rt,Object.assign({},e,{onDismiss:()=>{this.clear()},darkMode:this.darkMode})),this.root))}}const rt=({title:e,buttonText:t,darkMode:r,onButtonClick:n,onDismiss:o})=>{const s=r?"dark":"light";return(0,Ge.h)(Qe,{darkMode:r},(0,Ge.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,Ge.h)("style",null,".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}
2.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}"),(0,Ge.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:o}),(0,Ge.h)("div",{class:(0,$e.$)("-cbwsdk-redirect-dialog-box",s)},(0,Ge.h)("p",null,e),(0,Ge.h)("button",{onClick:n},t))))},nt="https://www.walletlink.org";class ot{constructor(){this.attached=!1,this.redirectDialog=new tt}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}redirectToCoinbaseWallet(e){const t=new URL("https://go.cb-w.com/walletlink");t.searchParams.append("redirect_url",qe().href),e&&t.searchParams.append("wl_url",e);const r=document.createElement("a");r.target="cbw-opener",r.href=t.href,r.rel="noreferrer noopener",r.click()}openCoinbaseWalletDeeplink(e){this.redirectToCoinbaseWallet(e),setTimeout((()=>{this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}})}),99)}showConnecting(e){return()=>{this.redirectDialog.clear()}}}class st{constructor(e){var t;this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.isMobileWeb=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(null===(t=null===window||void 0===window?void 0:window.navigator)||void 0===t?void 0:t.userAgent),this.linkedUpdated=e=>{this.isLinked=e;const t=this.storage.getItem(fe);if(e&&(this._session.linked=e),this.isUnlinkedErrorState=!1,t){const r=t.split(" "),n="true"===this.storage.getItem("IsStandaloneSigning");""===r[0]||e||!this._session.linked||n||(this.isUnlinkedErrorState=!0)}},this.metadataUpdated=(e,t)=>{this.storage.setItem(e,t)},this.chainUpdated=(e,t)=>{this.chainCallbackParams.chainId===e&&this.chainCallbackParams.jsonRpcUrl===t||(this.chainCallbackParams={chainId:e,jsonRpcUrl:t},this.chainCallback&&this.chainCallback(t,Number.parseInt(e,10)))},this.accountUpdated=e=>{this.accountsCallback&&this.accountsCallback([e]),st.accountRequestCallbackIds.size>0&&(Array.from(st.accountRequestCallbackIds.values()).forEach((t=>{this.invokeCallback(t,{method:"requestEthereumAccounts",result:[e]})})),st.accountRequestCallbackIds.clear())},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.metadata=e.metadata,this.accountsCallback=e.accountsCallback,this.chainCallback=e.chainCallback;const{session:r,ui:n,connection:o}=this.subscribe();this._session=r,this.connection=o,this.relayEventManager=new Ae,this.ui=n,this.ui.attach()}subscribe(){const e=Ve.load(this.storage)||Ve.create(this.storage),{linkAPIUrl:t}=this,r=new ve({session:e,linkAPIUrl:t,listener:this}),n=this.isMobileWeb?new ot:new et;return r.connect(),{session:e,ui:n,connection:r}}resetAndReload(){this.connection.destroy().then((()=>{const e=Ve.load(this.storage);(null==e?void 0:e.id)===this._session.id&&s.clearAll(),document.location.reload()})).catch((e=>{}))}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:j(e.weiValue),data:M(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?j(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?j(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?j(e.gasPriceInWei):null,gasLimit:e.gasLim
2it?j(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:j(e.weiValue),data:M(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?j(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?j(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?j(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?j(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,t){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:M(e,!0),chainId:t}})}getWalletLinkSession(){return this._session}sendRequest(e){let t=null;const r=x(8),n=n=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,e.method,n),null==t||t()};return new Promise(((o,s)=>{t=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:n,onResetConnection:this.resetAndReload}),this.relayEventManager.callbacks.set(r,(e=>{if(null==t||t(),ge(e))return s(new Error(e.errorMessage));o(e)})),this.publishWeb3RequestEvent(r,e)}))}publishWeb3RequestEvent(e,t){const r={type:"WEB3_REQUEST",id:e,request:t};this.publishEvent("Web3Request",r,!0).then((e=>{})).catch((e=>{this.handleWeb3ResponseMessage(r.id,{method:t.method,errorMessage:e.message})})),this.isMobileWeb&&this.openCoinbaseWalletDeeplink(t.method)}openCoinbaseWalletDeeplink(e){if(this.ui instanceof ot)switch(e){case"requestEthereumAccounts":case"switchEthereumChain":return;default:window.addEventListener("blur",(()=>{window.addEventListener("focus",(()=>{this.connection.checkUnseenEvents()}),{once:!0})}),{once:!0}),this.ui.openCoinbaseWalletDeeplink()}}publishWeb3RequestCanceledEvent(e){const t={type:"WEB3_REQUEST_CANCELED",id:e};this.publishEvent("Web3RequestCanceled",t,!1).then()}publishEvent(e,t,r){return this.connection.publishEvent(e,t,r)}handleWeb3ResponseMessage(e,t){if("requestEthereumAccounts"===t.method)return st.accountRequestCallbackIds.forEach((e=>this.invokeCallback(e,t))),void st.accountRequestCallbackIds.clear();this.invokeCallback(e,t)}handleErrorResponse(e,t,r){var n;const o=null!==(n=null==r?void 0:r.message)&&void 0!==n?n:"Unspecified error message.";this.handleWeb3ResponseMessage(e,{method:t,errorMessage:o})}invokeCallback(e,t){const r=this.relayEventManager.callbacks.get(e);r&&(r(t),this.relayEventManager.callbacks.delete(e))}requestEthereumAccounts(){const{appName:e,appLogoUrl:t}=this.metadata,r={method:"requestEthereumAccounts",params:{appName:e,appLogoUrl:t}},n=x(8);return new Promise(((e,t)=>{this.relayEventManager.callbacks.set(n,(r=>{if(ge(r))return t(new Error(r.errorMessage));e(r)})),st.accountRequestCallbackIds.add(n),this.publishWeb3RequestEvent(n,r)}))}watchAsset(e,t,r,n,o,s){const i={method:"watchAsset",params:{type:e,options:{address:t,symbol:r,decimals:n,image:o},chainId:s}};let a=null;const c=x(8),l=e=>{this.publishWeb3RequestCanceledEvent(c),this.handleErrorResponse(c,i.method,e),null==a||a()};return a=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:l,onResetConnection:this.resetAndReload}),new Promise(((e,t)=>{this.relayEventManager.callbacks.set(c,(r=>{if(null==a||a(),ge(r))return t(new Error(r.errorMessage));e(r)})),this.publishWeb3RequestEvent(c,i)}))}addEthereumChain(e,t,r,n,o,s){const i={method:"addEthereumChain",params:{chainId:e,rpcUrls:t,blockExplorerUrls:n,chainName:o,iconUrls:r,nativeCurrency:s}};let a=null;const c=x(8),l=e=>{this.publishWeb3RequestCanceledEvent(c),this.handleErrorResponse(c,i.method,e),null==a||a()};return a=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:l,onResetConnection:this.resetAndReload}),new Promise(((e,t)=>{this.relayEventManager.callbacks.set(c,(r=>{if(null==a||a(),ge(r))return t(new Error(r.errorMessage));e(r)})),this.publishWeb3RequestEvent(c,i)}))}switchEthereumChain(e,t){const r={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:t})};let n=null;const o=x(8),s=e=>{this.publishWeb3RequestCanceledEvent(o),this.handleErrorResponse(o,r.method,e),null==n||n()};return n=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:s,onResetConnection:this.resetAndReload}),new Promise(((e,t)=>{this.relayEventManager.callbacks.set(o,(r=>(null==n||n(),ge(r)&&r.errorCode?t(y.custom({code:r.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."})):ge(r)?t(new Error(r.errorMessage)):void e(r)))),this.publishWeb3RequestEvent(o,r)}))}}st.accountRequestCallbackIds=new Set;var it=r("./node_modules/buffer/index.js").Buffer;const at="DefaultChainId",ct="DefaultJsonRpcUrl";class lt{constructor(e){this._relay=null,this._addresses=[],this.metadata=e.metadata,this._storage=new s("walletlink",nt),this.callback=e.callback||null;const t=this._storage.getItem(fe);if(t){const e=t.split(" ");""!==e[0]&&(this._addresses=e.map((e=>z(e))))}this.initializeRelay()}getSession(){const e=this.initializeRelay(),{id:t,secret:r}=e.getWalletLinkSession();return{id:t,secret:r}}async handshake(){await this._eth_requestAccounts()}get selectedAddress(){return this._addresses[0]||void 0}get jsonRpcUrl(){var e;return null!==(e=this._storage.getItem(ct))&&void 0!==e?e:void 0}set jsonRpcUrl(e){this._storage.setItem(ct,e)}updateProviderInfo(e,t){var r;this.jsonRpcUrl=e;const n=this.getChainId();this._storage.setItem(at,t.toString(10));q(t)!==n&&(null===(r=this.callback)||void 0===r||r.call(this,"chainChanged",R(t)))}async watchAsset(e){const t=Array.isArray(e)?e[0]:e;
2if(!t.type)throw m.invalidParams("Type is required");if("ERC20"!==(null==t?void 0:t.type))throw m.invalidParams(`Asset of type '${t.type}' is not supported`);if(!(null==t?void 0:t.options))throw m.invalidParams("Options are required");if(!(null==t?void 0:t.options.address))throw m.invalidParams("Address is required");const r=this.getChainId(),{address:n,symbol:o,image:s,decimals:i}=t.options,a=this.initializeRelay(),c=await a.watchAsset(t.type,n,o,i,s,null==r?void 0:r.toString());return!ge(c)&&!!c.result}async addEthereumChain(e){var t,r;const n=e[0];if(0===(null===(t=n.rpcUrls)||void 0===t?void 0:t.length))throw m.invalidParams("please pass in at least 1 rpcUrl");if(!n.chainName||""===n.chainName.trim())throw m.invalidParams("chainName is a required field");if(!n.nativeCurrency)throw m.invalidParams("nativeCurrency is a required field");const o=Number.parseInt(n.chainId,16);if(o===this.getChainId())return!1;const s=this.initializeRelay(),{rpcUrls:i=[],blockExplorerUrls:a=[],chainName:c,iconUrls:l=[],nativeCurrency:u}=n,d=await s.addEthereumChain(o.toString(),i,l,a,c,u);if(ge(d))return!1;if(!0===(null===(r=d.result)||void 0===r?void 0:r.isApproved))return this.updateProviderInfo(i[0],o),null;throw m.internal("unable to add ethereum chain")}async switchEthereumChain(e){const t=e[0],r=Number.parseInt(t.chainId,16),n=this.initializeRelay(),o=await n.switchEthereumChain(r.toString(10),this.selectedAddress||void 0);if(ge(o))throw o;const s=o.result;return s.isApproved&&s.rpcUrl.length>0&&this.updateProviderInfo(s.rpcUrl,r),null}async cleanup(){this.callback=null,this._relay&&this._relay.resetAndReload(),this._storage.clear()}_setAddresses(e,t){var r;if(!Array.isArray(e))throw new Error("addresses is not an array");const n=e.map((e=>z(e)));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses=n,null===(r=this.callback)||void 0===r||r.call(this,"accountsChanged",n),this._storage.setItem(fe,n.join(" ")))}async request(e){const t=e.params||[];switch(e.method){case"eth_accounts":return[...this._addresses];case"eth_coinbase":return this.selectedAddress||null;case"net_version":return this.getChainId().toString(10);case"eth_chainId":return R(this.getChainId());case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_ecRecover":case"personal_ecRecover":return this.ecRecover(e);case"personal_sign":return this.personalSign(e);case"eth_signTransaction":return this._eth_signTransaction(t);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(t);case"eth_sendTransaction":return this._eth_sendTransaction(t);case"eth_signTypedData_v1":case"eth_signTypedData_v3":case"eth_signTypedData_v4":case"eth_signTypedData":return this.signTypedData(e);case"wallet_addEthereumChain":return this.addEthereumChain(t);case"wallet_switchEthereumChain":return this.switchEthereumChain(t);case"wallet_watchAsset":return this.watchAsset(t);default:if(!this.jsonRpcUrl)throw m.internal("No RPC URL set for chain");return ie(e,this.jsonRpcUrl)}}_ensureKnownAddress(e){const t=z(e);if(!this._addresses.map((e=>z(e))).includes(t))throw new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const t=e.from?z(e.from):this.selectedAddress;if(!t)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(t);return{fromAddress:t,toAddress:e.to?z(e.to):null,weiValue:null!=e.value?H(e.value):BigInt(0),data:e.data?V(e.data):it.alloc(0),nonce:null!=e.nonce?q(e.nonce):null,gasPriceInWei:null!=e.gasPrice?H(e.gasPrice):null,maxFeePerGas:null!=e.maxFeePerGas?H(e.maxFeePerGas):null,maxPriorityFeePerGas:null!=e.maxPriorityFeePerGas?H(e.maxPriorityFeePerGas):null,gasLimit:null!=e.gas?H(e.gas):null,chainId:e.chainId?q(e.chainId):this.getChainId()}}async ecRecover(e){const{method:t,params:r}=e;if(!Array.isArray(r))throw m.invalidParams();const n=this.initializeRelay(),o=await n.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:W(r[0]),signature:W(r[1]),addPrefix:"personal_ecRecover"===t}});if(ge(o))throw o;return o.result}getChainId(){var e;return Number.parseInt(null!==(e=this._storage.getItem(at))&&void 0!==e?e:"1",10)}async _eth_requestAccounts(){var e,t;if(this._addresses.length>0)return null===(e=this.callback)||void 0===e||e.call(this,"connect",{chainId:R(this.getChainId())}),this._addresses;const r=this.initializeRelay(),n=await r.requestEthereumAccounts();if(ge(n))throw n;if(!n.result)throw new Error("accounts received is empty");return this._setAddresses(n.result),null===(t=this.callback)||void 0===t||t.call(this,"connect",{chainId:R(this.getChainId())}),this._addresses}async personalSign({params:e}
2){if(!Array.isArray(e))throw m.invalidParams();const t=e[1],r=e[0];this._ensureKnownAddress(t);const n=this.initializeRelay(),o=await n.sendRequest({method:"signEthereumMessage",params:{address:z(t),message:W(r),addPrefix:!0,typedDataJson:null}});if(ge(o))throw o;return o.result}async _eth_signTransaction(e){const t=this._prepareTransactionParams(e[0]||{}),r=this.initializeRelay(),n=await r.signEthereumTransaction(t);if(ge(n))throw n;return n.result}async _eth_sendRawTransaction(e){const t=V(e[0]),r=this.initializeRelay(),n=await r.submitEthereumTransaction(t,this.getChainId());if(ge(n))throw n;return n.result}async _eth_sendTransaction(e){const t=this._prepareTransactionParams(e[0]||{}),r=this.initializeRelay(),n=await r.signAndSubmitEthereumTransaction(t);if(ge(n))throw n;return n.result}async signTypedData(e){const{method:t,params:r}=e;if(!Array.isArray(r))throw m.invalidParams();const n=r["eth_signTypedData_v1"===t?1:0],o=r["eth_signTypedData_v1"===t?0:1];this._ensureKnownAddress(n);const s=this.initializeRelay(),i=await s.sendRequest({method:"signEthereumMessage",params:{address:z(n),message:(a=o,M({eth_signTypedData_v1:pe.hashForSignTypedDataLegacy,eth_signTypedData_v3:pe.hashForSignTypedData_v3,eth_signTypedData_v4:pe.hashForSignTypedData_v4,eth_signTypedData:pe.hashForSignTypedData_v4}[t]({data:K(a)}),!0)),typedDataJson:JSON.stringify(o,null,2),addPrefix:!1}});var a;if(ge(i))throw i;return i.result}initializeRelay(){return this._relay||(this._relay=new st({linkAPIUrl:nt,storage:this._storage,metadata:this.metadata,accountsCallback:this._setAddresses.bind(this),chainCallback:this.updateProviderInfo.bind(this)})),this._relay}}const ut="SignerType",dt=new s("CBWSDK","SignerConfigurator");async function ht(e){const{communicator:t,metadata:r,handshakeRequest:n,callback:o}=e;(async function(e,t,r){await e.onMessage((({event:e})=>"WalletLinkSessionRequest"===e));const n=new lt({metadata:t,callback:r});e.postMessage({event:"WalletLinkUpdate",data:{session:n.getSession()}}),await n.handshake(),e.postMessage({event:"WalletLinkUpdate",data:{connected:!0}})})(t,r,o).catch((()=>{}));const s={id:crypto.randomUUID(),event:"selectSignerType",data:Object.assign(Object.assign({},e.preference),{handshakeRequest:n})},{data:i}=await t.postRequestAndWaitForResponse(s);return i}const{checkCrossOriginOpenerPolicy:pt,getCrossOriginOpenerPolicy:ft}=(()=>{let e;return{getCrossOriginOpenerPolicy:()=>void 0===e?"undefined":e,checkCrossOriginOpenerPolicy:async()=>{if("undefined"!=typeof window)try{const t=`${window.location.origin}${window.location.pathname}`,r=await fetch(t,{method:"HEAD"});if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);const n=r.headers.get("Cross-Origin-Opener-Policy");e=null!=n?n:"null","same-origin"===e&&console.error("Coinbase Wallet SDK requires the Cross-Origin-Opener-Policy header to not be set to 'same-origin'. This is to ensure that the SDK can communicate with the Coinbase Smart Wallet app.\n\nPlease see https://www.smartwallet.dev/guides/tips/popup-tips#cross-origin-opener-policy for more information.")}catch(t){console.error("Error checking Cross-Origin-Opener-Policy:",t.message),e="error"}else e="non-browser-env"}}})(),gt={isRed:!1,info:"Retry",svgWidth:"10",svgHeight:"11",path:Xe,defaultFillRule:"evenodd",defaultClipRule:"evenodd"};let mt=null;function yt(e){const t=(window.innerWidth-420)/2+window.screenX,r=(window.innerHeight-540)/2+window.screenY;function n(){const n=`wallet_${crypto.randomUUID()}`,o=window.open(e,n,`width=420, height=540, left=${t}, top=${r}`);return null==o||o.focus(),o||null}!function(e){const t={sdkName:se,sdkVersion:oe,origin:window.location.origin,coop:ft()};for(const[r,n]of Object.entries(t))e.searchParams.append(r,n.toString())}(e);let o=n();if(!o){const e=function(){if(!mt){const e=document.createElement("div");e.className="-cbwsdk-css-reset",document.body.appendChild(e),mt=new Je,mt.attach(e)}return mt}();return new Promise(((t,r)=>{e.presentItem({autoExpand:!0,message:"Popup was blocked. Try again.",menuItems:[Object.assign(Object.assign({},gt),{onClick:()=>{o=n(),o?t(o):r(m.internal("Popup window was blocked")),e.clear()}})]})}))}return Promise.resolve(o)}class bt{constructor({url:e="https://keys.coinbase.com/connect",metadata:t,preference:r}){this.popup=null,this.listeners=new Map,this.postMessage=async e=>{(await this.waitForPopupLoaded()).postMessage(e,this.url.origin)},this.postRequestAndWaitForResponse=async e=>{const t=this.onMessage((({requestId:t})=>t===e.id));return this.postMessage(e),await t},this.onMessage=async e=>new Promise(((t,r)=>{const n=r=>{if(r.origin!==this.url.origin)return;const o=r.data;e(o)&&(t(o),window.removeEventListener("message",n),this.listeners.delete(n))};window.addEventListener("message",n),this.listeners.set(n,{reject:r})})),this.disconnect=()=>{var e;(e=this.popup)&&!e.closed&&e.close(),this.popup=null,this.listeners.forEac
2h((({reject:e},t)=>{e(y.userRejectedRequest("Request rejected")),window.removeEventListener("message",t)})),this.listeners.clear()},this.waitForPopupLoaded=async()=>this.popup&&!this.popup.closed?(this.popup.focus(),this.popup):(this.popup=await yt(this.url),this.onMessage((({event:e})=>"PopupUnload"===e)).then(this.disconnect).catch((()=>{})),this.onMessage((({event:e})=>"PopupLoaded"===e)).then((e=>{this.postMessage({requestId:e.id,data:{version:oe,metadata:this.metadata,preference:this.preference,location:window.location.toString()}})})).then((()=>{if(!this.popup)throw m.internal();return this.popup}))),this.url=new URL(e),this.metadata=t,this.preference=r}}function wt(e){const t=d(function(e){var t;if("string"==typeof e)return{message:e,code:i.internal};if(ge(e)){const r=e.errorMessage,n=null!==(t=e.errorCode)&&void 0!==t?t:r.match(/(denied|rejected)/i)?a.userRejectedRequest:void 0;return Object.assign(Object.assign({},e),{message:r,code:n,data:{method:e.method}})}return e}(e),{shouldIncludeStack:!0}),r=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");return r.searchParams.set("version",oe),r.searchParams.set("code",t.code.toString()),r.searchParams.set("message",t.message),Object.assign(Object.assign({},t),{docUrl:r.href})}var vt=r("./node_modules/eventemitter3/index.mjs");class At extends vt.b{}var Tt=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r};class Pt extends At{constructor(e){var{metadata:t}=e,r=e.preference,{keysUrl:n}=r,o=Tt(r,["keysUrl"]);super(),this.signer=null,this.isCoinbaseWallet=!0,this.metadata=t,this.preference=o,this.communicator=new bt({url:n,metadata:t,preference:o});const s=dt.getItem(ut);s&&(this.signer=this.initSigner(s))}async request(e){try{if(function(e){if(!e||"object"!=typeof e||Array.isArray(e))throw m.invalidParams({message:"Expected a single, non-array, object argument.",data:e});const{method:t,params:r}=e;if("string"!=typeof t||0===t.length)throw m.invalidParams({message:"'args.method' must be a non-empty string.",data:e});if(void 0!==r&&!Array.isArray(r)&&("object"!=typeof r||null===r))throw m.invalidParams({message:"'args.params' must be an object or array if provided.",data:e});switch(t){case"eth_sign":case"eth_signTypedData_v2":case"eth_subscribe":case"eth_unsubscribe":throw y.unsupportedMethod()}}(e),!this.signer)switch(e.method){case"eth_requestAccounts":{const t=await this.requestSignerSelection(e),r=this.initSigner(t);await r.handshake(e),this.signer=r,function(e){dt.setItem(ut,e)}(t);break}case"wallet_sendCalls":{const t=this.initSigner("scw");await t.handshake({method:"handshake"});const r=await t.request(e);return await t.cleanup(),r}case"wallet_getCallsStatus":return ie(e,"https://rpc.wallet.coinbase.com");case"net_version":return 1;case"eth_chainId":return R(1);default:throw y.unauthorized("Must call 'eth_requestAccounts' before other methods")}return await this.signer.request(e)}catch(e){const{code:t}=e;return t===a.unauthorized&&this.disconnect(),Promise.reject(wt(e))}}async enable(){return console.warn('.enable() has been deprecated. Please use .request({ method: "eth_requestAccounts" }) instead.'),await this.request({method:"eth_requestAccounts"})}async disconnect(){var e;await(null===(e=this.signer)||void 0===e?void 0:e.cleanup()),this.signer=null,s.clearAll(),this.emit("disconnect",y.disconnected("User initiated disconnection"))}requestSignerSelection(e){return ht({communicator:this.communicator,preference:this.preference,metadata:this.metadata,handshakeRequest:e,callback:this.emit.bind(this)})}initSigner(e){return function(e){const{signerType:t,metadata:r,communicator:n,callback:o}=e;switch(t){case"scw":return new he({metadata:r,callback:o,communicator:n});case"walletlink":return new lt({metadata:r,callback:o})}}({signerType:e,metadata:this.metadata,communicator:this.communicator,callback:this.emit.bind(this)})}}function Et(e){if(e){if(!["all","smartWalletOnly","eoaOnly"].includes(e.options))throw new Error(`Invalid options: ${e.options}`);
2if(e.attribution&&void 0!==e.attribution.auto&&void 0!==e.attribution.dataSuffix)throw new Error("Attribution cannot contain both auto and dataSuffix properties")}}class Ct{constructor(e){this.metadata={appName:e.appName||"Dapp",appLogoUrl:e.appLogoUrl||$(),appChainIds:e.appChainIds||[]},this.storeLatestVersion(),pt()}makeWeb3Provider(e={options:"all"}){var t;Et(e);const r={metadata:this.metadata,preference:e};return null!==(t=ae(r))&&void 0!==t?t:new Pt(r)}getCoinbaseWalletLogo(e,t=240){return((e,t)=>{let r;switch(e){case"standard":default:return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3
2V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7
2h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`}})(e,t)}storeLatestVersion(){new s("CBWSDK").setItem("VERSION",oe)}}const kt={options:"all"};function _t(e){var t;new s("CBWSDK").setItem("VERSION",oe),pt();const r={metadata:{appName:e.appName||"Dapp",appLogoUrl:e.appLogoUrl||"",appChainIds:e.appChainIds||[]},preference:Object.assign(kt,null!==(t=e.preference)&&void 0!==t?t:{})};Et(r.preference);let n=null;return{getProvider:()=>(n||(n=function(e){var t;const r={metadata:e.metadata,preference:e.preference};return null!==(t=ae(r))&&void 0!==t?t:new Pt(r)}(r)),n)}}const It=Ct},"./node_modules/@metamask/connect-tron/dist/adapter.mjs"(e,t,r){"use strict";r.d(t,{x:()=>B});var n=r("./node_modules/@metamask/chain-agnostic-permission/dist/scope/constants.mjs");const o=4294967295;let s=Math.floor(Math.random()*o);const i=()=>(s=(s+1)%o,s);function a(e,t,r){return-1===t?e:new Promise(((n,o)=>{const s=setTimeout((()=>{o(r?r():new Error(`Timeout after ${t}ms`))}),t);e.then((e=>{clearTimeout(s),n(e)})).catch((e=>{clearTimeout(s),o(e)}))}))}const c="metamask-contentscript",l="metamask-inpage",u="metamask-multichain-provider",d="metamask-provider",h=-1,p=200;async function f(){return new Promise(((e,t)=>{const r=t=>{if(function(e){const{target:t,data:r}=e.data;return t===l&&r?.name===d&&e.origin===location.origin}(t)){const o=t?.data?.data?.data;if("METAMASK_EXTENSION_CONNECT_CAN_RETRY"===o?.method)g();else if(o?.result?.extensionId){const t=o?.result?.extensionId;e(t),window.removeEventListener("message",r),clearTimeout(n)}}},n=setTimeout((()=>{window.removeEventListener("message",r),t(new Error("MetaMask extension not found"))}),1e4);window.addEventListener("message",r),g()}))}function g(){window.postMessage({target:c,data:{name:d,data:{method:"metamask_getProviderState"}}},location.origin)}class m extends Error{constructor(e){super(e.message),this.name=this.constructor.name,this.cause=e,Object.setPrototypeOf(this,this.constructor.prototype)}}class y extends Error{constructor(e,t){super(e),this.name=this.constructor.name,this.cause=t,Object.setPrototypeOf(this,this.constructor.prototype)}}class b extends y{constructor(e="Transport request timed out",t){super(e,t)}}function w(e={}){let{extensionId:t}=e;const{defaultTimeout:r=h,warmupTimeout:n=p}=e;let o,s=i();const c=new Map,l=new Set;function u(e){const{data:t}=e;if(null==t?.id)!function(e){for(const t of l)try{t(e)}catch(e){console.log("[ChromeTransport] notifyCallbacks error:",e)}}(t);else if(c.has(t.id)){const e=c.get(t.id);c.delete(t.id),e?.(t)}}return{warmupTimeout:n,connect:async()=>{try{t||(t=await f());const e=chrome.runtime.connect(t);let r=!0;if(e.onDisconnect.addListener((()=>{console.log("[ChromeTransport] chromePort disconnected"),o=void 0,r=!1})),await new Promise((e=>setTimeout(e,10))),!r)throw new Error(`No extension found with id: ${t}`);e.onMessage.addListener(u),o=e}catch(e){throw new y("Failed to connect to MetaMask",e)}},disconnect:async()=>
2{if(o)try{o.disconnect(),o=void 0,l.clear(),c.clear()}catch(e){console.log("[ChromeTransport] disconnect error:",e)}},isConnected:()=>void 0!==o,request:async(e,t={})=>{const{timeout:n=r}=t,i=o;if(!i)throw new y("Chrome port not connected");const l=s++,u={id:l,jsonrpc:"2.0",...e};try{return await a(new Promise((e=>{c.set(l,e),i.postMessage({type:"caip-348",data:u})})),n,(()=>new b))}catch(e){throw c.has(l)&&c.delete(l),e}},onNotification:e=>(l.add(e),()=>{l.delete(e)})}}function v(e={}){const{defaultTimeout:t=h,warmupTimeout:r=p}=e;let n=null;const o=new Map,s=new Set;function d(e){if(null==e?.id)!function(e){for(const t of s)try{t(e)}catch(e){console.log("[WindowPostMessageTransport] notifyCallbacks error:",e)}}(e);else if(o.has(e.id)){const t=o.get(e.id);o.delete(e.id),t?.(e)}}async function f(){n&&(window.removeEventListener("message",n),n=null),o.clear(),s.clear()}const g=()=>Boolean(n);return{warmupTimeout:r,connect:async()=>{g()&&await f(),n=e=>{const{target:t,data:r}=e.data;t===l&&r?.name===u&&e.origin===location.origin&&d(r.data)},window.addEventListener("message",n)},disconnect:f,isConnected:g,request:(e,r={})=>{const{timeout:n=t}=r;if(!g())throw new y("Transport not connected");const s=i(),l={jsonrpc:"2.0",id:s,...e};return a(new Promise((e=>{o.set(s,(t=>e(t))),function(e){window.postMessage({target:c,data:{name:u,data:e}},location.origin)}(l)})),n,(()=>new b)).catch((e=>{throw o.has(s)&&o.delete(s),e}))},onNotification:e=>(s.add(e),()=>{s.delete(e)})}}function A({extensionId:e,defaultTimeout:t,warmupTimeout:r}={}){return"undefined"!=typeof chrome&&!!chrome.runtime&&"function"==typeof chrome.runtime.connect?w({extensionId:e,defaultTimeout:t,warmupTimeout:r}):v({defaultTimeout:t,warmupTimeout:r})}function T({transport:e}){let t,r;async function n(){e.isConnected()||(r||(r=e.connect()),await r)}async function o(){return t||(t=(async()=>{await n(),await async function(e,t={}){const{maxRetries:r=10,retryDelay:n=200,timeoutErrorClass:o}=t;for(let t=0;t<=r;t++)try{return await e()}catch(e){if(t>=r)throw e;if(o&&"function"==typeof o&&e instanceof o)continue;await new Promise((e=>setTimeout(e,n)))}throw new Error("Max retries exceeded")}((()=>e.request({method:"wallet_getSession"},{timeout:e.warmupTimeout??1e3})))})()),await t}return n(),{createSession:async t=>(await o(),await P({transport:e,method:"wallet_createSession",params:t})),getSession:async()=>(await o(),await P({transport:e,method:"wallet_getSession"})),revokeSession:async n=>{await o(),t=void 0,r=void 0,await P({transport:e,method:"wallet_revokeSession",params:n}),await e.disconnect()},invokeMethod:async t=>(await o(),await P({transport:e,method:"wallet_invokeMethod",params:t})),extendsRpcApi:()=>T({transport:e}),onNotification:t=>e.onNotification(t)}}async function P({transport:e,method:t,params:r,timeout:n}){const o=await e.request({method:t,params:r},{timeout:n});if(o?.error)throw new m(o.error);return o.result}var E=r("./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/adapter.js"),C=r("./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/errors.js");var k;!function(e){e.MAINNET="tron:728126428",e.SHASTA="tron:2494104990",e.NILE="tron:3448148188"}(k||(k={}));var _=r("./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/types.js");function I(e){switch(e){case k.MAINNET:return"0x2b6653dc";case k.NILE:return"0xcd8690dc";case k.SHASTA:return"0x94a9059e";default:throw new Error(`Could not determine chainId for unsupported scope: ${e}`)}}function S(e){return"wallet_notify"===e?.method&&"metamask_accountsChanged"===e?.params?.notification?.method}var x=r("./node_modules/buffer/index.js").Buffer;class B extends E.Y3{constructor(){super(),this.name="MetaMask",this.url="https://metamask.io",this.icon="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHZpZXdCb3g9IjAgMCAzMCAzMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjIzIiBoZWlnaHQ9IjIzIiB4PSIzLjUiIHk9IjMuNSIgdmlld0JveD0iMCAwIDE0MS41MSAxMzYuNDIiPjxwYXRoIGZpbGw9IiNGRjVDMTYiIGQ9Im0xMzIuMjQgMTMxLjc1LTMwLjQ4LTkuMDctMjIuOTkgMTMuNzQtMTYuMDMtLjAxLTIzLTEzLjc0LTMwLjQ3IDkuMDhMMCAxMDAuNDdsOS4yNy0zNC43M0wwIDM2LjQgOS4yNyAwbDQ3LjYgMjguNDRoMjcuNzZMMTMyLjI0IDBsOS4yNyAzNi4zOC05LjI3IDI5LjM2IDkuMjcgMzQuNzItOS4yNyAzMS4zWiIvPjxwYXRoIGZpbGw9IiNGRjVDMTYiIGQ9Im05LjI3IDAgNDcuNjEgMjguNDZMNTQuOTggNDggOS4yOSAwWm0zMC40NyAxMDAuNDggMjAuOTUgMTUuOTUtMjAuOTUgNi4yNHYtMjIuMlpNNTkuMDEgNzQuMSA1NSA0OCAyOS4yMiA2NS43NWgtLjAybC4wOCAxOC4yNyAxMC40NS05LjkyaDE5LjI5Wk0xMzIuMjUgMGwtNDcuNiAyOC40Nkw4Ni41MSA0OGw0NS43Mi00OFptLTMwLjQ3IDEwMC40OC0yMC45NCAxNS45NSAyMC45NCA2LjI0di0yMi4yWm0xMC41My0zNC43M0w4Ni41MyA0OCA4Mi4
21IDc0LjFoMTkuMjdsMTAuNDYgOS45LjA3LTE4LjI2WiIvPjxwYXRoIGZpbGw9IiNFMzQ4MDciIGQ9Im0zOS43MyAxMjIuNjctMzAuNDYgOS4wOEwwIDEwMC40OGgzOS43M3YyMi4yWk01OS4wMiA3NC4xbDUuODIgMzcuNzEtOC4wNy0yMC45Ny0yNy40OS02LjgyIDEwLjQ2LTkuOTJINTlabTQyLjc2IDQ4LjU5IDMwLjQ3IDkuMDcgOS4yNy0zMS4yN2gtMzkuNzR6TTgyLjUgNzQuMDlsLTUuODIgMzcuNzEgOC4wNi0yMC45NyAyNy41LTYuODItMTAuNDctOS45MnoiLz48cGF0aCBmaWxsPSIjRkY4RDVEIiBkPSJtMCAxMDAuNDcgOS4yNy0zNC43M0gyOS4ybC4wNyAxOC4yNyAyNy41IDYuODIgOC4wNiAyMC45Ny00LjE1IDQuNjItMjAuOTQtMTUuOTZIMFptMTQxLjUgMC05LjI2LTM0LjczaC0xOS45M2wtLjA3IDE4LjI3LTI3LjUgNi44Mi04LjA2IDIwLjk3IDQuMTUgNC42MiAyMC45NC0xNS45NmgzOS43NFpNODQuNjQgMjguNDRINTYuODhsLTEuODkgMTkuNTQgOS44NCA2My44aDExLjg1bDkuODUtNjMuOC0xLjktMTkuNTRaIi8+PHBhdGggZmlsbD0iIzY2MTgwMCIgZD0iTTkuMjcgMCAwIDM2LjM4bDkuMjcgMjkuMzZIMjkuMkw1NC45OCA0OHptNDMuOTggODEuNjdoLTkuMDNsLTQuOTIgNC44MSAxNy40NyA0LjMzLTMuNTItOS4xNVpNMTMyLjI0IDBsOS4yNyAzNi4zOC05LjI3IDI5LjM2aC0xOS45M0w4Ni41MyA0OHpNODguMjcgODEuNjdoOS4wNGw0LjkyIDQuODItMTcuNDkgNC4zNCAzLjUzLTkuMTdabS05LjUgNDIuMyAyLjA2LTcuNTQtNC4xNS00LjYySDY0LjgybC00LjE0IDQuNjIgMi4wNSA3LjU0Ii8+PHBhdGggZmlsbD0iI0MwQzRDRCIgZD0iTTc4Ljc3IDEyMy45N3YxMi40NUg2Mi43NHYtMTIuNDVoMTYuMDJaIi8+PHBhdGggZmlsbD0iI0U3RUJGNiIgZD0ibTM5Ljc0IDEyMi42NiAyMyAxMy43NnYtMTIuNDZsLTIuMDUtNy41NHptNjIuMDMgMC0yMyAxMy43NnYtMTIuNDZsMi4wNi03LjU0eiIvPjwvc3ZnPjwvc3ZnPg==",this._readyState=E.Ok.Loading,this._state=E.nL.Disconnect,this._connecting=!1,this._switchingChain=!1,this._address=null,this._transport=A(),this._client=T({transport:this._transport}),this._checkWalletPromise=this.checkWallet(),this._selectedAddressOnPageLoadPromise=this.getInitialSelectedAddress(),this._checkWalletPromise.then((e=>{e&&this.tryRestoringSession().then((()=>{this.address&&(this.startListeners(),this.setState(E.nL.Connected),this.emit("connect",this.address))})).catch((e=>{console.warn("Failed to auto-restore session:",e)}))}))}get address(){return this._address}get state(){return this._state}get readyState(){return this._readyState}get connecting(){return this._connecting}async connect(){try{if(this.connected||this.connecting)return;if(this._readyState!==E.Ok.Found)throw new C.Y6("Wallet not found or not ready");if(!await this._checkWalletPromise)throw new C.Y6("Wallet not found after initialization");this._connecting=!0;try{if(await this.tryRestoringSession(),this.address||await this.createSession(k.MAINNET),!this.address)return;this.startListeners(),this.setState(E.nL.Connected),this.emit("connect",this.address)}catch(e){throw new C.Y6(e?.message,e)}}catch(e){throw this.emit("error",e),e}finally{this._connecting=!1}}async disconnect(){this.state===E.nL.Connected&&(this.stopListeners(),this.setAddress(null),this.setScope(void 0,!1),this.setState(E.nL.Disconnect),this.emit("disconnect"),await this._client.revokeSession({scopes:[k.MAINNET,k.NILE,k.SHASTA]}))}async signTransaction(e,t){try{if(!this._scope)throw new C.PQ("Wallet not connected");const t=e.raw_data.contract[0]?.type;if(!t)throw new C.z4("Transaction contract type is required");const r=await this._client.invokeMethod({scope:this._scope,request:{method:"signTransaction",params:{address:this._address,transaction:{rawDataHex:e.raw_data_hex,type:t}}}});return{...e,signature:[r.signature]}}catch(e){if(e instanceof Error||"object"==typeof e&&e.message)throw new C.z4(e.message,e);if("string"==typeof e)throw new C.z4(e,new Error(e));throw new C.z4("Unknown error",e)}}async signMessage(e,t){try{if(!this._scope)throw new C.PQ("Wallet not connected");const t=x.from(e).toString("base64");return(await this._client.invokeMethod({scope:this._scope,request:{method:"signMessage",params:{message:t,address:this._address}}})).signature}catch(e){if(e instanceof Error||"object"==typeof e&&e.message)throw new C.K3(e.message,e);if("string"==typeof e)throw new C.K3(e,new Error(e));throw new C.K3("Unknown error",e)}}async switchChain(e){if(this._switchingChain)return;if(this._switchingChain=!0,!this._scope)throw this._switchingChain=!1,new C.PQ("Wallet not connected");const t=function(e){switch(e){case"0x2b6653dc":return k.MAINNET;case"0xcd8690dc":return k.NILE;case"0x94a9059e":return k.SHASTA;default:throw new Error(`Could not determine scope for unsupported chainId: ${e}`)}}(e);
2if(t===this._scope)return this.emit("chainChanged",{chainId:e}),void(this._switchingChain=!1);let r=await this._client.getSession(),n=r?.sessionScopes[t]?.accounts?.includes(`${t}:${this._address}`);if(!n&&(await this.createSession(t,this.address?[this.address]:void 0),r=await this._client.getSession(),n=r?.sessionScopes[t]?.accounts?.includes(`${t}:${this._address}`),!n))throw this._switchingChain=!1,new C.Y6("Failed to switch chain");this.setScope(t),this._switchingChain=!1}async network(){try{if(this.state!==E.nL.Connected||!this._scope)throw new C.PQ("Wallet not connected");const e=I(this._scope);return{networkType:function(e){switch(e){case k.MAINNET:return _.z1.Mainnet;case k.NILE:return _.z1.Nile;case k.SHASTA:return _.z1.Shasta;default:throw new Error(`Could not determine network type for unsupported scope: ${e}`)}}(this._scope),chainId:e,fullNode:"",solidityNode:"",eventServer:""}}catch(e){throw this.emit("error",e),e}}getInitialSelectedAddress(){return new Promise((e=>{const t=setTimeout((()=>{e(void 0)}),2e3),r=this._client.onNotification((n=>{if(S(n)){const o=n?.params?.notification?.params?.[0];o&&(clearTimeout(t),r?.(),e(o))}}))}))}async checkWallet(){return await async function({timeout:e=2e3}={}){return new Promise((t=>{const r=e=>{e.detail.info.rdns.includes("io.metamask")&&(window.removeEventListener("eip6963:announceProvider",r),clearTimeout(n),t(!0))},n=setTimeout((()=>{window.removeEventListener("eip6963:announceProvider",r),t(!1)}),e);window.addEventListener("eip6963:announceProvider",r),window.dispatchEvent(new Event("eip6963:requestProvider"))}))}()?(this._readyState=E.Ok.Found,this.emit("readyStateChanged",this.readyState),!0):(this._readyState=E.Ok.NotFound,this.emit("readyStateChanged",this.readyState),!1)}async tryRestoringSession(){try{const e=await this._client.getSession();if(!e)return;const t=await this._selectedAddressOnPageLoadPromise,r=this.restoreScope();this.updateSession(e,r,t)}catch(e){console.warn("Error restoring session",e)}}async createSession(e,t){let r;const o=new Promise((e=>{r=e})),s=this._client.onNotification((e=>{if(!S(e))return;const t=e?.params?.notification?.params?.[0];t&&(s(),r(t))})),i=await this._client.createSession({optionalScopes:{[e]:{accounts:t?t.map((t=>`${e}:${t}`)):[],methods:[],notifications:[]}},sessionProperties:{[n.NG.TronAccountChangedNotifications]:!0}}),a=await Promise.race([o,new Promise((e=>setTimeout((()=>e(void 0)),2e3)))]);this.updateSession(i,void 0,a)}updateSession(e,t,r){const n=this._scope,o=this.selectScopeFromSessionWithPriority(e,t);if(!o)return void this.setAddress(null);const s=e?.sessionScopes[o]?.accounts;if(!s?.[0])return void this.setAddress(null);let i;i=r&&s.includes(`${o}:${r}`)?r:this._address&&s.includes(`${o}:${this._address}`)?this._address:function(e){const[,,t]=e.split(":");if(!t)throw new Error(`Invalid CAIP account ID: ${e}`);return t}(s[0]),this.setAddress(i),this.setScope(o,n!==o)}startListeners(e){this._removeAccountsChangedListener=this._client.onNotification(e??this.handleEvents.bind(this))}stopListeners(){this._removeAccountsChangedListener?.(),this._removeAccountsChangedListener=void 0}async handleEvents(e){if(S(e)){const t=e?.params?.notification?.params?.[0];if(!t)return void await this.disconnect();const r=await this._client.getSession();if(!r)return;this.updateSession(r,this._scope,t)}else if(t=e,"wallet_sessionChanged"===t?.method){const t=e?.params;if(!t)return;const r=this.selectScopeFromSessionWithPriority(t);if(!r)return void await this.disconnect();if(!(t?.sessionScopes?.[r]?.accounts?.length>0))return void await this.disconnect();this.updateSession(t,r)}var t}setAddress(e){this._address!==e&&(e&&this.emit("accountsChanged",e,this._address||""),this._address=e)}setState(e){e!==this.state&&(this._state=e,this.emit("stateChanged",e))}setScope(e,t=!0){if(this._scope!==e&&(localStorage.setItem("metamaskAdapterScope",e??""),this._scope=e,this._scope&&t)){const e=I(this._scope);this.emit("chainChanged",{chainId:e})}}restoreScope(){const e=localStorage.getItem("metamaskAdapterScope");return e||void 0}selectScopeFromSessionWithPriority(e,t){const r=new Set(Object.keys(e?.sessionScopes??{}));
2return(t?[t]:[]).concat([k.MAINNET,k.SHASTA,k.NILE]).find((e=>r.has(e)))}}},"./node_modules/@reown/appkit-pay/dist/esm/src/partials/w3m-pay-fees-skeleton/index.js"(e,t,r){"use strict";var n=r("./node_modules/@reown/appkit-pay/node_modules/lit/index.js"),o=r("./node_modules/@reown/appkit-pay/node_modules/@reown/appkit-ui/dist/esm/exports/index.js");r("./node_modules/@reown/appkit-pay/node_modules/@reown/appkit-ui/dist/esm/exports/wui-flex.js"),r("./node_modules/@reown/appkit-pay/node_modules/@reown/appkit-ui/dist/esm/exports/wui-shimmer.js"),r("./node_modules/@reown/appkit-pay/node_modules/@reown/appkit-ui/dist/esm/exports/wui-text.js");const s=n.AH` 3 :host { 4 display: block; 5 } 6`;var i=function(e,t,r,n){var o,s=arguments.length,i=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(t,r,i):o(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i};let a=class extends n.WF{render(){return n.qy` 7 <wui-flex flexDirection="column" gap="4"> 8 <wui-flex alignItems="center" justifyContent="space-between"> 9 <wui-text variant="md-regular" color="secondary">Pay</wui-text> 10 <wui-shimmer width="60px" height="16px" borderRadius="4xs" variant="light"></wui-shimmer> 11 </wui-flex> 12 13 <wui-flex alignItems="center" justifyContent="space-between"> 14 <wui-text variant="md-regular" color="secondary">Network Fee</wui-text> 15 16 <wui-flex flexDirection="column" alignItems="flex-end" gap="2"> 17 <wui-shimmer 18 width="75px" 19 height="16px" 20 borderRadius="4xs" 21 variant="light" 22 ></wui-shimmer> 23 24 <wui-flex alignItems="center" gap="01"> 25 <wui-shimmer width="14px" height="14px" rounded variant="light"></wui-shimmer> 26 <wui-shimmer 27 width="49px" 28 height="14px" 29 borderRadius="4xs" 30 variant="light" 31 ></wui-shimmer> 32 </wui-flex> 33 </wui-flex> 34 </wui-flex> 35 36 <wui-flex alignItems="center" justifyContent="space-between"> 37 <wui-text variant="md-regular" color="secondary">Service Fee</wui-text> 38 <wui-shimmer width="75px" height="16px" borderRadius="4xs" variant="light"></wui-shimmer> 39 </wui-flex> 40 </wui-flex> 41 `}};a.styles=[s],a=i([(0,o.EM)("w3m-pay-fees-skeleton")],a)},"./node_modules/@reown/appkit-pay/dist/esm/src/partials/w3m-pay-options-skeleton/index.js"(e,t,r){"use strict";var n=r("./node_modules/@reown/appkit-pay/node_modules/lit/index.js"),o=r("./node_modules/@reown/appkit-pay/node_modules/@reown/appkit-ui/dist/esm/exports/index.js");r("./node_modules/@reown/appkit-pay/node_modules/@reown/appkit-ui/dist/esm/exports/wui-flex.js"),r("./node_modules/@reown/appkit-pay/node_modules/@reown/appkit-ui/dist/esm/exports/wui-shimmer.js");const s=o.AH` 42 :host { 43 display: block; 44 width: 100%; 45 } 46 47 .pay-options-container { 48 max-height: 196px; 49 overflow-y: auto; 50 overflow-x: hidden; 51 scrollbar-width: none; 52 } 53 54 .pay-options-container::-webkit-scrollbar {
55 display: none; 56 } 57 58 .pay-option-container { 59 border-radius: ${({borderRadius:e})=>e[4]}; 60 padding: ${({spacing:e})=>e[3]}; 61 min-height: 60px; 62 } 63 64 .token-images-container { 65 position: relative; 66 justify-content: center; 67 align-items: center; 68 } 69 70 .chain-image { 71 position: absolute; 72 bottom: -3px; 73 right: -5px; 74 border: 2px solid ${({tokens:e})=>e.theme.foregroundSecondary}; 75 } 76`;var i=function(e,t,r,n){var o,s=arguments.length,i=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(t,r,i):o(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i};let a=class extends n.WF{render(){return n.qy` 77 <wui-flex flexDirection="column" gap="2" class="pay-options-container"> 78 ${this.renderOptionEntry()} ${this.renderOptionEntry()} ${this.renderOptionEntry()} 79 </wui-flex> 80 `}renderOptionEntry(){return n.qy` 81 <wui-flex 82 alignItems="center" 83 justifyContent="space-between" 84 gap="2" 85 class="pay-option-container" 86 > 87 <wui-flex alignItems="center" gap="2"> 88 <wui-flex class="token-images-container"> 89 <wui-shimmer 90 width="32px" 91 height="32px" 92 rounded 93 variant="light" 94 class="token-image" 95 ></wui-shimmer> 96 <wui-shimmer 97 width="16px" 98 height="16px" 99 rounded 100 variant="light" 101 class="chain-image" 102 ></wui-shimmer> 103 </wui-flex> 104 105 <wui-flex flexDirection="column" gap="1"> 106 <wui-shimmer 107 width="74px" 108 height="16px" 109 borderRadius="4xs" 110 variant="light" 111 ></wui-shimmer> 112 <wui-shimmer 113 width="46px" 114 height="14px" 115 borderRadius="4xs" 116 variant="light" 117 ></wui-shimmer> 118 </wui-flex> 119 </wui-flex> 120 </wui-flex> 121 `}};a.styles=[s],a=i([(0,o.EM)("w3m-pay-options-skeleton")],a)},"./node_modules/@reown/appkit-pay/node_modules/@reown/appkit-ui/dist/esm/src/composites/wui-button/index.js"(e,t,r){"use strict";var n=r("./node_modules/@reown/appkit-pay/node_modules/lit/index.js"),o=r("./node_modules/@reown/appkit-pay/node_modules/lit/decorators.js"),s=(r("./node_modules/@reown/appkit-pay/node_modules/@reown/appkit-ui/dist/esm/src/components/wui-icon/index.js"),r("./node_modules/@reown/appkit-pay/node_modules/@reown/appkit-ui/dist/esm/src/components/wui-loading-spinner/index.js"),r("./node_modules/@reown/appkit-pay/node_modules/@reown/appkit-ui/dist/esm/src/components/wui-text/index.js"),r("./node_modules/@reown/appkit-pay/node_modules/@reown/appkit-ui/dist/esm/src/utils/ThemeUtil.js")),i=r("./node_modules/@reown/appkit-pay/node_modules/@reown/appkit-ui/dist/esm/src/utils/WebComponentsUtil.js");const a=r("./node_modules/@reown/appkit-pay/node_modules/@reown/appkit-ui/dist/esm/src/utils/ThemeHelperUtil.js").AH` 122 :host { 123 width: var(--local-width); 124 } 125 126 button { 127 width: var(--local-width); 128 white-space: nowrap; 129 column-gap: ${({spacing:e})=>e[2]}; 130 transition: 131 scale ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-1"]}, 132 background-color ${({durations:e})=>e.lg} 133 ${({easings:e})=>e["ease-out-power-2"]}, 134 border-radius ${({durations:e})=>e.lg} 135 ${({easings:e})=>e["ease-out-power-1"]}; 136 will-change: scale, background-color, border-radius; 137 cursor: pointer; 138 } 139 140 /* -- Sizes --------------------------------------------------- */ 141 button[data-size='sm'] { 142 border-radius: ${({borderRadius:e})=>e[2]}; 143 padding: 0 ${({spacing:e})=>e[2]}; 144 height: 28px; 145 } 146 147 button[data-size='md'] { 148 border-radius: ${({borderRadius:e})=>e[3]}; 149 padding: 0 ${({spacing:e})=>e[4]}; 150 height: 38px; 151 } 152 153 button[data-size='lg'] { 154 border-radius: ${({borderRadius:e})=>e[4]}; 155 padding: 0 ${({spacing:e})=>e[5]}; 156 height: 48px; 157 } 158 159 /* -- Variants --------------------------------------------------------- */ 160 button[data-variant='accent-primary'] { 161 background-color: ${({tokens:e})=>e.core.backgroundAccentPrimary}; 162 color: ${({tokens:e})=>e.theme.textInvert}; 163 } 164 165 button[data-variant='accent-secondary'] { 166 background-color: ${({tokens:e})=>e.core.foregroundAccent010}; 167 color: ${({tokens:e})=>e.core.textAccentPrimary}; 168 } 169 170 button[data-variant='neutral-primary'] { 171 background-color: ${({tokens:e})=>e.theme.backgroundInvert}; 172 color: ${({tokens:e})=>e.theme.textInvert}; 173 } 174 175 button[data-variant='neutral-secondary'] { 176 background-color: transparent; 177 border: 1px solid ${({tokens:e})=>e.theme.borderSecondary}; 178 color: ${({tokens:e})=>e.theme.textPrimary}; 179 } 180 181 button[data-variant='neutral-tertiary'] { 182 background-color: ${({tokens:e})=>e.theme.foregroundPrimary}; 183 color: ${({tokens:e})=>e.theme.textPrimary}; 184 } 185 186 button[data-variant='error-primary'] { 187 background-color: ${({tokens:e})=>e.core.textError}; 188 color: ${({tokens:e})=>e.theme.textInvert}; 189 } 190 191 button[data-variant='error-secondary'] { 192 background-color: ${({tokens:e})=>e.core.backgroundError}; 193 color: ${({tokens:e})=>e.core.textError}; 194 } 195 196 button[data-variant='shade'] { 197 background: var(--wui-color-gray-glass-002); 198 color: var(--wui-color-fg-200); 199 border: none; 200 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); 201 } 202 203 /* -- Focus states --------------------------------------------------- */ 204 button[data-size='sm']:focus-visible:enabled { 205 border-radius: 28px; 206 } 207 208 button[data-size='md']:focus-visible:enabled { 209 border-radius: 38px; 210 } 211 212 button[data-size='lg']:focus-visible:enabled { 213 border-radius: 48px; 214 } 215 button[data-variant='shade']:focus-visible:enabled { 216 background: var(--wui-color-gray-glass-005); 217 box-shadow: 218 inset 0 0 0 1px var(--wui-color-gray-glass-010), 219 0 0 0 4px var(--wui-color-gray-glass-002); 220 } 221 222 /* -- Hover & Active states ----------------------------------------------------------- */ 223 @media (hover: hover) { 224 button[data-size='sm']:hover:enabled { 225 border-radius: 28px; 226 } 227 228 button[data-size='md']:hover:enabled { 229 border-radius: 38px; 230 } 231 232 button[data-size='lg']:hover:enabled { 233 border-radius: 48px; 234 } 235 236 button[data-variant='shade']:hover:enabled { 237 background: var(--wui-color-gray-glass-002); 238 } 239 240 button[data-variant='shade']:active:enabled { 241 background: var(--wui-color-gray-glass-005); 242 } 243 } 244 245 button[data-size='sm']:active:enabled { 246 border-radius: 28px; 247 } 248 249 button[data-size='md']:active:enabled { 250 border-radius: 38px; 251 } 252 253 button[data-size='lg']:active:enabled { 254 border-radius: 48px; 255 } 256 257 /* -- Disabled states --------------------------------------------------- */ 258 button:disabled { 259 opacity: 0.3; 260 } 261`;var c=function(e,t,r,n){var o,s=arguments.length,i=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(t,r,i):o(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i};const l={lg:"lg-regular-mono",md:"md-regular-mono",sm:"sm-regular-mono"},u={lg:"md",md:"md",sm:"sm"};let d=class extends n.WF{constructor(){super(...arguments),this.size="lg",this.disabled=!1,this.fullWidth=!1,this.loading=!1,this.variant="accent-primary"}render(){this.style.cssText=`\n --local-width: ${this.fullWidth?"100%":"auto"};\n `;const e=this.textVariant??l[this.size];return n.qy` 262 <button data-variant=${this.variant} data-size=${this.size} ?disabled=${this.disabled}> 263 ${this.loadingTemplate()} 264 <slot name="iconLeft"></slot> 265 <wui-text variant=${e} color="inherit"> 266 <slot></slot> 267 </wui-text> 268 <slot name="iconRight"></slot> 269 </button> 270 `}loadingTemplate(){if(this.loading){const e=u[this.size],t="neutral-primary"===this.variant||"accent-primary"===this.variant?"invert":"primary";return n.qy`<wui-loading-spinner color=${t} size=${e}></wui-loading-spinner>`}return null}};d.styles=[s.W5,s.fD,a],c([(0,o.MZ)()],d.prototype,"size",void 0),c([(0,o.MZ)({type:Boolean})],d.prototype,"disabled",void 0),c([(0,o.MZ)({type:Boolean})],d.prototype,"fullWidth",void 0),c([(0,o.MZ)({type:Boolean})],d.prototype,"loading",void 0),c([(0,o.MZ)()],d.prototype,"variant",void 0),c([(0,o.MZ)()],d.prototype,"textVariant",void 0),d=c([(0,i.E)("wui-button")],d)},"./node_modules/@reown/appkit-pay/node_modules/@reown/appkit-ui/dist/esm/src/composites/wui-icon-button/index.js"(e,t,r){"use strict";var n=r("./node_modules/@reown/appkit-pay/node_modules/lit/index.js"),o=r("./node_modules/@reown/appkit-pay/node_modules/lit/decorators.js"),s=r("./node_modules/@reown/appkit-pay/node_modules/lit/directives/if-defined.js"),i=(r("./node_modules/@reown/appkit-pay/node_modules/@reown/appkit-ui/dist/esm/src/components/wui-icon/index.js"),r("./node_modules/@reown/appkit-pay/node_modules/@reown/appkit-ui/dist/esm/src/utils/ThemeUtil.js")),a=r("./node_modules/@reown/appkit-pay/node_modules/@reown/appkit-ui/dist/esm/src/utils/WebComponentsUtil.js");const c=r("./node_modules/@reown/appkit-pay/node_modules/@reown/appkit-ui/dist/esm/src/utils/ThemeHelperUtil.js").AH` 271 :host { 272 position: relative; 273 } 274 275 button { 276 display: flex; 277 justify-content: center;
278 align-items: center; 279 background-color: transparent; 280 padding: ${({spacing:e})=>e[1]}; 281 } 282 283 /* -- Colors --------------------------------------------------- */ 284 button[data-type='accent'] wui-icon { 285 color: ${({tokens:e})=>e.core.iconAccentPrimary}; 286 } 287 288 button[data-type='neutral'][data-variant='primary'] wui-icon { 289 color: ${({tokens:e})=>e.theme.iconInverse}; 290 } 291 292 button[data-type='neutral'][data-variant='secondary'] wui-icon { 293 color: ${({tokens:e})=>e.theme.iconDefault}; 294 } 295 296 button[data-type='success'] wui-icon { 297 color: ${({tokens:e})=>e.core.iconSuccess}; 298 } 299 300 button[data-type='error'] wui-icon { 301 color: ${({tokens:e})=>e.core.iconError}; 302 } 303 304 /* -- Sizes --------------------------------------------------- */ 305 button[data-size='xs'] { 306 width: 16px; 307 height: 16px; 308 309 border-radius: ${({borderRadius:e})=>e[1]}; 310 } 311 312 button[data-size='sm'] { 313 width: 20px; 314 height: 20px; 315 border-radius: ${({borderRadius:e})=>e[1]}; 316 } 317 318 button[data-size='md'] { 319 width: 24px; 320 height: 24px; 321 border-radius: ${({borderRadius:e})=>e[2]}; 322 } 323 324 button[data-size='lg'] { 325 width: 28px; 326 height: 28px; 327 border-radius: ${({borderRadius:e})=>e[2]}; 328 } 329 330 button[data-size='xs'] wui-icon { 331 width: 8px; 332 height: 8px; 333 } 334 335 button[data-size='sm'] wui-icon { 336 width: 12px; 337 height: 12px; 338 } 339 340 button[data-size='md'] wui-icon { 341 width: 16px; 342 height: 16px; 343 } 344 345 button[data-size='lg'] wui-icon { 346 width: 20px; 347 height: 20px; 348 } 349 350 /* -- Hover --------------------------------------------------- */ 351 @media (hover: hover) { 352 button[data-type='accent']:hover:enabled { 353 background-color: ${({tokens:e})=>e.core.foregroundAccent010}; 354 } 355 356 button[data-variant='primary'][data-type='neutral']:hover:enabled { 357 background-color: ${({tokens:e})=>e.theme.foregroundSecondary}; 358 } 359 360 button[data-variant='secondary'][data-type='neutral']:hover:enabled { 361 background-color: ${({tokens:e})=>e.theme.foregroundSecondary}; 362 } 363 364 button[data-type='success']:hover:enabled { 365 background-color: ${({tokens:e})=>e.core.backgroundSuccess}; 366 } 367 368 button[data-type='error']:hover:enabled { 369 background-color: ${({tokens:e})=>e.core.backgroundError}; 370 } 371 } 372 373 /* -- Focus --------------------------------------------------- */ 374 button:focus-visible { 375 box-shadow: 0 0 0 4px ${({tokens:e})=>e.core.foregroundAccent020}; 376 } 377 378 /* -- Properties --------------------------------------------------- */ 379 button[data-full-width='true'] { 380 width: 100%; 381 } 382 383 :host([fullWidth]) { 384 width: 100%; 385 } 386 387 button[disabled] { 388 opacity: 0.5; 389 cursor: not-allowed; 390 } 391`;var l=function(e,t,r,n){var o,s=arguments.length,i=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(t,r,i):o(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i};let u=class extends n.WF{constructor(){super(...arguments),this.icon="card",this.variant="primary",this.type="accent",this.size="md",this.iconSize=void 0,this.fullWidth=!1,this.disabled=!1}render(){return n.qy`<button 392 data-variant=${this.variant} 393 data-type=${this.type} 394 data-size=${this.size} 395 data-full-width=${this.fullWidth} 396 ?disabled=${this.disabled} 397 > 398 <wui-icon color="inherit" name=${this.icon} size=${(0,s.J)(this.iconSize)}></wui-icon> 399 </button>`}};u.styles=[i.W5,i.fD,c],l([(0,o.MZ)()],u.prototype,"icon",void 0),l([(0,o.MZ)()],u.prototype,"variant",void 0),l([(0,o.MZ)()],u.prototype,"type",void 0),l([(0,o.MZ)()],u.prototype,"size",void 0),l([(0,o.MZ)()],u.prototype,"iconSize",void 0),l([(0,o.MZ)({type:Boolean})],u.prototype,"fullWidth",void 0),l([(0,o.MZ)({type:Boolean})],u.prototype,"disabled",void 0),u=l([(0,a.E)("wui-icon-button")],u)},"./node_modules/@reown/appkit-universal-connector/node_modules/@reown/appkit-ui/dist/esm/src/composites/wui-button/index.js"(e,t,r){"use strict";var n=r("./node_modules/@reown/appkit-universal-connector/node_modules/lit/index.js"),o=r("./node_modules/@reown/appkit-universal-connector/node_modules/lit/decorators.js"),s=(r("./node_modules/@reown/appkit-universal-connector/node_modules/@reown/appkit-ui/dist/esm/src/components/wui-icon/index.js"),r("./node_modules/@reown/appkit-universal-connector/node_modules/@reown/appkit-ui/dist/esm/src/components/wui-loading-spinner/index.js"),r("./node_modules/@reown/appkit-universal-connector/node_modules/@reown/appkit-ui/dist/esm/src/components/wui-text/index.js"),r("./node_modules/@reown/appkit-universal-connector/node_modules/@reown/appkit-ui/dist/esm/src/utils/ThemeUtil.js")),i=r("./node_modules/@reown/appkit-universal-connector/node_modules/@reown/appkit-ui/dist/esm/src/utils/WebComponentsUtil.js");const a=r("./node_modules/@reown/appkit-universal-connector/node_modules/@reown/appkit-ui/dist/esm/src/utils/ThemeHelperUtil.js").AH` 400 :host { 401 width: var(--local-width); 402 } 403 404 button { 405 width: var(--local-width); 406 white-space: nowrap; 407 column-gap: ${({spacing:e})=>e[2]}; 408 transition: 409 scale ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-1"]}, 410 background-color ${({durations:e})=>e.lg} 411 ${({easings:e})=>e["ease-out-power-2"]}, 412 border-radius ${({durations:e})=>e.lg} 413 ${({easings:e})=>e["ease-out-power-1"]}; 414 will-change: scale, background-color, border-radius; 415 cursor: pointer; 416 } 417 418 /* -- Sizes --------------------------------------------------- */ 419 button[data-size='sm'] { 420 border-radius: ${({borderRadius:e})=>e[2]}; 421 padding: 0 ${({spacing:e})=>e[2]}; 422 height: 28px; 423 } 424 425 button[data-size='md'] { 426 border-radius: ${({borderRadius:e})=>e[3]}; 427 padding: 0 ${({spacing:e})=>e[4]}; 428 height: 38px; 429 } 430 431 button[data-size='lg'] { 432 border-radius: ${({borderRadius:e})=>e[4]}; 433 padding: 0 ${({spacing:e})=>e[5]}; 434 height: 48px; 435 } 436 437 /* -- Variants --------------------------------------------------------- */ 438 button[data-variant='accent-primary'] { 439 background-color: ${({tokens:e})=>e.core.backgroundAccentPrimary}; 440 color: ${({tokens:e})=>e.theme.textInvert}; 441 } 442 443 button[data-variant='accent-secondary'] { 444 background-color: ${({tokens:e})=>e.core.foregroundAccent010}; 445 color: ${({tokens:e})=>e.core.textAccentPrimary}; 446 } 447 448 button[data-variant='neutral-primary'] { 449 background-color: ${({tokens:e})=>e.theme.backgroundInvert}; 450 color: ${({tokens:e})=>e.theme.textInvert}; 451 } 452 453 button[data-variant='neutral-secondary'] { 454 background-color: transparent; 455 border: 1px solid ${({tokens:e})=>e.theme.borderSecondary}; 456 color: ${({tokens:e})=>e.theme.textPrimary}; 457 } 458 459 button[data-variant='neutral-tertiary'] { 460 background-color: ${({tokens:e})=>e.theme.foregroundPrimary}; 461 color: ${({tokens:e})=>e.theme.textPrimary}; 462 } 463 464 button[data-variant='error-primary'] { 465 background-color: ${({tokens:e})=>e.core.textError}; 466 color: ${({tokens:e})=>e.theme.textInvert}; 467 } 468 469 button[data-variant='error-secondary'] { 470 background-color: ${({tokens:e})=>e.core.backgroundError}; 471 color: ${({tokens:e})=>e.core.textError}; 472 } 473 474 button[data-variant='shade'] { 475 background: var(--wui-color-gray-glass-002); 476 color: var(--wui-color-fg-200); 477 border: none; 478 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); 479 } 480 481 /* -- Focus states --------------------------------------------------- */ 482 button[data-size='sm']:focus-visible:enabled { 483 border-radius: 28px; 484 } 485 486 button[data-size='md']:focus-visible:enabled { 487 border-radius: 38px; 488 } 489 490 button[data-size='lg']:focus-visible:enabled { 491 border-radius: 48px; 492 } 493 button[data-variant='shade']:focus-visible:enabled { 494 background: var(--wui-color-gray-glass-005); 495 box-shadow: 496 inset 0 0 0 1px var(--wui-color-gray-glass-010), 497 0 0 0 4px var(--wui-color-gray-glass-002); 498 } 499 500 /* -- Hover & Active states ----------------------------------------------------------- */ 501 @media (hover: hover) { 502 button[data-size='sm']:hover:enabled { 503 border-radius: 28px; 504 } 505 506 button[data-size='md']:hover:enabled { 507 border-radius: 38px; 508 } 509 510 button[data-size='lg']:hover:enabled { 511 border-radius: 48px; 512 } 513 514 button[data-variant='shade']:hover:enabled { 515 background: var(--wui-color-gray-glass-002); 516 } 517 518 button[data-variant='shade']:active:enabled { 519 background: var(--wui-color-gray-glass-005); 520 } 521 } 522 523 button[data-size='sm']:active:enabled { 524 border-radius: 28px; 525 } 526 527 button[data-size='md']:active:enabled { 528 border-radius: 38px; 529 } 530 531 button[data-size='lg']:active:enabled { 532 border-radius: 48px; 533 } 534 535 /* -- Disabled states --------------------------------------------------- */ 536 button:disabled { 537 opacity: 0.3; 538 } 539`;var c=function(e,t,r,n){var o,s=arguments.length,i=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(t,r,i):o(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i};const l={lg:"lg-regular-mono",md:"md-regular-mono",sm:"sm-regular-mono"},u={lg:"md",md:"md",sm:"sm"};let d=class extends n.WF{constructor(){super(...arguments),this.size="lg",this.disabled=!1,this.fullWidth=!1,this.loading=!1,this.variant="accent-primary"}render(){this.style.cssText=`\n --local-width: ${this.fullWidth?"100%":"auto"};\n `;const e=this.textVariant??l[this.size];return n.qy` 540 <button data-variant=${this.variant} data-size=${this.size} ?disabled=${this.disabled}> 541 ${this.loadingTemplate()} 542 <slot name="iconLeft"></slot> 543 <wui-text variant=${e} color="inherit"> 544 <slot></slot> 545 </wui-text> 546 <slot name="iconRight"></slot> 547 </button> 548 `}loadingTemplate(){if(this.loading){const e=u[this.size],t="neutral-primary"===this.variant||"accent-primary"===this.variant?"invert":"primary";return n.qy`<wui-loading-spinner color=${t} size=${e}></wui-loading-spinner>`}return null}};d.styles=[s.W5,s.fD,a],c([(0,o.MZ)()],d.prototype,"size",void 0),c([(0,o.MZ)({type:Boolean})],d.prototype,"disabled",void 0),c([(0,o.MZ)({type:Boolean})],d.prototype,"fullWidth",void 0),c([(0,o.MZ)({type:Boolean})],d.prototype,"loading",void 0),c([(0,o.MZ)()],d.prototype,"variant",void 0),c([(0,o.MZ)()],d.prototype,"textVariant",void 0),d=c([(0,i.E)("wui-button")],d)},"./node_modules/@reown/appkit-universal-connector/node_modules/@reown/appkit-ui/dist/esm/src/composites/wui-cta-button/index.js"(e,t,r){"use strict";var n=r("./node_modules/@reown/appkit-universal-connector/node_modules/lit/index.js"),o=r("./node_modules/@reown/appkit-universal-connector/node_modules/lit/decorators.js"),s=(r("./node_modules/@reown/appkit-universal-connector/node_modules/@reown/appkit-ui/dist/esm/src/components/wui-icon/index.js"),r("./node_modules/@reown/appkit-universal-connector/node_modules/@reown/appkit-ui/dist/esm/src/components/wui-text/index.js"),r("./node_modules/@reown/appkit-universal-connector/node_modules/@reown/appkit-ui/dist/esm/src/layout/wui-flex/index.js"),r("./node_modules/@reown/appkit-universal-connector/node_modules/@reown/appkit-ui/dist/esm/src/utils/ThemeUtil.js")),i=r("./node_modules/@reown/appkit-universal-connector/node_modules/@reown/appkit-ui/dist/esm/src/utils/WebComponentsUtil.js");r("./node_modules/@reown/appkit-universal-connector/node_modules/@reown/appkit-ui/dist/esm/src/composites/wui-button/index.js");const a=r("./node_modules/@reown/appkit-universal-connector/node_modules/@reown/appkit-ui/dist/esm/src/utils/ThemeHelperUtil.js").AH` 549 wui-flex { 550 width: 100%; 551 height: 52px; 552 box-sizing: border-box; 553 background-color: ${({tokens:e})=>e.theme.foregroundPrimary}; 554 border-radius: ${({borderRadius:e})=>e[5]}; 555 padding-left: ${({spacing:e})=>e[3]}; 556 padding-right: ${({spacing:e})=>e[3]}; 557 display: flex; 558 align-items: center; 559 justify-content: space-between; 560 gap: ${({spacing:e})=>e[6]}; 561 } 562 563 wui-text { 564 color: ${({tokens:e})=>e.theme.textSecondary}; 565 } 566 567 wui-icon { 568 width: 12px; 569 height: 12px; 570 } 571`;var c=function(e,t,r,n){var o,s=arguments.length,i=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(t,r,i):o(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i};let l=class extends n.WF{constructor(){super(...arguments),this.disabled=!1,this.label="",this.buttonLabel=""}render(){return n.qy` 572 <wui-flex justifyContent="space-between" alignItems="center"> 573 <wui-text variant="lg-regular" color="inherit">${this.label}</wui-text> 574 <wui-button variant="accent-secondary" size="sm"> 575 ${this.buttonLabel} 576 <wui-icon name="chevronRight" color="inherit" size="inherit" slot="iconRight"></wui-icon> 577 </wui-button>
577 578 </wui-flex> 579 `}};l.styles=[s.W5,s.fD,a],c([(0,o.MZ)({type:Boolean})],l.prototype,"disabled",void 0),c([(0,o.MZ)()],l.prototype,"label",void 0),c([(0,o.MZ)()],l.prototype,"buttonLabel",void 0),l=c([(0,i.E)("wui-cta-button")],l)},"./node_modules/@reown/appkit-universal-connector/node_modules/@reown/appkit-ui/dist/esm/src/composites/wui-icon-button/index.js"(e,t,r){"use strict";var n=r("./node_modules/@reown/appkit-universal-connector/node_modules/lit/index.js"),o=r("./node_modules/@reown/appkit-universal-connector/node_modules/lit/decorators.js"),s=r("./node_modules/@reown/appkit-universal-connector/node_modules/lit/directives/if-defined.js"),i=(r("./node_modules/@reown/appkit-universal-connector/node_modules/@reown/appkit-ui/dist/esm/src/components/wui-icon/index.js"),r("./node_modules/@reown/appkit-universal-connector/node_modules/@reown/appkit-ui/dist/esm/src/utils/ThemeUtil.js")),a=r("./node_modules/@reown/appkit-universal-connector/node_modules/@reown/appkit-ui/dist/esm/src/utils/WebComponentsUtil.js");const c=r("./node_modules/@reown/appkit-universal-connector/node_modules/@reown/appkit-ui/dist/esm/src/utils/ThemeHelperUtil.js").AH` 580 :host { 581 position: relative; 582 } 583 584 button { 585 display: flex; 586 justify-content: center; 587 align-items: center; 588 background-color: transparent; 589 padding: ${({spacing:e})=>e[1]}; 590 } 591 592 /* -- Colors --------------------------------------------------- */ 593 button[data-type='accent'] wui-icon { 594 color: ${({tokens:e})=>e.core.iconAccentPrimary}; 595 } 596 597 button[data-type='neutral'][data-variant='primary'] wui-icon { 598 color: ${({tokens:e})=>e.theme.iconInverse}; 599 } 600 601 button[data-type='neutral'][data-variant='secondary'] wui-icon { 602 color: ${({tokens:e})=>e.theme.iconDefault}; 603 } 604 605 button[data-type='success'] wui-icon { 606 color: ${({tokens:e})=>e.core.iconSuccess}; 607 } 608 609 button[data-type='error'] wui-icon { 610 color: ${({tokens:e})=>e.core.iconError}; 611 } 612 613 /* -- Sizes --------------------------------------------------- */ 614 button[data-size='xs'] { 615 width: 16px; 616 height: 16px; 617 618 border-radius: ${({borderRadius:e})=>e[1]}; 619 } 620 621 button[data-size='sm'] { 622 width: 20px; 623 height: 20px; 624 border-radius: ${({borderRadius:e})=>e[1]}; 625 } 626 627 button[data-size='md'] { 628 width: 24px; 629 height: 24px; 630 border-radius: ${({borderRadius:e})=>e[2]}; 631 } 632 633 button[data-size='lg'] { 634 width: 28px; 635 height: 28px; 636 border-radius: ${({borderRadius:e})=>e[2]}; 637 } 638 639 button[data-size='xs'] wui-icon { 640 width: 8px; 641 height: 8px; 642 } 643 644 button[data-size='sm'] wui-icon { 645 width: 12px; 646 height: 12px; 647 } 648 649 button[data-size='md'] wui-icon { 650 width: 16px; 651 height: 16px; 652 } 653 654 button[data-size='lg'] wui-icon { 655 width: 20px; 656 height: 20px; 657 } 658 659 /* -- Hover --------------------------------------------------- */ 660 @media (hover: hover) { 661 button[data-type='accent']:hover:enabled { 662 background-color: ${({tokens:e})=>e.core.foregroundAccent010}; 663 } 664 665 button[data-variant='primary'][data-type='neutral']:hover:enabled { 666 background-color: ${({tokens:e})=>e.theme.foregroundSecondary}; 667 } 668 669 button[data-variant='secondary'][data-type='neutral']:hover:enabled { 670 background-color: ${({tokens:e})=>e.theme.foregroundSecondary}; 671 } 672 673 button[data-type='success']:hover:enabled { 674 background-color: ${({tokens:e})=>e.core.backgroundSuccess}; 675 } 676 677 button[data-type='error']:hover:enabled { 678 background-color: ${({tokens:e})=>e.core.backgroundError}; 679 } 680 } 681 682 /* -- Focus --------------------------------------------------- */ 683 button:focus-visible { 684 box-shadow: 0 0 0 4px ${({tokens:e})=>e.core.foregroundAccent020}; 685 } 686 687 /* -- Properties --------------------------------------------------- */ 688 button[data-full-width='true'] { 689 width: 100%; 690 } 691 692 :host([fullWidth]) { 693 width: 100%; 694 } 695 696 button[disabled] { 697 opacity: 0.5; 698 cursor: not-allowed; 699 } 700`;var l=function(e,t,r,n){var o,s=arguments.length,i=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(t,r,i):o(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i};let u=class extends n.WF{constructor(){super(...arguments),this.icon="card",this.variant="primary",this.type="accent",this.size="md",this.iconSize=void 0,this.fullWidth=!1,this.disabled=!1}render(){return n.qy`<button 701 data-variant=${this.variant} 702 data-type=${this.type} 703 data-size=${this.size} 704 data-full-width=${this.fullWidth} 705 ?disabled=${this.disabled} 706 > 707 <wui-icon color="inherit" name=${this.icon} size=${(0,s.J)(this.iconSize)}></wui-icon> 708 </button>`}}
708;u.styles=[i.W5,i.fD,c],l([(0,o.MZ)()],u.prototype,"icon",void 0),l([(0,o.MZ)()],u.prototype,"variant",void 0),l([(0,o.MZ)()],u.prototype,"type",void 0),l([(0,o.MZ)()],u.prototype,"size",void 0),l([(0,o.MZ)()],u.prototype,"iconSize",void 0),l([(0,o.MZ)({type:Boolean})],u.prototype,"fullWidth",void 0),l([(0,o.MZ)({type:Boolean})],u.prototype,"disabled",void 0),u=l([(0,a.E)("wui-icon-button")],u)},"./node_modules/@reown/appkit-universal-connector/node_modules/@walletconnect/universal-provider/dist/index.js"(e,t,r){"use strict";r.d(t,{l:()=>Ew,A:()=>Pw});var n=r("./node_modules/events/events.js"),o=r.n(n),s=r("./node_modules/@walletconnect/time/dist/cjs/index.js");class i{}class a extends i{constructor(e){super()}}const c=s.FIVE_SECONDS,l="heartbeat_pulse";class u extends a{constructor(e){super(e),this.events=new n.EventEmitter,this.interval=c,this.interval=e?.interval||c}static async init(e){const t=new u(e);return await t.init(),t}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async initialize(){this.intervalRef=setInterval((()=>this.pulse()),(0,s.toMiliseconds)(this.interval))}pulse(){this.events.emit(l)}}var d=r("./node_modules/unstorage/dist/index.mjs"),h=r("./node_modules/idb-keyval/dist/index.js");function p(e){if("string"!=typeof e)throw new Error("Cannot safe json parse value of type "+typeof e);try{return(e=>{const t=e.replace(/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,'$1"$2n"$3');return JSON.parse(t,((e,t)=>"string"==typeof t&&t.match(/^\d+n$/)?BigInt(t.substring(0,t.length-1)):t))})(e)}catch(t){return e}}function f(e){return"string"==typeof e?e:(t=e,JSON.stringify(t,((e,t)=>"bigint"==typeof t?t.toString()+"n":t))||"");var t}var g=(e={})=>{const t=e.base&&e.base.length>0?`${e.base}:`:"",r=e=>t+e;let n;return e.dbName&&e.storeName&&(n=(0,h.y$)(e.dbName,e.storeName)),{name:"idb-keyval",options:e,hasItem:async e=>!(typeof await(0,h.Jt)(r(e),n)>"u"),getItem:async e=>await(0,h.Jt)(r(e),n)??null,setItem:(e,t)=>(0,h.hZ)(r(e),t,n),removeItem:e=>(0,h.yH)(r(e),n),getKeys:()=>(0,h.HP)(n),clear:()=>(0,h.IU)(n)}};class m{constructor(){this.indexedDb=(0,d.wE)({driver:g({dbName:"WALLET_CONNECT_V2_INDEXED_DB",storeName:"keyvaluestorage"})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map((e=>[e.key,e.value]))}async getItem(e){const t=await this.indexedDb.getItem(e);if(null!==t)return t}async setItem(e,t){await this.indexedDb.setItem(e,f(t))}async removeItem(e){await this.indexedDb.removeItem(e)}}var y=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof r.g<"u"?r.g:typeof self<"u"?self:{},b={exports:{}};function w(e){var t;return[e[0],p(null!=(t=e[1])?t:"")]}!function(){let e;function t(){}e=t,e.prototype.getItem=function(e){return this.hasOwnProperty(e)?String(this[e]):null},e.prototype.setItem=function(e,t){this[e]=String(t)},e.prototype.removeItem=function(e){delete this[e]},e.prototype.clear=function(){const e=this;Object.keys(e).forEach((function(t){e[t]=void 0,delete e[t]}))},e.prototype.key=function(e){return e=e||0,Object.keys(this)[e]},e.prototype.__defineGetter__("length",(function(){return Object.keys(this).length})),typeof y<"u"&&y.localStorage?b.exports=y.localStorage:typeof window<"u"&&window.localStorage?b.exports=window.localStorage:b.exports=new t}();class v{constructor(){this.localStorage=b.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(w)}async getItem(e){const t=this.localStorage.getItem(e);if(null!==t)return p(t)}async setItem(e,t){this.localStorage.setItem(e,f(t))}async removeItem(e){this.localStorage.removeItem(e)}}const A=async(e,t)=>{t.length&&t.forEach((async t=>{await e.removeItem(t)}))};class T{constructor(){this.initialized=!1,this.setInitialized=e=>{this.storage=e,this.initialized=!0};const e=new v;this.storage=e;try{(async(e,t,r)=>{const n="wc_storage_version",o=await t.getItem(n);if(o&&o>=1)return void r(t);const s=await e.getKeys();if(!s.length)return void r(t);const i=[];for(;s.length;){const r=s.shift();if(!r)continue;const n=r.toLowerCase();if(n.includes("wc@")||n.includes("walletconnect")||n.includes("wc_")||n.includes("wallet_connect")){const n=await e.getItem(r);await t.setItem(r,n),i.push(r)}}await t.setItem(n,1),r(t),A(e,i)})(e,new m,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,t){return await this.initialize(),this.storage.setItem(e,t)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise((e=>{const t=setInterval((()=>{this.initialized&&(clearInterval(t),e())}),20)}))}}var P=r("./node_modules/@reown/appkit-universal-connector/node_modules/@walletconnect/logger/dist/index.es.js"),E=Object.defineProperty,C=(e,t,r)=>((e,t,r)=>t in e?E(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class k extends i{constructor(e){super(),this.opts=e,C(this,"protocol","wc"),C(this,"version",2)}}var _=Object.defineProperty,I=(e,t,r)=>((e,t,r)=>t in e?_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class S extends i{constructor(e,t){super(),this.core=e,this.logger=t,I(this,"records",new Map)}}class x{constructor(e,t){this.logger=e,this.core=t}}class B extends i{constructor(e,t){super(),this.relayer=e,this.logger=t}}class O extends i{constructor(e){super()}}class M{constructor(e,t,r,n){this.core=e,this.logger=t,this.name=r}}Object.defineProperty;class W extends i{constructor(e,t){super(),this.relayer=e,this.logger=t}}class j extends i{constructor(e,t){super(),this.core=e,this.logger=t}}class R{constructor(e,t,r){this.core=e,this.logger=t,this.store=r}}class N{constructor(e,t){this.projectId=e,this.logger=t}}class U{constructor(e,t,r){this.core=e,this.logger=t,this.telemetryEnabled=r}}var D=Object.defineProperty,L=(e,t,r)=>((e,t,r)=>t in e?D(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);o();class F{constructor(e){this.opts=e,L(this,"protocol","wc"),L(this,"version",2)}}n.EventEmitter;class z{constructor(e){this.client=e}}function V(e,...t){if(!function(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function q(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}const H="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,K=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);function $(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),V(e),e}class G{clone(){return this._cloneInto()}}function Y(e=32){if(H&&"function"==typeof H.getRandomValues)return H.getRandomValues(new Uint8Array(e));if(H&&"function"==typeof H.randomBytes)return H.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}class J extends G{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=K(this.buffer)}update(e){q(this);const{view:t,buffer:r,blockLen:n}=this,o=(e=$(e)).length;for(let s=0;s<o;){const i=Math.min(n-this.pos,o-s);if(i!==n)r.set(e.subarray(s,s+i),this.pos),this.pos+=i,s+=i,this.pos===n&&(this.process(t,0),this.pos=0);else{const t=K(e);for(;n<=o-s;s+=n)this.process(t,s)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){q(this),function(e,t){V(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:n,isLE:o}=this;let{pos:s}=this;t[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>n-s&&(this.process(r,0),s=0);for(let e=s;e<n;e++)t[e]=0;(function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const o=BigInt(32),s=BigInt(4294967295),i=Number(r>>o&s),a=Number(r&s),c=n?4:0,l=n?0:4;e.setUint32(t+c,i,n),e.setUint32(t+l,a,n)})(r,n-8,BigInt(8*this.length),o),this.process(r,0);const i=K(e),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=a/4,l=this.get();if(c>l.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)i.setUint32(4*e,l[e],o)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:o,destroyed:s,pos:i}=this;return e.length=n,e.pos=i,e.finished=o,e.destroyed=s,n%t&&e.buffer.set(r),e}}const Q=BigInt(2**32-1),Z=BigInt(32);function X(e,t=!1){return t?{h:Number(e&Q),l:Number(e>>Z&Q)}:{h:0|Number(e>>Z&Q),l:0|Number(e&Q)}}const ee={fromBig:X,split:function(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let o=0;o<e.length;o++){const{h:s,l:i}=X(e[o],t);[r[o],n[o]]=[s,i]}return[r,n]},toBig:(e,t)=>
708BigInt(e>>>0)<<Z|BigInt(t>>>0),shrSH:(e,t,r)=>e>>>r,shrSL:(e,t,r)=>e<<32-r|t>>>r,rotrSH:(e,t,r)=>e>>>r|t<<32-r,rotrSL:(e,t,r)=>e<<32-r|t>>>r,rotrBH:(e,t,r)=>e<<64-r|t>>>r-32,rotrBL:(e,t,r)=>e>>>r-32|t<<64-r,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:(e,t,r)=>e<<r|t>>>32-r,rotlSL:(e,t,r)=>t<<r|e>>>32-r,rotlBH:(e,t,r)=>t<<r-32|e>>>64-r,rotlBL:(e,t,r)=>e<<r-32|t>>>64-r,add:function(e,t,r,n){const o=(t>>>0)+(n>>>0);return{h:e+r+(o/2**32|0)|0,l:0|o}},add3L:(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),add3H:(e,t,r,n)=>t+r+n+(e/2**32|0)|0,add4L:(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),add4H:(e,t,r,n,o)=>t+r+n+o+(e/2**32|0)|0,add5H:(e,t,r,n,o,s)=>t+r+n+o+s+(e/2**32|0)|0,add5L:(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0)},[te,re]=ee.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","0xf40e3585
7085771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((e=>BigInt(e)))),ne=new Uint32Array(80),oe=new Uint32Array(80);class se extends J{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:o,Cl:s,Dh:i,Dl:a,Eh:c,El:l,Fh:u,Fl:d,Gh:h,Gl:p,Hh:f,Hl:g}=this;return[e,t,r,n,o,s,i,a,c,l,u,d,h,p,f,g]}set(e,t,r,n,o,s,i,a,c,l,u,d,h,p,f,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|o,this.Cl=0|s,this.Dh=0|i,this.Dl=0|a,this.Eh=0|c,this.El=0|l,this.Fh=0|u,this.Fl=0|d,this.Gh=0|h,this.Gl=0|p,this.Hh=0|f,this.Hl=0|g}process(e,t){for(let r=0;r<16;r++,t+=4)ne[r]=e.getUint32(t),oe[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|ne[e-15],r=0|oe[e-15],n=ee.rotrSH(t,r,1)^ee.rotrSH(t,r,8)^ee.shrSH(t,r,7),o=ee.rotrSL(t,r,1)^ee.rotrSL(t,r,8)^ee.shrSL(t,r,7),s=0|ne[e-2],i=0|oe[e-2],a=ee.rotrSH(s,i,19)^ee.rotrBH(s,i,61)^ee.shrSH(s,i,6),c=ee.rotrSL(s,i,19)^ee.rotrBL(s,i,61)^ee.shrSL(s,i,6),l=ee.add4L(o,c,oe[e-7],oe[e-16]),u=ee.add4H(l,n,a,ne[e-7],ne[e-16]);ne[e]=0|u,oe[e]=0|l}let{Ah:r,Al:n,Bh:o,Bl:s,Ch:i,Cl:a,Dh:c,Dl:l,Eh:u,El:d,Fh:h,Fl:p,Gh:f,Gl:g,Hh:m,Hl:y}=this;for(let e=0;e<80;e++){const t=ee.rotrSH(u,d,14)^ee.rotrSH(u,d,18)^ee.rotrBH(u,d,41),b=ee.rotrSL(u,d,14)^ee.rotrSL(u,d,18)^ee.rotrBL(u,d,41),w=u&h^~u&f,v=d&p^~d&g,A=ee.add5L(y,b,v,re[e],oe[e]),T=ee.add5H(A,m,t,w,te[e],ne[e]),P=0|A,E=ee.rotrSH(r,n,28)^ee.rotrBH(r,n,34)^ee.rotrBH(r,n,39),C=ee.rotrSL(r,n,28)^ee.rotrBL(r,n,34)^ee.rotrBL(r,n,39),k=r&o^r&i^o&i,_=n&s^n&a^s&a;m=0|f,y=0|g,f=0|h,g=0|p,h=0|u,p=0|d,({h:u,l:d}=ee.add(0|c,0|l,0|T,0|P)),c=0|i,l=0|a,i=0|o,a=0|s,o=0|r,s=0|n;const I=ee.add3L(P,C,_);r=ee.add3H(I,T,E,k),n=0|I}({h:r,l:n}=ee.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:o,l:s}=ee.add(0|this.Bh,0|this.Bl,0|o,0|s)),({h:i,l:a}=ee.add(0|this.Ch,0|this.Cl,0|i,0|a)),({h:c,l}=ee.add(0|this.Dh,0|this.Dl,0|c,0|l)),({h:u,l:d}=ee.add(0|this.Eh,0|this.El,0|u,0|d)),({h,l:p}=ee.add(0|this.Fh,0|this.Fl,0|h,0|p)),({h:f,l:g}=ee.add(0|this.Gh,0|this.Gl,0|f,0|g)),({h:m,l:y}=ee.add(0|this.Hh,0|this.Hl,0|m,0|y)),this.set(r,n,o,s,i,a,c,l,u,d,h,p,f,g,m,y)}roundClean(){ne.fill(0),oe.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)}}const ie=function(e){const t=t=>e().update($(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}((()=>new se)),ae=BigInt(0),ce=BigInt(1),le=BigInt(2);function ue(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function de(e){if(!ue(e))throw new Error("Uint8Array expected")}function he(e,t){if("boolean"!=typeof t)throw new Error(e+" boolean expected, got "+t)}const pe=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function fe(e){de(e);let t="";for(let r=0;r<e.length;r++)t+=pe[e[r]];return t}function ge(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return""===e?ae:BigInt("0x"+e)}const me=48,ye=57,be=65,we=70,ve=97,Ae=102;function Te(e){return e>=me&&e<=ye?e-me:e>=be&&e<=we?e-(be-10):e>=ve&&e<=Ae?e-(ve-10):void 0}function Pe(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,o=0;t<r;t++,o+=2){const r=Te(e.charCodeAt(o)),s=Te(e.charCodeAt(o+1));if(void 0===r||void 0===s){const t=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+o)}n[t]=16*r+s}return n}function Ee(e){return de(e),ge(fe(Uint8Array.from(e).reverse()))}function Ce(e,t){return Pe(e.toString(16).padStart(2*t,"0"))}function ke(e,t){return Ce(e,t).reverse()}function _e(e,t,r){let n;if("string"==typeof t)try{n=Pe(t)}catch(t){throw new Error(e+" must be hex string or Uint8Array, cause: "+t)}else{if(!ue(t))throw new Error(e+" must be hex string or Uint8Array");n=Uint8Array.from(t)}const o=n.length;if("number"==typeof r&&o!==r)throw new Error(e+" of length "+r+" expected, got "+o);return n}function Ie(...e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];de(n),t+=n.length}
708const r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const o=e[t];r.set(o,n),n+=o.length}return r}const Se=e=>"bigint"==typeof e&&ae<=e;function xe(e,t,r,n){if(!function(e,t,r){return Se(e)&&Se(t)&&Se(r)&&t<=e&&e<r}(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}const Be=e=>(le<<BigInt(e-1))-ce,Oe={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||ue(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function Me(e,t,r={}){const n=(t,r,n)=>{const o=Oe[r];if("function"!=typeof o)throw new Error("invalid validator function");const s=e[t];if(!(n&&void 0===s||o(s,e)))throw new Error("param "+String(t)+" is invalid. Expected "+r+", got "+s)};for(const[e,r]of Object.entries(t))n(e,r,!1);for(const[e,t]of Object.entries(r))n(e,t,!0);return e}function We(e){const t=new WeakMap;return(r,...n)=>{const o=t.get(r);if(void 0!==o)return o;const s=e(r,...n);return t.set(r,s),s}}const je=BigInt(0),Re=BigInt(1),Ne=BigInt(2),Ue=BigInt(3),De=BigInt(4),Le=BigInt(5),Fe=BigInt(8);function ze(e,t){const r=e%t;return r>=je?r:t+r}function Ve(e,t,r){if(t<je)throw new Error("invalid exponent, negatives unsupported");if(r<=je)throw new Error("invalid modulus");if(r===Re)return je;let n=Re;for(;t>je;)t&Re&&(n=n*e%r),e=e*e%r,t>>=Re;return n}function qe(e,t,r){let n=e;for(;t-- >je;)n*=n,n%=r;return n}function He(e,t){if(e===je)throw new Error("invert: expected non-zero number");if(t<=je)throw new Error("invert: expected positive modulus, got "+t);let r=ze(e,t),n=t,o=je,s=Re;for(;r!==je;){const e=n%r,t=o-s*(n/r);n=r,r=e,o=s,s=t}if(n!==Re)throw new Error("invert: does not exist");return ze(o,t)}function Ke(e){if(e%De===Ue){const t=(e+Re)/De;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}if(e%Fe===Le){const t=(e-Le)/Fe;return function(e,r){const n=e.mul(r,Ne),o=e.pow(n,t),s=e.mul(r,o),i=e.mul(e.mul(s,Ne),o),a=e.mul(s,e.sub(i,e.ONE));if(!e.eql(e.sqr(a),r))throw new Error("Cannot find square root");return a}}return function(e){const t=(e-Re)/Ne;let r,n,o;for(r=e-Re,n=0;r%Ne===je;r/=Ne,n++);for(o=Ne;o<e&&Ve(o,t,e)!==e-Re;o++)if(o>1e3)throw new Error("Cannot find square root: likely non-prime P");if(1===n){const t=(e+Re)/De;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}const s=(r+Re)/Ne;return function(e,i){if(e.pow(i,t)===e.neg(e.ONE))throw new Error("Cannot find square root");let a=n,c=e.pow(e.mul(e.ONE,o),r),l=e.pow(i,s),u=e.pow(i,r);for(;!e.eql(u,e.ONE);){if(e.eql(u,e.ZERO))return e.ZERO;let t=1;for(let r=e.sqr(u);t<a&&!e.eql(r,e.ONE);t++)r=e.sqr(r);const r=e.pow(c,Re<<BigInt(a-t-1));c=e.sqr(r),l=e.mul(l,r),u=e.mul(u,c),a=t}return l}}(e)}const $e=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Ge(e,t){const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function Ye(e,t,r=!1,n={}){if(e<=je)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:o,nByteLength:s}=Ge(e,t);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let i;const a=Object.freeze({ORDER:e,isLE:r,BITS:o,BYTES:s,MASK:Be(o),ZERO:je,ONE:Re,create:t=>ze(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("invalid field element: expected bigint, got "+typeof t);return je<=t&&t<e},is0:e=>e===je,isOdd:e=>(e&Re)===Re,neg:t=>ze(-t,e),eql:(e,t)=>e===t,sqr:t=>ze(t*t,e),add:(t,r)=>ze(t+r,e),sub:(t,r)=>ze(t-r,e),mul:(t,r)=>ze(t*r,e),pow:(e,t)=>function(e,t,r){if(r<je)throw new Error("invalid exponent, negatives unsupported");if(r===je)return e.ONE;if(r===Re)return t;let n=e.ONE,o=t;for(;r>je;)r&Re&&(n=e.mul(n,o)),o=e.sqr(o),r>>=Re;return n}(a,e,t),div:(t,r)=>ze(t*He(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>He(t,e),sqrt:n.sqrt||(t=>(i||(i=Ke(e)),i(a,t))),invertBatch:e=>function(e,t){const r=new Array(t.length),n=t.reduce(((t,n,o)=>e.is0(n)?t:(r[o]=t,e.mul(t,n))),e.ONE),o=e.inv(n);return t.reduceRight(((t,n,o)=>e.is0(n)?t:(r[o]=e.mul(t,r[o]),e.mul(t,n))),o),r}(a,e),cmov:(e,t,r)=>r?t:e,toBytes:e=>r?ke(e,s):Ce(e,s),fromBytes:e=>{if(e.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+e.length);return r?Ee(e):function(e){return ge(fe(e))}(e)}});return Object.freeze(a)}const Je=BigInt(0),Qe=BigInt(1);function Ze(e,t){const r=t.negate();return e?r:t}function Xe(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function et(e,t){Xe(e,t);return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1)}}const tt=new WeakMap,rt=new WeakMap;function nt(e){return rt.get(e)||1}function ot(e,t,r,n){if(function(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach(((e,r)=>{if(!(e instanceof t))throw new Error("invalid point at index "+r)}))}(r,e),function(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach(((e,r)=>{if(!t.isValid(e))throw new Error("invalid scalar at index "+r)}))}(n,t),r.length!==n.length)throw new Error("arrays of points and scalars must have equal length");const o=e.ZERO,s=function(e){let t;for(t=0;e>ae;e>>=ce,t+=1);return t}(BigInt(r.length)),i=s>12?s-3:s>4?s-2:s?2:1,a=(1<<i)-1,c=new Array(a+1).fill(o);let l=o;for(let e=Math.floor((t.BITS-1)/i)*i;e>=0;e-=i){c.fill(o);for(let t=0;t<n.length;t++){const o=n[t],s=Number(o>>BigInt(e)&BigInt(a));c[s]=c[s].add(r[t])}let t=o;for(let e=c.length-1,r=o;e>0;e--)r=r.add(c[e]),t=t.add(r);if(l=l.add(t),0!==e)for(let e=0;e<i;e++)l=l.double()}return l}function st(e){return function(e){const t=$e.reduce(((e,t)=>(e[t]="function",e)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});Me(e,t)}(e.Fp),Me(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Ge(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}const it=BigInt(0),at=BigInt(1),ct=BigInt(2),lt=BigInt(8),ut={zip215:!0};function dt(e){const t=function(e){const t=st(e);return Me(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}(e),{Fp:r,n,prehash:o,hash:s,randomBytes:i,nByteLength:a,h:c}=t,l=ct<<BigInt(8*a)-at,u=r.create,d=Ye(t.n,t.nBitLength),h=t.uvRatio||((e,t)=>{try{return{isValid:!0,value:r.sqrt(e*r.inv(t))}}catch{return{isValid:!1,value:it}}}),p=t.adjustScalarBytes||(e=>e),f=t.domain||((e,t,r)=>{if(he("phflag",r),t.length||r)throw new Error("Contexts/pre-hash are not supported");return e});function g(e,t){xe("coordinate "+e,t,it,l)}function m(e){if(!(e instanceof w))throw new Error("ExtendedPoint expected")}const y=We(((e,t)=>{const{ex:n,ey:o,ez:s}=e,i=e.is0();null==t&&(t=i?lt:r.inv(s));const a=u(n*t),c=u(o*t),l=u(s*t);if(i)return{x:it,y:at};
708if(l!==at)throw new Error("invZ was invalid");return{x:a,y:c}})),b=We((e=>{const{a:r,d:n}=t;if(e.is0())throw new Error("bad point: ZERO");const{ex:o,ey:s,ez:i,et:a}=e,c=u(o*o),l=u(s*s),d=u(i*i),h=u(d*d),p=u(c*r);if(u(d*u(p+l))!==u(h+u(n*u(c*l))))throw new Error("bad point: equation left != right (1)");if(u(o*s)!==u(i*a))throw new Error("bad point: equation left != right (2)");return!0}));class w{constructor(e,t,r,n){this.ex=e,this.ey=t,this.ez=r,this.et=n,g("x",e),g("y",t),g("z",r),g("t",n),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(e){if(e instanceof w)throw new Error("extended point not allowed");const{x:t,y:r}=e||{};return g("x",t),g("y",r),new w(t,r,at,u(t*r))}static normalizeZ(e){const t=r.invertBatch(e.map((e=>e.ez)));return e.map(((e,r)=>e.toAffine(t[r]))).map(w.fromAffine)}static msm(e,t){return ot(w,d,e,t)}_setWindowSize(e){T.setWindowSize(this,e)}assertValidity(){b(this)}equals(e){m(e);const{ex:t,ey:r,ez:n}=this,{ex:o,ey:s,ez:i}=e,a=u(t*i),c=u(o*n),l=u(r*i),d=u(s*n);return a===c&&l===d}is0(){return this.equals(w.ZERO)}negate(){return new w(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){const{a:e}=t,{ex:r,ey:n,ez:o}=this,s=u(r*r),i=u(n*n),a=u(ct*u(o*o)),c=u(e*s),l=r+n,d=u(u(l*l)-s-i),h=c+i,p=h-a,f=c-i,g=u(d*p),m=u(h*f),y=u(d*f),b=u(p*h);return new w(g,m,b,y)}add(e){m(e);const{a:r,d:n}=t,{ex:o,ey:s,ez:i,et:a}=this,{ex:c,ey:l,ez:d,et:h}=e;if(r===BigInt(-1)){const e=u((s-o)*(l+c)),t=u((s+o)*(l-c)),r=u(t-e);if(r===it)return this.double();const n=u(i*ct*h),p=u(a*ct*d),f=p+n,g=t+e,m=p-n,y=u(f*r),b=u(g*m),v=u(f*m),A=u(r*g);return new w(y,b,A,v)}const p=u(o*c),f=u(s*l),g=u(a*n*h),y=u(i*d),b=u((o+s)*(c+l)-p-f),v=y-g,A=y+g,T=u(f-r*p),P=u(b*v),E=u(A*T),C=u(b*T),k=u(v*A);return new w(P,E,k,C)}subtract(e){return this.add(e.negate())}wNAF(e){return T.wNAFCached(this,e,w.normalizeZ)}multiply(e){const t=e;xe("scalar",t,at,n);const{p:r,f:o}=this.wNAF(t);return w.normalizeZ([r,o])[0]}multiplyUnsafe(e,t=w.ZERO){const r=e;return xe("scalar",r,it,n),r===it?A:this.is0()||r===at?this:T.wNAFCachedUnsafe(this,r,w.normalizeZ,t)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return T.unsafeLadder(this,n).is0()}toAffine(e){return y(this,e)}clearCofactor(){const{h:e}=t;return e===at?this:this.multiplyUnsafe(e)}static fromHex(e,n=!1){const{d:o,a:s}=t,i=r.BYTES;e=_e("pointHex",e,i),he("zip215",n);const a=e.slice(),c=e[i-1];a[i-1]=-129&c;const d=Ee(a),p=n?l:r.ORDER;xe("pointHex.y",d,it,p);const f=u(d*d),g=u(f-at),m=u(o*f-s);let{isValid:y,value:b}=h(g,m);if(!y)throw new Error("Point.fromHex: invalid y coordinate");const v=(b&at)===at,A=!!(128&c);if(!n&&b===it&&A)throw new Error("Point.fromHex: x=0 and x_0=1");return A!==v&&(b=u(-b)),w.fromAffine({x:b,y:d})}static fromPrivateKey(e){return C(e).point}toRawBytes(){const{x:e,y:t}=this.toAffine(),n=ke(t,r.BYTES);return n[n.length-1]|=e&at?128:0,n}toHex(){return fe(this.toRawBytes())}}w.BASE=new w(t.Gx,t.Gy,at,u(t.Gx*t.Gy)),w.ZERO=new w(it,at,at,it);const{BASE:v,ZERO:A}=w,T=function(e,t){return{constTimeNegate:Ze,hasPrecomputes:e=>1!==nt(e),unsafeLadder(t,r,n=e.ZERO){let o=t;for(;r>Je;)r&Qe&&(n=n.add(o)),o=o.double(),r>>=Qe;return n},precomputeWindow(e,r){const{windows:n,windowSize:o}=et(r,t),s=[];let i=e,a=i;for(let e=0;e<n;e++){a=i,s.push(a);for(let e=1;e<o;e++)a=a.add(i),s.push(a);i=a.double()}return s},wNAF(r,n,o){const{windows:s,windowSize:i}=et(r,t);let a=e.ZERO,c=e.BASE;const l=BigInt(2**r-1),u=2**r,d=BigInt(r);for(let e=0;e<s;e++){const t=e*i;let r=Number(o&l);o>>=d,r>i&&(r-=u,o+=Qe);const s=t,h=t+Math.abs(r)-1,p=e%2!=0,f=r<0;0===r?c=c.add(Ze(p,n[s])):a=a.add(Ze(f,n[h]))}return{p:a,f:c}},wNAFUnsafe(r,n,o,s=e.ZERO){const{windows:i,windowSize:a}=et(r,t),c=BigInt(2**r-1),l=2**r,u=BigInt(r);for(let e=0;e<i;e++){const t=e*a;if(o===Je)break;let r=Number(o&c);if(o>>=u,r>a&&(r-=l,o+=Qe),0===r)continue;let i=n[t+Math.abs(r)-1];r<0&&(i=i.negate()),s=s.add(i)}return s},getPrecomputes(e,t,r){let n=tt.get(t);return n||(n=this.precomputeWindow(t,e),1!==e&&tt.set(t,r(n))),n},wNAFCached(e,t,r){const n=nt(e);
708return this.wNAF(n,this.getPrecomputes(n,e,r),t)},wNAFCachedUnsafe(e,t,r,n){const o=nt(e);return 1===o?this.unsafeLadder(e,t,n):this.wNAFUnsafe(o,this.getPrecomputes(o,e,r),t,n)},setWindowSize(e,r){Xe(r,t),rt.set(e,r),tt.delete(e)}}}(w,8*a);function P(e){return ze(e,n)}function E(e){return P(Ee(e))}function C(e){const t=r.BYTES;e=_e("private key",e,t);const n=_e("hashed private key",s(e),2*t),o=p(n.slice(0,t)),i=n.slice(t,2*t),a=E(o),c=v.multiply(a),l=c.toRawBytes();return{head:o,prefix:i,scalar:a,point:c,pointBytes:l}}function k(e=new Uint8Array,...t){const r=Ie(...t);return E(s(f(r,_e("context",e),!!o)))}const _=ut;return v._setWindowSize(8),{CURVE:t,getPublicKey:function(e){return C(e).pointBytes},sign:function(e,t,s={}){e=_e("message",e),o&&(e=o(e));const{prefix:i,scalar:a,pointBytes:c}=C(t),l=k(s.context,i,e),u=v.multiply(l).toRawBytes(),d=P(l+k(s.context,u,c,e)*a);return xe("signature.s",d,it,n),_e("result",Ie(u,ke(d,r.BYTES)),2*r.BYTES)},verify:function(e,t,n,s=_){const{context:i,zip215:a}=s,c=r.BYTES;e=_e("signature",e,2*c),t=_e("message",t),n=_e("publicKey",n,c),void 0!==a&&he("zip215",a),o&&(t=o(t));const l=Ee(e.slice(c,2*c));let u,d,h;try{u=w.fromHex(n,a),d=w.fromHex(e.slice(0,c),a),h=v.multiplyUnsafe(l)}catch{return!1}if(!a&&u.isSmallOrder())return!1;const p=k(i,d.toRawBytes(),u.toRawBytes(),t);return d.add(u.multiplyUnsafe(p)).subtract(h).clearCofactor().equals(w.ZERO)},ExtendedPoint:w,utils:{getExtendedPublicKey:C,randomPrivateKey:()=>i(r.BYTES),precompute:(e=8,t=w.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)}}}BigInt(0),BigInt(1);const ht=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),pt=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);
708const ft=BigInt(1),gt=BigInt(2);BigInt(3);const mt=BigInt(5),yt=BigInt(8);function bt(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function wt(e,t){const r=ht,n=ze(t*t*t,r),o=function(e){const t=BigInt(10),r=BigInt(20),n=BigInt(40),o=BigInt(80),s=ht,i=e*e%s*e%s,a=qe(i,gt,s)*i%s,c=qe(a,ft,s)*e%s,l=qe(c,mt,s)*c%s,u=qe(l,t,s)*l%s,d=qe(u,r,s)*u%s,h=qe(d,n,s)*d%s,p=qe(h,o,s)*h%s,f=qe(p,o,s)*h%s,g=qe(f,t,s)*l%s;return{pow_p_5_8:qe(g,gt,s)*e%s,b2:i}}(e*ze(n*n*t,r)).pow_p_5_8;let s=ze(e*n*o,r);const i=ze(t*s*s,r),a=s,c=ze(s*pt,r),l=i===e,u=i===ze(-e,r),d=i===ze(-e*pt,r);return l&&(s=a),(u||d)&&(s=c),((e,t)=>(ze(e,t)&Re)===Re)(s,r)&&(s=ze(-s,r)),{isValid:l||u,value:s}}const vt=Ye(ht,void 0,!0),At=dt({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:vt,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:yt,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:ie,randomBytes:Y,adjustScalarBytes:bt,uvRatio:wt}),Tt="EdDSA",Pt=".",Et="base64url",Ct="utf8",kt="utf8",_t="did",It="key",St="base58btc";function xt(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function Bt(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?xt(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function Ot(e,t){t||(t=e.reduce(((e,t)=>e+t.length),0));const r=Bt(t);let n=0;for(const t of e)r.set(t,n),n+=t.length;return xt(r)}var Mt=function(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var o=0;o<e.length;o++){var s=e.charAt(o),i=s.charCodeAt(0);if(255!==r[i])throw new TypeError(s+" is ambiguous");r[i]=o}var a=e.length,c=e.charAt(0),l=Math.log(a)/Math.log(256),u=Math.log(256)/Math.log(a);function d(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[t]){for(var n=0,o=0;e[t]===c;)n++,t++;for(var s=(e.length-t)*l+1>>>0,i=new Uint8Array(s);e[t];){var u=r[e.charCodeAt(t)];if(255===u)return;for(var d=0,h=s-1;(0!==u||d<o)&&-1!==h;h--,d++)u+=a*i[h]>>>0,i[h]=u%256>>>0,u=u/256>>>0;if(0!==u)throw new Error("Non-zero carry");o=d,t++}if(" "!==e[t]){for(var p=s-o;p!==s&&0===i[p];)p++;for(var f=new Uint8Array(n+(s-p)),g=n;p!==s;)f[g++]=i[p++];return f}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,o=0,s=t.length;o!==s&&0===t[o];)o++,r++;for(var i=(s-o)*u+1>>>0,l=new Uint8Array(i);o!==s;){for(var d=t[o],h=0,p=i-1;(0!==d||h<n)&&-1!==p;p--,h++)d+=256*l[p]>>>0,l[p]=d%a>>>0,d=d/a>>>0;if(0!==d)throw new Error("Non-zero carry");n=h,o++}for(var f=i-n;f!==i&&0===l[f];)f++;for(var g=c.repeat(r);f<i;++f)g+=e.charAt(l[f]);return g},decodeUnsafe:d,decode:function(e){var r=d(e);if(r)return r;throw new Error(`Non-${t} character`)}}},Wt=Mt;const jt=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")};class Rt{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class Nt{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return Dt(this,e)}}class Ut{constructor(e){this.decoders=e}or(e){return Dt(this,e)}decode(e){const t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}
708, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Dt=(e,t)=>new Ut({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class Lt{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new Rt(e,t,r),this.decoder=new Nt(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Ft=({name:e,prefix:t,encode:r,decode:n})=>new Lt(e,t,r,n),zt=({prefix:e,name:t,alphabet:r})=>{const{encode:n,decode:o}=Wt(r,t);return Ft({prefix:e,name:t,encode:n,decode:e=>jt(o(e))})},Vt=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>Ft({prefix:t,name:e,encode:e=>((e,t,r)=>{const n="="===t[t.length-1],o=(1<<r)-1;let s="",i=0,a=0;for(let n=0;n<e.length;++n)for(a=a<<8|e[n],i+=8;i>r;)i-=r,s+=t[o&a>>i];if(i&&(s+=t[o&a<<r-i]),n)for(;s.length*r&7;)s+="=";return s})(e,n,r),decode:t=>((e,t,r,n)=>{const o={};for(let e=0;e<t.length;++e)o[t[e]]=e;let s=e.length;for(;"="===e[s-1];)--s;const i=new Uint8Array(s*r/8|0);let a=0,c=0,l=0;for(let t=0;t<s;++t){const s=o[e[t]];if(void 0===s)throw new SyntaxError(`Non-${n} character`);c=c<<r|s,a+=r,a>=8&&(a-=8,i[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return i})(t,n,r,e)}),qt=Ft({prefix:"\0",name:"identity",encode:e=>(e=>(new TextDecoder).decode(e))(e),decode:e=>(e=>(new TextEncoder).encode(e))(e)});var Ht=Object.freeze({__proto__:null,identity:qt});const Kt=Vt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var $t=Object.freeze({__proto__:null,base2:Kt});const Gt=Vt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Yt=Object.freeze({__proto__:null,base8:Gt});const Jt=zt({prefix:"9",name:"base10",alphabet:"0123456789"});var Qt=Object.freeze({__proto__:null,base10:Jt});const Zt=Vt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Xt=Vt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var er=Object.freeze({__proto__:null,base16:Zt,base16upper:Xt});const tr=Vt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),rr=Vt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),nr=Vt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),or=Vt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),sr=Vt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),ir=Vt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),ar=Vt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),cr=Vt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),lr=Vt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ur=Object.freeze({__proto__:null,base32:tr,base32upper:rr,base32pad:nr,base32padupper:or,base32hex:sr,base32hexupper:ir,base32hexpad:ar,base32hexpadupper:cr,base32z:lr});const dr=zt({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),hr=zt({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var pr=Object.freeze({__proto__:null,base36:dr,base36upper:hr});const fr=zt({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),gr=zt({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var mr=Object.freeze({__proto__:null,base58btc:fr,base58flickr:gr});const yr=Vt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),br=Vt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),wr=Vt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),vr=Vt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Ar=Object.freeze({__proto__:null,base64:yr,base64pad:br,base64url:wr,base64urlpad:vr});const Tr=Array.from("ððªâð°ðððððððððððððâð»ð¥ð¾ð¿ðâ¤ðð¤£ððððððð
ððð¥ð¥°ðððð¢ð¤ðððªðâºðð¤ððððð¹ð¤¦ððââ¨ð¤·ð±ðð¸ððððððððð¤©ððð¤ðð¯ðð
708ð¶ðð¤â£ððððªðð¥ððð©ð¡ð¤ªðð¥³ð¥ð¤¤ððð³âððð´ðð¬ððð·ð»ðââ
ð¥ºððð¤ð¦âð£ððâ¹ððð âððºðð»ððððð¹ð£ð«ðððµð¤ðð´ð¤ð¼ð«â½ð¤âðð¤«ðð®ðð»ðð¶ðð²ð¿ð§¡ðâ¡ððââðð°ð¤¨ð¶ð¤ð¶ð°ðð¢ð¤ðð¨ð¨ð¤¬âððºð¤ððð±ðð¶ð¥´â¶â¡âðð¸â¬ð¨ðð¦ð·ðºâ ð
ððµðð¤²ð¤ ð¤§ððµð
ð§ð¾ððð¤ðð¤¯ð·âð§ð¯ððð¤ððâð´ð£ð¸ððð¥ð¤¢ð
ð¡ð©ðð¸ð»ð¤ð¤®ð¼ð¥µð©ððð¼ðð£ð¥"),Pr=Tr.reduce(((e,t,r)=>(e[r]=t,e)),[]),Er=Tr.reduce(((e,t,r)=>(e[t.codePointAt(0)]=r,e)),[]);const Cr=Ft({prefix:"ð",name:"base256emoji",encode:function(e){return e.reduce(((e,t)=>e+=Pr[t]),"")},decode:function(e){const t=[];for(const r of e){const e=Er[r.codePointAt(0)];if(void 0===e)throw new Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}});var kr=Object.freeze({__proto__:null,base256emoji:Cr}),_r=function e(t,r,n){r=r||[];for(var o=n=n||0;t>=Ir;)r[n++]=255&t|128,t/=128;for(;-128&t;)r[n++]=255&t|128,t>>>=7;return r[n]=0|t,e.bytes=n-o+1,r},Ir=Math.pow(2,31);var Sr=function e(t,r){var n,o=0,s=(r=r||0,0),i=r,a=t.length;do{if(i>=a)throw e.bytes=0,new RangeError("Could not decode varint");n=t[i++],o+=s<28?(127&n)<<s:(127&n)*Math.pow(2,s),s+=7}while(n>=128);return e.bytes=i-r,o};var xr=Math.pow(2,7),Br=Math.pow(2,14),Or=Math.pow(2,21),Mr=Math.pow(2,28),Wr=Math.pow(2,35),jr=Math.pow(2,42),Rr=Math.pow(2,49),Nr=Math.pow(2,56),Ur=Math.pow(2,63),Dr={encode:_r,decode:Sr,encodingLength:function(e){return e<xr?1:e<Br?2:e<Or?3:e<Mr?4:e<Wr?5:e<jr?6:e<Rr?7:e<Nr?8:e<Ur?9:10}},Lr=Dr;const Fr=(e,t,r=0)=>(Lr.encode(e,t,r),t),zr=e=>Lr.encodingLength(e),Vr=(e,t)=>{const r=t.byteLength,n=zr(e),o=n+zr(r),s=new Uint8Array(o+r);return Fr(e,s,0),Fr(r,s,n),s.set(t,o),new qr(e,r,t,s)};class qr{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}}const Hr=({name:e,code:t,encode:r})=>new Kr(e,t,r);class Kr{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?Vr(this.code,t):t.then((e=>Vr(this.code,e)))}throw Error("Unknown type, must be binary type")}}const $r=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),Gr=Hr({name:"sha2-256",code:18,encode:$r("SHA-256")}),Yr=Hr({name:"sha2-512",code:19,encode:$r("SHA-512")});Object.freeze({__proto__:null,sha256:Gr,sha512:Yr});const Jr=jt,Qr={code:0,name:"identity",encode:Jr,digest:e=>Vr(0,Jr(e))};Object.freeze({__proto__:null,identity:Qr});new TextEncoder,new TextDecoder;const Zr={...Ht,...$t,...Yt,...Qt,...er,...ur,...pr,...mr,...Ar,...kr};function Xr(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const en=Xr("utf8","u",(e=>"u"+new TextDecoder("utf8").decode(e)),(e=>(new TextEncoder).encode(e.substring(1)))),tn=Xr("ascii","a",(e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t}),(e=>{const t=Bt((e=e.substring(1)).length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t})),rn={utf8:en,"utf-8":en,hex:Zr.base16,latin1:tn,ascii:tn,binary:tn,...Zr};function nn(e,t="utf8"){const r=rn[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?r.encoder.encode(e).substring(1):globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8")}function on(e,t="utf8"){const r=rn[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?r.decoder.decode(`${r.prefix}${e}`):xt(globalThis.Buffer.from(e,"utf-8"))}function sn(e){return p(nn(on(e,Et),Ct))}function an(e){return nn(on(f(e),Ct),Et)}function cn(e){const t="z"+nn(Ot([on("K36",St),e]),St);return[_t,It,t].join(":")}function ln(e){return nn(e,Et)}function un(e){const t=e.split(Pt),r=sn(t[0]),n=sn(t[1]),o=function(e){return on(e,Et)}(t[2]);return{header:r,payload:n,signature:o,data:on(t.slice(0,2).join(Pt),kt)}}function dn(e=Y(32)){const t=At.getPublicKey(e);return{secretKey:Ot([e,t]),publicKey:t}}async function hn(e,t,r,n,o=(0,s.fromMiliseconds)(Date.now())){const i={alg:Tt,typ:"JWT"},a={iss:cn(n.publicKey),sub:e,aud:t,iat:o,exp:o+r},c=function(e){return on([an(e.header),an(e.payload)].join(Pt),kt)}({header:i,payload:a});return function(e){return[an(e.header),an(e.payload),ln(e.signature)].join(Pt)}({header:i,payload:a,signature:At.sign(c,n.secretKey.slice(0,32))})}var pn=r("./node_modules/detect-browser/es/index.js"),fn=r("./node_modules/@walletconnect/window-getters/dist/cjs/index.js"),gn=r("./node_modules/@walletconnect/window-metadata/dist/cjs/index.js"),mn=r("./node_modules/@reown/appkit-universal-connector/node_modules/ox/_esm/core/Signature.js"),yn=r("./node_modules/@reown/appkit-universal-connector/node_modules/ox/_esm/core/Secp256k1.js"),bn=r("./node_modules/@reown/appkit-universal-connector/node_modules/bs58/src/esm/index.js"),wn=r("./node_modules/@msgpack/msgpack/dist.esm/decode.mjs"),vn=r("./node_modules/@msgpack/msgpack/dist.esm/encode.mjs"),An=r("./node_modules/@reown/appkit-universal-connector/node_modules/@scure/base/lib/esm/index.js"),Tn=r("./node_modules/@reown/appkit-universal-connector/node_modules/uint8arrays/esm/src/index.js");const Pn={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}};var En=r("./node_modules/blakejs/index.js"),Cn=r("./node_modules/process/browser.js"),kn=r("./node_modules/buffer/index.js").Buffer;const _n=":";function In(e){const[t,r]=e.split(_n);return{namespace:t,reference:r}}function Sn(e,t){return e.includes(":")?[e]:t.chains||[]}var xn=Object.defineProperty,Bn=Object.defineProperties,On=Object.getOwnPropertyDescriptors,Mn=Object.getOwnPropertySymbols,Wn=Object.prototype.hasOwnProperty,jn=Object.prototype.propertyIsEnumerable,Rn=(e,t,r)=>t in e?xn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Nn=(e,t)=>{for(var r in t||(t={}))Wn.call(t,r)&&Rn(e,r,t[r]);if(Mn)for(var r of Mn(t))jn.call(t,r)&&Rn(e,r,t[r]);return e},Un=(e,t,r)=>Rn(e,"symbol"!=typeof t?t+"":t,r);const Dn="react-native",Ln="node",Fn="browser",zn="unknown",Vn="js";function qn(){return typeof Cn<"u"&&typeof Cn.versions<"u"&&typeof Cn.versions.node<"u"}
708function Hn(){return!(0,fn.getDocument)()&&!!(0,fn.getNavigator)()&&"ReactNative"===navigator.product}function Kn(){return!qn()&&!!(0,fn.getNavigator)()&&!!(0,fn.getDocument)()}function $n(){return Hn()?Dn:qn()?Ln:Kn()?Fn:zn}function Gn(){var e;try{return Hn()&&typeof r.g<"u"&&typeof(null==r.g?void 0:r.g.Application)<"u"?null==(e=r.g.Application)?void 0:e.applicationId:void 0}catch{return}}function Yn(e){var t,r;const n=Jn();try{return null!=e&&e.url&&n.url&&new URL(e.url).host!==new URL(n.url).host&&(console.warn(`The configured WalletConnect 'metadata.url':${e.url} differs from the actual page url:${n.url}. This is probably unintended and can lead to issues.`),e.url=n.url),null!=(t=e?.icons)&&t.length&&e.icons.length>0&&(e.icons=e.icons.filter((e=>""!==e))),((e,t)=>Bn(e,On(t)))(Nn(Nn({},n),e),{url:e?.url||n.url,name:e?.name||n.name,description:e?.description||n.description,icons:null!=(r=e?.icons)&&r.length&&e.icons.length>0?e.icons:n.icons})}catch(t){return console.warn("Error populating app metadata",t),e||n}}function Jn(){return(0,gn.g)()||{name:"",description:"",url:"",icons:[""]}}function Qn(e,t,n){const o=function(){if($n()===Dn&&typeof r.g<"u"&&typeof(null==r.g?void 0:r.g.Platform)<"u"){const{OS:e,Version:t}=r.g.Platform;return[e,t].join("-")}const e=(0,pn.o0)();if(null===e)return"unknown";const t=e.os?e.os.replace(" ","").toLowerCase():"unknown";return"browser"===e.type?[t,e.name,e.version].join("-"):[t,e.version].join("-")}(),s=function(){var e;const t=$n();return t===Fn?[t,(null==(e=(0,fn.getLocation)())?void 0:e.host)||"unknown"].join(":"):t}();return[[e,t].join("-"),[Vn,n].join("-"),o,s].join("/")}function Zn({protocol:e,version:t,relayUrl:r,sdkVersion:n,auth:o,projectId:s,useOnCloseEvent:i,bundleId:a,packageName:c}){const l=r.split("?"),u={auth:o,ua:Qn(e,t,n),projectId:s,useOnCloseEvent:i||void 0,packageName:c||void 0,bundleId:a||void 0},d=function(e,t){const r=new URLSearchParams(e);return Object.entries(t).sort((([e],[t])=>e.localeCompare(t))).forEach((([e,t])=>{null!=t&&r.set(e,String(t))})),r.toString()}(l[1]||"",u);return l[0]+"?"+d}function Xn(e,t){return e.filter((e=>t.includes(e))).length===e.length}function eo(e){return Object.fromEntries(e.entries())}function to(e){return new Map(Object.entries(e))}function ro(e=s.FIVE_MINUTES,t){const r=(0,s.toMiliseconds)(e||s.FIVE_MINUTES);let n,o,i,a;return{resolve:e=>{i&&n&&(clearTimeout(i),n(e),a=Promise.resolve(e))},reject:e=>{i&&o&&(clearTimeout(i),o(e))},done:()=>new Promise(((e,s)=>{if(a)return e(a);i=setTimeout((()=>{const e=new Error(t);a=Promise.reject(e),s(e)}),r),n=e,o=s}))}}function no(e,t,r){return new Promise((async(n,o)=>{const s=setTimeout((()=>o(new Error(r))),t);try{n(await e)}catch(e){o(e)}clearTimeout(s)}))}function oo(e,t){if("string"==typeof t&&t.startsWith(`${e}:`))return t;if("topic"===e.toLowerCase()){if("string"!=typeof t)throw new Error('Value must be "string" for expirer target type: topic');return`topic:${t}`}if("id"===e.toLowerCase()){if("number"!=typeof t)throw new Error('Value must be "number" for expirer target type: id');return`id:${t}`}throw new Error(`Unknown expirer target type: ${e}`)}function so(e){const[t,r]=e.split(":"),n={id:void 0,topic:void 0};if("topic"===t&&"string"==typeof r)n.topic=r;else{if("id"!==t||!Number.isInteger(Number(r)))throw new Error(`Invalid target, expected id:number or topic:string, got ${t}:${r}`);n.id=Number(r)}return n}function io(e,t){return(0,s.fromMiliseconds)((t||Date.now())+(0,s.toMiliseconds)(e))}function ao(e){return Date.now()>=(0,s.toMiliseconds)(e)}function co(e,t){return`${e}${t?`:${t}`:""}`}function lo(e=[],t=[]){return[...new Set([...e,...t])]}async function uo({id:e,topic:t,wcDeepLink:n}){var o;try{if(!n)return;const s="string"==typeof n?JSON.parse(n):n,i=s?.href;if("string"!=typeof i)return;const a=function(e,t,r){const n=`requestId=${t}&sessionTopic=${r}`;e.endsWith("/")&&(e=e.slice(0,-1));let o=`${e}`;if(e.startsWith("https://t.me")){o=`${o}${e.includes("?")?"&startapp=":"?startapp="}${function(e,t=!1){const r=kn.from(e).toString("base64");return t?r.replace(/[=]/g,""):r}(n,!0)}`}else o=`${o}/wc?${n}`;return o}(i,e,t),c=$n();if(c===Fn){if(null==(o=(0,fn.getDocument)())||!o.hasFocus())return void console.warn("Document does not have focus, skipping deeplink.");!function(e){let t="_self";!function(){try{return window.self!==window.top}catch{return!1}}()?(typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)||e.startsWith("https://")||e.startsWith("http://"))&&(t="_blank"):t="_top",window.open(e,t,"noreferrer noopener")}(a)}else c===Dn&&typeof(null==r.g?void 0:r.g.Linking)<"u"&&await r.g.Linking.openURL(a)}catch(e){console.error(e)}}function ho(e,t){if(!e.includes(t))return null;const r=e.split(/([&,?,=])/),n=r.indexOf(t);return r[n+2]}function po(){return typeof crypto<"u"&&null!=crypto&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function fo(){return typeof Cn<"u"&&"true"===Cn.env.IS_VITEST}function go(e){return kn.from(e,"base64").toString("utf-8")}class mo{constructor({limit:e}){Un(this,"limit"),Un(this,"set"),this.limit=e,this.set=new Set}
708add(e){if(!this.set.has(e)){if(this.set.size>=this.limit){const e=this.set.values().next().value;e&&this.set.delete(e)}this.set.add(e)}}has(e){return this.set.has(e)}}const yo=BigInt(2**32-1),bo=BigInt(32);function wo(e,t=!1){return t?{h:Number(e&yo),l:Number(e>>bo&yo)}:{h:0|Number(e>>bo&yo),l:0|Number(e&yo)}}function vo(e,t=!1){const r=e.length;let n=new Uint32Array(r),o=new Uint32Array(r);for(let s=0;s<r;s++){const{h:r,l:i}=wo(e[s],t);[n[s],o[s]]=[r,i]}return[n,o]}const Ao=(e,t,r)=>e>>>r,To=(e,t,r)=>e<<32-r|t>>>r,Po=(e,t,r)=>e>>>r|t<<32-r,Eo=(e,t,r)=>e<<32-r|t>>>r,Co=(e,t,r)=>e<<64-r|t>>>r-32,ko=(e,t,r)=>e>>>r-32|t<<64-r,_o=(e,t)=>t,Io=(e,t)=>e;function So(e,t,r,n){const o=(t>>>0)+(n>>>0);return{h:e+r+(o/2**32|0)|0,l:0|o}}const xo=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),Bo=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,Oo=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),Mo=(e,t,r,n,o)=>t+r+n+o+(e/2**32|0)|0,Wo=(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0),jo=(e,t,r,n,o,s)=>t+r+n+o+s+(e/2**32|0)|0,Ro="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function No(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function Uo(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Do(e,...t){if(!No(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Lo(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.createHasher");Uo(e.outputLen),Uo(e.blockLen)}function Fo(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function zo(e,t){Do(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function Vo(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function qo(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Ho(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Ko(e,t){return e<<32-t|e>>>t}const $o=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0];function Go(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const Yo=$o?e=>e:e=>Go(e);const Jo=$o?e=>e:function(e){for(let t=0;t<e.length;t++)e[t]=Go(e[t]);return e},Qo="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,Zo=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function Xo(e){if(Do(e),Qo)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=Zo[e[r]];return t}const es=48,ts=57,rs=65,ns=70,os=97,ss=102;function is(e){return e>=es&&e<=ts?e-es:e>=rs&&e<=ns?e-(rs-10):e>=os&&e<=ss?e-(os-10):void 0}function as(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);if(Qo)return Uint8Array.fromHex(e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,o=0;t<r;t++,o+=2){const r=is(e.charCodeAt(o)),s=is(e.charCodeAt(o+1));if(void 0===r||void 0===s){const t=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+o)}n[t]=16*r+s}return n}function cs(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))}function ls(e){return"string"==typeof e&&(e=cs(e)),Do(e),e}function us(...e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];Do(n),t+=n.length}const r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const o=e[t];r.set(o,n),n+=o.length}return r}class ds{}function hs(e){const t=t=>e().update(ls(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function ps(e=32){if(Ro&&"function"==typeof Ro.getRandomValues)return Ro.getRandomValues(new Uint8Array(e));if(Ro&&"function"==typeof Ro.randomBytes)return Uint8Array.from(Ro.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}const fs=BigInt(0),gs=BigInt(1),ms=BigInt(2),ys=BigInt(7),bs=BigInt(256),ws=BigInt(113),vs=[],As=[],Ts=[];for(let e=0,t=gs,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],vs.push(2*(5*n+r)),As.push((e+1)*(e+2)/2%64);let o=fs;for(let e=0;e<7;e++)t=(t<<gs^(t>>ys)*ws)%bs,t&ms&&(o^=gs<<(gs<<BigInt(e))-gs);Ts.push(o)}const Ps=vo(Ts,!0),Es=Ps[0],Cs=Ps[1],ks=(e,t,r)=>r>32?((e,t,r)=>t<<r-32|e>>>64-r)(e,t,r):((e,t,r)=>e<<r|t>>>32-r)(e,t,r),_s=(e,t,r)=>r>32?((e,t,r)=>e<<r-32|t>>>64-r)(e,t,r):((e,t,r)=>t<<r|e>>>32-r)(e,t,r);class Is extends ds{constructor(e,t,r,n=!1,o=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=o,Uo(r),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Vo(this.state)}clone(){return this._cloneInto()}
vendor: 4,901 bytes, line 708
708keccak(){Jo(this.state32),function(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const n=(t+8)%10,o=(t+2)%10,s=r[o],i=r[o+1],a=ks(s,i,1)^r[n],c=_s(s,i,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=c}let t=e[2],o=e[3];for(let r=0;r<24;r++){const n=As[r],s=ks(t,o,n),i=_s(t,o,n),a=vs[r];t=e[a],o=e[a+1],e[a]=s,e[a+1]=i}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=Es[n],e[1]^=Cs[n]}qo(r)}(this.state32,this.rounds),Jo(this.state32),this.posOut=0,this.pos=0}update(e){Fo(this),Do(e=ls(e));const{blockLen:t,state:r}=this,n=e.length;for(let o=0;o<n;){const s=Math.min(t-this.pos,n-o);for(let t=0;t<s;t++)r[this.pos++]^=e[o++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,!!(128&t)&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){Fo(this,!1),Do(e),this.finish();const t=this.state,{blockLen:r}=this;for(let n=0,o=e.length;n<o;){this.posOut>=r&&this.keccak();const s=Math.min(r-this.posOut,o-n);e.set(t.subarray(this.posOut,this.posOut+s),n),this.posOut+=s,n+=s}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Uo(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(zo(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,qo(this.state)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:n,rounds:o,enableXOF:s}=this;return e||(e=new Is(t,r,n,s,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=r,e.outputLen=n,e.enableXOF=s,e.destroyed=this.destroyed,e}}const Ss=((e,t,r)=>hs((()=>new Is(t,e,r))))(1,136,32);function xs(e,t,r){return e&t^~e&r}function Bs(e,t,r){return e&t^e&r^t&r}class Os extends ds{constructor(e,t,r,n){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(e),this.view=Ho(this.buffer)}update(e){Fo(this),Do(e=ls(e));const{view:t,buffer:r,blockLen:n}=this,o=e.length;for(let s=0;s<o;){const i=Math.min(n-this.pos,o-s);if(i!==n)r.set(e.subarray(s,s+i),this.pos),this.pos+=i,s+=i,this.pos===n&&(this.process(t,0),this.pos=0);else{const t=Ho(e);for(;n<=o-s;s+=n)this.process(t,s)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){Fo(this),zo(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:n,isLE:o}=this;let{pos:s}=this;t[s++]=128,qo(this.buffer.subarray(s)),this.padOffset>n-s&&(this.process(r,0),s=0);for(let e=s;e<n;e++)t[e]=0;(function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const o=BigInt(32),s=BigInt(4294967295),i=Number(r>>o&s),a=Number(r&s),c=n?4:0,l=n?0:4;e.setUint32(t+c,i,n),e.setUint32(t+l,a,n)})(r,n-8,BigInt(8*this.length),o),this.process(r,0);const i=Ho(e),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=a/4,l=this.get();if(c>l.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)i.setUint32(4*e,l[e],o)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:o,destroyed:s,pos:i}=this;return e.destroyed=s,e.finished=o,e.length=n,e.pos=i,n%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}const Ms=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ws=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),js=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),Rs=Uint32Array.from([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,2756
vendor: 2,007 bytes, line 708
708734187,3204031479,3329325298]),Ns=new Uint32Array(64);class Us extends Os{constructor(e=32){super(64,e,8,!1),this.A=0|Ms[0],this.B=0|Ms[1],this.C=0|Ms[2],this.D=0|Ms[3],this.E=0|Ms[4],this.F=0|Ms[5],this.G=0|Ms[6],this.H=0|Ms[7]}get(){const{A:e,B:t,C:r,D:n,E:o,F:s,G:i,H:a}=this;return[e,t,r,n,o,s,i,a]}set(e,t,r,n,o,s,i,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|o,this.F=0|s,this.G=0|i,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)Ns[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=Ns[e-15],r=Ns[e-2],n=Ko(t,7)^Ko(t,18)^t>>>3,o=Ko(r,17)^Ko(r,19)^r>>>10;Ns[e]=o+Ns[e-7]+n+Ns[e-16]|0}let{A:r,B:n,C:o,D:s,E:i,F:a,G:c,H:l}=this;for(let e=0;e<64;e++){const t=l+(Ko(i,6)^Ko(i,11)^Ko(i,25))+xs(i,a,c)+Rs[e]+Ns[e]|0,u=(Ko(r,2)^Ko(r,13)^Ko(r,22))+Bs(r,n,o)|0;l=c,c=a,a=i,i=s+t|0,s=o,o=n,n=r,r=t+u|0}r=r+this.A|0,n=n+this.B|0,o=o+this.C|0,s=s+this.D|0,i=i+this.E|0,a=a+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(r,n,o,s,i,a,c,l)}roundClean(){qo(Ns)}destroy(){this.set(0,0,0,0,0,0,0,0),qo(this.buffer)}}const Ds=vo(["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","0xf40e3585
7085771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((e=>BigInt(e)))),Ls=Ds[0],Fs=Ds[1],zs=new Uint32Array(80),Vs=new Uint32Array(80);class qs extends Os{constructor(e=64){super(128,e,16,!1),this.Ah=0|js[0],this.Al=0|js[1],this.Bh=0|js[2],this.Bl=0|js[3],this.Ch=0|js[4],this.Cl=0|js[5],this.Dh=0|js[6],this.Dl=0|js[7],this.Eh=0|js[8],this.El=0|js[9],this.Fh=0|js[10],this.Fl=0|js[11],this.Gh=0|js[12],this.Gl=0|js[13],this.Hh=0|js[14],this.Hl=0|js[15]}get(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:o,Cl:s,Dh:i,Dl:a,Eh:c,El:l,Fh:u,Fl:d,Gh:h,Gl:p,Hh:f,Hl:g}=this;return[e,t,r,n,o,s,i,a,c,l,u,d,h,p,f,g]}set(e,t,r,n,o,s,i,a,c,l,u,d,h,p,f,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|o,this.Cl=0|s,this.Dh=0|i,this.Dl=0|a,this.Eh=0|c,this.El=0|l,this.Fh=0|u,this.Fl=0|d,this.Gh=0|h,this.Gl=0|p,this.Hh=0|f,this.Hl=0|g}process(e,t){for(let r=0;r<16;r++,t+=4)zs[r]=e.getUint32(t),Vs[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|zs[e-15],r=0|Vs[e-15],n=Po(t,r,1)^Po(t,r,8)^Ao(t,0,7),o=Eo(t,r,1)^Eo(t,r,8)^To(t,r,7),s=0|zs[e-2],i=0|Vs[e-2],a=Po(s,i,19)^Co(s,i,61)^Ao(s,0,6),c=Eo(s,i,19)^ko(s,i,61)^To(s,i,6),l=Oo(o,c,Vs[e-7],Vs[e-16]),u=Mo(l,n,a,zs[e-7],zs[e-16]);zs[e]=0|u,Vs[e]=0|l}let{Ah:r,Al:n,Bh:o,Bl:s,Ch:i,Cl:a,Dh:c,Dl:l,Eh:u,El:d,Fh:h,Fl:p,Gh:f,Gl:g,Hh:m,Hl:y}=this;for(let e=0;e<80;e++){const t=Po(u,d,14)^Po(u,d,18)^Co(u,d,41),b=Eo(u,d,14)^Eo(u,d,18)^ko(u,d,41),w=u&h^~u&f,v=Wo(y,b,d&p^~d&g,Fs[e],Vs[e]),A=jo(v,m,t,w,Ls[e],zs[e]),T=0|v,P=Po(r,n,28)^Co(r,n,34)^Co(r,n,39),E=Eo(r,n,28)^ko(r,n,34)^ko(r,n,39),C=r&o^r&i^o&i,k=n&s^n&a^s&a;m=0|f,y=0|g,f=0|h,g=0|p,h=0|u,p=0|d,({h:u,l:d}=So(0|c,0|l,0|A,0|T)),c=0|i,l=0|a,i=0|o,a=0|s,o=0|r,s=0|n;const _=xo(T,E,k);r=Bo(_,A,P,C),n=0|_}({h:r,l:n}=So(0|this.Ah,0|this.Al,0|r,0|n)),({h:o,l:s}=So(0|this.Bh,0|this.Bl,0|o,0|s)),({h:i,l:a}=So(0|this.Ch,0|this.Cl,0|i,0|a)),({h:c,l}=So(0|this.Dh,0|this.Dl,0|c,0|l)),({h:u,l:d}=So(0|this.Eh,0|this.El,0|u,0|d)),({h,l:p}=So(0|this.Fh,0|this.Fl,0|h,0|p)),({h:f,l:g}=So(0|this.Gh,0|this.Gl,0|f,0|g)),({h:m,l:y}=So(0|this.Hh,0|this.Hl,0|m,0|y)),this.set(r,n,o,s,i,a,c,l,u,d,h,p,f,g,m,y)}roundClean(){qo(zs,Vs)}destroy(){qo(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class Hs extends qs{constructor(){super(48),this.Ah=0|Ws[0],this.Al=0|Ws[1],this.Bh=0|Ws[2],this.Bl=0|Ws[3],this.Ch=0|Ws[4],this.Cl=0|Ws[5],this.Dh=0|Ws[6],this.Dl=0|Ws[7],this.Eh=0|Ws[8],this.El=0|Ws[9],this.Fh=0|Ws[10],this.Fl=0|Ws[11],this.Gh=0|Ws[12],this.Gl=0|Ws[13],this.Hh=0|Ws[14],this.Hl=0|Ws[15]}}const Ks=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class $s extends qs{constructor(){super(32),this.Ah=0|Ks[0],this.Al=0|Ks[1],this.Bh=0|Ks[2],this.Bl=0|Ks[3],this.Ch=0|Ks[4],this.Cl=0|Ks[5],this.Dh=0|Ks[6],this.Dl=0|Ks[7],this.Eh=0|Ks[8],this.El=0|Ks[9],this.Fh=0|Ks[10],this.Fl=0|Ks[11],this.Gh=0|Ks[12],this.Gl=0|Ks[13],this.Hh=0|Ks[14],this.Hl=0|Ks[15]}}const Gs=hs((()=>new Us)),Ys=hs((()=>new qs)),Js=hs((()=>new Hs)),Qs=hs((()=>new $s)),Zs=Uint8Array.from([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,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]),Xs=Uint32Array.from([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),ei=new Uint32Array(32);function ti(e,t,r,n,o,s){const i=o[s],a=o[s+1];let c=ei[2*e],l=ei[2*e+1],u=ei[2*t],d=ei[2*t+1],h=ei[2*r],p=ei[2*r+1],f=ei[2*n],g=ei[2*n+1],m=xo(c,u,i);l=Bo(m,l,d,a),c=0|m,({Dh:g,Dl:f}={Dh:g^l,Dl:f^c}),({Dh:g,Dl:f}={Dh:_o(0,f),Dl:Io(g)}),({h:p,l:h}=So(p,h,g,f)),({Bh:d,Bl:u}={Bh:d^p,Bl:u^h}),({Bh:d,Bl:u}={Bh:Po(d,u,24),Bl:Eo(d,u,24)}),ei[2*e]=c,ei[2*e+1]=l,ei[2*t]=u,ei[2*t+1]=d,ei[2*r]=h,ei[2*r+1]=p,ei[2*n]=f,ei[2*n+1]=g}function ri(e,t,r,n,o,s){const i=o[s],a=o[s+1];let c=ei[2*e],l=ei[2*e+1],u=ei[2*t],d=ei[2*t+1],h=ei[2*r],p=ei[2*r+1],f=ei[2*n],g=ei[2*n+1],m=xo(c,u,i);l=Bo(m,l,d,a),c=0|m,({Dh:g,Dl:f}={Dh:g^l,Dl:f^c}),({Dh:g,Dl:f}={Dh:Po(g,f,16),Dl:Eo(g,f,16)}),({h:p,l:h}=So(p,h,g,f)),({Bh:d,Bl:u}={Bh:d^p,Bl:u^h}),({Bh:d,Bl:u}={Bh:Co(d,u,63),Bl:ko(d,u,63)}),ei[2*e]=c,ei[2*e+1]=l,ei[2*t]=u,ei[2*t+1]=d,ei[2*r]=h,ei[2*r+1]=p,ei[2*n]=f,ei[2*n+1]=g}class ni extends ds{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,this.length=0,this.pos=0,Uo(e),Uo(t),this.blockLen=e,this.outputLen=t,this.buffer=new Uint8Array(e),this.buffer32=Vo(this.buffer)}update(e){Fo(this),Do(e=ls(e));const{blockLen:t,buffer:r,buffer32:n}=this,o=e.length,s=e.byteOffset,i=e.buffer;for(let a=0;a<o;){this.pos===t&&(Jo(n),this.compress(n,0,!1),Jo(n),this.pos=0);const c=Math.min(t-this.pos,o-a),l=s+a;if(c!==t||l%4||!(a+c<o))r.set(e.subarray(a,a+c),this.pos),this.pos+=c,this.length+=c,a+=c;else{const e=new Uint32Array(i,l,Math.floor((o-a)/4));Jo(e);for(let r=0;a+t<o;r+=n.length,a+=t)this.length+=t,this.compress(e,r,!1);Jo(e)}}return this}digestInto(e){Fo(this),zo(e,this);const{pos:t,buffer32:r}=this;this.finished=!0,qo(this.buffer.subarray(t)),Jo(r),this.compress(r,0,!0),Jo(r);const n=Vo(e);
708this.get().forEach(((e,t)=>n[t]=Yo(e)))}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){const{buffer:t,length:r,finished:n,destroyed:o,outputLen:s,pos:i}=this;return e||(e=new this.constructor({dkLen:s})),e.set(...this.get()),e.buffer.set(t),e.destroyed=o,e.finished=n,e.length=r,e.pos=i,e.outputLen=s,e}clone(){return this._cloneInto()}}class oi extends ni{constructor(e={}){const t=void 0===e.dkLen?64:e.dkLen;super(128,t),this.v0l=0|Xs[0],this.v0h=0|Xs[1],this.v1l=0|Xs[2],this.v1h=0|Xs[3],this.v2l=0|Xs[4],this.v2h=0|Xs[5],this.v3l=0|Xs[6],this.v3h=0|Xs[7],this.v4l=0|Xs[8],this.v4h=0|Xs[9],this.v5l=0|Xs[10],this.v5h=0|Xs[11],this.v6l=0|Xs[12],this.v6h=0|Xs[13],this.v7l=0|Xs[14],this.v7h=0|Xs[15],function(e,t={},r,n,o){if(Uo(r),e<0||e>r)throw new Error("outputLen bigger than keyLen");const{key:s,salt:i,personalization:a}=t;if(void 0!==s&&(s.length<1||s.length>r))throw new Error("key length must be undefined or 1.."+r);if(void 0!==i&&i.length!==n)throw new Error("salt must be undefined or "+n);if(void 0!==a&&a.length!==o)throw new Error("personalization must be undefined or "+o)}(t,e,64,16,16);let{key:r,personalization:n,salt:o}=e,s=0;if(void 0!==r&&(r=ls(r),s=r.length),this.v0l^=this.outputLen|s<<8|65536|1<<24,void 0!==o){o=ls(o);const e=Vo(o);this.v4l^=Yo(e[0]),this.v4h^=Yo(e[1]),this.v5l^=Yo(e[2]),this.v5h^=Yo(e[3])}if(void 0!==n){n=ls(n);const e=Vo(n);this.v6l^=Yo(e[0]),this.v6h^=Yo(e[1]),this.v7l^=Yo(e[2]),this.v7h^=Yo(e[3])}if(void 0!==r){const e=new Uint8Array(this.blockLen);e.set(r),this.update(e)}}get(){let{v0l:e,v0h:t,v1l:r,v1h:n,v2l:o,v2h:s,v3l:i,v3h:a,v4l:c,v4h:l,v5l:u,v5h:d,v6l:h,v6h:p,v7l:f,v7h:g}=this;return[e,t,r,n,o,s,i,a,c,l,u,d,h,p,f,g]}set(e,t,r,n,o,s,i,a,c,l,u,d,h,p,f,g){this.v0l=0|e,this.v0h=0|t,this.v1l=0|r,this.v1h=0|n,this.v2l=0|o,this.v2h=0|s,this.v3l=0|i,this.v3h=0|a,this.v4l=0|c,this.v4h=0|l,this.v5l=0|u,this.v5h=0|d,this.v6l=0|h,this.v6h=0|p,this.v7l=0|f,this.v7h=0|g}compress(e,t,r){this.get().forEach(((e,t)=>ei[t]=e)),ei.set(Xs,16);let{h:n,l:o}=wo(BigInt(this.length));ei[24]=Xs[8]^o,ei[25]=Xs[9]^n,r&&(ei[28]=~ei[28],ei[29]=~ei[29]);let s=0;const i=Zs;for(let r=0;r<12;r++)ti(0,4,8,12,e,t+2*i[s++]),ri(0,4,8,12,e,t+2*i[s++]),ti(1,5,9,13,e,t+2*i[s++]),ri(1,5,9,13,e,t+2*i[s++]),ti(2,6,10,14,e,t+2*i[s++]),ri(2,6,10,14,e,t+2*i[s++]),ti(3,7,11,15,e,t+2*i[s++]),ri(3,7,11,15,e,t+2*i[s++]),ti(0,5,10,15,e,t+2*i[s++]),ri(0,5,10,15,e,t+2*i[s++]),ti(1,6,11,12,e,t+2*i[s++]),ri(1,6,11,12,e,t+2*i[s++]),ti(2,7,8,13,e,t+2*i[s++]),ri(2,7,8,13,e,t+2*i[s++]),ti(3,4,9,14,e,t+2*i[s++]),ri(3,4,9,14,e,t+2*i[s++]);this.v0l^=ei[0]^ei[16],this.v0h^=ei[1]^ei[17],this.v1l^=ei[2]^ei[18],this.v1h^=ei[3]^ei[19],this.v2l^=ei[4]^ei[20],this.v2h^=ei[5]^ei[21],this.v3l^=ei[6]^ei[22],this.v3h^=ei[7]^ei[23],this.v4l^=ei[8]^ei[24],this.v4h^=ei[9]^ei[25],this.v5l^=ei[10]^ei[26],this.v5h^=ei[11]^ei[27],this.v6l^=ei[12]^ei[28],this.v6h^=ei[13]^ei[29],this.v7l^=ei[14]^ei[30],this.v7h^=ei[15]^ei[31],qo(ei)}destroy(){this.destroyed=!0,qo(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const si=function(e){const t=(t,r)=>e(r).update(ls(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}((e=>new oi(e))),ii="https://rpc.walletconnect.org/v1";function ai(e){const t=`�Ethereum Signed Message:\n${e.length}`,r=(new TextEncoder).encode(t+e);return"0x"+kn.from(Ss(r)).toString("hex")}async function ci(e,t,r,n,o,s){switch(r.t){case"eip191":return await function(e,t,r){const n=mn.aD(r);return yn.x_({payload:ai(t),signature:n}).toLowerCase()===e.toLowerCase()}(e,t,r.s);case"eip1271":return await async function(e,t,r,n,o,s){const i=In(n);if(!i.namespace||!i.reference)throw new Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${n}`);try{const i="0x1626ba7e",a="0000000000000000000000000000000000000000000000000000000000000040",c=r.substring(2),l=(c.length/2).toString(16).padStart(64,"0"),u=i+(t.startsWith("0x")?t:ai(t)).substring(2)+a+l+c,d=await fetch(`${s||ii}/?chainId=${n}&projectId=${o}`,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify({id:li(),jsonrpc:"2.0",method:"eth_call",params:[{to:e,data:u},"latest"]})}),{result:h}=await d.json();return!!h&&h.slice(0,i.length).toLowerCase()===i.toLowerCase()}catch(e){return console.error("isValidEip1271Signature: ",e),!1}}(e,t,r.s,n,o,s);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}function li(){return Date.now()+Math.floor(1e3*Math.random())}function ui(e){const t=new Uint8Array(kn.from(e,"base64")),r=Array.from("TransactionData::").map((e=>e.charCodeAt(0))),n=new Uint8Array(r.length+t.length);n.set(r),n.set(t,r.length);const o=si(n,{dkLen:32});return bn.A.encode(o)}function di(e){const t=new Uint8Array(Gs(function(e){if(e instanceof Uint8Array)return e;if(Array.isArray(e))return new Uint8Array(e);if("object"==typeof e&&null!=e&&e.data)return new Uint8Array(Object.values(e.data));if("object"==typeof e&&e)return new Uint8Array(Object.values(e));throw new Error("getNearUint8ArrayFromBytes: Unexpected result type from bytes array")}(e)));return bn.A.encode(t)}function hi(e){const t=kn.from(e,"base64"),r=(0,wn.D)(t).txn;if(!r)throw new Error("Invalid signed transaction: missing 'txn' field");const n=(0,vn.l)(r),o=kn.from("TX"),s=kn.concat([o,kn.from(n)]),i=Qs(s);return An.RG.encode(i).replace(/=+$/,"")}function pi(e){const t=[];let r=BigInt(e);for(;r>=BigInt(128);)t.push(Number(r&BigInt(127)|BigInt(128))),r>>=BigInt(7);return t.push(Number(r)),kn.from(t)}function fi(e){const t=kn.from(e.signed.bodyBytes,"base64"),r=kn.from(e.signed.authInfoBytes,"base64"),n=kn.from(e.signature.signature,"base64"),o=[];o.push(kn.from([10])),o.push(pi(t.length)),o.push(t),o.push(kn.from([18])),o.push(pi(r.length)),o.push(r),o.push(kn.from([26])),o.push(pi(n.length)),o.push(n);const s=kn.concat(o),i=Gs(s);return kn.from(i).toString("hex").toUpperCase()}var gi=Object.defineProperty,mi=Object.defineProperties,yi=Object.getOwnPropertyDescriptors,bi=Object.getOwnPropertySymbols,wi=Object.prototype.hasOwnProperty,vi=Object.prototype.propertyIsEnumerable,Ai=(e,t,r)=>t in e?gi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ti=(e,t)=>{for(var r in t||(t={}))wi.call(t,r)&&Ai(e,r,t[r]);if(bi)for(var r of bi(t))vi.call(t,r)&&Ai(e,r,t[r]);return e},Pi=(e,t)=>mi(e,yi(t));const Ei="did:pkh:",Ci={eip155:"Ethereum",solana:"Solana",bip122:"Bitcoin"},ki=e=>e?.split(":"),_i=e=>
708{const t=e&&ki(e);if(t)return t[2]+":"+t[3]},Ii=e=>{const t=e&&ki(e);if(t)return t.pop()};async function Si(e){const{cacao:t,projectId:r}=e,{s:n,p:o}=t,s=xi(o,o.iss),i=Ii(o.iss);return await ci(i,s,n,_i(o.iss),r)}const xi=(e,t)=>{const r=(e=>{const t=e&&ki(e);if(t)return e.includes(Ei)?t[2]:t[0]})(t);if(!r)throw new Error("Invalid issuer: "+t);const n=`${e.domain} wants you to sign in with your ${(e=>e?Ci[e]||e:"")(r)} account:`,o=Ii(t);if(!e.aud&&!e.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let s=e.statement||void 0;const i=`URI: ${e.aud||e.uri}`,a=`Version: ${e.version}`,c=`Chain ID: ${(e=>{const t=e&&ki(e);if(t)return e.includes(Ei)?t[3]:t[1]})(t)}`,l=`Nonce: ${e.nonce}`,u=`Issued At: ${e.iat}`,d=e.exp?`Expiration Time: ${e.exp}`:void 0,h=e.nbf?`Not Before: ${e.nbf}`:void 0,p=e.requestId?`Request ID: ${e.requestId}`:void 0,f=e.resources?`Resources:${e.resources.map((e=>`\n- ${e}`)).join("")}`:void 0,g=Fi(e.resources);if(g){s=Ui(s,Wi(g))}return[n,o,"",s,"",i,a,c,l,u,d,h,p,f].filter((e=>null!=e)).join("\n")};function Bi(e){if(!e)throw new Error("No recap provided, value is undefined");if(!e.att)throw new Error("No `att` property found");const t=Object.keys(e.att);if(null==t||!t.length)throw new Error("No resources found in `att` property");t.forEach((t=>{const r=e.att[t];if(Array.isArray(r))throw new Error(`Resource must be an object: ${t}`);if("object"!=typeof r)throw new Error(`Resource must be an object: ${t}`);if(!Object.keys(r).length)throw new Error(`Resource object is empty: ${t}`);Object.keys(r).forEach((e=>{const t=r[e];if(!Array.isArray(t))throw new Error(`Ability limits ${e} must be an array of objects, found: ${t}`);if(!t.length)throw new Error(`Value of ${e} is empty array, must be an array with objects`);t.forEach((t=>{if("object"!=typeof t)throw new Error(`Ability limits (${e}) must be an array of objects, found: ${t}`)}))}))}))}function Oi(e,t,r={}){t=t?.sort(((e,t)=>e.localeCompare(t)));const n=t.map((t=>({[`${e}/${t}`]:[r]})));return Object.assign({},...n)}function Mi(e){return Bi(e),`urn:recap:${function(e){return kn.from(JSON.stringify(e)).toString("base64")}(e).replace(/=/g,"")}`}function Wi(e){const t=function(e){return JSON.parse(kn.from(e,"base64").toString("utf-8"))}(e.replace("urn:recap:",""));return Bi(t),t}function ji(e,t,r){const n=function(e,t,r,n={}){return r?.sort(((e,t)=>e.localeCompare(t))),{att:{[e]:Oi(t,r,n)}}}(e,t,r);return Mi(n)}function Ri(e){return e&&e.includes("urn:recap:")}function Ni(e,t){const r=function(e,t){Bi(e),Bi(t);const r=Object.keys(e.att).concat(Object.keys(t.att)).sort(((e,t)=>e.localeCompare(t))),n={att:{}};return r.forEach((r=>{var o,s;Object.keys((null==(o=e.att)?void 0:o[r])||{}).concat(Object.keys((null==(s=t.att)?void 0:s[r])||{})).sort(((e,t)=>e.localeCompare(t))).forEach((o=>{var s,i;n.att[r]=Pi(Ti({},n.att[r]),{[o]:(null==(s=e.att[r])?void 0:s[o])||(null==(i=t.att[r])?void 0:i[o])})}))})),n}(Wi(e),Wi(t));return Mi(r)}function Ui(e="",t){Bi(t);const r="I further authorize the stated URI to perform the following actions on my behalf: ";if(e.includes(r))return e;const n=[];let o=0;Object.keys(t.att).forEach((e=>{const r=Object.keys(t.att[e]).map((e=>({ability:e.split("/")[0],action:e.split("/")[1]})));r.sort(((e,t)=>e.action.localeCompare(t.action)));const s={};r.forEach((e=>{s[e.ability]||(s[e.ability]=[]),s[e.ability].push(e.action)}));const i=Object.keys(s).map((t=>(o++,`(${o}) '${t}': '${s[t].join("', '")}' for '${e}'.`)));n.push(i.join(", ").replace(".,","."))}));return`${e?e+" ":""}${`${r}${n.join(" ")}`}`}function Di(e){var t;const r=Wi(e);Bi(r);const n=null==(t=r.att)?void 0:t.eip155;return n?Object.keys(n).map((e=>e.split("/")[1])):[]}function Li(e){const t=Wi(e);Bi(t);const r=[];return Object.values(t.att).forEach((e=>{Object.values(e).forEach((e=>{var t;null!=(t=e?.[0])&&t.chains&&r.push(e[0].chains)}))})),[...new Set(r.flat())]}function Fi(e){if(!e)return;const t=e?.[e.length-1];return Ri(t)?t:void 0}function zi(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function Vi(e){if("boolean"!=typeof e)throw new Error(`boolean expected, not ${e}`)}function qi(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Hi(e,...t){if(!zi(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Ki(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function $i(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Gi(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}const Yi=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0];function Ji(e){if("string"==typeof e)e=function(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))}(e);else{if(!zi(e))throw new Error("Uint8Array expected, got "+typeof e);e=ea(e)}return e}function Qi(e,t,r=!0){if(void 0===t)return new Uint8Array(e);if(t.length!==e)throw new Error("invalid output length, expected "+e+", got: "+t.length);if(r&&!function(e){return e.byteOffset%4==0}(t))throw new Error("invalid output, must be aligned");return t}function Zi(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const o=BigInt(32),s=BigInt(4294967295),i=Number(r>>o&s),a=Number(r&s),c=n?4:0,l=n?0:4;e.setUint32(t+c,i,n),e.setUint32(t+l,a,n)}function Xi(e,t,r){Vi(r);const n=new Uint8Array(16),o=function(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}(n);return Zi(o,0,BigInt(t),r),Zi(o,8,BigInt(e),r),n}function ea(e){return Uint8Array.from(e)}const ta=e=>Uint8Array.from(e.split("").map((e=>e.charCodeAt(0)))),ra=ta("expand 16-byte k"),na=ta("expand 32-byte k"),oa=$i(ra),sa=$i(na);function ia(e,t){return e<<t|e>>>32-t}function aa(e){return e.byteOffset%4==0}const ca=2**32-1,la=new Uint32Array;const ua=(e,t)=>255&e[t++]|(255&e[t++])<<8;class da{constructor(e){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,Hi(e=Ji(e),32);
708const t=ua(e,0),r=ua(e,2),n=ua(e,4),o=ua(e,6),s=ua(e,8),i=ua(e,10),a=ua(e,12),c=ua(e,14);this.r[0]=8191&t,this.r[1]=8191&(t>>>13|r<<3),this.r[2]=7939&(r>>>10|n<<6),this.r[3]=8191&(n>>>7|o<<9),this.r[4]=255&(o>>>4|s<<12),this.r[5]=s>>>1&8190,this.r[6]=8191&(s>>>14|i<<2),this.r[7]=8065&(i>>>11|a<<5),this.r[8]=8191&(a>>>8|c<<8),this.r[9]=c>>>5&127;for(let t=0;t<8;t++)this.pad[t]=ua(e,16+2*t)}process(e,t,r=!1){const n=r?0:2048,{h:o,r:s}=this,i=s[0],a=s[1],c=s[2],l=s[3],u=s[4],d=s[5],h=s[6],p=s[7],f=s[8],g=s[9],m=ua(e,t+0),y=ua(e,t+2),b=ua(e,t+4),w=ua(e,t+6),v=ua(e,t+8),A=ua(e,t+10),T=ua(e,t+12),P=ua(e,t+14);let E=o[0]+(8191&m),C=o[1]+(8191&(m>>>13|y<<3)),k=o[2]+(8191&(y>>>10|b<<6)),_=o[3]+(8191&(b>>>7|w<<9)),I=o[4]+(8191&(w>>>4|v<<12)),S=o[5]+(v>>>1&8191),x=o[6]+(8191&(v>>>14|A<<2)),B=o[7]+(8191&(A>>>11|T<<5)),O=o[8]+(8191&(T>>>8|P<<8)),M=o[9]+(P>>>5|n),W=0,j=W+E*i+C*(5*g)+k*(5*f)+_*(5*p)+I*(5*h);W=j>>>13,j&=8191,j+=S*(5*d)+x*(5*u)+B*(5*l)+O*(5*c)+M*(5*a),W+=j>>>13,j&=8191;let R=W+E*a+C*i+k*(5*g)+_*(5*f)+I*(5*p);W=R>>>13,R&=8191,R+=S*(5*h)+x*(5*d)+B*(5*u)+O*(5*l)+M*(5*c),W+=R>>>13,R&=8191;let N=W+E*c+C*a+k*i+_*(5*g)+I*(5*f);W=N>>>13,N&=8191,N+=S*(5*p)+x*(5*h)+B*(5*d)+O*(5*u)+M*(5*l),W+=N>>>13,N&=8191;let U=W+E*l+C*c+k*a+_*i+I*(5*g);W=U>>>13,U&=8191,U+=S*(5*f)+x*(5*p)+B*(5*h)+O*(5*d)+M*(5*u),W+=U>>>13,U&=8191;let D=W+E*u+C*l+k*c+_*a+I*i;W=D>>>13,D&=8191,D+=S*(5*g)+x*(5*f)+B*(5*p)+O*(5*h)+M*(5*d),W+=D>>>13,D&=8191;let L=W+E*d+C*u+k*l+_*c+I*a;W=L>>>13,L&=8191,L+=S*i+x*(5*g)+B*(5*f)+O*(5*p)+M*(5*h),W+=L>>>13,L&=8191;let F=W+E*h+C*d+k*u+_*l+I*c;W=F>>>13,F&=8191,F+=S*a+x*i+B*(5*g)+O*(5*f)+M*(5*p),W+=F>>>13,F&=8191;let z=W+E*p+C*h+k*d+_*u+I*l;W=z>>>13,z&=8191,z+=S*c+x*a+B*i+O*(5*g)+M*(5*f),W+=z>>>13,z&=8191;let V=W+E*f+C*p+k*h+_*d+I*u;W=V>>>13,V&=8191,V+=S*l+x*c+B*a+O*i+M*(5*g),W+=V>>>13,V&=8191;let q=W+E*g+C*f+k*p+_*h+I*d;W=q>>>13,q&=8191,q+=S*u+x*l+B*c+O*a+M*i,W+=q>>>13,q&=8191,W=(W<<2)+W|0,W=W+j|0,j=8191&W,W>>>=13,R+=W,o[0]=j,o[1]=R,o[2]=N,o[3]=U,o[4]=D,o[5]=L,o[6]=F,o[7]=z,o[8]=V,o[9]=q}finalize(){const{h:e,pad:t}=this,r=new Uint16Array(10);let n=e[1]>>>13;e[1]&=8191;for(let t=2;t<10;t++)e[t]+=n,n=e[t]>>>13,e[t]&=8191;e[0]+=5*n,n=e[0]>>>13,e[0]&=8191,e[1]+=n,n=e[1]>>>13,e[1]&=8191,e[2]+=n,r[0]=e[0]+5,n=r[0]>>>13,r[0]&=8191;for(let t=1;t<10;t++)r[t]=e[t]+n,n=r[t]>>>13,r[t]&=8191;r[9]-=8192;let o=(1^n)-1;for(let e=0;e<10;e++)r[e]&=o;o=~o;for(let t=0;t<10;t++)e[t]=e[t]&o|r[t];e[0]=65535&(e[0]|e[1]<<13),e[1]=65535&(e[1]>>>3|e[2]<<10),e[2]=65535&(e[2]>>>6|e[3]<<7),e[3]=65535&(e[3]>>>9|e[4]<<4),e[4]=65535&(e[4]>>>12|e[5]<<1|e[6]<<14),e[5]=65535&(e[6]>>>2|e[7]<<11),e[6]=65535&(e[7]>>>5|e[8]<<8),e[7]=65535&(e[8]>>>8|e[9]<<5);let s=e[0]+t[0];e[0]=65535&s;for(let r=1;r<8;r++)s=(e[r]+t[r]|0)+(s>>>16)|0,e[r]=65535&s;Gi(r)}update(e){Ki(this),Hi(e=Ji(e));const{buffer:t,blockLen:r}=this,n=e.length;for(let o=0;o<n;){const s=Math.min(r-this.pos,n-o);if(s!==r)t.set(e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===r&&(this.process(t,0,!1),this.pos=0);else for(;r<=n-o;o+=r)this.process(e,o)}return this}destroy(){Gi(this.h,this.r,this.buffer,this.pad)}digestInto(e){Ki(this),function(e,t){Hi(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}(e,this),this.finished=!0;const{buffer:t,h:r}=this;let{pos:n}=this;if(n){for(t[n++]=1;n<16;n++)t[n]=0;this.process(t,0,!0)}this.finalize();let o=0;for(let t=0;t<8;t++)e[o++]=r[t]>>>0,e[o++]=r[t]>>>8;return e}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}}const ha=function(e){const t=(t,r)=>e(r).update(Ji(t)).digest(),r=e(new Uint8Array(32));return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}((e=>new da(e)));const pa=function(e,t){const{allowShortKeys:r,extendNonceFn:n,counterLength:o,counterRight:s,rounds:i}=function(e,t){if(null==t||"object"!=typeof t)throw new Error("options must be defined");return Object.assign(e,t)}({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t);if("function"!=typeof e)throw new Error("core must be a function");return qi(o),qi(i),Vi(s),Vi(r),(t,a,c,l,u=0)=>{Hi(t),Hi(a),Hi(c);const d=c.length;if(void 0===l&&(l=new Uint8Array(d)),Hi(l),qi(u),u<0||u>=ca)throw new Error("arx: counter overflow");if(l.length<d)throw new Error(`arx: output (${l.length}) is shorter than data (${d})`);const h=[];let p,f,g=t.length;if(32===g)h.push(p=ea(t)),f=sa;
708else{if(16!==g||!r)throw new Error(`arx: invalid 32-byte key, got length=${g}`);p=new Uint8Array(32),p.set(t),p.set(t,16),f=oa,h.push(p)}aa(a)||h.push(a=ea(a));const m=$i(p);if(n){if(24!==a.length)throw new Error("arx: extended nonce must be 24 bytes");n(f,m,$i(a.subarray(0,16)),m),a=a.subarray(16)}const y=16-o;if(y!==a.length)throw new Error(`arx: nonce must be ${y} or 16 bytes`);if(12!==y){const e=new Uint8Array(12);e.set(a,s?0:12-a.length),a=e,h.push(a)}const b=$i(a);return function(e,t,r,n,o,s,i,a){const c=o.length,l=new Uint8Array(64),u=$i(l),d=aa(o)&&aa(s),h=d?$i(o):la,p=d?$i(s):la;for(let f=0;f<c;i++){if(e(t,r,n,u,i,a),i>=ca)throw new Error("arx: counter overflow");const g=Math.min(64,c-f);if(d&&64===g){const e=f/4;if(f%4!=0)throw new Error("arx: invalid block position");for(let t,r=0;r<16;r++)t=e+r,p[t]=h[t]^u[r];f+=64}else{for(let e,t=0;t<g;t++)e=f+t,s[e]=o[e]^l[t];f+=g}}}(e,f,m,b,c,l,u,i),Gi(...h),l}}((function(e,t,r,n,o,s=20){let i=e[0],a=e[1],c=e[2],l=e[3],u=t[0],d=t[1],h=t[2],p=t[3],f=t[4],g=t[5],m=t[6],y=t[7],b=o,w=r[0],v=r[1],A=r[2],T=i,P=a,E=c,C=l,k=u,_=d,I=h,S=p,x=f,B=g,O=m,M=y,W=b,j=w,R=v,N=A;for(let e=0;e<s;e+=2)T=T+k|0,W=ia(W^T,16),x=x+W|0,k=ia(k^x,12),T=T+k|0,W=ia(W^T,8),x=x+W|0,k=ia(k^x,7),P=P+_|0,j=ia(j^P,16),B=B+j|0,_=ia(_^B,12),P=P+_|0,j=ia(j^P,8),B=B+j|0,_=ia(_^B,7),E=E+I|0,R=ia(R^E,16),O=O+R|0,I=ia(I^O,12),E=E+I|0,R=ia(R^E,8),O=O+R|0,I=ia(I^O,7),C=C+S|0,N=ia(N^C,16),M=M+N|0,S=ia(S^M,12),C=C+S|0,N=ia(N^C,8),M=M+N|0,S=ia(S^M,7),T=T+_|0,N=ia(N^T,16),O=O+N|0,_=ia(_^O,12),T=T+_|0,N=ia(N^T,8),O=O+N|0,_=ia(_^O,7),P=P+I|0,W=ia(W^P,16),M=M+W|0,I=ia(I^M,12),P=P+I|0,W=ia(W^P,8),M=M+W|0,I=ia(I^M,7),E=E+S|0,j=ia(j^E,16),x=x+j|0,S=ia(S^x,12),E=E+S|0,j=ia(j^E,8),x=x+j|0,S=ia(S^x,7),C=C+k|0,R=ia(R^C,16),B=B+R|0,k=ia(k^B,12),C=C+k|0,R=ia(R^C,8),B=B+R|0,k=ia(k^B,7);let U=0;n[U++]=i+T|0,n[U++]=a+P|0,n[U++]=c+E|0,n[U++]=l+C|0,n[U++]=u+k|0,n[U++]=d+_|0,n[U++]=h+I|0,n[U++]=p+S|0,n[U++]=f+x|0,n[U++]=g+B|0,n[U++]=m+O|0,n[U++]=y+M|0,n[U++]=b+W|0,n[U++]=w+j|0,n[U++]=v+R|0,n[U++]=A+N|0}),{counterRight:!1,counterLength:4,allowShortKeys:!1}),fa=new Uint8Array(16),ga=(e,t)=>{e.update(t);const r=t.length%16;r&&e.update(fa.subarray(r))},ma=new Uint8Array(32);function ya(e,t,r,n,o){const s=e(t,r,ma),i=ha.create(s);o&&ga(i,o),ga(i,n);const a=Xi(n.length,o?o.length:0,!0);i.update(a);const c=i.digest();return Gi(s,a),c}const ba=((e,t)=>{function r(r,...n){if(Hi(r),!Yi)throw new Error("Non little-endian hardware is not yet supported");if(void 0!==e.nonceLength){const t=n[0];if(!t)throw new Error("nonce / iv required");e.varSizeNonce?Hi(t):Hi(t,e.nonceLength)}const o=e.tagLength;o&&void 0!==n[1]&&Hi(n[1]);const s=t(r,...n),i=(e,t)=>{if(void 0!==t){if(2!==e)throw new Error("cipher output not supported");Hi(t)}};let a=!1;return{encrypt(e,t){if(a)throw new Error("cannot encrypt() twice with same key + nonce");return a=!0,Hi(e),i(s.encrypt.length,t),s.encrypt(e,t)},decrypt(e,t){if(Hi(e),o&&e.length<o)throw new Error("invalid ciphertext length: smaller than tagLength="+o);return i(s.decrypt.length,t),s.decrypt(e,t)}}}return Object.assign(r,e),r})({blockSize:64,nonceLength:12,tagLength:16},(wa=pa,(e,t,r)=>({encrypt(n,o){const s=n.length;(o=Qi(s+16,o,!1)).set(n);const i=o.subarray(0,-16);wa(e,t,i,i,1);const a=ya(wa,e,t,i,r);return o.set(a,s),Gi(a),o},decrypt(n,o){o=Qi(n.length-16,o,!1);const s=n.subarray(0,-16),i=n.subarray(-16),a=ya(wa,e,t,s,r);if(!function(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r}(i,a))throw new Error("invalid tag");return o.set(n.subarray(0,-16)),wa(e,t,o,o,1),Gi(a),o}})));var wa;class va extends ds{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,Lo(e);const r=ls(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const n=this.blockLen,o=new Uint8Array(n);o.set(r.length>n?e.create().update(r).digest():r);for(let e=0;e<o.length;e++)o[e]^=54;this.iHash.update(o),this.oHash=e.create();for(let e=0;e<o.length;e++)o[e]^=106;this.oHash.update(o),qo(o)}update(e){return Fo(this),this.iHash.update(e),this}digestInto(e){Fo(this),Do(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:n,destroyed:o,blockLen:s,outputLen:i}=this;return e.finished=n,e.destroyed=o,e.blockLen=s,e.outputLen=i,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Aa=(e,t,r)=>new va(e,t).update(r).digest();Aa.create=(e,t)=>
708new va(e,t);const Ta=Uint8Array.from([0]),Pa=Uint8Array.of();const Ea=(e,t,r,n,o)=>function(e,t,r,n=32){Lo(e),Uo(n);const o=e.outputLen;if(n>255*o)throw new Error("Length should be <= 255*HashLen");const s=Math.ceil(n/o);void 0===r&&(r=Pa);const i=new Uint8Array(s*o),a=Aa.create(e,t),c=a._cloneInto(),l=new Uint8Array(a.outputLen);for(let e=0;e<s;e++)Ta[0]=e+1,c.update(0===e?Pa:l).update(r).update(Ta).digestInto(l),i.set(l,o*e),a._cloneInto(c);return a.destroy(),c.destroy(),qo(l,Ta),i.slice(0,n)}(e,function(e,t,r){return Lo(e),void 0===r&&(r=new Uint8Array(e.outputLen)),Aa(e,ls(r),ls(t))}(e,t,r),n,o),Ca=Gs,ka=BigInt(0),_a=BigInt(1);function Ia(e,t=""){if("boolean"!=typeof e){throw new Error((t&&`"${t}"`)+"expected boolean, got type="+typeof e)}return e}function Sa(e,t,r=""){const n=No(e),o=e?.length,s=void 0!==t;if(!n||s&&o!==t){throw new Error((r&&`"${r}" `)+"expected Uint8Array"+(s?` of length ${t}`:"")+", got "+(n?`length=${o}`:"type="+typeof e))}return e}function xa(e){const t=e.toString(16);return 1&t.length?"0"+t:t}function Ba(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);
708return""===e?ka:BigInt("0x"+e)}function Oa(e){return Ba(Xo(e))}function Ma(e){return Do(e),Ba(Xo(Uint8Array.from(e).reverse()))}function Wa(e,t){return as(e.toString(16).padStart(2*t,"0"))}function ja(e,t){return Wa(e,t).reverse()}function Ra(e,t,r){let n;if("string"==typeof t)try{n=as(t)}catch(t){throw new Error(e+" must be hex string or Uint8Array, cause: "+t)}else{if(!No(t))throw new Error(e+" must be hex string or Uint8Array");n=Uint8Array.from(t)}const o=n.length;if("number"==typeof r&&o!==r)throw new Error(e+" of length "+r+" expected, got "+o);return n}const Na=e=>"bigint"==typeof e&&ka<=e;function Ua(e,t,r,n){if(!function(e,t,r){return Na(e)&&Na(t)&&Na(r)&&t<=e&&e<r}(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function Da(e){let t;for(t=0;e>ka;e>>=_a,t+=1);return t}const La=e=>(_a<<BigInt(e))-_a;function Fa(e,t,r={}){if(!e||"object"!=typeof e)throw new Error("expected valid options object");function n(t,r,n){const o=e[t];if(n&&void 0===o)return;const s=typeof o;if(s!==r||null===o)throw new Error(`param "${t}" is invalid: expected ${r}, got ${s}`)}Object.entries(t).forEach((([e,t])=>n(e,t,!1))),Object.entries(r).forEach((([e,t])=>n(e,t,!0)))}function za(e){const t=new WeakMap;return(r,...n)=>{const o=t.get(r);if(void 0!==o)return o;const s=e(r,...n);return t.set(r,s),s}}const Va=BigInt(0),qa=BigInt(1),Ha=BigInt(2),Ka=BigInt(3),$a=BigInt(4),Ga=BigInt(5),Ya=BigInt(7),Ja=BigInt(8),Qa=BigInt(9),Za=BigInt(16);function Xa(e,t){const r=e%t;return r>=Va?r:t+r}function ec(e,t,r){let n=e;for(;t-- >Va;)n*=n,n%=r;return n}function tc(e,t){if(e===Va)throw new Error("invert: expected non-zero number");if(t<=Va)throw new Error("invert: expected positive modulus, got "+t);let r=Xa(e,t),n=t,o=Va,s=qa;for(;r!==Va;){const e=n%r,t=o-s*(n/r);n=r,r=e,o=s,s=t}if(n!==qa)throw new Error("invert: does not exist");return Xa(o,t)}function rc(e,t,r){if(!e.eql(e.sqr(t),r))throw new Error("Cannot find square root")}function nc(e,t){const r=(e.ORDER+qa)/$a,n=e.pow(t,r);return rc(e,n,t),n}function oc(e,t){const r=(e.ORDER-Ga)/Ja,n=e.mul(t,Ha),o=e.pow(n,r),s=e.mul(t,o),i=e.mul(e.mul(s,Ha),o),a=e.mul(s,e.sub(i,e.ONE));return rc(e,a,t),a}function sc(e){if(e<Ka)throw new Error("sqrt is not defined for small field");let t=e-qa,r=0;for(;t%Ha===Va;)t/=Ha,r++;let n=Ha;const o=dc(e);for(;1===lc(o,n);)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(1===r)return nc;let s=o.pow(n,t);const i=(t+qa)/Ha;return function(e,n){if(e.is0(n))return n;if(1!==lc(e,n))throw new Error("Cannot find square root");let o=r,a=e.mul(e.ONE,s),c=e.pow(n,t),l=e.pow(n,i);for(;!e.eql(c,e.ONE);){if(e.is0(c))return e.ZERO;let t=1,r=e.sqr(c);for(;!e.eql(r,e.ONE);)if(t++,r=e.sqr(r),t===o)throw new Error("Cannot find square root");const n=qa<<BigInt(o-t-1),s=e.pow(a,n);o=t,a=e.sqr(s),c=e.mul(c,a),l=e.mul(l,s)}return l}}function ic(e){return e%$a===Ka?nc:e%Ja===Ga?oc:e%Za===Qa?function(e){const t=dc(e),r=sc(e),n=r(t,t.neg(t.ONE)),o=r(t,n),s=r(t,t.neg(n)),i=(e+Ya)/Za;return(e,t)=>{let r=e.pow(t,i),a=e.mul(r,n);const c=e.mul(r,o),l=e.mul(r,s),u=e.eql(e.sqr(a),t),d=e.eql(e.sqr(c),t);r=e.cmov(r,a,u),a=e.cmov(l,c,d);const h=e.eql(e.sqr(a),t),p=e.cmov(r,a,h);return rc(e,p,t),p}}(e):sc(e)}const ac=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function cc(e,t,r=!1){const n=new Array(t.length).fill(r?e.ZERO:void 0),o=t.reduce(((t,r,o)=>e.is0(r)?t:(n[o]=t,e.mul(t,r))),e.ONE),s=e.inv(o);return t.reduceRight(((t,r,o)=>e.is0(r)?t:(n[o]=e.mul(t,n[o]),e.mul(t,r))),s),n}function lc(e,t){const r=(e.ORDER-qa)/Ha,n=e.pow(t,r),o=e.eql(n,e.ONE),s=e.eql(n,e.ZERO),i=e.eql(n,e.neg(e.ONE));if(!o&&!s&&!i)throw new Error("invalid Legendre symbol result");return o?1:s?0:-1}function uc(e,t){void 0!==t&&Uo(t);const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function dc(e,t,r=!1,n={}){if(e<=Va)throw new Error("invalid field: expected ORDER > 0, got "+e);let o,s,i,a=!1;if("object"==typeof t&&null!=t){if(n.sqrt||r)throw new Error("cannot specify opts in two arguments");const e=t;e.BITS&&(o=e.BITS),e.sqrt&&(s=e.sqrt),"boolean"==typeof e.isLE&&(r=e.isLE),"boolean"==typeof e.modFromBytes&&(a=e.modFromBytes),i=e.allowedLengths}else"number"==typeof t&&(o=t),n.sqrt&&(s=n.sqrt);const{nBitLength:c,nByteLength:l}=uc(e,o);if(l>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let u;const d=Object.freeze({ORDER:e,isLE:r,BITS:c,BYTES:l,MASK:La(c),ZERO:Va,ONE:qa,allowedLengths:i,create:t=>Xa(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("invalid field element: expected bigint, got "+typeof t);return Va<=t&&t<e},is0:e=>e===Va,isValidNot0:e=>!d.is0(e)&&d.isValid(e),isOdd:e=>(e&qa)===qa,neg:t=>Xa(-t,e),eql:(e,t)=>
708e===t,sqr:t=>Xa(t*t,e),add:(t,r)=>Xa(t+r,e),sub:(t,r)=>Xa(t-r,e),mul:(t,r)=>Xa(t*r,e),pow:(e,t)=>function(e,t,r){if(r<Va)throw new Error("invalid exponent, negatives unsupported");if(r===Va)return e.ONE;if(r===qa)return t;let n=e.ONE,o=t;for(;r>Va;)r&qa&&(n=e.mul(n,o)),o=e.sqr(o),r>>=qa;return n}(d,e,t),div:(t,r)=>Xa(t*tc(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>tc(t,e),sqrt:s||(t=>(u||(u=ic(e)),u(d,t))),toBytes:e=>r?ja(e,l):Wa(e,l),fromBytes:(t,n=!0)=>{if(i){if(!i.includes(t.length)||t.length>l)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+t.length);const e=new Uint8Array(l);e.set(t,r?0:e.length-t.length),t=e}if(t.length!==l)throw new Error("Field.fromBytes: expected "+l+" bytes, got "+t.length);let o=r?Ma(t):Oa(t);if(a&&(o=Xa(o,e)),!n&&!d.isValid(o))throw new Error("invalid field element: outside of range 0..ORDER");return o},invertBatch:e=>cc(d,e),cmov:(e,t,r)=>r?t:e});return Object.freeze(d)}function hc(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function pc(e){const t=hc(e);return t+Math.ceil(t/2)}const fc=BigInt(0),gc=BigInt(1);function mc(e,t){const r=t.negate();return e?r:t}function yc(e,t){const r=cc(e.Fp,t.map((e=>e.Z)));return t.map(((t,n)=>e.fromAffine(t.toAffine(r[n]))))}function bc(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function wc(e,t){bc(e,t);const r=2**e;return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1),mask:La(e),maxNumber:r,shiftBy:BigInt(e)}}function vc(e,t,r){const{windowSize:n,mask:o,maxNumber:s,shiftBy:i}=r;let a=Number(e&o),c=e>>i;a>n&&(a-=s,c+=gc);const l=t*n;return{nextN:c,offset:l+Math.abs(a)-1,isZero:0===a,isNeg:a<0,isNegF:t%2!=0,offsetF:l}}const Ac=new WeakMap,Tc=new WeakMap;function Pc(e){return Tc.get(e)||1}function Ec(e){if(e!==fc)throw new Error("invalid wNAF")}class Cc{constructor(e,t){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=t}_unsafeLadder(e,t,r=this.ZERO){let n=e;for(;t>fc;)t&gc&&(r=r.add(n)),n=n.double(),t>>=gc;return r}precomputeWindow(e,t){const{windows:r,windowSize:n}=wc(t,this.bits),o=[];let s=e,i=s;for(let e=0;e<r;e++){i=s,o.push(i);for(let e=1;e<n;e++)i=i.add(s),o.push(i);s=i.double()}return o}wNAF(e,t,r){if(!this.Fn.isValid(r))throw new Error("invalid scalar");let n=this.ZERO,o=this.BASE;const s=wc(e,this.bits);for(let e=0;e<s.windows;e++){const{nextN:i,offset:a,isZero:c,isNeg:l,isNegF:u,offsetF:d}=vc(r,e,s);r=i,c?o=o.add(mc(u,t[d])):n=n.add(mc(l,t[a]))}return Ec(r),{p:n,f:o}}wNAFUnsafe(e,t,r,n=this.ZERO){const o=wc(e,this.bits);for(let e=0;e<o.windows&&r!==fc;e++){const{nextN:s,offset:i,isZero:a,isNeg:c}=vc(r,e,o);if(r=s,!a){const e=t[i];n=n.add(c?e.negate():e)}}return Ec(r),n}getPrecomputes(e,t,r){let n=Ac.get(t);return n||(n=this.precomputeWindow(t,e),1!==e&&("function"==typeof r&&(n=r(n)),Ac.set(t,n))),n}cached(e,t,r){const n=Pc(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)}unsafe(e,t,r,n){const o=Pc(e);return 1===o?this._unsafeLadder(e,t,n):this.wNAFUnsafe(o,this.getPrecomputes(o,e,r),t,n)}createCache(e,t){bc(t,this.bits),Tc.set(e,t),Ac.delete(e)}hasCache(e){return 1!==Pc(e)}}function kc(e,t,r,n){(function(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach(((e,r)=>{if(!(e instanceof t))throw new Error("invalid point at index "+r)}))})(r,e),function(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach(((e,r)=>{if(!t.isValid(e))throw new Error("invalid scalar at index "+r)}))}(n,t);const o=r.length,s=n.length;if(o!==s)throw new Error("arrays of points and scalars must have equal length");const i=e.ZERO,a=Da(BigInt(o));let c=1;a>12?c=a-3:a>4?c=a-2:a>0&&(c=2);const l=La(c),u=new Array(Number(l)+1).fill(i);let d=i;for(let e=Math.floor((t.BITS-1)/c)*c;e>=0;e-=c){u.fill(i);for(let t=0;t<s;t++){const o=n[t],s=Number(o>>BigInt(e)&l);u[s]=u[s].add(r[t])}let t=i;for(let e=u.length-1,r=i;e>0;e--)r=r.add(u[e]),t=t.add(r);if(d=d.add(t),0!==e)for(let e=0;e<c;e++)d=d.double()}return d}function _c(e,t,r){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return function(e){const t=ac.reduce(((e,t)=>(e[t]="function",e)),{ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"});Fa(e,t)}(t),t}return dc(e,{isLE:r})}BigInt(0),BigInt(1),BigInt(2),BigInt(8),cs("HashToScalar-");const Ic=BigInt(0),Sc=BigInt(1),xc=BigInt(2);
708function Bc(e){const t=function(e){return Fa(e,{adjustScalarBytes:"function",powPminus2:"function"}),Object.freeze({...e})}(e),{P:r,type:n,adjustScalarBytes:o,powPminus2:s,randomBytes:i}=t,a="x25519"===n;if(!a&&"x448"!==n)throw new Error("invalid type");const c=i||ps,l=a?255:448,u=a?32:56,d=BigInt(a?9:5),h=BigInt(a?121665:39081),p=a?xc**BigInt(254):xc**BigInt(447),f=a?BigInt(8)*xc**BigInt(251)-Sc:BigInt(4)*xc**BigInt(445)-Sc,g=p+f+Sc,m=e=>Xa(e,r),y=b(d);function b(e){return ja(m(e),u)}function w(e,t){const n=function(e,t){Ua("u",e,Ic,r),Ua("scalar",t,p,g);const n=t,o=e;let i=Sc,a=Ic,c=e,u=Sc,d=Ic;for(let e=BigInt(l-1);e>=Ic;e--){const t=n>>e⪼d^=t,({x_2:i,x_3:c}=A(d,i,c)),({x_2:a,x_3:u}=A(d,a,u)),d=t;const r=i+a,s=m(r*r),l=i-a,p=m(l*l),f=s-p,g=c+u,y=m((c-u)*r),b=m(g*l),w=y+b,v=y-b;c=m(w*w),u=m(o*m(v*v)),i=m(s*p),a=m(f*(s+m(h*f)))}({x_2:i,x_3:c}=A(d,i,c)),({x_2:a,x_3:u}=A(d,a,u));const f=s(a);return m(i*f)}(function(e){const t=Ra("u coordinate",e,u);return a&&(t[31]&=127),m(Ma(t))}(t),function(e){return Ma(o(Ra("scalar",e,u)))}(e));if(n===Ic)throw new Error("invalid private or public key received");return b(n)}function v(e){return w(e,y)}function A(e,t,r){const n=m(e*(t-r));return{x_2:t=m(t-n),x_3:r=m(r+n)}}const T={secretKey:u,publicKey:u,seed:u},P=(e=c(u))=>(Do(e,T.seed),e);return{keygen:function(e){const t=P(e);return{secretKey:t,publicKey:v(t)}},getSharedSecret:(e,t)=>w(e,t),getPublicKey:e=>v(e),scalarMult:w,scalarMultBase:v,utils:{randomSecretKey:P,randomPrivateKey:P},GuBytes:y.slice(),lengths:T}}const Oc=BigInt(1),Mc=BigInt(2),Wc=BigInt(3),jc=BigInt(5),Rc=BigInt(8),Nc=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed");function Uc(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}const Dc=dc({p:Nc,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:Rc,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")}.p,{isLE:!0}),Lc=(()=>{const e=Dc.ORDER;return Bc({P:e,type:"x25519",powPminus2:t=>{const{pow_p_5_8:r,b2:n}=function(e){const t=BigInt(10),r=BigInt(20),n=BigInt(40),o=BigInt(80),s=Nc,i=e*e%s*e%s,a=ec(i,Mc,s)*i%s,c=ec(a,Oc,s)*e%s,l=ec(c,jc,s)*c%s,u=ec(l,t,s)*l%s,d=ec(u,r,s)*u%s,h=ec(d,n,s)*d%s,p=ec(h,o,s)*h%s,f=ec(p,o,s)*h%s,g=ec(f,t,s)*l%s;return{pow_p_5_8:ec(g,Mc,s)*e%s,b2:i}}(t);return Xa(ec(r,Wc,e)*n,e)},adjustScalarBytes:Uc})})(),Fc=(e,t)=>(e+(e>=0?t:-t)/Gc)/t;function zc(e){if(!["compact","recovered","der"].includes(e))throw new Error('Signature format must be "compact", "recovered", or "der"');return e}function Vc(e,t){const r={};for(let n of Object.keys(t))r[n]=void 0===e[n]?t[n]:e[n];return Ia(r.lowS,"lowS"),Ia(r.prehash,"prehash"),void 0!==r.format&&zc(r.format),r}class qc extends Error{constructor(e=""){super(e)}}
708const Hc={Err:qc,_tlv:{encode:(e,t)=>{const{Err:r}=Hc;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(1&t.length)throw new r("tlv.encode: unpadded data");const n=t.length/2,o=xa(n);if(o.length/2&128)throw new r("tlv.encode: long form length too big");const s=n>127?xa(o.length/2|128):"";return xa(e)+s+o+t},decode(e,t){const{Err:r}=Hc;let n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");const o=t[n++];let s=0;if(!!(128&o)){const e=127&o;if(!e)throw new r("tlv.decode(long): indefinite length not supported");if(e>4)throw new r("tlv.decode(long): byte length is too big");const i=t.subarray(n,n+e);if(i.length!==e)throw new r("tlv.decode: length bytes not complete");if(0===i[0])throw new r("tlv.decode(long): zero leftmost byte");for(const e of i)s=s<<8|e;if(n+=e,s<128)throw new r("tlv.decode(long): not minimal encoding")}else s=o;const i=t.subarray(n,n+s);if(i.length!==s)throw new r("tlv.decode: wrong value length");return{v:i,l:t.subarray(n+s)}}},_int:{encode(e){const{Err:t}=Hc;if(e<Kc)throw new t("integer: negative integers are not allowed");let r=xa(e);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){const{Err:t}=Hc;if(128&e[0])throw new t("invalid signature integer: negative");if(0===e[0]&&!(128&e[1]))throw new t("invalid signature integer: unnecessary leading zero");return Oa(e)}},toSig(e){const{Err:t,_int:r,_tlv:n}=Hc,o=Ra("signature",e),{v:s,l:i}=n.decode(48,o);if(i.length)throw new t("invalid signature: left bytes after parsing");const{v:a,l:c}=n.decode(2,s),{v:l,l:u}=n.decode(2,c);if(u.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(l)}},hexFromSig(e){const{_tlv:t,_int:r}=Hc,n=t.encode(2,r.encode(e.r))+t.encode(2,r.encode(e.s));return t.encode(48,n)}},Kc=BigInt(0),$c=BigInt(1),Gc=BigInt(2),Yc=BigInt(3),Jc=BigInt(4);function Qc(e,t){const{BYTES:r}=e;let n;if("bigint"==typeof t)n=t;else{let o=Ra("private key",t);try{n=e.fromBytes(o)}catch{throw new Error(`invalid private key: expected ui8a of size ${r}, got ${typeof t}`)}}if(!e.isValidNot0(n))throw new Error("invalid private key: out of range [1..N-1]");return n}function Zc(e,t={}){const r=function(e,t,r={},n){if(void 0===n&&(n="edwards"===e),!t||"object"!=typeof t)throw new Error(`expected valid ${e} CURVE object`);for(const e of["p","n","h"]){const r=t[e];if(!("bigint"==typeof r&&r>fc))throw new Error(`CURVE.${e} must be positive bigint`)}const o=_c(t.p,r.Fp,n),s=_c(t.n,r.Fn,n),i=["Gx","Gy","a","weierstrass"===e?"b":"d"];for(const e of i)if(!o.isValid(t[e]))throw new Error(`CURVE.${e} must be valid field element of CURVE.Fp`);return{CURVE:t=Object.freeze(Object.assign({},t)),Fp:o,Fn:s}}("weierstrass",e,t),{Fp:n,Fn:o}=r;let s=r.CURVE;const{h:i,n:a}=s;Fa(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:c}=t;if(c&&(!n.is0(s.a)||"bigint"!=typeof c.beta||!Array.isArray(c.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const l=el(n,o);function u(){if(!n.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}const d=t.toBytes||function(e,t,r){const{x:o,y:s}=t.toAffine(),i=n.toBytes(o);if(Ia(r,"isCompressed"),r){u();return us(Xc(!n.isOdd(s)),i)}return us(Uint8Array.of(4),i,n.toBytes(s))},h=t.fromBytes||function(e){Sa(e,void 0,"Point");const{publicKey:t,publicKeyUncompressed:r}=l,o=e.length,s=e[0],i=e.subarray(1);if(o!==t||2!==s&&3!==s){if(o===r&&4===s){const e=n.BYTES,t=n.fromBytes(i.subarray(0,e)),r=n.fromBytes(i.subarray(e,2*e));if(!f(t,r))throw new Error("bad point: is not on curve");return{x:t,y:r}}throw new Error(`bad point: got length ${o}, expected compressed=${t} or uncompressed=${r}`)}{const e=n.fromBytes(i);if(!n.isValid(e))throw new Error("bad point: is not on curve, wrong x");const t=p(e);let r;try{r=n.sqrt(t)}catch(e){const t=e instanceof Error?": "+e.message:"";throw new Error("bad point: is not on curve, sqrt error"+t)}u();return!(1&~s)!==n.isOdd(r)&&(r=n.neg(r)),{x:e,y:r}}};function p(e){const t=n.sqr(e),r=n.mul(t,e);return n.add(n.add(r,n.mul(e,s.a)),s.b)}function f(e,t){const r=n.sqr(t),o=p(e);return n.eql(r,o)}if(!f(s.Gx,s.Gy))throw new Error("bad curve params: generator point");const g=n.mul(n.pow(s.a,Yc),Jc),m=n.mul(n.sqr(s.b),BigInt(27));if(n.is0(n.add(g,m)))throw new Error("bad curve params: a or b");function y(e,t,r=!1){if(!n.isValid(t)||r&&n.is0(t))throw new Error(`bad point coordinate ${e}`);return t}function b(e){if(!(e instanceof P))throw new Error("ProjectivePoint expected")}function w(e){if(!c||!c.basises)throw new Error("no endo");return function(e,t,r){const[[n,o],[s,i]]=t,a=Fc(i*e,r),c=Fc(-o*e,r);let l=e-a*n-c*s,u=-a*o-c*i;const d=l<Kc,h=u<Kc;d&&(l=-l),h&&(u=-u);const p=La(Math.ceil(Da(r)/2))+$c;if(l<Kc||l>=p||u<Kc||u>=p)throw new Error("splitScalar (endomorphism): failed, k="+e);return{k1neg:d,k1:l,k2neg:h,k2:u}}(e,c.basises,o.ORDER)}const v=za(((e,t)=>{const{X:r,Y:o,Z:s}=e;if(n.eql(s,n.ONE))return{x:r,y:o};const i=e.is0();null==t&&(t=i?n.ONE:n.inv(s));const a=n.mul(r,t),c=n.mul(o,t),l=n.mul(s,t);if(i)return{x:n.ZERO,y:n.ZERO};
vendor: 4,172 bytes, line 708
708if(!n.eql(l,n.ONE))throw new Error("invZ was invalid");return{x:a,y:c}})),A=za((e=>{if(e.is0()){if(t.allowInfinityPoint&&!n.is0(e.Y))return;throw new Error("bad point: ZERO")}const{x:r,y:o}=e.toAffine();if(!n.isValid(r)||!n.isValid(o))throw new Error("bad point: x or y not field elements");if(!f(r,o))throw new Error("bad point: equation left != right");if(!e.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0}));function T(e,t,r,o,s){return r=new P(n.mul(r.X,e),r.Y,r.Z),t=mc(o,t),r=mc(s,r),t.add(r)}class P{constructor(e,t,r){this.X=y("x",e),this.Y=y("y",t,!0),this.Z=y("z",r),Object.freeze(this)}static CURVE(){return s}static fromAffine(e){const{x:t,y:r}=e||{};if(!e||!n.isValid(t)||!n.isValid(r))throw new Error("invalid affine point");if(e instanceof P)throw new Error("projective point not allowed");return n.is0(t)&&n.is0(r)?P.ZERO:new P(t,r,n.ONE)}static fromBytes(e){const t=P.fromAffine(h(Sa(e,void 0,"point")));return t.assertValidity(),t}static fromHex(e){return P.fromBytes(Ra("pointHex",e))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=8,t=!0){return C.createCache(this,e),t||this.multiply(Yc),this}assertValidity(){A(this)}hasEvenY(){const{y:e}=this.toAffine();if(!n.isOdd)throw new Error("Field doesn't support isOdd");return!n.isOdd(e)}equals(e){b(e);const{X:t,Y:r,Z:o}=this,{X:s,Y:i,Z:a}=e,c=n.eql(n.mul(t,a),n.mul(s,o)),l=n.eql(n.mul(r,a),n.mul(i,o));return c&&l}negate(){return new P(this.X,n.neg(this.Y),this.Z)}double(){const{a:e,b:t}=s,r=n.mul(t,Yc),{X:o,Y:i,Z:a}=this;let c=n.ZERO,l=n.ZERO,u=n.ZERO,d=n.mul(o,o),h=n.mul(i,i),p=n.mul(a,a),f=n.mul(o,i);return f=n.add(f,f),u=n.mul(o,a),u=n.add(u,u),c=n.mul(e,u),l=n.mul(r,p),l=n.add(c,l),c=n.sub(h,l),l=n.add(h,l),l=n.mul(c,l),c=n.mul(f,c),u=n.mul(r,u),p=n.mul(e,p),f=n.sub(d,p),f=n.mul(e,f),f=n.add(f,u),u=n.add(d,d),d=n.add(u,d),d=n.add(d,p),d=n.mul(d,f),l=n.add(l,d),p=n.mul(i,a),p=n.add(p,p),d=n.mul(p,f),c=n.sub(c,d),u=n.mul(p,h),u=n.add(u,u),u=n.add(u,u),new P(c,l,u)}add(e){b(e);const{X:t,Y:r,Z:o}=this,{X:i,Y:a,Z:c}=e;let l=n.ZERO,u=n.ZERO,d=n.ZERO;const h=s.a,p=n.mul(s.b,Yc);let f=n.mul(t,i),g=n.mul(r,a),m=n.mul(o,c),y=n.add(t,r),w=n.add(i,a);y=n.mul(y,w),w=n.add(f,g),y=n.sub(y,w),w=n.add(t,o);let v=n.add(i,c);return w=n.mul(w,v),v=n.add(f,m),w=n.sub(w,v),v=n.add(r,o),l=n.add(a,c),v=n.mul(v,l),l=n.add(g,m),v=n.sub(v,l),d=n.mul(h,w),l=n.mul(p,m),d=n.add(l,d),l=n.sub(g,d),d=n.add(g,d),u=n.mul(l,d),g=n.add(f,f),g=n.add(g,f),m=n.mul(h,m),w=n.mul(p,w),g=n.add(g,m),m=n.sub(f,m),m=n.mul(h,m),w=n.add(w,m),f=n.mul(g,w),u=n.add(u,f),f=n.mul(v,w),l=n.mul(y,l),l=n.sub(l,f),f=n.mul(y,g),d=n.mul(v,d),d=n.add(d,f),new P(l,u,d)}subtract(e){return this.add(e.negate())}is0(){return this.equals(P.ZERO)}multiply(e){const{endo:r}=t;if(!o.isValidNot0(e))throw new Error("invalid scalar: out of range");let n,s;const i=e=>C.cached(this,e,(e=>yc(P,e)));if(r){const{k1neg:t,k1:o,k2neg:a,k2:c}=w(e),{p:l,f:u}=i(o),{p:d,f:h}=i(c);s=u.add(h),n=T(r.beta,l,d,t,a)}else{const{p:t,f:r}=i(e);n=t,s=r}return yc(P,[n,s])[0]}multiplyUnsafe(e){const{endo:r}=t,n=this;if(!o.isValid(e))throw new Error("invalid scalar: out of range");if(e===Kc||n.is0())return P.ZERO;if(e===$c)return n;if(C.hasCache(this))return this.multiply(e);if(r){const{k1neg:t,k1:o,k2neg:s,k2:i}=w(e),{p1:a,p2:c}=function(e,t,r,n){let o=t,s=e.ZERO,i=e.ZERO;for(;r>fc||n>fc;)r&gc&&(s=s.add(o)),n&gc&&(i=i.add(o)),o=o.double(),r>>=gc,n>>=gc;return{p1:s,p2:i}}(P,n,o,i);return T(r.beta,a,c,t,s)}return C.unsafe(n,e)}multiplyAndAddUnsafe(e,t,r){const n=this.multiplyUnsafe(t).add(e.multiplyUnsafe(r));return n.is0()?void 0:n}toAffine(e){return v(this,e)}isTorsionFree(){const{isTorsionFree:e}=t;return i===$c||(e?e(P,this):C.unsafe(this,a).is0())}clearCofactor(){const{clearCofactor:e}=t;return i===$c?this:e?e(P,this):this.multiplyUnsafe(i)}isSmallOrder(){return this.multiplyUnsafe(i).is0()}toBytes(e=!0){return Ia(e,"isCompressed"),this.assertValidity(),d(P,this,e)}toHex(e=!0){return Xo(this.toBytes(e))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(e=!0){return this.toBytes(e)}
708_setWindowSize(e){this.precompute(e)}static normalizeZ(e){return yc(P,e)}static msm(e,t){return kc(P,o,e,t)}static fromPrivateKey(e){return P.BASE.multiply(Qc(o,e))}}P.BASE=new P(s.Gx,s.Gy,n.ONE),P.ZERO=new P(n.ZERO,n.ONE,n.ZERO),P.Fp=n,P.Fn=o;const E=o.BITS,C=new Cc(P,t.endo?Math.ceil(E/2):E);return P.BASE.precompute(8),P}function Xc(e){return Uint8Array.of(e?2:3)}function el(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function tl(e,t={}){const{Fn:r}=e,n=t.randomBytes||ps,o=Object.assign(el(e.Fp,r),{seed:pc(r.ORDER)});function s(e){try{return!!Qc(r,e)}catch{return!1}}function i(e=n(o.seed)){return function(e,t,r=!1){const n=e.length,o=hc(t),s=pc(t);if(n<16||n<s||n>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+n);const i=Xa(r?Ma(e):Oa(e),t-qa)+qa;return r?ja(i,o):Wa(i,o)}(Sa(e,o.seed,"seed"),r.ORDER)}function a(t,n=!0){return e.BASE.multiply(Qc(r,t)).toBytes(n)}function c(t){if("bigint"==typeof t)return!1;if(t instanceof e)return!0;const{secretKey:n,publicKey:s,publicKeyUncompressed:i}=o;if(r.allowedLengths||n===s)return;const a=Ra("key",t).length;return a===s||a===i}return Object.freeze({getPublicKey:a,getSharedSecret:function(t,n,o=!0){if(!0===c(t))throw new Error("first arg must be private key");if(!1===c(n))throw new Error("second arg must be public key");const s=Qc(r,t);return e.fromHex(n).multiply(s).toBytes(o)},keygen:function(e){const t=i(e);return{secretKey:t,publicKey:a(t)}},Point:e,utils:{isValidSecretKey:s,isValidPublicKey:function(t,r){const{publicKey:n,publicKeyUncompressed:s}=o;try{const o=t.length;return!(!0===r&&o!==n||!1===r&&o!==s)&&!!e.fromBytes(t)}catch{return!1}},randomSecretKey:i,isValidPrivateKey:s,randomPrivateKey:i,normPrivateKeyToScalar:e=>Qc(r,e),precompute:(t=8,r=e.BASE)=>r.precompute(t,!1)},lengths:o})}function rl(e,t,r={}){Lo(t),Fa(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const n=r.randomBytes||ps,o=r.hmac||((e,...r)=>Aa(t,e,us(...r))),{Fp:s,Fn:i}=e,{ORDER:a,BITS:c}=i,{keygen:l,getPublicKey:u,getSharedSecret:d,utils:h,lengths:p}=tl(e,r),f={prehash:!1,lowS:"boolean"==typeof r.lowS&&r.lowS,format:void 0,extraEntropy:!1},g="compact";function m(e){return e>a>>$c}function y(e,t){if(!i.isValidNot0(t))throw new Error(`invalid signature ${e}: out of range 1..Point.Fn.ORDER`);return t}class b{constructor(e,t,r){this.r=y("r",e),this.s=y("s",t),null!=r&&(this.recovery=r),Object.freeze(this)}static fromBytes(e,t=g){let r;if(function(e,t){zc(t);const r=p.signature;Sa(e,"compact"===t?r:"recovered"===t?r+1:void 0,`${t} signature`)}(e,t),"der"===t){const{r:t,s:r}=Hc.toSig(Sa(e));return new b(t,r)}"recovered"===t&&(r=e[0],t="compact",e=e.subarray(1));const n=i.BYTES,o=e.subarray(0,n),s=e.subarray(n,2*n);return new b(i.fromBytes(o),i.fromBytes(s),r)}static fromHex(e,t){return this.fromBytes(as(e),t)}addRecoveryBit(e){return new b(this.r,this.s,e)}recoverPublicKey(t){const r=s.ORDER,{r:n,s:o,recovery:c}=this;if(null==c||![0,1,2,3].includes(c))throw new Error("recovery id invalid");if(a*Gc<r&&c>1)throw new Error("recovery id is ambiguous for h>1 curve");const l=2===c||3===c?n+a:n;if(!s.isValid(l))throw new Error("recovery id 2 or 3 invalid");const u=s.toBytes(l),d=e.fromBytes(us(Xc(!(1&c)),u)),h=i.inv(l),p=v(Ra("msgHash",t)),f=i.create(-p*h),g=i.create(o*h),m=e.BASE.multiplyUnsafe(f).add(d.multiplyUnsafe(g));if(m.is0())throw new Error("point at infinify");return m.assertValidity(),m}hasHighS(){return m(this.s)}toBytes(e=g){if(zc(e),"der"===e)return as(Hc.hexFromSig(this));const t=i.toBytes(this.r),r=i.toBytes(this.s);if("recovered"===e){if(null==this.recovery)throw new Error("recovery bit must be present");return us(Uint8Array.of(this.recovery),t,r)}return us(t,r)}toHex(e){return Xo(this.toBytes(e))}assertValidity(){}static fromCompact(e){return b.fromBytes(Ra("sig",e),"compact")}static fromDER(e){return b.fromBytes(Ra("sig",e),"der")}normalizeS(){return this.hasHighS()?new b(this.r,i.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return Xo(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return Xo(this.toBytes("compact"))}}const w=r.bits2int||function(e){if(e.length>8192)throw new Error("input is too large");const t=Oa(e),r=8*e.length-c;return r>0?t>>BigInt(r):t},v=r.bits2int_modN||function(e){return i.create(w(e))},A=La(c);function T(e){return Ua("num < 2^"+c,e,Kc,A),i.toBytes(e)}function P(e,r){return Sa(e,void 0,"message"),r?Sa(t(e),void 0,"prehashed message"):e}return Object.freeze({keygen:l,getPublicKey:u,getSharedSecret:d,utils:h,lengths:p,Point:e,sign:function(r,s,a={}){r=Ra("message",r);const{seed:c,k2sig:l}=function(t,r,o){if(["recovered","canonical"].some((e=>e in o)))throw new Error("sign() legacy options not supported");const{lowS:s,prehash:a,extraEntropy:c}=Vc(o,f);t=P(t,a);const l=v(t),u=Qc(i,r),d=[T(u),T(l)];if(null!=c&&!1!==c){const e=!0===c?n(p.secretKey):c;d.push(Ra("extraEntropy",e))}const h=us(...d),g=l;return{seed:h,k2sig:function(t){const r=w(t);
708if(!i.isValidNot0(r))return;const n=i.inv(r),o=e.BASE.multiply(r).toAffine(),a=i.create(o.x);if(a===Kc)return;const c=i.create(n*i.create(g+a*u));if(c===Kc)return;let l=(o.x===a?0:2)|Number(o.y&$c),d=c;return s&&m(c)&&(d=i.neg(c),l^=1),new b(a,d,l)}}}(r,s,a);return function(e,t,r){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof r)throw new Error("hmacFn must be a function");const n=e=>new Uint8Array(e),o=e=>Uint8Array.of(e);let s=n(e),i=n(e),a=0;const c=()=>{s.fill(1),i.fill(0),a=0},l=(...e)=>r(i,s,...e),u=(e=n(0))=>{i=l(o(0),e),s=l(),0!==e.length&&(i=l(o(1),e),s=l())},d=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const r=[];for(;e<t;){s=l();const t=s.slice();r.push(t),e+=s.length}return us(...r)};return(e,t)=>{let r;for(c(),u(e);!(r=t(d()));)u();return c(),r}}(t.outputLen,i.BYTES,o)(c,l)},verify:function(t,r,n,o={}){const{lowS:s,prehash:a,format:c}=Vc(o,f);if(n=Ra("publicKey",n),r=P(Ra("message",r),a),"strict"in o)throw new Error("options.strict was renamed to lowS");const l=void 0===c?function(e){let t;const r="string"==typeof e||No(e),n=!r&&null!==e&&"object"==typeof e&&"bigint"==typeof e.r&&"bigint"==typeof e.s;if(!r&&!n)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(n)t=new b(e.r,e.s);else if(r){try{t=b.fromBytes(Ra("sig",e),"der")}catch(e){if(!(e instanceof Hc.Err))throw e}if(!t)try{t=b.fromBytes(Ra("sig",e),"compact")}catch{return!1}}return t||!1}(t):b.fromBytes(Ra("sig",t),c);if(!1===l)return!1;try{const t=e.fromBytes(n);if(s&&l.hasHighS())return!1;const{r:o,s:a}=l,c=v(r),u=i.inv(a),d=i.create(c*u),h=i.create(o*u),p=e.BASE.multiplyUnsafe(d).add(t.multiplyUnsafe(h));return!p.is0()&&i.create(p.x)===o}catch{return!1}},recoverPublicKey:function(e,t,r={}){const{prehash:n}=Vc(r,f);return t=P(t,n),b.fromBytes(e,"recovered").recoverPublicKey(t).toBytes()},Signature:b,hash:t})}function nl(e){const{CURVE:t,curveOpts:r}=function(e){const t={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},r=e.Fp;let n=e.allowedPrivateKeyLengths?Array.from(new Set(e.allowedPrivateKeyLengths.map((e=>Math.ceil(e/2))))):void 0;return{CURVE:t,curveOpts:{Fp:r,Fn:dc(t.n,{BITS:e.nBitLength,allowedLengths:n,modFromBytes:e.wrapPrivateKey}),allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes}}}(e),n={hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN};return{CURVE:t,curveOpts:r,hash:e.hash,ecdsaOpts:n}}function ol(e){const{CURVE:t,curveOpts:r,hash:n,ecdsaOpts:o}=nl(e);return function(e,t){const r=t.Point;return Object.assign({},t,{ProjectivePoint:r,CURVE:Object.assign({},e,uc(r.Fn.ORDER,r.Fn.BITS))})}(e,rl(Zc(t,r),n,o))}function sl(e,t){const r=t=>ol({...e,hash:t});return{...r(t),create:r}}const il={p:BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff"),n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),h:BigInt(1),a:BigInt("0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc"),b:BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5")},al={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff"),n:BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"),h:BigInt(1),a:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc"),b:BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef"),Gx:BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),Gy:BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f")},cl={p:BigInt("0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),n:BigInt("0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409"),h:BigInt(1),a:BigInt("0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc"),b:BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00"),Gx:BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),Gy:BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650")},ll=dc(il.p),ul=dc(al.p),dl=dc(cl.p),hl=sl({...il,Fp:ll,lowS:!1},Gs);sl({...al,Fp:ul,lowS:!1},Js),sl({...cl,Fp:dl,lowS:!1,allowedPrivateKeyLengths:[130,131,132]},Ys);const pl=hl,fl="base10",gl="base16",ml="base64pad",yl="base64url",bl="utf8";function wl(){const e=ps(32);return(0,Tn.dI)(e,gl)}function vl(e){const t=Ca((0,Tn.sH)(e,gl));return(0,Tn.dI)(t,gl)}function Al(e){const t=Ca((0,Tn.sH)(e,bl));return(0,Tn.dI)(t,gl)}function Tl(e){return(0,Tn.sH)(`${e}`,fl)}function Pl(e){return Number((0,Tn.dI)(e,fl))}function El(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Cl(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-t.length%4)%4;return t+"=".repeat(r)}function kl(e){if(2===Pl(e.type))return(0,Tn.dI)((0,Tn.xW)([e.type,e.sealed]),ml);if(1===Pl(e.type)){if(typeof e.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");
708return(0,Tn.dI)((0,Tn.xW)([e.type,e.senderPublicKey,e.iv,e.sealed]),ml)}return(0,Tn.dI)((0,Tn.xW)([e.type,e.iv,e.sealed]),ml)}function _l(e){const t=(e.encoding||ml)===yl?Cl(e.encoded):e.encoded,r=(0,Tn.sH)(t,ml),n=r.slice(0,1);if(1===Pl(n)){const e=33,t=e+12,o=r.slice(1,e),s=r.slice(e,t);return{type:n,sealed:r.slice(t),iv:s,senderPublicKey:o}}if(2===Pl(n)){return{type:n,sealed:r.slice(1),iv:ps(12)}}const o=r.slice(1,13);return{type:n,sealed:r.slice(13),iv:o}}function Il(e){const t=e?.type||0;if(1===t){if(typeof e?.senderPublicKey>"u")throw new Error("missing sender public key");if(typeof e?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:t,senderPublicKey:e?.senderPublicKey,receiverPublicKey:e?.receiverPublicKey}}function Sl(e){return 1===e.type&&"string"==typeof e.senderPublicKey&&"string"==typeof e.receiverPublicKey}function xl(e){return 2===e.type}function Bl(e,t){const[r,n,o]=e.split("."),s=kn.from(Cl(o),"base64");if(64!==s.length)throw new Error("Invalid signature length");const i=s.slice(0,32),a=s.slice(32,64),c=Ca(`${r}.${n}`),l=function(e){const t=kn.from(e.x,"base64"),r=kn.from(e.y,"base64");return(0,Tn.xW)([new Uint8Array([4]),t,r])}(t);if(!pl.verify((0,Tn.xW)([i,a]),c,l))throw new Error("Invalid signature");return un(e).payload}function Ol(e){return e?.relay||{protocol:"irn"}}function Ml(e){const t=Pn[e];if(typeof t>"u")throw new Error(`Relay Protocol not supported: ${e}`);return t}var Wl=Object.defineProperty,jl=Object.defineProperties,Rl=Object.getOwnPropertyDescriptors,Nl=Object.getOwnPropertySymbols,Ul=Object.prototype.hasOwnProperty,Dl=Object.prototype.propertyIsEnumerable,Ll=(e,t,r)=>t in e?Wl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Fl=(e,t)=>{for(var r in t||(t={}))Ul.call(t,r)&&Ll(e,r,t[r]);if(Nl)for(var r of Nl(t))Dl.call(t,r)&&Ll(e,r,t[r]);return e};function zl(e,t="-"){const r={},n="relay"+t;return Object.keys(e).forEach((t=>{if(t.startsWith(n)){const o=t.replace(n,""),s=e[t];r[o]=s}})),r}function Vl(e){if(!e.includes("wc:")){const t=go(e);null!=t&&t.includes("wc:")&&(e=t)}const t=(e=(e=e.includes("wc://")?e.replace("wc://",""):e).includes("wc:")?e.replace("wc:",""):e).indexOf(":"),r=-1!==e.indexOf("?")?e.indexOf("?"):void 0,n=e.substring(0,t),o=e.substring(t+1,r).split("@"),s=typeof r<"u"?e.substring(r):"",i=new URLSearchParams(s),a=Object.fromEntries(i.entries()),c="string"==typeof a.methods?a.methods.split(","):void 0;return{protocol:n,topic:ql(o[0]),version:parseInt(o[1],10),symKey:a.symKey,relay:zl(a),methods:c,expiryTimestamp:a.expiryTimestamp?parseInt(a.expiryTimestamp,10):void 0}}function ql(e){return e.startsWith("//")?e.substring(2):e}function Hl(e){const t=new URLSearchParams,r=Fl(Fl(((e,t)=>jl(e,Rl(t)))(Fl({},function(e,t="-"){const r={};return Object.keys(e).forEach((n=>{const o=n,s="relay"+t+o;e[o]&&(r[s]=e[o])})),r}(e.relay)),{symKey:e.symKey}),e.expiryTimestamp&&{expiryTimestamp:e.expiryTimestamp.toString()}),e.methods&&{methods:e.methods.join(",")});return Object.entries(r).sort((([e],[t])=>e.localeCompare(t))).forEach((([e,r])=>{void 0!==r&&t.append(e,String(r))})),`${e.protocol}:${e.topic}@${e.version}?${t}`}function Kl(e,t,r){return`${e}?wc_ev=${r}&topic=${t}`}var $l=Object.defineProperty,Gl=Object.defineProperties,Yl=Object.getOwnPropertyDescriptors,Jl=Object.getOwnPropertySymbols,Ql=Object.prototype.hasOwnProperty,Zl=Object.prototype.propertyIsEnumerable,Xl=(e,t,r)=>t in e?$l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,eu=(e,t)=>
708{for(var r in t||(t={}))Ql.call(t,r)&&Xl(e,r,t[r]);if(Jl)for(var r of Jl(t))Zl.call(t,r)&&Xl(e,r,t[r]);return e},tu=(e,t)=>Gl(e,Yl(t));function ru(e){const t=[];return e.forEach((e=>{const[r,n]=e.split(":");t.push(`${r}:${n}`)})),t}function nu(e){const t=[];return Object.values(e).forEach((e=>{t.push(...ru(e.accounts))})),[...new Set(t)]}function ou(e){return e.includes(":")}function su(e){return ou(e)?e.split(":")[0]:e}function iu(e){var t,r,n;const o={};if(!pu(e))return o;for(const[s,i]of Object.entries(e)){const e=ou(s)?[s]:i.chains,a=i.methods||[],c=i.events||[],l=su(s);o[l]=tu(eu({},o[l]),{chains:lo(e,null==(t=o[l])?void 0:t.chains),methods:lo(a,null==(r=o[l])?void 0:r.methods),events:lo(c,null==(n=o[l])?void 0:n.events)})}return o}function au(e,t){t=t.map((e=>e.replace("did:pkh:","")));const r=function(e){const t={};return e?.forEach((e=>{var r;const[n,o]=e.split(":");t[n]||(t[n]={accounts:[],chains:[],events:[],methods:[]}),t[n].accounts.push(e),null==(r=t[n].chains)||r.push(`${n}:${o}`)})),t}(t);for(const[t,n]of Object.entries(r))n.methods?n.methods=lo(n.methods,e):n.methods=e,n.events=["chainChanged","accountsChanged"];return r}const cu={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},lu={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function uu(e,t){const{message:r,code:n}=lu[e];return{message:t?`${r} ${t}`:r,code:n}}function du(e,t){const{message:r,code:n}=cu[e];return{message:t?`${r} ${t}`:r,code:n}}function hu(e,t){return!!Array.isArray(e)&&(!(typeof t<"u"&&e.length)||e.every(t))}function pu(e){return Object.getPrototypeOf(e)===Object.prototype&&Object.keys(e).length}function fu(e){return typeof e>"u"}function gu(e,t){return!(!t||!fu(e))||"string"==typeof e&&!!e.trim().length}function mu(e,t){return!(!t||!fu(e))||"number"==typeof e&&!isNaN(e)}function yu(e){return!(!gu(e,!1)||!e.includes(":"))&&2===e.split(":").length}function bu(e){let t=!0;return hu(e)?e.length&&(t=e.every((e=>gu(e,!1)))):t=!1,t}function wu(e,t,r){let n=null;return Object.entries(e).forEach((([e,o])=>{if(n)return;const s=function(e,t,r){let n=null;return hu(t)&&t.length?t.forEach((e=>{n||yu(e)||(n=du("UNSUPPORTED_CHAINS",`${r}, chain ${e} should be a string and conform to "namespace:chainId" format`))})):yu(e)||(n=du("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:
7085"] }`)),n}(e,Sn(e,o),`${t} ${r}`);s&&(n=s)})),n}function vu(e,t){let r=null;return hu(e)?e.forEach((e=>{r||function(e){if(gu(e,!1)&&e.includes(":")){const t=e.split(":");if(3===t.length){const e=t[0]+":"+t[1];return!!t[2]&&yu(e)}}return!1}(e)||(r=du("UNSUPPORTED_ACCOUNTS",`${t}, account ${e} should be a string and conform to "namespace:chainId:address" format`))})):r=du("UNSUPPORTED_ACCOUNTS",`${t}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function Au(e,t){let r=null;return Object.values(e).forEach((e=>{if(r)return;const n=function(e,t){let r=null;return bu(e?.methods)?bu(e?.events)||(r=du("UNSUPPORTED_EVENTS",`${t}, events should be an array of strings or empty array for no events`)):r=du("UNSUPPORTED_METHODS",`${t}, methods should be an array of strings or empty array for no methods`),r}(e,`${t}, namespace`);n&&(r=n)})),r}function Tu(e,t){let r=null;if(e&&pu(e)){const n=Au(e,t);n&&(r=n);const o=function(e,t){let r=null;return Object.values(e).forEach((e=>{if(r)return;const n=vu(e?.accounts,`${t} namespace`);n&&(r=n)})),r}(e,t);o&&(r=o)}else r=uu("MISSING_OR_INVALID",`${t}, namespaces should be an object with data`);return r}function Pu(e){return gu(e.protocol,!0)}function Eu(e){return typeof e<"u"&&null!==typeof e}function Cu(e,t){return!(!yu(t)||!nu(e).includes(t))}function ku(e,t,r){return!!gu(r,!1)&&function(e,t){const r=[];return Object.values(e).forEach((e=>{ru(e.accounts).includes(t)&&r.push(...e.methods)})),r}(e,t).includes(r)}function _u(e,t,r){return!!gu(r,!1)&&function(e,t){const r=[];return Object.values(e).forEach((e=>{ru(e.accounts).includes(t)&&r.push(...e.events)})),r}(e,t).includes(r)}function Iu(e,t,r){let n=null;const o=function(e){const t={};return Object.keys(e).forEach((r=>{var n;r.includes(":")?t[r]=e[r]:null==(n=e[r].chains)||n.forEach((n=>{t[n]={methods:e[r].methods,events:e[r].events}}))})),t}(e),s=function(e){const t={};return Object.keys(e).forEach((r=>{if(r.includes(":"))t[r]=e[r];else{const n=ru(e[r].accounts);n?.forEach((n=>{t[n]={accounts:e[r].accounts.filter((e=>e.includes(`${n}:`))),methods:e[r].methods,events:e[r].events}}))}})),t}(t),i=Object.keys(o),a=Object.keys(s),c=Su(Object.keys(e)),l=Su(Object.keys(t)),u=c.filter((e=>!l.includes(e)));return u.length&&(n=uu("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.\n Required: ${u.toString()}\n Received: ${Object.keys(t).toString()}`)),Xn(i,a)||(n=uu("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces.\n Required: ${i.toString()}\n Approved: ${a.toString()}`)),Object.keys(t).forEach((e=>{if(!e.includes(":")||n)return;const o=ru(t[e].accounts);o.includes(e)||(n=uu("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${e}\n Required: ${e}\n Approved: ${o.toString()}`))})),i.forEach((e=>{n||(Xn(o[e].methods,s[e].methods)?Xn(o[e].events,s[e].events)||(n=uu("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${e}`)):n=uu("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${e}`))})),n}function Su(e){return[...new Set(e.map((e=>e.includes(":")?e.split(":")[0]:e)))]}function xu(){const e=$n();return new Promise((t=>{switch(e){case Fn:t(Kn()&&navigator?.onLine);break;case Dn:t(async function(){if(Hn()&&typeof r.g<"u"&&null!=r.g&&r.g.NetInfo){const e=await(null==r.g?void 0:r.g.NetInfo.fetch());return e?.isConnected}return!0}());break;default:t(!0)}}))}function Bu(e){switch($n()){case Fn:!function(e){!Hn()&&Kn()&&(window.addEventListener("online",(()=>e(!0))),window.addEventListener("offline",(()=>e(!1))))}(e);break;case Dn:!function(e){Hn()&&typeof r.g<"u"&&null!=r.g&&r.g.NetInfo&&r.g?.NetInfo.addEventListener((t=>e(t?.isConnected)))}(e)}}const Ou={};class Mu{static get(e){return Ou[e]}static set(e,t){Ou[e]=t}static delete(e){delete Ou[e]}}function Wu({publicKey:e,signature:t,payload:r}){var n;const o=ju(r.method),s=128|parseInt((null==(n=r.version)?void 0:n.toString())||"4"),i=function(e){const t=bn.A.decode(e)[0];return 42===t?0:60===t?2:1}(r.address),a="00"===r.era?new Uint8Array([0]):ju(r.era);if(1!==a.length&&2!==a.length)throw new Error("Invalid era length");const c=parseInt(r.nonce,16),l=new Uint8Array([255&c,c>>8&255]),u=BigInt(`0x${function(e){return e.startsWith("0x")?e.slice(2):e}(r.tip)}`),d=function(e){if(e<BigInt(1)<<BigInt(6))return new Uint8Array([Number(e<<BigInt(2))]);if(e<BigInt(1)<<BigInt(14)){const t=e<<BigInt(2)|BigInt(1);return new Uint8Array([Number(t&BigInt(255)),Number(t>>BigInt(8)&BigInt(255))])}if(e<BigInt(1)<<BigInt(30)){const t=e<<BigInt(2)|BigInt(2);return new Uint8Array([Number(t&BigInt(255)),Number(t>>BigInt(8)&BigInt(255)),Number(t>>BigInt(16)&BigInt(255)),Number(t>>BigInt(24)&BigInt(255))])}throw new Error("BigInt compact encoding not supported > 2^30")}(u),h=new Uint8Array([0,...e,i,...t,...a,...l,...d,...o]),p=function(e){if(e<64)return new Uint8Array([e<<2]);if(e<16384){const t=e<<2|1;return new Uint8Array([255&t,t>>8&255])}if(e<1<<30){const t=e<<2|2;return new Uint8Array([255&t,t>>8&255,t>>16&255,t>>24&255])}throw new Error("Compact encoding > 2^30 not supported")}(h.length+1);
708return new Uint8Array([...p,s,...h])}function ju(e){return new Uint8Array(e.replace(/^0x/,"").match(/.{1,2}/g).map((e=>parseInt(e,16))))}function Ru(e){const t=Uint8Array.from(kn.from(e.signature,"hex")),r=function(e){const t=bn.A.decode(e);if(t.length<33)throw new Error("Too short to contain a public key");return t.slice(1,33)}(e.transaction.address),n=Wu({publicKey:r,signature:t,payload:e.transaction});return function(e){const t=ju(e),r=(0,En.blake2b)(t,void 0,32);return"0x"+kn.from(r).toString("hex")}(kn.from(n).toString("hex"))}function Nu({logger:e,name:t}){const r="string"==typeof e?(0,P.D5)({opts:{level:e,name:t}}).logger:e;return r.level="string"==typeof e?e:e.level,r}const Uu="PARSE_ERROR",Du="INVALID_REQUEST",Lu="METHOD_NOT_FOUND",Fu="INVALID_PARAMS",zu="INTERNAL_ERROR",Vu="SERVER_ERROR",qu=[-32700,-32600,-32601,-32602,-32603],Hu={[Uu]:{code:-32700,message:"Parse error"},[Du]:{code:-32600,message:"Invalid Request"},[Lu]:{code:-32601,message:"Method not found"},[Fu]:{code:-32602,message:"Invalid params"},[zu]:{code:-32603,message:"Internal error"},[Vu]:{code:-32e3,message:"Server error"}},Ku=Vu;function $u(e){return qu.includes(e)}function Gu(e){return Object.keys(Hu).includes(e)?Hu[e]:Hu[Ku]}function Yu(e){const t=Object.values(Hu).find((t=>t.code===e));return t||Hu[Ku]}function Ju(e,t,r){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${t}`):e}var Qu=r("./node_modules/@walletconnect/environment/dist/cjs/index.js");
708function Zu(e=3){return Date.now()*Math.pow(10,e)+Math.floor(Math.random()*Math.pow(10,e))}function Xu(e=6){return BigInt(Zu(e))}function ed(e,t,r){return{id:r||Zu(),jsonrpc:"2.0",method:e,params:t}}function td(e,t){return{id:e,jsonrpc:"2.0",result:t}}function rd(e,t,r){return{id:e,jsonrpc:"2.0",error:nd(t,r)}}function nd(e,t){return void 0===e?Gu(zu):("string"==typeof e&&(e=Object.assign(Object.assign({},Gu(Vu)),{message:e})),void 0!==t&&(e.data=t),$u(e.code)&&(e=Yu(e.code)),e)}class od{}class sd extends od{constructor(){super()}}class id extends sd{constructor(e){super()}}function ad(e,t){const r=function(e){const t=e.match(new RegExp(/^\w+:/,"gi"));if(t&&t.length)return t[0]}(e);return void 0!==r&&new RegExp(t).test(r)}function cd(e){return ad(e,"^https?:")}function ld(e){return ad(e,"^wss?:")}function ud(e){return"object"==typeof e&&"id"in e&&"jsonrpc"in e&&"2.0"===e.jsonrpc}function dd(e){return ud(e)&&"method"in e}function hd(e){return ud(e)&&(pd(e)||fd(e))}function pd(e){return"result"in e}function fd(e){return"error"in e}class gd extends id{constructor(e){super(e),this.events=new n.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(ed(e.method,e.params||[],e.id||Xu().toString()),t)}async requestStrict(e,t){return new Promise((async(r,n)=>{if(!this.connection.connected)try{await this.open()}catch(e){n(e)}this.events.on(`${e.id}`,(e=>{fd(e)?n(e.error):r(e.result)}));try{await this.connection.send(e,t)}catch(e){n(e)}}))}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),hd(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&3e3===e.code&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),"string"==typeof e&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",(e=>this.onPayload(e))),this.connection.on("close",(e=>this.onClose(e))),this.connection.on("error",(e=>this.events.emit("error",e))),this.connection.on("register_error",(e=>this.onClose())),this.hasRegisteredEventListeners=!0)}}const md=e=>e.split("?")[0],yd=typeof WebSocket<"u"?WebSocket:typeof r.g<"u"&&typeof r.g.WebSocket<"u"?r.g.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:r("./node_modules/ws/browser.js");class bd{constructor(e){if(this.url=e,this.events=new n.EventEmitter,this.registering=!1,!ld(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){return new Promise(((e,t)=>{typeof this.socket>"u"?t(new Error("Connection already closed")):(this.socket.onclose=t=>{this.onClose(t),e()},this.socket.close())}))}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(f(e))}catch(t){this.onError(e.id,t)}}register(e=this.url){if(!ld(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise(((e,t)=>{this.events.once("register_error",(e=>{this.resetMaxListeners(),t(e)})),this.events.once("open",(()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return t(new Error("WebSocket connection is missing or invalid"));e(this.socket)}))}))}return this.url=e,this.registering=!0,new Promise(((t,n)=>{const o=(0,Qu.isReactNative)()?void 0:{rejectUnauthorized:(i=e,!new RegExp("wss?://localhost(:d{2,5})?").test(i))},s=new yd(e,[],o);var i;typeof WebSocket<"u"||typeof r.g<"u"&&typeof r.g.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u"?s.onerror=e=>{const t=e;n(this.emitError(t.error))}:s.on("error",(e=>{n(this.emitError(e))})),s.onopen=()=>{this.onOpen(s),t(s)}}))}onOpen(e){e.onmessage=e=>this.onPayload(e),e.onclose=e=>this.onClose(e),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const t="string"==typeof e.data?p(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const r=this.parseError(t),n=rd(e,r.message||r.toString());this.events.emit("payload",n)}parseError(e,t=this.url){return Ju(e,md(t),"WS")}
708resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}emitError(e){const t=this.parseError(new Error(e?.message||`WebSocket connection failed for host: ${md(this.url)}`));return this.events.emit("register_error",t),t}}var wd=r("./node_modules/buffer/index.js").Buffer,vd=r("./node_modules/process/browser.js");const Ad="core",Td=`wc@2:${Ad}:`,Pd="error",Ed={database:":memory:"},Cd="client_ed25519_seed",kd=s.ONE_DAY,_d=s.SIX_HOURS,Id="wss://relay.walletconnect.org",Sd="relayer_message",xd="relayer_message_ack",Bd="relayer_connect",Od="relayer_disconnect",Md="relayer_error",Wd="relayer_connection_stalled",jd="relayer_publish",Rd="payload",Nd="connect",Ud="disconnect",Dd="error",Ld="2.23.2",Fd={link_mode:"link_mode",relay:"relay"},zd="inbound",Vd="outbound",qd="WALLETCONNECT_LINK_MODE_APPS",Hd="subscription_created",Kd="subscription_deleted",$d="subscription_sync",Gd="subscription_resubscribed",Yd=(s.FIVE_SECONDS,{wc_pairingDelete:{req:{ttl:s.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:s.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:s.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:s.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:s.ONE_DAY,prompt:!1,tag:0},res:{ttl:s.ONE_DAY,prompt:!1,tag:0}}}),Jd="pairing_create",Qd="pairing_expire",Zd="pairing_delete",Xd="pairing_ping",eh="history_created",th="history_updated",rh="history_deleted",nh="history_sync",oh="expirer_created",sh="expirer_deleted",ih="expirer_expired",ah="expirer_sync",ch="https://verify.walletconnect.org",lh=ch,uh=`${lh}/v3`,dh=["https://verify.walletconnect.com",ch],hh="pairing_started",ph="pairing_uri_validation_success",fh="pairing_uri_not_expired",gh="store_new_pairing",mh="subscribing_pairing_topic",yh="subscribe_pairing_topic_success",bh="existing_pairing",wh="pairing_not_expired",vh="emit_inactive_pairing",Ah="emit_session_proposal",Th="no_internet_connection",Ph="malformed_pairing_uri",Eh="active_pairing_already_exists",Ch="subscribe_pairing_topic_failure",kh="pairing_expired",_h="proposal_listener_not_found",Ih="session_approve_started",Sh="session_namespaces_validation_success",xh="subscribing_session_topic",Bh="subscribe_session_topic_success",Oh="session_approve_publish_success",Mh="store_session",Wh="session_request_response_started",jh="session_request_response_validation_success",Rh="session_request_response_publish_started",Nh="no_internet_connection",Uh="proposal_expired",Dh="subscribe_session_topic_failure",Lh="session_approve_namespace_validation_failure",Fh="proposal_not_found",zh="session_request_response_validation_failure",Vh="session_request_response_publish_failure",qh="authenticated_session_approve_started",Hh="create_authenticated_session_topic",Kh="cacaos_verified",$h="store_authenticated_session",Gh="subscribing_authenticated_session_topic",Yh="subscribe_authenticated_session_topic_success",Jh="publishing_authenticated_session_approve",Qh="no_internet_connection",Zh="invalid_cacao",Xh="subscribe_authenticated_session_topic_failure",ep="authenticated_session_approve_publish_failure",tp="authenticated_session_pending_request_not_found";var rp=function(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var o=0;o<e.length;o++){var s=e.charAt(o),i=s.charCodeAt(0);if(255!==r[i])throw new TypeError(s+" is ambiguous");r[i]=o}var a=e.length,c=e.charAt(0),l=Math.log(a)/Math.log(256),u=Math.log(256)/Math.log(a);function d(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[t]){for(var n=0,o=0;e[t]===c;)n++,t++;for(var s=(e.length-t)*l+1>>>0,i=new Uint8Array(s);e[t];){var u=r[e.charCodeAt(t)];if(255===u)return;for(var d=0,h=s-1;(0!==u||d<o)&&-1!==h;h--,d++)u+=a*i[h]>>>0,i[h]=u%256>>>0,u=u/256>>>0;if(0!==u)throw new Error("Non-zero carry");o=d,t++}if(" "!==e[t]){for(var p=s-o;p!==s&&0===i[p];)p++;for(var f=new Uint8Array(n+(s-p)),g=n;p!==s;)f[g++]=i[p++];return f}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,o=0,s=t.length;o!==s&&0===t[o];)o++,r++;for(var i=(s-o)*u+1>>>0,l=new Uint8Array(i);o!==s;){for(var d=t[o],h=0,p=i-1;(0!==d||h<n)&&-1!==p;p--,h++)d+=256*l[p]>>>0,l[p]=d%a>>>0,d=d/a>>>0;if(0!==d)throw new Error("Non-zero carry");n=h,o++}for(var f=i-n;f!==i&&0===l[f];)f++;for(var g=c.repeat(r);f<i;++f)g+=e.charAt(l[f]);return g},decodeUnsafe:d,decode:function(e){var r=d(e);if(r)return r;throw new Error(`Non-${t} character`)}}},np=rp;const op=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")};class sp{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class ip{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name}
708 decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return cp(this,e)}}class ap{constructor(e){this.decoders=e}or(e){return cp(this,e)}decode(e){const t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const cp=(e,t)=>new ap({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class lp{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new sp(e,t,r),this.decoder=new ip(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const up=({name:e,prefix:t,encode:r,decode:n})=>new lp(e,t,r,n),dp=({prefix:e,name:t,alphabet:r})=>{const{encode:n,decode:o}=np(r,t);return up({prefix:e,name:t,encode:n,decode:e=>op(o(e))})},hp=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>up({prefix:t,name:e,encode:e=>((e,t,r)=>{const n="="===t[t.length-1],o=(1<<r)-1;let s="",i=0,a=0;for(let n=0;n<e.length;++n)for(a=a<<8|e[n],i+=8;i>r;)i-=r,s+=t[o&a>>i];if(i&&(s+=t[o&a<<r-i]),n)for(;s.length*r&7;)s+="=";return s})(e,n,r),decode:t=>((e,t,r,n)=>{const o={};for(let e=0;e<t.length;++e)o[t[e]]=e;let s=e.length;for(;"="===e[s-1];)--s;const i=new Uint8Array(s*r/8|0);let a=0,c=0,l=0;for(let t=0;t<s;++t){const s=o[e[t]];if(void 0===s)throw new SyntaxError(`Non-${n} character`);c=c<<r|s,a+=r,a>=8&&(a-=8,i[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return i})(t,n,r,e)}),pp=up({prefix:"\0",name:"identity",encode:e=>(e=>(new TextDecoder).decode(e))(e),decode:e=>(e=>(new TextEncoder).encode(e))(e)});var fp=Object.freeze({__proto__:null,identity:pp});const gp=hp({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var mp=Object.freeze({__proto__:null,base2:gp});const yp=hp({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var bp=Object.freeze({__proto__:null,base8:yp});const wp=dp({prefix:"9",name:"base10",alphabet:"0123456789"});var vp=Object.freeze({__proto__:null,base10:wp});const Ap=hp({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Tp=hp({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Pp=Object.freeze({__proto__:null,base16:Ap,base16upper:Tp});const Ep=hp({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Cp=hp({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),kp=hp({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),_p=hp({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Ip=hp({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Sp=hp({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),xp=hp({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Bp=hp({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Op=hp({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Mp=Object.freeze({__proto__:null,base32:Ep,base32upper:Cp,base32pad:kp,base32padupper:_p,base32hex:Ip,base32hexupper:Sp,base32hexpad:xp,base32hexpadupper:Bp,base32z:Op});const Wp=dp({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),jp=dp({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Rp=Object.freeze({__proto__:null,base36:Wp,base36upper:jp});const Np=dp({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Up=dp({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Dp=Object.freeze({__proto__:null,base58btc:Np,base58flickr:Up});const Lp=hp({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Fp=hp({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
708+/=",bitsPerChar:6}),zp=hp({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Vp=hp({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var qp=Object.freeze({__proto__:null,base64:Lp,base64pad:Fp,base64url:zp,base64urlpad:Vp});const Hp=Array.from("ððªâð°ðððððððððððððâð»ð¥ð¾ð¿ðâ¤ðð¤£ððððððð
ððð¥ð¥°ðððð¢ð¤ðððªðâºðð¤ððððð¹ð¤¦ððââ¨ð¤·ð±ðð¸ððððððððð¤©ððð¤ðð¯ððð¶ðð¤â£ððððªðð¥ððð©ð¡ð¤ªðð¥³ð¥ð¤¤ððð³âððð´ðð¬ððð·ð»ðââ
ð¥ºððð¤ð¦âð£ððâ¹ððð âððºðð»ððððð¹ð£ð«ðððµð¤ðð´ð¤ð¼ð«â½ð¤âðð¤«ðð®ðð»ðð¶ðð²ð¿ð§¡ðâ¡ððââðð°ð¤¨ð¶ð¤ð¶ð°ðð¢ð¤ðð¨ð¨ð¤¬âððºð¤ððð±ðð¶ð¥´â¶â¡âðð¸â¬ð¨ðð¦ð·ðºâ ð
ððµðð¤²ð¤ ð¤§ððµð
ð§ð¾ððð¤ðð¤¯ð·âð§ð¯ððð¤ððâð´ð£ð¸ððð¥ð¤¢ð
ð¡ð©ðð¸ð»ð¤ð¤®ð¼ð¥µð©ððð¼ðð£ð¥"),Kp=Hp.reduce(((e,t,r)=>(e[r]=t,e)),[]),$p=Hp.reduce(((e,t,r)=>(e[t.codePointAt(0)]=r,e)),[]);const Gp=up({prefix:"ð",name:"base256emoji",encode:function(e){return e.reduce(((e,t)=>e+=Kp[t]),"")},decode:function(e){const t=[];for(const r of e){const e=$p[r.codePointAt(0)];if(void 0===e)throw new Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}});var Yp=Object.freeze({__proto__:null,base256emoji:Gp}),Jp=function e(t,r,n){r=r||[];for(var o=n=n||0;t>=Qp;)r[n++]=255&t|128,t/=128;for(;-128&t;)r[n++]=255&t|128,t>>>=7;return r[n]=0|t,e.bytes=n-o+1,r},Qp=Math.pow(2,31);var Zp=function e(t,r){var n,o=0,s=(r=r||0,0),i=r,a=t.length;do{if(i>=a)throw e.bytes=0,new RangeError("Could not decode varint");n=t[i++],o+=s<28?(127&n)<<s:(127&n)*Math.pow(2,s),s+=7}while(n>=128);return e.bytes=i-r,o};var Xp=Math.pow(2,7),ef=Math.pow(2,14),tf=Math.pow(2,21),rf=Math.pow(2,28),nf=Math.pow(2,35),of=Math.pow(2,42),sf=Math.pow(2,49),af=Math.pow(2,56),cf=Math.pow(2,63),lf={encode:Jp,decode:Zp,encodingLength:function(e){return e<Xp?1:e<ef?2:e<tf?3:e<rf?4:e<nf?5:e<of?6:e<sf?7:e<af?8:e<cf?9:10}},uf=lf;const df=(e,t,r=0)=>(uf.encode(e,t,r),t),hf=e=>uf.encodingLength(e),pf=(e,t)=>{const r=t.byteLength,n=hf(e),o=n+hf(r),s=new Uint8Array(o+r);return df(e,s,0),df(r,s,n),s.set(t,o),new ff(e,r,t,s)};class ff{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}}const gf=({name:e,code:t,encode:r})=>new mf(e,t,r);class mf{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?pf(this.code,t):t.then((e=>pf(this.code,e)))}throw Error("Unknown type, must be binary type")}}const yf=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),bf=gf({name:"sha2-256",code:18,encode:yf("SHA-256")}),wf=gf({name:"sha2-512",code:19,encode:yf("SHA-512")});Object.freeze({__proto__:null,sha256:bf,sha512:wf});const vf=op,Af={code:0,name:"identity",encode:vf,digest:e=>pf(0,vf(e))};Object.freeze({__proto__:null,identity:Af});new TextEncoder,new TextDecoder;const Tf={...fp,...mp,...bp,...vp,...Pp,...Mp,...Rp,...Dp,...qp,...Yp};function Pf(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function Ef(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const Cf=Ef("utf8","u",(e=>"u"+new TextDecoder("utf8").decode(e)),(e=>(new TextEncoder).encode(e.substring(1)))),kf=Ef("ascii","a",(e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t}),(e=>{const t=function(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?Pf(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}((e=e.substring(1)).length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t})),_f={utf8:Cf,"utf-8":Cf,hex:Tf.base16,latin1:kf,ascii:kf,binary:kf,...Tf};var If=Object.defineProperty,Sf=(e,t,r)=>((e,t,r)=>t in e?If(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class xf{constructor(e,t){this.core=e,this.logger=t,Sf(this,"keychain",new Map),Sf(this,"name","keychain"),Sf(this,"version","0.3"),Sf(this,"initialized",!1),Sf(this,"storagePrefix",Td),Sf(this,"init",(async()=>
708{if(!this.initialized){const e=await this.getKeyChain();typeof e<"u"&&(this.keychain=e),this.initialized=!0}})),Sf(this,"has",(e=>(this.isInitialized(),this.keychain.has(e)))),Sf(this,"set",(async(e,t)=>{this.isInitialized(),this.keychain.set(e,t),await this.persist()})),Sf(this,"get",(e=>{this.isInitialized();const t=this.keychain.get(e);if(typeof t>"u"){const{message:t}=uu("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(t)}return t})),Sf(this,"del",(async e=>{this.isInitialized(),this.keychain.delete(e),await this.persist()})),this.core=e,this.logger=(0,P.U5)(t,this.name)}get context(){return(0,P.oI)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,eo(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?to(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=uu("NOT_INITIALIZED",this.name);throw new Error(e)}}}var Bf=Object.defineProperty,Of=(e,t,r)=>((e,t,r)=>t in e?Bf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class Mf{constructor(e,t,r){this.core=e,this.logger=t,Of(this,"name","crypto"),Of(this,"keychain"),Of(this,"randomSessionIdentifier",wl()),Of(this,"initialized",!1),Of(this,"clientId"),Of(this,"init",(async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)})),Of(this,"hasKeys",(e=>(this.isInitialized(),this.keychain.has(e)))),Of(this,"getClientId",(async()=>{if(this.isInitialized(),this.clientId)return this.clientId;const e=cn(dn(await this.getClientSeed()).publicKey);return this.clientId=e,e})),Of(this,"generateKeyPair",(()=>{this.isInitialized();const e=function(){const e=Lc.utils.randomPrivateKey(),t=Lc.getPublicKey(e);return{privateKey:(0,Tn.dI)(e,gl),publicKey:(0,Tn.dI)(t,gl)}}();return this.setPrivateKey(e.publicKey,e.privateKey)})),Of(this,"signJWT",(async e=>{this.isInitialized();const t=dn(await this.getClientSeed()),r=this.randomSessionIdentifier,n=kd;return await hn(r,e,n,t)})),Of(this,"generateSharedKey",((e,t,r)=>{this.isInitialized();const n=function(e,t){const r=Lc.getSharedSecret((0,Tn.sH)(e,gl),(0,Tn.sH)(t,gl)),n=Ea(Ca,r,void 0,void 0,32);return(0,Tn.dI)(n,gl)}(this.getPrivateKey(e),t);return this.setSymKey(n,r)})),Of(this,"setSymKey",(async(e,t)=>{this.isInitialized();const r=t||vl(e);return await this.keychain.set(r,e),r})),Of(this,"deleteKeyPair",(async e=>{this.isInitialized(),await this.keychain.del(e)})),Of(this,"deleteSymKey",(async e=>{this.isInitialized(),await this.keychain.del(e)})),Of(this,"encode",(async(e,t,r)=>{this.isInitialized();const n=Il(r),o=f(t);if(xl(n))return function(e,t){const r=Tl(2),n=ps(12),o=kl({type:r,sealed:(0,Tn.sH)(e,bl),iv:n});return t===yl?El(o):o}(o,r?.encoding);if(Sl(n)){const t=n.senderPublicKey,r=n.receiverPublicKey;e=await this.generateSharedKey(t,r)}const s=this.getSymKey(e),{type:i,senderPublicKey:a}=n;return function(e){const t=Tl(typeof e.type<"u"?e.type:0);if(1===Pl(t)&&typeof e.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof e.senderPublicKey<"u"?(0,Tn.sH)(e.senderPublicKey,gl):void 0,n=typeof e.iv<"u"?(0,Tn.sH)(e.iv,gl):ps(12),o=(0,Tn.sH)(e.symKey,gl),s=kl({type:t,sealed:ba(o,n).encrypt((0,Tn.sH)(e.message,bl)),iv:n,senderPublicKey:r});return e.encoding===yl?El(s):s}({type:i,symKey:s,message:o,senderPublicKey:a,encoding:r?.encoding})})),Of(this,"decode",(async(e,t,r)=>{this.isInitialized();const n=function(e,t){const r=_l({encoded:e,encoding:t?.encoding});return Il({type:Pl(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?(0,Tn.dI)(r.senderPublicKey,gl):void 0,receiverPublicKey:t?.receiverPublicKey})}(t,r);if(xl(n)){const e=function(e,t){const{sealed:r}=_l({encoded:e,encoding:t});return(0,Tn.dI)(r,bl)}(t,r?.encoding);return p(e)}if(Sl(n)){const t=n.receiverPublicKey,r=n.senderPublicKey;e=await this.generateSharedKey(t,r)}try{const n=function(e){const t=(0,Tn.sH)(e.symKey,gl),{sealed:r,iv:n}=_l({encoded:e.encoded,encoding:e.encoding}),o=ba(t,n).decrypt(r);if(null===o)throw new Error("Failed to decrypt");return(0,Tn.dI)(o,bl)}({symKey:this.getSymKey(e),encoded:t,encoding:r?.encoding});return p(n)}catch(t){this.logger.error(`Failed to decode message from topic: '${e}', clientId: '${await this.getClientId()}'`),this.logger.error(t)}})),Of(this,"getPayloadType",((e,t=ml)=>Pl(_l({encoded:e,encoding:t}).type))),Of(this,"getPayloadSenderPublicKey",((e,t=ml)=>{const r=_l({encoded:e,encoding:t});return r.senderPublicKey?(0,Tn.dI)(r.senderPublicKey,gl):void 0})),this.core=e,this.logger=(0,P.U5)(t,this.name),this.keychain=r||new xf(this.core,this.logger)}get context(){return(0,P.oI)(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(Cd)}catch{e=wl(),await this.keychain.set(Cd,e)}return function(e,t="utf8"){const r=_f[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?r.decoder.decode(`${r.prefix}${e}`):Pf(globalThis.Buffer.from(e,"utf-8"))}(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=uu("NOT_INITIALIZED",this.name);throw new Error(e)}}}var Wf=Object.defineProperty,jf=Object.defineProperties,Rf=Object.getOwnPropertyDescriptors,Nf=Object.getOwnPropertySymbols,Uf=Object.prototype.hasOwnProperty,Df=Object.prototype.propertyIsEnumerable,Lf=(e,t,r)=>t in e?Wf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ff=(e,t,r)=>Lf(e,"symbol"!=typeof t?t+"":t,r);class zf extends x{constructor(e,t){super(e,t),this.logger=e,this.core=t,Ff(this,"messages",new Map),Ff(this,"messagesWithoutClientAck",new Map),Ff(this,"name","messages"),Ff(this,"version","0.3"),Ff(this,"initialized",!1),Ff(this,"storagePrefix",Td),Ff(this,"init",(async()=>
708{if(!this.initialized){this.logger.trace("Initialized");try{const e=await this.getRelayerMessages();typeof e<"u"&&(this.messages=e);const t=await this.getRelayerMessagesWithoutClientAck();typeof t<"u"&&(this.messagesWithoutClientAck=t),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}finally{this.initialized=!0}}})),Ff(this,"set",(async(e,t,r)=>{this.isInitialized();const n=Al(t);let o=this.messages.get(e);if(typeof o>"u"&&(o={}),typeof o[n]<"u")return n;if(o[n]=t,this.messages.set(e,o),r===zd){const r=this.messagesWithoutClientAck.get(e)||{};this.messagesWithoutClientAck.set(e,((e,t)=>jf(e,Rf(t)))(((e,t)=>{for(var r in t||(t={}))Uf.call(t,r)&&Lf(e,r,t[r]);if(Nf)for(var r of Nf(t))Df.call(t,r)&&Lf(e,r,t[r]);return e})({},r),{[n]:t}))}return await this.persist(),n})),Ff(this,"get",(e=>{this.isInitialized();let t=this.messages.get(e);return typeof t>"u"&&(t={}),t})),Ff(this,"getWithoutAck",(e=>{this.isInitialized();const t={};for(const r of e){const e=this.messagesWithoutClientAck.get(r)||{};t[r]=Object.values(e)}return t})),Ff(this,"has",((e,t)=>{this.isInitialized();return typeof this.get(e)[Al(t)]<"u"})),Ff(this,"ack",(async(e,t)=>{this.isInitialized();const r=this.messagesWithoutClientAck.get(e);if(typeof r>"u")return;delete r[Al(t)],0===Object.keys(r).length?this.messagesWithoutClientAck.delete(e):this.messagesWithoutClientAck.set(e,r),await this.persist()})),Ff(this,"del",(async e=>{this.isInitialized(),this.messages.delete(e),this.messagesWithoutClientAck.delete(e),await this.persist()})),this.logger=(0,P.U5)(e,this.name),this.core=t}get context(){return(0,P.oI)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get storageKeyWithoutClientAck(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name+"_withoutClientAck"}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,eo(e))}async setRelayerMessagesWithoutClientAck(e){await this.core.storage.setItem(this.storageKeyWithoutClientAck,eo(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?to(e):void 0}async getRelayerMessagesWithoutClientAck(){const e=await this.core.storage.getItem(this.storageKeyWithoutClientAck);return typeof e<"u"?to(e):void 0}async persist(){await this.setRelayerMessages(this.messages),await this.setRelayerMessagesWithoutClientAck(this.messagesWithoutClientAck)}isInitialized(){if(!this.initialized){const{message:e}=uu("NOT_INITIALIZED",this.name);throw new Error(e)}}}var Vf=Object.defineProperty,qf=Object.defineProperties,Hf=Object.getOwnPropertyDescriptors,Kf=Object.getOwnPropertySymbols,$f=Object.prototype.hasOwnProperty,Gf=Object.prototype.propertyIsEnumerable,Yf=(e,t,r)=>t in e?Vf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Jf=(e,t)=>{for(var r in t||(t={}))$f.call(t,r)&&Yf(e,r,t[r]);if(Kf)for(var r of Kf(t))Gf.call(t,r)&&Yf(e,r,t[r]);return e},Qf=(e,t)=>qf(e,Hf(t)),Zf=(e,t,r)=>Yf(e,"symbol"!=typeof t?t+"":t,r);class Xf extends B{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,Zf(this,"events",new n.EventEmitter),Zf(this,"name","publisher"),Zf(this,"queue",new Map),Zf(this,"publishTimeout",(0,s.toMiliseconds)(s.ONE_MINUTE)),Zf(this,"initialPublishTimeout",(0,s.toMiliseconds)(15*s.ONE_SECOND)),Zf(this,"needsTransportRestart",!1),Zf(this,"publish",(async(e,t,r)=>{var n,o,s,i,a;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:e,message:t,opts:r}});const c=r?.ttl||_d,l=r?.prompt||!1,u=r?.tag||0,d=r?.id||Xu().toString(),h=Ml(Ol().protocol),p={id:d,method:r?.publishMethod||h.publish,params:Jf({topic:e,message:t,ttl:c,prompt:l,tag:u,attestation:r?.attestation},r?.tvf)},f=`Failed to publish payload, please try again. id:${d} tag:${u}`;try{fu(null==(n=p.params)?void 0:n.prompt)&&(null==(o=p.params)||delete o.prompt),fu(null==(s=p.params)?void 0:s.tag)&&(null==(i=p.params)||delete i.tag);const a=new Promise((async e=>{const t=({id:r})=>{var n;(null==(n=p.id)?void 0:n.toString())===r.toString()&&(this.removeRequestFromQueue(r),this.relayer.events.removeListener(jd,t),e())};this.relayer.events.on(jd,t);const n=no(new Promise(((e,t)=>{this.rpcPublish(p,r).then(e).catch((e=>{this.logger.warn(e,e?.message),t(e)}))})),this.initialPublishTimeout,`Failed initial publish, retrying.... id:${d} tag:${u}`);try{await n,this.events.removeListener(jd,t)}catch(e){this.queue.set(d,{request:p,opts:r,attempt:1}),this.logger.warn(e,e?.message)}}));this.logger.trace({type:"method",method:"publish",params:{id:d,topic:e,message:t,opts:r}}),await no(a,this.publishTimeout,f)}catch(e){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(e),null!=(a=r?.internal)&&a.throwOnFailedPublish)throw e}finally{this.queue.delete(d)}})),Zf(this,"publishCustom",(async e=>{var t,r,n,o,i;this.logger.debug("Publishing custom payload"),this.logger.trace({type:"method",method:"publishCustom",params:e});const{payload:a,opts:c={}}=e,{attestation:l,tvf:u,publishMethod:d,prompt:h,tag:p,ttl:f=s.FIVE_MINUTES}=c,g=c.id||Xu().toString(),m=Ml(Ol().protocol),y=d||m.publish,b={id:g,method:y,params:Jf(Qf(Jf({},a),{ttl:f,prompt:h,tag:p,attestation:l}),u)},w=`Failed to publish custom payload, please try again. id:${g} tag:${p}`;try{fu(null==(t=b.params)?void 0:t.prompt)&&(null==(r=b.params)||delete r.prompt),fu(null==(n=b.params)?void 0:n.tag)&&(null==(o=b.params)||delete o.tag);const e=new Promise((async e=>{const t=({id:r})=>{var n;(null==(n=b.id)?void 0:n.toString())===r.toString()&&(this.removeRequestFromQueue(r),this.relayer.events.removeListener(jd,t),e())};this.relayer.events.on(jd,t);const r=no(new Promise(((e,t)=>{this.rpcPublish(b,c).then(e).catch((e=>{this.logger.warn(e,e?.message),t(e)}))})),this.initialPublishTimeout,`Failed initial custom payload publish, retrying.... method:${y} id:${g} tag:${p}`);try{await r,this.events.removeListener(jd,t)}catch(e){this.queue.set(g,{request:b,opts:c,attempt:1}),this.logger.warn(e,e?.message)}}));this.logger.trace({type:"method",method:"publish",params:{id:g,payload:a,opts:c}}),await no(e,this.publishTimeout,w)}catch(e){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(e),null!=(i=c?.internal)&&i.throwOnFailedPublish)throw e}finally{this.queue.delete(g)}})),Zf(this,"on",((e,t)=>
708{this.events.on(e,t)})),Zf(this,"once",((e,t)=>{this.events.once(e,t)})),Zf(this,"off",((e,t)=>{this.events.off(e,t)})),Zf(this,"removeListener",((e,t)=>{this.events.removeListener(e,t)})),this.relayer=e,this.logger=(0,P.U5)(t,this.name),this.registerEventListeners()}get context(){return(0,P.oI)(this.logger)}async rpcPublish(e,t){this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:e});const r=await this.relayer.request(e);return this.relayer.events.emit(jd,Jf(Jf({},e),t)),this.logger.debug("Successfully Published Payload"),r}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach((async(e,t)=>{var r;const n=e.attempt+1;this.queue.set(t,Qf(Jf({},e),{attempt:n})),this.logger.warn({},`Publisher: queue->publishing: ${e.request.id}, tag: ${null==(r=e.request.params)?void 0:r.tag}, attempt: ${n}`),await this.rpcPublish(e.request,e.opts),this.logger.warn({},`Publisher: queue->published: ${e.request.id}`)}))}registerEventListeners(){this.relayer.core.heartbeat.on(l,(()=>{if(this.needsTransportRestart)return this.needsTransportRestart=!1,void this.relayer.events.emit(Wd);this.checkQueue()})),this.relayer.on(xd,(e=>{this.removeRequestFromQueue(e.id.toString())}))}}var eg=Object.defineProperty,tg=(e,t,r)=>((e,t,r)=>t in e?eg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class rg{constructor(){tg(this,"map",new Map),tg(this,"set",((e,t)=>{const r=this.get(e);this.exists(e,t)||this.map.set(e,[...r,t])})),tg(this,"get",(e=>this.map.get(e)||[])),tg(this,"exists",((e,t)=>this.get(e).includes(t))),tg(this,"delete",((e,t)=>{if(typeof t>"u")return void this.map.delete(e);if(!this.map.has(e))return;const r=this.get(e);if(!this.exists(e,t))return;const n=r.filter((e=>e!==t));n.length?this.map.set(e,n):this.map.delete(e)})),tg(this,"clear",(()=>{this.map.clear()}))}get topics(){return Array.from(this.map.keys())}}var ng=Object.defineProperty,og=Object.defineProperties,sg=Object.getOwnPropertyDescriptors,ig=Object.getOwnPropertySymbols,ag=Object.prototype.hasOwnProperty,cg=Object.prototype.propertyIsEnumerable,lg=(e,t,r)=>t in e?ng(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ug=(e,t)=>{for(var r in t||(t={}))ag.call(t,r)&&lg(e,r,t[r]);if(ig)for(var r of ig(t))cg.call(t,r)&&lg(e,r,t[r]);return e},dg=(e,t)=>og(e,sg(t)),hg=(e,t,r)=>lg(e,"symbol"!=typeof t?t+"":t,r);class pg extends W{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,hg(this,"subscriptions",new Map),hg(this,"topicMap",new rg),hg(this,"events",new n.EventEmitter),hg(this,"name","subscription"),hg(this,"version","0.3"),hg(this,"pending",new Map),hg(this,"cached",[]),hg(this,"initialized",!1),hg(this,"storagePrefix",Td),hg(this,"subscribeTimeout",(0,s.toMiliseconds)(s.ONE_MINUTE)),hg(this,"initialSubscribeTimeout",(0,s.toMiliseconds)(15*s.ONE_SECOND)),hg(this,"clientId"),hg(this,"batchSubscribeTopicsLimit",500),hg(this,"init",(async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),await this.restore()),this.initialized=!0})),hg(this,"subscribe",(async(e,t)=>{var r;this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}});try{const n=Ol(t),o={topic:e,relay:n,transportType:t?.transportType};null!=(r=t?.internal)&&r.skipSubscribe||this.pending.set(e,o);const s=await this.rpcSubscribe(e,n,t);return"string"==typeof s&&(this.onSubscribe(s,o),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}})),s}catch(e){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(e),e}})),hg(this,"unsubscribe",(async(e,t)=>{this.isInitialized(),typeof t?.id<"u"?await this.unsubscribeById(e,t.id,t):await this.unsubscribeByTopic(e,t)})),hg(this,"isSubscribed",(e=>new Promise((t=>{t(this.topicMap.topics.includes(e))})))),hg(this,"isKnownTopic",(e=>new Promise((t=>{t(this.topicMap.topics.includes(e)||this.pending.has(e)||this.cached.some((t=>t.topic===e)))})))),hg(this,"on",((e,t)=>
708{this.events.on(e,t)})),hg(this,"once",((e,t)=>{this.events.once(e,t)})),hg(this,"off",((e,t)=>{this.events.off(e,t)})),hg(this,"removeListener",((e,t)=>{this.events.removeListener(e,t)})),hg(this,"start",(async()=>{await this.onConnect()})),hg(this,"stop",(async()=>{await this.onDisconnect()})),hg(this,"restart",(async()=>{await this.restore(),await this.onRestart()})),hg(this,"checkPending",(async()=>{if(!(0!==this.pending.size||this.initialized&&this.relayer.connected))return;const e=[];this.pending.forEach((t=>{e.push(t)})),await this.batchSubscribe(e)})),hg(this,"registerEventListeners",(()=>{this.relayer.core.heartbeat.on(l,(async()=>{await this.checkPending()})),this.events.on(Hd,(async e=>{const t=Hd;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()})),this.events.on(Kd,(async e=>{const t=Kd;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()}))})),this.relayer=e,this.logger=(0,P.U5)(t,this.name),this.clientId=""}get context(){return(0,P.oI)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}get hasAnyTopics(){return this.topicMap.topics.length>0||this.pending.size>0||this.cached.length>0||this.subscriptions.size>0}hasSubscription(e,t){let r=!1;try{r=this.getSubscription(e).topic===t}catch{}return r}reset(){this.cached=[],this.initialized=!0}onDisable(){this.values.length>0&&(this.cached=this.values),this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){const r=this.topicMap.get(e);await Promise.all(r.map((async r=>await this.unsubscribeById(e,r,t))))}async unsubscribeById(e,t,r){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:r}});try{const n=Ol(r);await this.restartToComplete({topic:e,id:t,relay:n}),await this.rpcUnsubscribe(e,t,n);const o=du("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,t,o),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:r}})}catch(e){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(e),e}}async rpcSubscribe(e,t,r){var n,o;
708const i=await this.getSubscriptionId(e);if(null!=(n=r?.internal)&&n.skipSubscribe)return i;(!r||r?.transportType===Fd.relay)&&await this.restartToComplete({topic:e,id:e,relay:t});const a={method:Ml(t.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:a});const c=null==(o=r?.internal)?void 0:o.throwOnFailedPublish;try{if(r?.transportType===Fd.link_mode)return setTimeout((()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(a).catch((e=>this.logger.warn(e)))}),(0,s.toMiliseconds)(s.ONE_SECOND)),i;const t=new Promise((async t=>{const r=n=>{n.topic===e&&(this.events.removeListener(Hd,r),t(n.id))};this.events.on(Hd,r);try{const n=await no(new Promise(((e,t)=>{this.relayer.request(a).catch((e=>{this.logger.warn(e,e?.message),t(e)})).then(e)})),this.initialSubscribeTimeout,`Subscribing to ${e} failed, please try again`);this.events.removeListener(Hd,r),t(n)}catch{}})),n=await no(t,this.subscribeTimeout,`Subscribing to ${e} failed, please try again`);if(!n&&c)throw new Error(`Subscribing to ${e} failed, please try again`);return n?i:null}catch(e){if(this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Wd),c)throw e}return null}async rpcBatchSubscribe(e){if(!e.length)return;const t={method:Ml(e[0].relay.protocol).batchSubscribe,params:{topics:e.map((e=>e.topic))}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:t});try{await await no(new Promise((e=>{this.relayer.request(t).catch((e=>this.logger.warn(e))).then(e)})),this.subscribeTimeout,"rpcBatchSubscribe failed, please try again")}catch{this.relayer.events.emit(Wd)}}async rpcBatchFetchMessages(e){if(!e.length)return;const t={method:Ml(e[0].relay.protocol).batchFetchMessages,params:{topics:e.map((e=>e.topic))}};let r;this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:t});try{r=await await no(new Promise(((e,r)=>{this.relayer.request(t).catch((e=>{this.logger.warn(e),r(e)})).then(e)})),this.subscribeTimeout,"rpcBatchFetchMessages failed, please try again")}catch{this.relayer.events.emit(Wd)}return r}rpcUnsubscribe(e,t,r){const n={method:Ml(r.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n}),this.relayer.request(n)}onSubscribe(e,t){this.setSubscription(e,dg(ug({},t),{id:e})),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach((e=>{this.setSubscription(e.id,ug({},e)),this.pending.delete(e.topic)}))}async onUnsubscribe(e,t,r){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,r),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,t){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t)}addSubscription(e,t){this.subscriptions.set(e,ug({},t)),this.topicMap.set(t.topic,e),this.events.emit(Hd,t)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const t=this.subscriptions.get(e);if(!t){const{message:t}=uu("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(t)}return t}deleteSubscription(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});const r=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(r.topic,e),this.events.emit(Kd,dg(ug({},r),{reason:t}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit($d)}async onRestart(){if(this.cached.length){const e=[...this.cached],t=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r<t;r++){const t=e.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(t)}}this.events.emit(Gd)}
708async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size&&!e.every((e=>{var t;return e.topic===(null==(t=this.subscriptions.get(e.id))?void 0:t.topic)}))){const{message:e}=uu("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(e)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){e.length&&(await this.rpcBatchSubscribe(e),this.onBatchSubscribe(await Promise.all(e.map((async e=>dg(ug({},e),{id:await this.getSubscriptionId(e.topic)}))))))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);const t=await this.rpcBatchFetchMessages(e);t&&t.messages&&(await function(e){return new Promise((t=>setTimeout(t,e)))}((0,s.toMiliseconds)(s.ONE_SECOND)),await this.relayer.handleBatchMessageEvents(t.messages))}async onConnect(){await this.restart(),this.reset()}onDisconnect(){this.onDisable()}isInitialized(){if(!this.initialized){const{message:e}=uu("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(e){!this.relayer.connected&&!this.relayer.connecting&&(this.cached.push(e),await this.relayer.transportOpen())}async getClientId(){return this.clientId||(this.clientId=await this.relayer.core.crypto.getClientId()),this.clientId}async getSubscriptionId(e){return Al(e+await this.getClientId())}}var fg=Object.defineProperty,gg=Object.getOwnPropertySymbols,mg=Object.prototype.hasOwnProperty,yg=Object.prototype.propertyIsEnumerable,bg=(e,t,r)=>t in e?fg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wg=(e,t)=>{for(var r in t||(t={}))mg.call(t,r)&&bg(e,r,t[r]);if(gg)for(var r of gg(t))yg.call(t,r)&&bg(e,r,t[r]);return e},vg=(e,t,r)=>bg(e,"symbol"!=typeof t?t+"":t,r);class Ag extends O{constructor(e){var t;super(e),vg(this,"protocol","wc"),vg(this,"version",2),vg(this,"core"),vg(this,"logger"),vg(this,"events",new n.EventEmitter),vg(this,"provider"),vg(this,"messages"),vg(this,"subscriber"),vg(this,"publisher"),vg(this,"name","relayer"),vg(this,"transportExplicitlyClosed",!1),vg(this,"initialized",!1),vg(this,"connectionAttemptInProgress",!1),vg(this,"relayUrl"),vg(this,"projectId"),vg(this,"packageName"),vg(this,"bundleId"),vg(this,"hasExperiencedNetworkDisruption",!1),vg(this,"pingTimeout"),vg(this,"heartBeatTimeout",(0,s.toMiliseconds)(s.THIRTY_SECONDS+s.FIVE_SECONDS)),vg(this,"reconnectTimeout"),vg(this,"connectPromise"),vg(this,"reconnectInProgress",!1),vg(this,"requestsInFlight",[]),vg(this,"connectTimeout",(0,s.toMiliseconds)(15*s.ONE_SECOND)),vg(this,"request",(async e=>{var t,r;this.logger.debug("Publishing Request Payload");const n=e.id||Xu().toString();await this.toEstablishConnection();try{this.logger.trace({id:n,method:e.method,topic:null==(t=e.params)?void 0:t.topic},"relayer.request - publishing...");const o=`${n}:${(null==(r=e.params)?void 0:r.tag)||""}`;this.requestsInFlight.push(o);const s=await this.provider.request(e);return this.requestsInFlight=this.requestsInFlight.filter((e=>e!==o)),s}catch(e){throw this.logger.debug(`Failed to Publish Request: ${n}`),e}})),vg(this,"resetPingTimeout",(()=>{qn()&&(clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout((()=>{var e,t,r,n;try{this.logger.debug({},"pingTimeout: Connection stalled, terminating..."),null==(n=null==(r=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:r.terminate)||n.call(r)}catch(e){this.logger.warn(e,e?.message)}}),this.heartBeatTimeout))})),vg(this,"onPayloadHandler",(e=>{this.onProviderPayload(e),this.resetPingTimeout()})),vg(this,"onConnectHandler",(()=>{this.logger.warn({},"Relayer connected ð"),this.startPingTimeout(),this.events.emit(Bd)})),vg(this,"onDisconnectHandler",(()=>{this.logger.warn({},"Relayer disconnected ð"),this.requestsInFlight=[],this.onProviderDisconnect()})),vg(this,"onProviderErrorHandler",(e=>{this.logger.fatal(`Fatal socket error: ${e.message}`),this.events.emit(Md,e),this.logger.fatal("Fatal socket error received, closing transport"),this.transportClose()})),vg(this,"registerProviderListeners",(()=>{this.provider.on(Rd,this.onPayloadHandler),this.provider.on(Nd,this.onConnectHandler),this.provider.on(Ud,this.onDisconnectHandler),this.provider.on(Dd,this.onProviderErrorHandler)})),this.core=e.core,this.logger=Nu({logger:null!=(t=e.logger)?t:"error",name:this.name}),this.messages=new zf(this.logger,e.core),this.subscriber=new pg(this,this.logger),this.publisher=new Xf(this,this.logger),this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||Id,Hn()&&typeof r.g<"u"&&typeof(null==r.g?void 0:r.g.Platform)<"u"&&"android"===(null==r.g?void 0:r.g.Platform.OS)?this.packageName=Gn():Hn()&&typeof r.g<"u"&&typeof(null==r.g?void 0:r.g.Platform)<"u"&&"ios"===(null==r.g?void 0:r.g.Platform.OS)&&(this.bundleId=Gn()),this.provider={}}
708async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.transportOpen().catch((e=>this.logger.warn(e,e?.message)))}get context(){return(0,P.oI)(this.logger)}get connected(){var e,t,r;return 1===(null==(r=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:r.readyState)||!1}get connecting(){var e,t,r;return 0===(null==(r=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:r.readyState)||void 0!==this.connectPromise||!1}async publish(e,t,r){this.isInitialized(),await this.publisher.publish(e,t,r),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now(),transportType:Fd.relay},Vd)}async publishCustom(e){this.isInitialized(),await this.publisher.publishCustom(e)}async subscribe(e,t){var r,n,o;this.isInitialized(),(null==t||!t.transportType||"relay"===t?.transportType)&&await this.toEstablishConnection();const s=typeof(null==(r=t?.internal)?void 0:r.throwOnFailedPublish)>
708"u"||(null==(n=t?.internal)?void 0:n.throwOnFailedPublish);let i,a=(null==(o=this.subscriber.topicMap.get(e))?void 0:o[0])||"";const c=t=>{t.topic===e&&(this.subscriber.off(Hd,c),i())};return await Promise.all([new Promise((e=>{i=e,this.subscriber.on(Hd,c)})),new Promise((async(r,n)=>{a=await this.subscriber.subscribe(e,wg({internal:{throwOnFailedPublish:s}},t)).catch((e=>{s&&n(e)}))||a,r()}))]),a}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportDisconnect(){this.provider.disconnect&&(this.hasExperiencedNetworkDisruption||this.connected)?await no(this.provider.disconnect(),2e3,"provider.disconnect()").catch((()=>this.onProviderDisconnect())):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){if(this.subscriber.hasAnyTopics){if(this.connectPromise?(this.logger.debug({},"Waiting for existing connection attempt to resolve..."),await this.connectPromise,this.logger.debug({},"Existing connection attempt resolved")):(this.connectPromise=new Promise((async(t,r)=>{await this.connect(e).then(t).catch(r).finally((()=>{this.connectPromise=void 0}))})),await this.connectPromise),!this.connected)throw new Error(`Couldn't establish socket connection to the relay server: ${this.relayUrl}`)}else this.logger.info("Starting WS connection skipped because the client has no topics to work with.")}async restartTransport(e){this.logger.debug({},"Restarting transport..."),!this.connectionAttemptInProgress&&(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}
708async confirmOnlineStateOrThrow(){if(!await xu())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if(0===e?.length)return void this.logger.trace("Batch message events is empty. Ignoring...");const t=e.sort(((e,t)=>e.publishedAt-t.publishedAt));this.logger.debug(`Batch of ${t.length} message events sorted`);for(const e of t)try{await this.onMessageEvent(e)}catch(e){this.logger.warn(e,"Error while processing batch message event: "+e?.message)}this.logger.trace(`Batch of ${t.length} message events processed`)}async onLinkMessageEvent(e,t){const{topic:r}=e;if(!t.sessionExists){const e={topic:r,expiry:io(s.FIVE_MINUTES),relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(r,e)}this.events.emit(Sd,e),await this.recordMessageEvent(e,zd)}async connect(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;let t=1;for(;t<6;){try{if(this.transportExplicitlyClosed)break;this.logger.debug({},`Connecting to ${this.relayUrl}, attempt: ${t}...`),await this.createProvider(),await new Promise((async(e,t)=>{const r=()=>{t(new Error("Connection interrupted while trying to connect"))};this.provider.once(Ud,r),await no(new Promise(((e,t)=>{this.provider.connect().then(e).catch(t)})),this.connectTimeout,`Socket stalled when trying to connect to ${this.relayUrl}`).catch((e=>{t(e)})).finally((()=>{this.provider.off(Ud,r),clearTimeout(this.reconnectTimeout)})),await new Promise((async(e,r)=>{const n=()=>{t(new Error("Connection interrupted while trying to subscribe"))};this.provider.once(Ud,n),await this.subscriber.start().then(e).catch(r).finally((()=>{this.provider.off(Ud,n)}))})),this.hasExperiencedNetworkDisruption=!1,e()}))}catch(e){await this.subscriber.stop();const t=e;this.logger.warn({},t.message),this.hasExperiencedNetworkDisruption=!0}finally{this.connectionAttemptInProgress=!1}if(this.connected){this.logger.debug({},`Connected to ${this.relayUrl} successfully on attempt: ${t}`);break}await new Promise((e=>setTimeout(e,(0,s.toMiliseconds)(1*t)))),t++}}startPingTimeout(){var e,t,r,n,o;if(qn())try{null!=(t=null==(e=this.provider)?void 0:e.connection)&&t.socket&&(null==(o=null==(n=null==(r=this.provider)?void 0:r.connection)?void 0:n.socket)||o.on("ping",(()=>{this.resetPingTimeout()}))),this.resetPingTimeout()}catch(e){this.logger.warn(e,e?.message)}}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new gd(new bd(Zn({sdkVersion:Ld,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId,packageName:this.packageName}))),this.registerProviderListeners()}async recordMessageEvent(e,t){const{topic:r,message:n}=e;await this.messages.set(r,n,t)}async shouldIgnoreMessageEvent(e){const{topic:t,message:r}=e;if(!r||0===r.length)return this.logger.warn(`Ignoring invalid/empty message: ${r}`),!0;if(!await this.subscriber.isKnownTopic(t))return this.logger.warn(`Ignoring message for unknown topic ${t}`),!0;const n=this.messages.has(t,r);return n&&this.logger.warn(`Ignoring duplicate message: ${r}`),n}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),dd(e)){if(!e.method.endsWith("_subscription"))return;const t=e.params,{topic:r,message:n,publishedAt:o,attestation:s}=t.data,i={topic:r,message:n,publishedAt:o,transportType:Fd.relay,attestation:s};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(wg({type:"event",event:t.id},i)),this.events.emit(t.id,i),await this.acknowledgePayload(e),await this.onMessageEvent(i)}else hd(e)&&this.events.emit(xd,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(await this.recordMessageEvent(e,zd),this.events.emit(Sd,e))}async acknowledgePayload(e){const t=td(e.id,!0);await this.provider.connection.send(t)}unregisterProviderListeners(){this.provider.off(Rd,this.onPayloadHandler),this.provider.off(Nd,this.onConnectHandler),this.provider.off(Ud,this.onDisconnectHandler),this.provider.off(Dd,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await xu();Bu((async t=>{e!==t&&(e=t,t?await this.transportOpen().catch((e=>this.logger.error(e,e?.message))):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))})),this.core.heartbeat.on(l,(async()=>
708{if(!this.transportExplicitlyClosed&&!this.connected&&function(){var e;return!Kn()||!(0,fn.getDocument)()||"visible"===(null==(e=(0,fn.getDocument)())?void 0:e.visibilityState)}())try{await this.confirmOnlineStateOrThrow(),await this.transportOpen()}catch(e){this.logger.warn(e,e?.message)}}))}async onProviderDisconnect(){clearTimeout(this.pingTimeout),this.events.emit(Od),this.connectionAttemptInProgress=!1,!this.reconnectInProgress&&(this.reconnectInProgress=!0,await this.subscriber.stop(),this.subscriber.hasAnyTopics&&(this.transportExplicitlyClosed||(this.reconnectTimeout=setTimeout((async()=>{await this.transportOpen().catch((e=>this.logger.error(e,e?.message))),this.reconnectTimeout=void 0,this.reconnectInProgress=!1}),(0,s.toMiliseconds)(.1)))))}isInitialized(){if(!this.initialized){const{message:e}=uu("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectPromise)return void await this.connectPromise;await this.connect()}}}function Tg(e){return Object.getOwnPropertySymbols(e).filter((t=>Object.prototype.propertyIsEnumerable.call(e,t)))}function Pg(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Eg="[object Arguments]",Cg="[object Object]";function kg(){}function _g(e){if(!e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&"[object Object]"===Object.prototype.toString.call(e)}function Ig(e,t,r,n,o,s,i){const a=i(e,t,r,n,o,s);if(void 0!==a)return a;if(typeof e==typeof t)switch(typeof e){case"bigint":case"string":case"boolean":case"symbol":case"undefined":case"function":return e===t;case"number":return e===t||Object.is(e,t);case"object":return Sg(e,t,s,i)}return Sg(e,t,s,i)}function Sg(e,t,r,n){if(Object.is(e,t))return!0;let o=Pg(e),s=Pg(t);if(o===Eg&&(o=Cg),s===Eg&&(s=Cg),o!==s)return!1;switch(o){case"[object String]":return e.toString()===t.toString();case"[object Number]":return function(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}(e.valueOf(),t.valueOf());case"[object Boolean]":case"[object Date]":case"[object Symbol]":return Object.is(e.valueOf(),t.valueOf());case"[object RegExp]":return e.source===t.source&&e.flags===t.flags;case"[object Function]":return e===t}const i=(r=r??new Map).get(e),a=r.get(t);if(null!=i&&null!=a)return i===t;r.set(e,t),r.set(t,e);try{switch(o){case"[object Map]":if(e.size!==t.size)return!1;for(const[o,s]of e.entries())if(!t.has(o)||!Ig(s,t.get(o),o,e,t,r,n))return!1;return!0;case"[object Set]":{if(e.size!==t.size)return!1;const o=Array.from(e.values()),s=Array.from(t.values());for(let i=0;i<o.length;i++){const a=o[i],c=s.findIndex((o=>Ig(a,o,void 0,e,t,r,n)));if(-1===c)return!1;s.splice(c,1)}return!0}case"[object Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":case"[object BigUint64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object BigInt64Array]":case"[object Float32Array]":case"[object Float64Array]":if(typeof wd<"u"&&wd.isBuffer(e)!==wd.isBuffer(t)||e.length!==t.length)return!1;for(let o=0;o<e.length;o++)if(!Ig(e[o],t[o],o,e,t,r,n))return!1;return!0;case"[object ArrayBuffer]":return e.byteLength===t.byteLength&&Sg(new Uint8Array(e),new Uint8Array(t),r,n);case"[object DataView]":return e.byteLength===t.byteLength&&e.byteOffset===t.byteOffset&&Sg(new Uint8Array(e),new Uint8Array(t),r,n);case"[object Error]":return e.name===t.name&&e.message===t.message;case Cg:{if(!(Sg(e.constructor,t.constructor,r,n)||_g(e)&&_g(t)))return!1;const o=[...Object.keys(e),...Tg(e)],s=[...Object.keys(t),...Tg(t)];if(o.length!==s.length)return!1;for(let s=0;s<o.length;s++){const i=o[s],a=e[i];if(!Object.hasOwn(t,i))return!1;if(!Ig(a,t[i],i,e,t,r,n))return!1}return!0}default:return!1}}finally{r.delete(e),r.delete(t)}}function xg(e,t){return function(e,t,r){return Ig(e,t,void 0,void 0,void 0,void 0,r)}(e,t,kg)}var Bg=Object.defineProperty,Og=Object.getOwnPropertySymbols,Mg=Object.prototype.hasOwnProperty,Wg=Object.prototype.propertyIsEnumerable,jg=(e,t,r)=>t in e?Bg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Rg=(e,t)=>
708{for(var r in t||(t={}))Mg.call(t,r)&&jg(e,r,t[r]);if(Og)for(var r of Og(t))Wg.call(t,r)&&jg(e,r,t[r]);return e},Ng=(e,t,r)=>jg(e,"symbol"!=typeof t?t+"":t,r);class Ug extends M{constructor(e,t,r,n=Td,o=void 0){super(e,t,r,n),this.core=e,this.logger=t,this.name=r,Ng(this,"map",new Map),Ng(this,"version","0.3"),Ng(this,"cached",[]),Ng(this,"initialized",!1),Ng(this,"getKey"),Ng(this,"storagePrefix",Td),Ng(this,"recentlyDeleted",[]),Ng(this,"recentlyDeletedLimit",200),Ng(this,"init",(async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach((e=>{this.getKey&&null!==e&&!fu(e)?this.map.set(this.getKey(e),e):function(e){var t;return null==(t=e?.proposer)?void 0:t.publicKey}(e)?this.map.set(e.id,e):function(e){return e?.topic}(e)&&this.map.set(e.topic,e)})),this.cached=[],this.initialized=!0)})),Ng(this,"set",(async(e,t)=>{this.isInitialized(),this.map.has(e)?await this.update(e,t):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:e,value:t}),this.map.set(e,t),await this.persist())})),Ng(this,"get",(e=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:e}),this.getData(e)))),Ng(this,"getAll",(e=>(this.isInitialized(),e?this.values.filter((t=>Object.keys(e).every((r=>xg(t[r],e[r]))))):this.values))),Ng(this,"update",(async(e,t)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:e,update:t});const r=Rg(Rg({},this.getData(e)),t);this.map.set(e,r),await this.persist()})),Ng(this,"delete",(async(e,t)=>{this.isInitialized(),this.map.has(e)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:e,reason:t}),this.map.delete(e),this.addToRecentlyDeleted(e),await this.persist())})),this.logger=(0,P.U5)(t,this.name),this.storagePrefix=n,this.getKey=o}get context(){return(0,P.oI)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const t=this.map.get(e);if(!t){if(this.recentlyDeleted.includes(e)){const{message:t}=uu("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(t),new Error(t)}const{message:t}=uu("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(t),new Error(t)}return t}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:e}=uu("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),new Error(e)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=uu("NOT_INITIALIZED",this.name);throw new Error(e)}}}var Dg=Object.defineProperty,Lg=(e,t,r)=>((e,t,r)=>t in e?Dg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class Fg{constructor(e,t){this.core=e,this.logger=t,Lg(this,"name","pairing"),Lg(this,"version","0.3"),Lg(this,"events",new n),Lg(this,"pairings"),Lg(this,"initialized",!1),Lg(this,"storagePrefix",Td),Lg(this,"ignoredPayloadTypes",[1]),Lg(this,"registeredMethods",[]),Lg(this,"init",(async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))})),Lg(this,"register",(({methods:e})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...e])]})),Lg(this,"create",(async e=>{this.isInitialized();const t=wl(),r=await this.core.crypto.setSymKey(t),n=io(s.FIVE_MINUTES),o={protocol:"irn"},i={topic:r,expiry:n,relay:o,active:!1,methods:e?.methods},a=Hl({protocol:this.core.protocol,version:this.core.version,topic:r,symKey:t,relay:o,expiryTimestamp:n,methods:e?.methods});return this.events.emit(Jd,i),this.core.expirer.set(r,n),await this.pairings.set(r,i),await this.core.relayer.subscribe(r,{transportType:e?.transportType,internal:e?.internal}),{topic:r,uri:a}})),Lg(this,"pair",(async e=>{this.isInitialized();const t=this.core.eventClient.createEvent({properties:{topic:e?.uri,trace:[hh]}});this.isValidPair(e,t);const{topic:r,symKey:n,relay:o,expiryTimestamp:i,methods:a}=Vl(e.uri);let c;if(t.props.properties.topic=r,t.addTrace(ph),t.addTrace(fh),this.pairings.keys.includes(r)){if(c=this.pairings.get(r),t.addTrace(bh),c.active)throw t.setError(Eh),new Error(`Pairing already exists: ${r}. Please try again with a new connection URI.`);t.addTrace(wh)}const l=i||io(s.FIVE_MINUTES),u={topic:r,relay:o,expiry:l,active:!1,methods:a};this.core.expirer.set(r,l),await this.pairings.set(r,u),t.addTrace(gh),e.activatePairing&&await this.activate({topic:r}),this.events.emit(Jd,u),t.addTrace(vh),this.core.crypto.keychain.has(r)||await this.core.crypto.setSymKey(n,r),t.addTrace(mh);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{t.setError(Th)}try{await this.core.relayer.subscribe(r,{relay:o})}catch(e){throw t.setError(Ch),e}return t.addTrace(yh),u})),Lg(this,"activate",(async({topic:e})=>{this.isInitialized();const t=io(s.FIVE_MINUTES);this.core.expirer.set(e,t),await this.pairings.update(e,{active:!0,expiry:t})})),Lg(this,"ping",(async e=>{this.isInitialized(),await this.isValidPing(e),this.logger.warn("ping() is deprecated and will be removed in the next major release.");const{topic:t}=e;if(this.pairings.keys.includes(t)){const e=await this.sendRequest(t,"wc_pairingPing",{}),{done:r,resolve:n,reject:o}=ro();this.events.once(co("pairing_ping",e),(({error:e})=>{e?o(e):n()})),await r()}})),Lg(this,"updateExpiry",(async({topic:e,expiry:t})=>{this.isInitialized(),await this.pairings.update(e,{expiry:t})})),Lg(this,"updateMetadata",(async({topic:e,metadata:t})=>{this.isInitialized(),await this.pairings.update(e,{peerMetadata:t})})),Lg(this,"getPairings",(()=>(this.isInitialized(),this.pairings.values))),Lg(this,"disconnect",(async e=>{this.isInitialized(),await this.isValidDisconnect(e);const{topic:t}=e;this.pairings.keys.includes(t)&&(await this.sendRequest(t,"wc_pairingDelete",du("USER_DISCONNECTED")),await this.deletePairing(t))})),Lg(this,"formatUriFromPairing",(e=>{this.isInitialized();const{topic:t,relay:r,expiry:n,methods:o}=e,s=this.core.crypto.keychain.get(t);return Hl({protocol:this.core.protocol,version:this.core.version,topic:t,symKey:s,relay:r,expiryTimestamp:n,methods:o})})),Lg(this,"sendRequest",(async(e,t,r)=>{const n=ed(t,r),o=await this.core.crypto.encode(e,n),s=Yd[t].req;return this.core.history.set(e,n),this.core.relayer.publish(e,o,s),n.id})),Lg(this,"sendResult",(async(e,t,r)=>{const n=td(e,r),o=await this.core.crypto.encode(t,n),s=(await this.core.history.get(t,e)).request.method,i=Yd[s].res;await this.core.relayer.publish(t,o,i),await this.core.history.resolve(n)})),Lg(this,"sendError",(async(e,t,r)=>{const n=rd(e,r),o=await this.core.crypto.encode(t,n),s=(await this.core.history.get(t,e)).request.method,i=Yd[s]?Yd[s].res:Yd.unregistered_method.res;await this.core.relayer.publish(t,o,i),await this.core.history.resolve(n)})),Lg(this,"deletePairing",(async(e,t)=>{await this.core.relayer.unsubscribe(e),await Promise.all([this.pairings.delete(e,du("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(e),t?Promise.resolve():this.core.expirer.del(e)])})),Lg(this,"cleanup",(async()=>{const e=this.pairings.getAll().filter((e=>ao(e.expiry)));await Promise.all(e.map((e=>this.deletePairing(e.topic))))})),Lg(this,"onRelayEventRequest",(async e=>{const{topic:t,payload:r}=e;switch(r.method){case"wc_pairingPing":return await this.onPairingPingRequest(t,r);case"wc_pairingDelete":return await this.onPairingDeleteRequest(t,r);default:return await this.onUnknownRpcMethodRequest(t,r)}})),Lg(this,"onRelayEventResponse",(async e=>{const{topic:t,payload:r}=e,n=(await this.core.history.get(t,r.id)).request.method;return"wc_pairingPing"===n?this.onPairingPingResponse(t,r):this.onUnknownRpcMethodResponse(n)})),Lg(this,"onPairingPingRequest",(async(e,t)=>{const{id:r}=t;try{this.isValidPing({topic:e}),await this.sendResult(r,e,!0),this.events.emit(Xd,{id:r,topic:e})}catch(t){await this.sendError(r,e,t),this.logger.error(t)}})),Lg(this,"onPairingPingResponse",((e,t)=>
708{const{id:r}=t;setTimeout((()=>{pd(t)?this.events.emit(co("pairing_ping",r),{}):fd(t)&&this.events.emit(co("pairing_ping",r),{error:t.error})}),500)})),Lg(this,"onPairingDeleteRequest",(async(e,t)=>{const{id:r}=t;try{this.isValidDisconnect({topic:e}),await this.deletePairing(e),this.events.emit(Zd,{id:r,topic:e})}catch(t){await this.sendError(r,e,t),this.logger.error(t)}})),Lg(this,"onUnknownRpcMethodRequest",(async(e,t)=>{const{id:r,method:n}=t;try{if(this.registeredMethods.includes(n))return;const t=du("WC_METHOD_UNSUPPORTED",n);await this.sendError(r,e,t),this.logger.error(t)}catch(t){await this.sendError(r,e,t),this.logger.error(t)}})),Lg(this,"onUnknownRpcMethodResponse",(e=>{this.registeredMethods.includes(e)||this.logger.error(du("WC_METHOD_UNSUPPORTED",e))})),Lg(this,"isValidPair",((e,t)=>{var r;if(!Eu(e)){const{message:r}=uu("MISSING_OR_INVALID",`pair() params: ${e}`);throw t.setError(Ph),new Error(r)}if(!function(e){function t(e){try{return typeof new URL(e)<"u"}catch{return!1}}try{if(gu(e,!1))return!!t(e)||t(go(e))}catch{}return!1}(e.uri)){const{message:r}=uu("MISSING_OR_INVALID",`pair() uri: ${e.uri}`);throw t.setError(Ph),new Error(r)}const n=Vl(e?.uri);if(null==(r=n?.relay)||!r.protocol){const{message:e}=uu("MISSING_OR_INVALID","pair() uri#relay-protocol");throw t.setError(Ph),new Error(e)}if(null==n||!n.symKey){const{message:e}=uu("MISSING_OR_INVALID","pair() uri#symKey");throw t.setError(Ph),new Error(e)}if(null!=n&&n.expiryTimestamp&&(0,s.toMiliseconds)(n?.expiryTimestamp)<Date.now()){t.setError(kh);const{message:e}=uu("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw new Error(e)}})),Lg(this,"isValidPing",(async e=>{if(!Eu(e)){const{message:t}=uu("MISSING_OR_INVALID",`ping() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidPairingTopic(t)})),Lg(this,"isValidDisconnect",(async e=>{if(!Eu(e)){const{message:t}=uu("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidPairingTopic(t)})),Lg(this,"isValidPairingTopic",(async e=>{if(!gu(e,!1)){const{message:t}=uu("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(t)}if(!this.pairings.keys.includes(e)){const{message:t}=uu("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(t)}if(ao(this.pairings.get(e).expiry)){await this.deletePairing(e);const{message:t}=uu("EXPIRED",`pairing topic: ${e}`);throw new Error(t)}})),this.core=e,this.logger=(0,P.U5)(t,this.name),this.pairings=new Ug(this.core,this.logger,this.name,this.storagePrefix)}get context(){return(0,P.oI)(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=uu("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Sd,(async e=>{const{topic:t,message:r,transportType:n}=e;if(this.pairings.keys.includes(t)&&n!==Fd.link_mode&&!this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(r)))try{const e=await this.core.crypto.decode(t,r);dd(e)?(this.core.history.set(t,e),await this.onRelayEventRequest({topic:t,payload:e})):hd(e)&&(await this.core.history.resolve(e),await this.onRelayEventResponse({topic:t,payload:e}),this.core.history.delete(t,e.id)),await this.core.relayer.messages.ack(t,r)}catch(e){this.logger.error(e)}}))}registerExpirerEvents(){this.core.expirer.on(ih,(async e=>{const{topic:t}=so(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit(Qd,{topic:t}))}))}}var zg=Object.defineProperty,Vg=(e,t,r)=>((e,t,r)=>t in e?zg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class qg extends S{constructor(e,t){super(e,t),this.core=e,this.logger=t,Vg(this,"records",new Map),Vg(this,"events",new n.EventEmitter),Vg(this,"name","history"),Vg(this,"version","0.3"),Vg(this,"cached",[]),Vg(this,"initialized",!1),Vg(this,"storagePrefix",Td),Vg(this,"init",(async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach((e=>this.records.set(e.id,e))),this.cached=[],this.registerEventListeners(),this.initialized=!0)})),Vg(this,"set",((e,t,r)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:e,request:t,chainId:r}),this.records.has(t.id))return;const n={id:t.id,topic:e,request:{method:t.method,params:t.params||null},chainId:r,expiry:io(s.THIRTY_DAYS)};this.records.set(n.id,n),this.persist(),this.events.emit(eh,n)})),Vg(this,"resolve",(async e=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:e}),!this.records.has(e.id))return;const t=await this.getRecord(e.id);typeof t.response>"u"&&(t.response=fd(e)?{error:e.error}:{result:e.result},this.records.set(t.id,t),this.persist(),this.events.emit(th,t))})),Vg(this,"get",(async(e,t)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:e,id:t}),await this.getRecord(t)))),Vg(this,"delete",((e,t)=>
708{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:t}),this.values.forEach((r=>{if(r.topic===e){if(typeof t<"u"&&r.id!==t)return;this.records.delete(r.id),this.events.emit(rh,r)}})),this.persist()})),Vg(this,"exists",(async(e,t)=>(this.isInitialized(),!!this.records.has(t)&&(await this.getRecord(t)).topic===e))),Vg(this,"on",((e,t)=>{this.events.on(e,t)})),Vg(this,"once",((e,t)=>{this.events.once(e,t)})),Vg(this,"off",((e,t)=>{this.events.off(e,t)})),Vg(this,"removeListener",((e,t)=>{this.events.removeListener(e,t)})),this.logger=(0,P.U5)(t,this.name)}get context(){return(0,P.oI)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach((t=>{if(typeof t.response<"u")return;const r={topic:t.topic,request:ed(t.request.method,t.request.params,t.id),chainId:t.chainId};return e.push(r)})),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const t=this.records.get(e);if(!t){const{message:t}=uu("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(t)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(nh)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:e}=uu("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),new Error(e)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(eh,(e=>{const t=eh;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})})),this.events.on(th,(e=>{const t=th;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})})),this.events.on(rh,(e=>{const t=rh;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})})),this.core.heartbeat.on(l,(()=>{this.cleanup()}))}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach((t=>{(0,s.toMiliseconds)(t.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${t.id}`),this.records.delete(t.id),this.events.emit(rh,t,!1),e=!0)})),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=uu("NOT_INITIALIZED",this.name);throw new Error(e)}}}var Hg=Object.defineProperty,Kg=(e,t,r)=>((e,t,r)=>t in e?Hg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class $g extends j{constructor(e,t){super(e,t),this.core=e,this.logger=t,Kg(this,"expirations",new Map),Kg(this,"events",new n.EventEmitter),Kg(this,"name","expirer"),Kg(this,"version","0.3"),Kg(this,"cached",[]),Kg(this,"initialized",!1),Kg(this,"storagePrefix",Td),Kg(this,"init",(async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach((e=>this.expirations.set(e.target,e))),this.cached=[],this.registerEventListeners(),this.initialized=!0)})),Kg(this,"has",(e=>{try{const t=this.formatTarget(e);return typeof this.getExpiration(t)<"u"}catch{return!1}})),Kg(this,"set",((e,t)=>{this.isInitialized();const r=this.formatTarget(e),n={target:r,expiry:t};this.expirations.set(r,n),this.checkExpiry(r,n),this.events.emit(oh,{target:r,expiration:n})})),Kg(this,"get",(e=>{this.isInitialized();const t=this.formatTarget(e);return this.getExpiration(t)})),Kg(this,"del",(e=>{if(this.isInitialized(),this.has(e)){const t=this.formatTarget(e),r=this.getExpiration(t);this.expirations.delete(t),this.events.emit(sh,{target:t,expiration:r})}})),Kg(this,"on",((e,t)=>{this.events.on(e,t)})),Kg(this,"once",((e,t)=>
708{this.events.once(e,t)})),Kg(this,"off",((e,t)=>{this.events.off(e,t)})),Kg(this,"removeListener",((e,t)=>{this.events.removeListener(e,t)})),this.logger=(0,P.U5)(t,this.name)}get context(){return(0,P.oI)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if("string"==typeof e)return function(e){return oo("topic",e)}(e);if("number"==typeof e)return function(e){return oo("id",e)}(e);const{message:t}=uu("UNKNOWN_TYPE","Target type: "+typeof e);throw new Error(t)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(ah)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:e}=uu("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),new Error(e)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const t=this.expirations.get(e);if(!t){const{message:t}=uu("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(t),new Error(t)}return t}checkExpiry(e,t){const{expiry:r}=t;(0,s.toMiliseconds)(r)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(ih,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach(((e,t)=>this.checkExpiry(t,e)))}registerEventListeners(){this.core.heartbeat.on(l,(()=>this.checkExpirations())),this.events.on(oh,(e=>{const t=oh;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})),this.events.on(ih,(e=>{const t=ih;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})),this.events.on(sh,(e=>{const t=sh;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}))}isInitialized(){if(!this.initialized){const{message:e}=uu("NOT_INITIALIZED",this.name);throw new Error(e)}}}var Gg=Object.defineProperty,Yg=(e,t,r)=>((e,t,r)=>t in e?Gg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class Jg extends R{constructor(e,t,r){super(e,t,r),this.core=e,this.logger=t,this.store=r,Yg(this,"name","verify-api"),Yg(this,"abortController"),Yg(this,"isDevEnv"),Yg(this,"verifyUrlV3",uh),Yg(this,"storagePrefix",Td),Yg(this,"version",2),Yg(this,"publicKey"),Yg(this,"fetchPromise"),Yg(this,"init",(async()=>{var e;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&(0,s.toMiliseconds)(null==(e=this.publicKey)?void 0:e.expiresAt)<Date.now()&&(this.logger.debug("verify v2 public key expired"),await this.removePublicKey()))})),Yg(this,"register",(async e=>{if(!Kn()||this.isDevEnv)return;const t=window.location.origin,{id:r,decryptedId:n}=e,o=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${t}&id=${r}&decryptedId=${n}`;try{const e=(0,fn.getDocument)(),t=this.startAbortTimer(5*s.ONE_SECOND),n=await new Promise(((n,s)=>{const i=()=>{window.removeEventListener("message",c),e.body.removeChild(a),s("attestation aborted")};this.abortController.signal.addEventListener("abort",i);const a=e.createElement("iframe");a.src=o,a.style.display="none",a.addEventListener("error",i,{signal:this.abortController.signal});const c=o=>{if(o.data&&"string"==typeof o.data)try{const s=JSON.parse(o.data);if("verify_attestation"===s.type){if(un(s.attestation).payload.id!==r)return;clearInterval(t),e.body.removeChild(a),this.abortController.signal.removeEventListener("abort",i),window.removeEventListener("message",c),n(null===s.attestation?"":s.attestation)}}catch(e){this.logger.warn(e)}};e.body.appendChild(a),window.addEventListener("message",c,{signal:this.abortController.signal})}));return this.logger.debug(n,"jwt attestation"),n}catch(e){this.logger.warn(e)}return""})),Yg(this,"resolve",(async e=>{if(this.isDevEnv)return"";const{attestationId:t,hash:r,encryptedId:n}=e;if(""===t)return void this.logger.debug("resolve: attestationId is empty, skipping");if(t){if(un(t).payload.id!==n)return;const e=await this.isValidJwtAttestation(t);
708if(e)return e.isVerified?e:void this.logger.warn("resolve: jwt attestation: origin url not verified")}if(!r)return;const o=this.getVerifyUrl(e?.verifyUrl);return this.fetchAttestation(r,o)})),Yg(this,"fetchAttestation",(async(e,t)=>{this.logger.debug(`resolving attestation: ${e} from url: ${t}`);const r=this.startAbortTimer(5*s.ONE_SECOND),n=await fetch(`${t}/attestation/${e}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(r),200===n.status?await n.json():void 0})),Yg(this,"getVerifyUrl",(e=>{let t=e||lh;return dh.includes(t)||(this.logger.info(`verify url: ${t}, not included in trusted list, assigning default: ${lh}`),t=lh),t})),Yg(this,"fetchPublicKey",(async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const e=this.startAbortTimer(s.FIVE_SECONDS),t=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(e),await t.json()}catch(e){this.logger.warn(e)}})),Yg(this,"persistPublicKey",(async e=>{this.logger.debug(e,"persisting public key to local storage"),await this.store.setItem(this.storeKey,e),this.publicKey=e})),Yg(this,"removePublicKey",(async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0})),Yg(this,"isValidJwtAttestation",(async e=>{const t=await this.getPublicKey();try{if(t)return this.validateAttestation(e,t)}catch(e){this.logger.error(e),this.logger.warn("error validating attestation")}const r=await this.fetchAndPersistPublicKey();try{if(r)return this.validateAttestation(e,r)}catch(e){this.logger.error(e),this.logger.warn("error validating attestation")}})),Yg(this,"getPublicKey",(async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey())),Yg(this,"fetchAndPersistPublicKey",(async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise((async e=>{const t=await this.fetchPublicKey();t&&(await this.persistPublicKey(t),e(t))}));const e=await this.fetchPromise;return this.fetchPromise=void 0,e})),Yg(this,"validateAttestation",((e,t)=>{const r=Bl(e,t.publicKey),n={hasExpired:(0,s.toMiliseconds)(r.exp)<Date.now(),payload:r};if(n.hasExpired)throw this.logger.warn("resolve: jwt attestation expired"),new Error("JWT attestation expired");return{origin:n.payload.origin,isScam:n.payload.isScam,isVerified:n.payload.isVerified}})),this.logger=(0,P.U5)(t,this.name),this.abortController=new AbortController,this.isDevEnv=fo(),this.init()}get storeKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//verify:public:key"}get context(){return(0,P.oI)(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout((()=>this.abortController.abort()),(0,s.toMiliseconds)(e))}}var Qg=Object.defineProperty,Zg=(e,t,r)=>((e,t,r)=>t in e?Qg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class Xg extends N{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,Zg(this,"context","echo"),Zg(this,"registerDeviceToken",(async e=>{const{clientId:t,token:r,notificationType:n,enableEncrypted:o=!1}=e,s=`https://echo.walletconnect.com/${this.projectId}/clients`;await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:t,type:n,token:r,always_raw:o})})})),this.logger=(0,P.U5)(t,this.context)}}var em=Object.defineProperty,tm=Object.getOwnPropertySymbols,rm=Object.prototype.hasOwnProperty,nm=Object.prototype.propertyIsEnumerable,om=(e,t,r)=>t in e?em(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,sm=(e,t)=>{for(var r in t||(t={}))rm.call(t,r)&&om(e,r,t[r]);if(tm)for(var r of tm(t))nm.call(t,r)&&om(e,r,t[r]);return e},im=(e,t,r)=>om(e,"symbol"!=typeof t?t+"":t,r);class am extends U{constructor(e,t,r=!0){super(e,t,r),this.core=e,this.logger=t,im(this,"context","event-client"),im(this,"storagePrefix",Td),im(this,"storageVersion",.1),im(this,"events",new Map),im(this,"shouldPersist",!1),im(this,"init",(async()=>{if(!fo())try{const e={eventId:po(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:Qn(this.core.relayer.protocol,this.core.relayer.version,Ld)}}};await this.sendEvent([e])}catch(e){this.logger.warn(e)}})),im(this,"createEvent",(e=>{const{event:t="ERROR",type:r="",properties:{topic:n,trace:o}}=e,s=po(),i=this.core.projectId||"",a=Date.now(),c=sm({eventId:s,timestamp:a,props:{event:t,type:r,properties:{topic:n,trace:o}},bundleId:i,domain:this.getAppDomain()},this.setMethods(s));return this.telemetryEnabled&&(this.events.set(s,c),this.shouldPersist=!0),c})),im(this,"getEvent",(e=>{const{eventId:t,topic:r}=e;if(t)return this.events.get(t);const n=Array.from(this.events.values()).find((e=>e.props.properties.topic===r));return n?sm(sm({},n),this.setMethods(n.eventId)):void 0})),im(this,"deleteEvent",(e=>{const{eventId:t}=e;this.events.delete(t),this.shouldPersist=!0})),im(this,"setEventListeners",(()=>{this.core.heartbeat.on(l,(async()=>
708{this.shouldPersist&&await this.persist(),this.events.forEach((e=>{(0,s.fromMiliseconds)(Date.now())-(0,s.fromMiliseconds)(e.timestamp)>86400&&(this.events.delete(e.eventId),this.shouldPersist=!0)}))}))})),im(this,"setMethods",(e=>({addTrace:t=>this.addTrace(e,t),setError:t=>this.setError(e,t)}))),im(this,"addTrace",((e,t)=>{const r=this.events.get(e);r&&(r.props.properties.trace.push(t),this.events.set(e,r),this.shouldPersist=!0)})),im(this,"setError",((e,t)=>{const r=this.events.get(e);r&&(r.props.type=t,r.timestamp=Date.now(),this.events.set(e,r),this.shouldPersist=!0)})),im(this,"persist",(async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1})),im(this,"restore",(async()=>{try{const e=await this.core.storage.getItem(this.storageKey)||[];if(!e.length)return;e.forEach((e=>{this.events.set(e.eventId,sm(sm({},e),this.setMethods(e.eventId)))}))}catch(e){this.logger.warn(e)}})),im(this,"submit",(async()=>{if(!this.telemetryEnabled||0===this.events.size)return;const e=[];for(const[t,r]of this.events)r.props.type&&e.push(r);if(0!==e.length)try{if((await this.sendEvent(e)).ok)for(const t of e)this.events.delete(t.eventId),this.shouldPersist=!0}catch(e){this.logger.warn(e)}})),im(this,"sendEvent",(async e=>{const t=this.getAppDomain()?"":"&sp=desktop";return await fetch(`https://pulse.walletconnect.org/batch?projectId=${this.core.projectId}&st=events_sdk&sv=js-${Ld}${t}`,{method:"POST",body:JSON.stringify(e)})})),im(this,"getAppDomain",(()=>Jn().url)),this.logger=(0,P.U5)(t,this.context),this.telemetryEnabled=r,r?this.restore().then((async()=>{await this.submit(),this.setEventListeners()})):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var cm=Object.defineProperty,lm=Object.getOwnPropertySymbols,um=Object.prototype.hasOwnProperty,dm=Object.prototype.propertyIsEnumerable,hm=(e,t,r)=>t in e?cm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,pm=(e,t)=>{for(var r in t||(t={}))um.call(t,r)&&hm(e,r,t[r]);if(lm)for(var r of lm(t))dm.call(t,r)&&hm(e,r,t[r]);return e},fm=(e,t,r)=>hm(e,"symbol"!=typeof t?t+"":t,r);class gm extends k{constructor(e){var t;super(e),fm(this,"protocol","wc"),fm(this,"version",2),fm(this,"name",Ad),fm(this,"relayUrl"),fm(this,"projectId"),fm(this,"customStoragePrefix"),fm(this,"events",new n.EventEmitter),fm(this,"logger"),fm(this,"heartbeat"),fm(this,"relayer"),fm(this,"crypto"),fm(this,"storage"),fm(this,"history"),fm(this,"expirer"),fm(this,"pairing"),fm(this,"verify"),fm(this,"echoClient"),fm(this,"linkModeSupportedApps"),fm(this,"eventClient"),fm(this,"initialized",!1),fm(this,"logChunkController"),fm(this,"on",((e,t)=>this.events.on(e,t))),fm(this,"once",((e,t)=>this.events.once(e,t))),fm(this,"off",((e,t)=>this.events.off(e,t))),fm(this,"removeListener",((e,t)=>this.events.removeListener(e,t))),fm(this,"dispatchEnvelope",(({topic:e,message:t,sessionExists:r})=>{if(!e||!t)return;const n={topic:e,message:t,publishedAt:Date.now(),transportType:Fd.link_mode};this.relayer.onLinkMessageEvent(n,{sessionExists:r})}));const r=this.getGlobalCore(e?.customStoragePrefix);if(r)try{return this.customStoragePrefix=r.customStoragePrefix,this.logger=r.logger,this.heartbeat=r.heartbeat,this.crypto=r.crypto,this.history=r.history,this.expirer=r.expirer,this.storage=r.storage,this.relayer=r.relayer,this.pairing=r.pairing,this.verify=r.verify,this.echoClient=r.echoClient,this.linkModeSupportedApps=r.linkModeSupportedApps,this.eventClient=r.eventClient,this.initialized=r.initialized,this.logChunkController=r.logChunkController,r}catch(e){console.warn("Failed to copy global core",e)}this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||Id,this.customStoragePrefix=null!=e&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const o=(0,P.iP)({level:"string"==typeof e?.logger&&e.logger?e.logger:Pd,name:Ad}),{logger:s,chunkLoggerController:i}=(0,P.D5)({opts:o,maxSizeInBytes:e?.maxLogBlobSizeInBytes,loggerOverride:e?.logger});this.logChunkController=i,null!=(t=this.logChunkController)&&t.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var e,t;null!=(e=this.logChunkController)&&e.downloadLogsBlobInBrowser&&(null==(t=this.logChunkController)||t.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=(0,P.U5)(s,this.name),this.heartbeat=new u,this.crypto=new Mf(this,this.logger,e?.keychain),this.history=new qg(this,this.logger),this.expirer=new $g(this,this.logger),this.storage=null!=e&&e.storage?e.storage:new T(pm(pm({},Ed),e?.storageOptions)),this.relayer=new Ag({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new Fg(this,this.logger),this.verify=new Jg(this,this.logger,this.storage),this.echoClient=new Xg(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new am(this,this.logger,e?.telemetryEnabled),this.setGlobalCore(this)}static async init(e){const t=new gm(e);await t.initialize();const r=await t.crypto.getClientId();return await t.storage.setItem("WALLETCONNECT_CLIENT_ID",r),t}get context(){return(0,P.oI)(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return null==(e=this.logChunkController)?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(qd,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(
708),await this.pairing.init(),this.linkModeSupportedApps=await this.storage.getItem(qd)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(e,`Core Initialization Failure at epoch ${Date.now()}`),this.logger.error(e.message),e}}getGlobalCore(e=""){try{if(this.isGlobalCoreDisabled())return;const t=`_walletConnectCore_${e}`,r=`${t}_count`;return globalThis[r]=(globalThis[r]||0)+1,globalThis[r]>1&&console.warn(`WalletConnect Core is already initialized. This is probably a mistake and can lead to unexpected behavior. Init() was called ${globalThis[r]} times.`),globalThis[t]}catch(e){return void console.warn("Failed to get global WalletConnect core",e)}}setGlobalCore(e){var t;try{if(this.isGlobalCoreDisabled())return;const r=`_walletConnectCore_${(null==(t=e.opts)?void 0:t.customStoragePrefix)||""}`;globalThis[r]=e}catch(e){console.warn("Failed to set global WalletConnect core",e)}}isGlobalCoreDisabled(){try{return typeof vd<"u"&&"true"===vd.env.DISABLE_GLOBAL_CORE}catch{return!0}}}const mm=gm;const ym="client",bm=`wc@2:${ym}:`,wm=ym,vm="error",Am="WALLETCONNECT_DEEPLINK_CHOICE",Tm="Proposal expired",Pm=s.SEVEN_DAYS,Em={wc_sessionPropose:{req:{ttl:s.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:s.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:s.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:s.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:s.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:s.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:s.ONE_DAY,prompt:!1,tag:1104},res:{ttl:s.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:s.ONE_DAY,prompt:!1,tag:1106},res:{ttl:s.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:s.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:s.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:s.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:s.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:s.ONE_DAY,prompt:!1,tag:1112},res:{ttl:s.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:s.ONE_DAY,prompt:!1,tag:1114},res:{ttl:s.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:s.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:s.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:s.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:s.FIVE_MINUTES,prompt:!1,tag:1119}}},Cm={min:s.FIVE_MINUTES,max:s.SEVEN_DAYS},km="IDLE",_m="ACTIVE",Im={eth_sendTransaction:{key:""},eth_sendRawTransaction:{key:""},wallet_sendCalls:{key:""},solana_signTransaction:{key:"signature"},solana_signAllTransactions:{key:"transactions"},solana_signAndSendTransaction:{key:"signature"},sui_signAndExecuteTransaction:{key:"digest"},sui_signTransaction:{key:""},hedera_signAndExecuteTransaction:{key:"transactionId"},hedera_executeTransaction:{key:"transactionId"},near_signTransaction:{key:""},near_signTransactions:{key:""},tron_signTransaction:{key:"txID"},xrpl_signTransaction:{key:""},xrpl_signTransactionFor:{key:""},algo_signTxn:{key:""},sendTransfer:{key:"txid"},stacks_stxTransfer:{key:"txId"},polkadot_signTransaction:{key:""},cosmos_signDirect:{key:""}},Sm=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],xm="[email protected]:auth:",Bm=`${xm}:PUB_KEY`;var Om=Object.defineProperty,Mm=Object.defineProperties,Wm=Object.getOwnPropertyDescriptors,jm=Object.getOwnPropertySymbols,Rm=Object.prototype.hasOwnProperty,Nm=Object.prototype.propertyIsEnumerable,Um=(e,t,r)=>t in e?Om(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Dm=(e,t)=>{for(var r in t||(t={}))Rm.call(t,r)&&Um(e,r,t[r]);if(jm)for(var r of jm(t))Nm.call(t,r)&&Um(e,r,t[r]);return e},Lm=(e,t)=>Mm(e,Wm(t)),Fm=(e,t,r)=>Um(e,"symbol"!=typeof t?t+"":t,r);class zm extends z{constructor(e){super(e),Fm(this,"name","engine"),Fm(this,"events",new n),Fm(this,"initialized",!1),Fm(this,"requestQueue",{state:km,queue:[]}),Fm(this,"sessionRequestQueue",{state:km,queue:[]}),Fm(this,"emittedSessionRequests",new mo({limit:500})),Fm(this,"requestQueueDelay",s.ONE_SECOND),Fm(this,"expectedPairingMethodMap",new Map),Fm(this,"recentlyDeletedMap",new Map),Fm(this,"recentlyDeletedLimit",200),Fm(this,"relayMessageCache",[]),Fm(this,"pendingSessions",new Map),Fm(this,"init",(async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(Em)}),this.initialized=!0,setTimeout((async()=>{await this.processPendingMessageEvents(),this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()}),(0,s.toMiliseconds)(this.requestQueueDelay)))})),Fm(this,"connect",(async e=>{var t;this.isInitialized(),await this.confirmOnlineStateOrThrow();const r=Lm(Dm({},e),{requiredNamespaces:e.requiredNamespaces||{},optionalNamespaces:e.optionalNamespaces||{}});await this.isValidConnect(r),r.optionalNamespaces=function(e,t){var r,n,o,s,i,a;const c=iu(e),l=iu(t),u={},d=Object.keys(c).concat(Object.keys(l));for(const e of d)u[e]={chains:lo(null==(r=c[e])?void 0:r.chains,null==(n=l[e])?void 0:n.chains),methods:lo(null==(o=c[e])?void 0:o.methods,null==(s=l[e])?void 0:s.methods),events:lo(null==(i=c[e])?void 0:i.events,null==(a=l[e])?void 0:a.events)};return u}(r.requiredNamespaces,r.optionalNamespaces),r.requiredNamespaces={};const{pairingTopic:n,requiredNamespaces:o,optionalNamespaces:i,sessionProperties:a,scopedProperties:c,relays:l,authentication:u,walletPay:d}=r,h=(null==(t=u?.[0])?void 0:t.ttl)||Em.wc_sessionPropose.req.ttl||s.FIVE_MINUTES;this.validateRequestExpiry(h);let p,f=n,g=!1;try{if(f){const e=this.client.core.pairing.pairings.get(f);this.client.logger.warn("connect() with existing pairing topic is deprecated and will be removed in the next major release."),g=e.active}}catch(e){throw this.client.logger.error(`connect() -> pairing.get(${f}) failed`),e}if(!f||!g){const{topic:e,uri:t}=await this.client.core.pairing.create({internal:{skipSubscribe:!0}});f=e,p=t}if(!f){const{message:e}=uu("NO_MATCHING_KEY",`connect() pairing topic: ${f}`);throw new Error(e)}const m=await this.client.core.crypto.generateKeyPair(),y=io(h),b=Dm(Lm(Dm(Dm({requiredNamespaces:o,optionalNamespaces:i,relays:l??[{protocol:"irn"}],proposer:{publicKey:m,metadata:this.client.metadata},expiryTimestamp:y,pairingTopic:f},a&&{sessionProperties:a}),c&&{scopedProperties:c}),{id:Zu()}),(u||d)&&{requests:{authentication:u?.map((e=>{const{domain:t,chains:r,nonce:n,uri:o,exp:s,nbf:i,type:a,statement:c,requestId:l,resources:u,signatureTypes:d}=e;return{domain:t,chains:r,nonce:n,type:a??"caip122",aud:o,version:"1",iat:(new Date).toISOString(),exp:s,nbf:i,statement:c,requestId:l,resources:u,signatureTypes:d}})),walletPay:d}}),w=co("session_connect",b.id),{reject:v,resolve:A,done:T}=ro(h,Tm),P=({id:e})=>{e===b.id&&(this.client.events.off("proposal_expire",P),this.pendingSessions.delete(b.i
708d),this.events.emit(w,{error:{message:Tm,code:0}}))};return this.client.events.on("proposal_expire",P),this.events.once(w,(({error:e,session:t})=>{this.client.events.off("proposal_expire",P),e?v(e):t&&A(t)})),await this.setProposal(b.id,b),await this.sendProposeSession({proposal:b,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:{correlationId:b.id}}}).catch((e=>{throw this.deleteProposal(b.id),e})),{uri:p,approval:T}})),Fm(this,"pair",(async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(e)}catch(e){throw this.client.logger.error("pair() failed"),e}})),Fm(this,"approve",(async e=>{var t,r,n;const o=this.client.core.eventClient.createEvent({properties:{topic:null==(t=e?.id)?void 0:t.toString(),trace:[Ih]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(e){throw o.setError(Nh),e}try{await this.isValidProposalId(e?.id)}catch(t){throw this.client.logger.error(`approve() -> proposal.get(${e?.id}) failed`),o.setError(Fh),t}try{await this.isValidApprove(e)}catch(e){throw this.client.logger.error("approve() -> isValidApprove() failed"),o.setError(Lh),e}const{id:s,relayProtocol:i,namespaces:a,sessionProperties:c,scopedProperties:l,sessionConfig:u,proposalRequestsResponses:d}=e,h=this.client.proposal.get(s);this.client.core.eventClient.deleteEvent({eventId:o.eventId});const{pairingTopic:p,proposer:f,requiredNamespaces:g,optionalNamespaces:m}=h;let y=null==(r=this.client.core.eventClient)?void 0:r.getEvent({topic:p});y||(y=null==(n=this.client.core.eventClient)?void 0:n.createEvent({type:Ih,properties:{topic:p,trace:[Ih,Sh]}}));const b=await this.client.core.crypto.generateKeyPair(),w=f.publicKey,v=await this.client.core.crypto.generateSharedKey(b,w),A=Lm(Dm(Dm(Dm({relay:{protocol:i??"irn"},namespaces:a,controller:{publicKey:b,metadata:this.client.metadata},expiry:io(Pm)},c&&{sessionProperties:c}),l&&{scopedProperties:l}),u&&{sessionConfig:u}),{proposalRequestsResponses:d}),T=Fd.relay;y.addTrace(xh);try{await this.client.core.relayer.subscribe(v,{transportType:T,internal:{skipSubscribe:!0}})}catch(e){throw y.setError(Dh),e}y.addTrace(Bh);const P=Lm(Dm({},A),{topic:v,requiredNamespaces:g,optionalNamespaces:m,pairingTopic:p,acknowledged:!1,self:A.controller,peer:{publicKey:f.publicKey,metadata:f.metadata},controller:b,transportType:Fd.relay,authentication:d?.authentication,walletPayResult:d?.walletPay});await this.client.session.set(v,P),y.addTrace(Mh);try{await this.sendApproveSession({sessionTopic:v,proposal:h,pairingProposalResponse:{relay:{protocol:i??"irn"},responderPublicKey:b},sessionSettleRequest:A,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:Dm({correlationId:s},this.getTVFApproveParams(P))}}),y.addTrace(Oh)}catch(e){throw this.client.logger.error(e),this.client.session.delete(v,du("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(v),e}return this.client.core.eventClient.deleteEvent({eventId:y.eventId}),await this.client.core.pairing.updateMetadata({topic:p,metadata:f.metadata}),await this.deleteProposal(s),await this.client.core.pairing.activate({topic:p}),await this.setExpiry(v,io(Pm)),{topic:v,acknowledged:()=>Promise.resolve(this.client.session.get(v))}})),Fm(this,"reject",(async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(e)}catch(e){throw this.client.logger.error("reject() -> isValidReject() failed"),e}const{id:t,reason:r}=e;let n;try{n=this.client.proposal.get(t).pairingTopic}catch(e){throw this.client.logger.error(`reject() -> proposal.get(${t}) failed`),e}n&&await this.sendError({id:t,topic:n,error:r,rpcOpts:Em.wc_sessionPropose.reject}),await this.deleteProposal(t)})),Fm(this,"update",(async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(e)}catch(e){throw this.client.logger.error("update() -> isValidUpdate() failed"),e}const{topic:t,namespaces:r}=e,{done:n,resolve:o,reject:i}=ro(s.FIVE_MINUTES,"Session update request expired without receiving any acknowledgement"),a=Zu(),c=Xu().toString(),l=this.client.session.get(t).namespaces;return this.events.once(co("session_update",a),(({error:e})=>{e?i(e):o()})),await this.client.session.update(t,{namespaces:r}),await this.sendRequest({topic:t,method:"wc_sessionUpdate",params:{namespaces:r},throwOnFailedPublish:!0,clientRpcId:a,relayRpcId:c}).catch((e=>{this.client.logger.error(e),this.client.session.update(t,{namespaces:l}),i(e)})),{acknowledged:n}})),Fm(this,"extend",(async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(e)}catch(e){throw this.client.logger.error("extend() -> isValidExtend() failed"),e}const{topic:t}=e,r=Zu(),{done:n,resolve:o,reject:i}=ro(s.FIVE_MINUTES,"Session extend request expired without receiving any acknowledgement");return this.events.once(co("session_extend",r),(({error:e})=>{e?i(e):o()})),await this.setExpiry(t,io(Pm)),this.sendRequest({topic:t,method:"wc_sessionExtend",params:{},clientRpcId:r,throwOnFailedPublish:!0}).catch((e=>{i(e)})),{acknowledged:n}})),Fm(this,"request",(async e=>{this.isInitialized();try{await this.isValidRequest(e)}catch(e){throw this.client.logger.error("request() -> isValidRequest() failed"),e}const{chainId:t,request:r,topic:n,expiry:o=Em.wc_sessionRequest.req.ttl}=e,s=this.client.session.get(n);s?.transportType===Fd.relay&&await this.confirmOnlineStateOrThrow();const i=Zu(),a=Xu().toString(),{done:c,resolve:l,reject:u}=ro(o,"Request expired. Please try again.");this.events.once(co("session_request",i),(({error:e,result:t})=>{e?u(e):l(t)}));const d="wc_sessionRequest",h=this.getAppLinkIfEnabled(s.peer.metadata,s.transportType);if(h)return await this.sendRequest({clientRpcId:i,relayRpcId:a,topic:n,method:d,params:{request:Lm(Dm({},r),{expiryTimestamp:io(o)}),chainId:t},expiry:o,throwOnFailedPublish:!0,appLink:h}).catch((e=>u(e))),this.client.events.emit("session_request_sent",{topic:n,request:r,chainId:t,id:i}
708),await c();const p={request:Lm(Dm({},r),{expiryTimestamp:io(o)}),chainId:t};return await Promise.all([new Promise((async e=>{await this.sendRequest({clientRpcId:i,relayRpcId:a,topic:n,method:d,params:p,expiry:o,throwOnFailedPublish:!0,tvf:this.getTVFParams(i,p)}).catch((e=>u(e))),this.client.events.emit("session_request_sent",{topic:n,request:r,chainId:t,id:i}),e()})),new Promise((async e=>{var t;if(null==(t=s.sessionConfig)||!t.disableDeepLink){const e=await async function(e,t){let r="";try{if(Kn()&&(r=localStorage.getItem(t),r))return r;r=await e.getItem(t)}catch(e){console.error(e)}return r}(this.client.core.storage,Am);await uo({id:i,topic:n,wcDeepLink:e})}e()})),c()]).then((e=>e[2]))})),Fm(this,"respond",(async e=>{var t,r;this.isInitialized();const n=this.client.core.eventClient.createEvent({properties:{topic:e?.topic||(null==(r=null==(t=e?.response)?void 0:t.id)?void 0:r.toString()),trace:[Wh]}});try{await this.isValidRespond(e)}catch(e){throw n.addTrace(e?.message),n.setError(zh),e}n.addTrace(jh);const{topic:o,response:s}=e,{id:i}=s,a=this.client.session.get(o);a.transportType===Fd.relay&&await this.confirmOnlineStateOrThrow();const c=this.getAppLinkIfEnabled(a.peer.metadata,a.transportType);try{n.addTrace(Rh),pd(s)?await this.sendResult({id:i,topic:o,result:s.result,throwOnFailedPublish:!0,appLink:c}):fd(s)&&await this.sendError({id:i,topic:o,error:s.error,appLink:c}),this.cleanupAfterResponse(e)}catch(e){throw n.addTrace(e?.message),n.setError(Vh),e}})),Fm(this,"ping",(async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(e)}catch(e){throw this.client.logger.error("ping() -> isValidPing() failed"),e}const{topic:t}=e;if(this.client.session.keys.includes(t)){const e=Zu(),r=Xu().toString(),{done:n,resolve:o,reject:i}=ro(s.FIVE_MINUTES,"Ping request expired without receiving any acknowledgement");this.events.once(co("session_ping",e),(({error:e})=>{e?i(e):o()})),await Promise.all([this.sendRequest({topic:t,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:e,relayRpcId:r}),n()])}else this.client.core.pairing.pairings.keys.includes(t)&&(this.client.logger.warn("ping() on pairing topic is deprecated and will be removed in the next major release."),await this.client.core.pairing.ping({topic:t}))})),Fm(this,"emit",(async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(e);const{topic:t,event:r,chainId:n}=e,o=Xu().toString(),s=Zu();await this.sendRequest({topic:t,method:"wc_sessionEvent",params:{event:r,chainId:n},throwOnFailedPublish:!0,relayRpcId:o,clientRpcId:s})})),Fm(this,"disconnect",(async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(e);const{topic:t}=e;if(this.client.session.keys.includes(t))await this.sendRequest({topic:t,method:"wc_sessionDelete",params:du("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:t,emitEvent:!1});else{if(!this.client.core.pairing.pairings.keys.includes(t)){const{message:e}=uu("MISMATCHED_TOPIC",`Session or pairing topic not found: ${t}`);throw new Error(e)}await this.client.core.pairing.disconnect({topic:t})}})),Fm(this,"find",(e=>(this.isInitialized(),this.client.session.getAll().filter((t=>function(e,t){const{requiredNamespaces:r}=t,n=Object.keys(e.namespaces),o=Object.keys(r);let s=!0;return!!Xn(o,n)&&(n.forEach((t=>{const{accounts:n,methods:o,events:i}=e.namespaces[t],a=ru(n),c=r[t];Xn(Sn(t,c),a)&&Xn(c.methods,o)&&Xn(c.events,i)||(s=!1)})),s)}(t,e)))))),Fm(this,"getPendingSessionRequests",(()=>this.client.pendingRequest.getAll())),Fm(this,"authenticate",(async(e,t)=>{var r;this.isInitialized(),this.isValidAuthenticate(e);const n=t&&this.client.core.linkModeSupportedApps.includes(t)&&(null==(r=this.client.metadata.redirect)?void 0:r.linkMode),o=n?Fd.link_mode:Fd.relay;o===Fd.relay&&await this.confirmOnlineStateOrThrow();const{chains:s,statement:i="",uri:a,domain:c,nonce:l,type:u,exp:d,nbf:h,methods:p=[],expiry:f}=e,g=[...e.resources||[]],{topic:m,uri:y}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:o});this.client.logger.info({message:"Generated new pairing",pairing:{topic:m,uri:y}});const b=await this.client.core.crypto.generateKeyPair(),w=vl(b);if(await Promise.all([this.client.auth.authKeys.set(Bm,{responseTopic:w,publicKey:b}),this.client.auth.pairingTopics.set(w,{topic:w,pairingTopic:m})]),await this.client.core.relayer.subscribe(w,{transportType:o}),this.client.logger.info(`sending request to new pairing topic: ${m}`),p.length>0){const{namespace:e}=In(s[0]);let t=ji(e,"request",p);Fi(g)&&(t=Ni(t,g.pop())),g.push(t)}const v=f&&f>Em.wc_sessionAuthenticate.req.ttl?f:Em.wc_sessionAuthenticate.req.ttl,A={authPayload:{type:u??"caip122",chains:s,statement:i,aud:a,domain:c,version:"1",nonce:l,iat:(new Date).toISOString(),exp:d,nbf:h,resources:g},requester:{publicKey:b,metadata:this.client.metadata},expiryTimestamp:io(v)},T={requiredNamespaces:{},optionalNamespaces:{eip155:{chains:s,methods:[...new Set(["personal_sign",...p])],events:["chainChanged","accountsChanged"]}},relays:[{protocol:"irn"}],pairingTopic:m,proposer:{publicKey:b,metadata:this.client.metadata},expiryTimestamp:io(Em.wc_sessionPropose.req.ttl),id:Zu()},{done:P,resolve:E,reject:C}=ro(v,"Request expired"),k=Zu(),_=co("session_connect",T.id),I=co("session_request",k),S=async({error:e,session:t})=>{this.events.off(I,x),e?C(e):t&&E({session:t})},x=async e=>{var r,n,s;if(await this.deletePendingAuthRequest(k,{message:"fulfilled",code:0}),e.error){const t=du("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return e.error.code===t.code?void 0:(this.events.off(_,S),C(e.error.message))}await this.deleteProposal(T.id),this.events.off(_,S);const{cacaos:i,responder:a}=e.result,c=[],l=[];for(const e of i){await Si({cacao:e,projectId:this.client.core.projectId})||(this.client.logger.error(e,"Signature verification failed"),C(du("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:t}=e,r=Fi(t.resources),n=[_i(t.iss)],o=Ii(t.iss);if(r){const e=Di(r),t=Li(r);c.push(...e),n.push(...t)}for(const e of n)l.push(`${e}:${o}`)}const u=await this.client.core.crypto.generateSharedKey(b,a.publicKey);let d;c.length>0&&(d={topic:u,acknowledged:!0,self:{publicKey:b,metadata:this.client.metadata},peer:a,controller:a.publicKey,expiry:io(Pm),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:m,namespaces:au([...new Set(c)],[...new Set(l)]),transportType:o},await this.client.core.relayer.subscribe(u,{transportType:o}),await this.client.session.set(u,d),m&&await this.client.core.pairing.updateMetadata({topic:m,metadata:a.metadata}),d=this.client.session.get(u)),null!=(r=this.client.metadata.redirect)&&r.linkMode&&null!=(n=a.metadata.redirect)&&n.linkMode&&null!=(s=a.metadata.redirect)&&s.universal&&t&&(this.client.core.addLinkModeSupportedApp(a.metadata.redirect.universal),this.client.session.update(u,{transportType:Fd.link_mode})),E({auths:i,session:d})};let B;this.events.once(_,S),this.events.once(I,x);try{if(n){const e=ed("wc_sessionAuthenticate",A,k);this.client.core.history.set(m,e);const r=await this.client.core.crypto.encode("",e,{type:2,encoding:yl});B=Kl(t,m,r)}else await Promise.all([this.sendRequest({topic:m,method:"wc_sessionAuthenticate",params:A,expiry:e.expiry,throwOnFailedPublish:!0,clientRpcId:k}),this.sendRequest({topic:m,method:"wc_sessionPropose",params:T,expiry:Em.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:T.id})])}catch(e){throw this.events.off(_,S),this.events.off(I,x),e}return await this.setProposal(T.id,T),await this.setAuthRequest(k,{request:Lm(Dm({},A),{verifyContext:{}}),pairingTopic:m,transportType:o}),{uri:B??y,response:P}})),Fm(this,"approveSessionAuthenticate",(async e=>{const{id:t,auths:r}=e,n=this.client.core.eventClient.createEvent({properties:{topic:t.toString(),trace:[qh]}});try{this.isInitialized()}catch(e){throw n.setError(Qh),e}const o=this.getPendingAuthRequest(t);if(!o)throw n.setError(tp),new Error(`Could not find pending auth request with id ${t}`);const s=o.transportType||Fd.relay;s===Fd.relay&&await this.confirmOnlineStateOrThrow();const i=o.requester.publicKey,a=await this.client.core.crypto.generateKeyPair(),c=vl(i),l={type:1,receiverPublicKey:i,senderPublicKey:a},u=[],d=[];for(const e of r){if(!await Si({cacao:e,projectId:this.client.core.projectId})){n.setError(Zh);const e=du("SESSION_SETTLEMENT_FAILED","Signature verification failed");
708throw await this.sendError({id:t,topic:c,error:e,encodeOpts:l}),new Error(e.message)}n.addTrace(Kh);const{p:r}=e,o=Fi(r.resources),s=[_i(r.iss)],i=Ii(r.iss);if(o){const e=Di(o),t=Li(o);u.push(...e),s.push(...t)}for(const e of s)d.push(`${e}:${i}`)}const h=await this.client.core.crypto.generateSharedKey(a,i);let p;if(n.addTrace(Hh),u?.length>0){p={topic:h,acknowledged:!0,self:{publicKey:a,metadata:this.client.metadata},peer:{publicKey:i,metadata:o.requester.metadata},controller:i,expiry:io(Pm),authentication:r,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:o.pairingTopic,namespaces:au([...new Set(u)],[...new Set(d)]),transportType:s},n.addTrace(Gh);try{await this.client.core.relayer.subscribe(h,{transportType:s})}catch(e){throw n.setError(Xh),e}n.addTrace(Yh),await this.client.session.set(h,p),n.addTrace($h),await this.client.core.pairing.updateMetadata({topic:o.pairingTopic,metadata:o.requester.metadata})}n.addTrace(Jh);try{await this.sendResult({topic:c,id:t,result:{cacaos:r,responder:{publicKey:a,metadata:this.client.metadata}},encodeOpts:l,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(o.requester.metadata,s)})}catch(e){throw n.setError(ep),e}return await this.client.auth.requests.delete(t,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:o.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:n.eventId}),{session:p}})),Fm(this,"rejectSessionAuthenticate",(async e=>{this.isInitialized();const{id:t,reason:r}=e,n=this.getPendingAuthRequest(t);if(!n)throw new Error(`Could not find pending auth request with id ${t}`);n.transportType===Fd.relay&&await this.confirmOnlineStateOrThrow();const o=n.requester.publicKey,s=await this.client.core.crypto.generateKeyPair(),i=vl(o),a={type:1,receiverPublicKey:o,senderPublicKey:s};await this.sendError({id:t,topic:i,error:r,encodeOpts:a,rpcOpts:Em.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(n.requester.metadata,n.transportType)}),await this.client.auth.requests.delete(t,{message:"rejected",code:0}),await this.deleteProposal(t)})),Fm(this,"formatAuthMessage",(e=>{this.isInitialized();const{request:t,iss:r}=e;return xi(t,r)})),Fm(this,"processRelayMessageCache",(()=>{setTimeout((async()=>{if(0!==this.relayMessageCache.length)for(;this.relayMessageCache.length>0;)try{const e=this.relayMessageCache.shift();e&&await this.onRelayMessage(e)}catch(e){this.client.logger.error(e)}}),50)})),Fm(this,"cleanupDuplicatePairings",(async e=>{if(e.pairingTopic)try{const t=this.client.core.pairing.pairings.get(e.pairingTopic),r=this.client.core.pairing.pairings.getAll().filter((r=>{var n,o;return(null==(n=r.peerMetadata)?void 0:n.url)&&(null==(o=r.peerMetadata)?void 0:o.url)===e.peer.metadata.url&&r.topic&&r.topic!==t.topic}));if(0===r.length)return;this.client.logger.info(`Cleaning up ${r.length} duplicate pairing(s)`),await Promise.all(r.map((e=>this.client.core.pairing.disconnect({topic:e.topic})))),this.client.logger.info("Duplicate pairings clean up finished")}catch(e){this.client.logger.error(e)}})),Fm(this,"deleteSession",(async e=>{var t;const{topic:r,expirerHasDeleted:n=!1,emitEvent:o=!0,id:s=0}=e,{self:i}=this.client.session.get(r);await this.client.core.relayer.unsubscribe(r),await this.client.session.delete(r,du("USER_DISCONNECTED")),this.addToRecentlyDeleted(r,"session"),this.client.core.crypto.keychain.has(i.publicKey)&&await this.client.core.crypto.deleteKeyPair(i.publicKey),this.client.core.crypto.keychain.has(r)&&await this.client.core.crypto.deleteSymKey(r),n||this.client.core.expirer.del(r),this.client.core.storage.removeItem(Am).catch((e=>this.client.logger.warn(e))),r===(null==(t=this.sessionRequestQueue.queue[0])?void 0:t.topic)&&(this.sessionRequestQueue.state=km),await Promise.all(this.getPendingSessionRequests().filter((e=>e.topic===r)).map((e=>this.deletePendingSessionRequest(e.id,du("USER_DISCONNECTED"))))),o&&this.client.events.emit("session_delete",{id:s,topic:r})})),Fm(this,"deleteProposal",(async(e,t)=>{if(t)try{const t=this.client.proposal.get(e),r=this.client.core.eventClient.getEvent({topic:t.pairingTopic});r?.setError(Uh)}catch{}await Promise.all([this.client.proposal.delete(e,du("USER_DISCONNECTED")),t?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,"proposal")})),Fm(this,"deletePendingSessionRequest",(async(e,t,r=!1)=>
708{await Promise.all([this.client.pendingRequest.delete(e,t),r?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter((t=>t.id!==e)),r&&(this.sessionRequestQueue.state=km,this.client.events.emit("session_request_expire",{id:e}))})),Fm(this,"deletePendingAuthRequest",(async(e,t,r=!1)=>{await Promise.all([this.client.auth.requests.delete(e,t),r?Promise.resolve():this.client.core.expirer.del(e)])})),Fm(this,"setExpiry",(async(e,t)=>{this.client.session.keys.includes(e)&&(this.client.core.expirer.set(e,t),await this.client.session.update(e,{expiry:t}))})),Fm(this,"setProposal",(async(e,t)=>{this.client.core.expirer.set(e,io(Em.wc_sessionPropose.req.ttl)),await this.client.proposal.set(e,t)})),Fm(this,"setAuthRequest",(async(e,t)=>{const{request:r,pairingTopic:n,transportType:o=Fd.relay}=t;this.client.core.expirer.set(e,r.expiryTimestamp),await this.client.auth.requests.set(e,{authPayload:r.authPayload,requester:r.requester,expiryTimestamp:r.expiryTimestamp,id:e,pairingTopic:n,verifyContext:r.verifyContext,transportType:o})})),Fm(this,"setPendingSessionRequest",(async e=>{const{id:t,topic:r,params:n,verifyContext:o}=e,s=n.request.expiryTimestamp||io(Em.wc_sessionRequest.req.ttl);this.client.core.expirer.set(t,s),await this.client.pendingRequest.set(t,{id:t,topic:r,params:n,verifyContext:o})})),Fm(this,"sendRequest",(async e=>{const{topic:t,method:n,params:o,expiry:s,relayRpcId:i,clientRpcId:a,throwOnFailedPublish:c,appLink:l,tvf:u,publishOpts:d={}}=e,h=ed(n,o,a);let p;const f=!!l;try{const e=f?yl:ml;p=await this.client.core.crypto.encode(t,h,{encoding:e})}catch(e){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${t} failed`),e}let g;if(Sm.includes(n)){const e=Al(JSON.stringify(h)),t=Al(p);g=await this.client.core.verify.register({id:t,decryptedId:e})}const m=Dm(Dm({},Em[n].req),d);if(m.attestation=g,s&&(m.ttl=s),i&&(m.id=i),this.client.core.history.set(t,h),f){const e=Kl(l,t,p);await r.g.Linking.openURL(e,this.client.name)}else m.tvf=Lm(Dm({},u),{correlationId:h.id}),c?(m.internal=Lm(Dm({},m.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(t,p,m)):this.client.core.relayer.publish(t,p,m).catch((e=>this.client.logger.error(e)));return h.id})),Fm(this,"sendProposeSession",(async e=>{const{proposal:t,publishOpts:r}=e,n=ed("wc_sessionPropose",t,t.id);this.client.core.history.set(t.pairingTopic,n);const o=await this.client.core.crypto.encode(t.pairingTopic,n,{encoding:ml}),s=Al(JSON.stringify(n)),i=Al(o),a=await this.client.core.verify.register({id:i,decryptedId:s});await this.client.core.relayer.publishCustom({payload:{pairingTopic:t.pairingTopic,sessionProposal:o},opts:Lm(Dm({},r),{publishMethod:"wc_proposeSession",attestation:a})})})),Fm(this,"sendApproveSession",(async e=>{const{sessionTopic:t,pairingProposalResponse:r,proposal:n,sessionSettleRequest:o,publishOpts:s}=e,i=td(n.id,r),a=await this.client.core.crypto.encode(n.pairingTopic,i,{encoding:ml}),c=ed("wc_sessionSettle",o,s?.id),l=await this.client.core.crypto.encode(t,c,{encoding:ml});this.client.core.history.set(t,c),await this.client.core.relayer.publishCustom({payload:{sessionTopic:t,pairingTopic:n.pairingTopic,sessionProposalResponse:a,sessionSettlementRequest:l},opts:Lm(Dm({},s),{publishMethod:"wc_approveSession"})})})),Fm(this,"sendResult",(async e=>{const{id:t,topic:n,result:o,throwOnFailedPublish:s,encodeOpts:i,appLink:a}=e,c=td(t,o);let l;const u=a&&typeof(null==r.g?void 0:r.g.Linking)<"u";try{const e=u?yl:ml;l=await this.client.core.crypto.encode(n,c,Lm(Dm({},i||{}),{encoding:e}))}catch(e){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${n} failed`),e}let d,h;try{d=await this.client.core.history.get(n,t);const e=d.request;try{h=this.getTVFParams(t,e.params,o)}catch(e){this.client.logger.warn(`sendResult() -> getTVFParams() failed: ${e?.message}`)}}catch(e){throw this.client.logger.error(`sendResult() -> history.get(${n}, ${t}) failed`),e}if(u){const e=Kl(a,n,l);await r.g.Linking.openURL(e,this.client.name)}else{const e=d.request.method,r=Em[e].res;r.tvf=Lm(Dm({},h),{correlationId:t}),s?(r.internal=Lm(Dm({},r.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,l,r)):this.client.core.relayer.publish(n,l,r).catch((e=>this.client.logger.error(e)))}await this.client.core.history.resolve(c)})),Fm(this,"sendError",(async e=>{const{id:t,topic:n,error:o,encodeOpts:s,rpcOpts:i,appLink:a}=e,c=rd(t,o);let l;const u=a&&typeof(null==r.g?void 0:r.g.Linking)<"u";try{const e=u?yl:ml;l=await this.client.core.crypto.encode(n,c,Lm(Dm({},s||{}),{encoding:e}))}catch(e){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${n} failed`),e}let d;try{d=await this.client.core.history.get(n,t)}catch(e){throw this.client.logger.error(`sendError() -> history.get(${n}, ${t}) failed`),e}if(u){const e=Kl(a,n,l);await r.g.Linking.openURL(e,this.client.name)}else{const e=d.request.method,t=i||Em[e].res;this.client.core.relayer.publish(n,l,t)}await this.client.core.history.resolve(c)})),Fm(this,"cleanup",(async()=>{const e=[],t=[];
708this.client.session.getAll().forEach((t=>{let r=!1;ao(t.expiry)&&(r=!0),this.client.core.crypto.keychain.has(t.topic)||(r=!0),r&&e.push(t.topic)})),this.client.proposal.getAll().forEach((e=>{ao(e.expiryTimestamp)&&t.push(e.id)})),await Promise.all([...e.map((e=>this.deleteSession({topic:e}))),...t.map((e=>this.deleteProposal(e)))])})),Fm(this,"onProviderMessageEvent",(async e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):await this.onRelayMessage(e)})),Fm(this,"onRelayEventRequest",(async e=>{this.requestQueue.queue.push(e),await this.processRequestsQueue()})),Fm(this,"processRequestsQueue",(async()=>{if(this.requestQueue.state!==_m){for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=_m;const e=this.requestQueue.queue.shift();if(e)try{await this.processRequest(e)}catch(e){this.client.logger.warn(e)}}this.requestQueue.state=km}else this.client.logger.info("Request queue already active, skipping...")})),Fm(this,"processRequest",(async e=>{const{topic:t,payload:r,attestation:n,transportType:o,encryptedId:s}=e,i=r.method;if(!this.shouldIgnorePairingRequest({topic:t,requestMethod:i}))switch(i){case"wc_sessionPropose":return await this.onSessionProposeRequest
708({topic:t,payload:r,attestation:n,encryptedId:s});case"wc_sessionSettle":return await this.onSessionSettleRequest(t,r);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(t,r);case"wc_sessionExtend":return await this.onSessionExtendRequest(t,r);case"wc_sessionPing":return await this.onSessionPingRequest(t,r);case"wc_sessionDelete":return await this.onSessionDeleteRequest(t,r);case"wc_sessionRequest":return await this.onSessionRequest({topic:t,payload:r,attestation:n,encryptedId:s,transportType:o});case"wc_sessionEvent":return await this.onSessionEventRequest(t,r);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:t,payload:r,attestation:n,encryptedId:s,transportType:o});default:return this.client.logger.info(`Unsupported request method ${i}`)}})),Fm(this,"onRelayEventResponse",(async e=>{const{topic:t,payload:r,transportType:n}=e,o=(await this.client.core.history.get(t,r.id)).request.method;switch(o){case"wc_sessionPropose":return this.onSessionProposeResponse(t,r,n);case"wc_sessionSettle":return this.onSessionSettleResponse(t,r);case"wc_sessionUpdate":return this.onSessionUpdateResponse(t,r);case"wc_sessionExtend":return this.onSessionExtendResponse(t,r);case"wc_sessionPing":return this.onSessionPingResponse(t,r);case"wc_sessionRequest":return this.onSessionRequestResponse(t,r);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(t,r);default:return this.client.logger.info(`Unsupported response method ${o}`)}})),Fm(this,"onRelayEventUnknownPayload",(e=>{const{topic:t}=e,{message:r}=uu("MISSING_OR_INVALID",`Decoded payload on topic ${t} is not identifiable as a JSON-RPC request or a response.`);throw new Error(r)})),Fm(this,"shouldIgnorePairingRequest",(e=>{const{topic:t,requestMethod:r}=e,n=this.expectedPairingMethodMap.get(t);return!(!n||n.includes(r))&&!!(n.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)})),Fm(this,"onSessionProposeRequest",(async e=>{const{topic:t,payload:r,attestation:n,encryptedId:o}=e,{params:s,id:i}=r;try{const e=this.client.core.eventClient.getEvent({topic:t});0===this.client.events.listenerCount("session_proposal")&&(console.warn("No listener for session_proposal event"),e?.setError(_h)),this.isValidConnect(Dm({},r.params));const a=s.expiryTimestamp||io(Em.wc_sessionPropose.req.ttl),c=Dm({id:i,pairingTopic:t,expiryTimestamp:a,attestation:n,encryptedId:o},s);await this.setProposal(i,c);const l=await this.getVerifyContext({attestationId:n,hash:Al(JSON.stringify(r)),encryptedId:o,metadata:c.proposer.metadata});e?.addTrace(Ah),this.client.events.emit("session_proposal",{id:i,params:c,verifyContext:l})}catch(e){await this.sendError({id:i,topic:t,error:e,rpcOpts:Em.wc_sessionPropose.autoReject}),this.client.logger.error(e)}})),Fm(this,"onSessionProposeResponse",(async(e,t,r)=>{const{id:n}=t;if(pd(t)){const{result:o}=t;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:o});const s=this.client.proposal.get(n);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:s});const i=s.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:i});const a=o.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:a});const c=await this.client.core.crypto.generateSharedKey(i,a);this.pendingSessions.set(n,{sessionTopic:c,pairingTopic:e,proposalId:n,publicKey:i});const l=await this.client.core.relayer.subscribe(c,{transportType:r});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:l}),await this.client.core.pairing.activate({topic:e})}else if(fd(t)){await this.deleteProposal(n);const e=co("session_connect",n);if(0===this.events.listenerCount(e))throw new Error(`emitting ${e} without any listeners, 954`);this.events.emit(e,{error:t.error})}})),Fm(this,"onSessionSettleRequest",(async(e,t)=>{const{id:r,params:n}=t;try{this.isValidSessionSettleRequest(n);const{relay:r,controller:o,expiry:s,namespaces:i,sessionProperties:a,scopedProperties:c,sessionConfig:l,proposalRequestsResponses:u}=t.params,d=[...this.pendingSessions.values()].find((t=>t.sessionTopic===e));if(!d)return this.client.logger.error(`Pending session not found for topic ${e}`);const h=this.client.proposal.get(d.proposalId),p=Lm(Dm(Dm(Dm({to
708pic:e,relay:r,expiry:s,namespaces:i,acknowledged:!0,pairingTopic:d.pairingTopic,requiredNamespaces:h.requiredNamespaces,optionalNamespaces:h.optionalNamespaces,controller:o.publicKey,self:{publicKey:d.publicKey,metadata:this.client.metadata},peer:{publicKey:o.publicKey,metadata:o.metadata}},a&&{sessionProperties:a}),c&&{scopedProperties:c}),l&&{sessionConfig:l}),{transportType:Fd.relay,authentication:u?.authentication,walletPayResult:u?.walletPay});await this.client.session.set(p.topic,p),await this.setExpiry(p.topic,p.expiry),await this.client.core.pairing.updateMetadata({topic:d.pairingTopic,metadata:p.peer.metadata}),this.pendingSessions.delete(d.proposalId),this.deleteProposal(d.proposalId,!1),this.cleanupDuplicatePairings(p),await this.sendResult({id:t.id,topic:e,throwOnFailedPublish:!0,result:!0}),this.client.events.emit("session_connect",{session:p}),this.events.emit(co("session_connect",d.proposalId),{session:p})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}})),Fm(this,"onSessionSettleResponse",(async(e,t)=>{const{id:r}=t;pd(t)?(await this.client.session.update(e,{acknowledged:!0}),this.events.emit(co("session_approve",r),{})):fd(t)&&(await this.client.session.delete(e,du("USER_DISCONNECTED")),this.events.emit(co("session_approve",r),{error:t.error}))})),Fm(this,"onSessionUpdateRequest",(async(e,t)=>{const{params:r,id:n}=t;try{const t=`${e}_session_update`,o=Mu.get(t);if(o&&this.isRequestOutOfSync(o,n))return this.client.logger.warn(`Discarding out of sync request - ${n}`),void this.sendError({id:n,topic:e,error:du("INVALID_UPDATE_REQUEST")});this.isValidUpdate(Dm({topic:e},r));try{Mu.set(t,n),await this.client.session.update(e,{namespaces:r.namespaces}),await this.sendResult({id:n,topic:e,result:!0})}catch(e){throw Mu.delete(t),e}this.client.events.emit("session_update",{id:n,topic:e,params:r})}catch(t){await this.sendError({id:n,topic:e,error:t}),this.client.logger.error(t)}})),Fm(this,"isRequestOutOfSync",((e,t)=>t.toString().slice(0,-3)<e.toString().slice(0,-3))),Fm(this,"onSessionUpdateResponse",((e,t)=>{const{id:r}=t,n=co("session_update",r);if(0===this.events.listenerCount(n))throw new Error(`emitting ${n} without any listeners`);pd(t)?this.events.emit(co("session_update",r),{}):fd(t)&&this.events.emit(co("session_update",r),{error:t.error})})),Fm(this,"onSessionExtendRequest",(async(e,t)=>{const{id:r}=t;try{this.isValidExtend({topic:e}),await this.setExpiry(e,io(Pm)),await this.sendResult({id:r,topic:e,result:!0}),this.client.events.emit("session_extend",{id:r,topic:e})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}})),Fm(this,"onSessionExtendResponse",((e,t)=>{const{id:r}=t,n=co("session_extend",r);if(0===this.events.listenerCount(n))throw new Error(`emitting ${n} without any listeners`);pd(t)?this.events.emit(co("session_extend",r),{}):fd(t)&&this.events.emit(co("session_extend",r),{error:t.error})})),Fm(this,"onSessionPingRequest",(async(e,t)=>{const{id:r}=t;try{this.isValidPing({topic:e}),await this.sendResult({id:r,topic:e,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:r,topic:e})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}})),Fm(this,"onSessionPingResponse",((e,t)=>{const{id:r}=t,n=co("session_ping",r);setTimeout((()=>{if(0===this.events.listenerCount(n))throw new Error(`emitting ${n} without any listeners 2176`);pd(t)?this.events.emit(co("session_ping",r),{}):fd(t)&&this.events.emit(co("session_ping",r),{error:t.error})}),500)})),Fm(this,"onSessionDeleteRequest",(async(e,t)=>{const{id:r}=t;try{await this.isValidDisconnect({topic:e,reason:t.params}),this.cleanupPendingSentRequestsForTopic({topic:e,error:du("USER_DISCONNECTED")}),await this.deleteSession({topic:e,id:r})}catch(e){this.client.logger.error(e)}})),Fm(this,"onSessionRequest",(async e=>{var t,r,n;const{topic:o,payload:s,attestation:i,encryptedId:a,transportType:c}=e,{id:l,params:u}=s;try{await this.isValidRequest(Dm({topic:o},u));const e=this.client.session.get(o),s={id:l,topic:o,params:u,verifyContext:await this.getVerifyContext({attestationId:i,hash:Al
708(JSON.stringify(ed("wc_sessionRequest",u,l))),encryptedId:a,metadata:e.peer.metadata,transportType:c})};await this.setPendingSessionRequest(s),c===Fd.link_mode&&null!=(t=e.peer.metadata.redirect)&&t.universal&&this.client.core.addLinkModeSupportedApp(null==(r=e.peer.metadata.redirect)?void 0:r.universal),null!=(n=this.client.signConfig)&&n.disableRequestQueue?this.emitSessionRequest(s):(this.addSessionRequestToSessionRequestQueue(s),this.processSessionRequestQueue())}catch(e){await this.sendError({id:l,topic:o,error:e}),this.client.logger.error(e)}})),Fm(this,"onSessionRequestResponse",((e,t)=>{const{id:r}=t,n=co("session_request",r);if(0===this.events.listenerCount(n))throw new Error(`emitting ${n} without any listeners`);pd(t)?this.events.emit(co("session_request",r),{result:t.result}):fd(t)&&this.events.emit(co("session_request",r),{error:t.error})})),Fm(this,"onSessionEventRequest",(async(e,t)=>{const{id:r,params:n}=t;try{const t=`${e}_session_event_${n.event.name}`,o=Mu.get(t);if(o&&this.isRequestOutOfSync(o,r))return void this.client.logger.info(`Discarding out of sync request - ${r}`);this.isValidEmit(Dm({topic:e},n)),this.client.events.emit("session_event",{id:r,topic:e,params:n}),Mu.set(t,r)}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}})),Fm(this,"onSessionAuthenticateResponse",((e,t)=>{const{id:r}=t;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:e,payload:t}),pd(t)?this.events.emit(co("session_request",r),{result:t.result}):fd(t)&&this.events.emit(co("session_request",r),{error:t.error})})),Fm(this,"onSessionAuthenticateRequest",(async e=>{var t;const{topic:r,payload:n,attestation:o,encryptedId:s,transportType:i}=e;try{const{requester:e,authPayload:a,expiryTimestamp:c}=n.params,l=await this.getVerifyContext({attestationId:o,hash:Al(JSON.stringify(n)),encryptedId:s,metadata:e.metadata,transportType:i}),u={requester:e,pairingTopic:r,id:n.id,authPayload:a,verifyContext:l,expiryTimestamp:c};await this.setAuthRequest(n.id,{request:u,pairingTopic:r,transportType:i}),i===Fd.link_mode&&null!=(t=e.metadata.redirect)&&t.universal&&this.client.core.addLinkModeSupportedApp(e.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:r,params:n.params,id:n.id,verifyContext:l})}catch(e){this.client.logger.error(e);const t=n.params.requester.publicKey,o=await this.client.core.crypto.generateKeyPair(),s=this.getAppLinkIfEnabled(n.params.requester.metadata,i),a={type:1,receiverPublicKey:t,senderPublicKey:o};await this.sendError({id:n.id,topic:r,error:e,encodeOpts:a,rpcOpts:Em.wc_sessionAuthenticate.autoReject,appLink:s})}})),Fm(this,"addSessionRequestToSessionRequestQueue",(e=>{this.sessionRequestQueue.queue.push(e)})),Fm(this,"cleanupAfterResponse",(e=>{this.deletePendingSessionRequest(e.response.id,{message:"fulfilled",code:0}),setTimeout((()=>{this.sessionRequestQueue.state=km,this.processSessionRequestQueue()}),(0,s.toMiliseconds)(this.requestQueueDelay))})),Fm(this,"cleanupPendingSentRequestsForTopic",(({topic:e,error:t})=>{const r=this.client.core.history.pending;r.length>0&&r.filter((t=>t.topic===e&&"wc_sessionRequest"===t.request.method)).forEach((e=>{this.events.emit(co("session_request",e.request.id),{error:t})}))})),Fm(this,"processSessionRequestQueue",(()=>{if(this.sessionRequestQueue.state===_m)return void this.client.logger.info("session request queue is already active.");const e=this.sessionRequestQueue.queue[0];if(e)try{this.emitSessionRequest(e)}catch(e){this.client.logger.error(e)}else this.client.logger.info("session request queue is empty.")})),Fm(this,"emitSessionRequest",(e=>{this.emittedSessionRequests.has(e.id)?this.client.logger.warn({id:e.id},`Skipping emitting \`session_request\` event for duplicate request. id: ${e.id}`):(this.sessionRequestQueue.state=_m,this.emittedSessionRequests.add(e.id),this.client.events.emit("session_request",e))})),Fm(this,"onPairingCreated",(e=>{if(e.methods&&this.expectedPairingMethodMap.set(e.topic,e.methods),e.active)return;const t=this.client.proposal.getAll().find((t=>t.pairingTopic===e.topic));
708t&&this.onSessionProposeRequest({topic:e.topic,payload:ed("wc_sessionPropose",Lm(Dm({},t),{requiredNamespaces:t.requiredNamespaces,optionalNamespaces:t.optionalNamespaces,relays:t.relays,proposer:t.proposer,sessionProperties:t.sessionProperties,scopedProperties:t.scopedProperties}),t.id),attestation:t.attestation,encryptedId:t.encryptedId})})),Fm(this,"isValidConnect",(async e=>{if(!Eu(e)){const{message:t}=uu("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(e)}`);throw new Error(t)}const{pairingTopic:t,requiredNamespaces:r,optionalNamespaces:n,sessionProperties:o,scopedProperties:s,relays:i}=e;if(fu(t)||await this.isValidPairingTopic(t),!function(e,t){let r=!1;return t&&!e?r=!0:e&&hu(e)&&e.length&&e.forEach((e=>{r=Pu(e)})),r}(i,!0)){const{message:e}=uu("MISSING_OR_INVALID",`connect() relays: ${i}`);throw new Error(e)}if(r&&!fu(r)&&0!==pu(r)){const e="requiredNamespaces are deprecated and are automatically assigned to optionalNamespaces";["fatal","error","silent"].includes(this.client.logger.level)?console.warn(e):this.client.logger.warn(e),this.validateNamespaces(r,"requiredNamespaces")}if(n&&!fu(n)&&0!==pu(n)&&this.validateNamespaces(n,"optionalNamespaces"),o&&!fu(o)&&this.validateSessionProps(o,"sessionProperties"),s&&!fu(s)){this.validateSessionProps(s,"scopedProperties");const e=Object.keys(r||{}).concat(Object.keys(n||{}));if(!Object.keys(s).every((t=>e.includes(t.split(":")[0]))))throw new Error(`Scoped properties must be a subset of required/optional namespaces, received: ${JSON.stringify(s)}, required/optional namespaces: ${JSON.stringify(e)}`)}})),Fm(this,"validateNamespaces",((e,t)=>{const r=function(e,t,r){let n=null;if(e&&pu(e)){const o=Au(e,t);o&&(n=o);const s=wu(e,t,r);s&&(n=s)}else n=uu("MISSING_OR_INVALID",`${t}, ${r} should be an object with data`);return n}(e,"connect()",t);if(r)throw new Error(r.message)})),Fm(this,"isValidApprove",(async e=>{if(!Eu(e))throw new Error(uu("MISSING_OR_INVALID",`approve() params: ${e}`).message);const{id:t,namespaces:r,relayProtocol:n,sessionProperties:o,scopedProperties:s}=e;this.checkRecentlyDeleted(t),await this.isValidProposalId(t);const i=this.client.proposal.get(t),a=Tu(r,"approve()");if(a)throw new Error(a.message);const c=Iu(i.requiredNamespaces,r,"approve()");if(c)throw new Error(c.message);if(!gu(n,!0)){const{message:e}=uu("MISSING_OR_INVALID",`approve() relayProtocol: ${n}`);throw new Error(e)}if(o&&!fu(o)&&this.validateSessionProps(o,"sessionProperties"),s&&!fu(s)){this.validateSessionProps(s,"scopedProperties");const e=new Set(Object.keys(r));if(!Object.keys(s).every((t=>e.has(t.split(":")[0]))))throw new Error(`Scoped properties must be a subset of approved namespaces, received: ${JSON.stringify(s)}, approved namespaces: ${Array.from(e).join(", ")}`)}})),Fm(this,"isValidReject",(async e=>{if(!Eu(e)){const{message:t}=uu("MISSING_OR_INVALID",`reject() params: ${e}`);throw new Error(t)}const{id:t,reason:r}=e;if(this.checkRecentlyDeleted(t),await this.isValidProposalId(t),!function(e){return!!(e&&"object"==typeof e&&e.code&&mu(e.code,!1)&&e.message&&gu(e.message,!1))}(r)){const{message:e}=uu("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(r)}`);throw new Error(e)}})),Fm(this,"isValidSessionSettleRequest",(e=>{if(!Eu(e)){const{message:t}=uu("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${e}`);throw new Error(t)}
708const{relay:t,controller:r,namespaces:n,expiry:o}=e;if(!Pu(t)){const{message:e}=uu("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(e)}const s=function(e,t){let r=null;return gu(e?.publicKey,!1)||(r=uu("MISSING_OR_INVALID",`${t} controller public key should be a string`)),r}(r,"onSessionSettleRequest()");if(s)throw new Error(s.message);const i=Tu(n,"onSessionSettleRequest()");if(i)throw new Error(i.message);if(ao(o)){const{message:e}=uu("EXPIRED","onSessionSettleRequest()");throw new Error(e)}})),Fm(this,"isValidUpdate",(async e=>{if(!Eu(e)){const{message:t}=uu("MISSING_OR_INVALID",`update() params: ${e}`);throw new Error(t)}const{topic:t,namespaces:r}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t);const n=this.client.session.get(t),o=Tu(r,"update()");if(o)throw new Error(o.message);const s=Iu(n.requiredNamespaces,r,"update()");if(s)throw new Error(s.message)})),Fm(this,"isValidExtend",(async e=>{if(!Eu(e)){const{message:t}=uu("MISSING_OR_INVALID",`extend() params: ${e}`);throw new Error(t)}const{topic:t}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t)})),Fm(this,"isValidRequest",(async e=>{if(!Eu(e)){const{message:t}=uu("MISSING_OR_INVALID",`request() params: ${e}`);throw new Error(t)}const{topic:t,request:r,chainId:n,expiry:o}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t);const{namespaces:s}=this.client.session.get(t);if(!Cu(s,n)){const{message:e}=uu("MISSING_OR_INVALID",`request() chainId: ${n}`);throw new Error(e)}if(!function(e){return!(fu(e)||!gu(e.method,!1))}(r)){const{message:e}=uu("MISSING_OR_INVALID",`request() ${JSON.stringify(r)}`);throw new Error(e)}if(!ku(s,n,r.method)){const{message:e}=uu("MISSING_OR_INVALID",`request() method: ${r.method}`);throw new Error(e)}this.validateRequestExpiry(o)})),Fm(this,"isValidRespond",(async e=>{var t;if(!Eu(e)){const{message:t}=uu("MISSING_OR_INVALID",`respond() params: ${e}`);throw new Error(t)}const{topic:r,response:n}=e;try{await this.isValidSessionTopic(r)}catch(r){throw null!=(t=e?.response)&&t.id&&this.cleanupAfterResponse(e),r}if(!function(e){return!(fu(e)||fu(e.result)&&fu(e.error)||!mu(e.id,!1)||!gu(e.jsonrpc,!1))}(n)){const{message:e}=uu("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(n)}`);throw new Error(e)}const o=this.client.pendingRequest.get(n.id);if(o.topic!==r){const{message:e}=uu("MISMATCHED_TOPIC",`Request response topic mismatch. reqId: ${n.id}, expected topic: ${o.topic}, received topic: ${r}`);throw new Error(e)}})),Fm(this,"isValidPing",(async e=>{if(!Eu(e)){const{message:t}=uu("MISSING_OR_INVALID",`ping() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidSessionOrPairingTopic(t)})),Fm(this,"isValidEmit",(async e=>{if(!Eu(e)){const{message:t}=uu("MISSING_OR_INVALID",`emit() params: ${e}`);throw new Error(t)}const{topic:t,event:r,chainId:n}=e;await this.isValidSessionTopic(t);const{namespaces:o}=this.client.session.get(t);if(!Cu(o,n)){const{message:e}=uu("MISSING_OR_INVALID",`emit() chainId: ${n}`);throw new Error(e)}if(!function(e){return!(fu(e)||!gu(e.name,!1))}(r)){const{message:e}=uu("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(r)}`);throw new Error(e)}if(!_u(o,n,r.name)){const{message:e}=uu("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(r)}`);throw new Error(e)}})),Fm(this,"isValidDisconnect",(async e=>{if(!Eu(e)){const{message:t}=uu("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidSessionOrPairingTopic(t)})),Fm(this,"isValidAuthenticate",(e=>{const{chains:t,uri:r,domain:n,nonce:o}=e;if(!Array.isArray(t)||0===t.length)throw new Error("chains is required and must be a non-empty array");if(!gu(r,!1))throw new Error("uri is required parameter");if(!gu(n,!1))throw new Error("domain is required parameter");if(!gu(o,!1))throw new Error("nonce is required parameter");if([...new Set(t.map((e=>In(e).namespace)))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:s}=In(t[0]);if("eip155"!==s)throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")})),Fm(this,"getVerifyContext",(async e=>{const{attestationId:t,hash:r,encryptedId:n,metadata:o,transportType:s}=e,i={verified:{verifyUrl:o.verifyUrl||lh,validation:"UNKNOWN",origin:o.url||""}};try{if(s===Fd.link_mode){const e=this.getAppLinkIfEnabled(o,s);return i.verified.validation=e&&new URL(e).origin===new URL(o.url).origin?"VALID":"INVALID",i}const e=await this.client.core.verify.resolve({attestationId:t,hash:r,encryptedId:n,verifyUrl:o.verifyUrl});e&&(i.verified.origin=e.origin,i.verified.isScam=e.isScam,i.verified.validation=e.origin===new URL(o.url).origin?"VALID":"INVALID")}catch(e){this.client.logger.warn(e)}return this.client.logger.debug(`Verify context: ${JSON.stringify(i)}`),i})),Fm(this,"validateSessionProps",((e,t)=>
708{Object.values(e).forEach(((r,n)=>{if(null==r){const{message:o}=uu("MISSING_OR_INVALID",`${t} must contain an existing value for each key. Received: ${r} for key ${Object.keys(e)[n]}`);throw new Error(o)}}))})),Fm(this,"getPendingAuthRequest",(e=>{const t=this.client.auth.requests.get(e);return"object"==typeof t?t:void 0})),Fm(this,"addToRecentlyDeleted",((e,t)=>{if(this.recentlyDeletedMap.set(e,t),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let e=0;const t=this.recentlyDeletedLimit/2;for(const r of this.recentlyDeletedMap.keys()){if(e++>=t)break;this.recentlyDeletedMap.delete(r)}}})),Fm(this,"checkRecentlyDeleted",(e=>{const t=this.recentlyDeletedMap.get(e);if(t){const{message:r}=uu("MISSING_OR_INVALID",`Record was recently deleted - ${t}: ${e}`);throw new Error(r)}})),Fm(this,"isLinkModeEnabled",((e,t)=>{var n,o,s,i,a,c,l,u,d;return!(!e||t!==Fd.link_mode)&&(!0===(null==(o=null==(n=this.client.metadata)?void 0:n.redirect)?void 0:o.linkMode)&&void 0!==(null==(i=null==(s=this.client.metadata)?void 0:s.redirect)?void 0:i.universal)&&""!==(null==(c=null==(a=this.client.metadata)?void 0:a.redirect)?void 0:c.universal)&&void 0!==(null==(l=e?.redirect)?void 0:l.universal)&&""!==(null==(u=e?.redirect)?void 0:u.universal)&&!0===(null==(d=e?.redirect)?void 0:d.linkMode)&&this.client.core.linkModeSupportedApps.includes(e.redirect.universal)&&typeof(null==r.g?void 0:r.g.Linking)<"u")})),Fm(this,"getAppLinkIfEnabled",((e,t)=>{var r;return this.isLinkModeEnabled(e,t)?null==(r=e?.redirect)?void 0:r.universal:void 0})),Fm(this,"handleLinkModeMessage",(({url:e})=>{if(!e||!e.includes("wc_ev")||!e.includes("topic"))return;const t=ho(e,"topic")||"",r=decodeURIComponent(ho(e,"wc_ev")||""),n=this.client.session.keys.includes(t);n&&this.client.session.update(t,{transportType:Fd.link_mode}),this.client.core.dispatchEnvelope({topic:t,message:r,sessionExists:n})})),Fm(this,"registerLinkModeListeners",(async()=>{var e;if(fo()||Hn()&&null!=(e=this.client.metadata.redirect)&&e.linkMode){const e=null==r.g?void 0:r.g.Linking;if(typeof e<"u"){e.addEventListener("url",this.handleLinkModeMessage,this.client.name);const t=await e.getInitialURL();t&&setTimeout((()=>{this.handleLinkModeMessage({url:t})}),50)}}})),Fm(this,"getTVFApproveParams",(e=>{try{const t=nu(e.namespaces),r=function(e){const t=[];return Object.values(e).forEach((e=>{t.push(...e.methods)})),[...new Set(t)]}(e.namespaces),n=function(e){const t=[];return Object.values(e).forEach((e=>{t.push(...e.events)})),[...new Set(t)]}(e.namespaces),o=e.sessionProperties;return{approvedChains:t,approvedMethods:r,approvedEvents:n,sessionProperties:o,scopedProperties:e.scopedProperties}}catch(e){return this.client.logger.warn(e,"Error getting TVF approve params"),{}}})),Fm(this,"getTVFParams",((e,t,r)=>{var n,o,s;if(null==(n=t.request)||!n.method)return{};const i={correlationId:e,rpcMethods:[t.request.method],chainId:t.chainId};try{const e=this.extractTxHashesFromResult(t.request,r);i.txHashes=e,i.contractAddresses=this.isValidContractData(t.request.params)?[null==(s=null==(o=t.request.params)?void 0:o[0])?void 0:s.to]:[]}catch(e){this.client.logger.warn(e,"Error getting TVF params")}return i})),Fm(this,"isValidContractData",(e=>{var t;if(!e)return!1;try{const r=e?.data||(null==(t=e?.[0])?void 0:t.data);if(!r.startsWith("0x"))return!1;const n=r.slice(2);return!!/^[0-9a-fA-F]*$/.test(n)&&n.length%2==0}catch{}return!1})),Fm(this,"extractTxHashesFromResult",((e,t)=>{var r;try{if(!t)return[];const n=e.method,o=Im[n];if("sui_signTransaction"===n)return[ui(t.transactionBytes)];if("near_signTransaction"===n)return[di(t)];if("near_signTransactions"===n)return t.map((e=>di(e)));if("xrpl_signTransactionFor"===n||"xrpl_signTransaction"===n)return[null==(r=t.tx_json)?void 0:r.hash];if("polkadot_signTransaction"===n)return[Ru({transaction:e.params.transactionPayload,signature:t.signature})];if("algo_signTxn"===n)return hu(t)?t.map((e=>hi(e))):[hi(t)];if("cosmos_signDirect"===n)return[fi(t)];if("wallet_sendCalls"===n)return function(e){var t,r;const n=[];try{if("string"==typeof e)return n.push(e),n;if("object"!=typeof e)return n;null!=e&&e.id&&n.push(e.id);const o=null==(r=null==(t=e?.capabilities)?void 0:t.caip345)?void 0:r.transactionHashes;o&&n.push(...o)}catch(e){console.warn("getWalletSendCallsHashes failed: ",e)}return n}(t);if("string"==typeof t)return[t];const s=t[o.key];if(hu(s))return"solana_signAllTransactions"===n?s.map((e=>function(e){const t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);const n=r[0];if(0===n)throw new Error("No signatures found");const o=1+64*n;
708if(r.length<o)throw new Error("Transaction data too short for claimed signature count");if(r.length<100)throw new Error("Transaction too short");const s=kn.from(e,"base64").slice(1,65);return bn.A.encode(s)}(e))):s;if("string"==typeof s)return[s]}catch(e){this.client.logger.warn(e,"Error extracting tx hashes from result")}return[]}))}async processPendingMessageEvents(){try{const e=this.client.session.keys,t=this.client.core.relayer.messages.getWithoutAck(e);for(const[e,r]of Object.entries(t))for(const t of r)try{await this.onProviderMessageEvent({topic:e,message:t,publishedAt:Date.now()})}catch{this.client.logger.warn(`Error processing pending message event for topic: ${e}, message: ${t}`)}}catch(e){this.client.logger.warn(e,"processPendingMessageEvents failed")}}isInitialized(){if(!this.initialized){const{message:e}=uu("NOT_INITIALIZED",this.name);throw new Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(Sd,(e=>{this.onProviderMessageEvent(e)}))}async onRelayMessage(e){const{topic:t,message:r,attestation:n,transportType:o}=e,{publicKey:s}=this.client.auth.authKeys.keys.includes(Bm)?this.client.auth.authKeys.get(Bm):{responseTopic:void 0,publicKey:void 0};try{const e=await this.client.core.crypto.decode(t,r,{receiverPublicKey:s,encoding:o===Fd.link_mode?yl:ml});dd(e)?(this.client.core.history.set(t,e),await this.onRelayEventRequest({topic:t,payload:e,attestation:n,transportType:o,encryptedId:Al(r)})):hd(e)?(await this.client.core.history.resolve(e),await this.onRelayEventResponse({topic:t,payload:e,transportType:o}),this.client.core.history.delete(t,e.id)):(this.client.logger.error(`onRelayMessage() -> unknown payload: ${JSON.stringify(e)}`),await this.onRelayEventUnknownPayload({topic:t,payload:e,transportType:o})),await this.client.core.relayer.messages.ack(t,r)}catch(e){this.client.logger.error(`onRelayMessage() -> failed to process an inbound message: ${r}`),this.client.logger.error(e)}}registerExpirerEvents(){this.client.core.expirer.on(ih,(async e=>
708{const{topic:t,id:r}=so(e.target);return r&&this.client.pendingRequest.keys.includes(r)?await this.deletePendingSessionRequest(r,uu("EXPIRED"),!0):r&&this.client.auth.requests.keys.includes(r)?await this.deletePendingAuthRequest(r,uu("EXPIRED"),!0):void(t?this.client.session.keys.includes(t)&&(await this.deleteSession({topic:t,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:t})):r&&(await this.deleteProposal(r,!0),this.client.events.emit("proposal_expire",{id:r})))}))}registerPairingEvents(){this.client.core.pairing.events.on(Jd,(e=>this.onPairingCreated(e))),this.client.core.pairing.events.on(Zd,(e=>{this.addToRecentlyDeleted(e.topic,"pairing")}))}isValidPairingTopic(e){if(!gu(e,!1)){const{message:t}=uu("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:t}=uu("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(t)}if(ao(this.client.core.pairing.pairings.get(e).expiry)){const{message:t}=uu("EXPIRED",`pairing topic: ${e}`);throw new Error(t)}}async isValidSessionTopic(e){if(!gu(e,!1)){const{message:t}=uu("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(t)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){const{message:t}=uu("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(t)}if(ao(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:t}=uu("EXPIRED",`session topic: ${e}`);throw new Error(t)}if(!this.client.core.crypto.keychain.has(e)){const{message:t}=uu("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(t)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else{if(!this.client.core.pairing.pairings.keys.includes(e)){if(gu(e,!1)){const{message:t}=uu("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(t)}{const{message:t}=uu("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(t)}}this.isValidPairingTopic(e)}}async isValidProposalId(e){if(!function(e){return"number"==typeof e}(e)){const{message:t}=uu("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(t)}if(!this.client.proposal.keys.includes(e)){const{message:t}=uu("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(t)}if(ao(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:t}=uu("EXPIRED",`proposal id: ${e}`);throw new Error(t)}}validateRequestExpiry(e){if(e&&!function(e,t){return mu(e,!1)&&e<=t.max&&e>=t.min}(e,Cm)){const{message:t}=uu("MISSING_OR_INVALID",`request() expiry: ${e}. Expiry must be a number (in seconds) between ${Cm.min} and ${Cm.max}`);throw new Error(t)}}}class Vm extends Ug{constructor(e,t){super(e,t,"proposal",bm),this.core=e,this.logger=t}}class qm extends Ug{constructor(e,t){super(e,t,"session",bm),this.core=e,this.logger=t}}class Hm extends Ug{constructor(e,t){super(e,t,"request",bm,(e=>e.id)),this.core=e,this.logger=t}}class Km extends Ug{constructor(e,t){super(e,t,"authKeys",xm,(()=>Bm)),this.core=e,this.logger=t}}class $m extends Ug{constructor(e,t){super(e,t,"pairingTopics",xm),this.core=e,this.logger=t}}class Gm extends Ug{constructor(e,t){super(e,t,"requests",xm,(e=>e.id)),this.core=e,this.logger=t}}var Ym=Object.defineProperty,Jm=(e,t,r)=>((e,t,r)=>t in e?Ym(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class Qm{constructor(e,t){this.core=e,this.logger=t,Jm(this,"authKeys"),Jm(this,"pairingTopics"),Jm(this,"requests"),this.authKeys=new Km(this.core,this.logger),this.pairingTopics=new $m(this.core,this.logger),this.requests=new Gm(this.core,this.logger)}
708async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}var Zm=Object.defineProperty,Xm=(e,t,r)=>((e,t,r)=>t in e?Zm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class ey extends F{constructor(e){super(e),Xm(this,"protocol","wc"),Xm(this,"version",2),Xm(this,"name",wm),Xm(this,"metadata"),Xm(this,"core"),Xm(this,"logger"),Xm(this,"events",new n.EventEmitter),Xm(this,"engine"),Xm(this,"session"),Xm(this,"proposal"),Xm(this,"pendingRequest"),Xm(this,"auth"),Xm(this,"signConfig"),Xm(this,"on",((e,t)=>this.events.on(e,t))),Xm(this,"once",((e,t)=>this.events.once(e,t))),Xm(this,"off",((e,t)=>this.events.off(e,t))),Xm(this,"removeListener",((e,t)=>this.events.removeListener(e,t))),Xm(this,"removeAllListeners",(e=>this.events.removeAllListeners(e))),Xm(this,"connect",(async e=>{try{return await this.engine.connect(e)}catch(e){throw this.logger.error(e.message),e}})),Xm(this,"pair",(async e=>{try{return await this.engine.pair(e)}catch(e){throw this.logger.error(e.message),e}})),Xm(this,"approve",(async e=>{try{return await this.engine.approve(e)}catch(e){throw this.logger.error(e.message),e}})),Xm(this,"reject",(async e=>{try{return await this.engine.reject(e)}catch(e){throw this.logger.error(e.message),e}})),Xm(this,"update",(async e=>{try{return await this.engine.update(e)}catch(e){throw this.logger.error(e.message),e}})),Xm(this,"extend",(async e=>{try{return await this.engine.extend(e)}catch(e){throw this.logger.error(e.message),e}})),Xm(this,"request",(async e=>{try{return await this.engine.request(e)}catch(e){throw this.logger.error(e.message),e}})),Xm(this,"respond",(async e=>{try{return await this.engine.respond(e)}catch(e){throw this.logger.error(e.message),e}})),Xm(this,"ping",(async e=>{try{return await this.engine.ping(e)}catch(e){throw this.logger.error(e.message),e}})),Xm(this,"emit",(async e=>{try{return await this.engine.emit(e)}catch(e){throw this.logger.error(e.message),e}})),Xm(this,"disconnect",(async e=>{try{return await this.engine.disconnect(e)}catch(e){throw this.logger.error(e.message),e}})),Xm(this,"find",(e=>{try{return this.engine.find(e)}catch(e){throw this.logger.error(e.message),e}})),Xm(this,"getPendingSessionRequests",(()=>{try{return this.engine.getPendingSessionRequests()}catch(e){throw this.logger.error(e.message),e}})),Xm(this,"authenticate",(async(e,t)=>{try{return await this.engine.authenticate(e,t)}catch(e){throw this.logger.error(e.message),e}})),Xm(this,"formatAuthMessage",(e=>{try{return this.engine.formatAuthMessage(e)}catch(e){throw this.logger.error(e.message),e}})),Xm(this,"approveSessionAuthenticate",(async e=>{try{return await this.engine.approveSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}})),Xm(this,"rejectSessionAuthenticate",(async e=>{try{return await this.engine.rejectSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}})),this.name=e?.name||wm,this.metadata=Yn(e?.metadata),this.signConfig=e?.signConfig;const t=Nu({logger:e?.logger||vm,name:this.name});this.logger=t,this.core=e?.core||new mm(e),this.session=new qm(this.core,this.logger),this.proposal=new Vm(this.core,this.logger),this.pendingRequest=new Hm(this.core,this.logger),this.engine=new zm(this),this.auth=new Qm(this.core,this.logger)}static async init(e){const t=new ey(e);return await t.initialize(),t}get context(){return(0,P.oI)(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}const ty=ey;var ry=r("./node_modules/@walletconnect/jsonrpc-http-connection/node_modules/cross-fetch/dist/browser-ponyfill.js"),ny=r.n(ry),oy=Object.defineProperty,sy=Object.defineProperties,iy=Object.getOwnPropertyDescriptors,ay=Object.getOwnPropertySymbols,cy=Object.prototype.hasOwnProperty,ly=Object.prototype.propertyIsEnumerable,uy=(e,t,r)=>t in e?oy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dy=(e,t)=>{for(var r in t||(t={}))cy.call(t,r)&&uy(e,r,t[r]);if(ay)for(var r of ay(t))ly.call(t,r)&&uy(e,r,t[r]);return e},hy=(e,t)=>sy(e,iy(t));const py={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"};class fy{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new n.EventEmitter,this.isAvailable=!1,this.registering=!1,!cd(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=t}
708get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{const t=f(e),r=await(await ny()(this.url,hy(dy({},py),{body:t}))).json();this.onPayload({data:r})}catch(t){this.onError(e.id,t)}}async register(e=this.url){if(!cd(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise(((e,t)=>{this.events.once("register_error",(e=>{this.resetMaxListeners(),t(e)})),this.events.once("open",(()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return t(new Error("HTTP connection is missing or invalid"));e()}))}))}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const t=f({id:1,jsonrpc:"2.0",method:"test",params:[]});await ny()(e,hy(dy({},py),{body:t}))}this.onOpen()}catch(e){const t=this.parseError(e);throw this.events.emit("register_error",t),this.onClose(),t}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const t="string"==typeof e.data?p(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const r=this.parseError(t),n=rd(e,r.message||r.toString());this.events.emit("payload",n)}parseError(e,t=this.url){return Ju(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}}var gy=r("./node_modules/buffer/index.js").Buffer;function my(e){return null==e||"object"!=typeof e&&"function"!=typeof e}function yy(e){return Object.getOwnPropertySymbols(e).filter((t=>Object.prototype.propertyIsEnumerable.call(e,t)))}function by(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const wy="[object RegExp]",vy="[object String]",Ay="[object Number]",Ty="[object Boolean]",Py="[object Arguments]",Ey="[object Symbol]",Cy="[object Date]",ky="[object Map]",_y="[object Set]",Iy="[object Array]",Sy="[object ArrayBuffer]",xy="[object Object]",By="[object DataView]",Oy="[object Uint8Array]",My="[object Uint8ClampedArray]",Wy="[object Uint16Array]",jy="[object Uint32Array]",Ry="[object Int8Array]",Ny="[object Int16Array]",Uy="[object Int32Array]",Dy="[object Float32Array]",Ly="[object Float64Array]";function Fy(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function zy(e,t,r,n=new Map,o=void 0){const s=o?.(e,t,r,n);if(null!=s)return s;if(my(e))return e;if(n.has(e))return n.get(e);if(Array.isArray(e)){const t=new Array(e.length);n.set(e,t);for(let s=0;s<e.length;s++)t[s]=zy(e[s],s,r,n,o);return Object.hasOwn(e,"index")&&(t.index=e.index),Object.hasOwn(e,"input")&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){const t=new Map;n.set(e,t);for(const[s,i]of e)t.set(s,zy(i,s,r,n,o));return t}if(e instanceof Set){const t=new Set;n.set(e,t);for(const s of e)t.add(zy(s,void 0,r,n,o));return t}if(typeof gy<"u"&&gy.isBuffer(e))return e.subarray();if(Fy(e)){const t=new(Object.getPrototypeOf(e).constructor)(e.length);n.set(e,t);for(let s=0;s<e.length;s++)t[s]=zy(e[s],s,r,n,o);return t}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return n.set(e,t),Vy(t,e,r,n,o),t}if(typeof File<"u"&&e instanceof File){const t=new File([e],e.name,{type:e.type});return n.set(e,t),Vy(t,e,r,n,o),t}if(e instanceof Blob){const t=new Blob([e],{type:e.type});return n.set(e,t),Vy(t,e,r,n,o),t}if(e instanceof Error){const t=new e.constructor;return n.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,Vy(t,e,r,n,o),t}if("object"==typeof e&&function(e){switch(by(e)){case Py:case Iy:case Sy:case By:case Ty:case Cy:case Dy:case Ly:case Ry:case Ny:case Uy:case ky:case Ay:case xy:case wy:case _y:case vy:case Ey:case Oy:case My:case Wy:case jy:return!0;default:return!1}}(e)){const t=Object.create(Object.getPrototypeOf(e));return n.set(e,t),Vy(t,e,r,n,o),t}return e}function Vy(e,t,r=e,n,o){const s=[...Object.keys(t),...yy(t)];for(let i=0;i<s.length;i++){const a=s[i],c=Object.getOwnPropertyDescriptor(e,a);(null==c||c.writable)&&(e[a]=zy(t[a],a,r,n,o))}}function qy(e,t){return function(e,t){return zy(e,void 0,e,new Map,t)}(e,((r,n,o,s)=>{const i=t?.(r,n,o,s);if(null!=i)return i;if("object"==typeof e)switch(Object.prototype.toString.call(e)){case Ay:case vy:case Ty:{const t=new e.constructor(e?.valueOf());return Vy(t,e),t}case Py:{const t={};return Vy(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}))}function Hy(e){return qy(e)}function Ky(e){return null!==e&&"object"==typeof e&&"[object Arguments]"===by(e)}function $y(e){return"object"==typeof e&&null!==e}function Gy(){}function Yy(e){return Fy(e)}function Jy(e){if("object"!=typeof e||null==e)return!1;if(null===Object.getPrototypeOf(e))return!0;
708if("[object Object]"!==Object.prototype.toString.call(e)){const t=e[Symbol.toStringTag];return!(null==t||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable)&&e.toString()===`[object ${t}]`}let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Qy(e,t,r,n){if(my(e)&&(e=Object(e)),null==t||"object"!=typeof t)return e;if(n.has(t))return function(e){if(my(e))return e;if(Array.isArray(e)||Fy(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);const t=Object.getPrototypeOf(e),r=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new r(e);if(e instanceof RegExp){const t=new r(e);return t.lastIndex=e.lastIndex,t}if(e instanceof DataView)return new r(e.buffer.slice(0));if(e instanceof Error){const t=new r(e.message);return t.stack=e.stack,t.name=e.name,t.cause=e.cause,t}if(typeof File<"u"&&e instanceof File)return new r([e],e.name,{type:e.type,lastModified:e.lastModified});if("object"==typeof e){const r=Object.create(t);return Object.assign(r,e)}return e}(n.get(t));if(n.set(t,e),Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)t[e]=t[e]??void 0}const o=[...Object.keys(t),...yy(t)];for(let s=0;s<o.length;s++){const i=o[s];let a=t[i],c=e[i];if(Ky(a)&&(a={...a}),Ky(c)&&(c={...c}),typeof gy<"u"&&gy.isBuffer(a)&&(a=Hy(a)),Array.isArray(a))if("object"==typeof c&&null!=c){const e=[],t=Reflect.ownKeys(c);for(let r=0;r<t.length;r++){const n=t[r];e[n]=c[n]}c=e}else c=[];const l=r(c,a,i,e,t,n);null!=l?e[i]=l:Array.isArray(a)||$y(c)&&$y(a)?e[i]=Qy(c,a,r,n):null==c&&Jy(a)?e[i]=Qy({},a,r,n):null==c&&Yy(a)?e[i]=Hy(a):(void 0===c||void 0!==a)&&(e[i]=a)}return e}function Zy(e,...t){return function(e,...t){const r=t.slice(0,-1),n=t[t.length-1];let o=e;for(let e=0;e<r.length;e++)o=Qy(o,r[e],n,new Map);return o}(e,...t,Gy)}const Xy="error",eb="universal_provider",tb=`wc@2:${eb}:`,rb="https://rpc.walletconnect.org/v1/",nb="generic",ob=`${rb}bundler`,sb="call_status",ib="default_chain_changed";var ab=Object.defineProperty,cb=Object.defineProperties,lb=Object.getOwnPropertyDescriptors,ub=Object.getOwnPropertySymbols,db=Object.prototype.hasOwnProperty,hb=Object.prototype.propertyIsEnumerable,pb=(e,t,r)=>t in e?ab(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,fb=(e,t)=>{for(var r in t||(t={}))db.call(t,r)&&pb(e,r,t[r]);if(ub)for(var r of ub(t))hb.call(t,r)&&pb(e,r,t[r]);return e},gb=(e,t)=>cb(e,lb(t));function mb(e,t,r){var n;const o=In(e);return(null==(n=t.rpcMap)?void 0:n[o.reference])||`${rb}?chainId=${o.namespace}:${o.reference}&projectId=${r}`}function yb(e){return e.map((e=>`${e.split(":")[0]}:${e.split(":")[1]}`))}function bb(e){return Object.fromEntries(Object.entries(e).filter((([e,t])=>{var r,n;return(null==(r=t?.chains)?void 0:r.length)&&(null==(n=t?.chains)?void 0:n.length)>0})))}function wb(e={},t={}){return Zy(bb(vb(e)),bb(vb(t)))}function vb(e){var t,r,n,o,s;const i={};if(!pu(e))return i;for(const[a,c]of Object.entries(e)){const e=ou(a)?[a]:c.chains,l=c.methods||[],u=c.events||[],d=c.rpcMap||{},h=su(a);i[h]=gb(fb(fb({},i[h]),c),{chains:lo(e,null==(t=i[h])?void 0:t.chains),methods:lo(l,null==(r=i[h])?void 0:r.methods),events:lo(u,null==(n=i[h])?void 0:n.events)}),(pu(d)||pu((null==(o=i[h])?void 0:o.rpcMap)||{}))&&(i[h].rpcMap=fb(fb({},d),null==(s=i[h])?void 0:s.rpcMap))}return i}function Ab(e){return e.includes(":")?e.split(":")[2]:e}function Tb(e){const t={};for(const[r,n]of Object.entries(e)){const e=n.methods||[],o=n.events||[],s=n.accounts||[],i=ou(r)?[r]:n.chains?n.chains:yb(n.accounts);t[r]={chains:i,methods:e,events:o,accounts:s}}return t}function Pb(e){return"number"==typeof e?e:e.includes("0x")?parseInt(e,16):(e=e.includes(":")?e.split(":")[1]:e,isNaN(Number(e))?e:Number(e))}const Eb={},Cb=e=>Eb[e],kb=(e,t)=>{Eb[e]=t};var _b=Object.defineProperty,Ib=Object.getOwnPropertySymbols,Sb=Object.prototype.hasOwnProperty,xb=Object.prototype.propertyIsEnumerable,Bb=(e,t,r)=>t in e?_b(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ob=(e,t)=>{for(var r in t||(t={}))Sb.call(t,r)&&Bb(e,r,t[r]);if(Ib)for(var r of Ib(t))xb.call(t,r)&&Bb(e,r,t[r]);return e};
708const Mb="eip155",Wb=["atomic","flow-control","paymasterService","sessionKeys","auxiliaryFunds"],jb=e=>e&&e.startsWith("0x")?BigInt(e).toString(10):e,Rb=e=>e&&e.startsWith("0x")?e:`0x${BigInt(e).toString(16)}`,Nb=e=>Object.keys(e).filter((e=>Wb.includes(e))).reduce(((t,r)=>(t[r]=Ub(e[r]),t)),{}),Ub=e=>"string"==typeof e&&function(e){try{const t=JSON.parse(e);return"object"==typeof t&&null!==t&&!Array.isArray(t)}catch{return!1}}(e)?JSON.parse(e):e;var Db=Object.defineProperty,Lb=(e,t,r)=>((e,t,r)=>t in e?Db(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);let Fb;class zb{constructor(e){Lb(this,"storage"),this.storage=e}async getItem(e){return await this.storage.getItem(e)}async setItem(e,t){return await this.storage.setItem(e,t)}async removeItem(e){return await this.storage.removeItem(e)}static getStorage(e){return Fb||(Fb=new zb(e)),Fb}}var Vb=Object.defineProperty,qb=Object.defineProperties,Hb=Object.getOwnPropertyDescriptors,Kb=Object.getOwnPropertySymbols,$b=Object.prototype.hasOwnProperty,Gb=Object.prototype.propertyIsEnumerable,Yb=(e,t,r)=>t in e?Vb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;async function Jb(e,t){const r=In(e.result.capabilities.caip345.caip2),n=e.result.capabilities.caip345.transactionHashes,o=await Promise.allSettled(n.map((e=>async function(e,t,r){return await r(parseInt(e)).request(ed("eth_getTransactionReceipt",[t]))}(r.reference,e,t)))),s=o.filter((e=>"fulfilled"===e.status)).map((e=>e.value)).filter((e=>e));o.filter((e=>"rejected"===e.status)).forEach((e=>console.warn("Failed to fetch transaction receipt:",e.reason)));const i=!s.length||s.some((e=>!e)),a=s.every((e=>"0x1"===e?.status)),c=s.every((e=>"0x0"===e?.status)),l=s.some((e=>"0x0"===e?.status));let u;return i?u=100:a?u=200:c?u=500:l&&(u=600),{id:e.result.id,version:e.request.version,atomic:e.request.atomicRequired,chainId:e.request.chainId,capabilities:e.result.capabilities,receipts:s,status:u}}async function Qb({sendCalls:e,storage:t}){const r=await t.getItem(sb);await t.setItem(sb,((e,t)=>qb(e,Hb(t)))(((e,t)=>{for(var r in t||(t={}))$b.call(t,r)&&Yb(e,r,t[r]);if(Kb)for(var r of Kb(t))Gb.call(t,r)&&Yb(e,r,t[r]);return e})({},r),{[e.result.id]:{request:e.request,result:e.result,expiry:io(86400)}}))}async function Zb({resultId:e,storage:t}){const r=await t.getItem(sb),n=r?.[e];if(n&&!ao(n.expiry))return n;await async function({resultId:e,storage:t}){const r=await t.getItem(sb);if(r){delete r[e],await t.setItem(sb,r);for(const e in r)ao(r[e].expiry)&&delete r[e];await t.setItem(sb,r)}}({resultId:e,storage:t})}var Xb=Object.defineProperty,ew=Object.defineProperties,tw=Object.getOwnPropertyDescriptors,rw=Object.getOwnPropertySymbols,nw=Object.prototype.hasOwnProperty,ow=Object.prototype.propertyIsEnumerable,sw=(e,t,r)=>t in e?Xb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,iw=(e,t)=>{for(var r in t||(t={}))nw.call(t,r)&&sw(e,r,t[r]);if(rw)for(var r of rw(t))ow.call(t,r)&&sw(e,r,t[r]);return e},aw=(e,t)=>ew(e,tw(t)),cw=(e,t,r)=>sw(e,"symbol"!=typeof t?t+"":t,r);class lw{constructor(e){cw(this,"name","eip155"),cw(this,"client"),cw(this,"chainId"),cw(this,"namespace"),cw(this,"httpProviders"),cw(this,"events"),cw(this,"storage"),this.namespace=e.namespace,this.events=Cb("events"),this.client=Cb("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain()),this.storage=zb.getStorage(this.client.core.storage)}async request(e){switch(e.request.method){case"eth_requestAccounts":case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e);case"wallet_getCallsStatus":return await this.getCallStatus(e);case"wallet_sendCalls":return await this.sendCalls(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(parseInt(e),t);const r=this.chainId;this.chainId=parseInt(e),this.events.emit(ib,{currentCaipChainId:`${this.name}:${e}`,previousCaipChainId:`${this.name}:${r}`})}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,t){const r=t||mb(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);return new gd(new fy(r,Cb("disableProviderPing")))}setHttpProvider(e,t){const r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var r;const n=parseInt(function(e){return e.includes(":")?e.split(":")[1]:e}(t));e[n]=this.createHttpProvider(n,null==(r=this.namespace.rpcMap)?void 0:r[t])})),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}getHttpProvider(e){const t=e||this.chainId;return this.httpProviders[t]||(this.httpProviders=aw(iw({},this.httpProviders),{[t]:this.createHttpProvider(t)}),this.httpProviders[t])}async handleSwitchChain(e){var t,r;let n=e.request.params?null==(t=e.request.params[0])?void 0:t.chainId:"0x0";n=n.startsWith("0x")?n:`0x${n}`;const o=parseInt(n,16);if(this.isChainApproved(o))this.setDefaultChain(`${o}`);else{if(!this.namespace.methods.includes("wallet_switchEthereumChain"))throw new Error(`Failed to switch to chain 'eip155:${o}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:n}]},chainId:null==(r=this.namespace.chains)?void 0:r[0]}),this.setDefaultChain(`${o}`)}return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var t,r,n,o,s;const i=null==(r=null==(t=e.request)?void 0:t.params)?void 0:r[0],a=(null==(o=null==(n=e.request)?void 0:n.params)?void 0:o[1])||[];if(!i)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const c=this.client.session.get(e.topic),l=(null==(s=c?.sessionProperties)?void 0:s.capabilities)||{},u=`${i}${a.length>0?a.join(","):`0x${this.chainId.toString(16)}`}`,d=l?.[u];if(d)return d;let h;try{h=((e,t,r)=>{const{sessionProperties:n={},scopedProperties:o={}}=e,s={};if(!pu(o)&&!pu(n))return;const i=Nb(n);for(const e of r){const r=jb(e);if(!r)continue;s[Rb(r)]=i;const n=o?.[`${Mb}:${r}`];if(n){const e=n?.[`${Mb}:${r}:${t}`];s[Rb(r)]=Ob(Ob({},s[Rb(r)]),Nb(e||n))}}for(const[e,t]of Object.entries(s))0===Object.keys(t).length&&delete s[e];return Object.keys(s).length>0?s:void 0})(c,i,a)}catch(e){console.warn("Failed to extract capabilities from session",e)}if(h)return h;const p=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:aw(iw({},c.sessionProperties||{}),{capabilities:aw(iw({},l||{}),{[u]:p})})})}catch(e){console.warn("Failed to update session with capabilities",e)}return p}async getCallStatus(e){var t,r,n;const o=this.client.session.get(e.topic),s=null==(t=o.sessionProperties)?void 0:t.bundler_name;if(s){const t=this.getBundlerUrl(e.chainId,s);try{return await this.getUserOperationReceipt(t,e)}catch(e){console.warn("Failed to fetch call status from bundler",e,t)}}const i=null==(r=o.sessionProperties)?void 0:r.bundler_url;if(i)try{return await this.getUserOperationReceipt(i,e)}catch(e){console.warn("Failed to fetch call status from custom bundler",e,i)}const a=await Zb({resultId:null==(n=e.request.params)?void 0:n[0],storage:this.storage});if(a)try{return await Jb(a,this.getHttpProvider.bind(this))}catch(e){console.warn("Failed to fetch call status from stored send calls",e,a)}if(this.namespace.methods.includes(e.request.method))return await this.client.request(e);throw new Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(e,t){var r;const n=new URL(e),o=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ed("eth_getUserOperationReceipt",[null==(r=t.request.params)?void 0:r[0]]))});if(!o.ok)throw new Error(`Failed to fetch user operation receipt - ${o.status}`);return await o.json()}
708getBundlerUrl(e,t){return`${ob}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${t}`}async sendCalls(e){var t,r,n;const o=await this.client.request(e),s=null==(t=e.request.params)?void 0:t[0],i=o?.id,a=o?.capabilities||{},c=null==(r=a?.caip345)?void 0:r.caip2,l=null==(n=a?.caip345)?void 0:n.transactionHashes;return!i||!c||!(null!=l&&l.length)||await Qb({sendCalls:{request:s,result:o},storage:this.storage}),o}}var uw=Object.defineProperty,dw=(e,t,r)=>((e,t,r)=>t in e?uw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class hw{constructor(e){dw(this,"name",nb),dw(this,"client"),dw(this,"httpProviders"),dw(this,"events"),dw(this,"namespace"),dw(this,"chainId"),this.namespace=e.namespace,this.events=Cb("events"),this.client=Cb("client"),this.chainId=this.getDefaultChain(),this.name=this.getNamespaceName(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t);const r=this.chainId;this.chainId=e,this.events.emit(ib,{currentCaipChainId:`${this.name}:${e}`,previousCaipChainId:`${this.name}:${r}`})}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getNamespaceName(){const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return In(e).namespace}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}createHttpProviders(){var e,t;const r={};return null==(t=null==(e=this.namespace)?void 0:e.accounts)||t.forEach((e=>{var t,n;const o=In(e),s=null==(n=null==(t=this.namespace)?void 0:t.rpcMap)?void 0:n[`${o.namespace}:${o.reference}`];r[o.reference]=this.createHttpProvider(e,s)})),r}getHttpProvider(e){const t=In(e).reference,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,t){const r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){const r=t||mb(e,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);return new gd(new fy(r,Cb("disableProviderPing")))}}var pw=Object.defineProperty,fw=Object.defineProperties,gw=Object.getOwnPropertyDescriptors,mw=Object.getOwnPropertySymbols,yw=Object.prototype.hasOwnProperty,bw=Object.prototype.propertyIsEnumerable,ww=(e,t,r)=>t in e?pw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vw=(e,t)=>{for(var r in t||(t={}))yw.call(t,r)&&ww(e,r,t[r]);if(mw)for(var r of mw(t))bw.call(t,r)&&ww(e,r,t[r]);return e},Aw=(e,t)=>fw(e,gw(t)),Tw=(e,t,r)=>ww(e,"symbol"!=typeof t?t+"":t,r);class Pw{constructor(e){var t,r;Tw(this,"client"),Tw(this,"namespaces"),Tw(this,"optionalNamespaces"),Tw(this,"sessionProperties"),Tw(this,"scopedProperties"),Tw(this,"events",new n),Tw(this,"rpcProviders",{}),Tw(this,"session"),Tw(this,"providerOpts"),Tw(this,"logger"),Tw(this,"uri"),Tw(this,"disableProviderPing",!1),Tw(this,"connectParams"),this.providerOpts=e,this.logger=Nu({logger:null!=(t=e.logger)?t:Xy,name:null!=(r=this.providerOpts.name)?r:eb}),this.disableProviderPing=e?.disableProviderPing||!1}static async init(e){const t=new Pw(e);return await t.initialize(),t}async request(e,t,r){const[n,o]=this.validateChain(t);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(n).request({request:vw({}
708,e),chainId:`${n}:${o}`,topic:this.session.topic,expiry:r})}sendAsync(e,t,r,n){const o=(new Date).getTime();this.request(e,r,n).then((e=>t(null,td(o,e)))).catch((e=>t(e,void 0)))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties,scopedProperties:this.scopedProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:null==(e=this.session)?void 0:e.topic,reason:du("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.connectParams=e,this.setNamespaces(e),this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e,t){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:r,response:n}=await this.client.authenticate(e,t);r&&(this.uri=r,this.events.emit("display_uri",r));const o=await n();if(this.session=o.session,this.session){const e=Tb(this.session.namespaces);this.namespaces=wb(this.namespaces,e),await this.persist("namespaces",this.namespaces),this.onConnect()}return o}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){var t,r;const{uri:n,approval:o}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties,scopedProperties:this.scopedProperties,authentication:null==(t=this.connectParams)?void 0:t.authentication,walletPay:null==(r=this.connectParams)?void 0:r.walletPay});n&&(this.uri=n,this.events.emit("display_uri",n));const s=await o();this.session=s;const i=Tb(s.namespaces);return this.namespaces=wb(this.namespaces,i),await this.persist("namespaces",this.namespaces),await this.persist("optionalNamespaces",this.optionalNamespaces),this.onConnect(),this.session}setDefaultChain(e,t){try{if(!this.session)return;const[r,n]=this.validateChain(e);this.getProvider(r).setDefaultChain(n,t)}catch(e){if(!/Please call connect/.test(e.message))throw e}}async cleanupPendingPairings(e={}){try{this.logger.info("Cleaning up inactive pairings...");const t=this.client.pairing.getAll();if(!hu(t))return;for(const r of t)e.deletePairings?this.client.core.expirer.set(r.topic,0):await this.client.core.relayer.subscriber.unsubscribe(r.topic);this.logger.info(`Inactive pairings cleared: ${t.length}`)}catch(e){this.logger.warn(e,"Failed to cleanup pending pairings")}}abortPairingAttempt(){this.logger.warn("abortPairingAttempt is deprecated. This is now a no-op.")}async checkStorage(){this.namespaces=await this.getFromStore("namespaces")||{},this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.session&&this.createProviders()}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){var e,t;if(this.client=this.providerOpts.client||await ty.init({core:this.providerOpts.core,logger:this.providerOpts.logger||Xy,relayUrl:this.providerOpts.relayUrl||"wss://relay.walletconnect.org",projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.providerOpts.session)try{this.session=this.client.session.get(this.providerOpts.session.topic)}catch(r){throw this.logger.error(r,"Failed to get session"),new Error(`The provided session: ${null==(t=null==(e=this.providerOpts)?void 0:e.session)?void 0:t.topic} doesn't exist in the Sign client`)}else{const e=this.client.session.getAll();this.session=e[0]}this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map((e=>su(e))))];kb("client",this.client),kb("events",this.events),kb("disableProviderPing",this.disableProviderPing),e.forEach((e=>{if(!this.session)return;const t=function(e,t){const r=Object.keys(t.namespaces).filter((t=>t.includes(e)));if(!r.length)return[];const n=[];return r.forEach((e=>{const r=t.namespaces[e].accounts;n.push(...r)})),n}(e,this.session);if(0===t?.length)return;const r=yb(t),n=wb(this.namespaces,this.optionalNamespaces),o=Aw(vw({},n[e]),{accounts:t,chains:r});if("eip155"===e)this.rpcProviders[e]=new lw({namespace:o});
708else this.rpcProviders[e]=new hw({namespace:o})}))}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",(e=>{var t;const{topic:r}=e;r===(null==(t=this.session)?void 0:t.topic)&&this.events.emit("session_ping",e)})),this.client.on("session_event",(e=>{var t;const{params:r,topic:n}=e;if(n!==(null==(t=this.session)?void 0:t.topic))return;const{event:o}=r;if("accountsChanged"===o.name){const e=o.data;e&&hu(e)&&this.events.emit("accountsChanged",e.map(Ab))}else if("chainChanged"===o.name){const e=r.chainId,t=r.event.data,n=su(e),o=Pb(e)!==Pb(t)?`${n}:${Pb(t)}`:e;this.onChainChanged({currentCaipChainId:o})}else this.events.emit(o.name,o.data);this.events.emit("session_event",e)})),this.client.on("session_update",(({topic:e,params:t})=>{var r,n;if(e!==(null==(r=this.session)?void 0:r.topic))return;const{namespaces:o}=t,s=null==(n=this.client)?void 0:n.session.get(e);this.session=Aw(vw({},s),{namespaces:o}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})})),this.client.on("session_delete",(async e=>{var t;e.topic===(null==(t=this.session)?void 0:t.topic)&&(await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",Aw(vw({},du("USER_DISCONNECTED")),{data:e.topic})))})),this.on(ib,(e=>{this.onChainChanged(Aw(vw({},e),{internal:!0}))}))}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[nb]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach((e=>{var t;this.getProvider(e).updateNamespace(null==(t=this.session)?void 0:t.namespaces[e])}))}setNamespaces(e){const{namespaces:t={},optionalNamespaces:r={},sessionProperties:n,scopedProperties:o}=e;this.optionalNamespaces=wb(t,r),this.sessionProperties=n,this.scopedProperties=o}validateChain(e){const[t,r]=e?.split(":")||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[t,r];if(t&&!Object.keys(this.namespaces||{}).map((e=>su(e))).includes(t))throw new Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&r)return[t,r];const n=su(Object.keys(this.namespaces)[0]);return[n,this.rpcProviders[n].getDefaultChain()]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}async onChainChanged({currentCaipChainId:e,previousCaipChainId:t,internal:r=!1}){if(!this.namespaces)return;const[n,o]=this.validateChain(e);o&&(this.updateNamespaceChain(n,o),r?(this.events.emit("chainChanged",o),this.emitAccountsChangedOnChainChange({namespace:n,currentCaipChainId:e,previousCaipChainId:t})):this.getProvider(n).setDefaultChain(o),await this.persist("namespaces",this.namespaces))}emitAccountsChangedOnChainChange({namespace:e,currentCaipChainId:t,previousCaipChainId:r}){var n,o;try{if(r===t)return;const s=null==(o=null==(n=this.session)?void 0:n.namespaces[e])?void 0:o.accounts;if(!s)return;const i=s.filter((e=>e.includes(`${t}:`))).map(Ab);if(!hu(i))return;this.events.emit("accountsChanged",i)}catch(e){this.logger.warn(e,"Failed to emit accountsChanged on chain change")}}updateNamespaceChain(e,t){if(!this.namespaces)return;const r=this.namespaces[e]?e:`${e}:${t}`,n={chains:[],methods:[],events:[],defaultChain:t};this.namespaces[r]?this.namespaces[r]&&(this.namespaces[r].defaultChain=t):this.namespaces[r]=n}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.connectParams=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,await this.deleteFromStore("namespaces"),await this.deleteFromStore("optionalNamespaces"),await this.deleteFromStore("sessionProperties"),this.session=void 0,this.cleanupPendingPairings({deletePairings:!0}),await this.cleanupStorage()}async persist(e,t){var r;const n=(null==(r=this.session)?void 0:r.topic)||"";await this.client.core.storage.setItem(`${tb}/${e}${n}`,t)}async getFromStore(e){var t;const r=(null==(t=this.session)?void 0:t.topic)||"";return await this.client.core.storage.getItem(`${tb}/${e}${r}`)}async deleteFromStore(e){var t;const r=(null==(t=this.session)?void 0:t.topic)||"";await this.client.core.storage.removeItem(`${tb}/${e}${r}`)}async cleanupStorage(){var e;try{if((null==(e=this.client)?void 0:e.session.length)>0)return;const t=await this.client.core.storage.getKeys();for(const e of t)e.startsWith(tb)&&await this.client.core.storage.removeItem(e)}catch(e){this.logger.warn(e,"Failed to cleanup storage")}}}const Ew=Pw},"./node_modules/@solana-mobile/mobile-wallet-adapter-protocol-web3js/lib/esm/index.js"(e,t,r){"use strict";r.d(t,{X:()=>p,h:()=>h});var n=r("./node_modules/@solana/web3.js/lib/index.browser.esm.js"),o=r("./node_modules/@solana-mobile/mobile-wallet-adapter-protocol/lib/esm/index.js"),s=r("./node_modules/@solana-mobile/mobile-wallet-adapter-protocol-web3js/node_modules/bs58/index.js");function i(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function a(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))}function c(e){return window.btoa(String.fromCharCode.call(null,...e))}function l(e){return new Uint8Array(window.atob(e).split("").map((e=>e.charCodeAt(0))))}function u(e){return c("version"in e?e.serialize():e.serialize({requireAllSignatures:!1,verifySignatures:!1}))}function d(e){const t=e[0]*n.SIGNATURE_LENGTH_IN_BYTES+1;return"legacy"===n.VersionedMessage.deserializeMessageVersion(e.slice(t,e.length))?n.Transaction.from(e):n.VersionedTransaction.deserialize(e)}function h(e,t){return a(this,void 0,void 0,(function*(){return yield(0,o.hL)((t=>e(f(t))),t)}))}function p(e){return a(this,void 0,void 0,(function*(){const{wallet:t,close:r,associationUrl:n}=yield(0,o.X2)(e);return{wallet:t.then((e=>f(e))),close:r,associationUrl:n}}))}function f(e){return new Proxy({},{get(t,r){if(null==t[r])switch(r){case"signAndSendTransactions":t[r]=function(t){var{minContextSlot:r,commitment:n,skipPreflight:o,maxRetries:c,waitForCommitmentToSendNextTransaction:d,transactions:h}=t,p=i(t,["minContextSlot","commitment","skipPreflight","maxRetries","waitForCommitmentToSendNextTransaction","transactions"]);return a(this,void 0,void 0,(function*(){const t=h.map(u),i={min_context_slot:r,commitment:n,skip_preflight:o,max_retries:c,wait_for_c
708ommitment_to_send_next_transaction:d},{signatures:a}=yield e.signAndSendTransactions(Object.assign(Object.assign(Object.assign({},p),Object.values(i).some((e=>null!=e))?{options:i}:null),{payloads:t}));return a.map(l).map(s.encode)}))};break;case"signMessages":t[r]=function(t){var{payloads:r}=t,n=i(t,["payloads"]);return a(this,void 0,void 0,(function*(){const t=r.map(c),{signed_payloads:o}=yield e.signMessages(Object.assign(Object.assign({},n),{payloads:t}));return o.map(l)}))};break;case"signTransactions":t[r]=function(t){var{transactions:r}=t,n=i(t,["transactions"]);return a(this,void 0,void 0,(function*(){const t=r.map(u),{signed_payloads:o}=yield e.signTransactions(Object.assign(Object.assign({},n),{payloads:t}));return o.map(l).map(d)}))};break;default:t[r]=e[r]}return t[r]},defineProperty:()=>!1,deleteProperty:()=>!1})}},"./node_modules/@solana/wallet-adapter-coinbase/lib/esm/adapter.js"(e,t,r){"use strict";r.d(t,{d:()=>c});var n=r("./node_modules/@solana/wallet-adapter-base/lib/esm/adapter.js"),o=r("./node_modules/@solana/wallet-adapter-base/lib/esm/errors.js"),s=r("./node_modules/@solana/wallet-adapter-base/lib/esm/signer.js"),i=r("./node_modules/@solana/wallet-adapter-base/lib/esm/transaction.js"),a=r("./node_modules/@solana/web3.js/lib/index.browser.esm.js");class c extends s.DE{constructor(e={}){super(),this.name="Coinbase Wallet",this.url="https://chrome.google.com/webstore/detail/coinbase-wallet-extension/hnfanknocfeofbddgcijnmhnfnkdnaad",this.icon="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAyNCIgaGVpZ2h0PSIxMDI0IiB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8Y2lyY2xlIGN4PSI1MTIiIGN5PSI1MTIiIHI9IjUxMiIgZmlsbD0iIzAwNTJGRiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTE1MiA1MTJDMTUyIDcxMC44MjMgMzEzLjE3NyA4NzIgNTEyIDg3MkM3MTAuODIzIDg3MiA4NzIgNzEwLjgyMyA4NzIgNTEyQzg3MiAzMTMuMTc3IDcxMC44MjMgMTUyIDUxMiAxNTJDMzEzLjE3NyAxNTIgMTUyIDMxMy4xNzcgMTUyIDUxMlpNNDIwIDM5NkM0MDYuNzQ1IDM5NiAzOTYgNDA2Ljc0NSAzOTYgNDIwVjYwNEMzOTYgNjE3LjI1NSA0MDYuNzQ1IDYyOCA0MjAgNjI4SDYwNEM2MTcuMjU1IDYyOCA2MjggNjE3LjI1NSA2MjggNjA0VjQyMEM2MjggNDA2Ljc0NSA2MTcuMjU1IDM5NiA2MDQgMzk2SDQyMFoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=",this.supportedTransactionVersions=new Set(["legacy",0]),this._readyState="undefined"==typeof window||"undefined"==typeof document?n.Ok.Unsupported:n.Ok.NotDetected,this._disconnected=()=>{const e=this._wallet;e&&(e.off("disconnect",this._disconnected),this._wallet=null,this._publicKey=null,this.emit("error",new o.PQ),this.emit("disconnect"))},this._connecting=!1,this._wallet=null,this._publicKey=null,this._readyState!==n.Ok.Unsupported&&(0,n.qG)((()=>!!window?.coinbaseSolana&&(this._readyState=n.Ok.Installed,this.emit("readyStateChange",this._readyState),!0)))}get publicKey(){return this._publicKey}get connecting(){return this._connecting}get readyState(){return this._readyState}async connect(){try{if(this.connected||this.connecting)return;if(this._readyState!==n.Ok.Installed)throw new o.AE;this._connecting=!0;const e=window.coinbaseSolana;try{await e.connect()}catch(e){throw new o.Y6(e?.message,e)}if(!e.publicKey)throw new o.fk;let t;try{t=new a.PublicKey(e.publicKey.toBytes())}catch(e){throw new o.Kd(e?.message,e)}e.on("disconnect",this._disconnected),this._wallet=e,this._publicKey=t,this.emit("connect",t)}catch(e){throw this.emit("error",e),e}finally{this._connecting=!1}}async disconnect(){const e=this._wallet;if(e){e.off("disconnect",this._disconnected),this._wallet=null,this._publicKey=null;try{await e.disconnect()}catch(e){this.emit("error",new o.Y8(e?.message,e))}}this.emit("disconnect")}async sendTransaction(e,t,r={}){try{const n=this._wallet;if(!n)throw new o.kW;try{const{signers:o,...s}=r;(0,i.Y)(e)?o?.length&&e.sign(o):(e=await this.prepareTransaction(e,t,s),o?.length&&e.partialSign(...o)),s.preflightCommitment=s.preflightCommitment||t.commitment;const{signature:a}=await n.signAndSendTransaction(e,s);return a}catch(e){if(e instanceof o.m7)throw e;throw new o.UF(e?.message,e)}}catch(e){throw this.emit("error",e),e}}async signTransaction(e){try{const t=this._wallet;if(!t)throw new o.kW;try{return await t.signTransaction(e)||e}catch(e){throw new o.z4(e?.message,e)}}
708catch(e){throw this.emit("error",e),e}}async signAllTransactions(e){try{const t=this._wallet;if(!t)throw new o.kW;try{return await t.signAllTransactions(e)||e}catch(e){throw new o.z4(e?.message,e)}}catch(e){throw this.emit("error",e),e}}async signMessage(e){try{const t=this._wallet;if(!t)throw new o.kW;try{const{signature:r}=await t.signMessage(e);return r}catch(e){throw new o.z4(e?.message,e)}}catch(e){throw this.emit("error",e),e}}}},"./node_modules/@tonconnect/ui-react/lib/index.mjs"(e,t,r){"use strict";r.d(t,{Nl:()=>Qu,k8:()=>sd,zI:()=>nd,IO:()=>od,Lg:()=>ed,c5:()=>rd});var n,o,s,i,a,c,l=r("./node_modules/react/index.js"),u=r("./node_modules/tweetnacl-util/nacl-util.js"),d=r("./node_modules/tweetnacl/nacl-fast.js");r("./node_modules/process/browser.js");!function(e){e[e.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",e[e.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",e[e.MANIFEST_NOT_FOUND_ERROR=2]="MANIFEST_NOT_FOUND_ERROR",e[e.MANIFEST_CONTENT_ERROR=3]="MANIFEST_CONTENT_ERROR",e[e.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",e[e.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",e[e.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"}(n||(n={})),function(e){e[e.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",e[e.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"}(o||(o={})),function(e){e[e.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",e[e.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",e[e.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",e[e.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",e[e.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"}(s||(s={})),function(e){e[e.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",e[e.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",e[e.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",e[e.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",e[e.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"}(i||(i={})),function(e){e[e.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",e[e.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",e[e.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",e[e.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"}(a||(a={})),function(e){e.MAINNET="-239",e.TESTNET="-3"}(c||(c={}));const h={encode:function(e,t=!1){let r;return e instanceof Uint8Array?r=e:("string"!=typeof e&&(e=JSON.stringify(e)),r=u.decodeUTF8(e)),function(e,t){const r=u.encodeBase64(e);return t?encodeURIComponent(r):r}(r,t)},decode:function(e,t=!1){const r=function(e,t){return t&&(e=decodeURIComponent(e)),u.decodeBase64(e)}(e,t);return{toString:()=>u.encodeUTF8(r),toObject(){try{return JSON.parse(u.encodeUTF8(r))}catch(e){return null}},toUint8Array:()=>r}}};function p(e){let t="";return e.forEach((e=>{t+=("0"+(255&e).toString(16)).slice(-2)})),t}function f(e){if(e.length%2!=0)throw new Error(`Cannot convert ${e} to bytesArray`);const t=new Uint8Array(e.length/2);for(let r=0;r<e.length;r+=2)t[r/2]=parseInt(e.slice(r,r+2),16);return t}class g{constructor(e){this.nonceLength=24,this.keyPair=e?this.createKeypairFromString(e):this.createKeypair(),this.sessionId=p(this.keyPair.publicKey)}createKeypair(){return d.box.keyPair()}createKeypairFromString(e){return{publicKey:f(e.publicKey),secretKey:f(e.secretKey)}}createNonce(){return d.randomBytes(this.nonceLength)}encrypt(e,t){const r=(new TextEncoder).encode(e),n=this.createNonce();return function(e,t){const r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}(n,d.box(r,n,t,this.keyPair.secretKey))}decrypt(e,t){const[r,n]=function(e,t){if(t>=e.length)throw new Error("Index is out of buffer");return[e.slice(0,t),e.slice(t)]}(e,this.nonceLength),o=d.box.open(n,r,t,this.keyPair.secretKey);if(!o)throw new Error(`Decryption error: \n message: ${e.toString()} \n sender pubkey: ${t.toString()} \n keypair pubkey: ${this.keyPair.publicKey.toString()} \n keypair secretkey: ${this.keyPair.secretKey.toString()}`);return(new TextDecoder).decode(o)}stringifyKeypair(){return{publicKey:p(this.keyPair.publicKey),secretKey:p(this.keyPair.secretKey)}}}var m=r("./node_modules/process/browser.js");function y(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))}
708class b extends Error{constructor(e,t){super(e,t),this.message=`${b.prefix} ${this.constructor.name}${this.info?": "+this.info:""}${e?"\n"+e:""}`,Object.setPrototypeOf(this,b.prototype)}get info(){return""}}b.prefix="[TON_CONNECT_SDK_ERROR]";class w extends b{get info(){return"Passed DappMetadata is in incorrect format."}constructor(...e){super(...e),Object.setPrototypeOf(this,w.prototype)}}class v extends b{get info(){return"Passed `tonconnect-manifest.json` contains errors. Check format of your manifest. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest"}constructor(...e){super(...e),Object.setPrototypeOf(this,v.prototype)}}class A extends b{get info(){return"Manifest not found. Make sure you added `tonconnect-manifest.json` to the root of your app or passed correct manifestUrl. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest"}constructor(...e){super(...e),Object.setPrototypeOf(this,A.prototype)}}class T extends b{get info(){return"Wallet connection called but wallet already connected. To avoid the error, disconnect the wallet before doing a new connection."}constructor(...e){super(...e),Object.setPrototypeOf(this,T.prototype)}}class P extends b{get info(){return"Send transaction or other protocol methods called while wallet is not connected."}constructor(...e){super(...e),Object.setPrototypeOf(this,P.prototype)}}class E extends b{get info(){return"User rejects the action in the wallet."}constructor(...e){super(...e),Object.setPrototypeOf(this,E.prototype)}}class C extends b{get info(){return"Request to the wallet contains errors."}constructor(...e){super(...e),Object.setPrototypeOf(this,C.prototype)}}class k extends b{get info(){return"App tries to send rpc request to the injected wallet while not connected."}constructor(...e){super(...e),Object.setPrototypeOf(this,k.prototype)}}class _ extends b{get info(){return"There is an attempt to connect to the injected wallet while it is not exists in the webpage."}constructor(...e){super(...e),Object.setPrototypeOf(this,_.prototype)}}class I extends b{get info(){return"An error occurred while fetching the wallets list."}constructor(...e){super(...e),Object.setPrototypeOf(this,I.prototype)}}class S extends b{get info(){return"Passed address is in incorrect format."}constructor(...e){super(...e),Object.setPrototypeOf(this,S.prototype)}}class x extends b{get info(){return"Passed hex is in incorrect format."}constructor(...e){super(...e),Object.setPrototypeOf(this,x.prototype)}}class B extends b{constructor(...e){super(...e),Object.setPrototypeOf(this,B.prototype)}}const O={[n.UNKNOWN_ERROR]:B,[n.USER_REJECTS_ERROR]:E,[n.BAD_REQUEST_ERROR]:C,[n.UNKNOWN_APP_ERROR]:k,[n.MANIFEST_NOT_FOUND_ERROR]:A,[n.MANIFEST_CONTENT_ERROR]:v};const M=new class{parseError(e){let t=B;return e.code in O&&(t=O[e.code]||B),new t(e.message)}};class W{isError(e){return"error"in e}}const j={[s.UNKNOWN_ERROR]:B,[s.USER_REJECTS_ERROR]:E,[s.BAD_REQUEST_ERROR]:C,[s.UNKNOWN_APP_ERROR]:k};const R=new class extends W{convertToRpcRequest(e){return{method:"sendTransaction",params:[JSON.stringify(e)]}}parseAndThrowError(e){let t=B;throw e.error.code in j&&(t=j[e.error.code]||B),new t(e.error.message)}convertFromRpcResponse(e){return{boc:e.result}}};class N{constructor(e,t){this.storage=e,this.storeKey="ton-connect-storage_http-bridge-gateway::"+t}storeLastEventId(e){return y(this,void 0,void 0,(function*(){return this.storage.setItem(this.storeKey,e)}))}removeLastEventId(){return y(this,void 0,void 0,(function*(){return this.storage.removeItem(this.storeKey)}))}getLastEventId(){return y(this,void 0,void 0,(function*(){const e=yield this.storage.getItem(this.storeKey);return e||null}))}}function U(e,t){return function(e){return"/"===e.slice(-1)?e.slice(0,-1):e}(e)+"/"+t}function D(e){if(!e)return!1;const t=new URL(e);return"tg:"===t.protocol||"t.me"===t.hostname}function L(e){return e.replaceAll(".","%2E").replaceAll("-","%2D").replaceAll("_","%5F").replaceAll("&","-").replaceAll("=","__").replaceAll("%","--")}function F(e,t){return y(this,void 0,void 0,(function*(){return new Promise(((r,n)=>{var o,s;if(null===(o=null==t?void 0:t.signal)||void 0===o?void 0:o.aborted)return void n(new b("Delay aborted"));const i=setTimeout((()=>r()),e);null===(s=null==t?void 0:t.signal)||void 0===s||s.addEventListener("abort",(()=>{clearTimeout(i),n(new b("Delay aborted"))}))}))}))}function z(e){const t=new AbortController;return(null==e?void 0:e.aborted)?t.abort():null==e||e.addEventListener("abort",(()=>t.abort()),{once:!0}),t}function V(e,t){var r,n;return y(this,void 0,void 0,(function*(){const o=null!==(r=null==t?void 0:t.attempts)&&void 0!==r?r:10,s=null!==(n=null==t?void 0:t.delayMs)&&void 0!==n?n:200,i=z(null==t?void 0:t.signal);if("function"!=typeof e)throw new b("Expected a function, got "+typeof e);let a,c=0;for(;c<o;){if(i.signal.aborted)throw new b(`Aborted after attempts ${c}`);try{return yield e({signal:i.signal})}catch(e){a=e,c++,c<o&&(yield F(s))}}throw a}))}function q(...e){try{console.debug("[TON_CONNECT_SDK]",...e)}catch(e){}}function H(...e){try{console.error("[TON_CONNECT_SDK]",...e)}catch(e){}}class K{constructor(e,t,r,n,o){this.bridgeUrl=t,this.sessionId=r,this.listener=n,this.errorsListener=o,this.ssePath="events",this.postPath="message",this.heartbeatMessage="heartbeat",this.defaultTtl=300,this.defaultReconnectDelay=2e3,this.defaultResendDelay=5e3,this.eventSource=function(e,t){let r=null,n=null,o=null,s=null,i=null;const a=(a,...c)=>y(this,void 0,void 0,(function*(){if(s=null!=a?a:null,null==i||i.abort(),i=z(
708a),i.signal.aborted)throw new b("Resource creation was aborted");n=null!=c?c:null;const l=e(i.signal,...c);o=l;const u=yield l;if(o!==l&&u!==r)throw yield t(u),new b("Resource creation was aborted by a new resource creation");return r=u,r}));return{create:a,current:()=>null!=r?r:null,dispose:()=>y(this,void 0,void 0,(function*(){try{const e=r;r=null;const n=o;o=null;try{null==i||i.abort()}catch(e){}yield Promise.allSettled([e?t(e):Promise.resolve(),n?t(yield n):Promise.resolve()])}catch(e){}})),recreate:e=>y(this,void 0,void 0,(function*(){const t=r,i=o,c=n,l=s;if(yield F(e),t===r&&i===o&&c===n&&l===s)return yield a(s,...null!=c?c:[]);throw new b("Resource recreation was aborted by a new resource creation")}))}}(((e,t)=>y(this,void 0,void 0,(function*(){const r={bridgeUrl:this.bridgeUrl,ssePath:this.ssePath,sessionId:this.sessionId,bridgeGatewayStorage:this.bridgeGatewayStorage,errorHandler:this.errorsHandler.bind(this),messageHandler:this.messagesHandler.bind(this),signal:e,openingDeadlineMS:t};return yield function(e){return y(this,void 0,void 0,(function*(){return yield function(e,t){const r=null==t?void 0:t.timeout,n=z(null==t?void 0:t.signal);return new Promise(((t,o)=>y(this,void 0,void 0,(function*(){if(n.signal.aborted)return void o(new b("Operation aborted"));let s;void 0!==r&&(s=setTimeout((()=>{n.abort(),o(new b(`Timeout after ${r}ms`))}),r)),n.signal.addEventListener("abort",(()=>{clearTimeout(s),o(new b("Operation aborted"))}),{once:!0});const i={timeout:r,abort:n.signal};yield e(((...e)=>{clearTimeout(s),t(...e)}),(()=>{clearTimeout(s),o()}),i)}))))}(((t,r,n)=>y(this,void 0,void 0,(function*(){var o;const s=z(n.signal).signal;if(s.aborted)return void r(new b("Bridge connection aborted"));const i=new URL(U(e.bridgeUrl,e.ssePath));i.searchParams.append("client_id",e.sessionId);const a=yield e.bridgeGatewayStorage.getLastEventId();if(a&&i.searchParams.append("last_event_id",a),s.aborted)return void r(new b("Bridge connection aborted"));const c=new EventSource(i.toString());c.onerror=n=>y(this,void 0,void 0,(function*(){if(s.aborted)return c.close(),void r(new b("Bridge connection aborted"));try{const r=yield e.errorHandler(c,n);r!==c&&c.close(),r&&r!==c&&t(r)}catch(e){c.close(),r(e)}})),c.onopen=()=>{if(s.aborted)return c.close(),void r(new b("Bridge connection aborted"));t(c)},c.onmessage=t=>{if(s.aborted)return c.close(),void r(new b("Bridge connection aborted"));e.messageHandler(t)},null===(o=e.signal)||void 0===o||o.addEventListener("abort",(()=>{c.close(),r(new b("Bridge connection aborted"))}))}))),{timeout:e.openingDeadlineMS,signal:e.signal})}))}(r)}))),(e=>y(this,void 0,void 0,(function*(){e.close()})))),this.bridgeGatewayStorage=new N(e,t)}get isReady(){const e=this.eventSource.current();return(null==e?void 0:e.readyState)===EventSource.OPEN}get isClosed(){const e=this.eventSource.current();return(null==e?void 0:e.readyState)!==EventSource.OPEN}get isConnecting(){const e=this.eventSource.current();return(null==e?void 0:e.readyState)===EventSource.CONNECTING}registerSession(e){return y(this,void 0,void 0,(function*(){yield this.eventSource.create(null==e?void 0:e.signal,null==e?void 0:e.openingDeadlineMS)}))}send(e,t,r,n){var o;return y(this,void 0,void 0,(function*(){const s={};"number"==typeof n?s.ttl=n:(s.ttl=null==n?void 0:n.ttl,s.signal=null==n?void 0:n.signal,s.attempts=null==n?void 0:n.attempts);const i=new URL(U(this.bridgeUrl,this.postPath));i.searchParams.append("client_id",this.sessionId),i.searchParams.append("to",t),i.searchParams.append("ttl",((null==s?void 0:s.ttl)||this.defaultTtl).toString()),i.searchParams.append("topic",r);const a=h.encode(e);yield V((e=>y(this,void 0,void 0,(function*(){const t=yield this.post(i,a,e.signal);if(!t.ok)throw new b(`Bridge send failed, status ${t.status}`)}))),{attempts:null!==(o=null==s?void 0:s.attempts)&&void 0!==o?o:Number.MAX_SAFE_INTEGER,delayMs:this.defaultResendDelay,signal:null==s?void 0:s.signal})}))}pause(){this.eventSource.dispose().catch((e=>H(`Bridge pause failed, ${e}`)))}unPause(){return y(this,void 0,void 0,(function*(){yield this.eventSource.recreate(0)}))}close(){return y(this,void 0,void 0,(function*(){yield this.eventSource.dispose().catch((e=>H(`Bridge close failed, ${e}`)))}))}setListener(e){this.listener=e}setErrorsListener(e){this.errorsListener=e}post(e,t,r){return y(this,void 0,void 0,(function*(){const n=yield fetch(e,{method:"post",body:t,signal:r});if(!n.ok)throw new b(`Bridge send failed, status ${n.status}`);return n}))}errorsHandler(e,t){return y(this,void 0,void 0,(function*(){if(this.isConnecting)throw e.close(),new b("Bridge error, failed to connect");
708if(!this.isReady){if(this.isClosed)return e.close(),q(`Bridge reconnecting, ${this.defaultReconnectDelay}ms delay`),yield this.eventSource.recreate(this.defaultReconnectDelay);throw new b("Bridge error, unknown state")}try{this.errorsListener(t)}catch(e){}}))}messagesHandler(e){return y(this,void 0,void 0,(function*(){if(e.data===this.heartbeatMessage)return;if(yield this.bridgeGatewayStorage.storeLastEventId(e.lastEventId),this.isClosed)return;let t;try{t=JSON.parse(e.data)}catch(e){throw new b(`Bridge message parse failed, message ${e.data}`)}this.listener(t)}))}}function $(e){return!("connectEvent"in e)}class G{constructor(e){this.storage=e,this.storeKey="ton-connect-storage_bridge-connection"}storeConnection(e){return y(this,void 0,void 0,(function*(){if("injected"===e.type)return this.storage.setItem(this.storeKey,JSON.stringify(e));if(!$(e)){const t={sessionKeyPair:e.session.sessionCrypto.stringifyKeypair(),walletPublicKey:e.session.walletPublicKey,bridgeUrl:e.session.bridgeUrl},r={type:"http",connectEvent:e.connectEvent,session:t,lastWalletEventId:e.lastWalletEventId,nextRpcRequestId:e.nextRpcRequestId};return this.storage.setItem(this.storeKey,JSON.stringify(r))}const t={type:"http",connectionSource:e.connectionSource,sessionCrypto:e.sessionCrypto.stringifyKeypair()};return this.storage.setItem(this.storeKey,JSON.stringify(t))}))}removeConnection(){return y(this,void 0,void 0,(function*(){return this.storage.removeItem(this.storeKey)}))}getConnection(){return y(this,void 0,void 0,(function*(){const e=yield this.storage.getItem(this.storeKey);if(!e)return null;const t=JSON.parse(e);if("injected"===t.type)return t;if("connectEvent"in t){const e=new g(t.session.sessionKeyPair);return{type:"http",connectEvent:t.connectEvent,lastWalletEventId:t.lastWalletEventId,nextRpcRequestId:t.nextRpcRequestId,session:{sessionCrypto:e,bridgeUrl:t.session.bridgeUrl,walletPublicKey:t.session.walletPublicKey}}}return{type:"http",sessionCrypto:new g(t.sessionCrypto),connectionSource:t.connectionSource}}))}getHttpConnection(){return y(this,void 0,void 0,(function*(){const e=yield this.getConnection();if(!e)throw new b("Trying to read HTTP connection source while nothing is stored");if("injected"===e.type)throw new b("Trying to read HTTP connection source while injected connection is stored");return e}))}getHttpPendingConnection(){return y(this,void 0,void 0,(function*(){const e=yield this.getConnection();if(!e)throw new b("Trying to read HTTP connection source while nothing is stored");if("injected"===e.type)throw new b("Trying to read HTTP connection source while injected connection is stored");if(!$(e))throw new b("Trying to read HTTP-pending connection while http connection is stored");return e}))}getInjectedConnection(){return y(this,void 0,void 0,(function*(){const e=yield this.getConnection();if(!e)throw new b("Trying to read Injected bridge connection source while nothing is stored");if("http"===(null==e?void 0:e.type))throw new b("Trying to read Injected bridge connection source while HTTP connection is stored");return e}))}storedConnectionType(){return y(this,void 0,void 0,(function*(){const e=yield this.storage.getItem(this.storeKey);if(!e)return null;return JSON.parse(e).type}))}storeLastWalletEventId(e){return y(this,void 0,void 0,(function*(){const t=yield this.getConnection();if(t&&"http"===t.type&&!$(t))return t.lastWalletEventId=e,this.storeConnection(t)}))}getLastWalletEventId(){return y(this,void 0,void 0,(function*(){const e=yield this.getConnection();if(e&&"lastWalletEventId"in e)return e.lastWalletEventId}))}increaseNextRpcRequestId(){return y(this,void 0,void 0,(function*(){const e=yield this.getConnection();if(e&&"nextRpcRequestId"in e){const t=e.nextRpcRequestId||0;return e.nextRpcRequestId=t+1,this.storeConnection(e)}}))}getNextRpcRequestId(){return y(this,void 0,void 0,(function*(){const e=yield this.getConnection();return e&&"nextRpcRequestId"in e&&e.nextRpcRequestId||0}))}}class Y{constructor(e,t){this.storage=e,this.walletConnectionSource=t,this.type="http",this.standardUniversalLink="tc://",this.pendingRequests=new Map,this.session=null,this.gateway=null,this.pendingGateways=[],this.listeners=[],this.defaultOpeningDeadlineMS=12e3,this.defaultRetryTimeoutMS=2e3,this.connectionStorage=new G(e)}static fromStorage(e){return y(this,void 0,void 0,(function*(){const t=new G(e),r=yield t.getHttpConnection();return $(r)?new Y(e,r.connectionSource):new Y(e,{bridgeUrl:r.session.bridgeUrl})}))}connect(e,t){var r;const n=z(null==t?void 0:t.signal);null===(r=this.abortController)||void 0===r||r.abort(),this.abortController=n,this.closeGateways();const o=new g;this.session={sessionCrypto:o,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},this.connectionStorage.storeConnection({type:"http",connectionSource:this.walletConnectionSource,sessionCrypto:o}).then((()=>y(this,void 0,void 0,(function*(){n.signal.aborted||(yield V((e=>{var r;return this.openGateways(o,{openingDeadlineMS:null!==(r=null==t?void 0:t.openingDeadlineMS)&&void 0!==r?r:this.defaultOpeningDeadlineMS,signal:null==e?void 0:e.signal})}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:this.defaultRetryTimeoutMS,signal:n.signal}))}))));const s="universalLink"in this.walletConnectionSource&&this.walletConnectionSource.universalLink?this.walletConnectionSource.universalLink:this.standardUniversalLink;return this.generateUniversalLink(s,e)}restoreConnection(e){var t,r;return y(this,void 0,void 0,(function*(){const n=z(null==e?void 0:e.signal);if(null===(t=this.abortController)||void 0===t||t.abort(),this.abortController=n,n.signal.aborted)return;this.closeGateways();const o=yield this.connectionStorage.getHttpConnection();if(!o)return;if(n.signal.aborted)return;const s=null!==(r=null==e?void 0:e.openingDeadlineMS)&&void 0!==r?r:this.defaultOpeningDeadlineMS;
708if($(o))return this.session={sessionCrypto:o.sessionCrypto,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},yield this.openGateways(o.sessionCrypto,{openingDeadlineMS:s,signal:null==n?void 0:n.signal});if(Array.isArray(this.walletConnectionSource))throw new b("Internal error. Connection source is array while WalletConnectionSourceHTTP was expected.");if(this.session=o.session,this.gateway&&(q("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new K(this.storage,this.walletConnectionSource.bridgeUrl,o.session.sessionCrypto.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),!n.signal.aborted){this.listeners.forEach((e=>e(o.connectEvent)));try{yield V((e=>this.gateway.registerSession({openingDeadlineMS:s,signal:e.signal})),{attempts:Number.MAX_SAFE_INTEGER,delayMs:this.defaultRetryTimeoutMS,signal:n.signal})}catch(e){return void(yield this.disconnect({signal:n.signal}))}}}))}sendRequest(e,t){const r={};return"function"==typeof t?r.onRequestSent=t:(r.onRequestSent=null==t?void 0:t.onRequestSent,r.signal=null==t?void 0:t.signal,r.attempts=null==t?void 0:t.attempts),new Promise(((t,n)=>y(this,void 0,void 0,(function*(){var o;if(!this.gateway||!this.session||!("walletPublicKey"in this.session))throw new b("Trying to send bridge request without session");const s=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),q("Send http-bridge request:",Object.assign(Object.assign({},e),{id:s}));const i=this.session.sessionCrypto.encrypt(JSON.stringify(Object.assign(Object.assign({},e),{id:s})),f(this.session.walletPublicKey));try{yield this.gateway.send(i,this.session.walletPublicKey,e.method,{attempts:null==r?void 0:r.attempts,signal:null==r?void 0:r.signal}),null===(o=null==r?void 0:r.onRequestSent)||void 0===o||o.call(r),this.pendingRequests.set(s.toString(),t)}catch(e){n(e)}}))))}closeConnection(){this.closeGateways(),this.listeners=[],this.session=null,this.gateway=null}disconnect(e){return y(this,void 0,void 0,(function*(){return new Promise((t=>y(this,void 0,void 0,(function*(){let r=!1,n=null;const o=()=>{r||(r=!0,this.removeBridgeAndSession().then(t))};try{this.closeGateways();const t=z(null==e?void 0:e.signal);n=setTimeout((()=>{t.abort()}),this.defaultOpeningDeadlineMS),yield this.sendRequest({method:"disconnect",params:[]},{onRequestSent:o,signal:t.signal,attempts:1})}catch(e){q("Disconnect error:",e),r||this.removeBridgeAndSession().then(t)}finally{n&&clearTimeout(n),o()}}))))}))}listen(e){return this.listeners.push(e),()=>this.listeners=this.listeners.filter((t=>t!==e))}pause(){var e;null===(e=this.gateway)||void 0===e||e.pause(),this.pendingGateways.forEach((e=>e.pause()))}unPause(){return y(this,void 0,void 0,(function*(){const e=this.pendingGateways.map((e=>e.unPause()));this.gateway&&e.push(this.gateway.unPause()),yield Promise.all(e)}))}pendingGatewaysListener(e,t,r){return y(this,void 0,void 0,(function*(){if(this.pendingGateways.includes(e))return this.closeGateways({except:e}),this.gateway&&(q("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.session.bridgeUrl=t,this.gateway=e,this.gateway.setErrorsListener(this.gatewayErrorsListener.bind(this)),this.gateway.setListener(this.gatewayListener.bind(this)),this.gatewayListener(r);yield e.close()}))}gatewayListener(e){return y(this,void 0,void 0,(function*(){const t=JSON.parse(this.session.sessionCrypto.decrypt(h.decode(e.message).toUint8Array(),f(e.from)));if(q("Wallet message received:",t),!("event"in t)){const e=t.id.toString(),r=this.pendingRequests.get(e);return r?(r(t),void this.pendingRequests.delete(e)):void q(`Response id ${e} doesn't match any request's id`)}if(void 0!==t.id){const e=yield this.connectionStorage.getLastWalletEventId();if(void 0!==e&&t.id<=e)return void H(`Received event id (=${t.id}) must be greater than stored last wallet event id (=${e}) `);"connect"!==t.event&&(yield this.connectionStorage.storeLastWalletEventId(t.id))}const r=this.listeners;"connect"===t.event&&(yield this.updateSession(t,e.from)),"disconnect"===t.event&&(q("Removing bridge and session: received disconnect event"),yield this.removeBridgeAndSession()),r.forEach((e=>e(t)))}))}gatewayErrorsListener(e){return y(this,void 0,void 0,(function*(){throw new b(`Bridge error ${JSON.stringify(e)}`)}))}updateSession(e,t){return y(this,void 0,void 0,(function*(){this.session=Object.assign(Object.assign({},this.session),{walletPublicKey:t});const r=e.payload.items.find((e=>"ton_addr"===e.name)),n=Object.assign(Object.assign({},e),{payload:Object.assign(Object.assign({},e.payload),{items:[r]})});yield this.connectionStorage.storeConnection({type:"http",session:this.session,lastWalletEventId:e.id,connectEvent:n,nextRpcRequestId:0})}))}removeBridgeAndSession(){return y(this,void 0,void 0,(function*(){this.closeConnection(),yield this.connectionStorage.removeConnection()}))}generateUniversalLink(e,t){return D(e)?this.generateTGUniversalLink(e,t):this.generateRegularUniversalLink(e,t)}
708generateRegularUniversalLink(e,t){const r=new URL(e);return r.searchParams.append("v",2..toString()),r.searchParams.append("id",this.session.sessionCrypto.sessionId),r.searchParams.append("r",JSON.stringify(t)),r.toString()}generateTGUniversalLink(e,t){const r="tonconnect-"+L(this.generateRegularUniversalLink("about:blank",t).split("?")[1]),n=this.convertToDirectLink(e),o=new URL(n);return o.searchParams.append("startapp",r),o.toString()}convertToDirectLink(e){const t=new URL(e);return t.searchParams.has("attach")&&(t.searchParams.delete("attach"),t.pathname+="/start"),t.toString()}openGateways(e,t){return y(this,void 0,void 0,(function*(){return Array.isArray(this.walletConnectionSource)?(this.pendingGateways.map((e=>e.close().catch())),this.pendingGateways=this.walletConnectionSource.map((t=>{const r=new K(this.storage,t.bridgeUrl,e.sessionId,(()=>{}),(()=>{}));return r.setListener((e=>this.pendingGatewaysListener(r,t.bridgeUrl,e))),r})),void(yield Promise.allSettled(this.pendingGateways.map((e=>V((r=>{var n;return this.pendingGateways.some((t=>t===e))?e.registerSession({openingDeadlineMS:null!==(n=null==t?void 0:t.openingDeadlineMS)&&void 0!==n?n:this.defaultOpeningDeadlineMS,signal:r.signal}):e.close()}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:this.defaultRetryTimeoutMS,signal:null==t?void 0:t.signal})))))):(this.gateway&&(q("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new K(this.storage,this.walletConnectionSource.bridgeUrl,e.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),yield this.gateway.registerSession({openingDeadlineMS:null==t?void 0:t.openingDeadlineMS,signal:null==t?void 0:t.signal}))}))}closeGateways(e){var t;null===(t=this.gateway)||void 0===t||t.close(),this.pendingGateways.filter((t=>t!==(null==e?void 0:e.except))).forEach((e=>e.close())),this.pendingGateways=[]}}function J(e,t){return Q(e,[t])}function Q(e,t){return!(!e||"object"!=typeof e)&&t.every((t=>t in e))}class Z{constructor(){this.storage={}}static getInstance(){return Z.instance||(Z.instance=new Z),Z.instance}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(e){var t;return null!==(t=this.storage[e])&&void 0!==t?t:null}key(e){var t;const r=Object.keys(this.storage);return e<0||e>=r.length?null:null!==(t=r[e])&&void 0!==t?t:null}removeItem(e){delete this.storage[e]}setItem(e,t){this.storage[e]=t}}function X(){if("undefined"!=typeof window)return window}function ee(){if("undefined"!=typeof document)return document}function te(){var e;const t=null===(e=X())||void 0===e?void 0:e.location.origin;return t?t+"/tonconnect-manifest.json":""}function re(){if(function(){try{return"undefined"!=typeof localStorage}catch(e){return!1}}())return localStorage;if(void 0!==m&&null!=m.versions&&null!=m.versions.node)throw new b("`localStorage` is unavailable, but it is required for TonConnect. For more details, see https://github.com/ton-connect/sdk/tree/main/packages/sdk#init-connector");return Z.getInstance()}class ne{constructor(e,t){this.injectedWalletKey=t,this.type="injected",this.unsubscribeCallback=null,this.listenSubscriptions=!1,this.listeners=[];const r=ne.window;if(!ne.isWindowContainsWallet(r,t))throw new _;this.connectionStorage=new G(e),this.injectedWallet=r[t].tonconnect}static fromStorage(e){return y(this,void 0,void 0,(function*(){const t=new G(e),r=yield t.getInjectedConnection();return new ne(e,r.jsBridgeKey)}))}static isWalletInjected(e){return ne.isWindowContainsWallet(this.window,e)}static isInsideWalletBrowser(e){return!!ne.isWindowContainsWallet(this.window,e)&&this.window[e].tonconnect.isWalletBrowser}static getCurrentlyInjectedWallets(){if(!this.window)return[];return function(){const e=X();if(!e)return[];try{return Object.keys(e)}catch(e){return[]}}().filter((([e,t])=>function(e){try{return!(!J(e,"tonconnect")||!J(e.tonconnect,"walletInfo"))&&Q(e.tonconnect.walletInfo,["name","app_name","image","about_url","platforms"])}catch(e){return!1}}(t))).map((([e,t])=>({name:t.tonconnect.walletInfo.name,appName:t.tonconnect.walletInfo.app_name,aboutUrl:t.tonconnect.walletInfo.about_url,imageUrl:t.tonconnect.walletInfo.image,tondns:t.tonconnect.walletInfo.tondns,jsBridgeKey:e,injected:!0,embedded:t.tonconnect.isWalletBrowser,platforms:t.tonconnect.walletInfo.platforms})))}static isWindowContainsWallet(e,t){return!!e&&t in e&&"object"==typeof e[t]&&"tonconnect"in e[t]}connect(e){this._connect(2,e)}restoreConnection(){return y(this,void 0,void 0,(function*(){try{q("Injected Provider restoring connection...");const e=yield this.injectedWallet.restoreConnection();q("Injected Provider restoring connection response",e),"connect"===e.event?(this.makeSubscriptions(),this.listeners.forEac
708h((t=>t(e)))):yield this.connectionStorage.removeConnection()}catch(e){yield this.connectionStorage.removeConnection(),console.error(e)}}))}closeConnection(){this.listenSubscriptions&&this.injectedWallet.disconnect(),this.closeAllListeners()}disconnect(){return y(this,void 0,void 0,(function*(){return new Promise((e=>{const t=()=>{this.closeAllListeners(),this.connectionStorage.removeConnection().then(e)};try{this.injectedWallet.disconnect(),t()}catch(e){q(e),this.sendRequest({method:"disconnect",params:[]},t)}}))}))}closeAllListeners(){var e;this.listenSubscriptions=!1,this.listeners=[],null===(e=this.unsubscribeCallback)||void 0===e||e.call(this)}listen(e){return this.listeners.push(e),()=>this.listeners=this.listeners.filter((t=>t!==e))}sendRequest(e,t){var r;return y(this,void 0,void 0,(function*(){const n={};"function"==typeof t?n.onRequestSent=t:(n.onRequestSent=null==t?void 0:t.onRequestSent,n.signal=null==t?void 0:t.signal);const o=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),q("Send injected-bridge request:",Object.assign(Object.assign({},e),{id:o}));const s=this.injectedWallet.send(Object.assign(Object.assign({},e),{id:o}));return s.then((e=>q("Wallet message received:",e))),null===(r=null==n?void 0:n.onRequestSent)||void 0===r||r.call(n),s}))}_connect(e,t){return y(this,void 0,void 0,(function*(){try{q(`Injected Provider connect request: protocolVersion: ${e}, message:`,t);const r=yield this.injectedWallet.connect(e,t);q("Injected Provider connect response:",r),"connect"===r.event&&(yield this.updateSession(),this.makeSubscriptions()),this.listeners.forEach((e=>e(r)))}catch(e){q("Injected Provider connect error:",e);const t={event:"connect_error",payload:{code:0,message:null==e?void 0:e.toString()}};this.listeners.forEach((e=>e(t)))}}))}makeSubscriptions(){this.listenSubscriptions=!0,this.unsubscribeCallback=this.injectedWallet.listen((e=>{q("Wallet message received:",e),this.listenSubscriptions&&this.listeners.forEach((t=>t(e))),"disconnect"===e.event&&this.disconnect()}))}updateSession(){return this.connectionStorage.storeConnection({type:"injected",jsBridgeKey:this.injectedWalletKey,nextRpcRequestId:0})}}ne.window=X();class oe{constructor(){this.localStorage=re()}getItem(e){return y(this,void 0,void 0,(function*(){return this.localStorage.getItem(e)}))}removeItem(e){return y(this,void 0,void 0,(function*(){this.localStorage.removeItem(e)}))}setItem(e,t){return y(this,void 0,void 0,(function*(){this.localStorage.setItem(e,t)}))}}function se(e){return function(e){return"jsBridgeKey"in e}(e)&&e.injected}function ie(e){return se(e)&&e.embedded}function ae(e){return"bridgeUrl"in e}const ce=[{app_name:"telegram-wallet",name:"Wallet",image:"https://wallet.tg/images/logo-288.png",about_url:"https://wallet.tg/",universal_url:"https://t.me/wallet?attach=wallet",bridge:[{type:"sse",url:"https://walletbot.me/tonconnect-bridge/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"tonkeeper",name:"Tonkeeper",image:"https://tonkeeper.com/assets/tonconnect-icon.png",tondns:"tonkeeper.ton",about_url:"https://tonkeeper.com",universal_url:"https://app.tonkeeper.com/ton-connect",deepLink:"tonkeeper-tc://",bridge:[{type:"sse",url:"https://bridge.tonapi.io/bridge"},{type:"js",key:"tonkeeper"}],platforms:["ios","android","chrome","firefox","macos"]},{app_name:"mytonwallet",name:"MyTonWallet",image:"https://static.mytonwallet.io/icon-256.png",about_url:"https://mytonwallet.io",universal_url:"https://connect.mytonwallet.org",bridge:[{type:"js",key:"mytonwallet"},{type:"sse",url:"https://tonconnectbridge.mytonwallet.org/bridge/"}],platforms:["chrome","windows","macos","linux","ios","android","firefox"]},{app_name:"tonhub",name:"Tonhub",image:"https://tonhub.com/tonconnect_logo.png",about_url:"https://tonhub.com",universal_url:"https://tonhub.com/ton-connect",bridge:[{type:"js",key:"tonhub"},{type:"sse",url:"https://connect.tonhubapi.com/tonconnect"}],platforms:["ios","android"]},{app_name:"bitgetTonWallet",name:"Bitget Wallet",image:"https://raw.githubusercontent.com/bitgetwallet/download/refs/heads/main/logo/png/bitget_wallet_logo_288_mini.png",about_url:"https://web3.bitget.com",deepLink:"bitkeep://",bridge:[{type:"js",key:"bitgetTonWallet"},{type:"sse",url:"https://ton-connect-bridge.bgwapi.io/bridge"}],platforms:["ios","android","chrome"],universal_url:"https://bkcode.vip/ton-connect"},{app_name:"okxMiniWallet",name:"OKX Mini Wallet",image:"https://static.okx.com/cdn/assets/imgs/2411/8BE1A4A434D8F58A.png",about_url:"https://www.okx.com/web3",universal_url:"https://t.me/OKX_WALLET_BOT?attach=wallet",bridge:[{type:"sse",url:"https://www.okx.com/tonbridge/discover/rpc/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"binanceWeb3TonWallet",name:"Binance Web3 Wallet",image:"https://public.bnbstatic.com/static/binance-w3w/ton-provider/binancew3w.png",about_url:"https://www.binance.com/en/web3wallet",deepLink:"bnc://app.binance.com/cedefi/ton-connect",bridge:[{type:"js",key:"binancew3w"}
708,{type:"sse",url:"https://wallet.binance.com/tonbridge/bridge"}],platforms:["ios","android","macos","windows","linux"],universal_url:"https://app.binance.com/cedefi/ton-connect"},{app_name:"fintopio-tg",name:"Fintopio",image:"https://fintopio.com/tonconnect-icon.png",about_url:"https://fintopio.com",universal_url:"https://t.me/fintopio?attach=wallet",bridge:[{type:"sse",url:"https://wallet-bridge.fintopio.com/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"okxTonWallet",name:"OKX Wallet",image:"https://static.okx.com/cdn/assets/imgs/247/58E63FEA47A2B7D7.png",about_url:"https://www.okx.com/web3",universal_url:"https://www.okx.com/download?appendQuery=true&deeplink=okx://web3/wallet/tonconnect",bridge:[{type:"js",key:"okxTonWallet"},{type:"sse",url:"https://www.okx.com/tonbridge/discover/rpc/bridge"}],platforms:["chrome","safari","firefox","ios","android"]},{app_name:"hot",name:"HOT",image:"https://raw.githubusercontent.com/hot-dao/media/main/logo.png",about_url:"https://hot-labs.org/",universal_url:"https://t.me/herewalletbot?attach=wallet",bridge:[{type:"sse",url:"https://sse-bridge.hot-labs.org"},{type:"js",key:"hotWallet"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"bybitTonWallet",name:"Bybit Wallet",image:"https://raw.githubusercontent.com/bybit-web3/bybit-web3.github.io/main/docs/images/bybit-logo.png",about_url:"https://www.bybit.com/web3",universal_url:"https://app.bybit.com/ton-connect",deepLink:"bybitapp://",bridge:[{type:"js",key:"bybitTonWallet"},{type:"sse",url:"https://api-node.bybit.com/spot/api/web3/bridge/ton/bridge"}],platforms:["ios","android","chrome"]},{app_name:"dewallet",name:"DeWallet",image:"https://raw.githubusercontent.com/delab-team/manifests-images/main/WalletAvatar.png",about_url:"https://delabwallet.com",universal_url:"https://t.me/dewallet?attach=wallet",bridge:[{type:"sse",url:"https://bridge.dewallet.pro/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"safepalwallet",name:"SafePal",image:"https://s.pvcliping.com/web/public_image/SafePal_x288.png",tondns:"",about_url:"https://www.safepal.com",universal_url:"https://link.safepal.io/ton-connect",deepLink:"safepal-tc://",bridge:[{type:"sse",url:"https://ton-bridge.safepal.com/tonbridge/v1/bridge"},{type:"js",key:"safepalwallet"}],platforms:["ios","android","chrome","firefox"]},{app_name:"GateWallet",name:"GateWallet",image:"https://img.gatedataimg.com/prd-ordinal-imgs/036f07bb8730716e/gateio-0925.png",about_url:"https://www.gate.io/",bridge:[{type:"js",key:"gatetonwallet"},{type:"sse",url:"https://dapp.gateio.services/tonbridge_api/bridge/v1"}],platforms:["ios","android"],universal_url:"https://gateio.go.link/gateio/web3?adj_t=1ff8khdw_1fu4ccc7"},{app_name:"openmask",name:"OpenMask",image:"https://raw.githubusercontent.com/OpenProduct/openmask-extension/main/public/openmask-logo-288.png",about_url:"https://www.openmask.app/",bridge:[{type:"js",key:"openmask"}],platforms:["chrome"]},{app_name:"BitgetWeb3",name:"BitgetWeb3",image:"https://img.bitgetimg.com/image/third/1731638059795.png",about_url:"âhttps://www.bitget.com",universal_url:"https://t.me/BitgetOfficialBot?attach=wallet",bridge:[{type:"sse",url:"https://ton-connect-bridge.bgwapi.io/bridge"}],platforms:["ios","android","windows","macos","linux"]},{app_name:"tobi",name:"Tobi",image:"https://app.tobiwallet.app/icons/logo-288.png",about_url:"https://tobi.fun",universal_url:"https://t.me/TobiCopilotBot?attach=wallet",bridge:[{type:"sse",url:"https://ton-bridge.tobiwallet.app/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"xtonwallet",name:"XTONWallet",image:"https://xtonwallet.com/assets/img/icon-256-back.png",about_url:"https://xtonwallet.com",bridge:[{type:"js",key:"xtonwallet"}],platforms:["chrome","firefox"]},{app_name:"tonwallet",name:"TON Wallet",image:"https://wallet.ton.org/assets/ui/qr-logo.png",about_url:"https://chrome.google.com/webstore/detail/ton-wallet/nphplpgoakhhjchkkhmiggakijnkhfnd",bridge:[{type:"js",key:"tonwallet"}],platforms:["chrome"]}];class le{constructor(e){this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null,this.walletsListSource="https://raw.githubusercontent.com/ton-blockchain/wallets-list/main/wallets-v2.json",(null==e?void 0:e.walletsListSource)&&(this.walletsListSource=e.walletsListSource),(null==e?void 0:e.cacheTTLMs)&&(this.cacheTTLMs=e.cacheTTLMs)}getWallets(){return y(this,void 0,void 0,(function*(){return this.cacheTTLMs&&this.walletsListCacheCreationTimestamp&&Date.now()>this.walletsListCacheCreationTimestamp+this.cacheTTLMs&&(this.walletsListCache=null),this.walletsListCache||(this.walletsListCache=this.fetchWalletsList(),this.walletsListCache.then((()=>{this.walletsListCacheCreationTimestamp=Date.now()})).catch((()=>{this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null}))),this.walletsListCache}))}getEmbeddedWallet(){return y(this,void 0,void 0,(function*(){const e=(yield this.getWallets()).filter(ie);return 1!==e.length?null:e[0]}))}fetchWalletsList(){return y(this,void 0,void 0,(function*(){let e=[];try{const t=yield fetch(this.walletsListSource);if(e=yield t.json(),!Array.isArray(e))throw new I("Wrong wallets list format, wallets list must be an array.");const r=e.filter((e=>!this.isCorrectWalletConfigDTO(e)));r.length&&(H(`Wallet(s) ${r.map((e=>e.name)).join(", ")} config format is wrong. They were removed from the wallets list.`),e=e.filter((e=>this.isCorrectWalletConfigDTO(e))))}catch(t){H(t),e=ce}let t=[];try{t=ne.getCurrentlyInjectedWallets()}catch(e){H(e)}return this.mergeWalletsLists(this.walletConfigDTOListToWalletConfigList(e),t)}))}walletConfigDTOListToWalletConfigList(e){return e.map((e=>{const t={name:e.name,appName:e.app_name,imageUrl:e.image,aboutUrl:e.about_url,tondns:e.tondns,platforms:e.platforms};return e.bridge.forEach((r=>{if("sse"===r.type&&(t.bridgeUrl=r.url,t.universalLink=e.universal_url,t.deepLink=e.deepLink),"js"===r.type){const e=r.key;t.jsBridgeKey=e,t.injected=ne.isWalletInjected(e),t.embedded=ne.isInsideWalletBrowser(e)}})),t}))}mergeWalletsLists(e,t){return[...new Set(e.concat(t).map((e=>e.name))).values()].map((r=>{const n=e.find((e=>e.name===r)),o=t.find((e=>e.name===r));return Object.assign(Object.assign({},n&&Object.assign({},n)),o&&Object.assign({},o))}))}isCorrectWalletConfigDTO(e){if(!e||"object"!=typeof e)return!1;if(!("name"in e&&"image"in e&&"about_url"in e&&"platforms"in e&&"app_name"in e))return!1;if(!e.platforms||!Array.isArray(e.platforms)||!e.platforms.length)return!1;if(!("bridge"in e)||!Array.isArray(e.bridge)||!e.bridge.length)return!1;const t=e.bridge;if(t.some((e=>!e||"object"!=typeof e||!("type"in e))))return!1;const r=t.find((e=>"sse"===e.type));if(r&&(!("url"in r)||!r.url||!e.universal_url))return!1;const n=t.find((e=>"js"===e.type));return!!(!n||"key"in n&&n.key)}}class ue extends b{get info(){return"Wallet doesn't support requested feature method."}constructor(...e){super(...e),Object.setPrototypeOf(this,ue.prototype)}}function de(e,t){const r=e.includes("SendTransaction"),n=e.find((e=>e&&"object"==typeof e&&"SendTransaction"===e.name));if(!r&&!n)throw new ue("Wallet doesn't support SendTransaction feature.");if(n&&void 0!==n.maxMessages){if(n.maxMessages<t.requiredMessagesNumber)throw new ue(`Wallet is not able to handle such SendTransaction request. Max support messages number is ${n.maxMessages}, but ${t.requiredMessagesNumber} is required.`)}else!function(...e){try{console.warn("[TON_CONNECT_SDK]",...e)}catch(e){}}("Connected wallet didn't provide information about max allowed messages in the SendTransaction request. Request may be rejected by the wallet.")}function he(e){return{type:"response-version",version:e}}function pe(e){return{ton_connect_sdk_lib:e.ton_connect_sdk_lib,ton_connect_ui_lib:e.ton_connect_ui_lib}}function fe(e,t){var r,n,o,s,i,a,c,l;const u=(null===(r=null==t?void 0:t.connectItems)||void 0===r?void 0:r.tonProof)&&"proof"in t.connectItems.tonProof?"ton_proof":"ton_addr";return{wallet_address:null!==(o=null===(n=null==t?void 0:t.account)||void 0===n?void 0:n.address)&&void 0!==o?o:null,wallet_type:null!==(s=null==t?void 0:t.device.appName)&&void 0!==s?s:null,wallet_version:null!==(i=null==t?void 0:t.device.appVersion)&&void 0!==i?i:null,auth_type:u,custom_data:Object.assign({chain_id:null!==(c=null===(a=null==t?void 0:t.account)||void 0===a?void 0:a.chain)&&void 0!==c?c:null,provider:null!==(l=null==t?void 0:t.provider)&&void 0!==l?l:null},pe(e))}}function ge(e){return{type:"connection-started",custom_data:pe(e)}}function me(e,t){return Object.assign({type:"connection-completed",is_success:!0},fe(e,t))}function ye(e,t,r){return{type:"connection-error",is_success:!1,error_message:t,error_code:null!=r?r:null,custom_data:pe(e)}}function be(e){return{type:"connection-restoring-started",custom_data:pe(e)}}function we(e,t){return Object.assign({type:"connection-restoring-completed",is_success:!0},fe(e,t))}function ve(e,t){return{type:"connection-restoring-error",is_success:!1,error_message:t,custom_data:pe(e)}}function Ae(e,t){var r,n,o,s;return{valid_until:null!==(r=String(t.validUntil))&&void 0!==r?r:null,from:null!==(s=null!==(n=t.from)&&void 0!==n?n:null===(o=null==e?void 0:e.account)||void 0===o?void 0:o.address)&&void 0!==s?s:null,messages:t.messages.map((e=>{var t,r;return{address:null!==(t=e.address)&&void 0!==t?t:null,amount:null!==(r=e.amount)&&void 0!==r?r:null}}))}}function Te(e,t,r){return Object.assign(Object.assign({type:"transaction-sent-for-signature"},fe(e,t)),Ae(t,r))}function Pe(e,t,r,n){return Object.assign(Object.assign({type:"transaction-signed",is_success:!0,signed_transaction:n.boc},fe(e,t)),Ae(t,r))}function Ee(e,t,r,n,o){return Object.assign(Object.assign({type:"transaction-signing-failed",is_success:!1,error_message:n,error_code:null!=o?o:null},fe(e,t)),Ae(t,r))}function Ce(e,t,r){return Object.assign({type:"disconnection",scope:r},fe(e,t))}class ke{constructor(){this.window=X()}dispatchEvent(e,t){var r;return y(this,void 0,void 0,(function*(){const n=new CustomEvent(e,{detail:t});null===(r=this.window)||void 0===r||r.dispatchEvent(n)}))}addEventListener(e,t,r){var n;return y(this,void 0,void 0,(function*(){return null===(n=this.window)||void 0===n||n.addEventListener(e,t,r),()=>{var r;return null===(r=this.window)||void 0===r?void 0:r.removeEventListener(e,t)}}))}}class _e{constructor(e){var t;this.eventPrefix="ton-connect-",this.tonConnectUiVersion=null,this.eventDispatcher=null!==(t=null==e?void 0:e.eventDispatcher)&&void 0!==t?t:new ke,this.tonConnectSdkVersion=e.tonConnectSdkVersion,this.init().catch()}get version(){return pe({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}init(){return y(this,void 0,void 0,(function*(){try{yield this.setRequestVersionHandler(),this.tonConnectUiVersion=yield this.requestTonConnectUiVersion()}catch(e){}}))}setRequestVersionHandler(){return y(this,void 0,void 0,(function*(){yield this.eventDispatcher.addEventListener("ton-connect-request-version",(()=>y(this,void 0,void 0,(function*(){yield this.eventDispatcher.dispatchEvent("ton-connect-response-version",he(this.tonConnectSdkVersion))}))))}
708))}requestTonConnectUiVersion(){return y(this,void 0,void 0,(function*(){return new Promise(((e,t)=>y(this,void 0,void 0,(function*(){try{yield this.eventDispatcher.addEventListener("ton-connect-ui-response-version",(t=>{e(t.detail.version)}),{once:!0}),yield this.eventDispatcher.dispatchEvent("ton-connect-ui-request-version",{type:"request-version"})}catch(e){t(e)}}))))}))}dispatchUserActionEvent(e){try{this.eventDispatcher.dispatchEvent(`${this.eventPrefix}${e.type}`,e).catch()}catch(e){}}trackConnectionStarted(...e){try{const t=ge(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackConnectionCompleted(...e){try{const t=me(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackConnectionError(...e){try{const t=ye(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackConnectionRestoringStarted(...e){try{const t=be(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackConnectionRestoringCompleted(...e){try{const t=we(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackConnectionRestoringError(...e){try{const t=ve(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackDisconnection(...e){try{const t=Ce(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackTransactionSentForSignature(...e){try{const t=Te(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackTransactionSigned(...e){try{const t=Pe(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackTransactionSigningFailed(...e){try{const t=Ee(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}}class Ie{constructor(e){if(this.walletsList=new le,this._wallet=null,this.provider=null,this.statusChangeSubscriptions=[],this.statusChangeErrorSubscriptions=[],this.dappSettings={manifestUrl:(null==e?void 0:e.manifestUrl)||te(),storage:(null==e?void 0:e.storage)||new oe},this.walletsList=new le({walletsListSource:null==e?void 0:e.walletsListSource,cacheTTLMs:null==e?void 0:e.walletsListCacheTTLMs}),this.tracker=new _e({eventDispatcher:null==e?void 0:e.eventDispatcher,tonConnectSdkVersion:"3.0.6"}),!this.dappSettings.manifestUrl)throw new w("Dapp tonconnect-manifest.json must be specified if window.location.origin is undefined. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest");this.bridgeConnectionStorage=new G(this.dappSettings.storage),(null==e?void 0:e.disableAutoPauseConnection)||this.addWindowFocusAndBlurSubscriptions()}static getWallets(){return this.walletsList.getWallets()}get connected(){return null!==this._wallet}get account(){var e;return(null===(e=this._wallet)||void 0===e?void 0:e.account)||null}get wallet(){return this._wallet}set wallet(e){this._wallet=e,this.statusChangeSubscriptions.forEach((e=>e(this._wallet)))}getWallets(){return this.walletsList.getWallets()}onStatusChange(e,t){return this.statusChangeSubscriptions.push(e),t&&this.statusChangeErrorSubscriptions.push(t),()=>{this.statusChangeSubscriptions=this.statusChangeSubscriptions.filter((t=>t!==e)),t&&(this.statusChangeErrorSubscriptions=this.statusChangeErrorSubscriptions.filter((e=>e!==t)))}}connect(e,t){var r,n;const o={};if("object"==typeof t&&"tonProof"in t&&(o.request=t),"object"==typeof t&&("openingDeadlineMS"in t||"signal"in t||"request"in t)&&(o.request=null==t?void 0:t.request,o.openingDeadlineMS=null==t?void 0:t.openingDeadlineMS,o.signal=null==t?void 0:t.signal),this.connected)throw new T;const s=z(null==o?void 0:o.signal);if(null===(r=this.abortController)||void 0===r||r.abort(),this.abortController=s,s.signal.aborted)throw new b("Connection was aborted");return null===(n=this.provider)||void 0===n||n.closeConnection(),this.provider=this.createProvider(e),s.signal.addEventListener("abort",(()=>{var e;null===(e=this.provider)||void 0===e||e.closeConnection(),this.provider=null})),this.tracker.trackConnectionStarted(),this.provider.connect(this.createConnectRequest(null==o?void 0:o.request),{openingDeadlineMS:null==o?void 0:o.openingDeadlineMS,signal:s.signal})}restoreConnection(e){var t,r;return y(this,void 0,void 0,(function*(){this.tracker.trackConnectionRestoringStarted();const n=z(null==e?void 0:e.signal);if(null===(t=this.abortController)||void 0===t||t.abort(),this.abortController=n,n.signal.aborted)return void this.tracker.trackConnectionRestoringError("Connection restoring was aborted");const[o,s]=yield Promise.all([this.bridgeConnectionStorage.storedConnectionType(),this.walletsList.getEmbeddedWallet()]);if(n.signal.aborted)return void this.tracker.trackConnectionRestoringError("Connection restoring was aborted");let i=null;try{switch(o){case"http":i=yield Y.fromStorage(this.dappSettings.storage);break;case"injected":i=yield ne.fromStorage(this.dappSettings.storage);break;default:if(!s)return;i=this.createProvider(s)}}catch(e){return this.tracker.trackConnectionRestoringError("Provider is not restored"),yield this.bridgeConnectionStorage.removeConnection(),null==i||i.closeConnection(),void(i=null)}if(n.signal.aborted)return null==i||i.closeConnection(),void this.tracker.trackConnectionRestoringError("Connection restoring was aborted");if(!i)return H("Provider is not restored"),void this.tracker.trackConnectionRestoringError("Provider is not restored");null===(r=this.provider)||void 0===r||r.closeConnection(),this.provider=i,i.listen(this.walletEventsListener.bind(this));const a=()=>{this.tracker.trackConnectionRestoringError("Connection restoring was aborted"),null==i||i.closeConnection(),i=null};n.signal.addEventListener("abort",a);const c=V((t=>y(this,void 0,void 0,(function*(){yield null==i?void 0:i.restoreConnection({openingDeadlineMS:null==e?void 0:e.openingDeadlineMS,signal:t.signal}),n.signal.removeEventListener("abort",a),this.connected?this.tracker.trackConnectionRestoringCompleted(this.wallet):this.tracker.trackConnectionRestoringError("Connection restoring failed")}))),{attempts:Number.MAX_SAFE_INTEGER,delayMs:2e3,signal:null==e?void 0:e.signal}),l=new Promise((e=>setTimeout((()=>e()),12e3)));return Promise.race([c,l])}))}sendTransaction(e,t){return y(this,void 0,void 0,(function*(){const r={};"function"==typeof t?r.onRequestSent=t:(r.onRequestSent=null==t?void 0:t.onRequestSent,r.signal=null==t?void 0:t.signal);const n=z(null==r?void 0:r.signal);if(n.signal.aborted)throw new b("Transaction sending was aborted");this.checkConnection(),de(this.wallet.device.features,{requiredMessagesNumber:e.messages.length}),this.tracker.trackTransactionSentForSignature(this.wallet,e);const{validUntil:o}=e,s=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["validUntil"]),i=e.from||this.account.address,a=e.network||this.account.chain,c=yield this.provider.sendRequest(R.convertToRpcRequest(Object.assign(Object.assign({},s),{valid_until:o,from:i,network:a})),{onRequestSent:r.onRequestSent,signal:n.signal});if(R.isError(c))return this.tracker.trackTransactionSigningFailed(this.wallet,e,c.error.message,c.error.code),R.parseAndThrowError(c);const l=R.convertFromRpcResponse(c);return this.tracker.trackTransactionSigned(this.wallet,e,l),l}))}disconnect(e){var t;return y(this,void 0,void 0,(function*(){if(!this.connected)throw new P;const r=z(null==e?void 0:e.signal),n=this.abortController;if(this.abortController=r,r.signal.aborted)throw new b("Disconnect was aborted");this.onWalletDisconnected("dapp"),yield null===(t=this.provider)||void 0===t?void 0:t.disconnect({signal:r.signal}),null==n||n.abort()}))}pauseConnection(){var e;"http"===(null===(e=this.provider)||void 0===e?void 0:e.type)&&this.provider.pause()}unPauseConnection(){var e;return"http"!==(null===(e=this.provider)||void 0===e?void 0:e.type)?Promise.resolve():this.provider.unPause()}addWindowFocusAndBlurSubscriptions(){const e=ee();if(e)try{e.addEventListener("visibilitychange",(()=>{e.hidden?this.pauseConnection():this.unPauseConnection().catch()}))}catch(e){H("Cannot subscribe to the document.visibilitychange: ",e)}}createProvider(e){let t;return t=!Array.isArray(e)&&"jsBridgeKey"in e?new ne(this.dappSettings.storage,e.
708jsBridgeKey):new Y(this.dappSettings.storage,e),t.listen(this.walletEventsListener.bind(this)),t}walletEventsListener(e){switch(e.event){case"connect":this.onWalletConnected(e.payload);break;case"connect_error":this.onWalletConnectError(e.payload);break;case"disconnect":this.onWalletDisconnected("wallet")}}onWalletConnected(e){const t=e.items.find((e=>"ton_addr"===e.name)),r=e.items.find((e=>"ton_proof"===e.name));if(!t)throw new b("ton_addr connection item was not found");const n={device:e.device,provider:this.provider.type,account:{address:t.address,chain:t.network,walletStateInit:t.walletStateInit,publicKey:t.publicKey}};r&&(n.connectItems={tonProof:r}),this.wallet=n,this.tracker.trackConnectionCompleted(n)}onWalletConnectError(e){const t=M.parseError(e);if(this.statusChangeErrorSubscriptions.forEach((e=>e(t))),q(t),this.tracker.trackConnectionError(e.message,e.code),t instanceof A||t instanceof v)throw H(t),t}onWalletDisconnected(e){this.tracker.trackDisconnection(this.wallet,e),this.wallet=null}checkConnection(){if(!this.connected)throw new P}createConnectRequest(e){const t=[{name:"ton_addr"}];return(null==e?void 0:e.tonProof)&&t.push({name:"ton_proof",payload:e.tonProof}),{manifestUrl:this.dappSettings.manifestUrl,items:t}}}Ie.walletsList=new le,Ie.isWalletInjected=e=>ne.isWalletInjected(e),Ie.isInsideWalletBrowser=e=>ne.isInsideWalletBrowser(e);function Se(e,t=!1){const{wc:r,hex:n}=function(e){if(!e.includes(":"))throw new S(`Wrong address ${e}. Address must include ":".`);const t=e.split(":");if(2!==t.length)throw new S(`Wrong address ${e}. Address must include ":" only once.`);const r=parseInt(t[0]);if(0!==r&&-1!==r)throw new S(`Wrong address ${e}. WC must be eq 0 or -1, but ${r} received.`);const n=t[1];if(64!==(null==n?void 0:n.length))throw new S(`Wrong address ${e}. Hex part must be 64bytes length, but ${null==n?void 0:n.length} received.`);return{wc:r,hex:Be(n)}}(e);let o=81;t&&(o|=128);const s=new Int8Array(34);s[0]=o,s[1]=r,s.set(n,2);const i=new Uint8Array(36);return i.set(s),i.set(function(e){const t=4129;let r=0;const n=new Uint8Array(e.length+2);n.set(e);for(let e of n){let n=128;for(;n>0;)r<<=1,e&n&&(r+=1),n>>=1,r>65535&&(r&=65535,r^=t)}return new Uint8Array([Math.floor(r/256),r%256])}(s),34),h.encode(i).replace(/\+/g,"-").replace(/\//g,"_")}const xe={};for(let e=0;e<=255;e++){let t=e.toString(16);t.length<2&&(t="0"+t),xe[t]=e}function Be(e){const t=(e=e.toLowerCase()).length;if(t%2!=0)throw new x("Hex string must have length a multiple of 2: "+e);const r=t/2,n=new Uint8Array(r);for(let t=0;t<r;t++){const r=2*t,o=e.substring(r,r+2);if(!xe.hasOwnProperty(o))throw new x("Invalid hex character: "+o);n[t]=xe[o]}return n}var Oe,Me,We,je,Re,Ne,Ue,De,Le=r("./node_modules/ua-parser-js/src/ua-parser.js"),Fe=r("./node_modules/deepmerge/dist/cjs.js"),ze=r("./node_modules/classnames/index.js"),Ve=r("./node_modules/process/browser.js"),qe=Object.defineProperty,He=Object.defineProperties,Ke=Object.getOwnPropertyDescriptors,$e=Object.getOwnPropertySymbols,Ge=Object.prototype.hasOwnProperty,Ye=Object.prototype.propertyIsEnumerable,Je=(e,t,r)=>t in e?qe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Qe=(e,t)=>{for(var r in t||(t={}))Ge.call(t,r)&&Je(e,r,t[r]);if($e)for(var r of $e(t))Ye.call(t,r)&&Je(e,r,t[r]);return e},Ze=(e,t)=>He(e,Ke(t)),Xe=(e,t,r)=>(Je(e,"symbol"!=typeof t?t+"":t,r),r),et=(e,t,r)=>new Promise(((n,o)=>{var s=e=>{try{a(r.next(e))}catch(e){o(e)}},i=e=>{try{a(r.throw(e))}catch(e){o(e)}},a=e=>e.done?n(e.value):Promise.resolve(e.value).then(s,i);a((r=r.apply(e,t)).next())}));const tt={};const rt=Symbol("solid-proxy"),nt=Symbol("solid-track"),ot={equals:(e,t)=>e===t};let st=jt;const it={owned:null,cleanups:null,context:null,owner:null},at={};var ct=null;let lt=null,ut=null,dt=null,ht=null,pt=0;function ft(e,t){const r=ut,n=ct,o=0===e.length,s=o?it:{owned:null,cleanups:null,context:null,owner:void 0===t?n:t},i=o?e:()=>e((()=>Tt((()=>Dt(s)))));ct=s,ut=null;try{return Wt(i,!0)}finally{ut=r,ct=n}}function gt(e,t){const r={value:e,observers:null,observerSlots:null,comparator:(t=t?Object.assign({},ot,t):ot).equals||void 0};return[St.bind(r),e=>("function"==typeof e&&(e=e(r.value)),xt(r,e))]}function mt(e,t,r){Bt(Ot(e,t,!0,1))}function yt(e,t,r){Bt(Ot(e,t,!1,1))}function bt(e,t,r){st=Rt;const n=Ot(e,t,!1,1);n.user=!0,ht?ht.push(n):Bt(n)}function wt(e,t,r){r=r?Object.assign({},ot,r):ot;const n=Ot(e,t,!0,0);return n.observers=null,n.observerSlots=null,n.comparator=r.equals||void 0,Bt(n),St.bind(n)}function vt(e,t,r){let n,o,s;2===arguments.length&&"object"==typeof t||1===arguments.length?(n=!0,o=e,s=t||{}):(n=e,o=t,s=r||{});let i=null,a=at,c=null,l=!1,u="initialValue"in s,d="function"==typeof n&&wt(n);const h=new Set,[p,f]=(s.storage||gt)(s.initialValue),[g,m]=gt(void 0),[y,b]=gt(void 0,{equals:!1}),[w,v]=gt(u?"ready":"unresolved");if(tt.context){let e;
708c=`${tt.context.id}${tt.context.count++}`,"initial"===s.ssrLoadFrom?a=s.initialValue:tt.load&&(e=tt.load(c))&&(a=e[0])}function A(e,t,r,n){return i===e&&(i=null,u=!0,e!==a&&t!==a||!s.onHydrated||queueMicrotask((()=>s.onHydrated(n,{value:t}))),a=at,function(e,t){Wt((()=>{void 0===t&&f((()=>e)),v(void 0!==t?"errored":"ready"),m(t);for(const e of h.keys())e.decrement();h.clear()}),!1)}(t,r)),t}function T(){const e=undefined,t=p(),r=g();if(void 0!==r&&!i)throw r;return ut&&!ut.user&&e&&mt((()=>{y(),i&&(e.resolved||h.has(e)||(e.increment(),h.add(e)))})),t}function P(e=!0){if(!1!==e&&l)return;l=!1;const t=d?d():n;if(null==t||!1===t)return void A(i,Tt(p));const r=a!==at?a:Tt((()=>o(t,{value:p(),refetching:e})));return"object"==typeof r&&r&&"then"in r?(i=r,l=!0,queueMicrotask((()=>l=!1)),Wt((()=>{v(u?"refreshing":"pending"),b()}),!1),r.then((e=>A(r,e,void 0,t)),(e=>A(r,void 0,Lt(e),t)))):(A(i,r,void 0,t),r)}return Object.defineProperties(T,{state:{get:()=>w()},error:{get:()=>g()},loading:{get(){const e=w();return"pending"===e||"refreshing"===e}},latest:{get(){if(!u)return T();const e=g();if(e&&!i)throw e;return p()}}}),d?mt((()=>P(!1))):P(!1),[T,{refetch:P,mutate:f}]}function At(e){return Wt(e,!1)}function Tt(e){if(null===ut)return e();const t=ut;ut=null;try{return e()}finally{ut=t}}function Pt(e){bt((()=>Tt(e)))}function Et(e){return null===ct||(null===ct.cleanups?ct.cleanups=[e]:ct.cleanups.push(e)),e}function Ct(){return ut}function kt(e,t){const r=Symbol("context");return{id:r,Provider:qt(r),defaultValue:e}}function _t(e){let t;return void 0!==(t=zt(ct,e.id))?t:e.defaultValue}function It(e){const t=wt(e),r=wt((()=>Vt(t())));return r.toArray=()=>{const e=r();return Array.isArray(e)?e:null!=e?[e]:[]},r}function St(){if(this.sources&&this.state)if(1===this.state)Bt(this);else{const e=dt;dt=null,Wt((()=>Nt(this)),!1),dt=e}if(ut){const e=this.observers?this.observers.length:0;ut.sources?(ut.sources.push(this),ut.sourceSlots.push(e)):(ut.sources=[this],ut.sourceSlots=[e]),this.observers?(this.observers.push(ut),this.observerSlots.push(ut.sources.length-1)):(this.observers=[ut],this.observerSlots=[ut.sources.length-1])}return this.value}function xt(e,t,r){let n=e.value;return e.comparator&&e.comparator(n,t)||(e.value=t,e.observers&&e.observers.length&&Wt((()=>{for(let t=0;t<e.observers.length;t+=1){const r=e.observers[t],n=lt;n&<.disposed.has(r),(n&&!r.tState||!n&&!r.state)&&(r.pure?dt.push(r):ht.push(r),r.observers&&Ut(r)),n||(r.state=1)}if(dt.length>1e6)throw dt=[],new Error}),!1)),t}function Bt(e){if(!e.fn)return;Dt(e);const t=ct,r=ut,n=pt;ut=ct=e,function(e,t,r){let n;try{n=e.fn(t)}catch(t){e.pure&&(e.state=1,e.owned&&e.owned.forEach(Dt),e.owned=null),Ft(t)}(!e.updatedAt||e.updatedAt<=r)&&(null!=e.updatedAt&&"observers"in e?xt(e,n):e.value=n,e.updatedAt=r)}(e,e.value,n),ut=r,ct=t}function Ot(e,t,r,n=1,o){const s={fn:e,state:n,updatedAt:null,owned:null,sources:null,
708sourceSlots:null,cleanups:null,value:t,owner:ct,context:null,pure:r};return null===ct||ct!==it&&(ct.owned?ct.owned.push(s):ct.owned=[s]),s}function Mt(e){if(0===e.state)return;if(2===e.state)return Nt(e);if(e.suspense&&Tt(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<pt);)e.state&&t.push(e);for(let r=t.length-1;r>=0;r--)if(1===(e=t[r]).state)Bt(e);else if(2===e.state){const r=dt;dt=null,Wt((()=>Nt(e,t[0])),!1),dt=r}}function Wt(e,t){if(dt)return e();let r=!1;t||(dt=[]),ht?r=!0:ht=[],pt++;try{const t=e();return function(e){dt&&(jt(dt),dt=null);if(e)return;const t=ht;ht=null,t.length&&Wt((()=>st(t)),!1)}(r),t}catch(e){r||(ht=null),dt=null,Ft(e)}}function jt(e){for(let t=0;t<e.length;t++)Mt(e[t])}function Rt(e){let t,r=0;for(t=0;t<e.length;t++){const n=e[t];n.user?e[r++]=n:Mt(n)}var n;for(tt.context&&(tt.context=n),t=0;t<r;t++)Mt(e[t])}function Nt(e,t){e.state=0;for(let r=0;r<e.sources.length;r+=1){const n=e.sources[r];n.sources&&(1===n.state?n!==t&&Mt(n):2===n.state&&Nt(n,t))}}function Ut(e){for(let t=0;t<e.observers.length;t+=1){const r=e.observers[t];r.state||(r.state=2,r.pure?dt.push(r):ht.push(r),r.observers&&Ut(r))}}function Dt(e){let t;if(e.sources)for(;e.sources.length;){const t=e.sources.pop(),r=e.sourceSlots.pop(),n=t.observers;if(n&&n.length){const e=n.pop(),o=t.observerSlots.pop();r<n.length&&(e.sourceSlots[o]=r,n[r]=e,t.observerSlots[r]=o)}}if(e.owned){for(t=0;t<e.owned.length;t++)Dt(e.owned[t]);e.owned=null}if(e.cleanups){for(t=0;t<e.cleanups.length;t++)e.cleanups[t]();e.cleanups=null}e.state=0,e.context=null}function Lt(e){return e instanceof Error||"string"==typeof e?e:new Error("Unknown error")}function Ft(e){throw e=Lt(e)}function zt(e,t){return e?e.context&&void 0!==e.context[t]?e.context[t]:zt(e.owner,t):void 0}function Vt(e){if("function"==typeof e&&!e.length)return Vt(e());if(Array.isArray(e)){const t=[];for(let r=0;r<e.length;r++){const n=Vt(e[r]);Array.isArray(n)?t.push.apply(t,n):t.push(n)}return t}return e}function qt(e,t){return function(t){let r;return yt((()=>r=Tt((()=>(ct.context={[e]:t.value},It((()=>t.children)))))),void 0),r}}const Ht=Symbol("fallback");function Kt(e){for(let t=0;t<e.length;t++)e[t]()}function $t(e,t){return Tt((()=>e(t||{})))}function Gt(){return!0}const Yt={get:(e,t,r)=>t===rt?r:e.get(t),has:(e,t)=>t===rt||e.has(t),set:Gt,deleteProperty:Gt,getOwnPropertyDescriptor:(e,t)=>({configurable:!0,enumerable:!0,get:()=>e.get(t),set:Gt,deleteProperty:Gt}),ownKeys:e=>e.keys()};function Jt(e){return(e="function"==typeof e?e():e)?e:{}}function Qt(...e){let t=!1;for(let r=0;r<e.length;r++){const n=e[r];t=t||!!n&&rt in n,e[r]="function"==typeof n?(t=!0,wt(n)):n}if(t)return new Proxy({get(t){for(let r=e.length-1;r>=0;r--){const n=Jt(e[r])[t];if(void 0!==n)return n}},has(t){for(let r=e.length-1;r>=0;r--)if(t in Jt(e[r]))return!0;return!1},keys(){const t=[];for(let r=0;r<e.length;r++)t.push(...Object.keys(Jt(e[r])));return[...new Set(t)]}},Yt);const r={};for(let t=e.length-1;t>=0;t--)if(e[t]){const n=Object.getOwnPropertyDescriptors(e[t]);for(const t in n)t in r||Object.defineProperty(r,t,{enumerable:!0,get(){for(let r=e.length-1;r>=0;r--){const n=(e[r]||{})[t];if(void 0!==n)return n}}})}return r}function Zt(e,...t){const r=new Set(t.flat());if(rt in e){const n=t.map((t=>new Proxy({get:r=>t.includes(r)?e[r]:void 0,has:r=>t.includes(r)&&r in e,keys:()=>t.filter((t=>t in e))},Yt)));return n.push(new Proxy({get:t=>r.has(t)?void 0:e[t],has:t=>!r.has(t)&&t in e,keys:()=>Object.keys(e).filter((e=>!r.has(e)))},Yt)),n}const n=Object.getOwnPropertyDescriptors(e);return t.push(Object.keys(n).filter((e=>!r.has(e)))),t.map((t=>{const r={};for(let o=0;o<t.length;o++){const s=t[o];s in e&&Object.defineProperty(r,s,n[s]?n[s]:{get:()=>e[s],set:()=>!0,enumerable:!0})}return r}))}function Xt(e){const t="fallback"in e&&{fallback:()=>e.fallback};return wt(function(e,t,r={}){let n=[],o=[],s=[],i=0,a=t.length>1?[]:null;return Et((()=>Kt(s))),()=>{let c,l,u=e()||[];return u[nt],Tt((()=>{let e,t,h,p,f,g,m,y,b,w=u.length;if(0===w)0!==i&&(Kt(s),s=[],n=[],o=[],i=0,a&&(a=[])),r.fallback&&(n=[Ht],o[0]=ft((e=>(s[0]=e,r.fallback()))),i=1);else if(0===i){for(o=new Array(w),l=0;l<w;l++)n[l]=u[l],o[l]=ft(d);i=w}else{for(h=new Array(w),p=new Array(w),a&&(f=new Array(w)),g=0,m=Math.min(i,w);g<m&&n[g]===u[g];g++);for(m=i-1,y=w-1;m>=g&&y>=g&&n[m]===u[y];m--,y--)h[y]=o[m],p[y]=s[m],a&&(f[y]=a[m]);for(e=new Map,t=new Array(y+1),l=y;l>=g;l--)b=u[l],c=e.get(b),t[l]=void 0===c?-1:c,e.set(b,l);for(c=g;c<=m;
708c++)b=n[c],l=e.get(b),void 0!==l&&-1!==l?(h[l]=o[c],p[l]=s[c],a&&(f[l]=a[c]),l=t[l],e.set(b,l)):s[c]();for(l=g;l<w;l++)l in h?(o[l]=h[l],s[l]=p[l],a&&(a[l]=f[l],a[l](l))):o[l]=ft(d);o=o.slice(0,i=w),n=u.slice(0)}return o}));function d(e){if(s[l]=e,a){const[e,r]=gt(l);return a[l]=r,t(u[l],e)}return t(u[l])}}}((()=>e.each),e.children,t||void 0))}function er(e){let t=!1;const r=e.keyed,n=wt((()=>e.when),void 0,{equals:(e,r)=>t?e===r:!e==!r});return wt((()=>{const o=n();if(o){const n=e.children,s="function"==typeof n&&n.length>0;return t=r||s,s?Tt((()=>n(o))):n}return e.fallback}),void 0,void 0)}function tr(e){let t=!1,r=!1;const n=It((()=>e.children)),o=wt((()=>{let e=n();Array.isArray(e)||(e=[e]);for(let t=0;t<e.length;t++){const n=e[t].when;if(n)return r=!!e[t].keyed,[t,n,e[t]]}return[-1]}),void 0,{equals:(e,r)=>e[0]===r[0]&&(t?e[1]===r[1]:!e[1]==!r[1])&&e[2]===r[2]});return wt((()=>{const[n,s,i]=o();if(n<0)return e.fallback;const a=i.children,c="function"==typeof a&&a.length>0;return t=r||c,c?Tt((()=>a(s))):a}),void 0,void 0)}function rr(e){return e}const nr=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline","allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"]),or=new Set(["innerHTML","textContent","innerText","children"]),sr=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),ir=Object.assign(Object.create(null),{class:"className",formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly"}),ar=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),cr=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),lr={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};const ur="_$DX_DELEGATE";function dr(e,t,r){if("undefined"==typeof window)return null;const n=document.createElement("template");n.innerHTML=e;let o=n.content.firstChild;return r&&(o=o.firstChild),o}function hr(e,t,r){null==r?e.removeAttribute(t):e.setAttribute(t,r)}function pr(e,t){null==t?e.removeAttribute("class"):e.className=t}function fr(e,t={},r,n){const o={};return n||yt((()=>o.children=Ar(e,t.children,o.children))),yt((()=>t.ref&&t.ref(e))),yt((()=>function(e,t,r,n,o={},s=!1){t||(t={});for(const n in o)if(!(n in t)){if("children"===n)continue;o[n]=wr(e,n,null,o[n],r,s)}for(const i in t){if("children"===i){n||Ar(e,t.children);continue}const a=t[i];o[i]=wr(e,i,a,o[i],r,s)}}(e,t,r,!0,o,!0))),o}function gr(e,t,r){return Tt((()=>e(t,r)))}function mr(e,t,r,n){if(void 0===r||n||(n=[]),"function"!=typeof t)return Ar(e,t,n,r);yt((n=>Ar(e,t(),n,r)),n)}function yr(e){let t,r;return tt.context&&(t=tt.registry.get(r=function(){const e=tt.context;return`${e.id}${e.count++}`}()))?(tt.completed&&tt.completed.add(t),tt.registry.delete(r),t):e.cloneNode(!0)}function br(e,t,r){const n=t.trim().split(/\s+/);for(let t=0,o=n.length;t<o;t++)e.classList.toggle(n[t],r)}function wr(e,t,r,n,o,s){let i,a,c;if("style"===t)return function(e,t,r){if(!t)return r?hr(e,"style"):t;const n=e.style;if("string"==typeof t)return n.cssText=t;let o,s;for(s in"string"==typeof r&&(n.cssText=r=void 0),r||(r={}),t||(t={}),r)null==t[s]&&n.removeProperty(s),delete r[s];for(s in t)o=t[s],o!==r[s]&&(n.setProperty(s,o),r[s]=o);return r}(e,r,n);if("classList"===t)return function(e,t,r={}){const n=Object.keys(t||{}),o=Object.keys(r);let s,i;for(s=0,i=o.length;s<i;s++){const n=o[s];n&&"undefined"!==n&&!t[n]&&(br(e,n,!1),delete r[n])}for(s=0,i=n.length;s<i;s++){const o=n[s],i=!!t[o];o&&"undefined"!==o&&r[o]!==i&&i&&(br(e,o,!0),r[o]=i)}return r}(e,r,n);if(r===n)return n;if("ref"===t)s||r(e);else if("on:"===t.slice(0,3)){const o=t.slice(3);n&&e.removeEventListener(o,n),r&&e.addEventListener(o,r)}else if("oncapture:"===t.slice(0,10)){const o=t.slice(10);n&&e.removeEventListener(o,n,!0),r&&e.addEventListener(o,r,!0)}else if("on"===t.slice(0,2)){const o=t.slice(2).toLowerCase(),s=ar.has(o);if(!s&&n){const t=Array.isArray(n)?n[0]:n;e.removeEventListener(o,t)}(s||r)&&(function(e,t,r,n){if(n)Array.isArray(r)?(e[`$$${t}`]=r[0],e[`$$${t}Data`]=r[1]):e[`$$${t}`]=r;else if(Array.isArray(r)){const n=r[0];e.addEventListener(t,r[0]=t=>n.call(e,r[1],t))}else e.addEventListener(t,r)}(e,o,r,s),s&&function(e,t=window.document){const r=t[ur]||(t[ur]=new Set);for(let n=0,o=e.length;n<o;n++){const o=e[n];
708r.has(o)||(r.add(o),t.addEventListener(o,vr))}}([o]))}else if((c=or.has(t))||!o&&(ir[t]||(a=nr.has(t)))||(i=e.nodeName.includes("-")))"class"===t||"className"===t?pr(e,r):!i||a||c?e[ir[t]||t]=r:e[(l=t,l.toLowerCase().replace(/-([a-z])/g,((e,t)=>t.toUpperCase())))]=r;else{const n=o&&t.indexOf(":")>-1&&lr[t.split(":")[0]];n?function(e,t,r,n){null==n?e.removeAttributeNS(t,r):e.setAttributeNS(t,r,n)}(e,n,t,r):hr(e,sr[t]||t,r)}var l;return r}function vr(e){const t=`$$${e.type}`;let r=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==r&&Object.defineProperty(e,"target",{configurable:!0,value:r}),Object.defineProperty(e,"currentTarget",{configurable:!0,get:()=>r||document}),tt.registry&&!tt.done&&(tt.done=!0,document.querySelectorAll("[id^=pl-]").forEach((t=>{for(;t&&8!==t.nodeType&&t.nodeValue!=="pl-"+e;){let e=t.nextSibling;t.remove(),t=e}t&&t.remove()})));r;){const n=r[t];if(n&&!r.disabled){const o=r[`${t}Data`];if(void 0!==o?n.call(r,o,e):n.call(r,e),e.cancelBubble)return}r=r._$host||r.parentNode||r.host}}function Ar(e,t,r,n,o){for(tt.context&&!r&&(r=[...e.childNodes]);"function"==typeof r;)r=r();if(t===r)return r;const s=typeof t,i=void 0!==n;if(e=i&&r[0]&&r[0].parentNode||e,"string"===s||"number"===s){if(tt.context)return r;if("number"===s&&(t=t.toString()),i){let o=r[0];o&&3===o.nodeType?o.data=t:o=document.createTextNode(t),r=Er(e,r,n,o)}else r=""!==r&&"string"==typeof r?e.firstChild.data=t:e.textContent=t}else if(null==t||"boolean"===s){if(tt.context)return r;r=Er(e,r,n)}else{if("function"===s)return yt((()=>{let o=t();for(;"function"==typeof o;)o=o();r=Ar(e,o,r,n)})),()=>r;if(Array.isArray(t)){const s=[],a=r&&Array.isArray(r);if(Tr(s,t,r,o))return yt((()=>r=Ar(e,s,r,n,!0))),()=>r;if(tt.context){if(!s.length)return r;for(let e=0;e<s.length;e++)if(s[e].parentNode)return r=s}if(0===s.length){if(r=Er(e,r,n),i)return r}else a?0===r.length?Pr(e,s,n):function(e,t,r){let n=r.length,o=t.length,s=n,i=0,a=0,c=t[o-1].nextSibling,l=null;for(;i<o||a<s;)if(t[i]!==r[a]){for(;t[o-1]===r[s-1];)o--,s--;if(o===i){const t=s<n?a?r[a-1].nextSibling:r[s-a]:c;for(;a<s;)e.insertBefore(r[a++],t)}else if(s===a)for(;i<o;)l&&l.has(t[i])||t[i].remove(),i++;else if(t[i]===r[s-1]&&r[a]===t[o-1]){const n=t[--o].nextSibling;e.insertBefore(r[a++],t[i++].nextSibling),e.insertBefore(r[--s],n),t[o]=r[s]}else{if(!l){l=new Map;let e=a;for(;e<s;)l.set(r[e],e++)}const n=l.get(t[i]);if(null!=n)if(a<n&&n<s){let c,u=i,d=1;for(;++u<o&&u<s&&null!=(c=l.get(t[u]))&&c===n+d;)d++;if(d>n-a){const o=t[i];for(;a<n;)e.insertBefore(r[a++],o)}else e.replaceChild(r[a++],t[i++])}else i++;else t[i++].remove()}}else i++,a++}(e,r,s):(r&&Er(e),Pr(e,s));r=s}else if(t instanceof Node){if(tt.context&&t.parentNode)return r=i?[t]:t;if(Array.isArray(r)){if(i)return r=Er(e,r,n,t);Er(e,r,null,t)}else null!=r&&""!==r&&e.firstChild?e.replaceChild(t,e.firstChild):e.appendChild(t);r=t}}return r}function Tr(e,t,r,n){let o=!1;for(let s=0,i=t.length;s<i;s++){let i=t[s],a=r&&r[s];if(i instanceof Node)e.push(i);else if(null==i||!0===i||!1===i);else if(Array.isArray(i))o=Tr(e,i,a)||o;else if("function"==typeof i)if(n){for(;"function"==typeof i;)i=i();o=Tr(e,Array.isArray(i)?i:[i],Array.isArray(a)?a:[a])||o}else e.push(i),o=!0;else{const t=String(i);a&&3===a.nodeType&&a.data===t?e.push(a):e.push(document.createTextNode(t))}}return o}function Pr(e,t,r=null){for(let n=0,o=t.length;n<o;n++)e.insertBefore(t[n],r)}function Er(e,t,r,n){if(void 0===r)return e.textContent="";const o=n||document.createTextNode("");if(t.length){let n=!1;for(let s=t.length-1;s>=0;s--){const i=t[s];if(o!==i){const t=i.parentNode===e;n||s?t&&i.remove():t?e.replaceChild(o,i):e.insertBefore(o,r)}else n=!0}}else e.insertBefore(o,r);return[o]}function Cr(e,t=!1){return t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}function kr(e){const{useShadow:t}=e,r=document.createTextNode(""),n=e.mount||document.body;function o(){if(tt.context){const[t,r]=gt(!1);return queueMicrotask((()=>r(!0))),()=>t()&&e.children}return()=>e.children}if(n instanceof HTMLHeadElement){const[e,t]=gt(!1),r=()=>t(!0);ft((t=>mr(n,(()=>e()?t():o()()),null))),Et((()=>{tt.context?queueMicrotask(r):r()}))}else{const s=Cr(e.isSVG?"g":"div",e.isSVG),i=t&&s.attachShadow?s.attachShadow({mode:"open"}):s;Object.defineProperty(s,"_$host",{get:()=>r.parentNode,configurable:!0}),mr(i,o()),n.appendChild(s),e.ref&&e.ref(s),Et((()=>n.removeChild(s)))}return r}function _r(e){const[t,r]=Zt(e,["component"]),n=wt((()=>t.component));return wt((()=>{const e=n();switch(typeof e){case"function":return Tt((()=>e(r)));case"string":const t=cr.has(e),n=tt.context?yr():Cr(e,t);return fr(n,r,t),n}}))}var Ir=(e=>(e.DARK="DARK",e.LIGHT="LIGHT",e))(Ir||{});let Sr={data:""},xr=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Br=/\/\*[^]*?\*\/| +/g,Or=/\n+/g,Mr=(e,t)=>
708{let r="",n="",o="";for(let s in e){let i=e[s];"@"==s[0]?"i"==s[1]?r=s+" "+i+";":n+="f"==s[1]?Mr(i,s):s+"{"+Mr(i,"k"==s[1]?"":t)+"}":"object"==typeof i?n+=Mr(i,t?t.replace(/([^,])+/g,(e=>s.replace(/(^:.*)|([^,])+/g,(t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)))):s):null!=i&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Mr.p?Mr.p(s,i):s+":"+i+";")}return r+(t&&o?t+"{"+o+"}":o)+n},Wr={},jr=e=>{if("object"==typeof e){let t="";for(let r in e)t+=r+jr(e[r]);return t}return e};function Rr(e){let t=this||{},r=e.call?e(t.p):e;return((e,t,r,n,o)=>{let s=jr(e),i=Wr[s]||(Wr[s]=(e=>{let t=0,r=11;for(;t<e.length;)r=101*r+e.charCodeAt(t++)>>>0;return"go"+r})(s));if(!Wr[i]){let t=s!==e?e:(e=>{let t,r,n=[{}];for(;t=xr.exec(e.replace(Br,""));)t[4]?n.shift():t[3]?(r=t[3].replace(Or," ").trim(),n.unshift(n[0][r]=n[0][r]||{})):n[0][t[1]]=t[2].replace(Or," ").trim();return n[0]})(e);Wr[i]=Mr(o?{["@keyframes "+i]:t}:t,r?"":"."+i)}let a=r&&Wr.g?Wr.g:null;return r&&(Wr.g=Wr[i]),c=Wr[i],l=t,u=n,(d=a)?l.data=l.data.replace(d,c):-1===l.data.indexOf(c)&&(l.data=u?c+l.data:l.data+c),i;var c,l,u,d})(r.unshift?r.raw?((e,t,r)=>e.reduce(((e,n,o)=>{let s=t[o];if(s&&s.call){let e=s(r),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;s=t?"."+t:e&&"object"==typeof e?e.props?"":Mr(e,""):!1===e?"":e}return e+n+(s??"")}),""))(r,[].slice.call(arguments,1),t.p):r.reduce(((e,r)=>Object.assign(e,r&&r.call?r(t.p):r)),{}):r,(n=t.target,"object"==typeof window?((n?n.querySelector("#_goober"):window._goober)||Object.assign((n||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:n||Sr),t.g,t.o,t.k);var n}Rr.bind({g:1});let Nr=Rr.bind({k:1});const Ur=kt();function Dr(e){return $t(Ur.Provider,{value:e.theme,get children(){return e.children}})}function Lr(){return _t(Ur)}function Fr(e){let t=this||{};return(...r)=>{const n=n=>{const o=Qt(n,{theme:_t(Ur)}),s=Qt(o,{get class(){const e=o.class,n="class"in o&&/^go[0-9]+/.test(e);return[e,Rr.apply({target:t.target,o:n,p:o,g:t.g},r)].filter(Boolean).join(" ")}}),[i,a]=Zt(s,["as","theme"]),c=a,l=i.as||e;let u;return"function"==typeof l?u=l(c):1==t.g?(u=document.createElement(l),fr(u,c)):u=_r(Qt({component:l},c)),u};return n.class=e=>Tt((()=>Rr.apply({target:t.target,p:e,g:t.g},r))),n}}const zr=new Proxy(Fr,{get:(e,t)=>e(t)});function Vr(){const e=Fr.call({g:1},"div").apply(null,arguments);return function(t){return e(t),null}}const qr="tc-root",Hr="tc-disable-scroll",Kr="tc-using-mouse",$r=()=>{document.body.addEventListener("mousedown",(()=>document.body.classList.add(Kr))),document.body.addEventListener("keydown",(e=>{"Tab"===e.key&&document.body.classList.remove(Kr)}));return $t(Vr` 709 ${qr} * { 710 margin: 0; 711 padding: 0; 712 box-sizing: border-box; 713 714 font-family: -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, Tahoma, Verdana, sans-serif; 715 -webkit-font-smoothing: antialiased; 716 -moz-osx-font-smoothing: grayscale; 717 -webkit-tap-highlight-color: transparent; 718 } 719 720 ${qr} img { 721 -webkit-user-select: none; 722 -webkit-touch-callout: none; 723 } 724 725 ${qr} *:focus { 726 outline: #08f auto 2px; 727 } 728 729 ${qr} li { 730 list-style: none; 731 } 732 733 ${qr} button { 734 outline: none; 735 } 736 737 body.${Hr} { 738 position: fixed; 739 overflow-y: scroll; 740 right: 0; 741 left: 0; 742 } 743 744 body.${Kr} ${qr} *:focus { 745 outline: none; 746 } 747`,{})};function Gr(e,t){return"#"===e[0]&&(e=function(e){"#"===e[0]&&(e=e.slice(1));const t=parseInt(e,16);return[t>>16&255,t>>8&255,255&t].join(",")}(e)),`rgba(${e}, ${t})`}function Yr(e){return e.toString()+"px"}const Jr=class{constructor(){Xe(this,"storage",{})}static getInstance(){return Jr.instance||(Jr.instance=new Jr),Jr.instance}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(e){var t;return null!=(t=this.storage[e])?t:null}key(e){var t;const r=Object.keys(this.storage);return e<0||e>=r.length?null:null!=(t=r[e])?t:null}removeItem(e){delete this.storage[e]}setItem(e,t){this.storage[e]=t}};let Qr=Jr;Xe(Qr,"instance");class Zr extends b{constructor(...e){super(...e),Object.setPrototypeOf(this,Zr.prototype)}}function Xr(...e){try{console.debug("[TON_CONNECT_UI]",...e)}catch(e){}}function en(e,t="_self"){Xr("openLink",e,t),window.open(e,t,"noopener noreferrer")}function tn(e){en(e,"_blank")}function rn(e,t){const r=setTimeout((()=>{un("safari")||ln("android")&&un("firefox")||t()}),200);window.addEventListener("blur",(()=>clearTimeout(r)),{once:!0}),en(e,"_self")}function nn(e){return et(this,null,(function*(){yield new Promise((e=>requestAnimationFrame(e))),e()}))}function on(e){"complete"!==document.readyState?window.addEventListener("load",(()=>nn((()=>on(e)))),{once:!0}):e.forEach((e=>{(new window.Image).src=e}))}function sn(){if("undefined"!=typeof window)return window}
747function an(){if(function(){try{return"undefined"!=typeof localStorage}catch(e){return!1}}())return localStorage;if(void 0!==Ve&&null!=Ve.versions&&null!=Ve.versions.node)throw new Zr("`localStorage` is unavailable, but it is required for TonConnect. For more details, see https://github.com/ton-connect/sdk/tree/main/packages/sdk#init-connector");return Qr.getInstance()}function cn(){var e,t,r;const n=(new Le).getResult(),o=null==(e=n.os.name)?void 0:e.toLowerCase();let s;switch(!0){case"ipad"===(null==(t=n.device.model)?void 0:t.toLowerCase()):s="ipad";break;case"ios"===o:s="ios";break;case"android"===o:s="android";break;case"mac os"===o:s="macos";break;case"linux"===o:s="linux";break;case null==o?void 0:o.includes("windows"):s="windows"}const i=null==(r=n.browser.name)?void 0:r.toLowerCase();let a;switch(!0){case"chrome"===i:a="chrome";break;case"firefox"===i:a="firefox";break;case null==i?void 0:i.includes("safari"):a="safari";break;case null==i?void 0:i.includes("opera"):a="opera"}return{os:s,browser:a}}function ln(...e){return e.includes(cn().os)}function un(...e){return e.includes(cn().browser)}function dn(e,t){return t+new URL(e).search}class hn{constructor(){Xe(this,"localStorage"),Xe(this,"storageKey","ton-connect-ui_wallet-info"),this.localStorage=an()}setWalletInfo(e){this.localStorage.setItem(this.storageKey,JSON.stringify(e))}getWalletInfo(){const e=this.localStorage.getItem(this.storageKey);return e?JSON.parse(e):null}removeWalletInfo(){this.localStorage.removeItem(this.storageKey)}}class pn{constructor(){Xe(this,"localStorage"),Xe(this,"storageKey","ton-connect-ui_preferred-wallet"),this.localStorage=an()}setPreferredWalletAppName(e){this.localStorage.setItem(this.storageKey,e)}getPreferredWalletAppName(){return this.localStorage.getItem(this.storageKey)||void 0}}class fn{constructor(){Xe(this,"localStorage"),Xe(this,"storageKey","ton-connect-ui_last-selected-wallet-info"),this.localStorage=an()}setLastSelectedWalletInfo(e){this.localStorage.setItem(this.storageKey,JSON.stringify(e))}getLastSelectedWalletInfo(){const e=this.localStorage.getItem(this.storageKey);return e?JSON.parse(e):null}removeLastSelectedWalletInfo(){this.localStorage.removeItem(this.storageKey)}}const[gn,mn]=gt({status:"closed",closeReason:null}),yn=wt((()=>"opened"===gn().status)),[bn,wn]=gt({status:"closed",closeReason:null}),vn=wt((()=>"opened"===bn().status)),An=wt((()=>{const e=bn();return"opened"===e.status?e.walletInfo:null}));let Tn="undefined"!=typeof window?new fn:void 0;const[Pn,En]=gt((null==Tn?void 0:Tn.getLastSelectedWalletInfo())||null),Cn=e=>{Tn||(Tn=new fn),e?Tn.setLastSelectedWalletInfo(e):Tn.removeLastSelectedWalletInfo(),En(e)},[kn,_n]=gt(null),In={common:{close:"ÐакÑÑÑÑ",openWallet:"ÐÑкÑÑÑÑ ÐºÐ¾ÑелÑк",copyLink:"СкопиÑоваÑÑ",linkCopied:"СÑÑлка ÑкопиÑована",copied:"СкопиÑовано",yourWallet:"ÐÐ°Ñ ÐºÐ¾ÑелÑк",retry:"ÐовÑоÑиÑÑ",get:"СкаÑаÑÑ",mobile:"ÐобилÑнÑй",browserExtension:"РаÑÑиÑение",desktop:"ÐеÑкÑоп"},button:{connectWallet:"ÐодклÑÑиÑÑ ÐºÐ¾ÑелÑк",dropdown:{copy:"СкопиÑоваÑÑ Ð°Ð´ÑеÑ",copied:"ÐдÑÐµÑ ÑкопиÑован!",disconnect:"ÐÑклÑÑиÑÑ ÐºÐ¾ÑелÑк"}},notifications:{confirm:{header:"ÐÑкÑойÑе {{ name }}, ÑÑобÑ подÑвеÑдиÑÑ ÑÑанзакÑиÑ."},transactionSent:{header:"ТÑанзакÑÐ¸Ñ Ð¾ÑпÑавлена",text:"ÐаÑа ÑÑанзакÑиÑ бÑÐ´ÐµÑ Ð¾Ð±ÑабоÑана ÑеÑез неÑколÑко ÑекÑнд."},transactionCanceled:{header:"ТÑанзакÑÐ¸Ñ Ð¾Ñменена",text:"СоÑÑоÑние ваÑего ÑÑÑÑа не измениÑÑÑ."}},walletItem:{walletOn:"Wallet в",recent:"Ðедавний",installed:"УÑÑановлен",popular:"ÐопÑлÑÑен"},walletModal:{loading:"ÐоÑелÑки загÑÑжаÑÑÑÑ",wallets:"ÐоÑелÑки",mobileUniversalModal:{connectYourWallet:"ÐодклÑÑиÑе TON коÑелÑк",openWalletOnTelegramOrSelect:"ÐодклÑÑиÑе Wallet в Telegram или вÑбеÑеÑе дÑÑгое пÑиложение",openWalletOnTelegram:"ÐÑкÑÑÑÑ Wallet в Telegram",chooseOtherApplication:"ÐÑбеÑиÑе дÑÑгое пÑиложение",openLink:"ÐÑкÑÑÑÑ",scan:"ÐÑÑканиÑÑйÑе камеÑой ваÑего ÑелеÑона"},desktopUniversalModal:{connectYourWallet:"ÐодклÑÑиÑе TON коÑелÑк",scan:"ÐÑÑканиÑÑйÑе QR-код камеÑой ваÑего ÑелеÑона",availableWallets:"ÐоÑÑÑпнÑе коÑелÑки"},mobileConnectionModal:{showQR:"ÐоказаÑÑ QR-код",scanQR:"ÐÑÑканиÑÑйÑе QR-код ниже камеÑой в пÑиложении {{ name }}, или камеÑой ÑелеÑона",continueIn:"ÐÑодолжиÑе в {{ name }}â¦",connectionDeclined:"ÐодклÑÑение оÑклонено"},desktopConnectionModal:{scanQR:"ÐÑÑканиÑÑйÑе QR-код ниже камеÑой в пÑиложении {{ name }}, или камеÑой ÑелеÑона",continueInExtension:"ÐÑкÑойÑе бÑаÑзеÑное ÑаÑÑиÑение {{ name }}",dontHaveExtension:"ÐоÑ
оже, Ñ Ð²Ð°Ñ Ð½ÐµÂ ÑÑÑановлено бÑаÑзеÑное ÑаÑÑиÑение {{ name }}",getWallet:"СкаÑаÑÑ {{ name }}",continueOnDesktop:"ÐÑкÑойÑе {{ name }} на компÑÑÑеÑеâ¦",openWalletOnTelegram:"ÐÑкÑÑÑÑ Wallet в Telegram",connectionDeclined:"ÐодклÑÑение оÑклонено"},infoModal:{whatIsAWallet:"ЧÑо Ñакое коÑелÑк?",secureDigitalAssets:"Ðадежное Ñ
ÑанилиÑе ÑиÑÑовÑÑ
акÑивов",walletProtects:"ÐоÑелÑк заÑиÑÐ°ÐµÑ Ð²Ð°Ñи ÑиÑÑовÑе акÑивÑ, вклÑÑÐ°Ñ TON, ÑÐ¾ÐºÐµÐ½Ñ Ð¸Â Ð¿ÑедмеÑÑ ÐºÐ¾Ð»Ð»ÐµÐºÑиониÑованиÑ, и ÑпÑавлÑÐµÑ Ð¸Ð¼Ð¸.",controlIdentity:"ÐонÑÑÐ¾Ð»Ñ Ñвоей лиÑноÑÑи Web3",manageIdentity:"УпÑавлÑйÑе Ñвоей ÑиÑÑовой иденÑиÑикаÑией и Ñ легкоÑÑÑÑ Ð¿Ð¾Ð»ÑÑайÑе доÑÑÑп к деÑенÑÑализованнÑм пÑиложениÑм. СоÑ
ÑанÑйÑе конÑÑÐ¾Ð»Ñ Ð½Ð°Ð´Â Ñвоими даннÑми и безопаÑно ÑÑаÑÑвÑйÑе в ÑкоÑиÑÑеме блокÑейна.",effortlessCryptoTransactions:"ÐÑоÑÑÑе кÑипÑоÑÑанзакÑии",easilySend:"Ðегко оÑпÑавлÑйÑе, полÑÑайÑе и оÑÑлеживайÑе Ñвои кÑипÑовалÑÑÑ. ÐпÑимизиÑÑйÑе Ñвои опеÑаÑии Ñ помоÑÑÑ Ð´ÐµÑенÑÑализованнÑÑ
пÑиложений.",getAWallet:"СкаÑаÑÑ ÐºÐ¾ÑелÑк"}},actionModal:{confirmTransaction:{header:"ÐодÑвеÑдиÑе дейÑÑвие в {{ name }}",text:"ÐÑо Ð·Ð°Ð¹Ð¼ÐµÑ Ð¿Ð°ÑÑ ÑекÑнд."},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled"}},Sn={en:xn({common:{close:"Close",openWallet:"Open wallet",copyLink:"Copy Link",linkCopied:"Link Copied",copied:"Copied",yourWallet:"Your Wallet",retry:"Retry",get:"GET",mobile:"Mobile",browserExtension:"Browser Extension",desktop:"Desktop"},button:{connectWallet:"Connect Wallet",dropdown:{copy:"Copy address",copied:"Address copied!",disconnect:"Disconnect"}},notifications:{confirm:{header:"Open {{ name }} to confirm the transaction."},transactionSent:{header:"Transaction sent",text:"Your transaction will be processed in a few seconds."},transactionCanceled:{header:"Transaction canceled",text:"There will be no changes to your account."}},walletItem:{walletOn:"Wallet in",recent:"Recent",installed:"Installed",popular:"Popular"},walletModal:{loading:"Loading wallets",wallets:"Wallets",mobileUniversalModal:{connectYourWallet:"Connect your TON wallet",openWalletOnTelegramOr
747Select:"Use Wallet in Telegram or choose other application",openWalletOnTelegram:"Connect Wallet in Telegram",chooseOtherApplication:"Choose other application",openLink:"Open Link",scan:"Scan with your mobile wallet"},desktopUniversalModal:{connectYourWallet:"Connect your TON wallet",scan:"Scan with your mobile wallet",availableWallets:"Available wallets"},mobileConnectionModal:{showQR:"Show QR Code",scanQR:"Scan the QR code below with your phoneâs or {{ name }}âs camera",continueIn:"Continue in {{ name }}â¦",connectionDeclined:"Connection declined"},desktopConnectionModal:{scanQR:"Scan the QR code below with your phoneâs or {{ name }}âs camera",continueInExtension:"Continue in {{ name }} browser extensionâ¦",dontHaveExtension:"Seems you don't have installed {{ name }} browser extension",getWallet:"Get {{ name }}",continueOnDesktop:"Continue in {{ name }} on desktopâ¦",openWalletOnTelegram:"Connect Wallet in Telegram on desktop",connectionDeclined:"Connection declined"},infoModal:{whatIsAWallet:"What is a wallet",secureDigitalAssets:"Secure digital assets storage",walletProtects:"A wallet protects and manages your digital assets including TON, tokens and collectables.",controlIdentity:"Control your Web3 identity",manageIdentity:"Manage your digital identity and access decentralized applications with ease. Maintain control over your data and engage securely in the blockchain ecosystem.",effortlessCryptoTransactions:"Effortless crypto transactions",easilySend:"Easily send, receive, monitor your cryptocurrencies. Streamline your operations with decentralized applications.",getAWallet:"Get a Wallet"}},actionModal:{confirmTransaction:{header:"Confirm the transaction in {{ name }}",text:"It will only take a moment."},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled"}}),ru:xn(In)};function xn(e){const t=r=>{Object.entries(r).forEach((([n,o])=>{if("object"==typeof o&&o)return t(o);if("string"==typeof o){if("$"===o[0]){const t=o.slice(1).split(".");let s=e;t.forEach((e=>{if(!(e in s))throw new Error(`Cannot parse translations: there is no property ${e} in translation`);s=s[e]})),r[n]=s}"\\$"===o.slice(0,2)&&(r[n]=o.slice(1))}}))};return t(e),e}const Bn=kt(),On=Symbol("store-raw"),Mn=Symbol("store-node"),Wn=Symbol("store-name");function jn(e,t){let r=e[rt];if(!r&&(Object.defineProperty(e,rt,{value:r=new Proxy(e,zn)}),!Array.isArray(e))){const t=Object.keys(e),n=Object.getOwnPropertyDescriptors(e);for(let o=0,s=t.length;o<s;o++){const s=t[o];n[s].get&&Object.defineProperty(e,s,{enumerable:n[s].enumerable,get:n[s].get.bind(r)})}}return r}function Rn(e){let t;return null!=e&&"object"==typeof e&&(e[rt]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function Nn(e,t=new Set){let r,n,o,s;if(r=null!=e&&e[On])return r;if(!Rn(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let r=0,s=e.length;r<s;r++)o=e[r],(n=Nn(o,t))!==o&&(e[r]=n)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const r=Object.keys(e),i=Object.getOwnPropertyDescriptors(e);for(let a=0,c=r.length;a<c;a++)s=r[a],i[s].get||(o=e[s],(n=Nn(o,t))!==o&&(e[s]=n))}return e}function Un(e){let t=e[Mn];return t||Object.defineProperty(e,Mn,{value:t={}}),t}function Dn(e,t,r){return e[t]||(e[t]=Fn(r))}function Ln(e){if(Ct()){const t=Un(e);(t._||(t._=Fn()))()}}function Fn(e){const[t,r]=gt(e,{equals:!1,internal:!0});return t.$=r,t}const zn={get(e,t,r){if(t===On)return e;if(t===rt)return r;if(t===nt)return Ln(e),r;const n=Un(e),o=n.hasOwnProperty(t);let s=o?n[t]():e[t];if(t===Mn||"__proto__"===t)return s;if(!o){const r=Object.getOwnPropertyDescriptor(e,t);!Ct()||"function"==typeof s&&!e.hasOwnProperty(t)||r&&r.get||(s=Dn(n,t,s)())}return Rn(s)?jn(s):s},has(e,t){return t===On||t===rt||t===nt||t===Mn||"__proto__"===t||(this.get(e,t,e),t in e)},set:()=>!0,deleteProperty:()=>!0,ownKeys:function(e){return Ln(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor:function(e,t){const r=Reflect.getOwnPropertyDescriptor(e,t);return r&&!r.get&&r.configurable&&t!==rt&&t!==Mn&&t!==Wn?(delete r.value,delete r.writable,r.get=()=>e[rt][t],r):r}};function Vn(e,t,r,n=!1){if(!n&&e[t]===r)return;const o=e[t],s=e.length;void 0===r?delete e[t]:e[t]=r;let i,a=Un(e);(i=Dn(a,t,o))&&i.$((()=>r)),Array.isArray(e)&&e.length!==s&&(i=Dn(a,"length",s))&&i.$(e.length),(i=a._)&&i.$()}function qn(e,t){const r=Object.keys(t);for(let n=0;n<r.length;n+=1){const o=r[n];Vn(e,o,t[o])}}function Hn(e,t,r=[]){let n,o=e;if(t.length>1){n=t.shift();const s=typeof n,i=Array.isArray(e);if(Array.isArray(n)){for(let o=0;o<n.length;o++)Hn(e,[n[o]].concat(t),r);return}if(i&&"function"===s){for(let o=0;o<e.length;o++)n(e[o],o)&&Hn(e,[o].concat(t),r);return}if(i&&"object"===s){const{from:o=0,to:s=e.length-1,by:i=1}=n;for(let n=o;n<=s;n+=i)Hn(e,[n].concat(t),r);return}if(t.length>
7471)return void Hn(e[n],t,[n].concat(r));o=e[n],r=[n].concat(r)}let s=t[0];"function"==typeof s&&(s=s(o,r),s===o)||void 0===n&&null==s||(s=Nn(s),void 0===n||Rn(o)&&Rn(s)&&!Array.isArray(s)?qn(o,s):Vn(e,n,s))}function Kn(...[e,t]){const r=Nn(e||{}),n=Array.isArray(r);return[jn(r),function(...e){At((()=>{n&&1===e.length?function(e,t){if("function"==typeof t&&(t=t(e)),t=Nn(t),Array.isArray(t)){if(e===t)return;let r=0,n=t.length;for(;r<n;r++){const n=t[r];e[r]!==n&&Vn(e,r,n)}Vn(e,"length",n)}else qn(e,t)}(r,e[0]):Hn(r,e)}))}]}const $n={constant:{black:"#000000",white:"#FFFFFF"},connectButton:{background:"#0098EA",foreground:"#FFFFFF"},accent:"#0098EA",telegramButton:"#0098EA",icon:{primary:"#0F0F0F",secondary:"#7A8999",tertiary:"#C1CAD2",success:"#29CC6A",error:"#F5A73B"},background:{primary:"#FFFFFF",secondary:"#F1F3F5",segment:"#FFFFFF",tint:"#F1F3F5",qr:"#F1F3F5"},text:{primary:"#0F0F0F",secondary:"#6A7785"}};function Gn(e){return"[object Object]"===Object.prototype.toString.call(e)}function Yn(e){var t,r;return!1!==Gn(e)&&(void 0===(t=e.constructor)||!1!==Gn(r=t.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf"))}function Jn(e,t){if(!e)return t;return Fe(t,e,{arrayMerge:(e,t,r)=>t,isMergeableObject:Yn})}const[Qn,Zn]=Kn({theme:Ir.LIGHT,colors:$n,borderRadius:"m"}),Xn={[Ir.LIGHT]:$n,[Ir.DARK]:{constant:{black:"#000000",white:"#FFFFFF"},connectButton:{background:"#0098EA",foreground:"#FFFFFF"},accent:"#E5E5EA",telegramButton:"#31A6F5",icon:{primary:"#E5E5EA",secondary:"#909099",tertiary:"#434347",success:"#29CC6A",error:"#F5A73B"},background:{primary:"#121214",secondary:"#18181A",segment:"#262629",tint:"#222224",qr:"#FFFFFF"},text:{primary:"#E5E5EA",secondary:"#7D7D85"}}},eo={[Ir.LIGHT]:void 0,[Ir.DARK]:void 0};function to(e,t){t&&(eo[Ir.DARK]=Jn(t[Ir.DARK],eo[Ir.DARK]),eo[Ir.LIGHT]=Jn(t[Ir.LIGHT],eo[Ir.LIGHT])),Zn({theme:e,colors:Jn(eo[e],Xn[e])})}const ro=zr.div` 748 background-color: ${e=>e.theme.colors.background.secondary}; 749`,no=e=>{let t;const[r,n]=gt(null);return bt((()=>{const t=new window.Image;return t.src=e.src,t.alt=e.alt||"",t.setAttribute("draggable","false"),e.class&&t.classList.add(e.class),t.complete?n(t):(t.addEventListener("load",(()=>n(t))),()=>t.removeEventListener("load",(()=>n(t))))})),[$t(er,{get when(){return r()},get children(){return r()}}),$t(er,{get when(){return!r()},get children(){return $t(ro,{get class(){return e.class},ref(e){"function"==typeof t?t(e):t=e}})}})]};let oo={};try{oo=function(e){e=e.replace(/^#/,"");let t={};if(!e.length)return t;if(e.indexOf("=")<0&&e.indexOf("?")<0)return t._path=go(e),t;let r=e.indexOf("?");if(r>=0){let n=e.substr(0,r);t._path=go(n),e=e.substr(r+1)}let n=function(e){let t={};if(!e.length)return t;let r,n,o,s,i=e.split("&");for(r=0;r<i.length;r++)n=i[r].split("="),o=go(n[0]),s=null==n[1]?null:go(n[1]),t[o]=s;return t}(e);for(let e in n)t[e]=n[e];return t}(location.hash.toString())}catch(e){}let so="unknown";if((null==oo?void 0:oo.tgWebAppPlatform)&&(so=null!=(Oe=oo.tgWebAppPlatform)?Oe:"unknown"),"unknown"===so){const e=sn();so=null!=(je=null==(We=null==(Me=null==e?void 0:e.Telegram)?void 0:Me.WebApp)?void 0:We.platform)?je:"unknown"}let io="6.0";if((null==oo?void 0:oo.tgWebAppVersion)&&(io=oo.tgWebAppVersion),!io){const e=sn();io=null!=(Ue=null==(Ne=null==(Re=null==e?void 0:e.Telegram)?void 0:Re.WebApp)?void 0:Ne.version)?Ue:"6.0"}function ao(...e){return e.includes(so)}function co(){var e;return"unknown"!==so||!!(null==(e=sn())?void 0:e.TelegramWebviewProxy)}function lo(){var e;const t=!!(null==(e=sn())?void 0:e.TelegramWebview);return(co()||t)&&"unknown"===so}function uo(){fo("web_app_expand",{})}function ho(e,t){const r=new URL(e);if("http:"!==r.protocol&&"https:"!==r.protocol){if(t)return t();throw new Zr(`Url protocol is not supported: ${r}`)}if("t.me"!==r.hostname){if(t)return t();throw new Zr(`Url host is not supported: ${r}`)}const n=r.pathname+r.search;po()||function(e,t){"string"!=typeof e&&(e=""),"string"!=typeof t&&(t="");let r,n,o,s,i=e.replace(/^\s+|\s+$/g,"").split("."),a=t.replace(/^\s+|\s+$/g,"").split(".");for(r=Math.max(i.length,a.length),n=0;n<r;n++)if(o=parseInt(i[n])||0,s=parseInt(a[n])||0,o!==s)return o>s?1:-1;return 0}(io,"6.1")>=0?fo("web_app_open_tg_link",{path_full:n}):tn("https://t.me"+n)}function po(){try{const e=sn();return!!e&&(null!=e.parent&&e!==e.parent)}catch(e){return!1}}function fo(e,t){try{const r=sn();if(!r)throw new Zr("Can't post event to parent window: window is not defined");if(void 0!==r.TelegramWebviewProxy)Xr("postEvent",e,t),r.TelegramWebviewProxy.postEvent(e,JSON.stringify(t));else if(r.external&&"notify"in r.external)Xr("postEvent",e,t),r.external.notify(JSON.stringify({eventType:e,eventData:t}));else{if(!po())throw new Zr("Can't post event to TMA");{const n="*",o=JSON.stringify({eventType:e,eventData:t});Xr("postEvent",e,t),r.parent.postMessage(o,n)}}}catch(e){!function(...e){try{console.error("[TON_CONNECT_UI]",...e)}catch(e){}}(`Can't post event to parent window: ${e}`)}}function go(e){try{return e=e.replace(/\+/g,"%20"),decodeURIComponent(e)}catch(t){return e}}const mo=440,yo=1020;function bo(e){const t=sn();if(!t)return"desktop"===e;if(ao("weba"))return!0;const r=t.innerWidth;
749switch(e){case"desktop":return r>yo;case"tablet":return r>mo;default:return r<=mo||ln("ios","android","ipad")}}function wo(e){switch(e){case"mobile":return`@media (max-width: ${mo}px)`;case"tablet":return`@media (max-width: ${yo}px) (min-width: ${mo}px)`;default:return`@media (min-width: ${yo}px)`}}const vo="@media (hover: none)",Ao="@media not all and (hover: none)",To={m:"100vh",s:"8px",none:"0"},Po={s:.02,m:.04},Eo=zr.button` 750 display: ${e=>e.leftIcon||e.rightIcon?"flex":"inline-block"}; 751 gap: ${e=>e.leftIcon||e.rightIcon?"6px":"unset"}; 752 align-items: ${e=>e.leftIcon||e.rightIcon?"center":"unset"}; 753 justify-content: ${e=>e.leftIcon||e.rightIcon?"space-between":"unset"}; 754 background-color: ${e=>"flat"===e.appearance?"transparent":"secondary"===e.appearance?e.theme.colors.background.tint:Gr(e.theme.colors.accent,.12)}; 755 color: ${e=>"secondary"===e.appearance?e.theme.colors.text.primary:e.theme.colors.accent}; 756 757 padding: ${e=>"flat"===e.appearance?"0":"9px 16px"}; 758 padding-left: ${e=>e.leftIcon&&"flat"!==e.appearance?"12px":"16px"}; 759 padding-right: ${e=>e.rightIcon&&"flat"!==e.appearance?"12px":"16px"}; 760 border: none; 761 border-radius: ${e=>To[e.theme.borderRadius]}; 762 cursor: ${e=>e.disabled?"not-allowed":"pointer"}; 763 764 font-size: 14px; 765 font-weight: 510; 766 line-height: 18px; 767 768 transition: transform 0.125s ease-in-out; 769 770 ${Ao} { 771 &:hover { 772 transform: ${e=>e.disabled?"unset":`scale(${1+Po[e.scale]})`}; 773 } 774 } 775 776 &:active { 777 transform: ${e=>e.disabled?"unset":`scale(${1-Po[e.scale]})`}; 778 } 779 780 ${vo} { 781 &:active { 782 transform: ${e=>e.disabled?"unset":`scale(${1-2*Po[e.scale]})`}; 783 } 784 } 785`;function Co(e){const t=Tt((()=>Object.keys(e).filter((e=>e.startsWith("data-"))))),[r]=Zt(e,t);return r}const ko=e=>{const t=Co(e);return $t(Eo,Qt({get appearance(){return e.appearance||"primary"},get class(){return e.class},onClick:t=>{var r;return null==(r=e.onClick)?void 0:r.call(e,t)},onMouseEnter:t=>{var r;return null==(r=e.onMouseEnter)?void 0:r.call(e,t)},onMouseLeave:t=>{var r;return null==(r=e.onMouseLeave)?void 0:r.call(e,t)},ref(t){const r=e.ref;"function"==typeof r?r(t):e.ref=t},get disabled(){return e.disabled},get scale(){return e.scale||"m"},get leftIcon(){return!!e.leftIcon},get rightIcon(){return!!e.rightIcon},"data-tc-button":"true"},t,{get children(){return[wt((()=>e.leftIcon)),wt((()=>e.children)),wt((()=>e.rightIcon))]}}))};function _o(e){requestAnimationFrame((()=>{requestAnimationFrame(e)}))}const Io=e=>{let t,r=!0;const[n,o]=gt(),[s,i]=gt(),a=It((()=>e.children)),{onBeforeEnter:c,onEnter:l,onAfterEnter:u,onBeforeExit:d,onExit:h,onAfterExit:p}=e,f=wt((()=>{const t=e.name||"s";
785return{enterActiveClass:e.enterActiveClass||t+"-enter-active",enterClass:e.enterClass||t+"-enter",enterToClass:e.enterToClass||t+"-enter-to",exitActiveClass:e.exitActiveClass||t+"-exit-active",exitClass:e.exitClass||t+"-exit",exitToClass:e.exitToClass||t+"-exit-to"}}));function g(t,a){if(!r||e.appear){let r=function(c){!t||c&&c.target!==t||(t.removeEventListener("transitionend",r),t.removeEventListener("animationend",r),t.classList.remove(...h),t.classList.remove(...p),At((()=>{n()!==t&&o(t),s()===t&&i(void 0)})),u&&u(t),"inout"===e.mode&&m(t,a))};const d=f().enterClass.split(" "),h=f().enterActiveClass.split(" "),p=f().enterToClass.split(" ");c&&c(t),t.classList.add(...d),t.classList.add(...h),_o((()=>{t.classList.remove(...d),t.classList.add(...p),l&&l(t,(()=>r())),(!l||l.length<2)&&(t.addEventListener("transitionend",r),t.addEventListener("animationend",r))}))}a&&!e.mode?i(t):o(t)}function m(t,r){const s=f().exitClass.split(" "),i=f().exitActiveClass.split(" "),a=f().exitToClass.split(" ");if(!r.parentNode)return c();function c(s){s&&s.target!==r||(r.removeEventListener("transitionend",c),r.removeEventListener("animationend",c),r.classList.remove(...i),r.classList.remove(...a),n()===r&&o(void 0),p&&p(r),"outin"===e.mode&&g(t,r))}d&&d(r),r.classList.add(...s),r.classList.add(...i),_o((()=>{r.classList.remove(...s),r.classList.add(...a)})),h&&h(r,(()=>c())),(!h||h.length<2)&&(r.addEventListener("transitionend",c),r.addEventListener("animationend",c))}return mt((n=>{for(t=a();"function"==typeof t;)t=t();return Tt((()=>(t&&t!==n&&("outin"!==e.mode?g(t,n):r&&o(t)),n&&n!==t&&"inout"!==e.mode&&m(t,n),r=!1,t)))})),[n,s]};function So(e){const{top:t,bottom:r,left:n,right:o,width:s,height:i}=e.getBoundingClientRect(),a=e.parentNode.getBoundingClientRect();return{top:t-a.top,bottom:r,left:n-a.left,right:o,width:s,height:i}}const xo=e=>{const t=It((()=>e.children)),r=wt((()=>{const t=e.name||"s";
785return{enterActiveClass:e.enterActiveClass||t+"-enter-active",enterClass:e.enterClass||t+"-enter",enterToClass:e.enterToClass||t+"-enter-to",exitActiveClass:e.exitActiveClass||t+"-exit-active",exitClass:e.exitClass||t+"-exit",exitToClass:e.exitToClass||t+"-exit-to",moveClass:e.moveClass||t+"-move"}})),{onBeforeEnter:n,onEnter:o,onAfterEnter:s,onBeforeExit:i,onExit:a,onAfterExit:c}=e,[l,u]=gt();let d=[],h=!0;return mt((()=>{const e=t(),l=[...e],p=new Set(e),f=new Set(d),g=r().enterClass.split(" "),m=r().enterActiveClass.split(" "),y=r().enterToClass.split(" "),b=r().exitClass.split(" "),w=r().exitActiveClass.split(" "),v=r().exitToClass.split(" ");for(let t=0;t<e.length;t++){const r=e[t];if(!h&&!f.has(r)){let e=function(t){!r||t&&t.target!==r||(r.removeEventListener("transitionend",e),r.removeEventListener("animationend",e),r.classList.remove(...m),r.classList.remove(...y),s&&s(r))};n&&n(r),r.classList.add(...g),r.classList.add(...m),_o((()=>{r.classList.remove(...g),r.classList.add(...y),o&&o(r,(()=>e())),(!o||o.length<2)&&(r.addEventListener("transitionend",e),r.addEventListener("animationend",e))}))}}for(let e=0;e<d.length;e++){const t=d[e];if(!p.has(t)&&t.parentNode){let r=function(e){e&&e.target!==t||(t.removeEventListener("transitionend",r),t.removeEventListener("animationend",r),t.classList.remove(...w),t.classList.remove(...v),c&&c(t),d=d.filter((e=>e!==t)),u(d))};l.splice(e,0,t),i&&i(t),t.classList.add(...b),t.classList.add(...w),_o((()=>{t.classList.remove(...b),t.classList.add(...v)})),a&&a(t,(()=>r())),(!a||a.length<2)&&(t.addEventListener("transitionend",r),t.addEventListener("animationend",r))}}d=l,u(l)})),bt((e=>{const t=l();return t.forEach((t=>{let r;(r=e.get(t))?r.new&&(r.new=!1,r.newPos=So(t)):e.set(t,r={pos:So(t),new:!h}),r.new&&t.addEventListener("transitionend",(()=>{r.new=!1,t.parentNode&&(r.newPos=So(t))}),{once:!0}),r.newPos&&(r.pos=r.newPos),r.newPos=So(t)})),h?(h=!1,e):(t.forEach((t=>{const r=e.get(t),n=r.pos,o=r.newPos,s=n.left-o.left,i=n.top-o.top;if(s||i){r.moved=!0;const e=t.style;e.transform=`translate(${s}px,${i}px)`,e.transitionDuration="0s"}})),document.body.offsetHeight,t.forEach((t=>{const n=e.get(t);if(n.moved){let e=function(r){r&&r.target!==t||!t.parentNode||r&&!/transform$/.test(r.propertyName)||(t.removeEventListener("transitionend",e),t.classList.remove(...s))};n.moved=!1;const o=t.style,s=r().moveClass.split(" ");t.classList.add(...s),o.transform=o.transitionDuration="",t.addEventListener("transitionend",e)}})),e)}),new Map),l};const Bo="androidBackHandler",Oo={[Bo]:!0},Mo=dr('<svg><path fill-rule="evenodd" clip-rule="evenodd" d="M10.2122 14.3407C10.5384 14.0854 10.5959 13.614 10.3406 13.2878L6.20237 8.00003L10.3406 2.71227C10.5959 2.38607 10.5384 1.91469 10.2122 1.6594C9.88604 1.40412 9.41465 1.46161 9.15937 1.7878L4.65937 7.5378C4.44688 7.80932 4.44688 8.19074 4.65937 8.46226L9.15937 14.2123C9.41465 14.5385 9.88604 14.5959 10.2122 14.3407Z"></path></svg>',0,!0),Wo={left:0,top:90,right:180,bottom:270},jo=e=>{const t=Lr();return $t(zr("svg")` 786 transform: rotate(${e=>Wo[e.svgDirection]}deg); 787 transition: transform 0.1s ease-in-out; 788 `,{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",get svgDirection(){return e.direction||"left"},get children(){const r=Mo.cloneNode(!0);return yt((()=>hr(r,"fill",e.fill||t.colors.icon.secondary))),r}})},Ro=dr('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.71966 2.71968C3.01255 2.42678 3.48743 2.42677 3.78032 2.71966L8.00002 6.93925L12.2197 2.71967C12.5126 2.42677 12.9874 2.42678 13.2803 2.71967C13.5732 3.01257 13.5732 3.48744 13.2803 3.78033L9.06068 7.99991L13.2803 12.2197C13.5732 12.5126 13.5732 12.9874 13.2803 13.2803C12.9874 13.5732 12.5126 13.5732 12.2197 13.2803L8.00002 9.06057L3.78033 13.2803C3.48744 13.5732 3.01257 13.5732 2.71967 13.2803C2.42678 12.9874 2.42677 12.5126 2.71967 12.2197L6.93936 7.99991L2.71968 3.78034C2.42678 3.48745 2.42677 3.01257 2.71966 2.71968Z"></path></svg>'),No=e=>{const t=Lr();return(()=>{const r=Ro.cloneNode(!0),n=r.firstChild;return yt((()=>hr(n,"fill",e.fill||t.colors.icon.secondary))),r})()},Uo=zr.button` 789 padding: 0; 790 display: flex; 791 justify-content: center;
792 align-items: center; 793 width: 32px; 794 height: 32px; 795 border-radius: 50%; 796 background-color: ${e=>e.theme.colors.background.tint}; 797 border: none; 798 cursor: pointer; 799 800 transition: transform 0.125s ease-in-out; 801 802 ${Ao} { 803 &:hover { 804 transform: scale(1.04); 805 } 806 } 807 808 &:active { 809 transform: scale(0.96); 810 } 811 812 ${vo} { 813 &:active { 814 transform: scale(0.92); 815 } 816 } 817`,Do=e=>{const t=Co(e),r=()=>e.icon||"close";return $t(Uo,Qt({get class(){return e.class},onClick:()=>e.onClick(),"data-tc-icon-button":"true"},t,{get children(){return[$t(er,{get when(){return!!e.children},get children(){return e.children}}),$t(er,{get when(){return!e.children},get children(){return $t(tr,{get children(){return[$t(rr,{get when(){return"close"===r()},get children(){return $t(No,{get fill(){return e.fill}})}}),$t(rr,{get when(){return"arrow"===r()},get children(){return $t(jo,{get fill(){return e.fill}})}}),$t(rr,{get when(){return"question"===r()},get children(){return $t(di,{get fill(){return e.fill}})}}),$t(rr,{get when(){return"string"!=typeof r()},get children(){return r()}})]}})}})]}}))},Lo={m:"24px",s:"16px",none:"0"},Fo=zr.div` 818 display: flex; 819 position: fixed; 820 z-index: 1000; 821 left: 0; 822 top: 0; 823 width: 100%; 824 height: 100%; 825 background-color: rgba(0, 0, 0, 0.4); 826 padding: 20px 0; 827 overflow-y: auto; 828 829 ${wo("mobile")} { 830 padding-bottom: 0; 831 } 832`,zo=Rr` 833 box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 16px 64px rgba(0, 0, 0, 0.16); 834 width: fit-content; 835 margin: auto; 836 837 ${wo("mobile")} { 838 width: 100%; 839 height: fit-content; 840 margin: auto 0 0 0; 841 } 842`,Vo=zr.div` 843 position: relative; 844 min-height: 100px; 845 width: 416px; 846 padding: 44px 56px 24px; 847 848 box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.04); 849 850 background-color: ${e=>e.theme.colors.background.primary}; 851 border-radius: ${e=>Lo[e.theme.borderRadius]}; 852 853 ${wo("mobile")} { 854 width: 100%; 855 } 856`,qo=zr(Do)` 857 position: absolute; 858 right: 16px; 859 top: 16px; 860`,Ho=zr.div` 861 display: flex; 862 justify-content: space-between; 863 align-items: center; 864 padding: 16px 16px 16px 18px; 865 border-radius: 0 0 ${e=>Lo[e.theme.borderRadius]} 866 ${e=>Lo[e.theme.borderRadius]}; 867`,Ko=zr(Do)` 868 background-color: ${e=>Gr(e.theme.colors.icon.secondary,.12)}; 869`;class $o{constructor(){Xe(this,"currentTime",0)}}const Go=class{constructor(){Xe(this,"currentTime",0),Xe(this,"playbackRate",1),Xe(this,"startTime",null),Xe(this,"timeline",new $o),Xe(this,"finished",Promise.resolve(this)),Xe(this,"effect",null),Xe(this,"id",""),Xe(this,"pending",!1),Xe(this,"playState","finished"),Xe(this,"replaceState","active"),Xe(this,"ready",Promise.resolve(this)),Xe(this,"oncancel",null),Xe(this,"onfinish",null),Xe(this,"onremove",null)}static create(){return Go._instance||(!function(...e){try{console.warn("[TON_CONNECT_UI]",...e)}catch(e){}}("Animation is not supported in this environment: please consider using the `web-animations-js` polyfill to provide a fallback implementation of the Web Animations API."),Go._instance=new Go),Go._instance}cancel(){}finish(){}pause(){}play(){}reverse(){}addEventListener(e,t,r){}dispatchEvent(e){return!1}removeEventListener(e,t,r){}updatePlaybackRate(e){}commitStyles(){}persist(){}};let Yo=Go;function Jo(e,t,r){return"animate"in e?e.animate(t,r):Yo.create()}Xe(Yo,"_instance",null);const Qo=dr("<div></div>"),Zo=function(e,t){const r=r=>{var n;return!e.contains(r.target)&&(null==(n=t())?void 0:n())};document.body.addEventListener("click",r),Et((()=>document.body.removeEventListener("click",r)))},Xo=function(e,t){const r=e=>{var r,n;"Escape"===e.key&&(null==(r=document.activeElement)||r.blur(),null==(n=t())||n())};document.body.addEventListener("keydown",r),Et((()=>document.body.removeEventListener("keydown",r)))},es=function(e,t){const{isEnabled:r,onClose:n}=t();if(!r)return;if(!("android"===cn().os))return;window.history.pushState(Oo,"");const o=e=>{e.preventDefault(),n()};window.addEventListener("popstate",o,{once:!0}),Et((()=>{window.removeEventListener("popstate",o),nn((()=>{var e;!0===(null==(e=window.history.state)?void 0:e[Bo])&&window.history.back()}))}))},ts=e=>{const t=Lr(),r=Co(e);return bt((()=>{e.opened?document.documentElement.scrollHeight!==document.documentElement.clientHeight&&(document.body.style.top=Yr(-document.documentElement.scrollTop),document.body.classList.add(Hr)):(document.body.classList.remove(Hr),document.documentElement.scrollTo({top:-parseFloat(getComputedStyle(document.body).top)}),document.body.style.top="auto")})),$t(Io,{onBeforeEnter:e=>{const t=bo("mobile")?200:100;Jo(e,[{opacity:0}
vendor: 7,206 bytes, lines 869-1017
869,{opacity:1}],{duration:t}),bo("mobile")&&Jo(e.firstElementChild,[{transform:"translateY(390px)"},{transform:"translateY(0)"}],{duration:t})},onExit:(e,t)=>{const r=bo("mobile")?200:100,n=Jo(e,[{opacity:1},{opacity:0}],{duration:r});if(bo("mobile")){const o=Jo(e.firstElementChild,[{transform:"translateY(0)"},{transform:"translateY(390px)"}],{duration:r});Promise.all([n.finished,o.finished]).then(t)}else n.finished.then(t)},get children(){return $t(er,{get when(){return e.opened},get children(){return $t(Fo,Qt({"data-tc-modal":"true"},r,{get children(){const r=Qo.cloneNode(!0);return gr(es,r,(()=>({isEnabled:e.enableAndroidBackHandler,onClose:()=>e.onClose()}))),gr(Xo,r,(()=>()=>e.onClose())),gr(Zo,r,(()=>()=>e.onClose())),mr(r,$t(Vo,{get class(){return e.class},get children(){return[$t(qo,{icon:"close",onClick:()=>e.onClose()}),wt((()=>e.children))]}}),null),mr(r,$t(er,{get when(){return e.onClickQuestion},get children(){return $t(Ho,{get children(){return[$t(li,{}),$t(Ko,{get onClick(){return e.onClickQuestion},icon:"question"})]}})}}),null),yt((()=>pr(r,ze(zo,Rr` 870 border-radius: ${Lo[t.borderRadius]}; 871 background-color: ${t.colors.background.tint}; 872 873 ${wo("mobile")} { 874 border-radius: ${Lo[t.borderRadius]} 875 ${Lo[t.borderRadius]} 0 0; 876 } 877 `)))),r}}))}})}})},rs={m:"22px",s:"12px",none:"0"},ns={m:"18px",s:"8px",none:"0"},os=zr.div` 878 display: grid; 879 grid-template: 1fr / 1fr 1fr; 880 width: fit-content; 881 justify-items: center; 882 gap: 4px; 883 884 position: relative; 885 padding: 4px; 886 border-radius: ${e=>rs[e.theme.borderRadius]}; 887 888 background-color: ${e=>e.theme.colors.background.secondary}; 889`,ss=zr.div` 890 position: absolute; 891 top: 4px; 892 left: 4px; 893 894 height: calc(100% - 8px); 895 width: calc(50% - 4px); 896 897 border-radius: ${e=>ns[e.theme.borderRadius]}; 898 background-color: ${e=>e.theme.colors.background.segment}; 899 900 transform: ${e=>e.right?"translateX(100%)":"translateX(0)"}; 901 902 transition: transform 0.13s ease-in-out; 903`,is=zr.input` 904 display: none; 905`,as=zr.label` 906 padding: 9px 12px; 907 z-index: 1; 908 909 cursor: ${e=>e.isActive?"default":"pointer"}; 910 911 transition: transform 0.13s ease-in-out; 912 913 &:hover { 914 transform: ${e=>e.isActive?"none":"scale(1.025)"}; 915 } 916 917 > * { 918 ${e=>e.isActive?"":`color: ${e.theme.colors.text.secondary};`} 919 } 920`,cs={m:"16px",s:"12px",none:"0"},ls={m:"12px",s:"8px",none:"0"},us=zr.div` 921 width: 52px; 922 height: 52px; 923 background: transparent; 924 position: absolute; 925 right: 0; 926 bottom: 0; 927 928 display: flex; 929 align-items: center; 930 justify-content: center; 931 transition: transform 0.125s ease-in-out; 932`,ds=zr.button` 933 display: flex; 934 align-items: center; 935 justify-content: center; 936 position: relative; 937 background-color: ${e=>e.theme.colors.background.qr}; 938 border-radius: ${e=>cs[e.theme.borderRadius]}; 939 padding: ${Yr(24)} 0; 940 height: ${Yr(304)}; 941 width: 100%; 942 943 overflow: hidden; 944 cursor: pointer; 945 border: none; 946 947 ${Ao} { 948 &:hover { 949 ${us.class} { 950 transform: scale(1.04); 951 } 952 } 953 } 954 955 &:active { 956 ${us.class} { 957 transform: scale(0.96); 958 } 959 } 960 961 ${vo} { 962 &:active { 963 ${us.class} { 964 transform: scale(0.92); 965 } 966 } 967 } 968`,hs=zr.div` 969 position: relative; 970 display: flex; 971 justify-content: center; 972 align-items: center; 973 margin: 0 auto; 974 975 > div:first-child { 976 display: flex; 977 align-items: center; 978 justify-content: center; 979 } 980 981 rect { 982 fill: transparent; 983 } 984 985 path { 986 fill: ${e=>e.theme.colors.constant.black}; 987 } 988`,ps=zr.div` 989 position: absolute; 990 width: ${Yr(60)}; 991 height: ${Yr(60)}; 992 background: ${e=>e.theme.colors.background.qr}; 993 994 display: flex; 995 align-items: center; 996 justify-content: center; 997`,fs=zr(no)` 998 width: ${e=>Yr(e.size)}; 999 height: ${e=>Yr(e.size)}; 1000 border-radius: ${e=>ls[e.theme.borderRadius]}; 1001 background-color: ${e=>e.theme.colors.background.qr}; 1002`,gs=zr.div` 1003 position: absolute; 1004 bottom: 14px; 1005 left: 50%; 1006 transform: translate(-50%, 0); 1007 1008 display: flex; 1009 gap: 6px; 1010 align-items: center; 1011 border-radius: 18px; 1012 min-width: 126px; 1013 padding: 9px 16px 9px 10px; 1014 1015 filter: drop-shadow(0px 2px 8px rgba(0, 0, 0, 0.08)); 1016 background-color: ${e=>e.theme.colors.background.segment}; 1017`;var ms,ys,bs={exports:{}};ms=bs,ys=function(){var e=function(e,t){var r=e,n=u[t],o=null,s=0,i=null,a=[],c={},l=function(e,t){o=function(e){for(var t=new Array(e),r=0;r<e;r+=1){t[r]=new Array(e);for(var n=0;n<e;n+=1)t[r][n]=null}return t}(s=4*r+17),d(0,0),d(s-7,0),d(0,s-7),p(),h(),g(e,t),r>=7&&f(e),null==i&&(i=y(r,n,a)),m(i,t)},d=function(e,t){for(var r=-1;r<=7;r+=1)if(!(e+r<=-1||s<=e+r))for(var n=-1;n<=7;n+=1)t+n<=-1||s<=t+n||(o[e+r][t+n]=0<=r&&r<=6&&(0==n||6==n)||0<=n&&n<=6&&(0==r||6==r)||2<=r&&r<=4&&2<=n&&n<=4)},h=function(){for(var e=8;e<s-8;e+=1)null==o[e][6]&&(o[e][6]=e%2==0);for(var t=8;t<s-8;t+=1)null==o[6][t]&&(o[6][t]=t%2==0)},p=function(){for(var e=w.getPatternPosition(r),t=0;t<e.length;t+=1)for(var n=0;n<e.length;n+=1){var s=e[t],i=e[n];if(null==o[s][i])for(var a=-2;a<=2;a+=1)for(var c=-2;c<=2;c+=1)o[s+a][i+c]=-2==a||2==a||-2==c||2==c||0==a&&0==c}},f=function(e){for(var t=w.getBCHTypeNumber(r),n=0;n<18;n+=1){var i=!e&&1==(t>>n&1);o[Math.floor(n/3)][n%3+s-8-3]=i}for(n=0;n<18;n+=1)i=!e&&1==(t>>n&1),o[n%3+s-8-3][Math.floor(n/3)]=i},g=function(e,t){for(var r=n<<3|t,i=w.getBCHTypeInfo(r),a=0;a<15;a+=1){var c=!e&&1==(i>>a&1);a<6?o[a][8]=c:a<8?o[a+1][8]=c:o[s-15+a][8]=c}for(a=0;a<15;a+=1)c=!e&&1==(i>>a&1),a<8?o[8][s-a-1]=c:a<9?o[8][15-a-1+1]=c:o[8][15-a-1]=c;o[s-8][8]=!e},m=function(e,t){for(var r=-1,n=s-1,i=7,a=0,c=w.getMaskFunction(t),l=s-1;l>0;l-=2)for(6==l&&(l-=1);;){for(var u=0;u<2;u+=1)if(null==o[n][l-u]){var d=!1;a<e.length&&(d=1==(e[a]>>>i&1)),c(n,l-u)&&(d=!d),o[n][l-u]=d,-1==(i-=1)&&(a+=1,i=7)}if((n+=r)<0||s<=n){n-=r,r=-r;break}}},y=function(e,t,r){for(var n=T.getRSBlocks(e,t),o=P(),s=0;s<r.length;s+=1){var i=r[s];o.put(i.getMode(),4),o.put(i.getLength(),w.getLengthInBits(i.getMode(),e)),i.write(o)}var a=0;for(s=0;s<n.length;s+=1)a+=n[s].dataCount;if(o.getLengthInBits()>8*a)throw"code length overflow. ("+o.getLengthInBits()+">"+8*a+")";for(o.getLengthInBits()+4<=8*a&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(!1);for(;!(o.getLengthInBits()>=8*a||(o.put(236,8),o.getLengthInBits()>=8*a));)o.put(17,8);return function(e,t){for(var r=0,n=0,o=0,s=new Array(t.length),i=new Array(t.length),a=0;a<t.length;a+=1){var c=t[a].dataCount,l=t[a].totalCount-c;n=Math.max(n,c),o=Math.max(o,l),s[a]=new Array(c);for(var u=0;u<s[a].length;u+=1)s[a][u]=255&e.getBuffer()[u+r];r+=c;var d=w.getErrorCorrectPolynomial(l),h=A(s[a],d.getLength()-1).mod(d);for(i[a]=new Array(d.getLength()-1),u=0;u<i[a].length;u+=1){var p=u+h.getLength()-i[a].length;i[a][u]=p>=0?h.getAt(p):0}}var f=0;for(u=0;
vendor: 4,241 bytes, line 1017
1017u<t.length;u+=1)f+=t[u].totalCount;var g=new Array(f),m=0;for(u=0;u<n;u+=1)for(a=0;a<t.length;a+=1)u<s[a].length&&(g[m]=s[a][u],m+=1);for(u=0;u<o;u+=1)for(a=0;a<t.length;a+=1)u<i[a].length&&(g[m]=i[a][u],m+=1);return g}(o,n)};c.addData=function(e,t){var r=null;switch(t=t||"Byte"){case"Numeric":r=E(e);break;case"Alphanumeric":r=C(e);break;case"Byte":r=k(e);break;case"Kanji":r=_(e);break;default:throw"mode:"+t}a.push(r),i=null},c.isDark=function(e,t){if(e<0||s<=e||t<0||s<=t)throw e+","+t;return o[e][t]},c.getModuleCount=function(){return s},c.make=function(){if(r<1){for(var e=1;e<40;e++){for(var t=T.getRSBlocks(e,n),o=P(),s=0;s<a.length;s++){var i=a[s];o.put(i.getMode(),4),o.put(i.getLength(),w.getLengthInBits(i.getMode(),e)),i.write(o)}var u=0;for(s=0;s<t.length;s++)u+=t[s].dataCount;if(o.getLengthInBits()<=8*u)break}r=e}l(!1,function(){for(var e=0,t=0,r=0;r<8;r+=1){l(!0,r);var n=w.getLostPoint(c);(0==r||e>n)&&(e=n,t=r)}return t}())},c.createTableTag=function(e,t){e=e||2;var r="";r+='<table style="',r+=" border-width: 0px; border-style: none;",r+=" border-collapse: collapse;",r+=" padding: 0px; margin: "+(t=void 0===t?4*e:t)+"px;",r+='">',r+="<tbody>";for(var n=0;n<c.getModuleCount();n+=1){r+="<tr>";for(var o=0;o<c.getModuleCount();o+=1)r+='<td style="',r+=" border-width: 0px; border-style: none;",r+=" border-collapse: collapse;",r+=" padding: 0px; margin: 0px;",r+=" width: "+e+"px;",r+=" height: "+e+"px;",r+=" background-color: ",r+=c.isDark(n,o)?"#000000":"#ffffff",r+=";",r+='"/>';r+="</tr>"}return r+="</tbody>",r+="</table>"},c.createSvgTag=function(e,t,r,n){var o={};"object"==typeof arguments[0]&&(e=(o=arguments[0]).cellSize,t=o.margin,r=o.alt,n=o.title),e=e||2,t=void 0===t?4*e:t,(r="string"==typeof r?{text:r}:r||{}).text=r.text||null,r.id=r.text?r.id||"qrcode-description":null,(n="string"==typeof n?{text:n}:n||{}).text=n.text||null,n.id=n.text?n.id||"qrcode-title":null;var s,i,a,l,u=c.getModuleCount()*e+2*t,d="";for(l="l"+e+",0 0,"+e+" -"+e+",0 0,-"+e+"z ",d+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',d+=o.scalable?"":' width="'+u+'px" height="'+u+'px"',d+=' viewBox="0 0 '+u+" "+u+'" ',d+=' preserveAspectRatio="xMinYMin meet"',d+=n.text||r.text?' role="img" aria-labelledby="'+b([n.id,r.id].join(" ").trim())+'"':"",d+=">",d+=n.text?'<title id="'+b(n.id)+'">'+b(n.text)+"</title>":"",d+=r.text?'<description id="'+b(r.id)+'">'+b(r.text)+"</description>":"",d+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',d+='<path d="',i=0;i<c.getModuleCount();i+=1)for(a=i*e+t,s=0;s<c.getModuleCount();s+=1)c.isDark(i,s)&&(d+="M"+(s*e+t)+","+a+l);return d+='" stroke="transparent" fill="black"/>',d+="</svg>"},c.createDataURL=function(e,t){e=e||2,t=void 0===t?4*e:t;var r=c.getModuleCount()*e+2*t,n=t,o=r-t;return x(r,r,(function(t,r){if(n<=t&&t<o&&n<=r&&r<o){var s=Math.floor((t-n)/e),i=Math.floor((r-n)/e);return c.isDark(i,s)?0:1}return 1}))},c.createImgTag=function(e,t,r){e=e||2,t=void 0===t?4*e:t;var n=c.getModuleCount()*e+2*t,o="";return o+="<img",o+=' src="',o+=c.createDataURL(e,t),o+='"',o+=' width="',o+=n,o+='"',o+=' height="',o+=n,o+='"',r&&(o+=' alt="',o+=b(r),o+='"'),o+="/>"};var b=function(e){for(var t="",r=0;r<e.length;r+=1){var n=e.charAt(r);switch(n){case"<":t+="<";break;case">":t+=">";break;case"&":t+="&";break;case'"':t+=""";break;default:t+=n}}return t};return c.createASCII=function(e,t){if((e=e||1)<2)return function(e){e=void 0===e?2:e;var t,r,n,o,s,i=1*c.getModuleCount()+2*e,a=e,l=i-e,u={"ââ":"â","â ":"â"," â":"â"," ":" "},d={"ââ":"â","â ":"â"," â":" "," ":" "},h="";for(t=0;t<i;t+=2){for(n=Math.floor((t-a)/1),o=Math.floor((t+1-a)/1),r=0;r<i;r+=1)s="â",a<=r&&r<l&&a<=t&&t<l&&c.isDark(n,Math.floor((r-a)/1))&&(s=" "),a<=r&&r<l&&a<=t+1&&t+1<l&&c.isDark(o,Math.floor((r-a)/1))?s+=" ":s+="â",h+=e<1&&t+1>=l?d[s]:u[s];h+="\n"}return i%2&&e>0?h.substring(0,h.length-i-1)+Array(i+1).join("â"):h.substring(0,h.length-1)}(t);e-=1,t=void 0===t?2*e:t;var r,n,o,s,i=c.getModuleCount()*e+2*t,a=t,l=i-t,u=Array(e+1).join("ââ"),d=Array(e+1).join(" "),h="",p="";for(r=0;r<i;r+=1){for(o=Math.floor((r-a)/e),p="",n=0;n<i;n+=1)s=1,a<=n&&n<l&&a<=r&&r<l&&c.isDark(o,Math.floor((n-a)/e))&&(s=0),p+=s?u:d;for(o=0;o<e;
vendor: 12,173 bytes, line 1017
1017o+=1)h+=p+"\n"}return h.substring(0,h.length-1)},c.renderTo2dContext=function(e,t){t=t||2;for(var r=c.getModuleCount(),n=0;n<r;n++)for(var o=0;o<r;o++)e.fillStyle=c.isDark(n,o)?"black":"white",e.fillRect(n*t,o*t,t,t)},c};e.stringToBytes=(e.stringToBytesFuncs={default:function(e){for(var t=[],r=0;r<e.length;r+=1){var n=e.charCodeAt(r);t.push(255&n)}return t}}).default,e.createStringToBytes=function(e,t){var r=function(){for(var r=S(e),n=function(){var e=r.read();if(-1==e)throw"eof";return e},o=0,s={};;){var i=r.read();if(-1==i)break;var a=n(),c=n()<<8|n();s[String.fromCharCode(i<<8|a)]=c,o+=1}if(o!=t)throw o+" != "+t;return s}(),n="?".charCodeAt(0);return function(e){for(var t=[],o=0;o<e.length;o+=1){var s=e.charCodeAt(o);if(s<128)t.push(s);else{var i=r[e.charAt(o)];"number"==typeof i?(255&i)==i?t.push(i):(t.push(i>>>8),t.push(255&i)):t.push(n)}}return t}};var t,r,n,o,s,i=1,a=2,c=4,l=8,u={L:1,M:0,Q:3,H:2},d=0,h=1,p=2,f=3,g=4,m=5,y=6,b=7,w=(t=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],r=1335,n=7973,s=function(e){for(var t=0;0!=e;)t+=1,e>>>=1;return t},(o={}).getBCHTypeInfo=function(e){for(var t=e<<10;s(t)-s(r)>=0;)t^=r<<s(t)-s(r);return 21522^(e<<10|t)},o.getBCHTypeNumber=function(e){for(var t=e<<12;s(t)-s(n)>=0;)t^=n<<s(t)-s(n);return e<<12|t},o.getPatternPosition=function(e){return t[e-1]},o.getMaskFunction=function(e){switch(e){case d:return function(e,t){return(e+t)%2==0};case h:return function(e,t){return e%2==0};case p:return function(e,t){return t%3==0};case f:return function(e,t){return(e+t)%3==0};case g:return function(e,t){return(Math.floor(e/2)+Math.floor(t/3))%2==0};case m:return function(e,t){return e*t%2+e*t%3==0};case y:return function(e,t){return(e*t%2+e*t%3)%2==0};case b:return function(e,t){return(e*t%3+(e+t)%2)%2==0};default:throw"bad maskPattern:"+e}},o.getErrorCorrectPolynomial=function(e){for(var t=A([1],0),r=0;r<e;r+=1)t=t.multiply(A([1,v.gexp(r)],0));return t},o.getLengthInBits=function(e,t){if(1<=t&&t<10)switch(e){case i:return 10;case a:return 9;case c:case l:return 8;default:throw"mode:"+e}else if(t<27)switch(e){case i:return 12;case a:return 11;case c:return 16;case l:return 10;default:throw"mode:"+e}else{if(!(t<41))throw"type:"+t;switch(e){case i:return 14;case a:return 13;case c:return 16;case l:return 12;default:throw"mode:"+e}}},o.getLostPoint=function(e){for(var t=e.getModuleCount(),r=0,n=0;n<t;n+=1)for(var o=0;o<t;o+=1){for(var s=0,i=e.isDark(n,o),a=-1;a<=1;a+=1)if(!(n+a<0||t<=n+a))for(var c=-1;c<=1;c+=1)o+c<0||t<=o+c||0==a&&0==c||i==e.isDark(n+a,o+c)&&(s+=1);s>5&&(r+=3+s-5)}for(n=0;n<t-1;n+=1)for(o=0;o<t-1;o+=1){var l=0;e.isDark(n,o)&&(l+=1),e.isDark(n+1,o)&&(l+=1),e.isDark(n,o+1)&&(l+=1),e.isDark(n+1,o+1)&&(l+=1),0!=l&&4!=l||(r+=3)}for(n=0;n<t;n+=1)for(o=0;o<t-6;o+=1)e.isDark(n,o)&&!e.isDark(n,o+1)&&e.isDark(n,o+2)&&e.isDark(n,o+3)&&e.isDark(n,o+4)&&!e.isDark(n,o+5)&&e.isDark(n,o+6)&&(r+=40);for(o=0;o<t;o+=1)for(n=0;n<t-6;n+=1)e.isDark(n,o)&&!e.isDark(n+1,o)&&e.isDark(n+2,o)&&e.isDark(n+3,o)&&e.isDark(n+4,o)&&!e.isDark(n+5,o)&&e.isDark(n+6,o)&&(r+=40);var u=0;for(o=0;o<t;o+=1)for(n=0;n<t;n+=1)e.isDark(n,o)&&(u+=1);return r+=Math.abs(100*u/t/t-50)/5*10},o),v=function(){for(var e=new Array(256),t=new Array(256),r=0;r<8;r+=1)e[r]=1<<r;for(r=8;r<256;r+=1)e[r]=e[r-4]^e[r-5]^e[r-6]^e[r-8];for(r=0;r<255;r+=1)t[e[r]]=r;var n={glog:function(e){if(e<1)throw"glog("+e+")";return t[e]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return e[t]}};return n}();function A(e,t){if(void 0===e.length)throw e.length+"/"+t;var r=function(){for(var r=0;r<e.length&&0==e[r];)r+=1;for(var n=new Array(e.length-r+t),o=0;o<e.length-r;o+=1)n[o]=e[o+r];return n}(),n={getAt:function(e){return r[e]},getLength:function(){return r.length},multiply:function(e){for(var t=new Array(n.getLength()+e.getLength()-1),r=0;r<n.getLength();r+=1)for(var o=0;o<e.getLength();o+=1)t[r+o]^=v.gexp(v.glog(n.getAt(r))+v.glog(e.getAt(o)));return A(t,0)},mod:function(e){if(n.getLength()-e.getLength()<0)return n;for(var t=v.glog(n.getAt(0))-v.glog(e.getAt(0)),r=new Array(n.getLength()),o=0;o<n.getLength();o+=1)r[o]=n.getAt(o);for(o=0;o<e.getLength();o+=1)r[o]^=v.gexp(v.glog(e.getAt(o))+t);return A(r,0).mod(e)}};return n}var T=function(){var e=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t=function(e,t){var r={};return r.totalCount=e,r.dataCount=t,r},r={getRSBlocks:function(r,n){var o=function(t,r){switch(r){case u.L:return e[4*(t-1)+0];case u.M:return e[4*(t-1)+1];case u.Q:return e[4*(t-1)+2];case u.H:return e[4*(t-1)+3];default:return}}(r,n);if(void 0===o)throw"bad rs block @ typeNumber:"+r+"/errorCorrectionLevel:"+n;for(var s=o.length/3,i=[],a=0;a<s;a+=1)for(var c=o[3*a+0],l=o[3*a+1],d=o[3*a+2],h=0;h<c;h+=1)i.push(t(l,d));return i}};return r}(),P=function(){var e=[],t=0,r={getBuffer:function(){return e},getAt:function(t){var r=Math.floor(t/8);return 1==(e[r]>>>7-t%8&1)},put:function(e,t){for(var n=0;n<t;n+=1)r.putBit(1==(e>>>t-n-1&1))},getLengthInBits:function(){return t},putBit:function(r){var n=Math.floor(t/8);e.length<=n&&e.push(0),r&&(e[n]|=128>>>t%8),t+=1}};return r},E=function(e){var t=i,r=e,n={getMode:function(){return t},getLength:function(e){return r.length},write:function(e){for(var t=r,n=0;n+2<t.length;)e.put(o(t.substring(n,n+3)),10),n+=3;n<t.length&&(t.length-n==1?e.put(o(t.substring(n,n+1)),4):t.length-n==2&&e.put(o(t.substring(n,n+2)),7))}},o=function(e){for(var t=0,r=0;r<e.length;r+=1)t=10*t+s(e.charAt(r));return t},s=function(e){if("0"<=e&&e<="9")return e.charCodeAt(0)-"0".charCodeAt(0);throw"illegal char :"+e};return n},C=function(e){var t=a,r=e,n={getMode:function(){return t},getLength:function(e){return r.length},write:function(e){for(var t=r,n=0;n+1<t.length;)e.put(45*o(t.charAt(n))+o(t.charAt(n+1)),11),n+=2;n<t.length&&e.put(o(t.charAt(n)),6)}},o=function(e){if("0"<=e&&e<="9")return e.charCodeAt(0)-"0".charCodeAt(0);if("A"<=e&&e<="Z")return e.charCodeAt(0)-"A".charCodeAt(0)+10;switch(e){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+e}};return n},k=function(t){var r=c,n=e.stringToBytes(t),o={getMode:function(){return r},getLength:function(e){return n.length},write:function(e){for(var t=0;t<n.length;t+=1)e.put(n[t],8)}};return o},_=function(t){var r=l,n=e.stringToBytesFuncs.SJIS;if(!n)throw"sjis not supported.";!function(){var e=n("å");if(2!=e.length||38726!=(e[0]<<8|e[1]))throw"sjis not supported."}();var o=n(t),s={getMode:function(){return r},getLength:function(e){return~~(o.length/2)},write:function(e){for(var t=o,r=0;r+1<t.length;){var n=(255&t[r])<<8|255&t[r+1];if(33088<=n&&n<=40956)n-=33088;else{if(!(57408<=n&&n<=60351))throw"illegal char at "+(r+1)+"/"+n;n-=49472}n=192*(n>>>8&255)+(255&n),e.put(n,13),r+=2}if(r<t.length)throw"illegal char at "+(r+1)}};return s},I=function(){var e=[],t={writeByte:function(t){e.push(255&t)},writeShort:function(e){t.writeByte(e),t.writeByte(e>>>8)},writeBytes:function(e,r,n){r=r||0,n=n||e.length;for(var o=0;o<n;o+=1)t.writeByte(e[o+r])},writeString:function(e){for(var r=0;r<e.length;r+=1)t.writeByte(e.charCodeAt(r))},toByteArray:function(){return e},toString:function(){var t="";t+="[";for(var r=0;r<e.length;r+=1)r>0&&(t+=","),t+=e[r];return t+="]"}};return t},S=function(e){var t=e,r=0,n=0,o=0,s={read:function(){for(;o<8;){if(r>=t.length){if(0==o)return-1;throw"unexpected end of file./"+o}var e=t.charAt(r);if(r+=1,"="==e)return o=0,-1;e.match(/^\s$/)||(n=n<<6|i(e.charCodeAt(0)),o+=6)}var s=n>>>o-8&255;return o-=8,s}},i=function(e){if(65<=e&&e<=90)return e-65;if(97<=e&&e<=122)return e-97+26;if(48<=e&&e<=57)return e-48+52;if(43==e)return 62;if(47==e)return 63;throw"c:"+e};return s},x=function(e,t,r){for(var n=function(e,t){var r=e,n=t,o=new Array(e*t),s={setPixel:function(e,t,n){o[t*r+e]=n},write:function(e){e.writeString("GIF87a"),e.writeShort(r),e.writeShort(n),e.writeByte(128),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(255),e.writeByte(255),e.writeByte(255),e.writeString(","),e.writeShort(0),e.writeShort(0),e.writeShort(r),e.writeShort(n),e.writeByte(0);var t=i(2);e.writeByte(2);for(var o=0;t.length-o>255;)e.writeByte(255),e.writeBytes(t,o,255),o+=255;e.writeByte(t.length-o),e.writeBytes(t,o,t.length-o),e.writeByte(0),e.writeString(";")}},i=function(e){for(var t=1<<e,r=1+(1<<e),n=e+1,s=a(),i=0;i<t;i+=1)s.add(String.fromCharCode(i));s.add(String.fromCharCode(t)),s.add(String.fromCharCode(r));var c,l,u,d=I(),h=(c=d,l=0,u=0,{write:function(e,t){if(e>>>t!=0)throw"length over";for(;l+t>=8;)c.writeByte(255&(e<<l|u)),t-=8-l,e>>>=8-l,u=0,l=0;u|=e<<l,l+=t},flush:function(){l>0&&c.writeByte(u)}});h.write(t,n);var p=0,f=String.fromCharCode(o[p]);for(p+=1;p<o.length;){var g=String.fromCharCode(o[p]);
1017p+=1,s.contains(f+g)?f+=g:(h.write(s.indexOf(f),n),s.size()<4095&&(s.size()==1<<n&&(n+=1),s.add(f+g)),f=g)}return h.write(s.indexOf(f),n),h.write(r,n),h.flush(),d.toByteArray()},a=function(){var e={},t=0,r={add:function(n){if(r.contains(n))throw"dup key:"+n;e[n]=t,t+=1},size:function(){return t},indexOf:function(t){return e[t]},contains:function(t){return void 0!==e[t]}};return r};return s}(e,t),o=0;o<t;o+=1)for(var s=0;s<e;s+=1)n.setPixel(s,o,r(s,o));var i=I();n.write(i);for(var a=function(){var e=0,t=0,r=0,n="",o={},s=function(e){n+=String.fromCharCode(i(63&e))},i=function(e){if(e<0);else{if(e<26)return 65+e;if(e<52)return e-26+97;if(e<62)return e-52+48;if(62==e)return 43;if(63==e)return 47}throw"n:"+e};return o.writeByte=function(n){for(e=e<<8|255&n,t+=8,r+=1;t>=6;)s(e>>>t-6),t-=6},o.flush=function(){if(t>0&&(s(e<<6-t),e=0,t=0),r%3!=0)for(var o=3-r%3,i=0;i<o;i+=1)n+="="},o.toString=function(){return n},o}(),c=i.toByteArray(),l=0;l<c.length;l+=1)a.writeByte(c[l]);return a.flush(),"data:image/gif;base64,"+a};return e}(),ys.stringToBytesFuncs["UTF-8"]=function(e){return function(e){for(var t=[],r=0;r<e.length;r++){var n=e.charCodeAt(r);n<128?t.push(n):n<2048?t.push(192|n>>6,128|63&n):n<55296||n>=57344?t.push(224|n>>12,128|n>>6&63,128|63&n):(r++,n=65536+((1023&n)<<10|1023&e.charCodeAt(r)),t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return t}(e)},ms.exports=ys;const ws=bs.exports;function vs(e){return et(this,null,(function*(){try{if(!(null==navigator?void 0:navigator.clipboard))throw new Zr("Clipboard API not available");return yield navigator.clipboard.writeText(e)}catch(e){}!function(e){const t=document.createElement("textarea");t.value=e,t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy")}finally{document.body.removeChild(t)}}(e)}))}const As=dr("<div></div>"),Ts=e=>{let t,r,n;const[o,s]=gt(!1),[i,a]=gt(48);bt((()=>{const o=ws(0,"L");o.addData(e.sourceUrl),o.make(),t.innerHTML=o.createSvgTag(4,0);const s=t.firstElementChild.clientWidth,i=Math.round(256/s*1e5)/1e5;if(n){const e=4*Math.ceil(60/(4*i)),t=Yr(4*Math.ceil((s-e)/8));n.style.top=t,n.style.left=t,n.style.height=Yr(e),n.style.width=Yr(e),a(Math.round(48/i))}r.style.transform=`scale(${i})`}));let c=null;return $t(ds,{get class(){return e.class},onClick:()=>{s(!0),vs(e.sourceUrl),null!=c&&clearTimeout(c),c=setTimeout((()=>s(!1)),1500)},get children(){return[$t(hs,{ref(e){"function"==typeof r?r(e):r=e},get children(){return[(()=>{const e=As.cloneNode(!0);return"function"==typeof t?gr(t,e):t=e,e})(),$t(er,{get when(){return e.imageUrl},get children(){return $t(ps,{ref(e){"function"==typeof n?n(e):n=e},get children(){return $t(fs,{get src(){return e.imageUrl},alt:"",get size(){return i()}})}})}})]}}),$t(Io,{onBeforeEnter:e=>{Jo(e,[{opacity:0,transform:"translate(-50%, 44px)"},{opacity:1,transform:"translate(-50%, 0)"}],{duration:150,easing:"ease-out"})},onExit:(e,t)=>{Jo(e,[{opacity:1,transform:"translate(-50%, 0)"},{opacity:0,transform:"translate(-50%, 44px)"}],{duration:150,easing:"ease-out"}).finished.then((()=>{t()}))},get children(){return $t(er,{get when(){return o()&&!e.disableCopy},get children(){return $t(gs,{get children(){return[$t(Xs,{size:"xs"}),$t(Is,{translationKey:"common.linkCopied",children:"Link Copied"})]}})}})}}),$t(er,{get when(){return!e.disableCopy},get children(){return $t(us,{get children(){return $t(Mi,{})}})}})]}})};var Ps=(e,t,r)=>{const n=t.trim().split(".").reduce(((e,t)=>e?e[t]:void 0),e);return void 0!==n?n:r},Es=(e={},t=(navigator.language in e?navigator.language:Object.keys(e)[0]))=>{const[r,n]=gt(t),[o,s]=Kn(e);return[(e,t,n)=>{const s=Ps(o[r()],e,n||"");return"function"==typeof s?s(t):"string"==typeof s?((e,t,r=/{{(.*?)}}/g)=>e.replace(r,((e,r)=>Ps(t,r,""))))(s,t||{}):s},{add(e,t){s(e,(e=>Object.assign(e||{},t)))},locale:e=>e?n(e):r(),dict:e=>Ps(o,e)}]},Cs=kt({}),ks=()=>_t(Cs);const _s=zr.div` 1018 font-style: normal; 1019 font-weight: ${e=>e.fontWeight}; 1020 font-size: ${e=>e.fontSize}; 1021 line-height: ${e=>e.lineHeight}; 1022 1023 color: ${e=>e.color}; 1024`,Is=e=>{const t=Lr(),[r]=ks();let n;const o=Qt({fontSize:"14px",fontWeight:"510",lineHeight:"130%"},e);return bt((()=>{n&&"unset"!==o.cursor&&"pointer"!==getComputedStyle(n).cursor&&(n.style.cursor="default")})),$t(_s,{get fontSize(){return o.fontSize},get fontWeight(){return o.fontWeight},get lineHeight(){return o.lineHeight},get color(){return e.color||t.colors.text.primary},get class(){return o.class},ref(e){"function"==typeof n?n(e):n=e},"data-tc-text":"true",get children(){var e;return wt((()=>!!o.translationKey))()?r(o.translationKey,o.translationValues,null==(e=o.children)?void 0:e.toString()):o.children}})},Ss=zr.div` 1025 position: relative; 1026 1027 &::after { 1028 content: ''; 1029 display: block; 1030 position: absolute; 1031 top: 0; 1032 bottom: 0; 1033 left: 0; 1034 right: 0; 1035 border: 0.5px solid rgba(0, 0, 0, 0.08); 1036 border-radius: inherit; 1037 } 1038`,xs=zr(no)` 1039 width: 100%; 1040 height: 100%; 1041 border-radius: inherit;
1042`,Bs=e=>$t(Ss,{get class(){return e.class},get children(){return[$t(xs,{get src(){return e.src}}),wt((()=>e.badge))]}}),Os={m:"16px",s:"12px",none:"0"},Ms={m:"6px",s:"6px",none:"0"},Ws=zr.ul` 1043 display: flex; 1044 gap: 0; 1045 width: 100%; 1046 overflow-x: auto; 1047 padding: 8px 12px 16px 12px; 1048 margin: 0; 1049 list-style: none; 1050 flex-wrap: nowrap; 1051 1052 &&::-webkit-scrollbar { 1053 display: none; 1054 } 1055 -ms-overflow-style: none; 1056 scrollbar-width: none; 1057 1058 > li { 1059 display: flex; 1060 flex: 1; 1061 min-width: 78px; 1062 height: fit-content; 1063 } 1064 1065 > li > button { 1066 width: 100%; 1067 } 1068`,js=zr.button` 1069 position: relative; 1070 cursor: pointer; 1071 border: none; 1072 background-color: unset; 1073 padding: 8px 4px; 1074 width: 100%; 1075 min-width: 78px; 1076 display: flex; 1077 flex-direction: column; 1078 align-items: center; 1079 1080 transition: transform 0.125s ease-in-out; 1081 1082 ${Ao} { 1083 &:hover { 1084 transform: scale(1.04); 1085 } 1086 } 1087 1088 &:active { 1089 transform: scale(0.96); 1090 } 1091 1092 ${vo} { 1093 &:active { 1094 transform: scale(0.92); 1095 } 1096 } 1097`,Rs=zr(Bs)` 1098 width: 60px; 1099 height: 60px; 1100 border-radius: ${e=>Os[e.theme.borderRadius]}; 1101 margin-bottom: 8px; 1102 position: relative; 1103`,Ns=zr(no)` 1104 position: absolute; 1105 right: -6px; 1106 bottom: -6px; 1107 width: 24px; 1108 height: 24px; 1109 border-radius: ${e=>Ms[e.theme.borderRadius]}; 1110 box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.08); 1111`,Us=zr(Is)` 1112 max-width: 90px; 1113 font-weight: 510; 1114 white-space: nowrap; 1115 text-overflow: ellipsis; 1116 overflow: hidden; 1117 1118 ${wo("mobile")} { 1119 max-width: 80px; 1120 } 1121`,Ds=zr(Is)` 1122 font-weight: ${e=>e.colorPrimary?"510":"400"}; 1123 max-width: 90px; 1124 white-space: nowrap; 1125 text-overflow: ellipsis; 1126 overflow: hidden; 1127 color: ${e=>e.colorPrimary?e.theme.colors.text.primary:e.theme.colors.text.secondary}; 1128 1129 ${wo("mobile")} { 1130 max-width: 80px; 1131 } 1132`,Ls=dr("<div></div>"),Fs=e=>{let t=null;const r=()=>{const e=null==t?void 0:t.querySelector("div");if(e&&e.scrollWidth>e.clientWidth){let t=0;const r=-.4,n=.05;for(;e.scrollWidth>e.clientWidth&&t>=r;)t-=n,e.style.letterSpacing=`${t}px`;0!==t&&(t-=n,e.style.letterSpacing=`${t}px`)}};return Pt((()=>r())),bt((()=>{r()})),$t(js,{get class(){return e.class},onClick:()=>e.onClick(),"data-tc-wallet-item":"true",get children(){return[wt((()=>wt((()=>"string"==typeof e.icon))()?$t(Rs,{get src(){return e.icon},get badge(){return wt((()=>!!e.badgeUrl))()&&$t(Ns,{get src(){return e.badgeUrl}})}}):e.icon)),(()=>{const r=Ls.cloneNode(!0);return gr((e=>t=e),r),mr(r,$t(Us,{get children(){return e.name}})),r})(),wt((()=>wt((()=>!!e.secondLine))()&&$t(Ds,{get colorPrimary(){var t;return null==(t=e.secondLineColorPrimary)||t},get children(){return e.secondLine}})))]}})},zs=zr.h1` 1133 font-style: normal; 1134 font-weight: 590; 1135 font-size: 20px; 1136 line-height: 28px; 1137 1138 text-align: center; 1139 1140 color: ${e=>e.theme.colors.text.primary}; 1141 1142 margin-top: 0; 1143 margin-bottom: 0; 1144 1145 cursor: default; 1146`,Vs=e=>{const[t]=ks();return $t(zs,{get class(){return e.class},"data-tc-h1":"true",get children(){var r;return wt((()=>!!e.translationKey))()?t(e.translationKey,e.translationValues,null==(r=e.children)?void 0:r.toString()):e.children}})},qs=zr.h2` 1147 font-style: normal; 1148 font-weight: 400; 1149 font-size: 16px; 1150 line-height: 22px; 1151 1152 text-align: center; 1153 1154 color: ${e=>e.theme.colors.text.secondary}; 1155 1156 margin-top: 0; 1157 margin-bottom: 32px; 1158 1159 cursor: default; 1160`,Hs=e=>{const[t]=ks();return $t(qs,{get class(){return e.class},"data-tc-h2":"true",get children(){var r;return wt((()=>!!e.translationKey))()?t(e.translationKey,e.translationValues,null==(r=e.children)?void 0:r.toString()):e.children}})},Ks=zr.h3` 1161 font-style: normal; 1162 font-weight: 510; 1163 font-size: 16px; 1164 line-height: 20px; 1165 1166 color: ${e=>e.theme.colors.text.primary}; 1167 1168 margin-top: 0; 1169 margin-bottom: 0; 1170 1171 cursor: default; 1172`,$s=e=>{const[t]=ks();return $t(Ks,{"data-tc-h3":"true",get class(){return e.class},get children(){var r;return wt((()=>!!e.translationKey))()?t(e.translationKey,e.translationValues,null==(r=e.children)?void 0:r.toString()):e.children}})},Gs=dr('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M14.1839 17.7069C13.6405 18.6507 13.3688 19.1226 13.0591 19.348C12.4278 19.8074 11.5723 19.8074 10.941 19.348C10.6312 19.1226 10.3595 18.6507 9.81613 17.7069L5.52066 10.2464C4.76864 8.94024 4.39263 8.28717 4.33762 7.75894C4.2255 6.68236 4.81894 5.65591 5.80788 5.21589C6.29309 5 7.04667 5 8.55383 5
1172H15.4462C16.9534 5 17.7069 5 18.1922 5.21589C19.1811 5.65591 19.7745 6.68236 19.6624 7.75894C19.6074 8.28717 19.2314 8.94024 18.4794 10.2464L14.1839 17.7069ZM11.1 16.3412L6.56139 8.48002C6.31995 8.06185 6.19924 7.85276 6.18146 7.68365C6.14523 7.33896 6.33507 7.01015 6.65169 6.86919C6.80703 6.80002 7.04847 6.80002 7.53133 6.80002H7.53134L11.1 6.80002V16.3412ZM12.9 16.3412L17.4387 8.48002C17.6801 8.06185 17.8008 7.85276 17.8186 7.68365C17.8548 7.33896 17.665 7.01015 17.3484 6.86919C17.193 6.80002 16.9516 6.80002 16.4687 6.80002L12.9 6.80002V16.3412Z"></path></svg>'),Ys=e=>{const t=Lr();return(()=>{const r=Gs.cloneNode(!0),n=r.firstChild;return yt((()=>hr(n,"fill",e.fill||t.colors.icon.primary))),r})()},Js=dr('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"><g clip-path="url(#clip0_3783_2045)"><circle cx="8" cy="8.00098" r="8"></circle><path d="M4.75 8.50098L7 10.751L11.75 6.00098" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></g><defs><clipPath id="clip0_3783_2045"><rect width="16" height="16" fill="white" transform="translate(0 0.000976562)"></rect></clipPath></defs></svg>'),Qs=dr('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="11"></circle><path d="M17.1364 9.6364C17.4879 9.28493 17.4879 8.71508 17.1364 8.36361C16.7849 8.01214 16.2151 8.01214 15.8636 8.36361L10 14.2272L8.1364 12.3636C7.78493 12.0121 7.21508 12.0121 6.86361 12.3636C6.51214 12.7151 6.51214 13.2849 6.86361 13.6364L9.36361 16.1364C9.71508 16.4879 10.2849 16.4879 10.6364 16.1364L17.1364 9.6364Z"></path></svg>'),Zs=dr('<svg width="72" height="72" viewBox="0 0 72 72" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="36" cy="36" r="33"></circle><path d="M50.9142 28.4142C51.6953 27.6332 51.6953 26.3668 50.9142 25.5858C50.1332 24.8047 48.8668 24.8047 48.0858 25.5858L30 43.6716L23.9142 37.5858C23.1332 36.8047 21.8668 36.8047 21.0858 37.5858C20.3047 38.3668 20.3047 39.6332 21.0858 40.4142L28.5858 47.9142C29.3668 48.6953 30.6332 48.6953 31.4142 47.9142L50.9142 28.4142Z"></path></svg>'),Xs=e=>{const t=Lr(),r=()=>e.size||"s",n=()=>e.fill||t.colors.icon.success;return wt((()=>{const o=wt((()=>"xs"===r()));return()=>o()?(()=>{const r=Js.cloneNode(!0),o=r.firstChild.firstChild,s=o.nextSibling;return yt((i=>{const a=e.class,c=n(),l=t.colors.constant.white;return a!==i._v$&&hr(r,"class",i._v$=a),c!==i._v$2&&hr(o,"fill",i._v$2=c),l!==i._v$3&&hr(s,"stroke",i._v$3=l),i}),{_v$:void 0,_v$2:void 0,_v$3:void 0}),r})():(()=>{const o=wt((()=>"s"===r()));return()=>o()?(()=>{const r=Qs.cloneNode(!0),o=r.firstChild,s=o.nextSibling;return yt((i=>{const a=e.class,c=n(),l=t.colors.constant.white;return a!==i._v$4&&hr(r,"class",i._v$4=a),c!==i._v$5&&hr(o,"fill",i._v$5=c),l!==i._v$6&&hr(s,"fill",i._v$6=l),i}),{_v$4:void 0,_v$5:void 0,_v$6:void 0}),r})():(()=>{const r=Zs.cloneNode(!0),o=r.firstChild,s=o.nextSibling;return yt((i=>{const a=e.class,c=n(),l=t.colors.constant.white;return a!==i._v$7&&hr(r,"class",i._v$7=a),c!==i._v$8&&hr(o,"fill",i._v$8=c),l!==i._v$9&&hr(s,"fill",i._v$9=l),i}),{_v$7:void 0,_v$8:void 0,_v$9:void 0}),r})()})()})())},ei=dr('<svg width="72" height="72" viewBox="0 0 72 72" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="36" cy="36" r="33"></circle><path d="M24.0858 26.9142C23.3047 26.1332 23.3047 24.8668 24.0858 24.0858C24.8668 23.3047 26.1332 23.3047 26.9142 24.0858L36 33.1716L45.0858 24.0858C45.8668 23.3047 47.1332 23.3047 47.9142 24.0858C48.6953 24.8668 48.6953 26.1332 47.9142 26.9142L38.8284 36L47.9142 45.0858C48.6953 45.8668 48.6953 47.1332 47.9142 47.9142C47.1332 48.6953 45.8668 48.6953 45.0858 47.9142L36 38.8284L26.9142 47.9142C26.1332 48.6953 24.8668 48.6953 24.0858 47.9142C23.3047 47.1332 23.3047 45.8668 24.0858 45.0858L33.1716 36L24.0858 26.9142Z"></path></svg>'),ti=dr('<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="none"><circle cx="24" cy="24.001" r="22"></circle><path d="M24 24.001L31.5 16.501M24 24.001L16.5 16.501M24 24.001L16.5 31.501M24 24.001L31.5 31.501" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"></path></svg>'),ri=dr('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="11"></circle><path d="M7.86361 9.1364C7.51214 8.78493 7.51214 8.21508 7.86361 7.86361C8.21508 7.51214 8.78493 7.51214 9.1364 7.86361L12 10.7272L14.8636 7.86361C15.2151 7.51214 15.7849 7.51214 16.1364 7.86361C16.4879 8.21508 16.4879 8.78493 16.1364 9.1364L13.2728 12L16.1364 14.8636C16.4879 15.2151 16.4879 15.7849 16.1364 16.1364C15.7849 16.4879 15.2151 16.4879 14.8636 16.1364L12 13.2728L9.1364 16.1364C8.78493 16.4879 8.21508 16.4879 7.86361 16.
11721364C7.51214 15.7849 7.51214 15.2151 7.86361 14.8636L10.7272 12L7.86361 9.1364Z"></path></svg>'),ni=e=>{const t=Lr(),r=()=>e.size||"m",n=()=>e.fill||t.colors.icon.error;return wt((()=>{const o=wt((()=>"m"===r()));return()=>o()?(()=>{const r=ei.cloneNode(!0),o=r.firstChild,s=o.nextSibling;return yt((i=>{const a=e.class,c=n(),l=t.colors.constant.white;return a!==i._v$&&hr(r,"class",i._v$=a),c!==i._v$2&&hr(o,"fill",i._v$2=c),l!==i._v$3&&hr(s,"fill",i._v$3=l),i}),{_v$:void 0,_v$2:void 0,_v$3:void 0}),r})():(()=>{const o=wt((()=>"s"===r()));return()=>o()?(()=>{const r=ti.cloneNode(!0),o=r.firstChild,s=o.nextSibling;return yt((i=>{const a=e.class,c=n(),l=t.colors.constant.white;return a!==i._v$4&&hr(r,"class",i._v$4=a),c!==i._v$5&&hr(o,"fill",i._v$5=c),l!==i._v$6&&hr(s,"stroke",i._v$6=l),i}),{_v$4:void 0,_v$5:void 0,_v$6:void 0}),r})():(()=>{const r=ri.cloneNode(!0),o=r.firstChild,s=o.nextSibling;return yt((i=>{const a=e.class,c=n(),l=t.colors.constant.white;return a!==i._v$7&&hr(r,"class",i._v$7=a),c!==i._v$8&&hr(o,"fill",i._v$8=c),l!==i._v$9&&hr(s,"fill",i._v$9=l),i}),{_v$7:void 0,_v$8:void 0,_v$9:void 0}),r})()})()})())},oi=dr('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.55 5.85123C18.9459 7.81184 20.1094 12.1541 18.1488 15.55C16.1882 18.9459 11.8459 20.1094 8.44998 18.1488C8.01952 17.9003 7.46909 18.0478 7.22056 18.4782C6.97203 18.9087 7.11952 19.4591 7.54998 19.7076C11.8068 22.1653 17.2499 20.7068 19.7076 16.45C22.1653 12.1932 20.7068 6.75005 16.45 4.29239C12.1932 1.83472 6.75003 3.29321 4.29236 7.55001C4.04383 7.98047 4.19132 8.53091 4.62178 8.77943C5.05224 9.02796 5.60268 8.88048 5.8512 8.45001C7.81181 5.05413 12.1541 3.89062 15.55 5.85123Z"></path></svg>'),si=dr('<svg xmlns="http://www.w3.org/2000/svg" width="44" height="44" viewBox="0 0 44 44" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M22 2.99951C11.5066 2.99951 3 11.5061 3 21.9995C3 32.4929 11.5066 40.9995 22 40.9995C22.8284 40.9995 23.5 41.6711 23.5 42.4995C23.5 43.3279 22.8284 43.9995 22 43.9995C9.84974 43.9995 0 34.1498 0 21.9995C0 9.84925 9.84974 -0.000488281 22 -0.000488281C34.1503 -0.000488281 44 9.84925 44 21.9995C44 22.8279 43.3284 23.4995 42.5 23.4995C41.6716 23.4995 41 22.8279 41 21.9995C41 11.5061 32.4934 2.99951 22 2.99951Z"></path></svg>'),ii=dr('<svg width="72" height="72" viewBox="0 0 72 72" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M24 56.7846C35.479 63.412 50.1572 59.479 56.7846 47.9999C63.412 36.5209 59.479 21.8427 48 15.2153C36.521 8.58791 21.8428 12.5209 15.2154 23.9999" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"></path></svg>'),ai=e=>{const t=Lr(),r=()=>e.size||"xs",n=()=>e.fill||t.colors.icon.tertiary,o=Rr` 1173 animation: ${Nr` 1174 0% { 1175 transform: rotate(0deg); 1176 } 1177 100% { 1178 transform: rotate(360deg); 1179 } 1180 `} 1s linear infinite; 1181 `;return wt((()=>{const t=wt((()=>"xs"===r()));return()=>t()?(()=>{const t=oi.cloneNode(!0),r=t.firstChild;return yt((s=>{const i=ze(o,e.class),a=n();return i!==s._v$&&hr(t,"class",s._v$=i),a!==s._v$2&&hr(r,"fill",s._v$2=a),s}),{_v$:void 0,_v$2:void 0}),t})():(()=>{const t=wt((()=>"s"===r()));return()=>t()?(()=>{const t=si.cloneNode(!0),r=t.firstChild;return yt((s=>{const i=ze(o,e.class),a=n();return i!==s._v$3&&hr(t,"class",s._v$3=i),a!==s._v$4&&hr(r,"fill",s._v$4=a),s}),{_v$3:void 0,_v$4:void 0}),t})():(()=>{const t=ii.cloneNode(!0),r=t.firstChild;return yt((s=>{const i=ze(o,e.class),a=n();return i!==s._v$5&&hr(t,"class",s._v$5=i),a!==s._v$6&&hr(r,"stroke",s._v$6=a),s}),{_v$5:void 0,_v$6:void 0}),t})()})()})())},ci=dr('<svg width="158" height="28" viewBox="0 0 158 28" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M28 14.001C28 21.733 21.732 28.001 14 28.001C6.26801 28.001 0 21.733 0 14.001C0 6.26899 6.26801 0.000976562 14 0.000976562C21.732 0.000976562 28 6.26899 28 14.001ZM9.21931 8.00098H18.7801H18.7813C20.538 8.00098 21.6522 9.89966 20.7691 11.4302L14.8672 21.6576C14.4822 22.3254 13.5172 22.3254 13.1322 21.6576L7.23158 11.4302C6.34721 9.89726 7.4614 8.00098 9.21931 8.00098ZM13.1262 18.5882V9.74806H9.21811C8.78976 9.74806 8.53708 10.2029 8.74163 10.5578L11.8423 16.1035L13.1262 18.5882ZM16.1559 16.1047L19.2554 10.5566C19.4599 10.2017 19.2073 9.74685 18.7789 9.74685H14.8709V18.5906L16.1559 16.1047Z" fill="#0098EA"></path><path d="M18.7802 8.00098H9.21936C7.46145 8.00098 6.34727 9.89726 7.23164 11.4302L13.1322 21.6576C13.5173 22.3254 14.4823 22.3254 14.8673 21.6576L20.7691 11.4302C21.6523 9.89966 20.5381 8.00098 18.7814 8.00098H18.7802ZM13.1274 18.5906L11.8424 16.1035L8.74168 10.5578C8.53714 10.2029 8.78981 9.74806 9.21816 9.74806H13.1262V18.5918L13.1274 18.5906ZM19.2555 10.5566L16.156 16.
11811047L14.8709 18.5906V9.74685H18.779C19.2073 9.74685 19.46 10.2017 19.2555 10.5566Z" fill="white"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M51.7483 22.1967C55.7182 22.1967 58.9609 18.954 58.9609 14.9841C58.9609 11.0142 55.7182 7.77148 51.7483 7.77148C47.7588 7.77148 44.5357 11.0142 44.5357 14.9841C44.5357 18.954 47.7588 22.1967 51.7483 22.1967ZM51.7483 19.1702C49.4686 19.1702 47.6802 17.2442 47.6802 14.9841C47.6802 12.724 49.4686 10.798 51.7483 10.798C54.0084 10.798 55.7968 12.724 55.7968 14.9841C55.7968 17.2442 54.0084 19.1702 51.7483 19.1702ZM37.0698 21.9609H40.2142V10.9946H44.2843V8.00732H33V10.9946H37.0698V21.9609ZM69.9379 8.00732H73.0823V21.9609H70.3899L63.59 13.3333V21.9609H60.4652V8.00732H63.1576L69.9379 16.6153V8.00732ZM79.2259 14.9887C79.2259 10.9202 82.351 7.77539 86.4982 7.77539C89.8592 7.77539 92.5519 9.95709 93.2202 12.6891H90.7437C90.154 11.0971 88.4637 9.9964 86.4982 9.9964C83.5893 9.9964 81.5452 12.1781 81.5452 14.9887C81.5452 17.7994 83.5893 19.9811 86.4982 19.9811C88.4637 19.9811 90.154 18.8804 90.7437 17.2884H93.2202C92.5519 20.0204 89.8592 22.2021 86.4982 22.2021C82.351 22.2021 79.2259 19.0573 79.2259 14.9887ZM104.584 17.0525C104.584 19.9025 102.343 22.1628 99.4342 22.1628C96.5253 22.1628 94.2846 19.9025 94.2846 17.0525C94.2846 14.2025 96.5253 11.9422 99.4342 11.9422C102.343 11.9422 104.584 14.2025 104.584 17.0525ZM96.4663 17.0525C96.4663 18.8018 97.6849 20.158 99.4342 20.158C101.164 20.158 102.382 18.8018 102.382 17.0525C102.382 15.3032 101.164 13.947 99.4342 13.947C97.6849 13.947 96.4663 15.3032 96.4663 17.0525ZM108.626 12.1388H106.463V21.9662H108.626V17.1311C108.626 15.0281 109.726 13.9077 111.161 13.9077C112.419 13.9077 113.205 14.8512 113.205 16.4039V21.9662H115.367V16.0501C115.367 13.5539 113.893 11.9422 111.613 11.9422C110.335 11.9422 109.215 12.4926 108.626 13.4753V12.1388ZM117.839 12.1388H120.001V13.4753C120.59 12.4926 121.711 11.9422 122.988 11.9422C125.268 11.9422 126.742 13.5539 126.742 16.0501V21.9662H124.58V16.4039C124.58 14.8512 123.794 13.9077 122.536 13.9077C121.101 13.9077 120.001 15.0281 120.001 17.1311V21.9662H117.839V12.1388ZM133.558 22.1628C136.054 22.1628 137.823 20.728 138.373 18.8804H136.113C135.661 19.8238 134.717 20.2563 133.636 20.2563C131.887 20.2563 130.747 19.077 130.668 17.5832H138.491C138.688 14.2419 136.585 11.9422 133.577 11.9422C130.551 11.9422 128.526 14.1436 128.526 17.0525C128.526 20.0007 130.629 22.1628 133.558 22.1628ZM130.747 16.0501C131.042 14.5367 132.162 13.7505 133.518 13.7505C134.717 13.7505 135.838 14.4581 136.172 16.0501H130.747ZM149.851 18.3694C149.32 20.5511 147.453 22.1628 144.859 22.1628C141.871 22.1628 139.709 19.8828 139.709 17.0525C139.709 14.2222 141.871 11.9422 144.859 11.9422C147.453 11.9422 149.32 13.5539 149.851 15.7356H147.571C147.178 14.6743 146.215 13.9077 144.859 13.9077C143.109 13.9077 141.91 15.2246 141.91 17.0525C141.91 18.8804 143.109 20.1973 144.859 20.1973C146.215 20.1973 147.178 19.4307 147.571 18.3694H149.851ZM155.75 22.0645C156.418 22.0645 156.929 21.9859 157.362 21.8483V19.9221C157.047 20.0401 156.615 20.1187 156.202 20.1187C155.082 20.1187 154.551 19.6666 154.551 18.448V14.065H157.362V12.1388H154.551V9.40675H152.389V12.1388H150.345V14.065H152.389V18.8018C152.389 21.0228 153.863 22.0645 155.75 22.0645Z"></path></svg>'),li=()=>{const e=Lr();return(()=>{const t=ci.cloneNode(!0),r=t.firstChild.nextSibling.nextSibling;return yt((()=>hr(r,"fill",e.theme===Ir.DARK?e.colors.constant.white:e.colors.constant.black))),t})()},ui=dr('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M5.56608 4.42584C5.82527 3.32158 6.8176 2.5 8.00001 2.5C9.38072 2.5 10.5 3.61929 10.5 5C10.5 5.63026 10.3391 6.0386 10.1264 6.34455C9.90018 6.66993 9.58561 6.92478 9.18864 7.20877C9.12579 7.25372 9.05873 7.30025 8.9887 7.34883C8.27392 7.84472 7.25001 8.55507 7.25001 10V10.25C7.25001 10.6642 7.5858 11 8.00001 11C8.41422 11 8.75001 10.6642 8.75001 10.25V10C8.75001 9.36502 9.10777 9.1096 9.94554 8.51149L10.0614 8.42873C10.4769 8.13147 10.9748 7.75194 11.358 7.20076C11.7547 6.63015 12 5.91973 12 5C12 2.79086 10.2091 1 8.00001 1C6.10564 1 4.5205 2.31615 4.10577 4.08308C4.01112 4.48634 4.26129 4.88997 4.66454 4.98462C5.0678 5.07927 5.47143 4.8291 5.56608 4.42584ZM8.00001 15C8.60752 15 9.10001 14.5075 9.10001 13.9C9.10001 13.2925 8.60752 12.8 8.00001 12.8C7.39249 12.8 6.90001 13.2925 6.90001 13.9C6.90001 14.5075 7.39249 15 8.00001 15Z"></path></svg>'),di=e=>{const t=Lr();return(()=>{const r=ui.cloneNode(!0),n=r.firstChild;return yt((()=>hr(n,"fill",e.fill||t.colors.icon.secondary))),r})()},hi=dr('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewB
1181ox="0 0 16 16" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.98156 8.75C9.84854 11.4328 9.01206 13.5 8 13.5C6.98794 13.5 6.15146 11.4328 6.01844 8.75H9.98156ZM11.4832 8.75C11.4217 10.1155 11.1929 11.3869 10.8239 12.4017C10.7734 12.5405 10.7188 12.6789 10.6595 12.8154C12.1454 11.993 13.2103 10.5029 13.4493 8.75H11.4832ZM13.4493 7.25H11.4832C11.4217 5.88453 11.1929 4.61314 10.8239 3.5983C10.7734 3.4595 10.7188 3.32111 10.6595 3.18459C12.1454 4.00697 13.2103 5.49709 13.4493 7.25ZM9.98156 7.25H6.01844C6.15144 4.56764 6.98769 2.50062 7.99955 2.5H8C9.01206 2.5 9.84854 4.56724 9.98156 7.25ZM4.51678 7.25C4.57826 5.88453 4.80706 4.61314 5.1761 3.5983C5.22657 3.4595 5.28124 3.32111 5.3405 3.18459C3.85463 4.00697 2.78972 5.49709 2.55071 7.25H4.51678ZM2.55071 8.75C2.78972 10.5029 3.85463 11.993 5.3405 12.8154C5.28124 12.6789 5.22657 12.5405 5.1761 12.4017C4.80706 11.3869 4.57826 10.1155 4.51678 8.75H2.55071ZM15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8Z"></path></svg>'),pi=e=>{const t=Lr();return(()=>{const r=hi.cloneNode(!0),n=r.firstChild;return yt((()=>hr(n,"fill",e.fill||t.colors.icon.primary))),r})()},fi=dr('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.5 4.8C2.5 3.11984 2.5 2.27976 2.82698 1.63803C3.1146 1.07354 3.57354 0.614601 4.13803 0.32698C4.77976 0 5.61984 0 7.3 0H8.7C10.3802 0 11.2202 0 11.862 0.32698C12.4265 0.614601 12.8854 1.07354 13.173 1.63803C13.5 2.27976 13.5 3.11984 13.5 4.8V11.2C13.5 12.8802 13.5 13.7202 13.173 14.362C12.8854 14.9265 12.4265 15.3854 11.862 15.673C11.2202 16 10.3802 16 8.7 16H7.3C5.61984 16 4.77976 16 4.13803 15.673C3.57354 15.3854 3.1146 14.9265 2.82698 14.362C2.5 13.7202 2.5 12.8802 2.5 11.2V4.8ZM4 3.9C4 3.05992 4 2.63988 4.16349 2.31901C4.3073 2.03677 4.53677 1.8073 4.81901 1.66349C5.13988 1.5 5.55992 1.5 6.4 1.5H9.6C10.4401 1.5 10.8601 1.5 11.181 1.66349C11.4632 1.8073 11.6927 2.03677 11.8365 2.31901C12 2.63988 12 3.05992 12 3.9V12.1C12 12.9401 12 13.3601 11.8365 13.681C11.6927 13.9632 11.4632 14.1927 11.181 14.3365C10.8601 14.5 10.4401 14.5 9.6 14.5H6.4C5.55992 14.5 5.13988 14.5 4.81901 14.3365C4.53677 14.1927 4.3073 13.9632 4.16349 13.681C4 13.3601 4 12.9401 4 12.1V3.9ZM7 2.5C6.58579 2.5 6.25 2.83579 6.25 3.25C6.25 3.66421 6.58579 4 7 4H9C9.41421 4 9.75 3.66421 9.75 3.25C9.75 2.83579 9.41421 2.5 9 2.5H7Z"></path></svg>'),gi=e=>{const t=Lr();return(()=>{const r=fi.cloneNode(!0),n=r.firstChild;return yt((()=>hr(n,"fill",e.fill||t.colors.icon.primary))),r})()},mi=dr('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 6.8C1.5 5.11984 1.5 4.27976 1.82698 3.63803C2.1146 3.07354 2.57354 2.6146 3.13803 2.32698C3.77976 2 4.61984 2 6.3 2H9.7C11.3802 2 12.2202 2 12.862 2.32698C13.4265 2.6146 13.8854 3.07354 14.173 3.63803C14.5 4.27976 14.5 5.11984 14.5 6.8V11.5H15.25C15.6642 11.5 16 11.8358 16 12.25C16 12.6642 15.6642 13 15.25 13H0.75C0.335786 13 0 12.6642 0 12.25C0 11.8358 0.335786 11.5 0.75 11.5H1.5V6.8ZM3 11.5H13V5.9C13 5.05992 13 4.63988 12.8365 4.31901C12.6927 4.03677 12.4632 3.8073 12.181 3.66349C11.8601 3.5 11.4401 3.5 10.6 3.5H5.4C4.55992 3.5 4.13988 3.5 3.81901 3.66349C3.53677 3.8073 3.3073 4.03677 3.16349 4.31901C3 4.63988 3 5.05992 3 5.9V11.5Z"></path></svg>'),yi=e=>{const t=Lr();return(()=>{const r=mi.cloneNode(!0),n=r.firstChild;return yt((()=>hr(n,"fill",e.fill||t.colors.icon.primary))),r})()},bi=dr('<svg xmlns="http://www.w3.org/2000/svg" width="17" height="16" viewBox="0 0 17 16" fill="none"><g clip-path="url(#clip0_3676_1603)"><path fill-rule="evenodd" clip-rule="evenodd" d="M15.5 1.25049C15.5 0.836275 15.1642 0.500488 14.75 0.500488C14.3358 0.500488 14 0.836275 14 1.25049V3.67012C12.7187 2.04487 10.7318 1.00049 8.5 1.00049C4.63401 1.00049 1.5 4.1345 1.5 8.00049C1.5 11.8665 4.63401 15.0005 8.5 15.0005C11.6844 15.0005 14.3703 12.8748 15.2199 9.96661C15.3361 9.56902 15.1079 9.15254 14.7103 9.03638C14.3127 8.92023 13.8962 9.14838 13.7801 9.54597C13.1123 11.8319 11 13.5005 8.5 13.5005C5.46243 13.5005 3 11.0381 3 8.00049C3 4.96292 5.46243 2.50049 8.5 2.50049C10.321 2.50049 11.9363 3.3855 12.9377 4.75049H10.5C10.0858 4.75049 9.75 5.08627 9.75 5.50049C9.75 5.9147 10.0858 6.25049 10.5 6.25049H14.75C15.1642 6.25049 15.5 5.9147 15.5 5.50049V1.25049Z"></path></g><defs><clipPath id="clip0_3676_1603"><rect width="16" height="16" fill="white" transform="translate(0.5 0.000488281)"></rect></clipPath></defs></svg>'),wi=e=>{const t=Lr();return(()=>{const r=bi.cloneNode(!0),n=r.firstChild.firstChild;return yt((()=>hr(n,"fill",e.fill||t.colors.accent))),r})()},vi=dr('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewB
1181ox="0 0 16 16" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M13 4.06119V6.75053C13 7.16474 13.3358 7.50053 13.75 7.50053C14.1642 7.50053 14.5 7.16474 14.5 6.75053V2.75053L14.5 2.72807C14.5001 2.63191 14.5003 2.49627 14.4842 2.37627C14.4638 2.22503 14.4063 1.99261 14.2071 1.79342C14.0079 1.59423 13.7755 1.5367 13.6243 1.51637C13.5043 1.50023 13.3686 1.50039 13.2725 1.50051L13.25 1.50053H9.25C8.83579 1.50053 8.5 1.83631 8.5 2.25053C8.5 2.66474 8.83579 3.00053 9.25 3.00053H11.9393L7.21967 7.7202C6.92678 8.01309 6.92678 8.48796 7.21967 8.78086C7.51256 9.07375 7.98744 9.07375 8.28033 8.78086L13 4.06119ZM5.85 1.50053H5.81903H5.81899C5.21528 1.50052 4.71702 1.50051 4.31113 1.53367C3.88956 1.56812 3.50203 1.64204 3.13803 1.82751C2.57354 2.11513 2.1146 2.57407 1.82698 3.13856C1.64151 3.50256 1.56759 3.89009 1.53315 4.31166C1.49998 4.71755 1.49999 5.21581 1.5 5.81953V5.81955V5.85053V10.1505V10.1815V10.1815C1.49999 10.7852 1.49998 11.2835 1.53315 11.6894C1.56759 12.111 1.64151 12.4985 1.82698 12.8625C2.1146 13.427 2.57354 13.8859 3.13803 14.1735C3.50203 14.359 3.88956 14.4329 4.31113 14.4674C4.71702 14.5005 5.21527 14.5005 5.81897 14.5005H5.81901H5.85H10.15H10.181H10.181C10.7847 14.5005 11.283 14.5005 11.6889 14.4674C12.1104 14.4329 12.498 14.359 12.862 14.1735C13.4265 13.8859 13.8854 13.427 14.173 12.8625C14.3585 12.4985 14.4324 12.111 14.4669 11.6894C14.5 11.2835 14.5 10.7853 14.5 10.1816V10.1815V10.1505V9.75053C14.5 9.33631 14.1642 9.00053 13.75 9.00053C13.3358 9.00053 13 9.33631 13 9.75053V10.1505C13 10.793 12.9994 11.2297 12.9718 11.5672C12.945 11.8961 12.8963 12.0642 12.8365 12.1815C12.6927 12.4638 12.4632 12.6932 12.181 12.837C12.0637 12.8968 11.8955 12.9455 11.5667 12.9724C11.2292 12.9999 10.7924 13.0005 10.15 13.0005H5.85C5.20757 13.0005 4.77085 12.9999 4.43328 12.9724C4.10447 12.9455 3.93632 12.8968 3.81902 12.837C3.53677 12.6932 3.3073 12.4638 3.16349 12.1815C3.10372 12.0642 3.05503 11.8961 3.02816 11.5672C3.00058 11.2297 3 10.793 3 10.1505V5.85053C3 5.20809 3.00058 4.77137 3.02816 4.43381C3.05503 4.10499 3.10372 3.93684 3.16349 3.81954C3.3073 3.5373 3.53677 3.30783 3.81902 3.16402C3.93632 3.10425 4.10447 3.05556 4.43328 3.02869C4.77085 3.00111 5.20757 3.00053 5.85 3.00053H6.25C6.66422 3.00053 7 2.66474 7 2.25053C7 1.83631 6.66422 1.50053 6.25 1.50053H5.85Z"></path></svg>'),Ai=e=>{const t=Lr();return(()=>{const r=vi.cloneNode(!0),n=r.firstChild;return yt((()=>hr(n,"fill",e.fill||t.colors.accent))),r})()},Ti=dr('<svg xmlns="http://www.w3.org/2000/svg" width="17" height="16" viewBox="0 0 17 16" fill="none"><g clip-path="url(#clip0_3676_1274)"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.82698 2.63901C1.5 3.28074 1.5 4.12082 1.5 5.80098V8.80098V9.00098V10.201C1.5 11.8811 1.5 12.7212 1.82698 13.3629C2.1146 13.9274 2.57354 14.3864 3.13803 14.674C3.77976 15.001 4.61984 15.001 6.3 15.001H11.7C13.3802 15.001 14.2202 15.001 14.862 14.674C15.4265 14.3864 15.8854 13.9274 16.173 13.3629C16.5 12.7212 16.5 11.8811 16.5 10.201V8.80098C16.5 7.12082 16.5 6.28074 16.173 5.63901C15.8854 5.07452 15.4265 4.61558 14.862 4.32796C14.743 4.26733 14.6172 4.21795 14.4805 4.17772C14.4501 3.49449 14.3722 3.02994 14.173 2.63901C13.8854 2.07452 13.4265 1.61558 12.862 1.32796C12.2202 1.00098 11.3802 1.00098 9.7 1.00098H6.3C4.61984 1.00098 3.77976 1.00098 3.13803 1.32796C2.57354 1.61558 2.1146 2.07452 1.82698 2.63901ZM12.9861 4.00942C12.9684 3.7108 12.9281 3.49982 12.8365 3.31999C12.6927 3.03775 12.4632 2.80828 12.181 2.66447C11.8601 2.50098 11.4401 2.50098 10.6 2.50098H5.4C4.55992 2.50098 4.13988 2.50098 3.81901 2.66447C3.53677 2.80828 3.3073 3.03775 3.16349 3.31999C3.03615 3.56991 3.00799 3.88 3.00177 4.40188C3.04646 4.37612 3.09189 4.35146 3.13803 4.32796C3.77976 4.00098 4.61984 4.00098 6.3 4.00098H11.7C12.1966 4.00098 12.6197 4.00098 12.9861 4.00942ZM3 7.90098V8.10098C3 8.47468 3 8.76527 3.01439 9.00098H3V11.101C3 11.9411 3 12.3611 3.16349 12.682C3.3073 12.9642 3.53677 13.1937 3.81901 13.3375C4.13988 13.501 4.55992 13.501 5.4 13.501H12.6C13.4401 13.501 13.8601 13.501 14.181 13.3375C14.4632 13.1937 14.6927 12.9642 14.8365 12.682C15 12.3611 15 11.9411 15 11.
1181101V7.90098C15 7.0609 15 6.64086 14.8365 6.31999C14.6927 6.03775 14.4632 5.80828 14.181 5.66447C13.8601 5.50098 13.4401 5.50098 12.6 5.50098H5.4C4.55992 5.50098 4.13988 5.50098 3.81901 5.66447C3.53677 5.80828 3.3073 6.03775 3.16349 6.31999C3 6.64086 3 7.0609 3 7.90098ZM10.5 9.75098C10.5 9.33676 10.8358 9.00098 11.25 9.00098H12.75C13.1642 9.00098 13.5 9.33676 13.5 9.75098C13.5 10.1652 13.1642 10.501 12.75 10.501H11.25C10.8358 10.501 10.5 10.1652 10.5 9.75098Z"></path></g><defs><clipPath id="clip0_3676_1274"><rect width="16" height="16" fill="white" transform="translate(0.5 0.000976562)"></rect></clipPath></defs></svg>'),Pi=e=>{const t=Lr();return(()=>{const r=Ti.cloneNode(!0),n=r.firstChild.firstChild;return yt((()=>hr(n,"fill",e.fill||t.colors.accent))),r})()},Ei=dr('<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M39.6319 16.8719C38.3212 16.2041 36.7002 16.0478 34 16.0112V11C34 5.47715 29.5228 1 24 1C18.4772 1 14 5.47715 14 11V16.0112C11.2998 16.0478 9.6788 16.2041 8.36808 16.8719C6.86278 17.6389 5.63893 18.8628 4.87195 20.3681C4 22.0794 4 24.3196 4 28.8V32.2C4 36.6804 4 38.9206 4.87195 40.6319C5.63893 42.1372 6.86278 43.3611 8.36808 44.1281C10.0794 45 12.3196 45 16.8 45H31.2C35.6804 45 37.9206 45 39.6319 44.1281C41.1372 43.3611 42.3611 42.1372 43.1281 40.6319C44 38.9206 44 36.6804 44 32.2V28.8C44 24.3196 44 22.0794 43.1281 20.3681C42.3611 18.8628 41.1372 17.6389 39.6319 16.8719ZM31 11V16H17V11C17 7.13401 20.134 4 24 4C27.866 4 31 7.13401 31 11ZM7.54497 21.73C7 22.7996 7 24.1997 7 27V34C7 36.8003 7 38.2004 7.54497 39.27C8.02433 40.2108 8.78924 40.9757 9.73005 41.455C10.7996 42 12.1997 42 15 42H33C35.8003 42 37.2004 42 38.27 41.455C39.2108 40.9757 39.9757 40.2108 40.455 39.27C41 38.2004 41 36.8003 41 34V27C41 24.1997 41 22.7996 40.455 21.73C39.9757 20.7892 39.2108 20.0243 38.27 19.545C37.2004 19 35.8003 19 33 19H15C12.1997 19 10.7996 19 9.73005 19.545C8.78924 20.0243 8.02433 20.7892 7.54497 21.73ZM24 24C23.1716 24 22.5 24.6716 22.5 25.5V29.5C22.5 30.3284 23.1716 31 24 31C24.8284 31 25.5 30.3284 25.5 29.5V25.5C25.5 24.6716 24.8284 24 24 24Z"></path></svg>'),Ci=e=>{const t=Lr();return(()=>{const r=Ei.cloneNode(!0),n=r.firstChild;return yt((o=>{const s=e.class,i=e.fill||t.colors.icon.secondary;return s!==o._v$&&hr(r,"class",o._v$=s),i!==o._v$2&&hr(n,"fill",o._v$2=i),o}),{_v$:void 0,_v$2:void 0}),r})()},ki=dr('<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M37.485 37.3849C40.894 33.9506 43 29.2212 43 24C43 13.5066 34.4934 5 24 5C13.5066 5 5 13.5066 5 24C5 29.2213 7.1061 33.9507 10.5151 37.385C13.3583 32.9438 18.3354 30 24.0001 30C29.6647 30 34.6418 32.9437 37.485 37.3849ZM35.1809 39.3635C32.9143 35.5532 28.7554 33 24.0001 33C19.2448 33 15.0858 35.5533 12.8193 39.3636C15.9564 41.6506 19.8206 43 24 43C28.1795 43 32.0437 41.6505 35.1809 39.3635ZM24 46C36.1503 46 46 36.1503 46 24C46 11.8497 36.1503 2 24 2C11.8497 2 2 11.8497 2 24C2 36.1503 11.8497 46 24 46ZM24 24C26.7614 24 29 21.7614 29 19C29 16.2386 26.7614 14 24 14C21.2386 14 19 16.2386 19 19C19 21.7614 21.2386 24 24 24ZM24 27C28.4183 27 32 23.4183 32 19C32 14.5817 28.4183 11 24 11C19.5817 11 16 14.5817 16 19C16 23.4183 19.5817 27 24 27Z"></path></svg>'),_i=e=>{const t=Lr();return(()=>{const r=ki.cloneNode(!0),n=r.firstChild;return yt((o=>{const s=e.class,i=e.fill||t.colors.icon.secondary;return s!==o._v$&&hr(r,"class",o._v$=s),i!==o._v$2&&hr(n,"fill",o._v$2=i),o}),{_v$:void 0,_v$2:void 0}),r})()},Ii=dr('<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M34.5607 4.43934C33.9749 3.85355 33.0251 3.85355 32.4393 4.43934C31.8536 5.02513 31.8536 5.97487 32.4393 6.56066L37.8787 12H10.5C9.67157 12 9 12.6716 9 13.5C9 14.3284 9.67157 15 10.5 15H37.8787L32.4393 20.4393C31.8536 21.0251 31.8536 21.9749 32.4393 22.5607C33.0251 23.1464 33.9749 23.1464 34.5607 22.5607L42.5607 14.5607C43.1464 13.9749 43.1464 13.0251 42.5607 12.4393L34.5607 4.43934ZM13.4393 25.4393
1181C14.0251 24.8536 14.9749 24.8536 15.5607 25.4393C16.1464 26.0251 16.1464 26.9749 15.5607 27.5607L10.1213 33H37.5C38.3284 33 39 33.6716 39 34.5C39 35.3284 38.3284 36 37.5 36H10.1213L15.5607 41.4393C16.1464 42.0251 16.1464 42.9749 15.5607 43.5607C14.9749 44.1464 14.0251 44.1464 13.4393 43.5607L5.43934 35.5607C4.85355 34.9749 4.85355 34.0251 5.43934 33.4393L13.4393 25.4393Z"></path></svg>'),Si=e=>{const t=Lr();return(()=>{const r=Ii.cloneNode(!0),n=r.firstChild;return yt((o=>{const s=e.class,i=e.fill||t.colors.icon.secondary;return s!==o._v$&&hr(r,"class",o._v$=s),i!==o._v$2&&hr(n,"fill",o._v$2=i),o}),{_v$:void 0,_v$2:void 0}),r})()},xi=dr('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.75 12.002C1.75 9.20169 1.75 7.80156 2.29497 6.732C2.77433 5.79119 3.53924 5.02629 4.48005 4.54692C5.54961 4.00195 6.94974 4.00195 9.75 4.00195H17.25C20.0503 4.00195 21.4504 4.00195 22.52 4.54692C23.4608 5.02629 24.2257 5.79119 24.705 6.732C24.8256 6.96861 24.9195 7.2214 24.9926 7.50195H21.5C19.6377 7.50195 18.7065 7.50195 17.9609 7.77334C16.711 8.22828 15.7263 9.21291 15.2714 10.4629C15 11.2085 15 12.1396 15 14.002C15 15.8643 15 16.7954 15.2714 17.541C15.7263 18.791 16.711 19.7756 17.9609 20.2306C18.7065 20.502 19.6377 20.502 21.5 20.502H24.9926C24.9195 20.7825 24.8256 21.0353 24.705 21.2719C24.2257 22.2127 23.4608 22.9776 22.52 23.457C21.4504 24.002 20.0503 24.002 17.25 24.002H9.75C6.94974 24.002 5.54961 24.002 4.48005 23.457C3.53924 22.9776 2.77433 22.2127 2.29497 21.2719C1.75 20.2023 1.75 18.8022 1.75 16.002V12.002ZM16.4999 13.802C16.4999 12.1218 16.4999 11.2817 16.8269 10.64C17.1145 10.0755 17.5735 9.61656 18.138 9.32894C18.7797 9.00196 19.6198 9.00196 21.2999 9.00196H23.1999C24.8801 9.00196 25.7202 9.00196 26.3619 9.32894C26.9264 9.61656 27.3853 10.0755 27.673 10.64C27.9999 11.2817 27.9999 12.1218 27.9999 13.802V14.202C27.9999 15.8821 27.9999 16.7222 27.673 17.3639C27.3853 17.9284 26.9264 18.3874 26.3619 18.675C25.7202 19.002 24.8801 19.002 23.1999 19.002H21.2999C19.6198 19.002 18.7797 19.002 18.138 18.675C17.5735 18.3874 17.1145 17.9284 16.8269 17.3639C16.4999 16.7222 16.4999 15.8821 16.4999 14.202V13.802ZM22.4999 14.002C22.4999 14.9685 21.7164 15.752 20.7499 15.752C19.7834 15.752 18.9999 14.9685 18.9999 14.002C18.9999 13.0355 19.7834 12.252 20.7499 12.252C21.7164 12.252 22.4999 13.0355 22.4999 14.002Z"></path></svg>'),Bi=e=>{const t=Lr();return(()=>{const r=xi.cloneNode(!0),n=r.firstChild;return yt((o=>{const s=e.class,i=e.fill||t.colors.constant.white;return s!==o._v$&&hr(r,"class",o._v$=s),i!==o._v$2&&hr(n,"fill",o._v$2=i),o}),{_v$:void 0,_v$2:void 0}),r})()},Oi=dr('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0001 10.0001C10.0016 8.02333 10.0267 6.98719 10.436 6.18404C10.8195 5.43139 11.4314 4.81947 12.184 4.43597C13.0397 4 14.1598 4 16.4 4H17.6C19.8402 4 20.9603 4 21.816 4.43597C22.5686 4.81947 23.1805 5.43139 23.564 6.18404C24 7.03969 24 8.15979 24 10.4V11.6C24 13.8402 24 14.9603 23.564 15.816C23.1805 16.5686 22.5686 17.1805 21.816 17.564C21.0128 17.9733 19.9767 17.9984 17.9999 17.9999C17.9984 19.9767 17.9733 21.0128 17.564 21.816C17.1805 22.5686 16.5686 23.1805 15.816 23.564C14.9603 24 13.8402 24 11.6 24H10.4C8.15979 24 7.03969 24 6.18404 23.564C5.43139 23.1805 4.81947 22.5686 4.43597 21.816C4 20.9603 4 19.8402 4 17.6V16.4C4 14.1598 4 13.0397 4.43597 12.184C4.81947 11.4314 5.43139 10.8195 6.18404 10.436C6.98719 10.0267 8.02333 10.0016 10.0001 10.0001ZM10 11.5H9.5C8.09987 11.5 7.3998 11.5 6.86502 11.7725C6.39462 12.0122 6.01217 12.3946 5.77248 12.865C5.5 13.3998 5.5 14.0999 5.5 15.5V18.5C5.5 19.9001 5.5 20.6002 5.77248 21.135C6.01217 21.6054 6.39462 21.9878 6.86502 22.2275C7.3998 22.5 8.09987 22.5 9.5 22.5H12.5C13.9001 22.5 14.6002 22.5 15.135 22.2275C15.6054 21.9878 15.9878 21.6054 16.2275 21.135C16.5 20.6002 16.5 19.9001 16.5 18.5V18H16.4C14.1598 18 13.0397 18 12.184 17.564C11.4314 17.1805 10.8195 16.5686 10.436 15.816C10 14.9603 10 13.8402 10 11.6V11.5ZM11.5 9.5C11.5 8.09987 11.5 7.3998 11.7725 6.86502C12.0122 6.39462 12.3946 6.01217 12.865 5.77248C13.3998 5.5 14.0999 5.5 15.5 5.5H18.5C19.9001 5.5 20.6002 5.5 21.135 5.77248C21.6054 6.01217 21.9878 6.39462 22.2275 6.86502C22.5 7.3998 22.5 8.09987 22.5 9.5V12.5C22.5 13.9001 22.5 14.6002 22.2275 15.135C21.9878 15.6054 21.6054 15.9878 21.135 16.2275C20.6002 16.5 19.9001 16.5 18.5 16.5H15.5C14.0999 16.5 13.3998 16.5 12.865 16.2275C12.3946 15.9878 12.0122 15.6054 11.7725 15.135C11.5 14.6002 11.5 13.9001 11.5 12.5V9.5Z"></path></svg>'),Mi=e=>{const t=Lr(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const e=Oi.cloneNode(!0),t=e.firstChild;return yt((n=>{const o=r(),s=r();return o!==n._v$&&hr(e,"fill",n._v$=o),s!==n._v$2&&hr(t,"fill",n._v$2=s),n}),{_v$:void 0,_v$2:void 0}),e})()},Wi=dr('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="17" viewBox="0 0 16 17" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M1 4.12695C1 3.07754 1 2.55284 1.19202 2.14684C1.38986 1.72856 1.7266 1.39181 2.14489 1.19397C2.55088 1.00195 3.07559 1.00195 4.125 1.00195C5.17441 1.00195 5.69912 1.00195 6.10511 1.19397C6.5234 1.39181 6.86014 1.72856 7.05798 2.14684C7.25 2.55284 7.25 3.07754 7.25 4.12695C7.25 5.17636 7.25 5.70107 7.05798 6.10706C6.86014 6.52535 6.5234 6.8621 6.10511 7.05993C5.69912 7.25195 5.17441 7.25195 4.125 7.25195C3.07559 7.25195 2.55088 7.25195 2.14489 7.05993C1.7266 6.8621 1.38986 6.52535 1.19202 6.10706C1 5.70107 1 5.17636 1 4.12695ZM2.5 3.30195C2.5 3.02193 2.5 2.88191 2.5545 2.77496C2.60243 2.68088 2.67892 2.60439 2.773 2.55645C2.87996 2.50195 3.01997 2.50195 3.3 2.50195H4.95C5.23003 2.50195 5.37004 2.50195 5.477 2.55645C5.57108 2.60439 5.64757 2.68088 5.6955 2.77496C5.75 2.88191 5.75 3.02193 5.75 3.30195V4.95195C5.75 5.23198 5.75 5.37199 5.6955 5.47895C5.64757 5.57303 5.57108 5.64952 5.477 5.69746C5.37004 5.75195 5.23003 5.75195 4.95 5.75195H3.3C3.01997 5.75195 2.87996 5.75195 2.773 5.69746C2.67892 5.64952 2.60243 5.57303 2.5545 5.47895C2.5 5.37199 2.5 5.23198 2.5 4.95195V3.3
11810195ZM1 11.877C1 10.8275 1 10.3028 1.19202 9.89684C1.38986 9.47856 1.7266 9.14181 2.14489 8.94397C2.55088 8.75195 3.07559 8.75195 4.125 8.75195C5.17441 8.75195 5.69912 8.75195 6.10511 8.94397C6.5234 9.14181 6.86014 9.47856 7.05798 9.89684C7.25 10.3028 7.25 10.8275 7.25 11.877C7.25 12.9264 7.25 13.4511 7.05798 13.8571C6.86014 14.2753 6.5234 14.6121 6.10511 14.8099C5.69912 15.002 5.17441 15.002 4.125 15.002C3.07559 15.002 2.55088 15.002 2.14489 14.8099C1.7266 14.6121 1.38986 14.2753 1.19202 13.8571C1 13.4511 1 12.9264 1 11.877ZM2.5 11.052C2.5 10.7719 2.5 10.6319 2.5545 10.525C2.60243 10.4309 2.67892 10.3544 2.773 10.3064C2.87996 10.252 3.01997 10.252 3.3 10.252H4.95C5.23003 10.252 5.37004 10.252 5.477 10.3064C5.57108 10.3544 5.64757 10.4309 5.6955 10.525C5.75 10.6319 5.75 10.7719 5.75 11.052V12.702C5.75 12.982 5.75 13.122 5.6955 13.2289C5.64757 13.323 5.57108 13.3995 5.477 13.4475C5.37004 13.502 5.23003 13.502 4.95 13.502H3.3C3.01997 13.502 2.87996 13.502 2.773 13.4475C2.67892 13.3995 2.60243 13.323 2.5545 13.2289C2.5 13.122 2.5 12.982 2.5 12.702V11.052ZM8.94202 2.14684C8.75 2.55284 8.75 3.07754 8.75 4.12695C8.75 5.17636 8.75 5.70107 8.94202 6.10706C9.13986 6.52535 9.4766 6.8621 9.89489 7.05993C10.3009 7.25195 10.8256 7.25195 11.875 7.25195C12.9244 7.25195 13.4491 7.25195 13.8551 7.05993C14.2734 6.8621 14.6101 6.52535 14.808 6.10706C15 5.70107 15 5.17636 15 4.12695C15 3.07754 15 2.55284 14.808 2.14684C14.6101 1.72856 14.2734 1.39181 13.8551 1.19397C13.4491 1.00195 12.9244 1.00195 11.875 1.00195C10.8256 1.00195 10.3009 1.00195 9.89489 1.19397C9.4766 1.39181 9.13986 1.72856 8.94202 2.14684ZM10.3045 2.77496C10.25 2.88191 10.25 3.02193 10.25 3.30195V4.95195C10.25 5.23198 10.25 5.37199 10.3045 5.47895C10.3524 5.57303 10.4289 5.64952 10.523 5.69746C10.63 5.75195 10.77 5.75195 11.05 5.75195H12.7C12.98 5.75195 13.12 5.75195 13.227 5.69746C13.3211 5.64952 13.3976 5.57303 13.4455 5.47895C13.5 5.37199 13.5 5.23198 13.5 4.95195V3.30195C13.5 3.02193 13.5 2.88191 13.4455 2.77496C13.3976 2.68088 13.3211 2.60439 13.227 2.55645C13.12 2.50195 12.98 2.50195 12.7 2.50195H11.05C10.77 2.50195 10.63 2.50195 10.523 2.55645C10.4289 2.60439 10.3524 2.68088 10.3045 2.77496ZM8.80727 9.13518C8.75 9.26242 8.75 9.4256 8.75 9.75195C8.75 10.0783 8.75 10.2415 8.80727 10.3687C8.87245 10.5136 8.9884 10.6295 9.13323 10.6947C9.26047 10.752 9.42365 10.752 9.75 10.752C10.0764 10.752 10.2395 10.752 10.3668 10.6947C10.5116 10.6295 10.6276 10.5136 10.6927 10.3687C10.75 10.2415 10.75 10.0783 10.75 9.75195C10.75 9.4256 10.75 9.26242 10.6927 9.13518C10.6276 8.99035 10.5116 8.8744 10.3668 8.80922C10.2395 8.75195 10.0764 8.75195 9.75 8.75195C9.42365 8.75195 9.26047 8.75195 9.13323 8.80922C8.9884 8.8744 8.87245 8.99035 8.80727 9.13518ZM10.87 11.8771C10.87 11.546 10.87 11.3805 10.9289 11.2517C10.9938 11.1098 11.1077 10.9959 11.2497 10.931C11.3784 10.8721 11.5439 10.8721 11.875 10.8721C12.2061 10.8721 12.3716 10.8721 12.5003 10.931C12.6423 10.9959 12.7562 11.1098 12.8211 11.2517C12.88 11.3805 12.88 11.546 12.88 11.8771C12.88 12.2081 12.88 12.3737 12.8211 12.5024C12.7562 12.6444 12.6423 12.7583 12.5003 12.8232C12.3716 12.8821 12.2061 12.8821 11.875 12.8821C11.5439 12.8821 11.3784 12.8821 11.2497 12.8232C11.1077 12.7583 10.9938 12.6444 10.9289 12.5024C10.87 12.3737 10.87 12.2081 10.87 11.8771ZM8.80727 13.3852C8.75 13.5124 8.75 13.6756 8.75 14.002C8.75 14.3283 8.75 14.4915 8.80727 14.6187C8.87245 14.7636 8.9884 14.8795 9.13323 14.9447C9.26047 15.002 9.42365 15.002 9.75 15.002C10.0764 15.002 10.2395 15.002 10.3668 14.9447C10.5116 14.8795 10.6276 14.7636 10.6927 14.6187C10.75 14.4915 10.75 14.3283 10.75 14.002C10.75 13.6756 10.75 13.5124 10.6927 13.3852C10.6276 13.2404 10.5116 13.1244 10.3668 13.0592C10.2395 13.002 10.0764 13.002 9.75 13.002C9.42365 13.002 9.26047 13.002 9.13323 13.0592C8.9884 13.1244 8.87245 13.2404 8.80727 13.3852ZM13 9.75195C13 9.4256 13 9.26242 13.0573 9.13518C13.1224 8.99035 13.2384 8.8744 13.3832 8.80922C13.5105 8.75195 13.6736 8.75195 14 8.75195C14.3264 8.75195 14.4895 8.75195 14.6168 8.80922C14.7616 8.8744 14.8776 8.99035 14.9427 9.13518C15 9.26242 15 9.4256 15 9.75195C15 10.0783 15 10.2415 14.9427 10.3687C14.8776 10.5136 14.7616 10.6295 14.6168 10.6947C14.4895 10.752 14.3264 10.752 14 10.752C13.6736 10.752 13.5105 10.752 13.3832 10.6947C13.2384 10.6295 13.1224 10.5136 13.0573 10.3687C13 10.2415 13 10.0783 13 9.75195ZM13.0573 13.3852C13 13.5124 13 13.6756 13 14.002C13 14.3283 13 14.4915 13.0573 14.6187C13.1224 14.7636 13.2384 14.8795 13.3832 14.9447C13.5105 15.002 13.6736 15.002 14 15.002C14.3264 15.002 14.4895 15.002 14.6168 14.9447C14.7616 14.8795 14.8776 14.7636 14.9427 14.6187C15 14.4915 15 14.3283 15 14.002C15 13.6756 15 13.5124 14.9427 13.3852C14.8776 13.2404 14.7616 13.1244 14.6168 13.0592C14.4895 13.002 14.3264 13.002 14 13.002C13.6736 13.002 13.5105 13.002 13.3832 13.0592C13.2384 13.1244 13.1224 13.2404 13.0573 13.3852Z"></path></svg>'),ji=e=>{const t=Lr();return(()=>{const r=Wi.cloneNode(!0),n=r.firstChild;return yt((()=>hr(n,"fill",e.fill||t.colors.icon.secondary))),r})()},Ri={m:"16px",s:"12px",none:"0"},Ni={m:"6px",s:"6px",none:"0"},Ui=zr.div` 1182 width: 60px; 1183 height: 60px; 1184 padding: 8px; 1185 margin-bottom: 8px; 1186 border-radius: ${e=>Ri[e.theme.borderRadius]}; 1187 background-color: ${e=>e.theme.colors.background.tint}; 1188 display: grid; 1189 grid-template: 1fr 1fr / 1fr 1fr; 1190 gap: 4px; 1191`,Di=zr(Bs)`
1192 width: 20px; 1193 height: 20px; 1194 border-radius: ${e=>Ni[e.theme.borderRadius]}; 1195`,Li=e=>$t(Fs,{get name(){return e.labelLine1},get secondLine(){return e.labelLine2},get icon(){return $t(Ui,{get children(){return $t(Xt,{each:[0,1,2,3],children:t=>$t(Di,{get src(){return e.images[t]}})})}})},onClick:()=>e.onClick()}),Fi="telegram-wallet",zi="https://raw.githubusercontent.com/ton-connect/sdk/main/assets/ton-icon-48.png",Vi="https://raw.githubusercontent.com/ton-connect/sdk/main/assets/tg.png",qi=e=>{const[t]=ks();return wt((()=>{const r=wt((()=>e.wallet.appName===Fi));return()=>r()?$t(Fs,{get icon(){return e.wallet.imageUrl},get name(){return t("walletItem.walletOn",{},"Wallet in")},secondLine:"Telegram",get badgeUrl(){return Vi},onClick:()=>e.onClick()}):$t(Fs,{get icon(){return e.wallet.imageUrl},get name(){return e.wallet.name},get secondLine(){return(()=>{if(e.wallet.appName!==Fi)return"isPreferred"in e.wallet&&e.wallet.isPreferred?t("walletItem.recent",{},"Recent"):se(e.wallet)?t("walletItem.installed",{},"Installed"):"Tonkeeper"===e.wallet.name?t("walletItem.popular",{},"Popular"):void 0})()},secondLineColorPrimary:!1,onClick:()=>e.onClick()})})())},Hi=zr.div` 1196 width: 100%; 1197 overflow-y: auto; 1198 max-height: ${e=>e.maxHeight}; 1199 1200 scrollbar-width: none; 1201 &&::-webkit-scrollbar {
1202 display: none; 1203 } 1204 1205 &&::-webkit-scrollbar-track { 1206 background: transparent; 1207 } 1208 1209 &&::-webkit-scrollbar-thumb { 1210 display: none; 1211 } 1212`,Ki=zr.div` 1213 height: 1px; 1214 margin: 0 -24px; 1215 width: calc(100% + 48px); 1216 opacity: 0.08; 1217 background: ${e=>e.isShown?e.theme.colors.icon.secondary:"transparent"}; 1218 transition: background 0.15s ease-in-out; 1219 1220 ${wo("mobile")} { 1221 width: 100%; 1222 margin: 0; 1223 } 1224`,[$i,Gi]=gt((null==(De=sn())?void 0:De.innerHeight)||0);sn()&&window.addEventListener("resize",(()=>Gi(window.innerHeight)));const[Yi,Ji]=gt(bo("mobile")),Qi=()=>Ji(bo("mobile"));sn()&&(window.addEventListener("resize",(()=>Qi())),window.addEventListener("load",(()=>Qi()),{once:!0}));const Zi=e=>{const[t,r]=gt(!1),n=()=>void 0!==e.maxHeight?`${e.maxHeight}px`:$i()-(Yi()?150:200)+"px";return[$t(Ki,{get isShown(){return t()}}),$t(Hi,{get maxHeight(){return n()},onScroll:e=>{r(e.target.scrollTop>0)},get class(){return e.class},get children(){return e.children}})]},Xi=zr.a` 1225 display: block; 1226 text-decoration: unset; 1227`,ea=e=>$t(Xi,Qt({get href(){return e.href},get target(){return e.blank?"_blank":"_self"},get class(){return e.class}},(()=>e.blank?{rel:"noreferrer noopener"}:{}),{get children(){return e.children}})),ta=kt(),ra=dr('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.76228 2.09998H10.2378C11.0458 2.09997 11.7067 2.09996 12.2438 2.14384C12.7997 2.18926 13.3017 2.28614 13.7706 2.52505C14.5045 2.89896 15.1011 3.49558 15.475 4.22941C15.7139 4.6983 15.8108 5.20038 15.8562 5.75629C15.9001 6.29337 15.9001 6.95422 15.9001 7.76227V8.1H16.2377C17.0457 8.09999 17.7066 8.09998 18.2437 8.14386C18.7996 8.18928 19.3017 8.28616 19.7705 8.52507C20.5044 8.89898 21.101 9.4956 21.4749 10.2294C21.7138 10.6983 21.8107 11.2004 21.8561 11.7563C21.9 12.2934 21.9 12.9542 21.9 13.7623V16.2377C21.9 17.0458 21.9 17.7066 21.8561 18.2437C21.8107 18.7996 21.7138 19.3017 21.4749 19.7706C21.101 20.5044 20.5044 21.101 19.7705 21.4749C19.3017 21.7138 18.7996 21.8107 18.2437 21.8561C17.7066 21.9 17.0458 21.9 16.2378 21.9H13.7623C12.9543 21.9 12.2934 21.9 11.7563 21.8561C11.2004 21.8107 10.6983 21.7138 10.2294 21.4749C9.49561 21.101 8.89898 20.5044 8.52508 19.7706C8.28616 19.3017 8.18928 18.7996 8.14386 18.2437C8.09998 17.7066 8.09999 17.0458 8.1 16.2377V15.9H7.76227C6.95426 15.9 6.29335 15.9 5.75629 15.8561C5.20038 15.8107 4.6983 15.7138 4.22941 15.4749C3.49558 15.101 2.89896 14.5044 2.52505 13.7705C2.28614 13.3017 2.18926 12.7996 2.14384 12.2437C2.09996 11.7066 2.09997 11.0458 2.09998 10.2377V7.76228C2.09997 6.95424 2.09996 6.29336 2.14384 5.75629C2.18926 5.20038 2.28614 4.6983 2.52505 4.22941C2.89896 3.49558 3.49558 2.89896 4.22941 2.52505C4.6983 2.28614 5.20038 2.18926 5.75629 2.14384C6.29336 2.09996 6.95425 2.09997 7.76228 2.09998ZM8.1 14.1V13.7623C8.09999 12.9542 8.09998 12.2934 8.14386 11.7563C8.18928 11.2004 8.28616 10.6983 8.52508 10.2294C8.89898 9.4956 9.49561 8.89898 10.2294 8.52507C10.6983 8.28616 11.2004 8.18928 11.7563 8.14386C12.2934 8.09998 12.9542 8.09999 13.7623 8.1H14.1001V7.79998C14.1001 6.94505 14.0994 6.35798 14.0622 5.90287C14.0259 5.45827 13.9593 5.21944 13.8712 5.0466C13.6699 4.65146 13.3486 4.3302 12.9535 4.12886C12.7806 4.04079 12.5418 3.97419 12.0972 3.93786C11.6421 3.90068 11.055 3.89998 10.2001 3.89998H7.79998C6.94505 3.89998 6.35798 3.90068 5.90287 3.93786C5.45827 3.97419 5.21944 4.04079 5.0466 4.12886C4.65146 4.3302 4.3302 4.65146 4.12886 5.0466C4.04079 5.21944 3.97419 5.45827 3.93786 5.90287C3.90068 6.35798 3.89998 6.94505 3.89998 7.79998V10.2C3.89998 11.0549 3.90068 11.642 3.93786 12.0971C3.97419 12.5417 4.04079 12.7805 4.12886 12.9534C4.3302 13.3485 4.65146 13.6698 5.0466 13.8711C5.21944 13.9592 5.45827 14.0258 5.90287 14.0621C6.35798 14.0993 6.94505 14.1 7.79998 14.1H8.1ZM11.0466 10.1289C11.2195 10.0408 11.4583 9.97421 11.9029 9.93788C12.358 9.9007 12.9451 9.9 13.8 9.9H16.2C17.0549 9.9 17.642 9.9007 18.0971 9.93788C18.5417 9.97421 18.7805 10.0408 18.9534 10.1289C19.3485 10.3302 19.6698 10.6515 19.8711 11.0466C19.9592 11.2195 20.0258 11.4583 20.0621 11.9
1227029C20.0993 12.358 20.1 12.9451 20.1 13.8V16.2C20.1 17.0549 20.0993 17.642 20.0621 18.0971C20.0258 18.5417 19.9592 18.7805 19.8711 18.9534C19.6698 19.3485 19.3485 19.6698 18.9534 19.8711C18.7805 19.9592 18.5417 20.0258 18.0971 20.0621C17.642 20.0993 17.0549 20.1 16.2 20.1H13.8C12.9451 20.1 12.358 20.0993 11.9029 20.0621C11.4583 20.0258 11.2195 19.9592 11.0466 19.8711C10.6515 19.6698 10.3302 19.3485 10.1289 18.9534C10.0408 18.7805 9.97421 18.5417 9.93788 18.0971C9.9007 17.642 9.9 17.0549 9.9 16.2V13.8C9.9 12.9451 9.9007 12.358 9.93788 11.9029C9.97421 11.4583 10.0408 11.2195 10.1289 11.0466C10.3302 10.6515 10.6515 10.3302 11.0466 10.1289Z"></path></svg>'),na=e=>{const t=Lr();return(()=>{const r=ra.cloneNode(!0),n=r.firstChild;return yt((o=>{const s=e.class,i=e.fill||t.colors.icon.primary;return s!==o._v$&&hr(r,"class",o._v$=s),i!==o._v$2&&hr(n,"fill",o._v$2=i),o}),{_v$:void 0,_v$2:void 0}),r})()},oa=dr('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.7624 3.10001C7.95435 3.1 7.29349 3.09999 6.75642 3.14387C6.2005 3.18929 5.69842 3.28617 5.22954 3.52508C4.4957 3.89899 3.89908 4.49561 3.52517 5.22944C3.28626 5.69833 3.18938 6.20041 3.14396 6.75632C3.10008 7.2934 3.10009 7.95424 3.1001 8.76229V15.2377C3.10009 16.0458 3.10008 16.7066 3.14396 17.2437C3.18938 17.7996 3.28626 18.3017 3.52517 18.7706C3.89908 19.5044 4.4957 20.101 5.22954 20.4749C5.69842 20.7138 6.2005 20.8107 6.75642 20.8561C7.29349 20.9 7.95434 20.9 8.76239 20.9H12.0001C12.4972 20.9 12.9001 20.4971 12.9001 20C12.9001 19.503 12.4972 19.1 12.0001 19.1H8.8001C7.94517 19.1 7.3581 19.0993 6.90299 19.0621C6.45839 19.0258 6.21956 18.9592 6.04672 18.8711C5.65158 18.6698 5.33032 18.3485 5.12898 17.9534C5.04092 17.7805 4.97431 17.5417 4.93798 17.0971C4.9008 16.642 4.9001 16.0549 4.9001 15.2V8.80001C4.9001 7.94508 4.9008 7.35801 4.93798 6.9029C4.97431 6.4583 5.04092 6.21947 5.12898 6.04663C5.33032 5.65149 5.65158 5.33023 6.04672 5.12889C6.21956 5.04082 6.45839 4.97422 6.90299 4.93789C7.3581 4.90071 7.94517 4.90001 8.8001 4.90001H12.0001C12.4972 4.90001 12.9001 4.49706 12.9001 4.00001C12.9001 3.50295 12.4972 3.10001 12.0001 3.10001H8.7624Z"></path><path d="M17.6364 7.3636C17.2849 7.01212 16.7151 7.01212 16.3636 7.3636C16.0121 7.71507 16.0121 8.28492 16.3636 8.63639L18.8272 11.1H9.00001C8.50295 11.1 8.10001 11.5029 8.10001 12C8.10001 12.497 8.50295 12.9 9.00001 12.9H18.8272L16.3636 15.3636C16.0121 15.7151 16.0121 16.2849 16.3636 16.6364C16.7151 16.9879 17.2849 16.9879 17.6364 16.6364L21.6364 12.6364C21.9879 12.2849 21.9879 11.7151 21.6364 11.3636L17.6364 7.3636Z"></path></svg>'),sa=e=>{const t=Lr(),r=()=>e.fill||t.colors.icon.primary;return(()=>{const e=oa.cloneNode(!0),t=e.firstChild,n=t.nextSibling;return yt((e=>{const o=r(),s=r();return o!==e._v$&&hr(t,"fill",e._v$=o),s!==e._v$2&&hr(n,"fill",e._v$2=s),e}),{_v$:void 0,_v$2:void 0}),e})()},ia={m:"8px",s:"4px",none:"0"},aa={m:"16px",s:"8px",none:"0"},ca=zr.div` 1228 width: 256px; 1229 box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16); 1230 border-radius: ${e=>aa[e.theme.borderRadius]}; 1231 1232 background-color: ${e=>e.theme.colors.background.primary} 1233 1234 color: ${e=>e.theme.colors.text.primary} 1235`,la=zr.ul` 1236 background-color: ${e=>e.theme.colors.background.primary}; 1237 padding: 8px; 1238`,ua=zr.button` 1239 display: flex; 1240 align-items: center; 1241 gap: 8px; 1242 height: 40px; 1243 padding-left: 8px; 1244 width: 100%; 1245 1246 background-color: ${e=>e.theme.colors.background.primary}; 1247 border: none; 1248 border-radius: ${e=>ia[e.theme.borderRadius]}; 1249 cursor: pointer; 1250 1251 transition: background-color, transform 0.1s ease-in-out; 1252 1253 &:hover { 1254 background-color: ${e=>e.theme.colors.background.secondary}; 1255 } 1256 1257 &:active { 1258 transform: scale(0.96); 1259 } 1260`,da=dr("<li></li>"),ha=e=>$t(Is,{get translationKey(){return e.translationKey},fontSize:"15px",fontWeight:"590",get children(){return e.children}}),pa={m:"16px",s:"8px",none:"0"},fa=zr.div` 1261 width: 256px; 1262 padding: 12px 16px; 1263 display: flex; 1264 gap: 9px; 1265 1266 background-color: ${e=>e.theme.colors.background.primary}; 1267 box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16); 1268 border-radius: ${e=>pa[e.theme.borderRadius]}; 1269`,ga=zr.div` 1270 width: 192px; 1271 1272 > h3 { 1273 font-size: 15px; 1274 } 1275`,ma=zr(Is)` 1276 margin-top: 4px; 1277 color: ${e=>e.theme.colors.text.secondary}; 1278`,ya=e=>{const t=Co(e);return $t(fa,Qt({get class(){return e.class},"data-tc-notification":"true"},t,{get children(){return[$t(ga,{get children(){return[$t($s,{get translationKey(){return e.header.translationKey},get translationValues(){return e.header.translationValues},get children(){return e.children}}),$t(er,{get when(){return e.text},get children(){return $t(ma,{get translationKey(){return e.text.translationKey},get translationValues(){return e.text.translationValues}})}})]}}
1278),wt((()=>e.icon))]}}))},ba=zr(ai)` 1279 align-self: center; 1280`,wa=e=>{const t=_t(ta),[r]=ks();return $t(ya,{get header(){return{translationKey:"notifications.confirm.header",translationValues:{name:t.wallet&&"name"in t.wallet?t.wallet.name:r("common.yourWallet",{},"Your wallet")}}},get class(){return e.class},get icon(){return $t(ba,{})},"data-tc-notification-confirm":"true",children:"Confirm operation in your wallet"})},va=zr(ni)` 1281 margin-top: 2px; 1282`,Aa=e=>$t(ya,{header:{translationKey:"notifications.transactionCanceled.header"},text:{translationKey:"notifications.transactionCanceled.text"},get icon(){return $t(va,{size:"xs"})},get class(){return e.class},"data-tc-notification-tx-cancelled":"true",children:"Transaction cancelled"}),Ta=zr(Xs)` 1283 margin-top: 2px; 1284`,Pa=e=>$t(ya,{header:{translationKey:"notifications.transactionSent.header"},text:{translationKey:"notifications.transactionSent.text"},get icon(){return $t(Ta,{})},get class(){return e.class},"data-tc-notification-tx-sent":"true",children:"Transaction sent"}),Ea=Rr` 1285 transform: translateY(-8px); 1286 margin-bottom: 12px; 1287`,Ca={timeout:4500},[ka,_a]=gt(null);function Ia(e){const{timeout:t}=Qe(Qe({},Ca),e),[r,n]=gt([]),[o,s]=gt([]);return bt(function(e,t,r){const n=Array.isArray(e);let o,s=r&&r.defer;return r=>{let i;if(n){i=Array(e.length);for(let t=0;t<e.length;t++)i[t]=e[t]()}else i=e();if(s)return void(s=!1);const a=Tt((()=>t(i,o,r)));return o=i,a}}(kn,(e=>{var r;if(!e||!e.showNotification)return;if(ka()===e)return;if("confirm-transaction"===(null==(r=ka())?void 0:r.name)&&"confirm-transaction"===e.name)return;_a(e),n((e=>e.filter((e=>"confirm-transaction"!==e.action))));const o={action:e.name};n((e=>[...e,o]));const i=setTimeout((()=>{n((e=>e.filter((e=>e!==o)))),s((e=>e.filter((e=>e!==i))))}),t);s((e=>[...e,i]))}))),Et((()=>{o().forEach((e=>clearTimeout(e)))})),r}const Sa=dr('<div data-tc-list-notifications="true"></div>'),xa=zr(ko)` 1288 background-color: ${e=>e.theme.colors.connectButton.background}; 1289 color: ${e=>e.theme.colors.connectButton.foreground}; 1290 box-shadow: ${e=>`0 4px 24px ${Gr(e.theme.colors.constant.black,.16)}`}; 1291 padding: 8px 16px 8px 12px; 1292 1293 display: flex; 1294 align-items: center; 1295 gap: 4px; 1296 height: 40px; 1297`,Ba=zr(xa)` 1298 padding: 12px 16px; 1299 min-width: 148px; 1300 justify-content: center; 1301 background-color: ${e=>e.theme.colors.background.primary}; 1302`,Oa=zr(ko)` 1303 min-width: 148px; 1304 height: 40px; 1305 1306 background-color: ${e=>e.theme.colors.background.primary}; 1307 color: ${e=>e.theme.colors.connectButton.foreground}; 1308 box-shadow: ${e=>`0 4px 24px ${Gr(e.theme.colors.constant.black,.16)}`}; 1309 1310 display: flex; 1311 align-items: center; 1312 justify-content: center; 1313`,Ma=zr(ai)` 1314 height: 18px; 1315 width: 18px; 1316`,Wa=zr.div` 1317 width: fit-content; 1318 display: flex; 1319 flex-direction: column; 1320 align-items: flex-end; 1321`,ja=zr((e=>{const t=_t(ta),[r,n]=gt(!1);return $t(ca,{ref(t){const r=e.ref;"function"==typeof r?r(t):e.ref=t},get class(){return e.class},"data-tc-dropdown":"true",get children(){return $t(la,{get children(){return[(()=>{const e=da.cloneNode(!0);return mr(e,$t(ua,{onClick:()=>et(void 0,null,(function*(){const e=Se(t.account.address,t.account.chain===c.TESTNET);yield vs(e),n(!0),setTimeout((()=>n(!1)),1e3)})),get children(){return[$t(na,{}),$t(er,{get when(){return!r()},get children(){return $t(ha,{translationKey:"button.dropdown.copy",children:"Copy address"})}}),$t(er,{get when(){return r()},get children(){return $t(ha,{translationKey:"button.dropdown.copied",children:"Address copied!"})}})]}})),e})(),(()=>{const r=da.cloneNode(!0);return mr(r,$t(ua,{onClick:()=>(t.disconnect(),void e.onClose()),get children(){return[$t(sa,{}),$t(ha,{translationKey:"button.dropdown.disconnect",children:"Disconnect"})]}})),r})()]}})}})}))` 1322 box-sizing: border-box; 1323 overflow: hidden; 1324 margin-top: 12px; 1325`,Ra=zr((e=>{const t=Ia();return(()=>{const r=Sa.cloneNode(!0);return mr(r,$t(xo,{onBeforeEnter:e=>{Jo(e,[{opacity:0,transform:"translateY(0)"},{opacity:1,transform:"translateY(-8px)"}],{duration:200})},onExit:(e,t)=>
1325{Jo(e,[{opacity:1,transform:"translateY(-8px)"},{opacity:0,transform:"translateY(-30px)"}],{duration:200}).finished.then(t)},get children(){return $t(Xt,{get each(){return t()},children:e=>$t(tr,{get children(){return[$t(rr,{get when(){return"transaction-sent"===e.action},get children(){return $t(Pa,{class:Ea})}}),$t(rr,{get when(){return"transaction-canceled"===e.action},get children(){return $t(Aa,{class:Ea})}}),$t(rr,{get when(){return"confirm-transaction"===e.action},get children(){return $t(wa,{class:Ea})}})]}})})}})),yt((()=>pr(r,e.class))),r})()}))` 1326 > div:first-child { 1327 margin-top: 20px; 1328 } 1329`;function Na(e){return e.split("-")[0]}function Ua(e,t,r){let{reference:n,floating:o}=e;const s=n.x+n.width/2-o.width/2,i=n.y+n.height/2-o.height/2,a=function(e){return["top","bottom"].includes(Na(e))?"x":"y"}(t),c="y"===a?"height":"width";const l=n[c]/2-o[c]/2,u="x"===a;let d;switch(Na(t)){case"top":d={x:s,y:n.y-o.height};break;case"bottom":d={x:s,y:n.y+n.height};break;case"right":d={x:n.x+n.width,y:i};break;case"left":d={x:n.x-o.width,y:i};break;default:d={x:n.x,y:n.y}}switch(function(e){return e.split("-")[1]}(t)){case"start":d[a]-=l*(r&&u?-1:1);break;case"end":d[a]+=l*(r&&u?-1:1)}return d}function Da(e){return Ze(Qe({},e),{top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height})}function La(e){var t;return(null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Fa(e){return La(e).getComputedStyle(e)}function za(e){return $a(e)?(e.nodeName||"").toLowerCase():""}let Va;function qa(){if(Va)return Va;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(Va=e.brands.map((e=>e.brand+"/"+e.version)).join(" "),Va):navigator.userAgent}function Ha(e){return e instanceof La(e).HTMLElement}function Ka(e){return e instanceof La(e).Element}function $a(e){return e instanceof La(e).Node}function Ga(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof La(e).ShadowRoot||e instanceof ShadowRoot}function Ya(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=Fa(e);return/auto|scroll|overlay|hidden/.test(t+n+r)&&!["inline","contents"].includes(o)}function Ja(e){return["table","td","th"].includes(za(e))}function Qa(e){const t=/firefox/i.test(qa()),r=Fa(e),n=r.backdropFilter||r.WebkitBackdropFilter;return"none"!==r.transform||"none"!==r.perspective||!!n&&"none"!==n||t&&"filter"===r.willChange||t&&!!r.filter&&"none"!==r.filter||["transform","perspective"].some((e=>r.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=r.contain;return null!=t&&t.includes(e)}))}function Za(){return!/^((?!chrome|android).)*safari/i.test(qa())}function Xa(e){return["html","body","#document"].includes(za(e))}const ec=Math.min,tc=Math.max,rc=Math.round,nc={x:1,y:1};function oc(e){const t=!Ka(e)&&e.contextElement?e.contextElement:Ka(e)?e:null;if(!t)return nc;const r=t.getBoundingClientRect(),n=Fa(t);if("border-box"!==n.boxSizing)return Ha(t)?{x:t.offsetWidth>0&&rc(r.width)/t.offsetWidth||1,y:t.offsetHeight>0&&rc(r.height)/t.offsetHeight||1}:nc;let o=r.width/parseFloat(n.width),s=r.height/parseFloat(n.height);return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}function sc(e,t,r,n){var o,s,i,a;void 0===t&&(t=!1),void 0===r&&(r=!1);const c=e.getBoundingClientRect();let l=nc;t&&(n?Ka(n)&&(l=oc(n)):l=oc(e));const u=Ka(e)?La(e):window,d=!Za()&&r,h=(c.left+(d&&null!=(o=null==(s=u.visualVie
1329wport)?void 0:s.offsetLeft)?o:0))/l.x,p=(c.top+(d&&null!=(i=null==(a=u.visualViewport)?void 0:a.offsetTop)?i:0))/l.y,f=c.width/l.x,g=c.height/l.y;return{width:f,height:g,top:p,right:h+f,bottom:p+g,left:h,x:h,y:p}}function ic(e){return(($a(e)?e.ownerDocument:e.document)||window.document).documentElement}function ac(e){return Ka(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function cc(e){return sc(ic(e)).left+ac(e).scrollLeft}function lc(e,t,r){const n=Ha(t),o=ic(t),s=sc(e,!0,"fixed"===r,t);let i={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(n||!n&&"fixed"!==r)if(("body"!==za(t)||Ya(o))&&(i=ac(t)),Ha(t)){const e=sc(t,!0);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else o&&(a.x=cc(o));return{x:s.left+i.scrollLeft-a.x,y:s.top+i.scrollTop-a.y,width:s.width,height:s.height}}function uc(e){if("html"===za(e))return e;const t=e.assignedSlot||e.parentNode||(Ga(e)?e.host:null)||ic(e);return Ga(t)?t.host:t}function dc(e){return Ha(e)&&"fixed"!==Fa(e).position?e.offsetParent:null}function hc(e){const t=La(e);let r=dc(e);for(;r&&Ja(r)&&"static"===Fa(r).position;)r=dc(r);return r&&("html"===za(r)||"body"===za(r)&&"static"===Fa(r).position&&!Qa(r))?t:r||function(e){let t=uc(e);for(;Ha(t)&&!Xa(t);){if(Qa(t))return t;t=uc(t)}return null}(e)||t}function pc(e){const t=uc(e);return Xa(t)?e.ownerDocument.body:Ha(t)&&Ya(t)?t:pc(t)}function fc(e,t){var r;void 0===t&&(t=[]);const n=pc(e),o=n===(null==(r=e.ownerDocument)?void 0:r.body),s=La(n);return o?t.concat(s,s.visualViewport||[],Ya(n)?n:[]):t.concat(n,fc(n))}function gc(e,t,r){return"viewport"===t?Da(function(e,t){const r=La(e),n=ic(e),o=r.visualViewport;let s=n.clientWidth,i=n.clientHeight,a=0,c=0;
1329if(o){s=o.width,i=o.height;const e=Za();(e||!e&&"fixed"===t)&&(a=o.offsetLeft,c=o.offsetTop)}return{width:s,height:i,x:a,y:c}}(e,r)):Ka(t)?function(e,t){const r=sc(e,!0,"fixed"===t),n=r.top+e.clientTop,o=r.left+e.clientLeft,s=Ha(e)?oc(e):{x:1,y:1},i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,l=n*s.y;return{top:l,left:c,right:c+i,bottom:l+a,x:c,y:l,width:i,height:a}}(t,r):Da(function(e){var t;const r=ic(e),n=ac(e),o=null==(t=e.ownerDocument)?void 0:t.body,s=tc(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),i=tc(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let a=-n.scrollLeft+cc(e);const c=-n.scrollTop;return"rtl"===Fa(o||r).direction&&(a+=tc(r.clientWidth,o?o.clientWidth:0)-s),{width:s,height:i,x:a,y:c}}(ic(e)))}const mc={getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[..."clippingAncestors"===r?function(e,t){const r=t.get(e);if(r)return r;let n=fc(e).filter((e=>Ka(e)&&"body"!==za(e))),o=null;const s="fixed"===Fa(e).position;let i=s?uc(e):e;for(;Ka(i)&&!Xa(i);){const e=Fa(i),t=Qa(i);(s?t||o:t||"static"!==e.position||!o||!["absolute","fixed"].includes(o.position))?o=e:n=n.filter((e=>e!==i)),i=uc(i)}return t.set(e,n),n}(t,this._c):[].concat(r),n],i=s[0],a=s.reduce(((e,r)=>{const n=gc(t,r,o);return e.top=tc(n.top,e.top),e.right=ec(n.right,e.right),e.bottom=ec(n.bottom,e.bottom),e.left=tc(n.left,e.left),e}),gc(t,i,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:r,strategy:n}=e;const o=Ha(r),s=ic(r);if(r===s)return t;let i={scrollLeft:0,scrollTop:0},a={x:1,y:1};const c={x:0,y:0};if((o||!o&&"fixed"!==n)&&(("body"!==za(r)||Ya(s))&&(i=ac(r)),Ha(r))){const e=sc(r);a=oc(r),c.x=e.x+r.clientLeft,c.y=e.y+r.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-i.scrollLeft*a.x+c.x,y:t.y*a.y-i.scrollTop*a.y+c.y}},isElement:Ka,getDimensions:function(e){if(Ha(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=sc(e);return{width:t.width,height:t.height}}
1329,getOffsetParent:hc,getDocumentElement:ic,getScale:oc,getElementRects(e){return et(this,null,(function*(){let{reference:t,floating:r,strategy:n}=e;const o=this.getOffsetParent||hc,s=this.getDimensions;return{reference:lc(t,yield o(r),n),floating:Qe({x:0,y:0},yield s(r))}}))},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===Fa(e).direction};function yc(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=!0,animationFrame:a=!1}=n,c=o&&!a,l=c||s?[...Ka(e)?fc(e):e.contextElement?fc(e.contextElement):[],...fc(t)]:[];l.forEach((e=>{c&&e.addEventListener("scroll",r,{passive:!0}),s&&e.addEventListener("resize",r)}));let u,d=null;if(i){let n=!0;d=new ResizeObserver((()=>{n||r(),n=!1})),Ka(e)&&!a&&d.observe(e),Ka(e)||!e.contextElement||a||d.observe(e.contextElement),d.observe(t)}let h=a?sc(e):null;return a&&function t(){const n=sc(e);!h||n.x===h.x&&n.y===h.y&&n.width===h.width&&n.height===h.height||r();h=n,u=requestAnimationFrame(t)}(),r(),()=>{var e;l.forEach((e=>{c&&e.removeEventListener("scroll",r),s&&e.removeEventListener("resize",r)})),null==(e=d)||e.disconnect(),d=null,a&&cancelAnimationFrame(u)}}const bc=(e,t,r)=>{const n=new Map,o=Qe({platform:mc},r),s=Ze(Qe({},o.platform),{_c:n});return((e,t,r)=>et(void 0,null,(function*(){const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:i}=r,a=s.filter(Boolean),c=yield null==i.isRTL?void 0:i.isRTL(t);if("production"!=={}.NODE_ENV){if(null==i&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),a.filter((e=>{let{name:t}=e;return"autoPlacement"===t||"flip"===t})).length>1)throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware","detected. This will lead to an infinite loop. Ensure only one of","either has been passed to the `middleware` array."].join(" "));e&&t||console.error(["Floating UI: The reference and/or floating element was not defined","when `computePosition()` was called. Ensure that both elements have","been created and can be measured."].join(" "))}let l=yield i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Ua(l,n,c),h=n,p={},f=0;for(let r=0;r<a.length;r++){const{name:s,fn:g}=a[r],{x:m,y,data:b,reset:w}=yield g({x:u,y:d,initialPlacement:n,placement:h,strategy:o,middlewareData:p,rects:l,platform:i,elements:{reference:e,floating:t}});u=null!=m?m:u,d=null!=y?y:d,p=Ze(Qe({},p),{[s]:Qe(Qe({},p[s]),b)}),"production"!=={}.NODE_ENV&&f>50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),w&&f<=50&&(f++,"object"==typeof w&&(w.placement&&(h=w.placement),w.rects&&(l=!0===w.rects?yield i.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:u,y:d}=Ua(l,h,c))),r=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:p}})))(e,t,Ze(Qe({},o),{platform:s}))};const wc=dr('<tc-root data-tc-dropdown-container="true"></tc-root>'),vc=()=>{const e=Lr(),t=_t(Bn),r=_t(ta),[n,o]=gt(!1),[s,i]=gt(t.account),[a,l]=gt(!t.account);let u;const[d,h]=gt(),[p,f]=gt(),g=function(e,t,r){let n=()=>{var e;return null!=(e=null==r?void 0:r.placement)?e:"bottom"},o=()=>{var e;return null!=(e=null==r?void 0:r.strategy)?e:"absolute"},[s,i]=gt({x:null,y:null,placement:n(),strategy:o(),middlewareData:{}}),[a,c]=gt();bt((()=>{let e=a();if(e)throw e.value}));let l=wt((()=>(e(),t(),{})));function u(){let s=e(),a=t();if(s&&a){let e=l();bc(s,a,{middleware:null==r?void 0:r.middleware,placement:n(),strategy:o()}).then((t=>{e===l()&&i(t)}),(e=>{c(e)}))}}return bt((()=>{let s=e(),i=t();if(null==r||r.middleware,n(),o(),s&&i)if(null!=r&&r.whileElementsMounted){let e=r.whileElementsMounted(s,i,u);e&&Et(e)}else u()})),{get x(){return s().x},get y(){return s().y},get placement(){return s().placement},get strategy(){return s().strategy},get middlewareData(){return s().middlewareData},update:u}}(p,d,{whileElementsMounted:yc,placement:"bottom-end"});r.connectionRestored.then((()=>l(!1)));const m=t.onStatusChange((e=>{if(!e)return o(!1),i(null),void l(!1);i(e.account),l(!1)})),y=e=>{if(!s()||!n())return;const t=p().contains(e.target),r=u.contains(e.target);t||r||o(!1)};return Pt((()=>{document.body.addEventListener("click",y)})),Et((()=>{document.body.removeEventListener("click",y),m()})),$t(_r,{component:qr,get children(){return[$t(er,{get when(){return a()},get children(){return $t(Oa,{disabled:!0,"data-tc-connect-button-loading":"true",get children(){return $t(Ma,{})}})}}),$t(er,{get when(){return!a()},get children(){return[$t(er,{get when(){return!s()},get children(){return $t(xa,{onClick:()=>r.openModal(),"data-tc-connect-button":"true",scale:"s",get children(){return[$t(Ys,{get fill(){return e.colors.connectButton.foreground}}),$t(Is,{translationKey:"button.connectWallet",fontSize:"15px",lineHeight:"18px",fontWeight:"590",get color(){return e.colors.connectButton.foreground},children:"Connect wallet"})]}})}}),$t(er,{get when(){return s()},get children(){return $t(Wa,{get children(){return[$t(Ba,{onClick:()=>o((e=>!e)),ref:f,"data-tc-dropdown-button":"true",scale:"s",get children(){return[$t(Is,{fontSize:"15px",fontWeight:"590",lineHeight:"18px",get children(){return(()=>{const e=s();if(e){const t=Se(e.address,e.chain===c.TESTNET);return t.slice(0,4)+"â¦"+t.slice(-4)}return""})()}}),$t(jo,{direction:"bottom"})]}}),$t(kr,{get children(){const e=Tt((()=>document.importNode(wc,!0)));return gr(h,e),e.style.setProperty("z-index","999"),e._$owner=ct,mr(e,$t(Io,{onBeforeEnter:e=>{Jo(e,[{opacity:0,transform:"translateY(-8px)"},{opacity:1,transform:"translateY(0)"}],{duration:150})},onExit:(e,t)=>
1329{Jo(e,[{opacity:1,transform:"translateY(0)"},{opacity:0,transform:"translateY(-8px)"}],{duration:150}).finished.then(t)},get children(){return $t(er,{get when(){return n()},get children(){return $t(ja,{get hidden(){return!n()},onClose:()=>o(!1),ref(e){"function"==typeof u?u(e):u=e}})}})}}),null),mr(e,$t(Ra,{}),null),yt((t=>{var r,n;const o=g.strategy,s=`${null!=(r=g.y)?r:0}px`,i=`${null!=(n=g.x)?n:0}px`;return o!==t._v$&&e.style.setProperty("position",t._v$=o),s!==t._v$2&&e.style.setProperty("top",t._v$2=s),i!==t._v$3&&e.style.setProperty("left",t._v$3=i),t}),{_v$:void 0,_v$2:void 0,_v$3:void 0}),e}})]}})}})]}})]}})},Ac=zr(ts)` 1330 padding-left: 24px; 1331 padding-right: 24px; 1332 padding-top: 18px; 1333 padding-bottom: 0; 1334 1335 ${wo("mobile")} { 1336 padding-left: 0; 1337 padding-right: 0; 1338 1339 min-height: 364px; 1340 } 1341`,Tc=zr(Vs)` 1342 margin-top: 12px; 1343 1344 ${wo("mobile")} { 1345 padding: 0 10px; 1346 } 1347`,Pc=zr.div` 1348 margin: 30px 0; 1349 width: 100%; 1350 display: flex; 1351 justify-content: center; 1352 1353 ${wo("mobile")} { 1354 height: 160px; 1355 align-items: center; 1356 } 1357`;zr(Is)` 1358 min-width: 84px; 1359 text-align: center; 1360 font-weight: 590; 1361`,zr((e=>{const t="tabBar"+Math.floor(1e4*Math.random());return $t(os,{get class(){return e.class},"data-tc-tab-bar":"true",get children(){return[$t(ss,{get right(){return 1===e.selectedTabIndex}}),$t(as,{get isActive(){return 0===e.selectedTabIndex},get children(){return[$t(is,{type:"radio",name:t,get checked(){return 0===e.selectedTabIndex},onInput:()=>{var t;return null==(t=e.onSelectedTabIndexChange)?void 0:t.call(e,0)}}),wt((()=>e.tab1))]}}),$t(as,{get isActive(){return 1===e.selectedTabIndex},get children(){return[$t(is,{type:"radio",get checked(){return 1===e.selectedTabIndex},name:t,onInput:()=>{var t;return null==(t=e.onSelectedTabIndexChange)?void 0:t.call(e,1)}}),wt((()=>e.tab2))]}})]}})}))` 1362 margin: 0 auto 22px; 1363`;const[Ec,Cc]=Kn({buttonRootId:null,language:"en",returnStrategy:"back",twaReturnUrl:void 0,walletsListConfiguration:{},enableAndroidBackHandler:!0});function kc(e){return"jsBridgeKey"in e?Ze(Qe({},e),{injected:Ie.isWalletInjected(e.jsBridgeKey),embedded:Ie.isInsideWalletBrowser(e.jsBridgeKey)}):e}function _c(e,t){var r,n,o,s;return t?((null==(r=t.includeWallets)?void 0:r.length)&&(n="name",o=e,s=t.includeWallets.map(kc),e=o.map((e=>{const t=s.find((t=>t[n]===e[n]));return s=s.filter((t=>t[n]!==e[n])),void 0===t?e:t})).concat(s)),e):e}function Ic(e){return e.platforms.some((e=>["macos","linux","windows"].includes(e)))}function Sc(e){return e.platforms.some((e=>["ios","android"].includes(e)))}function xc(e){return e.platforms.some((e=>["chrome","firefox","safari"].includes(e)))}function Bc(e,t){return!!t&&(e.name.toLowerCase()===t.toLowerCase()||e.appName.toLowerCase()===t.toLowerCase())}const Oc=zr.div` 1364 display: flex; 1365 flex-direction: column; 1366 align-items: center; 1367`,Mc=zr(Vs)` 1368 margin-bottom: 18px; 1369`;zr.div` 1370 height: 1px; 1371 margin: 0 -24px; 1372 width: calc(100% + 48px); 1373 opacity: 0.12; 1374 background: ${e=>e.isShown?e.theme.colors.icon.secondary:"transparent"}; 1375 transition: background 0.15s ease-in-out; 1376 1377 ${wo("mobile")} { 1378 width: 100%; 1379 } 1380`;const Wc=zr.ul` 1381 display: grid; 1382 grid-template-columns: repeat(auto-fit, 92px); 1383 grid-template-rows: auto; 1384 align-content: flex-start; 1385 justify-content: center; 1386 row-gap: 8px; 1387 width: 100%; 1388 padding: 0 0 16px; 1389 align-self: flex-start; 1390 max-width: 400px; 1391 margin: 0 auto; 1392 list-style: none; 1393 1394 > li { 1395 display: block; 1396 height: fit-content; 1397 } 1398 1399 ${wo("mobile")} { 1400 display: grid; 1401 grid-template-columns: repeat(4, 1fr); 1402 gap: 0; 1403 padding: 8px 12px 16px; 1404 max-width: none; 1405 1406 > li { 1407 min-width: 78px; 1408 display: flex; 1409 } 1410 1411 > li > * { 1412 width: 100%; 1413 } 1414 } 1415`;zr(ko)` 1416 display: block; 1417 margin: 0 auto 1px; 1418 font-size: 15px; 1419`;const jc=zr(Do)` 1420 position: absolute; 1421 top: 16px; 1422 left: 16px; 1423`,Rc=zr(qi)` 1424 height: 100%; 1425`,Nc=dr("<li></li>"),Uc=e=>$t(Oc,{"data-tc-wallets-modal-list":"true",get children(){return[$t(jc,{icon:"arrow",onClick:()=>e.onBack()}),$t(Mc,{translationKey:"walletModal.wallets",children:"Wallets"}),$t(Zi,{get maxHeight(){return Yi()?void 0:510},get children(){return $t(Wc,{get children(){return $t(Xt,{get each(){return Yi()?e.walletsList.filter(Sc):e.walletsList},children:t=>(()=>{const r=Nc.cloneNode(!0);return mr(r,$t(Rc,{wallet:t,onClick:()=>e.onSelect(t)})),r})()})}})}})]}}),Dc={m:"16px",s:"12px",none:"0"},Lc={m:"6px",s:"6px",none:"0"},Fc=zr.div` 1426 display: flex; 1427 flex-direction: column; 1428`,zc=zr.div` 1429 flex: 1; 1430 margin-top: ${e=>e.qr?"0":"18px"}; 1431 display: flex; 1432 flex-direction: column; 1433 align-items: center; 1434 justify-content: center; 1435 min-height: 232px; 1436`,Vc=zr(Ts)` 1437 margin-bottom: 24px; 1438`,qc=zr(Vs)` 1439 max-width: 288px; 1440 margin: 0 auto 2px; 1441`,Hc=zr(Hs)` 1442 max-width: 288px; 1443 text-align: center; 1444 margin: 0 auto 20px; 1445`,Kc=zr(Do)` 1446 position: absolute; 1447 top: 16px; 1448 left: 16px; 1449`,$c=zr.div` 1450 display: flex; 1451 justify-content: center; 1452 gap: 8px; 1453 padding-bottom: 16px; 1454`,Gc=zr($c)` 1455 padding-bottom: 0; 1456`,Yc=zr(ko)` 1457 margin-bottom: 24px; 1458`,Jc=zr(ai)` 1459 margin-bottom: 18px; 1460 margin-top: 2px; 1461`,Qc=zr(ni)` 1462 margin-bottom: 16px; 1463`,Zc=zr(Hs)` 1464 color: ${e=>e.theme.colors.text.secondary}; 1465 text-align: center; 1466 margin-bottom: 20px; 1467`,Xc=zr(ko)` 1468 margin-top: -8px; 1469 margin-bottom: 24px; 1470 width: 100%; 1471 padding: 12px 12px 12px 20px; 1472 border-radius: ${e=>Dc[e.theme.borderRadius]}; 1473 font-size: 16px; 1474 line-height: 20px; 1475`,el=zr(no)` 1476 width: 32px; 1477 height: 32px; 1478 border-radius: ${e=>Lc[e.theme.borderRadius]}; 1479`,tl=e=>{const[t]=ks();return wt((()=>{var r;return t(e.translationKey,e.translationValues,null==(r=e.children)?void 0:r.toString())}))};function rl(e,t){let r;r="string"==typeof t?t:co()?t.twaReturnUrl||t.returnStrategy:"none";const n=function(e,t,r){const n=new URL(e);return n.searchParams.append(t,r),n.toString()}(e,"ret",r);if(!D(e))return n;const o=n.slice(n.lastIndexOf("&")+1);return n.slice(0,n.lastIndexOf("&"))+"-"+L(o)}function nl(e,t){t=Qe({},t);const r=function(e){const t=new URL(e);t.searchParams.has("attach")&&(t.searchParams.delete("attach"),t.pathname+="/start");return t.toString()}(e),n=new URL(r);if(n.searchParams.has("startapp")||n.searchParams.append("startapp","tonconnect"),lo()){t.returnStrategy="back";tn(rl(n.toString(),t.returnStrategy))}else if(co())if(ao("ios","android","macos","tdesktop","web")){t.returnStrategy="back";ho(rl(n.toString(),t.returnStrategy))}else ao("weba")?ho(rl(n.toString(),t)):tn(rl(n.toString(),t));else if(ln("ios")){"back"===t.returnStrategy&&(un("safari")?t.returnStrategy="back":un("chrome")?t.returnStrategy="googlechrome://":un("firefox")?t.returnStrategy="firefox://":un("opera")?t.returnStrategy="opera-http://":t.returnStrategy=location.href);const e=un("chrome"),r=un("firefox");if((e||r)&&!t.forceRedirect){const e=rl(n.toString(),t.returnStrategy);rn(sl(e),(()=>tn(e)))}else{tn(rl(n.toString(),t.returnStrategy))}}else if(ln("android")){t.returnStrategy="back";const e=un("chrome"),r=un("firefox");if((e||r)&&!t.forceRedirect){const e=rl(n.toString(),t.returnStrategy);rn(sl(e),(()=>tn(e)))}else{tn(rl(n.toString(),t.returnStrategy))}}else if(ln("ipad")){"back"===t.returnStrategy&&(un("safari")?t.returnStrategy="back":un("chrome")?t.returnStrategy="googlechrome://":un("firefox")?t.returnStrategy="firefox://":un("opera")?t.returnStrategy="opera-http://":t.returnStrategy=location.href);const e=un("chrome"),r=un("firefox"),o=(e||r)&&!t.forceRedirect,s=rl(n.toString(),t.returnStrategy);if(o){rn(sl(s),(()=>tn(s)))}else tn(s)}else if(ln("macos","windows","linux")){t.returnStrategy="back",t.twaReturnUrl=void 0;const e=rl(n.toString(),t.returnStrategy);if(t.forceRedirect)tn(e);else{rn(sl(e),(()=>tn(e)))}}else tn(rl(n.toString(),t))}function ol(e,t,r,n){if(r=Qe({},r),lo())if(ln("ios","android"))"back"===r.returnStrategy&&(r.returnStrategy="tg://resolve"),n("universal-link"),en(rl(e,r.returnStrategy),"_self");else{n("universal-link");tn(rl(e,r.returnStrategy))}else if(co())if(ao("ios","android")){"back"===r.returnStrategy&&(r.returnStrategy="tg://resolve"),n("universal-link");const t=rl(e,r.returnStrategy);ho(t,(()=>{n("universal-link"),tn(t)}))}else if(ao("macos","tdesktop")){"back"===r.returnStrategy&&(r.returnStrategy="tg://resolve");const o=rl(e,r.returnStrategy);!!t&&!r.forceRedirect?(n("custom-deeplink"),rn(dn(o,t),(()=>{n("universal-link"),tn(o)}))):(n("universal-link"),tn(o))}else if(ao("weba")){"back"===r.returnStrategy&&(un("safari")?r.returnStrategy=location.href:un("chrome")?r.returnStrategy="googlechrome://":un("firefox")?r.returnStrategy="firefox://":un("opera")?r.returnStrategy="opera-http://":r.returnStrategy=location.href);const o=rl(e,r.returnStrategy);!!t&&!r.forceRedirect?(n("custom-deeplink"),rn(dn(o,t),(()=>{n("universal-link"),tn(o)}))):(n("universal-link"),tn(o))}else if(ao("web")){"back"===r.returnStrategy&&(un("safari")?r.returnStrategy=location.href:un("chrome")?r.returnStrategy="googlechrome://":un("firefox")?r.returnStrategy="firefox://":un("opera")?r.returnStrategy="opera-http://":r.returnStrategy=location.href);const o=rl(e,r.returnStrategy);!!t&&!r.forceRedirect?(n("custom-deeplink"),rn(dn(o,t),(()=>{n("universal-link"),tn(o)}))):(n("universal-link"),tn(o))}else{n("universal-link");tn(rl(e,r.returnStrategy))}else if(ln("ios"))"back"===r.returnStrategy&&(un("safari")?r.returnStrategy="none":un("chrome")?r.returnStrategy="googlechrome://":un("firefox")?r.returnStrategy="firefox://":un("opera")?r.returnStrategy="opera-http://":r.returnStrategy=location.href),un("chrome")?(n("universal-link"),en(rl(e,r.returnStrategy),"_self")):(n("universal-link"),tn(rl(e,r.returnStrategy)));else if(ln("android"))"back"===r.returnStrategy&&(un("chrome")?r.returnStrategy="googlechrome://":un("firefox")?r.returnStrategy="firefox://":un("opera")?r.returnStrategy="opera-http://":r.returnStrategy=location.href),n("universal-link"),tn(rl(e,r.returnStrategy));else if(ln("ipad"))"back"===r.returnStrategy&&(un("safari")?r.returnStrategy="none":un("chrome")?r.returnStrategy="googlechrome://":un("firefox")?r.returnStrategy="firefox://":un("opera")?r.returnStrategy="opera-http://":r.returnStrategy=location.href),un("chrome")?(n("universal-link"),en(rl(e,r.returnStrategy),"_self")):(n("universal-link"),tn(rl(e,r.returnStrategy)));else if(ln("macos","windows","linux")){"back"===r.returnStrategy&&(un("safari")?r.returnStrategy="none":un("chrome")?r.returnStrategy="googlechrome://":un("firefox")?r.returnStrategy="firefox://":un("opera")?r.returnStrategy="opera-http://":r.returnStrategy="none");const o=rl(e,r.returnStrategy);!!t&&!r.forceRedirect?(n("custom-deeplink"),rn(dn(o,t),(()=>{n("universal-link"),tn(o)}))):(n("universal-link"),tn(o))}else n("universal-link"),tn(rl(e,r.returnStrategy))}function sl(e){const t=new URL(e),[,r,n]=t.pathname.split("/");return`tg://resolve?domain=${r}&appname=${n}&startapp=${t.searchParams.get("startapp")}`}const il=e=>{const[t,r]=gt("mobile"),[n,o]=gt(!1),[s,i]=gt(),[a,c]=gt(!0),l=_t(Bn);Et(l.onStatusChange((()=>{}),(()=>{e.wallet.appName!==Fi&&o(!0)})));const u=()=>{try{const t=l.connect({universalLink:e.wallet.universalLink,bridgeUrl:e.wallet.bridgeUrl},e.additionalRequest);i(t)}catch(e){}};bt((()=>{"extension"!==Tt(t)&&(Sc(e.wallet)||Ic(e.wallet))&&u()}));const d=()=>{o(!1),"extension"===t()&&u(),r("mobile"),Cn(Ze(Qe({},e.wallet),{openMethod:"qrcode"}))},h=()=>
1479{if(o(!1),"extension"===t()&&u(),r("desktop"),D(s()))p();else{const t=!a();c(!1),ol(s(),e.wallet.deepLink,{returnStrategy:Ec.returnStrategy,forceRedirect:t},(t=>{Cn(Ze(Qe({},e.wallet),{openMethod:t}))}))}},p=()=>{const t=!a();c(!1),Cn(Ze(Qe({},e.wallet),{openMethod:"universal-link"})),nl(s(),{returnStrategy:Ec.returnStrategy,twaReturnUrl:Ec.twaReturnUrl,forceRedirect:t})},f=()=>{o(!1),r("extension"),se(e.wallet)&&(Cn(e.wallet),l.connect({jsBridgeKey:e.wallet.jsBridgeKey},e.additionalRequest))};return Sc(e.wallet)?d():xc(e.wallet)?f():h(),$t(Fc,{"data-tc-wallets-modal-connection-desktop":"true",get children(){return[$t(er,{get when(){return!e.backDisabled},get children(){return $t(Kc,{icon:"arrow",onClick:()=>e.onBackClick()})}}),$t(qc,{get children(){return e.wallet.name}}),$t(er,{get when(){return"mobile"===t()},get children(){return $t(Hc,{translationKey:"walletModal.desktopConnectionModal.scanQR",get translationValues(){return{name:e.wallet.name}},get children(){return["Scan the QR code below with your phoneâs or ",wt((()=>e.wallet.name)),"âs camera"]}})}}),$t(zc,{get qr(){return"mobile"===t()},get children(){return $t(tr,{get children(){return[$t(rr,{get when(){return"mobile"===t()},get children(){return $t(Vc,{disableCopy:!1,get sourceUrl(){return rl(s(),"none")},get imageUrl(){return e.wallet.imageUrl}})}}),$t(rr,{get when(){return n()},get children(){return[$t(Qc,{size:"s"}),$t(Zc,{translationKey:"walletModal.desktopConnectionModal.connectionDeclined",children:"Connection declined"}),$t($c,{get children(){return $t(ko,{get leftIcon(){return $t(wi,{})},get onClick(){return"extension"===t()?f:h},get children(){return $t(tl,{translationKey:"common.retry",children:"Retry"})}})}})]}}),$t(rr,{get when(){return"extension"===t()},get children(){return[$t(er,{get when(){return se(e.wallet)},get children(){return[$t(Jc,{size:"s"}),$t(Zc,{translationKey:"walletModal.desktopConnectionModal.continueInExtension",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",wt((()=>e.wallet.name))," browser extensionâ¦"]}}),$t($c,{get children(){return $t(ko,{get leftIcon(){return $t(wi,{})},onClick:f,get children(){return $t(tl,{translationKey:"common.retry",children:"Retry"})}})}})]}}),$t(er,{get when(){return!se(e.wallet)},get children(){return[$t(Zc,{translationKey:"walletModal.desktopConnectionModal.dontHaveExtension",get translationValues(){return{name:e.wallet.name}},get children(){return["Seems you don't have installed ",wt((()=>e.wallet.name))," browser extension"]}}),$t($c,{get children(){return $t(ea,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return $t(ko,{get rightIcon(){return $t(Ai,{})},onClick:f,get children(){return $t(tl,{translationKey:"walletModal.desktopConnectionModal.getWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Get ",wt((()=>e.wallet.name))]}})}})}})}})]}})]}}),$t(rr,{get when(){return"desktop"===t()},get children(){return[$t(ai,{size:"m"}),$t(Zc,{translationKey:"walletModal.desktopConnectionModal.continueOnDesktop",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",wt((()=>e.wallet.name))," on desktopâ¦"]}}),$t($c,{get children(){return[$t(ko,{get leftIcon(){return $t(wi,{})},onClick:h,get children(){return $t(tl,{translationKey:"common.retry",children:"Retry"})}}),$t(ea,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return $t(ko,{get rightIcon(){return $t(Ai,{})},get children(){return $t(tl,{translationKey:"walletModal.desktopConnectionModal.getWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Get ",wt((()=>e.wallet.name))]}})}})}})]}})]}})]}})}}),$t(er,{get when(){return e.wallet.appName===Fi},get children(){return $t(Xc,{get rightIcon(){return $t(el,{get src(){return Vi}})},scale:"s",onClick:p,get children(){return $t(tl,{translationKey:"walletModal.desktopConnectionModal.openWalletOnTelegram",children:"Open Wallet in Telegram on desktop"})}})}}),$t(er,{get when(){return e.wallet.appName!==Fi},get children(){return $t(Gc,{get children(){return[$t(er,{get when(){return wt((()=>
1479"mobile"!==t()))()&&Sc(e.wallet)},get children(){return $t(Yc,{appearance:"secondary",get leftIcon(){return $t(gi,{})},onClick:d,get children(){return $t(tl,{translationKey:"common.mobile",children:"Mobile"})}})}}),$t(er,{get when(){return wt((()=>"extension"!==t()))()&&xc(e.wallet)},get children(){return $t(Yc,{appearance:"secondary",get leftIcon(){return $t(pi,{})},onClick:f,get children(){return $t(tl,{translationKey:"common.browserExtension",children:"Browser Extension"})}})}}),$t(er,{get when(){return wt((()=>"desktop"!==t()))()&&Ic(e.wallet)},get children(){return $t(Yc,{appearance:"secondary",get leftIcon(){return $t(yi,{})},onClick:h,get children(){return $t(tl,{translationKey:"common.desktop",children:"Desktop"})}})}})]}})}})]}})},al=zr.div``,cl=zr(Do)` 1480 position: absolute; 1481 top: 16px; 1482 left: 16px; 1483`,ll=zr(Vs)` 1484 margin-bottom: 18px; 1485`,ul=zr.div` 1486 padding: 16px 0; 1487 display: flex; 1488 flex-direction: column; 1489 align-items: center; 1490`,dl=Rr` 1491 margin-bottom: 12px; 1492`,hl=zr($s)` 1493 text-align: center; 1494 margin-bottom: 4px; 1495`,pl=zr(Is)` 1496 text-align: center; 1497 max-width: 352px; 1498 color: ${e=>e.theme.colors.text.secondary}; 1499`,fl=zr.div` 1500 padding: 16px 24px 24px; 1501 display: flex; 1502 align-items: center; 1503 justify-content: center; 1504 gap: 8px; 1505`,gl="https://ton.org/wallets?filters[wallet_features][slug][$in]=dapp-auth&pagination[limit]=-1",ml=e=>$t(al,{"data-tc-wallets-modal-info":"true",get children(){return[$t(cl,{icon:"arrow",onClick:()=>e.onBackClick()}),$t(ll,{translationKey:"walletModal.infoModal.whatIsAWallet",children:"What is a wallet"}),$t(Zi,{get children(){return[$t(ul,{get children(){return[$t(Ci,{class:dl}),$t(hl,{translationKey:"walletModal.infoModal.secureDigitalAssets",children:"Secure digital assets storage"}),$t(pl,{translationKey:"walletModal.infoModal.walletProtects",children:"A wallet protects and manages your digital assets including TON, tokens and collectables."})]}}),$t(ul,{get children(){return[$t(_i,{class:dl}),$t(hl,{translationKey:"walletModal.infoModal.controlIdentity",children:"Control your Web3 identity"}),$t(pl,{translationKey:"walletModal.infoModal.manageIdentity",children:"Manage your digital identity and access decentralized applications with ease. Maintain control over your data and engage securely in the blockchain ecosystem."})]}}),$t(ul,{get children(){return[$t(Si,{class:dl}),$t(hl,{translationKey:"walletModal.infoModal.effortlessCryptoTransactions",children:"Effortless crypto transactions"}),$t(pl,{translationKey:"walletModal.infoModal.easilySend",children:"Easily send, receive, monitor your cryptocurrencies. Streamline your operations with decentralized applications."})]}}),$t(fl,{get children(){return $t(ea,{get href(){return gl},blank:!0,get children(){return $t(ko,{get rightIcon(){return $t(Pi,{})},get children(){return $t(tl,{translationKey:"walletModal.infoModal.getAWallet",children:"Get a Wallet"})}})}})}})]}})]}}),yl=zr.div``,bl=zr.div` 1506 flex: 1; 1507 margin-top: 18px; 1508 display: flex; 1509 flex-direction: column; 1510 align-items: center; 1511 justify-content: center; 1512 min-height: 232px; 1513`,wl=zr(Vs)` 1514 max-width: 262px; 1515 margin: 0 auto 8px; 1516`,vl=zr(Do)` 1517 position: absolute; 1518 top: 16px; 1519 left: 16px; 1520`,Al=zr.div` 1521 padding: 16px; 1522 display: flex; 1523 align-items: center; 1524 gap: 12px; 1525 border-top: 0.5px solid ${e=>Gr(e.theme.colors.icon.secondary,.2)}; 1526`,Tl=zr(no)` 1527 width: 36px; 1528 height: 36px; 1529 border-radius: 10px; 1530`,Pl=zr(ea)` 1531 margin-left: auto; 1532`,El=zr(ai)` 1533 margin-bottom: 18px; 1534 margin-top: 2px; 1535`,Cl=zr(ni)` 1536 margin-bottom: 16px; 1537`,kl=zr(Hs)` 1538 color: ${e=>e.theme.colors.text.secondary}; 1539 text-align: center; 1540 margin-bottom: 20px; 1541`,_l=zr.div` 1542 display: flex; 1543 justify-content: center; 1544 gap: 8px; 1545 padding-bottom: 16px; 1546`,Il={m:"16px",s:"8px",none:"0"},Sl=zr(Vs)` 1547 margin-bottom: 2px; 1548 padding: 0 52px; 1549`,xl=zr(Hs)` 1550 margin-bottom: 20px; 1551 padding: 0 64px; 1552`,Bl=zr.div` 1553 padding: 0 24px 16px; 1554`,Ol=zr.div` 1555 display: flex; 1556 flex-direction: row; 1557 gap: 16px; 1558 padding: 0 24px 24px; 1559 margin-top: 0; 1560`,Ml=zr(ko)` 1561 width: 100%; 1562 height: 56px; 1563 border-radius: ${e=>Il[e.theme.borderRadius]}; 1564 background-color: ${e=>Gr(e.theme.colors.accent,.12)}; 1565 color: ${e=>e.theme.colors.accent}; 1566 font-size: 16px; 1567 line-height: 20px; 1568 font-weight: 500; 1569 padding: 17px 20px 19px 20px; 1570`,Wl=e=>[$t(Sl,{get children(){return e.walletInfo.name}}),$t(xl,{translationKey:"walletModal.mobileConnectionModal.scanQR",get translationValues(){return{name:e.walletInfo.name}},get children(){return["Scan the QR code below with your phoneâs or ",wt((()=>e.walletInfo.name)),"âs camera"]}}),$t(Bl,{get children(){return $t(Ts,{get imageUrl(){return e.walletInfo.imageUrl},get sourceUrl(){return rl(e.universalLink,"none")},disableCopy:!0})}}),$t(Ol,{get children(){return[$t(Ml,{appearance:"secondary",onClick:()=>{var t;return null==(t=e.onOpenLink)?void 0:t.call(e)},get children(){return $t(tl,{translationKey:"walletModal.mobileUniversalModal.openLink",children:"Open Link"})}}),$t(Ml,{appearance:"secondary",onClick:()=>{var t;return null==(t=e.onCopy)?void 0:t.call(e)},get children(){return $t(tl,{get translationKey(){return void 0!==e.isCopiedShown?"common.copied":"common.copyLink"},get children(){return void 0!==e.isCopiedShown?"Copied":"Copy Link"}})}})]}})],jl=e=>{const t=Lr(),[r,n]=gt(!0),[o,s]=gt(!1),[i,a]=gt(!1),c=_t(Bn),l=c.onStatusChange((()=>{}),(()=>{a(!0)})),u=wt((()=>c.connect({universalLink:e.wallet.universalLink,bridgeUrl:e.wallet.bridgeUrl},e.additionalRequest))),d=()=>
1570{if(D(u()))return Cn(Ze(Qe({},e.wallet),{openMethod:"universal-link"})),void nl(u(),{returnStrategy:Ec.returnStrategy,twaReturnUrl:Ec.twaReturnUrl,forceRedirect:!0});a(!1);const t=!r();n(!1),ol(u(),e.wallet.deepLink,{returnStrategy:Ec.returnStrategy,forceRedirect:t},(t=>{Cn(Ze(Qe({},e.wallet),{openMethod:t}))}))},[h,p]=gt(void 0),f=()=>et(void 0,null,(function*(){void 0!==h()&&clearTimeout(h()),yield vs(u());const e=setTimeout((()=>p(void 0)),1500);p(e)})),g=()=>{a(!1),s(!0),Cn(Ze(Qe({},e.wallet),{openMethod:"qrcode"}))},m=()=>{o()?(s(!1),Cn(Ze(Qe({},e.wallet),{openMethod:"universal-link"}))):e.onBackClick()};return Et(l),d(),$t(yl,{"data-tc-wallets-modal-connection-mobile":"true",get children(){return[$t(er,{get when(){return!e.backDisabled||o()},get children(){return $t(vl,{icon:"arrow",onClick:m})}}),$t(er,{get when(){return o()},get children(){return $t(Wl,{get universalLink(){return u()},get walletInfo(){return e.wallet},onOpenLink:d,onCopy:f,get isCopiedShown(){return h()}})}}),$t(er,{get when(){return!o()},get children(){return[$t(wl,{get children(){return e.wallet.name}}),$t(bl,{get children(){return[$t(er,{get when(){return i()},get children(){return[$t(Cl,{size:"s"}),$t(kl,{translationKey:"walletModal.mobileConnectionModal.connectionDeclined",children:"Connection declined"}),$t(_l,{get children(){return[$t(ko,{get leftIcon(){return $t(wi,{})},onClick:d,get children(){return $t(tl,{translationKey:"common.retry",children:"Retry"})}}),$t(ko,{get leftIcon(){return $t(ji,{get fill(){return t.colors.accent}})},onClick:g,get children(){return $t(tl,{translationKey:"walletModal.mobileConnectionModal.showQR",children:"Show QR Code"})}})]}})]}}),$t(er,{get when(){return!i()},get children(){return[$t(El,{size:"s"}),$t(kl,{translationKey:"walletModal.mobileConnectionModal.continueIn",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",wt((()=>e.wallet.name)),"â¦"]}}),$t(_l,{get children(){return[$t(ko,{get leftIcon(){return $t(wi,{})},onClick:d,get children(){return $t(tl,{translationKey:"common.retry",children:"Retry"})}}),$t(ko,{get leftIcon(){return $t(ji,{get fill(){return t.colors.accent}})},onClick:g,get children(){return $t(tl,{translationKey:"walletModal.mobileConnectionModal.showQR",children:"Show QR Code"})}})]}})]}})]}}),$t(Al,{get children(){return[$t(Tl,{get src(){return e.wallet.imageUrl}}),$t($s,{get children(){return e.wallet.name}}),$t(Pl,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return $t(ko,{get children(){return $t(tl,{translationKey:"common.get",children:"GET"})}})}})]}})]}})]}})},Rl={m:"16px",s:"12px",none:"0"},Nl={m:"6px",s:"6px",none:"0"};zr.li` 1571 width: 82px; 1572 min-width: 82px; 1573 height: 124px; 1574 display: flex; 1575 flex-direction: column; 1576 align-items: center; 1577 padding: 8px 4px; 1578 1579 text-align: center; 1580 cursor: pointer; 1581 1582 transition: transform 0.1s ease-in-out; 1583 1584 ${Ao} { 1585 &:hover { 1586 transform: scale(1.04); 1587 } 1588 } 1589 1590 &:active { 1591 transform: scale(0.96); 1592 } 1593 1594 ${vo} { 1595 &:active { 1596 transform: scale(0.92); 1597 } 1598 } 1599`;const Ul=zr(Vs)` 1600 margin-top: 38px; 1601 margin-bottom: 4px; 1602 padding: 0 24px; 1603`,Dl=zr(Hs)` 1604 margin: ${e=>{var t;return null!=(t=e.margin)?t:"0 0 28px 0"}}; 1605 padding: ${e=>{var t;return null!=(t=e.padding)?t:"0 24px"}}; 1606 min-height: ${e=>{var t;return null!=(t=e.padding)?t:"44px"}}; 1607 max-width: ${e=>e.maxWidth}px; 1608 margin-left: ${e=>e.maxWidth?"auto":"0px"}; 1609 margin-right: ${e=>e.maxWidth?"auto":"0px"}; 1610`;zr(ko)` 1611 display: block; 1612 margin: 0 auto; 1613`;const Ll=zr(ko)` 1614 margin: 0 28px 24px; 1615 width: calc(100% - 56px); 1616 border-radius: ${e=>Rl[e.theme.borderRadius]}; 1617 padding: 14px 16px 14px 14px; 1618 background-color: ${e=>e.theme.colors.telegramButton}; 1619 1620 color: ${e=>e.theme.colors.constant.white}; 1621 font-weight: 500; 1622 font-size: 16px; 1623 line-height: 20px; 1624 1625 @media (max-width: 375px) { 1626 margin: 0 16px 24px; 1627 width: calc(100% - 32px); 1628 } 1629`,Fl=zr(no)` 1630 background-color: transparent; 1631 border-radius: ${e=>Nl[e.theme.borderRadius]}; 1632 width: 24px; 1633 height: 24px; 1634`,zl=zr(Do)` 1635 position: absolute; 1636 top: 16px; 1637 left: 16px; 1638`,Vl={m:"16px",s:"8px",none:"0"},ql=zr(Vs)` 1639 margin-bottom: 2px; 1640 padding: 0 52px; 1641`,Hl=zr(Hs)` 1642 margin-bottom: 20px; 1643 padding: 0 64px; 1644`,Kl=zr.div` 1645 padding: 0 24px 16px; 1646`,$l=zr.div` 1647 display: flex; 1648 flex-direction: row; 1649 gap: 16px; 1650 padding: 0 24px 24px; 1651 margin-top: 0; 1652`,Gl=zr(ko)` 1653 width: 100%; 1654 height: 56px; 1655 border-radius: ${e=>Vl[e.theme.borderRadius]}; 1656 background-color: ${e=>Gr(e.theme.colors.accent,.12)}; 1657 color: ${e=>e.theme.colors.accent}; 1658 font-size: 16px; 1659 line-height: 20px; 1660 font-weight: 500; 1661 padding: 17px 20px 19px 20px; 1662`,Yl=e=>[$t(ql,{translationKey:"walletModal.mobileUniversalModal.connectYourWallet",children:"Connect your TON wallet"}),$t(Hl,{translationKey:"walletModal.mobileUniversalModal.scan",children:"Scan with your mobile wallet"}),$t(Kl,{get children(){return $t(Ts,{get imageUrl(){return zi},get sourceUrl(){return rl(e.universalLink,"none")},disableCopy:!0})}}),$t($l,{get children(){return[$t(Gl,{appearance:"secondary",onClick:()=>e.onOpenLink(),get children(){return $t(tl,{translationKey:"walletModal.mobileUniversalModal.openLink",children:"Open Link"})}}),$t(Gl,{appearance:"secondary",onClick:()=>e.onCopy(),get children(){return $t(tl,{get translationKey(){return void 0!==e.isCopiedShown?"common.copied":"common.copyLink"},get children(){return void 0!==e.isCopiedShown?"Copied":"Copy Link"}})}})]}})];function Jl(e){const t=new Set(e.filter(ae).map((e=>e.bridgeUrl)));return Array.from(t).map((e=>({bridgeUrl:e})))}function Ql(e,t){const r=new Set(null==e?void 0:e.map((e=>e.bridgeUrl))),n=new Set(null==t?void 0:t.map((e=>e.bridgeUrl)));return r.size===n.size&&[...r].every((e=>n.has(e)))}const Zl=dr("<li></li>"),Xl=dr('<div data-tc-wallets-modal-universal-mobile="true"></div>'),eu=e=>{const[t,r]=gt(!1),[n,o]=gt(!0),[s,i]=gt(null),a=Ec.connector,c=()=>e.walletsList.filter((e=>
1662Sc(e)&&e.appName!==Fi)),l=()=>c().length>7,u=wt((()=>Jl(e.walletsList)),null,{equals:Ql}),d=()=>(s()||i(a.connect(u(),e.additionalRequest)),s());Cn({openMethod:"universal-link"});const[h,p]=gt(void 0),f=()=>et(void 0,null,(function*(){void 0!==h()&&clearTimeout(h()),yield vs(d());const e=setTimeout((()=>p(void 0)),1500);p(e)})),g=()=>{const e=!n();o(!1),ol(d(),void 0,{returnStrategy:Ec.returnStrategy,forceRedirect:e},(e=>{Cn({openMethod:e})}))},m=()=>{i(null);const t=e.walletsList.find((e=>e.appName===Fi));if(!t||!ae(t))throw new Zr("@wallet bot not found in the wallets list");const r=a.connect({bridgeUrl:t.bridgeUrl,universalLink:t.universalLink},e.additionalRequest),s=!n();o(!1),nl(r,{returnStrategy:Ec.returnStrategy,twaReturnUrl:Ec.twaReturnUrl,forceRedirect:s})},y=()=>{r(!0),Cn({openMethod:"qrcode"})},b=()=>{r(!1),Cn({openMethod:"universal-link"})};return(()=>{const r=Xl.cloneNode(!0);return mr(r,$t(er,{get when(){return t()},get children(){return[$t(zl,{icon:"arrow",onClick:b}),$t(Yl,{get universalLink(){return d()},get isCopiedShown(){return h()},onOpenLink:g,onCopy:f})]}}),null),mr(r,$t(er,{get when(){return!t()},get children(){return[$t(zl,{get icon(){return $t(ji,{})},onClick:y}),$t(Ul,{translationKey:"walletModal.mobileUniversalModal.connectYourWallet",children:"Connect your TON wallet"}),$t(Dl,{translationKey:"walletModal.mobileUniversalModal.openWalletOnTelegramOrSelect",maxWidth:320,children:"Use Wallet in Telegram or choose other application"}),$t(Ll,{get leftIcon(){return $t(Bi,{})},get rightIcon(){return $t(Fl,{get src(){return Vi}})},onClick:m,scale:"s",get children(){return $t(tl,{translationKey:"walletModal.mobileUniversalModal.openWalletOnTelegram",children:"Connect Wallet in Telegram"})}}),$t(Dl,{translationKey:"walletModal.mobileUniversalModal.chooseOtherApplication",maxWidth:342,padding:"0 24px 8px 24px",margin:"0",children:"Choose other application"}),$t(Ws,{get children(){return[$t(Xt,{get each(){return wt((()=>!!l()))()?c().slice(0,3):c()},children:t=>(()=>{const r=Zl.cloneNode(!0);return mr(r,$t(Fs,{get icon(){return t.imageUrl},get name(){return t.name},onClick:()=>e.onSelect(t)})),r})()}),$t(er,{get when(){return l()},get children(){const t=Zl.cloneNode(!0);return mr(t,$t(Li,{labelLine1:"View all",labelLine2:"wallets",get images(){return c().slice(3,7).map((e=>e.imageUrl))},onClick:()=>e.onSelectAllWallets()})),t}})]}})]}}),null),r})()},tu={m:"16px",s:"8px",none:"0"},ru={m:"8px",s:"4px",none:"0"},nu=zr.div` 1663 display: flex; 1664 flex-direction: column; 1665 align-items: center; 1666 padding-bottom: 16px; 1667`,ou=zr(Hs)` 1668 max-width: 320px; 1669 margin-top: 2px; 1670 margin-bottom: 20px; 1671`,su=zr(Hs)` 1672 margin-bottom: 16px; 1673`,iu=zr(Ts)` 1674 margin-bottom: 24px; 1675`,au=zr.ul` 1676 display: flex; 1677`;zr.div` 1678 display: flex; 1679 gap: 16px; 1680 width: 100%; 1681`,zr(ko)` 1682 position: relative; 1683 font-size: 16px; 1684 line-height: 20px; 1685 width: 100%; 1686 padding: 0 16px; 1687 height: 56px; 1688 border-radius: ${e=>tu[e.theme.borderRadius]}; 1689 1690 &:hover { 1691 ${e=>e.disableEventsAnimation?"transform: unset;":""} 1692 } 1693 1694 &:active { 1695 ${e=>e.disableEventsAnimation?"transform: unset;":""} 1696 } 1697`,zr.ul` 1698 position: absolute; 1699 bottom: 100%; 1700 left: 0; 1701 margin: 0; 1702 padding: 8px; 1703 width: 188px; 1704 transform: translateY(-16px); 1705 1706 background-color: ${e=>e.theme.colors.background.primary}; 1707 border-radius: ${e=>tu[e.theme.borderRadius]}; 1708 box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16); 1709`,zr.li` 1710 padding: 8px; 1711 1712 display: flex; 1713 align-items: center; 1714 gap: 8px; 1715 1716 cursor: pointer; 1717 border-radius: ${e=>ru[e.theme.borderRadius]}; 1718 1719 transition: background-color, transform 0.1s ease-in-out; 1720 1721 &:hover { 1722 background-color: ${e=>e.theme.colors.background.secondary}; 1723 } 1724 1725 &:active { 1726 transform: scale(0.96); 1727 } 1728`,zr(no)` 1729 width: 24px; 1730 height: 24px; 1731 1732 border-radius: 6px; 1733`,zr.div` 1734 margin-top: 23px; 1735 margin-bottom: 1px; 1736 width: 100%; 1737 display: flex; 1738 justify-content: center; 1739 align-items: center; 1740`,zr(Is)` 1741 color: ${e=>e.theme.colors.text.secondary}; 1742 font-size: 16px; 1743`;const cu=dr("<li></li>"),lu=e=>{const[t,r]=gt(!1),n=Ec.connector,o=wt((()=>Jl(e.walletsList)),null,{equals:Ql});Cn({openMethod:"qrcode"});const s=wt((()=>n.connect(o(),e.additionalRequest)));return $t(nu,{onClick:()=>r(!1),"data-tc-wallets-modal-universal-desktop":"true",get children(){return[$t(Vs,{translationKey:"walletModal.desktopUniversalModal.connectYourWallet",children:"Connect your wallet"}),$t(ou,{translationKey:"walletModal.desktopUniversalModal.scan",children:"Scan with your mobile wallet"}),$t(iu,{get sourceUrl(){return rl(s(),"none")},get disableCopy(){return t()},get imageUrl(){return zi}}),$t(su,{translationKey:"walletModal.desktopUniversalModal.availableWallets",children:"Available wallets"}),$t(au,{get children(){return[$t(Xt,{get each(){return e.walletsList.slice(0,3)},children:t=>(()=>{const r=cu.cloneNode(!0);return mr(r,$t(qi,{wallet:t,onClick:()=>e.onSelect(t)})),r})()}),$t(Li,{labelLine1:"View all",labelLine2:"wallets",get images(){return e.walletsList.slice(3,7).map((e=>e.imageUrl))},onClick:()=>e.onSelectAllWallets()})]}})]}})},uu=()=>{const{locale:e}=ks()[1];bt((()=>e(Ec.language))),bt((()=>{yn()?Qi():(s(null),a("universal"),l(!1))}));const t=_t(Bn),r=_t(ta),[n]=vt((()=>r.getWallets())),[o,s]=gt(null),[i,a]=gt("universal"),[c,l]=gt(!1),u=wt((()=>
1743{if("ready"!==n.state)return null;let e=_c(n(),Ec.walletsListConfiguration);const t=e.filter(se),r=e.filter((e=>!se(e)));e=(t||[]).concat(r);const o=Ec.preferredWalletAppName,s=e.find((e=>Bc(e,o))),i=e.filter((e=>Bc(e,o))).length>=2;o&&s&&!i&&(e=[Ze(Qe({},s),{isPreferred:!0})].concat(e.filter((e=>!Bc(e,o)))));const a=e.find((e=>Bc(e,Fi)));return a&&(e=[a].concat(e.filter((e=>!Bc(e,Fi))))),e})),d=()=>{var e;return"loading"===(null==(e=Ec.connectRequestParameters)?void 0:e.state)},h=wt((()=>{var e;if(!d())return null==(e=Ec.connectRequestParameters)?void 0:e.value})),p=e=>{r.closeModal(e)},f=t.onStatusChange((e=>{e&&p("wallet-selected")})),g=()=>{a("all-wallets")},m=()=>{a("universal")},y=()=>{s(null)};return Et((()=>{s(null),l(!1)})),Et(f),$t(Ac,{get opened(){return yn()},get enableAndroidBackHandler(){return Ec.enableAndroidBackHandler},onClose:()=>p("action-cancelled"),onClickQuestion:()=>l((e=>!e)),"data-tc-wallets-modal-container":"true",get children(){return[$t(er,{get when(){return c()},get children(){return $t(ml,{onBackClick:()=>l(!1)})}}),$t(er,{get when(){return!c()},get children(){return[$t(er,{get when(){return d()||!u()},get children(){return[$t(Tc,{translationKey:"walletModal.loading",children:"Wallets list is loading"}),$t(Pc,{get children(){return $t(ai,{size:"m"})}})]}}),$t(er,{get when(){return wt((()=>!d()))()&&u()},get children(){return $t(tr,{get children(){return[$t(rr,{get when(){return o()},get children(){return $t(_r,{get component(){return Yi()?jl:il},get wallet(){return o()},get additionalRequest(){return h()},onBackClick:y})}}),$t(rr,{get when(){return"universal"===i()},get children(){return $t(_r,{get component(){return Yi()?eu:lu},onSelect:s,get walletsList(){return u()},get additionalRequest(){return h()},onSelectAllWallets:g})}}),$t(rr,{get when(){return"all-wallets"===i()},get children(){return $t(Uc,{get walletsList(){return u()},onBack:m,onSelect:s})}})]}})}})]}})]}})},du=zr.div` 1744 display: flex; 1745 flex-direction: column; 1746 align-items: center; 1747 padding-bottom: 8px; 1748`,hu=zr(Vs)` 1749 margin-top: 16px; 1750`,pu=zr(Is)` 1751 font-weight: 510; 1752 font-size: 16px; 1753 line-height: 20px; 1754 text-align: center; 1755 max-width: 250px; 1756 1757 color: ${e=>e.theme.colors.text.secondary}; 1758`,fu=zr(ko)` 1759 min-width: 112px; 1760 margin-top: 32px; 1761`,gu=zr(ai)` 1762 height: 16px; 1763 width: 16px; 1764`,mu=zr(ko)` 1765 margin-top: 32px; 1766`,yu=e=>{const t=Co(e),r=_t(ta),[n,o]=gt(!0),[s,i]=gt(!1);let a,c;bt((()=>{const e=kn();i(!!e&&"sent"in e&&e.sent)})),(null==r?void 0:r.wallet)&&"universalLink"in r.wallet&&("universal-link"===r.wallet.openMethod||D(r.wallet.universalLink)&&co())&&(a=r.wallet.universalLink),(null==r?void 0:r.wallet)&&"deepLink"in r.wallet&&("custom-deeplink"===r.wallet.openMethod||D(r.wallet.deepLink)&&co())&&(c=r.wallet.deepLink);const l=()=>{const e=kn(),t="returnStrategy"in e?e.returnStrategy:Ec.returnStrategy,r=!n();o(!1),D(a)?nl(a,{returnStrategy:t,twaReturnUrl:"twaReturnUrl"in e?e.twaReturnUrl:Ec.twaReturnUrl,forceRedirect:r}):ol(a,c,{returnStrategy:t,forceRedirect:r},(()=>{}))};return $t(du,Qt(t,{get children(){return[wt((()=>e.icon)),$t(hu,{get translationKey(){return e.headerTranslationKey},get translationValues(){return e.headerTranslationValues}}),$t(pu,{get translationKey(){return e.textTranslationKey},get translationValues(){return e.textTranslationValues}}),$t(er,{get when(){return!s()&&("open-wallet"===e.showButton&&a||"open-wallet"!==e.showButton)},get children(){return $t(fu,{disabled:!0,"data-tc-connect-button-loading":"true",get children(){return $t(gu,{})}})}}),$t(er,{get when(){return s()},get children(){return[$t(er,{get when(){return"open-wallet"!==e.showButton},get children(){return $t(mu,{onClick:()=>e.onClose(),get children(){return $t(tl,{translationKey:"common.close",children:"Close"})}})}}),$t(er,{get when(){return"open-wallet"===e.showButton&&a},get children(){return $t(mu,{onClick:l,get children(){return $t(tl,{translationKey:"common.openWallet",children:"Open wallet"})}})}})]}})]}}))},bu=e=>{const t=_t(ta),[r]=ks();return $t(yu,{headerTranslationKey:"actionModal.confirmTransaction.header",get headerTranslationValues(){return{name:t.wallet&&"name"in t.wallet?t.wallet.name:r("common.yourWallet",{},"Your wallet")}},textTranslationKey:"actionModal.confirmTransaction.text",get icon(){return $t(ai,{size:"m"})},onClose:()=>e.onClose(),showButton:"open-wallet","data-tc-confirm-modal":"true"})},wu=e=>$t(yu,{headerTranslationKey:"actionModal.transactionCanceled.header",textTranslationKey:"actionModal.transactionCanceled.text",get icon(){return $t(ni,{size:"m"})},onClose:()=>e.onClose(),"data-tc-transaction-canceled-modal":"true"}),vu=e=>$t(yu,{headerTranslationKey:"actionModal.transactionSent.header",textTranslationKey:"actionModal.transactionSent.text",get icon(){return $t(Xs,{size:"m"})},onClose:()=>e.onClose(),"data-tc-transaction-sent-modal":"true"}),Au=()=>$t(ts,{get opened(){var e;return wt((()=>null!==kn()))()&&!0===(null==(e=kn())?void 0:e.openModal)},get enableAndroidBackHandler(){return Ec.enableAndroidBackHandler},onClose:()=>_n(null),"data-tc-actions-modal-container":"true",get children(){return $t(tr,{get children(){return[$t(rr,{get when(){return"transaction-sent"===kn().name},get children(){return $t(vu,{onClose:()=>_n(null)})}}),$t(rr,{get when(){return"transaction-canceled"===kn().name},get children(){return $t(wu,{onClose:()=>_n(null)})}}),$t(rr,{get when(){return"confirm-transaction"===kn().name},get children(){return $t(bu,{onClose:()=>_n(null)})}})]}})}}),Tu=()=>{const{locale:e}=ks()[1];bt((()=>e(Ec.language))),bt((()=>{vn()&&Qi()}));const t=_t(Bn),r=_t(ta),[n,o]=gt(!1),s=()=>{var e;return"loading"===(null==(e=Ec.connectRequestParameters)?void 0:e.state)},i=wt((()=>{var e;if(!s())return null==(e=Ec.connectRequestParameters)?void 0:e.value})),a=e=>{r.closeSingleWalletModal(e)};return Et(t.onStatusChange((e=>{e&&a("wallet-selected")}))),Et((()=>{o(!1)})),$t(Ac,{get opened(){return vn()},get enableAndroidBackHandler(){return Ec.enableAndroidBackHandler},onClose:()=>a("action-cancelled"),onClickQuestion:()=>o((e=>!e)),"data-tc-wallets-modal-container":"true",get children(){return[$t(er,{get when(){return n()},get children(){return $t(ml,{onBackClick:()=>o(!1)})}}),$t(er,{get when(){return!n()},get children(){return[$t(er,{get when(){return s()},get children(){return[$t(Tc,{translationKey:"walletModal.loading",children:"Wallets list is loading"}),$t(Pc,{get children(){return $t(ai,{size:"m"})}})]}}),$t(er,{get when(){return!s()},get children(){return $t(_r,{get component(){return Yi()?jl:il},get wallet(){return An()}
1766,get additionalRequest(){return i()},onBackClick:()=>{},backDisabled:!0})}})]}})]}})},Pu=e=>{const t=Es(Sn,Ec.language);return customElements.define(qr,class extends HTMLElement{}),document.body.hasAttribute("ontouchstart")||document.body.setAttribute("ontouchstart",""),$t(Cs.Provider,{value:t,get children(){return $t(ta.Provider,{get value(){return e.tonConnectUI},get children(){return $t(Bn.Provider,{get value(){return Ec.connector},get children(){return[$t($r,{}),$t(Dr,{theme:Qn,get children(){return[$t(er,{get when(){return Ec.buttonRootId},get children(){return $t(kr,{get mount(){return document.getElementById(Ec.buttonRootId)},get children(){return $t(vc,{})}})}}),$t(_r,{component:qr,get children(){return[$t(uu,{}),$t(Tu,{}),$t(Au,{})]}})]}})]}})}})}})},Eu=()=>{setTimeout((()=>mn({status:"opened",closeReason:null})))},Cu=e=>{setTimeout((()=>mn({status:"closed",closeReason:e})))},ku=e=>{setTimeout((()=>wn({status:"opened",closeReason:null,walletInfo:e})))},_u=e=>{setTimeout((()=>wn({status:"closed",closeReason:e})))},Iu=e=>{setTimeout((()=>_n(e)))},Su=()=>{setTimeout((()=>_n(null)))},xu=()=>Pn(),Bu=()=>Cn(null),Ou=(e,t)=>function(e,t,r,n={}){let o;return ft((n=>{o=n,t===document?e():mr(t,e(),t.firstChild?null:void 0,r)}),n.owner),()=>{o(),t.textContent=""}}((()=>$t(Pu,{tonConnectUI:t})),document.getElementById(e));class Mu{constructor(e){Xe(this,"connector"),Xe(this,"setConnectRequestParametersCallback"),Xe(this,"consumers",[]),Xe(this,"tracker"),Xe(this,"state",gn()),this.connector=e.connector,this.tracker=e.tracker,this.setConnectRequestParametersCallback=e.setConnectRequestParametersCallback,bt((()=>{const e=gn();this.state=e,this.consumers.forEach((t=>t(e)))}))}open(){return et(this,null,(function*(){this.tracker.trackConnectionStarted();const e=(yield this.connector.getWallets()).find(ie);return e?this.connectEmbeddedWallet(e):this.openWalletsModal()}))}close(e="action-cancelled"){"action-cancelled"===e&&this.tracker.trackConnectionError("Connection was cancelled"),Cu(e)}onStateChange(e){return this.consumers.push(e),()=>{this.consumers=this.consumers.filter((t=>t!==e))}}connectEmbeddedWallet(e){const t=t=>
1766{Cn(e),this.connector.connect({jsBridgeKey:e.jsBridgeKey},t)},r=Ec.connectRequestParameters;"loading"===(null==r?void 0:r.state)?this.setConnectRequestParametersCallback(t):t(null==r?void 0:r.value)}openWalletsModal(){return et(this,null,(function*(){return co()&&uo(),Eu(),new Promise((e=>{const t=this.onStateChange((r=>{const{status:n}=r;"opened"===n&&(t(),e())}))}))}))}}class Wu{constructor(e){Xe(this,"connector"),Xe(this,"consumers",[]),this.connector=e.connector,bt((()=>{const e=kn();this.consumers.forEach((t=>t(e)))}))}onStateChange(e){return this.consumers.push(e),()=>{this.consumers=this.consumers.filter((t=>t!==e))}}}class ju{constructor(e){Xe(this,"connector"),Xe(this,"setConnectRequestParametersCallback"),Xe(this,"consumers",[]),Xe(this,"tracker"),Xe(this,"state",bn()),this.connector=e.connector,this.tracker=e.tracker,this.setConnectRequestParametersCallback=e.setConnectRequestParametersCallback,bt((()=>{const e=bn();this.state=e,this.consumers.forEach((t=>t(e)))}))}open(e){return et(this,null,(function*(){this.tracker.trackConnectionStarted();const t=_c(yield this.connector.getWallets(),Ec.walletsListConfiguration),r=t.find(ie);if(!!r)return this.connectEmbeddedWallet(r);const n=t.filter(ae).find((t=>Bc(t,e)));if(!!n)return this.openSingleWalletModal(n);const o=`Trying to open modal window with unknown wallet "${e}".`;throw this.tracker.trackConnectionError(o),new Zr(o)}))}close(e="action-cancelled"){"action-cancelled"===e&&this.tracker.trackConnectionError("Connection was cancelled"),_u("action-cancelled")}onStateChange(e){return this.consumers.push(e),()=>{this.consumers=this.consumers.filter((t=>t!==e))}}connectEmbeddedWallet(e){const t=t=>
1766{Cn(e),this.connector.connect({jsBridgeKey:e.jsBridgeKey},t)},r=Ec.connectRequestParameters;"loading"===(null==r?void 0:r.state)?this.setConnectRequestParametersCallback(t):t(null==r?void 0:r.value)}openSingleWalletModal(e){return et(this,null,(function*(){return co()&&uo(),ku(e),new Promise((e=>{const t=this.onStateChange((r=>{const{status:n}=r;"opened"===n&&(t(),e())}))}))}))}}class Ru{constructor(e){var t;Xe(this,"eventPrefix","ton-connect-ui-"),Xe(this,"tonConnectUiVersion"),Xe(this,"tonConnectSdkVersion",null),Xe(this,"eventDispatcher"),this.eventDispatcher=null!=(t=null==e?void 0:e.eventDispatcher)?t:new ke,this.tonConnectUiVersion=e.tonConnectUiVersion,this.init().catch()}get version(){return pe({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}init(){return et(this,null,(function*(){try{yield this.setRequestVersionHandler(),this.tonConnectSdkVersion=yield this.requestTonConnectSdkVersion()}catch(e){}}))}setRequestVersionHandler(){return et(this,null,(function*(){yield this.eventDispatcher.addEventListener("ton-connect-ui-request-version",(()=>et(this,null,(function*(){yield this.eventDispatcher.dispatchEvent("ton-connect-ui-response-version",he(this.tonConnectUiVersion))}))))}))}requestTonConnectSdkVersion(){return et(this,null,(function*(){return new Promise(((e,t)=>et(this,null,(function*(){try{yield this.eventDispatcher.addEventListener("ton-connect-response-version",(t=>{e(t.detail.version)}),{once:!0}),yield this.eventDispatcher.dispatchEvent("ton-connect-request-version",{type:"request-version"})}catch(e){t(e)}}))))}))}dispatchUserActionEvent(e){var t;try{null==(t=this.eventDispatcher)||t.dispatchEvent(`${this.eventPrefix}${e.type}`,e).catch()}catch(e){}}trackConnectionStarted(...e){try{const t=ge(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackConnectionCompleted(...e){try{const t=me(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackConnectionError(...e){try{const t=ye(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackConnectionRestoringStarted(...e){try{const t=be(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackConnectionRestoringCompleted(...e){try{const t=we(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackConnectionRestoringError(...e){try{const t=ve(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackDisconnection(...e){try{const t=Ce(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackTransactionSentForSignature(...e){try{const t=Te(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackTransactionSigned(...e){try{const t=Pe(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackTransactionSigningFailed(...e){try{const t=Ee(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}}class Nu{constructor(e){if(Xe(this,"walletInfoStorage",new hn),Xe(this,"preferredWalletStorage",new pn),Xe(this,"tracker"),Xe(this,"walletInfo",null),Xe(this,"systemThemeChangeUnsubscribe",null),Xe(this,"actionsConfiguration"),Xe(this,"walletsList"),Xe(this,"connectRequestParametersCallback"),Xe(this,"connector"),Xe(this,"modal"),Xe(this,"singleWalletModal"),Xe(this,"transactionModal"),Xe(this,"connectionRestored",Promise.resolve(!1)),e&&"connector"in e&&e.connector)this.connector=e.connector;else{if(!(e&&"manifestUrl"in e&&e.manifestUrl))throw new Zr("You have to specify a `manifestUrl` or a `connector` in the options.");this.connector=new Ie({manifestUrl:e.manifestUrl,eventDispatcher:null==e?void 0:e.eventDispatcher})}this.tracker=new Ru({eventDispatcher:null==e?void 0:e.eventDispatcher,tonConnectUiVersion:"2.0.11"}),this.modal=new Mu({connector:this.connector,tracker:this.tracker,setConnectRequestParametersCallback:e=>{this.connectRequestParametersCallback=e}}),this.singleWalletModal=new ju({connector:this.connector,tracker:this.tracker,setConnectRequestParametersCallback:e=>{this.connectRequestParametersCallback=e}}),this.transactionModal=new Wu({connector:this.connector}),this.walletsList=this.getWallets(),this.walletsList.then((e=>{return on((t=e.map((e=>e.imageUrl)),[...new Set(t)]));var t}));const t=this.normalizeWidgetRoot(null==e?void 0:e.widgetRootId);this.subscribeToWalletChange(),!1!==(null==e?void 0:e.restoreConnection)&&(this.connectionRestored=function(e){return et(this,null,(function*(){return yield new Promise((e=>requestAnimationFrame(e))),e()}))}((()=>et(this,null,(function*(){return this.tracker.trackConnectionRestoringStarted(),yield this.connector.restoreConnection(),this.connector.connected?this.tracker.trackConnectionRestoringCompleted(this.wallet):(this.tracker.trackConnectionRestoringError("Connection was not restored"),this.walletInfoStorage.removeWalletInfo()),this.connector.connected}))))),this.uiOptions=Jn(e,{uiPreferences:{theme:"SYSTEM"}});const r=this.preferredWalletStorage.getPreferredWalletAppName();Cc({connector:this.connector,preferredWalletAppName:r}),Ou(t,this)}static getWallets(){return Ie.getWallets()}get connected(){return this.connector.connected}get account(){return this.connector.account}get wallet(){return this.connector.wallet?Qe(Qe({},this.connector.wallet),this.walletInfo):null}set uiOptions(e){var t,r,n,o,s,i,a;this.checkButtonRootExist(e.buttonRootId),this.actionsConfiguration=e.actionsConfiguration,(null==(t=e.uiPreferences)?void 0:t.theme)?"SYSTEM"!==(null==(r=e.uiPreferences)?void 0:r.theme)?(null==(n=this.systemThemeChangeUnsubscribe)||n.call(this),to(e.uiPreferences.theme,e.uiPreferences.colorsSet)):(to(window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?Ir.LIGHT:Ir.DARK,e.uiPreferences.colorsSet),this.systemThemeChangeUnsubscribe||(this.systemThemeChangeUnsubscribe=function(e){const t=t=>e(t.matches?Ir.DARK:Ir.LIGHT);return window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t),()=>window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",t)}(to))):(null==(o=e.uiPreferences)?void 0:o.colorsSet)&&(i=e.uiPreferences.colorsSet,eo[Ir.DARK]=Jn(i[Ir.DARK],eo[Ir.DARK]),eo[Ir.LIGHT]=Jn(i[Ir.LIGHT],eo[Ir.LIGHT]),Zn((e=>({colors:Jn(eo[e.theme],Xn[e.theme])})))),(null==(s=e.uiPreferences)?void 0:s.borderRadius)&&(a=e.uiPreferences.borderRadius,Zn({borderRadius:a})),Cc((t=>{var r,n;const o=Jn(Qe(Qe(Qe(Qe({},e.language&&{language:e.language}),!!(null==(r=e.actionsConfiguration)?void 0:r.returnStrategy)&&{returnStrategy:e.actionsConfiguration.returnStrategy}),!!(null==(n=e.actionsConfiguration)?void 0:n.twaReturnUrl)&&{twaReturnUrl:e.actionsConfiguration.twaReturnUrl}),!!e.walletsListConfiguration&&{walletsListConfiguration:e.walletsListConfiguration}),Nn(t));return void 0!==e.buttonRootId&&(o.buttonRootId=e.buttonRootId),void 0!==e.enableAndroidBackHandler&&(o.enableAndroidBackHandler=e.enableAndroidBackHandler),o}))}setConnectRequestParameters(e){var t;Cc({connectRequestParameters:e}),"ready"!==(null==e?void 0:e.state)&&e||null==(t=this.connectRequestParametersCallback)||t.call(this,null==e?void 0:e.value)}getWallets(){return et(this,null,(function*(){return this.connector.getWallets()}))}onStatusChange(e,t){return this.connector.onStatusChange((t=>
1766et(this,null,(function*(){if(t){const r=yield this.getSelectedWalletInfo(t);e(Qe(Qe({},t),r||this.walletInfoStorage.getWalletInfo()))}else e(t)}))),t)}openModal(){return et(this,null,(function*(){return this.modal.open()}))}closeModal(e){this.modal.close(e)}onModalStateChange(e){return this.modal.onStateChange(e)}get modalState(){return this.modal.state}openSingleWalletModal(e){return et(this,null,(function*(){return this.singleWalletModal.open(e)}))}closeSingleWalletModal(e){this.singleWalletModal.close(e)}onSingleWalletModalStateChange(e){return this.singleWalletModal.onStateChange(e)}get singleWalletModalState(){return this.singleWalletModal.state}connectWallet(){return et(this,null,(function*(){const e=(yield this.getWallets()).find(ie);return e?yield this.connectEmbeddedWallet(e):yield this.connectExternalWallet()}))}disconnect(){return this.tracker.trackDisconnection(this.wallet,"dapp"),Su(),Bu(),this.walletInfoStorage.removeWalletInfo(),this.connector.disconnect()}sendTransaction(e,t){return et(this,null,(function*(){if(this.tracker.trackTransactionSentForSignature(this.wallet,e),!this.connected)throw this.tracker.trackTransactionSigningFailed(this.wallet,e,"Wallet was not connected"),new Zr("Connect wallet to send a transaction.");co()&&uo();const{notifications:r,modals:n,returnStrategy:o,twaReturnUrl:s,skipRedirectToWallet:i}=this.getModalsAndNotificationsConfiguration(t);Iu({name:"confirm-transaction",showNotification:r.includes("before"),openModal:n.includes("before"),sent:!1});const a=()=>{c.signal.aborted||(Iu({name:"confirm-transaction",showNotification:r.includes("before"),openModal:n.includes("before"),sent:!0}),this.walletInfo&&"universalLink"in this.walletInfo&&("universal-link"===this.walletInfo.openMethod||"custom-deeplink"===this.walletInfo.openMethod)&&(D(this.walletInfo.universalLink)?nl(this.walletInfo.universalLink,{returnStrategy:o,twaReturnUrl:s||Ec.twaReturnUrl,forceRedirect:!1}):ol(this.walletInfo.universalLink,this.walletInfo.deepLink,{returnStrategy:o,forceRedirect:!1},(()=>{}))))},c=new AbortController,l=this.onTransactionModalStateChange((e=>{(null==e?void 0:e.openModal)||(l(),e||c.abort())}));try{const t=yield this.waitForSendTransaction({transaction:e,signal:c.signal},a);return this.tracker.trackTransactionSigned(this.wallet,e,t),Iu({name:"transaction-sent",showNotification:r.includes("success"),openModal:n.includes("success")}),t}catch(e){throw Iu({name:"transaction-canceled",showNotification:r.includes("error"),openModal:n.includes("error")}),e instanceof b?e:(console.error(e),new Zr("Unhandled error:"+e))}finally{l()}}))}connectEmbeddedWallet(e){return et(this,null,(function*(){const t=t=>
1766{Cn(e),this.connector.connect({jsBridgeKey:e.jsBridgeKey},t)},r=Ec.connectRequestParameters;return"loading"===(null==r?void 0:r.state)?this.connectRequestParametersCallback=t:t(null==r?void 0:r.value),yield this.waitForWalletConnection({ignoreErrors:!1})}))}connectExternalWallet(){return et(this,null,(function*(){const e=new AbortController;Eu();const t=this.onModalStateChange((r=>{const{status:n,closeReason:o}=r;"opened"!==n&&(t(),"action-cancelled"===o&&e.abort())}));return yield this.waitForWalletConnection({ignoreErrors:!0,signal:e.signal})}))}waitForWalletConnection(e){return et(this,null,(function*(){return new Promise(((t,r)=>{this.tracker.trackConnectionStarted();const{ignoreErrors:n=!1,signal:o=null}=e;if(o&&o.aborted)return this.tracker.trackConnectionError("Connection was cancelled"),r(new Zr("Wallet was not connected"));const s=e=>et(this,null,(function*(){if(e)this.tracker.trackConnectionCompleted(e),a(),t(e);else{if(this.tracker.trackConnectionError("Connection was cancelled"),n)return;a(),r(new Zr("Wallet was not connected"))}})),i=e=>{this.tracker.trackConnectionError(e.message),n||(a(),r(e))},a=this.onStatusChange((e=>s(e)),(e=>i(e)));o&&o.addEventListener("abort",(()=>{a(),r(new Zr("Wallet was not connected"))}),{once:!0})}))}))}waitForSendTransaction(e,t){return et(this,null,(function*(){return new Promise(((r,n)=>{const{transaction:o,signal:s}=e;if(s.aborted)return this.tracker.trackTransactionSigningFailed(this.wallet,o,"Transaction was cancelled"),n(new Zr("Transaction was not sent"));const i=e=>et(this,null,(function*(){r(e)})),a=()=>{this.tracker.trackTransactionSigningFailed(this.wallet,o,"Transaction was cancelled"),n(new Zr("Transaction was not sent"))};s.addEventListener("abort",a,{once:!0}),this.connector.sendTransaction(o,{onRequestSent:t,signal:s}).then((e=>(s.removeEventListener("abort",a),i(e)))).catch((e=>(s.removeEventListener("abort",a),(e=>{n(e)})(e))))}))}))}onTransactionModalStateChange(e){return this.transactionModal.onStateChange(e)}subscribeToWalletChange(){this.connector.onStatusChange((e=>et(this,null,(function*(){var t;e?(yield this.updateWalletInfo(e),this.setPreferredWalletAppName((null==(t=this.walletInfo)?void 0:t.appName)||e.device.appName)):this.walletInfoStorage.removeWalletInfo()}))))}setPreferredWalletAppName(e){this.preferredWalletStorage.setPreferredWalletAppName(e),Cc({preferredWalletAppName:e})}getSelectedWalletInfo(e){return et(this,null,(function*(){let t,r=xu();if(!r)return null;if("name"in r)t=r;else{const n=_c(yield this.walletsList,Ec.walletsListConfiguration).find((t=>Bc(t,e.device.appName)));if(!n)throw new Zr(`Cannot find WalletInfo for the '${e.device.appName}' wallet`);t=Qe(Qe({},n),r)}return t}))}updateWalletInfo(e){return et(this,null,(function*(){const t=yield this.getSelectedWalletInfo(e);if(t)return this.walletInfo=t,void this.walletInfoStorage.setWalletInfo(t);const r=this.walletInfoStorage.getWalletInfo();this.walletInfo=r||((yield this.walletsList).find((t=>Bc(t,e.device.appName)))||null)}))}normalizeWidgetRoot(e){if(!e||!document.getElementById(e)){e="tc-widget-root";const t=document.createElement("div");t.id=e,document.body.appendChild(t)}return e}checkButtonRootExist(e){if(null!=e&&!document.getElementById(e))throw new Zr(`${e} element not found in the document.`)}getModalsAndNotificationsConfiguration(e){var t,r,n,o,s,i;const a=["before","success","error"];let c=a;(null==(t=this.actionsConfiguration)?void 0:t.notifications)&&"all"!==(null==(r=this.actionsConfiguration)?void 0:r.notifications)&&(c=this.actionsConfiguration.notifications),(null==e?void 0:e.notifications)&&(c="all"===e.notifications?a:e.notifications);let l=["before"];(null==(n=this.actionsConfiguration)?void 0:n.modals)&&(l="all"===this.actionsConfiguration.modals?a:this.actionsConfiguration.modals),(null==e?void 0:e.modals)&&(l="all"===e.modals?a:e.modals);const u=(null==e?void 0:e.returnStrategy)||(null==(o=this.actionsConfiguration)?void 0:o.returnStrategy)||"back",d=(null==e?void 0:e.twaReturnUrl)||(null==(s=this.actionsConfiguration)?void 0:s.twaReturnUrl);let h=(null==e?void 0:e.skipRedirectToWallet)||(null==(i=this.actionsConfiguration)?void 0:i.skipRedirectToWallet)||"ios";return co()&&(h="never"),{notifications:c,modals:l,returnStrategy:u,twaReturnUrl:d,skipRedirectToWallet:h}}}var Uu,Du=Object.defineProperty,Lu=Object.getOwnPropertySymbols,Fu=Object.prototype.hasOwnProperty,zu=Object.prototype.propertyIsEnumerable,Vu=(e,t,r)=>t in e?Du(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,qu=(e,t)=>
1766{for(var r in t||(t={}))Fu.call(t,r)&&Vu(e,r,t[r]);if(Lu)for(var r of Lu(t))zu.call(t,r)&&Vu(e,r,t[r]);return e},Hu={exports:{}},Ku={};!function(e){e.exports=function(){if(Uu)return Ku;Uu=1;var e=l,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function i(e,r,i){var a,c={},l=null,u=null;for(a in void 0!==i&&(l=""+i),void 0!==r.key&&(l=""+r.key),void 0!==r.ref&&(u=r.ref),r)n.call(r,a)&&!s.hasOwnProperty(a)&&(c[a]=r[a]);if(e&&e.defaultProps)for(a in r=e.defaultProps)void 0===c[a]&&(c[a]=r[a]);return{$$typeof:t,type:e,key:l,ref:u,props:c,_owner:o.current}}return Ku.Fragment=r,Ku.jsx=i,Ku.jsxs=i,Ku}()}(Hu);const $u=Hu.exports.jsx;function Gu(){return"undefined"!=typeof window}const Yu=(0,l.createContext)(null);let Ju=null;const Qu=(0,l.memo)((e=>{var t=e,{children:r}=t,n=((e,t)=>{var r={};for(var n in e)Fu.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&Lu)for(var n of Lu(e))t.indexOf(n)<0&&zu.call(e,n)&&(r[n]=e[n]);return r})(t,["children"]);return Gu()&&!Ju&&(Ju=new Nu(n)),$u(Yu.Provider,{value:Ju,children:r})}));class Zu extends Zr{constructor(...e){super(...e),Object.setPrototypeOf(this,Zu.prototype)}}class Xu extends Zu{constructor(...e){super(...e),Object.setPrototypeOf(this,Xu.prototype)}}function ed(){const e=(0,l.useContext)(Yu),t=(0,l.useCallback)((t=>{e&&(e.uiOptions=t)}),[e]);return Gu()?(function(e){if(!e)throw new Xu("You should add <TonConnectUIProvider> on the top of the app to use TonConnect")}(e),[e,t]):[null,()=>{}]}const td="ton-connect-button";(0,l.memo)((({className:e,style:t})=>{const[r,n]=ed();return(0,l.useEffect)((()=>(n({buttonRootId:td}),()=>n({buttonRootId:null}))),[n]),$u("div",{id:td,className:e,style:qu({width:"fit-content"},t)})}));function rd(){const[e]=ed(),[t,r]=(0,l.useState)((null==e?void 0:e.wallet)||null);return(0,l.useEffect)((()=>{if(e)return r(e.wallet),e.onStatusChange((e=>{r(e)}))}),[e]),t}function nd(e=!0){const t=rd();return(0,l.useMemo)((()=>t?e?Se(t.account.address,t.account.chain===c.TESTNET):t.account.address:""),[t,e,null==t?void 0:t.account.address,null==t?void 0:t.account.chain])}function od(){const[e]=ed(),[t,r]=(0,l.useState)((null==e?void 0:e.modal.state)||null);return(0,l.useEffect)((()=>{if(e)return r(e.modal.state),e.onModalStateChange((e=>{r(e)}))}),[e]),{state:t,open:()=>null==e?void 0:e.modal.open(),close:()=>null==e?void 0:e.modal.close()}}function sd(){const[e,t]=(0,l.useState)(!1),[r]=ed();return(0,l.useEffect)((()=>{r&&r.connectionRestored.then((()=>t(!0)))}),[r]),e}},"./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/adapter.js"(e,t,r){"use strict";r.d(t,{Ok:()=>n,Y3:()=>i,nL:()=>o});var n,o,s=r("./node_modules/@tronweb3/tronwallet-abstract-adapter/node_modules/eventemitter3/index.js");!function(e){e.Loading="Loading",e.NotFound="NotFound",e.Found="Found"}(n||(n={})),function(e){e.Loading="Loading",e.NotFound="NotFound",e.Disconnect="Disconnected",e.Connected="Connected"}(o||(o={}));class i extends s{get connected(){return this.state===o.Connected}disconnect(){return console.info("The current adapter doesn't support disconnect by DApp."),Promise.resolve()}multiSign(...e){return Promise.reject("The current wallet doesn't support multiSign.")}switchChain(e){return Promise.reject("The current wallet doesn't support switch chain.")}}},"./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/errors.js"(e,t,r){"use strict";r.d(t,{K3:()=>l,KL:()=>d,PQ:()=>i,Pj:()=>h,W0:()=>p,Y6:()=>a,Y8:()=>c,gK:()=>s,hv:()=>o,m7:()=>n,z4:()=>u});class n extends Error{constructor(e,t){super(e),this.error=t}}class o extends n{constructor(e,t){super(e||"The wallet is not found.",t),this.name="WalletNotFoundError"}}class s extends n{constructor(){super(...arguments),this.name="WalletNotSelectedError",this.message="No wallet is selected. Please select a wallet."}}class i extends n{constructor(){super(...arguments),this.name="WalletDisconnectedError",this.message="The wallet is disconnected. Please connect first."}}class a extends n{constructor(){super(...arguments),this.name="WalletConnectionError"}}class c extends n{constructor(){super(...arguments),this.name="WalletDisconnectionError"}}class l extends n{constructor(){super(...arguments),this.name="WalletSignMessageError"}}class u extends n{constructor(){super(...arguments),this.name="WalletSignTransactionError"}}class d extends n{constructor(e,t){super(e||"The QR window is closed.",t),this.name="WalletWindowClosedError"}}class h extends n{constructor(){super(...arguments),this.name="WalletSwitchChainError"}}class p extends n{constructor(){super(...arguments),this.name="WalletGetNetworkError"}}},"./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/types.js"(e,t,r){"use strict";var n,o;r.d(t,{Xm:()=>i,r5:()=>s,z1:()=>n}),function(e){e.Mainnet="Mainnet",e.Shasta="Shasta",e.Nile="Nile",e.Unknown="Unknown"}(n||(n={})),function(e){e.Mainnet="Mainnet",e.Shasta="Shasta",e.Nile="Nile"}(o||(o={}));const s="TIP6963:announceProvider",i="TIP6963:requestProvider"},"./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/utils.js"(e,t,r){"use strict";function n(){return"undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typeof navigator}function o(){return"undefined"!=typeof navigator&&navigator.userAgent.match(/Android|webOS|iPhone|iPad|iPod|BlackBerry|W
1766indows Phone/i)}r.d(t,{My:()=>n,yO:()=>o})},"./node_modules/@tronweb3/tronwallet-adapter-binance/lib/esm/adapter.js"(e,t,r){"use strict";r.d(t,{$:()=>l});var n=r("./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/adapter.js"),o=r("./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/errors.js"),s=r("./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/types.js"),i=r("./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/utils.js"),a=function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))};const c={"0x2b6653dc":s.z1.Mainnet,"0x94a9059e":s.z1.Shasta,"0xcd8690dc":s.z1.Nile};class l extends n.Y3{constructor(e={}){super(),this.name="Binance Wallet",this.url="https://www.binance.com/en/binancewallet",this.icon="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHZpZXdCb3g9IjAgMCAzMCAzMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjMwIiBoZWlnaHQ9IjMwIiBmaWxsPSIjMEIwRTExIi8+CjxwYXRoIGQ9Ik01IDE1TDcuMjU4MDYgMTIuNzQxOUw5LjUxNjEzIDE1TDcuMjU4MDYgMTcuMjU4MUw1IDE1WiIgZmlsbD0iI0YwQjkwQiIvPgo8cGF0aCBkPSJNOC44NzA5NyAxMS4xMjlMMTUgNUwyMS4xMjkgMTEuMTI5TDE4Ljg3MSAxMy4zODcxTDE1IDkuNTE2MTNMMTEuMTI5IDEzLjM4NzFMOC44NzA5NyAxMS4xMjlaIiBmaWxsPSIjRjBCOTBCIi8+CjxwYXRoIGQ9Ik0xMi43NDE5IDE1TDE1IDEyLjc0MTlMMTcuMjU4MSAxNUwxNSAxNy4yNTgxTDEyLjc0MTkgMTVaIiBmaWxsPSIjRjBCOTBCIi8+CjxwYXRoIGQ9Ik0xMS4xMjkgMTYuNjEyOUw4Ljg3MDk3IDE4Ljg3MUwxNSAyNUwyMS4xMjkgMTguODcxTDE4Ljg3MSAxNi42MTI5TDE1IDIwLjQ4MzlMMTEuMTI5IDE2LjYxMjlaIiBmaWxsPSIjRjBCOTBCIi8+CjxwYXRoIGQ9Ik0yMC40ODM5IDE1TDIyLjc0MTkgMTIuNzQxOUwyNSAxNUwyMi43NDE5IDE3LjI1ODFMMjAuNDgzOSAxNVoiIGZpbGw9IiNGMEI5MEIiLz4KPC9zdmc+Cg==",this._readyState=(0,i.My)()?n.Ok.Loading:n.Ok.NotFound,this._state=n.nL.Loading,this._onAccountsChanged=e=>{const t=this.address||"";this.setAddress(e[0]),this.emit("accountsChanged",this.address||"",t)},this._checkPromise=null,this._updateProvider=()=>{var e;let t=this.state,r=this.address;(null===(e=window.binancew3w)||void 0===e?void 0:e.tron)?(this._provider=window.binancew3w.tron,r=null,t=n.nL.Disconnect):(this._provider=null,r=null,t=n.nL.NotFound),this.setAddress(r),this.setState(t)};const{checkTimeout:t=2e3,openUrlWhenWalletNotFound:r=!0}=e;if("number"!=typeof t)throw new Error("[BinanceWalletAdapter] config.checkTimeout should be a number");if(this.config={checkTimeout:t,openUrlWhenWalletNotFound:r},this._connecting=!1,this._provider=null,this._address=null,!(0,i.My)())return this._readyState=n.Ok.NotFound,void this.setState(n.nL.NotFound);this._checkWallet().then((()=>{this.connected&&(this.emit("connect",this.address||""),this._listenEvent())}))}get address(){return this._address}get state(){return this._state}get readyState(){return this._readyState}get connecting(){return this._connecting}network(){return a(this,void 0,void 0,(function*(){try{if(yield this._checkWallet(),this.state!==n.nL.Connected)throw new o.PQ;try{const e=this._provider.getChainId();return{networkType:c[e]||s.z1.Unknown,chainId:e,fullNode:"",solidityNode:"",eventServer:""}}catch(e){throw new o.W0(null==e?void 0:e.message,e)}}catch(e){throw this.emit("error",e),e}}))}connect(){return a(this,void 0,void 0,(function*(){try{if(this.connected||this.connecting)return;if(yield this._checkWallet(),this.state===n.nL.NotFound)throw!1!==this.config.openUrlWhenWalletNotFound&&(0,i.My)()&&window.open(this.url,"_blank"),new o.hv;this._connecting=!0;try{const{address:e}=yield this._provider.getAccount();this.setAddress(e),this.setState(n.nL.Connected),this.emit("connect",e),this._listenEvent()}catch(e){throw new o.Y6(null==e?void 0:e.message,e)}}catch(e){throw this.emit("error",e),e}finally{this._connecting=!1}}))}disconnect(){return a(this,void 0,void 0,(function*(){this.state===n.nL.Connected&&(yield this._provider.disconnect(),this.setAddress(null),this.setState(n.nL.Disconnect),this.emit("disconnect"),this._stopListenEvent())}
1766))}signMessage(e){return a(this,void 0,void 0,(function*(){try{if(this.state!==n.nL.Connected)throw new o.PQ;try{return yield this._provider.signMessageV2(e)}catch(e){throw new o.K3(null==e?void 0:e.message,e)}}catch(e){throw this.emit("error",e),e}}))}signTransaction(e){return a(this,void 0,void 0,(function*(){try{if(this.state!==n.nL.Connected)throw new o.PQ;try{return yield this._provider.signTransaction(e)}catch(e){throw new o.z4(null==e?void 0:e.message,e)}}catch(e){throw this.emit("error",e),e}}))}_listenEvent(){this._stopListenEvent(),this._provider.on("accountsChanged",this._onAccountsChanged)}_stopListenEvent(){this._provider.removeListener("accountsChanged",this._onAccountsChanged)}_checkWallet(){return a(this,void 0,void 0,(function*(){if(this.readyState===n.Ok.Found)return!0;if(this._checkPromise)return this._checkPromise;const e=Math.floor(this.config.checkTimeout/100);let t,r=0;return this._checkPromise=new Promise((o=>{const s=()=>{var s;r++;const i=!!(null===(s=window.binancew3w)||void 0===s?void 0:s.tron);(i||r>e)&&(t&&clearInterval(t),this._readyState=i?n.Ok.Found:n.Ok.NotFound,this._updateProvider(),this.emit("readyStateChanged",this.readyState),o(i))};t=setInterval(s,100),s()})),this._checkPromise}))}setAddress(e){this._address=e}setState(e){e!==this.state&&(this._state=e,this.emit("stateChanged",e))}}},"./node_modules/@tronweb3/tronwallet-adapter-bitkeep/lib/esm/adapter.js"(e,t,r){"use strict";r.d(t,{_:()=>l});var n=r("./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/adapter.js"),o=r("./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/utils.js"),s=r("./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/errors.js"),i=r("./node_modules/@tronweb3/tronwallet-adapter-tronlink/lib/esm/adapter.js");function a(){return!!window.tronLink&&window.isBitKeep}var c=function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))};class l extends n.Y3{constructor(e={}){super(),this.name="Bitget Wallet",this.url="https://web3.bitget.com",this.icon="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTEyIiBoZWlnaHQ9IjUxMiIgdmlld0JveD0iMCAwIDUxMiA1MTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIiBmaWxsPSIjMDAxRjI5Ii8+CjxwYXRoIGQ9Ik0yMTkuOTQ4IDk1LjcwMjJDMjAxLjYyMyA5NS42OTI5IDE4My4zMyA5NS42ODM1IDE2NC45NDEgOTUuNzExNkMxNTMuODIyIDk1LjcxMTYgMTQ5LjY1MSAxMDkuNjcxIDE1Ny45MjEgMTE3LjkzOUwyODMuMDk4IDI0My4xMTdDMjg3LjAwNCAyNDYuNjkgMjg5LjQ0MSAyNTAuNTc0IDI4OS41MyAyNTUuNjkzQzI4OS40NDEgMjYwLjgxMiAyODcuMDA0IDI2NC42OTYgMjgzLjA5OCAyNjguMjY5TDE1Ny45MjEgMzkzLjQ0NkMxNDkuNjUxIDQwMS43MTUgMTUzLjgyMiA0MTUuNjc0IDE2NC45NDEgNDE1LjY3NEMxODMuMzMgNDE1LjcwMiAyMDEuNjIzIDQxNS42OTMgMjE5Ljk0OCA0MTUuNjgzQzIyOS4xMjIgNDE1LjY3OSAyMzguMzA1IDQxNS42NzQgMjQ3LjUxMSA0MTUuNjc0QzI1OS41NTUgNDE1LjY3NCAyNjYuNzIgNDA5LjI0IDI3My4xNTQgNDAyLjgwNUwzODYuMDQ3IDI4OS45MTJDMzk1LjA1NyAyODAuOTAyIDQwMy4xMTkgMjY4LjkzOSA0MDMuMDA5IDI1NS42OTNDNDAzLjExOSAyNDIuNDQ3IDM5NS4wNTcgMjMwLjQ4NCAzODYuMDQ3IDIyMS40NzRMMjczLjE1NCAxMDguNThDMjY2LjcyIDEwMi4xNDYgMjU5LjU1NSA5NS43MTE2IDI0Ny41MTEgOTUuNzExNkMyMzguMzA1IDk1LjcxMTYgMjI5LjEyMiA5NS43MDY5IDIxOS45NDggOTUuNzAyMloiIGZpbGw9IiMwMEYwRkYiLz4KPC9zdmc+Cg==",this._readyState=n.Ok.Loading,this._state=n.nL.Loading,this.checkReadyInterval=null,this._checkPromise=null,this._updateWallet=()=>c(this,void 0,void 0,(function*(){var e,t,r,s,i,c;let l=this.state,u=this.address;if(a()){if((0,o.yO)()){const t=null===(e=window.bitkeep)||void 0===e?void 0:e.tronLink;this._wallet={tron:t,tronWeb:null==t?void 0:t.tronWeb}}else{const e=null===(t=window.bitkeep)||void 0===t?void 0:t.tronWeb;this._wallet={tron:window.bitkeep.tronLink,tronWeb:e}}u=(null===(r=this._wallet.tron)||void 0===r?void 0:r.ready)?(null===(s=this._wallet.tronWeb.defaultAddress)||void 0===s?void 0:s.base58)||null:"",l=(null===(i=this._wallet.tron)||void 0===i?void 0:i.ready)?n.nL.Connected:n.nL.Disconnect,(null===(c=this._wallet.tron)||void 0===c?void 0:c.ready)||this.checkForWalletReady()}else this._wallet=null,u=null,l=n.nL.NotFound;this.setAddress(u),this.setState(l)}));const{checkTimeout:t=2e3,openUrlWhenWalletNotFound:r=!0,openAppWithDeeplink:s=!0}=e;if("number"!=typeof t)throw new Error("[BitKeepAdapter] config.checkTimeout should be a number");if(this.config={checkTimeout:t,openUrlWhenWalletNotFound:r,openAppWithDeeplink:s},this._connecting=!1,this._wallet=null,this._address=null,!(0,o.My)())return this._readyState=n.Ok.NotFound,void this.setState(n.nL.NotFound);a()?(this._readyState=n.Ok.Found,this._updateWallet()):this._checkWallet().then((()=>
1766{this.connected&&this.emit("connect",this.address||"")}))}get address(){return this._address}get state(){return this._state}get readyState(){return this._readyState}get connecting(){return this._connecting}network(){return c(this,void 0,void 0,(function*(){try{if(yield this._checkWallet(),this.state!==n.nL.Connected)throw new s.PQ;const e=this._wallet;if(!e||!e.tronWeb)throw new s.PQ;try{return yield(0,i.NA)(e.tronWeb)}catch(e){throw new s.W0(null==e?void 0:e.message,e)}}catch(e){throw this.emit("error",e),e}}))}connect(){return c(this,void 0,void 0,(function*(){var e,t,r,i;try{if(this.checkIfOpenApp(),this.connected||this.connecting)return;if(yield this._checkWallet(),this.readyState===n.Ok.NotFound)throw!1!==this.config.openUrlWhenWalletNotFound&&(0,o.My)()&&window.open(this.url,"_blank"),new s.hv;const a=this._wallet;if(!(0,o.yO)()){if(!a)return;this._connecting=!0;try{const e=yield a.tron.request({method:"tron_requestAccounts"});if(200!==(null==e?void 0:e.code))throw new s.Y6(40001===(null==e?void 0:e.code)?"The connection request is canceled by user.":null==e?void 0:e.message)}catch(e){throw e instanceof s.m7?e:new s.Y6(null==e?void 0:e.message,e)}}const c=(null===(e=null==a?void 0:a.tronWeb.defaultAddress)||void 0===e?void 0:e.base58)||(null===(i=null===(r=null===(t=window.bitkeep)||void 0===t?void 0:t.tronWeb)||void 0===r?void 0:r.defaultAddress)||void 0===i?void 0:i.base58)||"";this.setAddress(c),this.setState(n.nL.Connected),this.emit("connect",this.address||"")}catch(e){throw this.emit("error",e),e}finally{this._connecting=!1}}))}disconnect(){return c(this,void 0,void 0,(function*(){this.state===n.nL.Connected&&(this.setAddress(null),this.setState(n.nL.Disconnect),this.emit("disconnect"))}))}signTransaction(e,t){return c(this,void 0,void 0,(function*(){try{const r=yield this.checkAndGetWallet();try{return yield r.tronWeb.trx.sign(e,t)}catch(e){throw e instanceof Error?new s.z4(e.message,e):new s.z4(e,new Error(e))}}catch(e){throw this.emit("error",e),e}}))}multiSign(e,t,r){return c(this,void 0,void 0,(function*(){try{const n=yield this.checkAndGetWallet();try{return yield n.tronWeb.trx.multiSign(e,t,r)}catch(e){throw e instanceof Error?new s.z4(e.message,e):new s.z4(e,new Error(e))}}catch(e){throw this.emit("error",e),e}}))}signMessage(e,t){return c(this,void 0,void 0,(function*(){try{const r=yield this.checkAndGetWallet();try{return yield r.tronWeb.trx.signMessageV2(e,t)}catch(e){throw e instanceof Error?new s.K3(e.message,e):new s.K3(e,new Error(e))}}catch(e){throw this.emit("error",e),e}}))}checkAndGetWallet(){return c(this,void 0,void 0,(function*(){if(this.checkIfOpenApp(),yield this._checkWallet(),!this.connected)throw new s.PQ;const e=this._wallet;if(!e||!e.tronWeb)throw new s.PQ;return e}))}checkForWalletReady(){if(this.checkReadyInterval)return;let e=0;const t=Math.floor(this.config.checkTimeout/200);this.checkReadyInterval=setInterval((()=>c(this,void 0,void 0,(function*(){var r;this._wallet&&(null===(r=this._wallet)||void 0===r?void 0:r.tron.ready)?(this.checkReadyInterval&&clearInterval(this.checkReadyInterval),this.checkReadyInterval=null,yield this._updateWallet(),this.emit("connect",this.address||"")):e>t?(this.checkReadyInterval&&clearInterval(this.checkReadyInterval),this.checkReadyInterval=null):e++}))),200)}_checkWallet(){if(this.readyState===n.Ok.Found)return Promise.resolve(!0);if(this._checkPromise)return this._checkPromise;const e=Math.floor(this.config.checkTimeout/100);let t,r=0;return this._checkPromise=new Promise((o=>{const s=()=>{r++;const s=a();(s||r>e)&&(t&&clearInterval(t),this._readyState=s?n.Ok.Found:n.Ok.NotFound,this._updateWallet(),this.emit("readyStateChanged",this.readyState),o(s))};t=setInterval(s,100),s()})),this._checkPromise}checkIfOpenApp(){if(!1!==this.config.openAppWithDeeplink&&function(){if((0,o.yO)()&&!a()){const{origin:e,pathname:t,search:r,hash:n}=window.location,o=e+t+r+n;return location.href=`https://bkcode.vip?action=dapp&url=${encodeURIComponent(o)}`,!0}return!1}())throw new s.hv}setAddress(e){this._address=e}
1766setState(e){e!==this.state&&(this._state=e,this.emit("stateChanged",e))}}},"./node_modules/@tronweb3/tronwallet-adapter-gatewallet/lib/esm/adapter.js"(e,t,r){"use strict";r.d(t,{E:()=>d});var n=r("./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/adapter.js"),o=r("./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/utils.js"),s=r("./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/errors.js"),i=r("./node_modules/@tronweb3/tronwallet-adapter-tronlink/lib/esm/adapter.js");function a(){return!(!window.gatewallet||!window.gatewallet.tronLink)}const c="undefined"!=typeof navigator&&/GateApp/i.test(navigator.userAgent);function l(){return!("undefined"!=typeof window&&void 0!==window.navigator&&/GateApp/i.test(window.navigator.userAgent)||!(0,o.yO)())&&(window.location.href="https://gateio.onelink.me/DmA6/web3?dapp_url="+encodeURIComponent(window.location.href),!0)}var u=function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))};class d extends n.Y3{constructor(e={}){super(),this.name="Gate Wallet",this.url="https://gate.io",this.icon="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPG1hc2sgaWQ9Im1hc2swXzQ1ODJfNzgxIiBzdHlsZT0ibWFzay10eXBlOmFscGhhIiBtYXNrVW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4PSIwIiB5PSIwIiB3aWR0aD0iNDAiIGhlaWdodD0iNDAiPgo8cGF0aCBkPSJNMCA4QzAgMy41ODE3MiAzLjU4MTcyIDAgOCAwSDMyQzM2LjQxODMgMCA0MCAzLjU4MTcyIDQwIDhWMzJDNDAgMzYuNDE4MyAzNi40MTgzIDQwIDMyIDQwSDhDMy41ODE3MiA0MCAwIDM2LjQxODMgMCAzMlY4WiIgZmlsbD0id2hpdGUiLz4KPC9tYXNrPgo8ZyBtYXNrPSJ1cmwoI21hc2swXzQ1ODJfNzgxKSI+CjxwYXRoIGQ9Ik0wIDhDMCAzLjU4MTcyIDMuNTgxNzIgMCA4IDBIMzJDMzYuNDE4MyAwIDQwIDMuNTgxNzIgNDAgOFYzMkM0MCAzNi40MTgzIDM2LjQxODMgNDAgMzIgNDBIOEMzLjU4MTcyIDQwIDAgMzYuNDE4MyAwIDMyVjhaIiBmaWxsPSIjMDA1MUQyIi8+CjwvZz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zNSAyMEMzNSAyOC4yODQzIDI4LjI4NDMgMzUgMjAgMzVDMTEuNzE1NyAzNSA1IDI4LjI4NDMgNSAyMEM1IDExLjcxNTcgMTEuNzE1NyA1IDIwIDVWMTIuMDU4N0MyMCAxMi4wNTg3IDE5Ljk5OTkgMTIuMDU4NyAxOS45OTk5IDEyLjA1ODdDMTUuNjE0MSAxMi4wNTg3IDEyLjA1ODcgMTUuNjE0MSAxMi4wNTg3IDE5Ljk5OTlDMTIuMDU4NyAyNC4zODU3IDE1LjYxNDEgMjcuOTQxMSAxOS45OTk5IDI3Ljk0MTFDMjQuMzg1NiAyNy45NDExIDI3Ljk0MSAyNC4zODU3IDI3Ljk0MTEgMjBIMzVaIiBmaWxsPSJ3aGl0ZSIvPgo8cmVjdCB4PSIyMCIgeT0iMTIuMDU4NiIgd2lkdGg9IjcuOTQxMTgiIGhlaWdodD0iNy45NDExOCIgZmlsbD0iIzE0RTBBMSIvPgo8L3N2Zz4K",this._readyState=(0,o.My)()?n.Ok.Loading:n.Ok.NotFound,this._state=n.nL.Loading,this.onGateAccountChange=e=>{setTimeout((()=>{const t=this.address||"";if(0!==e.length){const t=e[0];this.setAddress(t),this.setState(n.nL.Connected)}else this.setAddress(null),this.setState(n.nL.Disconnect);(this.address||"")!==t&&this.emit("accountsChanged",this.address||"",t),!t&&this.address?this.emit("connect",this.address):t&&!this.address&&this.emit("disconnect")}),200)},this._checkPromise=null,this._updateWallet=()=>{var e,t;let r=this.state,o=this.address;if(a()){this._wallet=c?window.gatewallet.tronLink:window.gatewallet.tron,this._listenEvent(),o=(null===(t=null===(e=this._wallet.tronWeb)||void 0===e?void 0:e.defaultAddress)||void 0===t?void 0:t.base58)||null;r=(c?this._wallet.ready:this._wallet.tronWeb.ready)?n.nL.Connected:n.nL.Disconnect}else this._wallet=null,o=null,r=n.nL.NotFound;this.setAddress(o),this.setState(r)};const{checkTimeout:t=2e3,openUrlWhenWalletNotFound:r=!0,openAppWithDeeplink:s=!0}=e;if("number"!=typeof t)throw new Error("[GateWalletAdapter] config.checkTimeout should be a number");if(this.config={checkTimeout:t,openAppWithDeeplink:s,openUrlWhenWalletNotFound:r},this._connecting=!1,this._wallet=null,this._address=null,!(0,o.My)())return this._readyState=n.Ok.NotFound,void this.setState(n.nL.NotFound);a()?(this._readyState=n.Ok.Found,this._updateWallet()):this._checkWallet().then((()=>{this.connected&&this.emit("connect",this.address||"")}))}get address(){return this._address}get state(){return this._state}get readyState(){return this._readyState}get connecting(){return this._connecting}network(){return u(this,void 0,void 0,(function*(){try{if(yield this._checkWallet(),this.state!==n.nL.Connected)throw new s.PQ;const e=this._wallet;if(!e||!e.tronWeb)throw new s.PQ;try{return yield(0,i.NA)(e.tronWeb)}catch(e){throw new s.W0(null==e?void 0:e.message,e)}}
1766catch(e){throw this.emit("error",e),e}}))}connect(){return u(this,void 0,void 0,(function*(){var e;try{if(this.checkIfOpenGateWallet(),this.connected||this.connecting)return;if(yield this._checkWallet(),this.state===n.nL.NotFound)throw!1!==this.config.openUrlWhenWalletNotFound&&(0,o.My)()&&window.open(this.url,"_blank"),new s.hv;if(!this._wallet)return;this._connecting=!0;const t=this._wallet;let r;try{const e=c?"tron_requestAccounts":"eth_requestAccounts";if(r=yield t.request({method:e}),!r)throw new s.Y6("Request connect error.");if(4e3===r.code)throw new s.Y6("The same DApp has already initiated a request to connect to GateWallet, and the pop-up window has not been closed.");if(4001===r.code)throw new s.Y6("The user rejected connection.")}catch(e){throw new s.Y6(null==e?void 0:e.message,e)}const i=(c?null===(e=t.tronWeb.defaultAddress)||void 0===e?void 0:e.base58:r[0])||"";this.setAddress(i),this.setState(n.nL.Connected),this._listenEvent(),this.connected&&this.emit("connect",this.address||"")}catch(e){throw this.emit("error",e),e}finally{this._connecting=!1}}))}disconnect(){return u(this,void 0,void 0,(function*(){this._stopListenEvent(),this.state===n.nL.Connected&&(this.setAddress(null),this.setState(n.nL.Disconnect),this.emit("disconnect"))}))}signTransaction(e,t){return u(this,void 0,void 0,(function*(){try{const r=yield this.checkAndGetWallet();try{return yield r.tronWeb.trx.sign(e,t)}catch(e){throw e instanceof Error||"object"==typeof e&&e.message?new s.z4(e.message,e):"string"==typeof e?new s.z4(e,new Error(e)):new s.z4("Unknown error",e)}}catch(e){throw this.emit("error",e),e}}))}multiSign(e,t,r){return u(this,void 0,void 0,(function*(){try{const n=yield this.checkAndGetWallet();try{return yield n.tronWeb.trx.multiSign(e,t,r)}catch(e){throw e instanceof Error||"object"==typeof e&&e.message?new s.z4(e.message,e):"string"==typeof e?new s.z4(e,new Error(e)):new s.z4("Unknown error",e)}}catch(e){throw this.emit("error",e),e}}))}signMessage(e,t){return u(this,void 0,void 0,(function*(){try{const r=yield this.checkAndGetWallet();try{return yield r.tronWeb.trx.signMessageV2(e,t)}catch(e){throw e instanceof Error||"object"==typeof e&&e.message?new s.K3(e.message,e):"string"==typeof e?new s.K3(e,new Error(e)):new s.K3("Unknown error",e)}}catch(e){throw this.emit("error",e),e}}))}checkAndGetWallet(){return u(this,void 0,void 0,(function*(){if(this.checkIfOpenGateWallet(),yield this._checkWallet(),this.state!==n.nL.Connected)throw new s.PQ;const e=this._wallet;if(!e||!e.tronWeb)throw new s.PQ;return e}))}_listenEvent(){this._stopListenEvent(),c||this._wallet.on("accountsChanged",this.onGateAccountChange)}_stopListenEvent(){c||this._wallet.off("accountsChanged",this.onGateAccountChange)}checkIfOpenGateWallet(){if(!1!==this.config.openAppWithDeeplink&&l())throw new s.hv}_checkWallet(){if(this.readyState===n.Ok.Found)return Promise.resolve(!0);if(this._checkPromise)return this._checkPromise;const e=Math.floor(this.config.checkTimeout/100);let t,r=0;return this._checkPromise=new Promise((o=>{const s=()=>{r++;const s=a();(s||r>e)&&(t&&clearInterval(t),this._readyState=s?n.Ok.Found:n.Ok.NotFound,this._updateWallet(),this.emit("readyStateChanged",this.readyState),o(s))};t=setInterval(s,100),s()})),this._checkPromise}setAddress(e){this._address=e}setState(e){e!==this.state&&(this._state=e,this.emit("stateChanged",e))}}},"./node_modules/@tronweb3/tronwallet-adapter-okxwallet/lib/esm/adapter.js"(e,t,r){"use strict";r.d(t,{L:()=>u});var n=r("./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/adapter.js"),o=r("./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/utils.js"),s=r("./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/errors.js"),i=r("./node_modules/@tronweb3/tronwallet-adapter-tronlink/lib/esm/adapter.js");function a(){return!(!window.okxwallet||!window.okxwallet.tronLink)}"undefined"!=typeof navigator&&/OKApp/i.test(navigator.userAgent);function c(){return!("undefined"!=typeof window&&void 0!==window.navigator&&/OKApp/i.test(window.navigator.userAgent)||!(0,o.yO)())&&(window.location.href="okx://wallet/dapp/url?dappUrl="+encodeURIComponent(window.location.href),!0)}var l=function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))};class u extends n.Y3{constructor(e={}
1766){super(),this.name="OKX Wallet",this.url="https://okx.com",this.icon="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjQwIiBoZWlnaHQ9IjQwIiByeD0iOCIgZmlsbD0iYmxhY2siLz4KPHBhdGggZD0iTTIzLjU1ODMgMTUuODk2NUgxNi40NDc0QzE2LjE0NTMgMTUuODk2NSAxNS45MDA0IDE2LjE0MTQgMTUuOTAwNCAxNi40NDM1VjIzLjU1NDRDMTUuOTAwNCAyMy44NTY1IDE2LjE0NTMgMjQuMTAxNCAxNi40NDc0IDI0LjEwMTRIMjMuNTU4M0MyMy44NjA0IDI0LjEwMTQgMjQuMTA1MyAyMy44NTY1IDI0LjEwNTMgMjMuNTU0NFYxNi40NDM1QzI0LjEwNTMgMTYuMTQxNCAyMy44NjA0IDE1Ljg5NjUgMjMuNTU4MyAxNS44OTY1WiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZD0iTTE2LjQ0NzQgMTYuMzk2NUgyMy41NTgzQzIzLjU4NDIgMTYuMzk2NSAyMy42MDUzIDE2LjQxNzUgMjMuNjA1MyAxNi40NDM1VjIzLjU1NDRDMjMuNjA1MyAyMy41ODAzIDIzLjU4NDIgMjMuNjAxNCAyMy41NTgzIDIzLjYwMTRIMTYuNDQ3NEMxNi40MjE0IDIzLjYwMTQgMTYuNDAwNCAyMy41ODAzIDE2LjQwMDQgMjMuNTU0NFYxNi40NDM1QzE2LjQwMDQgMTYuNDE3NSAxNi40MjE0IDE2LjM5NjUgMTYuNDQ3NCAxNi4zOTY1WiIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLW9wYWNpdHk9IjAuMTUiLz4KPHBhdGggZD0iTTE1LjM1MDMgNy42OTE0MUg4LjIzOTM3QzcuOTM3MjggNy42OTE0MSA3LjY5MjM4IDcuOTM2MyA3LjY5MjM4IDguMjM4NFYxNS4zNDkzQzcuNjkyMzggMTUuNjUxNCA3LjkzNzI4IDE1Ljg5NjMgOC4yMzkzNyAxNS44OTYzSDE1LjM1MDNDMTUuNjUyMyAxNS44OTYzIDE1Ljg5NzIgMTUuNjUxNCAxNS44OTcyIDE1LjM0OTNWOC4yMzg0QzE1Ljg5NzIgNy45MzYzIDE1LjY1MjMgNy42OTE0MSAxNS4zNTAzIDcuNjkxNDFaIiBmaWxsPSJ3aGl0ZSIvPgo8cGF0aCBkPSJNOC4yMzkzNyA4LjE5MTQxSDE1LjM1MDNDMTUuMzc2MiA4LjE5MTQxIDE1LjM5NzIgOC4yMTI0NSAxNS4zOTcyIDguMjM4NFYxNS4zNDkzQzE1LjM5NzIgMTUuMzc1MiAxNS4zNzYyIDE1LjM5NjMgMTUuMzUwMyAxNS4zOTYzSDguMjM5MzdDOC4yMTM0MiAxNS4zOTYzIDguMTkyMzggMTUuMzc1MiA4LjE5MjM4IDE1LjM0OTNWOC4yMzg0QzguMTkyMzggOC4yMTI0NCA4LjIxMzQyIDguMTkxNDEgOC4yMzkzNyA4LjE5MTQxWiIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLW9wYWNpdHk9IjAuMTUiLz4KPHBhdGggZD0iTTMxLjc2MDQgNy42OTE0MUgyNC42NDk1QzI0LjM0NzQgNy42OTE0MSAyNC4xMDI1IDcuOTM2MyAyNC4xMDI1IDguMjM4NFYxNS4zNDkzQzI0LjEwMjUgMTUuNjUxNCAyNC4zNDc0IDE1Ljg5NjMgMjQuNjQ5NSAxNS44OTYzSDMxLjc2MDRDMzIuMDYyNSAxNS44OTYzIDMyLjMwNzQgMTUuNjUxNCAzMi4zMDc0IDE1LjM0OTNWOC4yMzg0QzMyLjMwNzQgNy45MzYzIDMyLjA2MjUgNy42OTE0MSAzMS43NjA0IDcuNjkxNDFaIiBmaWxsPSJ3aGl0ZSIvPgo8cGF0aCBkPSJNMjQuNjQ5NSA4LjE5MTQxSDMxLjc2MDRDMzEuNzg2NCA4LjE5MTQxIDMxLjgwNzQgOC4yMTI0NSAzMS44MDc0IDguMjM4NFYxNS4zNDkzQzMxLjgwNzQgMTUuMzc1MiAzMS43ODY0IDE1LjM5NjMgMzEuNzYwNCAxNS4zOTYzSDI0LjY0OTVDMjQuNjIzNiAxNS4zOTYzIDI0LjYwMjUgMTUuMzc1MiAyNC42MDI1IDE1LjM0OTNWOC4yMzg0QzI0LjYwMjUgOC4yMTI0NCAyNC42MjM2IDguMTkxNDEgMjQuNjQ5NSA4LjE5MTQxWiIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLW9wYWNpdHk9IjAuMTUiLz4KPHBhdGggZD0iTTE1LjM1MDMgMjQuMDk5Nkg4LjIzOTM3QzcuOTM3MjggMjQuMDk5NiA3LjY5MjM4IDI0LjM0NDUgNy42OTIzOCAyNC42NDY2VjMxLjc1NzVDNy42OTIzOCAzMi4wNTk2IDcuOTM3MjggMzIuMzA0NSA4LjIzOTM3IDMyLjMwNDVIMTUuMzUwM0MxNS42NTI0IDMyLjMwNDUgMTUuODk3MyAzMi4wNTk2IDE1Ljg5NzMgMzEuNzU3NVYyNC42NDY2QzE1Ljg5NzMgMjQuMzQ0NSAxNS42NTI0IDI0LjA5OTYgMTUuMzUwMyAyNC4wOTk2WiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZD0iTTguMjM5MzcgMjQuNTk5NkgxNS4zNTAzQzE1LjM3NjIgMjQuNTk5NiAxNS4zOTczIDI0LjYyMDYgMTUuMzk3MyAyNC42NDY2VjMxLjc1NzVDMTUuMzk3MyAzMS43ODM0IDE1LjM3NjIgMzEuODA0NSAxNS4zNTAzIDMxLjgwNDVIOC4yMzkzN0M4LjIxMzQyIDMxLjgwNDUgOC4xOTIzOCAzMS43ODM0IDguMTkyMzggMzEuNzU3NVYyNC42NDY2QzguMTkyMzggMjQuNjIwNiA4LjIxMzQyIDI0LjU5OTYgOC4yMzkzNyAyNC41OTk2WiIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLW9wYWNpdHk9IjAuMTUiLz4KPHBhdGggZD0iTTMxLjc2MDQgMjQuMDk5NkgyNC42NDk1QzI0LjM0NzQgMjQuMDk5NiAyNC4xMDI1IDI0LjM0NDUgMjQuMTAyNSAyNC42NDY2VjMxLjc1NzVDMjQuMTAyNSAzMi4wNTk2IDI0LjM0NzQgMzIuMzA0NSAyNC42NDk1IDMyLjMwNDVIMzEuNzYwNEMzMi4wNjI1IDMyLjMwNDUgMzIuMzA3NCAzMi4wNTk2IDMyLjMwNzQgMzEuNzU3NVYyNC42NDY2QzMyLjMwNzQgMjQuMzQ0NSAzMi4wNjI1IDI0LjA5OTYgMzEuNzYwNCAyNC4wOTk2WiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZD0iTTI0LjY0OTUgMjQuNTk5NkgzMS43NjA0QzMxLjc4NjQgMjQuNTk5NiAzMS44MDc0IDI0LjYyMDYgMzEuODA3NCAyNC42NDY2VjMxLjc1NzVDMzEuODA3NCAzMS43ODM0IDMxLjc4NjQgMzEuODA0NSAzMS43NjA0IDMxLjgwNDVIMjQuNjQ5NUMyNC42MjM2IDMxLjgwNDUgMjQuNjAyNSAzMS43ODM0IDI0LjYwMjUgMzEuNzU3NVYyNC42NDY2QzI0LjYwMjUgMjQuNjIwNiAyNC42MjM2IDI0LjU5OTYgMjQuNjQ5NSAyNC41OTk2WiIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLW9wYWNpdHk9IjAuMTUiLz4KPC9zdmc+Cg==",this._readyState=(0,o.My)()?n.Ok.Loading:n.Ok.NotFound,this._state=n.nL.Loading,this.messageHandler=e=>{var t,r,o;const s=null===(t=e.data)||void 0===t?void 0:t.message;if(s)if("accountsChanged"===s.action)setTimeout((()=>{var e;const t=this.address||"";if(null===(e=this._wallet)||void 0===e?void 0:e.ready){const e=s.data.address;this.setAddress(e),this.setState(n.nL.Connected)}else this.setAddress(null),this.setState(n.nL.Disconnect);
1766(this.address||"")!==t&&this.emit("accountsChanged",this.address||"",t),!t&&this.address?this.emit("connect",this.address):t&&!this.address&&this.emit("disconnect")}),200);else if("connect"===s.action){const e=this.connected,t=this.address||"",s=(null===(o=null===(r=this._wallet.tronWeb)||void 0===r?void 0:r.defaultAddress)||void 0===o?void 0:o.base58)||"";this.setAddress(s),this.setState(n.nL.Connected),e?s!==t&&this.emit("accountsChanged",this.address||"",t):this.emit("connect",s)}else"disconnect"===s.action&&(this.setAddress(null),this.setState(n.nL.Disconnect),this.emit("disconnect"))},this._checkPromise=null,this._updateWallet=()=>{var e,t;let r=this.state,o=this.address;a()?(this._wallet=window.okxwallet.tronLink,this._listenEvent(),o=(null===(t=null===(e=this._wallet.tronWeb)||void 0===e?void 0:e.defaultAddress)||void 0===t?void 0:t.base58)||null,r=this._wallet.ready?n.nL.Connected:n.nL.Disconnect):(this._wallet=null,o=null,r=n.nL.NotFound),this.setAddress(o),this.setState(r)};const{checkTimeout:t=2e3,openUrlWhenWalletNotFound:r=!0,openAppWithDeeplink:s=!0}=e;if("number"!=typeof t)throw new Error("[OkxWalletAdapter] config.checkTimeout should be a number");if(this.config={checkTimeout:t,openAppWithDeeplink:s,openUrlWhenWalletNotFound:r},this._connecting=!1,this._wallet=null,this._address=null,!(0,o.My)())return this._readyState=n.Ok.NotFound,void this.setState(n.nL.NotFound);a()?(this._readyState=n.Ok.Found,this._updateWallet()):this._checkWallet().then((()=>{this.connected&&this.emit("connect",this.address||"")}))}get address(){return this._address}get state(){return this._state}get readyState(){return this._readyState}get connecting(){return this._connecting}network(){return l(this,void 0,void 0,(function*(){try{if(yield this._checkWallet(),this.state!==n.nL.Connected)throw new s.PQ;const e=this._wallet;if(!e||!e.tronWeb)throw new s.PQ;try{return yield(0,i.NA)(e.tronWeb)}catch(e){throw new s.W0(null==e?void 0:e.message,e)}}catch(e){throw this.emit("error",e),e}}))}connect(){return l(this,void 0,void 0,(function*(){var e;try{if(this.checkIfOpenOkxWallet(),this.connected||this.connecting)return;if(yield this._checkWallet(),this.state===n.nL.NotFound)throw!1!==this.config.openUrlWhenWalletNotFound&&(0,o.My)()&&window.open(this.url,"_blank"),new s.hv;if(!this._wallet)return;this._connecting=!0;const t=this._wallet;try{const e=yield t.request({method:"tron_requestAccounts"});if(!e)throw new s.Y6("Request connect error.");if(4e3===e.code)throw new s.Y6("The same DApp has already initiated a request to connect to OkxWallet, and the pop-up window has not been closed.");if(4001===e.code)throw new s.Y6("The user rejected connection.")}catch(e){throw new s.Y6(null==e?void 0:e.message,e)}const r=(null===(e=t.tronWeb.defaultAddress)||void 0===e?void 0:e.base58)||"";this.setAddress(r),this.setState(n.nL.Connected),this._listenEvent(),this.connected&&this.emit("connect",this.address||"")}catch(e){throw this.emit("error",e),e}finally{this._connecting=!1}}))}disconnect(){return l(this,void 0,void 0,(function*(){this._stopListenEvent(),this.state===n.nL.Connected&&(this.setAddress(null),this.setState(n.nL.Disconnect),this.emit("disconnect"))}))}signTransaction(e,t){return l(this,void 0,void 0,(function*(){try{const r=yield this.checkAndGetWallet();try{return yield r.tronWeb.trx.sign(e,t)}catch(e){throw e instanceof Error||"object"==typeof e&&e.message?new s.z4(e.message,e):"string"==typeof e?new s.z4(e,new Error(e)):new s.z4("Unknown error",e)}}catch(e){throw this.emit("error",e),e}}))}multiSign(e,t,r){return l(this,void 0,void 0,(function*(){try{const n=yield this.checkAndGetWallet();try{return yield n.tronWeb.trx.multiSign(e,t,r)}catch(e){throw e instanceof Error||"object"==typeof e&&e.message?new s.z4(e.message,e):"string"==typeof e?new s.z4(e,new Error(e)):new s.z4("Unknown error",e)}}catch(e){throw this.emit("error",e),e}}))}signMessage(e,t){return l(this,void 0,void 0,(function*(){try{const r=yield this.checkAndGetWallet();try{return yield r.tronWeb.trx.signMessageV2(e,t)}catch(e){throw e instanceof Error||"object"==typeof e&&e.message?new s.K3(e.message,e):"string"==typeof e?new s.K3(e,new Error(e)):new s.K3("Unknown error",e)}}
1766catch(e){throw this.emit("error",e),e}}))}checkAndGetWallet(){return l(this,void 0,void 0,(function*(){if(this.checkIfOpenOkxWallet(),yield this._checkWallet(),this.state!==n.nL.Connected)throw new s.PQ;const e=this._wallet;if(!e||!e.tronWeb)throw new s.PQ;return e}))}_listenEvent(){this._stopListenEvent(),window.addEventListener("message",this.messageHandler)}_stopListenEvent(){window.removeEventListener("message",this.messageHandler)}checkIfOpenOkxWallet(){if(!1!==this.config.openAppWithDeeplink&&c())throw new s.hv}_checkWallet(){if(this.readyState===n.Ok.Found)return Promise.resolve(!0);if(this._checkPromise)return this._checkPromise;const e=Math.floor(this.config.checkTimeout/100);let t,r=0;return this._checkPromise=new Promise((o=>{const s=()=>{r++;const s=a();(s||r>e)&&(t&&clearInterval(t),this._readyState=s?n.Ok.Found:n.Ok.NotFound,this._updateWallet(),this.emit("readyStateChanged",this.readyState),o(s))};t=setInterval(s,100),s()})),this._checkPromise}setAddress(e){this._address=e}setState(e){e!==this.state&&(this._state=e,this.emit("stateChanged",e))}}},"./node_modules/@tronweb3/tronwallet-adapter-react-hooks/lib/esm/WalletProvider.js"(e,t,r){"use strict";r.d(t,{r:()=>u});var n=r("./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/errors.js"),o=r("./node_modules/@tronweb3/tronwallet-adapter-tronlink/lib/esm/adapter.js"),s=r("./node_modules/react/index.js"),i=r("./node_modules/@tronweb3/tronwallet-adapter-react-hooks/lib/esm/useWallet.js"),a=r("./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/utils.js");var c=function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))};const l={wallet:null,address:null,connected:!1,adapter:null},u=function({children:e,adapters:t=null,onError:r=e=>console.error(e),onReadyStateChanged:u,onConnect:d,onDisconnect:h,onAccountsChanged:p,onChainChanged:f,onAdapterChanged:g,localStorageKey:m="tronAdapterName",autoConnect:y=!0,disableAutoConnectOnLoad:b=!1}){const[w,v]=function(e,t){const[r,n]=(0,s.useState)((()=>{try{const t=localStorage.getItem(e);if(t)return JSON.parse(t)}catch(e){(0,a.My)()&&console.error(e)}return t})),o=(0,s.useRef)(!0);return(0,s.useEffect)((()=>{if(o.current)o.current=!1;else try{null===r?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(r))}catch(e){(0,a.My)()&&console.error(e)}}),[r,e]),[r,n]}(m,null),[{wallet:A,connected:T,address:P,adapter:E},C]=(0,s.useState)(l),[k,_]=(0,s.useState)(!1),[I,S]=(0,s.useState)(!1),x=(0,s.useRef)(!1),B=(0,s.useRef)(!1),O=(0,s.useMemo)((()=>null===t?[new o.Fq]:t),[t]),[M,W]=(0,s.useState)((()=>O.map((e=>({adapter:e,state:e.state})))));(0,s.useEffect)((function(){function e(){W((e=>{const t=e.findIndex((e=>e.adapter===this));return-1===t?e:e.map(((e,r)=>r===t?Object.assign(Object.assign({},e),{state:e.adapter.state}):e))}))}return W((e=>O.map(((t,r)=>{const n=e[r];return n&&n.adapter===t&&n.state===t.state?n:{adapter:t,state:t.state}})))),O.forEach((t=>t.on("stateChanged",e,t))),()=>O.forEach((t=>t.off("stateChanged",e,t)))}),[O]),(0,s.useEffect)((function(){const e=w&&M.find((e=>e.adapter.name===w));C(e?{wallet:e,adapter:e.adapter,connected:e.adapter.connected,address:e.adapter.address}:l)}),[w,M]);const j=(0,s.useRef)(null);(0,s.useEffect)((function(){E!==j.current&&(null==g||g(E),j.current=E)}),[E,g]);const R=(0,s.useCallback)((function(e){if(!E)return v(null);C((e=>Object.assign(Object.assign({},e),{connected:E.connected,address:E.address}))),null==d||d(e)}),[E,v,d]),N=(0,s.useCallback)((function(e){return r(e),e}),[r]),U=(0,s.useCallback)((function(e,t){C((t=>Object.assign(Object.assign({},t),{address:e}))),null==p||p(e,t)}),[p]),D=(0,s.useCallback)((function(){null==h||h()}),[h]),L=(0,s.useCallback)((function(e){null==u||u(e)}),[u]),F=(0,s.useCallback)((function(e){null==f||f(e)}),[f]);(0,s.useEffect)((function(){if(E)return E.on("connect",R),E.on("error",N),E.on("accountsChanged",U),E.on("chainChanged",F),E.on("readyStateChanged",L),E.on("disconnect",D),()=>{E.off("connect",R),E.off("error",N),E.off("accountsChanged",U),E.off("chainChanged",F),E.off("readyStateChanged",L),E.off("disconnect",D)}}),[E,R,N,U,F,L,D]),(0,s.useEffect)((()=>()=>{null==E||E.disconnect()}),[E]);const z=(0,s.useRef)(!1);(0,s.useEffect)((function(){const e=y&&(!b||z.current);!x.current&&e&&E&&function(){c(this,void 0,void 0,(function*(){x.current=!0,_(!0);try{yield E.connect()}catch(e){}finally{_(!1),x.current=!1}}))}()}),[x,y,E,v,b]);const V=(0,s.useCallback)((e=>{z.current=!0,v(e)}),[v]),q=(0,s.useCallback)((function(){return c(this,void 0,void 0,(function*(){if(!(x.current||B.current||T)){if(!E)throw N(new n.gK);x.current=!0,_(!0);try{yield E.connect()}
1766catch(e){throw v(null),e}finally{_(!1),x.current=!1}}}))}),[x,B,E,T,N,v]),H=(0,s.useCallback)((function(){return c(this,void 0,void 0,(function*(){if(!B.current){if(!E)return v(null);B.current=!0,S(!0);try{yield E.disconnect(),v(null)}catch(e){throw v(null),e}finally{S(!1),B.current=!1}}}))}),[E,B,v]),K=(0,s.useCallback)((function(e,t){return c(this,void 0,void 0,(function*(){if(!E)throw N(new n.gK);return yield E.signTransaction(e,t)}))}),[E,N]),$=(0,s.useCallback)((function(e,t){return c(this,void 0,void 0,(function*(){if(!E)throw N(new n.gK);return yield E.signMessage(e,t)}))}),[E,N]);return s.createElement(i.b.Provider,{value:{disableAutoConnectOnLoad:b,autoConnect:y,wallets:M,wallet:A,address:P,connecting:k,connected:T,disconnecting:I,select:V,connect:q,disconnect:H,signTransaction:K,signMessage:$}},e)}},"./node_modules/@tronweb3/tronwallet-adapter-react-hooks/lib/esm/useWallet.js"(e,t,r){"use strict";r.d(t,{b:()=>i,v:()=>a});var n=r("./node_modules/react/index.js");function o(){console.error("\nYou are using WalletContext without provide the WalletContext.Provider.\nPlease wrap your sub-components with a WalletProvider and provide required values.\n")}const s={autoConnect:!1,connecting:!1,connected:!1,disconnecting:!1,select(e){o()},connect:()=>(o(),Promise.reject()),disconnect:()=>(o(),Promise.reject()),signTransaction:e=>(o(),Promise.reject()),signMessage:e=>(o(),Promise.reject())};Object.defineProperty(s,"wallets",{get:()=>(o(),[])}),Object.defineProperty(s,"wallet",{get:()=>(o(),null)}),Object.defineProperty(s,"address",{get:()=>(o(),null)});const i=(0,n.createContext)(s);function a(){return(0,n.useContext)(i)}},"./node_modules/@tronweb3/tronwallet-adapter-tokenpocket/lib/esm/adapter.js"(e,t,r){"use strict";r.d(t,{D:()=>d});var n=r("./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/adapter.js"),o=r("./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/utils.js"),s=r("./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/errors.js"),i=r("./node_modules/@tronweb3/tronwallet-adapter-tronlink/lib/esm/adapter.js");function a(){return!!window.tronWeb&&void 0!==window.tokenpocket}function c(){if(!a()&&(0,o.yO)()&&(!(0,o.My)()||void 0===window.tokenpocket)){const{origin:e,pathname:t,search:r,hash:n}=window.location,o=e+t+r+n,s={action:"open",actionId:Date.now()+"",callbackUrl:"http://someurl.com",blockchain:"Tron",chain:"Tron",url:o,protocol:"TokenPocket",version:"1.0"};return window.location.href=`tpdapp://open?params=${encodeURIComponent(JSON.stringify(s))}`,!0}return!1}var l=r("./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/types.js"),u=function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))};class d extends n.Y3{constructor(e={}){super(),this.name="TokenPocket",this.url="https://tokenpocket.pro/",this.icon="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwIiBoZWlnaHQ9IjEyMCIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGc+CjxwYXRoIGQ9Ik0xMDQxLjUyIDBILTI3VjEwMjRIMTA0MS41MlYwWiIgZmlsbD0iIzI5ODBGRSIvPgo8ZyBjbGlwLXBhdGg9InVybCgjY2xpcDBfNDA4XzIyNSkiPgo8cGF0aCBkPSJNNDA2Ljc5NiA0MzguNjQzSDQwNi45MjdDNDA2Ljc5NiA0MzcuODU3IDQwNi43OTYgNDM2Ljk0IDQwNi43OTYgNDM2LjE1NFY0MzguNjQzWiIgZmlsbD0iIzI5QUVGRiIvPgo8cGF0aCBkPSJNNjY3LjYwMiA0NjMuNTMzSDUyMy4yNDlWNzI0LjA3NkM1MjMuMjQ5IDczNi4zODkgNTMzLjIwNCA3NDYuMzQ1IDU0NS41MTcgNzQ2LjM0NUg2NDUuMzMzQzY1Ny42NDcgNzQ2LjM0NSA2NjcuNjAyIDczNi4zODkgNjY3LjYwMiA3MjQuMDc2VjQ2My41MzNaIiBmaWxsPSJ3aGl0ZSIvPgo8cGF0aCBkPSJNNDUzLjU2MyAyNzdINDQ4LjcxNkgxOTAuMjY5QzE3Ny45NTUgMjc3IDE2OCAyODYuOTU1IDE2OCAyOTkuMjY5VjM4OS42NTNDMTY4IDQwMS45NjcgMTc3Ljk1NSA0MTEuOTIyIDE5MC4yNjkgNDExLjkyMkgyNTAuOTE4SDI3NS4wMjFWNDM4LjY0NFY3MjQuNzMxQzI3NS4wMjEgNzM3LjA0NSAyODQuOTc2IDc0NyAyOTcuMjg5IDc0N0gzOTIuMTI4QzQwNC40NDEgNzQ3IDQxNC4zOTYgNzM3LjA0NSA0MTQuMzk2IDcyNC43MzFWNDM4LjY0NFY0MzYuMTU2VjQxMS45MjJINDM4LjQ5OUg0NDguMzIzSDQ1My4xN0M0OTAuMzcyIDQ
1766xMS45MjIgNTIwLjYzMSAzODEuNjYzIDUyMC42MzEgMzQ0LjQ2MUM1MjEuMDI0IDMwNy4yNTkgNDkwLjc2NSAyNzcgNDUzLjU2MyAyNzdaIiBmaWxsPSJ3aGl0ZSIvPgo8cGF0aCBkPSJNNjY3LjczNSA0NjMuNTMzVjY0NS4zNUM2NzIuNzEzIDY0Ni41MjkgNjc3LjgyMSA2NDcuNDQ2IDY4My4wNjEgNjQ4LjIzMkM2OTAuMzk3IDY0OS4yOCA2OTcuOTk0IDY0OS45MzUgNzA1LjU5MiA2NTAuMDY2QzcwNS45ODUgNjUwLjA2NiA3MDYuMzc4IDY1MC4wNjYgNzA2LjkwMiA2NTAuMDY2VjUwNS40NUM2ODUuMDI2IDUwNC4wMDkgNjY3LjczNSA0ODUuODAxIDY2Ny43MzUgNDYzLjUzM1oiIGZpbGw9InVybCgjcGFpbnQwX2xpbmVhcl80MDhfMjI1KSIvPgo8cGF0aCBkPSJNNzA5Ljc4MSAyNzdDNjA2LjgyMiAyNzcgNTIzLjI0OSAzNjAuNTczIDUyMy4yNDkgNDYzLjUzM0M1MjMuMjQ5IDU1Mi4wODQgNTg0Ljk0NiA2MjYuMjI1IDY2Ny43MzMgNjQ1LjM1VjQ2My41MzNDNjY3LjczMyA0NDAuMzQ3IDY4Ni41OTYgNDIxLjQ4NCA3MDkuNzgxIDQyMS40ODRDNzMyLjk2NyA0MjEuNDg0IDc1MS44MyA0NDAuMzQ3IDc1MS44MyA0NjMuNTMzQzc1MS44MyA0ODMuMDUxIDczOC42IDQ5OS40MjUgNzIwLjUyMyA1MDQuMTRDNzE3LjExNyA1MDUuMDU3IDcxMy40NDkgNTA1LjU4MSA3MDkuNzgxIDUwNS41ODFWNjUwLjA2NkM3MTMuNDQ5IDY1MC4wNjYgNzE2Ljk4NiA2NDkuOTM1IDcyMC41MjMgNjQ5LjgwNEM4MTguNTA1IDY0NC4xNzEgODk2LjMxNCA1NjIuOTU2IDg5Ni4zMTQgNDYzLjUzM0M4OTYuNDQ1IDM2MC41NzMgODEyLjg3MiAyNzcgNzA5Ljc4MSAyNzdaIiBmaWxsPSJ3aGl0ZSIvPgo8cGF0aCBkPSJNNzA5Ljc4IDY1MC4wNjZWNTA1LjU4MUM3MDguNzMzIDUwNS41ODEgNzA3LjgxNiA1MDUuNTgxIDcwNi43NjggNTA1LjQ1VjY1MC4wNjZDNzA3LjgxNiA2NTAuMDY2IDcwOC44NjQgNjUwLjA2NiA3MDkuNzggNjUwLjA2NloiIGZpbGw9IndoaXRlIi8+CjwvZz4KPC9nPgo8ZGVmcz4KPGxpbmVhckdyYWRpZW50IGlkPSJwYWludDBfbGluZWFyXzQwOF8yMjUiIHgxPSI3MDkuODQ0IiB5MT0iNTU2LjgyNyIgeDI9IjY2Ny43NTMiIHkyPSI1NTYuODI3IiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CjxzdG9wIHN0b3AtY29sb3I9IndoaXRlIi8+CjxzdG9wIG9mZnNldD0iMC45NjY3IiBzdG9wLWNvbG9yPSJ3aGl0ZSIgc3RvcC1vcGFjaXR5PSIwLjMyMzMiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSJ3aGl0ZSIgc3RvcC1vcGFjaXR5PSIwLjMiLz4KPC9saW5lYXJHcmFkaWVudD4KPGNsaXBQYXRoIGlkPSJjbGlwMF80MDhfMjI1Ij4KPHJlY3Qgd2lkdGg9IjcyOC40NDgiIGhlaWdodD0iNDcwIiBmaWxsPSJ3aGl0ZSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTY4IDI3NykiLz4KPC9jbGlwUGF0aD4KPC9kZWZzPgo8L3N2Zz4K",this._readyState=(0,o.My)()?n.Ok.Loading:n.Ok.NotFound,this._state=n.nL.Loading,this.onAccountsChanged=e=>{const t=this.address||"",r=(null==e?void 0:e[0])||"";if(r){const e=r;this.setAddress(e),this.setState(n.nL.Connected)}else this.setAddress(null),this.setState(n.nL.Disconnect);this.emit("accountsChanged",this.address||"",t),!t&&this.address?this.emit("connect",this.address):t&&!this.address&&this.emit("disconnect")},this.checkReadyInterval=null,this._checkPromise=null,this._updateWallet=()=>{var e,t,r,s,i;let c=this.state,l=this.address;if(a()){const a=null===(e=window.tokenpocket)||void 0===e?void 0:e.tron;this._wallet=(0,o.yO)()?{tron:a,ready:null===(t=window.tronWeb)||void 0===t?void 0:t.ready,tronWeb:null===(r=window.tokenpocket)||void 0===r?void 0:r.tronWeb}:{tron:a,ready:!!(null===(s=(null==a?void 0:a.tronWeb).defaultAddress)||void 0===s?void 0:s.base58)||!1,tronWeb:null==a?void 0:a.tronWeb},l=(null===(i=this._wallet.tronWeb.defaultAddress)||void 0===i?void 0:i.base58)||null,c=l?n.nL.Connected:n.nL.Disconnect,l||this.checkForWalletReady()}else this._wallet=null,l=null,c=n.nL.NotFound;this.setAddress(l),this.setState(c)};const{checkTimeout:t=2e3,openUrlWhenWalletNotFound:r=!0,openAppWithDeeplink:s=!0}=e;if("number"!=typeof t)throw new Error("[TokenPocketAdapter] config.checkTimeout should be a number");this.config={checkTimeout:t,openAppWithDeeplink:s,openUrlWhenWalletNotFound:r},this._connecting=!1,this._wallet=null,this._address=null,(0,o.yO)()&&a()?(this._readyState=n.Ok.Found,this._updateWallet()):this._checkWallet().then((()=>{this.connected&&this.emit("connect",this.address||"")}))}get address(){return this._address}get state(){return this._state}get readyState(){return this._readyState}get connecting(){return this._connecting}network(){return u(this,void 0,void 0,(function*(){try{if(yield this._checkWallet(),this.state!==n.nL.Connected)throw new s.PQ;const e=this._wallet;if(!e||!e.tronWeb)throw new s.PQ;try{return yield(0,i.NA)(e.tronWeb)}catch(e){throw new s.W0(null==e?void 0:e.message,e)}}catch(e){throw this.emit("error",e),e}}))}connect(){return u(this,void 0,void 0,(function*(){try{if(this.checkIfOpenApp(),this.connected||this.connecting)return;if(yield this._checkWallet(),this.readyState===n.Ok.NotFound)throw!1!==this.config.openUrlWhenWalletNotFound&&(0,o.My)()&&window.open(this.url,"_blank"),new s.hv;if(!this._wallet)return;this._connecting=!0;const e=this._wallet;try{const t=yield e.tron.request({method:"eth_requestAccounts"});if(!(null==t?void 0:t[0]))throw new s.Y6("Request connect error.");const r=t[0];
1766this.setAddress(r),this.setState(n.nL.Connected),this.emit("connect",this.address||"")}catch(e){throw e instanceof s.m7?e:new s.Y6(null==e?void 0:e.message,e)}}catch(e){throw this.emit("error",e),e}finally{this._connecting=!1}}))}disconnect(){return u(this,void 0,void 0,(function*(){this.state===n.nL.Connected&&(this.setAddress(null),this.setState(n.nL.Disconnect),this.emit("disconnect"))}))}signTransaction(e,t){return u(this,void 0,void 0,(function*(){try{const r=yield this.checkAndGetWallet();try{return yield r.tronWeb.trx.sign(e,t)}catch(e){throw e instanceof Error||"object"==typeof e&&e.message?new s.z4(e.message,e):"string"==typeof e?new s.z4(e,new Error(e)):new s.z4("Unknown error",e)}}catch(e){throw this.emit("error",e),e}}))}multiSign(e,t,r){return u(this,void 0,void 0,(function*(){try{const n=yield this.checkAndGetWallet();try{return yield n.tronWeb.trx.multiSign(e,t,r)}catch(e){throw e instanceof Error||"object"==typeof e&&e.message?new s.z4(e.message,e):"string"==typeof e?new s.z4(e,new Error(e)):new s.z4("Unknown error",e)}}catch(e){throw this.emit("error",e),e}}))}signMessage(e,t){return u(this,void 0,void 0,(function*(){try{const r=yield this.checkAndGetWallet();try{return yield r.tronWeb.trx.signMessageV2(e,t)}catch(e){throw e instanceof Error||"object"==typeof e&&e.message?new s.K3(e.message,e):"string"==typeof e?new s.K3(e,new Error(e)):new s.K3("Unknown error",e)}}catch(e){throw this.emit("error",e),e}}))}listenTronEvent(){if((0,o.yO)())return;this.stopListenTronEvent();const e=this._wallet;e&&e.tron&&e.tron.on("accountsChanged",this.onAccountsChanged)}stopListenTronEvent(){if((0,o.yO)())return;const e=this._wallet;e&&e.tron&&e.tron.removeListener("accountsChanged",this.onAccountsChanged)}
1766checkAndGetWallet(){return u(this,void 0,void 0,(function*(){if(this.checkIfOpenApp(),yield this._checkWallet(),!this.connected)throw new s.PQ;const e=this._wallet;if(!e||!e.tronWeb)throw new s.PQ;return e}))}checkIfOpenApp(){if(!1!==this.config.openAppWithDeeplink&&c())throw new s.hv}checkForWalletReady(){if(this.checkReadyInterval)return;let e=0;const t=Math.floor(this.config.checkTimeout/200);this.checkReadyInterval=setInterval((()=>{var r,s,i,a;if((0,o.yO)()&&(null===(r=window.tronWeb)||void 0===r?void 0:r.ready))this.checkReadyInterval&&clearInterval(this.checkReadyInterval),this.checkReadyInterval=null,this._updateWallet(),this.emit("connect",this.address||"");else if(null===(a=null===(i=null===(s=this._wallet)||void 0===s?void 0:s.tronWeb)||void 0===i?void 0:i.defaultAddress)||void 0===a?void 0:a.base58){this.checkReadyInterval&&clearInterval(this.checkReadyInterval),this.checkReadyInterval=null,this._wallet.ready=!0;const e=this._wallet.tronWeb.defaultAddress.base58,t=e?n.nL.Connected:n.nL.Disconnect;this.setAddress(e),this.setState(t),this.emit("connect",this.address||"")}else e>t?(this.checkReadyInterval&&clearInterval(this.checkReadyInterval),this.checkReadyInterval=null):e++}),200)}_checkWallet(){if(this.readyState===n.Ok.Found)return Promise.resolve(!0);if(this._checkPromise)return this._checkPromise;if((0,o.My)()&&!(0,o.yO)())return this._checkPromise=new Promise((e=>{const t=setTimeout((()=>{window.removeEventListener(l.r5,r),this._updateWallet(),a()?(this._readyState=n.Ok.Found,e(!0)):(this._readyState=n.Ok.NotFound,e(!1)),this.emit("readyStateChanged",this._readyState)}),this.config.checkTimeout),r=o=>{var s,i,a;const{info:c,provider:u}=o.detail;if("TokenPocket"===c.name){this._wallet={ready:!!(null===(i=null===(s=u.tronWeb)||void 0===s?void 0:s.defaultAddress)||void 0===i?void 0:i.base58),tron:u,tronWeb:u.tronWeb},this.listenTronEvent(),this._readyState=n.Ok.Found;const o=(null===(a=this._wallet.tronWeb.defaultAddress)||void 0===a?void 0:a.base58)||null,c=o?n.nL.Connected:n.nL.Disconnect;this.setState(c),this.setAddress(o),this.emit("readyStateChanged",this.readyState),window.removeEventListener(l.r5,r),clearTimeout(t),e(!0),this.connected||this.checkForWalletReady()}};window.addEventListener(l.r5,r),window.dispatchEvent(new Event(l.Xm))})),this._checkPromise;const e=Math.floor(this.config.checkTimeout/100);let t,r=0;return this._checkPromise=new Promise((o=>{const s=()=>{r++;const s=a();(s||r>e)&&(t&&clearInterval(t),this._readyState=s?n.Ok.Found:n.Ok.NotFound,this._updateWallet(),this.emit("readyStateChanged",this.readyState),o(s))};t=setInterval(s,100),s()})),this._checkPromise}setAddress(e){this._address=e}setState(e){e!==this.state&&(this._state=e,this.emit("stateChanged",e))}}},"./node_modules/@tronweb3/tronwallet-adapter-tronlink/lib/esm/adapter.js"(e,t,r){"use strict";r.d(t,{Fq:()=>f,NA:()=>p});var n=r("./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/types.js"),o=r("./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/adapter.js"),s=r("./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/utils.js"),i=r("./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/errors.js"),a=function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))};function c(){return!(!window.tron||!window.tron.isTronLink)}function l(){return!!(c()||window.tronLink||window.tronWeb)}function u({dappIcon:e,dappName:t}={dappIcon:"",dappName:""}){if(!l()&&(0,s.yO)()&&(!(0,s.My)()||void 0===window.iTron)){let r="",n="";try{r=document.title;const e=document.querySelector('link[rel*="icon"]');e&&(n=new URL(e.getAttribute("href")||"",location.href).toString())}catch(e){}const{origin:o,pathname:s,search:i,hash:a}=window.location,c=o+s+i+(a.includes("?")?a:`${a}?_=1`),l={action:"open",actionId:Date.now()+"",callbackUrl:"http://someurl.com",dappIcon:e||n,dappName:t||r,url:c,protocol:"TronLink",version:"1.0",chainId:"0x2b6653dc"};return window.location.href=`tronlinkoutside://pull.activity?param=${encodeURIComponent(JSON.stringify(l))}`,!0}return!1}var d=function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))};const h={"0x2b6653dc":n.z1.Mainnet,"0x94a9059e":n.z1.Shasta,"0xcd8690dc":n.z1.Nile};function p(e){return d(this,void 0,void 0,(function*(){var t,r,o;const{blockID:s=""}=yield e.trx.getBlockByNumber(0),i=`0x${s.slice(-8)}`;return{networkType:h[i]||n.z1.Unknown,chainId:i,fullNode:(null===(t=e.fullNode)||void 0===t?void 0:t.host)||"",solidityNode:(null===(r=e.solidityNode)||void 0===r?void 0:r.host)||"",eventServer:(null===(o=e.eventServer)||void 0===o?void 0:o.host)||""}}))}class f extends o.Y3{constructor(e={}){super(),this.name="TronLink",this.url="https://www.tronlink.org/",this.icon="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF0AAABdCAYAAADHcWrDAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAUGVYSWZNTQAqAAAACAACARIAAwAAAAEAAQAAh2kABAAAAAEAAAAmAAAAAAADoAEAAwAAAAEAAQAAoAIABAAAAAEAAABdoAMABAAAAAEAAABdAAAAAMkTBfIAAAFZaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA2LjAuMCI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgI
1766HhtbG5zOnRpZmY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vdGlmZi8xLjAvIj4KICAgICAgICAgPHRpZmY6T3JpZW50YXRpb24+MTwvdGlmZjpPcmllbnRhdGlvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+Chle4QcAABZhSURBVHgB7V0JlBTVuf6runtWllkA2QeYQQRBZHNFxZjw4jFqMEFxCWIS1yOaTeJ76nk5Lyc5CUZNfCoa0BgUxRh3QD2CJs8lELaIgOCw78sszN4z0131vu/W1NDTfbtneqa7Zx5v/nN6prrq1q2q77//ev9bbUgcNHjm/sya7PIiIxA43TCNUbYEcw3bsOLo4v98U9sWAxSwbbvYI7LDCDZ+dezl847G82BGWxrnzVl/nmF5bhCxviG2FBoen0+Ep9ptOf0UbOPAZlsNhOCYmOYawzaXirfynZLnpla19sAxQc+5ac14jyf9IbHsqw1vute2GoF78P8x2Bo4DVMME2OQqAQDW8W2flv64oQXMCijjsiooOfP3jAXvf0SHfa2A/XsUnXc/ScGAgAfqgfgB18zGqvvKVk69ZCudSTot63z5fvNRw0z7W7bCpB9uvO698VAwPBmAraGzXbQuq5sycSt4U3NljtsA4D/wfBk3I2TugFvCU6bv9mBOigJ71jTY7zd++Z1heEntgA976b1P8YIv9MO+NGuW52EgxXPdzsIlexJK/Ra5uK+d23pEXpuM+h9blo30TS9/6WMZTfgoRi1e5uD1/BmXGBV1j0Y2okD+i9smGDjV2L6smF9Q493b3cQATXiTc/c3BvXjXO7UqD32bn2Itv0TlcN3CPd/xODAAax4UnP8pjmvW6HCnTbNm+B4sd2tx53gUnkfw5mW6wZUOED2K+ZM2djDoLLy+wgAp9uSg4CarRn5Ikpl/ICpinWGfBvBnXr8uTg3dwrIlfkbS5yQLdkPNxEBEndqqUZoGRsqCDTHK1At2yZZnd7LMmAuUWfDsZ236LLV6SbGPXZ3aO8BT7J/OLx98iBSre79UoyUW7RN3Jh/O4ERy2OdH9JNgLdoCcbYU3/3aBrQEn2rm7Qk42wpn+vZl/cuzgTUtvgJMo8piEesNLE/8gZkri7PiVP6DDojUFb5s0YIIPz02TDzhr58oBf9hyrl9KqgGIEZq/ABEOY2UEFQTcjMIw6DHoAoO891iAPfHeg3HxpH4a6cryyUXYfrZdNe+tk055aMKJO9h5vUIyog0ScZASYQGackuM5+kN1GPR0nykrN1XIobIGGZiXpgDt19sn/Jx7ujNhgqhXjlU4jPhiby0YUdfEiHopg0TUNbKYxJUIgwmhU5o6DDo0hhw90Sjvb6yQWy7rqwWLbfrn+NTn/FEnGcHzdh7xyxeQCDKDqmlficOI+iZGeHGyxwNGnELi0GHQiTIBeWNNucz5Wl81YrXIh+3kOQNyfeozdXRPdTQIkThWEZAdh/1QTY5EbD9YB0Y0SFl1QBpOEUYkBPQ0WMm1xTVCgM4YnBkGb9u/0uC6jLhojMMI2gxKxI4j9UoaaCO2HfTLfjCinIwIOKrJC2ng+WRmV6eEgE59XFEblHfWnugQ6DqwCOYgeEb8XHLmSUYcLm+U4kNQTfsc1bTdZURNQBq7OCMSAjrB8gGcd9adkHuv7C9p3uQONzJiSJ809fnaWb0Ur+i6HgEjviIjqJrwISMOQCJO1ASFxykFtA+dLREJBX0zRt16+OqusdSN3GTtI9NdRlzWxAiqHkrEV4coDScl4kCpwwiqrs5gRMJAp7Ptr7fkzdXlnQK6jpmUuIK+aerzjfG9VRN6RXRvt0MiNkMayAxKBxlBFekywrURVJ2JpsSBjjvjQ77/rwp5YOZA6ZWF6u02Ui2YRXvQI9OUcUOz4O/7hA+dDEr3GTL8tHT1+eYElxGWHCxrVOqIqsllxEEyoi4owSaJSBQjEgo6b2oXItGPv6ySKybltBmzrHRTRgCIW5/ardTBqEEZws+4giwZOzRTRg7IkP5wL6lCkkEM8Hh9fi6f6DDCj8iZo9+RCETWYAYN90FISWWtJXRvGcSpOAI6Kh6JMPJnr38LtV9XCSt0E0AM82dNzZdn7x4ed29MFcx5fJd8AqZRaphS4P/cHl6lr88AI84a1sSIgRlyGgIuPnSqiM9GV5UGevM+RyJcRlTVtcIIE+PbDmzLrKufmHDQLSQb83p65ONfj1E+d7yAlFQG1IhnhEsJIDGNQBEPYMNlRB4YMRT6mnHBuIJMSESWnE5G9PaqDGe8121ve6pGMmIbYhSqJTKj+FC9shvVfqgm4KEkwusTjxHcluVPAui8eY6IBbcPk9lIgLWHqv2WzF24R175pEwyAbxuLIczgrqajCjomw5GQCKgms6EaiqCako1I2pw/4yiGSwqGwGvrvhIQI6W1W3zVPsTP9IJcn2jJV+Ht/D6/SO1gG3YVQs9nS49M6MbW7p7//7Cfnnm/WNCndsWnUkpozRQ31IiyIj8ng4jRkMixg/LBCOypLB/uvRFQi6FmkmofpB53bNkU81ZCTWk7qhmWmDNV9XK8FDkw6myNiB3PH1YnoI09I7i5VCX/27OUKXP579xWHkzrYFEMU5TjU7KBrOYzOesxv2QERlppmLEMKim0UOomhwb4TLi5Jnhd92x7z3hmcE58BTu8FO7J544KhkF0g386dX9Iy5wwRk9Zd6f98u1D++QxfeOUAYxohF2sJ8H4X7m9fDIgy8dVCOY0WQ8xBks4Mze1GnAXUqR72c+57Pt1WofJalPL68M65cuY5ptRCa8mQxIROIgYgxA8mSNv/16zCSMSnQtI7unSN14cb4Ku9XVmv4QuEr4vwveOyb/RKLskrG91IgObRO6PWVkDxXgrNxUqRJcBLK9xDO5GIv3QBdUuaHYWQOjR4O4DhH1uxsqlD1Z+kmpLENqYyPUISNbgkYpdg18vPeAnFDlF/vqFySOjWF34IN6oCXfsLtGzgVo4fStybny6NtHZO2OGvnub4vlT/eMgM7NCm/W/H3WRfmSA0N5x4LdSPMGlSvZfLCDG2QEmcC53VCJ4MQLwf5kK5aGolEmRKavKxFQTXRfx8FYD4N/TyPeVkraSOeD0J3KyfLCqDpJqdCbooH7eGu1mk8liO/CRTx7eJbyPkLbhW7TE+Fs1EdfVCKtG0xa1Mpr8v5NVyIwgCgRjvQG1dQjJXTF+hNKIuhlrYB0fL67Vo6CUXQTacTJpFAKBqVy0z7/gqSBzotRJxPQG6BiqDdDicfq4aFQfGncqG64TcOrM77uuUxqXQp1xKiXWcVkpQvc64X+1zICnKjCve/GPDGdBz4D1dJfwAgOJOb/jyH2AAvBNKuy5EjjgoQHR6E3yW26fq/8rKg5vA49fhj5jqn/sVUxhqLt6sxHbhki35sW28ffe7xebvnv3bIGxpC+fFciekkW/gSwBFelC8Ct7Kx0yc+2vyrq0zgh6XfLi76xpkyLyQAktqZh1DYEII8gjtpGyOY9i/bJH5bFfscBgyAyczqSVlRjXYkoxbQRVDE0upRkDqhD5Y3Wxi0NWFWXZKK//dEXVcpF011qxnm5CI8puA7xZvn1wSUH5BdLD6oR4x4L/0+jRpfzuql5qsaGOrerEp/JVYVJB50gMn+98vMKLR4XYy50BCJERpIu4RTlnTz85mH50bP7xI8INxoxqn3mzuFyx7/1k3qkHyjaXZ2SDjoBIJdfX3NCCwjz7tPP7q1m+kPB4jm0/os+OC63Prkb6dTo7yigND2C6PX+7wxU03Ih/AvtstO3OXd74ABNagqIAcVqGDzWuOhoxrm5Su/pBil14mv/KJcbH9sZVUWxT6WSEL3+5nuD8c3Jv+iu1Vn7mI+aMDw77aNFRU44kOwbobpguQTdKR1NKspWkxVumBzehsB/iGiUaQNOksSiuy4/TZ68bZhyUaP1F+v8ZByjoZ8Fu/PKzwp9PTP6pgZ0PgiNyNvIxeiAoHr41uQcVToR7aHpFq7fheh1frHyfaO14/7rEb0+P3eE9M72KJc1VttkHqN9YZr7tun95KnbhkpOthfPUJ4a9cIHY1qAgcK/ELXp6MopOSrjGMsQZiDA4kzNTIx4zi7Fom9i2m3pT4tkENxSTkanmmhX6AqzovnR7w9FROvEIbyPlOh0XggaRvnTb6L8TkejBmXKlJHZrY5MRraMRG94dGdUdeX2z1KQV+eNFE7zcc4zVeTk82351U1D5D+vGxSRt08Z6HxgqpH3EBozoxdO1Ps0qIzkWiNKDb2ZHzyxW174W0nM5pzY/uvPi+QcJN0o6skmqk/maR7/YYHcc8Vp2sulFHTqdaqHT7c5eezwO6LryMlmzgC1RuyLKYZ7Fu2V
1766x9sSvd5XKNMxm5XM6JUuIeOGZ+8eETONkVLQCSSDIFb46oj1igyW3LSArk3oProBzI2fjF5Dj7bc7tvLJ4t/1BS9wptoXZ5ant/aNw6AfjleWfLjQqF9ikUpB50qhu4fc9U6mnFenvK5dcd0+6iWqG6c6HWvmp/VteM+Fb3ekfjolREzC5heva9ILm4qctXdgw+5GFLKQWdagEU8qwC8jliZywcITQvo2oXuC41ef9ha9IoHf+SWofLzaxITvdJOcPLltXlFmA/Aiv8Y9MHnlf4nH14bSDnovCeC9AZqHnWUA99alxbQtQ3fF0/0+tC1jF6HqC7obbSHaB+oDukhcYIlFj31fqnM/v3O4KaqCqtTQGda4B9IC+yKkhb4NtMCcA3bA4WKXjGz1LbotZ88cWuBpON+dEFbLBAJOHX3Sz8plIEo+YtGfIZf//UQykkOqGnowYMHp1698Oaoh7nkcfl6feZxCtICY4ZkxA2E++BMlLFkm3OvDMhiEWe1nsf8bFujV4JYB8A5yfInRL0s+YtGarnn8/sV6PS2zKYyn04Z6bxJJy1QrgWWAdAVraQFoj2ou58TB8WH69scvb78E0avaTENMUMIJq7mwv9+8raCmFUBrPK68+k98uR7RyUd90KV6lKngU6PgykB1v/p6Kopuarcug2xku50tY8zN270ujxKss09+YIzGL0WoSAoUxtEudVjD84cJL+ZPaR5QsI9P/Q/C5xYCPvS/5RKFgEPPYjtTgOdN8LREC0twDK4yYWtpwXCnifiqxu9fv+JXfLi31uPXumFsGQkNHqloeVInQ+w779GvXAu4jruDnpmsx7ZKcs3nIgqCZ0GOm+SPvsK3JwuSmSJHA1qsCNDvQkJN3qdu7AN0SuqvJCCFa7c4H1RL9OoL7hjmNyO2alYxBLqmfN3IOKuUiOcbWkDLDCNwVPz+xOSVeEV6+bcY6zUYmn0+SizY0F+OLHIk6UM/qb1o+HH4/nOGham3eArKwAuHtOrhZ4N7Ss7w6Nsyh6UVVA9PYew/upzckObRGzTcDMJxwXIzL0Q5AA+XFiWhxqfsQXZMu3MHhWXFHj+GN30RnSbnB0cSfTZv960OCv0KqxxoR/8+uoyNbMUeqw92/SaKF2MXjmpMv/moWrGXtcXo9enMbqpLmLV4fDc5Sg6cqcUaYwL+qE4VdVEOuXaHFDMKUFo0579sNzT6aC7aQGOeBZxhtOM83OjlnCEt23Ldw54ejYLMffKQih6IdHWR9Hnbw1wLiT+++YqFLoOUhVqnGQ/DRIa6q2491UDdUWKfEq3RYr+My2wv7RePmRAc2FexFWnIS1QAD17EMWdFNVEEHtxotcyrKgLyMK7hketHG7tekWos59/sxPZttbWPd6phtS9CVqbaGkBBh80aizBSzQR+FXQ8df+bgfK4mLPvUa7dnvWPHUJ0NPgHdDiR3twTm6kwedOPOwo8+DcKyqHv8PoFSvoUkFdAnQaOOr0d2GQdHQOpvFYrB9vfkTXl26fil6xOIvuXmtzr7rz27rPrbnsEqDzppFzkrf+iWoBTcaPoHBdKmdmkkWMXlmLfj3cvk9bmfSO5x6YNuDrtT74vFp+/86RhpWfHg52uiF1H8AH1DeixGIz0gKsUw+nq87JkceXH1WjXecZhLdvz3d6UiVNr8K6sOkdNPH0Q4BRJKqmJJne4Mo6Lv51Vl6jODbQ2JhvNXYd0AkklzK+vbZcC/oYrHyYWJiFUVitfO14wIinLdO8g/tEBmrhfbC6gKunnYW8dbJlP94xAPeR+yo0b93web0ImiDOSDV5YZ26zCvkONKWr6uQ+64eEFFzTtfy24gK6ROzXTKIGQdmBHXxAq/H1Rer8L4yBTBG8CHU17MqgbaGdsl9rQnzPfxEI6TA7MSsT492hTj2M0fCBa+ri/XVApdPzFEvZNOo/TiuEr0pLUY2vBkuzdERl1Y+gBJuvumDo5q5GQ4Aup60Owz/CX4Msr3Z9bZpW57PDDe7HqN1qg65aQHd9bgs/UKkYNtaLaDrI9Y+JqZyUfrGFEA48VhpVaP0RF6GAKtJidgAt+jC4LsQxa7Y8/y0euSBrA34obsWDTrzC0cOly4yJ60jLiKI41l1XUTdRwl
1766icoqjPZyqMaqZNmhlJIefdvI7QbfNYiTdbNMTSNuCtzOUqrdSnmzSaVvU3fvwNowPN+urBS4d1wtvxEhXa3kSfZMczXyPgM474gt4KvB+ML5Ftb1kiPUZzzWPvTzuKK7yqfvzju3tMLHnOZlHXZ/Ut1wimYyiUI50ZgN1pF5ji9HeLsjBRfzsTq0R9Kxi30qO8GuCLzjpdt3lUr+P1QKMDLmCTkcqLRDDO9Cd09Z9fEWhjo6jOIr5H50U6NqH7jM8aYDXXnX8pQlQL02g9/L1WQZObFQHQ1t30jYl+DheosDl4jriAl6++YhGN5FEQJkP1xEnM9qXhsAotwKWYdiPuf2qkb7n+eF+6PmH8LvJSPi2S4Dc/hL2n7r9LdQ86gqB6KJ1tFpAd6N0+aKpF/rk7Zk5xA8G4rzAKyWLJ3/kXrPZTJf8efJysRueMXyxK5XcE5P9n17MBqQFGIjoiNUCPTJQkJSgwa4CI2Q7+WJmHTEvE7dqwS/x2kH/Pgn65oX22Qw6d5p1mfPwc46r+MuxnU18QL5F4x0kwXQ0Fq+QmjAC1QIJUjHkXTaYyFdh6ehweUN8oKu3uliVhhW8uWzJ+AOhfbYA/firZ1Y3NFqzwJ0PDS+TTp2rahhKc/4xtBzCvXlOHnCymO/2SgTRXeQLf3RTdzx2HKnn0EXGMa9Jwyn2CSMYuKHkxSl/C2/bAnQerHp5cgl+6niGHax7Tsitpl8KDz8xFd8Z9fGF93x5so4un9Rb5Uno6nWU2AdfH5KVHjnSObdZjmBNBZWxLoQGSkvYwS3A8IqSF6GyNRQBOtuULTmvsnTxxB9YVuB6VG1sxW9O4zc1wb24lZrminHsopzRH482lTccc6eszEpEWoDLbmhEdbEPk1p8U5NTxqF5AAxORyUbVWI1PNbQEJhW9uI5n2laql36zE5T6/IXJi7Nu3H1CsO0r4OmmY2M5CT8oGmmw3IMjURZsWh3h/3pGbas3OKXE5hJy4lMs8s1WESwbAMOejwdUoaIVaR/nt6JKK1GoVAQDEF61lG4+Ks2GPRgQbId3InZl7cxQBeWLJ70ZYzHUYdigs4WHPX4txA9L8qfs34UfM7J2B6NFVmDxLB6i92q0KkLtfcPhX0vSqq3H6geC/98RHg/VwL0MW8e/hjvVy/Xim34CVG+21h+ePawjAk4HDG1byFN4q+r/dQH74aaDGOtFvnw4wC+2BJzo8db/XnJc1Njr7EMua7DuJAdXXXTrq8fI2lpUyPvz8LSjjXLjCEXHIw8Ft8eu65sqmTkjok4K+AvNnyZH0Xsb+eO/wWrg46Do/7gYAAAAABJRU5ErkJggg==",this._readyState=(0,s.My)()?o.Ok.Loading:o.Ok.NotFound,this._state=o.nL.Loading,this._supportNewTronProtocol=!1,this._tronLinkMessageHandler=e=>{var t,r,n,s,i;const a=null===(t=e.data)||void 0===t?void 0:t.message;if(a)if("accountsChanged"===a.action)setTimeout((()=>{var e;const t=this.address||"";if(null===(e=this._wallet)||void 0===e?void 0:e.ready){const e=a.data.address;this.setAddress(e),this.setState(o.nL.Connected)}else this.setAddress(null),this.setState(o.nL.Disconnect);this.emit("accountsChanged",this.address||"",t),!t&&this.address?this.emit("connect",this.address):t&&!this.address&&this.emit("disconnect")}),200);else if("setNode"===a.action)this.emit("chainChanged",{chainId:(null===(n=null===(r=a.data)||void 0===r?void 0:r.node)||void 0===n?void 0:n.chainId)||""});else if("connect"===a.action){const e=(null===(i=null===(s=this._wallet.tronWeb)||void 0===s?void 0:s.defaultAddress)||void 0===i?void 0:i.base58)||"";this.setAddress(e),this.setState(o.nL.Connected),this.emit("connect",e)}else"disconnect"===a.action&&(this.setAddress(null),this.setState(o.nL.Disconnect),this.emit("disconnect"))},this._onChainChanged=e=>{this.emit("chainChanged",e)},this._onAccountsChanged=()=>{var e,t,r;const n=this.address||"",s=(null===(e=this._wallet)||void 0===e?void 0:e.tronWeb)&&(null===(r=null===(t=this._wallet)||void 0===t?void 0:t.tronWeb.defaultAddress)||void 0===r?void 0:r.base58)||"";if(s){const e=s;this.setAddress(e),this.setState(o.nL.Connected)}else this.setAddress(null),this.setState(o.nL.Disconnect);this.emit("accountsChanged",this.address||"",n),!n&&this.address?this.emit("connect",this.address):n&&!this.address&&this.emit("disconnect")},this._checkPromise=null,this._updateWallet=()=>{var e,t,r,n,i,a,c,l,u;let d=this.state,h=this.address;if((0,s.yO)())window.tronLink?this._wallet=window.tronLink:this._wallet={ready:!!(null===(e=window.tronWeb)||void 0===e?void 0:e.defaultAddress),tronWeb:window.tronWeb,request:()=>Promise.resolve(!0)},h=(null===(r=null===(t=this._wallet.tronWeb)||void 0===t?void 0:t.defaultAddress)||void 0===r?void 0:r.base58)||null,d=h?o.nL.Connected:o.nL.Disconnect;else if(window.tron&&window.tron.isTronLink){this._supportNewTronProtocol=!0,this._wallet=window.tron,this._listenTronEvent();try{h=(null===(n=this._wallet)||void 0===n?void 0:n.tronWeb)&&(null===(a=null===(i=this._wallet.tronWeb)||void 0===i?void 0:i.defaultAddress)||void 0===a?void 0:a.base58)||null,d=h?o.nL.Connected:o.nL.Disconnect}catch(e){return console.error("Unknow error: "+e," Please install TronLink extension wallet."),h=null,d=o.nL.Disconnect,this._readyState=o.Ok.NotFound,void this.emit("readyStateChanged",this.readyState)}}else window.tronLink?(this._wallet=window.tronLink,this._listenTronLinkEvent(),h=(null===(l=null===(c=this._wallet.tronWeb)||void 0===c?void 0:c.defaultAddress)||void 0===l?void 0:l.base58)||null,d=this._wallet.ready?o.nL.Connected:o.nL.Disconnect):window.tronWeb?(this._wallet={ready:window.tronWeb.ready,tronWeb:window.tronWeb,request:()=>Promise.resolve(!0)},h=(null===(u=this._wallet.tronWeb.defaultAddress)||void 0===u?void 0:u.base58)||null,d=this._wallet.ready?o.nL.Connected:o.nL.Disconnect):(this._wallet=null,h=null,d=o.nL.NotFound);(0,s.yO)()&&d===o.nL.Disconnect&&this.checkForWalletReadyForApp(),this.setAddress(h),this.setState(d)},this.checkReadyInterval=null;const{checkTimeout:t=3e4,dappIcon:r="",dappName:n="",openUrlWhenWalletNotFound:i=!0,openTronLinkAppOnMobile:a=!0}=e;if("number"!=typeof t)throw new Error("[TronLinkAdapter] config.checkTimeout should be a number");if(this.config={checkTimeout:t,openTronLinkAppOnMobile:a,openUrlWhenWalletNotFound:i,dappIcon:r,dappName:n},this._connecting=!1,this._wallet=null,this._address=null,!(0,s.My)())return this._readyState=o.Ok.NotFound,void this.setState(o.nL.NotFound);c()||(0,s.yO)()&&(window.tronLink||window.tronWeb)?(this._readyState=o.Ok.Found,this._updateWallet()):this._checkWallet().then((()=>
1766{this.connected&&this.emit("connect",this.address||"")}))}get address(){return this._address}get state(){return this._state}get readyState(){return this._readyState}get connecting(){return this._connecting}network(){return d(this,void 0,void 0,(function*(){var e;try{if(yield this._checkWallet(),this.state!==o.nL.Connected)throw new i.PQ;const t=(null===(e=this._wallet)||void 0===e?void 0:e.tronWeb)||window.tronWeb;if(!t)throw new i.PQ;try{return yield p(t)}catch(e){throw new i.W0(null==e?void 0:e.message,e)}}catch(e){throw this.emit("error",e),e}}))}connect(){return d(this,void 0,void 0,(function*(){var e,t;try{if(this.checkIfOpenTronLink(),this.connected||this.connecting)return;if(yield this._checkWallet(),this.state===o.nL.NotFound)throw!1!==this.config.openUrlWhenWalletNotFound&&(0,s.My)()&&window.open(this.url,"_blank"),new i.hv;if(!this._wallet)return;if(this._connecting=!0,this._supportNewTronProtocol){const e=this._wallet;try{const t=(yield e.request({method:"eth_requestAccounts"}))[0];this.setAddress(t),this.setState(o.nL.Connected),this._listenTronEvent(),this._wallet.tronWeb||(yield function(e){return a(this,void 0,void 0,(function*(){return new Promise(((t,r)=>{const n=setInterval((()=>{e.tronWeb&&(clearInterval(n),clearTimeout(o),t())}),50),o=setTimeout((()=>{clearInterval(n),r("`window.tron.tronweb` is not ready.")}),2e3)}))}))}(this._wallet))}catch(e){let t=(null==e?void 0:e.message)||e||"Connect TronLink wallet failed.";throw-32002===e.code&&(t="The same DApp has already initiated a request to connect to TronLink wallet, and the pop-up window has not been closed."),4001===e.code&&(t="The user rejected connection."),new i.Y6(t,e)}}else if(window.tronLink){const t=this._wallet;try{const e=yield t.request({method:"tron_requestAccounts"});if(!e)throw new i.Y6("TronLink wallet is locked or no wallet account is avaliable.");if(4e3===e.code)throw new i.Y6("The same DApp has already initiated a request to connect to TronLink wallet, and the pop-up window has not been closed.");if(4001===e.code)throw new i.Y6("The user rejected connection.")}catch(e){throw new i.Y6(null==e?void 0:e.message,e)}const r=(null===(e=t.tronWeb.defaultAddress)||void 0===e?void 0:e.base58)||"";this.setAddress(r),this.setState(o.nL.Connected),this._listenTronLinkEvent()}else{if(!window.tronWeb)throw new i.Y6("Cannot connect wallet.");{const e=(null===(t=this._wallet.tronWeb.defaultAddress)||void 0===t?void 0:t.base58)||"";this.setAddress(e),this.setState(o.nL.Connected)}}this.connected&&this.emit("connect",this.address||"")}catch(e){throw this.emit("error",e),e}finally{this._connecting=!1}}))}disconnect(){return d(this,void 0,void 0,(function*(){this._supportNewTronProtocol?this._stopListenTronEvent():this._stopListenTronLinkEvent(),this.state===o.nL.Connected&&(this.setAddress(null),this.setState(o.nL.Disconnect),this.emit("disconnect"))}))}signTransaction(e,t){return d(this,void 0,void 0,(function*(){try{const r=yield this.checkAndGetWallet();try{return yield r.tronWeb.trx.sign(e,t)}catch(e){throw e instanceof Error?new i.z4(e.message,e):new i.z4(e,new Error(e))}}catch(e){throw this.emit("error",e),e}}))}multiSign(e,t,r){return d(this,void 0,void 0,(function*(){try{const n=yield this.checkAndGetWallet();try{return yield n.tronWeb.trx.multiSign(e,t,r)}catch(e){throw e instanceof Error?new i.z4(e.message,e):new i.z4(e,new Error(e))}}catch(e){throw this.emit("error",e),e}}))}signMessage(e,t){return d(this,void 0,void 0,(function*(){try{const r=yield this.checkAndGetWallet();try{return yield r.tronWeb.trx.signMessageV2(e,t)}catch(e){throw e instanceof Error?new i.K3(e.message,e):new i.K3(e,new Error(e))}}catch(e){throw this.emit("error",e),e}}))}switchChain(e){return d(this,void 0,void 0,(function*(){try{if(yield this._checkWallet(),this.state===o.nL.NotFound)throw!1!==this.config.openUrlWhenWalletNotFound&&(0,s.My)()&&window.open(this.url,"_blank"),new i.hv;if(!this._supportNewTronProtocol)throw new i.Pj("Current version of TronLink doesn't support switch chain operation.");const t=this._wallet;try{yield t.request({method:"wallet_switchEthereumChain",params:[{chainId:e}]})}catch(e){throw new i.Pj((null==e?void 0:e.message)||e,e instanceof Error?e:new Error(e))}}
1766catch(e){throw this.emit("error",e),e}}))}checkAndGetWallet(){return d(this,void 0,void 0,(function*(){if(this.checkIfOpenTronLink(),yield this._checkWallet(),this.state!==o.nL.Connected)throw new i.PQ;const e=this._wallet;if(!e||!e.tronWeb)throw new i.PQ;return e}))}_listenTronLinkEvent(){this._stopListenTronLinkEvent(),window.addEventListener("message",this._tronLinkMessageHandler)}_stopListenTronLinkEvent(){window.removeEventListener("message",this._tronLinkMessageHandler)}checkIfOpenTronLink(){const{dappName:e="",dappIcon:t=""}=this.config;if(!1!==this.config.openTronLinkAppOnMobile&&u({dappIcon:t,dappName:e}))throw new i.hv}_listenTronEvent(){var e,t;this._stopListenTronEvent(),this._stopListenTronLinkEvent();const r=this._wallet;null===(e=r.on)||void 0===e||e.call(r,"chainChanged",this._onChainChanged),null===(t=r.on)||void 0===t||t.call(r,"accountsChanged",this._onAccountsChanged)}_stopListenTronEvent(){var e,t;const r=this._wallet;null===(e=r.removeListener)||void 0===e||e.call(r,"chainChanged",this._onChainChanged),null===(t=r.removeListener)||void 0===t||t.call(r,"accountsChanged",this._onAccountsChanged)}_checkWallet(){if(this.readyState===o.Ok.Found)return Promise.resolve(!0);if(this._checkPromise)return this._checkPromise;const e=Math.floor(20),t=Math.floor(this.config.checkTimeout/100);let r,n=0;return this._checkPromise=new Promise((i=>{const a=()=>{n++;const a=n<e&&!(0,s.yO)()?c():l();(a||n>t)&&(r&&clearInterval(r),this._readyState=a?o.Ok.Found:o.Ok.NotFound,this._updateWallet(),this.emit("readyStateChanged",this.readyState),i(a))};r=setInterval(a,100),a()})),this._checkPromise}checkForWalletReadyForApp(){if(this.checkReadyInterval)return;let e=0;const t=Math.floor(this.config.checkTimeout/200);this.checkReadyInterval=setInterval((()=>{var r,n;(window.tronLink?null===(r=window.tronLink.tronWeb)||void 0===r?void 0:r.defaultAddress:null===(n=window.tronWeb)||void 0===n?void 0:n.defaultAddress)?(this.checkReadyInterval&&clearInterval(this.checkReadyInterval),this.checkReadyInterval=null,this._updateWallet(),this.emit("connect",this.address||"")):e>t?(this.checkReadyInterval&&clearInterval(this.checkReadyInterval),this.checkReadyInterval=null):e++}),200)}setAddress(e){this._address=e}setState(e){e!==this.state&&(this._state=e,this.emit("stateChanged",e))}}},"./node_modules/@tronweb3/tronwallet-adapter-trust/lib/esm/adapter.js"(e,t,r){"use strict";r.d(t,{K:()=>u});var n=r("./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/adapter.js"),o=r("./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/utils.js"),s=r("./node_modules/@tronweb3/tronwallet-abstract-adapter/lib/esm/errors.js"),i=r("./node_modules/@tronweb3/tronwallet-adapter-tronlink/lib/esm/adapter.js");function a(){return"undefined"!=typeof window&&!(!window.trustwallet||!window.trustwallet.tronLink)}function c(){return!("undefined"!=typeof window&&void 0!==window.navigator&&/Trust/i.test(window.navigator.userAgent)||!(0,o.yO)())&&(window.location.href="https://link.trustwallet.com/open_url?url="+encodeURIComponent(window.location.href),!0)}var l=function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))};class u extends n.Y3{constructor(e={}){super(),this.name="Trust",this.url="https://trustwallet.com",this.icon="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTgiIGhlaWdodD0iNjUiIHZpZXdCb3g9IjAgMCA1OCA2NSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTAgOS4zODk0OUwyOC44OTA3IDBWNjUuMDA0MkM4LjI1NDUgNTYuMzM2OSAwIDM5LjcyNDggMCAzMC4zMzUzVjkuMzg5NDlaIiBmaWxsPSIjMDUwMEZGIi8+CjxwYXRoIGQ9Ik01Ny43ODIyIDkuMzg5NDlMMjguODkxNSAwVjY1LjAwNDJDNDkuNTI3NyA1Ni4zMzY5IDU3Ljc4MjIgMzkuNzI0OCA1Ny43ODIyIDMwLjMzNTNWOS4zODk0OVoiIGZpbGw9InVybCgjcGFpbnQwX2xpbmVhcl8yMjAxXzY5NDIpIi8+CjxkZWZzPgo8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50MF9saW5lYXJfMjIwMV82OTQyIiB4MT0iNTEuMzYxNSIgeTE9Ii00LjE1MjkzIiB4Mj0iMjkuNTM4NCIgeTI9IjY0LjUxNDciIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHN0b3Agb2Zmc2V0PSIwLjAyMTEyIiBzdG9wLWNvbG9yPSIjMDAwMEZGIi8+CjxzdG9wIG9mZnNldD0iMC4wNzYyNDIzIiBzdG9wLWNvbG9yPSIjMDA5NEZGIi8+CjxzdG9wIG9mZnNldD0iMC4xNjMwODkiIHN0b3AtY29sb3I9IiM0OEZGOTEiLz4KPHN0b3Agb2Zmc2V0PSIwLjQyMDA0OSIgc3RvcC1jb2xvcj0iIzAwOTRGRiIvPgo8c3RvcCBvZmZzZXQ9IjAuNjgyODg2IiBzdG9wLWNvbG9yPSIjMDAzOEZGIi8+CjxzdG9wIG9mZnNldD0iMC45MDI0NjUiIHN0b3AtY29sb3I9IiMwNTAwRkYiLz4KPC9saW5lYXJHcmFkaWVudD4KPC9kZWZzPgo8L3N2Zz4K",this._readyState=(0,o.My)()?n.Ok.Loading:n.Ok.NotFound,this._state=n.nL.Loading,this.messageHandler=e=>{var t,r,o;const s=null===(t=e.data)||void 0===t?void 0:t.message;if(s)if("accountsChanged"===s.action)setTimeout((()=>{var e;const t=this.address||"";if(null===(e=this._wallet)||void 0===e?void 0:e.ready){const e=s.data.address;this.setAddress(e),this.setState(n.nL.Connected)}else this.setAddress(null),this.setState(n.nL.Disconnect);
1766(this.address||"")!==t&&this.emit("accountsChanged",this.address||"",t),!t&&this.address?this.emit("connect",this.address):t&&!this.address&&this.emit("disconnect")}),200);else if("connect"===s.action){const e=this.connected,t=this.address||"",s=(null===(o=null===(r=this._wallet.tronWeb)||void 0===r?void 0:r.defaultAddress)||void 0===o?void 0:o.base58)||"";this.setAddress(s),this.setState(n.nL.Connected),e?s!==t&&this.emit("accountsChanged",this.address||"",t):this.emit("connect",s)}else"disconnect"===s.action&&(this.setAddress(null),this.setState(n.nL.Disconnect),this.emit("disconnect"))},this._checkPromise=null,this._updateWallet=()=>{var e,t;let r=this.state,o=this.address;a()?(this._wallet=window.trustwallet.tronLink,this._listenEvent(),o=(null===(t=null===(e=this._wallet.tronWeb)||void 0===e?void 0:e.defaultAddress)||void 0===t?void 0:t.base58)||null,r=this._wallet.ready?n.nL.Connected:n.nL.Disconnect):(this._wallet=null,o=null,r=n.nL.NotFound),this.setAddress(o),this.setState(r)};const{checkTimeout:t=2e3,openUrlWhenWalletNotFound:r=!0,openAppWithDeeplink:s=!0}=e;if("number"!=typeof t)throw new Error("[TrustAdapter] config.checkTimeout should be a number");if(this.config={checkTimeout:t,openAppWithDeeplink:s,openUrlWhenWalletNotFound:r},this._connecting=!1,this._wallet=null,this._address=null,!(0,o.My)())return this._readyState=n.Ok.NotFound,void this.setState(n.nL.NotFound);a()?(this._readyState=n.Ok.Found,this._updateWallet()):this._checkWallet().then((()=>{this.connected&&this.emit("connect",this.address||"")}))}get address(){return this._address}get state(){return this._state}get readyState(){return this._readyState}get connecting(){return this._connecting}network(){return l(this,void 0,void 0,(function*(){try{if(yield this._checkWallet(),this.state!==n.nL.Connected)throw new s.PQ;const e=this._wallet;if(!e||!e.tronWeb)throw new s.PQ;try{return yield(0,i.NA)(e.tronWeb)}catch(e){throw new s.W0(null==e?void 0:e.message,e)}}catch(e){throw this.emit("error",e),e}}))}connect(){return l(this,void 0,void 0,(function*(){var e;try{if(this.checkIfopenTrustWallet(),this.connected||this.connecting)return;if(yield this._checkWallet(),this.state===n.nL.NotFound)throw!1!==this.config.openUrlWhenWalletNotFound&&(0,o.My)()&&window.open(this.url,"_blank"),new s.hv;if(!this._wallet)return;this._connecting=!0;const t=this._wallet;try{const e=yield t.request({method:"tron_requestAccounts"});if(!e)throw new s.Y6("Request connect error.");if(4e3===e.code)throw new s.Y6("The same DApp has already initiated a request to connect to trustwallet, and the pop-up window has not been closed.");if(4001===e.code)throw new s.Y6("The user rejected connection.")}catch(e){throw new s.Y6(null==e?void 0:e.message,e)}const r=(null===(e=t.tronWeb.defaultAddress)||void 0===e?void 0:e.base58)||"";this.setAddress(r),this.setState(n.nL.Connected),this._listenEvent(),this.connected&&this.emit("connect",this.address||"")}catch(e){throw this.emit("error",e),e}finally{this._connecting=!1}}))}disconnect(){return l(this,void 0,void 0,(function*(){this._stopListenEvent(),this.state===n.nL.Connected&&(this.setAddress(null),this.setState(n.nL.Disconnect),this.emit("disconnect"))}))}signTransaction(e,t){return l(this,void 0,void 0,(function*(){try{const r=yield this.checkAndGetWallet();try{return yield r.tronWeb.trx.sign(e,t)}catch(e){throw e instanceof Error||"object"==typeof e&&e.message?new s.z4(e.message,e):"string"==typeof e?new s.z4(e,new Error(e)):new s.z4("Unknown error",e)}}catch(e){throw this.emit("error",e),e}}))}multiSign(e,t,r){return l(this,void 0,void 0,(function*(){try{const n=yield this.checkAndGetWallet();try{return yield n.tronWeb.trx.multiSign(e,t,r)}catch(e){throw e instanceof Error||"object"==typeof e&&e.message?new s.z4(e.message,e):"string"==typeof e?new s.z4(e,new Error(e)):new s.z4("Unknown error",e)}}catch(e){throw this.emit("error",e),e}}))}signMessage(e,t){return l(this,void 0,void 0,(function*(){try{const r=yield this.checkAndGetWallet();try{return yield r.tronWeb.trx.signMessageV2(e,t)}catch(e){throw e instanceof Error||"object"==typeof e&&e.message?new s.K3(e.message,e):"string"==typeof e?new s.K3(e,new Error(e)):new s.K3("Unknown error",e)}}
1766catch(e){throw this.emit("error",e),e}}))}checkAndGetWallet(){return l(this,void 0,void 0,(function*(){if(this.checkIfopenTrustWallet(),yield this._checkWallet(),this.state!==n.nL.Connected)throw new s.PQ;const e=this._wallet;if(!e||!e.tronWeb)throw new s.PQ;return e}))}_listenEvent(){this._stopListenEvent(),window.addEventListener("message",this.messageHandler)}_stopListenEvent(){window.removeEventListener("message",this.messageHandler)}checkIfopenTrustWallet(){if(!1!==this.config.openAppWithDeeplink&&c())throw new s.hv}_checkWallet(){if(this.readyState===n.Ok.Found)return Promise.resolve(!0);if(this._checkPromise)return this._checkPromise;const e=Math.floor(this.config.checkTimeout/100);let t,r=0;return this._checkPromise=new Promise((o=>{const s=()=>{r++;const s=a();(s||r>e)&&(t&&clearInterval(t),this._readyState=s?n.Ok.Found:n.Ok.NotFound,this._updateWallet(),this.emit("readyStateChanged",this.readyState),o(s))};t=setInterval(s,100),s()})),this._checkPromise}setAddress(e){this._address=e}setState(e){e!==this.state&&(this._state=e,this.emit("stateChanged",e))}}},"./node_modules/tronweb/lib/esm/index.js"(e,t,r){"use strict";r.d(t,{K_:()=>Sl,Wp:()=>Ad});var n={};r.r(n),r.d(n,{base64DecodeFromString:()=>C,base64EncodeToString:()=>k,byte2hexStr:()=>A,byteArray2hexStr:()=>E,bytesToString:()=>T,hextoString:()=>P});var o={};r.r(o),r.d(o,{ADDRESS_PREFIX:()=>I,ADDRESS_PREFIX_BYTE:()=>S,ADDRESS_PREFIX_REGEX:()=>x,ADDRESS_SIZE:()=>_,TRON_BIP39_PATH_INDEX_0:()=>O,TRON_BIP39_PATH_PREFIX:()=>B});var s={};r.r(s),r.d(s,{arrayEquals:()=>W,base64DecodeFromString:()=>C,base64EncodeToString:()=>k,bin2String:()=>M,byte2hexStr:()=>A,byteArray2hexStr:()=>E,bytesToString:()=>T,getStringType:()=>F,hexChar2byte:()=>R,hexStr2byteArray:()=>U,hextoString:()=>P,isHexChar:()=>N,isNumber:()=>L,strToDate:()=>D,stringToBytes:()=>j});var i={};r.r(i),r.d(i,{decode58:()=>H,encode58:()=>q});var a={};r.r(a),r.d(a,{OG:()=>Xt,My:()=>qt,Ph:()=>$t,lX:()=>Gt,Id:()=>Zt,fg:()=>rr,qj:()=>Qt,aT:()=>Kt,lq:()=>Yt,z:()=>Jt,Q5:()=>or});var c={};r.r(c),r.d(c,{AbiCoder:()=>eo,FormatTypes:()=>Ta,Interface:()=>ya,Mnemonic:()=>It,Signature:()=>De,SigningKey:()=>zr,Wordlist:()=>vt,arrayify:()=>Aa,concat:()=>pe,ethersHDNodeWallet:()=>yi,id:()=>gt,isValidMnemonic:()=>Pa,joinSignature:()=>va,keccak256:()=>ft,pbkdf2:()=>ot,recoverAddress:()=>qr,sha256:()=>Xe,sha512:()=>et,splitSignature:()=>wa,toUtf8Bytes:()=>ct,toUtf8String:()=>lt,wordlists:()=>wi});var l={};r.r(l),r.d(l,{ECKeySign:()=>za,SHA256:()=>Va,arrayToBase64String:()=>xa,computeAddress:()=>Wa,decode58Check:()=>Ra,decodeBase58Address:()=>_a,ecRecover:()=>Sa,genPriKey:()=>Ma,getAddressFromPriKey:()=>ja,getAddressFromPriKeyBase64String:()=>La,getBase58CheckAddress:()=>ka,getBase58CheckAddressFromPriKeyBase64String:()=>Ua,getHexStrAddressFromPriKeyBase64String:()=>Da,getPubKeyFromPriKey:()=>Fa,getRowBytesFromTransactionBase64:()=>Oa,isAddressValid:()=>Na,passwordToAddress:()=>qa,pkToAddress:()=>Ha,sha3:()=>Ka,signBytes:()=>Ba,signTransaction:()=>Ia});var u={};r.r(u),r.d(u,{generateAccount:()=>$a,generateAccountWithMnemonic:()=>Ya,generateRandom:()=>Ga});var d={};r.r(d),r.d(d,{hasProperties:()=>lc,hasProperty:()=>cc,isArray:()=>ec,isBigNumber:()=>nc,isBoolean:()=>rc,isFunction:()=>sc,isHex:()=>ic,isInteger:()=>ac,isJson:()=>tc,isNotNullOrUndefined:()=>pc,isObject:()=>Xa,isString:()=>oc,isValidURL:()=>Za,mapEvent:()=>uc,padLeft:()=>hc,parseEvent:()=>dc,sleep:()=>fc});var h={};r.r(h),r.d(h,{fromHex:()=>gc,fromPrivateKey:()=>wc,getCreate2Address:()=>Pc,isAddress:()=>vc,isChecksumAddress:()=>bc,toChecksumAddress:()=>yc,toHex:()=>mc});var p={};r.r(p),r.d(p,{decodeParams:()=>kc,decodeParamsV2ByABI:()=>Bc,encodeParams:()=>_c,encodeParamsV2ByABI:()=>xc});var f={};r.r(f),r.d(f,{TRON_MESSAGE_PREFIX:()=>Oc,hashMessage:()=>Mc,signMessage:()=>Wc,verifyMessage:()=>jc});var g={};r.r(g),r.d(g,{TypedDataEncoder:()=>Yc,signTypedData:()=>Jc,verifyTypedData:()=>Qc});var m={};r.r(m),r.d(m,{txCheck:()=>_u,txCheckWithArgs:()=>Iu,txJsonToPb:()=>Pu,txJsonToPbWithArgs:()=>Eu,txPbToRawDataHex:()=>ku,txPbToTxID:()=>Su});var y={};r.r(y),r.d(y,{deserializeTransaction:()=>vd});var b={};r.r(b),r.d(b,{AccountType:()=>ol,ContractType:()=>rl,Permission_PermissionType:()=>nl,ResourceCode:()=>Td}
vendor: 2,632 bytes, line 1766
1766);const w="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";class v{encode(e){let t,r,n,o,s,i,a,c="",l=0;for(;l<e.length;)t=e.charCodeAt(l++),r=e.charCodeAt(l++),n=e.charCodeAt(l++),o=t>>2,s=(3&t)<<4|r>>4,i=(15&r)<<2|n>>6,a=63&n,isNaN(r)?i=a=64:isNaN(n)&&(a=64),c=c+w.charAt(o)+w.charAt(s)+w.charAt(i)+w.charAt(a);return c}encodeIgnoreUtf8(e){let t,r,n,o,s,i,a,c="",l=0;for(;l<e.length;)t=e[l++],r=e[l++],n=e[l++],o=t>>2,s=(3&t)<<4|r>>4,i=(15&r)<<2|n>>6,a=63&n,isNaN(r)?i=a=64:isNaN(n)&&(a=64),c=c+w.charAt(o)+w.charAt(s)+w.charAt(i)+w.charAt(a);return c}decode(e){let t,r,n,o,s,i,a,c="",l=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");l<e.length;)o=w.indexOf(e.charAt(l++)),s=w.indexOf(e.charAt(l++)),i=w.indexOf(e.charAt(l++)),a=w.indexOf(e.charAt(l++)),t=o<<2|s>>4,r=(15&s)<<4|i>>2,n=(3&i)<<6|a,c+=String.fromCharCode(t),64!=i&&(c+=String.fromCharCode(r)),64!=a&&(c+=String.fromCharCode(n));return this._utf8_decode(c)}decodeToByteArray(e){let t,r,n,o,s,i,a,c="",l=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");l<e.length;)o=w.indexOf(e.charAt(l++)),s=w.indexOf(e.charAt(l++)),i=w.indexOf(e.charAt(l++)),a=w.indexOf(e.charAt(l++)),t=o<<2|s>>4,r=(15&s)<<4|i>>2,n=(3&i)<<6|a,c+=String.fromCharCode(t),64!=i&&(c+=String.fromCharCode(r)),64!=a&&(c+=String.fromCharCode(n));return this._out2ByteArray(c)}_out2ByteArray(e){const t=new Array(e.length);let r=0,n=0;for(;r<e.length;)n=e.charCodeAt(r),t[r]=n,r++;return t}_utf8_encode(e){e=e.replace(/\r\n/g,"\n");let t="";for(let r=0;r<e.length;r++){const n=e.charCodeAt(r);n<128?t+=String.fromCharCode(n):n>127&&n<2048?(t+=String.fromCharCode(n>>6|192),t+=String.fromCharCode(63&n|128)):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128),t+=String.fromCharCode(63&n|128))}return t}_utf8_decode(e){let t="",r=0,n=0,o=0,s=0;for(;r<e.length;)n=e.charCodeAt(r),n<128?(t+=String.fromCharCode(n),r++):n>191&&n<224?(o=e.charCodeAt(r+1),t+=String.fromCharCode((31&n)<<6|63&o),r+=2):(o=e.charCodeAt(r+1),s=e.charCodeAt(r+2),t+=String.fromCharCode((15&n)<<12|(63&o)<<6|63&s),r+=3);return t}}function A(e){if(e<0||e>255)throw new Error("Input must be a byte");const t="0123456789ABCDEF";let r="";return r+=t.charAt(e>>4),r+=t.charAt(15&e),r}function T(e){let t="";for(let r=0;r<e.length;r++){const n=e[r].toString(2),o=n.match(/^1+?(?=0)/);if(o&&8===n.length){const n=o[0].length;let s=e[r].toString(2).slice(7-n);for(let t=1;t<n;t++)s+=e[t+r].toString(2).slice(2);t+=String.fromCharCode(parseInt(s,2)),r+=n-1}else t+=String.fromCharCode(e[r])}return t}function P(e){const t=e.replace(/^0x/,"").split("");let r="";for(let e=0;e<t.length/2;e++){const n=`0x${t[2*e]}
1766${t[2*e+1]}`;r+=String.fromCharCode(parseInt(n))}return r}function E(e){let t="";for(let r=0;r<e.length;r++)t+=A(e[r]);return t}function C(e){return(new v).decodeToByteArray(e)}function k(e){return(new v).encodeIgnoreUtf8(e)}const _=34,I="41",S=65,x=/^(41)/,B="m/44'/195'",O=B+"/0'/0/0";function M(e){return T(e)}function W(e,t,r=!1){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(r){if(e[n]!=t[n])return!1}else if(JSON.stringify(e[n])!=JSON.stringify(t[n]))return!1;return!0}function j(e){const t=[],r=e.length;let n;for(let o=0;o<r;o++)n=e.charCodeAt(o),n>=65536&&n<=1114111?(t.push(n>>18&7|240),t.push(n>>12&63|128),t.push(n>>6&63|128),t.push(63&n|128)):n>=2048&&n<=65535?(t.push(n>>12&15|224),t.push(n>>6&63|128),t.push(63&n|128)):n>=128&&n<=2047?(t.push(n>>6&31|192),t.push(63&n|128)):t.push(255&n);return t}function R(e){let t;if(e>="A"&&e<="F"?t=e.charCodeAt(0)-"A".charCodeAt(0)+10:e>="a"&&e<="f"?t=e.charCodeAt(0)-"a".charCodeAt(0)+10:e>="0"&&e<="9"&&(t=e.charCodeAt(0)-"0".charCodeAt(0)),"number"==typeof t)return t;throw new Error("The passed hex char is not a valid hex char")}function N(e){return e>="A"&&e<="F"||e>="a"&&e<="f"||e>="0"&&e<="9"?1:0}function U(e,t=!1){let r=e.length;t&&r%2&&(e=`0${e}`,r++);const n=[];let o=0,s=0,i=0;for(let t=0;t<r;t++){const r=e.charAt(t);if(!N(r))throw new Error("The passed hex char is not a valid hex string");o<<=4,o+=R(r),s++,0==s%2&&(n[i++]=o,o=0)}return n}function D(e){if(!/^\d{4}-\d{2}-\d{2}( \d{2}-\d{2}-\d{2}|)/.test(e))throw new Error("The passed date string is not valid");const t=e.split(" "),r=t[0].split("-"),n=parseInt(r[0],10),o=parseInt(r[1],10)-1,s=parseInt(r[2],10);if(t.length>1){const e=t[1].split("-"),r=parseInt(e[0],10),i=parseInt(e[1],10),a=parseInt(e[2],10);return new Date(n,o,s,r,i,a)}return new Date(n,o,s)}function L(e){return e>="0"&&e<="9"?1:0}function F(e){if(null==e)return-1;if(0==e.length||""==e)return-1;let t=0;if(40==e.length)for(;t<40;t++){if(!N(e.charAt(t)))break}if(40==t)return 1;for(t=0;t<e.length;t++){if(!L(e.charAt(t)))break}if(t==e.length)return 2;for(t=0;t<e.length;t++){if(e.charAt(t)>" ")return 3}return-1}const z="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",V={};for(let e=0;e<58;e++)V[z.charAt(e)]=e;function q(e){if(0===e.length)return"";let t,r;const n=[0];for(t=0;t<e.length;t++){for(r=0;r<n.length;r++)n[r]<<=8;n[0]+=e[t];let o=0;for(r=0;r<n.length;++r)n[r]+=o,o=n[r]/58|0,n[r]%=58;for(;o;)n.push(o%58),o=o/58|0}for(t=0;0===e[t]&&t<e.length-1;t++)n.push(0);return n.reverse().map((e=>z[e])).join("")}function H(e){if(0===e.length)return[];let t,r;const n=[0];for(t=0;t<e.length;t++){const o=e[t];if(!(o in V))throw new Error("Non-base58 character");for(r=0;r<n.length;r++)n[r]*=58;n[0]+=V[o];let s=0;for(r=0;r<n.length;++r)n[r]+=s,s=n[r]>>8,n[r]&=255;for(;s;)n.push(255&s),s>>=8}for(t=0;"1"===e[t]&&t<e.length-1;t++)n.push(0);return n.reverse()}const K="0x0000000000000000000000000000000000000000000000000000000000000000",$="6.13.5";function G(e,t,r){const n=t.split("|").map((e=>e.trim()));for(let r=0;r<n.length;r++)switch(t){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof e===t)return}const o=new Error(`invalid value for type ${t}`);throw o.code="INVALID_ARGUMENT",o.argument=`value.${r}`,o.value=e,o}async function Y(e){const t=Object.keys(e);return(await Promise.all(t.map((t=>Promise.resolve(e[t]))))).reduce(((e,r,n)=>(e[t[n]]=r,e)),{})}function J(e,t,r){for(let n in t){let o=t[n];const s=r?r[n]:null;s&&G(o,s,n),Object.defineProperty(e,n,{enumerable:!0,value:o,writable:!1})}}function Q(e){if(null==e)return"null";if(Array.isArray(e))return"[ "+e.map(Q).join(", ")+" ]";if(e instanceof Uint8Array){const t="0123456789abcdef";let r="0x";for(let n=0;n<e.length;n++)r+=t[e[n]>>4],r+=t[15&e[n]];return r}if("object"==typeof e&&"function"==typeof e.toJSON)return Q(e.toJSON());switch(typeof e){case"boolean":case"symbol":case"number":return e.toString();case"bigint":return BigInt(e).toString();case"string":return JSON.stringify(e);case"object":{const t=Object.keys(e);return t.sort(),"{ "+t.map((t=>`${Q(t)}: ${Q(e[t])}`)).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Z(e,t){return e&&e.code===t}function X(e,t,r){let n,o=e;{const n=[];if(r){if("message"in r||"code"in r||"name"in r)throw new Error(`value will over
1766write populated values: ${Q(r)}`);for(const e in r){if("shortMessage"===e)continue;const t=r[e];n.push(e+"="+Q(t))}}n.push(`code=${t}`),n.push(`version=${$}`),n.length&&(e+=" ("+n.join(", ")+")")}switch(t){case"INVALID_ARGUMENT":n=new TypeError(e);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":n=new RangeError(e);break;default:n=new Error(e)}return J(n,{code:t}),r&&Object.assign(n,r),null==n.shortMessage&&J(n,{shortMessage:o}),n}function ee(e,t,r,n){if(!e)throw X(t,r,n)}function te(e,t,r,n){ee(e,t,"INVALID_ARGUMENT",{argument:r,value:n})}function re(e,t,r){null==r&&(r=""),r&&(r=": "+r),ee(e>=t,"missing argument"+r,"MISSING_ARGUMENT",{count:e,expectedCount:t}),ee(e<=t,"too many arguments"+r,"UNEXPECTED_ARGUMENT",{count:e,expectedCount:t})}const ne=["NFD","NFC","NFKD","NFKC"].reduce(((e,t)=>{try{if("test"!=="test".normalize(t))throw new Error("bad");if("NFD"===t){const e=String.fromCharCode(233).normalize("NFD");if(e!==String.fromCharCode(101,769))throw new Error("broken")}e.push(t)}catch(e){}return e}),[]);function oe(e){ee(ne.indexOf(e)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:e}})}function se(e,t,r){if(null==r&&(r=""),e!==t){let e=r,t="new";r&&(e+=".",t+=" "+r),ee(!1,`private constructor; use ${e}from* methods`,"UNSUPPORTED_OPERATION",{operation:t})}}function ie(e,t,r){if(e instanceof Uint8Array)return r?new Uint8Array(e):e;if("string"==typeof e&&e.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const t=new Uint8Array((e.length-2)/2);let r=2;for(let n=0;n<t.length;n++)t[n]=parseInt(e.substring(r,r+2),16),r+=2;return t}te(!1,"invalid BytesLike value",t||"value",e)}function ae(e,t){return ie(e,t,!1)}function ce(e,t){return ie(e,t,!0)}function le(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(("number"!=typeof t||e.length===2+2*t)&&(!0!==t||e.length%2==0))}function ue(e){return le(e,!0)||e instanceof Uint8Array}const de="0123456789abcdef";function he(e){const t=ae(e);let r="0x";for(let e=0;e<t.length;e++){const n=t[e];r+=de[(240&n)>>4]+de[15&n]}return r}function pe(e){return"0x"+e.map((e=>he(e).substring(2))).join("")}function fe(e){return le(e,!0)?(e.length-2)/2:ae(e).length}function ge(e,t,r){const n=ae(e);return null!=r&&r>n.length&&ee(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:r}),he(n.slice(t??0,r??n.length))}function me(e,t,r){const n=ae(e);ee(t>=n.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(n),length:t,offset:t+1});const o=new Uint8Array(t);return o.fill(0),r?o.set(n,t-n.length):o.set(n,0),he(o)}function ye(e,t){return me(e,t,!0)}const be=BigInt(0),we=BigInt(1),ve=9007199254740991;function Ae(e,t){let r=Pe(e,"value");const n=BigInt(_e(t,"width")),o=we<<n-we;if(r<be){r=-r,ee(r<=o,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:e});return(~r&(we<<n)-we)+we}return ee(r<o,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:e}),r}function Te(e,t){const r=Ee(e,"value"),n=BigInt(_e(t,"bits"));return r&(we<<n)-we}function Pe(e,t){switch(typeof e){case"bigint":return e;case"number":return te(Number.isInteger(e),"underflow",t||"value",e),te(e>=-ve&&e<=ve,"overflow",t||"value",e),BigInt(e);case"string":try{if(""===e)throw new Error("empty string");return"-"===e[0]&&"-"!==e[1]?-BigInt(e.substring(1)):BigInt(e)}catch(r){te(!1,`invalid BigNumberish string: ${r.message}`,t||"value",e)}}te(!1,"invalid BigNumberish value",t||"value",e)}function Ee(e,t){const r=Pe(e,t);return ee(r>=be,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:e}),r}const Ce="0123456789abcdef";function ke(e){if(e instanceof Uint8Array){let t="0x0";for(const r of e)t+=Ce[r>>4],t+=Ce[15&r];return BigInt(t)}return Pe(e)}function _e(e,t){switch(typeof e){case"bigint":return te(e>=-ve&&e<=ve,"overflow",t||"value",e),Number(e);case"number":return te(Number.isInteger(e),"underflow",t||"value",e),te(e>=-ve&&e<=ve,"overflow",t||"value",e),e;case"string":try{if(""===e)throw new Error("empty string");return _e(BigInt(e),t)}catch(r){te(!1,`invalid numeric string: ${r.message}`,t||"value",e)}}te(!1,"invalid numeric value",t||"value",e)}function Ie(e,t){let r=Ee(e,"value").toString(16);if(null==t)r.length%2&&(r="0"+r);else{const n=_e(t,"width");for(ee(2*n>=r.length,`value exceeds width (${n} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:e});r.length<2*n;)r="0"+r}return"0x"+r}function Se(e){const t=Ee(e,"value");if(t===be)return new Uint8Array([]);let r=t.toString(16);r.length%2&&(r="0"+r);const n=new Uint8Array(r.length/2);for(let e=0;e<n.length;e++){const t=2*e;n[e]=parseInt(r.substring(t,t+2),16)}return n}function xe(e){let t=he(ue(e)?e:Se(e)).substring(2);for(;t.startsWith("0");)t=t.substring(1);return""===t&&(t="0"),"0x"+t}const Be=BigInt(0),Oe=BigInt(1),Me=BigInt(2),We=BigInt(27),je=BigInt(28),Re=BigInt(35),Ne={};function Ue(e){return ye(Se(e),32)}class De{#e;#t;#r;#n;get r(){return this.#e}set r(e){te(32===fe(e),"invalid r","value",e),this.#e=he(e)}get s(){return this.#t}set s(e){te(32===fe(e),"invalid s","value",e);const t=he(e);te(parseInt(t.substring(0,3))<8,"non-canonical s","value",t),this.#t=t}get v(){return this.#r}set v(e){const t=_e(e,"value");
1766te(27===t||28===t,"invalid v","v",e),this.#r=t}get networkV(){return this.#n}get legacyChainId(){const e=this.networkV;return null==e?null:De.getChainId(e)}get yParity(){return 27===this.v?0:1}get yParityAndS(){const e=ae(this.s);return this.yParity&&(e[0]|=128),he(e)}get compactSerialized(){return pe([this.r,this.yParityAndS])}get serialized(){return pe([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(e,t,r,n){se(e,Ne,"Signature"),this.#e=t,this.#t=r,this.#r=n,this.#n=null}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new De(Ne,this.r,this.s,this.v);return this.networkV&&(e.#n=this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:null!=e?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const t=Pe(e,"v");return t==We||t==je?Be:(te(t>=Re,"invalid EIP-155 v","v",e),(t-Re)/Me)}static getChainIdV(e,t){return Pe(e)*Me+BigInt(35+t-27)}static getNormalizedV(e){const t=Pe(e);return t===Be||t===We?27:t===Oe||t===je?28:(te(t>=Re,"invalid v","v",e),t&Oe?27:28)}static from(e){function t(t,r){te(t,r,"signature",e)}if(null==e)return new De(Ne,K,K,27);if("string"==typeof e){const r=ae(e,"signature");if(64===r.length){const e=he(r.slice(0,32)),t=r.slice(32,64),n=128&t[0]?28:27;return t[0]&=127,new De(Ne,e,he(t),n)}if(65===r.length){const e=he(r.slice(0,32)),n=r.slice(32,64);t(!(128&n[0]),"non-canonical s");const o=De.getNormalizedV(r[64]);return new De(Ne,e,he(n),o)}t(!1,"invalid raw signature length")}if(e instanceof De)return e.clone();const r=e.r;t(null!=r,"missing r");const n=Ue(r),o=function(e,r){if(null!=e)return Ue(e);if(null!=r){t(le(r,32),"invalid yParityAndS");const e=ae(r);return e[0]&=127,he(e)}t(!1,"missing s")}(e.s,e.yParityAndS);t(!(128&ae(o)[0]),"non-canonical s");const{networkV:s,v:i}=function(e,r,n){if(null!=e){const t=Pe(e);return{networkV:t>=Re?t:void 0,v:De.getNormalizedV(t)}}if(null!=r)return t(le(r,32),"invalid yParityAndS"),{v:128&ae(r)[0]?28:27};if(null!=n){switch(_e(n,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}t(!1,"invalid yParity")}t(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),a=new De(Ne,n,o,i);return s&&(a.#n=s),t(null==e.yParity||_e(e.yParity,"sig.yParity")===a.yParity,"yParity mismatch"),t(null==e.yParityAndS||e.yParityAndS===a.yParityAndS,"yParityAndS mismatch"),a}
vendor: 3,009 bytes, line 1766
1766}var Le=r("./node_modules/@noble/hashes/esm/hmac.js"),Fe=r("./node_modules/@noble/hashes/esm/pbkdf2.js"),ze=r("./node_modules/@noble/hashes/esm/sha256.js"),Ve=r("./node_modules/@noble/hashes/esm/sha512.js");const qe=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw new Error("unable to locate global object")}(),He=qe.crypto||qe.msCrypto;function Ke(e){switch(e){case"sha256":return ze.s.create();case"sha512":return Ve.Zf.create()}te(!1,"invalid hashing algorithm name","algorithm",e)}const $e=function(e){return Ke("sha256").update(e).digest()},Ge=function(e){return Ke("sha512").update(e).digest()};let Ye=$e,Je=Ge,Qe=!1,Ze=!1;function Xe(e){const t=ae(e,"data");return he(Ye(t))}function et(e){const t=ae(e,"data");return he(Je(t))}Xe._=$e,Xe.lock=function(){Qe=!0},Xe.register=function(e){if(Qe)throw new Error("sha256 is locked");Ye=e},Object.freeze(Xe),et._=Ge,et.lock=function(){Ze=!0},et.register=function(e){if(Ze)throw new Error("sha512 is locked");Je=e},Object.freeze(Xe);let tt=!1;const rt=function(e,t,r,n,o){return function(e,t,r,n,o){const s={sha256:ze.s,sha512:Ve.Zf}[o];return te(null!=s,"invalid pbkdf2 algorithm","algorithm",o),(0,Fe.A)(s,e,t,{c:r,dkLen:n})}(e,t,r,n,o)};let nt=rt;function ot(e,t,r,n,o){const s=ae(e,"password"),i=ae(t,"salt");return he(nt(s,i,r,n,o))}function st(e,t,r,n,o){if("BAD_PREFIX"===e||"UNEXPECTED_CONTINUE"===e){let e=0;for(let n=t+1;n<r.length&&r[n]>>6==2;n++)e++;return e}return"OVERRUN"===e?r.length-t-1:0}ot._=rt,ot.lock=function(){tt=!0},ot.register=function(e){if(tt)throw new Error("pbkdf2 is locked");nt=e},Object.freeze(ot);const it=Object.freeze({error:function(e,t,r,n,o){te(!1,`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:st,replace:function(e,t,r,n,o){return"OVERLONG"===e?(te("number"==typeof o,"invalid bad code point for replacement","badCodepoint",o),n.push(o),0):(n.push(65533),st(e,t,r))}});function at(e,t){null==t&&(t=it.error);const r=ae(e,"bytes"),n=[];let o=0;for(;o<r.length;){const e=r[o++];if(!(e>>7)){n.push(e);continue}let s=null,i=null;if(192==(224&e))s=1,i=127;else if(224==(240&e))s=2,i=2047;else{if(240!=(248&e)){o+=t(128==(192&e)?"UNEXPECTED_CONTINUE":"BAD_PREFIX",o-1,r,n);continue}s=3,i=65535}if(o-1+s>=r.length){o+=t("OVERRUN",o-1,r,n);continue}let a=e&(1<<8-s-1)-1;for(let e=0;e<s;e++){let e=r[o];if(128!=(192&e)){o+=t("MISSING_CONTINUE",o,r,n),a=null;break}a=a<<6|63&e,o++}null!==a&&(a>1114111?o+=t("OUT_OF_RANGE",o-1-s,r,n,a):a>=55296&&a<=57343?o+=t("UTF16_SURROGATE",o-1-s,r,n,a):a<=i?o+=t("OVERLONG",o-1-s,r,n,a):n.push(a))}return n}function ct(e,t){te("string"==typeof e,"invalid string value","str",e),null!=t&&(oe(t),e=e.normalize(t));let r=[];for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<128)r.push(n);else if(n<2048)r.push(n>>6|192),r.push(63&n|128);else if(55296==(64512&n)){t++;const o=e.charCodeAt(t);te(t<e.length&&56320==(64512&o),"invalid surrogate pair","str",e);const s=65536+((1023&n)<<10)+(1023&o);
1766r.push(s>>18|240),r.push(s>>12&63|128),r.push(s>>6&63|128),r.push(63&s|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return new Uint8Array(r)}function lt(e,t){return at(e,t).map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}var ut=r("./node_modules/@noble/hashes/esm/sha3.js");let dt=!1;const ht=function(e){return(0,ut.lY)(e)};let pt=ht;function ft(e){const t=ae(e,"data");return he(pt(t))}function gt(e){return ft(ct(e))}ft._=ht,ft.lock=function(){dt=!0},ft.register=function(e){if(dt)throw new TypeError("keccak256 is locked");pt=e},Object.freeze(ft);const mt=" !#$%&'()*+,-./<=>?@[]^_`{|}~",yt=/^[a-z]*$/i;function bt(e,t){let r=97;return e.reduce(((e,n)=>(n===t?r++:n.match(yt)?e.push(String.fromCharCode(r)+n):(r=97,e.push(n)),e)),[])}function wt(e){return te("0"===e[0],"unsupported auwl data","data",e),function(e,t){for(let r=28;r>=0;r--)e=e.split(mt[r]).join(t.substring(2*r,2*r+2));const r=[],n=e.replace(/(:|([0-9])|([A-Z][a-z]*))/g,((e,t,n,o)=>{if(n)for(let e=parseInt(n);e>=0;e--)r.push(";");else r.push(t.toLowerCase());return""}));if(n)throw new Error(`leftovers: ${JSON.stringify(n)}`);return bt(bt(r,";"),":")}(e.substring(59),e.substring(1,59))}class vt{locale;constructor(e){J(this,{locale:e})}split(e){return e.toLowerCase().split(/\s+/g)}join(e){return e.join(" ")}}class At extends vt{#o;#s;constructor(e,t,r){super(e),this.#o=t,this.#s=r,this.#i=null}get _data(){return this.#o}_decodeWords(){return wt(this.#o)}#i;#a(){if(null==this.#i){const e=this._decodeWords();if(gt(e.join("\n")+"\n")!==this.#s)throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);this.#i=e}return this.#i}getWord(e){const t=this.#a();return te(e>=0&&e<t.length,`invalid word index: ${e}`,"index",e),t[e]}getWordIndex(e){return this.#a().indexOf(e)}}let Tt=null;class Pt extends At{constructor(){super("en","0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN<aNn RRelyRga(R*lSeS-SketTt!3A^AnAutyCau'ComeEfF%eG(Ha=H(dLie=LowLtN^Nef./TrayTt Twe&Y#d3Cyc!DKeNdOlogyRdR`Tt _{AdeAmeAnketA,EakE[IndOodO[omOu'UeUrUsh_rdAtDyIlMbNeNusOkO,Rd R(gRrowSsTtomUn)XY_{etA(AndA[A=EadEezeI{Id+IefIghtIngIskOccoliOk&OnzeOomO` OwnUsh2Bb!DdyD+tFf$oIldLbLkL!tNd!Nk Rd&Rg R,SS(e[SyTt Y Zz:Bba+B(B!CtusGeKe~LmM aMpNN$N)lNdyNn#NoeNvasNy#Pab!P.$Pta(RRb#RdRgoRpetRryRtSeShS(o/!Su$TT$ogT^Teg%yTt!UghtU'Ut]Ve3Il(gL yM|NsusNturyRe$Rta(_irAlkAmp]An+AosApt Ar+A'AtEapE{Ee'EfErryE,I{&IefIldIm}yOi)Oo'R#-U{!UnkUrn0G?Nnam#Rc!Tiz&TyVil_imApArifyAwAyE<ErkEv I{I|IffImbIn-IpO{OgO'O`OudOwnUbUmpU, Ut^_^A,C#utDeFfeeIlInL!@L%LumnMb(eMeMf%tM-Mm#Mp<yNc tNdu@NfirmNg*[N}@Nsid NtrolNv()OkOlPp PyR$ReRnR*@/Tt#U^UntryUp!Ur'Us(V Yo>_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M<dMi'Ni$Nti,NyP?tP&dPos.P`PutyRi=ScribeS tSignSkSpair/royTailTe@VelopVi)Vo>3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-Eg<tEm|Eph<tEvat%I>Se0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-P<dPe@Pi*Pla(Po'P*[T&dTra0EEbrow:Br-CeCultyDeIntI`~L'MeMilyMousNNcyNtasyRmSh]TT$Th TigueUltV%.e3Atu*Bru?yD $EEdElMa!N)/iv$T^V W3B Ct]EldGu*LeLmLt N$NdNeNg NishReRmR,Sc$ShTT}[X_gAmeAshAtAv%EeIghtIpOatO{O%Ow UidUshY_mCusGIlLd~owOdOtR)Re,R+tRkRtu}
1766RumRw?dSsil/ UndX_gi!AmeEqu|EshI&dIn+OgOntO,OwnOz&U.2ElNNnyRna)RyTu*:D+tInLaxy~ yMePRa+Rba+Rd&Rl-Rm|SSpTeTh U+Ze3N $NiusN*Nt!Nu(e/u*2O,0AntFtGg!Ng RaffeRlVe_dAn)A*A[IdeImp'ObeOomOryO=OwUe_tDde[LdOdO'RillaSpelSsipV nWn_bA)A(AntApeA[Av.yEatE&IdIefItOc yOupOwUnt_rdE[IdeIltIt?N3M:B.IrLfMm M, NdPpyRb%RdRshR=,TVeWkZ?d3AdAl`ArtAvyD+hogIght~oLmetLpNRo3Dd&Gh~NtPRe/%y5BbyCkeyLdLeLiday~owMeNeyOdPeRnRr%R'Sp.$/TelUrV 5BGeM<Mb!M%Nd*dNgryNtRd!RryRtSb<d3Brid:1EOn0EaEntifyLe2N%e4LLeg$L}[0A+Ita>M&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryF<tFl-tF%mHa!H .Iti$Je@JuryMa>N Noc|PutQuiryS<eSe@SideSpi*/$lTa@T e,ToVe,V.eVol=3On0L<dOla>Sue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/:Ng?oo3EnEpT^upY3CkDD}yNdNgdomSsTT^&TeTt&Wi4EeIfeO{Ow:BBelB%Dd DyKeMpNgua+PtopR+T T(UghUndryVaWWnWsu.Y Zy3Ad AfArnA=Ctu*FtGG$G&dIsu*M#NdNg`NsOp?dSs#Tt Vel3ArB tyBr?yC&'FeFtGhtKeMbM.NkOnQuid/Tt!VeZ?d5AdAnB, C$CkG-NelyNgOpTt yUdUn+VeY$5CkyGga+Mb N?N^Xury3R-s:Ch(eDG-G}tIdIlInJ%KeMm$NNa+Nda>NgoNs]Nu$P!Rb!R^Rg(R(eRketRria+SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurE<Tob 0Or1FF Fi)T&2L1Ay0DI=Ymp-0It0CeEI#L(eLy1EnEraIn]Po'T]1An+B.Ch?dD D(?yG<I|Ig($Ph<0Tr-h0H 0Tdo%T TputTside0AlEnEr0NN 0Yg&0/ 0O}:CtDd!GeIrLa)LmNdaNelN-N` P RadeR|RkRrotRtySsT^ThTi|TrolTt nU'VeYm|3A)AnutArAs<tL-<NN$tyNcilOp!Pp [email protected]#T2O}OtoRa'Ys-$0AnoCn-Ctu*E)GGe#~LotNkO} Pe/olT^Zza_)A}tA,-A>AyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOg<OtOwUsh0AllArtI!OkeOo`0A{AkeApIffOw0ApCc Ci$CkDaFtL?Ldi LidLut]L=Me#eNgOnRryRtUlUndUpUr)U`0A)A*Ati$AwnEakEci$EedEllEndH eI)Id IkeInIr.L.OilOns%O#OrtOtRayReadR(gY0Ua*UeezeUir*l_b!AdiumAffA+AirsAmpAndArtA>AyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|[email protected])[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NN<tNnisNtRm/Xt_nkAtEmeEnE%yE*EyIngIsOughtReeRi=RowUmbUnd 0CketDeG LtMb MeNyPRedSsueT!5A,BaccoDayDdl EGe` I!tK&MatoM%rowNeNgueNightOlO`PP-Pp!R^RnadoRtoi'SsT$Uri,W?dW WnY_{AdeAff-Ag-A(Ansf ApAshA=lAyEatEeEndI$IbeI{Igg ImIpOphyOub!U{UeUlyUmpetU,U`Y2BeIt]Mb!NaN}lRkeyRnRt!1El=EntyI)InI,O1PeP-$:5Ly5B*lla0Ab!Awa*C!Cov D DoFairFoldHappyIf%mIqueItIv 'KnownLo{TilUsu$Veil1Da>GradeHoldOnP Set1B<Ge0A+EEdEfulE![U$0Il.y:C<tCuumGueLidL!yL=NNishP%Rious/Ult3H-!L=tNd%Ntu*NueRbRifyRs]RyS'lT <3Ab!Br<tCiousCt%yDeoEw~a+Nta+Ol(Rtu$RusSaS.Su$T$Vid5C$I)IdLc<oLumeTeYa+:GeG#ItLk~LnutNtRfa*RmRri%ShSp/eT VeY3Al`Ap#ArA'lA` BDd(gEk&dIrdLcome/T_!AtEatEelEnE*IpIsp 0DeD`FeLd~NNdowNeNgNkNn Nt ReSdomSeShT}[5LfM<Nd OdOlRdRkRldRryR`_pE{E,!I,I>Ong::Rd3Ar~ow9UUngU`:3BraRo9NeO","0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60")}static wordlist(){return null==Tt&&(Tt=new Pt),Tt}}function Et(e){return(1<<e)-1<<8-e&255}function Ct(e,t){oe("NFKD"),null==t&&(t=Pt.wordlist());const r=t.split(e);te(r.length%3==0&&r.length>
vendor: 8,463 bytes, line 1766
1766=12&&r.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const n=new Uint8Array(Math.ceil(11*r.length/8));let o=0;for(let e=0;e<r.length;e++){let s=t.getWordIndex(r[e].normalize("NFKD"));te(s>=0,`invalid mnemonic word at index ${e}`,"mnemonic","[ REDACTED ]");for(let e=0;e<11;e++)s&1<<10-e&&(n[o>>3]|=1<<7-o%8),o++}const s=32*r.length/3,i=Et(r.length/3);return te((ae(Xe(n.slice(0,s/8)))[0]&i)===(n[n.length-1]&i),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),he(n.slice(0,s/8))}function kt(e,t){te(e.length%4==0&&e.length>=16&&e.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),null==t&&(t=Pt.wordlist());const r=[0];let n=11;for(let t=0;t<e.length;t++)n>8?(r[r.length-1]<<=8,r[r.length-1]|=e[t],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[t]>>8-n,r.push(e[t]&((1<<8-n)-1&255)),n+=3);const o=e.length/4,s=parseInt(Xe(e).substring(2,4),16)&Et(o);return r[r.length-1]<<=o,r[r.length-1]|=s>>8-o,t.join(r.map((e=>t.getWord(e))))}const _t={};class It{phrase;password;wordlist;entropy;constructor(e,t,r,n,o){null==n&&(n=""),null==o&&(o=Pt.wordlist()),se(e,_t,"Mnemonic"),J(this,{phrase:r,password:n,wordlist:o,entropy:t})}computeSeed(){const e=ct("mnemonic"+this.password,"NFKD");return ot(ct(this.phrase,"NFKD"),e,2048,64,"sha512")}static fromPhrase(e,t,r){const n=Ct(e,r);return e=kt(ae(n),r),new It(_t,n,e,t,r)}static fromEntropy(e,t,r){const n=ae(e,"entropy"),o=kt(n,r);return new It(_t,he(n),o,t,r)}static entropyToPhrase(e,t){return kt(ae(e,"entropy"),t)}static phraseToEntropy(e,t){return Ct(e,t)}static isValidMnemonic(e,t){try{return Ct(e,t),!0}catch(e){}return!1}}let St=!1;const xt=function(e,t,r){return function(e,t){const r={sha256:ze.s,sha512:Ve.Zf}[e];return te(null!=r,"invalid hmac algorithm","algorithm",e),Le.w.create(r,t)}(e,t).update(r).digest()};let Bt=xt;function Ot(e,t,r){const n=ae(t,"key"),o=ae(r,"data");return he(Bt(e,n,o))}Ot._=xt,Ot.lock=function(){St=!0},Ot.register=function(e){if(St)throw new Error("computeHmac is locked");Bt=e},Object.freeze(Ot);const Mt=BigInt(0),Wt=BigInt(36);function jt(e){const t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let e=0;e<40;e++)r[e]=t[e].charCodeAt(0);const n=ae(ft(r));for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&n[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}const Rt={};for(let e=0;e<10;e++)Rt[String(e)]=String(e);for(let e=0;e<26;e++)Rt[String.fromCharCode(65+e)]=String(10+e);function Nt(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>Rt[e])).join("");for(;t.length>=15;){let e=t.substring(0,15);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}const Ut=function(){const e={};for(let t=0;t<36;t++){e["0123456789abcdefghijklmnopqrstuvwxyz"[t]]=BigInt(t)}return e}();function Dt(e){if(te("string"==typeof e,"invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/)){e.startsWith("0x")||(e="0x"+e);const t=jt(e);return te(!e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||t===e,"bad address checksum","address",e),t}if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){te(e.substring(2,4)===Nt(e),"bad icap checksum","address",e);let t=function(e){e=e.toLowerCase();let t=Mt;for(let r=0;r<e.length;r++)t=t*Wt+Ut[e[r]];return t}(e.substring(4)).toString(16);for(;t.length<40;)t="0"+t;return jt("0x"+t)}te(!1,"invalid address","address",e)}BigInt(0);const Lt=BigInt(1),Ft=BigInt(2),zt=e=>e instanceof Uint8Array,Vt=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function qt(e){if(!zt(e))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=Vt[e[r]];return t}function Ht(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return BigInt(""===e?"0":`0x${e}`)}function Kt(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(t/2);for(let t=0;t<r.length;t++){const n=2*t,o=e.slice(n,n+2),s=Number.parseInt(o,16);if(Number.isNaN(s)||s<0)throw new Error("Invalid byte sequence");r[t]=s}return r}function $t(e){return Ht(qt(e))}function Gt(e){if(!zt(e))throw new Error("Uint8Array expected");return Ht(qt(Uint8Array.from(e).reverse()))}function Yt(e,t){return Kt(e.toString(16).padStart(2*t,"0"))}function Jt(e,t){return Yt(e,t).reverse()}function Qt(e,t,r){let n;if("string"==typeof t)try{n=Kt(t)}catch(r){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${r}`)}else{if(!zt(t))throw new Error(`${e} must be hex string or Uint8Array`);n=Uint8Array.from(t)}const o=n.length;if("number"==typeof r&&o!==r)throw new Error(`${e} expected ${r} bytes, got ${o}`);return n}function Zt(...e){const t=new Uint8Array(e.reduce(((e,t)=>e+t.length),0));let r=0;return e.forEach((e=>{if(!zt(e))throw new Error("Uint8Array expected");t.set(e,r),r+=e.length})),t}const Xt=e=>(Ft<<BigInt(e-1))-Lt,er=e=>new Uint8Array(e),tr=e=>Uint8Array.from(e);function rr(e,t,r){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof r)throw new Error("hmacFn must be a function");let n=er(e),o=er(e),s=0;const i=()=>{n.fill(1),o.fill(0),s=0},a=(...e)=>r(o,n,...e),c=(e=er())=>{o=a(tr([0]),e),n=a(),0!==e.length&&(o=a(tr([1]),e),n=a())},l=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const r=[];for(;e<t;){n=a();const t=n.slice();r.push(t),e+=n.length}return Zt(...r)};return(e,t)=>{let r;for(i(),c(e);!(r=t(l()));)c();return i(),r}}const nr={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function or(e,t,r={}){const n=(t,r,n)=>{const o=nr[r];if("function"!=typeof o)throw new Error(`Invalid validator "${r}", expected function`);const s=e[t];if(!(n&&void 0===s||o(s,e)))throw new Error(`Invalid param ${String(t)}=${s} (${typeof s}), expected ${r}`)};for(const[e,r]of Object.entries(t))n(e,r,!1);for(const[e,t]of Object.entries(r))n(e,t,!0);return e}const sr=BigInt(0),ir=BigInt(1),ar=BigInt(2),cr=BigInt(3),lr=BigInt(4),ur=BigInt(5),dr=BigInt(8);BigInt(9),BigInt(16);function hr(e,t){const r=e%t;return r>=sr?r:t+r}function pr(e,t,r){if(r<=sr||t<sr)throw new Error("Expected power/modulo > 0");if(r===ir)return sr;let n=ir;for(;t>sr;)t&ir&&(n=n*e%r),e=e*e%r,t>>=ir;return n}function fr(e,t,r){let n=e;for(;t-- >sr;)n*=n,n%=r;return n}function gr(e,t){if(e===sr||t<=sr)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=hr(e,t),n=t,o=sr,s=ir,i=ir,a=sr;for(;r!==sr;){const e=n/r,t=n%r,c=o-i*e,l=s-a*e;n=r,r=t,o=i,s=a,i=c,a=l}if(n!==ir)throw new Error("invert: does not exist");return hr(o,t)}function mr(e){if(e%lr===cr){const t=(e+ir)/lr;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}if(e%dr===ur){const t=(e-ur)/dr;return function(e,r){const n=e.mul(r,ar),o=e.pow(n,t),s=e.mul(r,o),i=e.mul(e.mul(s,ar),o),a=e.mul(s,e.sub(i,e.ONE));if(!e.eql(e.sqr(a),r))throw new Error("Cannot find square root");return a}}return function(e){const t=(e-ir)/ar;let r,n,o;for(r=e-ir,n=0;r%ar===sr;r/=ar,n++);for(o=ar;o<e&&pr(o,t,e)!==e-ir;o++);if(1===n){const t=(e+ir)/lr;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}const s=(r+ir)/ar;return function(e,i){if(e.pow(i,t)===e.neg(e.ONE))throw new Error("Cannot find square root");let a=n,c=e.pow(e.mul(e.ONE,o),r),l=e.pow(i,s),u=e.pow(i,r);for(;!e.eql(u,e.ONE);){if(e.eql(u,e.ZERO))return e.ZERO;let t=1;for(let r=e.sqr(u);t<a&&!e.eql(r,e.ONE);t++)r=e.sqr(r);const r=e.pow(c,ir<<BigInt(a-t-1));c=e.sqr(r),l=e.mul(l,r),u=e.mul(u,c),a=t}return l}}(e)}const yr=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function br(e,t){const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function wr(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function vr(e){const t=wr(e);return t+Math.ceil(t/2)}
1766var Ar=r("./node_modules/@noble/hashes/esm/utils.js");const Tr=BigInt(0),Pr=BigInt(1);function Er(e){return or(e.Fp,yr.reduce(((e,t)=>(e[t]="function",e)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"})),or(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...br(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}const{Ph:Cr,aT:kr}=a,_r={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(e){const{Err:t}=_r;if(e.length<2||2!==e[0])throw new t("Invalid signature integer tag");const r=e[1],n=e.subarray(2,r+2);if(!r||n.length!==r)throw new t("Invalid signature integer: wrong length");if(128&n[0])throw new t("Invalid signature integer: negative");if(0===n[0]&&!(128&n[1]))throw new t("Invalid signature integer: unnecessary leading zero");return{d:Cr(n),l:e.subarray(r+2)}},toSig(e){const{Err:t}=_r,r="string"==typeof e?kr(e):e;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||48!=r[0])throw new t("Invalid signature tag");if(r[1]!==n-2)throw new t("Invalid signature: incorrect length");const{d:o,l:s}=_r._parseInt(r.subarray(2)),{d:i,l:a}=_r._parseInt(s);if(a.length)throw new t("Invalid signature: left bytes after parsing");return{r:o,s:i}},hexFromSig(e){const t=e=>8&Number.parseInt(e[0],16)?"00"+e:e,r=e=>{const t=e.toString(16);return 1&t.length?`0${t}`:t},n=t(r(e.s)),o=t(r(e.r)),s=n.length/2,i=o.length/2,a=r(s),c=r(i);return`30${r(i+s+4)}02${c}${o}02${a}${n}`}},Ir=BigInt(0),Sr=BigInt(1),xr=(BigInt(2),BigInt(3));BigInt(4);function Br(e){const t=function(e){const t=Er(e);or(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:n,a:o}=t;if(r){if(!n.eql(o,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}(e),{Fp:r}=t,n=t.toBytes||((e,t,n)=>{const o=t.toAffine();return Zt(Uint8Array.from([4]),r.toBytes(o.x),r.toBytes(o.y))}),o=t.fromBytes||(e=>{const t=e.subarray(1);return{x:r.fromBytes(t.subarray(0,r.BYTES)),y:r.fromBytes(t.subarray(r.BYTES,2*r.BYTES))}});function s(e){const{a:n,b:o}=t,s=r.sqr(e),i=r.mul(s,e);return r.add(r.add(i,r.mul(e,n)),o)}if(!r.eql(r.sqr(t.Gy),s(t.Gx)))throw new Error("bad generator point: equation left != right");function i(e){return"bigint"==typeof e&&Ir<e&&e<t.n}function a(e){if(!i(e))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function c(e){const{allowedPrivateKeyLengths:r,nByteLength:n,wrapPrivateKey:o,n:s}=t;if(r&&"bigint"!=typeof e){if(e instanceof Uint8Array&&(e=qt(e)),"string"!=typeof e||!r.includes(e.length))throw new Error("Invalid key");e=e.padStart(2*n,"0")}let i;try{i="bigint"==typeof e?e:$t(Qt("private key",e,n))}catch(t){throw new Error(`private key must be ${n} bytes, hex or bigint, not ${typeof e}`)}return o&&(i=hr(i,s)),a(i),i}const l=new Map;function u(e){if(!(e instanceof d))throw new Error("ProjectivePoint expected")}class d{constructor(e,t,n){if(this.px=e,this.py=t,this.pz=n,null==e||!r.isValid(e))throw new Error("x required");if(null==t||!r.isValid(t))throw new Error("y required");if(null==n||!r.isValid(n))throw new Error("z required")}static fromAffine(e){const{x:t,y:n}=e||{};if(!e||!r.isValid(t)||!r.isValid(n))throw new Error("invalid affine point");if(e instanceof d)throw new Error("projective point not allowed");const o=e=>r.eql(e,r.ZERO);return o(t)&&o(n)?d.ZERO:new d(t,n,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const t=r.invertBatch(e.map((e=>e.pz)));return e.map(((e,r)=>e.toAffine(t[r]))).map(d.fromAffine)}static fromHex(e){const t=d.fromAffine(o(Qt("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return d.BASE.multiply(c(e))}_setWindowSize(e){this._WINDOW_SIZE=e,l.delete(this)}
vendor: 4,337 bytes, line 1766
1766assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:e,y:n}=this.toAffine();if(!r.isValid(e)||!r.isValid(n))throw new Error("bad point: x or y not FE");const o=r.sqr(n),i=s(e);if(!r.eql(o,i))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:e}=this.toAffine();if(r.isOdd)return!r.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){u(e);const{px:t,py:n,pz:o}=this,{px:s,py:i,pz:a}=e,c=r.eql(r.mul(t,a),r.mul(s,o)),l=r.eql(r.mul(n,a),r.mul(i,o));return c&&l}negate(){return new d(this.px,r.neg(this.py),this.pz)}double(){const{a:e,b:n}=t,o=r.mul(n,xr),{px:s,py:i,pz:a}=this;let c=r.ZERO,l=r.ZERO,u=r.ZERO,h=r.mul(s,s),p=r.mul(i,i),f=r.mul(a,a),g=r.mul(s,i);return g=r.add(g,g),u=r.mul(s,a),u=r.add(u,u),c=r.mul(e,u),l=r.mul(o,f),l=r.add(c,l),c=r.sub(p,l),l=r.add(p,l),l=r.mul(c,l),c=r.mul(g,c),u=r.mul(o,u),f=r.mul(e,f),g=r.sub(h,f),g=r.mul(e,g),g=r.add(g,u),u=r.add(h,h),h=r.add(u,h),h=r.add(h,f),h=r.mul(h,g),l=r.add(l,h),f=r.mul(i,a),f=r.add(f,f),h=r.mul(f,g),c=r.sub(c,h),u=r.mul(f,p),u=r.add(u,u),u=r.add(u,u),new d(c,l,u)}add(e){u(e);const{px:n,py:o,pz:s}=this,{px:i,py:a,pz:c}=e;let l=r.ZERO,h=r.ZERO,p=r.ZERO;const f=t.a,g=r.mul(t.b,xr);let m=r.mul(n,i),y=r.mul(o,a),b=r.mul(s,c),w=r.add(n,o),v=r.add(i,a);w=r.mul(w,v),v=r.add(m,y),w=r.sub(w,v),v=r.add(n,s);let A=r.add(i,c);return v=r.mul(v,A),A=r.add(m,b),v=r.sub(v,A),A=r.add(o,s),l=r.add(a,c),A=r.mul(A,l),l=r.add(y,b),A=r.sub(A,l),p=r.mul(f,v),l=r.mul(g,b),p=r.add(l,p),l=r.sub(y,p),p=r.add(y,p),h=r.mul(l,p),y=r.add(m,m),y=r.add(y,m),b=r.mul(f,b),v=r.mul(g,v),y=r.add(y,b),b=r.sub(m,b),b=r.mul(f,b),v=r.add(v,b),m=r.mul(y,v),h=r.add(h,m),m=r.mul(A,v),l=r.mul(w,l),l=r.sub(l,m),m=r.mul(w,y),p=r.mul(A,p),p=r.add(p,m),new d(l,h,p)}subtract(e){return this.add(e.negate())}is0(){return this.equals(d.ZERO)}wNAF(e){return p.wNAFCached(this,l,e,(e=>{const t=r.invertBatch(e.map((e=>e.pz)));return e.map(((e,r)=>e.toAffine(t[r]))).map(d.fromAffine)}))}multiplyUnsafe(e){const n=d.ZERO;if(e===Ir)return n;if(a(e),e===Sr)return this;const{endo:o}=t;if(!o)return p.unsafeLadder(this,e);let{k1neg:s,k1:i,k2neg:c,k2:l}=o.splitScalar(e),u=n,h=n,f=this;for(;i>Ir||l>Ir;)i&Sr&&(u=u.add(f)),l&Sr&&(h=h.add(f)),f=f.double(),i>>=Sr,l>>=Sr;return s&&(u=u.negate()),c&&(h=h.negate()),h=new d(r.mul(h.px,o.beta),h.py,h.pz),u.add(h)}multiply(e){a(e);let n,o,s=e;const{endo:i}=t;if(i){const{k1neg:e,k1:t,k2neg:a,k2:c}=i.splitScalar(s);let{p:l,f:u}=this.wNAF(t),{p:h,f}=this.wNAF(c);l=p.constTimeNegate(e,l),h=p.constTimeNegate(a,h),h=new d(r.mul(h.px,i.beta),h.py,h.pz),n=l.add(h),o=u.add(f)}else{const{p:e,f:t}=this.wNAF(s);n=e,o=t}return d.normalizeZ([n,o])[0]}multiplyAndAddUnsafe(e,t,r){const n=d.BASE,o=(e,t)=>t!==Ir&&t!==Sr&&e.equals(n)?e.multiply(t):e.multiplyUnsafe(t),s=o(this,t).add(o(e,r));return s.is0()?void 0:s}toAffine(e){const{px:t,py:n,pz:o}=this,s=this.is0();null==e&&(e=s?r.ONE:r.inv(o));const i=r.mul(t,e),a=r.mul(n,e),c=r.mul(o,e);if(s)return{x:r.ZERO,y:r.ZERO};if(!r.eql(c,r.ONE))throw new Error("invZ was invalid");return{x:i,y:a}}isTorsionFree(){const{h:e,isTorsionFree:r}=t;if(e===Sr)return!0;if(r)return r(d,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:r}=t;return e===Sr?this:r?r(d,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return this.assertValidity(),n(d,this,e)}toHex(e=!0){return qt(this.toRawBytes(e))}}d.BASE=new d(t.Gx,t.Gy,r.ONE),d.ZERO=new d(r.ZERO,r.ONE,r.ZERO);const h=t.nBitLength,p=function(e,t){const r=(e,t)=>{const r=t.negate();return e?r:t},n=e=>({windows:Math.ceil(t/e)+1,windowSize:2**(e-1)});return{constTimeNegate:r,unsafeLadder(t,r){let n=e.ZERO,o=t;for(;r>Tr;)r&Pr&&(n=n.add(o)),o=o.double(),r>>=Pr;return n},precomputeWindow(e,t){const{windows:r,windowSize:o}=n(t),s=[];let i=e,a=i;for(let e=0;e<r;e++){a=i,s.push(a);for(let e=1;e<o;e++)a=a.add(i),s.push(a);i=a.double()}return s},wNAF(t,o,s){const{windows:i,windowSize:a}=n(t);let c=e.ZERO,l=e.BASE;const u=BigInt(2**t-1),d=2**t,h=BigInt(t);for(let e=0;e<i;e++){const t=e*a;let n=Number(s&u);s>>=h,n>a&&(n-=d,s+=Pr);const i=t,p=t+Math.abs(n)-1,f=e%2!=0,g=n<0;0===n?l=l.add(r(f,o[i])):c=c.add(r(g,o[p]))}return{p:c,f:l}}
vendor: 5,692 bytes, line 1766
1766,wNAFCached(e,t,r,n){const o=e._WINDOW_SIZE||1;let s=t.get(e);return s||(s=this.precomputeWindow(e,o),1!==o&&t.set(e,n(s))),this.wNAF(o,s,r)}}}(d,t.endo?Math.ceil(h/2):h);return{CURVE:t,ProjectivePoint:d,normPrivateKeyToScalar:c,weierstrassEquation:s,isWithinCurveOrder:i}}function Or(e){const t=function(e){const t=Er(e);return or(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:r,n}=t,o=r.BYTES+1,s=2*r.BYTES+1;function i(e){return hr(e,n)}function a(e){return gr(e,n)}const{ProjectivePoint:c,normPrivateKeyToScalar:l,weierstrassEquation:u,isWithinCurveOrder:d}=Br({...t,toBytes(e,t,n){const o=t.toAffine(),s=r.toBytes(o.x),i=Zt;return n?i(Uint8Array.from([t.hasEvenY()?2:3]),s):i(Uint8Array.from([4]),s,r.toBytes(o.y))},fromBytes(e){const t=e.length,n=e[0],i=e.subarray(1);if(t!==o||2!==n&&3!==n){if(t===s&&4===n){return{x:r.fromBytes(i.subarray(0,r.BYTES)),y:r.fromBytes(i.subarray(r.BYTES,2*r.BYTES))}}throw new Error(`Point of length ${t} was invalid. Expected ${o} compressed bytes or ${s} uncompressed bytes`)}{const e=$t(i);if(!(Ir<(a=e)&&a<r.ORDER))throw new Error("Point is not on curve");const t=u(e);let o=r.sqrt(t);return!(1&~n)!==((o&Sr)===Sr)&&(o=r.neg(o)),{x:e,y:o}}var a}}),h=e=>qt(Yt(e,t.nByteLength));function p(e){return e>n>>Sr}const f=(e,t,r)=>$t(e.slice(t,r));class g{constructor(e,t,r){this.r=e,this.s=t,this.recovery=r,this.assertValidity()}static fromCompact(e){const r=t.nByteLength;return e=Qt("compactSignature",e,2*r),new g(f(e,0,r),f(e,r,2*r))}static fromDER(e){const{r:t,s:r}=_r.toSig(Qt("DER",e));return new g(t,r)}assertValidity(){if(!d(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!d(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new g(this.r,this.s,e)}recoverPublicKey(e){const{r:n,s:o,recovery:s}=this,l=w(Qt("msgHash",e));if(null==s||![0,1,2,3].includes(s))throw new Error("recovery id invalid");const u=2===s||3===s?n+t.n:n;if(u>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const d=1&s?"03":"02",p=c.fromHex(d+h(u)),f=a(u),g=i(-l*f),m=i(o*f),y=c.BASE.multiplyAndAddUnsafe(p,g,m);if(!y)throw new Error("point at infinify");return y.assertValidity(),y}hasHighS(){return p(this.s)}normalizeS(){return this.hasHighS()?new g(this.r,i(-this.s),this.recovery):this}toDERRawBytes(){return Kt(this.toDERHex())}toDERHex(){return _r.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Kt(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const m={isValidPrivateKey(e){try{return l(e),!0}catch(e){return!1}},normPrivateKeyToScalar:l,randomPrivateKey:()=>{const e=vr(t.n);return function(e,t,r=!1){const n=e.length,o=wr(t),s=vr(t);if(n<16||n<s||n>1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);const i=hr(r?$t(e):Gt(e),t-ir)+ir;return r?Jt(i,o):Yt(i,o)}(t.randomBytes(e),t.n)},precompute:(e=8,t=c.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)};function y(e){const t=e instanceof Uint8Array,r="string"==typeof e,n=(t||r)&&e.length;return t?n===o||n===s:r?n===2*o||n===2*s:e instanceof c}const b=t.bits2int||function(e){const r=$t(e),n=8*e.length-t.nBitLength;return n>0?r>>BigInt(n):r},w=t.bits2int_modN||function(e){return i(b(e))},v=Xt(t.nBitLength);function A(e){if("bigint"!=typeof e)throw new Error("bigint expected");if(!(Ir<=e&&e<v))throw new Error(`bigint expected < 2^${t.nBitLength}`);return Yt(e,t.nByteLength)}function T(e,n,o=P){if(["recovered","canonical"].some((e=>e in o)))throw new Error("sign() legacy options not supported");const{hash:s,randomBytes:u}=t;let{lowS:h,prehash:f,extraEntropy:m}=o;null==h&&(h=!0),e=Qt("msgHash",e),f&&(e=Qt("prehashed msgHash",s(e)));const y=w(e),v=l(n),T=[A(v),A(y)];if(null!=m){const e=!0===m?u(r.BYTES):m;T.push(Qt("extraEntropy",e))}const E=Zt(...T),C=y;return{seed:E,k2sig:function(e){const t=b(e);if(!d(t))return;const r=a(t),n=c.BASE.multiply(t).toAffine(),o=i(n.x);if(o===Ir)return;const s=i(r*i(C+o*v));if(s===Ir)return;let l=(n.x===o?0:2)|Number(n.y&Sr),u=s;return h&&p(s)&&(u=function(e){return p(e)?i(-e):e}(s),l^=1),new g(o,u,l)}}}const P={lowS:t.lowS,prehash:!1},E={lowS:t.lowS,prehash:!1};return c.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function(e,t=!0){return c.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,r=!0){if(y(e))throw new Error("first arg must be private key");if(!y(t))throw new Error("second arg must be public key");return c.fromHex(t).multiply(l(e)).toRawBytes(r)},sign:function(e,r,n=P){const{seed:o,k2sig:s}=T(e,r,n),i=t;return rr(i.hash.outputLen,i.nByteLength,i.hmac)(o,s)},verify:function(e,r,n,o=E){const s=e;if(r=Qt("msgHash",r),n=Qt("publicKey",n),"strict"in o)throw new Error("options.strict was renamed to lowS");const{lowS:l,prehash:u}=o;let d,h;try{if("string"==typeof s||s instanceof Uint8Array)try{d=g.fromDER(s)}catch(e){if(!(e instanceof _r.Err))throw e;d=g.fromCompact(s)}else{if("object"!=typeof s||"bigint"!=typeof s.r||"bigint"!=typeof s.s)throw new Error("PARSE");{const{r:e,s:t}=s;d=new g(e,t)}}h=c.fromHex(n)}catch(e){if("PARSE"===e.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(l&&d.hasHighS())return!1;u&&(r=t.hash(r));const{r:p,s:f}=d,m=w(r),y=a(f),b=i(m*y),v=i(p*y),A=c.BASE.multiplyAndAddUnsafe(h,b,v)?.toAffine();return!!A&&i(A.x)===p},ProjectivePoint:c,Signature:g,utils:m}}function Mr(e){return{hash:e,hmac:(t,...r)=>(0,Le.w)(e,t,(0,Ar.Id)(...r)),randomBytes:Ar.po}}const Wr=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),jr=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Rr=BigInt(1),Nr=BigInt(2),Ur=(e,t)=>
1766(e+t/Nr)/t;function Dr(e){const t=Wr,r=BigInt(3),n=BigInt(6),o=BigInt(11),s=BigInt(22),i=BigInt(23),a=BigInt(44),c=BigInt(88),l=e*e*e%t,u=l*l*e%t,d=fr(u,r,t)*u%t,h=fr(d,r,t)*u%t,p=fr(h,Nr,t)*l%t,f=fr(p,o,t)*p%t,g=fr(f,s,t)*f%t,m=fr(g,a,t)*g%t,y=fr(m,c,t)*m%t,b=fr(y,a,t)*g%t,w=fr(b,r,t)*u%t,v=fr(w,i,t)*f%t,A=fr(v,n,t)*l%t,T=fr(A,Nr,t);if(!Lr.eql(Lr.sqr(T),e))throw new Error("Cannot find square root");return T}const Lr=function(e,t,r=!1,n={}){if(e<=sr)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:o,nByteLength:s}=br(e,t);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");const i=mr(e),a=Object.freeze({ORDER:e,BITS:o,BYTES:s,MASK:Xt(o),ZERO:sr,ONE:ir,create:t=>hr(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("Invalid field element: expected bigint, got "+typeof t);return sr<=t&&t<e},is0:e=>e===sr,isOdd:e=>(e&ir)===ir,neg:t=>hr(-t,e),eql:(e,t)=>e===t,sqr:t=>hr(t*t,e),add:(t,r)=>hr(t+r,e),sub:(t,r)=>hr(t-r,e),mul:(t,r)=>hr(t*r,e),pow:(e,t)=>function(e,t,r){if(r<sr)throw new Error("Expected power > 0");if(r===sr)return e.ONE;if(r===ir)return t;let n=e.ONE,o=t;for(;r>sr;)r&ir&&(n=e.mul(n,o)),o=e.sqr(o),r>>=ir;return n}(a,e,t),div:(t,r)=>hr(t*gr(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>gr(t,e),sqrt:n.sqrt||(e=>i(a,e)),invertBatch:e=>function(e,t){const r=new Array(t.length),n=t.reduce(((t,n,o)=>e.is0(n)?t:(r[o]=t,e.mul(t,n))),e.ONE),o=e.inv(n);return t.reduceRight(((t,n,o)=>e.is0(n)?t:(r[o]=e.mul(t,r[o]),e.mul(t,n))),o),r}(a,e),cmov:(e,t,r)=>r?t:e,toBytes:e=>r?Jt(e,s):Yt(e,s),fromBytes:e=>{if(e.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${e.length}`);return r?Gt(e):$t(e)}});return Object.freeze(a)}(Wr,void 0,void 0,{sqrt:Dr}),Fr=function(e,t){const r=t=>Or({...e,...Mr(t)});return Object.freeze({...r(t),create:r})}({a:BigInt(0),b:BigInt(7),Fp:Lr,n:jr,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=jr,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-Rr*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,i=BigInt("0x100000000000000000000000000000000"),a=Ur(s*e,t),c=Ur(-n*e,t);let l=hr(e-a*r-c*o,t),u=hr(-a*n-c*s,t);const d=l>i,h=u>i;if(d&&(l=t-l),h&&(u=t-u),l>i||u>i)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:l,k2neg:h,k2:u}}}},ze.s);BigInt(0);Fr.ProjectivePoint;class zr{#c;constructor(e){te(32===fe(e),"invalid private key","privateKey","[REDACTED]"),this.#c=he(e)}get privateKey(){return this.#c}get publicKey(){return zr.computePublicKey(this.#c)}get compressedPublicKey(){return zr.computePublicKey(this.#c,!0)}sign(e){te(32===fe(e),"invalid digest length","digest",e);const t=Fr.sign(ce(e),ce(this.#c),{lowS:!0});return De.from({r:Ie(t.r,32),s:Ie(t.s,32),v:t.recovery?28:27})}computeSharedSecret(e){const t=zr.computePublicKey(e);return he(Fr.getSharedSecret(ce(this.#c),ae(t),!1))}static computePublicKey(e,t){let r=ae(e,"key");if(32===r.length){return he(Fr.getPublicKey(r,!!t))}if(64===r.length){const e=new Uint8Array(65);e[0]=4,e.set(r,1),r=e}return he(Fr.ProjectivePoint.fromHex(r).toRawBytes(t))}static recoverPublicKey(e,t){te(32===fe(e),"invalid digest length","digest",e);const r=De.from(t);let n=Fr.Signature.fromCompact(ce(pe([r.r,r.s])));n=n.addRecoveryBit(r.yParity);const o=n.recoverPublicKey(ce(e));return te(null!=o,"invalid signautre for digest","signature",t),"0x"+o.toHex(!1)}static addPoints(e,t,r){const n=Fr.ProjectivePoint.fromHex(zr.computePublicKey(e).substring(2)),o=Fr.ProjectivePoint.fromHex(zr.computePublicKey(t).substring(2));return"0x"+n.add(o).toHex(!!r)}}function Vr(e){let t;return t="string"==typeof e?zr.computePublicKey(e,!1):e.publicKey,Dt(ft("0x"+t.substring(4)).substring(26))}function qr(e,t){return Vr(zr.recoverPublicKey(e,t))}const Hr=32,Kr=new Uint8Array(Hr),$r=["then"],Gr={},Yr=new WeakMap;function Jr(e){return Yr.get(e)}function Qr(e,t){Yr.set(e,t)}function Zr(e,t){const r=new Error(`deferred error during ABI decoding triggered accessing ${e}`);throw r.error=t,r}function Xr(e,t,r){return e.indexOf(null)>=0?t.map(((e,t)=>e instanceof en?Xr(Jr(e),e,r):e)):e.reduce(((e,n,o)=>{let s=t.getValue(n);return n in e||(r&&s instanceof en&&(s=Xr(Jr(s),s,r)),e[n]=s),e}),{})}class en extends Array{#l;constructor(...e){const t=e[0];let r=e[1],n=(e[2]||[]).slice(),o=!0;t!==Gr&&(r=e,n=[],o=!1),super(r.length),r.forEach(((e,t)=>{this[t]=e}));const s=n.reduce(((e,t)=>("string"==typeof t&&e.set(t,(e.get(t)||0)+1),e)),new Map);if(Qr(this,Object.freeze(r.map(((e,t)=>{const r=n[t];return null!=r&&1===s.get(r)?r:null})))),this.#l=[],null==this.#l&&this.#l,!o)return;Object.freeze(this);const i=new Proxy(this,{get:(e,t,r)=>{if("string"==typeof t){if(t.match(/^[0-9]+$/)){const r=_e(t,"%index");if(r<0||r>=this.length)throw new RangeError("out of result range");const n=e[r];return n instanceof Error&&Zr(`index ${r}`,n),n}if($r.indexOf(t)>=0)return Reflect.get(e,t,r);const n=e[t];if(n instanceof Function)return function(...t){return n.apply(this===r?e:this,t)};if(!(t in e))return e.getValue.apply(this===r?e:this,[t])}return Reflect.get(e,t,r)}});return Qr(i,Jr(this)),i}toArray(e){const t=[];return this.forEach(((r,n)=>{r instanceof Error&&Zr(`index ${n}`,r),e&&r instanceof en&&(r=r.toArray(e)),t.push(r)})),t}toObject(e){const t=Jr(this);return t.reduce(((r,n,o)=>(ee(null!=n,`value at index ${o} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),Xr(t,this,e))),{})}slice(e,t){null==e&&(e=0),e<0&&(e+=this.length)<0&&(e=0),null==t&&(t=this.length),t<0&&(t+=this.length)<0&&(t=0),t>this.length&&(t=this.length);const r=Jr(this),n=[],o=[];for(let s=e;s<t;s++)n.push(this[s]),o.push(r[s]);return new en(Gr,n,o)}filter(e,t){const r=Jr(this),n=[],o=[];for(let s=0;s<this.length;s++){const i=this[s];i instanceof Error&&Zr(`index ${s}`,i),e.call(t,i,s,this)&&(n.push(i),o.push(r[s]))}return new en(Gr,n,o)}map(e,t){const r=[];for(let n=0;n<this.length;n++){const o=this[n];o instanceof Error&&Zr(`index ${n}`,o),r.push(e.call(t,o,n,this))}return r}getValue(e){const t=Jr(this).indexOf(e);if(-1===t)return;const r=this[t];return r instanceof Error&&Zr(`property ${JSON.stringify(e)}`,r.error),r}static fromItems(e,t){return new en(Gr,e,t)}}function tn(e){let t=Se(e);return ee(t.length<=Hr,"value out-of-bounds","BUFFER_OVERRUN",{buffer:t,length:Hr,offset:t.length}),t.length!==Hr&&(t=ce(pe([Kr.slice(t.length%Hr),t]))),t}class rn{name;type;localName;dynamic;constructor(e,t,r,n){J(this,{name:e,type:t,localName:r,dynamic:n},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(e,t){te(!1,e,this.localName,t)}}class nn{#o;#u;
1766constructor(){this.#o=[],this.#u=0}get data(){return pe(this.#o)}get length(){return this.#u}#d(e){return this.#o.push(e),this.#u+=e.length,e.length}appendWriter(e){return this.#d(ce(e.data))}writeBytes(e){let t=ce(e);const r=t.length%Hr;return r&&(t=ce(pe([t,Kr.slice(r)]))),this.#d(t)}writeValue(e){return this.#d(tn(e))}writeUpdatableValue(){const e=this.#o.length;return this.#o.push(Kr),this.#u+=Hr,t=>{this.#o[e]=tn(t)}}}class on{allowLoose;#o;#h;#p;#f;#g;constructor(e,t,r){J(this,{allowLoose:!!t}),this.#o=ce(e),this.#p=0,this.#f=null,this.#g=null!=r?r:1024,this.#h=0}get data(){return he(this.#o)}get dataLength(){return this.#o.length}get consumed(){return this.#h}get bytes(){return new Uint8Array(this.#o)}#m(e){if(this.#f)return this.#f.#m(e);this.#p+=e,ee(this.#g<1||this.#p<=this.#g*this.dataLength,`compressed ABI data exceeds inflation ratio of ${this.#g} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:ce(this.#o),offset:this.#h,length:e,info:{bytesRead:this.#p,dataLength:this.dataLength}})}#y(e,t,r){let n=Math.ceil(t/Hr)*Hr;return this.#h+n>this.#o.length&&(this.allowLoose&&r&&this.#h+t<=this.#o.length?n=t:ee(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:ce(this.#o),length:this.#o.length,offset:this.#h+n})),this.#o.slice(this.#h,this.#h+n)}subReader(e){const t=new on(this.#o.slice(this.#h+e),this.allowLoose,this.#g);return t.#f=this,t}readBytes(e,t){let r=this.#y(0,e,!!t);return this.#m(e),this.#h+=r.length,r.slice(0,e)}readValue(){return ke(this.readBytes(Hr))}readIndex(){return _e(ke(this.readBytes(Hr)))}}const sn={};function an(e,t){let r=!1;return t<0&&(r=!0,t*=-1),new un(sn,`${r?"":"u"}int${t}`,e,{signed:r,width:t})}function cn(e,t){return new un(sn,`bytes${t||""}`,e,{size:t})}const ln=Symbol.for("_ethers_typed");class un{type;value;#b;_typedSymbol;constructor(e,t,r,n){null==n&&(n=null),se(sn,e,"Typed"),J(this,{_typedSymbol:ln,type:t,value:r}),this.#b=n,this.format()}format(){if("array"===this.type)throw new Error("");if("dynamicArray"===this.type)throw new Error("");return"tuple"===this.type?`tuple(${this.value.map((e=>e.format())).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return"string"===this.type}get tupleName(){if("tuple"!==this.type)throw TypeError("not a tuple");return this.#b}get arrayLength(){if("array"!==this.type)throw TypeError("not an array");return!0===this.#b?-1:!1===this.#b?this.value.length:null}static from(e,t){return new un(sn,e,t)}static uint8(e){return an(e,8)}static uint16(e){return an(e,16)}static uint24(e){return an(e,24)}static uint32(e){return an(e,32)}static uint40(e){return an(e,40)}static uint48(e){return an(e,48)}static uint56(e){return an(e,56)}static uint64(e){return an(e,64)}static uint72(e){return an(e,72)}static uint80(e){return an(e,80)}static uint88(e){return an(e,88)}static uint96(e){return an(e,96)}static uint104(e){return an(e,104)}static uint112(e){return an(e,112)}static uint120(e){return an(e,120)}static uint128(e){return an(e,128)}static uint136(e){return an(e,136)}static uint144(e){return an(e,144)}static uint152(e){return an(e,152)}static uint160(e){return an(e,160)}static uint168(e){return an(e,168)}static uint176(e){return an(e,176)}static uint184(e){return an(e,184)}static uint192(e){return an(e,192)}static uint200(e){return an(e,200)}static uint208(e){return an(e,208)}static uint216(e){return an(e,216)}static uint224(e){return an(e,224)}static uint232(e){return an(e,232)}static uint240(e){return an(e,240)}static uint248(e){return an(e,248)}static uint256(e){return an(e,256)}static uint(e){return an(e,256)}static int8(e){return an(e,-8)}static int16(e){return an(e,-16)}static int24(e){return an(e,-24)}static int32(e){return an(e,-32)}static int40(e){return an(e,-40)}static int48(e){return an(e,-48)}static int56(e){return an(e,-56)}static int64(e){return an(e,-64)}static int72(e){return an(e,-72)}static int80(e){return an(e,-80)}static int88(e){return an(e,-88)}static int96(e){return an(e,-96)}static int104(e){return an(e,-104)}static int112(e){return an(e,-112)}static int120(e){return an(e,-120)}static int128(e){return an(e,-128)}static int136(e){return an(e,-136)}static int144(e){return an(e,-144)}static int152(e){return an(e,-152)}static int160(e){return an(e,-160)}static int168(e){return an(e,-168)}static int176(e){return an(e,-176)}static int184(e){return an(e,-184)}static int192(e){return an(e,-192)}static int200(e){return an(e,-200)}static int208(e){return an(e,-208)}static int216(e){return an(e,-216)}static int224(e){return an(e,-224)}static int232(e){return an(e,-232)}static int240(e){return an(e,-240)}static int248(e){return an(e,-248)}static int256(e){return an(e,-256)}static int(e){return an(e,-256)}static bytes1(e){return cn(e,1)}static bytes2(e){return cn(e,2)}static bytes3(e){return cn(e,3)}static bytes4(e){return cn(e,4)}static bytes5(e){return cn(e,5)}static bytes6(e){return cn(e,6)}static bytes7(e){return cn(e,7)}static bytes8(e){return cn(e,8)}static bytes9(e){return cn(e,9)}static bytes10(e){return cn(e,10)}static bytes11(e){return cn(e,11)}static bytes12(e){return cn(e,12)}static bytes13(e){return cn(e,13)}static bytes14(e){return cn(e,14)}static bytes15(e){return cn(e,15)}static bytes16(e){return cn(e,16)}static bytes17(e){return cn(e,17)}static bytes18(e){return cn(e,18)}static bytes19(e){return cn(e,19)}static bytes20(e){return cn(e,20)}static bytes21(e){return cn(e,21)}static bytes22(e){return cn(e,22)}static bytes23(e){return cn(e,23)}static bytes24(e){return cn(e,24)}static bytes25(e){return cn(e,25)}static bytes26(e){return cn(e,26)}static bytes27(e){return cn(e,27)}static bytes28(e){return cn(e,28)}static bytes29(e){return cn(e,29)}static bytes30(e){return cn(e,30)}static bytes31(e){return cn(e,31)}static bytes32(e){return cn(e,32)}static address(e){return new un(sn,"address",e)}static bool(e){return new un(sn,"bool",!!e)}static bytes(e){return new un(sn,"bytes",e)}static string(e){return new un(sn,"string",e)}static array(e,t){throw new Error("not implemented yet")}static tuple(e,t){throw new Error("not implemented yet")}static overrides(e){return new un(sn,"overrides",Object.assign({},e))}
1766static isTyped(e){return e&&"object"==typeof e&&"_typedSymbol"in e&&e._typedSymbol===ln}static dereference(e,t){if(un.isTyped(e)){if(e.type!==t)throw new Error(`invalid type: expecetd ${t}, got ${e.type}`);return e.value}return e}}class dn extends rn{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){let r=un.dereference(t,"string");try{r=Dt(r)}catch(e){return this._throwError(e.message,t)}return e.writeValue(r)}decode(e){return Dt(Ie(e.readValue(),20))}}class hn extends rn{coder;constructor(e){super(e.name,e.type,"_",e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}function pn(e,t,r){let n=[];if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let e={};n=t.map((t=>{const n=t.localName;return ee(n,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:t},value:r}),ee(!e[n],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:t},value:r}),e[n]=!0,r[n]}))}else te(!1,"invalid tuple value","tuple",r);te(t.length===n.length,"types/value length mismatch","tuple",r);let o=new nn,s=new nn,i=[];t.forEach(((e,t)=>{let r=n[t];if(e.dynamic){let t=s.length;e.encode(s,r);let n=o.writeUpdatableValue();i.push((e=>{n(e+t)}))}else e.encode(o,r)})),i.forEach((e=>{e(o.length)}));let a=e.appendWriter(o);return a+=e.appendWriter(s),a}function fn(e,t){let r=[],n=[],o=e.subReader(0);return t.forEach((t=>{let s=null;if(t.dynamic){let r=e.readIndex(),n=o.subReader(r);try{s=t.decode(n)}catch(e){if(Z(e,"BUFFER_OVERRUN"))throw e;s=e,s.baseType=t.name,s.name=t.localName,s.type=t.type}}else try{s=t.decode(e)}catch(e){if(Z(e,"BUFFER_OVERRUN"))throw e;s=e,s.baseType=t.name,s.name=t.localName,s.type=t.type}if(null==s)throw new Error("investigate");r.push(s),n.push(t.localName||null)})),en.fromItems(r,n)}class gn extends rn{coder;length;constructor(e,t,r){super("array",e.type+"["+(t>=0?t:"")+"]",r,-1===t||e.dynamic),J(this,{coder:e,length:t})}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let r=0;r<this.length;r++)t.push(e);return t}encode(e,t){const r=un.dereference(t,"array");Array.isArray(r)||this._throwError("expected array value",r);let n=this.length;-1===n&&(n=r.length,e.writeValue(r.length)),re(r.length,n,"coder array"+(this.localName?" "+this.localName:""));let o=[];for(let e=0;e<r.length;e++)o.push(this.coder);return pn(e,o,r)}decode(e){let t=this.length;-1===t&&(t=e.readIndex(),ee(t*Hr<=e.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:e.bytes,offset:t*Hr,length:e.dataLength}));let r=[];for(let e=0;e<t;e++)r.push(new hn(this.coder));return fn(e,r)}}class mn extends rn{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){const r=un.dereference(t,"bool");return e.writeValue(r?1:0)}decode(e){return!!e.readValue()}}class yn extends rn{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=ce(t);let r=e.writeValue(t.length);return r+=e.writeBytes(t),r}decode(e){return e.readBytes(e.readIndex(),!0)}}class bn extends yn{constructor(e){super("bytes",e)}decode(e){return he(super.decode(e))}}class wn extends rn{size;constructor(e,t){let r="bytes"+String(e);super(r,r,t,!1),J(this,{size:e},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(e,t){let r=ce(un.dereference(t,this.type));return r.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(r)}decode(e){return he(e.readBytes(this.size))}}const vn=new Uint8Array([]);class An extends rn{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return null!=t&&this._throwError("not null",t),e.writeBytes(vn)}decode(e){return e.readBytes(0),null}}const Tn=BigInt(0),Pn=BigInt(1),En=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class Cn extends rn{size;signed;constructor(e,t,r){const n=(t?"int":"uint")+8*e;super(n,n,r,!1),J(this,{size:e,signed:t},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(e,t){let r=Pe(un.dereference(t,this.type)),n=Te(En,256);if(this.signed){let e=Te(n,8*this.size-1);(r>e||r<-(e+Pn))&&this._throwError("value out-of-bounds",t),r=Ae(r,256)}else(r<Tn||r>Te(n,8*this.size))&&this._throwError("value out-of-bounds",t);return e.writeValue(r)}decode(e){let t=Te(e.readValue(),8*this.size);return this.signed&&(t=function(e,t){const r=Ee(e,"value"),n=BigInt(_e(t,"width"));if(ee(r>>n===be,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:e}),r>>n-we)return-((~r&(we<<n)-we)+we);return r}(t,8*this.size)),t}}class kn extends yn{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,ct(un.dereference(t,"string")))}decode(e){return lt(super.decode(e))}}class _n extends rn{coders;constructor(e,t){let r=!1;const n=[];e.forEach((e=>{e.dynamic&&(r=!0),n.push(e.type)}));super("tuple","tuple("+n.join(",")+")",t,r),J(this,{coders:Object.freeze(e.slice())})}defaultValue(){const e=[];
1766this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});return this.coders.forEach(((r,n)=>{let o=r.localName;o&&1===t[o]&&("length"===o&&(o="_length"),null==e[o]&&(e[o]=e[n]))})),Object.freeze(e)}encode(e,t){const r=un.dereference(t,"tuple");return pn(e,this.coders,r)}decode(e){return fn(e,this.coders)}}function In(e){const t=new Set;return e.forEach((e=>t.add(e))),Object.freeze(t)}In("external public payable override".split(" "));const Sn="constant external internal payable private public pure view override",xn=(In(Sn.split(" ")),"constructor error event fallback function receive struct"),Bn=(In(xn.split(" ")),"calldata memory storage payable indexed"),On=In(Bn.split(" ")),Mn=In([xn,Bn,"tuple returns",Sn].join(" ").split(" ")),Wn={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},jn=new RegExp("^(\\s*)"),Rn=new RegExp("^([0-9]+)"),Nn=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),Un=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),Dn=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");class Ln{#h;#w;get offset(){return this.#h}get length(){return this.#w.length-this.#h}constructor(e){this.#h=0,this.#w=e.slice()}clone(){return new Ln(this.#w)}reset(){this.#h=0}#v(e=0,t=0){return new Ln(this.#w.slice(e,t).map((t=>Object.freeze(Object.assign({},t,{match:t.match-e,linkBack:t.linkBack-e,linkNext:t.linkNext-e})))))}popKeyword(e){const t=this.peek();if("KEYWORD"!==t.type||!e.has(t.text))throw new Error(`expected keyword ${t.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const t=this.peek();throw new Error(`expected ${e}; got ${t.type} ${JSON.stringify(t.text)}`)}return this.pop().text}popParen(){const e=this.peek();if("OPEN_PAREN"!==e.type)throw new Error("bad start");const t=this.#v(this.#h+1,e.match+1);return this.#h=e.match+1,t}popParams(){const e=this.peek();if("OPEN_PAREN"!==e.type)throw new Error("bad start");const t=[];for(;this.#h<e.match-1;){const e=this.peek().linkNext;t.push(this.#v(this.#h+1,e)),this.#h=e}return this.#h=e.match+1,t}peek(){if(this.#h>=this.#w.length)throw new Error("out-of-bounds");return this.#w[this.#h]}peekKeyword(e){const t=this.peekType("KEYWORD");return null!=t&&e.has(t)?t:null}peekType(e){if(0===this.length)return null;const t=this.peek();return t.type===e?t.text:null}pop(){const e=this.peek();return this.#h++,e}toString(){const e=[];for(let t=this.#h;t<this.#w.length;t++){const r=this.#w[t];e.push(`${r.type}:${r.text}`)}return`<TokenString ${e.join(" ")}>`}}function Fn(e){const t=[],r=t=>{const r=s<e.length?JSON.stringify(e[s]):"$EOI";throw new Error(`invalid token ${r} at ${s}: ${t}`)};let n=[],o=[],s=0;for(;s<e.length;){let i=e.substring(s),a=i.match(jn);a&&(s+=a[1].length,i=e.substring(s));const c={depth:n.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:s,value:-1};t.push(c);let l=Wn[i[0]]||"";if(l){if(c.type=l,c.text=i[0],s++,"OPEN_PAREN"===l)n.push(t.length-1),o.push(t.length-1);else if("CLOSE_PAREN"==l)0===n.length&&r("no matching open bracket"),c.match=n.pop(),t[c.match].match=t.length-1,c.depth--,c.linkBack=o.pop(),t[c.linkBack].linkNext=t.length-1;else if("COMMA"===l)c.linkBack=o.pop(),t[c.linkBack].linkNext=t.length-1,o.push(t.length-1);else if("OPEN_BRACKET"===l)c.type="BRACKET";else if("CLOSE_BRACKET"===l){let e=t.pop().text;if(t.length>0&&"NUMBER"===t[t.length-1].type){const r=t.pop().text;e=r+e,t[t.length-1].value=_e(r)}if(0===t.length||"BRACKET"!==t[t.length-1].type)throw new Error("missing opening bracket");t[t.length-1].text+=e}}else if(a=i.match(Nn),a){if(c.text=a[1],s+=c.text.length,Mn.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(Dn)){c.type="TYPE";continue}c.type="ID"}else{if(a=i.match(Rn),!a)throw new Error(`unexpected token ${JSON.stringify(i[0])} at position ${s}`);c.text=a[1],c.type="NUMBER",s+=c.text.length}}return new Ln(t.map((e=>Object.freeze(e))))}function zn(e,t){const r=new Set;for(;;){const n=e.peekType("KEYWORD");if(null==n||t&&!t.has(n))break;if(e.pop(),r.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);r.add(n)}return Object.freeze(r)}const Vn=new RegExp(/^(.*)\[([0-9]*)\]$/);function qn(e){const t=e.match(Dn);
1766if(te(t,"invalid type","type",e),"uint"===e)return"uint256";if("int"===e)return"int256";if(t[2]){const r=parseInt(t[2]);te(0!==r&&r<=32,"invalid bytes length","type",e)}else if(t[3]){const r=parseInt(t[3]);te(0!==r&&r<=256&&r%8==0,"invalid numeric width","type",e)}return e}const Hn={},Kn=Symbol.for("_ethers_internal"),$n="_ParamTypeInternal";class Gn{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(e,t,r,n,o,s,i,a){if(se(e,Hn,"ParamType"),Object.defineProperty(this,Kn,{value:$n}),s&&(s=Object.freeze(s.slice())),"array"===n){if(null==i||null==a)throw new Error("")}else if(null!=i||null!=a)throw new Error("");if("tuple"===n){if(null==s)throw new Error("")}else if(null!=s)throw new Error("");J(this,{name:t,type:r,baseType:n,indexed:o,components:s,arrayLength:i,arrayChildren:a})}format(e){if(null==e&&(e="sighash"),"json"===e){const t=this.name||"";if(this.isArray()){const e=JSON.parse(this.arrayChildren.format("json"));return e.name=t,e.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(e)}const r={type:"tuple"===this.baseType?"tuple":this.type,name:t};return"boolean"==typeof this.indexed&&(r.indexed=this.indexed),this.isTuple()&&(r.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(r)}let t="";return this.isArray()?(t+=this.arrayChildren.format(e),t+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?t+="("+this.components.map((t=>t.format(e))).join("full"===e?", ":",")+")":t+=this.type,"sighash"!==e&&(!0===this.indexed&&(t+=" indexed"),"full"===e&&this.name&&(t+=" "+this.name)),t}isArray(){return"array"===this.baseType}isTuple(){return"tuple"===this.baseType}isIndexable(){return null!=this.indexed}walk(e,t){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(-1!==this.arrayLength&&e.length!==this.arrayLength)throw new Error("array is wrong length");const r=this;return e.map((e=>r.arrayChildren.walk(e,t)))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const r=this;return e.map(((e,n)=>r.components[n].walk(e,t)))}return t(this.type,e)}#A(e,t,r,n){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(-1!==this.arrayLength&&t.length!==this.arrayLength)throw new Error("array is wrong length");const o=this.arrayChildren,s=t.slice();return s.forEach(((t,n)=>{o.#A(e,t,r,(e=>{s[n]=e}))})),void n(s)}if(this.isTuple()){const o=this.components;let s;if(Array.isArray(t))s=t.slice();else{if(null==t||"object"!=typeof t)throw new Error("invalid tuple value");s=o.map((e=>{if(!e.name)throw new Error("cannot use object value with unnamed components");if(!(e.name in t))throw new Error(`missing value for component ${e.name}`);return t[e.name]}))}if(s.length!==this.components.length)throw new Error("array is wrong length");return s.forEach(((t,n)=>{o[n].#A(e,t,r,(e=>{s[n]=e}))})),void n(s)}const o=r(this.type,t);o.then?e.push(async function(){n(await o)}()):n(o)}async walkAsync(e,t){const r=[],n=[e];return this.#A(r,e,t,(e=>{n[0]=e})),r.length&&await Promise.all(r),n[0]}static from(e,t){if(Gn.isParamType(e))return e;if("string"==typeof e)try{return Gn.from(Fn(e),t)}catch(t){te(!1,"invalid param type","obj",e)}else if(e instanceof Ln){let r="",n="",o=null;zn(e,In(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(n="tuple",o=e.popParams().map((e=>Gn.from(e))),r=`tuple(${o.map((e=>e.format())).join(",")})`):(r=qn(e.popType("TYPE")),n=r);let s=null,i=null;for(;e.length&&e.peekType("BRACKET");){const t=e.pop();s=new Gn(Hn,"",r,n,null,o,i,s),i=t.value,r+=t.text,n="array",o=null}let a=null;if(zn(e,On).has("indexed")){if(!t)throw new Error("");a=!0}const c=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new Gn(Hn,c,r,n,a,o,i,s)}const r=e.name;te(!r||"string"==typeof r&&r.match(Un),"invalid name","obj.name",r);let n=e.indexed;null!=n&&(te(t,"parameter cannot be indexed","obj.indexed",e.indexed),n=!!n);let o=e.type,s=o.match(Vn);if(s){const t=parseInt(s[2]||"-1"),i=Gn.from({type:s[1],components:e.components});return new Gn(Hn,r||"",o,"array",n,null,t,i)}if("tuple"===o||o.startsWith("tuple(")||o.startsWith("(")){const t=null!=e.components?e.components.map((e=>Gn.from(e))):null;return new Gn(Hn,r||"",o,"tuple",n,t,null,null)}return o=qn(e.type),new Gn(Hn,r||"",o,o,n,null,null,null)}static isParamType(e){return e&&e[Kn]===$n}}const Yn=new Map;Yn.set(0,"GENERIC_PANIC"),Yn.set(1,"ASSERT_FALSE"),Yn.set(17,"OVERFLOW"),Yn.set(18,"DIVIDE_BY_ZERO"),Yn.set(33,"ENUM_RANGE_ERROR"),Yn.set(34,"BAD_STORAGE_DATA"),Yn.set(49,"STACK_UNDERFLOW"),Yn.set(50,"ARRAY_RANGE_ERROR"),Yn.set(65,"OUT_OF_MEMORY"),Yn.set(81,"UNINITIALIZED_FUNCTION_CALL");const Jn=new RegExp(/^bytes([0-9]*)$/),Qn=new RegExp(/^(u?int)([0-9]*)$/);let Zn=null,Xn=1024;class eo{#T(e){if(e.isArray())return new gn(this.#T(e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new _n(e.components.map((e=>this.#T(e))),e.name);switch(e.baseType){case"address":return new dn(e.name);case"bool":return new mn(e.name);case"string":return new kn(e.name);case"bytes":return new bn(e.name);case"":return new An(e.name)}let t=e.type.match(Qn);if(t){let r=parseInt(t[2]||"256");return te(0!==r&&r<=256&&r%8==0,"invalid "+t[1]+" bit length","param",e),new Cn(r/8,"int"===t[1],e.name)}if(t=e.type.match(Jn),t){let r=parseInt(t[1]);
1766return te(0!==r&&r<=32,"invalid bytes length","param",e),new wn(r,e.name)}te(!1,"invalid type","type",e.type)}getDefaultValue(e){const t=e.map((e=>this.#T(Gn.from(e))));return new _n(t,"_").defaultValue()}encode(e,t){re(t.length,e.length,"types/values length mismatch");const r=e.map((e=>this.#T(Gn.from(e)))),n=new _n(r,"_"),o=new nn;return n.encode(o,t),o.data}decode(e,t,r){const n=e.map((e=>this.#T(Gn.from(e))));return new _n(n,"_").decode(new on(t,r,Xn))}static _setDefaultMaxInflation(e){te("number"==typeof e&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),Xn=e}static defaultAbiCoder(){return null==Zn&&(Zn=new eo),Zn}static getBuiltinCallException(e,t,r){return function(e,t,r,n){let o="missing revert data",s=null,i=null;if(r){o="execution reverted";const e=ae(r);if(r=he(r),0===e.length)o+=" (no data present; likely require(false) occurred",s="require(false)";else if(e.length%32!=4)o+=" (could not decode reason; invalid data length)";else if("0x08c379a0"===he(e.slice(0,4)))try{s=n.decode(["string"],e.slice(4))[0],i={signature:"Error(string)",name:"Error",args:[s]},o+=`: ${JSON.stringify(s)}`}catch(e){o+=" (could not decode reason; invalid string data)"}else if("0x4e487b71"===he(e.slice(0,4)))try{const t=Number(n.decode(["uint256"],e.slice(4))[0]);i={signature:"Panic(uint256)",name:"Panic",args:[t]},s=`Panic due to ${Yn.get(t)||"UNKNOWN"}(${t})`,o+=`: ${s}`}catch(e){o+=" (could not decode panic code)"}else o+=" (unknown custom error)"}const a={to:t.to?Dt(t.to):null,data:t.data||"0x"};return t.from&&(a.from=Dt(t.from)),X(o,"CALL_EXCEPTION",{action:e,data:r,reason:s,transaction:a,invocation:null,revert:i})}(e,t,r,eo.defaultAbiCoder())}}var to=r("./node_modules/@noble/hashes/esm/ripemd160.js");let ro=!1;const no=function(e){return(0,to.H)(e)};let oo=no;function so(e){const t=ae(e,"data");return he(oo(t))}so._=no,so.lock=function(){ro=!0},so.register=function(e){if(ro)throw new TypeError("ripemd160 is locked");oo=e},Object.freeze(so);let io=!1;const ao=function(e){return new Uint8Array(function(e){ee(null!=He,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),te(Number.isInteger(e)&&e>0&&e<=1024,"invalid length","length",e);const t=new Uint8Array(e);return He.getRandomValues(t),t}(e))};let co=ao;function lo(e){return co(e)}async function uo(e,t){const r=await t;return null!=r&&"0x0000000000000000000000000000000000000000"!==r||(ee("string"!=typeof e,"unconfigured name","UNCONFIGURED_NAME",{value:e}),te(!1,"invalid AddressLike value; did not resolve to a value address","target",e)),Dt(r)}function ho(e,t){return"string"==typeof e?e.match(/^0x[0-9a-f]{40}$/i)?Dt(e):(ee(null!=t,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),uo(e,t.resolveName(e))):(r=e)&&"function"==typeof r.getAddress?uo(e,e.getAddress()):e&&"function"==typeof e.then?uo(e,e):void te(!1,"unsupported addressable value","target",e);var r}lo._=ao,lo.lock=function(){io=!0},lo.register=function(e){if(io)throw new Error("randomBytes is locked");co=e},Object.freeze(lo);const po="0x0000000000000000000000000000000000000000";function fo(e){let t=e.toString(16);for(;t.length<2;)t="0"+t;return"0x"+t}function go(e,t,r){let n=0;for(let o=0;o<r;o++)n=256*n+e[t+o];return n}function mo(e,t,r,n){const o=[];for(;r<t+1+n;){const s=yo(e,r);o.push(s.result),ee((r+=s.consumed)<=t+1+n,"child data too short","BUFFER_OVERRUN",{buffer:e,length:n,offset:t})}return{consumed:1+n,result:o}}function yo(e,t){ee(0!==e.length,"data too short","BUFFER_OVERRUN",{buffer:e,length:0,offset:1});const r=t=>{ee(t<=e.length,"data short segment too short","BUFFER_OVERRUN",{buffer:e,length:e.length,offset:t})};if(e[t]>=248){const n=e[t]-247;r(t+1+n);const o=go(e,t+1,n);return r(t+1+n+o),mo(e,t,t+1+n,n+o)}if(e[t]>=192){const n=e[t]-192;return r(t+1+n),mo(e,t,t+1,n)}if(e[t]>=184){const n=e[t]-183;r(t+1+n);const o=go(e,t+1,n);r(t+1+n+o);return{consumed:1+n+o,result:he(e.slice(t+1+n,t+1+n+o))}}if(e[t]>=128){const n=e[t]-128;r(t+1+n);return{consumed:1+n,result:he(e.slice(t+1,t+1+n))}}return{consumed:1,result:fo(e[t])}}function bo(e){const t=ae(e,"data"),r=yo(t,0);return te(r.consumed===t.length,"unexpected junk after rlp payload","data",e),r.result}function wo(e){const t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function vo(e){if(Array.isArray(e)){let t=[];if(e.forEach((function(e){t=t.concat(vo(e))})),t.length<=55)return t.unshift(192+t.length),t;const r=wo(t.length);return r.unshift(247+r.length),r.concat(t)}const t=Array.prototype.slice.call(ae(e,"object"));if(1===t.length&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const r=wo(t.length);return r.unshift(183+r.length),r.concat(t)}const Ao="0123456789abcdef";function To(e){let t="0x";for(const r of vo(e))t+=Ao[r>>4],t+=Ao[15&r];return t}function Po(e,t){return{address:Dt(e),storageKeys:t.map(((e,t)=>(te(le(e,32),"invalid slot",`storageKeys[${t}]`,e),e.toLowerCase())))}}function Eo(e){if(Array.isArray(e))return e.map(((t,r)=>Array.isArray(t)?(te(2===t.length,"invalid slot set",`value[${r}
1766]`,t),Po(t[0],t[1])):(te(null!=t&&"object"==typeof t,"invalid address-slot set","value",e),Po(t.address,t.storageKeys))));te(null!=e&&"object"==typeof e,"invalid access list","value",e);const t=Object.keys(e).map((t=>{const r=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return Po(t,Object.keys(r).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}const Co=BigInt(0),ko=BigInt(2),_o=BigInt(27),Io=BigInt(28),So=BigInt(35),xo=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Bo=131072;function Oo(e,t){let r=e.toString(16);for(;r.length<2;)r="0"+r;return r+=Xe(t).substring(4),"0x"+r}function Mo(e){return"0x"===e?null:Dt(e)}function Wo(e,t){try{return Eo(e)}catch(r){te(!1,r.message,t,e)}}function jo(e,t){return"0x"===e?0:_e(e,t)}function Ro(e,t){if("0x"===e)return Co;const r=Pe(e,t);return te(r<=xo,"value exceeds uint size",t,r),r}function No(e,t){const r=Pe(e,"value"),n=Se(r);return te(n.length<=32,"value too large",`tx.${t}`,r),n}function Uo(e){return Eo(e).map((e=>[e.address,e.storageKeys]))}function Do(e,t){te(Array.isArray(e),`invalid ${t}`,"value",e);for(let t=0;t<e.length;t++)te(le(e[t],32),"invalid ${ param } hash",`value[${t}]`,e[t]);return e}function Lo(e,t){let r;try{if(r=jo(t[0],"yParity"),0!==r&&1!==r)throw new Error("bad yParity")}catch(e){te(!1,"invalid yParity","yParity",t[0])}const n=ye(t[1],32),o=ye(t[2],32),s=De.from({r:n,s:o,yParity:r});e.signature=s}class Fo{#P;#E;#o;#C;#k;#_;#I;#S;#x;#B;#O;#M;#W;#j;#R;#N;get type(){return this.#P}set type(e){switch(e){case null:this.#P=null;break;case 0:case"legacy":this.#P=0;break;case 1:case"berlin":case"eip-2930":this.#P=1;break;case 2:case"london":case"eip-1559":this.#P=2;break;case 3:case"cancun":case"eip-4844":this.#P=3;break;default:te(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844"}return null}get to(){const e=this.#E;return null==e&&3===this.type?po:e}set to(e){this.#E=null==e?null:Dt(e)}get nonce(){return this.#C}set nonce(e){this.#C=_e(e,"value")}get gasLimit(){return this.#k}set gasLimit(e){this.#k=Pe(e)}get gasPrice(){const e=this.#_;return null!=e||0!==this.type&&1!==this.type?e:Co}set gasPrice(e){this.#_=null==e?null:Pe(e,"gasPrice")}get maxPriorityFeePerGas(){const e=this.#I;return e??(2===this.type||3===this.type?Co:null)}set maxPriorityFeePerGas(e){this.#I=null==e?null:Pe(e,"maxPriorityFeePerGas")}get maxFeePerGas(){const e=this.#S;return e??(2===this.type||3===this.type?Co:null)}set maxFeePerGas(e){this.#S=null==e?null:Pe(e,"maxFeePerGas")}get data(){return this.#o}set data(e){this.#o=he(e)}get value(){return this.#x}set value(e){this.#x=Pe(e,"value")}get chainId(){return this.#B}set chainId(e){this.#B=Pe(e)}get signature(){return this.#O||null}set signature(e){this.#O=null==e?null:De.from(e)}get accessList(){const e=this.#M||null;return e??(1===this.type||2===this.type||3===this.type?[]:null)}set accessList(e){this.#M=null==e?null:Eo(e)}get maxFeePerBlobGas(){const e=this.#W;return null==e&&3===this.type?Co:e}set maxFeePerBlobGas(e){this.#W=null==e?null:Pe(e,"maxFeePerBlobGas")}get blobVersionedHashes(){let e=this.#j;return null==e&&3===this.type?[]:e}set blobVersionedHashes(e){if(null!=e){te(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let t=0;t<e.length;t++)te(le(e[t],32),"invalid blobVersionedHash",`value[${t}]`,e[t])}this.#j=e}get blobs(){return null==this.#N?null:this.#N.map((e=>Object.assign({},e)))}set blobs(e){if(null==e)return void(this.#N=null);const t=[],r=[];for(let n=0;n<e.length;n++){const o=e[n];if(ue(o)){ee(this.#R,"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let e=ae(o);if(te(e.length<=Bo,"blob is too large",`blobs[${n}]`,o),e.length!==Bo){const t=new Uint8Array(Bo);t.set(e),e=t}const s=this.#R.blobToKzgCommitment(e),i=he(this.#R.computeBlobKzgProof(e,s));t.push({data:he(e),commitment:he(s),proof:i}),r.push(Oo(1,s))}else{const e=he(o.commitment);t.push({data:he(o.data),commitment:e,proof:he(o.proof)}),r.push(Oo(1,e))}}this.#N=t,this.#j=r}get kzg(){return this.#R}set kzg(e){this.#R=e}
1766constructor(){this.#P=null,this.#E=null,this.#C=0,this.#k=Co,this.#_=null,this.#I=null,this.#S=null,this.#o="0x",this.#x=Co,this.#B=Co,this.#O=null,this.#M=null,this.#W=null,this.#j=null,this.#N=null,this.#R=null}get hash(){return null==this.signature?null:ft(this.#U(!0,!1))}get unsignedHash(){return ft(this.unsignedSerialized)}get from(){return null==this.signature?null:qr(this.unsignedHash,this.signature)}get fromPublicKey(){return null==this.signature?null:zr.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return null!=this.signature}#U(e,t){ee(!e||null!=this.signature,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const r=e?this.signature:null;switch(this.inferType()){case 0:return function(e,t){const r=[No(e.nonce,"nonce"),No(e.gasPrice||0,"gasPrice"),No(e.gasLimit,"gasLimit"),e.to||"0x",No(e.value,"value"),e.data];let n=Co;if(e.chainId!=Co)n=Pe(e.chainId,"tx.chainId"),te(!t||null==t.networkV||t.legacyChainId===n,"tx.chainId/sig.v mismatch","sig",t);else if(e.signature){const t=e.signature.legacyChainId;null!=t&&(n=t)}if(!t)return n!==Co&&(r.push(Se(n)),r.push("0x"),r.push("0x")),To(r);let o=BigInt(27+t.yParity);return n!==Co?o=De.getChainIdV(n,t.v):BigInt(t.v)!==o&&te(!1,"tx.chainId/sig.v mismatch","sig",t),r.push(Se(o)),r.push(Se(t.r)),r.push(Se(t.s)),To(r)}(this,r);case 1:return function(e,t){const r=[No(e.chainId,"chainId"),No(e.nonce,"nonce"),No(e.gasPrice||0,"gasPrice"),No(e.gasLimit,"gasLimit"),e.to||"0x",No(e.value,"value"),e.data,Uo(e.accessList||[])];return t&&(r.push(No(t.yParity,"recoveryParam")),r.push(Se(t.r)),r.push(Se(t.s))),pe(["0x01",To(r)])}(this,r);case 2:return function(e,t){const r=[No(e.chainId,"chainId"),No(e.nonce,"nonce"),No(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),No(e.maxFeePerGas||0,"maxFeePerGas"),No(e.gasLimit,"gasLimit"),e.to||"0x",No(e.value,"value"),e.data,Uo(e.accessList||[])];return t&&(r.push(No(t.yParity,"yParity")),r.push(Se(t.r)),r.push(Se(t.s))),pe(["0x02",To(r)])}(this,r);case 3:return function(e,t,r){const n=[No(e.chainId,"chainId"),No(e.nonce,"nonce"),No(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),No(e.maxFeePerGas||0,"maxFeePerGas"),No(e.gasLimit,"gasLimit"),e.to||po,No(e.value,"value"),e.data,Uo(e.accessList||[]),No(e.maxFeePerBlobGas||0,"maxFeePerBlobGas"),Do(e.blobVersionedHashes||[],"blobVersionedHashes")];return t&&(n.push(No(t.yParity,"yParity")),n.push(Se(t.r)),n.push(Se(t.s)),r)?pe(["0x03",To([n,r.map((e=>e.data)),r.map((e=>e.commitment)),r.map((e=>e.proof))])]):pe(["0x03",To(n)])}(this,r,t?this.blobs:null)}ee(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get serialized(){return this.#U(!0,!0)}get unsignedSerialized(){return this.#U(!1,!1)}inferType(){const e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){const e=null!=this.gasPrice,t=null!=this.maxFeePerGas||null!=this.maxPriorityFeePerGas,r=null!=this.accessList,n=null!=this.#W||this.#j;null!=this.maxFeePerGas&&null!=this.maxPriorityFeePerGas&&ee(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),ee(!t||0!==this.type&&1!==this.type,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),ee(0!==this.type||!r,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const o=[];return null!=this.type?o.push(this.type):t?o.push(2):e?(o.push(1),r||o.push(0)):r?(o.push(1),o.push(2)):(n&&this.to||(o.push(0),o.push(1),o.push(2)),o.push(3)),o.sort(),o}isLegacy(){return 0===this.type}isBerlin(){return 1===this.type}isLondon(){return 2===this.type}isCancun(){return 3===this.type}clone(){return Fo.from(this)}toJSON(){const e=e=>null==e?null:e.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(null==e)return new Fo;if("string"==typeof e){const t=ae(e);if(t[0]>=127)return Fo.from(function(e){const t=bo(e);te(Array.isArray(t)&&(9===t.length||6===t.length),"invalid field count for legacy transaction","data",e);const r={type:0,nonce:jo(t[0],"nonce"),gasPrice:Ro(t[1],"gasPrice"),gasLimit:Ro(t[2],"gasLim
1766it"),to:Mo(t[3]),value:Ro(t[4],"value"),data:he(t[5]),chainId:Co};if(6===t.length)return r;const n=Ro(t[6],"v"),o=Ro(t[7],"r"),s=Ro(t[8],"s");if(o===Co&&s===Co)r.chainId=n;else{let e=(n-So)/ko;e<Co&&(e=Co),r.chainId=e,te(e!==Co||n===_o||n===Io,"non-canonical legacy v","v",t[6]),r.signature=De.from({r:ye(t[7],32),s:ye(t[8],32),v:n})}return r}(t));switch(t[0]){case 1:return Fo.from(function(e){const t=bo(ae(e).slice(1));te(Array.isArray(t)&&(8===t.length||11===t.length),"invalid field count for transaction type: 1","data",he(e));const r={type:1,chainId:Ro(t[0],"chainId"),nonce:jo(t[1],"nonce"),gasPrice:Ro(t[2],"gasPrice"),gasLimit:Ro(t[3],"gasLimit"),to:Mo(t[4]),value:Ro(t[5],"value"),data:he(t[6]),accessList:Wo(t[7],"accessList")};return 8===t.length||Lo(r,t.slice(8)),r}(t));case 2:return Fo.from(function(e){const t=bo(ae(e).slice(1));te(Array.isArray(t)&&(9===t.length||12===t.length),"invalid field count for transaction type: 2","data",he(e));const r={type:2,chainId:Ro(t[0],"chainId"),nonce:jo(t[1],"nonce"),maxPriorityFeePerGas:Ro(t[2],"maxPriorityFeePerGas"),maxFeePerGas:Ro(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:Ro(t[4],"gasLimit"),to:Mo(t[5]),value:Ro(t[6],"value"),data:he(t[7]),accessList:Wo(t[8],"accessList")};return 9===t.length||Lo(r,t.slice(9)),r}(t));case 3:return Fo.from(function(e){let t=bo(ae(e).slice(1)),r="3",n=null;if(4===t.length&&Array.isArray(t[0])){r="3 (network format)";const e=t[1],o=t[2],s=t[3];te(Array.isArray(e),"invalid network format: blobs not an array","fields[1]",e),te(Array.isArray(o),"invalid network format: commitments not an array","fields[2]",o),te(Array.isArray(s),"invalid network format: proofs not an array","fields[3]",s),te(e.length===o.length,"invalid network format: blobs/commitments length mismatch","fields",t),te(e.length===s.length,"invalid network format: blobs/proofs length mismatch","fields",t),n=[];for(let r=0;r<t[1].length;r++)n.push({data:e[r],commitment:o[r],proof:s[r]});t=t[0]}te(Array.isArray(t)&&(11===t.length||14===t.length),`invalid field count for transaction type: ${r}`,"data",he(e));const o={type:3,chainId:Ro(t[0],"chainId"),nonce:jo(t[1],"nonce"),maxPriorityFeePerGas:Ro(t[2],"maxPriorityFeePerGas"),maxFeePerGas:Ro(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:Ro(t[4],"gasLimit"),to:Mo(t[5]),value:Ro(t[6],"value"),data:he(t[7]),accessList:Wo(t[8],"accessList"),maxFeePerBlobGas:Ro(t[9],"maxFeePerBlobGas"),blobVersionedHashes:t[10]};n&&(o.blobs=n),te(null!=o.to,`invalid address for transaction type: ${r}`,"data",e),te(Array.isArray(o.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",e);for(let t=0;t<o.blobVersionedHashes.length;t++)te(le(o.blobVersionedHashes[t],32),`invalid blobVersionedHash at index ${t}: must be length 32`,"data",e);return 11===t.length||Lo(o,t.slice(11)),o}(t))}ee(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const t=new Fo;return null!=e.type&&(t.type=e.type),null!=e.to&&(t.to=e.to),null!=e.nonce&&(t.nonce=e.nonce),null!=e.gasLimit&&(t.gasLimit=e.gasLimit),null!=e.gasPrice&&(t.gasPrice=e.gasPrice),null!=e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas),null!=e.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null!=e.maxFeePerBlobGas&&(t.maxFeePerBlobGas=e.maxFeePerBlobGas),null!=e.data&&(t.data=e.data),null!=e.value&&(t.value=e.value),null!=e.chainId&&(t.chainId=e.chainId),null!=e.signature&&(t.signature=De.from(e.signature)),null!=e.accessList&&(t.accessList=e.accessList),null!=e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes),null!=e.kzg&&(t.kzg=e.kzg),null!=e.blobs&&(t.blobs=e.blobs),null!=e.hash&&(te(t.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),te(t.hash===e.hash,"hash mismatch","tx",e)),null!=e.from&&(te(t.isSigned(),"unsigned transaction cannot define '.from'","tx",e),te(t.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),t}}BigInt(0);function zo(e){const t={};e.to&&(t.to=e.to),e.from&&(t.from=e.from),e.data&&(t.data=he(e.data));const r="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const n of r)n in e&&null!=e[n]&&(t[n]=Pe(e[n],`request.${n}`));const n="type,nonce".split(/,/);for(const r of n)r in e&&null!=e[r]&&(t[r]=_e(e[r],`request.${r}`));return e.accessList&&(t.accessList=Eo(e.accessList)),"blockTag"in e&&(t.blockTag=e.blockTag),"enableCcipRead"in e&&(t.enableCcipRead=!!e.enableCcipRead),"customData"in e&&(t.customData=e.customData),"blobVersionedHashes"in e&&e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes.slice()),"kzg"in e&&(t.kzg=e.kzg),"blobs"in e&&e.blobs&&(t.blobs=e.blobs.map((e=>ue(e)?he(e):Object.assign({},e)))),t}Symbol.iterator;Symbol.iterator;function Vo(e,t){if(e.provider)return e.provider;ee(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:t})}async function qo(e,t){let r=zo(t);
1766if(null!=r.to&&(r.to=ho(r.to,e)),null!=r.from){const t=r.from;r.from=Promise.all([e.getAddress(),ho(t,e)]).then((([e,t])=>(te(e.toLowerCase()===t.toLowerCase(),"transaction from mismatch","tx.from",t),e)))}else r.from=e.getAddress();return await Y(r)}class Ho{provider;constructor(e){J(this,{provider:e||null})}async getNonce(e){return Vo(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await qo(this,e)}async populateTransaction(e){const t=Vo(this,"populateTransaction"),r=await qo(this,e);null==r.nonce&&(r.nonce=await this.getNonce("pending")),null==r.gasLimit&&(r.gasLimit=await this.estimateGas(r));const n=await this.provider.getNetwork();if(null!=r.chainId){te(Pe(r.chainId)===n.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else r.chainId=n.chainId;const o=null!=r.maxFeePerGas||null!=r.maxPriorityFeePerGas;if(null==r.gasPrice||2!==r.type&&!o?0!==r.type&&1!==r.type||!o||te(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e):te(!1,"eip-1559 transaction do not support gasPrice","tx",e),2!==r.type&&null!=r.type||null==r.maxFeePerGas||null==r.maxPriorityFeePerGas)if(0===r.type||1===r.type){const e=await t.getFeeData();ee(null!=e.gasPrice,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),null==r.gasPrice&&(r.gasPrice=e.gasPrice)}else{const e=await t.getFeeData();if(null==r.type)if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)if(r.type=2,null!=r.gasPrice){const e=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=e,r.maxPriorityFeePerGas=e}else null==r.maxFeePerGas&&(r.maxFeePerGas=e.maxFeePerGas),null==r.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=e.maxPriorityFeePerGas);else null!=e.gasPrice?(ee(!o,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),null==r.gasPrice&&(r.gasPrice=e.gasPrice),r.type=0):ee(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else 2!==r.type&&3!==r.type||(null==r.maxFeePerGas&&(r.maxFeePerGas=e.maxFeePerGas),null==r.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else r.type=2;return await Y(r)}async estimateGas(e){return Vo(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return Vo(this,"call").call(await this.populateCall(e))}async resolveName(e){const t=Vo(this,"resolveName");return await t.resolveName(e)}async sendTransaction(e){const t=Vo(this,"sendTransaction"),r=await this.populateTransaction(e);delete r.from;const n=Fo.from(r);return await t.broadcastTransaction(await this.signTransaction(n))}}class Ko extends Ho{address;constructor(e,t){super(t),J(this,{address:e})}async getAddress(){return this.address}connect(e){return new Ko(this.address,e)}#D(e,t){ee(!1,`VoidSigner cannot sign ${e}`,"UNSUPPORTED_OPERATION",{operation:t})}async signTransaction(e){this.#D("transactions","signTransaction")}async signMessage(e){this.#D("messages","signMessage")}async signTypedData(e,t,r){this.#D("typed-data","signTypedData")}}const $o="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";let Go=null;function Yo(e){if(null==Go){Go={};for(let e=0;e<58;e++)Go[$o[e]]=BigInt(e)}const t=Go[e];return te(null!=t,"invalid base58 value","letter",e),t}const Jo=BigInt(0),Qo=BigInt(58);function Zo(e){return"string"==typeof e&&(e=ct(e)),ft(pe([ct("�Ethereum Signed Message:\n"),ct(String(e.length)),e]))}const Xo=new Uint8Array(32);Xo.fill(0);const es=BigInt(-1),ts=BigInt(0),rs=BigInt(1),ns=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const os=Ie(rs,32),ss=Ie(ts,32),is={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},as=["name","version","chainId","verifyingContract","salt"];function cs(e){return function(t){return te("string"==typeof t,`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const ls={name:cs("name"),version:cs("version"),chainId:function(e){const t=Pe(e,"domain.chainId");return te(t>=0,"invalid chain ID","domain.chainId",e),Number.isSafeInteger(t)?Number(t):xe(t)},verifyingContract:function(e){try{return Dt(e).toLowerCase()}catch(e){}te(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){const t=ae(e,"domain.salt");return te(32===t.length,'invalid domain value "salt"',"domain.salt",e),he(t)}};function us(e){{const t=e.match(/^(u?)int(\d+)$/);if(t){const r=""===t[1],n=parseInt(t[2]);
1766te(n%8==0&&0!==n&&n<=256&&t[2]===String(n),"invalid numeric width","type",e);const o=Te(ns,r?n-1:n),s=r?(o+rs)*es:ts;return function(t){const n=Pe(t,"value");return te(n>=s&&n<=o,`value out-of-bounds for ${e}`,"value",n),Ie(r?Ae(n,256):n,32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return te(0!==r&&r<=32&&t[1]===String(r),"invalid bytes width","type",e),function(t){return te(ae(t).length===r,`invalid length for ${e}`,"value",t),function(e){const t=ae(e),r=t.length%32;return r?pe([t,Xo.slice(r)]):he(t)}(t)}}}switch(e){case"address":return function(e){return ye(Dt(e),32)};case"bool":return function(e){return e?os:ss};case"bytes":return function(e){return ft(e)};case"string":return function(e){return gt(e)}}return null}function ds(e,t){return`${e}(${t.map((({name:e,type:t})=>t+" "+e)).join(",")})`}function hs(e){const t=e.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return t?{base:t[1],index:t[2]+t[4],array:{base:t[1],prefix:t[1]+t[2],count:t[5]?parseInt(t[5]):-1}}:{base:e}}class ps{primaryType;#L;get types(){return JSON.parse(this.#L)}#F;#z;constructor(e){this.#F=new Map,this.#z=new Map;const t=new Map,r=new Map,n=new Map,o={};Object.keys(e).forEach((s=>{o[s]=e[s].map((({name:t,type:r})=>{let{base:n,index:o}=hs(r);return"int"!==n||e.int||(n="int256"),"uint"!==n||e.uint||(n="uint256"),{name:t,type:n+(o||"")}})),t.set(s,new Set),r.set(s,[]),n.set(s,new Set)})),this.#L=JSON.stringify(o);for(const n in o){const s=new Set;for(const i of o[n]){te(!s.has(i.name),`duplicate variable name ${JSON.stringify(i.name)} in ${JSON.stringify(n)}`,"types",e),s.add(i.name);const o=hs(i.type).base;te(o!==n,`circular type reference to ${JSON.stringify(o)}`,"types",e);us(o)||(te(r.has(o),`unknown type ${JSON.stringify(o)}`,"types",e),r.get(o).push(n),t.get(n).add(o))}}const s=Array.from(r.keys()).filter((e=>0===r.get(e).length));te(0!==s.length,"missing primary type","types",e),te(1===s.length,`ambiguous primary types or unused types: ${s.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),J(this,{primaryType:s[0]}),function o(s,i){te(!i.has(s),`circular type reference to ${JSON.stringify(s)}`,"types",e),i.add(s);for(const e of t.get(s))if(r.has(e)){o(e,i);for(const t of i)n.get(t).add(e)}i.delete(s)}(this.primaryType,new Set);for(const[e,t]of n){const r=Array.from(t);r.sort(),this.#F.set(e,ds(e,o[e])+r.map((e=>ds(e,o[e]))).join(""))}}getEncoder(e){let t=this.#z.get(e);return t||(t=this.#V(e),this.#z.set(e,t)),t}#V(e){{const t=us(e);if(t)return t}const t=hs(e).array;
1766if(t){const e=t.prefix,r=this.getEncoder(e);return n=>{te(-1===t.count||t.count===n.length,`array length mismatch; expected length ${t.count}`,"value",n);let o=n.map(r);return this.#F.has(e)&&(o=o.map(ft)),ft(pe(o))}}const r=this.types[e];if(r){const t=gt(this.#F.get(e));return e=>{const n=r.map((({name:t,type:r})=>{const n=this.getEncoder(r)(e[t]);return this.#F.has(r)?ft(n):n}));return n.unshift(t),pe(n)}}te(!1,`unknown type: ${e}`,"type",e)}encodeType(e){const t=this.#F.get(e);return te(t,`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return ft(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){if(us(e))return r(e,t);const n=hs(e).array;if(n)return te(-1===n.count||n.count===t.length,`array length mismatch; expected length ${n.count}`,"value",t),t.map((e=>this._visit(n.prefix,e,r)));const o=this.types[e];if(o)return o.reduce(((e,{name:n,type:o})=>(e[n]=this._visit(o,t[n],r),e)),{});te(!1,`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new ps(e)}static getPrimaryType(e){return ps.from(e).primaryType}static hashStruct(e,t,r){return ps.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){if(null==e[r])continue;const n=is[r];te(n,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:n})}return t.sort(((e,t)=>as.indexOf(e.name)-as.indexOf(t.name))),ps.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return pe(["0x1901",ps.hashDomain(e),ps.from(t).hash(r)])}static hash(e,t,r){return ft(ps.encode(e,t,r))}static async resolveNames(e,t,r,n){e=Object.assign({},e);for(const t in e)null==e[t]&&delete e[t];const o={};e.verifyingContract&&!le(e.verifyingContract,20)&&(o[e.verifyingContract]="0x");const s=ps.from(t);s.visit(r,((e,t)=>("address"!==e||le(t,20)||(o[t]="0x"),t)));for(const e in o)o[e]=await n(e);return e.verifyingContract&&o[e.verifyingContract]&&(e.verifyingContract=o[e.verifyingContract]),{domain:e,value:r=s.visit(r,((e,t)=>"address"===e&&o[t]?o[t]:t))}}static getPayload(e,t,r){ps.hashDomain(e);const n={},o=[];as.forEach((t=>{const r=e[t];null!=r&&(n[t]=ls[t](r),o.push({name:t,type:is[t]}))}));const s=ps.from(t);t=s.types;const i=Object.assign({},t);return te(null==i.EIP712Domain,"types must not contain EIP712Domain type","types.EIP712Domain",t),i.EIP712Domain=o,s.encode(r),{types:i,domain:n,primaryType:s.primaryType,message:s.visit(r,((e,t)=>{if(e.match(/^bytes(\d*)/))return he(ae(t));if(e.match(/^u?int/))return Pe(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return te("string"==typeof t,"invalid string","value",t),t}te(!1,"unsupported type","type",e)}))}}}class fs extends Ho{address;#q;constructor(e,t){super(t),te(e&&"function"==typeof e.sign,"invalid private key","privateKey","[ REDACTED ]"),this.#q=e;J(this,{address:Vr(this.signingKey.publicKey)})}get signingKey(){return this.#q}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(e){return new fs(this.#q,e)}async signTransaction(e){e=zo(e);const{to:t,from:r}=await Y({to:e.to?ho(e.to,this.provider):void 0,from:e.from?ho(e.from,this.provider):void 0});null!=t&&(e.to=t),null!=r&&(e.from=r),null!=e.from&&(te(Dt(e.from)===this.address,"transaction from address mismatch","tx.from",e.from),delete e.from);const n=Fo.from(e);return n.signature=this.signingKey.sign(n.unsignedHash),n.serialized}async signMessage(e){return this.signMessageSync(e)}signMessageSync(e){return this.signingKey.sign(Zo(e)).serialized}async signTypedData(e,t,r){const n=await ps.resolveNames(e,t,r,(async e=>{ee(null!=this.provider,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:e}});const t=await this.provider.resolveName(e);return ee(null!=t,"unconfigured ENS name","UNCONFIGURED_NAME",{value:e}),t}));return this.signingKey.sign(ps.hash(n.domain,t,n.value)).serialized}}var gs,ms,ys,bs=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},ws=function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r};const vs={16:10,24:12,32:14},As=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],Ts=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,9
17660,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],Ps=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],Es=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,16733
176613503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],Cs=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],ks=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389
1766623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],_s=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],Is=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,
1766632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],Ss=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],xs=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,12974
176603050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],Bs=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,60
17667398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],Os=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],Ms=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,12
176601765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],Ws=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],js=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861
vendor: 9,286 bytes, line 1766
1766748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function Rs(e){const t=[];for(let r=0;r<e.length;r+=4)t.push(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3]);return t}class Ns{get key(){return bs(this,gs,"f").slice()}constructor(e){if(gs.set(this,void 0),ms.set(this,void 0),ys.set(this,void 0),!(this instanceof Ns))throw Error("AES must be instanitated with `new`");ws(this,gs,new Uint8Array(e),"f");const t=vs[this.key.length];if(null==t)throw new TypeError("invalid key size (must be 16, 24 or 32 bytes)");ws(this,ys,[],"f"),ws(this,ms,[],"f");for(let e=0;e<=t;e++)bs(this,ys,"f").push([0,0,0,0]),bs(this,ms,"f").push([0,0,0,0]);const r=4*(t+1),n=this.key.length/4,o=Rs(this.key);let s;for(let e=0;e<n;e++)s=e>>2,bs(this,ys,"f")[s][e%4]=o[e],bs(this,ms,"f")[t-s][e%4]=o[e];let i,a=0,c=n;for(;c<r;){if(i=o[n-1],o[0]^=Ts[i>>16&255]<<24^Ts[i>>8&255]<<16^Ts[255&i]<<8^Ts[i>>24&255]^As[a]<<24,a+=1,8!=n)for(let e=1;e<n;e++)o[e]^=o[e-1];else{for(let e=1;e<n/2;e++)o[e]^=o[e-1];i=o[n/2-1],o[n/2]^=Ts[255&i]^Ts[i>>8&255]<<8^Ts[i>>16&255]<<16^Ts[i>>24&255]<<24;for(let e=n/2+1;e<n;e++)o[e]^=o[e-1]}let e,s,l=0;for(;l<n&&c<r;)e=c>>2,s=c%4,bs(this,ys,"f")[e][s]=o[l],bs(this,ms,"f")[t-e][s]=o[l++],c++}for(let e=1;e<t;e++)for(let t=0;t<4;t++)i=bs(this,ms,"f")[e][t],bs(this,ms,"f")[e][t]=Os[i>>24&255]^Ms[i>>16&255]^Ws[i>>8&255]^js[255&i]}encrypt(e){if(16!=e.length)throw new TypeError("invalid plaintext size (must be 16 bytes)");const t=bs(this,ys,"f").length-1,r=[0,0,0,0];let n=Rs(e);for(let e=0;e<4;e++)n[e]^=bs(this,ys,"f")[0][e];for(let e=1;e<t;e++){for(let t=0;t<4;t++)r[t]=Es[n[t]>>24&255]^Cs[n[(t+1)%4]>>16&255]^ks[n[(t+2)%4]>>8&255]^_s[255&n[(t+3)%4]]^bs(this,ys,"f")[e][t];n=r.slice()}const o=new Uint8Array(16);let s=0;for(let e=0;e<4;e++)s=bs(this,ys,"f")[t][e],o[4*e]=255&(Ts[n[e]>>24&255]^s>>24),o[4*e+1]=255&(Ts[n[(e+1)%4]>>16&255]^s>>16),o[4*e+2]=255&(Ts[n[(e+2)%4]>>8&255]^s>>8),o[4*e+3]=255&(Ts[255&n[(e+3)%4]]^s);return o}decrypt(e){if(16!=e.length)throw new TypeError("invalid ciphertext size (must be 16 bytes)");const t=bs(this,ms,"f").length-1,r=[0,0,0,0];let n=Rs(e);for(let e=0;e<4;e++)n[e]^=bs(this,ms,"f")[0][e];for(let e=1;e<t;e++){for(let t=0;t<4;t++)r[t]=Is[n[t]>>24&255]^Ss[n[(t+3)%4]>>16&255]^xs[n[(t+2)%4]>>8&255]^Bs[255&n[(t+1)%4]]^bs(this,ms,"f")[e][t];n=r.slice()}const o=new Uint8Array(16);let s=0;for(let e=0;e<4;e++)s=bs(this,ms,"f")[t][e],o[4*e]=255&(Ps[n[e]>>24&255]^s>>24),o[4*e+1]=255&(Ps[n[(e+3)%4]>>16&255]^s>>16),o[4*e+2]=255&(Ps[n[(e+2)%4]>>8&255]^s>>8),o[4*e+3]=255&(Ps[255&n[(e+1)%4]]^s);return o}}gs=new WeakMap,ms=new WeakMap,ys=new WeakMap;class Us{constructor(e,t,r){if(r&&!(this instanceof r))throw new Error(`${e} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new Ns(t)},name:{enumerable:!0,value:e}})}}new WeakMap,new WeakMap;var Ds,Ls=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};new WeakMap,Ds=new WeakMap,new WeakSet;var Fs,zs,Vs,qs=function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},Hs=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class Ks extends Us{constructor(e,t){super("CTR",e,Ks),Fs.set(this,void 0),zs.set(this,void 0),Vs.set(this,void 0),qs(this,Vs,new Uint8Array(16),"f"),Hs(this,Vs,"f").fill(0),qs(this,Fs,Hs(this,Vs,"f"),"f"),qs(this,zs,16,"f"),null==t&&(t=1),"number"==typeof t?this.setCounterValue(t):this.setCounterBytes(t)}get counter(){return new Uint8Array(Hs(this,Vs,"f"))}setCounterValue(e){if(!Number.isInteger(e)||e<0||e>Number.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let t=15;t>=0;--t)Hs(this,Vs,"f")[t]=e%256,e=Math.floor(e/256)}setCounterBytes(e){if(16!==e.length)throw new TypeError("invalid counter initial Uint8Array value length");Hs(this,Vs,"f").set(e)}increment(){for(let e=15;e>=0;e--){if(255!==Hs(this,Vs,"f")[e]){Hs(this,Vs,"f")[e]++;break}Hs(this,Vs,"f")[e]=0}}encrypt(e){var t,r;const n=new Uint8Array(e);for(let e=0;e<n.length;e++)16===Hs(this,zs,"f")&&(qs(this,Fs,this.aes.encrypt(Hs(this,Vs,"f")),"f"),qs(this,zs,0,"f"),this.increment()),n[e]^=Hs(this,Fs,"f")[(qs(this,zs,(r=Hs(this,zs,"f"),t=r++,r),"f"),t)];return n}decrypt(e){return this.encrypt(e)}}Fs=new WeakMap,zs=new WeakMap,Vs=new WeakMap;new WeakMap,new WeakMap,new WeakMap;var $s=r("./node_modules/@noble/hashes/esm/scrypt.js");let Gs=!1,Ys=!1;const Js=async function(e,t,r,n,o,s,i){return await(0,$s.Q)(e,t,{N:r,r:n,p:o,dkLen:s,onProgress:i})},Qs=function(e,t,r,n,o,s){return(0,$s.s)(e,t,{N:r,r:n,p:o,dkLen:s})};let Zs=Js,Xs=Qs;async function ei(e,t,r,n,o,s,i){const a=ae(e,"passwd"),c=ae(t,"salt");return he(await Zs(a,c,r,n,o,s,i))}function ti(e,t,r,n,o,s){const i=ae(e,"passwd"),a=ae(t,"salt");return he(Xs(i,a,r,n,o,s))}function ri(e){const t=ae(e,"randomBytes");t[6]=15&t[6]|64,t[8]=63&t[8]|128;const r=he(t);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}function ni(e,t){for(e=String(e);e.length<t;)e="0"+e;return e}function oi(e){return"string"==typeof e?ct(e,"NFKC"):ce(e)}ei._=Js,ei.lock=function(){Ys=!0},ei.register=function(e){if(Ys)throw new Error("scrypt is locked");Zs=e},Object.freeze(ei),ti._=Qs,ti.lock=function(){Gs=!0},ti.register=function(e){if(Gs)throw new Error("scryptSync is locked");Xs=e},Object.freeze(ti);const si="m/44'/60'/0'/0/0";function ii(e){const t=null!=e.salt?ae(e.salt,"options.salt"):lo(32);let r=1<<17,n=8,o=1;return e.scrypt&&(e.scrypt.N&&(r=e.scrypt.N),e.scrypt.r&&(n=e.scrypt.r),e.scrypt.p&&(o=e.scrypt.p)),te("number"==typeof r&&r>0&&Number.isSafeInteger(r)&&(BigInt(r)&BigInt(r-1))===BigInt(0),"invalid scrypt N parameter","options.N",r),te("number"==typeof n&&n>0&&Number.isSafeInteger(n),"invalid scrypt r parameter","options.r",n),te("number"==typeof o&&o>0&&Number.isSafeInteger(o),"invalid scrypt p parameter","options.p",o),{name:"scrypt",dkLen:32,salt:t,N:r,r:n,p:o}}function ai(e,t,r,n){const o=ae(r.privateKey,"privateKey"),s=null!=n.iv?ae(n.iv,"options.iv"):lo(16);te(16===s.length,"invalid options.iv length","options.iv",n.iv);const i=null!=n.uuid?ae(n.uuid,"options.uuid"):lo(16);te(16===i.length,"invalid options.uuid length","options.uuid",n.iv);
1766const a=e.slice(0,16),c=e.slice(16,32),l=ae(new Ks(a,s).encrypt(o)),u=ft(pe([c,l])),d={address:r.address.substring(2).toLowerCase(),id:ri(i),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:he(s).substring(2)},ciphertext:he(l).substring(2),kdf:"scrypt",kdfparams:{salt:he(t.salt).substring(2),n:t.N,dklen:32,p:t.p,r:t.r},mac:u.substring(2)}};if(r.mnemonic){const t=null!=n.client?n.client:`ethers/${$}`,o=r.mnemonic.path||si,s=r.mnemonic.locale||"en",i=e.slice(32,64),a=ae(r.mnemonic.entropy,"account.mnemonic.entropy"),c=lo(16),l=ae(new Ks(i,c).encrypt(a)),u=new Date,h="UTC--"+(u.getUTCFullYear()+"-"+ni(u.getUTCMonth()+1,2)+"-"+ni(u.getUTCDate(),2)+"T"+ni(u.getUTCHours(),2)+"-"+ni(u.getUTCMinutes(),2)+"-"+ni(u.getUTCSeconds(),2)+".0Z")+"--"+d.address;d["x-ethers"]={client:t,gethFilename:h,path:o,locale:s,mnemonicCounter:he(c).substring(2),mnemonicCiphertext:he(l).substring(2),version:"0.1"}}return JSON.stringify(d)}const ci="m/44'/60'/0'/0/0",li=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),ui=2147483648,di=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");function hi(e,t){let r="";for(;e;)r="0123456789abcdef"[e%16]+r,e=Math.trunc(e/16);for(;r.length<2*t;)r="0"+r;return"0x"+r}function pi(e){const t=ae(e);return function(e){const t=ae(e);let r=ke(t),n="";for(;r;)n=$o[Number(r%Qo)]+n,r/=Qo;for(let e=0;e<t.length&&!t[e];e++)n=$o[0]+n;return n}(pe([t,ge(Xe(Xe(t)),0,4)]))}const fi={};function gi(e,t,r,n){const o=new Uint8Array(37);e&ui?(ee(null!=n,"cannot derive child of neutered node","UNSUPPORTED_OPERATION",{operation:"deriveChild"}),o.set(ae(n),1)):o.set(ae(r));for(let t=24;t>=0;t-=8)o[33+(t>>3)]=e>>24-t&255;const s=ae(Ot("sha512",t,o));return{IL:s.slice(0,32),IR:s.slice(32)}}function mi(e,t){const r=t.split("/");te(r.length>0,"invalid path","path",t),"m"===r[0]&&(te(0===e.depth,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${e.depth}`,"path",t),r.shift());let n=e;for(let e=0;e<r.length;e++){const t=r[e];if(t.match(/^[0-9]+'$/)){const r=parseInt(t.substring(0,t.length-1));te(r<ui,"invalid path index",`path[${e}]`,t),n=n.deriveChild(ui+r)}else if(t.match(/^[0-9]+$/)){const r=parseInt(t);te(r<ui,"invalid path index",`path[${e}]`,t),n=n.deriveChild(r)}else te(!1,"invalid path component",`path[${e}]`,t)}return n}class yi extends fs{publicKey;fingerprint;parentFingerprint;mnemonic;chainCode;path;index;depth;constructor(e,t,r,n,o,s,i,a,c){super(t,c),se(e,fi,"HDNodeWallet"),J(this,{publicKey:t.compressedPublicKey});J(this,{parentFingerprint:r,fingerprint:ge(so(Xe(this.publicKey)),0,4),chainCode:n,path:o,index:s,depth:i}),J(this,{mnemonic:a})}connect(e){return new yi(fi,this.signingKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.mnemonic,e)}#H(){const e={address:this.address,privateKey:this.privateKey},t=this.mnemonic;return this.path&&t&&"en"===t.wordlist.locale&&""===t.password&&(e.mnemonic={path:this.path,locale:"en",entropy:t.entropy}),e}async encrypt(e,t){return await async function(e,t,r){null==r&&(r={});const n=oi(t),o=ii(r);return ai(ae(await ei(n,o.salt,o.N,o.r,o.p,64,r.progressCallback)),o,e,r)}(this.#H(),e,{progressCallback:t})}encryptSync(e){return function(e,t,r){null==r&&(r={});const n=oi(t),o=ii(r);return ai(ae(ti(n,o.salt,o.N,o.r,o.p,64)),o,e,r)}(this.#H(),e)}get extendedKey(){return ee(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),pi(pe(["0x0488ADE4",hi(this.depth,1),this.parentFingerprint,hi(this.index,4),this.chainCode,pe(["0x00",this.privateKey])]))}hasPath(){return null!=this.path}neuter(){return new bi(fi,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.provider)}deriveChild(e){const t=_e(e,"index");te(t<=4294967295,"invalid index","index",t);let r=this.path;r&&(r+="/"+(2147483647&t),t&ui&&(r+="'"));const{IR:n,IL:o}=gi(t,this.chainCode,this.publicKey,this.privateKey),s=new zr(Ie((ke(o)+BigInt(this.privateKey))%di,32));return new yi(fi,s,this.fingerprint,he(n),r,t,this.depth+1,this.mnemonic,this.provider)}derivePath(e){return mi(this,e)}static#K(e,t){te(ue(e),"invalid seed","seed","[REDACTED]");const r=ae(e,"seed");te(r.length>
1766=16&&r.length<=64,"invalid seed","seed","[REDACTED]");const n=ae(Ot("sha512",li,r)),o=new zr(he(n.slice(0,32)));return new yi(fi,o,"0x00000000",he(n.slice(32)),"m",0,0,t,null)}static fromExtendedKey(e){const t=Se(function(e){let t=Jo;for(let r=0;r<e.length;r++)t*=Qo,t+=Yo(e[r]);return t}(e));te(82===t.length||pi(t.slice(0,78))===e,"invalid extended key","extendedKey","[ REDACTED ]");const r=t[4],n=he(t.slice(5,9)),o=parseInt(he(t.slice(9,13)).substring(2),16),s=he(t.slice(13,45)),i=t.slice(45,78);switch(he(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":{const e=he(i);return new bi(fi,Vr(e),e,n,s,null,o,r,null)}case"0x0488ade4":case"0x04358394 ":if(0!==i[0])break;return new yi(fi,new zr(i.slice(1)),n,s,null,o,r,null,null)}te(!1,"invalid extended key prefix","extendedKey","[ REDACTED ]")}static createRandom(e,t,r){null==e&&(e=""),null==t&&(t=ci),null==r&&(r=Pt.wordlist());const n=It.fromEntropy(lo(16),e,r);return yi.#K(n.computeSeed(),n).derivePath(t)}static fromMnemonic(e,t){return t||(t=ci),yi.#K(e.computeSeed(),e).derivePath(t)}static fromPhrase(e,t,r,n){null==t&&(t=""),null==r&&(r=ci),null==n&&(n=Pt.wordlist());const o=It.fromPhrase(e,t,n);return yi.#K(o.computeSeed(),o).derivePath(r)}static fromSeed(e){return yi.#K(e,null)}}class bi extends Ko{publicKey;fingerprint;parentFingerprint;chainCode;path;index;depth;constructor(e,t,r,n,o,s,i,a,c){super(t,c),se(e,fi,"HDNodeVoidWallet"),J(this,{publicKey:r});J(this,{publicKey:r,fingerprint:ge(so(Xe(r)),0,4),parentFingerprint:n,chainCode:o,path:s,index:i,depth:a})}connect(e){return new bi(fi,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,e)}get extendedKey(){return ee(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),pi(pe(["0x0488B21E",hi(this.depth,1),this.parentFingerprint,hi(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return null!=this.path}deriveChild(e){const t=_e(e,"index");te(t<=4294967295,"invalid index","index",t);let r=this.path;r&&(r+="/"+(2147483647&t),t&ui&&(r+="'"));const{IR:n,IL:o}=gi(t,this.chainCode,this.publicKey,null),s=zr.addPoints(o,this.publicKey,!0),i=Vr(s);return new bi(fi,i,s,this.fingerprint,he(n),r,t,this.depth+1,this.provider)}derivePath(e){return mi(this,e)}}const wi={en:Pt.wordlist()};var vi;function Ai(e){const t=new Set;return e.forEach((e=>t.add(e))),Object.freeze(t)}const Ti="constant external internal payable private public pure view",Pi=Ai(Ti.split(" ")),Ei="constructor error event fallback function receive struct",Ci=Ai(Ei.split(" ")),ki="calldata memory storage payable indexed",_i=Ai(ki.split(" ")),Ii=Ai([Ei,ki,"tuple returns",Ti].join(" ").split(" ")),Si={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},xi=new RegExp("^(\\s*)"),Bi=new RegExp("^([0-9]+)"),Oi=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),Mi=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),Wi=new RegExp("^(trcToken|address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");class ji{#h;#w;get offset(){return this.#h}get length(){return this.#w.length-this.#h}constructor(e){this.#h=0,this.#w=e.slice()}clone(){return new vi(this.#w)}reset(){this.#h=0}#v(e=0,t=0){return new vi(this.#w.slice(e,t).map((t=>Object.freeze(Object.assign({},t,{match:t.match-e,linkBack:t.linkBack-e,linkNext:t.linkNext-e})))))}popKeyword(e){const t=this.peek();if("KEYWORD"!==t.type||!e.has(t.text))throw new Error(`expected keyword ${t.text}`);return this.pop().text}popType(e){if(this.peek().type!==e)throw new Error(`expected ${e}; got ${JSON.stringify(this.peek())}`);return this.pop().text}popParen(){const e=this.peek();if("OPEN_PAREN"!==e.type)throw new Error("bad start");const t=this.#v(this.#h+1,e.match+1);return this.#h=e.match+1,t}popParams(){const e=this.peek();if("OPEN_PAREN"!==e.type)throw new Error("bad start");const t=[];for(;this.#h<e.match-1;){const e=this.peek().linkNext;t.push(this.#v(this.#h+1,e)),this.#h=e}return this.#h=e.match+1,t}peek(){if(this.#h>=this.#w.length)throw new Error("out-of-bounds");return this.#w[this.#h]}peekKeyword(e){const t=this.peekType("KEYWORD");return null!=t&&e.has(t)?t:null}peekType(e){if(0===this.length)return null;const t=this.peek();return t.type===e?t.text:null}pop(){const e=this.peek();return this.#h++,e}toString(){const e=[];for(let t=this.#h;t<this.#w.length;t++){const r=this.#w[t];e.push(`${r.type}:${r.text}`)}return`<TokenString ${e.join(" ")}>`}}function Ri(e){const t=[],r=t=>{const r=s<e.length?JSON.stringify(e[s]):"$EOI";throw new Error(`invalid token ${r} at ${s}: ${t}`)},n=[],o=[];let s=0;for(;s<e.length;){let i=e.substring(s),a=i.match(xi);a&&(s+=a[1].length,i=e.substring(s));const c={depth:n.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:s,value:-1};t.push(c);const l=Si[i[0]]||"";if(l){if(c.type=l,c.text=i[0],s++,"OPEN_PAREN"===l)n.push(t.length-1),o.push(t.length-1);else if("CLOSE_PAREN"==l)0===n.length&&r("no matching open bracket"),c.match=n.pop(),t[c.match].match=t.length-1,c.depth--,c.linkBack=o.pop(),t[c.linkBack].linkNext=t.length-1;else if("COMMA"===l)c.linkBack=o.pop(),t[c.linkBack].linkNext=t.length-1,o.push(t.length-1);else if("OPEN_BRACKET"===l)c.type="BRACKET";else if("CLOSE_BRACKET"===l){let e=t.pop().text;if(t.length>0&&"NUMBER"===t[t.length-1].type){const r=t.pop().text;e=r+e,t[t.length-1].value=_e(r)}if(0===t.length||"BRACKET"!==t[t.length-1].type)throw new Error("missing opening bracket");t[t.length-1].text+=e}}else if(a=i.match(Oi),a){if(c.text=a[1],s+=c.text.length,Ii.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(Wi)){c.type="TYPE";continue}c.type="ID"}else{if(a=i.match(Bi),!a)throw new Error(`unexpected token ${JSON.stringify(i[0])} at position ${s}`);c.text=a[1],c.type="NUMBER",s+=c.text.length}}return new ji(t.map((e=>Object.freeze(e))))}function Ni(e,t){const r=[];for(const n in t.keys())e.has(n)&&r.push(n);if(r.length>1)throw new Error(`conflicting types: ${r.join(", ")}`)}function Ui(e,t){if(t.peekKeyword(Ci)){const r=t.pop().text;if(r!==e)throw new Error(`expected ${e}, got ${r}`)}return t.popType("ID")}function Di(e,t){const r=new Set;for(;;){const n=e.peekType("KEYWORD");if(null==n||t&&!t.has(n))break;if(e.pop(),r.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);r.add(n)}return Object.freeze(r)}function Li(e){const t=Di(e,Pi);return Ni(t,Ai("constant payable nonpayable".split(" "))),Ni(t,Ai("pure view payable nonpayable".split(" "))),t.has("view")?"view":t.has("pure")?"pure":t.has("payable")?"payable":t.has("nonpayable")?"nonpayable":t.has("constant")?"view":"nonpayable"}function Fi(e,t){return e.popParams().map((e=>ta.from(e,t)))}
1766function zi(e){if(e.peekType("AT")){if(e.pop(),e.peekType("NUMBER"))return Pe(e.pop().text);throw new Error("invalid gas")}return null}function Vi(e){if(e.length)throw new Error(`unexpected tokens: ${e.toString()}`)}vi=ji;const qi=new RegExp(/^(.*)\[([0-9]*)\]$/);function Hi(e){const t=e.match(Wi);if(te(t,"invalid type","type",e),"uint"===e)return"uint256";if("int"===e)return"int256";if(t[2]){const r=parseInt(t[2]);te(0!==r&&r<=32,"invalid bytes length","type",e)}else if(t[3]){const r=parseInt(t[3]);te(0!==r&&r<=256&&r%8==0,"invalid numeric width","type",e)}return e}const Ki={},$i=Symbol.for("_ethers_internal"),Gi="_ParamTypeInternal",Yi="_ErrorInternal",Ji="_EventInternal",Qi="_ConstructorInternal",Zi="_FallbackInternal",Xi="_FunctionInternal",ea="_StructInternal";class ta{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(e,t,r,n,o,s,i,a){if(se(e,Ki,"ParamType"),Object.defineProperty(this,$i,{value:Gi}),s&&(s=Object.freeze(s.slice())),"array"===n){if(null==i||null==a)throw new Error("")}else if(null!=i||null!=a)throw new Error("");if("tuple"===n){if(null==s)throw new Error("")}else if(null!=s)throw new Error("");J(this,{name:t,type:r,baseType:n,indexed:o,components:s,arrayLength:i,arrayChildren:a})}format(e){if(null==e&&(e="sighash"),"json"===e){const t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.isTuple()&&(t.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return this.isArray()?(t+=this.arrayChildren.format(e),t+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?("sighash"!==e&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join("full"===e?", ":",")+")"):t+=this.type,"sighash"!==e&&(!0===this.indexed&&(t+=" indexed"),"full"===e&&this.name&&(t+=" "+this.name)),t}isArray(){return"array"===this.baseType}isTuple(){return"tuple"===this.baseType}isIndexable(){return null!=this.indexed}walk(e,t){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(-1!==this.arrayLength&&e.length!==this.arrayLength)throw new Error("array is wrong length");return e.map((e=>this.arrayChildren?.walk(e,t)))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");return e.map(((e,r)=>this.components?.[r].walk(e,t)))}return t(this.type,e)}#A(e,t,r,n){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(-1!==this.arrayLength&&t.length!==this.arrayLength)throw new Error("array is wrong length");const o=this.arrayChildren,s=t.slice();return s.forEach(((t,n)=>{o.#A(e,t,r,(e=>{s[n]=e}))})),void n(s)}if(this.isTuple()){const o=this.components;let s;if(Array.isArray(t))s=t.slice();else{if(null==t||"object"!=typeof t)throw new Error("invalid tuple value");s=o.map((e=>{if(!e.name)throw new Error("cannot use object value with unnamed components");if(!(e.name in t))throw new Error(`missing value for component ${e.name}`);return t[e.name]}))}if(s.length!==this.components.length)throw new Error("array is wrong length");return s.forEach(((t,n)=>{o[n].#A(e,t,r,(e=>{s[n]=e}))})),void n(s)}const o=r(this.type,t);o.then?e.push(async function(){n(await o)}()):n(o)}async walkAsync(e,t){const r=[],n=[e];return this.#A(r,e,t,(e=>{n[0]=e})),r.length&&await Promise.all(r),n[0]}static from(e,t){if(ta.isParamType(e))return e;if("string"==typeof e)return ta.from(Ri(e),t);if(e instanceof ji){let r="",n="",o=null;Di(e,Ai(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(n="tuple",o=e.popParams().map((e=>ta.from(e))),r=`tuple(${o.map((e=>e.format())).join(",")})`):(r=Hi(e.popType("TYPE")),n=r);let s=null,i=null;for(;e.length&&e.peekType("BRACKET");){const t=e.pop();s=new ta(Ki,"",r,n,null,o,i,s),i=t.value,r+=t.text,n="array",o=null}let a=null;if(Di(e,_i).has("indexed")){if(!t)throw new Error("");a=!0}const c=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new ta(Ki,c,r,n,a,o,i,s)}const r=e.name;te(!r||"string"==typeof r&&r.match(Mi),"invalid name","obj.name",r);let n=e.indexed;null!=n&&(te(t,"parameter cannot be indexed","obj.indexed",e.indexed),n=!!n);let o=e.type;const s=o.match(qi);if(s){const t=parseInt(s[2]||"-1"),i=ta.from({type:s[1],components:e.components});return new ta(Ki,r||"",o,"array",n,null,t,i)}if("tuple"===o||o.startsWith("tuple(")||o.startsWith("(")){const t=null!=e.components?e.components.map((e=>ta.from(e))):null;return new ta(Ki,r||"",o,"tuple",n,t,null,null)}return o=Hi(e.type),new ta(Ki,r||"",o,o,n,null,null,null)}static isParamType(e){return e&&e[$i]===Gi}}class ra{type;inputs;constructor(e,t,r){se(e,Ki,"Fragment"),J(this,{type:t,inputs:r=Object.freeze(r.slice())})}static from(e){if("string"==typeof e){try{ra.from(JSON.parse(e))}catch(e){}return ra.from(Ri(e))}if(e instanceof ji){switch(e.peekKeyword(Ci)){case"constructor":return aa.from(e);case"error":return sa.from(e);case"event":return ia.from(e);case"fallback":case"receive":return ca.from(e);case"function":return la.from(e);case"struct":return ua.from(e)}}else if("object"==typeof e){switch(e.type){case"constructor":return aa.from(e);case"error":return sa.from(e);case"event":return ia.from(e);case"fallback":case"receive":return ca.from(e);case"function":return la.from(e);case"struct":return ua.from(e)}ee(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}te(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return aa.isFragment(e)}static isError(e){return sa.isFragment(e)}static isEvent(e){return ia.isFragment(e)}static isFunction(e){return la.isFragment(e)}static isStruct(e){return ua.isFragment(e)}}class na extends ra{name;constructor(e,t,r,n){super(e,t,n),te("string"==typeof r&&r.match(Mi),"invalid identifier","name",r),n=Object.freeze(n.slice()),J(this,{name:r})}}function oa(e,t){return"("+t.map((t=>t.format(e))).join("full"===e?", ":",")+")"}class sa extends na{constructor(e,t,r){super(e,"error",t,r),Object.defineProperty(this,$i,{value:Yi})}get selector(){return gt(this.format("sighash")).substring(0,10)}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});const t=[];
1766return"sighash"!==e&&t.push("error"),t.push(this.name+oa(e,this.inputs)),t.join(" ")}static from(e){if(sa.isFragment(e))return e;if("string"==typeof e)return sa.from(Ri(e));if(e instanceof ji){const t=Ui("error",e),r=Fi(e);return Vi(e),new sa(Ki,t,r)}return new sa(Ki,e.name,e.inputs?e.inputs.map(ta.from):[])}static isFragment(e){return e&&e[$i]===Yi}}class ia extends na{anonymous;constructor(e,t,r,n){super(e,"event",t,r),Object.defineProperty(this,$i,{value:Ji}),J(this,{anonymous:n})}get topicHash(){return gt(this.format("sighash"))}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});const t=[];return"sighash"!==e&&t.push("event"),t.push(this.name+oa(e,this.inputs)),"sighash"!==e&&this.anonymous&&t.push("anonymous"),t.join(" ")}static getTopicHash(e,t){t=(t||[]).map((e=>ta.from(e)));return new ia(Ki,e,t,!1).topicHash}static from(e){if(ia.isFragment(e))return e;if("string"==typeof e)return ia.from(Ri(e));if(e instanceof ji){const t=Ui("event",e),r=Fi(e,!0),n=!!Di(e,Ai(["anonymous"])).has("anonymous");return Vi(e),new ia(Ki,t,r,n)}return new ia(Ki,e.name,e.inputs?e.inputs.map((e=>ta.from(e,!0))):[],!!e.anonymous)}static isFragment(e){return e&&e[$i]===Ji}}class aa extends ra{payable;gas;constructor(e,t,r,n,o){super(e,t,r),Object.defineProperty(this,$i,{value:Qi}),J(this,{payable:n,gas:o})}format(e){if(ee(null!=e&&"sighash"!==e,"cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),"json"===e)return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});const t=[`constructor${oa(e,this.inputs)}`];return t.push(this.payable?"payable":"nonpayable"),null!=this.gas&&t.push(`@${this.gas.toString()}`),t.join(" ")}static from(e){if(aa.isFragment(e))return e;if("string"==typeof e)return aa.from(Ri(e));if(e instanceof ji){Di(e,Ai(["constructor"]));const t=Fi(e),r=!!Di(e,Ai(["payable"])).has("payable"),n=zi(e);return Vi(e),new aa(Ki,"constructor",t,r,n)}return new aa(Ki,"constructor",e.inputs?e.inputs.map(ta.from):[],!!e.payable,null!=e.gas?e.gas:null)}static isFragment(e){return e&&e[$i]===Qi}}class ca extends ra{payable;constructor(e,t,r){super(e,"fallback",t),Object.defineProperty(this,$i,{value:Zi}),J(this,{payable:r})}format(e){const t=0===this.inputs.length?"receive":"fallback";if("json"===e){const e=this.payable?"payable":"nonpayable";return JSON.stringify({type:t,stateMutability:e})}return`${t}()${this.payable?" payable":""}`}static from(e){if(ca.isFragment(e))return e;if("string"==typeof e)return ca.from(Ri(e));if(e instanceof ji){const t=e.toString();te(e.peekKeyword(Ai(["fallback","receive"])),"type must be fallback or receive","obj",t);if("receive"===e.popKeyword(Ai(["fallback","receive"]))){const t=Fi(e);return te(0===t.length,"receive cannot have arguments","obj.inputs",t),Di(e,Ai(["payable"])),Vi(e),new ca(Ki,[],!0)}let r=Fi(e);r.length?te(1===r.length&&"bytes"===r[0].type,"invalid fallback inputs","obj.inputs",r.map((e=>e.format("minimal"))).join(", ")):r=[ta.from("bytes")];const n=Li(e);if(te("nonpayable"===n||"payable"===n,"fallback cannot be constants","obj.stateMutability",n),Di(e,Ai(["returns"])).has("returns")){const t=Fi(e);te(1===t.length&&"bytes"===t[0].type,"invalid fallback outputs","obj.outputs",t.map((e=>e.format("minimal"))).join(", "))}return Vi(e),new ca(Ki,r,"payable"===n)}if("receive"===e.type)return new ca(Ki,[],!0);if("fallback"===e.type){const t=[ta.from("bytes")],r="payable"===e.stateMutability;return new ca(Ki,t,r)}te(!1,"invalid fallback description","obj",e)}static isFragment(e){return e&&e[$i]===Zi}}class la extends na{constant;outputs;stateMutability;payable;gas;constructor(e,t,r,n,o,s){super(e,"function",t,n),Object.defineProperty(this,$i,{value:Xi});J(this,{constant:"view"===r||"pure"===r,gas:s,outputs:o=Object.freeze(o.slice()),payable:"payable"===r,stateMutability:r})}get selector(){return gt(this.format("sighash")).substring(0,10)}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});const t=[];return"sighash"!==e&&t.push("function"),t.push(this.name+oa(e,this.inputs)),"sighash"!==e&&("nonpayable"!==this.stateMutability&&t.push(this.stateMutability),this.outputs&&this.outputs.length&&(t.push("returns"),t.push(oa(e,this.outputs))),null!=this.gas&&t.push(`@${this.gas.toString()}`)),t.join(" ")}static getSelector(e,t){t=(t||[]).map((e=>ta.from(e)));return new la(Ki,e,"view",t,[],null).selector}static from(e){if(la.isFragment(e))return e;if("string"==typeof e)return la.from(Ri(e));if(e instanceof ji){const t=Ui("function",e),r=Fi(e),n=Li(e);let o=[];Di(e,Ai(["returns"])).has("returns")&&(o=Fi(e));const s=zi(e);return Vi(e),new la(Ki,t,n,r,o,s)}let t=e.stateMutability;return null==t&&(t="payable","boolean"==typeof e.constant?(t="view",e.constant||(t="payable","boolean"!=typeof e.payable||e.payable||(t="nonpayable"))):"boolean"!=typeof e.payable||e.payable||(t="nonpayable")),new la(Ki,e.name,t,e.inputs?e.inputs.map(ta.from):[],e.outputs?e.outputs.map(ta.from):[],null!=e.gas?e.gas:null)}static isFragment(e){return e&&e[$i]===Xi}}class ua extends na{constructor(e,t,r){super(e,"struct",t,r),Object.defineProperty(this,$i,{value:ea})}format(){throw new Error("@TODO")}static from(e){if("string"==typeof e)return ua.from(Ri(e));if(e instanceof ji){const t=Ui("struct",e),r=Fi(e);return Vi(e),new ua(Ki,t,r)}return new ua(Ki,e.name,e.inputs?e.inputs.map(ta.from):[])}static isFragment(e){return e&&e[$i]===ea}}class da{fragment;name;signature;topic;args;constructor(e,t,r){const n=e.name,o=e.format();J(this,{fragment:e,name:n,signature:o,topic:t,args:r})}}class ha{fragment;name;args;signature;selector;value;constructor(e,t,r,n){const o=e.name,s=e.format();J(this,{fragment:e,name:o,args:r,signature:s,selector:t,value:n})}}class pa{fragment;name;args;signature;selector;constructor(e,t,r){const n=e.name,o=e.format();J(this,{fragment:e,name:n,args:r,signature:o,selector:t})}}class fa{hash;_isIndexed;static isIndexed(e){return!(!e||!e._isIndexed)}constructor(e){J(this,{hash:e,_isIndexed:!0})}}const ga={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"}
1766,ma={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:e=>`reverted with reason string ${JSON.stringify(e)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:e=>{let t="unknown panic code";return e>=0&&e<=255&&ga[e.toString()]&&(t=ga[e.toString()]),`reverted with panic code 0x${e.toString(16)} (${t})`}}};class ya{fragments;deploy;fallback;receive;#$;#G;#Y;#J;constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,this.#Y=new Map,this.#$=new Map,this.#G=new Map;const r=[];for(const e of t)try{r.push(ra.from(e))}catch(e){console.log("EE",e)}J(this,{fragments:Object.freeze(r)});let n=null,o=!1;this.#J=this.getAbiCoder(),this.fragments.forEach(((e,t)=>{let r;switch(e.type){case"constructor":return this.deploy?void console.log("duplicate definition - constructor"):void J(this,{deploy:e});case"fallback":return void(0===e.inputs.length?o=!0:(te(!n||e.payable!==n.payable,"conflicting fallback fragments",`fragments[${t}]`,e),n=e,o=n.payable));case"function":r=this.#Y;break;case"event":r=this.#G;break;case"error":r=this.#$;break;default:return}const s=e.format();r.has(s)||r.set(s,e)})),this.deploy||J(this,{deploy:aa.from("constructor()")}),J(this,{fallback:n,receive:o})}format(e){const t=e?"minimal":"full";return this.fragments.map((e=>e.format(t)))}formatJson(){const e=this.fragments.map((e=>e.format("json")));return JSON.stringify(e.map((e=>JSON.parse(e))))}getAbiCoder(){return eo.defaultAbiCoder()}#Q(e,t,r){if(le(e)){const t=e.toLowerCase();for(const e of this.#Y.values())if(t===e.selector)return e;return null}if(-1===e.indexOf("(")){const n=[];for(const[t,r]of this.#Y)t.split("(")[0]===e&&n.push(r);if(t){const e=t.length>0?t[t.length-1]:null;let r=t.length,o=!0;un.isTyped(e)&&"overrides"===e.type&&(o=!1,r--);for(let e=n.length-1;e>=0;e--){const t=n[e].inputs.length;t===r||o&&t===r-1||n.splice(e,1)}for(let e=n.length-1;e>=0;e--){const r=n[e].inputs;for(let o=0;o<t.length;o++)if(un.isTyped(t[o])){if(o>=r.length){if("overrides"===t[o].type)continue;n.splice(e,1);break}if(t[o].type!==r[o].baseType){n.splice(e,1);break}}}}if(1===n.length&&t&&t.length!==n[0].inputs.length){const e=t[t.length-1];(null==e||Array.isArray(e)||"object"!=typeof e)&&n.splice(0,1)}if(0===n.length)return null;if(n.length>1&&r){te(!1,`ambiguous function description (i.e. matches ${n.map((e=>JSON.stringify(e.format()))).join(", ")})`,"key",e)}return n[0]}const n=this.#Y.get(la.from(e).format());return n||null}getFunctionName(e){const t=this.#Q(e,null,!1);return te(t,"no matching function","key",e),t.name}hasFunction(e){return!!this.#Q(e,null,!1)}getFunction(e,t){return this.#Q(e,t||null,!0)}forEachFunction(e){const t=Array.from(this.#Y.keys());t.sort(((e,t)=>e.localeCompare(t)));for(let r=0;r<t.length;r++){const n=t[r];e(this.#Y.get(n),r)}}#Z(e,t,r){if(le(e)){const t=e.toLowerCase();for(const e of this.#G.values())if(t===e.topicHash)return e;return null}if(-1===e.indexOf("(")){const n=[];for(const[t,r]of this.#G)t.split("(")[0]===e&&n.push(r);if(t){for(let e=n.length-1;e>=0;e--)n[e].inputs.length<t.length&&n.splice(e,1);for(let e=n.length-1;e>=0;e--){const r=n[e].inputs;for(let o=0;o<t.length;o++)if(un.isTyped(t[o])&&t[o].type!==r[o].baseType){n.splice(e,1);break}}}if(0===n.length)return null;if(n.length>1&&r){te(!1,`ambiguous event description (i.e. matches ${n.map((e=>JSON.stringify(e.format()))).join(", ")})`,"key",e)}return n[0]}const n=this.#G.get(ia.from(e).format());return n||null}getEventName(e){const t=this.#Z(e,null,!1);return te(t,"no matching event","key",e),t.name}hasEvent(e){return!!this.#Z(e,null,!1)}getEvent(e,t){return this.#Z(e,t||null,!0)}forEachEvent(e){const t=Array.from(this.#G.keys());t.sort(((e,t)=>e.localeCompare(t)));for(let r=0;r<t.length;r++){const n=t[r];e(this.#G.get(n),r)}}getError(e,t){if(le(e)){const t=e.toLowerCase();if(ma[t])return sa.from(ma[t].signature);for(const e of this.#$.values())if(t===e.selector)return e;return null}if(-1===e.indexOf("(")){const t=[];for(const[r,n]of this.#$)r.split("(")[0]===e&&t.push(n);if(0===t.length)return"Error"===e?sa.from("error Error(string)"):"Panic"===e?sa.from("error Panic(uint256)"):null;if(t.length>1){te(!1,`ambiguous error description (i.e. ${t.map((e=>JSON.stringify(e.format()))).join(", ")})`,"name",e)}return t[0]}if("Error(string)"===(e=sa.from(e).format()))return sa.from("error Error(string)");if("Panic(uint256)"===e)return sa.from("error Panic(uint256)");const r=this.#$.get(e);return r||null}forEachError(e){const t=Array.from(this.#$.keys());t.sort(((e,t)=>e.localeCompare(t)));for(let r=0;r<t.length;r++){const n=t[r];e(this.#$.get(n),r)}}_decodeParams(e,t){return this.#J.decode(e,t)}_encodeParams(e,t){return this.#J.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){if("string"==typeof e){const t=this.getError(e);te(t,"unknown error","fragment",e),e=t}return te(ge(t,0,4)===e.selector,`data signature does not match error ${e.name}.`,"data",t),this._decodeParams(e.inputs,ge(t,4))}encodeErrorResult(e,t){if("string"==typeof e){const t=this.getError(e);te(t,"unknown error","fragment",e),e=t}return pe([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionData(e,t){if("string"==typeof e){const t=this.getFunction(e);te(t,"unknown function","fragment",e),e=t}return te(ge(t,0,4)===e.selector,`data signature does not match function ${e.name}.`,"data",t),this._decodeParams(e.inputs,ge(t,4))}encodeFunctionData(e,t){if("string"==typeof e){const t=this.getFunction(e);te(t,"unknown function","fragment",e),e=t}return pe([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionResult(e,t){if("string"==typeof e){const t=this.getFunction(e);te(t,"unknown function","fragment",e),e=t}let r="invalid length for result data";const n=ce(t);if(n.length%32==0)try{return this.#J.decode(e.outputs,n)}catch(e){r="could not decode result data"}ee(!1,r,"BAD_DATA",{value:he(n),info:{method:e.name,signature:e.format()}})}makeError(e,t){const r=ae(e,"data"),n=eo.getBuiltinCallException("call",t,r);if(n.message.startsWith("execution reverted (unknown custom error)")){const e=he(r.slice(0,4)),t=this.getError(e);
1766if(t)try{const e=this.#J.decode(t.inputs,r.slice(4));n.revert={name:t.name,signature:t.format(),args:e},n.reason=n.revert.signature,n.message=`execution reverted: ${n.reason}`}catch(e){n.message="execution reverted (coult not decode custom error)"}}const o=this.parseTransaction(t);return o&&(n.invocation={method:o.name,signature:o.signature,args:o.args}),n}encodeFunctionResult(e,t){if("string"==typeof e){const t=this.getFunction(e);te(t,"unknown function","fragment",e),e=t}return he(this.#J.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){if("string"==typeof e){const t=this.getEvent(e);te(t,"unknown event","eventFragment",e),e=t}ee(t.length<=e.inputs.length,`too many arguments for ${e.format()}`,"UNEXPECTED_ARGUMENT",{count:t.length,expectedCount:e.inputs.length});const r=[];e.anonymous||r.push(e.topicHash);const n=(e,t)=>"string"===e.type?gt(t):"bytes"===e.type?ft(he(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=Ie(t)),"address"===e.type&&this.#J.encode(["address"],[t]),ye(he(t),32));for(t.forEach(((t,o)=>{const s=e.inputs[o];s.indexed?null==t?r.push(null):"array"===s.baseType||"tuple"===s.baseType?te(!1,"filtering with tuples or arrays not supported","contract."+s.name,t):Array.isArray(t)?r.push(t.map((e=>n(s,e)))):r.push(n(s,t)):te(null==t,"cannot filter non-indexed parameters; must be null","contract."+s.name,t)}));r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(e,t){if("string"==typeof e){const t=this.getEvent(e);te(t,"unknown event","eventFragment",e),e=t}const r=[],n=[],o=[];return e.anonymous||r.push(e.topicHash),te(t.length===e.inputs.length,"event arguments/values mismatch","values",t),e.inputs.forEach(((e,s)=>{const i=t[s];if(e.indexed)if("string"===e.type)r.push(gt(i));else if("bytes"===e.type)r.push(ft(i));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");r.push(this.#J.encode([e.type],[i]))}else n.push(e),o.push(i)})),{data:this.#J.encode(n,o),topics:r}}decodeEventLog(e,t,r){if("string"==typeof e){const t=this.getEvent(e);te(t,"unknown event","eventFragment",e),e=t}if(null!=r&&!e.anonymous){const t=e.topicHash;te(le(r[0],32)&&r[0].toLowerCase()===t,"fragment/topic mismatch","topics[0]",r[0]),r=r.slice(1)}const n=[],o=[],s=[];e.inputs.forEach(((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(n.push(ta.from({type:"bytes32",name:e.name})),s.push(!0)):(n.push(e),s.push(!1)):(o.push(e),s.push(!1))}));const i=null!=r?this.#J.decode(n,pe(r)):null,a=this.#J.decode(o,t,!0),c=[],l=[];let u=0,d=0;return e.inputs.forEach(((e,t)=>{let r=null;if(e.indexed)if(null==i)r=new fa(null);else if(s[t])r=new fa(i[d++]);else try{r=i[d++]}catch(e){r=e}else try{r=a[u++]}catch(e){r=e}c.push(r),l.push(e.name||null)})),en.fromItems(c,l)}parseTransaction(e){const t=ae(e.data,"tx.data"),r=Pe(null!=e.value?e.value:0,"tx.value"),n=this.getFunction(he(t.slice(0,4)));if(!n)return null;const o=this.#J.decode(n.inputs,t.slice(4));return new ha(n,n.selector,o,r)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new da(t,t.topicHash,this.decodeEventLog(t,e.data,e.topics))}parseError(e){const t=he(e),r=this.getError(ge(t,0,4));if(!r)return null;const n=this.#J.decode(r.inputs,ge(t,4));return new pa(r,r.selector,n)}static from(e){return e instanceof ya?e:"string"==typeof e?new ya(JSON.parse(e)):"function"==typeof e.format?new ya(e.format("json")):new ya(e)}}var ba=r("./node_modules/buffer/index.js").Buffer;const wa=e=>De.from(e),va=e=>De.from(e).serialized,Aa=e=>ae(e),Ta={sighash:"sighash",minimal:"minimal",full:"full",json:"json"},Pa=It.isValidMnemonic;Ot.register(((e,t,r)=>Ot._(e,ba.from(t),ba.from(r))));var Ea=r("./node_modules/ethereum-cryptography/node_modules/@noble/curves/esm/secp256k1.js"),Ca=r("./node_modules/buffer/index.js").Buffer;function ka(e){const t=Va(e);let r=Va(t).slice(0,4);return r=e.concat(r),q(r)}function _a(e){if("string"!=typeof e)return!1;if(e.length<=4)return!1;let t=H(e);if(t.length<=4)return!1;const r=t.length-4,n=t.slice(r);t=t.slice(0,r);const o=Va(t),s=Va(o).slice(0,4);if(n[0]===s[0]&&n[1]===s[1]&&n[2]===s[2]&&n[3]===s[3])return t;throw new Error("Invalid address provided")}function Ia(e,t){"string"==typeof e&&(e=U(e));const r=za(U(t.txID),e);return Array.isArray(t.signature)?t.signature.includes(r)||t.signature.push(r):t.signature=[r],t}function Sa(e,t){e="0x"+e.replace(/^0x/,""),t="0x"+t.replace(/^0x/,"");const r=qr(Aa(e),De.from(t));return I+r.substring(2)}function xa(e){return btoa(String.fromCharCode(...e))}function Ba(e,t){"string"==typeof e&&(e=U(e));return za(Va(t),e)}function Oa(e){const t=C(e),{Transaction:r}=globalThis.TronWebProto;return r.deserializeBinary(t).getRawData().serializeBinary()}function Ma(){let e=E(Ea.bI.utils.randomPrivateKey());return e=e.padStart(64,"0"),U(e)}function Wa(e){65===e.length&&(e=e.slice(1));const t=ft(new Uint8Array(e)).toString().substring(2);return U(I+t.substring(24))}function ja(e){return Wa(Fa(e))}function Ra(e){const t=H(e);if(t.length<=4)return!1;const r=t.slice(0,t.length-4),n=Va(r),o=Va(n);return o[0]===t[r.length]&&o[1]===t[r.length+1]&&o[2]===t[r.length+2]&&o[3]===t[r.length+3]&&r}function Na(e){if("string"!=typeof e)return!1;if(e.length!==_)return!1;let t=H(e);if(25!==t.length)return!1;if(t[0]!==S)return!1;const r=t.slice(21);t=t.slice(0,21);const n=Va(t),o=Va(n).slice(0,4);return r[0]==o[0]&&r[1]==o[1]&&r[2]==o[2]&&r[3]==o[3]}function Ua(e){return ka(Wa(Fa(C(e))))}function Da(e){return E(Wa(Fa(C(e))))}function La(e){return k(Wa(Fa(C(e))))}function Fa(e){const t=Ea.bI.ProjectivePoint.fromPrivateKey(new Uint8Array(function(e){return U(E(e).padStart(64,"0"))}(e))),r=t.x,n=t.y;return U(`04${r.toString(16).padStart(64,"0")}${n.toString(16).padStart(64,"0")}`)}function za(e,t){const r=Ea.bI.sign(E(e),E(t)),n=r.r.toString(16),o=r.s.toString(16),s=r.recovery+27;return n.padStart(64,"0")+o.padStart(64,"0")+A(s)}function Va(e){return U(Xe("0x"+E(e)).replace(/^0x/,""))}function qa(e){return ka(ja(C(e)))}function Ha(e,t=!1){return ka(ja(U(e,t)))}function Ka(e,t=!0){return(t?"0x":"")+ft(Ca.from(e,"utf-8")).toString().substring(2)}function $a(){const e=Ma(),t=Fa(e),r=ja(e);return{privateKey:E(e),publicKey:E(t),address:{base58:ka(r),hex:E(r)}}}function Ga(e="",t=O,r){const n=yi.createRandom(e,t,r);return{mnemonic:n.mnemonic,privateKey:n.privateKey,publicKey:n.signingKey.publicKey,address:Ha(n.privateKey.replace(/^0x/,"")),path:n.path}}function Ya(e,t=O,r="",n=null){if(!String(t).match(/^m\/44\'\/195\'/))throw new Error("Invalid tron path provided");const o=yi.fromMnemonic(It.fromPhrase(e,r,n),t);return{mnemonic:o.mnemonic,privateKey:o.privateKey,publicKey:o.signingKey.publicKey,address:Ha(o.privateKey.replace(/^0x/,""))}}var Ja=r("./node_modules/bignumber.js/bignumber.mjs"),Qa=r("./node_modules/validator/index.js");function Za(e){return"string"==typeof e&&Qa.isURL(e.toString(),{protocols:["http","https"],require_tld:!1})}function Xa(e){return e===Object(e)&&"[object Array]"!==Object.prototype.toString.call(e)}function ec(e){return Array.isArray(e)}function tc(e){try{return!!JSON.parse(e)}catch(e){return!1}}function rc(e){return"boolean"==typeof e}function nc(e){return!!e&&(e instanceof Ja.g||e.constructor&&"BigNumber"===e.constructor.name)}function oc(e){return"string"==typeof e||!!e&&e.constructor&&"String"===e.constructor.name}function sc(e){return"function"==typeof e}function ic(e){return"string"==typeof e&&!isNaN(parseInt(e,16))&&/^(0x|)[a-fA-F0-9]+$/.test(e)}function ac(e){return null!==e&&Number.isInteger(Number(e))}function cc(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function lc(e,...t){return t.length&&!t.map((t=>cc(e,t))).includes(!1)}function uc(e){const t={block:e.block_number,timestamp:e.block_t
1766imestamp,contract:e.contract_address,name:e.event_name,transaction:e.transaction_id,result:e.result,resourceNode:e.resource_Node||(e._unconfirmed?"fullNode":"solidityNode")};return e._unconfirmed&&(t.unconfirmed=e._unconfirmed),e._fingerprint&&(t.fingerprint=e._fingerprint),t}function dc(e,{inputs:t}){if(!e.result)return e;if(Xa(e.result))for(let r=0;r<t.length;r++){const n=t[r];"address"==n.type&&n.name in e.result&&(e.result[n.name]=I+e.result[n.name].substr(2).toLowerCase())}else ec(e.result)&&(e.result=e.result.reduce(((e,r,n)=>{const{name:o,type:s}=t[n];return"address"==s&&(r=I+r.substr(2).toLowerCase()),e[o]=r,e}),Object.create(null)));return e}function hc(e,t,r){let n=e.toString();for(;n.length<r;)n=t+n;return n}function pc(e){return null!=e}async function fc(e=1e3){return new Promise((t=>setTimeout(t,e)))}function gc(e){return ic(e)?ka(U(e.replace(/^0x/,I))):e}function mc(e){return ic(e)?e.toLowerCase().replace(/^0x/,I):E(_a(e)).toLowerCase()}function yc(e){if(!vc(e))throw new Error(`'${e}' is not a valid address string`);return function(e){const t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let e=0;e<40;e++)r[e]=t[e].charCodeAt(0);const n=U(ft(r).slice(2));for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&n[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return I+t.join("")}(mc(e))}function bc(e){if(!ic(e)||42!==e.length)return!1;try{return yc(e)===e}catch{return!1}}function wc(e,t=!1){try{return Ha(e,t)}catch{return!1}}function vc(e){if(!e||!oc(e))return!1;if(42===e.length)try{return vc(ka(U(e)))}catch(e){return!1}try{return Na(e)}catch(e){return!1}}function Ac(e){return new Uint8Array(U(e.replace(/^0x/,"")))}function Tc(e){return"string"==typeof e?Ac(e):e}function Pc({from:e,salt:t,initCode:r,addressFormat:n="base58"}){if(!vc(e))throw new Error(`from(${e}) is not a valid address string`);const o=Ac(mc(e)),s=Tc(t),i=Tc(r);if(32!==s.length)throw new Error(`salt(${t}) must be 32 bytes`);const a=Ac(ft(i)),c=`41${ft(pe([o,s,a])).slice(-40)}`;return"base58"===n?gc(c):c}const Ec=new eo;function Cc(e){return mc(e).replace(x,"0x")}function kc(e,t,r,n=!1){if(n&&r.replace(/^0x/,"").length%64==8&&(r="0x"+r.replace(/^0x/,"").substring(8)),r.replace(/^0x/,"").length%64)throw new Error("The encoded string is not valid. Its length must be a multiple of 64.");return t=t.map((e=>(/trcToken/.test(e)&&(e=e.replace(/trcToken/,"uint256")),e))),Ec.decode(t,r).reduce(((r,n,o)=>("address"==t[o]&&(n=I+n.substr(2).toLowerCase()),e.length?r[e[o]]=n:r.push(n),r)),e.length?Object.create(null):[])}function _c(e,t){for(let r=0;r<e.length;r++)"address"===e[r]&&(t[r]=Cc(t[r]));return Ec.encode(e,t)}function Ic(e){const t=e.match(/([a-zA-Z0-9])(\[.*\])/);return t?t[2]:""}function Sc(e){return(Ic(e).match(/\]\[/g)||[]).length+1}function xc(e,t){const r=[],n=e=>{if(e&&0===e.type.indexOf("tuple")&&e.components){return`tuple(${e.components.map((e=>n(e))).join(",")})${Ic(e.type)}`}return/trcToken/.test(e.type)?e.type.replace(/trcToken/,"uint256"):e.type},o=e=>Array.isArray(e)?(e.forEach(((t,r)=>{e[r]=o(t)})),e):Cc(e),s=(e,t,r)=>{r>1?t.length&&t.forEach((t=>{s(e,t,r-1)})):t.length&&r&&t.forEach((t=>{i(e,t)}))},i=(e=[],t)=>{e.length&&e.forEach(((e,r)=>{const n=e.type;if(void 0!==t[r]&&null!==t[r])if("address"===n)t[r]=Cc(t[r]);else if("address["===n.match(/^([^\x5b]*)(\x5b|$)/)[0])o(t[r]);else if(0===n.indexOf("tuple"))if(Ic(n)){const o=Sc(n);s(e.components,t[r],o)}else i(e.components,t[r])}))};if(e.inputs&&e.inputs.length)for(let o=0;o<e.inputs.length;o++){const s=e.inputs[o].type;"bool"===s&&"false"===t[o]&&(t[o]=!1),r.push(0===s.indexOf("tuple")?n(e.inputs[o]):s),t.length<r.length&&t.push("")}return i(e.inputs,t),(e=>{for(let t=0;t<e.length;t++){const r=e[t];/trcToken/.test(r)&&(e[t]=r.replace(/trcToken/,"uint256"))}})(r),Ec.encode(r,t)}function Bc(e,t){const r=e=>Array.isArray(e)?(e.forEach(((t,n)=>{e[n]=r(t)})),e):mc(e),n=(e,t,r)=>{r>1?t.length&&t.forEach((t=>{n(e,t,r-1)})):t.length&&r&&t.forEach((t=>{i(e,t)}))},o=e=>{const t=e.name?` ${e.name}`:"";if(e&&0===e.type.indexOf("tuple")&&e.components){return`tuple(${e.components.map((e=>o(e))).join(",")})${Ic(e.type)}${t}`}return/trcToken/.test(e.type)?e.type.replace(/trcToken/,"uint256")+t:e.type+t},s=(e,t,r)=>{!t||"length"===t||t in Object.prototype||t in Array.prototype||(e[t]=r)},i=(e,t)=>{e.length&&e.forEach(((e,o)=>{const{type:a,name:c}=e;if(t[o])if("address"===a)t[o]=mc(t[o]),s(t,c,mc(t[o]));else if("address["===a.match(/^([^\x5b]*)(\x5b|$)/)[0])r(t[o]),s(t,c,r(t[o]));else if(0===a.indexOf("tuple")){if(Ic(a)){const r=Sc(a);n(e.components,t[o],r)}else i(e.components,t[o]);s(t,c,t[o])}else s(t,c,t[o]);else s(t,c,t[o])}
1766))};if("outputs"in e&&e.outputs&&e.outputs.length>0){const r=[];for(let t=0;t<e.outputs.length;t++){const n=e.outputs[t].type,s=e.outputs[t].name?` ${e.outputs[t].name}`:"";r.push(0===n.indexOf("tuple")?o(e.outputs[t]):n+s)}(e=>{for(let t=0;t<e.length;t++){const r=e[t];/^trcToken/.test(r)&&(e[t]=r.replace(/^trcToken/,"uint256"))}})(r),t&&t.length||(t=new Uint8Array(32*e.outputs.length));const n=Ec.decode(r,t).toArray(!0);return i(e.outputs,n),n}return[]}const Oc="�TRON Signed Message:\n";function Mc(e){return"string"==typeof e?e=ct(e):Array.isArray(e)&&(e=new Uint8Array(e)),ft(pe([ct(Oc),ct(String(e.length)),e]))}function Wc(e,t){t.match(/^0x/)||(t="0x"+t);const r=new zr(t),n=Mc(e),o=r.sign(n);return va(o)}function jc(e,t){t.match(/^0x/)||(t="0x"+t);return ka(U(qr(Mc(e),t).replace(/^0x/,I)))}const Rc=new Uint8Array(32);Rc.fill(0);const Nc=BigInt(-1),Uc=BigInt(0),Dc=BigInt(1),Lc=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const Fc=Ie(Dc,32),zc=Ie(Uc,32),Vc={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},qc=["name","version","chainId","verifyingContract","salt"];function Hc(e){return function(t){return te("string"==typeof t,`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const Kc={name:Hc("name"),version:Hc("version"),chainId:function(e){const t=Pe(e,"domain.chainId");return te(t>=0,"invalid chain ID","domain.chainId",e),Number.isSafeInteger(t)?Number(t):xe(t)},verifyingContract:function(e){try{return(t=e,mc(t)).toLowerCase()}catch(e){}var t;te(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){const t=ae(e,"domain.salt");return te(32===t.length,'invalid domain value "salt"',"domain.salt",e),he(t)}};function $c(e){{const t=e.match(/^(u?)int(\d*)$/);if(t){const r=""===t[1],n=parseInt(t[2]||"256");te(n%8==0&&0!==n&&n<=256&&(null==t[2]||t[2]===String(n)),"invalid numeric width","type",e);const o=Te(Lc,r?n-1:n),s=r?(o+Dc)*Nc:Uc;return function(t){const n=Pe(t,"value");return te(n>=s&&n<=o,`value out-of-bounds for ${e}`,"value",n),Ie(r?Ae(n,256):n,32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return te(0!==r&&r<=32&&t[1]===String(r),"invalid bytes width","type",e),function(t){return te(ae(t).length===r,`invalid length for ${e}`,"value",t),function(e){const t=ae(e),r=t.length%32;return r?pe([t,Rc.slice(r)]):he(t)}(t)}}}switch(e){case"trcToken":return $c("uint256");case"address":return function(e){return ye(mc(e).replace(x,"0x"),32)};case"bool":return function(e){return e?Fc:zc};case"bytes":return function(e){return ft(e)};case"string":return function(e){return gt(e)}}return null}function Gc(e,t){return`${e}(${t.map((({name:e,type:t})=>t+" "+e)).join(",")})`}class Yc{primaryType;#L;get types(){return JSON.parse(this.#L)}#F;#z;constructor(e){this.#L=JSON.stringify(e),this.#F=new Map,this.#z=new Map;const t=new Map,r=new Map,n=new Map;Object.keys(e).forEach((e=>{t.set(e,new Set),r.set(e,[]),n.set(e,new Set)}));for(const n in e){const o=new Set;for(const s of e[n]){te(!o.has(s.name),`duplicate variable name ${JSON.stringify(s.name)} in ${JSON.stringify(n)}`,"types",e),o.add(s.name);const i=s.type.match(/^([^\x5b]*)(\x5b|$)/)[1]||null;te(i!==n,`circular type reference to ${JSON.stringify(i)}`,"types",e);$c(i)||(te(r.has(i),`unknown type ${JSON.stringify(i)}`,"types",e),r.get(i).push(n),t.get(n).add(i))}}const o=Array.from(r.keys()).filter((e=>0===r.get(e).length));te(0!==o.length,"missing primary type","types",e),te(1===o.length,`ambiguous primary types or unused types: ${o.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),J(this,{primaryType:o[0]}),function o(s,i){te(!i.has(s),`circular type reference to ${JSON.stringify(s)}`,"types",e),i.add(s);for(const e of t.get(s))if(r.has(e)){o(e,i);for(const t of i)n.get(t).add(e)}i.delete(s)}(this.primaryType,new Set);for(const[t,r]of n){const n=Array.from(r);n.sort(),this.#F.set(t,Gc(t,e[t])+n.map((t=>Gc(t,e[t]))).join(""))}}getEncoder(e){let t=this.#z.get(e);return t||(t=this.#V(e),this.#z.set(e,t)),t}#V(e){{const t=$c(e);if(t)return t}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const e=t[1],r=this.getEncoder(e);return n=>{te(!t[3]||parseInt(t[3])===n.length,`array length mismatch; expected length ${parseInt(t[3])}`,"value",n);let o=n.map(r);return this.#F.has(e)&&(o=o.map(ft)),ft(pe(o))}}
1766const r=this.types[e];if(r){const t=gt(this.#F.get(e));return e=>{const n=r.map((({name:t,type:r})=>{const n=this.getEncoder(r)(e[t]);return this.#F.has(r)?ft(n):n}));return n.unshift(t),pe(n)}}te(!1,`unknown type: ${e}`,"type",e)}encodeType(e){const t=this.#F.get(e);return te(t,`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return ft(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){if($c(e))return r(e,t);const n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n)return te(!n[3]||parseInt(n[3])===t.length,`array length mismatch; expected length ${parseInt(n[3])}`,"value",t),t.map((e=>this._visit(n[1],e,r)));const o=this.types[e];if(o)return o.reduce(((e,{name:n,type:o})=>(e[n]=this._visit(o,t[n],r),e)),{});te(!1,`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new Yc(e)}static getPrimaryType(e){return Yc.from(e).primaryType}static hashStruct(e,t,r){return Yc.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){if(null==e[r])continue;const n=Vc[r];te(n,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:n})}return t.sort(((e,t)=>qc.indexOf(e.name)-qc.indexOf(t.name))),Yc.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return pe(["0x1901",Yc.hashDomain(e),Yc.from(t).hash(r)])}static hash(e,t,r){return ft(Yc.encode(e,t,r))}static async resolveNames(e,t,r,n){e=Object.assign({},e);for(const t in e)null==e[t]&&delete e[t];const o={};e.verifyingContract&&!le(e.verifyingContract,20)&&(o[e.verifyingContract]="0x");const s=Yc.from(t);s.visit(r,((e,t)=>("address"!==e||le(t,20)||(o[t]="0x"),t)));for(const e in o)o[e]=await n(e);return e.verifyingContract&&o[e.verifyingContract]&&(e.verifyingContract=o[e.verifyingContract]),{domain:e,value:r=s.visit(r,((e,t)=>"address"===e&&o[t]?o[t]:t))}}static getPayload(e,t,r){Yc.hashDomain(e);const n={},o=[];qc.forEach((t=>{const r=e[t];null!=r&&(n[t]=Kc[t](r),o.push({name:t,type:Vc[t]}))}));const s=Yc.from(t),i=Object.assign({},t);return te(null==i.EIP712Domain,"types must not contain EIP712Domain type","types.EIP712Domain",t),i.EIP712Domain=o,s.encode(r),{types:i,domain:n,primaryType:s.primaryType,message:s.visit(r,((e,t)=>{if(e.match(/^bytes(\d*)/))return he(ae(t));if(e.match(/^u?int/))return Pe(t).toString();switch(e){case"trcToken":return Pe(t).toString();case"address":return t.toLowerCase();case"bool":return!!t;case"string":return te("string"==typeof t,"invalid string","value",t),t}te(!1,"unsupported type","type",e)}))}}}function Jc(e,t,r,n){const o=`0x${n.replace(/^0x/,"")}`,s=new zr(o),i=Yc.hash(e,t,r),a=s.sign(i);return["0x",a.r.substring(2),a.s.substring(2),Number(a.v).toString(16)].join("")}function Qc(e,t,r,n){return qr(Yc.hash(e,t,r),n)}var Zc=r("./node_modules/google-protobuf/google/protobuf/any_pb.js"),Xc=(r("./node_modules/tronweb/lib/esm/protocol/core/Tron_pb.cjs"),r("./node_modules/tronweb/lib/esm/protocol/core/contract/balance_contract_pb.cjs"),r("./node_modules/tronweb/lib/esm/protocol/core/contract/asset_issue_contract_pb.cjs"),r("./node_modules/tronweb/lib/esm/protocol/core/contract/smart_contract_pb.cjs"),r("./node_modules/tronweb/lib/esm/protocol/core/contract/common_pb.cjs"),r("./node_modules/tronweb/lib/esm/protocol/core/contract/witness_contract_pb.cjs"),r("./node_modules/tronweb/lib/esm/protocol/core/contract/storage_contract_pb.cjs"),r("./node_modules/tronweb/lib/esm/protocol/core/contract/account_contract_pb.cjs"),r("./node_modules/tronweb/lib/esm/protocol/core/contract/proposal_contract_pb.cjs"),r("./node_modules/tronweb/lib/esm/protocol/core/contract/exchange_contract_pb.cjs"),r("./node_modules/axios/lib/axios.js"));class el{host;timeout;user;password;headers;statusPage;instance;constructor(e,t=3e4,r="",n="",o={},s="/"){if(!Za(e))throw new Error("Invalid URL provided to HttpProvider");if(isNaN(t)||t<0)throw new Error("Invalid timeout duration provided");if(!Xa(o))throw new Error("Invalid headers object provided");e=e.replace(/\/+$/,""),this.host=e,this.timeout=t,this.user=r,this.password=n,this.headers=o,this.statusPage=s,this.instance=Xc.A.create({baseURL:e,timeout:t,headers:o,auth:r?{username:r,password:n}:void 0})}setStatusPage(e="/"){this.statusPage=e}async isConnected(e=this.statusPage){return this.request(e).then((e=>lc(e,"blockID","block_header"))).catch((()=>!1))}
vendor: 10,917 bytes, line 1766
1766request(e,t={},r="get"){return r=r.toLowerCase(),this.instance.request({data:"post"==r&&Object.keys(t).length?t:null,params:"get"==r&&t,url:e,method:r}).then((({data:e})=>e))}}const tl={HttpProvider:el};var rl,nl,ol,sl=r("./node_modules/eventemitter3/index.mjs"),il=r("./node_modules/tronweb/node_modules/semver/index.js");class al{invalid(e){return e.msg||`Invalid ${e.name}${"address"===e.type?" address":""} provided`}notPositive(e){return`${e.name} must be a positive integer`}notEqual(e){return e.msg||`${e.names?.[0]} can not be equal to ${e.names?.[1]}`}notValid(e){const t={};let r=!1;for(const n of e){const{name:e,names:o,value:s,type:i,gt:a,lt:c,gte:l,lte:u,optional:d}=n;if(!d||pc(s)&&("boolean"===i||!1!==s)){switch(t[e]=n.value,i){case"address":vc(s)?t[e]=mc(s):r=!0;break;case"integer":(!ac(s)||"number"==typeof a&&s<=a||"number"==typeof c&&s>=c||"number"==typeof l&&s<l||"number"==typeof u&&s>u)&&(r=!0);break;case"positive-integer":if(!ac(s)||s<=0)throw new Error(this.notPositive(n));break;case"tokenId":case"not-empty-string":oc(s)&&s.length||(r=!0);break;case"notEmptyObject":Xa(s)&&Object.keys(s).length||(r=!0);break;case"notEqual":if(o&&t[o[0]]===t[o[1]])throw new Error(this.notEqual(n));break;case"resource":["BANDWIDTH","ENERGY"].includes(s)||(r=!0);break;case"url":Za(s)||(r=!0);break;case"hex":ic(s)||(r=!0);break;case"array":Array.isArray(s)||(r=!0);break;case"boolean":rc(s)||(r=!0);break;case"string":(!oc(s)||"number"==typeof a&&s.length<=a||"number"==typeof c&&s.length>=c||"number"==typeof l&&s.length<l||"number"==typeof u&&s.length>u)&&(r=!0)}if(r)throw new Error(this.invalid(n))}}return!1}}!function(e){e.AccountCreateContract="AccountCreateContract",e.TransferContract="TransferContract",e.TransferAssetContract="TransferAssetContract",e.VoteAssetContract="VoteAssetContract",e.VoteWitnessContract="VoteWitnessContract",e.WitnessCreateContract="WitnessCreateContract",e.AssetIssueContract="AssetIssueContract",e.WitnessUpdateContract="WitnessUpdateContract",e.ParticipateAssetIssueContract="ParticipateAssetIssueContract",e.AccountUpdateContract="AccountUpdateContract",e.FreezeBalanceContract="FreezeBalanceContract",e.UnfreezeBalanceContract="UnfreezeBalanceContract",e.CancelAllUnfreezeV2Contract="CancelAllUnfreezeV2Contract",e.WithdrawBalanceContract="WithdrawBalanceContract",e.UnfreezeAssetContract="UnfreezeAssetContract",e.UpdateAssetContract="UpdateAssetContract",e.ProposalCreateContract="ProposalCreateContract",e.ProposalApproveContract="ProposalApproveContract",e.ProposalDeleteContract="ProposalDeleteContract",e.SetAccountIdContract="SetAccountIdContract",e.CustomContract="CustomContract",e.CreateSmartContract="CreateSmartContract",e.TriggerSmartContract="TriggerSmartContract",e.GetContract="GetContract",e.UpdateSettingContract="UpdateSettingContract",e.ExchangeCreateContract="ExchangeCreateContract",e.ExchangeInjectContract="ExchangeInjectContract",e.ExchangeWithdrawContract="ExchangeWithdrawContract",e.ExchangeTransactionContract="ExchangeTransactionContract",e.UpdateEnergyLimitContract="UpdateEnergyLimitContract",e.AccountPermissionUpdateContract="AccountPermissionUpdateContract",e.ClearABIContract="ClearABIContract",e.UpdateBrokerageContract="UpdateBrokerageContract",e.ShieldedTransferContract="ShieldedTransferContract",e.MarketSellAssetContract="MarketSellAssetContract",e.MarketCancelOrderContract="MarketCancelOrderContract",e.FreezeBalanceV2Contract="FreezeBalanceV2Contract",e.UnfreezeBalanceV2Contract="UnfreezeBalanceV2Contract",e.WithdrawExpireUnfreezeContract="WithdrawExpireUnfreezeContract",e.DelegateResourceContract="DelegateResourceContract",e.UnDelegateResourceContract="UnDelegateResourceContract",e.UNRECOGNIZED="UNRECOGNIZED"}(rl||(rl={})),function(e){e[e.Owner=0]="Owner",e[e.Witness=1]="Witness",e[e.Active=2]="Active",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(nl||(nl={})),function(e){e[e.Normal=0]="Normal",e[e.AssetIssue=1]="AssetIssue",e[e.Contract=2]="Contract",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(ol||(ol={}));var cl=r("./node_modules/buffer/index.js").Buffer;function ll(e){return Sl.fromUtf8(e).replace(/^0x/,"")}function ul(e){return JSON.parse(JSON.stringify(e))}function dl(e={}){if(void 0===e.ref_block_bytes&&void 0===e.ref_block_hash&&void 0===e.expiration&&void 0===e.timestamp)return!1;if("string"!=typeof e.ref_block_bytes)throw new Error("Invalid ref_block_bytes provided.");if("string"!=typeof e.ref_block_hash)throw new Error("Invalid ref_block_hash provided.");if("number"!=typeof e.expiration)throw new Error("Invalid expiration provided.");if("number"!=typeof e.timestamp)throw new Error("Invalid timestamp provided.");return!0}async function hl(e,t,r,n,o={}){const s={visible:!1,txID:"",raw_data_hex:"",raw_data:{contract:[{parameter:{value:r,type_url:`type.googleapis.com/protocol.${t}`},type:t}],...dl(o)?{}:await e.trx.getCurrentRefBlockParams(),...o}};n&&(s.raw_data.contract[0].Permission_id=n);const i=Pu(s);return s.txID=Su(i).replace(/^0x/,""),s.raw_data_hex=ku(i).toLowerCase(),s}function pl(e={}){const t={};return dl(e.blockHeader)&&(t.ref_block_bytes=e.blockHeader.ref_block_bytes,t.ref_block_hash=e.blockHeader.ref_block_hash,t.expiration=e.blockHeader.expiration,t.timestamp=e.blockHeader.timestamp),t}var fl=r("./node_modules/buffer/index.js").Buffer;class gl{tronWeb;validator;constructor(e){if(!(e&&e instanceof Sl))throw new Error("Expected instance of TronWeb");this.tronWeb=e,this.validator=new al}async sendTrx(e,t=0,r=this.tronWeb.defaultAddress.hex,n={}){t=parseInt(t),this.validator.notValid([{name:"recipient",type:"address",value:e},{name:"origin",type:"address",value:r},{names:["recipient","origin"],type:"notEqual",msg:"Cannot transfer TRX to the same account"},{name:"amount",type:"integer",gt:0,value:t}]);const o={to_address:mc(e),owner_address:mc(r),amount:t},s=pl(n);return hl(this.tronWeb,rl.TransferContract,o,n?.permissionId,s)}async sendToken(e,t=0,r,n=this.tronWeb.defaultAddress.hex,o={}){t=parseInt(t),this.validator.notValid([{name:"recipient",type:"address",value:e},{name:"origin",type:"address",value:n},{names:["recipient","origin"],type:"notEqual",msg:"Cannot transfer tokens to the same account"},{name:"amount",type:"integer",gt:0,value:t},{name:"token ID",type:"tokenId",value:r}]);const s={to_address:mc(e),owner_address:mc(n),asset_name:ll(r),amount:t},i=pl(o);return hl(this.tronWeb,rl.TransferAssetContract,s,o?.permissionId,i)}async purchaseToken(e,t,r=0,n=this.tronWeb.defaultAddress.hex,o={}){this.validator.notValid([{name:"buyer",type:"address",value:n},{name:"issuer",type:"address",value:e},{names:["buyer","issuer"],type:"notEqual",msg:"Cannot purchase tokens from same account"},{name:"amount",type:"integer",gt:0,value:r},{name:"token ID",type:"tokenId",value:t}]);const s={to_address:mc(e),owner_address:mc(n),asset_name:ll(t),amount:parseInt(r)},i=pl(o);return hl(this.tronWeb,rl.ParticipateAssetIssueContract,s,o?.permissionId,i)}async freezeBalance(e=0,t=3,r="BANDWIDTH",n=this.tronWeb.defaultAddress.hex,o,s={}){this.validator.notValid([{name:"origin",type:"address",value:n},{name:"receiver",type:"address",value:o,optional:!0},{name:"amount",type:"integer",gt:0,value:e},{name:"duration",type:"integer",gte:3,value:t},{name:"resource",type:"resource",value:r,msg:'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"'}]);const i={owner_address:mc(n),frozen_balance:parseInt(e),frozen_duration:parseInt(String(t))};"BANDWIDTH"!==r&&(i.resource=r),pc(o)&&mc(o)!==mc(n)&&(i.receiver_address=mc(o));const a=pl(s);return hl(this.tronWeb,rl.FreezeBalanceContract,i,s?.permissionId,a)}async unfreezeBalance(e="BANDWIDTH",t=this.tronWeb.defaultAddress.hex,r,n={}){this.validator.notValid([{name:"origin",type:"address",value:t},{name:"receiver",type:"address",value:r,optional:!0},{name:"resource",type:"resource",value:e,msg:'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"'}]);const o={owner_address:mc(t)};"BANDWIDTH"!==e&&(o.resource=e),pc(r)&&mc(r)!==mc(t)&&(o.receiver_address=mc(r));const s=pl(n);return hl(this.tronWeb,rl.UnfreezeBalanceContract,o,n?.permissionId,s)}async freezeBalanceV2(e=0,t="BANDWIDTH",r=this.tronWeb.defaultAddress.hex,n={}){this.validator.notValid([{name:"origin",type:"address",value:r},{name:"amount",type:"integer",gt:0,value:e},{name:"resource",type:"resource",value:t,msg:'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"'}]);const o={owner_address:mc(r),frozen_balance:parseInt(e)};"BANDWIDTH"!==t&&(o.resource=t);const s=pl(n);return hl(this.tronWeb,rl.FreezeBalanceV2Contract,o,n?.permissionId,s)}async unfreezeBalanceV2(e=0,t="BANDWIDTH",r=this.tronWeb.defaultAddress.hex,n={}){this.validator.notValid([{name:"origin",type:"address",value:r},{name:"amount",type:"integer",gt:0,value:e},{name:"resource",type:"resource",value:t,msg:'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"'}]);const o={owner_address:mc(r),unfreeze_balance:parseInt(e)};"BANDWIDTH"!==t&&(o.resource=t);const s=pl(n);return hl(this.tronWeb,rl.UnfreezeBalanceV2Contract,o,n?.permissionId,s)}async cancelUnfreezeBalanceV2(e=this.tronWeb.defaultAddress.hex,t={}){this.validator.notValid([{name:"origin",type:"address",value:e}]);const r={owner_address:mc(e)},n=pl(t);return hl(this.tronWeb,rl.CancelAllUnfreezeV2Contract,r,t?.permissionId,n)}async delegateResource(e=0,t,r="BANDWIDTH",n=this.tronWeb.defaultAddress.hex,o=!1,s,i={}){if(this.validator.notValid([{name:"amount",type:"integer",gt:0,value:e},{name:"resource",type:"resource",value:r,msg:'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"'},{name:"receiver",type:"address",value:t},{name:"origin",type:"address",value:n},{name:"lock",type:"boolean",value:o},{name:"lock period",type:"integer",gte:0,value:s,optional:!0}]),mc(t)===mc(n))throw new Error("Receiver address must not be the same as owner address");const a={owner_address:mc(n),receiver_address:mc(t),balance:parseInt(e)};"BANDWIDTH"!==r&&(a.resource=r),o&&(a.lock=o,pc(s)&&(a.lock_period=s));const c=pl(i);return hl(this.tronWeb,rl.DelegateResourceContract,a,i?.permissionId,c)}async undelegateResource(e=0,t,r="BANDWIDTH",n=this.tronWeb.defaultAddress.hex,o={}){if(this.validator.notValid([{name:"origin",type:"address",value:n},{name:"receiver",type:"address",value:t},{name:"amount",type:"integer",gt:0,value:e},{name:"resource",type:"resource",value:r,msg:'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"'}]),mc(t)===mc(n))throw new Error("Receiver address must not be the same as owner address");const s={owner_address:mc(n),receiver_address:mc(t),balance:parseInt(e)};"BANDWIDTH"!==r&&(s.resource=r);const i=pl(o);return hl(this.tronWeb,rl.UnDelegateResourceContract,s,o?.permissionId,i)}async withdrawExpireUnfreeze(e=this.tronWeb.defaultAddress.hex,t={}){this.validator.notValid([{name:"origin",type:"address",value:e}]);const r={owner_address:mc(e)},n=pl(t);return hl(this.tronWeb,rl.WithdrawExpireUnfreezeContract,r,t?.permissionId,n)}
1766async withdrawBlockRewards(e=this.tronWeb.defaultAddress.hex,t={}){this.validator.notValid([{name:"origin",type:"address",value:e}]);const r={owner_address:mc(e)},n=pl(t);return hl(this.tronWeb,rl.WithdrawBalanceContract,r,t?.permissionId,n)}async applyForSR(e=this.tronWeb.defaultAddress.hex,t="",r={}){this.validator.notValid([{name:"origin",type:"address",value:e},{name:"url",type:"url",value:t,msg:"Invalid url provided"},{name:"url",type:"string",value:t,lte:256,msg:"Invalid url provided"}]);const n={owner_address:mc(e),url:ll(t)},o=pl(r);return hl(this.tronWeb,rl.WitnessCreateContract,n,r?.permissionId,o)}async vote(e={},t=this.tronWeb.defaultAddress.hex,r={}){this.validator.notValid([{name:"voter",type:"address",value:t},{name:"votes",type:"notEmptyObject",value:e}]);const n=Object.entries(e);for(const[e,t]of n)this.validator.notValid([{name:"SR",type:"address",value:e},{name:"vote count",type:"integer",gt:0,value:t,msg:"Invalid vote count provided for SR: "+e}]);const o=n.map((([e,t])=>({vote_address:mc(e),vote_count:parseInt(t)}))),s={owner_address:mc(t),votes:o},i=pl(r);return hl(this.tronWeb,rl.VoteWitnessContract,s,r?.permissionId,i)}async createSmartContract(e={},t=this.tronWeb.defaultAddress.hex){const r=e.feeLimit||this.tronWeb.feeLimit;let n=e.userFeePercentage;"number"==typeof n||n||(n=100);const o=e.originEnergyLimit||1e7,s=e.callValue||0,i=e.tokenValue,a=e.tokenId||e.token_id;let{abi:c}=e;const{parameters:l=[]}=e;let u="";const{bytecode:d=!1,name:h=""}=e;if(c&&oc(c))try{c=JSON.parse(c)}catch{throw new Error("Invalid options.abi provided")}const p=c;let f=p;if(p.entrys&&(f=p.entrys),!ec(f))throw new Error("Invalid options.abi provided");const g=f.some((e=>"constructor"===e.type&&"payable"===e.stateMutability.toLowerCase()));if(this.validator.notValid([{name:"bytecode",type:"hex",value:d},{name:"feeLimit",type:"integer",value:r,gt:0},{name:"callValue",type:"integer",value:s,gte:0},{name:"userFeePercentage",type:"integer",value:n,gte:0,lte:100},{name:"originEnergyLimit",type:"integer",value:o,gte:0,lte:1e7},{name:"parameters",type:"array",value:l},{name:"issuer",type:"address",value:t},{name:"tokenValue",type:"integer",value:i,gte:0,optional:!0},{name:"tokenId",type:"integer",value:a,gte:0,optional:!0}]),!g&&(s>0||i>0))throw new Error("When contract is not payable, options.callValue and options.tokenValue must be 0");const{rawParameter:m,funcABIV2:y,parametersV2:b}=e;if(m&&oc(m))u=m.replace(/^(0x)/,"");else if(y)u=xc(y,b).replace(/^(0x)/,"");else{let e=f.find((e=>"constructor"===e.type));if(void 0!==e&&e){const t=new eo,r=[],n=[];if(e=e.inputs,l.length!=e.length)throw new Error(`constructor needs ${e.length} but ${l.length} provided`);for(let t=0;t<l.length;t++){let o=e[t].type,s=l[t];if(!o||!oc(o)||!o.length)throw new Error("Invalid parameter type provided: "+o);const i=e=>ec(e)?e.map((e=>i(e))):mc(e).replace(x,"0x");"address"===o||"address["===o.match(/^([^\x5b]*)(\x5b|$)/)?.[0]?s=i(s):/trcToken/.test(o)&&(o=o.replace(/trcToken/,"uint256")),r.push(o),n.push(s)}try{u=t.encode(r,n).replace(/^(0x)/,"")}catch(e){throw new Error(e)}}else u=""}const w={owner_address:mc(t),fee_limit:parseInt(r),call_value:parseInt(s),consume_user_resource_percent:n,origin_energy_limit:o,abi:JSON.stringify(f),bytecode:d,parameter:u,name:h};pc(i)&&(w.call_token_value=parseInt(i)),pc(a)&&(w.token_id=parseInt(a));const v={};v.owner_address=w.owner_address,pc(w.call_token_value)&&(v.call_token_value=w.call_token_value),pc(w.token_id)&&(v.token_id=w.token_id);const A=v.new_contract={};w.abi?A.abi={entrys:JSON.parse(w.abi)}:A.abi={},w.call_value&&(A.call_value=w.call_value),A.consume_user_resource_percent=w.consume_user_resource_percent,A.origin_energy_limit=w.origin_energy_limit,A.origin_address=w.origin_address??w.owner_address,w.bytecode+w.parameter&&(A.bytecode=(w.bytecode+w.parameter).replace(/^0x/,"")),pc(w.name)&&(A.name=w.name);const T=pl(e),P=await hl(this.tronWeb,rl.CreateSmartContract,v,e?.permissionId,{...T,fee_limit:w.fee_limit});var E,C;return P.contract_address=(E=w.owner_address,C=P.txID,"41"+ft(cl.from(C+E,"hex")).toString().substring(2).slice(24)),P}async triggerSmartContract(e,t,r,n,o){const s=[e,t,r,n,o];return"object"!=typeof s[2]&&(s[2]={feeLimit:s[2],callValue:s[3]},s.splice(3,1)),s[2]?.txLocal?this._triggerSmartContractLocal(...s):this._triggerSmartContract(...s)}async triggerConstantContract(e,t,r={},n=[],o=this.tronWeb.defaultAddress.hex){return r._isConstant=!0,this._triggerSmartContract(e,t,r,n,o)}async triggerConfirmedConstantContract(e,t,r={},n=[],o=this.tronWeb.defaultAddress.hex){return r._isConstant=!0,r.confirmed=!0,this._triggerSmartContract(e,t,r,n,o)}async estimateEnergy(e,t,r={},n=[],o=this.tronWeb.defaultAddress.hex){r.estimateEnergy=!0;return await this._triggerSmartContract(e,t,r,n,o)}async deployConstantContract(e={input:"",ownerAddress:""}){const{input:t,ownerAddress:r,tokenId:n,tokenValue:o,callValue:s=0}=e;this.validator.notValid([{name:"input",type:"not-empty-string",value:t},{name:"callValue",type:"integer",value:s,gte:0},{name:"owner",type:"address",value:r},{name:"tokenValue",type:"integer",value:o,gte:0,optional:!0},{name:"tokenId",type:"integer",value:n,gte:0,optional:!0}]);const i={data:t,owner_address:mc(r),call_value:s};n&&(i.token_id=n),o&&(i.call_token_value=o);const a=`wallet${e.confirmed?"solidity":""}/estimateenergy`,c=await this.tronWeb[e.confirmed?"solidityNode":"fullNode"].request(a,i,"post");if(c.Error)throw new Error(c.Error);if(c.result&&c.result.message)throw new Error(this.tronWeb.toUtf8(c.result.message));return c}
1766_getTriggerSmartContractArgs(e,t,r,n,o,s,i,a,c){const l={contract_address:mc(e),owner_address:mc(o)};if(t&&oc(t)){let e;if(t=t.replace(/\s*/g,""),n.length){const t=new eo;let r=[];const o=[];for(let e=0;e<n.length;e++){let{value:t}=n[e];const{type:s}=n[e];if(!s||!oc(s)||!s.length)throw new Error("Invalid parameter type provided: "+s);const i=e=>ec(e)?e.map((e=>i(e))):mc(e).replace(x,"0x");("address"===s||"address["===s.match(/^([^\x5b]*)(\x5b|$)/)?.[0])&&(t=i(t)),r.push(s),o.push(t)}try{r=r.map((e=>(/trcToken/.test(e)&&(e=e.replace(/trcToken/,"uint256")),e))),e=t.encode(r,o).replace(/^(0x)/,"")}catch(e){throw new Error(e)}}else e="";r.funcABIV2&&(e=xc(r.funcABIV2,r.parametersV2).replace(/^(0x)/,"")),r.shieldedParameter&&oc(r.shieldedParameter)&&(e=r.shieldedParameter.replace(/^(0x)/,"")),r.rawParameter&&oc(r.rawParameter)&&(e=r.rawParameter.replace(/^(0x)/,"")),l.function_selector=t,l.parameter=e}else r.input&&(l.data=r.input);return l.call_value=parseInt(a),pc(s)&&(l.call_token_value=parseInt(s)),pc(i)&&(l.token_id=parseInt(i)),r._isConstant||r.estimateEnergy||(l.fee_limit=parseInt(c)),r.permissionId&&(l.Permission_id=r.permissionId),l}async _triggerSmartContractLocal(e,t,r={},n=[],o=this.tronWeb.defaultAddress.hex){const{tokenValue:s,tokenId:i,callValue:a,feeLimit:c}=Object.assign({callValue:0,feeLimit:this.tronWeb.feeLimit},r);this.validator.notValid([{name:"feeLimit",type:"integer",value:c,gt:0},{name:"callValue",type:"integer",value:a,gte:0},{name:"parameters",type:"array",value:n},{name:"contract",type:"address",value:e},{name:"issuer",type:"address",value:o,optional:!0},{name:"tokenValue",type:"integer",value:s,gte:0,optional:!0},{name:"tokenId",type:"integer",value:i,gte:0,optional:!0}]);const l=this._getTriggerSmartContractArgs(e,t,r,n,o,s,i,a,c);l.function_selector&&(l.data=ft(fl.from(l.function_selector,"utf-8")).toString().substring(2,10)+l.parameter);const u={data:l.data,owner_address:l.owner_address,contract_address:l.contract_address};l.call_value&&(u.call_value=l.call_value),l.call_token_value&&(u.call_token_value=l.call_token_value),l.token_id&&(u.token_id=l.token_id);const d=pl(r);return{result:{result:!0},transaction:await hl(this.tronWeb,rl.TriggerSmartContract,u,r.permissionId,{...d,fee_limit:l.fee_limit})}}async _triggerSmartContract(e,t,r={},n=[],o=this.tronWeb.defaultAddress.hex){const{tokenValue:s,tokenId:i,callValue:a,feeLimit:c}=Object.assign({callValue:0,feeLimit:this.tronWeb.feeLimit},r);this.validator.notValid([{name:"feeLimit",type:"integer",value:c,gt:0},{name:"callValue",type:"integer",value:a,gte:0},{name:"parameters",type:"array",value:n},{name:"contract",type:"address",value:e},{name:"issuer",type:"address",value:o,optional:!0},{name:"tokenValue",type:"integer",value:s,gte:0,optional:!0},{name:"tokenId",type:"integer",value:i,gte:0,optional:!0}]);const l=this._getTriggerSmartContractArgs(e,t,r,n,o,s,i,a,c);let u="triggersmartcontract";r._isConstant?u="triggerconstantcontract":r.estimateEnergy&&(u="estimateenergy"),u=`wallet${r.confirmed?"solidity":""}/${u}`;return function(e,t,r){if(e.Error)throw new Error(e.Error);if(e.result&&e.result.message)throw new Error(Sl.toUtf8(e.result.message));if(!r._isConstant&&!r.estimateEnergy){if(Iu(e.transaction,t,r))return e;throw new Error("Invalid transaction")}return e}(await this.tronWeb[r.confirmed?"solidityNode":"fullNode"].request(u,l,"post"),l,r)}async clearABI(e,t=this.tronWeb.defaultAddress.hex,r={}){if(!Sl.isAddress(e))throw new Error("Invalid contract address provided");if(!Sl.isAddress(t))throw new Error("Invalid owner address provided");const n={contract_address:mc(e),owner_address:mc(t)};this.tronWeb.trx.cache.contracts[e]&&delete this.tronWeb.trx.cache.contracts[e];const o=pl(r);return hl(this.tronWeb,rl.ClearABIContract,n,r?.permissionId,o)}async updateBrokerage(e,t=this.tronWeb.defaultAddress.hex,r={}){if(!pc(e))throw new Error("Invalid brokerage provided");if(!ac(e)||e<0||e>100)throw new Error("Brokerage must be an integer between 0 and 100");if(!Sl.isAddress(t))throw new Error("Invalid owner address provided");const n={brokerage:parseInt(e),owner_address:mc(t)},o=pl(r);return hl(this.tronWeb,rl.UpdateBrokerageContract,n,r?.permissionId,o)}async createToken(e={},t=this.tronWeb.defaultAddress.hex){const{name:r=!1,abbreviation:n=!1,description:o="",url:s=!1,totalSupply:i=0,trxRatio:a=1,tokenRatio:c=1,saleStart:l=Date.now(),saleEnd:u
vendor: 4,694 bytes, line 1766
1766=!1,freeBandwidth:d=0,freeBandwidthLimit:h=0,frozenAmount:p=0,frozenDuration:f=0,voteScore:g,precision:m}=e;if(this.validator.notValid([{name:"Supply amount",type:"positive-integer",value:i},{name:"TRX ratio",type:"positive-integer",value:a},{name:"Token ratio",type:"positive-integer",value:c},{name:"token abbreviation",type:"string",value:n,lte:32,gt:0},{name:"token name",type:"not-empty-string",value:r},{name:"token description",type:"string",value:o,lte:200},{name:"token url",type:"url",value:s},{name:"token url",type:"string",value:s,lte:256},{name:"issuer",type:"address",value:t},{name:"sale start timestamp",type:"integer",value:l,gte:Date.now()},{name:"sale end timestamp",type:"integer",value:u,gt:l},{name:"Frozen supply",type:"integer",value:p,gte:0},{name:"Frozen duration",type:"integer",value:f,gte:0}]),pc(g)&&(!ac(g)||g<=0))throw new Error("voteScore must be a positive integer greater than 0");if(pc(m)&&(!ac(m)||m<0||m>6))throw new Error("precision must be a positive integer >= 0 and <= 6");const y={owner_address:mc(t),name:ll(r),abbr:ll(n),description:ll(o),url:ll(s),total_supply:parseInt(i),trx_num:parseInt(a),num:parseInt(c),start_time:parseInt(l),end_time:parseInt(u),frozen_supply:[{frozen_amount:parseInt(p),frozen_days:parseInt(f)}]};["name","abbr","description","url"].forEach((e=>{y[e]||delete y[e]})),parseInt(p)>0||delete y.frozen_supply,d&&!isNaN(parseInt(d))&&parseInt(d)>=0&&(y.free_asset_net_limit=parseInt(d)),h&&!isNaN(parseInt(h))&&parseInt(h)>=0&&(y.public_free_asset_net_limit=parseInt(h)),m&&!isNaN(parseInt(m))&&(y.precision=parseInt(m)),g&&!isNaN(parseInt(g))&&(y.vote_score=parseInt(g));const b=pl(e);return hl(this.tronWeb,rl.AssetIssueContract,y,e?.permissionId,b)}async createAccount(e,t=this.tronWeb.defaultAddress.hex,r={}){this.validator.notValid([{name:"account",type:"address",value:e},{name:"origin",type:"address",value:t}]);const n={owner_address:mc(t),account_address:mc(e)},o=pl(r);return hl(this.tronWeb,rl.AccountCreateContract,n,r?.permissionId,o)}async updateAccount(e,t=this.tronWeb.defaultAddress.hex,r={}){this.validator.notValid([{name:"Name",type:"string",lte:200,gt:0,value:e,msg:"Invalid accountName"},{name:"origin",type:"address",value:t}]);const n={account_name:ll(e),owner_address:mc(t)},o=pl(r);return hl(this.tronWeb,rl.AccountUpdateContract,n,r?.permissionId,o)}async setAccountId(e,t=this.tronWeb.defaultAddress.hex,r={}){e&&oc(e)&&e.startsWith("0x")&&(e=e.slice(2)),this.validator.notValid([{name:"accountId",type:"hex",value:e},{name:"accountId",type:"string",lte:32,gte:8,value:e},{name:"origin",type:"address",value:t}]);const n={account_id:e,owner_address:mc(t)},o=pl(r);return hl(this.tronWeb,rl.SetAccountIdContract,n,r?.permissionId,o)}async updateToken(e={},t=this.tronWeb.defaultAddress.hex){const{description:r="",url:n=!1,freeBandwidth:o=0,freeBandwidthLimit:s=0}=e;this.validator.notValid([{name:"token description",type:"string",value:r,lte:200},{name:"token url",type:"url",value:n},{name:"token url",type:"string",value:n,lte:256},{name:"issuer",type:"address",value:t}]);const i={owner_address:mc(t),description:ll(r),url:ll(n)};o&&!isNaN(parseInt(o))&&parseInt(o)>=0&&(i.new_limit=parseInt(o)),s&&!isNaN(parseInt(s))&&parseInt(s)>=0&&(i.new_public_limit=parseInt(s));const a=pl(e);return hl(this.tronWeb,rl.UpdateAssetContract,i,e?.permissionId,a)}async sendAsset(e,t=0,r,n=this.tronWeb.defaultAddress.hex,o={}){return this.sendToken(e,t,r,n,o)}async purchaseAsset(e,t,r=0,n=this.tronWeb.defaultAddress.hex,o={}){return this.purchaseToken(e,t,r,n,o)}async createAsset(e,t){return this.createToken(e,t)}async updateAsset(e={},t=this.tronWeb.defaultAddress.hex){return this.updateToken(e,t)}async createProposal(e,t=this.tronWeb.defaultAddress.hex,r={}){this.validator.notValid([{name:"issuer",type:"address",value:t}]);const n="Invalid proposal parameters provided";if(!e)throw new Error(n);const o=ec(e)?e:[e];for(const e of o)if(!Xa(e))throw new Error(n);const s={owner_address:mc(t),parameters:o},i=pl(r);return hl(this.tronWeb,rl.ProposalCreateContract,s,r?.permissionId,i)}async deleteProposal(e,t=this.tronWeb.defaultAddress.hex,r={}){this.validator.notValid([{name:"issuer",type:"address",value:t},{name:"proposalID",type:"integer",value:e,gte:0}]);const n={owner_address:mc(t),proposal_id:parseInt(e)},o=pl(r);return hl(this.tronWeb,rl.ProposalDeleteContract,n,r?.permissionId,o)}async voteProposal(e,t=!1,r=this.tronWeb.defaultAddress.hex,n={}){this.validator.notValid([{name:"voter",type:"address",value:r},{name:"proposalID",type:"integer",value:e,gte:0},{name:"has approval",type:"boolean",value:t}]);const o={owner_address:mc(r),proposal_id:parseInt(e),is_add_approval:t},s=pl(n);
1766return hl(this.tronWeb,rl.ProposalApproveContract,o,n?.permissionId,s)}async createTRXExchange(e,t,r,n=this.tronWeb.defaultAddress.hex,o={}){this.validator.notValid([{name:"owner",type:"address",value:n},{name:"token name",type:"not-empty-string",value:e},{name:"token balance",type:"positive-integer",value:t},{name:"trx balance",type:"positive-integer",value:r}]);const s={owner_address:mc(n),first_token_id:ll(e),first_token_balance:t,second_token_id:"5f",second_token_balance:r},i=pl(o);return hl(this.tronWeb,rl.ExchangeCreateContract,s,o?.permissionId,i)}async createTokenExchange(e,t,r,n,o=this.tronWeb.defaultAddress.hex,s={}){this.validator.notValid([{name:"owner",type:"address",value:o},{name:"first token name",type:"not-empty-string",value:e},{name:"second token name",type:"not-empty-string",value:r},{name:"first token balance",type:"positive-integer",value:t},{name:"second token balance",type:"positive-integer",value:n}]);const i={owner_address:mc(o),first_token_id:ll(e),first_token_balance:t,second_token_id:ll(r),second_token_balance:n},a=pl(s);return hl(this.tronWeb,rl.ExchangeCreateContract,i,s?.permissionId,a)}async injectExchangeTokens(e,t,r,n=this.tronWeb.defaultAddress.hex,o={}){this.validator.notValid([{name:"owner",type:"address",value:n},{name:"token name",type:"not-empty-string",value:t},{name:"token amount",type:"integer",value:r,gte:1},{name:"exchangeID",type:"integer",value:e,gte:0}]);const s={owner_address:mc(n),exchange_id:parseInt(e),token_id:ll(t),quant:parseInt(r)},i=pl(o);return hl(this.tronWeb,rl.ExchangeInjectContract,s,o?.permissionId,i)}async withdrawExchangeTokens(e,t,r,n=this.tronWeb.defaultAddress.hex,o={}){this.validator.notValid([{name:"owner",type:"address",value:n},{name:"token name",type:"not-empty-string",value:t},{name:"token amount",type:"integer",value:r,gte:1},{name:"exchangeID",type:"integer",value:e,gte:0}]);const s={owner_address:mc(n),exchange_id:parseInt(e),token_id:ll(t),quant:parseInt(r)},i=pl(o);return hl(this.tronWeb,rl.ExchangeWithdrawContract,s,o?.permissionId,i)}async tradeExchangeTokens(e,t,r,n,o=this.tronWeb.defaultAddress.hex,s={}){this.validator.notValid([{name:"owner",type:"address",value:o},{name:"token name",type:"not-empty-string",value:t},{name:"tokenAmountSold",type:"integer",value:r,gte:1},{name:"tokenAmountExpected",type:"integer",value:n,gte:1},{name:"exchangeID",type:"integer",value:e,gte:0}]);const i={owner_address:mc(o),exchange_id:parseInt(e),token_id:Sl.fromAscii(t).replace(/^0x/,""),quant:parseInt(r),expected:parseInt(n)},a=pl(s);return hl(this.tronWeb,rl.ExchangeTransactionContract,i,s?.permissionId,a)}async updateSetting(e,t,r=this.tronWeb.defaultAddress.hex,n={}){this.validator.notValid([{name:"owner",type:"address",value:r},{name:"contract",type:"address",value:e},{name:"userFeePercentage",type:"integer",value:t,gte:0,lte:100}]);const o={owner_address:mc(r),contract_address:mc(e),consume_user_resource_percent:t},s=pl(n);return hl(this.tronWeb,rl.UpdateSettingContract,o,n?.permissionId,s)}async updateEnergyLimit(e,t=0,r=this.tronWeb.defaultAddress.hex,n={}){this.validator.notValid([{name:"owner",type:"address",value:r},{name:"contract",type:"address",value:e},{name:"originEnergyLimit",type:"integer",value:t,gte:0,lte:1e7}]);const o={owner_address:mc(r),contract_address:mc(e),origin_energy_limit:t},s=pl(n);return hl(this.tronWeb,rl.UpdateEnergyLimitContract,o,n?.permissionId,s)}checkPermissions(e,t){if(e){if(e.type!==t||!e.permission_name||!oc(e.permission_name)||!ac(e.threshold)||e.threshold<1||!e.keys)return!1;for(const r of e.keys)if(!Sl.isAddress(r.address)||!ac(r.weight)||r.weight<1||2===t&&!e.operations)return!1}return!0}async updateAccountPermissions(e=this.tronWeb.defaultAddress.hex,t,r,n,o={}){if(!Sl.isAddress(e))throw new Error("Invalid ownerAddress provided");if(!this.checkPermissions(t,0))throw new Error("Invalid ownerPermissions provided");if(!this.checkPermissions(r,1))throw new Error("Invalid witnessPermissions provided");Array.isArray(n)||(n=[n]);for(const e of n)if(!this.checkPermissions(e,2))throw new Error("Invalid activesPermissions provided");const s={owner_address:mc(e)};if(t){const e=ul(t);"type"in e&&delete e.type,e.keys=e.keys?.map((({address:e,weight:t})=>({address:mc(e),weight:t}))),s.owner=e}if(r){const e=ul(r);e.type="Witness",e.keys=e.keys.map((({address:e,weight:t})=>({address:mc(e),weight:t}))),s.witness=e}if(n){const e=ul(n);e.forEach((e=>{e.type="Active"})),e.forEach((e=>{e.keys=e.keys.map((({address:e,weight:t})=>({address:mc(e),weight:t})))})),s.actives=e}const i=pl(o);return hl(this.tronWeb,rl.AccountPermissionUpdateContract,s,o?.permissionId,i)}async newTxID(e,t={}){if(t?.txLocal){const t=e.raw_data.contract[0];try{const r=await hl(this.tronWeb,t.type,t.parameter.value,t.Permission_id,{fee_limit:e.raw_data.fee_limit,data:e.raw_data.data,ref_block_bytes:e.raw_data.ref_block_bytes,ref_block_hash:e.raw_data.ref_block_hash,expiration:e.raw_data.expiration,timestamp:e.raw_data.timestamp});return r.signature=e.signature,r.visible=e.visible,r}catch(e){throw new Error("Error generating a new transaction id.")}}try{const t=await this.tronWeb.fullNode.request("wallet/getsignweight",e,"post");return"boolean"==typeof e.visible&&(t.transaction.transaction.visible=e.visible),function(e,t,r){if(e.Error)throw new Error(e.Error);if(e.result&&e.result.message)throw new Error(Sl.toUtf8(e.result.message));if(Iu(e,t,r))return e;throw new Error("Invalid transaction")}(t.transaction.transaction,{...e.raw_data.contract[0].parameter.value,Permission_id:e.raw_data.contract[0].Permission_id},{data:e.raw_data.data,fee_limit:e.raw_data.fee_limit})}catch(e){throw new Error("Error generating a new transaction id.")}}async alterTransaction(e,t={}){if(Reflect.has(e,"signature"))throw new Error("You can not extend the expiration of a signed transaction.");
1766if(t.data){if("hex"===t.dataFormat||/^0x/.test(t.data)||(t.data=Sl.fromUtf8(t.data)),!ic(t.data))throw new Error("Invalid data provided");if(t.data=t.data.replace(/^0x/,""),t.data=t.data.padStart(2*Math.ceil(t.data.length/2),"0"),0===t.data.length)throw new Error("Invalid data provided");e.raw_data.data=t.data}if(t.extension){if(t.extension=parseInt(1e3*t.extension),isNaN(t.extension)||e.raw_data.expiration+t.extension<=Date.now()+3e3)throw new Error("Invalid extension provided");e.raw_data.expiration+=t.extension}return await this.newTxID(e,{txLocal:t.txLocal})}async extendExpiration(e,t,r={}){return await this.alterTransaction(e,{extension:t,txLocal:r?.txLocal})}async addUpdateData(e,t,r="utf8",n={}){return this.alterTransaction(e,{data:t,dataFormat:r,txLocal:n?.txLocal})}}const ml="�TRON Signed Message:\n32",yl="�Ethereum Signed Message:\n32";class bl{tronWeb;cache;validator;signMessage;sendAsset;send;sendTrx;broadcast;broadcastHex;signTransaction;constructor(e){this.tronWeb=e,this.cache={contracts:{}},this.validator=new al,this.signMessage=this.sign,this.sendAsset=this.sendToken,this.send=this.sendTransaction,this.sendTrx=this.sendTransaction,this.broadcast=this.sendRawTransaction,this.broadcastHex=this.sendHexTransaction,this.signTransaction=this.sign}_parseToken(e){return{...e,name:this.tronWeb.toUtf8(e.name),abbr:e.abbr&&this.tronWeb.toUtf8(e.abbr),description:e.description&&this.tronWeb.toUtf8(e.description),url:e.url&&this.tronWeb.toUtf8(e.url)}}getCurrentBlock(){return this.tronWeb.fullNode.request("wallet/getnowblock")}getConfirmedCurrentBlock(){return this.tronWeb.solidityNode.request("walletsolidity/getnowblock")}async getBlock(e=this.tronWeb.defaultBlock){if(!1===e)throw new Error("No block identifier provided");return"earliest"==e&&(e=0),"latest"==e?this.getCurrentBlock():isNaN(+e)&&Ad.isHex(e.toString())?this.getBlockByHash(e):this.getBlockByNumber(e)}async getBlockByHash(e){const t=await this.tronWeb.fullNode.request("wallet/getblockbyid",{value:e},"post");if(!Object.keys(t).length)throw new Error("Block not found");return t}async getBlockByNumber(e){if(!Ad.isInteger(e)||e<0)throw new Error("Invalid block number provided");return this.tronWeb.fullNode.request("wallet/getblockbynum",{num:parseInt(e)},"post").then((e=>{if(!Object.keys(e).length)throw new Error("Block not found");return e}))}async getBlockTransactionCount(e=this.tronWeb.defaultBlock){const{transactions:t=[]}=await this.getBlock(e);return t.length}async getTransactionFromBlock(e=this.tronWeb.defaultBlock,t){const{transactions:r}=await this.getBlock(e);if(!r)throw new Error("Transaction not found in block");if(t>=0&&t<r.length)return r[t];throw new Error("Invalid transaction index provided")}async getTransactionsFromBlock(e=this.tronWeb.defaultBlock){const{transactions:t}=await this.getBlock(e);if(!t)throw new Error("Transaction not found in block");return t}async getTransaction(e){const t=await this.tronWeb.fullNode.request("wallet/gettransactionbyid",{value:e},"post");if(!Object.keys(t).length)throw new Error("Transaction not found");return t}async getConfirmedTransaction(e){const t=await this.tronWeb.solidityNode.request("walletsolidity/gettransactionbyid",{value:e},"post");if(!Object.keys(t).length)throw new Error("Transaction not found");return t}getUnconfirmedTransactionInfo(e){return this.tronWeb.fullNode.request("wallet/gettransactioninfobyid",{value:e},"post")}getTransactionInfo(e){return this.tronWeb.solidityNode.request("walletsolidity/gettransactioninfobyid",{value:e},"post")}getTransactionsToAddress(e=this.tronWeb.defaultAddress.hex,t=30,r=0){return this.getTransactionsRelated(mc(e),"to",t,r)}getTransactionsFromAddress(e=this.tronWeb.defaultAddress.hex,t=30,r=0){return this.getTransactionsRelated(mc(e),"from",t,r)}async getTransactionsRelated(e=this.tronWeb.defaultAddress.hex,t="all",r=30,n=0){if(this.tronWeb.fullnodeSatisfies(">=4.1.1"))throw new Error("This api is not supported any more");if(!["to","from","all"].includes(t))throw new Error('Invalid direction provided: Expected "to", "from" or "all"');if("all"==t){const[t,o]=await Promise.all([this.getTransactionsRelated(e,"from",r,n),this.getTransactionsRelated(e,"to",r,n)]);return[...t.map((e=>(e.direction="from",e))),...o.map((e=>(e.direction="to",e)))].sort(((e,t)=>t.raw_data.timestamp-e.raw_data.timestamp))}if(!this.tronWeb.isAddress(e))throw new Error("Invalid address provided");
1766if(!Ad.isInteger(r)||r<0||n&&r<1)throw new Error("Invalid limit provided");if(!Ad.isInteger(n)||n<0)throw new Error("Invalid offset provided");return e=mc(e),this.tronWeb.solidityNode.request(`walletextension/gettransactions${t}this`,{account:{address:e},offset:n,limit:r},"post").then((({transaction:e})=>e))}async getAccount(e=this.tronWeb.defaultAddress.hex){if(!this.tronWeb.isAddress(e))throw new Error("Invalid address provided");return e=mc(e),this.tronWeb.solidityNode.request("walletsolidity/getaccount",{address:e},"post")}getAccountById(e){return this.getAccountInfoById(e,{confirmed:!0})}async getAccountInfoById(e,t){return this.validator.notValid([{name:"accountId",type:"hex",value:e},{name:"accountId",type:"string",lte:32,gte:8,value:e}]),e.startsWith("0x")&&(e=e.slice(2)),this.tronWeb[t.confirmed?"solidityNode":"fullNode"].request(`wallet${t.confirmed?"solidity":""}/getaccountbyid`,{account_id:e},"post")}async getBalance(e=this.tronWeb.defaultAddress.hex){const{balance:t=0}=await this.getAccount(e);return t}async getUnconfirmedAccount(e=this.tronWeb.defaultAddress.hex){if(!this.tronWeb.isAddress(e))throw new Error("Invalid address provided");return e=mc(e),this.tronWeb.fullNode.request("wallet/getaccount",{address:e},"post")}getUnconfirmedAccountById(e){return this.getAccountInfoById(e,{confirmed:!1})}async getUnconfirmedBalance(e=this.tronWeb.defaultAddress.hex){const{balance:t=0}=await this.getUnconfirmedAccount(e);return t}async getBandwidth(e=this.tronWeb.defaultAddress.hex){if(!this.tronWeb.isAddress(e))throw new Error("Invalid address provided");return e=mc(e),this.tronWeb.fullNode.request("wallet/getaccountnet",{address:e},"post").then((({freeNetUsed:e=0,freeNetLimit:t=0,NetUsed:r=0,NetLimit:n=0})=>t-e+(n-r)))}async getTokensIssuedByAddress(e=this.tronWeb.defaultAddress.hex){if(!this.tronWeb.isAddress(e))throw new Error("Invalid address provided");return e=mc(e),this.tronWeb.fullNode.request("wallet/getassetissuebyaccount",{address:e},"post").then((({assetIssue:e})=>{if(!e)return{};return e.map((e=>this._parseToken(e))).reduce(((e,t)=>(e[t.name]=t,e)),{})}))}async getTokenFromID(e){if(Ad.isInteger(e)&&(e=e.toString()),!Ad.isString(e)||!e.length)throw new Error("Invalid token ID provided");return this.tronWeb.fullNode.request("wallet/getassetissuebyname",{value:this.tronWeb.fromUtf8(e)},"post").then((e=>{if(!e.name)throw new Error("Token does not exist");return this._parseToken(e)}))}async listNodes(){const{nodes:e=[]}=await this.tronWeb.fullNode.request("wallet/listnodes");return e.map((({address:{host:e,port:t}})=>`${this.tronWeb.toUtf8(e)}:${t}`))}async getBlockRange(e=0,t=30){if(!Ad.isInteger(e)||e<0)throw new Error("Invalid start of range provided");if(!Ad.isInteger(t)||t<e)throw new Error("Invalid end of range provided");if(t+1-e>100)throw new Error("Invalid range size, which should be no more than 100.");return this.tronWeb.fullNode.request("wallet/getblockbylimitnext",{startNum:parseInt(e),endNum:parseInt(t)+1},"post").then((({block:e=[]})=>e))}async listSuperRepresentatives(){const{witnesses:e=[]}=await this.tronWeb.fullNode.request("wallet/listwitnesses");return e}async listTokens(e=0,t=0){if(!Ad.isInteger(e)||e<0||t&&e<1)throw new Error("Invalid limit provided");if(!Ad.isInteger(t)||t<0)throw new Error("Invalid offset provided");return e?this.tronWeb.fullNode.request("wallet/getpaginatedassetissuelist",{offset:parseInt(t),limit:parseInt(e)},"post").then((({assetIssue:e=[]})=>e.map((e=>this._parseToken(e))))):this.tronWeb.fullNode.request("wallet/getassetissuelist").then((({assetIssue:e=[]})=>e.map((e=>this._parseToken(e)))))}async timeUntilNextVoteCycle(){const{num:e=-1}=await this.tronWeb.fullNode.request("wallet/getnextmaintenancetime");if(-1==e)throw new Error("Failed to get time until next vote cycle");return Math.floor(e/1e3)}async getContract(e){if(!this.tronWeb.isAddress(e))throw new Error("Invalid contract address provided");if(this.cache.contracts[e])return this.cache.contracts[e];e=mc(e);const t=await this.tronWeb.fullNode.request("wallet/getcontract",{value:e});if(t.Error)throw new Error("Contract does not exist");return this.cache.contracts[e]=t,t}async getContractInfo(e){if(!this.tronWeb.isAddress(e))throw new Error("Invalid contract address provided");e=mc(e);const t=await this.tronWeb.fullNode.request("wallet/getcontractinfo",{value:e});if(t.Error)throw new Error("Contract does not exist");return t}ecRecover(e){return bl.ecRecover(e)}static ecRecover(e){if(!_u(e))throw new Error("Invalid transaction");if(!e.signature?.length)throw new Error("Transaction is not signed");if(1===e.signature.length){const t=Sa(e.txID,e.signature[0]);return Sl.address.fromHex(t)}return e.signature.map((t=>{const r=Sa(e.txID,t);return Sl.address.fromHex(r)}))}async verifyMessage(e,t,r=this.tronWeb.defaultAddress.base58,n=!0){if(!Ad.isHex(e))throw new Error("Expected hex message input");if(bl.verifySignature(e,r,t,n))return!0;throw new Error("Signature does not match")}static verifySignature(e,t,r,n=!0){e=e.replace(/^0x/,"");const o=[...ct(n?ml:yl),...Ad.code.hexStr2byteArray(e)],s=qr(ft(new Uint8Array(o)),De.from(`0x${r.replace(/^0x/,"")}`)),i=I+s.substr(2);return Sl.address.fromHex(i)==Sl.address.fromHex(t)}async verifyMessageV2(e,t){return bl.verifyMessageV2(e,t)}static verifyMessageV2(e,t){return Ad.message.verifyMessage(e,t)}verifyTypedData(e,t,r,n,o=this.tronWeb.defaultAddress.base58){if(bl.verifyTypedData(e,t,r,n,o))return!0;throw new Error("Signature does not match")}static verifyTypedData(e,t,r,n,o){const s=qr(Ad.typedData.TypedDataEncoder.hash(e,t,r),De.from(`0x${n.replace(/^0x/,"")}`)),i=I+s.substr(2);return Sl.address.fromHex(i)==Sl.address.fromHex(o)}async sign(e,t=this.tronWeb.defaultPrivateKey,r=!0,n=!1){if(Ad.isString(e)){if(!Ad.isHex(e))throw new Error("Expected hex message input");return bl.signString(e,t,r)}if(!Ad.isObject(e))throw new Error("Invalid transaction provided");
1766if(!n&&e.signature)throw new Error("Transaction is already signed");if(!n){if(mc(this.tronWeb.address.fromPrivateKey(t)).toLowerCase()!==mc(e.raw_data.contract[0].parameter.value.owner_address))throw new Error("Private key does not match address in transaction")}if(!_u(e))throw new Error("Invalid transaction");return Ad.crypto.signTransaction(t,e)}static signString(e,t,r=!0){e=e.replace(/^0x/,"");const n=`0x${t.replace(/^0x/,"")}`,o=new zr(n),s=[...ct(r?ml:yl),...Ad.code.hexStr2byteArray(e)],i=ft(new Uint8Array(s)),a=o.sign(i);return["0x",a.r.substring(2),a.s.substring(2),Number(a.v).toString(16)].join("")}signMessageV2(e,t=this.tronWeb.defaultPrivateKey){return bl.signMessageV2(e,t)}static signMessageV2(e,t){return Ad.message.signMessage(e,t)}_signTypedData(e,t,r,n=this.tronWeb.defaultPrivateKey){return bl._signTypedData(e,t,r,n)}static _signTypedData(e,t,r,n){return Ad.typedData.signTypedData(e,t,r,n)}signTypedData(e,t,r,n=this.tronWeb.defaultPrivateKey){return bl.signTypedData(e,t,r,n)}static signTypedData(e,t,r,n){return Ad.typedData.signTypedData(e,t,r,n)}async multiSign(e,t=this.tronWeb.defaultPrivateKey,r=0){if(!Ad.isObject(e)||!e.raw_data||!e.raw_data.contract)throw new Error("Invalid transaction provided");if(!e.raw_data.contract[0].Permission_id&&r>0){e.raw_data.contract[0].Permission_id=r;const n=mc(this.tronWeb.address.fromPrivateKey(t)).toLowerCase(),o=await this.get
1766SignWeight(e,r);if("PERMISSION_ERROR"===o.result.code)throw new Error(o.result.message);let s=!1;if(o.permission.keys.map((e=>{e.address===n&&(s=!0)})),!s)throw new Error("Address "+gc(n)+" has no permission to sign");if(o.approved_list&&-1!=o.approved_list.indexOf(n))throw new Error("Address "+gc(n)+" already sign transaction");if(!o.transaction||!o.transaction.transaction)throw new Error("Invalid transaction provided");e=o.transaction.transaction,r>0&&(e.raw_data.contract[0].Permission_id=r)}if(!_u(e))throw new Error("Invalid transaction");return Ad.crypto.signTransaction(t,e)}async getApprovedList(e){if(!Ad.isObject(e))throw new Error("Invalid transaction provided");return this.tronWeb.fullNode.request("wallet/getapprovedlist",e,"post")}async getSignWeight(e,t){if(!Ad.isObject(e)||!e.raw_data||!e.raw_data.contract)throw new Error("Invalid transaction provided");return Ad.isInteger(t)?e.raw_data.contract[0].Permission_id=parseInt(t):"number"!=typeof e.raw_data.contract[0].Permission_id&&(e.raw_data.contract[0].Permission_id=0),this.tronWeb.fullNode.request("wallet/getsignweight",e,"post")}async sendRawTransaction(e){if(!Ad.isObject(e))throw new Error("Invalid transaction provided");if(!e.signature||!Ad.isArray(e.signature))throw new Error("Transaction is not signed");return{...await this.tronWeb.fullNode.request("wallet/broadcasttransaction",e,"post"),transaction:e}}async sendHexTransaction(e){if(!Ad.isHex(e))throw new Error("Invalid hex transaction provided");const t={transaction:e},r=await this.tronWeb.fullNode.request("wallet/broadcasthex",t,"post");return r.result?{...r,transaction:JSON.parse(r.transaction),hexTransaction:e}:r}async sendTransaction(e,t,r={}){if("string"==typeof r&&(r={privateKey:r}),!this.tronWeb.isAddress(e))throw new Error("Invalid recipient provided");if(!Ad.isInteger(t)||t<=0)throw new Error("Invalid amount provided");if(!(r={privateKey:this.tronWeb.defaultPrivateKey,address:this.tronWeb.defaultAddress.hex,...r}).privateKey&&!r.address)throw new Error("Function requires either a private key or address to be set");const n=r.privateKey?this.tronWeb.address.fromPrivateKey(r.privateKey):r.address,o=await this.tronWeb.transactionBuilder.sendTrx(e,t,n),s=await this.sign(o,r.privateKey);return await this.sendRawTransaction(s)}async sendToken(e,t,r,n={}){if("string"==typeof n&&(n={privateKey:n}),!this.tronWeb.isAddress(e))throw new Error("Invalid recipient provided");if(!Ad.isInteger(t)||t<=0)throw new Error("Invalid amount provided");if(Ad.isInteger(r)&&(r=r.toString()),!Ad.isString(r))throw new Error("Invalid token ID provided");if(!(n={privateKey:this.tronWeb.defaultPrivateKey,address:this.tronWeb.defaultAddress.hex,...n}).privateKey&&!n.address)throw new Error("Function requires either a private key or address to be set");const o=n.privateKey?this.tronWeb.address.fromPrivateKey(n.privateKey):n.address,s=await this.tronWeb.transactionBuilder.sendToken(e,t,r,o),i=await this.sign(s,n.privateKey);return await this.sendRawTransaction(i)}async freezeBalance(e=0,t=3,r="BANDWIDTH",n={},o){if("string"==typeof n&&(n={privateKey:n}),!["BANDWIDTH","ENERGY"].includes(r))throw new Error('Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"');if(!Ad.isInteger(e)||e<=0)throw new Error("Invalid amount provided");if(!Ad.isInteger(t)||t<3)throw new Error("Invalid duration provided, minimum of 3 days");if(!(n={privateKey:this.tronWeb.defaultPrivateKey,address:this.tronWeb.defaultAddress.hex,...n}).privateKey&&!n.address)throw new Error("Function requires either a private key or address to be set");const s=n.privateKey?this.tronWeb.address.fromPrivateKey(n.privateKey):n.address,i=await this.tronWeb.transactionBuilder.freezeBalance(e,t,r,s,o),a=await this.sign(i,n.privateKey);return await this.sendRawTransaction(a)}async unfreezeBalance(e="BANDWIDTH",t={},r){if("string"==typeof t&&(t={privateKey:t}),!["BANDWIDTH","ENERGY"].includes(e))throw new Error('Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"');if(!(t={privateKey:this.tronWeb.defaultPrivateKey,address:this.tronWeb.defaultAddress.hex,...t}).privateKey&&!t.address)throw new Error("Function requires either a private key or address to be set");const n=t.privateKey?this.tronWeb.address.fromPrivateKey(t.privateKey):t.address,o=await this.tronWeb.transactionBuilder.unfreezeBalance(e,n,r),s=await this.sign(o,t.privateKey);return await this.sendRawTransaction(s)}async updateAccount(e,t={}){if("string"==typeof t&&(t={privateKey:t}),!Ad.isString(e)||!e.length)throw new Error("Name must be a string");if(!(t={privateKey:this.tronWeb.defaultPrivateKey,address:this.tronWeb.defaultAddress.hex,...t}).privateKey&&!t.address)throw Error("Function requires either a private key or address to be set");const r=t.privateKey?this.tronWeb.address.fromPrivateKey(t.privateKey):t.address,n=await this.tronWeb.transactionBuilder.updateAccount(e,r),o=await this.sign(n,t.privateKey);return await this.sendRawTransaction(o)}async getProposal(e){if(!Ad.isInteger(e)||e<0)throw new Error("Invalid proposalID provided");return this.tronWeb.fullNode.request("wallet/getproposalbyid",{id:parseInt(e)},"post")}async listProposals(){const{proposals:e=[]}=await this.tronWeb.fullNode.request("wallet/listproposals",{},"post");return e}async getChainParameters(){const{chainParameter:e=[]}=await this.tronWeb.fullNode.request("wallet/getchainparameters",{},"post");return e}async getAccountResources(e=this.tronWeb.defaultAddress.hex){if(!this.tronWeb.isAddress(e))throw new Error("Invalid address provided");return this.tronWeb.fullNode.request("wallet/getaccountresource",{address:mc(e)},"post")}async getDelegatedResourceV2(e=this.tronWeb.defaultAddress.hex,t=this.tronWeb.defaultAddress.hex,r={confirmed:!0}){if(!this.tronWeb.isAddress(e))throw new Error("Invalid address provided");
1766if(!this.tronWeb.isAddress(t))throw new Error("Invalid address provided");return this.tronWeb[r.confirmed?"solidityNode":"fullNode"].request(`wallet${r.confirmed?"solidity":""}/getdelegatedresourcev2`,{fromAddress:mc(e),toAddress:mc(t)},"post")}async getDelegatedResourceAccountIndexV2(e=this.tronWeb.defaultAddress.hex,t={confirmed:!0}){if(!this.tronWeb.isAddress(e))throw new Error("Invalid address provided");return this.tronWeb[t.confirmed?"solidityNode":"fullNode"].request(`wallet${t.confirmed?"solidity":""}/getdelegatedresourceaccountindexv2`,{value:mc(e)},"post")}async getCanDelegatedMaxSize(e=this.tronWeb.defaultAddress.hex,t="BANDWIDTH",r={confirmed:!0}){if(!this.tronWeb.isAddress(e))throw new Error("Invalid address provided");return this.validator.notValid([{name:"resource",type:"resource",value:t,msg:'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"'}]),this.tronWeb[r.confirmed?"solidityNode":"fullNode"].request(`wallet${r.confirmed?"solidity":""}/getcandelegatedmaxsize`,{owner_address:mc(e),type:"ENERGY"===t?1:0},"post")}async getAvailableUnfreezeCount(e=this.tronWeb.defaultAddress.hex,t={confirmed:!0}){if(!this.tronWeb.isAddress(e))throw new Error("Invalid address provided");return this.tronWeb[t.confirmed?"solidityNode":"fullNode"].request(`wallet${t.confirmed?"solidity":""}/getavailableunfreezecount`,{owner_address:mc(e)},"post")}async getCanWithdrawUnfreezeAmount(e=this.tronWeb.defaultAddress.hex,t=Date.now(),r={confirmed:!0}){if(!this.tronWeb.isAddress(e))throw new Error("Invalid address provided");if(!Ad.isInteger(t)||t<0)throw new Error("Invalid timestamp provided");return this.tronWeb[r.confirmed?"solidityNode":"fullNode"].request(`wallet${r.confirmed?"solidity":""}/getcanwithdrawunfreezeamount`,{owner_address:mc(e),timestamp:t},"post")}async getExchangeByID(e){if(!Ad.isInteger(e)||e<0)throw new Error("Invalid exchangeID provided");return this.tronWeb.fullNode.request("wallet/getexchangebyid",{id:e},"post")}async listExchanges(){return this.tronWeb.fullNode.request("wallet/listexchanges",{},"post").then((({exchanges:e=[]})=>e))}async listExchangesPaginated(e=10,t=0){return this.tronWeb.fullNode.request("wallet/getpaginatedexchangelist",{limit:e,offset:t},"post").then((({exchanges:e=[]})=>e))}async getNodeInfo(){return this.tronWeb.fullNode.request("wallet/getnodeinfo",{},"post")}async getTokenListByName(e){if(Ad.isInteger(e)&&(e=e.toString()),!Ad.isString(e)||!e.length)throw new Error("Invalid token ID provided");return this.tronWeb.fullNode.request("wallet/getassetissuelistbyname",{value:this.tronWeb.fromUtf8(e)},"post").then((e=>{if(Array.isArray(e.assetIssue))return e.assetIssue.map((e=>this._parseToken(e)));if(!e.name)throw new Error("Token does not exist");return this._parseToken(e)}))}getTokenByID(e){if(Ad.isInteger(e)&&(e=e.toString()),!Ad.isString(e)||!e.length)throw new Error("Invalid token ID provided");return this.tronWeb.fullNode.request("wallet/getassetissuebyid",{value:e},"post").then((e=>{if(!e.name)throw new Error("Token does not exist");return this._parseToken(e)}))}async getReward(e,t={}){return t.confirmed=!0,this._getReward(e,t)}async getUnconfirmedReward(e,t={}){return t.confirmed=!1,this._getReward(e,t)}async getBrokerage(e,t={}){return t.confirmed=!0,this._getBrokerage(e,t)}async getUnconfirmedBrokerage(e,t={}){return t.confirmed=!1,this._getBrokerage(e,t)}async _getReward(e=this.tronWeb.defaultAddress.hex,t){this.validator.notValid([{name:"origin",type:"address",value:e}]);const r={address:mc(e)};return this.tronWeb[t.confirmed?"solidityNode":"fullNode"].request(`wallet${t.confirmed?"solidity":""}/getReward`,r,"post").then(((e={reward:void 0})=>{if(void 0===e.reward)throw new Error("Not found.");return e.reward}))}async _getBrokerage(e=this.tronWeb.defaultAddress.hex,t){this.validator.notValid([{name:"origin",type:"address",value:e}]);const r={address:mc(e)};return this.tronWeb[t.confirmed?"solidityNode":"fullNode"].request(`wallet${t.confirmed?"solidity":""}/getBrokerage`,r,"post").then(((e={})=>{if(void 0===e.brokerage)throw new Error("Not found.");return e.brokerage}))}async getBandwidthPrices(){return this.tronWeb.fullNode.request("wallet/getbandwidthprices",{},"post").then(((e={})=>
1766{if(void 0===e.prices)throw new Error("Not found.");return e.prices}))}async getEnergyPrices(){return this.tronWeb.fullNode.request("wallet/getenergyprices",{},"post").then(((e={})=>{if(void 0===e.prices)throw new Error("Not found.");return e.prices}))}async getCurrentRefBlockParams(){try{const{block_header:e,blockID:t}=await this.tronWeb.fullNode.request("wallet/getblock",{detail:!1},"post"),{number:r,timestamp:n}=e.raw_data;return{ref_block_bytes:r.toString(16).slice(-4).padStart(4,"0"),ref_block_hash:t.slice(16,32),expiration:n+6e4,timestamp:n}}catch(e){throw new Error(`Unable to get params: ${e.message||e}`)}}async getNowWitnessList(e={}){const{offset:t=0,limit:r=10,visible:n=!1,confirmed:o=!0}=e;this.validator.notValid([{name:"offset",type:"integer",gte:0,value:t,msg:"Invalid offset: must be an integer >= 0"},{name:"limit",type:"integer",gt:0,value:r,msg:"Invalid limit: must be an integer > 0"},{name:"visible",type:"boolean",value:n,msg:"Invalid visible: must be a boolean"}]);const s={offset:Number(t),limit:Number(r),visible:n},i=o?this.tronWeb.solidityNode:this.tronWeb.fullNode,a=`wallet${o?"solidity":""}/getpaginatednowwitnesslist`,c=await i.request(a,s,"post");if(c?.Error)throw new Error(c.Error);return Array.isArray(c?.witnesses)?c.witnesses:[]}}const wl=(e,t)=>Bc(e,t);class vl{tronWeb;contract;abi;name;inputs;outputs;functionSelector;signature;defaultOptions;constructor(e,t){this.tronWeb=e.tronWeb,this.contract=e,this.abi=t,this.name=t.name||t.type,this.inputs=t.inputs||[],this.outputs=[],"outputs"in t&&t.outputs&&(this.outputs=t.outputs),this.functionSelector=(e=>{if("stateMutability"in e&&(e.stateMutability=e.stateMutability?e.stateMutability.toLowerCase():"nonpayable"),e.type=e.type?e.type.toLowerCase():"","fallback"===e.type||"receive"===e.type)return"0x";const t=new Ad.ethersUtils.Interface([e]);let r;if(r="event"===e.type?t.getEvent(e.name):t.getFunction(e.name),r)return r.format("sighash");throw new Error("unknown function")})(t),this.signature=Ka(this.functionSelector,!1).slice(0,8),this.defaultOptions={feeLimit:this.tronWeb.feeLimit,callValue:0,shouldPollResponse:!1}}decodeInput(e){const t=JSON.parse(JSON.stringify(this.abi));return t.outputs=t.inputs,wl(t,"0x"+e)}onMethod(...e){let t="";return this.abi&&!/event/i.test(this.abi.type)&&(t=xc(this.abi,e)),{call:async(e={})=>(e={...e,rawParameter:t},await this._call([],[],e)),send:async(e={},r=this.tronWeb.defaultPrivateKey)=>(e={...e,rawParameter:t},await this._send([],[],e,r))}}async _call(e,t,r={}){if(e.length!==t.length)throw new Error("Invalid argument count provided");if(!this.contract.address)throw new Error("Smart contract is missing address");if(!this.contract.deployed)throw new Error("Calling smart contracts requires you to load the contract first");
1766if("stateMutability"in this.abi){const{stateMutability:e}=this.abi;if(e&&!["pure","view"].includes(e.toLowerCase()))throw new Error(`Methods with state mutability "${e}" must use send()`)}r={...this.defaultOptions,from:this.tronWeb.defaultAddress.hex,...r,_isConstant:!0};const n=t.map(((t,r)=>({type:e[r],value:t}))),o=await this.tronWeb.transactionBuilder.triggerSmartContract(this.contract.address,this.functionSelector,r,n,r.from?this.tronWeb.address.toHex(r.from):void 0);if(!Ad.hasProperty(o,"constant_result"))throw new Error("Failed to execute");const s=o.constant_result[0].length;if(0===s||s%64==8){let e="The call has been reverted or has thrown an error.";if(0!==s){e+=" Error message: ";let t="";const r=o.constant_result[0].substring(8);for(let e=0;e<s-8;e+=64)t+=this.tronWeb.toUtf8(r.substring(e,e+64));e+=t.replace(/(\u0000|\u000b|\f)+/g," ").replace(/ +/g," ").replace(/\s+$/g,"")}throw new Error(e)}const i=wl(this.abi,"0x"+o.constant_result[0]);return 1===i.length&&1===Object.keys(i).length?i[0]:i}async _send(e,t,r={},n=this.tronWeb.defaultPrivateKey){if(e.length!==t.length)throw new Error("Invalid argument count provided");if(!this.contract.address)throw new Error("Smart contract is missing address");if(!this.contract.deployed)throw new Error("Calling smart contracts requires you to load the contract first");const{stateMutability:o}=this.abi;if(["pure","view"].includes(o.toLowerCase()))throw new Error(`Methods with state mutability "${o}" must use call()`);["payable"].includes(o.toLowerCase())||(r.callValue=0),r={...this.defaultOptions,from:this.tronWeb.defaultAddress.hex,...r};const s=t.map(((t,r)=>({type:e[r],value:t}))),i=n?this.tronWeb.address.fromPrivateKey(n):this.tronWeb.defaultAddress.base58,a=await this.tronWeb.transactionBuilder.triggerSmartContract(this.contract.address,this.functionSelector,r,s,this.tronWeb.address.toHex(i));if(!a.result||!a.result.result)throw new Error("Unknown error: "+JSON.stringify(a,null,2));const c=await this.tronWeb.trx.sign(a.transaction,n);if(!c.signature){if(!n)throw new Error("Transaction was not signed properly");throw new Error("Invalid private key provided")}const l=await this.tronWeb.trx.sendRawTransaction(c);if(l.code){const e={error:l.code,message:l.code};l.message&&(e.message=this.tronWeb.toUtf8(l.message));const t=new Error(e.message);throw t.error=l.code,t}if(!r.shouldPollResponse)return c.txID;const u=async e=>{if(e===(r.pollTimes||20)){const e=new Error("Cannot find result in solidity node");throw e.error="Cannot find result in solidity node",e.transaction=c,e}const t=await this.tronWeb.trx.getTransactionInfo(c.txID);if(!Object.keys(t).length)return await new Promise((e=>setTimeout(e,3e3))),u(e+1);if(t.result&&"FAILED"===t.result){const e=new Error(this.tronWeb.toUtf8(t.resMessage));throw e.error=this.tronWeb.toUtf8(t.resMessage),e.transaction=c,e.output=t,e}if(!Ad.hasProperty(t,"contractResult")){const e=new Error("Failed to execute: "+JSON.stringify(t,null,2));throw e.error="Failed to execute: "+JSON.stringify(t,null,2),e.transaction=c,e.output=t,e}if(r.rawResponse)return t;let n=wl(this.abi,"0x"+t.contractResult[0]);return 1===n.length&&1===Object.keys(n).length?(n=n[0],r.keepTxID?[c.txID,n]:n):r.keepTxID?[c.txID,n]:n};return u(0)}}class Al{tronWeb;abi;address;eventListener;bytecode;deployed;lastBlock;methods;methodInstances;props;constructor(e,t=[],r){if(!(e&&e instanceof Sl))throw new Error("Expected instance of TronWeb");this.tronWeb=e,this.address=r,this.abi=t,this.eventListener=!1,this.bytecode=!1,this.deployed=!1,this.lastBlock=!1,this.methods={},this.methodInstances={},this.props=[],Ad.address.isAddress(r)?this.deployed=!0:this.address=!1,this.loadAbi(t)}hasProperty(e){return this.hasOwnProperty(e)||this.__proto__.hasOwnProperty(e)}loadAbi(e){this.abi=e,this.methods={},this.props.forEach((e=>delete this[e])),e.forEach((e=>{if(!e.type||["constructor","error"].includes(e.type.toLowerCase()))return;const t=new vl(this,e),r=t.onMethod.bind(t),{name:n,functionSelector:o,signature:s}=t,i=n,a=o,c=s;this.methods[n]=r,this.methods[o]=r,this.methods[s]=r,this.methodInstances[i]=t,this.methodInstances[a]=t,this.methodInstances[c]=t,this.hasProperty(n)||(this[n]=r,this.props.push(n)),this.hasProperty(o)||(this[o]=r,this.props.push(o)),this.hasProperty(s)||(this[s]=r,this.props.push(s))}))}decodeInput(e){const t=e.substring(0,8),r=e.substring(8);if(!this.methodInstances[t])throw new Error("Contract method "+t+" not found");return{name:this.methodInstances[t].name,params:this.methodInstances[t].decodeInput(r)}}async new(e,t=this.tronWeb.defaultPrivateKey){const r=this.tronWeb.address.fromPrivateKey(t),n=await this.tronWeb.transactionBuilder.createSmartContract(e,r),o=await this.tronWeb.trx.sign(n,t),s=await this.tronWeb.trx.sendRawTransaction(o);if(s.code)throw{error:s.code,message:this.tronWeb.toUtf8(s.message)};await Ad.sleep(3e3);const i=o.raw_data.contract[0].parameter.value.new_contract.abi.entrys||[];return this.tronWeb.contract(i,o.contract_address)}async at(e){try{const t=await this.tronWeb.trx.getContract(e);if(!t.contract_address)throw new Error("Unknown error: "+JSON.stringify(t,null,2));return this.address=t.contract_address,this.bytecode=t.bytecode,this.deployed=!0,this.loadAbi(t.abi&&t.abi.entrys?t.abi.entrys:[]),this}catch(e){if(e.toString().includes("does not exist"))throw new Error("Contract has not been deployed on the network");throw new Error(e)}}}const Tl=["transactionBuilder","plugin"],Pl=["sign","signMessage","signMessageV2","signTransaction","signTypedData","multiSign","setPrivateKey","ecRecover"];class El{tronWeb;pluginNoOverride;disablePlugins;constructor(e,t={}){if(!(e&&e instanceof Sl))throw new Error("Expected instance of TronWeb");this.tronWeb=e,this.pluginNoOverride=["register"],this.disablePlugins=!!t.disablePlugins}register(e,t){let r={requires:"0.0.0",components:{}};const n={libs:[],plugged:[],skipped:[],error:void 0};if(this.disablePlugins)return n.error="This instance of TronWeb has plugins disabled.",n;const o=new e(this.tronWeb);if(Ad.isFunction(o.pluginInterface)&&(r=o.pluginInterface(t)),!il.satisfies(Sl.version,r.requires))throw new Error("The plugin is not compatible with this version of TronWeb");if(r.fullClass){const t=o.constructor.name,r=t.substring(0,1).toLowerCase()+t.substring(1);t!==r&&(Object.assign(Sl,{[t]:e}),Object.assign(this.tronWeb,{[r]:o}),n.libs.push(t))}
1766else for(const e in r.components){if(Tl.includes(e)){console.warn(`[TronWeb] Plugin attempted to override protected module "${e}", which is not allowed. Plugin support will be removed in the next major version.`),n.skipped.push(e);continue}if(!this.tronWeb.hasOwnProperty(e))continue;const t=r.components[e],o=this.tronWeb[e].pluginNoOverride||[];for(const r in t)"constructor"===r||Pl.includes(r)||this.tronWeb[e][r]&&(o.includes(r)||/^_/.test(r))?n.skipped.push(r):(this.tronWeb[e][r]=t[r].bind(this.tronWeb[e]),n.plugged.push(r))}return n}}class Cl{tronWeb;constructor(e){if(!(e&&e instanceof Sl))throw new Error("Expected instance of TronWeb");this.tronWeb=e}setServer(e,t="healthcheck"){if(!e)return this.tronWeb.eventServer=void 0;if(Ad.isString(e)&&(e=new el(e)),!this.tronWeb.isValidProvider(e))throw new Error("Invalid event server provided");this.tronWeb.eventServer=e,this.tronWeb.eventServer.isConnected=()=>this.tronWeb.eventServer.request(t).then((()=>!0)).catch((()=>!1))}async getEventsByContractAddress(e,t={}){const r=Object.assign({limit:20},t),{eventName:n,blockNumber:o,onlyUnconfirmed:s,onlyConfirmed:i,minBlockTimestamp:a,maxBlockTimestamp:c,orderBy:l,fingerprint:u}=r;let{limit:d}=r;if(!this.tronWeb.eventServer)throw new Error("No event server configured");if(!this.tronWeb.isAddress(e))throw new Error("Invalid contract address provided");if(void 0!==a&&!Ad.isInteger(a))throw new Error("Invalid minBlockTimestamp provided");if(void 0!==c&&!Ad.isInteger(c))throw new Error("Invalid maxBlockTimestamp provided");Ad.isInteger(d)&&d>200&&(console.warn("Defaulting to maximum accepted limit: 200"),d=200);const h={};n&&(h.event_name=n),o&&(h.block_number=o),"boolean"==typeof s&&(h.only_unconfirmed=s),"boolean"==typeof i&&(h.only_confirmed=i),a&&(h.min_block_timestamp=a),c&&(h.max_block_timestamp=c),l&&(h.order_by=l),u&&(h.fingerprint=u),Ad.isInteger(d)&&(h.limit=d);const p=await this.tronWeb.eventServer.request(`v1/contracts/${this.tronWeb.address.fromHex(e)}/events?${new URLSearchParams(h).toString()}`);if(p.success)return p;throw new Error(p.error)}async getEventsByTransactionID(e,t={}){if(!this.tronWeb.eventServer)throw new Error("No event server configured");if(!/^[0-9a-fA-F]{64}$/.test(e))throw new Error("Invalid transactionID provided");const r={};return"boolean"==typeof t.only_unconfirmed&&(r.only_unconfirmed=t.only_unconfirmed),"boolean"==typeof t.only_confirmed&&(r.only_confirmed=t.only_confirmed),this.tronWeb.eventServer.request(`v1/transactions/${e}/events?${new URLSearchParams(r).toString()}`).then((e=>{if(e.success)return e;throw new Error(JSON.parse(e.error).message)}))}async getEventsByBlockNumber(e,t={}){if(!this.tronWeb.eventServer)throw new Error("No event server configured");const r={};return"boolean"==typeof t.only_confirmed&&(r.only_confirmed=t.only_confirmed),t.limit&&(r.limit=t.limit),t.fingerprint&&(r.fingerprint=t.fingerprint),this.tronWeb.eventServer.request(`v1/blocks/${encodeURIComponent(String(e))}/events?${new URLSearchParams(r).toString()}`).then((e=>{if(e.success)return e;throw new Error(e.error)}))}async getEventsOfLatestBlock(e={}){if(!this.tronWeb.eventServer)throw new Error("No event server configured");const t={};return"boolean"==typeof e.only_confirmed&&(t.only_confirmed=e.only_confirmed),this.tronWeb.eventServer.request(`v1/blocks/latest/events?${new URLSearchParams(t).toString()}`).then((e=>{if(e.success)return e;throw new Error(e.error)}))}}var kl=r("./node_modules/buffer/index.js").Buffer;const _l="4.7.1";function Il(e){return!(!e||"object"!=typeof e||!e.fullNode&&!e.fullHost)}class Sl extends sl.A{providers;BigNumber;transactionBuilder;trx;plugin;event;version;static version="6.3.0";utils;defaultBlock;defaultPrivateKey;defaultAddress;fullnodeVersion;feeLimit;fullNode;solidityNode;eventServer;constructor(e,t="",r,n=""){let o;super();let s=!1,i=!1;Il(e)?(o=e.fullNode||e.fullHost,t=e.solidityNode||e.fullHost,r=e.eventServer||e.fullHost,s=e.headers||!1,i=e.eventHeaders||s,n=e.privateKey):o=e,Ad.isString(o)&&(o=new tl.HttpProvider(o)),Ad.isString(t)&&(t=new tl.HttpProvider(t)),Ad.isString(r)&&(r=new tl.HttpProvider(r)),this.event=new Cl(this),this.transactionBuilder=new gl(this),this.trx=new bl(this),this.plugin=new El(this,{disablePlugins:!!Il(e)&&e.disablePlugins}),this.utils=Ad,this.setFullNode(o),this.setSolidityNode(t),this.setEventServer(r),this.providers=tl,this.BigNumber=Ja.g,this.defaultBlock=!1,this.defaultPrivateKey=!1,this.defaultAddress={hex:!1,base58:!1},this.version=Sl.version,this.sha3=Sl.sha3,this.fromUtf8=Sl.fromUtf8,this.address=Sl.address,this.toAscii=Sl.toAscii,this.toUtf8=Sl.toUtf8,this.isAddress=Sl.isAddress,this.fromAscii=Sl.fromAscii,this.toHex=Sl.toHex,this.toBigNumber=Sl.toBigNumber,this.toDecimal=Sl.toDecimal,this.fromDecimal=Sl.fromDecimal,this.toSun=Sl.toSun,this.fromSun=Sl.fromSun,this.createAccount=Sl.createAccount,this.createRandom=Sl.createRandom,this.fromMnemonic=Sl.fromMnemonic,n&&this.setPrivateKey(n),this.fullnodeVersion=_l,this.feeLimit=15e7,s&&this.setFullNodeHeader(s),i&&this.setEventHeader(i)}async getFullnodeVersion(){try{const e=await this.trx.getNodeInfo();this.fullnodeVersion=e.configNodeInfo.codeVersion,2===this.fullnodeVersion.split(".").length&&(this.fullnodeVersion+=".0")}catch(e){this.fullnodeVersion=_l}}setDefaultBlock(e=!1){if([!1,"latest","earliest",0].includes(e))return this.defaultBlock=e;if(!Ad.isInteger(e)||!e)throw new Error("Invalid block ID provided");return this.defaultBlock=Math.abs(e)}setPrivateKey(e){try{this.setAddress(Sl.address.fromPrivateKey(e))}catch{throw new Error("Invalid private key provided")}this.defaultPrivateKey=e}setAddress(e){if(!Sl.isAddress(e))throw new Error("Invalid address provided");const t=Sl.address.toHex(e),r=Sl.address.fromHex(e);this.defaultPrivateKey&&Sl.address.fromPrivateKey(this.defaultPrivateKey)!==r&&(this.defaultPrivateKey=!1),this.defaultAddress={hex:t,base58:r}
1766,this.emit("addressChanged",{hex:t,base58:r})}fullnodeSatisfies(e){return il.satisfies(this.fullnodeVersion,e)}isValidProvider(e){return Object.values(tl).some((t=>e instanceof t))}setFullNode(e){if(oc(e)&&(e=new tl.HttpProvider(e)),!this.isValidProvider(e))throw new Error("Invalid full node provided");this.fullNode=e,this.fullNode.setStatusPage("wallet/getnowblock")}setSolidityNode(e){if(Ad.isString(e)&&(e=new tl.HttpProvider(e)),!this.isValidProvider(e))throw new Error("Invalid solidity node provided");this.solidityNode=e,this.solidityNode.setStatusPage("walletsolidity/getnowblock")}setEventServer(e,t){this.event.setServer(e,t)}setHeader(e={}){const t=new tl.HttpProvider(this.fullNode.host,3e4,"","",e),r=new tl.HttpProvider(this.solidityNode.host,3e4,"","",e),n=new tl.HttpProvider(this.eventServer.host,3e4,"","",e);this.setFullNode(t),this.setSolidityNode(r),this.setEventServer(n)}setFullNodeHeader(e={}){const t=new tl.HttpProvider(this.fullNode.host,3e4,"","",e),r=new tl.HttpProvider(this.solidityNode.host,3e4,"","",e);this.setFullNode(t),this.setSolidityNode(r)}setEventHeader(e={}){const t=new tl.HttpProvider(this.eventServer.host,3e4,"","",e);this.setEventServer(t)}currentProviders(){return{fullNode:this.fullNode,solidityNode:this.solidityNode,eventServer:this.eventServer}}currentProvider(){return this.currentProviders()}getEventResult(...e){return this.event.getEventsByContractAddress(...e)}getEventByTransactionID(...e){return this.event.getEventsByTransactionID(...e)}contract(e=[],t){return new Al(this,e,t)}address;static get address(){return{fromHex:e=>gc(e),toHex:e=>mc(e),toChecksumAddress:e=>yc(e),isChecksumAddress:e=>bc(e),fromPrivateKey:(e,t=!1)=>wc(e,t)}}sha3;static sha3(e,t=!0){return(t?"0x":"")+ft(kl.from(e,"utf-8")).toString().substring(2)}toHex;static toHex(e){if(Ad.isBoolean(e))return Sl.fromDecimal(+e);if(Ad.isBigNumber(e))return Sl.fromDecimal(e);if("object"==typeof e)return Sl.fromUtf8(JSON.stringify(e));if(Ad.isString(e)){if(/^(-|)0x/.test(e))return e;if(!isFinite(e)||/^\s*$/.test(e))return Sl.fromUtf8(e)}const t=Sl.fromDecimal(e);if("0xNaN"===t)throw new Error("The passed value is not convertible to a hex string");return t}toUtf8;static toUtf8(e){if(Ad.isHex(e))return e=e.replace(/^0x/,""),kl.from(e,"hex").toString("utf8");throw new Error("The passed value is not a valid hex string")}fromUtf8;static fromUtf8(e){if(!Ad.isString(e))throw new Error("The passed value is not a valid utf-8 string");return"0x"+kl.from(e,"utf8").toString("hex")}toAscii;static toAscii(e){if(Ad.isHex(e)){let t="",r=0;const n=e.length;for("0x"===e.substring(0,2)&&(r=2);r<n;r+=2){const n=parseInt(e.substr(r,2),16);t+=String.fromCharCode(n)}return t}throw new Error("The passed value is not a valid hex string")}fromAscii;static fromAscii(e,t){if(!Ad.isString(e))throw new Error("The passed value is not a valid utf-8 string");return"0x"+kl.from(e,"ascii").toString("hex").padEnd(t,"0")}toDecimal;static toDecimal(e){return Sl.toBigNumber(e).toNumber()}fromDecimal;static fromDecimal(e){const t=Sl.toBigNumber(e),r=t.toString(16);return t.isLessThan(0)?"-0x"+r.substr(1):"0x"+r}fromSun;static fromSun(e){const t=Sl.toBigNumber(e).div(1e6);return Ad.isBigNumber(e)?t:t.toString(10)}toSun;static toSun(e){const t=Sl.toBigNumber(e).times(1e6);return Ad.isBigNumber(e)?t:t.toString(10)}toBigNumber;static toBigNumber(e=0){return Ad.isBigNumber(e)?e:Ad.isString(e)&&/^(-|)0x/.test(e)?new Ja.g(e.replace("0x",""),16):new Ja.g(e.toString(10),10)}isAddress;static isAddress(e=""){return vc(e)}createAccount;static async createAccount(){return Ad.accounts.generateAccount()}createRandom;static createRandom(...e){return Ad.accounts.generateRandom(...e)}fromMnemonic;static fromMnemonic(...e){return Ad.accounts.generateAccountWithMnemonic(...e)}async isConnected(){return{fullNode:await this.fullNode.isConnected(),solidityNode:await this.solidityNode.isConnected(),eventServer:this.eventServer&&await this.eventServer.isConnected()}}}const xl=Sl;var Bl=r("./node_modules/buffer/index.js").Buffer;const{Transaction:Ol,Permission:Ml,Key:Wl}=globalThis.TronWebProto,{TransferContract:jl,FreezeBalanceContract:Rl,UnfreezeBalanceContract:Nl,WithdrawBalanceContract:Ul,FreezeBalanceV2Contract:Dl,UnfreezeBalanceV2Contract:Ll,CancelAllUnfreezeV2Contract:Fl,W
1766ithdrawExpireUnfreezeContract:zl,DelegateResourceContract:Vl,UnDelegateResourceContract:ql}=globalThis.TronWebProto,{TransferAssetContract:Hl,ParticipateAssetIssueContract:Kl,AssetIssueContract:$l,UpdateAssetContract:Gl}=globalThis.TronWebProto,{TriggerSmartContract:Yl,ClearABIContract:Jl,UpdateEnergyLimitContract:Ql,UpdateSettingContract:Zl,CreateSmartContract:Xl,SmartContract:eu}=globalThis.TronWebProto,{ResourceCode:tu}=globalThis.TronWebProto,{WitnessCreateContract:ru,VoteWitnessContract:nu}=globalThis.TronWebProto,{UpdateBrokerageContract:ou}=globalThis.TronWebProto,{AccountCreateContract:su,AccountUpdateContract:iu,SetAccountIdContract:au,AccountPermissionUpdateContract:cu}=globalThis.TronWebProto,{ProposalCreateContract:lu,ProposalDeleteContract:uu,ProposalApproveContract:du}=globalThis.TronWebProto,{ExchangeCreateContract:hu,ExchangeInjectContract:pu,ExchangeWithdrawContract:fu,ExchangeTransactionContract:gu}=globalThis.TronWebProto,mu=e=>e&&0!==e.length?new Uint8Array(xl.address.toHex(e).match(/.{1,2}/g).map((e=>parseInt(e,16)))):new Uint8Array([]),yu=e=>e&&0!==e.length?new Uint8Array((ic(e)?e:xl.toHex(e)).replace(/^0x/,"").match(/.{1,2}/g).map((e=>parseInt(e,16)))):new Uint8Array([]),bu=(e,t)=>yu(t?xl.fromUtf8(e).replace(/^0x/,""):e.replace(/^0x/,"")),wu=(e,t,r,n)=>{const o=new Zc.Any;o.pack(e.serializeBinary(),"protocol."+r);const s=new Ol.Contract;s.setType(t),s.setParameter(o),n&&s.setPermissionId(n);const i=new Ol.raw;i.addContract(s);const a=new Ol;return a.setRawData(i),a},vu=(e,t)=>{const r=new Yl,{owner_address:n,contract_address:o,parameter:s="",function_selector:i,call_value:a,call_token_value:c,token_id:l,data:u}=e;if(r.setOwnerAddress(mu(n)),r.setContractAddress(mu(o)),r.setCallValue(a),u)r.setData(yu(u));else if(i){const e=((e,t=!0)=>(t?"0x":"")+ft(Bl.from(e,"utf-8")).toString().substring(2))(i).substring(2,10)+s;r.setData(yu(e))}return l&&r.setTokenId(l),c&&r.setCallTokenValue(c),wu(r,Ol.Contract.ContractType.TRIGGERSMARTCONTRACT,"TriggerSmartContract",t.Permission_id)},Au=(e,t)=>{const r=new cu,{owner_address:n,owner:o,witness:s,actives:i}=e;r.setOwnerAddress(mu(n));const a=e=>{const t=new Ml,{type:r,id:n,permission_name:o,threshold:s,parentId:i,operations:a,keys:c}=e;return t.setType((e=>isNaN(e)?"Active"===e?2:"Witness"===e?1:0:e)(r)),t.setId(n),t.setPermissionName(o),t.setThreshold(s),i&&t.setParentId(i),a&&t.setOperations(yu(a)),c&&t.setKeysList(c.map((e=>{const t=new Wl;return t.setAddress(mu(e.address)),t.setWeight(e.weight),t}))),t};return o&&r.setOwner(a(o)),s&&r.setWitness(a(s)),i&&(Array.isArray(i)?r.setActivesList(i.map((e=>a(e)))):r.setActivesList([a(i)])),wu(r,Ol.Contract.ContractType.ACCOUNTPERMISSIONUPDATECONTRACT,"AccountPermissionUpdateContract",t.Permission_id)},Tu=(e,t,r)=>{switch(e.type){case"TransferContract":return((e,t)=>{const{to_address:r,owner_address:n,amount:o}=e,s=new jl;return s.setToAddress(mu(r)),s.setOwnerAddress(mu(n)),s.setAmount(o),wu(s,Ol.Contract.ContractType.TRANSFERCONTRACT,"TransferContract",t.Permission_id)})(t,r);case"TransferAssetContract":return((e,t)=>{const{to_address:r,owner_address:n,amount:o,asset_name:s}=e,i=new Hl;return i.setToAddress(mu(r)),i.setOwnerAddress(mu(n)),i.setAssetName(bu(s,t.visible)),i.setAmount(o),wu(i,Ol.Contract.ContractType.TRANSFERASSETCONTRACT,"TransferAssetContract",t.Permission_id)})(t,r);case"ParticipateAssetIssueContract":return((e,t)=>{const r=new Kl;return r.setToAddress(mu(e.to_address)),r.setOwnerAddress(mu(e.owner_address)),r.setAssetName(bu(e.asset_name,t.visible)),r.setAmount(e.amount),wu(r,Ol.Contract.ContractType.PARTICIPATEASSETISSUECONTRACT,"ParticipateAssetIssueContract",t.Permission_id)})(t,r);case"TriggerSmartContract":return vu(t,r);case"FreezeBalanceContract":return((e,t)=>{const r=new Rl,{owner_address:n,frozen_balance:o,frozen_duration:s,resource:i,receiver_address:a}=e;return r.setOwnerAddress(mu(n)),r.setFrozenBalance(o),r.setFrozenDuration(s),i&&r.setResource(tu[i]),a&&r.setReceiverAddress(mu(a)),wu(r,Ol.Contract.ContractType.FREEZEBALANCECONTRACT,"FreezeBalanceContract",t.Permission_id)})(t,r);case"UnfreezeBalanceContract":return((e,t)=>{const r=new Nl,{owner_address:n,resource:o,receiver_address:s}=e;return r.setOwnerAddress(mu(n)),o&&r.setResource(tu[o]),s&&r.setReceiverAddress(mu(s)),wu(r,Ol.Contract.ContractType.UNFREEZEBALANCECONTRACT,"UnfreezeBalanceContract",t.Permission_id)})(t,r);case"WithdrawBalanceContract":return((e,t)=>
vendor: 5,750 bytes, line 1766
1766{const r=new Ul,{owner_address:n}=e;return r.setOwnerAddress(mu(n)),wu(r,Ol.Contract.ContractType.WITHDRAWBALANCECONTRACT,"WithdrawBalanceContract",t.Permission_id)})(t,r);case"FreezeBalanceV2Contract":return((e,t)=>{const r=new Dl,{owner_address:n,frozen_balance:o,resource:s}=e;return r.setOwnerAddress(mu(n)),r.setFrozenBalance(o),r.setResource(tu[s]),wu(r,Ol.Contract.ContractType.FREEZEBALANCEV2CONTRACT,"FreezeBalanceV2Contract",t.Permission_id)})(t,r);case"CancelAllUnfreezeV2Contract":return((e,t)=>{const r=new Fl,{owner_address:n}=e;return r.setOwnerAddress(mu(n)),wu(r,Ol.Contract.ContractType.CANCELALLUNFREEZEV2CONTRACT,"CancelAllUnfreezeV2Contract",t.Permission_id)})(t,r);case"UnfreezeBalanceV2Contract":return((e,t)=>{const r=new Ll,{owner_address:n,unfreeze_balance:o,resource:s}=e;return r.setOwnerAddress(mu(n)),r.setUnfreezeBalance(o),r.setResource(tu[s]),wu(r,Ol.Contract.ContractType.UNFREEZEBALANCEV2CONTRACT,"UnfreezeBalanceV2Contract",t.Permission_id)})(t,r);case"DelegateResourceContract":return((e,t)=>{const r=new Vl,{owner_address:n,receiver_address:o,balance:s,resource:i,lock:a=!1,lock_period:c}=e;return r.setOwnerAddress(mu(n)),r.setBalance(s),r.setResource(tu[i]),r.setLock(a),r.setLockPeriod(c),r.setReceiverAddress(mu(o)),wu(r,Ol.Contract.ContractType.DELEGATERESOURCECONTRACT,"DelegateResourceContract",t.Permission_id)})(t,r);case"UnDelegateResourceContract":return((e,t)=>{const r=new ql,{owner_address:n,receiver_address:o,balance:s,resource:i}=e;return r.setOwnerAddress(mu(n)),r.setBalance(s),r.setResource(tu[i]),r.setReceiverAddress(mu(o)),wu(r,Ol.Contract.ContractType.UNDELEGATERESOURCECONTRACT,"UnDelegateResourceContract",t.Permission_id)})(t,r);case"WithdrawExpireUnfreezeContract":return((e,t)=>{const r=new zl,{owner_address:n}=e;return r.setOwnerAddress(mu(n)),wu(r,Ol.Contract.ContractType.WITHDRAWEXPIREUNFREEZECONTRACT,"WithdrawExpireUnfreezeContract",t.Permission_id)})(t,r);case"WitnessCreateContract":return((e,t)=>{const r=new ru,{owner_address:n,url:o}=e;return r.setOwnerAddress(mu(n)),r.setUrl(yu(o.replace(/^0x/,""))),wu(r,Ol.Contract.ContractType.WITNESSCREATECONTRACT,"WitnessCreateContract",t.Permission_id)})(t,r);case"VoteWitnessContract":return((e,t)=>{const r=new nu,{owner_address:n,votes:o}=e;return r.setOwnerAddress(mu(n)),o.forEach((e=>{const t=new nu.Vote,{vote_address:n,vote_count:o}=e;t.setVoteAddress(mu(n));const s=parseInt(o);t.setVoteCount(s),r.addVotes(t)})),wu(r,Ol.Contract.ContractType.VOTEWITNESSCONTRACT,"VoteWitnessContract",t.Permission_id)})(t,r);case"CreateSmartContract":return((e,t)=>{const r=e?.new_contract?{owner_address:e.owner_address,call_token_value:e.call_token_value,token_id:e.token_id,...e.new_contract}:e,{owner_address:n,consume_user_resource_percent:o,origin_energy_limit:s,abi:i,bytecode:a="",parameter:c="",call_value:l,call_token_value:u,token_id:d,name:h}=r;let{origin_address:p}=r;const f=new Xl;f.setOwnerAddress(mu(n)),d&&f.setTokenId(d),u&&f.setCallTokenValue(u);const g=new eu;if(i){let e;e="string"==typeof i?JSON.parse(i):i?.entrys||[];const t=new eu.ABI,r=e=>{const t=new eu.ABI.Entry.Param,{indexed:r,name:n,type:o}=e;return!0===r&&t.setIndexed(!0),t.setName(n),t.setType(o),t},n=e.map((e=>{const{anonymous:t,constant:n,name:o,inputs:s,outputs:i,type:a,payable:c,stateMutability:l}=e,u=new eu.ABI.Entry;return u.setAnonymous(t),u.setConstant(n),u.setName(o),s&&u.setInputsList(s.map((e=>r(e)))),i&&u.setOutputsList(i.map((e=>r(e)))),a&&u.setType(eu.ABI.Entry.EntryType[a.toUpperCase()]),u.setPayable(c),l&&u.setStatemutability(eu.ABI.Entry.StateMutabilityType[l.toUpperCase()]),u}));t.setEntrysList(n),g.setAbi(t)}if(l&&g.setCallValue(l),g.setConsumeUserResourcePercent(o),g.setOriginEnergyLimit(s),p||(p=n),g.setOriginAddress(mu(p)),a){const e=a.replace(/^0x/,"")+c.replace(/^0x/,"");g.setBytecode(yu(e))}return g.setName(h),f.setNewContract(g),wu(f,Ol.Contract.ContractType.CREATESMARTCONTRACT,"CreateSmartContract",t.Permission_id)})(t,r);case"ClearABIContract":return((e,t)=>{const{contract_address:r,owner_address:n}=e,o=new Jl;return o.setOwnerAddress(mu(n)),o.setContractAddress(mu(r)),wu(o,Ol.Contract.ContractType.CLEARABICONTRACT,"ClearABIContract",t.Permission_id)})(t,r);case"UpdateBrokerageContract":return((e,t)=>{const{brokerage:r,owner_address:n}=e,o=new ou;return o.setOwnerAddress(mu(n)),o.setBrokerage(r),wu(o,Ol.Contract.ContractType.UPDATEBROKERAGECONTRACT,"UpdateBrokerageContract",t.Permission_id)})(t,r);case"AssetIssueContract":return((e,t)=>{const{owner_address:r,name:n,abbr:o,description:s,url:i,total_supply:a,trx_num:c,num:l,start_time:u,end_time:d,precision:h,free_asset_net_limit:p,public_free_asset_net_limit:f,public_free_asset_net_usage:g=0,public_latest_free_net_time:m=0,vote_score:y=0,frozen_supply:b}=e,w=new $l;if(w.setOwnerAddress(mu(r)),n&&w.setName(yu(n.replace(/^0x/,""))),o&&w.setAbbr(yu(o.replace(/^0x/,""))),w.setTotalSupply(a),w.setNum(l),w.setEndTime(d),w.setStartTime(u),w.setTrxNum(c),w.setVoteScore(y),h&&w.setPrecision(h),m&&w.setPublicLatestFreeNetTime(m),s&&w.setDescription(yu(s.replace(/^0x/,""))),i&&w.setUrl(yu(i.replace(/^0x/,""))),w.setPublicFreeAssetNetUsage(g),w.setFreeAssetNetLimit(p),w.setPublicFreeAssetNetLimit(f),b){const e=new $l.FrozenSupply;e.setFrozenAmount(b.length?b[0].frozen_amount:b.frozen_amount),e.setFrozenDays(b.length?b[0].frozen_days:b.frozen_days),w.addFrozenSupply(e)}return wu(w,Ol.Contract.ContractType.ASSETISSUECONTRACT,"AssetIssueContract",t.Permission_id)})(t,r);case"AccountCreateContract":return((e,t)=>{const r=new su,{account_address:n,owner_address:o}=e;return r.setOwnerAddress(mu(o)),r.setAccountAddress(mu(n.replace(/^0x/,""))),wu(r,Ol.Contract.ContractType.ACCOUNTCREATECONTRACT,"AccountCreateContract",t.Permission_id)})(t,r);
vendor: 4,403 bytes, line 1766
1766case"AccountUpdateContract":return((e,t)=>{const r=new iu,{account_name:n,owner_address:o}=e;return r.setOwnerAddress(mu(o)),r.setAccountName(yu(n.replace(/^0x/,""))),wu(r,Ol.Contract.ContractType.ACCOUNTUPDATECONTRACT,"AccountUpdateContract",t.Permission_id)})(t,r);case"SetAccountIdContract":return((e,t)=>{const r=new au,{account_id:n,owner_address:o}=e;return r.setOwnerAddress(mu(o)),r.setAccountId(yu(n.replace(/^0x/,""))),wu(r,Ol.Contract.ContractType.SETACCOUNTIDCONTRACT,"SetAccountIdContract",t.Permission_id)})(t,r);case"ProposalCreateContract":return((e,t)=>{const r=new lu,{owner_address:n,parameters:o}=e;return r.setOwnerAddress(mu(n)),o.forEach((e=>{r.getParametersMap().set(e.key,e.value)})),wu(r,Ol.Contract.ContractType.PROPOSALCREATECONTRACT,"ProposalCreateContract",t.Permission_id)})(t,r);case"ProposalDeleteContract":return((e,t)=>{const r=new uu,{owner_address:n,proposal_id:o}=e;return r.setOwnerAddress(mu(n)),r.setProposalId(o),wu(r,Ol.Contract.ContractType.PROPOSALDELETECONTRACT,"ProposalDeleteContract",t.Permission_id)})(t,r);case"ProposalApproveContract":return((e,t)=>{const r=new du,{owner_address:n,proposal_id:o,is_add_approval:s}=e;return r.setOwnerAddress(mu(n)),r.setProposalId(o),r.setIsAddApproval(s),wu(r,Ol.Contract.ContractType.PROPOSALAPPROVECONTRACT,"ProposalApproveContract",t.Permission_id)})(t,r);case"ExchangeCreateContract":return((e,t)=>{const r=new hu,{owner_address:n,first_token_id:o,first_token_balance:s,second_token_id:i,second_token_balance:a}=e;return r.setOwnerAddress(mu(n)),r.setFirstTokenId(bu(o,t.visible)),r.setFirstTokenBalance(s),r.setSecondTokenId(bu(i,t.visible)),r.setSecondTokenBalance(a),wu(r,Ol.Contract.ContractType.EXCHANGECREATECONTRACT,"ExchangeCreateContract",t.Permission_id)})(t,r);case"ExchangeInjectContract":return((e,t)=>{const r=new pu,{owner_address:n,exchange_id:o,token_id:s,quant:i}=e;return r.setOwnerAddress(mu(n)),r.setExchangeId(o),r.setTokenId(bu(s,t.visible)),r.setQuant(i),wu(r,Ol.Contract.ContractType.EXCHANGEINJECTCONTRACT,"ExchangeInjectContract",t.Permission_id)})(t,r);case"ExchangeWithdrawContract":return((e,t)=>{const r=new fu,{owner_address:n,exchange_id:o,token_id:s,quant:i}=e;return r.setOwnerAddress(mu(n)),r.setExchangeId(o),r.setTokenId(bu(s,t.visible)),r.setQuant(i),wu(r,Ol.Contract.ContractType.EXCHANGEWITHDRAWCONTRACT,"ExchangeWithdrawContract",t.Permission_id)})(t,r);case"ExchangeTransactionContract":return((e,t)=>{const r=new gu,{owner_address:n,exchange_id:o,token_id:s,quant:i,expected:a}=e;return r.setOwnerAddress(mu(n)),r.setExchangeId(o),r.setTokenId(bu(s,t.visible)),r.setQuant(i),r.setExpected(a),wu(r,Ol.Contract.ContractType.EXCHANGETRANSACTIONCONTRACT,"ExchangeTransactionContract",t.Permission_id)})(t,r);case"UpdateSettingContract":return((e,t)=>{const r=new Zl,{owner_address:n,contract_address:o,consume_user_resource_percent:s}=e;return r.setOwnerAddress(mu(n)),r.setContractAddress(mu(o)),r.setConsumeUserResourcePercent(s),wu(r,Ol.Contract.ContractType.UPDATESETTINGCONTRACT,"UpdateSettingContract",t.Permission_id)})(t,r);case"UpdateEnergyLimitContract":return((e,t)=>{const r=new Ql,{owner_address:n,contract_address:o,origin_energy_limit:s}=e;return r.setOwnerAddress(mu(n)),r.setContractAddress(mu(o)),r.setOriginEnergyLimit(s),wu(r,Ol.Contract.ContractType.UPDATEENERGYLIMITCONTRACT,"UpdateEnergyLimitContract",t.Permission_id)})(t,r);case"AccountPermissionUpdateContract":return Au(t,r);case"UpdateAssetContract":return((e,t)=>{const r=new Gl,{owner_address:n,description:o,url:s,new_limit:i,new_public_limit:a}=e;return r.setOwnerAddress(mu(n)),o&&r.setDescription(yu(o.replace(/^0x/,""))),s&&r.setUrl(yu(s.replace(/^0x/,""))),i&&r.setNewLimit(i),a&&r.setNewPublicLimit(a),wu(r,Ol.Contract.ContractType.UPDATEASSETCONTRACT,"UpdateAssetContract",t.Permission_id)})(t,r);default:throw new Error("Unsupported transaction type: "+e.type)}},Pu=e=>{const t=e.raw_data,r=t.contract[0],n=r.parameter.value,o={Permission_id:r.Permission_id,visible:e.visible},s=Tu(r,n,o),i=s.getRawData();return i.setRefBlockBytes(yu(t.ref_block_bytes)),i.setRefBlockHash(yu(t.ref_block_hash)),t.data&&i.setData(yu(t.data)),t.fee_limit&&i.setFeeLimit(t.fee_limit),t.expiration&&i.setExpiration(t.expiration),t.timestamp&&i.setTimestamp(t.timestamp),s.setRawData(i),s},Eu=(e,t={},r={})=>{const n=e.raw_data,o=n.contract[0],s=Tu(o,t,{Permission_id:t?.Permission_id}),i=s.getRawData();
1766return i.setRefBlockBytes(yu(n.ref_block_bytes)),i.setRefBlockHash(yu(n.ref_block_hash)),r.data&&i.setData(yu(r.data.replace(/^0x/,""))),(r.fee_limit||t.fee_limit)&&i.setFeeLimit(r.fee_limit||t.fee_limit),n.expiration&&i.setExpiration(n.expiration),n.timestamp&&i.setTimestamp(n.timestamp),s.setRawData(i),s},Cu=(e,t)=>{const r=t.getRawData().serializeBinary(),n=E(r),o=Xe(r);return n.toLowerCase()===e.raw_data_hex.toLowerCase()&&o.replace(/^0x/,"").toLowerCase()===e.txID.replace(/^0x/,"").toLowerCase()},ku=e=>E(e.getRawData().serializeBinary()),_u=e=>{const t=Pu(e);return Cu(e,t)},Iu=(e,t,r)=>{const n=Eu(e,t,r);return Cu(e,n)},Su=e=>Xe(e.getRawData().serializeBinary()),{Transaction:xu,Permission:Bu,Key:Ou}=globalThis.TronWebProto,{TransferContract:Mu,WithdrawBalanceContract:Wu,WitnessCreateContract:ju,FreezeBalanceV2Contract:Ru,UnfreezeBalanceV2Contract:Nu,CancelAllUnfreezeV2Contract:Uu,WithdrawExpireUnfreezeContract:Du,DelegateResourceContract:Lu,UnDelegateResourceContract:Fu,FreezeBalanceContract:zu,UnfreezeBalanceContract:Vu}=globalThis.TronWebProto,{TransferAssetContract:qu,ParticipateAssetIssueContract:Hu,AssetIssueContract:Ku,UpdateAssetContract:$u}=globalThis.TronWebProto,{TriggerSmartContract:Gu,CreateSmartContract:Yu,UpdateSettingContract:Ju,UpdateEnergyLimitContract:Qu,ClearABIContract:Zu}=globalThis.TronWebProto,{AccountCreateContract:Xu,AccountUpdateContract:ed,SetAccountIdContract:td,AccountPermissionUpdateContract:rd}=globalThis.TronWebProto,{VoteWitnessContract:nd}=globalThis.TronWebProto,{ProposalCreateContract:od,ProposalApproveContract:sd,ProposalDeleteContract:id}=globalThis.TronWebProto,{ExchangeCreateContract:ad,ExchangeInjectContract:cd,ExchangeWithdrawContract:ld,ExchangeTransactionContract:ud}=globalThis.TronWebProto,{UpdateBrokerageContract:dd}=globalThis.TronWebProto,hd={0:"AccountCreateContract",1:"TransferContract",2:"TransferAssetContract",4:"VoteWitnessContract",5:"WitnessCreateContract",6:"AssetIssueContract",9:"ParticipateAssetIssueContract",10:"AccountUpdateContract",11:"FreezeBalanceContract",12:"UnfreezeBalanceContract",13:"WithdrawBalanceContract",15:"UpdateAssetContract",16:"ProposalCreateContract",17:"ProposalApproveContract",18:"ProposalDeleteContract",19:"SetAccountIdContract",30:"CreateSmartContract",31:"TriggerSmartContract",33:"UpdateSettingContract",41:"ExchangeCreateContract",42:"ExchangeInjectContract",43:"ExchangeWithdrawContract",44:"ExchangeTransactionContract",45:"UpdateEnergyLimitContract",46:"AccountPermissionUpdateContract",48:"ClearABIContract",49:"UpdateBrokerageContract",54:"FreezeBalanceV2Contract",55:"UnfreezeBalanceV2Contract",56:"WithdrawExpireUnfreezeContract",57:"DelegateResourceContract",58:"UnDelegateResourceContract",59:"CancelAllUnfreezeV2Contract"},pd=e=>e.getAuthsList().map((e=>{const t=E(e.getPermissionName_asU8()),r=e.getAccount();return{permission_name:t,account:{name:E(r.getName_asU8()),address:E(r.getAddress_asU8())}}})),fd=(e,t)=>{const r=xu.raw.deserializeBinary(U(t)),n=r.getContractList()[0],o=n.getParameter().getValue(),s=hd[n.getType()];if(e!==s)throw new Error(`type ${e} dismatches with rawDataHex type ${s}`);return[{contract:[{parameter:{value:{},type_url:n.getParameter().getTypeUrl()},type:e,Permission_id:n.getPermissionId()}],data:E(r.getData()),fee_limit:r.getFeeLimit(),ref_block_bytes:E(r.getRefBlockBytes_asU8()),ref_block_hash:E(r.getRefBlockHash_asU8()),expiration:r.getExpiration(),timestamp:r.getTimestamp(),scripts:E(r.getScripts_asU8()),auths:pd(r)},o]},gd=e=>{switch(e){case 0:default:return"BANDWIDTH";case 1:return"ENERGY"}},md={1:"Witness",2:"Active"},yd=e=>{if(!e)return null;const t=e.getType();return{permission_name:e.getPermissionName(),threshold:e.getThreshold(),operations:E(e.getOperations_asU8()),keys:e.getKeysList().map((e=>({address:E(e.getAddress_asU8()),weight:e.getWeight()}))),...0===t?{}:{type:md[t],id:e.getId()}}},bd=["","constructor","function","event","fallback","receive","error"],wd=["","pure","view","nonpayable","payable"],vd=(e,t)=>{if(!t)throw new Error("rawDataHex cannot be empty");if(!ic(t))throw new Error("rawDataHex is not a valid hex string");switch(e){case"TriggerSmartContract":return((e,t)=>{const[r,n]=fd(e,t),o=Gu.deserializeBinary(n);return r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8()),contract_address:E(o.getContractAddress_asU8()),call_value:o.getCallValue(),data:E(o.getData_asU8()),call_token_value:o.getCallTokenValue(),token_id:o.getTokenId()},r})(e,t);case"FreezeBalanceV2Contract":return((e,t)=>{const[r,n]=fd(e,t),o=Ru.deserializeBinary(n);return r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8()),frozen_balance:o.getFrozenBalance(),resource:gd(o.getResource())},r})(e,t);case"UnfreezeBalanceV2Contract":return((e,t)=>{const[r,n]=fd(e,t),o=Nu.deserializeBinary(n);return r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8()),unfreeze_balance:o.getUnfreezeBalance(),resource:gd(o.getResource())},r})(e,t);case"CancelAllUnfreezeV2Contract":return((e,t)=>{const[r,n]=fd(e,t),o=Uu.deserializeBinary(n);return r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8())},r})(e,t);case"DelegateResourceContract":return((e,t)=>{const[r,n]=fd(e,t),o=Lu.deserializeBinary(n);return r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8()),balance:o.getBalance(),lock:o.getLock(),lock_period:o.getLockPeriod(),receiver_address:E(o.getReceiverAddress_asU8()),resource:gd(o.getResource())},r})(e,t);case"UnDelegateResourceContract":return((e,t)=>{const[r,n]=fd(e,t),o=Fu.deserializeBinary(n);return r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8()),balance:o.getBalance(),receiver_address:E(o.getReceiverAddress_asU8()),resource:gd(o.getResource())},r})(e,t);case"WithdrawExpireUnfreezeContract":return((e,t)=>{const[r,n]=fd(e,t),o=Du.deserializeBinary(n);return r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8())},r})(e,t);case"TransferContract":return((e,t)=>{const[r,n]=fd(e,t),o=Mu.deserializeBinary(n);return r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8()),to_address:E(o.getToAddress_asU8()),amount:o.getAmount()},r})(e,t);case"WithdrawBalanceContract":return((e,t)=>{const[r,n]=fd(e,t),o=Wu.deserializeBinary(n);return r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8())},r})(e,t);case"WitnessCreateContract":return((e,t)=>{const[r,n]=fd(e,t),o=ju.deserializeBinary(n);return r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8()),url:E(o.getUrl_asU8())},r})(e,t);case"TransferAssetContract":return((e,t)=>{const[r,n]=fd(e,t),o=qu.deserializeBinary(n);return r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8()),to_address:E(o.getToAddress_asU8()),asset_name:E(o.getAssetName_asU8()),amount:o.getAmount()},r})(e,t);case"ParticipateAssetIssueContract":return((e,t)=>
1766{const[r,n]=fd(e,t),o=Hu.deserializeBinary(n);return r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8()),to_address:E(o.getToAddress_asU8()),asset_name:E(o.getAssetName_asU8()),amount:o.getAmount()},r})(e,t);case"AssetIssueContract":return((e,t)=>{const[r,n]=fd(e,t),o=Ku.deserializeBinary(n);return r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8()),name:E(o.getName_asU8()),abbr:E(o.getAbbr_asU8()),description:E(o.getDescription_asU8()),url:E(o.getUrl_asU8()),total_supply:o.getTotalSupply(),trx_num:o.getTrxNum(),num:o.getNum(),start_time:o.getStartTime(),end_time:o.getEndTime(),frozen_supply:o.getFrozenSupplyList().map((e=>({frozen_amount:e.getFrozenAmount(),frozen_days:e.getFrozenDays()}))),free_asset_net_limit:o.getFreeAssetNetLimit(),public_free_asset_net_limit:o.getPublicFreeAssetNetLimit(),precision:o.getPrecision(),vote_score:o.getVoteScore()},r})(e,t);case"UpdateAssetContract":return((e,t)=>{const[r,n]=fd(e,t),o=$u.deserializeBinary(n);return r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8()),description:E(o.getDescription_asU8()),url:E(o.getUrl_asU8()),new_limit:o.getNewLimit(),new_public_limit:o.getNewPublicLimit()},r})(e,t);case"AccountCreateContract":return((e,t)=>{const[r,n]=fd(e,t),o=Xu.deserializeBinary(n);return r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8()),account_address:E(o.getAccountAddress_asU8())},r})(e,t);case"AccountUpdateContract":return((e,t)=>{const[r,n]=fd(e,t),o=ed.deserializeBinary(n);return r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8()),account_name:E(o.getAccountName_asU8())},r})(e,t);case"SetAccountIdContract":return((e,t)=>{const[r,n]=fd(e,t),o=td.deserializeBinary(n);return r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8()),account_id:E(o.getAccountId_asU8())},r})(e,t);case"AccountPermissionUpdateContract":return((e,t)=>{const[r,n]=fd(e,t),o=rd.deserializeBinary(n),s=o.getWitness();return r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8()),owner:yd(o.getOwner()),witness:s?yd(s):null,actives:o.getActivesList().map(yd)},r})(e,t);case"FreezeBalanceContract":return((e,t)=>{const[r,n]=fd(e,t),o=zu.deserializeBinary(n);return r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8()),frozen_balance:o.getFrozenBalance(),frozen_duration:o.getFrozenDuration(),resource:gd(o.getResource()),receiver_address:E(o.getReceiverAddress_asU8())},r})(e,t);case"UnfreezeBalanceContract":return((e,t)=>{const[r,n]=fd(e,t),o=Vu.deserializeBinary(n);return r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8()),resource:gd(o.getResource()),receiver_address:E(o.getReceiverAddress_asU8())},r})(e,t);case"VoteWitnessContract":return((e,t)=>{const[r,n]=fd(e,t),o=nd.deserializeBinary(n);return r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8()),votes:o.getVotesList().map((e=>({vote_address:E(e.getVoteAddress_asU8()),vote_count:e.getVoteCount()})))},r})(e,t);case"ProposalCreateContract":return((e,t)=>{const[r,n]=fd(e,t),o=od.deserializeBinary(n),s=o.getParametersMap(),i=[];return[...s.entries()].forEach((([e,t])=>{i.push({key:e,value:t})})),r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8()),parameters:i},r})(e,t);case"ProposalApproveContract":return((e,t)=>{const[r,n]=fd(e,t),o=sd.deserializeBinary(n);return r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8()),proposal_id:o.getProposalId(),is_add_approval:o.getIsAddApproval()},r})(e,t);case"ProposalDeleteContract":return((e,t)=>{const[r,n]=fd(e,t),o=id.deserializeBinary(n);return r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8()),proposal_id:o.getProposalId()},r})(e,t);case"CreateSmartContract":return((e,t)=>{const[r,n]=fd(e,t),o=Yu.deserializeBinary(n),s=o.getNewContract(),i=s.getAbi(),a=i?i.getEntrysList().map((e=>{const t=e=>({name:e.getName(),type:e.getType(),...e.getIndexed()?{indexed:!0}:{}});return{type:bd[e.getType()]||"",name:e.getName(),inputs:e.getInputsList().map(t),outputs:e.getOutputsList().map(t),payable:e.getPayable(),stateMutability:wd[e.getStatemutability()]||"",...e.getConstant()?{constant:!0}:{},...e.getAnonymous()?{anonymous:!0}:{}}})):[],c=s?{origin_address:E(s.getOriginAddress_asU8()),abi:{entrys:a},bytecode:E(s.getBytecode_asU8()),call_value:s.getCallValue(),consume_user_resource_percent:s.getConsumeUserResourcePercent(),name:s.getName(),origin_energy_limit:s.getOriginEnergyLimit()}:null;return r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8()),call_token_value:o.getCallTokenValue(),token_id:o.getTokenId(),new_contract:c},r})(e,t);case"UpdateSettingContract":return((e,t)=>{const[r,n]=fd(e,t),o=Ju.deserializeBinary(n);return r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8()),contract_address:E(o.getContractAddress_asU8()),consume_user_resource_percent:o.getConsumeUserResourcePercent()},r})(e,t);case"UpdateEnergyLimitContract":return((e,t)=>{const[r,n]=fd(e,t),o=Qu.deserializeBinary(n);return r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8()),contract_address:E(o.getContractAddress_asU8()),origin_energy_limit:o.getOriginEnergyLimit()},r})(e,t);case"ClearABIContract":return((e,t)=>{const[r,n]=fd(e,t),o=Zu.deserializeBinary(n);return r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8()),contract_address:E(o.getContractAddress_asU8())},r})(e,t);case"ExchangeCreateContract":return((e,t)=>{const[r,n]=fd(e,t),o=ad.deserializeBinary(n);return r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8()),first_token_id:E(o.getFirstTokenId_asU8()),first_token_balance:o.getFirstTokenBalance(),second_token_id:E(o.getSecondTokenId_asU8()),second_token_balance:o.getSecondTokenBalance()},r})(e,t);case"ExchangeInjectContract":return((e,t)=>{const[r,n]=fd(e,t),o=cd.deserializeBinary(n);return r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8()),exchange_id:o.getExchangeId(),token_id:E(o.getTokenId_asU8()),quant:o.getQuant()},r})(e,t);case"ExchangeWithdrawContract":return((e,t)=>{const[r,n]=fd(e,t),o=ld.deserializeBinary(n);return r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8()),exchange_id:o.getExchangeId(),token_id:E(o.getTokenId_asU8()),quant:o.getQuant()},r})(e,t);case"ExchangeTransactionContract":return((e,t)=>{const[r,n]=fd(e,t),o=ud.deserializeBinary(n);return r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8()),exchange_id:o.getExchangeId(),token_id:E(o.getTokenId_asU8()),quant:o.getQuant(),expected:o.getExpected()},r})(e,t);case"UpdateBrokerageContract":return((e,t)=>{const[r,n]=fd(e,t),o=dd.deserializeBinary(n);return r.contract[0].parameter.value={owner_address:E(o.getOwnerAddress_asU8()),brokerage:o.getBrokerage()},r})(e,t);default:throw new Error(`trasaction ${e} not supported`)}},Ad={...d,constants:o,address:h,code:s,accounts:u,base58:i,bytes:n,crypto:l,abi:p,message:f,_TypedDataEncoder:Yc,typedData:g,transaction:m,ethersUtils:c,deserializeTx:y};var Td,Pd,Ed,Cd;!function(e){e[e.BANDWIDTH=0]="BANDWIDTH",e[e.ENERGY=1]="ENERGY",e[e.TRON_POWER=2]="TRON_POWER"}(Td||(Td={})),function(e){e.ENOUGH_PERMISSION="ENOUGH_PERMISSION",e.NOT_ENOUGH_PERMISSION="NOT_ENOUGH_PERMISSION",e.SIGNATURE_FORMAT_ERROR="SIGNATURE_FORMAT_ERROR",e.COMPUTE_ADDRESS_E
1766RROR="COMPUTE_ADDRESS_ERROR",e.PERMISSION_ERROR="PERMISSION_ERROR",e.OTHER_ERROR="OTHER_ERROR"}(Pd||(Pd={})),function(e){e[e.SUCCESS=0]="SUCCESS",e[e.SIGERROR=1]="SIGERROR",e[e.CONTRACT_VALIDATE_ERROR=2]="CONTRACT_VALIDATE_ERROR",e[e.CONTRACT_EXE_ERROR=3]="CONTRACT_EXE_ERROR",e[e.BANDWITH_ERROR=4]="BANDWITH_ERROR",e[e.DUP_TRANSACTION_ERROR=5]="DUP_TRANSACTION_ERROR",e[e.TAPOS_ERROR=6]="TAPOS_ERROR",e[e.TOO_BIG_TRANSACTION_ERROR=7]="TOO_BIG_TRANSACTION_ERROR",e[e.TRANSACTION_EXPIRATION_ERROR=8]="TRANSACTION_EXPIRATION_ERROR",e[e.SERVER_BUSY=9]="SERVER_BUSY",e[e.NO_CONNECTION=10]="NO_CONNECTION",e[e.NOT_ENOUGH_EFFECTIVE_CONNECTION=11]="NOT_ENOUGH_EFFECTIVE_CONNECTION",e[e.OTHER_ERROR=20]="OTHER_ERROR"}(Ed||(Ed={})),function(e){e[e.PENDING=0]="PENDING",e[e.DISAPPROVED=1]="DISAPPROVED",e[e.APPROVED=2]="APPROVED",e[e.CANCELED=3]="CANCELED"}(Cd||(Cd={}));Ja.g},"./node_modules/@ton/ton/package.json"(e){"use strict";e.exports={rE:"15.3.1"}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.