PageSourceSearch

https://app.slinkylayer.ai/assets/vendor-web3-x3amP11p.js

js slinkylayer.ai collected 2026-10-05 12:38:27 UTC 608,880 bytes, 68 lines download raw bytes

vendor: 5,547 bytes, lines 1-9
1var z0=t=>{throw TypeError(t)};var xu=(t,e,r)=>e.has(t)||z0("Cannot "+r);var C=(t,e,r)=>(xu(t,e,"read from private field"),r?r.call(t):e.get(t)),ce=(t,e,r)=>e.has(t)?z0("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),re=(t,e,r,n)=>(xu(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),ge=(t,e,r)=>(xu(t,e,"access private method"),r);var Ta=(t,e,r,n)=>({set _(i){re(t,e,i,r)},get _(){return C(t,e,n)}});function wy(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var ip=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ia(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function vy(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var sp={exports:{}},_c={},op={exports:{}},he={};/**
2 * @license React
3 * react.production.min.js
4 *
5 * Copyright (c) Facebook, Inc. and its affiliates.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the root directory of this source tree.
9 */var sa=Symbol.for("react.element"),xy=Symbol.for("react.portal"),Ay=Symbol.for("react.fragment"),Ey=Symbol.for("react.strict_mode"),Py=Symbol.for("react.profiler"),Sy=Symbol.for("react.provider"),_y=Symbol.for("react.context"),Iy=Symbol.for("react.forward_ref"),Ny=Symbol.for("react.suspense"),ky=Symbol.for("react.memo"),My=Symbol.for("react.lazy"),q0=Symbol.iterator;function Ty(t){return t===null||typeof t!="object"?null:(t=q0&&t[q0]||t["@@iterator"],typeof t=="function"?t:null)}var ap={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},cp=Object.assign,up={};function Gs(t,e,r){this.props=t,this.context=e,this.refs=up,this.updater=r||ap}Gs.prototype.isReactComponent={};Gs.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};Gs.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function fp(){}fp.prototype=Gs.prototype;function wl(t,e,r){this.props=t,this.context=e,this.refs=up,this.updater=r||ap}var vl=wl.prototype=new fp;vl.constructor=wl;cp(vl,Gs.prototype);vl.isPureReactComponent=!0;var j0=Array.isArray,lp=Object.prototype.hasOwnProperty,xl={current:null},dp={key:!0,ref:!0,__self:!0,__source:!0};function hp(t,e,r){var n,i={},s=null,o=null;if(e!=null)for(n in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)lp.call(e,n)&&!dp.hasOwnProperty(n)&&(i[n]=e[n]);var a=arguments.length-2;if(a===1)i.children=r;else if(1<a){for(var c=Array(a),u=0;u<a;u++)c[u]=arguments[u+2];i.children=c}if(t&&t.defaultProps)for(n in a=t.defaultProps,a)i[n]===void 0&&(i[n]=a[n]);return{$$typeof:sa,type:t,key:s,ref:o,props:i,_owner:xl.current}}function Ry(t,e){return{$$typeof:sa,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function Al(t){return typeof t=="object"&&t!==null&&t.$$typeof===sa}function Cy(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(r){return e[r]})}var G0=/\/+/g;function Au(t,e){return typeof t=="object"&&t!==null&&t.key!=null?Cy(""+t.key):e.toString(36)}function Va(t,e,r,n,i){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case sa:case xy:o=!0}}if(o)return o=t,i=i(o),t=n===""?"."+Au(o,0):n,j0(i)?(r="",t!=null&&(r=t.replace(G0,"$&/")+"/"),Va(i,e,r,"",function(u){return u})):i!=null&&(Al(i)&&(i=Ry(i,r+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(G0,"$&/")+"/")+t)),e.push(i)),1;if(o=0,n=n===""?".":n+":",j0(t))for(var a=0;a<t.length;a++){s=t[a];var c=n+Au(s,a);o+=Va(s,e,r,c,i)}else if(c=Ty(t),typeof c=="function")for(t=c.call(t),a=0;!(s=t.next()).done;)s=s.value,c=n+Au(s,a++),o+=Va(s,e,r,c,i);else if(s==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return o}function Ra(t,e,r){if(t==null)return t;var n=[],i=0;return Va(t,n,"","",function(s){return e.call(r,s,i++)}),n}function By(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(r){(t._status===0||t._status===-1)&&(t._status=1,t._result=r)},function(r){(t._status===0||t._status===-1)&&(t._status=2,t._result=r)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var $t={current:null},Ka={transition:null},Oy={ReactCurrentDispatcher:$t,ReactCurrentBatchConfig:Ka,ReactCurrentOwner:xl};function pp(){throw Error("act(...) is not supported in production builds of React.")}
vendor: 17,463 bytes, lines 9-17
9he.Children={map:Ra,forEach:function(t,e,r){Ra(t,function(){e.apply(this,arguments)},r)},count:function(t){var e=0;return Ra(t,function(){e++}),e},toArray:function(t){return Ra(t,function(e){return e})||[]},only:function(t){if(!Al(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};he.Component=Gs;he.Fragment=Ay;he.Profiler=Py;he.PureComponent=wl;he.StrictMode=Ey;he.Suspense=Ny;he.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Oy;he.act=pp;he.cloneElement=function(t,e,r){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var n=cp({},t.props),i=t.key,s=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,o=xl.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(c in e)lp.call(e,c)&&!dp.hasOwnProperty(c)&&(n[c]=e[c]===void 0&&a!==void 0?a[c]:e[c])}var c=arguments.length-2;if(c===1)n.children=r;else if(1<c){a=Array(c);for(var u=0;u<c;u++)a[u]=arguments[u+2];n.children=a}return{$$typeof:sa,type:t.type,key:i,ref:s,props:n,_owner:o}};he.createContext=function(t){return t={$$typeof:_y,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:Sy,_context:t},t.Consumer=t};he.createElement=hp;he.createFactory=function(t){var e=hp.bind(null,t);return e.type=t,e};he.createRef=function(){return{current:null}};he.forwardRef=function(t){return{$$typeof:Iy,render:t}};he.isValidElement=Al;he.lazy=function(t){return{$$typeof:My,_payload:{_status:-1,_result:t},_init:By}};he.memo=function(t,e){return{$$typeof:ky,type:t,compare:e===void 0?null:e}};he.startTransition=function(t){var e=Ka.transition;Ka.transition={};try{t()}finally{Ka.transition=e}};he.unstable_act=pp;he.useCallback=function(t,e){return $t.current.useCallback(t,e)};he.useContext=function(t){return $t.current.useContext(t)};he.useDebugValue=function(){};he.useDeferredValue=function(t){return $t.current.useDeferredValue(t)};he.useEffect=function(t,e){return $t.current.useEffect(t,e)};he.useId=function(){return $t.current.useId()};he.useImperativeHandle=function(t,e,r){return $t.current.useImperativeHandle(t,e,r)};he.useInsertionEffect=function(t,e){return $t.current.useInsertionEffect(t,e)};he.useLayoutEffect=function(t,e){return $t.current.useLayoutEffect(t,e)};he.useMemo=function(t,e){return $t.current.useMemo(t,e)};he.useReducer=function(t,e,r){return $t.current.useReducer(t,e,r)};he.useRef=function(t){return $t.current.useRef(t)};he.useState=function(t){return $t.current.useState(t)};he.useSyncExternalStore=function(t,e,r){return $t.current.useSyncExternalStore(t,e,r)};he.useTransition=function(){return $t.current.useTransition()};he.version="18.3.1";op.exports=he;var El=op.exports;const Fy=ia(El),zP=wy({__proto__:null,default:Fy},[El]);/**
10 * @license React
11 * react-jsx-runtime.production.min.js
12 *
13 * Copyright (c) Facebook, Inc. and its affiliates.
14 *
15 * This source code is licensed under the MIT license found in the
16 * LICENSE file in the root directory of this source tree.
17 */var $y=El,Ly=Symbol.for("react.element"),Uy=Symbol.for("react.fragment"),Dy=Object.prototype.hasOwnProperty,zy=$y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,qy={key:!0,ref:!0,__self:!0,__source:!0};function mp(t,e,r){var n,i={},s=null,o=null;r!==void 0&&(s=""+r),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(n in e)Dy.call(e,n)&&!qy.hasOwnProperty(n)&&(i[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)i[n]===void 0&&(i[n]=e[n]);return{$$typeof:Ly,type:t,key:s,ref:o,props:i,_owner:zy.current}}_c.Fragment=Uy;_c.jsx=mp;_c.jsxs=mp;sp.exports=_c;var qP=sp.exports,oa=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ks=typeof window>"u"||"Deno"in globalThis;function fr(){}function jy(t,e){return typeof t=="function"?t(e):t}function lf(t){return typeof t=="number"&&t>=0&&t!==1/0}function gp(t,e){return Math.max(t+(e||0)-Date.now(),0)}function cs(t,e){return typeof t=="function"?t(e):t}function Pr(t,e){return typeof t=="function"?t(e):t}function H0(t,e){const{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:o,stale:a}=t;if(o){if(n){if(e.queryHash!==Pl(o,e.options))return!1}else if(!vo(e.queryKey,o))return!1}if(r!=="all"){const c=e.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||i&&i!==e.state.fetchStatus||s&&!s(e))}function V0(t,e){const{exact:r,status:n,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(r){if(wo(e.options.mutationKey)!==wo(s))return!1}else if(!vo(e.options.mutationKey,s))return!1}return!(n&&e.state.status!==n||i&&!i(e))}function Pl(t,e){return(e?.queryKeyHashFn||wo)(t)}function wo(t){return JSON.stringify(t,(e,r)=>hf(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function vo(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(r=>!vo(t[r],e[r])):!1}function yp(t,e){if(t===e)return t;const r=K0(t)&&K0(e);if(r||hf(t)&&hf(e)){const n=r?t:Object.keys(t),i=n.length,s=r?e:Object.keys(e),o=s.length,a=r?[]:{};let c=0;for(let u=0;u<o;u++){const f=r?u:s[u];(!r&&n.includes(f)||r)&&t[f]===void 0&&e[f]===void 0?(a[f]=void 0,c++):(a[f]=yp(t[f],e[f]),a[f]===t[f]&&t[f]!==void 0&&c++)}return i===o&&c===i?t:a}return e}function df(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const r in t)if(t[r]!==e[r])return!1;return!0}function K0(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function hf(t){if(!W0(t))return!1;const e=t.constructor;if(e===void 0)return!0;const r=e.prototype;return!(!W0(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function W0(t){return Object.prototype.toString.call(t)==="[object Object]"}function Gy(t){return new Promise(e=>{setTimeout(e,t)})}function pf(t,e,r){return typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?yp(t,e):e}function Hy(t,e,r=0){const n=[...t,e];return r&&n.length>r?n.slice(1):n}function Vy(t,e,r=0){const n=[e,...t];return r&&n.length>r?n.slice(0,-1):n}var Sl=Symbol();function bp(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===Sl?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var Pi,qn,gs,Qh,Ky=(Qh=class extends oa{constructor(){super();ce(this,Pi);ce(this,qn);ce(this,gs);re(this,gs,e=>{if(!ks&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){C(this,qn)||this.setEventListener(C(this,gs))}onUnsubscribe(){var e;this.hasListeners()||((e=C(this,qn))==null||e.call(this),re(this,qn,void 0))}setEventListener(e){var r;re(this,gs,e),(r=C(this,qn))==null||r.call(this),re(this,qn,e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(e){C(this,Pi)!==e&&(re(this,Pi,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(r=>{r(e)})}isFocused(){return typeof C(this,Pi)=="boolean"?C(this,Pi):globalThis.document?.visibilityState!=="hidden"}},Pi=new WeakMap,qn=new WeakMap,gs=new WeakMap,Qh),_l=new Ky,ys,jn,bs,Jh,Wy=(Jh=class extends oa{constructor(){super();ce(this,ys,!0);ce(this,jn);ce(this,bs);re(this,bs,e=>{if(!ks&&window.addEventListener){const r=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){C(this,jn)||this.setEventListener(C(this,bs))}onUnsubscribe(){var e;this.hasListeners()||((e=C(this,jn))==null||e.call(this),re(this,jn,void 0))}setEventListener(e){var r;re(this,bs,e),(r=C(this,jn))==null||r.call(this),re(this,jn,e(this.setOnline.bind(this)))}setOnline(e){C(this,ys)!==e&&(re(this,ys,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return C(this,ys)}},ys=new WeakMap,jn=new WeakMap,bs=new WeakMap,Jh),ic=new Wy;function mf(){let t,e;const r=new Promise((i,s)=>{t=i,e=s});r.status="pending",r.catch(()=>{});function n(i){Object.assign(r,i),delete r.resolve,delete r.reject}return r.resolve=i=>{n({status:"fulfilled",value:i}),t(i)},r.reject=i=>{n({status:"rejected",reason:i}),e(i)},r}function Qy(t){return Math.min(1e3*2**t,3e4)}function wp(t){return(t??"online")==="online"?ic.isOnline():!0}var vp=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function Eu(t){return t instanceof vp}function xp(t){let e=!1,r=0,n=!1,i;const s=mf(),o=A=>{n||(m(new vp(A)),t.abort?.())},a=()=>{e=!0},c=()=>{e=!1},u=()=>_l.isFocused()&&(t.networkMode==="always"||ic.isOnline())&&t.canRun(),f=()=>wp(t.networkMode)&&t.canRun(),d=A=>{n||(n=!0,t.onSuccess?.(A),i?.(),s.resolve(A))},m=A=>{n||(n=!0,t.onError?.(A),i?.(),s.reject(A))},g=()=>new Promise(A=>{i=k=>{(n||u())&&A(k)},t.onPause?.()}).then(()=>{i=void 0,n||t.onContinue?.()}),w=()=>{if(n)return;let A;const k=r===0?t.initialPromise:void 0;try{A=k??t.fn()}catch(_){A=Promise.reject(_)}Promise.resolve(A).then(d).catch(_=>{if(n)return;const B=t.retry??(ks?0:3),T=t.retryDelay??Qy,N=typeof T=="function"?T(r,_):T,M=B===!0||typeof B=="number"&&r<B||typeof B=="function"&&B(r,_);if(e||!M){m(_);return}r++,t.onFail?.(r,_),Gy(N).then(()=>u()?void 0:g()).then(()=>{e?m(_):w()})})};return{promise:s,cancel:o,continue:()=>(i?.(),s),cancelRetry:a,continueRetry:c,canStart:f,start:()=>(f()?w():g().then(w),s)}}function Jy(){let t=[],e=0,r=a=>{a()},n=a=>{a()},i=a=>setTimeout(a,0);const s=a=>{e?t.push(a):i(()=>{r(a)})},o=()=>{const a=t;t=[],a.length&&i(()=>{n(()=>{a.forEach(c=>{r(c)})})})};return{batch:a=>{let c;e++;try{c=a()}finally{e--,e||o()}return c},batchCalls:a=>(...c)=>{s(()=>{a(...c)})},schedule:s,setNotifyFunction:a=>{r=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{i=a}}}var Nt=Jy(),Si,Yh,Ap=(Yh=class{constructor(){ce(this,Si)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),lf(this.gcTime)&&re(this,Si,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(ks?1/0:5*60*1e3))}clearGcTimeout(){C(this,Si)&&(clearTimeout(C(this,Si)),re(this,Si,void 0))}},Si=new WeakMap,Yh),ws,vs,ur,_i,_t,ea,Ii,Ar,fn,Zh,Yy=(Zh=class extends Ap{constructor(e){super();ce(this,Ar);ce(this,ws);ce(this,vs);ce(this,ur);ce(this,_i);ce(this,_t);ce(this,ea);ce(this,Ii);re(this,Ii,!1),re(this,ea,e.defaultOptions),this.setOptions(e.options),this.observers=[],re(this,_i,e.client),re(this,ur,C(this,_i).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,re(this,ws,Zy(this.options)),this.state=e.state??C(this,ws),this.scheduleGc()}get meta(){return this.options.meta}get promise(){return C(this,_t)?.promise}setOptions(e){this.options={...C(this,ea),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&C(this,ur).remove(this)}setData(e,r){const n=pf(this.state.data,e,this.options);return ge(this,Ar,fn).call(this,{data:n,type:"success",dataUpdatedAt:r?.updatedAt,manual:r?.manual}),n}setState(e,r){ge(this,Ar,fn).call(this,{type:"setState",state:e,setStateOptions:r})}cancel(e){const r=C(this,_t)?.promise;return C(this,_t)?.cancel(e),r?r.then(fr).catch(fr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(C(this,ws))}isActive(){return this.observers.some(e=>Pr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Sl||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!gp(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(r=>r.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),C(this,_t)?.continue()}onOnline(){this.observers.find(r=>r.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),C(this,_t)?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),C(this,ur).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(r=>r!==e),this.observers.length||(C(this,_t)&&(C(this,Ii)?C(this,_t).cancel({revert:!0}):C(this,_t).cancelRetry()),this.scheduleGc()),C(this,ur).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ge(this,Ar,fn).call(this,{type:"invalidate"})}fetch(e,r){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&r?.cancelRefetch)this.cancel({silent:!0});else if(C(this,_t))return C(this,_t).continueRetry(),C(this,_t).promise}if(e&&this.setOptions(e),!this.options.queryFn){const c=this.observers.find(u=>u.options.queryFn);c&&this.setOptions(c.options)}const n=new AbortController,i=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(re(this,Ii,!0),n.signal)})},s=()=>{const c=bp(this.options,r),u={client:C(this,_i),queryKey:this.queryKey,meta:this.meta};return i(u),re(this,Ii,!1),this.options.persister?this.options.persister(c,u,this):c(u)},o={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:C(this,_i),state:this.state,fetchFn:s};i(o),this.options.behavior?.onFetch(o,this),re(this,vs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&ge(this,Ar,fn).call(this,{type:"fetch",meta:o.fetchOptions?.meta});const a=c=>{Eu(c)&&c.silent||ge(this,Ar,fn).call(this,{type:"error",error:c}),Eu(c)||(C(this,ur).config.onError?.(c,this),C(this,ur).config.onSettled?.(this.state.data,c,this)),this.scheduleGc()};return re(this,_t,xp({initialPromise:r?.initialPromise,fn:o.fetchFn,abort:n.abort.bind(n),onSuccess:c=>{if(c===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(c)}catch(u){a(u);return}C(this,ur).config.onSuccess?.(c,this),C(this,ur).config.onSettled?.(c,this.state.error,this),this.scheduleGc()},onError:a,onFail:(c,u)=>{ge(this,Ar,fn).call(this,{type:"failed",failureCount:c,error:u})},onPause:()=>{ge(this,Ar,fn).call(this,{type:"pause"})},onContinue:()=>{ge(this,Ar,fn).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),C(this,_t).start()}},ws=new WeakMap,vs=new WeakMap,ur=new WeakMap,_i=new WeakMap,_t=new WeakMap,ea=new WeakMap,Ii=new WeakMap,Ar=new WeakSet,fn=function(e){const r=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Ep(n.data,this.options),fetchMeta:e.meta??null};case"success":return{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return Eu(i)&&i.revert&&C(this,vs)?{...C(this,vs),fetchStatus:"idle"}:{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=r(this.state),Nt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),C(this,ur).notify({query:this,type:"updated",action:e})})},Zh);function Ep(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:wp(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function Zy(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,r=e!==void 0,n=r?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Ur,Xh,Xy=(Xh=class extends oa{constructor(e={}){super();ce(this,Ur);this.config=e,re(this,Ur,new Map)}build(e,r,n){const i=r.queryKey,s=r.queryHash??Pl(i,r);let o=this.get(s);return o||(o=new Yy({client:e,queryKey:i,queryHash:s,options:e.defaultQueryOptions(r),state:n,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){C(this,Ur).has(e.queryHash)||(C(this,Ur).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const r=C(this,Ur).get(e.queryHash);r&&(e.destroy(),r===e&&C(this,Ur).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Nt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return C(this,Ur).get(e)}getAll(){return[...C(this,Ur).values()]}find(e){const r={exact:!0,...e};return this.getAll().find(n=>H0(r,n))}findAll(e={}){const r=this.getAll();return Object.keys(e).length>0?r.filter(n=>H0(e,n)):r}notify(e){Nt.batch(()=>{this.listeners.forEach(r=>{r(e)})})}onFocus(){Nt.batch(()=>
17{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Nt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ur=new WeakMap,Xh),Dr,Tt,Ni,zr,Un,ep,eb=(ep=class extends Ap{constructor(e){super();ce(this,zr);ce(this,Dr);ce(this,Tt);ce(this,Ni);this.mutationId=e.mutationId,re(this,Tt,e.mutationCache),re(this,Dr,[]),this.state=e.state||tb(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){C(this,Dr).includes(e)||(C(this,Dr).push(e),this.clearGcTimeout(),C(this,Tt).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){re(this,Dr,C(this,Dr).filter(r=>r!==e)),this.scheduleGc(),C(this,Tt).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){C(this,Dr).length||(this.state.status==="pending"?this.scheduleGc():C(this,Tt).remove(this))}continue(){return C(this,Ni)?.continue()??this.execute(this.state.variables)}async execute(e){re(this,Ni,xp({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(i,s)=>{ge(this,zr,Un).call(this,{type:"failed",failureCount:i,error:s})},onPause:()=>{ge(this,zr,Un).call(this,{type:"pause"})},onContinue:()=>{ge(this,zr,Un).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>C(this,Tt).canRun(this)}));const r=this.state.status==="pending",n=!C(this,Ni).canStart();try{if(!r){ge(this,zr,Un).call(this,{type:"pending",variables:e,isPaused:n}),await C(this,Tt).config.onMutate?.(e,this);const s=await this.options.onMutate?.(e);s!==this.state.context&&ge(this,zr,Un).call(this,{type:"pending",context:s,variables:e,isPaused:n})}const i=await C(this,Ni).start();return await C(this,Tt).config.onSuccess?.(i,e,this.state.context,this),await this.options.onSuccess?.(i,e,this.state.context),await C(this,Tt).config.onSettled?.(i,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(i,null,e,this.state.context),ge(this,zr,Un).call(this,{type:"success",data:i}),i}catch(i){try{throw await C(this,Tt).config.onError?.(i,e,this.state.context,this),await this.options.onError?.(i,e,this.state.context),await C(this,Tt).config.onSettled?.(void 0,i,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,i,e,this.state.context),i}finally{ge(this,zr,Un).call(this,{type:"error",error:i})}}finally{C(this,Tt).runNext(this)}}},Dr=new WeakMap,Tt=new WeakMap,Ni=new WeakMap,zr=new WeakSet,Un=function(e){const r=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Nt.batch(()=>{C(this,Dr).forEach(n=>{n.onMutationUpdate(e)}),C(this,Tt).notify({mutation:this,type:"updated",action:e})})},ep);function tb(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var pn,Er,ta,tp,rb=(tp=class extends oa{constructor(e={}){super();ce(this,pn);ce(this,Er);ce(this,ta);this.config=e,re(this,pn,new Set),re(this,Er,new Map),re(this,ta,0)}build(e,r,n){const i=new eb({mutationCache:this,mutationId:++Ta(this,ta)._,options:e.defaultMutationOptions(r),state:n});return this.add(i),i}add(e){C(this,pn).add(e);const r=Ca(e);if(typeof r=="string"){const n=C(this,Er).get(r);n?n.push(e):C(this,Er).set(r,[e])}this.notify({type:"added",mutation:e})}remove(e){if(C(this,pn).delete(e)){const r=Ca(e);if(typeof r=="string"){const n=C(this,Er).get(r);if(n)if(n.length>1){const i=n.indexOf(e);i!==-1&&n.splice(i,1)}else n[0]===e&&C(this,Er).delete(r)}}this.notify({type:"removed",mutation:e})}canRun(e){const r=Ca(e);if(typeof r=="string"){const i=C(this,Er).get(r)?.find(s=>
vendor: 13,359 bytes, line 17
17s.state.status==="pending");return!i||i===e}else return!0}runNext(e){const r=Ca(e);return typeof r=="string"?C(this,Er).get(r)?.find(i=>i!==e&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Nt.batch(()=>{C(this,pn).forEach(e=>{this.notify({type:"removed",mutation:e})}),C(this,pn).clear(),C(this,Er).clear()})}getAll(){return Array.from(C(this,pn))}find(e){const r={exact:!0,...e};return this.getAll().find(n=>V0(r,n))}findAll(e={}){return this.getAll().filter(r=>V0(e,r))}notify(e){Nt.batch(()=>{this.listeners.forEach(r=>{r(e)})})}resumePausedMutations(){const e=this.getAll().filter(r=>r.state.isPaused);return Nt.batch(()=>Promise.all(e.map(r=>r.continue().catch(fr))))}},pn=new WeakMap,Er=new WeakMap,ta=new WeakMap,tp);function Ca(t){return t.options.scope?.id}function Q0(t){return{onFetch:(e,r)=>{const n=e.options,i=e.fetchOptions?.meta?.fetchMore?.direction,s=e.state.data?.pages||[],o=e.state.data?.pageParams||[];let a={pages:[],pageParams:[]},c=0;const u=async()=>{let f=!1;const d=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(e.signal.aborted?f=!0:e.signal.addEventListener("abort",()=>{f=!0}),e.signal)})},m=bp(e.options,e.fetchOptions),g=async(w,A,k)=>{if(f)return Promise.reject();if(A==null&&w.pages.length)return Promise.resolve(w);const _={client:e.client,queryKey:e.queryKey,pageParam:A,direction:k?"backward":"forward",meta:e.options.meta};d(_);const B=await m(_),{maxPages:T}=e.options,N=k?Vy:Hy;return{pages:N(w.pages,B,T),pageParams:N(w.pageParams,A,T)}};if(i&&s.length){const w=i==="backward",A=w?nb:J0,k={pages:s,pageParams:o},_=A(n,k);a=await g(k,_,w)}else{const w=t??s.length;do{const A=c===0?o[0]??n.initialPageParam:J0(n,a);if(c>0&&A==null)break;a=await g(a,A),c++}while(c<w)}return a};e.options.persister?e.fetchFn=()=>e.options.persister?.(u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r):e.fetchFn=u}}}function J0(t,{pages:e,pageParams:r}){const n=e.length-1;return e.length>0?t.getNextPageParam(e[n],e,r[n],r):void 0}function nb(t,{pages:e,pageParams:r}){return e.length>0?t.getPreviousPageParam?.(e[0],e,r[0],r):void 0}var ot,Gn,Hn,xs,As,Vn,Es,Ps,rp,jP=(rp=class{constructor(t={}){ce(this,ot);ce(this,Gn);ce(this,Hn);ce(this,xs);ce(this,As);ce(this,Vn);ce(this,Es);ce(this,Ps);re(this,ot,t.queryCache||new Xy),re(this,Gn,t.mutationCache||new rb),re(this,Hn,t.defaultOptions||{}),re(this,xs,new Map),re(this,As,new Map),re(this,Vn,0)}mount(){Ta(this,Vn)._++,C(this,Vn)===1&&(re(this,Es,_l.subscribe(async t=>{t&&(await this.resumePausedMutations(),C(this,ot).onFocus())})),re(this,Ps,ic.subscribe(async t=>{t&&(await this.resumePausedMutations(),C(this,ot).onOnline())})))}unmount(){var t,e;Ta(this,Vn)._--,C(this,Vn)===0&&((t=C(this,Es))==null||t.call(this),re(this,Es,void 0),(e=C(this,Ps))==null||e.call(this),re(this,Ps,void 0))}isFetching(t){return C(this,ot).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return C(this,Gn).findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return C(this,ot).get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),r=C(this,ot).build(this,e),n=r.state.data;return n===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(cs(e.staleTime,r))&&this.prefetchQuery(e),Promise.resolve(n))}getQueriesData(t){return C(this,ot).findAll(t).map(({queryKey:e,state:r})=>{const n=r.data;return[e,n]})}setQueryData(t,e,r){const n=this.defaultQueryOptions({queryKey:t}),s=C(this,ot).get(n.queryHash)?.state.data,o=jy(e,s);if(o!==void 0)return C(this,ot).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(t,e,r){return Nt.batch(()=>C(this,ot).findAll(t).map(({queryKey:n})=>[n,this.setQueryData(n,e,r)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return C(this,ot).get(e.queryHash)?.state}removeQueries(t){const e=C(this,ot);Nt.batch(()=>{e.findAll(t).forEach(r=>{e.remove(r)})})}resetQueries(t,e){const r=C(this,ot),n={type:"active",...t};return Nt.batch(()=>(r.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries(n,e)))}cancelQueries(t,e={}){const r={revert:!0,...e},n=Nt.batch(()=>C(this,ot).findAll(t).map(i=>i.cancel(r)));return Promise.all(n).then(fr).catch(fr)}invalidateQueries(t,e={}){return Nt.batch(()=>{if(C(this,ot).findAll(t).forEach(n=>{n.invalidate()}),t?.refetchType==="none")return Promise.resolve();const r={...t,type:t?.refetchType??t?.type??"active"};return this.refetchQueries(r,e)})}refetchQueries(t,e={}){const r={...e,cancelRefetch:e.cancelRefetch??!0},n=Nt.batch(()=>C(this,ot).findAll(t).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,r);return r.throwOnError||(s=s.catch(fr)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(n).then(fr)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const r=C(this,ot).build(this,e);return r.isStaleByTime(cs(e.staleTime,r))?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(fr).catch(fr)}fetchInfiniteQuery(t){return t.behavior=Q0(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(fr).catch(fr)}ensureInfiniteQueryData(t){return t.behavior=Q0(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return ic.isOnline()?C(this,Gn).resumePausedMutations():Promise.resolve()}getQueryCache(){return C(this,ot)}getMutationCache(){return C(this,Gn)}getDefaultOptions(){return C(this,Hn)}setDefaultOptions(t){re(this,Hn,t)}setQueryDefaults(t,e){C(this,xs).set(wo(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...C(this,xs).values()],r={};return e.forEach(n=>{vo(t,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(t,e){C(this,As).set(wo(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...C(this,As).values()];let r={};return e.forEach(n=>{vo(t,n.mutationKey)&&(r={...r,...n.defaultOptions})}),r}defaultQueryOptions(t){if(t._defaulted)return t;const e={...C(this,Hn).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Pl(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Sl&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...C(this,Hn).mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){C(this,ot).clear(),C(this,Gn).clear()}},ot=new WeakMap,Gn=new WeakMap,Hn=new WeakMap,xs=new WeakMap,As=new WeakMap,Vn=new WeakMap,Es=new WeakMap,Ps=new WeakMap,rp),Dt,ye,ra,Rt,ki,Ss,Kn,qr,na,_s,Is,Mi,Ti,Wn,Ns,Ae,po,gf,yf,bf,wf,vf,xf,Af,Pp,np,GP=(np=class extends oa{constructor(e,r){super();ce(this,Ae);ce(this,Dt);ce(this,ye);ce(this,ra);ce(this,Rt);ce(this,ki);ce(this,Ss);ce(this,Kn);ce(this,qr);ce(this,na);ce(this,_s);ce(this,Is);ce(this,Mi);ce(this,Ti);ce(this,Wn);ce(this,Ns,new Set);this.options=r,re(this,Dt,e),re(this,qr,null),re(this,Kn,mf()),this.options.experimental_prefetchInRender||C(this,Kn).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(C(this,ye).addObserver(this),Y0(C(this,ye),this.options)?ge(this,Ae,po).call(this):this.updateResult(),ge(this,Ae,wf).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ef(C(this,ye),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ef(C(this,ye),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ge(this,Ae,vf).call(this),ge(this,Ae,xf).call(this),C(this,ye).removeObserver(this)}setOptions(e,r){const n=this.options,i=C(this,ye);if(this.options=C(this,Dt).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Pr(this.options.enabled,C(this,ye))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ge(this,Ae,Af).call(this),C(this,ye).setOptions(this.options),n._defaulted&&!df(this.options,n)&&C(this,Dt).getQueryCache().notify({type:"observerOptionsUpdated",query:C(this,ye),observer:this});const s=this.hasListeners();s&&Z0(C(this,ye),i,this.options,n)&&ge(this,Ae,po).call(this),this.updateResult(r),s&&(C(this,ye)!==i||Pr(this.options.enabled,C(this,ye))!==Pr(n.enabled,C(this,ye))||cs(this.options.staleTime,C(this,ye))!==cs(n.staleTime,C(this,ye)))&&ge(this,Ae,gf).call(this);const o=ge(this,Ae,yf).call(this);s&&(C(this,ye)!==i||Pr(this.options.enabled,C(this,ye))!==Pr(n.enabled,C(this,ye))||o!==C(this,Wn))&&ge(this,Ae,bf).call(this,o)}getOptimisticResult(e){const r=C(this,Dt).getQueryCache().build(C(this,Dt),e),n=this.createResult(r,e);return sb(this,n)&&(re(this,Rt,n),re(this,Ss,this.options),re(this,ki,C(this,ye).state)),n}getCurrentResult(){return C(this,Rt)}trackResult(e,r){const n={};return Object.keys(e).forEach(i=>{Object.defineProperty(n,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),r?.(i),e[i])})}),n}trackProp(e){C(this,Ns).add(e)}getCurrentQuery(){return C(this,ye)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const r=C(this,Dt).defaultQueryOptions(e),n=C(this,Dt).getQueryCache().build(C(this,Dt),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(e){return ge(this,Ae,po).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),C(this,Rt)))}createResult(e,r){const n=C(this,ye),i=this.options,s=C(this,Rt),o=C(this,ki),a=C(this,Ss),u=e!==n?e.state:C(this,ra),{state:f}=e;let d={...f},m=!1,g;if(r._optimisticResults){const L=this.hasListeners(),z=!L&&Y0(e,r),D=L&&Z0(e,n,r,i);(z||D)&&(d={...d,...Ep(f.data,e.options)}),r._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:w,errorUpdatedAt:A,status:k}=d;if(r.select&&d.data!==void 0)if(s&&d.data===o?.data&&r.select===C(this,na))g=C(this,_s);else try{re(this,na,r.select),g=r.select(d.data),g=pf(s?.data,g,r),re(this,_s,g),re(this,qr,null)}catch(L){re(this,qr,L)}else g=d.data;if(r.placeholderData!==void 0&&g===void 0&&k==="pending"){let L;if(s?.isPlaceholderData&&r.placeholderData===a?.placeholderData)L=s.data;else if(L=typeof r.placeholderData=="function"?r.placeholderData(C(this,Is)?.state.data,C(this,Is)):r.placeholderData,r.select&&L!==void 0)try{L=r.select(L),re(this,qr,null)}catch(z){re(this,qr,z)}L!==void 0&&(k="success",g=pf(s?.data,L,r),m=!0)}C(this,qr)&&(w=C(this,qr),g=C(this,_s),A=Date.now(),k="error");const _=d.fetchStatus==="fetching",B=k==="pending",T=k==="error",N=B&&_,M=g!==void 0,F={status:k,fetchStatus:d.fetchStatus,isPending:B,isSuccess:k==="success",isError:T,isInitialLoading:N,isLoading:N,data:g,dataUpdatedAt:d.dataUpdatedAt,error:w,errorUpdatedAt:A,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:_,isRefetching:_&&!B,isLoadingError:T&&!M,isPaused:d.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:T&&M,isStale:Il(e,r),refetch:this.refetch,promise:C(this,Kn)};if(this.options.experimental_prefetchInRender){const L=j=>{F.status==="error"?j.reject(F.error):F.data!==void 0&&j.resolve(F.data)},z=()=>{const j=re(this,Kn,F.promise=mf());L(j)},D=C(this,Kn);switch(D.status){case"pending":e.queryHash===n.queryHash&&L(D);break;case"fulfilled":(F.status==="error"||F.data!==D.value)&&z();break;case"rejected":(F.status!=="error"||F.error!==D.reason)&&z();break}}return F}updateResult(e){const r=C(this,Rt),n=this.createResult(C(this,ye),this.options);if(re(this,ki,C(this,ye).state),re(this,Ss,this.options),C(this,ki).data!==void 0&&re(this,Is,C(this,ye)),df(n,r))return;re(this,Rt,n);const i={},s=()=>{if(!r)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!C(this,Ns).size)return!0;const c=new Set(a??C(this,Ns));return this.options.throwOnError&&c.add("error"),Object.keys(C(this,Rt)).some(u=>{const f=u;return C(this,Rt)[f]!==r[f]&&c.has(f)})};e?.listeners!==!1&&s()&&(i.listeners=!0),ge(this,Ae,Pp).call(this,{...i,...e})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ge(this,Ae,wf).call(this)}},Dt=new WeakMap,ye=new WeakMap,ra=new WeakMap,Rt=new WeakMap,ki=new WeakMap,Ss=new WeakMap,Kn=new WeakMap,qr=new WeakMap,na=new WeakMap,_s=new WeakMap,Is=new WeakMap,Mi=new WeakMap,Ti=new WeakMap,Wn=new WeakMap,Ns=new WeakMap,Ae=new WeakSet,po=function(e){ge(this,Ae,Af).call(this);let r=C(this,ye).fetch(this.options,e);return e?.throwOnError||(r=r.catch(fr)),r},gf=function(){ge(this,Ae,vf).call(this);const e=cs(this.options.staleTime,C(this,ye));if(ks||C(this,Rt).isStale||!lf(e))return;const n=gp(C(this,Rt).dataUpdatedAt,e)+1;re(this,Mi,setTimeout(()=>{C(this,Rt).isStale||this.updateResult()},n))},yf=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(C(this,ye)):this.options.refetchInterval)??!1},bf=function(e){ge(this,Ae,xf).call(this),re(this,Wn,e),!(ks||Pr(this.options.enabled,C(this,ye))===!1||!lf(C(this,Wn))||C(this,Wn)===0)&&re(this,Ti,setInterval(()=>
17{(this.options.refetchIntervalInBackground||_l.isFocused())&&ge(this,Ae,po).call(this)},C(this,Wn)))},wf=function(){ge(this,Ae,gf).call(this),ge(this,Ae,bf).call(this,ge(this,Ae,yf).call(this))},vf=function(){C(this,Mi)&&(clearTimeout(C(this,Mi)),re(this,Mi,void 0))},xf=function(){C(this,Ti)&&(clearInterval(C(this,Ti)),re(this,Ti,void 0))},Af=function(){const e=C(this,Dt).getQueryCache().build(C(this,Dt),this.options);if(e===C(this,ye))return;const r=C(this,ye);re(this,ye,e),re(this,ra,e.state),this.hasListeners()&&(r?.removeObserver(this),e.addObserver(this))},Pp=function(e){Nt.batch(()=>{e.listeners&&this.listeners.forEach(r=>{r(C(this,Rt))}),C(this,Dt).getQueryCache().notify({query:C(this,ye),type:"observerResultsUpdated"})})},np);function ib(t,e){return Pr(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function Y0(t,e){return ib(t,e)||t.state.data!==void 0&&Ef(t,e,e.refetchOnMount)}function Ef(t,e,r){if(Pr(e.enabled,t)!==!1){const n=typeof r=="function"?r(t):r;return n==="always"||n!==!1&&Il(t,e)}return!1}function Z0(t,e,r,n){return(t!==e||Pr(n.enabled,t)===!1)&&(!r.suspense||t.state.status!=="error")&&Il(t,r)}function Il(t,e){return Pr(e.enabled,t)!==!1&&t.isStaleByTime(cs(e.staleTime,t))}function sb(t,e){return!df(t.getCurrentResult(),e)}var Nl={exports:{}};const ob={},ab=Object.freeze(Object.defineProperty({__proto__:null,default:ob},Symbol.toStringTag,{value:"Module"})),cb=vy(ab);Nl.exports;(function(t){(function(e,r){function n(E,l){if(!E)throw new Error(l||"Assertion failed")}function i(E,l){E.super_=l;var p=function(){};p.prototype=l.prototype,E.prototype=new p,E.prototype.constructor=E}function s(E,l,p){if(s.isBN(E))return E;this.negative=0,this.words=null,this.length=0,this.red=null,E!==null&&((l==="le"||l==="be")&&(p=l,l=10),this._init(E||0,l||10,p||"be"))}
vendor: 40,853 bytes, line 17
17typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=cb.Buffer}catch{}s.isBN=function(l){return l instanceof s?!0:l!==null&&typeof l=="object"&&l.constructor.wordSize===s.wordSize&&Array.isArray(l.words)},s.max=function(l,p){return l.cmp(p)>0?l:p},s.min=function(l,p){return l.cmp(p)<0?l:p},s.prototype._init=function(l,p,b){if(typeof l=="number")return this._initNumber(l,p,b);if(typeof l=="object")return this._initArray(l,p,b);p==="hex"&&(p=16),n(p===(p|0)&&p>=2&&p<=36),l=l.toString().replace(/\s+/g,"");var x=0;l[0]==="-"&&(x++,this.negative=1),x<l.length&&(p===16?this._parseHex(l,x,b):(this._parseBase(l,p,x),b==="le"&&this._initArray(this.toArray(),p,b)))},s.prototype._initNumber=function(l,p,b){l<0&&(this.negative=1,l=-l),l<67108864?(this.words=[l&67108863],this.length=1):l<4503599627370496?(this.words=[l&67108863,l/67108864&67108863],this.length=2):(n(l<9007199254740992),this.words=[l&67108863,l/67108864&67108863,1],this.length=3),b==="le"&&this._initArray(this.toArray(),p,b)},s.prototype._initArray=function(l,p,b){if(n(typeof l.length=="number"),l.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(l.length/3),this.words=new Array(this.length);for(var x=0;x<this.length;x++)this.words[x]=0;var v,I,R=0;if(b==="be")for(x=l.length-1,v=0;x>=0;x-=3)I=l[x]|l[x-1]<<8|l[x-2]<<16,this.words[v]|=I<<R&67108863,this.words[v+1]=I>>>26-R&67108863,R+=24,R>=26&&(R-=26,v++);else if(b==="le")for(x=0,v=0;x<l.length;x+=3)I=l[x]|l[x+1]<<8|l[x+2]<<16,this.words[v]|=I<<R&67108863,this.words[v+1]=I>>>26-R&67108863,R+=24,R>=26&&(R-=26,v++);return this._strip()};function a(E,l){var p=E.charCodeAt(l);if(p>=48&&p<=57)return p-48;if(p>=65&&p<=70)return p-55;if(p>=97&&p<=102)return p-87;n(!1,"Invalid character in "+E)}function c(E,l,p){var b=a(E,p);return p-1>=l&&(b|=a(E,p-1)<<4),b}s.prototype._parseHex=function(l,p,b){this.length=Math.ceil((l.length-p)/6),this.words=new Array(this.length);for(var x=0;x<this.length;x++)this.words[x]=0;var v=0,I=0,R;if(b==="be")for(x=l.length-1;x>=p;x-=2)R=c(l,p,x)<<v,this.words[I]|=R&67108863,v>=18?(v-=18,I+=1,this.words[I]|=R>>>26):v+=8;else{var P=l.length-p;for(x=P%2===0?p+1:p;x<l.length;x+=2)R=c(l,p,x)<<v,this.words[I]|=R&67108863,v>=18?(v-=18,I+=1,this.words[I]|=R>>>26):v+=8}this._strip()};function u(E,l,p,b){for(var x=0,v=0,I=Math.min(E.length,p),R=l;R<I;R++){var P=E.charCodeAt(R)-48;x*=b,P>=49?v=P-49+10:P>=17?v=P-17+10:v=P,n(P>=0&&v<b,"Invalid character"),x+=v}return x}s.prototype._parseBase=function(l,p,b){this.words=[0],this.length=1;for(var x=0,v=1;v<=67108863;v*=p)x++;x--,v=v/p|0;for(var I=l.length-b,R=I%x,P=Math.min(I,I-R)+b,h=0,S=b;S<P;S+=x)h=u(l,S,S+x,p),this.imuln(v),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(R!==0){var Z=1;for(h=u(l,S,l.length,p),S=0;S<R;S++)Z*=p;this.imuln(Z),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this._strip()},s.prototype.copy=function(l){l.words=new Array(this.length);for(var p=0;p<this.length;p++)l.words[p]=this.words[p];l.length=this.length,l.negative=this.negative,l.red=this.red};function f(E,l){E.words=l.words,E.length=l.length,E.negative=l.negative,E.red=l.red}if(s.prototype._move=function(l){f(l,this)},s.prototype.clone=function(){var l=new s(null);return this.copy(l),l},s.prototype._expand=function(l){for(;this.length<l;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch{s.prototype.inspect=d}else s.prototype.inspect=d;function d(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var m=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],g=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],w=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(l,p){l=l||10,p=p|0||1;var b;if(l===16||l==="hex"){b="";for(var x=0,v=0,I=0;I<this.length;I++){var R=this.words[I],P=((R<<x|v)&16777215).toString(16);v=R>>>24-x&16777215,x+=2,x>=26&&(x-=26,I--),v!==0||I!==this.length-1?b=m[6-P.length]+P+b:b=P+b}for(v!==0&&(b=v.toString(16)+b);b.length%p!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(l===(l|0)&&l>=2&&l<=36){var h=g[l],S=w[l];b="";var Z=this.clone();for(Z.negative=0;!Z.isZero();){var y=Z.modrn(S).toString(l);Z=Z.idivn(S),Z.isZero()?b=y+b:b=m[h-y.length]+y+b}for(this.isZero()&&(b="0"+b);b.length%p!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var l=this.words[0];return this.length===2?l+=this.words[1]*67108864:this.length===3&&this.words[2]===1?l+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-l:l},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(l,p){return this.toArrayLike(o,l,p)}),s.prototype.toArray=function(l,p){return this.toArrayLike(Array,l,p)};var A=function(l,p){return l.allocUnsafe?l.allocUnsafe(p):new l(p)};s.prototype.toArrayLike=function(l,p,b){this._strip();var x=this.byteLength(),v=b||Math.max(1,x);n(x<=v,"byte array longer than desired length"),n(v>0,"Requested array length <= 0");var I=A(l,v),R=p==="le"?"LE":"BE";return this["_toArrayLike"+R](I,x),I},s.prototype._toArrayLikeLE=function(l,p){for(var b=0,x=0,v=0,I=0;v<this.length;v++){var R=this.words[v]<<I|x;l[b++]=R&255,b<l.length&&(l[b++]=R>>8&255),b<l.length&&(l[b++]=R>>16&255),I===6?(b<l.length&&(l[b++]=R>>24&255),x=0,I=0):(x=R>>>24,I+=2)}if(b<l.length)for(l[b++]=x;b<l.length;)l[b++]=0},s.prototype._toArrayLikeBE=function(l,p){for(var b=l.length-1,x=0,v=0,I=0;v<this.length;v++){var R=this.words[v]<<I|x;l[b--]=R&255,b>=0&&(l[b--]=R>>8&255),b>=0&&(l[b--]=R>>16&255),I===6?(b>=0&&(l[b--]=R>>24&255),x=0,I=0):(x=R>>>24,I+=2)}if(b>=0)for(l[b--]=x;b>=0;)l[b--]=0},Math.clz32?s.prototype._countBits=function(l){return 32-Math.clz32(l)}:s.prototype._countBits=function(l){var p=l,b=0;return p>=4096&&(b+=13,p>>>=13),p>=64&&(b+=7,p>>>=7),p>=8&&(b+=4,p>>>=4),p>=2&&(b+=2,p>>>=2),b+p},s.prototype._zeroBits=function(l){if(l===0)return 26;var p=l,b=0;return p&8191||(b+=13,p>>>=13),p&127||(b+=7,p>>>=7),p&15||(b+=4,p>>>=4),p&3||(b+=2,p>>>=2),p&1||b++,b},s.prototype.bitLength=function(){var l=this.words[this.length-1],p=this._countBits(l);return(this.length-1)*26+p};function k(E){for(var l=new Array(E.bitLength()),p=0;p<l.length;p++){var b=p/26|0,x=p%26;l[p]=E.words[b]>>>x&1}return l}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var l=0,p=0;p<this.length;p++){var b=this._zeroBits(this.words[p]);if(l+=b,b!==26)break}return l},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(l){return this.negative!==0?this.abs().inotn(l).iaddn(1):this.clone()},s.prototype.fromTwos=function(l){return this.testn(l-1)?this.notn(l).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(l){for(;this.length<l.length;)this.words[this.length++]=0;for(var p=0;p<l.length;p++)this.words[p]=this.words[p]|l.words[p];return this._strip()},s.prototype.ior=function(l){return n((this.negative|l.negative)===0),this.iuor(l)},s.prototype.or=function(l){return this.length>l.length?this.clone().ior(l):l.clone().ior(this)},s.prototype.uor=function(l){return this.length>l.length?this.clone().iuor(l):l.clone().iuor(this)},s.prototype.iuand=function(l){var p;this.length>l.length?p=l:p=this;for(var b=0;b<p.length;b++)this.words[b]=this.words[b]&l.words[b];return this.length=p.length,this._strip()},s.prototype.iand=function(l){return n((this.negative|l.negative)===0),this.iuand(l)},s.prototype.and=function(l){return this.length>l.length?this.clone().iand(l):l.clone().iand(this)},s.prototype.uand=function(l){return this.length>l.length?this.clone().iuand(l):l.clone().iuand(this)},s.prototype.iuxor=function(l){var p,b;this.length>l.length?(p=this,b=l):(p=l,b=this);for(var x=0;x<b.length;x++)this.words[x]=p.words[x]^b.words[x];if(this!==p)for(;x<p.length;x++)this.words[x]=p.words[x];return this.length=p.length,this._strip()},s.prototype.ixor=function(l){return n((this.negative|l.negative)===0),this.iuxor(l)},s.prototype.xor=function(l){return this.length>l.length?this.clone().ixor(l):l.clone().ixor(this)},s.prototype.uxor=function(l){return this.length>l.length?this.clone().iuxor(l):l.clone().iuxor(this)},s.prototype.inotn=function(l){n(typeof l=="number"&&l>=0);var p=Math.ceil(l/26)|0,b=l%26;this._expand(p),b>0&&p--;for(var x=0;x<p;x++)this.words[x]=~this.words[x]&67108863;return b>0&&(this.words[x]=~this.words[x]&67108863>>26-b),this._strip()},s.prototype.notn=function(l){return this.clone().inotn(l)},s.prototype.setn=function(l,p){n(typeof l=="number"&&l>=0);var b=l/26|0,x=l%26;return this._expand(b+1),p?this.words[b]=this.words[b]|1<<x:this.words[b]=this.words[b]&~(1<<x),this._strip()},s.prototype.iadd=function(l){var p;if(this.negative!==0&&l.negative===0)return this.negative=0,p=this.isub(l),this.negative^=1,this._normSign();if(this.negative===0&&l.negative!==0)return l.negative=0,p=this.isub(l),l.negative=1,p._normSign();var b,x;this.length>l.length?(b=this,x=l):(b=l,x=this);for(var v=0,I=0;I<x.length;I++)p=(b.words[I]|0)+(x.words[I]|0)+v,this.words[I]=p&67108863,v=p>>>26;for(;v!==0&&I<b.length;I++)p=(b.words[I]|0)+v,this.words[I]=p&67108863,v=p>>>26;if(this.length=b.length,v!==0)this.words[this.length]=v,this.length++;else if(b!==this)for(;I<b.length;I++)this.words[I]=b.words[I];return this},s.prototype.add=function(l){var p;return l.negative!==0&&this.negative===0?(l.negative=0,p=this.sub(l),l.negative^=1,p):l.negative===0&&this.negative!==0?(this.negative=0,p=l.sub(this),this.negative=1,p):this.length>l.length?this.clone().iadd(l):l.clone().iadd(this)},s.prototype.isub=function(l){if(l.negative!==0){l.negative=0;var p=this.iadd(l);return l.negative=1,p._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(l),this.negative=1,this._normSign();var b=this.cmp(l);if(b===0)return this.negative=0,this.length=1,this.words[0]=0,this;var x,v;b>0?(x=this,v=l):(x=l,v=this);for(var I=0,R=0;R<v.length;R++)p=(x.words[R]|0)-(v.words[R]|0)+I,I=p>>26,this.words[R]=p&67108863;for(;I!==0&&R<x.length;R++)p=(x.words[R]|0)+I,I=p>>26,this.words[R]=p&67108863;if(I===0&&R<x.length&&x!==this)for(;R<x.length;R++)this.words[R]=x.words[R];return this.length=Math.max(this.length,R),x!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(l){return this.clone().isub(l)};function _(E,l,p){p.negative=l.negative^E.negative;var b=E.length+l.length|0;p.length=b,b=b-1|0;var x=E.words[0]|0,v=l.words[0]|0,I=x*v,R=I&67108863,P=I/67108864|0;p.words[0]=R;for(var h=1;h<b;h++){for(var S=P>>>26,Z=P&67108863,y=Math.min(h,l.length-1),U=Math.max(0,h-E.length+1);U<=y;U++){var G=h-U|0;x=E.words[G]|0,v=l.words[U]|0,I=x*v+Z,S+=I/67108864|0,Z=I&67108863}p.words[h]=Z|0,P=S|0}return P!==0?p.words[h]=P|0:p.length--,p._strip()}var B=function(l,p,b){var x=l.words,v=p.words,I=b.words,R=0,P,h,S,Z=x[0]|0,y=Z&8191,U=Z>>>13,G=x[1]|0,H=G&8191,V=G>>>13,ie=x[2]|0,X=ie&8191,Y=ie>>>13,xe=x[3]|0,ee=xe&8191,ae=xe>>>13,Or=x[4]|0,Pe=Or&8191,Se=Or>>>13,oi=x[5]|0,_e=oi&8191,Ie=oi>>>13,ai=x[6]|0,Ne=ai&8191,ke=ai>>>13,ci=x[7]|0,Me=ci&8191,Te=ci>>>13,ui=x[8]|0,Re=ui&8191,Ce=ui>>>13,fi=x[9]|0,Be=fi&8191,Oe=fi>>>13,li=v[0]|0,Fe=li&8191,$e=li>>>13,di=v[1]|0,Le=di&8191,Ue=di>>>13,hi=v[2]|0,De=hi&8191,ze=hi>>>13,pi=v[3]|0,qe=pi&8191,je=pi>>>13,mi=v[4]|0,Ge=mi&8191,He=mi>>>13,gi=v[5]|0,Ve=gi&8191,Ke=gi>>>13,yi=v[6]|0,We=yi&8191,Qe=yi>>>13,bi=v[7]|0,Je=bi&8191,Ye=bi>>>13,wi=v[8]|0,Ze=wi&8191,Xe=wi>>>13,vi=v[9]|0,et=vi&8191,tt=vi>>>13;b.negative=l.negative^p.negative,b.length=19,P=Math.imul(y,Fe),h=Math.imul(y,$e),h=h+Math.imul(U,Fe)|0,S=Math.imul(U,$e);var Mn=(R+P|0)+((h&8191)<<13)|0;R=(S+(h>>>13)|0)+(Mn>>>26)|0,Mn&=67108863,P=Math.imul(H,Fe),h=Math.imul(H,$e),h=h+Math.imul(V,Fe)|0,S=Math.imul(V,$e),P=P+Math.imul(y,Le)|0,h=h+Math.imul(y,Ue)|0,h=h+Math.imul(U,Le)|0,S=S+Math.imul(U,Ue)|0;var Tn=(R+P|0)+((h&8191)<<13)|0;R=(S+(h>>>13)|0)+(Tn>>>26)|0,Tn&=67108863,P=Math.imul(X,Fe),h=Math.imul(X,$e),h=h+Math.imul(Y,Fe)|0,S=Math.imul(Y,$e),P=P+Math.imul(H,Le)|0,h=h+Math.imul(H,Ue)|0,h=h+Math.imul(V,Le)|0,S=S+Math.imul(V,Ue)|0,P=P+Math.imul(y,De)|0,h=h+Math.imul(y,ze)|0,h=h+Math.imul(U,De)|0,S=S+Math.imul(U,ze)|0;var Rn=(R+P|0)+((h&8191)<<13)|0;R=(S+(h>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,P=Math.imul(ee,Fe),h=Math.imul(ee,$e),h=h+Math.imul(ae,Fe)|0,S=Math.imul(ae,$e),P=P+Math.imul(X,Le)|0,h=h+Math.imul(X,Ue)|0,h=h+Math.imul(Y,Le)|0,S=S+Math.imul(Y,Ue)|0,P=P+Math.imul(H,De)|0,h=h+Math.imul(H,ze)|0,h=h+Math.imul(V,De)|0,S=S+Math.imul(V,ze)|0,P=P+Math.imul(y,qe)|0,h=h+Math.imul(y,je)|0,h=h+Math.imul(U,qe)|0,S=S+Math.imul(U,je)|0;var Cn=(R+P|0)+((h&8191)<<13)|0;R=(S+(h>>>13)|0)+(Cn>>>26)|0,Cn&=67108863,P=Math.imul(Pe,Fe),h=Math.imul(Pe,$e),h=h+Math.imul(Se,Fe)|0,S=Math.imul(Se,$e),P=P+Math.imul(ee,Le)|0,h=h+Math.imul(ee,Ue)|0,h=h+Math.imul(ae,Le)|0,S=S+Math.imul(ae,Ue)|0,P=P+Math.imul(X,De)|0,h=h+Math.imul(X,ze)|0,h=h+Math.imul(Y,De)|0,S=S+Math.imul(Y,ze)|0,P=P+Math.imul(H,qe)|0,h=h+Math.imul(H,je)|0,h=h+Math.imul(V,qe)|0,S=S+Math.imul(V,je)|0,P=P+Math.imul(y,Ge)|0,h=h+Math.imul(y,He)|0,h=h+Math.imul(U,Ge)|0,S=S+Math.imul(U,He)|0;var Bn=(R+P|0)+((h&8191)<<13)|0;R=(S+(h>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,P=Math.imul(_e,Fe),h=Math.imul(_e,$e),h=h+Math.imul(Ie,Fe)|0,S=Math.imul(Ie,$e),P=P+Math.imul(Pe,Le)|0,h=h+Math.imul(Pe,Ue)|0,h=h+Math.imul(Se,Le)|0,S=S+Math.imul(Se,Ue)|0,P=P+Math.imul(ee,De)|0,h=h+Math.imul(ee,ze)|0,h=h+Math.imul(ae,De)|0,S=S+Math.imul(ae,ze)|0,P=P+Math.imul(X,qe)|0,h=h+Math.imul(X,je)|0,h=h+Math.imul(Y,qe)|0,S=S+Math.imul(Y,je)|0,P=P+Math.imul(H,Ge)|0,h=h+Math.imul(H,He)|0,h=h+Math.imul(V,Ge)|0,S=S+Math.imul(V,He)|0,P=P+Math.imul(y,Ve)|0,h=h+Math.imul(y,Ke)|0,h=h+Math.imul(U,Ve)|0,S=S+Math.imul(U,Ke)|0;var au=(R+P|0)+((h&8191)<<13)|0;R=(S+(h>>>13)|0)+(au>>>26)|0,au&=67108863,P=Math.imul(Ne,Fe),h=Math.imul(Ne,$e),h=h+Math.imul(ke,Fe)|0,S=Math.imul(ke,$e),P=P+Math.imul(_e,Le)|0,h=h+Math.imul(_e,Ue)|0,h=h+Math.imul(Ie,Le)|0,S=S+Math.imul(Ie,Ue)|0,P=P+Math.imul(Pe,De)|0,h=h+Math.imul(Pe,ze)|0,h=h+Math.imul(Se,De)|0,S=S+Math.imul(Se,ze)|0,P=P+Math.imul(ee,qe)|0,h=h+Math.imul(ee,je)|0,h=h+Math.imul(ae,qe)|0,S=S+Math.imul(ae,je)|0,P=P+Math.imul(X,Ge)|0,h=h+Math.imul(X,He)|0,h=h+Math.imul(Y,Ge)|0,S=S+Math.imul(Y,He)|0,P=P+Math.imul(H,Ve)|0,h=h+Math.imul(H,Ke)|0,h=h+Math.imul(V,Ve)|0,S=S+Math.imul(V,Ke)|0,P=P+Math.imul(y,We)|0,h=h+Math.imul(y,Qe)|0,h=h+Math.imul(U,We)|0,S=S+Math.imul(U,Qe)|0;var cu=(R+P|0)+((h&8191)<<13)|0;R=(S+(h>>>13)|0)+(cu>>>26)|0,cu&=67108863,P=Math.imul(Me,Fe),h=Math.imul(Me,$e),h=h+Math.imul(Te,Fe)|0,S=Math.imul(Te,$e),P=P+Math.imul(Ne,Le)|0,h=h+Math.imul(Ne,Ue)|0,h=h+Math.imul(ke,Le)|0,S=S+Math.imul(ke,Ue)|0,P=P+Math.imul(_e,De)|0,h=h+Math.imul(_e,ze)|0,h=h+Math.imul(Ie,De)|0,S=S+Math.imul(Ie,ze)|0,P=P+Math.imul(Pe,qe)|0,h=h+Math.imul(Pe,je)|0,h=h+Math.imul(Se,qe)|0,S=S+Math.imul(Se,je)|0,P=P+Math.imul(ee,Ge)|0,h=h+Math.imul(ee,He)|0,h=h+Math.imul(ae,Ge)|0,S=S+Math.imul(ae,He)|0,P=P+Math.imul(X,Ve)|0,h=h+Math.imul(X,Ke)|0,h=h+Math.imul(Y,Ve)|0,S=S+Math.imul(Y,Ke)|0,P=P+Math.imul(H,We)|0,h=h+Math.imul(H,Qe)|0,h=h+Math.imul(V,We)|0,S=S+Math.imul(V,Qe)|0,P=P+Math.imul(y,Je)|0,h=h+Math.imul(y,Ye)|0,h=h+Math.imul(U,Je)|0,S=S+Math.imul(U,Ye)|0;var uu=(R+P|0)+((h&8191)<<13)|0;R=(S+(h>>>13)|0)+(uu>>>26)|0,uu&=67108863,P=Math.imul(Re,Fe),h=Math.imul(Re,$e),h=h+Math.imul(Ce,Fe)|0,S=Math.imul(Ce,$e),P=P+Math.imul(Me,Le)|0,h=h+Math.imul(Me,Ue)|0,h=h+Math.imul(Te,Le)|0,S=S+Math.imul(Te,Ue)|0,P=P+Math.imul(Ne,De)|0,h=h+Math.imul(Ne,ze)|0,h=h+Math.imul(ke,De)|0,S=S+Math.imul(ke,ze)|0,P=P+Math.imul(_e,qe)|0,h=h+Math.imul(_e,je)|0,h=h+Math.imul(Ie,qe)|0,S=S+Math.imul(Ie,je)|0,P=P+Math.imul(Pe,Ge)|0,h=h+Math.imul(Pe,He)|0,h=h+Math.imul(Se,Ge)|0,S=S+Math.imul(Se,He)|0,P=P+Math.imul(ee,Ve)|0,h=h+Math.imul(ee,Ke)|0,h=h+Math.imul(ae,Ve)|0,S=S+Math.imul(ae,Ke)|0,P=P+Math.imul(X,We)|0,h=h+Math.imul(X,Qe)|0,h=h+Math.imul(Y,We)|0,S=S+Math.imul(Y,Qe)|0,P=P+Math.imul(H,Je)|0,h=h+Math.imul(H,Ye)|0,h=h+Math.imul(V,Je)|0,S=S+Math.imul(V,Ye)|0,P=P+Math.imul(y,Ze)|0,h=h+Math.imul(y,Xe)|0,h=h+Math.imul(U,Ze)|0,S=S+Math.imul(U,Xe)|0;var fu=(R+P|0)+((h&8191)<<13)|0;R=(S+(h>>>13)|0)+(fu>>>26)|0,fu&=67108863,P=Math.imul(Be,Fe),h=Math.imul(Be,$e),h=h+Math.imul(Oe,Fe)|0,S=Math.imul(Oe,$e),P=P+Math.imul(Re,Le)|0,h=h+Math.imul(Re,Ue)|0,h=h+Math.imul(Ce,Le)|0,S=S+Math.imul(Ce,Ue)|0,P=P+Math.imul(Me,De)|0,h=h+Math.imul(Me,ze)|0,h=h+Math.imul(Te,De)|0,S=S+Math.imul(Te,ze)|0,P=P+Math.imul(Ne,qe)|0,h=h+Math.imul(Ne,je)|0,h=h+Math.imul(ke,qe)|0,S=S+Math.imul(ke,je)|0,P=P+Math.imul(_e,Ge)|0,h=h+Math.imul(_e,He)|0,h=h+Math.imul(Ie,Ge)|0,S=S+Math.imul(Ie,He)|0,P=P+Math.imul(Pe,Ve)|0,h=h+Math.imul(Pe,Ke)|0,h=h+Math.imul(Se,Ve)|0,S=S+Math.imul(Se,Ke)|0,P=P+Math.imul(ee,We)|0,h=h+Math.imul(ee,Qe)|0,h=h+Math.imul(ae,We)|0,S=S+Math.imul(ae,Qe)|0,P=P+Math.imul(X,Je)|0,h=h+Math.imul(X,Ye)|0,h=h+Math.imul(Y,Je)|0,S=S+Math.imul(Y,Ye)|0,P=P+Math.imul(H,Ze)|0,h=h+Math.imul(H,Xe)|0,h=h+Math.imul(V,Ze)|0,S=S+Math.imul(V,Xe)|0,P=P+Math.imul(y,et)|0,h=h+Math.imul(y,tt)|0,h=h+Math.imul(U,et)|0,S=S+Math.imul(U,tt)|0;var lu=(R+P|0)+((h&8191)<<13)|0;R=(S+(h>>>13)|0)+(lu>>>26)|0,lu&=67108863,P=Math.imul(Be,Le),h=Math.imul(Be,Ue),h=h+Math.imul(Oe,Le)|0,S=Math.imul(Oe,Ue),P=P+Math.imul(Re,De)|0,h=h+Math.imul(Re,ze)|0,h=h+Math.imul(Ce,De)|0,S=S+Math.imul(Ce,ze)|0,P=P+Math.imul(Me,qe)|0,h=h+Math.imul(Me,je)|0,h=h+Math.imul(Te,qe)|0,S=S+Math.imul(Te,je)|0,P=P+Math.imul(Ne,Ge)|0,h=h+Math.imul(Ne,He)|0,h=h+Math.imul(ke,Ge)|0,S=S+Math.imul(ke,He)|0,P=P+Math.imul(_e,Ve)|0,h=h+Math.imul(_e,Ke)|0,h=h+Math.imul(Ie,Ve)|0,S=S+Math.imul(Ie,Ke)|0,P=P+Math.imul(Pe,We)|0,h=h+Math.imul(Pe,Qe)|0,h=h+Math.imul(Se,We)|0,S=S+Math.imul(Se,Qe)|0,P=P+Math.imul(ee,Je)|0,h=h+Math.imul(ee,Ye)|0,h=h+Math.imul(ae,Je)|0,S=S+Math.imul(ae,Ye)|0,P=P+Math.imul(X,Ze)|0,h=h+Math.imul(X,Xe)|0,h=h+Math.imul(Y,Ze)|0,S=S+Math.imul(Y,Xe)|0,P=P+Math.imul(H,et)|0,h=h+Math.imul(H,tt)|0,h=h+Math.imul(V,et)|0,S=S+Math.imul(V,tt)|0;var du=(R+P|0)+((h&8191)<<13)|0;R=(S+(h>>>13)|0)+(du>>>26)|0,du&=67108863,P=Math.imul(Be,De),h=Math.imul(Be,ze),h=h+Math.imul(Oe,De)|0,S=Math.imul(Oe,ze),P=P+Math.imul(Re,qe)|0,h=h+Math.imul(Re,je)|0,h=h+Math.imul(Ce,qe)|0,S=S+Math.imul(Ce,je)|0,P=P+Math.imul(Me,Ge)|0,h=h+Math.imul(Me,He)|0,h=h+Math.imul(Te,Ge)|0,S=S+Math.imul(Te,He)|0,P=P+Math.imul(Ne,Ve)|0,h=h+Math.imul(Ne,Ke)|0,h=h+Math.imul(ke,Ve)|0,S=S+Math.imul(ke,Ke)|0,P=P+Math.imul(_e,We)|0,h=h+Math.imul(_e,Qe)|0,h=h+Math.imul(Ie,We)|0,S=S+Math.imul(Ie,Qe)|0,P=P+Math.imul(Pe,Je)|0,h=h+Math.imul(Pe,Ye)|0,h=h+Math.imul(Se,Je)|0,S=S+Math.imul(Se,Ye)|0,P=P+Math.imul(ee,Ze)|0,h=h+Math.imul(ee,Xe)|0,h=h+Math.imul(ae,Ze)|0,S=S+Math.imul(ae,Xe)|0,P=P+Math.imul(X,et)|0,h=h+Math.imul(X,tt)|0,h=h+Math.imul(Y,et)|0,S=S+Math.imul(Y,tt)|0;var hu=(R+P|0)+((h&8191)<<13)|0;R=(S+(h>>>13)|0)+(hu>>>26)|0,hu&=67108863,P=Math.imul(Be,qe),h=Math.imul(Be,je),h=h+Math.imul(Oe,qe)|0,S=Math.imul(Oe,je),P=P+Math.imul(Re,Ge)|0,h=h+Math.imul(Re,He)|0,h=h+Math.imul(Ce,Ge)|0,S=S+Math.imul(Ce,He)|0,P=P+Math.imul(Me,Ve)|0,h=h+Math.imul(Me,Ke)|0,h=h+Math.imul(Te,Ve)|0,S=S+Math.imul(Te,Ke)|0,P=P+Math.imul(Ne,We)|0,h=h+Math.imul(Ne,Qe)|0,h=h+Math.imul(ke,We)|0,S=S+Math.imul(ke,Qe)|0,P=P+Math.imul(_e,Je)|0,h=h+Math.imul(_e,Ye)|0,h=h+Math.imul(Ie,Je)|0,S=S+Math.imul(Ie,Ye)|0,P=P+Math.imul(Pe,Ze)|0,h=h+Math.imul(Pe,Xe)|0,h=h+Math.imul(Se,Ze)|0,S=S+Math.imul(Se,Xe)|0,P=P+Math.imul(ee,et)|0,h=h+Math.imul(ee,tt)|0,h=h+Math.imul(ae,et)|0,S=S+Math.imul(ae,tt)|0;var pu=(R+P|0)+((h&8191)<<13)|0;R=(S+(h>>>13)|0)+(pu>>>26)|0,pu&=67108863,P=Math.imul(Be,Ge),h=Math.imul(Be,He),h=h+Math.imul(Oe,Ge)|0,S=Math.imul(Oe,He),P=P+Math.imul(Re,Ve)|0,h=h+Math.imul(Re,Ke)|0,h=h+Math.imul(Ce,Ve)|0,S=S+Math.imul(Ce,Ke)|0,P=P+Math.imul(Me,We)|0,h=h+Math.imul(Me,Qe)|0,h=h+Math.imul(Te,We)|0,S=S+Math.imul(Te,Qe)|0,P=P+Math.imul(Ne,Je)|0,h=h+Math.imul(Ne,Ye)|0,h=h+Math.imul(ke,Je)|0,S=S+Math.imul(ke,Ye)|0,P=P+Math.imul(_e,Ze)|0,h=h+Math.imul(_e,Xe)|0,h=h+Math.imul(Ie,Ze)|0,S=S+Math.imul(Ie,Xe)|0,P=P+Math.imul(Pe,et)|0,h=h+Math.imul(Pe,tt)|0,h=h+Math.imul(Se,et)|0,S=S+Math.imul(Se,tt)|0;var mu=(R+P|0)+((h&8191)<<13)|0;R=(S+(h>>>13)|0)+(mu>>>26)|0,mu&=67108863,P=Math.imul(Be,Ve),h=Math.imul(Be,Ke),h=h+Math.imul(Oe,Ve)|0,S=Math.imul(Oe,Ke),P=P+Math.imul(Re,We)|0,h=h+Math.imul(Re,Qe)|0,h=h+Math.imul(Ce,We)|0,S=S+Math.imul(Ce,Qe)|0,P=P+Math.imul(Me,Je)|0,h=h+Math.imul(Me,Ye)|0,h=h+Math.imul(Te,Je)|0,S=S+Math.imul(Te,Ye)|0,P=P+Math.imul(Ne,Ze)|0,h=h+Math.imul(Ne,Xe)|0,h=h+Math.imul(ke,Ze)|0,S=S+Math.imul(ke,Xe)|0,P=P+Math.imul(_e,et)|0,h=h+Math.imul(_e,tt)|0,h=h+Math.imul(Ie,et)|0,S=S+Math.imul(Ie,tt)|0;var gu=(R+P|0)+((h&8191)<<13)|0;R=(S+(h>>>13)|0)+(gu>>>26)|0,gu&=67108863,P=Math.imul(Be,We),h=Math.imul(Be,Qe),h=h+Math.imul(Oe,We)|0,S=Math.imul(Oe,Qe),P=P+Math.imul(Re,Je)|0,h=h+Math.imul(Re,Ye)|0,h=h+Math.imul(Ce,Je)|0,S=S+Math.imul(Ce,Ye)|0,P=P+Math.imul(Me,Ze)|0,h=h+Math.imul(Me,Xe)|0,h=h+Math.imul(Te,Ze)|0,S=S+Math.imul(Te,Xe)|0,P=P+Math.imul(Ne,et)|0,h=h+Math.imul(Ne,tt)|0,h=h+Math.imul(ke,et)|0,S=S+Math.imul(ke,tt)|0;var yu=(R+P|0)+((h&8191)<<13)|0;R=(S+(h>>>13)|0)+(yu>>>26)|0,yu&=67108863,P=Math.imul(Be,Je),h=Math.imul(Be,Ye),h=h+Math.imul(Oe,Je)|0,S=Math.imul(Oe,Ye),P=P+Math.imul(Re,Ze)|0,h=h+Math.imul(Re,Xe)|0,h=h+Math.imul(Ce,Ze)|0,S=S+Math.imul(Ce,Xe)|0,P=P+Math.imul(Me,et)|0,h=h+Math.imul(Me,tt)|0,h=h+Math.imul(Te,et)|0,S=S+Math.imul(Te,tt)|0;var bu=(R+P|0)+((h&8191)<<13)|0;R=(S+(h>>>13)|0)+(bu>>>26)|0,bu&=67108863,P=Math.imul(Be,Ze),h=Math.imul(Be,Xe),h=h+Math.imul(Oe,Ze)|0,S=Math.imul(Oe,Xe),P=P+Math.imul(Re,et)|0,h=h+Math.imul(Re,tt)|0,h=h+Math.imul(Ce,et)|0,S=S+Math.imul(Ce,tt)|0;var wu=(R+P|0)+((h&8191)<<13)|0;R=(S+(h>>>13)|0)+(wu>>>26)|0,wu&=67108863,P=Math.imul(Be,et),h=Math.imul(Be,tt),h=h+Math.imul(Oe,et)|0,S=Math.imul(Oe,tt);var vu=(R+P|0)+((h&8191)<<13)|0;return R=(S+(h>>>13)|0)+(vu>>>26)|0,vu&=67108863,I[0]=Mn,I[1]=Tn,I[2]=Rn,I[3]=Cn,I[4]=Bn,I[5]=au,I[6]=cu,I[7]=uu,I[8]=fu,I[9]=lu,I[10]=du,I[11]=hu,I[12]=pu,I[13]=mu,I[14]=gu,I[15]=yu,I[16]=bu,I[17]=wu,I[18]=vu,R!==0&&(I[19]=R,b.length++),b};Math.imul||(B=_);function T(E,l,p){p.negative=l.negative^E.negative,p.length=E.length+l.length;for(var b=0,x=0,v=0;v<p.length-1;v++){var I=x;x=0;for(var R=b&67108863,P=Math.min(v,l.length-1),h=Math.max(0,v-E.length+1);h<=P;h++){var S=v-h,Z=E.words[S]|0,y=l.words[h]|0,U=Z*y,G=U&67108863;I=I+(U/67108864|0)|0,G=G+R|0,R=G&67108863,I=I+(G>>>26)|0,x+=I>>>26,I&=67108863}p.words[v]=R,b=I,I=x}return b!==0?p.words[v]=b:p.length--,p._strip()}function N(E,l,p){return T(E,l,p)}s.prototype.mulTo=function(l,p){var b,x=this.length+l.length;return this.length===10&&l.length===10?b=B(this,l,p):x<63?b=_(this,l,p):x<1024?b=T(this,l,p):b=N(this,l,p),b},s.prototype.mul=function(l){var p=new s(null);return p.words=new Array(this.length+l.length),this.mulTo(l,p)},s.prototype.mulf=function(l){var p=new s(null);return p.words=new Array(this.length+l.length),N(this,l,p)},s.prototype.imul=function(l){return this.clone().mulTo(l,this)},s.prototype.imuln=function(l){var p=l<0;p&&(l=-l),n(typeof l=="number"),n(l<67108864);for(var b=0,x=0;x<this.length;x++){var v=(this.words[x]|0)*l,I=(v&67108863)+(b&67108863);b>>=26,b+=v/67108864|0,b+=I>>>26,this.words[x]=I&67108863}return b!==0&&(this.words[x]=b,this.length++),this.length=l===0?1:this.length,p?this.ineg():this},s.prototype.muln=function(l){return this.clone().imuln(l)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(l){var p=k(l);if(p.length===0)return new s(1);for(var b=this,x=0;x<p.length&&p[x]===0;x++,b=b.sqr());if(++x<p.length)for(var v=b.sqr();x<p.length;x++,v=v.sqr())p[x]!==0&&(b=b.mul(v));return b},s.prototype.iushln=function(l){n(typeof l=="number"&&l>=0);var p=l%26,b=(l-p)/26,x=67108863>>>26-p<<26-p,v;if(p!==0){var I=0;for(v=0;v<this.length;v++){var R=this.words[v]&x,P=(this.words[v]|0)-R<<p;this.words[v]=P|I,I=R>>>26-p}I&&(this.words[v]=I,this.length++)}if(b!==0){for(v=this.length-1;v>=0;v--)this.words[v+b]=this.words[v];for(v=0;v<b;v++)this.words[v]=0;this.length+=b}return this._strip()},s.prototype.ishln=function(l){return n(this.negative===0),this.iushln(l)},s.prototype.iushrn=function(l,p,b){n(typeof l=="number"&&l>=0);var x;p?x=(p-p%26)/26:x=0;var v=l%26,I=Math.min((l-v)/26,this.length),R=67108863^67108863>>>v<<v,P=b;if(x-=I,x=Math.max(0,x),P){for(var h=0;h<I;h++)P.words[h]=this.words[h];P.length=I}if(I!==0)if(this.length>I)for(this.length-=I,h=0;h<this.length;h++)this.words[h]=this.words[h+I];else this.words[0]=0,this.length=1;var S=0;for(h=this.length-1;h>=0&&(S!==0||h>=x);h--){var Z=this.words[h]|0;this.words[h]=S<<26-v|Z>>>v,S=Z&R}return P&&S!==0&&(P.words[P.length++]=S),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(l,p,b){return n(this.negative===0),this.iushrn(l,p,b)},s.prototype.shln=function(l){return this.clone().ishln(l)},s.prototype.ushln=function(l){return this.clone().iushln(l)},s.prototype.shrn=function(l){return this.clone().ishrn(l)},s.prototype.ushrn=function(l){return this.clone().iushrn(l)},s.prototype.testn=function(l){n(typeof l=="number"&&l>=0);var p=l%26,b=(l-p)/26,x=1<<p;if(this.length<=b)return!1;var v=this.words[b];return!!(v&x)},s.prototype.imaskn=function(l){n(typeof l=="number"&&l>=0);var p=l%26,b=(l-p)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(p!==0&&b++,this.length=Math.min(b,this.length),p!==0){var x=67108863^67108863>>>p<<p;this.words[this.length-1]&=x}return this._strip()},s.prototype.maskn=function(l){return this.clone().imaskn(l)},s.prototype.iaddn=function(l){return n(typeof l=="number"),n(l<67108864),l<0?this.isubn(-l):this.negative!==0?this.length===1&&(this.words[0]|0)<=l?(this.words[0]=l-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(l),this.negative=1,this):this._iaddn(l)},s.prototype._iaddn=function(l){this.words[0]+=l;for(var p=0;p<this.length&&this.words[p]>=67108864;p++)this.words[p]-=67108864,p===this.length-1?this.words[p+1]=1:this.words[p+1]++;return this.length=Math.max(this.length,p+1),this},s.prototype.isubn=function(l){if(n(typeof l=="number"),n(l<67108864),l<0)return this.iaddn(-l);if(this.negative!==0)return this.negative=0,this.iaddn(l),this.negative=1,this;if(this.words[0]-=l,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var p=0;p<this.length&&this.words[p]<0;p++)this.words[p]+=67108864,this.words[p+1]-=1;return this._strip()},s.prototype.addn=function(l){return this.clone().iaddn(l)},s.prototype.subn=function(l){return this.clone().isubn(l)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(l,p,b){var x=l.length+b,v;this._expand(x);var I,R=0;for(v=0;v<l.length;v++){I=(this.words[v+b]|0)+R;var P=(l.words[v]|0)*p;I-=P&67108863,R=(I>>26)-(P/67108864|0),this.words[v+b]=I&67108863}for(;v<this.length-b;v++)I=(this.words[v+b]|0)+R,R=I>>26,this.words[v+b]=I&67108863;if(R===0)return this._strip();for(n(R===-1),R=0,v=0;v<this.length;v++)I=-(this.words[v]|0)+R,R=I>>26,this.words[v]=I&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(l,p){var b=this.length-l.length,x=this.clone(),v=l,I=v.words[v.length-1]|0,R=this._countBits(I);b=26-R,b!==0&&(v=v.ushln(b),x.iushln(b),I=v.words[v.length-1]|0);var P=x.length-v.length,h;if(p!=="mod"){h=new s(null),h.length=P+1,h.words=new Array(h.length);for(var S=0;S<h.length;S++)h.words[S]=0}var Z=x.clone()._ishlnsubmul(v,1,P);Z.negative===0&&(x=Z,h&&(h.words[P]=1));for(var y=P-1;y>=0;y--){var U=(x.words[v.length+y]|0)*67108864+(x.words[v.length+y-1]|0);for(U=Math.min(U/I|0,67108863),x._ishlnsubmul(v,U,y);x.negative!==0;)U--,x.negative=0,x._ishlnsubmul(v,1,y),x.isZero()||(x.negative^=1);h&&(h.words[y]=U)}return h&&h._strip(),x._strip(),p!=="div"&&b!==0&&x.iushrn(b),{div:h||null,mod:x}},s.prototype.divmod=function(l,p,b){if(n(!l.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var x,v,I;return this.negative!==0&&l.negative===0?(I=this.neg().divmod(l,p),p!=="mod"&&(x=I.div.neg()),p!=="div"&&(v=I.mod.neg(),b&&v.negative!==0&&v.iadd(l)),{div:x,mod:v}):this.negative===0&&l.negative!==0?(I=this.divmod(l.neg(),p),p!=="mod"&&(x=I.div.neg()),{div:x,mod:I.mod}):this.negative&l.negative?(I=this.neg().divmod(l.neg(),p),p!=="div"&&(v=I.mod.neg(),b&&v.negative!==0&&v.isub(l)),{div:I.div,mod:v}):l.length>this.length||this.cmp(l)<0?{div:new s(0),mod:this}:l.length===1?p==="div"?{div:this.divn(l.words[0]),mod:null}:p==="mod"?{div:null,mod:new s(this.modrn(l.words[0]))}:{div:this.divn(l.words[0]),mod:new s(this.modrn(l.words[0]))}:this._wordDiv(l,p)},s.prototype.div=function(l){return this.divmod(l,"div",!1).div},s.prototype.mod=function(l){return this.divmod(l,"mod",!1).mod},s.prototype.umod=function(l){return this.divmod(l,"mod",!0).mod},s.prototype.divRound=function(l){var p=this.divmod(l);if(p.mod.isZero())return p.div;var b=p.div.negative!==0?p.mod.isub(l):p.mod,x=l.ushrn(1),v=l.andln(1),I=b.cmp(x);return I<0||v===1&&I===0?p.div:p.div.negative!==0?p.div.isubn(1):p.div.iaddn(1)},s.prototype.modrn=function(l){var p=l<0;p&&(l=-l),n(l<=67108863);for(var b=(1<<26)%l,x=0,v=this.length-1;v>=0;v--)x=(b*x+(this.words[v]|0))%l;return p?-x:x},s.prototype.modn=function(l){return this.modrn(l)},s.prototype.idivn=function(l){var p=l<0;p&&(l=-l),n(l<=67108863);for(var b=0,x=this.length-1;x>=0;x--){var v=(this.words[x]|0)+b*67108864;this.words[x]=v/l|0,b=v%l}return this._strip(),p?this.ineg():this},s.prototype.divn=function(l){return this.clone().idivn(l)},s.prototype.egcd=function(l){n(l.negative===0),n(!l.isZero());var p=this,b=l.clone();p.negative!==0?p=p.umod(l):p=p.clone();for(var x=new s(1),v=new s(0),I=new s(0),R=new s(1),P=0;p.isEven()&&b.isEven();)p.iushrn(1),b.iushrn(1),++P;for(var h=b.clone(),S=p.clone();!p.isZero();){for(var Z=0,y=1;!(p.words[0]&y)&&Z<26;++Z,y<<=1);if(Z>0)for(p.iushrn(Z);Z-- >0;)(x.isOdd()||v.isOdd())&&(x.iadd(h),v.isub(S)),x.iushrn(1),v.iushrn(1);for(var U=0,G=1;!(b.words[0]&G)&&U<26;++U,G<<=1);if(U>0)for(b.iushrn(U);U-- >0;)(I.isOdd()||R.isOdd())&&(I.iadd(h),R.isub(S)),I.iushrn(1),R.iushrn(1);p.cmp(b)>=0?(p.isub(b),x.isub(I),v.isub(R)):(b.isub(p),I.isub(x),R.isub(v))}return{a:I,b:R,gcd:b.iushln(P)}},s.prototype._invmp=function(l){n(l.negative===0),n(!l.isZero());var p=this,b=l.clone();p.negative!==0?p=p.umod(l):p=p.clone();for(var x=new s(1),v=new s(0),I=b.clone();p.cmpn(1)>0&&b.cmpn(1)>0;){for(var R=0,P=1;!(p.words[0]&P)&&R<26;++R,P<<=1);if(R>0)for(p.iushrn(R);R-- >0;)x.isOdd()&&x.iadd(I),x.iushrn(1);for(var h=0,S=1;!(b.words[0]&S)&&h<26;++h,S<<=1);if(h>0)for(b.iushrn(h);h-- >0;)v.isOdd()&&v.iadd(I),v.iushrn(1);p.cmp(b)>=0?(p.isub(b),x.isub(v)):(b.isub(p),v.isub(x))}var Z;return p.cmpn(1)===0?Z=x:Z=v,Z.cmpn(0)<0&&Z.iadd(l),Z},s.prototype.gcd=function(l){if(this.isZero())return l.abs();if(l.isZero())return this.abs();var p=this.clone(),b=l.clone();p.negative=0,b.negative=0;for(var x=0;p.isEven()&&b.isEven();x++)p.iushrn(1),b.iushrn(1);do{for(;p.isEven();)p.iushrn(1);for(;b.isEven();)b.iushrn(1);var v=p.cmp(b);if(v<0){var I=p;p=b,b=I}else if(v===0||b.cmpn(1)===0)break;p.isub(b)}while(!0);return b.iushln(x)},s.prototype.invm=function(l){return this.egcd(l).a.umod(l)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(l){return this.words[0]&l},s.prototype.bincn=function(l){n(typeof l=="number");var p=l%26,b=(l-p)/26,x=1<<p;if(this.length<=b)return this._expand(b+1),this.words[b]|=x,this;for(var v=x,I=b;v!==0&&I<this.length;I++){var R=this.words[I]|0;R+=v,v=R>>>26,R&=67108863,this.words[I]=R}return v!==0&&(this.words[I]=v,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(l){var p=l<0;if(this.negative!==0&&!p)return-1;if(this.negative===0&&p)return 1;this._strip();var b;if(this.length>1)b=1;else{p&&(l=-l),n(l<=67108863,"Number is too big");var x=this.words[0]|0;b=x===l?0:x<l?-1:1}return this.negative!==0?-b|0:b},s.prototype.cmp=function(l){if(this.negative!==0&&l.negative===0)return-1;if(this.negative===0&&l.negative!==0)return 1;var p=this.ucmp(l);return this.negative!==0?-p|0:p},s.prototype.ucmp=function(l){if(this.length>l.length)return 1;if(this.length<l.length)return-1;for(var p=0,b=this.length-1;b>=0;b--){var x=this.words[b]|0,v=l.words[b]|0;if(x!==v){x<v?p=-1:x>v&&(p=1);break}}return p},s.prototype.gtn=function(l){return this.cmpn(l)===1},s.prototype.gt=function(l){return this.cmp(l)===1},s.prototype.gten=function(l){return this.cmpn(l)>=0},s.prototype.gte=function(l){return this.cmp(l)>=0},s.prototype.ltn=function(l){return this.cmpn(l)===-1},s.prototype.lt=function(l){return this.cmp(l)===-1},s.prototype.lten=function(l){return this.cmpn(l)<=0},s.prototype.lte=function(l){return this.cmp(l)<=0},s.prototype.eqn=function(l){return this.cmpn(l)===0},s.prototype.eq=function(l){return this.cmp(l)===0},s.red=function(l){return new j(l)},s.prototype.toRed=function(l){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),l.convertTo(this)._forceRed(l)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(l){return this.red=l,this},s.prototype.forceRed=function(l){return n(!this.red,"Already a number in reduction context"),this._forceRed(l)},s.prototype.redAdd=function(l){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,l)},s.prototype.redIAdd=function(l){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,l)},s.prototype.redSub=function(l){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,l)},s.prototype.redISub=function(l){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,l)},s.prototype.redShl=function(l){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,l)},s.prototype.redMul=function(l){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.mul(this,l)},s.prototype.redIMul=function(l){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.imul(this,l)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(l){return n(this.red&&!l.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,l)};var M={k256:null,p224:null,p192:null,p25519:null};function O(E,l){this.name=E,this.p=new s(l,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}O.prototype._tmp=function(){var l=new s(null);return l.words=new Array(Math.ceil(this.n/13)),l},O.prototype.ireduce=function(l){var p=l,b;do this.split(p,this.tmp),p=this.imulK(p),p=p.iadd(this.tmp),b=p.bitLength();while(b>this.n);var x=b<this.n?-1:p.ucmp(this.p);return x===0?(p.words[0]=0,p.length=1):x>0?p.isub(this.p):p.strip!==void 0?p.strip():p._strip(),p},O.prototype.split=function(l,p){l.iushrn(this.n,0,p)},O.prototype.imulK=function(l){return l.imul(this.k)};function F(){O.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(F,O),F.prototype.split=function(l,p){for(var b=4194303,x=Math.min(l.length,9),v=0;v<x;v++)p.words[v]=l.words[v];if(p.length=x,l.length<=9){l.words[0]=0,l.length=1;return}var I=l.words[9];for(p.words[p.length++]=I&b,v=10;v<l.length;v++){var R=l.words[v]|0;l.words[v-10]=(R&b)<<4|I>>>22,I=R}I>>>=22,l.words[v-10]=I,I===0&&l.length>10?l.length-=10:l.length-=9},F.prototype.imulK=function(l){l.words[l.length]=0,l.words[l.length+1]=0,l.length+=2;for(var p=0,b=0;b<l.length;b++){var x=l.words[b]|0;p+=x*977,l.words[b]=p&67108863,p=x*64+(p/67108864|0)}return l.words[l.length-1]===0&&(l.length--,l.words[l.length-1]===0&&l.length--),l};function L(){O.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(L,O);function z(){O.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(z,O);function D(){O.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(D,O),D.prototype.imulK=function(l){for(var p=0,b=0;b<l.length;b++){var x=(l.words[b]|0)*19+p,v=x&67108863;x>>>=26,l.words[b]=v,p=x}return p!==0&&(l.words[l.length++]=p),l},s._prime=function(l){if(M[l])return M[l];var p;if(l==="k256")p=new F;else if(l==="p224")p=new L;else if(l==="p192")p=new z;else if(l==="p25519")p=new D;else throw new Error("Unknown prime "+l);return M[l]=p,p};function j(E){if(typeof E=="string"){var l=s._prime(E);this.m=l.p,this.prime=l}else n(E.gtn(1),"modulus must be greater than 1"),this.m=E,this.prime=null}j.prototype._verify1=function(l){n(l.negative===0,"red works only with positives"),n(l.red,"red works only with red numbers")},j.prototype._verify2=function(l,p){n((l.negative|p.negative)===0,"red works only with positives"),n(l.red&&l.red===p.red,"red works only with red numbers")},j.prototype.imod=function(l){return this.prime?this.prime.ireduce(l)._forceRed(this):(f(l,l.umod(this.m)._forceRed(this)),l)},j.prototype.neg=function(l){return l.isZero()?l.clone():this.m.sub(l)._forceRed(this)},j.prototype.add=function(l,p){this._verify2(l,p);var b=l.add(p);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},j.prototype.iadd=function(l,p){this._verify2(l,p);var b=l.iadd(p);return b.cmp(this.m)>=0&&b.isub(this.m),b},j.prototype.sub=function(l,p){this._verify2(l,p);var b=l.sub(p);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},j.prototype.isub=function(l,p){this._verify2(l,p);var b=l.isub(p);return b.cmpn(0)<0&&b.iadd(this.m),b},j.prototype.shl=function(l,p){return this._verify1(l),this.imod(l.ushln(p))},j.prototype.imul=function(l,p){return this._verify2(l,p),this.imod(l.imul(p))},j.prototype.mul=function(l,p){return this._verify2(l,p),this.imod(l.mul(p))},j.prototype.isqr=function(l){return this.imul(l,l.clone())},j.prototype.sqr=function(l){return this.mul(l,l)},j.prototype.sqrt=function(l){if(l.isZero())return l.clone();var p=this.m.andln(3);if(n(p%2===1),p===3){var b=this.m.add(new s(1)).iushrn(2);return this.pow(l,b)}for(var x=this.m.subn(1),v=0;!x.isZero()&&x.andln(1)===0;)v++,x.iushrn(1);n(!x.isZero());var I=new s(1).toRed(this),R=I.redNeg(),P=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new s(2*h*h).toRed(this);this.pow(h,P).cmp(R)!==0;)h.redIAdd(R);for(var S=this.pow(h,x),Z=this.pow(l,x.addn(1).iushrn(1)),y=this.pow(l,x),U=v;y.cmp(I)!==0;){for(var G=y,H=0;G.cmp(I)!==0;H++)G=G.redSqr();n(H<U);var V=this.pow(S,new s(1).iushln(U-H-1));Z=Z.redMul(V),S=V.redSqr(),y=y.redMul(S),U=H}return Z},j.prototype.invm=function(l){var p=l._invmp(this.m);return p.negative!==0?(p.negative=0,this.imod(p).redNeg()):this.imod(p)},j.prototype.pow=function(l,p){if(p.isZero())return new s(1).toRed(this);if(p.cmpn(1)===0)return l.clone();var b=4,x=new Array(1<<b);x[0]=new s(1).toRed(this),x[1]=l;for(var v=2;v<x.length;v++)x[v]=this.mul(x[v-1],l);var I=x[0],R=0,P=0,h=p.bitLength()%26;for(h===0&&(h=26),v=p.length-1;v>=0;v--){for(var S=p.words[v],Z=h-1;Z>=0;Z--){var y=S>
17>Z&1;if(I!==x[0]&&(I=this.sqr(I)),y===0&&R===0){P=0;continue}R<<=1,R|=y,P++,!(P!==b&&(v!==0||Z!==0))&&(I=this.mul(I,x[R]),P=0,R=0)}h=26}return I},j.prototype.convertTo=function(l){var p=l.umod(this.m);return p===l?p.clone():p},j.prototype.convertFrom=function(l){var p=l.clone();return p.red=null,p},s.mont=function(l){return new Q(l)};function Q(E){j.call(this,E),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(Q,j),Q.prototype.convertTo=function(l){return this.imod(l.ushln(this.shift))},Q.prototype.convertFrom=function(l){var p=this.imod(l.mul(this.rinv));return p.red=null,p},Q.prototype.imul=function(l,p){if(l.isZero()||p.isZero())return l.words[0]=0,l.length=1,l;var b=l.imul(p),x=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=b.isub(x).iushrn(this.shift),I=v;return v.cmp(this.m)>=0?I=v.isub(this.m):v.cmpn(0)<0&&(I=v.iadd(this.m)),I._forceRed(this)},Q.prototype.mul=function(l,p){if(l.isZero()||p.isZero())return new s(0)._forceRed(this);var b=l.mul(p),x=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=b.isub(x).iushrn(this.shift),I=v;return v.cmp(this.m)>=0?I=v.isub(this.m):v.cmpn(0)<0&&(I=v.iadd(this.m)),I._forceRed(this)},Q.prototype.invm=function(l){var p=this.imod(l._invmp(this.m).mul(this.r2));return p._forceRed(this)}})(t,ip)})(Nl);var ub=Nl.exports;const fe=ia(ub),fb="logger/5.8.0";let X0=!1,ed=!1;const Wa={debug:1,default:2,info:2,warning:3,error:4,off:5};let td=Wa.default,Pu=null;function lb(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(t){return t.message}return null}const rd=lb();var Pf;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(Pf||(Pf={}));var vr;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(vr||(vr={}));const nd="0123456789abcdef";class ${constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();Wa[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(td>Wa[n])&&console.log.apply(console,r)}debug(...e){this._log($.levels.DEBUG,e)}info(...e){this._log($.levels.INFO,e)}warn(...e){this._log($.levels.WARNING,e)}makeError(e,r,n){if(ed)return this.makeError("censored error",r,{});r||(r=$.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(c=>{const u=n[c];try{if(u instanceof Uint8Array){let f="";for(let d=0;d<u.length;d++)f+=nd[u[d]>>4],f+=nd[u[d]&15];i.push(c+"=Uint8Array(0x"+f+")")}else i.push(c+"="+JSON.stringify(u))}catch{i.push(c+"="+JSON.stringify(n[c].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);const s=e;let o="";switch(r){case vr.NUMERIC_FAULT:{o="NUMERIC_FAULT";const c=e;switch(c){case"overflow":case"underflow":case"division-by-zero":o+="-"+c;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result";break}break}case vr.CALL_EXCEPTION:case vr.INSUFFICIENT_FUNDS:case vr.MISSING_NEW:case vr.NONCE_EXPIRED:case vr.REPLACEMENT_UNDERPRICED:case vr.TRANSACTION_REPLACED:case vr.UNPREDICTABLE_GAS_LIMIT:o=r;break}
17o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const a=new Error(e);return a.reason=s,a.code=r,Object.keys(n).forEach(function(c){a[c]=n[c]}),a}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,$.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,r,n,i){e||this.throwError(r,n,i)}assertArgument(e,r,n,i){e||this.throwArgumentError(r,n,i)}checkNormalize(e){rd&&this.throwError("platform missing String.prototype.normalize",$.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:rd})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,$.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,$.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,n){n?n=": "+n:n="",e<r&&this.throwError("missing argument"+n,$.errors.MISSING_ARGUMENT,{count:e,expectedCount:r}),e>r&&this.throwError("too many arguments"+n,$.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",$.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",$.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",$.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return Pu||(Pu=new $(fb)),Pu}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",$.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),X0){if(!e)return;this.globalLogger().throwError("error censorship permanent",$.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}ed=!!e,X0=!!r}static setLogLevel(e){const r=Wa[e.toLowerCase()];if(r==null){$.globalLogger().warn("invalid log level - "+e);return}td=r}static from(e){return new $(e)}}$.errors=vr;$.levels=Pf;const db="bytes/5.8.0",at=new $(db);function Sp(t){return!!t.toHexString}function us(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return us(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function kl(t){return ve(t)&&!(t.length%2)||Hs(t)}function id(t){return typeof t=="number"&&t==t&&t%1===0}function Hs(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!id(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){const r=t[e];if(!id(r)||r<0||r>=256)return!1}return!0}function oe(t,e){if(e||(e={}),typeof t=="number"){at.checkSafeUint53(t,"invalid arrayify value");const r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),us(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),Sp(t)&&(t=t.toHexString()),ve(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":at.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;i<r.length;i+=2)n.push(parseInt(r.substring(i,i+2),16));return us(new Uint8Array(n))}return Hs(t)?us(new Uint8Array(t)):at.throwArgumentError("invalid arrayify value","value",t)}function jt(t){const e=t.map(i=>oe(i)),r=e.reduce((i,s)=>i+s.length,0),n=new Uint8Array(r);return e.reduce((i,s)=>(n.set(s,i),i+s.length),0),us(n)}function Ms(t){let e=oe(t);if(e.length===0)return e;let r=0;for(;r<e.length&&e[r]===0;)r++;return r&&(e=e.slice(r)),e}function hb(t,e){t=oe(t),t.length>e&&at.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),us(r)}function ve(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const Su="0123456789abcdef";function se(t,e){if(e||(e={}),typeof t=="number"){at.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=Su[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),Sp(t))return t.toHexString();if(ve(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":at.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(Hs(t)){let r="0x";for(let n=0;n<t.length;n++){let i=t[n];r+=Su[(i&240)>>4]+Su[i&15]}return r}return at.throwArgumentError("invalid hexlify value","value",t)}function Fi(t){if(typeof t!="string")t=se(t);
17else if(!ve(t)||t.length%2)return null;return(t.length-2)/2}function It(t,e,r){return typeof t!="string"?t=se(t):(!ve(t)||t.length%2)&&at.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function qt(t){let e="0x";return t.forEach(r=>{e+=se(r).substring(2)}),e}function Ml(t){const e=pb(se(t,{hexPad:"left"}));return e==="0x"?"0x0":e}function pb(t){typeof t!="string"&&(t=se(t)),ve(t)||at.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let e=0;for(;e<t.length&&t[e]==="0";)e++;return"0x"+t.substring(e)}function nt(t,e){for(typeof t!="string"?t=se(t):ve(t)||at.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&at.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function Ic(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(kl(t)){let r=oe(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=se(r.slice(0,32)),e.s=se(r.slice(32,64))):r.length===65?(e.r=se(r.slice(0,32)),e.s=se(r.slice(32,64)),e.v=r[64]):at.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:at.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=se(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){const i=hb(oe(e._vs),32);e._vs=se(i);const s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&at.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const o=se(i);e.s==null?e.s=o:e.s!==o&&at.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?at.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&at.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!ve(e.r)?at.throwArgumentError("signature missing or invalid r","signature",t):e.r=nt(e.r,32),e.s==null||!ve(e.s)?at.throwArgumentError("signature missing or invalid s","signature",t):e.s=nt(e.s,32);const r=oe(e.s);r[0]>=128&&at.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=se(r);e._vs&&(ve(e._vs)||at.throwArgumentError("signature invalid _vs","signature",t),e._vs=nt(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&at.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}const _p="bignumber/5.8.0";var sc=fe.BN;const ln=new $(_p),_u={},sd=9007199254740991;function mb(t){return t!=null&&(J.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||ve(t)||typeof t=="bigint"||Hs(t))}let od=!1;class J{constructor(e,r){e!==_u&&ln.throwError("cannot call constructor directly; use BigNumber.from",$.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Ut(pe(this).fromTwos(e))}toTwos(e){return Ut(pe(this).toTwos(e))}abs(){return this._hex[0]==="-"?J.from(this._hex.substring(1)):this}add(e){return Ut(pe(this).add(pe(e)))}sub(e){return Ut(pe(this).sub(pe(e)))}div(e){return J.from(e).isZero()&&sr("division-by-zero","div"),Ut(pe(this).div(pe(e)))}mul(e){return Ut(pe(this).mul(pe(e)))}mod(e){const r=pe(e);return r.isNeg()&&sr("division-by-zero","mod"),Ut(pe(this).umod(r))}pow(e){const r=pe(e);return r.isNeg()&&sr("negative-power","pow"),Ut(pe(this).pow(r))}and(e){const r=pe(e);return(this.isNegative()||r.isNeg())&&sr("unbound-bitwise-result","and"),Ut(pe(this).and(r))}or(e){const r=pe(e);return(this.isNegative()||r.isNeg())&&sr("unbound-bitwise-result","or"),Ut(pe(this).or(r))}xor(e){const r=pe(e);return(this.isNegative()||r.isNeg())&&sr("unbound-bitwise-result","xor"),Ut(pe(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&sr("negative-width","mask"),Ut(pe(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&sr("negative-width","shl"),Ut
17(pe(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&sr("negative-width","shr"),Ut(pe(this).shrn(e))}eq(e){return pe(this).eq(pe(e))}lt(e){return pe(this).lt(pe(e))}lte(e){return pe(this).lte(pe(e))}gt(e){return pe(this).gt(pe(e))}gte(e){return pe(this).gte(pe(e))}isNegative(){return this._hex[0]==="-"}isZero(){return pe(this).isZero()}toNumber(){try{return pe(this).toNumber()}catch{sr("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return ln.throwError("this platform does not support BigInt",$.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?od||(od=!0,ln.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?ln.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",$.errors.UNEXPECTED_ARGUMENT,{}):ln.throwError("BigNumber.toString does not accept parameters",$.errors.UNEXPECTED_ARGUMENT,{})),pe(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof J)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new J(_u,xo(e)):e.match(/^-?[0-9]+$/)?new J(_u,xo(new sc(e))):ln.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&sr("underflow","BigNumber.from",e),(e>=sd||e<=-sd)&&sr("overflow","BigNumber.from",e),J.from(String(e));const r=e;if(typeof r=="bigint")return J.from(r.toString());if(Hs(r))return J.from(se(r));if(r)if(r.toHexString){const n=r.toHexString();if(typeof n=="string")return J.from(n)}else{let n=r._hex;if(n==null&&r.type==="BigNumber"&&(n=r.hex),typeof n=="string"&&(ve(n)||n[0]==="-"&&ve(n.substring(1))))return J.from(n)}return ln.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function xo(t){if(typeof t!="string")return xo(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&ln.throwArgumentError("invalid hex","value",t),t=xo(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function Ut(t){return J.from(xo(t))}function pe(t){const e=J.from(t).toHexString();return e[0]==="-"?new sc("-"+e.substring(3),16):new sc(e.substring(2),16)}function sr(t,e,r){const n={fault:t,operation:e};return r!=null&&(n.value=r),ln.throwError(t,$.errors.NUMERIC_FAULT,n)}function gb(t){return new sc(t,36).toString(16)}const Bt=new $(_p),go={},Ip=J.from(0),Np=J.from(-1);function kp(t,e,r,n){const i={fault:e,operation:r};return n!==void 0&&(i.value=n),Bt.throwError(t,$.errors.NUMERIC_FAULT,i)}let yo="0";for(;yo.length<256;)yo+=yo;function Tl(t){if(typeof t!="number")try{t=J.from(t).toNumber()}catch{}return typeof t=="number"&&t>=0&&t<=256&&!(t%1)?"1"+yo.substring(0,t):Bt.throwArgumentError("invalid decimal size","decimals",t)}function Qa(t,e){e==null&&(e=0);const r=Tl(e);t=J.from(t);const n=t.lt(Ip);n&&(t=t.mul(Np));let i=t.mod(r).toString();for(;i.length<r.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const s=t.div(r).toString();return r.length===1?t=s:t=s+"."+i,n&&(t="-"+t),t}function on(t,e){e==null&&(e=0);const r=Tl(e);(typeof t!="string"||!t.match(/^-?[0-9.]+$/))&&Bt.throwArgumentError("invalid decimal value","value",t);const n=t.substring(0,1)==="-";n&&(t=t.substring(1)),t==="."&&Bt.throwArgumentError("missing value","value",t);const i=t.split(".");i.length>2&&Bt.throwArgumentError("too many decimal points","value",t);let s=i[0],o=i[1];for(s||(s="0"),o||(o="0");o[o.length-1]==="0";)o=o.substring(0,o.length-1);for(o.length>r.length-1&&kp("fractional component exceeds decimals","underflow","parseFixed"),o===""&&(o="0");o.length<r.length-1;)o+="0";const a=J.from(s),c=J.from(o);let u=a.mul(r).add(c);return n&&(u=u.mul(Np)),u}class fs{constructor(e,r,n,i){e!==go&&Bt.throwError("cannot use FixedFormat constructor; use FixedFormat.from",$.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=r,this.width=n,this.decimals=i,this.name=(r?"":"u")+"fixed"+String(n)+"x"+String(i),this._multiplier=Tl(i),Object.freeze(this)}static from(e){if(e instanceof fs)return e;typeof e=="number"&&(e=`fixed128x${e}`);let r=!0,n=128,i=18;if(typeof e=="string"){if(e!=="fixed")if(e==="ufixed")r=!1;else{const s=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);s||Bt.throwArgumentError("invalid fixed format","format",e),r=s[1]!=="u",n=parseInt(s[2]),i=parseInt(s[3])}}else if(e){const s=(o,a,c)=>e[o]==null?c:(typeof e[o]!==a&&Bt.throwArgumentError("invalid fixed format ("+o+" not "+a+")","format."+o,e[o]),e[o
vendor: 4,137 bytes, line 17
17]);r=s("signed","boolean",r),n=s("width","number",n),i=s("decimals","number",i)}return n%8&&Bt.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),i>80&&Bt.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new fs(go,r,n,i)}}class xt{constructor(e,r,n,i){e!==go&&Bt.throwError("cannot use FixedNumber constructor; use FixedNumber.from",$.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&Bt.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const r=on(this._value,this.format.decimals),n=on(e._value,e.format.decimals);return xt.fromValue(r.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const r=on(this._value,this.format.decimals),n=on(e._value,e.format.decimals);return xt.fromValue(r.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const r=on(this._value,this.format.decimals),n=on(e._value,e.format.decimals);return xt.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const r=on(this._value,this.format.decimals),n=on(e._value,e.format.decimals);return xt.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=xt.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(ad.toFormat(r.format))),r}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=xt.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(ad.toFormat(r.format))),r}round(e){e==null&&(e=0);const r=this.toString().split(".");if(r.length===1&&r.push("0"),(e<0||e>80||e%1)&&Bt.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;const n=xt.from("1"+yo.substring(0,e),this.format),i=yb.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(e){if(e==null)return this._hex;e%8&&Bt.throwArgumentError("invalid byte width","width",e);const r=J.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return nt(r,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return xt.fromString(this._value,e)}static fromValue(e,r,n){return n==null&&r!=null&&!mb(r)&&(n=r,r=null),r==null&&(r=0),n==null&&(n="fixed"),xt.fromString(Qa(e,r),fs.from(n))}static fromString(e,r){r==null&&(r="fixed");const n=fs.from(r),i=on(e,n.decimals);!n.signed&&i.lt(Ip)&&kp("unsigned value cannot be negative","overflow","value",e);let s=null;n.signed?s=i.toTwos(n.width).toHexString():(s=i.toHexString(),s=nt(s,n.width/8));const o=Qa(i,n.decimals);return new xt(go,s,o,n)}static fromBytes(e,r){r==null&&(r="fixed");const n=fs.from(r);if(oe(e).length>n.width/8)throw new Error("overflow");let i=J.from(e);n.signed&&(i=i.fromTwos(n.width));const s=i.toTwos((n.signed?0:1)+n.width).toHexString(),o=Qa(i,n.decimals);return new xt(go,s,o,n)}static from(e,r){if(typeof e=="string")return xt.fromString(e,r);if(Hs(e))return xt.fromBytes(e,r);try{return xt.fromValue(e,0,r)}catch(n){if(n.code!==$.errors.INVALID_ARGUMENT)throw n}return Bt.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}}const ad=xt.from(1),yb=xt.from("0.5"),bb="properties/5.8.0";var wb=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(d){o(d)}}function c(f){try{u(n.throw(f))}catch(d){o(d)}}function u(f){f.done?s(f.value):i(f.value).then(a,c)}u((n=n.apply(t,e||[])).next())})};const oc=new $(bb);function K(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function Hr(t,e){for(let r=0;r<32;r++){if(t[e])return t[e];
17if(!t.prototype||typeof t.prototype!="object")break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function lt(t){return wb(this,void 0,void 0,function*(){const e=Object.keys(t).map(n=>{const i=t[n];return Promise.resolve(i).then(s=>({key:n,value:s}))});return(yield Promise.all(e)).reduce((n,i)=>(n[i.key]=i.value,n),{})})}function vb(t,e){(!t||typeof t!="object")&&oc.throwArgumentError("invalid object","object",t),Object.keys(t).forEach(r=>{e[r]||oc.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)})}function mt(t){const e={};for(const r in t)e[r]=t[r];return e}const xb={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function Mp(t){if(t==null||xb[typeof t])return!0;if(Array.isArray(t)||typeof t=="object"){if(!Object.isFrozen(t))return!1;const e=Object.keys(t);for(let r=0;r<e.length;r++){let n=null;try{n=t[e[r]]}catch{continue}if(!Mp(n))return!1}return!0}return oc.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function Ab(t){if(Mp(t))return t;if(Array.isArray(t))return Object.freeze(t.map(e=>vn(e)));if(typeof t=="object"){const e={};for(const r in t){const n=t[r];n!==void 0&&K(e,r,vn(n))}return e}return oc.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function vn(t){return Ab(t)}class aa{constructor(e){for(const r in e)this[r]=vn(e[r])}}const ca="abi/5.8.0",be=new $(ca),$i={};let cd={calldata:!0,memory:!0,storage:!0},Eb={calldata:!0,memory:!0};function Ba(t,e){if(t==="bytes"||t==="string"){if(cd[e])return!0}else if(t==="address"){if(e==="payable")return!0}else if((t.indexOf("[")>=0||t==="tuple")&&Eb[e])return!0;return(cd[e]||e==="payable")&&be.throwArgumentError("invalid modifier","name",e),!1}function Pb(t,e){let r=t;function n(a){be.throwArgumentError(`unexpected character at position ${a}`,"param",t)}t=t.replace(/\s/g," ");function i(a){let c={type:"",name:"",parent:a,state:{allowType:!0}};return e&&(c.indexed=!1),c}let s={type:"",name:"",state:{allowType:!0}},o=s;for(let a=0;a<t.length;a++){let c=t[a];switch(c){case"(":o.state.allowType&&o.type===""?o.type="tuple":o.state.allowParams||n(a),o.state.allowType=!1,o.type=es(o.type),o.components=[i(o)],o=o.components[0];break;case")":delete o.state,o.name==="indexed"&&(e||n(a),o.indexed=!0,o.name=""),Ba(o.type,o.name)&&(o.name=""),o.type=es(o.type);let u=o;o=o.parent,o||n(a),delete u.parent,o.state.allowParams=!1,o.state.allowName=!0,o.state.allowArray=!0;break;case",":delete o.state,o.name==="indexed"&&(e||n(a),o.indexed=!0,o.name=""),Ba(o.type,o.name)&&(o.name=""),o.type=es(o.type);let f=i(o.parent);o.parent.components.push(f),delete o.parent,o=f;break;case" ":o.state.allowType&&o.type!==""&&(o.type=es(o.type),delete o.state.allowType,o.state.allowName=!0,o.state.allowParams=!0),o.state.allowName&&o.name!==""&&(o.name==="indexed"?(e||n(a),o.indexed&&n(a),o.indexed=!0,o.name=""):Ba(o.type,o.name)?o.name="":o.state.allowName=!1);break;case"[":o.state.allowArray||n(a),o.type+=c,o.state.allowArray=!1,o.state.allowName=!1,o.state.readArray=!0;break;case"]":o.state.readArray||n(a),o.type+=c,o.state.readArray=!1,o.state.allowArray=!0,o.state.allowName=!0;break;default:o.state.allowType?(o.type+=c,o.state.allowParams=!0,o.state.allowArray=!0):o.state.allowName?(o.name+=c,delete o.state.allowArray):o.state.readArray?o.type+=c:n(a)}}return o.parent&&be.throwArgumentError("unexpected eof","param",t),delete s.state,o.name==="indexed"?(e||n(r.length-7),o.indexed&&n(r.length-7),o.indexed=!0,o.name=""):Ba(o.type,o.name)&&(o.name=""),s.type=es(s.type),s}function Ja(t,e){for(let r in e)K(t,r,e[r])}const we=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),Sb=new RegExp(/^(.*)\[([0-9]*)\]$/);class yt{constructor(e,r){e!==$i&&be.throwError("use fromString",$.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),Ja(this,r);let n=this.type.match(Sb);n?Ja(this,{arrayLength:parseInt(n[2]||"-1"),arrayChildren:yt.fromObject({type:n[1],components:this.components}),baseType:"array"}):Ja(this,{arrayLength:null,arrayChildren:null,baseType:this.components!=null?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=we.sighash),we[e]||be.throwArgumentError("invalid format type","format",e),e===we.json){let n={type:this.baseType==="tuple"?"tuple":this.t
17ype,name:this.name||void 0};return typeof this.indexed=="boolean"&&(n.indexed=this.indexed),this.components&&(n.components=this.components.map(i=>JSON.parse(i.format(e)))),JSON.stringify(n)}let r="";return this.baseType==="array"?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(e!==we.sighash&&(r+=this.type),r+="("+this.components.map(n=>n.format(e)).join(e===we.full?", ":",")+")"):r+=this.type,e!==we.sighash&&(this.indexed===!0&&(r+=" indexed"),e===we.full&&this.name&&(r+=" "+this.name)),r}static from(e,r){return typeof e=="string"?yt.fromString(e,r):yt.fromObject(e)}static fromObject(e){return yt.isParamType(e)?e:new yt($i,{name:e.name||null,type:es(e.type),indexed:e.indexed==null?null:!!e.indexed,components:e.components?e.components.map(yt.fromObject):null})}static fromString(e,r){function n(i){return yt.fromObject({name:i.name,type:i.type,indexed:i.indexed,components:i.components})}return n(Pb(e,!!r))}static isParamType(e){return!!(e!=null&&e._isParamType)}}function Ao(t,e){return Ib(t).map(r=>yt.fromString(r,e))}class yn{constructor(e,r){e!==$i&&be.throwError("use a static from method",$.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Ja(this,r),this._isFragment=!0,Object.freeze(this)}static from(e){return yn.isFragment(e)?e:typeof e=="string"?yn.fromString(e):yn.fromObject(e)}static fromObject(e){if(yn.isFragment(e))return e;switch(e.type){case"function":return Gr.fromObject(e);case"event":return mn.fromObject(e);case"constructor":return jr.fromObject(e);case"error":return zn.fromObject(e);case"fallback":case"receive":return null}return be.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return e=e.replace(/\s/g," "),e=e.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),e=e.trim(),e.split(" ")[0]==="event"?mn.fromString(e.substring(5).trim()):e.split(" ")[0]==="function"?Gr.fromString(e.substring(8).trim()):e.split("(")[0].trim()==="constructor"?jr.fromString(e.trim()):e.split(" ")[0]==="error"?zn.fromString(e.substring(5).trim()):be.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!!(e&&e._isFragment)}}class mn extends yn{format(e){if(e||(e=we.sighash),we[e]||be.throwArgumentError("invalid format type","format",e),e===we.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==we.sighash&&(r+="event "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===we.full?", ":",")+") ",e!==we.sighash&&this.anonymous&&(r+="anonymous "),r.trim()}static from(e){return typeof e=="string"?mn.fromString(e):mn.fromObject(e)}static fromObject(e){if(mn.isEventFragment(e))return e;e.type!=="event"&&be.throwArgumentError("invalid event object","value",e);const r={name:Eo(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(yt.fromObject):[],type:"event"};return new mn($i,r)}static fromString(e){let r=e.match(Po);r||be.throwArgumentError("invalid event string","value",e);let n=!1;return r[3].split(" ").forEach(i=>{switch(i.trim()){case"anonymous":n=!0;break;case"":break;default:be.warn("unknown modifier: "+i)}}),mn.fromObject({name:r[1].trim(),anonymous:n,inputs:Ao(r[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&e.type==="event"}}function Tp(t,e){e.gas=null;let r=t.split("@");return r.length!==1?(r.length>2&&be.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||be.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=J.from(r[1]),r[0]):t}function Rp(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach(r=>{switch(r.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+r)}})}function Cp(t){let e={constant:!1,payable:!0,stateMutability:"payable"};return t.stateMutability!=null?(e.stateMutability=t.stateMutability,e.constant=e.stateMutability==="view"||e.stateMutability==="pure",t.constant!=null&&!!t.constant!==e.constant&&be.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable=e.stateMutability==="payable",t.payable!=null&&!!t.payable!==e.payable&&be.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):t.payable!=null?(e.payable=!!t.payable,t.constant==null&&!e.payable&&t.type!=="constructor"&&be.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&be.throwArgumentError("cannot have constant payable function","value",t)):t.constant!=null?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):t.type!=="constructor"&&be.throwArgumentError("unable to determine stateMutability","value",t),e}class jr extends yn{format(e){if(e||(e=we.sighash),we[e]||be.throwArgumentError("invalid format type","format",e),e===we.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});e===we.sighash&&be.throwError("cannot format a constructor for sighash",$.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let r="constructor("+this.inputs.map(n=>n.format(e)).join(e===we.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "),r.trim()}static from(e){return typeof e=="string"?jr.fromString(e):jr.fromObject(e)}static fromObject(e){if(jr.isConstructorFragment(e))return e;e.type!=="constructor"&&be.throwArgumentError("invalid constructor object","value",e);let r=Cp(e);r.constant&&be.throwArgumentError("constructor cannot be constant","value",e);const n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(yt.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?J.from(e.gas):null};return new jr($i,n)}static fromString(e){let r={type:"constructor"};e=Tp(e,r);let n=e.match(Po);return(!n||n[1].trim()!=="constructor")&&be.throwArgumentError("invalid constructor string","value",e),r.inputs=Ao(n[2].trim(),!1),Rp(n[3].trim(),r),jr.fromObject(r)}static isConstructorFragment(e){return e&&e._isFragment&&e.type==="constructor"}}
17class Gr extends jr{format(e){if(e||(e=we.sighash),we[e]||be.throwArgumentError("invalid format type","format",e),e===we.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e))),outputs:this.outputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==we.sighash&&(r+="function "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===we.full?", ":",")+") ",e!==we.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "):this.constant&&(r+="view "),this.outputs&&this.outputs.length&&(r+="returns ("+this.outputs.map(n=>n.format(e)).join(", ")+") "),this.gas!=null&&(r+="@"+this.gas.toString()+" ")),r.trim()}static from(e){return typeof e=="string"?Gr.fromString(e):Gr.fromObject(e)}static fromObject(e){if(Gr.isFunctionFragment(e))return e;e.type!=="function"&&be.throwArgumentError("invalid function object","value",e);let r=Cp(e);const n={type:e.type,name:Eo(e.name),constant:r.constant,inputs:e.inputs?e.inputs.map(yt.fromObject):[],outputs:e.outputs?e.outputs.map(yt.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?J.from(e.gas):null};return new Gr($i,n)}static fromString(e){let r={type:"function"};e=Tp(e,r);let n=e.split(" returns ");n.length>2&&be.throwArgumentError("invalid function string","value",e);let i=n[0].match(Po);if(i||be.throwArgumentError("invalid function signature","value",e),r.name=i[1].trim(),r.name&&Eo(r.name),r.inputs=Ao(i[2],!1),Rp(i[3].trim(),r),n.length>1){let s=n[1].match(Po);(s[1].trim()!=""||s[3].trim()!="")&&be.throwArgumentError("unexpected tokens","value",e),r.outputs=Ao(s[2],!1)}else r.outputs=[];return Gr.fromObject(r)}static isFunctionFragment(e){return e&&e._isFragment&&e.type==="function"}}function ud(t){const e=t.format();return(e==="Error(string)"||e==="Panic(uint256)")&&be.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}class zn extends yn{format(e){if(e||(e=we.sighash),we[e]||be.throwArgumentError("invalid format type","format",e),e===we.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==we.sighash&&(r+="error "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===we.full?", ":",")+") ",r.trim()}static from(e){return typeof e=="string"?zn.fromString(e):zn.fromObject(e)}static fromObject(e){if(zn.isErrorFragment(e))return e;e.type!=="error"&&be.throwArgumentError("invalid error object","value",e);const r={type:e.type,name:Eo(e.name),inputs:e.inputs?e.inputs.map(yt.fromObject):[]};return ud(new zn($i,r))}static fromString(e){let r={type:"error"},n=e.match(Po);return n||be.throwArgumentError("invalid error signature","value",e),r.name=n[1].trim(),r.name&&Eo(r.name),r.inputs=Ao(n[2],!1),ud(zn.fromObject(r))}static isErrorFragment(e){return e&&e._isFragment&&e.type==="error"}}function es(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const _b=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Eo(t){return(!t||!t.match(_b))&&be.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const Po=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function Ib(t){t=t.trim();let e=[],r="",n=0;for(let i=0;i<t.length;i++){let s=t[i];s===","&&n===0?(e.push(r),r=""):(r+=s,s==="("?n++:s===")"&&(n--,n===-1&&be.throwArgumentError("unbalanced parenthesis","value",t)))}return r&&e.push(r),e}const Rl=new $(ca);function Nb(t){const e=[],r=function(n,i){if(Array.isArray(i))for(let s in i){const o=n.slice();o.push(s);try{r(o,i[s])}catch(a){e.push({path:o,error:a})}}};return r([],t),e}class Sn{constructor(e,r,n,i){this.name=e,this.type=r,this.localName=n,this.dynamic=i}_throwError(e,r){Rl.throwArgumentError(e,this.localName,r)}}class Sf{constructor(e){K(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return qt(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(jt(e._data))}writeBytes(e){let r=oe(e);const n=r.length%this.wordSize;
vendor: 4,988 bytes, lines 17-24
17return n&&(r=jt([r,this._padding.slice(n)])),this._writeData(r)}_getValue(e){let r=oe(J.from(e));return r.length>this.wordSize&&Rl.throwError("value out-of-bounds",$.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:r.length}),r.length%this.wordSize&&(r=jt([this._padding.slice(r.length%this.wordSize),r])),r}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,r=>{this._data[e]=this._getValue(r)}}}class ac{constructor(e,r,n,i){K(this,"_data",oe(e)),K(this,"wordSize",r||32),K(this,"_coerceFunc",n),K(this,"allowLoose",i),this._offset=0}get data(){return se(this._data)}get consumed(){return this._offset}static coerce(e,r){let n=e.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(r=r.toNumber()),r}coerce(e,r){return this._coerceFunc?this._coerceFunc(e,r):ac.coerce(e,r)}_peekBytes(e,r,n){let i=Math.ceil(r/this.wordSize)*this.wordSize;return this._offset+i>this._data.length&&(this.allowLoose&&n&&this._offset+r<=this._data.length?i=r:Rl.throwError("data out-of-bounds",$.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+i})),this._data.slice(this._offset,this._offset+i)}subReader(e){return new ac(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,r){let n=this._peekBytes(0,e,!!r);return this._offset+=n.length,n.slice(0,e)}readValue(){return J.from(this.readBytes(this.wordSize))}}var Bp={exports:{}};/**
18 * [js-sha3]{@link https://github.com/emn178/js-sha3}
19 *
20 * @version 0.8.0
21 * @author Chen, Yi-Cyuan [[email protected]]
22 * @copyright Chen, Yi-Cyuan 2015-2018
23 * @license MIT
24 */(function(t){(function(){var e="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var s=!n&&typeof self=="object",o=!i.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?i=ip:s&&(i=self);var a=!i.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,c=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",u="0123456789abcdef".split(""),f=[31,7936,2031616,520093696],d=[4,1024,262144,67108864],m=[1,256,65536,16777216],g=[6,1536,393216,100663296],w=[0,8,16,24],A=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],k=[224,256,384,512],_=[128,256],B=["hex","buffer","arrayBuffer","array","digest"],T={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(y){return Object.prototype.toString.call(y)==="[object Array]"}),c&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(y){return typeof y=="object"&&y.buffer&&y.buffer.constructor===ArrayBuffer});for(var N=function(y,U,G){return function(H){return new h(y,U,y).update(H)[G]()}},M=function(y,U,G){return function(H,V){return new h(y,U,V).update(H)[G]()}},O=function(y,U,G){return function(H,V,ie,X){return l["cshake"+y].update(H,V,ie,X)[G]()}},F=function(y,U,G){return function(H,V,ie,X){return l["kmac"+y].update(H,V,ie,X)[G]()}},L=function(y,U,G,H){for(var V=0;V<B.length;++V){var ie=B[V];y[ie]=U(G,H,ie)}return y},z=function(y,U){var G=N(y,U,"hex");return G.create=function(){return new h(y,U,y)},G.update=function(H){return G.create().update(H)},L(G,N,y,U)},D=function(y,U){var G=M(y,U,"hex");return G.create=function(H){return new h(y,U,H)},G.update=function(H,V){return G.create(V).update(H)},L(G,M,y,U)},j=function(y,U){var G=T[y],H=O(y,U,"hex");return H.create=function(V,ie,X){return!ie&&!X?l["shake"+y].create(V):new h(y,U,V).bytepad([ie,X],G)},H.update=function(V,ie,X,Y){return H.create(ie,X,Y).update(V)},L(H,O,y,U)},Q=function(y,U){var G=T[y],H=F(y,U,"hex");return H.create=function(V,ie,X){return new S(y,U,ie).bytepad(["KMAC",X],G).bytepad([V],G)},H.update=function(V,ie,X,Y){return H.create(V,X,Y).update(ie)},L(H,F,y,U)},E=[{name:"keccak",padding:m,bits:k,createMethod:z},{name:"sha3",padding:g,bits:k,createMethod:z},{name:"shake",padding:f,bits:_,createMethod:D},{name:"cshake",padding:d,bits:_,createMethod:j},{name:"kmac",padding:d,bits:_,createMethod:Q}],l={},p=[],b=0;b<E.length;++b)for(var x=E[b],v=x.bits,I=0;I<v.length;++I){var R=x.name+"_"+v[I];if(p.push(R),l[R]=x.createMethod(v[I],x.padding),x.name!=="sha3"){var P=x.name+v[I];p.push(P),l[P]=l[R]}}function h(y,U,G){this.blocks=[],this.s=[],this.padding=U,this.outputBits=G,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(y<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=G>>5,this.extraBytes=(G&31)>>3;for(var H=0;H<50;++H)this.s[H]=0}h.prototype.update=function(y){if(this.finalized)throw new Error(r);var U,G=typeof y;if(G!=="string"){if(G==="object"){if(y===null)throw new Error(e);
24if(c&&y.constructor===ArrayBuffer)y=new Uint8Array(y);else if(!Array.isArray(y)&&(!c||!ArrayBuffer.isView(y)))throw new Error(e)}else throw new Error(e);U=!0}for(var H=this.blocks,V=this.byteCount,ie=y.length,X=this.blockCount,Y=0,xe=this.s,ee,ae;Y<ie;){if(this.reset)for(this.reset=!1,H[0]=this.block,ee=1;ee<X+1;++ee)H[ee]=0;if(U)for(ee=this.start;Y<ie&&ee<V;++Y)H[ee>>2]|=y[Y]<<w[ee++&3];else for(ee=this.start;Y<ie&&ee<V;++Y)ae=y.charCodeAt(Y),ae<128?H[ee>>2]|=ae<<w[ee++&3]:ae<2048?(H[ee>>2]|=(192|ae>>6)<<w[ee++&3],H[ee>>2]|=(128|ae&63)<<w[ee++&3]):ae<55296||ae>=57344?(H[ee>>2]|=(224|ae>>12)<<w[ee++&3],H[ee>>2]|=(128|ae>>6&63)<<w[ee++&3],H[ee>>2]|=(128|ae&63)<<w[ee++&3]):(ae=65536+((ae&1023)<<10|y.charCodeAt(++Y)&1023),H[ee>>2]|=(240|ae>>18)<<w[ee++&3],H[ee>>2]|=(128|ae>>12&63)<<w[ee++&3],H[ee>>2]|=(128|ae>>6&63)<<w[ee++&3],H[ee>>2]|=(128|ae&63)<<w[ee++&3]);if(this.lastByteIndex=ee,ee>=V){for(this.start=ee-V,this.block=H[X],ee=0;ee<X;++ee)xe[ee]^=H[ee];Z(xe),this.reset=!0}else this.start=ee}return this},h.prototype.encode=function(y,U){var G=y&255,H=1,V=[G];for(y=y>>8,G=y&255;G>0;)V.unshift(G),y=y>>8,G=y&255,++H;return U?V.push(H):V.unshift(H),this.update(V),V.length},h.prototype.encodeString=function(y){var U,G=typeof y;if(G!=="string"){if(G==="object"){if(y===null)throw new Error(e);
24if(c&&y.constructor===ArrayBuffer)y=new Uint8Array(y);else if(!Array.isArray(y)&&(!c||!ArrayBuffer.isView(y)))throw new Error(e)}else throw new Error(e);U=!0}var H=0,V=y.length;if(U)H=V;else for(var ie=0;ie<y.length;++ie){var X=y.charCodeAt(ie);X<128?H+=1:X<2048?H+=2:X<55296||X>=57344?H+=3:(X=65536+((X&1023)<<10|y.charCodeAt(++ie)&1023),H+=4)}return H+=this.encode(H*8),this.update(y),H},h.prototype.bytepad=function(y,U){for(var G=this.encode(U),H=0;H<y.length;++H)G+=this.encodeString(y[H]);var V=U-G%U,ie=[];return ie.length=V,this.update(ie),this},h.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var y=this.blocks,U=this.lastByteIndex,G=this.blockCount,H=this.s;if(y[U>>2]|=this.padding[U&3],this.lastByteIndex===this.byteCount)for(y[0]=y[G],U=1;U<G+1;++U)y[U]=0;for(y[G-1]|=2147483648,U=0;U<G;++U)H[U]^=y[U];Z(H)}},h.prototype.toString=h.prototype.hex=function(){this.finalize();for(var y=this.blockCount,U=this.s,G=this.outputBlocks,H=this.extraBytes,V=0,ie=0,X="",Y;ie<G;){for(V=0;V<y&&ie<G;++V,++ie)Y=U[V],X+=u[Y>>4&15]+u[Y&15]+u[Y>>12&15]+u[Y>>8&15]+u[Y>>20&15]+u[Y>>16&15]+u[Y>>28&15]+u[Y>>24&15];ie%y===0&&(Z(U),V=0)}return H&&(Y=U[V],X+=u[Y>>4&15]+u[Y&15],H>1&&(X+=u[Y>>12&15]+u[Y>>8&15]),H>2&&(X+=u[Y>>20&15]+u[Y>>16&15])),X},h.prototype.arrayBuffer=function(){this.finalize();var y=this.blockCount,U=this.s,G=this.outputBlocks,H=this.extraBytes,V=0,ie=0,X=this.outputBits>>3,Y;H?Y=new ArrayBuffer(G+1<<2):Y=new ArrayBuffer(X);for(var xe=new Uint32Array(Y);ie<G;){for(V=0;V<y&&ie<G;++V,++ie)xe[ie]=U[V];ie%y===0&&Z(U)}return H&&(xe[V]=U[V],Y=Y.slice(0,X)),Y},h.prototype.buffer=h.prototype.arrayBuffer,h.prototype.digest=h.prototype.array=function(){this.finalize();for(var y=this.blockCount,U=this.s,G=this.outputBlocks,H=this.extraBytes,V=0,ie=0,X=[],Y,xe;ie<G;){for(V=0;V<y&&ie<G;++V,++ie)Y=ie<<2,xe=U[V],X[Y]=xe&255,X[Y+1]=xe>>8&255,X[Y+2]=xe>>16&255,X[Y+3]=xe>>24&255;ie%y===0&&Z(U)}return H&&(Y=ie<<2,xe=U[V],X[Y]=xe&255,H>1&&(X[Y+1]=xe>>8&255),H>2&&(X[Y+2]=xe>>16&255)),X};function S(y,U,G){h.call(this,y,U,G)}S.prototype=new h,S.prototype.finalize=function(){return this.encode(this.outputBits,!0),h.prototype.finalize.call(this)};var Z=function(y){var U,G,H,V,ie,X,Y,xe,ee,ae,Or,Pe,Se,oi,_e,Ie,ai,Ne,ke,ci,Me,Te,ui,Re,Ce,fi,Be,Oe,li,Fe,$e,di,Le,Ue,hi,De,ze,pi,qe,je,mi,Ge,He,gi,Ve,Ke,yi,We,Qe,bi,Je,Ye,wi,Ze,Xe,vi,et,tt,Mn,Tn,Rn,Cn,Bn;for(H=0;H<48;H+=2)V=y[0]^y[10]^y[20]^y[30]^y[40],ie=y[1]^y[11]^y[21]^y[31]^y[41],X=y[2]^y[12]^y[22]^y[32]^y[42],Y=y[3]^y[13]^y[23]^y[33]^y[43],xe=y[4]^y[14]^y[24]^y[34]^y[44],ee=y[5]^y[15]^y[25]^y[35]^y[45],ae=y[6]^y[16]^y[26]^y[36]^y[46],Or=y[7]^y[17]^y[27]^y[37]^y[47],Pe=y[8]^y[18]^y[28]^y[38]^y[48],Se=y[9]^y[19]^y[29]^y[39]^y[49],U=Pe^(X<<1|Y>>>31),G=Se^(Y<<1|X>>>31),y[0]^=U,y[1]^=G,y[10]^=U,y[11]^=G,y[20]^=U,y[21]^=G,y[30]^=U,y[31]^=G,y[40]^=U,y[41]^=G,U=V^(xe<<1|ee>>>31),G=ie^(ee<<1|xe>>>31),y[2]^=U,y[3]^=G,y[12]^=U,y[13]^=G,y[22]^=U,y[23]^=G,y[32]^=U,y[33]^=G,y[42]^=U,y[43]^=G,U=X^(ae<<1|Or>>>31),G=Y^(Or<<1|ae>>>31),y[4]^=U,y[5]^=G,y[14]^=U,y[15]^=G,y[24]^=U,y[25]^=G,y[34]^=U,y[35]^=G,y[44]^=U,y[45]^=G,U=xe^(Pe<<1|Se>>>31),G=ee^(Se<<1|Pe>>>31),y[6]^=U,y[7]^=G,y[16]^=U,y[17]^=G,y[26]^=U,y[27]^=G,y[36]^=U,y[37]^=G,y[46]^=U,y[47]^=G,U=ae^(V<<1|ie>>>31),G=Or^(ie<<1|V>>>31),y[8]^=U,y[9]^=G,y[18]^=U,y[19]^=G,y[28]^=U,y[29]^=G,y[38]^=U,y[39]^=G,y[48]^=U,y[49]^=G,oi=y[0],_e=y[1],Ke=y[11]<<4|y[10]>>>28,yi=y[10]<<4|y[11]>>>28,Oe=y[20]<<3|y[21]>>>29,li=y[21]<<3|y[20]>>>29,Tn=y[31]<<9|y[30]>>>23,Rn=y[30]<<9|y[31]>>>23,Ge=y[40]<<18|y[41]>>>14,He=y[41]<<18|y[40]>>>14,Ue=y[2]<<1|y[3]>>>31,hi=y[3]<<1|y[2]>>>31,Ie=y[13]<<12|y[12]>>>20,ai=y[12]<<12|y[13]>>>20,We=y[22]<<10|y[23]>>>22,Qe=y[23]<<10|y[22]>>>22,Fe=y[33]<<13|y[32]>>>19,$e=y[32]<<13|y[33]>>>19,Cn=y[42]<<2|y[43]>>>30,Bn=y[43]<<2|y[42]>>>30,Ze=y[5]<<30|y[4]>>>2,Xe=y[4]<<30|y[5]>>>2,De=y[14]<<6|y[15]>>>26,ze=y[15]<<6|y[14]>>>26,Ne=y[25]<<11|y[24]>>>21,ke=y[24]<<11|y[25]>>>21,bi=y[34]<<15|y[35]>>>17,Je=y[35]<<15|y[34]>>>17,di=y[45]<<29|y[44]>>>3,Le=y[44]<<29|y[45]>>>3,Re=y[6]<<28|y[7]>>>4,Ce=y[7]<<28|y[6]>>>4,vi=y[17]<<23|y[16]>>>9,et=y[16]<<23|y[17]>>>9,pi=y[26]<<25|y[27]>>>7,qe=y[27]<<25|y[26]>>>7,ci=y[36]<<21|y[37]>>>11,Me=y[37]<<21|y[36]>>>11,Ye=y[47]<<24|y[46]>>>8,wi=y[46]<<24|y[47]>>>8,gi=y[8]<<27|y[9]>>>5,Ve=y[9]<<27|y[8]>>>5,fi=y[18]<<20|y[19]>>>12,Be=y[19]<<20|y[18]>>>12,tt=y[29]<<7|y[28]>>>25,Mn=y[28]<<7|y[29]>>>25,je=y[38]<<8|y[39]>>>24,mi=y[39]<<8|y[38]>>>24,Te=y[48]<<14|y[49]>>>18,ui=y[49]<<14|y[48]>>>
2418,y[0]=oi^~Ie&Ne,y[1]=_e^~ai&ke,y[10]=Re^~fi&Oe,y[11]=Ce^~Be&li,y[20]=Ue^~De&pi,y[21]=hi^~ze&qe,y[30]=gi^~Ke&We,y[31]=Ve^~yi&Qe,y[40]=Ze^~vi&tt,y[41]=Xe^~et&Mn,y[2]=Ie^~Ne&ci,y[3]=ai^~ke&Me,y[12]=fi^~Oe&Fe,y[13]=Be^~li&$e,y[22]=De^~pi&je,y[23]=ze^~qe&mi,y[32]=Ke^~We&bi,y[33]=yi^~Qe&Je,y[42]=vi^~tt&Tn,y[43]=et^~Mn&Rn,y[4]=Ne^~ci&Te,y[5]=ke^~Me&ui,y[14]=Oe^~Fe&di,y[15]=li^~$e&Le,y[24]=pi^~je&Ge,y[25]=qe^~mi&He,y[34]=We^~bi&Ye,y[35]=Qe^~Je&wi,y[44]=tt^~Tn&Cn,y[45]=Mn^~Rn&Bn,y[6]=ci^~Te&oi,y[7]=Me^~ui&_e,y[16]=Fe^~di&Re,y[17]=$e^~Le&Ce,y[26]=je^~Ge&Ue,y[27]=mi^~He&hi,y[36]=bi^~Ye&gi,y[37]=Je^~wi&Ve,y[46]=Tn^~Cn&Ze,y[47]=Rn^~Bn&Xe,y[8]=Te^~oi&Ie,y[9]=ui^~_e&ai,y[18]=di^~Re&fi,y[19]=Le^~Ce&Be,y[28]=Ge^~Ue&De,y[29]=He^~hi&ze,y[38]=Ye^~gi&Ke,y[39]=wi^~Ve&yi,y[48]=Cn^~Ze&vi,y[49]=Bn^~Xe&et,y[0]^=A[H],y[1]^=A[H+1]};if(a)t.exports=l;else for(b=0;b<p.length;++b)i[p[b]]=l[p[b]]})()})(Bp);var kb=Bp.exports;const Mb=ia(kb);function ht(t){return"0x"+Mb.keccak_256(oe(t))}const Tb="rlp/5.8.0",Lr=new $(Tb);function fd(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function ld(t,e,r){let n=0;for(let i=0;i<r;i++)n=n*256+t[e+i];return n}function Op(t){if(Array.isArray(t)){let n=[];if(t.forEach(function(s){n=n.concat(Op(s))}),n.length<=55)return n.unshift(192+n.length),n;const i=fd(n.length);return i.unshift(247+i.length),i.concat(n)}kl(t)||Lr.throwArgumentError("RLP object must be BytesLike","object",t);const e=Array.prototype.slice.call(oe(t));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const r=fd(e.length);return r.unshift(183+r.length),r.concat(e)}function Nc(t){return se(Op(t))}function dd(t,e,r,n){const i=[];for(;r<e+1+n;){const s=Fp(t,r);i.push(s.result),r+=s.consumed,r>e+1+n&&Lr.throwError("child data too short",$.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function Fp(t,e){if(t.length===0&&Lr.throwError("data too short",$.errors.BUFFER_OVERRUN,{}),t[e]>=248){const r=t[e]-247;e+1+r>t.length&&Lr.throwError("data short segment too short",$.errors.BUFFER_OVERRUN,{});const n=ld(t,e+1,r);return e+1+r+n>t.length&&Lr.throwError("data long segment too short",$.errors.BUFFER_OVERRUN,{}),dd(t,e,e+1+r,r+n)}else if(t[e]>=192){const r=t[e]-192;return e+1+r>t.length&&Lr.throwError("data array too short",$.errors.BUFFER_OVERRUN,{}),dd(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;e+1+r>t.length&&Lr.throwError("data array too short",$.errors.BUFFER_OVERRUN,{});const n=ld(t,e+1,r);e+1+r+n>t.length&&Lr.throwError("data array too short",$.errors.BUFFER_OVERRUN,{});const i=se(t.slice(e+1+r,e+1+r+n));return{consumed:1+r+n,result:i}}else if(t[e]>=128){const r=t[e]-128;e+1+r>t.length&&Lr.throwError("data too short",$.errors.BUFFER_OVERRUN,{});const n=se(t.slice(e+1,e+1+r));return{consumed:1+r,result:n}}return{consumed:1,result:se(t[e])}}function Cl(t){const e=oe(t),r=Fp(e,0);return r.consumed!==e.length&&Lr.throwArgumentError("invalid rlp data","data",t),r.result}const Rb="address/5.8.0",rs=new $(Rb);function hd(t){ve(t,20)||rs.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=oe(ht(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const Cb=9007199254740991;function Bb(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const Bl={};for(let t=0;t<10;t++)Bl[String(t)]=String(t);for(let t=0;t<26;t++)Bl[String.fromCharCode(65+t)]=String(10+t);const pd=Math.floor(Bb(Cb));function Ob(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>Bl[n]).join("");for(;e.length>=pd;){let n=e.substring(0,pd);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function Et(t){let e=null;if(typeof t!="string"&&rs.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=hd(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&rs.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==Ob(t)&&rs.throwArgumentError("bad icap checksum","address",t),e=gb(t.substring(4));e.length<40;)e="0"+e;e=hd("0x"+e)}else rs.throwArgumentError("invalid address","address",t);return e}function $p(t){let e=null;try{e=Et(t.from)}catch{rs.throwArgumentError("missing from address","transaction",t)}
24const r=Ms(oe(J.from(t.nonce).toHexString()));return Et(It(ht(Nc([e,r])),12))}class Fb extends Sn{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){try{r=Et(r)}catch(n){this._throwError(n.message,r)}return e.writeValue(r)}decode(e){return Et(nt(e.readValue().toHexString(),20))}}class $b extends Sn{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,r){return this.coder.encode(e,r)}decode(e){return this.coder.decode(e)}}const ns=new $(ca);function Lp(t,e,r){let n=null;if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let c={};n=e.map(u=>{const f=u.localName;return f||ns.throwError("cannot encode object for signature with missing names",$.errors.INVALID_ARGUMENT,{argument:"values",coder:u,value:r}),c[f]&&ns.throwError("cannot encode object for signature with duplicate names",$.errors.INVALID_ARGUMENT,{argument:"values",coder:u,value:r}),c[f]=!0,r[f]})}else ns.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&ns.throwArgumentError("types/value length mismatch","tuple",r);let i=new Sf(t.wordSize),s=new Sf(t.wordSize),o=[];e.forEach((c,u)=>{let f=n[u];if(c.dynamic){let d=s.length;c.encode(s,f);let m=i.writeUpdatableValue();o.push(g=>{m(g+d)})}else c.encode(i,f)}),o.forEach(c=>{c(i.length)});let a=t.appendWriter(i);return a+=t.appendWriter(s),a}function Up(t,e){let r=[],n=t.subReader(0);e.forEach(s=>{let o=null;if(s.dynamic){let a=t.readValue(),c=n.subReader(a.toNumber());try{o=s.decode(c)}catch(u){if(u.code===$.errors.BUFFER_OVERRUN)throw u;o=u,o.baseType=s.name,o.name=s.localName,o.type=s.type}}else try{o=s.decode(t)}catch(a){if(a.code===$.errors.BUFFER_OVERRUN)throw a;o=a,o.baseType=s.name,o.name=s.localName,o.type=s.type}o!=null&&r.push(o)});const i=e.reduce((s,o)=>{const a=o.localName;return a&&(s[a]||(s[a]=0),s[a]++),s},{});e.forEach((s,o)=>{let a=s.localName;if(!a||i[a]!==1||(a==="length"&&(a="_length"),r[a]!=null))return;const c=r[o];c instanceof Error?Object.defineProperty(r,a,{enumerable:!0,get:()=>{throw c}}):r[a]=c});for(let s=0;s<r.length;s++){const o=r[s];o instanceof Error&&Object.defineProperty(r,s,{enumerable:!0,get:()=>{throw o}})}return Object.freeze(r)}class Lb extends Sn{constructor(e,r,n){const i=e.type+"["+(r>=0?r:"")+"]",s=r===-1||e.dynamic;super("array",i,n,s),this.coder=e,this.length=r}defaultValue(){const e=this.coder.defaultValue(),r=[];for(let n=0;n<this.length;n++)r.push(e);return r}encode(e,r){Array.isArray(r)||this._throwError("expected array value",r);let n=this.length;n===-1&&(n=r.length,e.writeValue(r.length)),ns.checkArgumentCount(r.length,n,"coder array"+(this.localName?" "+this.localName:""));let i=[];for(let s=0;s<r.length;s++)i.push(this.coder);return Lp(e,i,r)}decode(e){let r=this.length;r===-1&&(r=e.readValue().toNumber(),r*32>e._data.length&&ns.throwError("insufficient data length",$.errors.BUFFER_OVERRUN,{length:e._data.length,count:r}));let n=[];for(let i=0;i<r;i++)n.push(new $b(this.coder));return e.coerce(this.name,Up(e,n))}}class Ub extends Sn{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,r){return e.writeValue(r?1:0)}decode(e){return e.coerce(this.type,!e.readValue().isZero())}}class Dp extends Sn{constructor(e,r){super(e,e,r,!0)}defaultValue(){return"0x"}encode(e,r){r=oe(r);let n=e.writeValue(r.length);return n+=e.writeBytes(r),n}decode(e){return e.readBytes(e.readValue().toNumber(),!0)}}class Db extends Dp{constructor(e){super("bytes",e)}decode(e){return e.coerce(this.name,se(super.decode(e)))}}class zb extends Sn{constructor(e,r){let n="bytes"+String(e);super(n,n,r,!1),this.size=e}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(e,r){let n=oe(r);return n.length!==this.size&&this._throwError("incorrect data length",r),e.writeBytes(n)}decode(e){return e.coerce(this.name,se(e.readBytes(this.size)))}}class qb extends Sn{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,r){return r!=null&&this._throwError("not null",r),e.writeBytes([])}decode(e){return e.readBytes(0),e.coerce(this.name,null)}}const jb="0x0000000000000000000000000000000000000000",Gb=J.from(-1),zp=J.from(0),Hb=J.from(1),Vb=J.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Kb="0x0000000000000000000000000000000000000000000000000000000000000000";class Wb extends Sn{constructor(e,r,n){const i=(r?"int":"uint")+e*8;super(i,i,n,!1),this.size=e,this.signed=r}defaultValue(){return 0}encode(e,r){let n=J.from(r),i=Vb.mask(e.wordSize*8);if(this.signed){let s=i.mask(this.size*8-1);(n.gt(s)||n.lt(s.add(Hb).mul(Gb)))&&this._throwError("value out-of-bounds",r)}else(n.lt(zp)||n.gt(i.mask(this.size*8)))&&this._throwError("value out-of-bounds",r);return n=n.toTwos(this.size*8).mask(this.size*8),this.signed&&(n=n.fromTwos(this.size*8).toTwos(8*e.wordSize)),e.writeValue(n)}decode(e){let r=e.readValue().mask(this.size*8);return this.signed&&(r=r.fromTwos(this.size*8)),e.coerce(this.name,r)}}const Qb="strings/5.8.0",qp=new $(Qb);var So;(function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"})(So||(So={}));var Zt;(function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"})(Zt||(Zt={}));function Jb(t,e,r,n,i){return qp.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)}function jp(t,e,r,n,i){if(t===Zt.BAD_PREFIX||t===Zt.UNEXPECTED_CONTINUE){let s=0;for(let o=e+1;o<r.length&&r[o]>>6===2;o++)s++;return s}return t===Zt.OVERRUN?r.length-e-1:0}function Yb(t,e,r,n,i){return t===Zt.OVERLONG?(n.push(i),0):(n.push(65533),jp(t,e,r))}const Zb=Object.freeze({error:Jb,ignore:jp,replace:Yb});function Gp(t,e){e==null&&(e=Zb.error),t=oe(t);const r=[];let n=0;for(;n<t.length;){const i=t[n++];if(!(i>>7)){r.push(i);continue}let s=null,o=null;if((i&224)===192)s=1,o=127;else if((i&240)===224)s=2,o=2047;else if((i&248)===240)s=3,o=65535;else{(i&192)===128?n+=e(Zt.UNEXPECTED_CONTINUE,n-1,t,r):n+=e(Zt.BAD_PREFIX,n-1,t,r);continue}if(n-1+s>=t.length){n+=e(Zt.OVERRUN,n-1,t,r);continue}let a=i&(1<<8-s-1)-1;for(let c=0;c<s;c++){let u=t[n];if((u&192)!=128){n+=e(Zt.MISSING_CONTINUE,n,t,r),a=null;break}a=a<<6|u&63,n++}if(a!==null){if(a>1114111){n+=e(Zt.OUT_OF_RANGE,n-1-s,t,r,a);continue}if(a>=55296&&a<=57343){n+=e(Zt.UTF16_SURROGATE,n-1-s,t,r,a);continue}if(a<=o){n+=e(Zt.OVERLONG,n-1-s,t,r,a);continue}r.push(a)}}return r}function tr(t,e=So.current){e!=So.current&&(qp.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n<t.length;n++){const i=t.charCodeAt(n);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);if(n>=t.length||(s&64512)!==56320)throw new Error("invalid utf-8 string");const o=65536+((i&1023)<<10)+(s&1023);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return oe(r)}function Xb(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function ua(t,e){return Xb(Gp(t,e))}function ew(t,e=So.current){return Gp(tr(t,e))}class tw extends Dp{constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,tr(r))}decode(e){return ua(super.decode(e))}}class Oa extends Sn{constructor(e,r){let n=!1;const i=[];e.forEach(o=>{o.dynamic&&(n=!0),i.push(o.type)});const s="tuple("+i.join(",")+")";super("tuple",s,r,n),this.coders=e}defaultValue(){const e=[];
24this.coders.forEach(n=>{e.push(n.defaultValue())});const r=this.coders.reduce((n,i)=>{const s=i.localName;return s&&(n[s]||(n[s]=0),n[s]++),n},{});return this.coders.forEach((n,i)=>{let s=n.localName;!s||r[s]!==1||(s==="length"&&(s="_length"),e[s]==null&&(e[s]=e[i]))}),Object.freeze(e)}encode(e,r){return Lp(e,this.coders,r)}decode(e){return e.coerce(this.name,Up(e,this.coders))}}const Fa=new $(ca),rw=new RegExp(/^bytes([0-9]*)$/),nw=new RegExp(/^(u?int)([0-9]*)$/);class iw{constructor(e){K(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new Fb(e.name);case"bool":return new Ub(e.name);case"string":return new tw(e.name);case"bytes":return new Db(e.name);case"array":return new Lb(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new Oa((e.components||[]).map(n=>this._getCoder(n)),e.name);case"":return new qb(e.name)}let r=e.type.match(nw);if(r){let n=parseInt(r[2]||"256");return(n===0||n>256||n%8!==0)&&Fa.throwArgumentError("invalid "+r[1]+" bit length","param",e),new Wb(n/8,r[1]==="int",e.name)}if(r=e.type.match(rw),r){let n=parseInt(r[1]);return(n===0||n>32)&&Fa.throwArgumentError("invalid bytes length","param",e),new zb(n,e.name)}return Fa.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,r){return new ac(e,this._getWordSize(),this.coerceFunc,r)}_getWriter(){return new Sf(this._getWordSize())}getDefaultValue(e){const r=e.map(i=>this._getCoder(yt.from(i)));return new Oa(r,"_").defaultValue()}encode(e,r){e.length!==r.length&&Fa.throwError("types/values length mismatch",$.errors.INVALID_ARGUMENT,{count:{types:e.length,values:r.length},value:{types:e,values:r}});const n=e.map(o=>this._getCoder(yt.from(o))),i=new Oa(n,"_"),s=this._getWriter();return i.encode(s,r),s.data}decode(e,r,n){const i=e.map(o=>this._getCoder(yt.from(o)));return new Oa(i,"_").decode(this._getReader(oe(r),n))}}const sw=new iw;function is(t){return ht(tr(t))}const Hp="hash/5.8.0";function Vp(t){t=atob(t);const e=[];for(let r=0;r<t.length;r++)e.push(t.charCodeAt(r));return oe(e)}function Kp(t){t=oe(t);let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function Wp(t,e){e==null&&(e=1);const r=[],n=r.forEach,i=function(s,o){n.call(s,function(a){o>0&&Array.isArray(a)?i(a,o-1):r.push(a)})};return i(t,e),r}function ow(t){const e={};for(let r=0;r<t.length;r++){const n=t[r];e[n[0]]=n[1]}return e}function aw(t){let e=0;function r(){return t[e++]<<8|t[e++]}let n=r(),i=1,s=[0,1];for(let M=1;M<n;M++)s.push(i+=r());let o=r(),a=e;e+=o;let c=0,u=0;function f(){return c==0&&(u=u<<8|t[e++],c=8),u>>--c&1}const d=31,m=Math.pow(2,d),g=m>>>1,w=g>>1,A=m-1;let k=0;for(let M=0;M<d;M++)k=k<<1|f();let _=[],B=0,T=m;for(;;){let M=Math.floor(((k-B+1)*i-1)/T),O=0,F=n;for(;F-O>1;){let D=O+F>>>1;M<s[D]?F=D:O=D}if(O==0)break;_.push(O);let L=B+Math.floor(T*s[O]/i),z=B+Math.floor(T*s[O+1]/i)-1;for(;!((L^z)&g);)k=k<<1&A|f(),L=L<<1&A,z=z<<1&A|1;for(;L&~z&w;)k=k&g|k<<1&A>>>1|f(),L=L<<1^g,z=(z^g)<<1|g|1;B=L,T=1+z-L}let N=n-4;return _.map(M=>{switch(M-N){case 3:return N+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return N+256+(t[a++]<<8|t[a++]);case 1:return N+t[a++];default:return M-1}})}function cw(t){let e=0;return()=>t[e++]}function uw(t){return cw(aw(t))}function fw(t){return t&1?~t>>1:t>>1}function lw(t,e){let r=Array(t);for(let n=0;n<t;n++)r[n]=1+e();return r}function md(t,e){let r=Array(t);for(let n=0,i=-1;n<t;n++)r[n]=i+=1+e();return r}function dw(t,e){let r=Array(t);for(let n=0,i=0;n<t;n++)r[n]=i+=fw(e());return r}function cc(t,e){let r=md(t(),t),n=t(),i=md(n,t),s=lw(n,t);for(let o=0;o<n;o++)for(let a=0;a<s[o];a++)r.push(i[o]+a);return e?r.map(o=>e[o]):r}function hw(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(mw(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(gw(r,t))}return ow(Wp(e))}function pw(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(r)}return e}function Qp(t,e,r){let n=Array(t).fill(void 0).map(()=>[]);for(let i=0;i<e;i++)dw(t,r).forEach((s,o)=>n[o].push(s));return n}function mw(t,e){let r=1+e(),n=e(),i=pw(e),s=Qp(i.length,1+t,e);return Wp(s.map((o,a)=>{const c=o[0],u=o.slice(1);return Array(i[a]).fill(void 0).map((f,d)=>{let m=d*n;return[c+d*r,u.map(g=>g+m)]})}))}function gw(t,e){let r=1+e();return Qp(r,1+t,e).map(i=>[i[0],i.slice(1)])}function yw(t){let e=cc(t).sort((n,i)=>n-i);return r();function r(){let n=[];for(;;){let u=cc(t,e);if(u.length==0)break;n.push({set:new Set(u),node:r()})}n.sort((u,f)=>f.set.size-u.set.size);let i=t(),s=i%3;i=i/3|0;let o=!!(i&1);i>>=1;let a=i==1,c=i==2;return{branches:n,valid:s,fe0f:o,save:a,check:c}}}function bw(){return uw(Vp
vendor: 14,757 bytes, line 24
24("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=="))
24}const kc=bw(),ww=new Set(cc(kc)),vw=new Set(cc(kc)),xw=hw(kc),Aw=yw(kc),gd=45,yd=95;function Jp(t){return ew(t)}function Ew(t){return t.filter(e=>e!=65039)}function Yp(t){for(let e of t.split(".")){let r=Jp(e);try{for(let n=r.lastIndexOf(yd)-1;n>=0;n--)if(r[n]!==yd)throw new Error("underscore only allowed at start");if(r.length>=4&&r.every(n=>n<128)&&r[2]===gd&&r[3]===gd)throw new Error("invalid label extension")}catch(n){throw new Error(`Invalid label "${e}": ${n.message}`)}}return t}function Pw(t){return Yp(Sw(t,Ew))}function Sw(t,e){let r=Jp(t).reverse(),n=[];for(;r.length;){let i=Iw(r);if(i){n.push(...e(i));continue}let s=r.pop();if(ww.has(s)){n.push(s);continue}if(vw.has(s))continue;let o=xw[s];if(o){n.push(...o);continue}throw new Error(`Disallowed codepoint: 0x${s.toString(16).toUpperCase()}`)}return Yp(_w(String.fromCodePoint(...n)))}function _w(t){return t.normalize("NFC")}function Iw(t,e){var r;let n=Aw,i,s,o=[],a=t.length;for(;a;){let c=t[--a];if(n=(r=n.branches.find(u=>u.set.has(c)))===null||r===void 0?void 0:r.node,!n)break;if(n.save)s=c;else if(n.check&&c===s)break;o.push(c),n.fe0f&&(o.push(65039),a>0&&t[a-1]==65039&&a--),n.valid&&(i=o.slice(),n.valid==2&&i.splice(1,1),t.length=a)}return i}const Nw=new $(Hp),Zp=new Uint8Array(32);Zp.fill(0);function bd(t){if(t.length===0)throw new Error("invalid ENS name; empty component");return t}function Xp(t){const e=tr(Pw(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i<e.length;i++)e[i]===46&&(r.push(bd(e.slice(n,i))),n=i+1);if(n>=e.length)throw new Error("invalid ENS name; empty component");return r.push(bd(e.slice(n))),r}function Ya(t){typeof t!="string"&&Nw.throwArgumentError("invalid ENS name; not a string","name",t);let e=Zp;const r=Xp(t);for(;r.length;)e=ht(jt([e,ht(r.pop())]));return se(e)}function kw(t){return se(jt(Xp(t).map(e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const r=new Uint8Array(e.length+1);return r.set(e,1),r[0]=r.length-1,r})))+"00"}const Mw=`�Ethereum Signed Message:
25`;function Tw(t){return typeof t=="string"&&(t=tr(t)),ht(jt([tr(Mw),tr(String(t.length)),t]))}var Rw=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(d){o(d)}}function c(f){try{u(n.throw(f))}catch(d){o(d)}}function u(f){f.done?s(f.value):i(f.value).then(a,c)}u((n=n.apply(t,e||[])).next())})};const st=new $(Hp),em=new Uint8Array(32);em.fill(0);const Cw=J.from(-1),tm=J.from(0),rm=J.from(1),Bw=J.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function Ow(t){const e=oe(t),r=e.length%32;return r?qt([e,em.slice(r)]):se(e)}const Fw=nt(rm.toHexString(),32),$w=nt(tm.toHexString(),32),wd={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Iu=["name","version","chainId","verifyingContract","salt"];function vd(t){return function(e){return typeof e!="string"&&st.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const Lw={name:vd("name"),version:vd("version"),chainId:function(t){try{return J.from(t).toString()}catch{}return st.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return Et(t).toLowerCase()}catch{}return st.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=oe(t);if(e.length!==32)throw new Error("bad length");return se(e)}catch{}return st.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function Nu(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=e[1]==="",n=parseInt(e[2]||"256");(n%8!==0||n>256||e[2]&&e[2]!==String(n))&&st.throwArgumentError("invalid numeric width","type",t);const i=Bw.mask(r?n-1:n),s=r?i.add(rm).mul(Cw):tm;return function(o){const a=J.from(o);return(a.lt(s)||a.gt(i))&&st.throwArgumentError(`value out-of-bounds for ${t}`,"value",o),nt(a.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(r===0||r>32||e[1]!==String(r))&&st.throwArgumentError("invalid bytes width","type",t),function(n){return oe(n).length!==r&&st.throwArgumentError(`invalid length for ${t}`,"value",n),Ow(n)}}}switch(t){case"address":return function(e){return nt(Et(e),32)};case"bool":return function(e){return e?Fw:$w};case"bytes":return function(e){return ht(e)};case"string":return function(e){return is(e)}}return null}function xd(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}
25class Yt{constructor(e){K(this,"types",Object.freeze(vn(e))),K(this,"_encoderCache",{}),K(this,"_types",{});const r={},n={},i={};Object.keys(e).forEach(a=>{r[a]={},n[a]=[],i[a]={}});for(const a in e){const c={};e[a].forEach(u=>{c[u.name]&&st.throwArgumentError(`duplicate variable name ${JSON.stringify(u.name)} in ${JSON.stringify(a)}`,"types",e),c[u.name]=!0;const f=u.type.match(/^([^\x5b]*)(\x5b|$)/)[1];f===a&&st.throwArgumentError(`circular type reference to ${JSON.stringify(f)}`,"types",e),!Nu(f)&&(n[f]||st.throwArgumentError(`unknown type ${JSON.stringify(f)}`,"types",e),n[f].push(a),r[a][f]=!0)})}const s=Object.keys(n).filter(a=>n[a].length===0);s.length===0?st.throwArgumentError("missing primary type","types",e):s.length>1&&st.throwArgumentError(`ambiguous primary types or unused types: ${s.map(a=>JSON.stringify(a)).join(", ")}`,"types",e),K(this,"primaryType",s[0]);function o(a,c){c[a]&&st.throwArgumentError(`circular type reference to ${JSON.stringify(a)}
25`,"types",e),c[a]=!0,Object.keys(r[a]).forEach(u=>{n[u]&&(o(u,c),Object.keys(c).forEach(f=>{i[f][u]=!0}))}),delete c[a]}o(this.primaryType,{});for(const a in i){const c=Object.keys(i[a]);c.sort(),this._types[a]=xd(a,e[a])+c.map(u=>xd(u,e[u])).join("")}}getEncoder(e){let r=this._encoderCache[e];return r||(r=this._encoderCache[e]=this._getEncoder(e)),r}_getEncoder(e){{const i=Nu(e);if(i)return i}const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const i=r[1],s=this.getEncoder(i),o=parseInt(r[3]);return a=>{o>=0&&a.length!==o&&st.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",a);let c=a.map(s);return this._types[i]&&(c=c.map(ht)),ht(qt(c))}}const n=this.types[e];if(n){const i=is(this._types[e]);return s=>{const o=n.map(({name:a,type:c})=>{const u=this.getEncoder(c)(s[a]);return this._types[c]?ht(u):u});return o.unshift(i),qt(o)}}return st.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const r=this._types[e];return r||st.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return ht(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(Nu(e))return n(e,r);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){const o=i[1],a=parseInt(i[3]);return a>=0&&r.length!==a&&st.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r),r.map(c=>this._visit(o,c,n))}const s=this.types[e];return s?s.reduce((o,{name:a,type:c})=>(o[a]=this._visit(c,r[a],n),o),{}):st.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new Yt(e)}static getPrimaryType(e){return Yt.from(e).primaryType}static hashStruct(e,r,n){return Yt.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){const i=wd[n];i||st.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>Iu.indexOf(n.name)-Iu.indexOf(i.name)),Yt.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return qt(["0x1901",Yt.hashDomain(e),Yt.from(r).hash(n)])}static hash(e,r,n){return ht(Yt.encode(e,r,n))}static resolveNames(e,r,n,i){return Rw(this,void 0,void 0,function*(){e=mt(e);const s={};e.verifyingContract&&!ve(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const o=Yt.from(r);o.visit(n,(a,c)=>(a==="address"&&!ve(c,20)&&(s[c]="0x"),c));for(const a in s)s[a]=yield i(a);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),n=o.visit(n,(a,c)=>a==="address"&&s[c]?s[c]:c),{domain:e,value:n}})}static getPayload(e,r,n){Yt.hashDomain(e);const i={},s=[];Iu.forEach(c=>{const u=e[c];u!=null&&(i[c]=Lw[c](u),s.push({name:c,type:wd[c]}))});const o=Yt.from(r),a=mt(r);return a.EIP712Domain?st.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):a.EIP712Domain=s,o.encode(n),{types:a,domain:i,primaryType:o.primaryType,message:o.visit(n,(c,u)=>{if(c.match(/^bytes(\d*)/))return se(oe(u));if(c.match(/^u?int/))return J.from(u).toString();switch(c){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return typeof u!="string"&&st.throwArgumentError("invalid string","value",u),u}return st.throwArgumentError("unsupported type","type",c)})}}}const it=new $(ca);class Uw extends aa{}class Dw extends aa{}class zw extends aa{}class _f extends aa{static isIndexed(e){return!!(e&&e._isIndexed)}}const qw={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function Ad(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}class Ed{constructor(e){let r=[];typeof e=="string"?r=JSON.parse(e):r=e,K(this,"fragments",r.map(n=>yn.from(n)).filter(n=>n!=null)),K(this,"_abiCoder",Hr(new.target,"getAbiCoder")()),K(this,"functions",{}),K(this,"errors",{}),K(this,"events",{}),K(this,"structs",{}
25),this.fragments.forEach(n=>{let i=null;switch(n.type){case"constructor":if(this.deploy){it.warn("duplicate definition - constructor");return}K(this,"deploy",n);return;case"function":i=this.functions;break;case"event":i=this.events;break;case"error":i=this.errors;break;default:return}let s=n.format();if(i[s]){it.warn("duplicate definition - "+s);return}i[s]=n}),this.deploy||K(this,"deploy",jr.from({payable:!1,type:"constructor"})),K(this,"_isInterface",!0)}format(e){e||(e=we.full),e===we.sighash&&it.throwArgumentError("interface does not support formatting sighash","format",e);const r=this.fragments.map(n=>n.format(e));return e===we.json?JSON.stringify(r.map(n=>JSON.parse(n))):r}static getAbiCoder(){return sw}static getAddress(e){return Et(e)}static getSighash(e){return It(is(e.format()),0,4)}static getEventTopic(e){return is(e.format())}getFunction(e){if(ve(e)){for(const n in this.functions)if(e===this.getSighash(n))return this.functions[n];it.throwArgumentError("no matching function","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.functions).filter(s=>s.split("(")[0]===n);return i.length===0?it.throwArgumentError("no matching function","name",n):i.length>1&&it.throwArgumentError("multiple matching functions","name",n),this.functions[i[0]]}const r=this.functions[Gr.fromString(e).format()];return r||it.throwArgumentError("no matching function","signature",e),r}getEvent(e){if(ve(e)){const n=e.toLowerCase();for(const i in this.events)if(n===this.getEventTopic(i))return this.events[i];it.throwArgumentError("no matching event","topichash",n)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.events).filter(s=>s.split("(")[0]===n);return i.length===0?it.throwArgumentError("no matching event","name",n):i.length>1&&it.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}const r=this.events[mn.fromString(e).format()];return r||it.throwArgumentError("no matching event","signature",e),r}getError(e){if(ve(e)){const n=Hr(this.constructor,"getSighash");for(const i in this.errors){const s=this.errors[i];if(e===n(s))return this.errors[i]}it.throwArgumentError("no matching error","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.errors).filter(s=>s.split("(")[0]===n);return i.length===0?it.throwArgumentError("no matching error","name",n):i.length>1&&it.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}const r=this.errors[Gr.fromString(e).format()];return r||it.throwArgumentError("no matching error","signature",e),r}getSighash(e){if(typeof e=="string")try{e=this.getFunction(e)}catch(r){try{e=this.getError(e)}catch{throw r}}return Hr(this.constructor,"getSighash")(e)}getEventTopic(e){return typeof e=="string"&&(e=this.getEvent(e)),Hr(this.constructor,"getEventTopic")(e)}_decodeParams(e,r){return this._abiCoder.decode(e,r)}_encodeParams(e,r){return this._abiCoder.encode(e,r)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,r){typeof e=="string"&&(e=this.getError(e));const n=oe(r);return se(n.slice(0,4))!==this.getSighash(e)&&it.throwArgumentError(`data signature does not match error ${e.name}.`,"data",se(n)),this._decodeParams(e.inputs,n.slice(4))}encodeErrorResult(e,r){return typeof e=="string"&&(e=this.getError(e)),se(jt([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionData(e,r){typeof e=="string"&&(e=this.getFunction(e));const n=oe(r);return se(n.slice(0,4))!==this.getSighash(e)&&it.throwArgumentError(`data signature does not match function ${e.name}.`,"data",se(n)),this._decodeParams(e.inputs,n.slice(4))}encodeFunctionData(e,r){return typeof e=="string"&&(e=this.getFunction(e)),se(jt([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionResult(e,r){typeof e=="string"&&(e=this.getFunction(e));let n=oe(r),i=null,s="",o=null,a=null,c=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,n)}catch{}break;case 4:{const u=se(n.slice(0,4)),f=qw[u];if(f)o=this._abiCoder.decode(f.inputs,n.slice(4)),a=f.name,c=f.signature,f.reason&&(i=o[0]),a==="Error"?s=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:a==="Panic"&&(s=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const d=this.getError(u);o=this._abiCoder.decode(d.inputs,n.slice(4)),a=d.name,c=d.format()}catch{}break}}return it.throwError("call revert exception"+s,$.errors.CALL_EXCEPTION,{method:e.format(),data:se(r),errorArgs:o,errorName:a,errorSignature:c,reason:i})}encodeFunctionResult(e,r){return typeof e=="string"&&(e=this.getFunction(e)),se(this._abiCoder.encode(e.outputs,r||[]))}encodeFilterTopics(e,r){typeof e=="string"&&(e=this.getEvent(e)),r.length>
25e.inputs.length&&it.throwError("too many arguments for "+e.format(),$.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:r});let n=[];e.anonymous||n.push(this.getEventTopic(e));const i=(s,o)=>s.type==="string"?is(o):s.type==="bytes"?ht(se(o)):(s.type==="bool"&&typeof o=="boolean"&&(o=o?"0x01":"0x00"),s.type.match(/^u?int/)&&(o=J.from(o).toHexString()),s.type==="address"&&this._abiCoder.encode(["address"],[o]),nt(se(o),32));for(r.forEach((s,o)=>{let a=e.inputs[o];if(!a.indexed){s!=null&&it.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+a.name,s);return}s==null?n.push(null):a.baseType==="array"||a.baseType==="tuple"?it.throwArgumentError("filtering with tuples or arrays not supported","contract."+a.name,s):Array.isArray(s)?n.push(s.map(c=>i(a,c))):n.push(i(a,s))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){typeof e=="string"&&(e=this.getEvent(e));const n=[],i=[],s=[];return e.anonymous||n.push(this.getEventTopic(e)),r.length!==e.inputs.length&&it.throwArgumentError("event arguments/values mismatch","values",r),e.inputs.forEach((o,a)=>{const c=r[a];if(o.indexed)if(o.type==="string")n.push(is(c));else if(o.type==="bytes")n.push(ht(c));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");n.push(this._abiCoder.encode([o.type],[c]))}else i.push(o),s.push(c)}),{data:this._abiCoder.encode(i,s),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"&&(e=this.getEvent(e)),n!=null&&!e.anonymous){let m=this.getEventTopic(e);(!ve(n[0],32)||n[0].toLowerCase()!==m)&&it.throwError("fragment/topic mismatch",$.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:m,value:n[0]}),n=n.slice(1)}let i=[],s=[],o=[];e.inputs.forEach((m,g)=>{m.indexed?m.type==="string"||m.type==="bytes"||m.baseType==="tuple"||m.baseType==="array"?(i.push(yt.fromObject({type:"bytes32",name:m.name})),o.push(!0)):(i.push(m),o.push(!1)):(s.push(m),o.push(!1))});let a=n!=null?this._abiCoder.decode(i,jt(n)):null,c=this._abiCoder.decode(s,r,!0),u=[],f=0,d=0;e.inputs.forEach((m,g)=>{if(m.indexed)if(a==null)u[g]=new _f({_isIndexed:!0,hash:null});else if(o[g])u[g]=new _f({_isIndexed:!0,hash:a[d++]});else try{u[g]=a[d++]}catch(w){u[g]=w}else try{u[g]=c[f++]}catch(w){u[g]=w}
25if(m.name&&u[m.name]==null){const w=u[g];w instanceof Error?Object.defineProperty(u,m.name,{enumerable:!0,get:()=>{throw Ad(`property ${JSON.stringify(m.name)}`,w)}}):u[m.name]=w}});for(let m=0;m<u.length;m++){const g=u[m];g instanceof Error&&Object.defineProperty(u,m,{enumerable:!0,get:()=>{throw Ad(`index ${m}`,g)}})}return Object.freeze(u)}parseTransaction(e){let r=this.getFunction(e.data.substring(0,10).toLowerCase());return r?new Dw({args:this._abiCoder.decode(r.inputs,"0x"+e.data.substring(10)),functionFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r),value:J.from(e.value||"0")}):null}parseLog(e){let r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new Uw({eventFragment:r,name:r.name,signature:r.format(),topic:this.getEventTopic(r),args:this.decodeEventLog(r,e.data,e.topics)})}parseError(e){const r=se(e);let n=this.getError(r.substring(0,10).toLowerCase());return n?new zw({args:this._abiCoder.decode(n.inputs,"0x"+r.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(e){return!!(e&&e._isInterface)}}const jw="abstract-provider/5.8.0";var Gw=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(d){o(d)}}function c(f){try{u(n.throw(f))}catch(d){o(d)}}function u(f){f.done?s(f.value):i(f.value).then(a,c)}u((n=n.apply(t,e||[])).next())})};const Hw=new $(jw);class Vw extends aa{static isForkEvent(e){return!!(e&&e._isForkEvent)}}class Mc{constructor(){Hw.checkAbstract(new.target,Mc),K(this,"_isProvider",!0)}getFeeData(){return Gw(this,void 0,void 0,function*(){const{block:e,gasPrice:r}=yield lt({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(o=>null)});let n=null,i=null,s=null;return e&&e.baseFeePerGas&&(n=e.baseFeePerGas,s=J.from("1500000000"),i=e.baseFeePerGas.mul(2).add(s)),{lastBaseFeePerGas:n,maxFeePerGas:i,maxPriorityFeePerGas:s,gasPrice:r}})}addListener(e,r){return this.on(e,r)}removeListener(e,r){return this.off(e,r)}static isProvider(e){return!!(e&&e._isProvider)}}const Kw="abstract-signer/5.8.0";var gr=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(d){o(d)}}function c(f){try{u(n.throw(f))}catch(d){o(d)}}function u(f){f.done?s(f.value):i(f.value).then(a,c)}u((n=n.apply(t,e||[])).next())})};const ar=new $(Kw),Ww=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],Qw=[$.errors.INSUFFICIENT_FUNDS,$.errors.NONCE_EXPIRED,$.errors.REPLACEMENT_UNDERPRICED];class fa{constructor(){ar.checkAbstract(new.target,fa),K(this,"_isSigner",!0)}getBalance(e){return gr(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return gr(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return gr(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const r=yield lt(this.checkTransaction(e));return yield this.provider.estimateGas(r)})}call(e,r){return gr(this,void 0,void 0,function*(){this._checkProvider("call");const n=yield lt(this.checkTransaction(e));return yield this.provider.call(n,r)})}sendTransaction(e){return gr(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const r=yield this.populateTransaction(e),n=yield this.signTransaction(r);return yield this.provider.sendTransaction(n)})}getChainId(){return gr(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return gr(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return gr(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return gr(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(const n in e)Ww.indexOf(n)===-1&&ar.throwArgumentError("invalid transaction key: "+n,"transaction",e);const r=mt(e);return r.from==null?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then(n=>(n[0].toLowerCase()!==n[1].toLowerCase()&&ar.throwArgumentError("from address mismatch","transaction",e),n[0])),r}populateTransaction(e){return gr(this,void 0,void 0,function*(){const r=yield lt(this.checkTransaction(e));r.to!=null&&(r.to=Promise.resolve(r.to).then(i=>gr(this,void 0,void 0,function*(){if(i==null)return null;const s=yield this.resolveName(i);return s==null&&ar.throwArgumentError("provided ENS name resolves to null","tx.to",i),s})),r.to.catch(i=>{}));const n=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||n)?ar.throwArgumentError("eip-1559 transaction do n
25ot support gasPrice","transaction",e):(r.type===0||r.type===1)&&n&&ar.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1)r.gasPrice==null&&(r.gasPrice=this.getGasPrice());else{const i=yield this.getFeeData();if(r.type==null)if(i.maxFeePerGas!=null&&i.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const s=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=s,r.maxPriorityFeePerGas=s}else r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas);else i.gasPrice!=null?(n&&ar.throwError("network does not support EIP-1559",$.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=i.gasPrice),r.type=0):ar.throwError("failed to get consistent fee data",$.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas))}return r.nonce==null&&(r.nonce=this.getTransactionCount("pending")),r.gasLim
25it==null&&(r.gasLimit=this.estimateGas(r).catch(i=>{if(Qw.indexOf(i.code)>=0)throw i;return ar.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",$.errors.UNPREDICTABLE_GAS_LIMIT,{error:i,tx:r})})),r.chainId==null?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then(i=>(i[1]!==0&&i[0]!==i[1]&&ar.throwArgumentError("chainId address mismatch","transaction",e),i[0])),yield lt(r)})}_checkProvider(e){this.provider||ar.throwError("missing provider",$.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}}class Ol extends fa{constructor(e,r){super(),K(this,"address",e),K(this,"provider",r||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,r){return Promise.resolve().then(()=>{ar.throwError(e,$.errors.UNSUPPORTED_OPERATION,{operation:r})})}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,r,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new Ol(this.address,e)}}var nm={},me={},la=im;function im(t,e){if(!t)throw new Error(e||"Assertion failed")}im.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var If={exports:{}};typeof Object.create=="function"?If.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:If.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var Jw=If.exports,Yw=la,Zw=Jw;me.inherits=Zw;function Xw(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function ev(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(var n=0,i=0;i<t.length;i++){var s=t.charCodeAt(i);s<128?r[n++]=s:s<2048?(r[n++]=s>>6|192,r[n++]=s&63|128):Xw(t,i)?(s=65536+((s&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=s&63|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=s&63|128)}else for(i=0;i<t.length;i++)r[i]=t[i]|0;return r}me.toArray=ev;function tv(t){for(var e="",r=0;r<t.length;r++)e+=om(t[r].toString(16));return e}me.toHex=tv;function sm(t){var e=t>>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}me.htonl=sm;function rv(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];e==="little"&&(i=sm(i)),r+=am(i.toString(16))}return r}me.toHex32=rv;function om(t){return t.length===1?"0"+t:t}me.zero2=om;function am(t){return t.length===7?"0"+t:t.length===6?"00"+t:t.length===5?"000"+t:t.length===4?"0000"+t:t.length===3?"00000"+t:t.length===2?"000000"+t:t.length===1?"0000000"+t:t}me.zero8=am;function nv(t,e,r,n){var i=r-e;Yw(i%4===0);for(var s=new Array(i/4),o=0,a=e;o<s.length;o++,a+=4){var c;n==="big"?c=t[a]<<24|t[a+1]<<16|t[a+2]<<8|t[a+3]:c=t[a+3]<<24|t[a+2]<<16|t[a+1]<<8|t[a],s[o]=c>>>0}return s}me.join32=nv;function iv(t,e){for(var r=new Array(t.length*4),n=0,i=0;n<t.length;n++,i+=4){var s=t[n];e==="big"?(r[i]=s>>>24,r[i+1]=s>>>16&255,r[i+2]=s>>>8&255,r[i+3]=s&255):(r[i+3]=s>>>24,r[i+2]=s>>>16&255,r[i+1]=s>>>8&255,r[i]=s&255)}return r}me.split32=iv;function sv(t,e){return t>>>e|t<<32-e}me.rotr32=sv;function ov(t,e){return t<<e|t>>>32-e}me.rotl32=ov;function av(t,e){return t+e>>>0}me.sum32=av;function cv(t,e,r){return t+e+r>>>0}me.sum32_3=cv;function uv(t,e,r,n){return t+e+r+n>>>0}me.sum32_4=uv;function fv(t,e,r,n,i){return t+e+r+n+i>>>0}me.sum32_5=fv;function lv(t,e,r,n){var i=t[e],s=t[e+1],o=n+s>>>0,a=(o<n?1:0)+r+i;t[e]=a>>>0,t[e+1]=o}me.sum64=lv;function dv(t,e,r,n){var i=e+n>>>0,s=(i<e?1:0)+t+r;return s>>>0}me.sum64_hi=dv;function hv(t,e,r,n){var i=e+n;return i>>>0}me.sum64_lo=hv;function pv(t,e,r,n,i,s,o,a){var c=0,u=e;u=u+n>>>0,c+=u<e?1:0,u=u+s>>>0,c+=u<s?1:0,u=u+a>>>0,c+=u<a?1:0;var f=t+r+i+o+c;return f>>>0}
25me.sum64_4_hi=pv;function mv(t,e,r,n,i,s,o,a){var c=e+n+s+a;return c>>>0}me.sum64_4_lo=mv;function gv(t,e,r,n,i,s,o,a,c,u){var f=0,d=e;d=d+n>>>0,f+=d<e?1:0,d=d+s>>>0,f+=d<s?1:0,d=d+a>>>0,f+=d<a?1:0,d=d+u>>>0,f+=d<u?1:0;var m=t+r+i+o+c+f;return m>>>0}me.sum64_5_hi=gv;function yv(t,e,r,n,i,s,o,a,c,u){var f=e+n+s+a+u;return f>>>0}me.sum64_5_lo=yv;function bv(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}me.rotr64_hi=bv;function wv(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}me.rotr64_lo=wv;function vv(t,e,r){return t>>>r}me.shr64_hi=vv;function xv(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}me.shr64_lo=xv;var Vs={},Pd=me,Av=la;function Tc(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Vs.BlockHash=Tc;Tc.prototype.update=function(e,r){if(e=Pd.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var n=e.length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=Pd.join32(e,0,e.length-n,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this};Tc.prototype.digest=function(e){return this.update(this._pad()),Av(this.pending===null),this._digest(e)};Tc.prototype._pad=function(){var e=this.pendingTotal,r=this._delta8,n=r-(e+this.padLength)%r,i=new Array(n+this.padLength);i[0]=128;for(var s=1;s<n;s++)i[s]=0;if(e<<=3,this.endian==="big"){for(var o=8;o<this.padLength;o++)i[s++]=0;i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=e>>>24&255,i[s++]=e>>>16&255,i[s++]=e>>>8&255,i[s++]=e&255}else for(i[s++]=e&255,i[s++]=e>>>8&255,i[s++]=e>>>16&255,i[s++]=e>>>24&255,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,o=8;o<this.padLength;o++)i[s++]=0;return i};var Ks={},nn={},Ev=me,Vr=Ev.rotr32;function Pv(t,e,r,n){if(t===0)return cm(e,r,n);if(t===1||t===3)return fm(e,r,n);if(t===2)return um(e,r,n)}nn.ft_1=Pv;function cm(t,e,r){return t&e^~t&r}nn.ch32=cm;function um(t,e,r){return t&e^t&r^e&r}nn.maj32=um;function fm(t,e,r){return t^e^r}nn.p32=fm;function Sv(t){return Vr(t,2)^Vr(t,13)^Vr(t,22)}nn.s0_256=Sv;function _v(t){return Vr(t,6)^Vr(t,11)^Vr(t,25)}nn.s1_256=_v;function Iv(t){return Vr(t,7)^Vr(t,18)^t>>>3}nn.g0_256=Iv;function Nv(t){return Vr(t,17)^Vr(t,19)^t>>>10}nn.g1_256=Nv;var Ts=me,kv=Vs,Mv=nn,ku=Ts.rotl32,so=Ts.sum32,Tv=Ts.sum32_5,Rv=Mv.ft_1,lm=kv.BlockHash,Cv=[1518500249,1859775393,2400959708,3395469782];function Jr(){if(!(this instanceof Jr))return new Jr;lm.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Ts.inherits(Jr,lm);var Bv=Jr;Jr.blockSize=512;Jr.outSize=160;Jr.hmacStrength=80;Jr.padLength=64;Jr.prototype._update=function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;i<n.length;i++)n[i]=ku(n[i-3]^n[i-8]^n[i-14]^n[i-16],1);var s=this.h[0],o=this.h[1],a=this.h[2],c=this.h[3],u=this.h[4];for(i=0;i<n.length;i++){var f=~~(i/20),d=Tv(ku(s,5),Rv(f,o,a,c),u,n[i],Cv[f]);u=c,c=a,a=ku(o,30),o=s,s=d}this.h[0]=so(this.h[0],s),this.h[1]=so(this.h[1],o),this.h[2]=so(this.h[2],a),this.h[3]=so(this.h[3],c),this.h[4]=so(this.h[4],u)};Jr.prototype._digest=function(e){return e==="hex"?Ts.toHex32(this.h,"big"):Ts.split32(this.h,"big")};var Rs=me,Ov=Vs,Ws=nn,Fv=la,yr=Rs.sum32,$v=Rs.sum32_4,Lv=Rs.sum32_5,Uv=Ws.ch32,Dv=Ws.maj32,zv=Ws.s0_256,qv=Ws.s1_256,jv=Ws.g0_256,Gv=Ws.g1_256,dm=Ov.BlockHash,Hv=[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: 3,262 bytes, line 25
25734187,3204031479,3329325298];function Yr(){if(!(this instanceof Yr))return new Yr;dm.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=Hv,this.W=new Array(64)}Rs.inherits(Yr,dm);var hm=Yr;Yr.blockSize=512;Yr.outSize=256;Yr.hmacStrength=192;Yr.padLength=64;Yr.prototype._update=function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;i<n.length;i++)n[i]=$v(Gv(n[i-2]),n[i-7],jv(n[i-15]),n[i-16]);var s=this.h[0],o=this.h[1],a=this.h[2],c=this.h[3],u=this.h[4],f=this.h[5],d=this.h[6],m=this.h[7];for(Fv(this.k.length===n.length),i=0;i<n.length;i++){var g=Lv(m,qv(u),Uv(u,f,d),this.k[i],n[i]),w=yr(zv(s),Dv(s,o,a));m=d,d=f,f=u,u=yr(c,g),c=a,a=o,o=s,s=yr(g,w)}this.h[0]=yr(this.h[0],s),this.h[1]=yr(this.h[1],o),this.h[2]=yr(this.h[2],a),this.h[3]=yr(this.h[3],c),this.h[4]=yr(this.h[4],u),this.h[5]=yr(this.h[5],f),this.h[6]=yr(this.h[6],d),this.h[7]=yr(this.h[7],m)};Yr.prototype._digest=function(e){return e==="hex"?Rs.toHex32(this.h,"big"):Rs.split32(this.h,"big")};var Nf=me,pm=hm;function xn(){if(!(this instanceof xn))return new xn;pm.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Nf.inherits(xn,pm);var Vv=xn;xn.blockSize=512;xn.outSize=224;xn.hmacStrength=192;xn.padLength=64;xn.prototype._digest=function(e){return e==="hex"?Nf.toHex32(this.h.slice(0,7),"big"):Nf.split32(this.h.slice(0,7),"big")};var Kt=me,Kv=Vs,Wv=la,Kr=Kt.rotr64_hi,Wr=Kt.rotr64_lo,mm=Kt.shr64_hi,gm=Kt.shr64_lo,On=Kt.sum64,Mu=Kt.sum64_hi,Tu=Kt.sum64_lo,Qv=Kt.sum64_4_hi,Jv=Kt.sum64_4_lo,Yv=Kt.sum64_5_hi,Zv=Kt.sum64_5_lo,ym=Kv.BlockHash,Xv=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,
251126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Ir(){if(!(this instanceof Ir))return new Ir;ym.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=Xv,this.W=new Array(160)}Kt.inherits(Ir,ym);var bm=Ir;Ir.blockSize=1024;Ir.outSize=512;Ir.hmacStrength=192;Ir.padLength=128;Ir.prototype._prepareBlock=function(e,r){for(var n=this.W,i=0;i<32;i++)n[i]=e[r+i];for(;i<n.length;i+=2){var s=f6(n[i-4],n[i-3]),o=l6(n[i-4],n[i-3]),a=n[i-14],c=n[i-13],u=c6(n[i-30],n[i-29]),f=u6(n[i-30],n[i-29]),d=n[i-32],m=n[i-31];n[i]=Qv(s,o,a,c,u,f,d,m),n[i+1]=Jv(s,o,a,c,u,f,d,m)}};Ir.prototype._update=function(e,r){this._prepareBlock(e,r);var n=this.W,i=this.h[0],s=this.h[1],o=this.h[2],a=this.h[3],c=this.h[4],u=this.h[5],f=this.h[6],d=this.h[7],m=this.h[8],g=this.h[9],w=this.h[10],A=this.h[11],k=this.h[12],_=this.h[13],B=this.h[14],T=this.h[15];Wv(this.k.length===n.length);for(var N=0;N<n.length;N+=2){var M=B,O=T,F=o6(m,g),L=a6(m,g),z=e6(m,g,w,A,k),D=t6(m,g,w,A,k,_),j=this.k[N],Q=this.k[N+1],E=n[N],l=n[N+1],p=Yv(M,O,F,L,z,D,j,Q,E,l),b=Zv(M,O,F,L,z,D,j,Q,E,l);M=i6(i,s),O=s6(i,s),F=r6(i,s,o,a,c),L=n6(i,s,o,a,c,u);var x=Mu(M,O,F,L),v=Tu(M,O,F,L);B=k,T=_,k=w,_=A,w=m,A=g,m=Mu(f,d,p,b),g=Tu(d,d,p,b),f=c,d=u,c=o,u=a,o=i,a=s,i=Mu(p,b,x,v),s=Tu(p,b,x,v)}On(this.h,0,i,s),On(this.h,2,o,a),On(this.h,4,c,u),On(this.h,6,f,d),On(this.h,8,m,g),On(this.h,10,w,A),On(this.h,12,k,_),On(this.h,14,B,T)};Ir.prototype._digest=function(e){return e==="hex"?Kt.toHex32(this.h,"big"):Kt.split32(this.h,"big")};function e6(t,e,r,n,i){var s=t&r^~t&i;return s<0&&(s+=4294967296),s}function t6(t,e,r,n,i,s){var o=e&n^~e&s;return o<0&&(o+=4294967296),o}function r6(t,e,r,n,i){var s=t&r^t&i^r&i;return s<0&&(s+=4294967296),s}function n6(t,e,r,n,i,s){var o=e&n^e&s^n&s;return o<0&&(o+=4294967296),o}function i6(t,e){var r=Kr(t,e,28),n=Kr(e,t,2),i=Kr(e,t,7),s=r^n^i;return s<0&&(s+=4294967296),s}function s6(t,e){var r=Wr(t,e,28),n=Wr(e,t,2),i=Wr(e,t,7),s=r^n^i;return s<0&&(s+=4294967296),s}function o6(t,e){var r=Kr(t,e,14),n=Kr(t,e,18),i=Kr(e,t,9),s=r^n^i;return s<0&&(s+=4294967296),s}function a6(t,e){var r=Wr(t,e,14),n=Wr(t,e,18),i=Wr(e,t,9),s=r^n^i;return s<0&&(s+=4294967296),s}function c6(t,e){var r=Kr(t,e,1),n=Kr(t,e,8),i=mm(t,e,7),s=r^n^i;return s<0&&(s+=4294967296),s}function u6(t,e){var r=Wr(t,e,1),n=Wr(t,e,8),i=gm(t,e,7),s=r^n^i;return s<0&&(s+=4294967296),s}function f6(t,e){var r=Kr(t,e,19),n=Kr(e,t,29),i=mm(t,e,6),s=r^n^i;return s<0&&(s+=4294967296),s}function l6(t,e){var r=Wr(t,e,19),n=Wr(e,t,29),i=gm(t,e,6),s=r^n^i;return s<0&&(s+=4294967296),s}var kf=me,wm=bm;function An(){if(!(this instanceof An))return new An;wm.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}kf.inherits(An,wm);var d6=An;An.blockSize=1024;An.outSize=384;An.hmacStrength=192;An.padLength=128;An.prototype._digest=function(e){return e==="hex"?kf.toHex32(this.h.slice(0,12),"big"):kf.split32(this.h.slice(0,12),"big")};Ks.sha1=Bv;Ks.sha224=Vv;Ks.sha256=hm;Ks.sha384=d6;Ks.sha512=bm;var vm={},Li=me,h6=Vs,$a=Li.rotl32,Sd=Li.sum32,oo=Li.sum32_3,_d=Li.sum32_4,xm=h6.BlockHash;function Zr(){if(!(this instanceof Zr))return new Zr;xm.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}Li.inherits(Zr,xm);vm.ripemd160=Zr;Zr.blockSize=512;Zr.outSize=160;Zr.hmacStrength=192;Zr.padLength=64;Zr.prototype._update=function(e,r){for(var n=this.h[0],i=this.h[1],s=this.h[2],o=this.h[3],a=this.h[4],c=n,u=i,f=s,d=o,m=a,g=0;g<80;g++){var w=Sd($a(_d(n,Id(g,i,s,o),e[g6[g]+r],p6(g)),b6[g]),a);n=a,a=o,o=$a(s,10),s=i,i=w,w=Sd($a(_d(c,Id(79-g,u,f,d),e[y6[g]+r],m6(g)),w6[g]),m),c=m,m=d,d=$a(f,10),f=u,u=w}w=oo(this.h[1],s,d),this.h[1]=oo(this.h[2],o,m),this.h[2]=oo(this.h[3],a,c),this.h[3]=oo(this.h[4],n,u),this.h[4]=oo(this.h[0],i,f),this.h[0]=w};Zr.prototype._digest=function(e){return e==="hex"?Li.toHex32(this.h,"little"):Li.split32(this.h,"little")};function Id(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function p6(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function m6(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}var g6=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],y6=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],b6=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],w6=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],v6=me,x6=la;function Cs(t,e,r){if(!(this instanceof Cs))return new Cs(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(v6.toArray(e,r))}var A6=Cs;Cs.prototype._init=function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),x6(e.length<=this.blockSize);for(var r=e.length;r<this.blockSize;r++)e.push(0);for(r=0;r<e.length;r++)e[r]^=54;for(this.inner=new this.Hash().update(e),r=0;r<e.length;r++)e[r]^=106;this.outer=new this.Hash().update(e)};Cs.prototype.update=function(e,r){return this.inner.update(e,r),this};Cs.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)};(function(t){var e=t;e.utils=me,e.common=Vs,e.sha=Ks,e.ripemd=vm,e.hmac=A6,e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160})(nm);const $r=ia(nm);function Qs(t,e,r){return r={path:e,exports:{},require:function(n,i){return E6(n,i??r.path)}},t(r,r.exports),r.exports}function E6(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var Fl=Am;function Am(t,e){if(!t)throw new Error(e||"Assertion failed")}Am.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var Sr=Qs(function(t,e){var r=e;function n(o,a){if(Array.isArray(o))return o.slice();if(!o)return[];var c=[];if(typeof o!="string"){for(var u=0;u<o.length;u++)c[u]=o[u]|0;return c}if(a==="hex"){o=o.replace(/[^a-z0-9]+/ig,""),o.length%2!==0&&(o="0"+o);for(var u=0;u<o.length;u+=2)c.push(parseInt(o[u]+o[u+1],16))}else for(var u=0;u<o.length;
25u++){var f=o.charCodeAt(u),d=f>>8,m=f&255;d?c.push(d,m):c.push(m)}return c}r.toArray=n;function i(o){return o.length===1?"0"+o:o}r.zero2=i;function s(o){for(var a="",c=0;c<o.length;c++)a+=i(o[c].toString(16));return a}r.toHex=s,r.encode=function(a,c){return c==="hex"?s(a):a}}),ir=Qs(function(t,e){var r=e;r.assert=Fl,r.toArray=Sr.toArray,r.zero2=Sr.zero2,r.toHex=Sr.toHex,r.encode=Sr.encode;function n(c,u,f){var d=new Array(Math.max(c.bitLength(),f)+1),m;for(m=0;m<d.length;m+=1)d[m]=0;var g=1<<u+1,w=c.clone();for(m=0;m<d.length;m++){var A,k=w.andln(g-1);w.isOdd()?(k>(g>>1)-1?A=(g>>1)-k:A=k,w.isubn(A)):A=0,d[m]=A,w.iushrn(1)}return d}r.getNAF=n;function i(c,u){var f=[[],[]];c=c.clone(),u=u.clone();for(var d=0,m=0,g;c.cmpn(-d)>0||u.cmpn(-m)>0;){var w=c.andln(3)+d&3,A=u.andln(3)+m&3;w===3&&(w=-1),A===3&&(A=-1);var k;w&1?(g=c.andln(7)+d&7,(g===3||g===5)&&A===2?k=-w:k=w):k=0,f[0].push(k);var _;A&1?(g=u.andln(7)+m&7,(g===3||g===5)&&w===2?_=-A:_=A):_=0,f[1].push(_),2*d===k+1&&(d=1-d),2*m===_+1&&(m=1-m),c.iushrn(1),u.iushrn(1)}return f}r.getJSF=i;function s(c,u,f){var d="_"+u;c.prototype[u]=function(){return this[d]!==void 0?this[d]:this[d]=f.call(this)}}r.cachedProperty=s;function o(c){return typeof c=="string"?r.toArray(c,"hex"):c}r.parseBytes=o;function a(c){return new fe(c,"hex","le")}r.intFromLE=a}),uc=ir.getNAF,P6=ir.getJSF,fc=ir.assert;function ti(t,e){this.type=t,this.p=new fe(e.p,16),this.red=e.prime?fe.red(e.prime):fe.mont(this.p),this.zero=new fe(0).toRed(this.red),this.one=new fe(1).toRed(this.red),this.two=new fe(2).toRed(this.red),this.n=e.n&&new fe(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Wi=ti;ti.prototype.point=function(){throw new Error("Not implemented")};ti.prototype.validate=function(){throw new Error("Not implemented")};ti.prototype._fixedNafMul=function(e,r){fc(e.precomputed);var n=e._getDoubles(),i=uc(r,1,this._bitLength),s=(1<<n.step+1)-(n.step%2===0?2:1);s/=3;var o=[],a,c;for(a=0;a<i.length;a+=n.step){c=0;for(var u=a+n.step-1;u>=a;u--)c=(c<<1)+i[u];o.push(c)}for(var f=this.jpoint(null,null,null),d=this.jpoint(null,null,null),m=s;m>0;m--){for(a=0;a<o.length;a++)c=o[a],c===m?d=d.mixedAdd(n.points[a]):c===-m&&(d=d.mixedAdd(n.points[a].neg()));f=f.add(d)}return f.toP()};ti.prototype._wnafMul=function(e,r){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var s=i.points,o=uc(r,n,this._bitLength),a=this.jpoint(null,null,null),c=o.length-1;c>=0;c--){for(var u=0;c>=0&&o[c]===0;c--)u++;if(c>=0&&u++,a=a.dblp(u),c<0)break;var f=o[c];fc(f!==0),e.type==="affine"?f>0?a=a.mixedAdd(s[f-1>>1]):a=a.mixedAdd(s[-f-1>>1].neg()):f>0?a=a.add(s[f-1>>1]):a=a.add(s[-f-1>>1].neg())}return e.type==="affine"?a.toP():a};ti.prototype._wnafMulAdd=function(e,r,n,i,s){var o=this._wnafT1,a=this._wnafT2,c=this._wnafT3,u=0,f,d,m;for(f=0;f<i;f++){m=r[f];var g=m._getNAFPoints(e);o[f]=g.wnd,a[f]=g.points}for(f=i-1;f>=1;f-=2){var w=f-1,A=f;if(o[w]!==1||o[A]!==1){c[w]=uc(n[w],o[w],this._bitLength),c[A]=uc(n[A],o[A],this._bitLength),u=Math.max(c[w].length,u),u=Math.max(c[A].length,u);continue}var k=[r[w],null,null,r[A]];r[w].y.cmp(r[A].y)===0?(k[1]=r[w].add(r[A]),k[2]=r[w].toJ().mixedAdd(r[A].neg())):r[w].y.cmp(r[A].y.redNeg())===0?(k[1]=r[w].toJ().mixedAdd(r[A]),k[2]=r[w].add(r[A].neg())):(k[1]=r[w].toJ().mixedAdd(r[A]),k[2]=r[w].toJ().mixedAdd(r[A].neg()));var _=[-3,-1,-5,-7,0,7,5,1,3],B=P6(n[w],n[A]);for(u=Math.max(B[0].length,u),c[w]=new Array(u),c[A]=new Array(u),d=0;d<u;d++){var T=B[0][d]|0,N=B[1][d]|0;c[w][d]=_[(T+1)*3+(N+1)],c[A][d]=0,a[w]=k}}var M=this.jpoint(null,null,null),O=this._wnafT4;for(f=u;f>=0;f--){for(var F=0;f>=0;){var L=!0;for(d=0;d<i;d++)O[d]=c[d][f]|0,O[d]!==0&&(L=!1);if(!L)break;F++,f--}if(f>=0&&F++,M=M.dblp(F),f<0)break;for(d=0;d<i;d++){var z=O[d];z!==0&&(z>0?m=a[d][z-1>>1]:z<0&&(m=a[d][-z-1>>1].neg()),m.type==="affine"?M=M.mixedAdd(m):M=M.add(m))}}for(f=0;f<i;f++)a[f]=null;return s?M:M.toP()};
25function pr(t,e){this.curve=t,this.type=e,this.precomputed=null}ti.BasePoint=pr;pr.prototype.eq=function(){throw new Error("Not implemented")};pr.prototype.validate=function(){return this.curve.validate(this)};ti.prototype.decodePoint=function(e,r){e=ir.toArray(e,r);var n=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*n){e[0]===6?fc(e[e.length-1]%2===0):e[0]===7&&fc(e[e.length-1]%2===1);var i=this.point(e.slice(1,1+n),e.slice(1+n,1+2*n));return i}else if((e[0]===2||e[0]===3)&&e.length-1===n)return this.pointFromX(e.slice(1,1+n),e[0]===3);throw new Error("Unknown point format")};pr.prototype.encodeCompressed=function(e){return this.encode(e,!0)};pr.prototype._encode=function(e){var r=this.curve.p.byteLength(),n=this.getX().toArray("be",r);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",r))};pr.prototype.encode=function(e,r){return ir.encode(this._encode(r),e)};pr.prototype.precompute=function(e){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,e),r.beta=this._getBeta(),this.precomputed=r,this};pr.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return r?r.points.length>=Math.ceil((e.bitLength()+1)/r.step):!1};pr.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s<r;s+=e){for(var o=0;o<e;o++)i=i.dbl();n.push(i)}return{step:e,points:n}};pr.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var r=[this],n=(1<<e)-1,i=n===1?null:this.dbl(),s=1;s<n;s++)r[s]=r[s-1].add(i);return{wnd:e,points:r}};pr.prototype._getBeta=function(){return null};pr.prototype.dblp=function(e){for(var r=this,n=0;n<e;n++)r=r.dbl();return r};var $l=Qs(function(t){typeof Object.create=="function"?t.exports=function(r,n){n&&(r.super_=n,r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(r,n){if(n){r.super_=n;var i=function(){};i.prototype=n.prototype,r.prototype=new i,r.prototype.constructor=r}}}),S6=ir.assert;function mr(t){Wi.call(this,"short",t),this.a=new fe(t.a,16).toRed(this.red),this.b=new fe(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}$l(mr,Wi);var _6=mr;mr.prototype._getEndomorphism=function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,n;if(e.beta)r=new fe(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);r=i[0].cmp(i[1])<0?i[0]:i[1],r=r.toRed(this.red)}if(e.lambda)n=new fe(e.lambda,16);else{var s=this._getEndoRoots(this.n);this.g.mul(s[0]).x.cmp(this.g.x.redMul(r))===0?n=s[0]:(n=s[1],S6(this.g.mul(n).x.cmp(this.g.x.redMul(r))===0))}var o;return e.basis?o=e.basis.map(function(a){return{a:new fe(a.a,16),b:new fe(a.b,16)}}):o=this._getEndoBasis(n),{beta:r,lambda:n,basis:o}}};mr.prototype._getEndoRoots=function(e){var r=e===this.p?this.red:fe.mont(e),n=new fe(2).toRed(r).redInvm(),i=n.redNeg(),s=new fe(3).toRed(r).redNeg().redSqrt().redMul(n),o=i.redAdd(s).fromRed(),a=i.redSub(s).fromRed();return[o,a]};mr.prototype._getEndoBasis=function(e){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=e,i=this.n.clone(),s=new fe(1),o=new fe(0),a=new fe(0),c=new fe(1),u,f,d,m,g,w,A,k=0,_,B;n.cmpn(0)!==0;){var T=i.div(n);_=i.sub(T.mul(n)),B=a.sub(T.mul(s));var N=c.sub(T.mul(o));if(!d&&_.cmp(r)<0)u=A.neg(),f=s,d=_.neg(),m=B;else if(d&&++k===2)break;A=_,i=n,n=_,a=s,s=B,c=o,o=N}g=_.neg(),w=B;var M=d.sqr().add(m.sqr()),O=g.sqr().add(w.sqr());return O.cmp(M)>=0&&(g=u,w=f),d.negative&&(d=d.neg(),m=m.neg()),g.negative&&(g=g.neg(),w=w.neg()),[{a:d,b:m},{a:g,b:w}]};mr.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],s=i.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=s.mul(n.a),c=o.mul(i.a),u=s.mul(n.b),f=o.mul(i.b),d=e.sub(a).sub(c),m=u.add(f).neg();return{k1:d,k2:m}};mr.prototype.pointFromX=function(e,r){e=new fe(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(r&&!s||!r&&s)&&(i=i.redNeg()),this.point(e,i)};mr.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0};mr.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(r[o]),c=e[o],u=c._getBeta();a.k1.negative&&(a.k1.ineg(),c=c.neg(!0)),a.k2.negative&&(a.k2.ineg(),u=u.neg(!0)),i[o*2]=c,i[o*2+1]=u,s[o*2]=a.k1,s[o*2+1]=a.k2}for(var f=this._wnafMulAdd(1,i,s,o*2,n),d=0;d<o*2;
vendor: 8,303 bytes, line 25
25d++)i[d]=null,s[d]=null;return f};function vt(t,e,r,n){Wi.BasePoint.call(this,t,"affine"),e===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new fe(e,16),this.y=new fe(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)}$l(vt,Wi.BasePoint);mr.prototype.point=function(e,r,n){return new vt(this,e,r,n)};mr.prototype.pointFromJSON=function(e,r){return vt.fromJSON(this,e,r)};vt.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,i=function(s){return n.point(s.x.redMul(n.endo.beta),s.y)};e.beta=r,r.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(i)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(i)}}}return r}};vt.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]};vt.fromJSON=function(e,r,n){typeof r=="string"&&(r=JSON.parse(r));var i=e.point(r[0],r[1],n);if(!r[2])return i;function s(a){return e.point(a[0],a[1],n)}var o=r[2];return i.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[i].concat(o.doubles.points.map(s))},naf:o.naf&&{wnd:o.naf.wnd,points:[i].concat(o.naf.points.map(s))}},i};vt.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)+">"};vt.prototype.isInfinity=function(){return this.inf};vt.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};vt.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),o=s.redSqr().redISub(this.x.redAdd(this.x)),a=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)};vt.prototype.getX=function(){return this.x.fromRed()};vt.prototype.getY=function(){return this.y.fromRed()};vt.prototype.mul=function(e){return e=new fe(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)};vt.prototype.mulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)};vt.prototype.jmulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)};vt.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};vt.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(s){return s.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};vt.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function St(t,e,r,n){Wi.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new fe(0)):(this.x=new fe(e,16),this.y=new fe(r,16),this.z=new fe(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}$l(St,Wi.BasePoint);mr.prototype.jpoint=function(e,r,n){return new St(this,e,r,n)};St.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};St.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};St.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),s=e.x.redMul(n),o=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),c=i.redSub(s),u=o.redSub(a);if(c.cmpn(0)===0)return u.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var f=c.redSqr(),d=f.redMul(c),m=i.redMul(f),g=u.redSqr().redIAdd(d).redISub(m).redISub(m),w=u.redMul(m.redISub(g)).redISub(o.redMul(d)),A=this.z.redMul(e.z).redMul(c);return this.curve.jpoint(g,w,A)};St.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),s=this.y,o=e.y.redMul(r).redMul(this.z),a=n.redSub(i),c=s.redSub(o);if(a.cmpn(0)===0)return c.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),f=u.redMul(a),d=n.redMul(u),m=c.redSqr().redIAdd(f).redISub(d).redISub(d),g=c.redMul(d.redISub(m)).redISub(s.redMul(f)),w=this.z.redMul(a);return this.curve.jpoint(m,g,w)};St.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r<e;r++)n=n.dbl();return n}var i=this.curve.a,s=this.curve.tinv,o=this.x,a=this.y,c=this.z,u=c.redSqr().redSqr(),f=a.redAdd(a);for(r=0;r<e;r++){var d=o.redSqr(),m=f.redSqr(),g=m.redSqr(),w=d.redAdd(d).redIAdd(d).redIAdd(i.redMul(u)),A=o.redMul(m),k=w.redSqr().redISub(A.redAdd(A)),_=A.redISub(k),B=w.redMul(_);B=B.redIAdd(B).redISub(g);var T=f.redMul(c);r+1<e&&(u=u.redMul(g)),o=k,c=T,f=B}return this.curve.jpoint(o,f.redMul(s),c)};St.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};St.prototype._zeroDbl=function(){var e,r,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),o=s.redSqr(),a=this.x.redAdd(s).redSqr().redISub(i).redISub(o);a=a.redIAdd(a);var c=i.redAdd(i).redIAdd(i),u=c.redSqr().redISub(a).redISub(a),f=o.redIAdd(o);f=f.redIAdd(f),f=f.redIAdd(f),e=u,r=c.redMul(a.redISub(u)).redISub(f),n=this.y.redAdd(this.y)}else{var d=this.x.redSqr(),m=this.y.redSqr(),g=m.redSqr(),w=this.x.redAdd(m).redSqr().redISub(d).redISub(g);w=w.redIAdd(w);var A=d.redAdd(d).redIAdd(d),k=A.redSqr(),_=g.redIAdd(g);_=_.redIAdd(_),_=_.redIAdd(_),e=k.redISub(w).redISub(w),r=A.redMul(w.redISub(e)).redISub(_),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,r,n)};St.prototype._threeDbl=function(){var e,r,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),o=s.redSqr(),a=this.x.redAdd(s).redSqr().redISub(i).redISub(o);a=a.redIAdd(a);var c=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),u=c.redSqr().redISub(a).redISub(a);e=u;var f=o.redIAdd(o);f=f.redIAdd(f),f=f.redIAdd(f),r=c.redMul(a.redISub(u)).redISub(f),n=this.y.redAdd(this.y)}else{var d=this.z.redSqr(),m=this.y.redSqr(),g=this.x.redMul(m),w=this.x.redSub(d).redMul(this.x.redAdd(d));w=w.redAdd(w).redIAdd(w);var A=g.redIAdd(g);A=A.redIAdd(A);var k=A.redAdd(A);e=w.redSqr().redISub(k),n=this.y.redAdd(this.z).redSqr().redISub(m).redISub(d);var _=m.redSqr();_=_.redIAdd(_),_=_.redIAdd(_),_=_.redIAdd(_),r=w.redMul(A.redISub(e)).redISub(_)}return this.curve.jpoint(e,r,n)};St.prototype._dbl=function(){var e=this.curve.a,r=this.x,n=this.y,i=this.z,s=i.redSqr().redSqr(),o=r.redSqr(),a=n.redSqr(),c=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(s)),u=r.redAdd(r);u=u.redIAdd(u);var f=u.redMul(a),d=c.redSqr().redISub(f.redAdd(f)),m=f.redISub(d),g=a.redSqr();g=g.redIAdd(g),g=g.redIAdd(g),g=g.redIAdd(g);var w=c.redMul(m).redISub(g),A=n.redAdd(n).redMul(i);return this.curve.jpoint(d,w,A)};St.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);
25var e=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr(),i=r.redSqr(),s=e.redAdd(e).redIAdd(e),o=s.redSqr(),a=this.x.redAdd(r).redSqr().redISub(e).redISub(i);a=a.redIAdd(a),a=a.redAdd(a).redIAdd(a),a=a.redISub(o);var c=a.redSqr(),u=i.redIAdd(i);u=u.redIAdd(u),u=u.redIAdd(u),u=u.redIAdd(u);var f=s.redIAdd(a).redSqr().redISub(o).redISub(c).redISub(u),d=r.redMul(f);d=d.redIAdd(d),d=d.redIAdd(d);var m=this.x.redMul(c).redISub(d);m=m.redIAdd(m),m=m.redIAdd(m);var g=this.y.redMul(f.redMul(u.redISub(f)).redISub(a.redMul(c)));g=g.redIAdd(g),g=g.redIAdd(g),g=g.redIAdd(g);var w=this.z.redAdd(a).redSqr().redISub(n).redISub(c);return this.curve.jpoint(m,g,w)};St.prototype.mul=function(e,r){return e=new fe(e,r),this.curve._wnafMul(this,e)};St.prototype.eq=function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var r=this.z.redSqr(),n=e.z.redSqr();if(this.x.redMul(n).redISub(e.x.redMul(r)).cmpn(0)!==0)return!1;var i=r.redMul(this.z),s=n.redMul(e.z);return this.y.redMul(s).redISub(e.y.redMul(i)).cmpn(0)===0};St.prototype.eqXToP=function(e){var r=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(r);if(this.x.cmp(n)===0)return!0;for(var i=e.clone(),s=this.curve.redN.redMul(r);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}};St.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)+">"};St.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Za=Qs(function(t,e){var r=e;r.base=Wi,r.short=_6,r.mont=null,r.edwards=null}),Xa=Qs(function(t,e){var r=e,n=ir.assert;function i(a){a.type==="short"?this.curve=new Za.short(a):a.type==="edwards"?this.curve=new Za.edwards(a):this.curve=new Za.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function s(a,c){Object.defineProperty(r,a,{configurable:!0,enumerable:!0,get:function(){var u=new i(c);return Object.defineProperty(r,a,{configurable:!0,enumerable:!0,value:u}),u}})}s("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:$r.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("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:$r.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("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:$r.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("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:$r.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"]}),s("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:$r.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"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:$r.sha256,gRed:!1,g:["9"]}),s("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:$r.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var o;try{o=null.crash()}catch{o=void 0}s("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:$r.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"}
25,{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",o]})});function Yn(t){if(!(this instanceof Yn))return new Yn(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=Sr.toArray(t.entropy,t.entropyEnc||"hex"),r=Sr.toArray(t.nonce,t.nonceEnc||"hex"),n=Sr.toArray(t.pers,t.persEnc||"hex");Fl(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var Em=Yn;Yn.prototype._init=function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s<this.V.length;s++)this.K[s]=0,this.V[s]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656};Yn.prototype._hmac=function(){return new $r.hmac(this.hash,this.K)};Yn.prototype._update=function(e){var r=this._hmac().update(this.V).update([0]);e&&(r=r.update(e)),this.K=r.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())};Yn.prototype.reseed=function(e,r,n,i){typeof r!="string"&&(i=n,n=r,r=null),e=Sr.toArray(e,r),n=Sr.toArray(n,i),Fl(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};Yn.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=Sr.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length<e;)this.V=this._hmac().update(this.V).digest(),s=s.concat(this.V);var o=s.slice(0,e);return this._update(n),this._reseed++,Sr.encode(o,r)};var Mf=ir.assert;function Mt(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var Ll=Mt;Mt.fromPublic=function(e,r,n){return r instanceof Mt?r:new Mt(e,{pub:r,pubEnc:n})};Mt.fromPrivate=function(e,r,n){return r instanceof Mt?r:new Mt(e,{priv:r,privEnc:n})};Mt.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"}};Mt.prototype.getPublic=function(e,r){return typeof e=="string"&&(r=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,e):this.pub};Mt.prototype.getPrivate=function(e){return e==="hex"?this.priv.toString(16,2):this.priv};Mt.prototype._importPrivate=function(e,r){this.priv=new fe(e,r||16),this.priv=this.priv.umod(this.ec.curve.n)};Mt.prototype._importPublic=function(e,r){if(e.x||e.y){this.ec.curve.type==="mont"?Mf(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&Mf(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,r)};Mt.prototype.derive=function(e){return e.validate()||Mf(e.validate(),"public point not validated"),e.mul(this.priv).getX()};Mt.prototype.sign=function(e,r,n){return this.ec.sign(e,this,r,n)};Mt.prototype.verify=function(e,r,n){return this.ec.verify(e,r,this,void 0,n)};Mt.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var I6=ir.assert;function Rc(t,e){if(t instanceof Rc)return t;this._importDER(t,e)||(I6(t.r&&t.s,"Signature without r or s"),this.r=new fe(t.r,16),this.s=new fe(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var Cc=Rc;function N6(){this.place=0}function Ru(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4||t[e.place]===0)return!1;for(var i=0,s=0,o=e.place;s<n;s++,o++)i<<=8,i|=t[o],i>>>=0;return i<=127?!1:(e.place=o,i)}function Nd(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e<r;)e++;return e===0?t:t.slice(e)}Rc.prototype._importDER=function(e,r){e=ir.toArray(e,r);var n=new N6;if(e[n.place++]!==48)return!1;var i=Ru(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var s=Ru(e,n);if(s===!1||e[n.place]&128)return!1;var o=e.slice(n.place,s+n.place);if(n.place+=s,e[n.place++]!==2)return!1;var a=Ru(e,n);if(a===!1||e.length!==a+n.place||e[n.place]&128)return!1;var c=e.slice(n.place,a+n.place);
25if(o[0]===0)if(o[1]&128)o=o.slice(1);else return!1;if(c[0]===0)if(c[1]&128)c=c.slice(1);else return!1;return this.r=new fe(o),this.s=new fe(c),this.recoveryParam=null,!0};function Cu(t,e){if(e<128){t.push(e);return}var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}Rc.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=Nd(r),n=Nd(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];Cu(i,r.length),i=i.concat(r),i.push(2),Cu(i,n.length);var s=i.concat(n),o=[48];return Cu(o,s.length),o=o.concat(s),ir.encode(o,e)};var k6=function(){throw new Error("unsupported")},xi=ir.assert;function dr(t){if(!(this instanceof dr))return new dr(t);typeof t=="string"&&(xi(Object.prototype.hasOwnProperty.call(Xa,t),"Unknown curve "+t),t=Xa[t]),t instanceof Xa.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var M6=dr;dr.prototype.keyPair=function(e){return new Ll(this,e)};dr.prototype.keyFromPrivate=function(e,r){return Ll.fromPrivate(this,e,r)};dr.prototype.keyFromPublic=function(e,r){return Ll.fromPublic(this,e,r)};dr.prototype.genKeyPair=function(e){e||(e={});for(var r=new Em({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||k6(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new fe(2));;){var s=new fe(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};dr.prototype._truncateToN=function(e,r,n){var i;if(fe.isBN(e)||typeof e=="number")e=new fe(e,16),i=e.byteLength();else if(typeof e=="object")i=e.length,e=new fe(e,16);else{var s=e.toString();i=s.length+1>>>1,e=new fe(s,16)}typeof n!="number"&&(n=i*8);var o=n-this.n.bitLength();return o>0&&(e=e.ushrn(o)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};dr.prototype.sign=function(e,r,n,i){if(typeof n=="object"&&(i=n,n=null),i||(i={}),typeof e!="string"&&typeof e!="number"&&!fe.isBN(e)){xi(typeof e=="object"&&e&&typeof e.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),xi(e.length>>>0===e.length);for(var s=0;s<e.length;s++)xi((e[s]&255)===e[s])}r=this.keyFromPrivate(r,n),e=this._truncateToN(e,!1,i.msgBitLength),xi(!e.isNeg(),"Can not sign a negative message");var o=this.n.byteLength(),a=r.getPrivate().toArray("be",o),c=e.toArray("be",o);xi(new fe(c).eq(e),"Can not sign message");for(var u=new Em({hash:this.hash,entropy:a,nonce:c,pers:i.pers,persEnc:i.persEnc||"utf8"}),f=this.n.sub(new fe(1)),d=0;;d++){var m=i.k?i.k(d):new fe(u.generate(this.n.byteLength()));if(m=this._truncateToN(m,!0),!(m.cmpn(1)<=0||m.cmp(f)>=0)){var g=this.g.mul(m);if(!g.isInfinity()){var w=g.getX(),A=w.umod(this.n);if(A.cmpn(0)!==0){var k=m.invm(this.n).mul(A.mul(r.getPrivate()).iadd(e));if(k=k.umod(this.n),k.cmpn(0)!==0){var _=(g.getY().isOdd()?1:0)|(w.cmp(A)!==0?2:0);return i.canonical&&k.cmp(this.nh)>0&&(k=this.n.sub(k),_^=1),new Cc({r:A,s:k,recoveryParam:_})}}}}}};dr.prototype.verify=function(e,r,n,i,s){s||(s={}),e=this._truncateToN(e,!1,s.msgBitLength),n=this.keyFromPublic(n,i),r=new Cc(r,"hex");var o=r.r,a=r.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var c=a.invm(this.n),u=c.mul(e).umod(this.n),f=c.mul(o).umod(this.n),d;return this.curve._maxwellTrick?(d=this.g.jmulAdd(u,n.getPublic(),f),d.isInfinity()?!1:d.eqXToP(o)):(d=this.g.mulAdd(u,n.getPublic(),f),d.isInfinity()?!1:d.getX().umod(this.n).cmp(o)===0)};dr.prototype.recoverPubKey=function(t,e,r,n){xi((3&r)===r,"The recovery param is more than two bits"),e=new Cc(e,n);var i=this.n,s=new fe(t),o=e.r,a=e.s,c=r&1,u=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");u?o=this.curve.pointFromX(o.add(this.curve.n),c):o=this.curve.pointFromX(o,c);var f=e.r.invm(i),d=i.sub(s).mul(f).umod(i),m=a.mul(f).umod(i);return this.g.mulAdd(d,o,m)};dr.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new Cc(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch{continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var T6=Qs(function(t,e){var r=e;r.version="6.6.1",r.utils=ir,r.rand=function(){throw new Error("unsupported")},r.curve=Za,r.curves=Xa,r.ec=M6,r.eddsa=null}),R6=T6.ec;const C6="signing-key/5.8.0",Tf=new $(C6);let Bu=null;function Dn(){return Bu||(Bu=new R6("secp256k1")),Bu}class B6{constructor(e){K(this,"curve","secp256k1"),K(this,"privateKey",se(e)),Fi(this.privateKey)!==32&&Tf.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=Dn().keyFromPrivate(oe(this.privateKey));K(this,"publicKey","0x"+r.getPublic(!1,"hex")),K(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),K(this,"_isSigningKey",!0)}_addPoint(e){const r=Dn().keyFromPublic(oe(this.publicKey)),n=Dn().keyFromPublic(oe(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}
25signDigest(e){const r=Dn().keyFromPrivate(oe(this.privateKey)),n=oe(e);n.length!==32&&Tf.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return Ic({recoveryParam:i.recoveryParam,r:nt("0x"+i.r.toString(16),32),s:nt("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=Dn().keyFromPrivate(oe(this.privateKey)),n=Dn().keyFromPublic(oe(Pm(e)));return nt("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function O6(t,e){const r=Ic(e),n={r:oe(r.r),s:oe(r.s)};return"0x"+Dn().recoverPubKey(oe(t),n,r.recoveryParam).encode("hex",!1)}function Pm(t,e){const r=oe(t);return r.length===32?new B6(r).publicKey:r.length===33?"0x"+Dn().keyFromPublic(r).getPublic(!1,"hex"):r.length===65?se(r):Tf.throwArgumentError("invalid public or private key","key","[REDACTED]")}const F6="transactions/5.8.0",_n=new $(F6);var kd;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(kd||(kd={}));function Ul(t){return t==="0x"?null:Et(t)}function kt(t){return t==="0x"?zp:J.from(t)}function $6(t){const e=Pm(t);return Et(It(ht(It(e,1)),12))}function Dl(t,e){return $6(O6(oe(t),e))}function Xt(t,e){const r=Ms(J.from(t).toHexString());return r.length>32&&_n.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function Ou(t,e){return{address:Et(t),storageKeys:(e||[]).map((r,n)=>(Fi(r)!==32&&_n.throwArgumentError("invalid access list storageKey",`accessList[${t}:${n}]`,r),r.toLowerCase()))}}function Js(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(r.length>2&&_n.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${n}]`,r),Ou(r[0],r[1])):Ou(r.address,r.storageKeys));const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,s)=>(i[s]=!0,i),{});return Ou(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function Sm(t){return Js(t).map(e=>[e.address,e.storageKeys])}function L6(t,e){if(t.gasPrice!=null){const n=J.from(t.gasPrice),i=J.from(t.maxFeePerGas||0);n.eq(i)||_n.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:n,maxFeePerGas:i})}const r=[Xt(t.chainId||0,"chainId"),Xt(t.nonce||0,"nonce"),Xt(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Xt(t.maxFeePerGas||0,"maxFeePerGas"),Xt(t.gasLimit||0,"gasLimit"),t.to!=null?Et(t.to):"0x",Xt(t.value||0,"value"),t.data||"0x",Sm(t.accessList||[])];if(e){const n=Ic(e);r.push(Xt(n.recoveryParam,"recoveryParam")),r.push(Ms(n.r)),r.push(Ms(n.s))}return qt(["0x02",Nc(r)])}function U6(t,e){const r=[Xt(t.chainId||0,"chainId"),Xt(t.nonce||0,"nonce"),Xt(t.gasPrice||0,"gasPrice"),Xt(t.gasLimit||0,"gasLimit"),t.to!=null?Et(t.to):"0x",Xt(t.value||0,"value"),t.data||"0x",Sm(t.accessList||[])];if(e){const n=Ic(e);r.push(Xt(n.recoveryParam,"recoveryParam")),r.push(Ms(n.r)),r.push(Ms(n.s))}return qt(["0x01",Nc(r)])}function _m(t,e,r){try{const n=kt(e[0]).toNumber();if(n!==0&&n!==1)throw new Error("bad recid");t.v=n}catch{_n.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=nt(e[1],32),t.s=nt(e[2],32);try{const n=ht(r(t));t.from=Dl(n,{r:t.r,s:t.s,recoveryParam:t.v})}catch{}}function D6(t){const e=Cl(t.slice(1));e.length!==9&&e.length!==12&&_n.throwArgumentError("invalid component count for transaction type: 2","payload",se(t));const r=kt(e[2]),n=kt(e[3]),i={type:2,chainId:kt(e[0]).toNumber(),nonce:kt(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:kt(e[4]),to:Ul(e[5]),value:kt(e[6]),data:e[7],accessList:Js(e[8])};return e.length===9||(i.hash=ht(t),_m(i,e.slice(9),L6)),i}function z6(t){const e=Cl(t.slice(1));e.length!==8&&e.length!==11&&_n.throwArgumentError("invalid component count for transaction type: 1","payload",se(t));const r={type:1,chainId:kt(e[0]).toNumber(),nonce:kt(e[1]).toNumber(),gasPrice:kt(e[2]),gasLimit:kt(e[3]),to:Ul(e[4]),value:kt(e[5]),data:e[6],accessList:Js(e[7])};return e.length===8||(r.hash=ht(t),_m(r,e.slice(8),U6)),r}function q6(t){const e=Cl(t);e.length!==9&&e.length!==6&&_n.throwArgumentError("invalid raw transaction","rawTransaction",t);const r={nonce:kt(e[0]).toNumber(),gasPrice:kt(e[1]),gasLimit:kt(e[2]),to:Ul(e[3]),value:kt(e[4]),data:e[5],chainId:0};if(e.length===6)return r;try{r.v=J.from(e[6]).toNumber()}catch{return r}if(r.r=nt(e[7],32),r.s=nt(e[8],32),J.from(r.r).isZero()&&J.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 i=e.slice(0,6);r.chainId!==0&&(i.push(se(r.chainId)),i.push("0x"),i.push("0x"),n-=r.chainId*2+8);const s=ht(Nc(i));try{r.from=Dl(s,{r:se(r.r),s:se(r.s),recoveryParam:n})}catch{}r.hash=ht(t)}return r.type=null,r}function j6(t){const e=oe(t);if(e[0]>127)return q6(e);switch(e[0]){case 1:return z6(e);case 2:return D6(e)}return _n.throwError(`unsupported transaction type: ${e[0]}`,$.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}const G6="contracts/5.8.0";var Ui=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(d){o(d)}}function c(f){try{u(n.throw(f))}catch(d){o(d)}}function u(f){f.done?s(f.value):i(f.value).then(a,c)}u((n=n.apply(t,e||[])).next())})};const ct=new $(G6);function lc(t,e){return Ui(this,void 0,void 0,function*(){const r=yield e;typeof r!="string"&&ct.throwArgumentError("invalid address or ENS name","name",r);try{return Et(r)}catch{}t||ct.throwError("a provider or signer is needed to resolve ENS names",$.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield t.resolveName(r);return n==null&&ct.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n})}function ec(t,e,r){return Ui(this,void 0,void 0,function*(){return Array.isArray(r)?yield Promise.all(r.map((n,i)=>ec(t,Array.isArray(e)?e[i]:e[n.name],n))):r.type==="address"?yield lc(t,e):r.type==="tuple"?yield ec(t,e,r.components):r.baseType==="array"?Array.isArray(e)?yield Promise.all(e.map(n=>ec(t,n,r.arrayChildren))):Promise.reject(ct.makeError("invalid value for array",$.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e})}function Bc(t,e,r){return Ui(this,void 0,void 0,function*(){let n={};r.length===e.inputs.length+1&&typeof r[r.length-1]=="object"&&(n=mt(r.pop())
25),ct.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?n.from?n.from=lt({override:lc(t.signer,n.from),signer:t.signer.getAddress()}).then(u=>Ui(this,void 0,void 0,function*(){return Et(u.signer)!==u.override&&ct.throwError("Contract with a Signer cannot override from",$.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),u.override})):n.from=t.signer.getAddress():n.from&&(n.from=lc(t.provider,n.from));const i=yield lt({args:ec(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:lt(n)||{}}),s=t.interface.encodeFunctionData(e,i.args),o={data:s,to:i.address},a=i.overrides;if(a.nonce!=null&&(o.nonce=J.from(a.nonce).toNumber()),a.gasLimit!=null&&(o.gasLimit=J.from(a.gasLimit)),a.gasPrice!=null&&(o.gasPrice=J.from(a.gasPrice)),a.maxFeePerGas!=null&&(o.maxFeePerGas=J.from(a.maxFeePerGas)),a.maxPriorityFeePerGas!=null&&(o.maxPriorityFeePerGas=J.from(a.maxPriorityFeePerGas)),a.from!=null&&(o.from=a.from),a.type!=null&&(o.type=a.type),a.accessList!=null&&(o.accessList=Js(a.accessList)),o.gasLimit==null&&e.gas!=null){let u=21e3;const f=oe(s);for(let d=0;d<f.length;d++)u+=4,f[d]&&(u+=64);o.gasLimit=J.from(e.gas).add(u)}if(a.value){const u=J.from(a.value);!u.isZero()&&!e.payable&&ct.throwError("non-payable method cannot override value",$.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:n.value}),o.value=u}a.customData&&(o.customData=mt(a.customData)),a.ccipReadEnabled&&(o.ccipReadEnabled=!!a.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 c=Object.keys(n).filter(u=>n[u]!=null);return c.length&&ct.throwError(`cannot override ${c.map(u=>JSON.stringify(u)).join(",")}`,$.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:c}),o})}function H6(t,e){return function(...r){return Bc(t,e,r)}}function V6(t,e){const r=t.signer||t.provider;return function(...n){return Ui(this,void 0,void 0,function*(){r||ct.throwError("estimate require a provider or signer",$.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield Bc(t,e,n);return yield r.estimateGas(i)})}}function K6(t,e){const r=e.wait.bind(e);e.wait=n=>r(n).then(i=>(i.events=i.logs.map(s=>{let o=vn(s),a=null;try{a=t.interface.parseLog(s)}catch{}return a&&(o.args=a.args,o.decode=(c,u)=>t.interface.decodeEventLog(a.eventFragment,c,u),o.event=a.name,o.eventSignature=a.signature),o.removeListener=()=>t.provider,o.getBlock=()=>t.provider.getBlock(i.blockHash),o.getTransaction=()=>t.provider.getTransaction(i.transactionHash),o.getTransactionReceipt=()=>Promise.resolve(i),o}),i))}function Im(t,e,r){const n=t.signer||t.provider;return function(...i){return Ui(this,void 0,void 0,function*(){let s;if(i.length===e.inputs.length+1&&typeof i[i.length-1]=="object"){const c=mt(i.pop());c.blockTag!=null&&(s=yield c.blockTag),delete c.blockTag,i.push(c)}t.deployTransaction!=null&&(yield t._deployed(s));const o=yield Bc(t,e,i),a=yield n.call(o,s);try{let c=t.interface.decodeFunctionResult(e,a);return r&&e.outputs.length===1&&(c=c[0]),c}catch(c){throw c.code===$.errors.CALL_EXCEPTION&&(c.address=t.address,c.args=i,c.transaction=o),c}})}}function W6(t,e){return function(...r){return Ui(this,void 0,void 0,function*(){t.signer||ct.throwError("sending a transaction requires a signer",$.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),t.deployTransaction!=null&&(yield t._deployed());const n=yield Bc(t,e,r),i=yield t.signer.sendTransaction(n);return K6(t,i),i})}}function Md(t,e,r){return e.constant?Im(t,e,r):W6(t,e)}function Nm(t){return t.address&&(t.topics==null||t.topics.length===0)?"*":(t.address||"*")+"@"+(t.topics?t.topics.map(e=>Array.isArray(e)?e.join("|"):e).join(":"):"")}class _o{constructor(e,r){K(this,"tag",e),K(this,"filter",r),this._listeners=[]}addListener(e,r){this._listeners.push({listener:e,once:r})}removeListener(e){let r=!1;this._listeners=this._listeners.filter(n=>r||n.listener!==e?!0:(r=!0,!1))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map(e=>e.listener)}listenerCount(){return this._listeners.length}run(e){const r=this.listenerCount();return this._listeners=this._listeners.filter(n=>{const i=e.slice();return setTimeout(()=>{n.listener.apply(this,i)},0),!n.once}),r}prepareEvent(e){}getEmit(e){return[e]}}class Q6 extends _o{constructor(){super("error",null)}}class Td extends _o{constructor(e,r,n,i){const s={address:e};let o=r.getEventTopic(n);i?(o!==i[0]&&ct.throwArgumentError("topic mismatch","topics",i),s.topics=i.slice()):s.topics=[o],super(Nm(s),s),K(this,"address",e),K(this,"interface",r),K(this,"fragment",n)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(r,n)=>this.interface.decodeEventLog(this.fragment,r,n);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(r){e.args=null,e.decodeError=r}}getEmit(e){const r=Nb(e.args);if(r.length)throw r[0].error;const n=(e.args||[]).slice();return n.push(e),n}}class Rd extends _o{constructor(e,r){super("*",{address:e}),K(this,"address",e),K(this,"interface",r)}prepareEvent(e){super.prepareEvent(e);try{const r=this.interface.parseLog(e);e.event=r.name,e.eventSignature=r.signature,e.decode=(n,i)=>this.interface.decodeEventLog(r.eventFragment,n,i),e.args=r.args}catch{}}}class J6{constructor(e,r,n){K(this,"interface",Hr(new.target,"getInterface")(r)),n==null?(K(this,"provider",null),K(this,"signer",null)):fa.isSigner(n)?(K(this,"provider",n.provider||null),K(this,"signer",n)):Mc.isProvider(n)?(K(this,"provider",n),K(this,"signer",null)):ct.throwArgumentError("invalid signer or provider","signerOrProvider",n),K(this,"callStatic",{}),K(this,"estimateGas",{}),K(this,"functions",{}),K(this,"populateTransaction",{}),K(this,"filters",{});{const o={};
25Object.keys(this.interface.events).forEach(a=>{const c=this.interface.events[a];K(this.filters,a,(...u)=>({address:this.address,topics:this.interface.encodeFilterTopics(c,u)})),o[c.name]||(o[c.name]=[]),o[c.name].push(a)}),Object.keys(o).forEach(a=>{const c=o[a];c.length===1?K(this.filters,a,this.filters[c[0]]):ct.warn(`Duplicate definition of ${a} (${c.join(", ")})`)})}if(K(this,"_runningEvents",{}),K(this,"_wrappedEmits",{}),e==null&&ct.throwArgumentError("invalid contract address or ENS name","addressOrName",e),K(this,"address",e),this.provider)K(this,"resolvedAddress",lc(this.provider,e));else try{K(this,"resolvedAddress",Promise.resolve(Et(e)))}catch{ct.throwError("provider is required to use ENS name as contract address",$.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(o=>{});const i={},s={};Object.keys(this.interface.functions).forEach(o=>{const a=this.interface.functions[o];if(s[o]){ct.warn(`Duplicate ABI entry for ${JSON.stringify(o)}`);return}s[o]=!0;{const c=a.name;i[`%${c}`]||(i[`%${c}`]=[]),i[`%${c}`].push(o)}this[o]==null&&K(this,o,Md(this,a,!0)),this.functions[o]==null&&K(this.functions,o,Md(this,a,!1)),this.callStatic[o]==null&&K(this.callStatic,o,Im(this,a,!0)),this.populateTransaction[o]==null&&K(this.populateTransaction,o,H6(this,a)),this.estimateGas[o]==null&&K(this.estimateGas,o,V6(this,a))}
25),Object.keys(i).forEach(o=>{const a=i[o];if(a.length>1)return;o=o.substring(1);const c=a[0];try{this[o]==null&&K(this,o,this[c])}catch{}this.functions[o]==null&&K(this.functions,o,this.functions[c]),this.callStatic[o]==null&&K(this.callStatic,o,this.callStatic[c]),this.populateTransaction[o]==null&&K(this.populateTransaction,o,this.populateTransaction[c]),this.estimateGas[o]==null&&K(this.estimateGas,o,this.estimateGas[c])})}static getContractAddress(e){return $p(e)}static getInterface(e){return Ed.isInterface(e)?e:new Ed(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(r=>(r==="0x"&&ct.throwError("contract not deployed",$.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(e){this.signer||ct.throwError("sending a transactions require a signer",$.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const r=mt(e||{});return["from","to"].forEach(function(n){r[n]!=null&&ct.throwError("cannot override "+n,$.errors.UNSUPPORTED_OPERATION,{operation:n})}),r.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(r))}connect(e){typeof e=="string"&&(e=new Ol(e,this.provider));const r=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&K(r,"deployTransaction",this.deployTransaction),r}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return _f.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if(typeof e=="string"){if(e==="error")return this._normalizeRunningEvent(new Q6);if(e==="event")return this._normalizeRunningEvent(new _o("event",null));if(e==="*")return this._normalizeRunningEvent(new Rd(this.address,this.interface));const r=this.interface.getEvent(e);return this._normalizeRunningEvent(new Td(this.address,this.interface,r))}if(e.topics&&e.topics.length>0){try{const n=e.topics[0];if(typeof n!="string")throw new Error("invalid topic");const i=this.interface.getEvent(n);return this._normalizeRunningEvent(new Td(this.address,this.interface,i,e.topics))}catch{}const r={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new _o(Nm(r),r))}return this._normalizeRunningEvent(new Rd(this.address,this.interface))}_checkRunningEvents(e){if(e.listenerCount()===0){delete this._runningEvents[e.tag];const r=this._wrappedEmits[e.tag];r&&e.filter&&(this.provider.off(e.filter,r),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,r,n){const i=vn(r);return i.removeListener=()=>{n&&(e.removeListener(n),this._checkRunningEvents(e))},i.getBlock=()=>this.provider.getBlock(r.blockHash),i.getTransaction=()=>this.provider.getTransaction(r.transactionHash),i.getTransactionReceipt=()=>this.provider.getTransactionReceipt(r.transactionHash),e.prepareEvent(i),i}_addEventListener(e,r,n){if(this.provider||ct.throwError("events require a provider or a signer with a provider",$.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(r,n),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const i=s=>{let o=this._wrapEvent(e,s,r);if(o.decodeError==null)try{const a=e.getEmit(o);this.emit(e.filter,...a)}catch(a){o.decodeError=a.error}e.filter!=null&&this.emit("event",o),o.decodeError!=null&&this.emit("error",o.decodeError,o)};this._wrappedEmits[e.tag]=i,e.filter!=null&&this.provider.on(e.filter,i)}}queryFilter(e,r,n){const i=this._getRunningEvent(e),s=mt(i.filter);return typeof r=="string"&&ve(r,32)?(n!=null&&ct.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),s.blockHash=r):(s.fromBlock=r??0,s.toBlock=n??"latest"),this.provider.getLogs(s).then(o=>o.map(a=>this._wrapEvent(i,a,null)))}on(e,r){return this._addEventListener(this._getRunningEvent(e),r,!1),this}once(e,r){return this._addEventListener(this._getRunningEvent(e),r,!0),this}emit(e,...r){if(!this.provider)return!1;const n=this._getRunningEvent(e),i=n.run(r)>0;return this._checkRunningEvents(n),i}
25listenerCount(e){return this.provider?e==null?Object.keys(this._runningEvents).reduce((r,n)=>r+this._runningEvents[n].listenerCount(),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(e==null){const r=[];for(let n in this._runningEvents)this._runningEvents[n].listeners().forEach(i=>{r.push(i)});return r}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(e==null){for(const n in this._runningEvents){const i=this._runningEvents[n];i.removeAllListeners(),this._checkRunningEvents(i)}return this}const r=this._getRunningEvent(e);return r.removeAllListeners(),this._checkRunningEvents(r),this}off(e,r){if(!this.provider)return this;const n=this._getRunningEvent(e);return n.removeListener(r),this._checkRunningEvents(n),this}removeListener(e,r){return this.off(e,r)}}class HP extends J6{}class km{constructor(e){K(this,"alphabet",e),K(this,"base",e.length),K(this,"_alphabetMap",{}),K(this,"_leader",e.charAt(0));for(let r=0;r<e.length;r++)this._alphabetMap[e.charAt(r)]=r}encode(e){let r=oe(e);if(r.length===0)return"";let n=[0];for(let s=0;s<r.length;++s){let o=r[s];for(let a=0;a<n.length;++a)o+=n[a]<<8,n[a]=o%this.base,o=o/this.base|0;for(;o>0;)n.push(o%this.base),o=o/this.base|0}let i="";for(let s=0;r[s]===0&&s<r.length-1;++s)i+=this._leader;for(let s=n.length-1;s>=0;--s)i+=this.alphabet[n[s]];return i}decode(e){if(typeof e!="string")throw new TypeError("Expected String");let r=[];if(e.length===0)return new Uint8Array(r);r.push(0);for(let n=0;n<e.length;n++){let i=this._alphabetMap[e[n]];if(i===void 0)throw new Error("Non-base"+this.base+" character");let s=i;for(let o=0;o<r.length;++o)s+=r[o]*this.base,r[o]=s&255,s>>=8;for(;s>0;)r.push(s&255),s>>=8}for(let n=0;e[n]===this._leader&&n<e.length-1;++n)r.push(0);return oe(new Uint8Array(r.reverse()))}}new km("abcdefghijklmnopqrstuvwxyz234567");const Rf=new km("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function Cd(t){return"0x"+$r.sha256().update(oe(t)).digest("hex")}function VP(t,e){return Dl(Tw(t),e)}const Y6="networks/5.8.0",Bd=new $(Y6);function Z6(t){return t&&typeof t.renetwork=="function"}function xr(t){const e=function(r,n){n==null&&(n={});const i=[];if(r.InfuraProvider&&n.infura!=="-")try{i.push(new r.InfuraProvider(t,n.infura))}catch{}if(r.EtherscanProvider&&n.etherscan!=="-")try{i.push(new r.EtherscanProvider(t,n.etherscan))}catch{}if(r.AlchemyProvider&&n.alchemy!=="-")try{i.push(new r.AlchemyProvider(t,n.alchemy))}catch{}if(r.PocketProvider&&n.pocket!=="-"){const s=["goerli","ropsten","rinkeby","sepolia"];try{const o=new r.PocketProvider(t,n.pocket);o.network&&s.indexOf(o.network.name)===-1&&i.push(o)}catch{}}if(r.CloudflareProvider&&n.cloudflare!=="-")try{i.push(new r.CloudflareProvider(t))}catch{}if(r.AnkrProvider&&n.ankr!=="-")try{const s=["ropsten"],o=new r.AnkrProvider(t,n.ankr);o.network&&s.indexOf(o.network.name)===-1&&i.push(o)}catch{}if(r.QuickNodeProvider&&n.quicknode!=="-")try{i.push(new r.QuickNodeProvider(t,n.quicknode))}catch{}if(i.length===0)return null;if(r.FallbackProvider){let s=1;return n.quorum!=null?s=n.quorum:t==="homestead"&&(s=2),new r.FallbackProvider(i,s)}return i[0]};return e.renetwork=function(r){return xr(r)},e}function dc(t,e){const r=function(n,i){return n.JsonRpcProvider?new n.JsonRpcProvider(t,e):null};return r.renetwork=function(n){return dc(t,n)},r}const Od={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:xr("homestead")},Fd={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:xr("ropsten")},$d={chainId:63,name:"classicMordor",_defaultProvider:dc("https://www.ethercluster.com/mordor","classicMordor")},La={unspecified:{chainId:0,name:"unspecified"},homestead:Od,mainnet:Od,morden:{chainId:2,name:"morden"},ropsten:Fd,testnet:Fd,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:xr("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:xr("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:xr("goerli")}
25,kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"sepolia",_defaultProvider:xr("sepolia")},holesky:{chainId:17e3,name:"holesky",_defaultProvider:xr("holesky")},classic:{chainId:61,name:"classic",_defaultProvider:dc("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:$d,classicTestnet:$d,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:dc("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:xr("matic")},maticmum:{chainId:80001,name:"maticmum",_defaultProvider:xr("maticmum")},optimism:{chainId:10,name:"optimism",_defaultProvider:xr("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 X6(t){if(t==null)return null;if(typeof t=="number"){for(const n in La){const i=La[n];if(i.chainId===t)return{name:i.name,chainId:i.chainId,ensAddress:i.ensAddress||null,_defaultProvider:i._defaultProvider||null}}return{chainId:t,name:"unknown"}}if(typeof t=="string"){const n=La[t];return n==null?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}const e=La[t.name];if(!e)return typeof t.chainId!="number"&&Bd.throwArgumentError("invalid network chainId","network",t),t;t.chainId!==0&&t.chainId!==e.chainId&&Bd.throwArgumentError("network chainId mismatch","network",t);let r=t._defaultProvider||null;return r==null&&e._defaultProvider&&(Z6(e._defaultProvider)?r=e._defaultProvider.renetwork(t):r=e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:r}}const e2="web/5.8.0";var t2=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(d){o(d)}}function c(f){try{u(n.throw(f))}catch(d){o(d)}}function u(f){f.done?s(f.value):i(f.value).then(a,c)}u((n=n.apply(t,e||[])).next())})};function r2(t,e){return t2(this,void 0,void 0,function*(){e==null&&(e={});const r={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0};
25if(e.skipFetchSetup!==!0&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),e.fetchOptions!=null){const o=e.fetchOptions;o.mode&&(r.mode=o.mode),o.cache&&(r.cache=o.cache),o.credentials&&(r.credentials=o.credentials),o.redirect&&(r.redirect=o.redirect),o.referrer&&(r.referrer=o.referrer)}const n=yield fetch(t,r),i=yield n.arrayBuffer(),s={};return n.headers.forEach?n.headers.forEach((o,a)=>{s[a.toLowerCase()]=o}):n.headers.keys().forEach(o=>{s[o.toLowerCase()]=n.headers.get(o)}),{headers:s,statusCode:n.status,statusMessage:n.statusText,body:oe(new Uint8Array(i))}})}var n2=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(d){o(d)}}function c(f){try{u(n.throw(f))}catch(d){o(d)}}function u(f){f.done?s(f.value):i(f.value).then(a,c)}u((n=n.apply(t,e||[])).next())})};const wr=new $(e2);function Ld(t){return new Promise(e=>{setTimeout(e,t)})}function Fn(t,e){if(t==null)return null;if(typeof t=="string")return t;if(kl(t)){if(e&&(e.split("/")[0]==="text"||e.split(";")[0].trim()==="application/json"))try{return ua(t)}catch{}return se(t)}return t}function i2(t){return tr(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function s2(t,e,r){const n=typeof t=="object"&&t.throttleLimit!=null?t.throttleLimit:12;wr.assertArgument(n>0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);const i=typeof t=="object"?t.throttleCallback:null,s=typeof t=="object"&&typeof t.throttleSlotInterval=="number"?t.throttleSlotInterval:100;wr.assertArgument(s>0&&s%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",s);const o=typeof t=="object"?!!t.errorPassThrough:!1,a={};let c=null;const u={method:"GET"};let f=!1,d=2*60*1e3;if(typeof t=="string")c=t;else if(typeof t=="object"){if((t==null||t.url==null)&&wr.throwArgumentError("missing URL","connection.url",t),c=t.url,typeof t.timeout=="number"&&t.timeout>0&&(d=t.timeout),t.headers)for(const _ in t.headers)a[_.toLowerCase()]={key:_,value:String(t.headers[_])},["if-none-match","if-modified-since"].indexOf(_.toLowerCase())>=0&&(f=!0);if(u.allowGzip=!!t.allowGzip,t.user!=null&&t.password!=null){c.substring(0,6)!=="https:"&&t.allowInsecureAuthentication!==!0&&wr.throwError("basic authentication requires a secure https url",$.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:t.user,password:"[REDACTED]"});const _=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+Kp(tr(_))}}t.skipFetchSetup!=null&&(u.skipFetchSetup=!!t.skipFetchSetup),t.fetchOptions!=null&&(u.fetchOptions=mt(t.fetchOptions))}const m=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),g=c?c.match(m):null;if(g)try{const _={statusCode:200,statusMessage:"OK",headers:{"content-type":g[1]||"text/plain"},body:g[2]?Vp(g[3]):i2(g[3])};let B=_.body;return r&&(B=r(_.body,_)),Promise.resolve(B)}catch(_){wr.throwError("processing response error",$.errors.SERVER_ERROR,{body:Fn(g[1],g[2]),error:_,requestBody:null,requestMethod:"GET",url:c})}e&&(u.method="POST",u.body=e,a["content-type"]==null&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),a["content-length"]==null&&(a["content-length"]={key:"Content-Length",value:String(e.length)}));const w={};Object.keys(a).forEach(_=>{const B=a[_];w[B.key]=B.value}),u.headers=w;const A=function(){let _=null;return{promise:new Promise(function(N,M){d&&(_=setTimeout(()=>{_!=null&&(_=null,M(wr.makeError("timeout",$.errors.TIMEOUT,{requestBody:Fn(u.body,w["content-type"]),requestMethod:u.method,timeout:d,url:c})))},d))}),cancel:function(){_!=null&&(clearTimeout(_),_=null)}}}(),k=function(){return n2(this,void 0,void 0,function*(){for(let _=0;_<n;_++){let B=null;try{if(B=yield r2(c,u),_<n){if(B.statusCode===301||B.statusCode===302){const N=B.headers.location||"";if(u.method==="GET"&&N.match(/^https:/)){c=B.headers.location;continue}}else if(B.statusCode===429){let N=!0;if(i&&(N=yield i(_,c)),N){let M=0;const O=B.headers["retry-after"];typeof O=="string"&&O.match(/^[1-9][0-9]*$/)?M=parseInt(O)*1e3:M=s*parseInt(String(Math.random()*Math.pow(2,_))),yield Ld(M);continue}}}}catch(N){B=N.response,B==null&&(A.cancel(),wr.throwError("missing response",$.errors.SERVER_ERROR,{requestBody:Fn(u.body,w["content-type"]),requestMethod:u.method,serverError:N,url:c}))}let T=B.body;if(f&&B.statusCode===304?T=null:!o&&(B.statusCode<200||B.statusCode>=300)&&(A.cancel(),wr.throwError("bad response",$.errors.SERVER_ERROR,{status:B.statusCode,headers:B.headers,body:Fn(T,B.headers?B.headers["content-type"]:null),requestBody:Fn(u.body,w["content-type"]),requestMethod:u.method,url:c})),r)try{const N=yield r(T,B);return A.cancel(),N}catch(N){if(N.throttleRetry&&_<n){let M=!0;if(i&&(M=yield i(_,c)),M){const O=s*parseInt(String(Math.random()*Math.pow(2,_)));yield Ld(O);continue}}A.cancel(),wr.throwError("processing response error",$.errors.SERVER_ERROR,{body:Fn(T,B.headers?B.headers["content-type"]:null),error:N,requestBody:Fn(u.body,w["content-type"]),requestMethod:u.method,url:c})}return A.cancel(),T}return wr.throwError("failed response",$.errors.SERVER_ERROR,{requestBody:Fn(u.body,w["content-type"]),requestMethod:u.method,url:c})})}();return Promise.race([A.promise,k])}function zl(t,e,r){let n=(s,o)=>{let a=null;if(s!=null)try{a=JSON.parse(ua(s))}catch(c){wr.throwError("invalid JSON",$.errors.SERVER_ERROR,{body:s,error:c})}return r&&(a=r(a,o)),a},i=null;if(e!=null){i=tr(e);const s=typeof t=="string"?{url:t}:mt(t);s.headers?Object.keys(s.headers).filter(a=>a.toLowerCase()==="content-type").length!==0||(s.headers=mt(s.headers),s.headers["content-type"]="application/json"):s.headers={"content-type":"application/json"},t=s}return s2(t,i,n)}function mo(t,e){return e||(e={}),e=mt(e),e.floor==null&&(e.floor=0),e.ceiling==null&&(e.ceiling=1e4),e.interval==null&&(e.interval=250),new Promise(function(r,n){let i=null,s=!1;const o=()=>s?!1:(s=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout(()=>{o()&&n(new Error("timeout"))},e.timeout));const a=e.retryLimit;let c=0;
25function u(){return t().then(function(f){if(f!==void 0)o()&&r(f);else if(e.oncePoll)e.oncePoll.once("poll",u);else if(e.onceBlock)e.onceBlock.once("block",u);else if(!s){if(c++,c>a){o()&&n(new Error("retry limit reached"));return}let d=e.interval*parseInt(String(Math.random()*Math.pow(2,c)));d<e.floor&&(d=e.floor),d>e.ceiling&&(d=e.ceiling),setTimeout(u,d)}return null},function(f){o()&&n(f)})}u()})}var hc="qpzry9x8gf2tvdw0s3jn54khce6mua7l",Cf={};for(var Ua=0;Ua<hc.length;Ua++){var Fu=hc.charAt(Ua);if(Cf[Fu]!==void 0)throw new TypeError(Fu+" is ambiguous");Cf[Fu]=Ua}function ls(t){var e=t>>25;return(t&33554431)<<5^-(e>>0&1)&996825010^-(e>>1&1)&642813549^-(e>>2&1)&513874426^-(e>>3&1)&1027748829^-(e>>4&1)&705979059}function Mm(t){for(var e=1,r=0;r<t.length;++r){var n=t.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+t+")";e=ls(e)^n>>5}for(e=ls(e),r=0;r<t.length;++r){var i=t.charCodeAt(r);e=ls(e)^i&31}return e}function o2(t,e,r){if(r=r||90,t.length+7+e.length>r)throw new TypeError("Exceeds length limit");t=t.toLowerCase();var n=Mm(t);if(typeof n=="string")throw new Error(n);for(var i=t+"1",s=0;s<e.length;++s){var o=e[s];if(o>>5)throw new Error("Non 5-bit word");n=ls(n)^o,i+=hc.charAt(o)}for(s=0;s<6;++s)n=ls(n);for(n^=1,s=0;s<6;++s){var a=n>>(5-s)*5&31;i+=hc.charAt(a)}return i}function Tm(t,e){if(e=e||90,t.length<8)return t+" too short";if(t.length>e)return"Exceeds length limit";var r=t.toLowerCase(),n=t.toUpperCase();if(t!==r&&t!==n)return"Mixed-case string "+t;t=r;var i=t.lastIndexOf("1");if(i===-1)return"No separator character for "+t;if(i===0)return"Missing prefix for "+t;var s=t.slice(0,i),o=t.slice(i+1);if(o.length<6)return"Data too short";var a=Mm(s);if(typeof a=="string")return a;for(var c=[],u=0;u<o.length;++u){var f=o.charAt(u),d=Cf[f];if(d===void 0)return"Unknown character "+f;a=ls(a)^d,!(u+6>=o.length)&&c.push(d)}return a!==1?"Invalid checksum for "+t:{prefix:s,words:c}}function a2(){var t=Tm.apply(null,arguments);if(typeof t=="object")return t}function c2(t){var e=Tm.apply(null,arguments);if(typeof e=="object")return e;throw new Error(e)}function Oc(t,e,r,n){for(var i=0,s=0,o=(1<<r)-1,a=[],c=0;c<t.length;++c)for(i=i<<e|t[c],s+=e;s>=r;)s-=r,a.push(i>>s&o);if(n)s>0&&a.push(i<<r-s&o);else{if(s>=e)return"Excess padding";if(i<<r-s&o)return"Non-zero padding"}return a}function u2(t){var e=Oc(t,8,5,!0);if(Array.isArray(e))return e}function f2(t){var e=Oc(t,8,5,!0);if(Array.isArray(e))return e;throw new Error(e)}function l2(t){var e=Oc(t,5,8,!1);if(Array.isArray(e))return e}function d2(t){var e=Oc(t,5,8,!1);if(Array.isArray(e))return e;throw new Error(e)}var h2={decodeUnsafe:a2,decode:c2,encode:o2,toWordsUnsafe:u2,toWords:f2,fromWordsUnsafe:l2,fromWords:d2};const Ud=ia(h2),Fc="providers/5.8.0",ao=new $(Fc);class ne{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},r=this.address.bind(this),n=this.bigNumber.bind(this),i=this.blockTag.bind(this),s=this.data.bind(this),o=this.hash.bind(this),a=this.hex.bind(this),c=this.number.bind(this),u=this.type.bind(this),f=d=>this.data(d,!0);return e.transaction={hash:o,type:u,accessList:ne.allowNull(this.accessList.bind(this),null),blockHash:ne.allowNull(o,null),blockNumber:ne.allowNull(c,null),transactionIndex:ne.allowNull(c,null),confirmations:ne.allowNull(c,null),from:r,gasPrice:ne.allowNull(n),maxPriorityFeePerGas:ne.allowNull(n),maxFeePerGas:ne.allowNull(n),gasLimit:n,to:ne.allowNull(r,null),value:n,nonce:c,data:s,r:ne.allowNull(this.uint256),s:ne.allowNull(this.uint256),v:ne.allowNull(c),creates:ne.allowNull(r,null),raw:ne.allowNull(s)},e.transactionRequest={from:ne.allowNull(r),nonce:ne.allowNull(c),gasLimit:ne.allowNull(n),gasPrice:ne.allowNull(n),maxPriorityFeePerGas:ne.allowNull(n),maxFeePerGas:ne.allowNull(n),to:ne.allowNull(r),value:ne.allowNull(n),data:ne.allowNull(f),type:ne.allowNull(c),accessList:ne.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:c,blockNumber:c,transactionHash:o,address:r,topics:ne.arrayOf(o),data:s,logIndex:c,blockHash:o},e.receipt={to:ne.allowNull(this.address,null),from:ne.allowNull(this.address,null),
25contractAddress:ne.allowNull(r,null),transactionIndex:c,root:ne.allowNull(a),gasUsed:n,logsBloom:ne.allowNull(s),blockHash:o,transactionHash:o,logs:ne.arrayOf(this.receiptLog.bind(this)),blockNumber:c,confirmations:ne.allowNull(c,null),cumulativeGasUsed:n,effectiveGasPrice:ne.allowNull(n),status:ne.allowNull(c),type:u},e.block={hash:ne.allowNull(o),parentHash:o,number:c,timestamp:c,nonce:ne.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:ne.allowNull(r),extraData:s,transactions:ne.allowNull(ne.arrayOf(o)),baseFeePerGas:ne.allowNull(n)},e.blockWithTransactions=mt(e.block),e.blockWithTransactions.transactions=ne.allowNull(ne.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:ne.allowNull(i,void 0),toBlock:ne.allowNull(i,void 0),blockHash:ne.allowNull(o,void 0),address:ne.allowNull(r,void 0),topics:ne.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:ne.allowNull(c),blockHash:ne.allowNull(o),transactionIndex:c,removed:ne.allowNull(this.boolean.bind(this)),address:r,data:ne.allowFalsish(s,"0x"),topics:ne.arrayOf(o),transactionHash:o,logIndex:c},e}accessList(e){return Js(e||[])}number(e){return e==="0x"?0:J.from(e).toNumber()}type(e){return e==="0x"||e==null?0:J.from(e).toNumber()}bigNumber(e){return J.from(e)}boolean(e){if(typeof e=="boolean")return e;if(typeof e=="string"){if(e=e.toLowerCase(),e==="true")return!0;if(e==="false")return!1}throw new Error("invalid boolean - "+e)}hex(e,r){return typeof e=="string"&&(!r&&e.substring(0,2)!=="0x"&&(e="0x"+e),ve(e))?e.toLowerCase():ao.throwArgumentError("invalid hash","value",e)}data(e,r){const n=this.hex(e,r);if(n.length%2!==0)throw new Error("invalid data; odd-length - "+e);return n}address(e){return Et(e)}callAddress(e){if(!ve(e,32))return null;const r=Et(It(e,12));return r===jb?null:r}contractAddress(e){return $p(e)}blockTag(e){if(e==null)return"latest";if(e==="earliest")return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(typeof e=="number"||ve(e))return Ml(e);throw new Error("invalid blockTag")}hash(e,r){const n=this.hex(e,r);return Fi(n)!==32?ao.throwArgumentError("invalid hash","value",e):n}difficulty(e){if(e==null)return null;const r=J.from(e);try{return r.toNumber()}catch{}return null}uint256(e){if(!ve(e))throw new Error("invalid uint256");return nt(e,32)}_block(e,r){e.author!=null&&e.miner==null&&(e.miner=e.author);const n=e._difficulty!=null?e._difficulty:e.difficulty,i=ne.check(r,e);return i._difficulty=n==null?null:J.from(n),i}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return ne.check(this.formats.transactionRequest,e)}transactionResponse(e){e.gas!=null&&e.gasLimit==null&&(e.gasLimit=e.gas),e.to&&J.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),e.input!=null&&e.data==null&&(e.data=e.input),e.to==null&&e.creates==null&&(e.creates=this.contractAddress(e)),(e.type===1||e.type===2)&&e.accessList==null&&(e.accessList=[]);const r=ne.check(this.formats.transaction,e);if(e.chainId!=null){let n=e.chainId;ve(n)&&(n=J.from(n).toNumber()),r.chainId=n}else{let n=e.networkId;n==null&&r.v==null&&(n=e.chainId),ve(n)&&(n=J.from(n).toNumber()),typeof n!="number"&&r.v!=null&&(n=(r.v-35)/2,n<0&&(n=0),n=parseInt(n)),typeof n!="number"&&(n=0),r.chainId=n}return r.blockHash&&r.blockHash.replace(/0/g,"")==="x"&&(r.blockHash=null),r}transaction(e){return j6(e)}receiptLog(e){return ne.check(this.formats.receiptLog,e)}receipt(e){const r=ne.check(this.formats.receipt,e);if(r.root!=null)if(r.root.length<=4){const n=J.from(r.root).toNumber();n===0||n===1?(r.status!=null&&r.status!==n&&ao.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):ao.throwArgumentError("invalid alt-root-status","value.root",r.root)}else r.root.length!==66&&ao.throwArgumentError("invalid root hash","value.root",r.root);return r.status!=null&&(r.byzantium=!0),r}topics(e){return Array.isArray(e)?e.map(r=>this.topics(r)):e!=null?this.hash(e,!0):null}filter(e){return ne.check(this.formats.filter,e)}filterLog(e){return ne.check(this.formats.filterLog,e)}static check(e,r){const n={};for(const i in e)try{const s=e[i](r[i]);s!==void 0&&(n[i]=s)}catch(s){throw s.checkKey=i,s.checkValue=r[i],s}return n}static allowNull(e,r){return function(n){return n==null?r:e(n)}}static allowFalsish(e,r){return function(n){return n?e(n):r}}static arrayOf(e){return function(r){if(!Array.isArray(r))throw new Error("not an array");const n=[];return r.forEach(function(i){n.push(e(i))}),n}}}var le=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(d){o(d)}}function c(f){try{u(n.throw(f))}catch(d){o(d)}}function u(f){f.done?s(f.value):i(f.value).then(a,c)}u((n=n.apply(t,e||[])).next())})};const de=new $(Fc),p2=10;function Dd(t){return t==null?"null":(Fi(t)!==32&&de.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function zd(t){for(t=t.slice();t.length>0&&t[t.length-1]==null;)t.pop();return t.map(e=>{if(Array.isArray(e)){const r={};e.forEach(i=>
25{r[Dd(i)]=!0});const n=Object.keys(r);return n.sort(),n.join("|")}else return Dd(e)}).join("&")}function m2(t){return t===""?[]:t.split(/&/g).map(e=>{if(e==="")return[];const r=e.split("|").map(n=>n==="null"?null:n);return r.length===1?r[0]:r})}function Yi(t){if(typeof t=="string"){if(t=t.toLowerCase(),Fi(t)===32)return"tx:"+t;if(t.indexOf(":")===-1)return t}else{if(Array.isArray(t))return"filter:*:"+zd(t);if(Vw.isForkEvent(t))throw de.warn("not implemented"),new Error("not implemented");if(t&&typeof t=="object")return"filter:"+(t.address||"*")+":"+zd(t.topics||[])}throw new Error("invalid event - "+t)}function co(){return new Date().getTime()}function qd(t){return new Promise(e=>{setTimeout(e,t)})}const g2=["block","network","pending","poll"];let y2=class{constructor(e,r,n){K(this,"tag",e),K(this,"listener",r),K(this,"once",n),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 e[0]!=="tx"?null:e[1]}get filter(){const e=this.tag.split(":");if(e[0]!=="filter")return null;const r=e[1],n=m2(e[2]),i={};return n.length>0&&(i.topics=n),r&&r!=="*"&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||g2.indexOf(this.tag)>=0}};const b2={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 $u(t){return nt(J.from(t).toHexString(),32)}function jd(t){return Rf.encode(jt([t,It(Cd(Cd(t)),0,4)]))}const Rm=new RegExp("^(ipfs)://(.*)$","i"),Gd=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),Rm,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function tc(t,e){try{return ua(Io(t,e))}catch{}return null}function Io(t,e){if(t==="0x")return null;const r=J.from(It(t,e,e+32)).toNumber(),n=J.from(It(t,r,r+32)).toNumber();return It(t,r+32,r+32+n)}function Lu(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):de.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function Hd(t){const e=oe(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function w2(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}function Cm(t){const e=[];let r=0;for(let n=0;n<t.length;n++)e.push(null),r+=32;for(let n=0;n<t.length;n++){const i=oe(t[n]);e[n]=Hd(r),e.push(Hd(i.length)),e.push(w2(i)),r+=32+Math.ceil(i.length/32)*32}return qt(e)}class Vd{constructor(e,r,n,i){K(this,"provider",e),K(this,"name",n),K(this,"address",e.formatter.address(r)),K(this,"_resolvedAddress",i)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then(e=>J.from(e).eq(1)).catch(e=>{if(e.code===$.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e})),this._supportsEip2544}_fetch(e,r){return le(this,void 0,void 0,function*(){const n={to:this.address,ccipReadEnabled:!0,data:qt([e,Ya(this.name),r||"0x"])};let i=!1;(yield this.supportsWildcard())&&(i=!0,n.data=qt(["0x9061b923",Cm([kw(this.name),n.data])]));try{let s=yield this.provider.call(n);return oe(s).length%32===4&&de.throwError("resolver threw error",$.errors.CALL_EXCEPTION,{transaction:n,data:s}),i&&(s=Io(s,0)),s}catch(s){if(s.code===$.errors.CALL_EXCEPTION)return null;throw s}})}_fetchBytes(e,r){return le(this,void 0,void 0,function*(){const n=yield this._fetch(e,r);return n!=null?Io(n,0):null})}_getAddress(e,r){const n=b2[String(e)];if(n==null&&de.throwError(`unsupported coin type: ${e}`,$.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),n.ilk==="eth")return this.provider.formatter.address(r);const i=oe(r);if(n.p2pkh!=null){const s=r.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return jd(jt([[n.p2pkh],"0x"+s[2]]))}}if(n.p2sh!=null){const s=r.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return jd(jt([[n.p2sh],"0x"+s[2]]))}}if(n.prefix!=null){const s=i[1];let o=i[0];
25if(o===0?s!==20&&s!==32&&(o=-1):o=-1,o>=0&&i.length===2+s&&s>=1&&s<=75){const a=Ud.toWords(i.slice(2));return a.unshift(o),Ud.encode(n.prefix,a)}}return null}getAddress(e){return le(this,void 0,void 0,function*(){if(e==null&&(e=60),e===60)try{const i=yield this._fetch("0x3b3b57de");return i==="0x"||i===Kb?null:this.provider.formatter.callAddress(i)}catch(i){if(i.code===$.errors.CALL_EXCEPTION)return null;throw i}const r=yield this._fetchBytes("0xf1cb7e06",$u(e));if(r==null||r==="0x")return null;const n=this._getAddress(e,r);return n==null&&de.throwError("invalid or unsupported coin data",$.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:r}),n})}getAvatar(){return le(this,void 0,void 0,function*(){const e=[{type:"name",content:this.name}];try{const r=yield this.getText("avatar");if(r==null)return null;for(let n=0;n<Gd.length;n++){const i=r.match(Gd[n]);if(i==null)continue;const s=i[1].toLowerCase();switch(s){case"https":return e.push({type:"url",content:r}),{linkage:e,url:r};case"data":return e.push({type:"data",content:r}),{linkage:e,url:r};case"ipfs":return e.push({type:"ipfs",content:r}),{linkage:e,url:Lu(r)};case"erc721":case"erc1155":{const o=s==="erc721"?"0xc87b56dd":"0x0e89341c";e.push({type:s,content:r});const a=this._resolvedAddress||(yield this.getAddress()),c=(i[2]||"").split("/");if(c.length!==2)return null;const u=yield this.provider.formatter.address(c[0]),f=nt(J.from(c[1]).toHexString(),32);if(s==="erc721"){const A=this.provider.formatter.callAddress(yield this.provider.call({to:u,data:qt(["0x6352211e",f])}));if(a!==A)return null;e.push({type:"owner",content:A})}else if(s==="erc1155"){const A=J.from(yield this.provider.call({to:u,data:qt(["0x00fdd58e",nt(a,32),f])}));if(A.isZero())return null;e.push({type:"balance",content:A.toString()})}const d={to:this.provider.formatter.address(c[0]),data:qt([o,f])};let m=tc(yield this.provider.call(d),0);if(m==null)return null;e.push({type:"metadata-url-base",content:m}),s==="erc1155"&&(m=m.replace("{id}",f.substring(2)),e.push({type:"metadata-url-expanded",content:m})),m.match(/^ipfs:/i)&&(m=Lu(m)),e.push({type:"metadata-url",content:m});const g=yield zl(m);if(!g)return null;e.push({type:"metadata",content:JSON.stringify(g)});let w=g.image;if(typeof w!="string")return null;if(!w.match(/^(https:\/\/|data:)/i)){if(w.match(Rm)==null)return null;e.push({type:"url-ipfs",content:w}),w=Lu(w)}return e.push({type:"url",content:w}),{linkage:e,url:w}}}}}catch{}return null})}getContentHash(){return le(this,void 0,void 0,function*(){const e=yield this._fetchBytes("0xbc1c58d1");if(e==null||e==="0x")return null;const r=e.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const o=parseInt(r[3],16);if(r[4].length===o*2)return"ipfs://"+Rf.encode("0x"+r[1])}const n=e.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(n){const o=parseInt(n[3],16);if(n[4].length===o*2)return"ipns://"+Rf.encode("0x"+n[1])}const i=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(i&&i[1].length===32*2)return"bzz://"+i[1];const s=e.match(/^0x90b2c605([0-9a-f]*)$/);if(s&&s[1].length===34*2){const o={"=":"","+":"-","/":"_"};return"sia://"+Kp("0x"+s[1]).replace(/[=+\/]/g,c=>o[c])}return de.throwError("invalid or unsupported content hash data",$.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return le(this,void 0,void 0,function*(){let r=tr(e);r=jt([$u(64),$u(r.length),r]),r.length%32!==0&&(r=jt([r,nt("0x",32-e.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",se(r));return n==null||n==="0x"?null:ua(n)})}}let Uu=null,v2=1;class x2 extends Mc{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),K(this,"anyNetwork",e==="any"),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch(r=>{}),this._ready().catch(r=>{});else{const r=Hr(new.target,"getNetwork")(e);r?(K(this,"_network",r),this.emit("network",r,null)):de.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return le(this,void 0,void 0,function*(){if(this._network==null){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch{}e==null&&(e=yield this.detectNetwork()),e||de.throwError("no network detected",$.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=e:K(this,"_network",e),this.emit
25("network",e,null))}return this._network})}get ready(){return mo(()=>this._ready().then(e=>e,e=>{if(!(e.code===$.errors.NETWORK_ERROR&&e.event==="noNetwork"))throw e}))}static getFormatter(){return Uu==null&&(Uu=new ne),Uu}static getNetwork(e){return X6(e??"homestead")}ccipReadFetch(e,r,n){return le(this,void 0,void 0,function*(){if(this.disableCcipRead||n.length===0)return null;const i=e.to.toLowerCase(),s=r.toLowerCase(),o=[];for(let a=0;a<n.length;a++){const c=n[a],u=c.replace("{sender}",i).replace("{data}",s),f=c.indexOf("{data}")>=0?null:JSON.stringify({data:s,sender:i}),d=yield zl({url:u,errorPassThrough:!0},f,(g,w)=>(g.status=w.statusCode,g));if(d.data)return d.data;const m=d.message||"unknown error";if(d.status>=400&&d.status<500)return de.throwError(`response not found during CCIP fetch: ${m}`,$.errors.SERVER_ERROR,{url:c,errorMessage:m});o.push(m)}return de.throwError(`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,$.errors.SERVER_ERROR,{urls:n,errorMessages:o})})}_getInternalBlockNumber(e){return le(this,void 0,void 0,function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const i=this._internalBlockNumber;try{const s=yield i;if(co()-s.respTime<=e)return s.blockNumber;break}catch{if(this._internalBlockNumber===i)break}}const r=co(),n=lt({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(i=>null,i=>i)}).then(({blockNumber:i,networkError:s})=>{if(s)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),s;const o=co();return i=J.from(i).toNumber(),i<this._maxInternalBlockNumber&&(i=this._maxInternalBlockNumber),this._maxInternalBlockNumber=i,this._setFastBlockNumber(i),{blockNumber:i,reqTime:r,respTime:o}});return this._internalBlockNumber=n,n.catch(i=>{this._internalBlockNumber===n&&(this._internalBlockNumber=null)}),(yield n).blockNumber})}poll(){return le(this,void 0,void 0,function*(){const e=v2++,r=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(i){this.emit("error",i);return}if(this._setFastBlockNumber(n),this.emit("poll",e,n),n===this._lastBlockNumber){this.emit("didPoll",e);return}if(this._emitted.block===-2&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)de.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",de.makeError("network block skew detected",$.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let i=this._emitted.block+1;i<=n;i++)this.emit("block",i);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach(i=>{if(i==="block")return;const s=this._emitted[i];s!=="pending"&&n-s>12&&delete this._emitted[i]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=n-1),this._events.forEach(i=>{switch(i.type){case"tx":{const s=i.hash;let o=this.getTransactionReceipt(s).then(a=>(!a||a.blockNumber==null||(this._emitted["t:"+s]=a.blockNumber,this.emit(s,a)),null)).catch(a=>{this.emit("error",a)});r.push(o);break}case"filter":{if(!i._inflight){i._inflight=!0,i._lastBlockNumber===-2&&(i._lastBlockNumber=n-1);const s=i.filter;s.fromBlock=i._lastBlockNumber+1,s.toBlock=n;const o=s.toBlock-this._maxFilterBlockRange;o>s.fromBlock&&(s.fromBlock=o),s.fromBlock<0&&(s.fromBlock=0);const a=this.getLogs(s).then(c=>{i._inflight=!1,c.length!==0&&c.forEach(u=>{u.blockNumber>i._lastBlockNumber&&(i._lastBlockNumber=u.blockNumber),this._emitted["b:"+u.blockHash]=u.blockNumber,this._emitted["t:"+u.transactionHash]=u.blockNumber,this.emit(s,u)})}).catch(c=>{this.emit("error",c),i._inflight=!1});r.push(a)}break}}}),this._lastBlockNumber=n,Promise.all(r).then(()=>{this.emit("didPoll",e)}).catch(i=>{this.emit("error",i)})})}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return le(this,void 0,void 0,function*(){return de.throwError("provider does not support network detection",$.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return le(this,void 0,void 0,function*(){const e=yield this._ready(),r=yield this.detectNetwork();if(e.chainId!==r.chainId){if(this.anyNetwork)return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit
25("network",r,e),yield qd(0),this._network;const n=de.makeError("underlying network changed",$.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:r});throw this.emit("error",n),n}return e})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(e=>{this._setFastBlockNumber(e)},e=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}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(typeof e!="number"||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=co();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then(r=>((this._fastBlockNumber==null||r>this._fastBlockNumber)&&(this._fastBlockNumber=r),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(e){this._fastBlockNumber!=null&&e<this._fastBlockNumber||(this._fastQueryDate=co(),(this._fastBlockNumber==null||e>this._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,r,n){return le(this,void 0,void 0,function*(){return this._waitForTransaction(e,r??1,n||0,null)})}_waitForTransaction(e,r,n,i){return le(this,void 0,void 0,function*(){const s=yield this.getTransactionReceipt(e);return(s?s.confirmations:0)>=r?s:new Promise((o,a)=>{const c=[];let u=!1;const f=function(){return u?!0:(u=!0,c.forEach(m=>{m()}),!1)},d=m=>{m.confirmations<r||f()||o(m)};if(this.on(e,d),c.push(()=>{this.removeListener(e,d)}),i){let m=i.startBlock,g=null;const w=A=>le(this,void 0,void 0,function*(){u||(yield qd(1e3),this.getTransactionCount(i.from).then(k=>le(this,void 0,void 0,function*(){if(!u){if(k<=i.nonce)m=A;else{{const _=yield this.getTransaction(e);if(_&&_.blockNumber!=null)return}for(g==null&&(g=m-3,g<i.startBlock&&(g=i.startBlock));g<=A;){if(u)return;const _=yield this.getBlockWithTransactions(g);for(let B=0;B<_.transactions.length;B++){const T=_.transactions[B];if(T.hash===e)return;if(T.from===i.from&&T.nonce===i.nonce){if(u)return;const N=yield this.waitForTransaction(T.hash,r);if(f())return;let M="replaced";T.data===i.data&&T.to===i.to&&T.value.eq(i.value)?M="repriced":T.data==="0x"&&T.from===T.to&&T.value.isZero()&&(M="cancelled"),a(de.makeError("transaction was replaced",$.errors.TRANSACTION_REPLACED,{cancelled:M==="replaced"||M==="cancelled",reason:M,replacement:this._wrapTransaction(T),hash:e,receipt:N}));return}}g++}}u||this.once("block",w)}}),k=>{u||this.once("block",w)}))});if(u)return;this.once("block",w),c.push(()=>{this.removeListener("block",w)})}if(typeof n=="number"&&n>0){const m=setTimeout(()=>{f()||a(de.makeError("timeout exceeded",$.errors.TIMEOUT,{timeout:n}))},n);m.unref&&m.unref(),c.push(()=>{clearTimeout(m)})}})})}getBlockNumber(){return le(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return le(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return J.from(e)}catch(r){return de.throwError("bad result from backend",$.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:r})}})}getBalance(e,r){return le(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield lt({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getBalance",n);try{return J.from(i)}catch(s){return de.throwError("bad result from backend",$.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:s})}})}getTransactionCount(e,r){return le(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield lt({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getTransactionCount",n);try{return J.from(i).toNumber()}catch(s){return de.throwError("bad result from backend",$.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:s})}})}getCode(e,r){return le(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield lt({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getCode",n);try{return se(i)}catch(s){return de.throwError("bad result from backend",$.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:s})}})}getStorageAt(e,r,n){return le(this,void 0,void 0,function*(){yield this.getNetwork();const i=yield lt({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Prom
25ise.resolve(r).then(o=>Ml(o))}),s=yield this.perform("getStorageAt",i);try{return se(s)}catch(o){return de.throwError("bad result from backend",$.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:s,error:o})}})}_wrapTransaction(e,r,n){if(r!=null&&Fi(r)!==32)throw new Error("invalid response - sendTransaction");const i=e;return r!=null&&e.hash!==r&&de.throwError("Transaction hash mismatch from Provider.sendTransaction.",$.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:r}),i.wait=(s,o)=>le(this,void 0,void 0,function*(){s==null&&(s=1),o==null&&(o=0);let a;s!==0&&n!=null&&(a={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n});const c=yield this._waitForTransaction(e.hash,s,o,a);return c==null&&s===0?null:(this._emitted["t:"+e.hash]=c.blockNumber,c.status===0&&de.throwError("transaction failed",$.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:c}),c)}),i}sendTransaction(e){return le(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Promise.resolve(e).then(s=>se(s)),n=this.formatter.transaction(e);n.confirmations==null&&(n.confirmations=0);const i=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const s=yield this.perform("sendTransaction",{signedTransaction:r});return this._wrapTransaction(n,s,i)}catch(s){throw s.transaction=n,s.transactionHash=n.hash,s}})}_getTransactionRequest(e){return le(this,void 0,void 0,function*(){const r=yield e,n={};return["from","to"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?this._getAddress(s):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?J.from(s):null))}),["type"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s??null))}),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?se(s):null))}),this.formatter.transactionRequest(yield lt(n))})}_getFilter(e){return le(this,void 0,void 0,function*(){e=yield e;const r={};return e.address!=null&&(r.address=this._getAddress(e.address)),["blockHash","topics"].forEach(n=>{e[n]!=null&&(r[n]=e[n])}),["fromBlock","toBlock"].forEach(n=>{e[n]!=null&&(r[n]=this._getBlockTag(e[n]))}),this.formatter.filter(yield lt(r))})}_call(e,r,n){return le(this,void 0,void 0,function*(){n>=p2&&de.throwError("CCIP read exceeded maximum redirections",$.errors.SERVER_ERROR,{redirects:n,transaction:e});const i=e.to,s=yield this.perform("call",{transaction:e,blockTag:r});if(n>=0&&r==="latest"&&i!=null&&s.substring(0,10)==="0x556f1830"&&Fi(s)%32===4)try{const o=It(s,4),a=It(o,0,32);J.from(a).eq(i)||de.throwError("CCIP Read sender did not match",$.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s});const c=[],u=J.from(It(o,32,64)).toNumber(),f=J.from(It(o,u,u+32)).toNumber(),d=It(o,u+32);for(let _=0;_<f;_++){const B=tc(d,_*32);B==null&&de.throwError("CCIP Read contained corrupt URL string",$.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s}),c.push(B)}const m=Io(o,64);J.from(It(o,100,128)).isZero()||de.throwError("CCIP Read callback selector included junk",$.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s});const g=It(o,96,100),w=Io(o,128),A=yield this.ccipReadFetch(e,m,c);A==null&&de.throwError("CCIP Read disabled or provided no URLs",$.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s});const k={to:i,data:qt([g,Cm([A,w])])};return this._call(k,r,n+1)}catch(o){if(o.code===$.errors.SERVER_ERROR)throw o}try{return se(s)}catch(o){return de.throwError("bad result from backend",$.errors.SERVER_ERROR,{method:"call",params:{transaction:e,blockTag:r},result:s,error:o})}})}call(e,r){return le(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield lt({transaction:this._getTransactionRequest(e),blockTag:this._getBlockTag(r),ccipReadEnabled:Promise.resolve(e.cci
25pReadEnabled)});return this._call(n.transaction,n.blockTag,n.ccipReadEnabled?0:-1)})}estimateGas(e){return le(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield lt({transaction:this._getTransactionRequest(e)}),n=yield this.perform("estimateGas",r);try{return J.from(n)}catch(i){return de.throwError("bad result from backend",$.errors.SERVER_ERROR,{method:"estimateGas",params:r,result:n,error:i})}})}_getAddress(e){return le(this,void 0,void 0,function*(){e=yield e,typeof e!="string"&&de.throwArgumentError("invalid address or ENS name","name",e);const r=yield this.resolveName(e);return r==null&&de.throwError("ENS name not configured",$.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(e)})`}),r})}_getBlock(e,r){return le(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;let n=-128;const i={includeTransactions:!!r};if(ve(e,32))i.blockHash=e;else try{i.blockTag=yield this._getBlockTag(e),ve(i.blockTag)&&(n=parseInt(i.blockTag.substring(2),16))}catch{de.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",e)}return mo(()=>le(this,void 0,void 0,function*(){const s=yield this.perform("getBlock",i);if(s==null)return i.blockHash!=null&&this._emitted["b:"+i.blockHash]==null||i.blockTag!=null&&n>this._emitted.block?null:void 0;if(r){let o=null;for(let c=0;c<s.transactions.length;c++){const u=s.transactions[c];if(u.blockNumber==null)u.confirmations=0;else if(u.confirmations==null){o==null&&(o=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let f=o-u.blockNumber+1;f<=0&&(f=1),u.confirmations=f}}const a=this.formatter.blockWithTransactions(s);return a.transactions=a.transactions.map(c=>this._wrapTransaction(c)),a}return this.formatter.block(s)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return le(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return mo(()=>le(this,void 0,void 0,function*(){const n=yield this.perform("getTransaction",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;const i=this.formatter.transactionResponse(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return this._wrapTransaction(i)}),{oncePoll:this})})}getTransactionReceipt(e){return le(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return mo(()=>le(this,void 0,void 0,function*(){const n=yield this.perform("getTransactionReceipt",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;if(n.blockHash==null)return;const i=this.formatter.receipt(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return i}),{oncePoll:this})})}getLogs(e){return le(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield lt({filter:this._getFilter(e)}),n=yield this.perform("getLogs",r);return n.forEach(i=>{i.removed==null&&(i.removed=!1)}),ne.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)})}getEtherPrice(){return le(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return le(this,void 0,void 0,function*(){if(e=yield e,typeof e=="number"&&e<0){e%1&&de.throwArgumentError("invalid BlockTag","blockTag",e);let r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return r+=e,r<0&&(r=0),this.formatter.blockTag(r)}return this.formatter.blockTag(e)})}getResolver(e){return le(this,void 0,void 0,function*(){let r=e;for(;;){if(r===""||r==="."||e!=="eth"&&r==="eth")return null;const n=yield this._getResolver(r,"getResolver");if(n!=null){const i=new Vd(this,n,e);return r!==e&&!(yield i.supportsWildcard())?null:i}r=r.split(".").slice(1).join(".")}})}_getResolver(e,r){return le(this,void 0,void 0,function*(){r==null&&(r="ENS");const n=yield this.getNetwork();n.ensAddress||de.throwError("network does not support ENS",$.errors.UNSUPPORTED_OPERATION,{operation:r,network:n.name});try{const i=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+Ya(e).substring(2)});return this.formatter.callAddress(i)}catch{}return null})}resolveName(e){return le(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(n){if(ve(e))throw n}typeof e!="string"&&de.throwArgumentError("invalid ENS name","name",e);const r=yield this.getResolver(e);return r?yield r.getAddress():null})}lookupAddress(e){return le(this,void 0,void 0,function*(){e=yield e,e=this.formatter.address(e);const r=e.substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"lookupAddress");if(n==null)return null;const i=tc(yield this.call({to:n,data:"0x691f3431"+Ya(r).substring(2)}),0);return(yield this.resolveName(i))!=e?null:i})}getAvatar(e){return le(this,void 0,void 0,function*(){let r=null;if(ve(e)){const s=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",o=yield this._getResolver(s,"getAvatar");if(!o)return null;r=new Vd(this,o,s);try{const a=yield r.getAvatar();if(a)return a.url}catch(a){if(a.code!==$.errors.CALL_EXCEPTION)throw a}try{const a=tc(yield this.call({to:o,data:"0x691f3431"+Ya(s).substring(2)}),0);r=yield this.getResolver(a)}catch(a){if(a.code!==$.errors.CALL_EXCEPTION)throw a;return null}}else if(r=yield this.getResolver(e),!r)return null;const n=yield r.getAvatar();return n==null?null:n.url})}perform(e,r){return de.throwError(e+" not implemented",$.errors.NOT_IMPLEMENT
25ED,{operation:e})}_startEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_stopEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_addEventListener(e,r,n){const i=new y2(Yi(e),r,n);return this._events.push(i),this._startEvent(i),this}on(e,r){return this._addEventListener(e,r,!1)}once(e,r){return this._addEventListener(e,r,!0)}emit(e,...r){let n=!1,i=[],s=Yi(e);return this._events=this._events.filter(o=>o.tag!==s?!0:(setTimeout(()=>{o.listener.apply(this,r)},0),n=!0,o.once?(i.push(o),!1):!0)),i.forEach(o=>{this._stopEvent(o)}),n}listenerCount(e){if(!e)return this._events.length;let r=Yi(e);return this._events.filter(n=>n.tag===r).length}listeners(e){if(e==null)return this._events.map(n=>n.listener);let r=Yi(e);return this._events.filter(n=>n.tag===r).map(n=>n.listener)}off(e,r){if(r==null)return this.removeAllListeners(e);const n=[];let i=!1,s=Yi(e);return this._events=this._events.filter(o=>o.tag!==s||o.listener!=r||i?!0:(i=!0,n.push(o),!1)),n.forEach(o=>{this._stopEvent(o)}),this}removeAllListeners(e){let r=[];if(e==null)r=this._events,this._events=[];else{const n=Yi(e);this._events=this._events.filter(i=>i.tag!==n?!0:(r.push(i),!1))}return r.forEach(n=>{this._stopEvent(n)}),this}}var dn=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(n.next(f))}catch(d){o(d)}}function c(f){try{u(n.throw(f))}catch(d){o(d)}}function u(f){f.done?s(f.value):i(f.value).then(a,c)}u((n=n.apply(t,e||[])).next())})};const dt=new $(Fc),A2=["call","estimateGas"];function bo(t,e){if(t==null)return null;if(typeof t.message=="string"&&t.message.match("reverted")){const r=ve(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if(typeof t=="object"){for(const r in t){const n=bo(t[r],e);if(n)return n}return null}if(typeof t=="string")try{return bo(JSON.parse(t),e)}catch{}return null}function Bm(t,e,r){const n=r.transaction||r.signedTransaction;if(t==="call"){const s=bo(e,!0);if(s)return s.data;dt.throwError("missing revert data in call exception; Transaction reverted without a reason string",$.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if(t==="estimateGas"){let s=bo(e.body,!1);s==null&&(s=bo(e,!1)),s&&dt.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",$.errors.UNPREDICTABLE_GAS_LIMIT,{reason:s.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===$.errors.SERVER_ERROR&&e.error&&typeof e.error.message=="string"?i=e.error.message:typeof e.body=="string"?i=e.body:typeof e.responseText=="string"&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&dt.throwError("insufficient funds for intrinsic transaction cost",$.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&dt.throwError("nonce has already been used",$.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&dt.throwError("replacement fee too low",$.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&dt.throwError("legacy pre-eip-155 transactions not supported",$.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),A2.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&dt.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",$.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function Kd(t){return new Promise(function(e){setTimeout(e,t)})}function E2(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function uo(t){return t&&t.toLowerCase()}const Bf={};class Om extends fa{constructor(e,r,n){if(super(),e!==Bf)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");K(this,"provider",r),n==null&&(n=0),typeof n=="string"?(K(this,"_address",this.provider.formatter.address(n)),K(this,"_index",null)):typeof n=="number"?(K(this,"_index",n),K(this,"_address",null)):dt.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(e){return dt.throwError("cannot alter JSON-RPC Signer connection",$.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new P2(Bf,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&&dt.throwError("unknown account #"+this._index,$.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=mt(e);const r=this.getAddress().then(n=>(n&&(n=n.toLowerCase()),n));
25if(e.gasLimit==null){const n=mt(e);n.from=r,e.gasLimit=this.provider.estimateGas(n)}return e.to!=null&&(e.to=Promise.resolve(e.to).then(n=>dn(this,void 0,void 0,function*(){if(n==null)return null;const i=yield this.provider.resolveName(n);return i==null&&dt.throwArgumentError("provided ENS name resolves to null","tx.to",n),i}))),lt({tx:lt(e),sender:r}).then(({tx:n,sender:i})=>{n.from!=null?n.from.toLowerCase()!==i&&dt.throwArgumentError("from address mismatch","transaction",e):n.from=i;const s=this.provider.constructor.hexlifyTransaction(n,{from:!0});return this.provider.send("eth_sendTransaction",[s]).then(o=>o,o=>(typeof o.message=="string"&&o.message.match(/user denied/i)&&dt.throwError("user rejected transaction",$.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),Bm("sendTransaction",o,s)))})}signTransaction(e){return dt.throwError("signing transactions is unsupported",$.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return dn(this,void 0,void 0,function*(){const r=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(e);try{return yield mo(()=>dn(this,void 0,void 0,function*(){const i=yield this.provider.getTransaction(n);if(i!==null)return this.provider._wrapTransaction(i,n,r)}),{oncePoll:this.provider})}catch(i){throw i.transactionHash=n,i}})}signMessage(e){return dn(this,void 0,void 0,function*(){const r=typeof e=="string"?tr(e):e,n=yield this.getAddress();try{return yield this.provider.send("personal_sign",[se(r),n.toLowerCase()])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&dt.throwError("user rejected signing",$.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),i}})}_legacySignMessage(e){return dn(this,void 0,void 0,function*(){const r=typeof e=="string"?tr(e):e,n=yield this.getAddress();try{return yield this.provider.send("eth_sign",[n.toLowerCase(),se(r)])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&dt.throwError("user rejected signing",$.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),i}})}_signTypedData(e,r,n){return dn(this,void 0,void 0,function*(){const i=yield Yt.resolveNames(e,r,n,o=>this.provider.resolveName(o)),s=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[s.toLowerCase(),JSON.stringify(Yt.getPayload(i.domain,r,i.value))])}catch(o){throw typeof o.message=="string"&&o.message.match(/user denied/i)&&dt.throwError("user rejected signing",$.errors.ACTION_REJECTED,{action:"_signTypedData",from:s,messageData:{domain:i.domain,types:r,value:i.value}}),o}})}unlock(e){return dn(this,void 0,void 0,function*(){const r=this.provider,n=yield this.getAddress();return r.send("personal_unlockAccount",[n.toLowerCase(),e,null])})}}class P2 extends Om{sendTransaction(e){return this.sendUncheckedTransaction(e).then(r=>({hash:r,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:n=>this.provider.waitForTransaction(r,n)}))}}const S2={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class _2 extends x2{constructor(e,r){let n=r;n==null&&(n=new Promise((i,s)=>{setTimeout(()=>{this.detectNetwork().then(o=>{i(o)},o=>{s(o)})},0)})),super(n),e||(e=Hr(this.constructor,"defaultUrl")()),typeof e=="string"?K(this,"connection",Object.freeze({url:e})):K(this,"connection",Object.freeze(mt(e))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(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 dn(this,void 0,void 0,function*(){yield Kd(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch{try{e=yield this.send("net_version",[])}catch{}}if(e!=null){const r=Hr(this.constructor,"getNetwork");try{return r(J.from(e).toNumber())}catch(n){return dt.throwError("could not detect network",$.errors.NETWORK_E
25RROR,{chainId:e,event:"invalidNetwork",serverError:n})}}return dt.throwError("could not detect network",$.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new Om(Bf,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(e=>e.map(r=>this.formatter.address(r)))}send(e,r){const n={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:vn(n),provider:this});const i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];const s=zl(this.connection,JSON.stringify(n),E2).then(o=>(this.emit("debug",{action:"response",request:n,response:o,provider:this}),o),o=>{throw this.emit("debug",{action:"response",error:o,request:n,provider:this}),o});return i&&(this._cache[e]=s,setTimeout(()=>{this._cache[e]=null},0)),s}prepareRequest(e,r){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[uo(r.address),r.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[uo(r.address),r.blockTag]];case"getCode":return["eth_getCode",[uo(r.address),r.blockTag]];case"getStorageAt":return["eth_getStorageAt",[uo(r.address),nt(r.position,32),r.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[r.signedTransaction]];case"getBlock":return r.blockTag?["eth_getBlockByNumber",[r.blockTag,!!r.includeTransactions]]:r.blockHash?["eth_getBlockByHash",[r.blockHash,!!r.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[r.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[r.transactionHash]];case"call":return["eth_call",[Hr(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0}),r.blockTag]];case"estimateGas":return["eth_estimateGas",[Hr(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0})]];case"getLogs":return r.filter&&r.filter.address!=null&&(r.filter.address=uo(r.filter.address)),["eth_getLogs",[r.filter]]}return null}perform(e,r){return dn(this,void 0,void 0,function*(){if(e==="call"||e==="estimateGas"){const i=r.transaction;if(i&&i.type!=null&&J.from(i.type).isZero()&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const s=yield this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(r=mt(r),r.transaction=mt(i),delete r.transaction.type)}}const n=this.prepareRequest(e,r);n==null&&dt.throwError(e+" not implemented",$.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(n[0],n[1])}catch(i){return Bm(e,i,r)}})}_startEvent(e){e.tag==="pending"&&this._startPending(),super._startEvent(e)}_startPending(){if(this._pendingFilter!=null)return;const e=this,r=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=r,r.then(function(n){function i(){e.send("eth_getFilterChanges",[n]).then(function(s){if(e._pendingFilter!=r)return null;let o=Promise.resolve();return s.forEach(function(a){e._emitted["t:"+a.toLowerCase()]="pending",o=o.then(function(){return e.getTransaction(a).then(function(c){return e.emit("pending",c),null})})}),o.then(function(){return Kd(1e3)})}).then(function(){if(e._pendingFilter!=r){e.send("eth_uninstallFilter",[n]);return}return setTimeout(function(){i()},0),null}).catch(s=>{})}return i(),n}).catch(n=>{})}_stopEvent(e){e.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,r){const n=mt(S2);if(r)for(const s in r)r[s]&&(n[s]=!0);vb(e,n);const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(s){if(e[s]==null)return;const o=Ml(J.from(e[s]));s==="gasLimit"&&(s="gas"),i[s]=o}),["from","to","data"].forEach(function(s){e[s]!=null&&(i[s]=se(e[s]))}),e.accessList&&(i.accessList=Js(e.accessList)),i}}const Wd=new $(Fc);let I2=1;function Qd(t,e){const r="Web3LegacyFetcher";return function(n,i){const s={method:n,params:i,id:I2++,jsonrpc:"2.0"};return new Promise((o,a)=>{this.emit("debug",{action:"request",fetcher:r,request:vn(s),provider:this}),e(s,(c,u)=>
25{if(c)return this.emit("debug",{action:"response",fetcher:r,error:c,request:s,provider:this}),a(c);if(this.emit("debug",{action:"response",fetcher:r,request:s,response:u,provider:this}),u.error){const f=new Error(u.error.message);return f.code=u.error.code,f.data=u.error.data,a(f)}o(u.result)})})}}function N2(t){return function(e,r){r==null&&(r=[]);const n={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:vn(n),provider:this}),t.request(n).then(i=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:i,provider:this}),i),i=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:i,provider:this}),i})}}class WP extends _2{constructor(e,r){e==null&&Wd.throwArgumentError("missing provider","provider",e);let n=null,i=null,s=null;typeof e=="function"?(n="unknown:",i=e):(n=e.host||e.path||"",!n&&e.isMetaMask&&(n="metamask"),s=e,e.request?(n===""&&(n="eip-1193:"),i=N2(e)):e.sendAsync?i=Qd(e,e.sendAsync.bind(e)):e.send?i=Qd(e,e.send.bind(e)):Wd.throwArgumentError("unsupported provider","provider",e),n||(n="unknown:")),super(n,r),K(this,"jsonRpcFetchFunc",i),K(this,"provider",s)}send(e,r){return this.jsonRpcFetchFunc(e,r)}}const k2=["wei","kwei","mwei","gwei","szabo","finney","ether"];function QP(t,e){if(typeof e=="string"){const r=k2.indexOf(e);r!==-1&&(e=3*r)}return Qa(t,e??18)}const M2="modulepreload",T2=function(t){return"/"+t},Jd={},Fm=function(e,r,n){let i=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=o?.nonce||o?.getAttribute("nonce");i=Promise.allSettled(r.map(c=>{if(c=T2(c),c in Jd)return;Jd[c]=!0;const u=c.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${f}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":M2,u||(d.as="script"),d.crossOrigin="",d.href=c,a&&d.setAttribute("nonce",a),document.head.appendChild(d),u)return new Promise((m,g)=>{d.addEventListener("load",m),d.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})},R2="1.2.3";let Wt=class Of extends Error{constructor(e,r={}){const n=r.cause instanceof Of?r.cause.details:r.cause?.message?r.cause.message:r.details,i=r.cause instanceof Of&&r.cause.docsPath||r.docsPath,s=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...i?[`Docs: https://abitype.dev${i}`]:[],...n?[`Details: ${n}`]:[],`Version: abitype@${R2}`].join(`
26`);super(s),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),r.cause&&(this.cause=r.cause),this.details=n,this.docsPath=i,this.metaMessages=r.metaMessages,this.shortMessage=e}};function In(t,e){return t.exec(e)?.groups}const $m=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Lm=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,Um=/^\(.+?\).*?$/,Yd=/^tuple(?<array>(\[(\d*)\])*)$/;function Ff(t){let e=t.type;if(Yd.test(t.type)&&"components"in t){e="(";const r=t.components.length;for(let i=0;i<r;i++){const s=t.components[i];e+=Ff(s),i<r-1&&(e+=", ")}const n=In(Yd,t.type);return e+=`)${n?.array||""}`,Ff({...t,type:e})}return"indexed"in t&&t.indexed&&(e=`${e}
26 indexed`),t.name?`${e} ${t.name}`:e}function ts(t){let e="";const r=t.length;for(let n=0;n<r;n++){const i=t[n];e+=Ff(i),n!==r-1&&(e+=", ")}return e}function pc(t){return t.type==="function"?`function ${t.name}(${ts(t.inputs)})${t.stateMutability&&t.stateMutability!=="nonpayable"?` ${t.stateMutability}`:""}${t.outputs?.length?` returns (${ts(t.outputs)})`:""}`:t.type==="event"?`event ${t.name}(${ts(t.inputs)})`:t.type==="error"?`error ${t.name}(${ts(t.inputs)})`:t.type==="constructor"?`constructor(${ts(t.inputs)})${t.stateMutability==="payable"?" payable":""}`:t.type==="fallback"?`fallback() external${t.stateMutability==="payable"?" payable":""}`:"receive() external payable"}const Dm=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function C2(t){return Dm.test(t)}function B2(t){return In(Dm,t)}const zm=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function O2(t){return zm.test(t)}function F2(t){return In(zm,t)}const qm=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function $2(t){return qm.test(t)}function L2(t){return In(qm,t)}const jm=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function $c(t){return jm.test(t)}function U2(t){return In(jm,t)}const Gm=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function D2(t){return Gm.test(t)}function z2(t){return In(Gm,t)}const Hm=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function q2(t){return Hm.test(t)}function j2(t){return In(Hm,t)}const G2=/^receive\(\) external payable$/;function H2(t){return G2.test(t)}const Zd=new Set(["memory","indexed","storage","calldata"]),V2=new Set(["indexed"]),$f=new Set(["calldata","memory","storage"]);class K2 extends Wt{constructor({signature:e}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(e,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}class W2 extends Wt{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class Q2 extends Wt{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class J2 extends Wt{constructor({params:e}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(e,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}class Y2 extends Wt{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class Z2 extends Wt{constructor({param:e,name:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`"${r}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class X2 extends Wt{constructor({param:e,type:r,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${r?` in "${r}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class e5 extends Wt{constructor({param:e,type:r,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${r?` in "${r}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${n}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class t5 extends Wt{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invali
26d."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class Ys extends Wt{constructor({signature:e,type:r}){super(`Invalid ${r} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class r5 extends Wt{constructor({signature:e}){super("Unknown signature.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class n5 extends Wt{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class i5 extends Wt{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class s5 extends Wt{constructor({current:e,depth:r}){super("Unbalanced parentheses.",{metaMessages:[`"${e.trim()}" has too many ${r>0?"opening":"closing"} parentheses.`],details:`Depth "${r}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function o5(t,e,r){let n="";if(r)for(const i of Object.entries(r)){if(!i)continue;let s="";for(const o of i[1])s+=`[${o.type}${o.name?`:${o.name}`:""}]`;n+=`(${i[0]}{${s}})`}return e?`${e}:${t}${n}`:`${t}${n}`}const Du=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function Lf(t,e={}){if($2(t))return a5(t,e);if(O2(t))return c5(t,e);if(C2(t))return u5(t,e);if(D2(t))return f5(t,e);if(q2(t))return l5(t);if(H2(t))return{type:"receive",stateMutability:"payable"};throw new r5({signature:t})}function a5(t,e={}){const r=L2(t);if(!r)throw new Ys({signature:t,type:"function"});const n=er(r.parameters),i=[],s=n.length;for(let a=0;a<s;a++)i.push(En(n[a],{modifiers:$f,structs:e,type:"function"}));const o=[];if(r.returns){const a=er(r.returns),c=a.length;for(let u=0;u<c;u++)o.push(En(a[u],{modifiers:$f,structs:e,type:"function"}))}return{name:r.name,type:"function",stateMutability:r.stateMutability??"nonpayable",inputs:i,outputs:o}}function c5(t,e={}){const r=F2(t);if(!r)throw new Ys({signature:t,type:"event"});const n=er(r.parameters),i=[],s=n.length;for(let o=0;o<s;o++)i.push(En(n[o],{modifiers:V2,structs:e,type:"event"}));return{name:r.name,type:"event",inputs:i}}function u5(t,e={}){const r=B2(t);if(!r)throw new Ys({signature:t,type:"error"});const n=er(r.parameters),i=[],s=n.length;for(let o=0;o<s;o++)i.push(En(n[o],{structs:e,type:"error"}));return{name:r.name,type:"error",inputs:i}}function f5(t,e={}){const r=z2(t);if(!r)throw new Ys({signature:t,type:"constructor"});const n=er(r.parameters),i=[],s=n.length;for(let o=0;o<s;o++)i.push(En(n[o],{structs:e,type:"constructor"}));return{type:"constructor",stateMutability:r.stateMutability??"nonpayable",inputs:i}}function l5(t){const e=j2(t);if(!e)throw new Ys({signature:t,type:"fallback"});return{type:"fallback",stateMutability:e.stateMutability??"nonpayable"}}const d5=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,h5=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,p5=/^u?int$/;function En(t,e){const r=o5(t,e?.type,e?.structs);if(Du.has(r))return Du.get(r);const n=Um.test(t),i=In(n?h5:d5,t);
26if(!i)throw new Y2({param:t});if(i.name&&g5(i.name))throw new Z2({param:t,name:i.name});const s=i.name?{name:i.name}:{},o=i.modifier==="indexed"?{indexed:!0}:{},a=e?.structs??{};let c,u={};if(n){c="tuple";const d=er(i.type),m=[],g=d.length;for(let w=0;w<g;w++)m.push(En(d[w],{structs:a}));u={components:m}}else if(i.type in a)c="tuple",u={components:a[i.type]};else if(p5.test(i.type))c=`${i.type}256`;else if(i.type==="address payable")c="address";else if(c=i.type,e?.type!=="struct"&&!Vm(c))throw new Q2({type:c});if(i.modifier){if(!e?.modifiers?.has?.(i.modifier))throw new X2({param:t,type:e?.type,modifier:i.modifier});if($f.has(i.modifier)&&!y5(c,!!i.array))throw new e5({param:t,type:e?.type,modifier:i.modifier})}const f={type:`${c}${i.array??""}`,...s,...o,...u};return Du.set(r,f),f}function er(t,e=[],r="",n=0){const i=t.trim().length;for(let s=0;s<i;s++){const o=t[s],a=t.slice(s+1);switch(o){case",":return n===0?er(a,[...e,r.trim()]):er(a,e,`${r}${o}`,n);case"(":return er(a,e,`${r}${o}`,n+1);case")":return er(a,e,`${r}${o}`,n-1);default:return er(a,e,`${r}${o}`,n)}}if(r==="")return e;if(n!==0)throw new s5({current:r,depth:n});return e.push(r.trim()),e}function Vm(t){return t==="address"||t==="bool"||t==="function"||t==="string"||$m.test(t)||Lm.test(t)}const m5=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function g5(t){return t==="address"||t==="bool"||t==="function"||t==="string"||t==="tuple"||$m.test(t)||Lm.test(t)||m5.test(t)}function y5(t,e){return e||t==="bytes"||t==="string"||t==="tuple"}function ql(t){const e={},r=t.length;for(let o=0;o<r;o++){const a=t[o];if(!$c(a))continue;const c=U2(a);if(!c)throw new Ys({signature:a,type:"struct"});const u=c.properties.split(";"),f=[],d=u.length;for(let m=0;m<d;m++){const w=u[m].trim();if(!w)continue;const A=En(w,{type:"struct"});f.push(A)}if(!f.length)throw new n5({signature:a});e[c.name]=f}const n={},i=Object.entries(e),s=i.length;for(let o=0;o<s;o++){const[a,c]=i[o];n[a]=Km(c,e)}return n}const b5=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function Km(t=[],e={},r=new Set){const n=[],i=t.length;for(let s=0;s<i;s++){const o=t[s];if(Um.test(o.type))n.push(o);else{const c=In(b5,o.type);if(!c?.type)throw new t5({abiParameter:o});const{array:u,type:f}=c;if(f in e){if(r.has(f))throw new i5({type:f});n.push({...o,type:`tuple${u??""}`,components:Km(e[f],e,new Set([...r,f]))})}else if(Vm(f))n.push(o);else throw new W2({type:f})}}return n}function Wm(t){const e=ql(t),r=[],n=t.length;for(let i=0;i<n;i++){const s=t[i];$c(s)||r.push(Lf(s,e))}return r}function Xd(t){let e;if(typeof t=="string")e=Lf(t);else{const r=ql(t),n=t.length;for(let i=0;i<n;i++){const s=t[i];if(!$c(s)){e=Lf(s,r);break}}}if(!e)throw new K2({signature:t});return e}function eh(t){const e=[];if(typeof t=="string"){const r=er(t),n=r.length;for(let i=0;i<n;i++)e.push(En(r[i],{modifiers:Zd}))}else{const r=ql(t),n=t.length;for(let i=0;i<n;i++){const s=t[i];if($c(s))continue;const o=er(s),a=o.length;for(let c=0;c<a;c++)e.push(En(o[c],{modifiers:Zd,structs:r}))}}if(e.length===0)throw new J2({params:t});return e}function te(t,e,r){const n=t[e.name];if(typeof n=="function")return n;const i=t[r];return typeof i=="function"?i:s=>e(t,s)}function Nr(t,{includeName:e=!1}={}){if(t.type!=="function"&&t.type!=="event"&&t.type!=="error")throw new R5(t.type);return`${t.name}(${Lc(t.inputs,{includeName:e})})`}function Lc(t,{includeName:e=!1}={}){return t?t.map(r=>w5(r,{includeName:e})).join(e?", ":","):""}function w5(t,{includeName:e}){return t.type.startsWith("tuple")?`(${Lc(t.components,{includeName:e})})${t.type.slice(5)}`:t.type+(e&&t.name?` ${t.name}`:"")}function kr(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}function rt(t){return kr(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}const Qm="2.54.6";let zu={getDocsUrl:({docsBaseUrl:t,docsPath:e="",docsSlug:r})=>e?`${t??"https://viem.sh"}${e}${r?`#${r}`:""}`:void 0,version:`viem@${Qm}`}
vendor: 10,082 bytes, lines 26-46
26,q=class Uf extends Error{constructor(e,r={}){const n=r.cause instanceof Uf?r.cause.details:r.cause?.message?r.cause.message:r.details,i=r.cause instanceof Uf&&r.cause.docsPath||r.docsPath,s=zu.getDocsUrl?.({...r,docsPath:i}),o=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...n?[`Details: ${n}`]:[],...zu.version?[`Version: ${zu.version}`]:[]].join(`
27`);super(o,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=i,this.metaMessages=r.metaMessages,this.name=r.name??this.name,this.shortMessage=e,this.version=Qm}walk(e){return Jm(this,e)}};function Jm(t,e){return e?.(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause!==void 0?Jm(t.cause,e):e?null:t}class v5 extends q{constructor({docsPath:e}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
28`),{docsPath:e,name:"AbiConstructorNotFoundError"})}}class th extends q{constructor({docsPath:e}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
29`),{docsPath:e,name:"AbiConstructorParamsNotFoundError"})}}class Ym extends q{constructor({data:e,params:r,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join(`
30`),{metaMessages:[`Params: (${Lc(r,{includeName:!0})})`,`Data:   ${e} (${n} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=r,this.size=n}}class da extends q{constructor({cause:e}={}){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError",cause:e})}}class x5 extends q{constructor({expectedLength:e,givenLength:r,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${r}`].join(`
31`),{name:"AbiEncodingArrayLengthMismatchError"})}}class A5 extends q{constructor({expectedSize:e,value:r}){super(`Size of bytes "${r}" (bytes${rt(r)}) does not match expected size (bytes${e}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class E5 extends q{constructor({expectedLength:e,givenLength:r}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${r}`].join(`
32`),{name:"AbiEncodingLengthMismatchError"})}}class P5 extends q{constructor(e,{docsPath:r}){super([`Arguments (\`args\`) were provided to "${e}", but "${e}" on the ABI does not contain any parameters (\`inputs\`).`,"Cannot encode error result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the inputs exist on it."].join(`
33`),{docsPath:r,name:"AbiErrorInputsNotFoundError"})}}class rh extends q{constructor(e,{docsPath:r}={}){super([`Error ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it."].join(`
34`),{docsPath:r,name:"AbiErrorNotFoundError"})}}class Zm extends q{constructor(e,{docsPath:r,cause:n}){super([`Encoded error signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${e}.`].join(`
35`),{docsPath:r,name:"AbiErrorSignatureNotFoundError",cause:n}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}}class S5 extends q{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e,name:"AbiEventSignatureEmptyTopicsError"})}}class _5 extends q{constructor(e,{docsPath:r}){super([`Encoded event signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://4byte.sourcify.dev/?q=${e}.`].join(`
36`),{docsPath:r,name:"AbiEventSignatureNotFoundError"})}}class nh extends q{constructor(e,{docsPath:r}={}){super([`Event ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(`
37`),{docsPath:r,name:"AbiEventNotFoundError"})}}class Bs extends q{constructor(e,{docsPath:r}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
38`),{docsPath:r,name:"AbiFunctionNotFoundError"})}}class Xm extends q{constructor(e,{docsPath:r}){super([`Function "${e}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(`
39`),{docsPath:r,name:"AbiFunctionOutputsNotFoundError"})}}class I5 extends q{constructor(e,{docsPath:r}){super([`Encoded function signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it.",`You can look up the signature here: https://4byte.sourcify.dev/?q=${e}.`].join(`
40`),{docsPath:r,name:"AbiFunctionSignatureNotFoundError"})}}class N5 extends q{constructor(e,r){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${Nr(e.abiItem)}\`, and`,`\`${r.type}\` in \`${Nr(r.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}let k5=class extends q{constructor({expectedSize:e,givenSize:r}){super(`Expected bytes${e}, got bytes${r}.`,{name:"BytesSizeMismatchError"})}};class mc extends q{constructor({abiItem:e,data:r,params:n,size:i}){super([`Data size of ${i} bytes is too small for non-indexed event parameters.`].join(`
41`),{metaMessages:[`Params: (${Lc(n,{includeName:!0})})`,`Data:   ${r} (${i} bytes)`],name:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e,this.data=r,this.params=n,this.size=i}}class jl extends q{constructor({abiItem:e,param:r}){super([`Expected a topic for indexed event parameter${r.name?` "${r.name}"`:""} on event "${Nr(e,{includeName:!0})}".`].join(`
42`),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}}class M5 extends q{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
43`),{docsPath:r,name:"InvalidAbiEncodingType"})}}class T5 extends q{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
44`),{docsPath:r,name:"InvalidAbiDecodingType"})}}let e1=class extends q{constructor(e){super([`Value "${e}" is not a valid array.`].join(`
45`),{name:"InvalidArrayError"})}};class R5 extends q{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
46`),{name:"InvalidDefinitionTypeError"})}}class C5 extends q{constructor(e){super(`Filter type "${e}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}let t1=class extends q{constructor({offset:e,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`,{name:"SliceOffsetOutOfBoundsError"})}},r1=class extends q{constructor({size:e,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${r}).`,{name:"SizeExceedsPaddingSizeError"})}};class ih extends q{constructor({size:e,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} is expected to be ${r} ${n} long, but is ${e} ${n} long.`,{name:"InvalidBytesLengthError"})}}function Zs(t,{dir:e,size:r=32}={}){return typeof t=="string"?Jn(t,{dir:e,size:r}):B5(t,{dir:e,size:r})}function Jn(t,{dir:e,size:r=32}={}){if(r===null)return t;const n=t.replace("0x","");if(n.length>r*2)throw new r1({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n[e==="right"?"padEnd":"padStart"](r*2,"0")}`}function B5(t,{dir:e,size:r=32}={}){if(r===null)return t;if(t.length>r)throw new r1({size:t.length,targetSize:r,type:"bytes"});const n=new Uint8Array(r);for(let i=0;i<r;i++){const s=e==="right";n[s?i:r-i-1]=t[s?i:t.length-i-1]}return n}let Gl=class extends q{constructor({max:e,min:r,signed:n,size:i,value:s}){super(`Number "${s}" is not in safe ${i?`${i*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${r} to ${e})`:`(above ${r})`}`,{name:"IntegerOutOfRangeError"})}},O5=class extends q{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}};class F5 extends q{constructor(e){super(`Hex value "${e}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}let $5=class extends q{constructor({givenSize:e,maxSize:r}
46){super(`Size cannot exceed ${r} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}};function rr(t,{dir:e="left"}={}){let r=typeof t=="string"?t.replace("0x",""):t,n=0;for(let i=0;i<r.length-1&&r[e==="left"?i:r.length-i-1].toString()==="0";i++)n++;return r=e==="left"?r.slice(n):r.slice(0,r.length-n),typeof t=="string"?(r.length===1&&e==="right"&&(r=`${r}0`),`0x${r.length%2===1?`0${r}`:r}`):r}function Br(t,{size:e}){if(rt(t)>e)throw new $5({givenSize:rt(t),maxSize:e})}function bt(t,e={}){const{signed:r}=e;e.size&&Br(t,{size:e.size});const n=BigInt(t);if(!r)return n;const i=(t.length-2)/2,s=(1n<<BigInt(i)*8n-1n)-1n;return n<=s?n:n-BigInt(`0x${"f".padStart(i*2,"f")}`)-1n}function L5(t,e={}){let r=t;if(e.size&&(Br(r,{size:e.size}),r=rr(r)),rr(r)==="0x00")return!1;if(rr(r)==="0x01")return!0;throw new F5(r)}function hr(t,e={}){const r=bt(t,e),n=Number(r);if(!Number.isSafeInteger(n))throw new Gl({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:e.signed,size:e.size,value:`${r}n`});return n}const U5=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Ht(t,e={}){return typeof t=="number"||typeof t=="bigint"?W(t,e):typeof t=="string"?No(t,e):typeof t=="boolean"?n1(t,e):pt(t,e)}function n1(t,e={}){const r=`0x${Number(t)}`;return typeof e.size=="number"?(Br(r,{size:e.size}),Zs(r,{size:e.size})):r}function pt(t,e={}){let r="";for(let i=0;i<t.length;i++)r+=U5[t[i]];const n=`0x${r}`;return typeof e.size=="number"?(Br(n,{size:e.size}),Zs(n,{dir:"right",size:e.size})):n}function W(t,e={}){const{signed:r,size:n}=e,i=BigInt(t);let s;n?r?s=(1n<<BigInt(n)*8n-1n)-1n:s=2n**(BigInt(n)*8n)-1n:typeof t=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof s=="bigint"&&r?-s-1n:0;if(s&&i>s||i<o){const c=typeof t=="bigint"?"n":"";throw new Gl({max:s?`${s}${c}`:void 0,min:`${o}${c}`,signed:r,size:n,value:`${t}${c}`})}const a=`0x${(r&&i<0?(1n<<BigInt(n*8))+BigInt(i):i).toString(16)}`;return n?Zs(a,{size:n}):a}const D5=new TextEncoder;function No(t,e={}){const r=D5.encode(t);return pt(r,e)}const z5=new TextEncoder;function Xs(t,e={}){return typeof t=="number"||typeof t=="bigint"?j5(t,e):typeof t=="boolean"?q5(t,e):kr(t)?Xr(t,e):Ri(t,e)}function q5(t,e={}){const r=new Uint8Array(1);return r[0]=Number(t),typeof e.size=="number"?(Br(r,{size:e.size}),Zs(r,{size:e.size})):r}const an={zero:48,nine:57,A:65,F:70,a:97,f:102};function sh(t){if(t>=an.zero&&t<=an.nine)return t-an.zero;if(t>=an.A&&t<=an.F)return t-(an.A-10);if(t>=an.a&&t<=an.f)return t-(an.a-10)}function Xr(t,e={}){let r=t;e.size&&(Br(r,{size:e.size}),r=Zs(r,{dir:"right",size:e.size}));let n=r.slice(2);n.length%2&&(n=`0${n}`);const i=n.length/2,s=new Uint8Array(i);for(let o=0,a=0;o<i;o++){const c=sh(n.charCodeAt(a++)),u=sh(n.charCodeAt(a++));if(c===void 0||u===void 0)throw new q(`Invalid byte sequence ("${n[a-2]}${n[a-1]}" in "${n}").`);s[o]=c*16+u}return s}function j5(t,e){const r=W(t,e);return Xr(r)}function Ri(t,e={}){const r=z5.encode(t);return typeof e.size=="number"?(Br(r,{size:e.size}),Zs(r,{dir:"right",size:e.size})):r}const Da=BigInt(2**32-1),oh=BigInt(32);function G5(t,e=!1){return e?{h:Number(t&Da),l:Number(t>>oh&Da)}:{h:Number(t>>oh&Da)|0,l:Number(t&Da)|0}}function H5(t,e=!1){const r=t.length;let n=new Uint32Array(r),i=new Uint32Array(r);for(let s=0;s<r;s++){const{h:o,l:a}=G5(t[s],e);[n[s],i[s]]=[o,a]}return[n,i]}const V5=(t,e,r)=>t<<r|e>>>32-r,K5=(t,e,r)=>e<<r|t>>>32-r,W5=(t,e,r)=>e<<r-32|t>>>64-r,Q5=(t,e,r)=>t<<r-32|e>>>64-r,Zi=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function J5(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function ko(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function Di(t,...e){if(!J5(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function Y5(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");ko(t.outputLen),ko(t.blockLen)}function Os(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function i1(t,e){Di(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function Z5(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function Fs(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function qu(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function Fr(t,e){return t<<32-e|t>>>e}const X5=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function ex(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function tx(t){for(let e=0;e<t.length;e++)t[e]=ex(t[e]);return t}const ah=X5?t=>t:tx;function rx(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function Uc(t){return typeof t=="string"&&(t=rx(t)),Di(t),t}function nx(...t){let e=0;for(let n=0;n<t.length;n++){const i=t[n];
vendor: 5,357 bytes, line 46
46Di(i),e+=i.length}const r=new Uint8Array(e);for(let n=0,i=0;n<t.length;n++){const s=t[n];r.set(s,i),i+=s.length}return r}class Hl{}function s1(t){const e=n=>t().update(Uc(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function ix(t=32){if(Zi&&typeof Zi.getRandomValues=="function")return Zi.getRandomValues(new Uint8Array(t));if(Zi&&typeof Zi.randomBytes=="function")return Uint8Array.from(Zi.randomBytes(t));throw new Error("crypto.getRandomValues must be defined")}const sx=BigInt(0),fo=BigInt(1),ox=BigInt(2),ax=BigInt(7),cx=BigInt(256),ux=BigInt(113),o1=[],a1=[],c1=[];for(let t=0,e=fo,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],o1.push(2*(5*n+r)),a1.push((t+1)*(t+2)/2%64);let i=sx;for(let s=0;s<7;s++)e=(e<<fo^(e>>ax)*ux)%cx,e&ox&&(i^=fo<<(fo<<BigInt(s))-fo);c1.push(i)}const u1=H5(c1,!0),fx=u1[0],lx=u1[1],ch=(t,e,r)=>r>32?W5(t,e,r):V5(t,e,r),uh=(t,e,r)=>r>32?Q5(t,e,r):K5(t,e,r);function dx(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,u=r[c],f=r[c+1],d=ch(u,f,1)^r[a],m=uh(u,f,1)^r[a+1];for(let g=0;g<50;g+=10)t[o+g]^=d,t[o+g+1]^=m}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=a1[o],c=ch(i,s,a),u=uh(i,s,a),f=o1[o];i=t[f],s=t[f+1],t[f]=c,t[f+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=fx[n],t[1]^=lx[n]}Fs(r)}class Vl extends Hl{constructor(e,r,n,i=!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=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,ko(n),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Z5(this.state)}clone(){return this._cloneInto()}keccak(){ah(this.state32),dx(this.state32,this.rounds),ah(this.state32),this.posOut=0,this.pos=0}update(e){Os(this),e=Uc(e),Di(e);const{blockLen:r,state:n}=this,i=e.length;for(let s=0;s<i;){const o=Math.min(r-this.pos,i-s);for(let a=0;a<o;a++)n[this.pos++]^=e[s++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:r,pos:n,blockLen:i}=this;e[n]^=r,r&128&&n===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){Os(this,!1),Di(e),this.finish();const r=this.state,{blockLen:n}=this;for(let i=0,s=e.length;i<s;){this.posOut>=n&&this.keccak();const o=Math.min(n-this.posOut,s-i);e.set(r.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return ko(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(i1(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,Fs(this.state)}_cloneInto(e){const{blockLen:r,suffix:n,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new Vl(r,n,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const hx=(t,e,r)=>s1(()=>new Vl(e,t,r)),f1=hx(1,136,256/8);function At(t,e){const r=e||"hex",n=f1(kr(t,{strict:!1})?Xs(t):t);return r==="bytes"?n:Ht(n)}const px=t=>At(Xs(t));function mx(t){return px(t)}function gx(t){let e=!0,r="",n=0,i="",s=!1;for(let o=0;o<t.length;o++){const a=t[o];if(["(",")",","].includes(a)&&(e=!0),a==="("&&n++,a===")"&&n--,!!e){if(n===0){if(a===" "&&["event","function",""].includes(i))i="";else if(i+=a,a===")"){s=!0;break}continue}if(a===" "){t[o-1]!==","&&r!==","&&r!==",("&&(r="",e=!1);continue}i+=a,r+=a}}if(!s)throw new q("Unable to normalize signature.");return i}const yx=t=>{const e=typeof t=="string"?t:pc(t);return gx(e)};function l1(t){return mx(yx(t))}const Dc=l1;let Ft=class extends q{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}},eo=class extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const r=super.get(e);return super.has(e)&&(super.delete(e),super.set(e,r)),r}set(e,r){if(super.has(e)&&super.delete(e),super.set(e,r),this.maxSize&&this.size>this.maxSize){const n=super.keys().next().value;n!==void 0&&super.delete(n)}return this}};const ju=new eo(8192);function ha(t,e){if(ju.has(`${t}.${e}`))return ju.get(`${t}.${e}`);const r=t.substring(2).toLowerCase(),n=At(Ri(r),"bytes"),i=r.split("");for(let o=0;o<40;o+=2)n[o>>1]>>4>=8&&i[o]&&(i[o]=i[o].toUpperCase()),(n[o>>1]&15)>=8&&i[o+1]&&(i[o+1]=i[o+1].toUpperCase());const s=`0x${i.join("")}`;return ju.set(`${t}.${e}`,s),s}function $s(t,e){if(!ft(t,{strict:!1}))throw new Ft({address:t});return ha(t,e)}const bx=/^0x[a-fA-F0-9]{40}$/,Gu=new eo(8192);function ft(t,e){const{strict:r=!0}=e??{},n=`${t}.${r}`;if(Gu.has(n))return Gu.get(n);const i=bx.test(t)?t.toLowerCase()===t?!0:r?ha(t)===t:!0:!1;return Gu.set(n,i),i}function Mr(t){return typeof t[0]=="string"?Pt(t):wx(t)}function wx(t){let e=0;for(const i of t)e+=i.length;
46const r=new Uint8Array(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function Pt(t){return`0x${t.reduce((e,r)=>e+r.replace("0x",""),"")}`}function Zn(t,e,r,{strict:n}={}){return kr(t,{strict:!1})?Df(t,e,r,{strict:n}):p1(t,e,r,{strict:n})}function d1(t,e){if(typeof e=="number"&&e>0&&e>rt(t)-1)throw new t1({offset:e,position:"start",size:rt(t)})}function h1(t,e,r){if(typeof e=="number"&&typeof r=="number"&&rt(t)!==r-e)throw new t1({offset:r,position:"end",size:rt(t)})}function p1(t,e,r,{strict:n}={}){d1(t,e);const i=t.slice(e,r);return n&&h1(i,e,r),i}function Df(t,e,r,{strict:n}={}){d1(t,e);const i=`0x${t.replace("0x","").slice((e??0)*2,(r??t.length)*2)}`;return n&&h1(i,e,r),i}const vx=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,m1=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function ri(t,e){if(t.length!==e.length)throw new E5({expectedLength:t.length,givenLength:e.length});const r=xx({params:t,values:e});return Wl(r)}function xx({params:t,values:e}){const r=[];for(let n=0;n<t.length;n++)r.push(Kl({param:t[n],value:e[n]}));return r}function Kl({param:t,value:e}){const r=zc(t.type);if(r){const[n,i]=r;return Ex(e,{length:n,param:{...t,type:i}})}if(t.type==="tuple")return Nx(e,{param:t});if(t.type==="address")return Ax(e);if(t.type==="bool")return Sx(e);if(t.type.startsWith("uint")||t.type.startsWith("int")){const n=t.type.startsWith("int"),[,,i="256"]=m1.exec(t.type)??[];return _x(e,{signed:n,size:Number(i)})}if(t.type.startsWith("bytes"))return Px(e,{param:t});if(t.type==="string")return Ix(e);throw new M5(t.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Wl(t){let e=0;for(let s=0;s<t.length;s++){const{dynamic:o,encoded:a}=t[s];o?e+=32:e+=rt(a)}const r=[],n=[];let i=0;for(let s=0;s<t.length;s++){const{dynamic:o,encoded:a}=t[s];o?(r.push(W(e+i,{size:32})),n.push(a),i+=rt(a)):r.push(a)}return Pt([...r,...n])}function Ax(t){if(!ft(t))throw new Ft({address:t});return{dynamic:!1,encoded:Jn(t.toLowerCase())}}function Ex(t,{length:e,param:r}){const n=e===null;if(!Array.isArray(t))throw new e1(t);if(!n&&t.length!==e)throw new x5({expectedLength:e,givenLength:t.length,type:`${r.type}[${e}]`});let i=t.length===0&&zf(r);const s=[];for(let o=0;o<t.length;o++){const a=Kl({param:r,value:t[o]});a.dynamic&&(i=!0),s.push(a)}if(n||i){const o=Wl(s);if(n){const a=W(s.length,{size:32});return{dynamic:!0,encoded:Pt([a,o])}}if(i)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:Pt(s.map(({encoded:o})=>o))}}function Px(t,{param:e}){const[,r]=e.type.split("bytes"),n=rt(t);if(!r){let i=t;return n%32!==0&&(i=Jn(i,{dir:"right",size:Math.ceil((t.length-2)/2/32)*32})),{dynamic:!0,encoded:Pt([Jn(W(n,{size:32})),i])}}if(n!==Number.parseInt(r,10))throw new A5({expectedSize:Number.parseInt(r,10),value:t});return{dynamic:!1,encoded:Jn(t,{dir:"right"})}}function Sx(t){if(typeof t!="boolean")throw new q(`Invalid boolean value: "${t}" (type: ${typeof t}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Jn(n1(t))}}function _x(t,{signed:e,size:r=256}){if(typeof r=="number"){const n=2n**(BigInt(r)-(e?1n:0n))-1n,i=e?-n-1n:0n;if(t>n||t<i)throw new Gl({max:n.toString(),min:i.toString(),signed:e,size:r/8,value:t.toString()})}return{dynamic:!1,encoded:W(t,{size:32,signed:e})}}function Ix(t){const e=No(t),r=Math.ceil(rt(e)/32),n=[];for(let i=0;i<r;i++)n.push(Jn(Zn(e,i*32,(i+1)*32),{dir:"right"}));return{dynamic:!0,encoded:Pt([Jn(W(rt(e),{size:32})),...n])}}function Nx(t,{param:e}){let r=!1;const n=[];for(let i=0;i<e.components.length;i++){const s=e.components[i],o=Array.isArray(t)?i:s.name,a=Kl({param:s,value:t[o]});n.push(a),a.dynamic&&(r=!0)}return{dynamic:r,encoded:r?Wl(n):Pt(n.map(({encoded:i})=>i))}}function zc(t){const e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}function zf(t){const{type:e}=t;if(e==="string"||e==="bytes"||e.endsWith("[]"))return!0;if(e==="tuple")return t.components.some(zf);const r=zc(e);return r?zf({...t,type:r[1]}):!1}const pa=t=>Zn(l1(t),0,4);function Qi(t){const{abi:e,args:r=[],name:n}=t,i=kr(n,{strict:!1}),s=e.filter(a=>i?a.type==="function"?pa(a)===n:a.type==="event"?Dc(a)===n:!1:"name"in a&&a.name===n);if(s.length===0)return;if(s.length===1)return s[0];let o;for(const a of s){if(!("inputs"in a))continue;if(!r||r.length===0){if(!a.inputs||a.inputs.length===0)return a;continue}if(!a.inputs||a.inputs.length===0||a.inputs.length!==r.length)continue;if(r.every((u,f)=>{const d="inputs"in a&&a.inputs[f];return d?qf(u,d):!1}
46)){if(o&&"inputs"in o&&o.inputs){const u=g1(a.inputs,o.inputs,r);if(u)throw new N5({abiItem:a,type:u[0]},{abiItem:o,type:u[1]})}o=a}}return o||s[0]}function qf(t,e){const r=typeof t,n=e.type;switch(n){case"address":return ft(t,{strict:!1});case"bool":return r==="boolean";case"function":return r==="string";case"string":return r==="string";default:return n==="tuple"&&"components"in e?Object.values(e.components).every((i,s)=>r==="object"&&qf(Object.values(t)[s],i)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(n)?r==="number"||r==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n)?r==="string"||t instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n)?Array.isArray(t)&&t.every(i=>qf(i,{...e,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function g1(t,e,r){for(const n in t){const i=t[n],s=e[n];if(i.type==="tuple"&&s.type==="tuple"&&"components"in i&&"components"in s)return g1(i.components,s.components,r[n]);const o=[i.type,s.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?ft(r[n],{strict:!1}):o.includes("address")&&o.includes("bytes")?ft(r[n],{strict:!1}):!1)return o}}const fh="/docs/contract/encodeEventTopics";function ma(t){const{abi:e,eventName:r,args:n}=t;let i=e[0];if(r){const c=Qi({abi:e,name:r});if(!c)throw new nh(r,{docsPath:fh});i=c}if(i.type!=="event")throw new nh(void 0,{docsPath:fh});let s=[];if(n&&"inputs"in i){const c=i.inputs?.filter(f=>"indexed"in f&&f.indexed),u=Array.isArray(n)?n:Object.values(n).length>0?c?.map(f=>n[f.name])??[]:[];u.length>0&&(s=c?.map((f,d)=>Array.isArray(u[d])?u[d].map((m,g)=>lh({param:f,value:u[d][g]})):typeof u[d]<"u"&&u[d]!==null?lh({param:f,value:u[d]}):null)??[])}if(i.anonymous)return s;const o=Nr(i);return[Dc(o),...s]}function lh({param:t,value:e}){if(t.type==="string"||t.type==="bytes")return At(Xs(e));if(t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/))throw new C5(t.type);return ri([t],[e])}function qc(t,{method:e}){const r={};return t.transport.type==="fallback"&&t.transport.onResponse?.(({method:n,response:i,status:s,transport:o})=>{s==="success"&&e===n&&(r[i]=o.request)}),n=>r[n]||t.request}async function y1(t,e){const{address:r,abi:n,args:i,eventName:s,fromBlock:o,strict:a,toBlock:c}=e,u=qc(t,{method:"eth_newFilter"}),f=s?ma({abi:n,args:i,eventName:s}):void 0,d=await t.request({method:"eth_newFilter",params:[{address:r,fromBlock:typeof o=="bigint"?W(o):o,toBlock:typeof c=="bigint"?W(c):c,topics:f}]});return{abi:n,args:i,eventName:s,id:d,request:u(d),strict:!!a,type:"event"}}function Ee(t){return typeof t=="string"?{address:t,type:"json-rpc"}:t}const dh="/docs/contract/encodeFunctionData";function kx(t){const{abi:e,args:r,functionName:n}=t;let i=e[0];if(n){const s=Qi({abi:e,args:r,name:n});if(!s)throw new Bs(n,{docsPath:dh});i=s}if(i.type!=="function")throw new Bs(void 0,{docsPath:dh});return{abi:[i],functionName:pa(Nr(i))}}function Lt(t){const{args:e}=t,{abi:r,functionName:n}=t.abi.length===1&&t.functionName?.startsWith("0x")?t:kx(t),i=r[0],s=n,o="inputs"in i&&i.inputs?ri(i.inputs,e??[]):void 0;return Pt([s,o??"0x"])}const Mx={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},b1={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},Tx={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};let hh=class extends q{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`,{name:"NegativeOffsetError"})}},w1=class extends q{constructor({length:e,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${e}\`).`,{name:"PositionOutOfBoundsError"})}},Rx=class extends q{constructor({count:e,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${e}\`).`,{name:"RecursiveReadLimitExceededError"})}};const Cx={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new Rx({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(t){if(t<0||t>this.bytes.length-1)throw new w1({length:this.bytes.length,position:t})},decrementPosition(t){if(t<0)throw new hh({offset:t});const e=this.position-t;this.assertPosition(e),this.position=e},getReadCount(t){return this.positionReadCount.get(t||this.position)||0},incrementPosition(t){if(t<0)throw new hh({offset:t});const e=this.position+t;this.assertPosition(e),this.position=e},inspectByte(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectBytes(t,e){const r=e??this.position;return this.assertPosition(r+t-1),this.bytes.subarray(r,r+t)},inspectUint8(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectUint16(t){const e=t??this.position;return this.assertPosition(e+1),this.dataView.getUint16(e)},inspectUint24(t){const e=t??this.position;return this.assertPosition(e+2),(this.dataView.getUint16(e)<<8)+this.dataView.getUint8(e+2)},inspectUint32(t){const e=t??this.position;return this.assertPosition(e+3),this.dataView.getUint32(e)},pushByte(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushBytes(t){this.assertPosition(this.position+t.length-1),this.bytes.set(t,this.position),this.position+=t.length},pushUint8(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushUint16(t){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,t),this.position+=2},pushUint24(t){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,t>>8),this.dataView.setUint8(this.position+2,t&255),this.position+=3},pushUint32(t){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,t),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const t=this.inspectByte();return this.position++,t},readBytes(t,e){this.assertReadLimit(),this._touch();const r=this.inspectBytes(t);return this.position+=e??t,r},readUint8(){this.assertReadLimit(),this._touch();const t=this.inspectUint8();return this.position+=1,t},readUint16(){this.assertReadLimit(),this._touch();const t=this.inspectUint16();return this.position+=2,t},readUint24(){this.assertReadLimit(),this._touch();const t=this.inspectUint24();return this.position+=3,t},readUint32(){this.assertReadLimit(),this._touch();const t=this.inspectUint32();return this.position+=4,t},get remaining(){return this.bytes.length-this.position},setPosition(t){const e=this.position;return this.assertPosition(t),this.position=t,()=>this.position=e},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const t=this.getReadCount();this.positionReadCount.set(this.position,t+1),t>0&&this.recursiveReadCount++}};function Ql(t,{recursiveReadLimit:e=8192}={}){const r=Object.create(Cx);return r.bytes=t,r.dataView=new DataView(t.buffer??t,t.byteOffset,t.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=e,r}function Bx(t,e={}){typeof e.size<"u"&&Br(t,{size:e.size});const r=pt(t,e);return bt(r,e)}function Ox(t,e={}){let r=t;if(typeof e.size<"u"&&(Br(r,{size:e.size}),r=rr(r)),r.length>1||r[0]>1)throw new O5(r);return!!r[0]}function bn(t,e={}){typeof e.size<"u"&&Br(t,{size:e.size});const r=pt(t,e);return hr(r,e)}function Fx(t,e={}){let r=t;return typeof e.size<"u"&&(Br(r,{size:e.size}),r=rr(r,{dir:"right"})),new TextDecoder().decode(r)}
46function ga(t,e){const r=typeof e=="string"?Xr(e):e,n=Ql(r);if(rt(r)===0&&t.length>0)throw new da;if(rt(e)&&rt(e)<32)throw new Ym({data:typeof e=="string"?e:pt(e),params:t,size:rt(e)});let i=0;const s=[];for(let o=0;o<t.length;++o){const a=t[o];i<r.length&&n.setPosition(i);const[c,u]=ds(n,a,{staticPosition:0});i+=u,s.push(c)}return s}function ds(t,e,{staticPosition:r}){const n=zc(e.type);if(n){const[i,s]=n;return Lx(t,{...e,type:s},{length:i,staticPosition:r})}if(e.type==="tuple")return qx(t,e,{staticPosition:r});if(e.type==="address")return $x(t);if(e.type==="bool")return Ux(t);if(e.type.startsWith("bytes"))return Dx(t,e,{staticPosition:r});if(e.type.startsWith("uint")||e.type.startsWith("int"))return zx(t,e);if(e.type==="string")return jx(t,{staticPosition:r});throw new T5(e.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const ph=32,jf=32;function $x(t){const e=t.readBytes(32);return[ha(pt(p1(e,-20))),32]}function Lx(t,e,{length:r,staticPosition:n}){if(r===null){const o=bn(t.readBytes(jf)),a=n+o,c=a+ph;t.setPosition(a);const u=bn(t.readBytes(ph)),f=Mo(e);let d=0;const m=[];for(let g=0;g<u;++g){t.setPosition(c+(f?g*32:d));const[w,A]=ds(t,e,{staticPosition:c});d+=A,m.push(w),A===0&&(t.assertReadLimit(),t._touch())}return t.setPosition(n+32),[m,32]}if(Mo(e)){const o=bn(t.readBytes(jf)),a=n+o,c=[];for(let u=0;u<r;++u){t.setPosition(a+u*32);const[f]=ds(t,e,{staticPosition:a});c.push(f)}return t.setPosition(n+32),[c,32]}let i=0;const s=[];for(let o=0;o<r;++o){const[a,c]=ds(t,e,{staticPosition:n+i});i+=c,s.push(a),c===0&&(t.assertReadLimit(),t._touch())}return[s,i]}function Ux(t){return[Ox(t.readBytes(32),{size:32}),32]}function Dx(t,e,{staticPosition:r}){const[n,i]=e.type.split("bytes");if(!i){const o=bn(t.readBytes(32));t.setPosition(r+o);const a=bn(t.readBytes(32));if(a===0)return t.setPosition(r+32),["0x",32];const c=t.readBytes(a);return t.setPosition(r+32),[pt(c),32]}return[pt(t.readBytes(Number.parseInt(i,10),32)),32]}function zx(t,e){const r=e.type.startsWith("int"),n=Number.parseInt(e.type.split("int")[1]||"256",10),i=t.readBytes(32);return[n>48?Bx(i,{signed:r}):bn(i,{signed:r}),32]}function qx(t,e,{staticPosition:r}){const n=e.components.length===0||e.components.some(({name:o})=>!o),i=n?[]:{};let s=0;if(Mo(e)){const o=bn(t.readBytes(jf)),a=r+o;for(let c=0;c<e.components.length;++c){const u=e.components[c];t.setPosition(a+s);const[f,d]=ds(t,u,{staticPosition:a});s+=d,i[n?c:u?.name]=f}return t.setPosition(r+32),[i,32]}for(let o=0;o<e.components.length;++o){const a=e.components[o],[c,u]=ds(t,a,{staticPosition:r});i[n?o:a?.name]=c,s+=u}return[i,s]}function jx(t,{staticPosition:e}){const r=bn(t.readBytes(32)),n=e+r;t.setPosition(n);const i=bn(t.readBytes(32));if(i===0)return t.setPosition(e+32),["",32];const s=t.readBytes(i,32),o=Fx(rr(s));return t.setPosition(e+32),[o,32]}function Mo(t){const{type:e}=t;if(e==="string"||e==="bytes"||e.endsWith("[]"))return!0;if(e==="tuple")return t.components?.some(Mo);const r=zc(t.type);return!!(r&&Mo({...t,type:r[1]}))}function v1(t){const{abi:e,data:r,cause:n}=t,i=Zn(r,0,4);if(i==="0x")throw new da({cause:n});const o=[...e||[],b1,Tx].find(a=>a.type==="error"&&i===pa(Nr(a)));if(!o)throw new Zm(i,{docsPath:"/docs/contract/decodeErrorResult",cause:n});return{abiItem:o,args:"inputs"in o&&o.inputs&&o.inputs.length>0?ga(o.inputs,Zn(r,4)):void 0,errorName:o.name}}const ut=(t,e,r)=>JSON.stringify(t,(n,i)=>typeof i=="bigint"?i.toString():i,r);function x1({abiItem:t,args:e,includeFunctionName:r=!0,includeName:n=!1}){if("name"in t&&"inputs"in t&&t.inputs)return`${r?t.name:""}(${t.inputs.map((i,s)=>`${n&&i.name?`${i.name}: `:""}${typeof e[s]=="object"?ut(e[s]):e[s]}`).join(", ")})`}const Gx={gwei:9,wei:18},Hx={ether:-9,wei:9};function ya(t,e){let r=t.toString();const n=r.startsWith("-");n&&(r=r.slice(1)),r=r.padStart(e,"0");let[i,s]=[r.slice(0,r.length-e),r.slice(r.length-e)];return s=s.replace(/(0+)$/,""),`${n?"-":""}${i||"0"}${s?`.${s}`:""}`}function Jl(t,e="wei"){return ya(t,Gx[e])}function Vt(t,e="wei"){return ya(t,Hx[e])}class Vx extends q{constructor({address:e}){super(`State for account "${e}" is set multiple times.`,{name:"AccountStateConflictError"})}}class Kx extends q{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentC
46onflictError"})}}function mh(t){return t.reduce((e,{slot:r,value:n})=>`${e}        ${r}: ${n}
47`,"")}function Wx(t){return t.reduce((e,{address:r,...n})=>{let i=`${e}    ${r}:
48`;return n.nonce&&(i+=`      nonce: ${n.nonce}
49`),n.balance&&(i+=`      balance: ${n.balance}
50`),n.code&&(i+=`      code: ${n.code}
51`),n.state&&(i+=`      state:
52`,i+=mh(n.state)),n.stateDiff&&(i+=`      stateDiff:
53`,i+=mh(n.stateDiff)),i},`  State Override:
54`).slice(0,-1)}function ba(t){const e=Object.entries(t).map(([n,i])=>i===void 0||i===!1?null:[n,i]).filter(Boolean),r=e.reduce((n,[i])=>Math.max(n,i.length),0);return e.map(([n,i])=>`  ${`${n}:`.padEnd(r+1)}  ${i}`).join(`
55`)}class Qx extends q{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class Jx extends q{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",ba(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class Yx extends q{constructor({storageKey:e}){super(`Size for storage key "${e}" is invalid. Expected 32 bytes. Got ${Math.floor((e.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}class Zx extends q{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:u,nonce:f,to:d,value:m}){const g=ba({chain:i&&`${i?.name} (id: ${i?.id})`,from:r?.address,to:d,value:typeof m<"u"&&`${Jl(m)} ${i?.nativeCurrency?.symbol||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${Vt(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${Vt(c)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${Vt(u)} gwei`,nonce:f});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",g].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class Yl extends q{constructor({blockHash:e,blockNumber:r,blockTag:n,hash:i,index:s}){let o="Transaction";n&&s!==void 0&&(o=`Transaction at block time "${n}" at index "${s}"`),e&&s!==void 0&&(o=`Transaction at block hash "${e}" at index "${s}"`),r&&s!==void 0&&(o=`Transaction at block number "${r}" at index "${s}"`),i&&(o=`Transaction with hash "${i}"`),super(`${o} could not be found.`,{name:"TransactionNotFoundError"})}}class A1 extends q{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}class Gf extends q{constructor({receipt:e}){super(`Transaction with hash "${e.transactionHash}" reverted.`,{metaMessages:['The receipt marked the transaction as "reverted". This could mean that the function on the contract you are trying to call threw an error.'," ","You can attempt to extract the revert reason by:","- calling the `simulateContract` or `simulateCalls` Action with the `abi` and `functionName` of the contract","- using the `call` Action with raw `data`"],name:"TransactionReceiptRevertedError"}),Object.defineProperty(this,"receipt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.receipt=e}}class Xx extends q{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}const eA=t=>t;function Tr(t){if(t?.reason)return t.reason;if(typeof DOMException=="function")return new DOMException("This operation was aborted","AbortError");const e=new Error("This operation was aborted");return e.name="AbortError",e}function ni(t){return typeof t=="object"&&t!==null&&"name"in t&&t.name==="AbortError"}const wa=t=>{try{const e=new URL(t);return!e.username&&!e.password?t:(e.username="",e.password="",e.toString())}catch{return t}};class E1 extends q{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:u,nonce:f,to:d,value:m,stateOverride:g}){const w=r?Ee(r):void 0;let A=ba({from:w?.address,to:d,value:typeof m<"u"&&`${Jl(m)} ${i?.nativeCurrency?.symbol||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${Vt(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${Vt(c)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${Vt(u)} gwei`,nonce:f});g&&(A+=`
56${Wx(g)}`),super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",A].filter(
vendor: 4,281 bytes, lines 56-57
56Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class P1 extends q{constructor(e,{abi:r,args:n,contractAddress:i,docsPath:s,functionName:o,sender:a}){const c=Qi({abi:r,args:n,name:o}),u=c?x1({abiItem:c,args:n,includeFunctionName:!1,includeName:!1}):void 0,f=c?Nr(c,{includeName:!0}):void 0,d=ba({address:i&&eA(i),function:f,args:u&&u!=="()"&&`${[...Array(o?.length??0).keys()].map(()=>" ").join("")}${u}`,sender:a});super(e.shortMessage||`An unknown error occurred while executing the contract function "${o}".`,{cause:e,docsPath:s,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],d&&"Contract Call:",d].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=r,this.args=n,this.cause=e,this.contractAddress=i,this.functionName=o,this.sender=a}}class Hf extends q{constructor({abi:e,data:r,functionName:n,message:i,cause:s}){let o,a,c,u;if(r&&r!=="0x")try{a=v1({abi:e,data:r,cause:s});const{abiItem:d,errorName:m,args:g}=a;if(m==="Error")u=g[0];else if(m==="Panic"){const[w]=g;u=Mx[w]}else{const w=d?Nr(d,{includeName:!0}):void 0,A=d&&g?x1({abiItem:d,args:g,includeFunctionName:!1,includeName:!1}):void 0;c=[w?`Error: ${w}`:"",A&&A!=="()"?`       ${[...Array(m?.length??0).keys()].map(()=>" ").join("")}${A}`:""]}}catch(d){o=d}else i&&(u=i);let f;o instanceof Zm&&(f=o.signature,c=[`Unable to decode signature "${f}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${f}.`]),super(u&&u!=="execution reverted"||f?[`The contract function "${n}" reverted with the following ${f?"signature":"reason"}:`,u||f].join(`
57`):`The contract function "${n}" reverted.`,{cause:o??s,metaMessages:c,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=a,this.raw=r,this.reason=u,this.signature=f}}class tA extends q{constructor({functionName:e,cause:r}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",`  - The contract does not have the function "${e}",`,"  - The parameters passed to the contract function may be invalid, or","  - The address is not a contract."],name:"ContractFunctionZeroDataError",cause:r})}}class rA extends q{constructor({factory:e}){super(`Deployment for counterfactual contract call failed${e?` for factory "${e}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class jc extends q{constructor({data:e,message:r}){super(r||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}class Ci extends q{constructor({body:e,cause:r,details:n,headers:i,status:s,url:o}){super("HTTP request failed.",{cause:r,details:n,metaMessages:[s&&`Status: ${s}`,`URL: ${wa(o)}`,e&&`Request body: ${ut(e)}
57`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=i,this.status=s,this.url=o}}class rc extends q{constructor({maxSize:e,size:r}){super("HTTP response body exceeded the size limit.",{metaMessages:[`Max: ${e} bytes`,`Received: ${r} bytes`],name:"ResponseBodyTooLargeError"}),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e,this.size=r}}class Zl extends q{constructor({body:e,error:r,url:n}){super("RPC Request failed.",{cause:r,details:r.message,metaMessages:[`URL: ${wa(n)}`,`Request body: ${ut(e)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=r.code,this.data=r.data,this.url=n}}class gh extends q{constructor({body:e,url:r}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${wa(r)}`,`Request body: ${ut(e)}`],name:"TimeoutError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=r}}const nA=-1;class Qt extends q{constructor(e,{code:r,docsPath:n,metaMessages:i,name:s,shortMessage:o}){super(o,{cause:e,docsPath:n,metaMessages:i||e?.metaMessages,name:s||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=s||e.name,this.code=e instanceof Zl?e.code:r??nA}}class Jt extends Qt{constructor(e,r){super(e,r),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=r.data}}class To extends Qt{constructor(e){super(e,{code:To.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(To,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class Ro extends Qt{constructor(e){super(e,{code:Ro.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(Ro,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class Co extends Qt{constructor(e,{method:r}={}){super(e,{code:Co.code,name:"MethodNotFoundRpcError",shortMessage:`The method${r?` "${r}"`:""} does not exist / is not available.`})}}Object.defineProperty(Co,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class Bo extends Qt{constructor(e){super(e,{code:Bo.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
58`)})}}Object.defineProperty(Bo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class zi extends Qt{constructor(e){super(e,{code:zi.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(zi,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class Xn extends Qt{constructor(e){super(e,{code:Xn.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
59`)})}}Object.defineProperty(Xn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class Oo extends Qt{constructor(e){super(e,{code:Oo.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(Oo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class Fo extends Qt{constructor(e){super(e,{code:Fo.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(Fo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class $o extends Qt{constructor(e){super(e,{code:$o.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty($o,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class Ai extends Qt{constructor(e,{method:r}={}){super(e,{code:Ai.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${r?` "${r}"`:""} is not supported.`})}}Object.defineProperty(Ai,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class Ls extends Qt{constructor(e){super(e,{code:Ls.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(Ls,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class Lo extends Qt{constructor(e){super(e,{code:Lo.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(Lo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class hs extends Jt{constructor(e){super(e,{code:hs.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(hs,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class Uo extends Jt{constructor(e){super(e,{code:Uo.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(Uo,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class Do extends Jt{constructor(e,{method:r}={}){super(e,{code:Do.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${r?` " ${r}"`:""}.`})}}Object.defineProperty(Do,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class zo extends Jt{constructor(e){super(e,{code:zo.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(zo,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});
59class qo extends Jt{constructor(e){super(e,{code:qo.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(qo,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class jo extends Jt{constructor(e){super(e,{code:jo.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(jo,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class Us extends Jt{constructor(e){super(e,{code:Us.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(Us,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class Go extends Jt{constructor(e){super(e,{code:Go.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(Go,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class Ho extends Jt{constructor(e){super(e,{code:Ho.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(Ho,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class Vo extends Jt{constructor(e){super(e,{code:Vo.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(Vo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class Ko extends Jt{constructor(e){super(e,{code:Ko.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(Ko,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class Wo extends Jt{constructor(e){super(e,{code:Wo.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(Wo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class Ds extends Jt{constructor(e){super(e,{code:Ds.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(Ds,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class Qo extends Jt{constructor(e){super(e,{code:Qo.code,name:"WalletConnectSessionSettlementError",shortMessage:"WalletConnect session settlement failed."})}}Object.defineProperty(Qo,"code",{enumerable:!0,configurable:!0,writable:!0,value:7e3});class iA extends Qt{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const sA=3;function qi(t,{abi:e,address:r,args:n,docsPath:i,functionName:s,sender:o}){const a=t instanceof jc?t:t instanceof q?t.walk(w=>"data"in w)||t.walk():{},{code:c,data:u,details:f,message:d,shortMessage:m}=a,g=t instanceof da?new tA({functionName:s,cause:t}):[sA,zi.code].includes(c)&&(u||f||d||m)||c===Xn.code&&f==="execution reverted"&&u?new Hf({abi:e,data:typeof u=="object"?u.data:u,functionName:s,message:a instanceof Zl?f:m??d,cause:t}):t;return new P1(g,{abi:e,args:n,contractAddress:r,docsPath:i,functionName:s,sender:o})}function oA(t){const e=At(`0x${t.substring(4)}`).substring(26);return ha(`0x${e}`)}async function aA({hash:t,signature:e}){const r=kr(t)?t:Ht(t),{secp256k1:n}=await Fm(async()=>{const{secp256k1:o}=await Promise.resolve().then(()=>n4);return{secp256k1:o}},void 0);return`0x${(()=>{if(typeof e=="object"&&"r"in e&&"s"in e){const{r:u,s:f,v:d,yParity:m}=e,g=Number(m??d),w=yh(g);return new n.Signature(bt(u),bt(f)).addRecoveryBit(w)}const o=kr(e)?e:Ht(e);if(rt(o)!==65)throw new Error("invalid signature length");const a=hr(`0x${o.slice(130)}`),c=yh(a);return n.Signature.fromCompact(o.substring(2,130)).addRecoveryBit(c)})().recoverPublicKey(r.substring(2)).toHex(!1)}`}function yh(t){if(t===0||t===1)return t;if(t===27)return 0;if(t===28)return 1;throw new Error("Invalid yParityOrV value")}async function Vf({hash:t,signature:e}){return oA(await aA({hash:t,signature:e}))}function ei(t,e="hex"){const r=S1(t),n=Ql(new Uint8Array(r.length));return r.encode(n),e==="hex"?pt(n.bytes):n.bytes}function S1(t){return Array.isArray(t)?cA(t.map(e=>S1(e))):uA(t)}function cA(t){const e=t.reduce((i,s)=>i+s.length,0),r=_1(e);return{length:e<=55?1+e:1+r+e,encode(i){e<=55?i.pushByte(192+e):(i.pushByte(247+r),r===1?i.pushUint8(e):r===2?i.pushUint16(e):r===3?i.pushUint24(e):i.pushUint32(e));for(const{encode:s}of t)s(i)}}}function uA(t){const e=typeof t=="string"?Xr(t):t,r=_1(e.length);return{length:e.length===1&&e[0]<128?1:e.length<=55?1+e.length:1+r+e.length,encode(i){e.length===1&&e[0]<128?i.pushBytes(e):e.length<=55?(i.pushByte(128+e.length),i.pushBytes(e)):(i.pushByte(183+r),r===1?i.pushUint8(e.length):r===2?i.pushUint16(e.length):r===3?i.pushUint24(e.length):i.pushUint32(e.length),i.pushBytes(e))}}}function _1(t){if(t<2**8)return 1;if(t<2**16)return 2;if(t<2**24)return 3;
vendor: 1,481 bytes, line 59
59if(t<2**32)return 4;throw new q("Length is too large.")}function fA(t){const{chainId:e,nonce:r,to:n}=t,i=t.contractAddress??t.address,s=At(Pt(["0x05",ei([e?W(e):"0x",i,r?W(r):"0x"])]));return n==="bytes"?Xr(s):s}async function Gc(t){const{authorization:e,signature:r}=t;return Vf({hash:fA(e),signature:r??e})}class lA extends q{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:u,nonce:f,to:d,value:m}){const g=ba({from:r?.address,to:d,value:typeof m<"u"&&`${Jl(m)} ${i?.nativeCurrency?.symbol||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${Vt(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${Vt(c)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${Vt(u)} gwei`,nonce:f});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",g].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class ss extends q{constructor({cause:e,message:r}={}){const n=r?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:e,name:"ExecutionRevertedError"})}}Object.defineProperty(ss,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(ss,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});
vendor: 5,139 bytes, lines 59-62
59class ji extends q{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${Vt(r)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e,name:"FeeCapTooHighError"})}}Object.defineProperty(ji,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class Kf extends q{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${Vt(r)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e,name:"FeeCapTooLowError"})}}Object.defineProperty(Kf,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class Wf extends q{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}is higher than the next one expected.`,{cause:e,name:"NonceTooHighError"})}}Object.defineProperty(Wf,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class Qf extends q{constructor({cause:e,nonce:r}={}){super([`Nonce provided for the transaction ${r?`(${r}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
60`),{cause:e,name:"NonceTooLowError"})}}Object.defineProperty(Qf,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class Jf extends q{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}exceeds the maximum allowed nonce.`,{cause:e,name:"NonceMaxValueError"})}}Object.defineProperty(Jf,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class Yf extends q{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
61`),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(Yf,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class Zf extends q{constructor({cause:e,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(Zf,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class Xf extends q{constructor({cause:e,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction is too low.`,{cause:e,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(Xf,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class el extends q{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(el,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class Jo extends q{constructor({cause:e,maxPriorityFeePerGas:r,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${r?` = ${Vt(r)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${Vt(n)} gwei`:""}).`].join(`
62`),{cause:e,name:"TipAboveFeeCapError"})}}Object.defineProperty(Jo,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class va extends q{constructor({cause:e}){super(`An error occurred while executing: ${e?.shortMessage}`,{cause:e,name:"UnknownNodeError"})}}function Hc(t,e){const r=(t.details||"").toLowerCase(),n=t instanceof q?t.walk(i=>i?.code===ss.code):t;return n instanceof q?new ss({cause:t,message:n.details}):ss.nodeMessage.test(r)?new ss({cause:t,message:t.details}):ji.nodeMessage.test(r)?new ji({cause:t,maxFeePerGas:e?.maxFeePerGas}):Kf.nodeMessage.test(r)?new Kf({cause:t,maxFeePerGas:e?.maxFeePerGas}):Wf.nodeMessage.test(r)?new Wf({cause:t,nonce:e?.nonce}):Qf.nodeMessage.test(r)?new Qf({cause:t,nonce:e?.nonce}):Jf.nodeMessage.test(r)?new Jf({cause:t,nonce:e?.nonce}):Yf.nodeMessage.test(r)?new Yf({cause:t}):Zf.nodeMessage.test(r)?new Zf({cause:t,gas:e?.gas}):Xf.nodeMessage.test(r)?new Xf({cause:t,gas:e?.gas}):el.nodeMessage.test(r)?new el({cause:t}):Jo.nodeMessage.test(r)?new Jo({cause:t,maxFeePerGas:e?.maxFeePerGas,maxPriorityFeePerGas:e?.maxPriorityFeePerGas}):new va({cause:t})}function dA(t,{docsPath:e,...r}){const n=(()=>{const i=Hc(t,r);return i instanceof va?t:i})();return new lA(n,{docsPath:e,...r})}function to(t,{format:e}){if(!e)return{};const r={};function n(s){const o=Object.keys(s);
62for(const a of o)a in t&&(r[a]=t[a]),s[a]&&typeof s[a]=="object"&&!Array.isArray(s[a])&&n(s[a])}const i=e(t||{});return n(i),r}function Xl(t,e){return({exclude:r,format:n})=>({exclude:r,format:(i,s)=>{const o=e(i,s);if(r)for(const a of r)delete o[a];return{...o,...n(i,s)}},type:t})}const hA={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function ii(t,e){const r={};return typeof t.authorizationList<"u"&&(r.authorizationList=pA(t.authorizationList)),typeof t.accessList<"u"&&(r.accessList=t.accessList),typeof t.blobVersionedHashes<"u"&&(r.blobVersionedHashes=t.blobVersionedHashes),typeof t.blobs<"u"&&(typeof t.blobs[0]!="string"?r.blobs=t.blobs.map(n=>pt(n)):r.blobs=t.blobs),typeof t.data<"u"&&(r.data=t.data),t.account&&(r.from=t.account.address),typeof t.from<"u"&&(r.from=t.from),typeof t.gas<"u"&&(r.gas=W(t.gas)),typeof t.gasPrice<"u"&&(r.gasPrice=W(t.gasPrice)),typeof t.maxFeePerBlobGas<"u"&&(r.maxFeePerBlobGas=W(t.maxFeePerBlobGas)),typeof t.maxFeePerGas<"u"&&(r.maxFeePerGas=W(t.maxFeePerGas)),typeof t.maxPriorityFeePerGas<"u"&&(r.maxPriorityFeePerGas=W(t.maxPriorityFeePerGas)),typeof t.nonce<"u"&&(r.nonce=W(t.nonce)),typeof t.to<"u"&&(r.to=t.to),typeof t.type<"u"&&(r.type=hA[t.type]),typeof t.value<"u"&&(r.value=W(t.value)),r}function pA(t){return t.map(e=>({address:e.address,r:e.r?W(BigInt(e.r)):e.r,s:e.s?W(BigInt(e.s)):e.s,chainId:W(e.chainId),nonce:W(e.nonce),...typeof e.yParity<"u"?{yParity:W(e.yParity)}:{},...typeof e.v<"u"&&typeof e.yParity>"u"?{v:W(e.v)}:{}}))}function bh(t){if(!(!t||t.length===0))return t.reduce((e,{slot:r,value:n})=>{if(r.length!==66)throw new ih({size:r.length,targetSize:66,type:"hex"});if(n.length!==66)throw new ih({size:n.length,targetSize:66,type:"hex"});return e[r]=n,e},{})}function mA(t){const{balance:e,nonce:r,state:n,stateDiff:i,code:s}=t,o={};if(s!==void 0&&(o.code=s),e!==void 0&&(o.balance=W(e)),r!==void 0&&(o.nonce=W(r)),n!==void 0&&(o.state=bh(n)),i!==void 0){if(o.state)throw new Kx;o.stateDiff=bh(i)}return o}function e0(t){if(!t)return;const e={};for(const{address:r,...n}of t){if(!ft(r,{strict:!1}))throw new Ft({address:r});if(e[r])throw new Vx({address:r});e[r]=mA(n)}return e}const Vc=2n**256n-1n;function Nn(t){const{account:e,maxFeePerGas:r,maxPriorityFeePerGas:n,to:i}=t,s=e?Ee(e):void 0;if(s&&!ft(s.address))throw new Ft({address:s.address});if(i&&!ft(i))throw new Ft({address:i});if(r&&r>Vc)throw new ji({maxFeePerGas:r});if(n&&r&&n>r)throw new Jo({maxFeePerGas:r,maxPriorityFeePerGas:n})}class I1 extends q{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class t0 extends q{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class gA extends q{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${Vt(e)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class r0 extends q{constructor({blockHash:e,blockNumber:r}){let n="Block";e&&(n=`Block at hash "${e}"`),r&&(n=`Block at number "${r}"`),super(`${n} could not be found.`,{name:"BlockNotFoundError"})}}const N1={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function xa(t,e){const r={...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,...t.blockTimestamp!=null&&{blockTimestamp:BigInt(t.blockTimestamp)},chainId:t.chainId?hr(t.chainId):void 0,gas:t.gas?BigInt(t.gas):void 0,gasPrice:t.gasPrice?BigInt(t.gasPrice):void 0,maxFeePerBlobGas:t.maxFeePerBlobGas?BigInt(t.maxFeePerBlobGas):void 0,maxFeePerGas:t.maxFeePerGas?BigInt(t.maxFeePerGas):void 0,maxPriorityFeePerGas:t.maxPriorityFeePerGas?BigInt(t.maxPriorityFeePerGas):void 0,nonce:t.nonce?hr(t.nonce):void 0,to:t.to?t.to:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,type:t.type?N1[t.type]:void 0,typeHex:t.type?t.type:void 0,value:t.value?BigInt(t.value):void 0,v:t.v?BigInt(t.v):void 0};return t.authorizationList&&(r.authorizationList=bA(t.authorizationList)),r.yParity=(()=>{if(t.yParity)return Number(t.yParity);if(typeof r.v=="bigint"){if(r.v===0n||r.v===27n)return 0;if(r.v===1n||r.v===28n)return 1;if(r.v>=35n)return r.v%2n===0n?1:0}})(),r.type==="legacy"&&(delete r.accessList,delete r.maxFeePerBlobGas,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas,delete r.yParity),r.type==="eip2930"&&(delete r.maxFeePerBlobGas,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas),r.type==="eip1559"&&delete r.maxFeePerBlobGas,r}const yA=Xl("transaction",xa);function bA(t){return t.map(e=>({address:e.address,chainId:Number(e.chainId),nonce:Number(e.nonce),r:e.r,s:e.s,yParity:Number(e.yParity)}))}function n0(t,e){const r=(t.transactions??[]).map(n=>typeof n=="string"?n:xa(n));return{...t,baseFeePerGas:t.baseFeePerGas?BigInt(t.baseFeePerGas):null,blobGasUsed:t.blobGasUsed?BigInt(t.blobGasUsed):void 0,difficulty:t.difficulty?BigInt(t.difficulty):void 0,excessBlobGas:t.excessBlobGas?BigInt(t.excessBlobGas):void 0,gasLimit:t.gasLimit?BigInt(t.gasLimit):void 0,gasUsed:t.gasUsed?BigInt(t.gasUsed):void 0,hash:t.hash?t.hash:null,logsBloom:t.logsBloom?t.logsBloom:null,nonce:t.nonce?t.nonce:null,number:t.number?BigInt(t.number):null,size:t.size?BigInt(t.size):void 0,timestamp:t.timestamp?BigInt(t.timestamp):void 0,transactions:r,totalDifficulty:t.totalDifficulty?BigInt(t.totalDifficulty):null}}const wA=Xl("block",n0);async function _r(t,{blockHash:e,blockNumber:r,blockTag:n=t.experimental_blockTag??"latest",includeTransactions:i}={}){const s=i??!1,o=r!==void 0?W(r):void 0;let a=null;if(e?a=await t.request({method:"eth_getBlockByHash",params:[e,s]},{dedupe:!0}):a=await t.request({method:"eth_getBlockByNumber",params:[o||n,s]},{dedupe:!!o}),!a)throw new r0({blockHash:e,blockNumber:r});return(t.chain?.formatters?.block?.format||n0)(a,"getBlock")}async function i0(t){const e=await t.request({method:"eth_gasPrice"});return BigInt(e)}async function vA(t,e){return k1(t,e)}async function k1(t,e){const{block:r,chain:n=t.chain,request:i}=e||{};try{const s=n?.fees?.maxPriorityFeePerGas??n?.fees?.defaultPriorityFee;if(typeof s=="function"){const a=r||await te(t,_r,"getBlock")({}),c=await s({block:a,client:t,request:i});if(c===null)throw new Error;return c}if(typeof s<"u")return s;const o=await t.request({method:"eth_maxPriorityFeePerGas"});
vendor: 4,829 bytes, line 62
62return bt(o)}catch{const[s,o]=await Promise.all([r?Promise.resolve(r):te(t,_r,"getBlock")({}),te(t,i0,"getGasPrice")({})]);if(typeof s.baseFeePerGas!="bigint")throw new t0;const a=o-s.baseFeePerGas;return a<0n?0n:a}}async function xA(t,e){return tl(t,e)}async function tl(t,e){const{block:r,chain:n=t.chain,request:i,type:s="eip1559"}=e||{},o=await(async()=>typeof n?.fees?.baseFeeMultiplier=="function"?n.fees.baseFeeMultiplier({block:r,client:t,request:i}):n?.fees?.baseFeeMultiplier??1.2)();if(o<1)throw new I1;const c=10**(o.toString().split(".")[1]?.length??0),u=m=>m*BigInt(Math.ceil(o*c))/BigInt(c),f=r||await te(t,_r,"getBlock")({});if(typeof n?.fees?.estimateFeesPerGas=="function"){const m=await n.fees.estimateFeesPerGas({block:r,client:t,multiply:u,request:i,type:s});if(m!==null)return m}if(s==="eip1559"){if(typeof f.baseFeePerGas!="bigint")throw new t0;const m=typeof i?.maxPriorityFeePerGas=="bigint"?i.maxPriorityFeePerGas:await k1(t,{block:f,chain:n,request:i}),g=u(f.baseFeePerGas);return{maxFeePerGas:i?.maxFeePerGas??g+m,maxPriorityFeePerGas:m}}return{gasPrice:i?.gasPrice??u(await te(t,i0,"getGasPrice")({}))}}function Ji(t){const{blockHash:e,blockNumber:r,blockTag:n,requireCanonical:i}=t;if(i!==void 0&&!e)throw new q("`requireCanonical` can only be provided when `blockHash` is set.");return e?i?{blockHash:e,requireCanonical:i}:{blockHash:e}:typeof r=="bigint"?W(r):n??"latest"}async function s0(t,{address:e,blockHash:r,blockNumber:n,blockTag:i="latest",requireCanonical:s}){const o=Ji({blockHash:r,blockNumber:n,blockTag:i,requireCanonical:s}),a=await t.request({method:"eth_getTransactionCount",params:[e,o]},{dedupe:typeof n=="bigint"||r!==void 0});return hr(a)}function o0(t){const{kzg:e}=t,r=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),n=typeof t.blobs[0]=="string"?t.blobs.map(s=>Xr(s)):t.blobs,i=[];for(const s of n)i.push(Uint8Array.from(e.blobToKzgCommitment(s)));return r==="bytes"?i:i.map(s=>pt(s))}function a0(t){const{kzg:e}=t,r=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),n=typeof t.blobs[0]=="string"?t.blobs.map(o=>Xr(o)):t.blobs,i=typeof t.commitments[0]=="string"?t.commitments.map(o=>Xr(o)):t.commitments,s=[];for(let o=0;o<n.length;o++){const a=n[o],c=i[o];s.push(Uint8Array.from(e.computeBlobKzgProof(a,c)))}return r==="bytes"?s:s.map(o=>pt(o))}function AA(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,u=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+u,a,n)}function EA(t,e,r){return t&e^~t&r}function PA(t,e,r){return t&e^t&r^e&r}class SA extends Hl{constructor(e,r,n,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.buffer=new Uint8Array(e),this.view=qu(this.buffer)}update(e){Os(this),e=Uc(e),Di(e);const{view:r,buffer:n,blockLen:i}=this,s=e.length;for(let o=0;o<s;){const a=Math.min(i-this.pos,s-o);if(a===i){const c=qu(e);for(;i<=s-o;o+=i)this.process(c,o);continue}n.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Os(this),i1(e,this),this.finished=!0;const{buffer:r,view:n,blockLen:i,isLE:s}=this;let{pos:o}=this;r[o++]=128,Fs(this.buffer.subarray(o)),this.padOffset>i-o&&(this.process(n,0),o=0);for(let d=o;d<i;d++)r[d]=0;AA(n,i-8,BigInt(this.length*8),s),this.process(n,0);const a=qu(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,f=this.get();if(u>f.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<u;d++)a.setUint32(4*d,f[d],s)}digest(){const{buffer:e,outputLen:r}=this;this.digestInto(e);const n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:r,buffer:n,length:i,finished:s,destroyed:o,pos:a}=this;return e.destroyed=o,e.finished=s,e.length=i,e.pos=a,i%r&&e.buffer.set(n),e}clone(){return this._cloneInto()}}const $n=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),_A=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
62734187,3204031479,3329325298]),Ln=new Uint32Array(64);class IA extends SA{constructor(e=32){super(64,e,8,!1),this.A=$n[0]|0,this.B=$n[1]|0,this.C=$n[2]|0,this.D=$n[3]|0,this.E=$n[4]|0,this.F=$n[5]|0,this.G=$n[6]|0,this.H=$n[7]|0}get(){const{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:c}=this;return[e,r,n,i,s,o,a,c]}set(e,r,n,i,s,o,a,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,r){for(let d=0;d<16;d++,r+=4)Ln[d]=e.getUint32(r,!1);for(let d=16;d<64;d++){const m=Ln[d-15],g=Ln[d-2],w=Fr(m,7)^Fr(m,18)^m>>>3,A=Fr(g,17)^Fr(g,19)^g>>>10;Ln[d]=A+Ln[d-7]+w+Ln[d-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:u,H:f}=this;for(let d=0;d<64;d++){const m=Fr(a,6)^Fr(a,11)^Fr(a,25),g=f+m+EA(a,c,u)+_A[d]+Ln[d]|0,A=(Fr(n,2)^Fr(n,13)^Fr(n,22))+PA(n,i,s)|0;f=u,u=c,c=a,a=o+g|0,o=s,s=i,i=n,n=g+A|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,f=f+this.H|0,this.set(n,i,s,o,a,c,u,f)}roundClean(){Fs(Ln)}destroy(){this.set(0,0,0,0,0,0,0,0),Fs(this.buffer)}}const M1=s1(()=>new IA),NA=M1;function kA(t,e){return NA(kr(t,{strict:!1})?Xs(t):t)}function MA(t){const{commitment:e,version:r=1}=t,n=t.to??(typeof e=="string"?"hex":"bytes"),i=kA(e);return i.set([r],0),n==="bytes"?i:pt(i)}function T1(t){const{commitments:e,version:r}=t,n=t.to??(typeof e[0]=="string"?"hex":"bytes"),i=[];for(const s of e)i.push(MA({commitment:s,to:n,version:r}));return i}const wh=6,R1=32,c0=4096,C1=R1*c0,vh=C1*wh-1-1*c0*wh,B1=1;class TA extends q{constructor({maxSize:e,size:r}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${r} bytes`],name:"BlobSizeTooLargeError"})}}class O1 extends q{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class RA extends q{constructor({hash:e,size:r}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${r}`],name:"InvalidVersionedHashSizeError"})}}class CA extends q{constructor({hash:e,version:r}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${B1}`,`Received: ${r}`],name:"InvalidVersionedHashVersionError"})}}function BA(t){const e=t.to??(typeof t.data=="string"?"hex":"bytes"),r=typeof t.data=="string"?Xr(t.data):t.data,n=rt(r);if(!n)throw new O1;if(n>vh)throw new TA({maxSize:vh,size:n});const i=[];let s=!0,o=0;for(;s;){const a=Ql(new Uint8Array(C1));let c=0;for(;c<c0;){const u=r.slice(o,o+(R1-1));if(a.pushByte(0),a.pushBytes(u),u.length<31){a.pushByte(128),s=!1;break}c++,o+=31}i.push(a)}return e==="bytes"?i.map(a=>a.bytes):i.map(a=>pt(a.bytes))}function F1(t){const{data:e,kzg:r,to:n}=t,i=t.blobs??BA({data:e,to:n}),s=t.commitments??o0({blobs:i,kzg:r,to:n}),o=t.proofs??a0({blobs:i,commitments:s,kzg:r,to:n}),a=[];for(let c=0;c<i.length;c++)a.push({blob:i[c],commitment:s[c],proof:o[c]});return a}function $1(t){if(t.type)return t.type;if(typeof t.authorizationList<"u")return"eip7702";if(typeof t.blobs<"u"||typeof t.blobVersionedHashes<"u"||typeof t.maxFeePerBlobGas<"u"||typeof t.sidecars<"u")return"eip4844";if(typeof t.maxFeePerGas<"u"||typeof t.maxPriorityFeePerGas<"u")return"eip1559";if(typeof t.gasPrice<"u")return typeof t.accessList<"u"?"eip2930":"legacy";throw new Jx({transaction:t})}function Kc(t,{docsPath:e,...r}){const n=(()=>{const i=Hc(t,r);return i instanceof va?t:i})();return new Zx(n,{docsPath:e,...r})}async function en(t){const e=await t.request({method:"eth_chainId"},{dedupe:!0});return hr(e)}async function u0(t,e){const{account:r=t.account,accessList:n,authorizationList:i,chain:s=t.chain,blobVersionedHashes:o,blobs:a,data:c,gas:u,gasPrice:f,maxFeePerBlobGas:d,maxFeePerGas:m,maxPriorityFeePerGas:g,nonce:w,nonceManager:A,to:k,type:_,value:B,...T}=e,N=await(async()=>{if(!r||!A||typeof w<"u")return w;const L=Ee(r),z=s?s.id:await te(t,en,"getChainId")({});return await A.consume({address:L.address,chainId:z,client:t})})();Nn(e);const M=s?.formatters?.transactionRequest?.format,F=(M||ii)({...to(T,{format:M}),account:r?Ee(r):void 0,accessList:n,authorizationList:i,blobs:a,blobVersionedHashes:o,data:c,gas:u,gasPrice:f,maxFeePerBlobGas:d,maxFeePerGas:m,maxPriorityFeePerGas:g,nonce:N,to:k,type:_,value:B},"fillTransaction");try{const L=await t.request({method:"eth_fillTransaction",params:[F]}),D=(s?.formatters?.transaction?.format||xa)(L.tx);delete D.blockHash,delete D.blockNumber,delete D.r,delete D.s,delete D.transactionIndex,delete D.v,delete D.yParity,D.data=D.input,D.gas&&(D.gas=e.gas??D.gas),D.gasPrice&&(D.gasPrice=e.gasPrice??D.gasPrice),D.maxFeePerBlobGas&&(D.maxFeePerBlobGas=e.maxFeePerBlobGas??D.maxFeePerBlobGas),D.maxFeePerGas&&(D.maxFeePerGas=e.maxFeePerGas??D.maxFeePerGas),D.maxPriorityFeePerGas&&(D.maxPriorityFeePerGas=e.maxPriorityFeePerGas??D.maxPriorityFeePerGas),typeof D.nonce<"u"&&(D.nonce=e.nonce??D.nonce);const j=await(async()=>
62{if(typeof s?.fees?.baseFeeMultiplier=="function"){const p=await te(t,_r,"getBlock")({});return s.fees.baseFeeMultiplier({block:p,client:t,request:e})}return s?.fees?.baseFeeMultiplier??1.2})();if(j<1)throw new I1;const E=10**(j.toString().split(".")[1]?.length??0),l=p=>p*BigInt(Math.ceil(j*E))/BigInt(E);return D.feePayerSignature||(D.maxFeePerGas&&!e.maxFeePerGas&&(D.maxFeePerGas=l(D.maxFeePerGas)),D.gasPrice&&!e.gasPrice&&(D.gasPrice=l(D.gasPrice))),{raw:L.raw,transaction:{from:F.from,...D},...L.capabilities?{capabilities:L.capabilities}:{}}}catch(L){throw Kc(L,{...e,chain:t.chain})}}const f0=["blobVersionedHashes","chainId","fees","gas","nonce","type"],xh=new Map,Hu=new eo(128);async function Aa(t,e){let r=e;r.account??(r.account=t.account),r.parameters??(r.parameters=f0);const{account:n,chain:i=t.chain,nonceManager:s,parameters:o}=r,a=(()=>{if(typeof i?.prepareTransactionRequest=="function")return{fn:i.prepareTransactionRequest,runAt:["beforeFillTransaction"]};if(Array.isArray(i?.prepareTransactionRequest))return{fn:i.prepareTransactionRequest[0],runAt:i.prepareTransactionRequest[1].runAt}})();let c;async function u(){return c||(typeof r.chainId<"u"?r.chainId:i?i.id:(c=await te(t,en,"getChainId")({}),c))}const f=n&&Ee(n);let d=r.nonce;if(o.includes("nonce")&&typeof d>"u"&&f&&s){const N=await u();d=await s.consume({address:f.address,chainId:N,client:t})}a?.fn&&a.runAt?.includes("beforeFillTransaction")&&(r=await a.fn({...r,chain:i},{client:t,phase:"beforeFillTransaction"}),d??(d=r.nonce));const g=((o.includes("blobVersionedHashes")||o.includes("sidecars"))&&r.kzg&&r.blobs||Hu.get(t.uid)===!1||!["fees","gas"].some(M=>o.includes(M))?!1:!!(o.includes("chainId")&&typeof r.chainId!="number"||o.includes("nonce")&&typeof d!="number"||o.includes("fees")&&typeof r.gasPrice!="bigint"&&(typeof r.maxFeePerGas!="bigint"||typeof r.maxPriorityFeePerGas!="bigint")||o.includes("gas")&&typeof r.gas!="bigint"))?await te(t,u0,"fillTransaction")({...r,nonce:d}).then(N=>{const{chainId:M,from:O,gas:F,gasPrice:L,nonce:z,maxFeePerBlobGas:D,maxFeePerGas:j,maxPriorityFeePerGas:Q,type:E,...l}=N.transaction,p="feeToken"in l?l.feeToken:void 0,b="feePayerSignature"in l&&l.feePayerSignature!==null&&typeof l.feePayerSignature<"u",x=typeof p<"u"&&p!==null&&(!("feeToken"in r)||b);return Hu.set(t.uid,!0),{...r,...O?{from:O}:{},...E&&!r.type?{type:E}:{},...typeof M<"u"?{chainId:M}:{},...typeof F<"u"?{gas:F}:{},...typeof L<"u"?{gasPrice:L}:{},...typeof z<"u"?{nonce:z}:{},...typeof D<"u"&&r.type!=="legacy"&&r.type!=="eip2930"?{maxFeePerBlobGas:D}:{},...typeof j<"u"&&r.type!=="legacy"&&r.type!=="eip2930"?{maxFeePerGas:j}:{},...typeof Q<"u"&&r.type!=="legacy"&&r.type!=="eip2930"?{maxPriorityFeePerGas:Q}:{},..."nonceKey"in l&&typeof l.nonceKey<"u"?{nonceKey:l.nonceKey}:{},..."keyAuthorization"in l&&typeof l.keyAuthorization<"u"&&l.keyAuthorization!==null&&!("keyAuthorization"in r)?{keyAuthorization:l.keyAuthorization}:{},..."feePayerSignature"in l&&typeof l.feePayerSignature<"u"&&l.feePayerSignature!==null?{feePayerSignature:l.feePayerSignature}:{},...x?{feeToken:p}:{},...N.capabilities?{_capabilities:N.capabilities}:{}}}).catch(N=>{const M=N;if(M.name!=="TransactionExecutionError")return r;if(M.walk?.(L=>L.name==="ExecutionRevertedError"))throw N;return M.walk?.(L=>{const z=L;return z.name==="MethodNotFoundRpcError"||z.name==="MethodNotSupportedRpcError"||z.message?.includes("eth_fillTransaction is not available")})&&Hu.set(t.uid,!1),r}):r;d??(d=g.nonce),r={...g,...f?{from:f?.address}:{},...typeof d<"u"?{nonce:d}:{}};const{blobs:w,gas:A,kzg:k,type:_}=r;a?.fn&&a.runAt?.includes("beforeFillParameters")&&(r=await a.fn({...r,chain:i},{client:t,phase:"beforeFillParameters"}));let B;async function T(){return B||(B=await te(t,_r,"getBlock")({blockTag:"latest"}),B)}if(o.includes("nonce")&&typeof d>"u"&&f&&!s&&(r.nonce=await te(t,s0,"getTransactionCount")({address:f.address,blockTag:"pending"})),(o.includes("blobVersionedHashes")||o.includes("sidecars"))&&w&&k){const N=o0({blobs:w,kzg:k});if(o.includes("blobVersionedHashes")){const M=T1({commitments:N,to:"hex"});r.blobVersionedHashes=M}if(o.includes("sidecars")){const M=a0({blobs:w,commitments:N,kzg:k}),O=F1({blobs:w,commitments:N,proofs:M,to:"hex"});r.sidecars=O}}if(o.includes("chainId")&&(r.chainId=await u()),(o.includes("fees")||o.includes("type"))&&typeof _>"u")try{r.type=$1(r)}catch{let N=xh.get(t.uid);typeof N>"u"&&(N=typeof(await T())?.baseFeePerGas=="bigint",xh.set(t.uid,N)),r.type=N?"eip1559":"legacy"}
62if(o.includes("fees"))if(r.type!=="legacy"&&r.type!=="eip2930"){if(typeof r.maxFeePerGas>"u"||typeof r.maxPriorityFeePerGas>"u"){const N=await T(),{maxFeePerGas:M,maxPriorityFeePerGas:O}=await tl(t,{block:N,chain:i,request:r});if(typeof r.maxPriorityFeePerGas>"u"&&r.maxFeePerGas&&r.maxFeePerGas<O)throw new gA({maxPriorityFeePerGas:O});r.maxPriorityFeePerGas=O,r.maxFeePerGas=M}}else{if(typeof r.maxFeePerGas<"u"||typeof r.maxPriorityFeePerGas<"u")throw new t0;if(typeof r.gasPrice>"u"){const N=await T(),{gasPrice:M}=await tl(t,{block:N,chain:i,request:r,type:"legacy"});r.gasPrice=M}}return o.includes("gas")&&typeof A>"u"&&(r.gas=await te(t,l0,"estimateGas")({...r,account:f,prepare:f?.type==="local"?[]:["blobVersionedHashes"]})),a?.fn&&a.runAt?.includes("afterFillParameters")&&(r=await a.fn({...r,chain:i},{client:t,phase:"afterFillParameters"})),Nn(r),delete r.parameters,r}async function l0(t,e){const{account:r=t.account,prepare:n=!0}=e,i=r?Ee(r):void 0,s=(()=>{if(Array.isArray(n))return n;if(i?.type!=="local")return["blobVersionedHashes"]})();try{const o=await(async()=>{if(e.to)return e.to;if(e.authorizationList&&e.authorizationList.length>0)return await Gc({authorization:e.authorizationList[0]}).catch(()=>{throw new q("`to` is required. Could not infer from `authorizationList`")})})(),{accessList:a,authorizationList:c,blobs:u,blobVersionedHashes:f,blockNumber:d,blockTag:m,data:g,gas:w,gasPrice:A,maxFeePerBlobGas:k,maxFeePerGas:_,maxPriorityFeePerGas:B,nonce:T,value:N,stateOverride:M,...O}=n?await Aa(t,{...e,parameters:s,to:o}):e;if(w&&e.gas!==w)return w;const L=(typeof d=="bigint"?W(d):void 0)||m,z=e0(M);Nn(e);const D=t.chain?.formatters?.transactionRequest?.format,Q=(D||ii)({...to(O,{format:D}),account:i,accessList:a,authorizationList:c,blobs:u,blobVersionedHashes:f,data:g,gasPrice:A,maxFeePerBlobGas:k,maxFeePerGas:_,maxPriorityFeePerGas:B,nonce:T,to:o,value:N},"estimateGas");return BigInt(await t.request({method:"eth_estimateGas",params:z?[Q,L??t.experimental_blockTag??"latest",z]:L?[Q,L]:[Q]}))}catch(o){throw dA(o,{...e,account:i,chain:t.chain})}}async function d0(t,e){const{abi:r,address:n,args:i,functionName:s,dataSuffix:o=typeof t.dataSuffix=="string"?t.dataSuffix:t.dataSuffix?.value,...a}=e,c=Lt({abi:r,args:i,functionName:s});try{return await te(t,l0,"estimateGas")({data:`${c}${o?o.replace("0x",""):""}`,to:n,...a})}catch(u){const f=a.account?Ee(a.account):void 0;throw qi(u,{abi:r,address:n,args:i,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:f?.address})}}function tn(t,e){if(!ft(t,{strict:!1}))throw new Ft({address:t});if(!ft(e,{strict:!1}))throw new Ft({address:e});return t.toLowerCase()===e.toLowerCase()}function rn(t,{args:e,eventName:r}={}){return{...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,blockTimestamp:t.blockTimestamp?BigInt(t.blockTimestamp):t.blockTimestamp===null?null:void 0,logIndex:t.logIndex?Number(t.logIndex):null,transactionHash:t.transactionHash?t.transactionHash:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,...r?{args:e,eventName:r}:{}}}const Ah="/docs/contract/decodeEventLog";function gc(t){const{abi:e,data:r,strict:n,topics:i}=t,s=n??!0,[o,...a]=i;if(!o)throw new S5({docsPath:Ah});const c=e.find(_=>_.type==="event"&&o===Dc(Nr(_)));if(!(c&&"name"in c)||c.type!=="event")throw new _5(o,{docsPath:Ah});const{name:u,inputs:f}=c,d=f?.some(_=>!("name"in _&&_.name)),m=d?[]:{},g=f.map((_,B)=>[_,B]).filter(([_])=>"indexed"in _&&_.indexed),w=[];for(let _=0;_<g.length;_++){const[B,T]=g[_],N=a[_];if(!N){if(s)throw new jl({abiItem:c,param:B});w.push([B,T]);continue}m[d?T:B.name||T]=OA({param:B,value:N})}const A=f.filter(_=>!("indexed"in _&&_.indexed)),k=s?A:[...w.map(([_])=>_),...A];if(k.length>0){if(r&&r!=="0x")try{const _=ga(k,r);if(_){let B=0;if(!s)for(const[T,N]of w)m[d?N:T.name||N]=_[B++];if(d)for(let T=0;T<f.length;T++)m[T]===void 0&&B<_.length&&(m[T]=_[B++]);else for(let T=0;T<A.length;T++)m[A[T].name]=_[B++]}}catch(_){if(s)throw _ instanceof Ym||_ instanceof w1?new mc({abiItem:c,data:r,params:k,size:rt(r)}):_}else if(s)throw new mc({abiItem:c,data:"0x",params:k,size:0})}return{eventName:u,args:Object.values(m).length>0?m:void 0}}function OA({param:t,value:e}){return t.type==="string"||t.type==="bytes"||t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/)?e:(ga([t],e)||[])[0]}function Ea(t){const{abi:e,args:r,logs:n,strict:i=!0}=t,s=(()=>
62{if(t.eventName)return Array.isArray(t.eventName)?t.eventName:[t.eventName]})(),o=e.filter(a=>a.type==="event").map(a=>({abi:a,selector:Dc(a)}));return n.map(a=>{const c=typeof a.blockNumber=="string"?rn(a):a,u=o.filter(m=>c.topics[0]===m.selector);if(u.length===0)return null;let f,d;for(const m of u)try{f=gc({...c,abi:[m.abi],strict:!0}),d=m;break}catch{}if(!f&&!i){d=u[0];try{f=gc({data:c.data,topics:c.topics,abi:[d.abi],strict:!1})}catch{const m=d.abi.inputs?.some(g=>!("name"in g&&g.name));return{...c,args:m?[]:{},eventName:d.abi.name}}}return!f||!d||s&&!s.includes(f.eventName)||!FA({args:f.args,inputs:d.abi.inputs,matchArgs:r})?null:{...f,...c}}).filter(Boolean)}function FA(t){const{args:e,inputs:r,matchArgs:n}=t;if(!n)return!0;if(!e)return!1;function i(s,o,a){try{return s.type==="address"?tn(o,a):s.type==="string"||s.type==="bytes"?At(Xs(o))===a:o===a}catch{return!1}}return Array.isArray(e)&&Array.isArray(n)?n.every((s,o)=>{if(s==null)return!0;const a=r[o];return a?(Array.isArray(s)?s:[s]).some(u=>i(a,u,e[o])):!1}):typeof e=="object"&&!Array.isArray(e)&&typeof n=="object"&&!Array.isArray(n)?Object.entries(n).every(([s,o])=>{if(o==null)return!0;const a=r.find(u=>u.name===s);return a?(Array.isArray(o)?o:[o]).some(u=>i(a,u,e[s])):!1}):!1}async function h0(t,{address:e,blockHash:r,fromBlock:n,toBlock:i,event:s,events:o,args:a,strict:c}={}){const u=c??!1,f=o??(s?[s]:void 0);let d=[];f&&(d=[f.flatMap(A=>ma({abi:[A],eventName:A.name,args:o?void 0:a}))],s&&(d=d[0]));let m;r?m=await t.request({method:"eth_getLogs",params:[{address:e,topics:d,blockHash:r}]}):m=await t.request({method:"eth_getLogs",params:[{address:e,topics:d,fromBlock:typeof n=="bigint"?W(n):n,toBlock:typeof i=="bigint"?W(i):i}]});const g=m.map(w=>rn(w));return f?Ea({abi:f,args:a,logs:g,strict:u}):g}async function L1(t,e){const{abi:r,address:n,args:i,blockHash:s,eventName:o,fromBlock:a,toBlock:c,strict:u}=e,f=o?Qi({abi:r,name:o}):void 0,d=f?void 0:r.filter(m=>m.type==="event");return te(t,h0,"getLogs")({address:n,args:i,blockHash:s,event:f,events:d,fromBlock:a,toBlock:c,strict:u})}const Vu="/docs/contract/decodeFunctionResult";function si(t){const{abi:e,args:r,functionName:n,data:i}=t;let s=e[0];if(n){const a=Qi({abi:e,args:r,name:n});if(!a)throw new Bs(n,{docsPath:Vu});s=a}if(s.type!=="function")throw new Bs(void 0,{docsPath:Vu});if(!s.outputs)throw new Xm(s.name,{docsPath:Vu});const o=ga(s.outputs,i);if(o&&o.length>1)return o;if(o&&o.length===1)return o[0]}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const p0=BigInt(0),rl=BigInt(1);function Pa(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function m0(t){if(!Pa(t))throw new Error("Uint8Array expected")}function Yo(t,e){if(typeof e!="boolean")throw new Error(t+" boolean expected, got "+e)}function za(t){const e=t.toString(16);return e.length&1?"0"+e:e}function U1(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?p0:BigInt("0x"+t)}const D1=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",$A=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Zo(t){if(m0(t),D1)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=$A[t[r]];return e}const cn={_0:48,_9:57,A:65,F:70,a:97,f:102};function Eh(t){if(t>=cn._0&&t<=cn._9)return t-cn._0;if(t>=cn.A&&t<=cn.F)return t-(cn.A-10);if(t>=cn.a&&t<=cn.f)return t-(cn.a-10)}function yc(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);if(D1)return Uint8Array.fromHex(t);const e=t.length,r=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(r);for(let i=0,s=0;i<r;i++,s+=2){const o=Eh(t.charCodeAt(s)),a=Eh(t.charCodeAt(s+1));if(o===void 0||a===void 0){const c=t[s]+t[s+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+s)}n[i]=o*16+a}return n}function Bi(t){return U1(Zo(t))}function z1(t){return m0(t),U1(Zo(Uint8Array.from(t).reverse()))}function Sa(t,e){return yc(t.toString(16).padStart(e*2,"0"))}function q1(t,e){return Sa(t,e).reverse()}function cr(t,e,r){let n;if(typeof e=="string")try{n=yc(e)}catch(s){throw new Error(t+" must be hex string or Uint8Array, cause: "+s)}else if(Pa(e))n=Uint8Array.from(e);else throw new Error(t+" must be hex string or Uint8Array");const i=n.length;if(typeof r=="number"&&i!==r)throw new Error(t+" of length "+r+" expected, got "+i);return n}function bc(...t){let e=0;for(let n=0;n<t.length;n++){const i=t[n];m0(i),e+=i.length}
vendor: 9,085 bytes, lines 62-63
62const r=new Uint8Array(e);for(let n=0,i=0;n<t.length;n++){const s=t[n];r.set(s,i),i+=s.length}return r}const Ku=t=>typeof t=="bigint"&&p0<=t;function g0(t,e,r){return Ku(t)&&Ku(e)&&Ku(r)&&e<=t&&t<r}function ps(t,e,r,n){if(!g0(e,r,n))throw new Error("expected valid "+t+": "+r+" <= n < "+n+", got "+e)}function LA(t){let e;for(e=0;t>p0;t>>=rl,e+=1);return e}const Wc=t=>(rl<<BigInt(t))-rl,Wu=t=>new Uint8Array(t),Ph=t=>Uint8Array.from(t);function UA(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=Wu(t),i=Wu(t),s=0;const o=()=>{n.fill(1),i.fill(0),s=0},a=(...d)=>r(i,n,...d),c=(d=Wu(0))=>{i=a(Ph([0]),d),n=a(),d.length!==0&&(i=a(Ph([1]),d),n=a())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let d=0;const m=[];for(;d<e;){n=a();const g=n.slice();m.push(g),d+=n.length}return bc(...m)};return(d,m)=>{o(),c(d);let g;for(;!(g=m(u()));)c();return o(),g}}const DA={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||Pa(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function Qc(t,e,r={}){const n=(i,s,o)=>{const a=DA[s];if(typeof a!="function")throw new Error("invalid validator function");const c=t[i];if(!(o&&c===void 0)&&!a(c,t))throw new Error("param "+String(i)+" is invalid. Expected "+s+", got "+c)};for(const[i,s]of Object.entries(e))n(i,s,!1);for(const[i,s]of Object.entries(r))n(i,s,!0);return t}function Sh(t){const e=new WeakMap;return(r,...n)=>{const i=e.get(r);if(i!==void 0)return i;const s=t(r,...n);return e.set(r,s),s}}const zA="0.1.1";function qA(){return zA}class ue extends Error{static setStaticOptions(e){ue.prototype.docsOrigin=e.docsOrigin,ue.prototype.showVersion=e.showVersion,ue.prototype.version=e.version}constructor(e,r={}){const n=(()=>{if(r.cause instanceof ue){if(r.cause.details)return r.cause.details;if(r.cause.shortMessage)return r.cause.shortMessage}return r.cause&&"details"in r.cause&&typeof r.cause.details=="string"?r.cause.details:r.cause?.message?r.cause.message:r.details})(),i=r.cause instanceof ue&&r.cause.docsPath||r.docsPath,s=r.docsOrigin??ue.prototype.docsOrigin,o=`${s}${i??""}`,a=!!(r.version??ue.prototype.showVersion),c=r.version??ue.prototype.version,u=[e||"An error occurred.",...r.metaMessages?["",...r.metaMessages]:[],...n||i||a?["",n?`Details: ${n}`:void 0,i?`See: ${o}`:void 0,a?`Version: ${c}`:void 0]:[]].filter(f=>typeof f=="string").join(`
63`);super(u,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=r.cause,this.details=n,this.docs=o,this.docsOrigin=s,this.docsPath=i,this.shortMessage=e,this.showVersion=a,this.version=c}walk(e){return j1(this,e)}}Object.defineProperty(ue,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${qA()}`}});ue.setStaticOptions(ue.defaultStaticOptions);function j1(t,e){return e?.(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause?j1(t.cause,e):e?null:t}function _a(t,e){if(os(t)>e)throw new sE({givenSize:os(t),maxSize:e})}const un={zero:48,nine:57,A:65,F:70,a:97,f:102};function _h(t){if(t>=un.zero&&t<=un.nine)return t-un.zero;if(t>=un.A&&t<=un.F)return t-(un.A-10);if(t>=un.a&&t<=un.f)return t-(un.a-10)}function jA(t,e={}){const{dir:r,size:n=32}=e;if(n===0)return t;if(t.length>n)throw new oE({size:t.length,targetSize:n,type:"Bytes"});const i=new Uint8Array(n);for(let s=0;s<n;s++){const o=r==="right";i[o?s:n-s-1]=t[o?s:t.length-s-1]}return i}function G1(t,e={}){const{dir:r="left"}=e;let n=t,i=0;for(let s=0;s<n.length-1&&n[r==="left"?s:n.length-s-1].toString()==="0";s++)i++;return n=r==="left"?n.slice(i):n.slice(0,n.length-i),n}function Jc(t,e){if(nr(t)>e)throw new dE({givenSize:nr(t),maxSize:e})}function GA(t,e){if(typeof e=="number"&&e>0&&e>nr(t)-1)throw new X1({offset:e,position:"start",size:nr(t)})}function HA(t,e,r){if(typeof e=="number"&&typeof r=="number"&&nr(t)!==r-e)throw new X1({offset:r,position:"end",size:nr(t)})}function H1(t,e={}){const{dir:r,size:n=32}=e;if(n===0)return t;const i=t.replace("0x","");if(i.length>n*2)throw new hE({size:Math.ceil(i.length/2),targetSize:n,type:"Hex"});return`0x${i[r==="right"?"padEnd":"padStart"](n*2,"0")}`}const VA="#__bigint";function V1(t,e,r){return JSON.stringify(t,(n,i)=>typeof i=="bigint"?i.toString()+VA:i,r)}const KA=new TextDecoder,WA=new TextEncoder;function QA(t){return t instanceof Uint8Array?t:typeof t=="string"?K1(t):JA(t)}function JA(t){return t instanceof Uint8Array?t:new Uint8Array(t)}function K1(t,e={}){const{size:r}=e;let n=t;r&&(Jc(t,r),n=Hi(t,r));let i=n.slice(2);i.length%2&&(i=`0${i}`);const s=i.length/2,o=new Uint8Array(s);for(let a=0,c=0;a<s;a++){const u=_h(i.charCodeAt(c++)),f=_h(i.charCodeAt(c++));if(u===void 0||f===void 0)throw new ue(`Invalid byte sequence ("${i[c-2]}${i[c-1]}" in "${i}").`);o[a]=u<<4|f}return o}function YA(t,e={}){const{size:r}=e,n=WA.encode(t);return typeof r=="number"?(_a(n,r),ZA(n,r)):n}function ZA(t,e){return jA(t,{dir:"right",size:e})}function os(t){return t.length}function XA(t,e,r,n={}){return t.slice(e,r)}function eE(t,e={}){const{size:r}=e;typeof r<"u"&&_a(t,r);const n=Cr(t,e);return J1(n,e)}function tE(t,e={}){const{size:r}=e;let n=t;if(typeof r<"u"&&(_a(n,r),n=W1(n)),n.length>1||n[0]>1)throw new iE(n);return!!n[0]}function wn(t,e={}){const{size:r}=e;typeof r<"u"&&_a(t,r);const n=Cr(t,e);return Y1(n,e)}function rE(t,e={}){const{size:r}=e;let n=t;return typeof r<"u"&&(_a(n,r),n=nE(n)),KA.decode(n)}function W1(t){return G1(t,{dir:"left"})}function nE(t){return G1(t,{dir:"right"})}class iE extends ue{constructor(e){super(`Bytes value \`${e}\` is not a valid boolean.`,{metaMessages:["The bytes array must contain a single byte of either a `0` or `1` value."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesBooleanError"})}}let sE=class extends ue{constructor({givenSize:e,maxSize:r}){super(`Size cannot exceed \`${r}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}},oE=class extends ue{constructor({size:e,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}};const aE=new TextEncoder,cE=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function uE(t,e={}){const{strict:r=!1}=e;if(!t)throw new Ih(t);if(typeof t!="string")throw new Ih(t);if(r&&!/^0x[0-9a-fA-F]*$/.test(t))throw new Nh(t);if(!t.startsWith("0x"))throw new Nh(t)}function Rr(...t){return`0x${t.reduce((e,r)=>e+r.replace("0x",""),"")}`}function fE(t){return t instanceof Uint8Array?Cr(t):Array.isArray(t)?Cr(new Uint8Array(t)):t}function Q1(t,e={}){const r=`0x${Number(t)}`;return typeof e.size=="number"?(Jc(r,e.size),Gi(r,e.size)):r}function Cr(t,e={}){let r="";for(let i=0;i<t.length;i++)r+=cE[t[i]];const n=`0x${r}`;return typeof e.size=="number"?(Jc(n,e.size),Hi(n,e.size)):n}function Ct(t,e={}){const{signed:r,size:n}=e,i=BigInt(t);let s;n?r?s=(1n<<BigInt(n)*8n-1n)-1n:s=2n**(BigInt(n)*8n)-1n:typeof t=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof s=="bigint"&&r?-s-1n:0;if(s&&i>s||i<o){const u=typeof t=="bigint"?"n":"";throw new Z1({max:s?`${s}${u}`:void 0,min:`${o}${u}`,signed:r,size:n,value:`${t}${u}`})}const c=`0x${(r&&i<0?BigInt.asUintN(n*8,BigInt(i)):i).toString(16)}`;return n?Gi(c,n):c}function y0(t,e={}){return Cr(aE.encode(t),e)}function Gi(t,e){return H1(t,{dir:"left",size:e})}function Hi(t,e){return H1(t,{dir:"right",size:e})}function Qr(t,e,r,n={}){const{strict:i}=n;GA(t,e);const s=`0x${t.replace("0x","").slice((e??0)*2,(r??t.length)*2)}`;return i&&HA(s,e,r),s}function nr(t){return Math.ceil((t.length-2)/2)}function J1(t,e={}){const{signed:r}=e;e.size&&Jc(t,e.size);const n=BigInt(t);if(!r)return n;
vendor: 6,023 bytes, line 63
63const i=(t.length-2)/2,s=(1n<<BigInt(i)*8n)-1n,o=s>>1n;return n<=o?n:n-s-1n}function Y1(t,e={}){const{signed:r,size:n}=e;return Number(!r&&!n?t:J1(t,e))}function lE(t,e={}){const{strict:r=!1}=e;try{return uE(t,{strict:r}),!0}catch{return!1}}class Z1 extends ue{constructor({max:e,min:r,signed:n,size:i,value:s}){super(`Number \`${s}\` is not in safe${i?` ${i*8}-bit`:""}${n?" signed":" unsigned"} integer range ${e?`(\`${r}\` to \`${e}\`)`:`(above \`${r}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class Ih extends ue{constructor(e){super(`Value \`${typeof e=="object"?V1(e):e}\` of type \`${typeof e}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}class Nh extends ue{constructor(e){super(`Value \`${e}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}class dE extends ue{constructor({givenSize:e,maxSize:r}){super(`Size cannot exceed \`${r}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}class X1 extends ue{constructor({offset:e,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset \`${e}\` is out-of-bounds (size: \`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}class hE extends ue{constructor({size:e,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}function pE(t){return{address:t.address,amount:Ct(t.amount),index:Ct(t.index),validatorIndex:Ct(t.validatorIndex)}}function eg(t){return{...typeof t.baseFeePerGas=="bigint"&&{baseFeePerGas:Ct(t.baseFeePerGas)},...typeof t.blobBaseFee=="bigint"&&{blobBaseFee:Ct(t.blobBaseFee)},...typeof t.feeRecipient=="string"&&{feeRecipient:t.feeRecipient},...typeof t.gasLimit=="bigint"&&{gasLimit:Ct(t.gasLimit)},...typeof t.number=="bigint"&&{number:Ct(t.number)},...typeof t.prevRandao=="bigint"&&{prevRandao:Ct(t.prevRandao)},...typeof t.time=="bigint"&&{time:Ct(t.time)},...t.withdrawals&&{withdrawals:t.withdrawals.map(pE)}}}const zs=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{name:"addr",type:"address"}],name:"getEthBalance",outputs:[{name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],nl=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],tg=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}],rg=[...tg,{name:"resolveWithGateways",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],mE=[...tg,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],kh=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],ng=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],ig=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],Mh=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}
63],lr=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],gE="0x82ad56cb",sg="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",yE="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",bE
vendor: 3,374 bytes, line 63
63="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",
63b0="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9
63150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033";class il extends q{constructor({blockNumber:e,chain:r,contract:n}){super(`Chain "${r.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...e&&n.blockCreated&&n.blockCreated>e?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${n.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class wE extends q{constructor({chain:e,currentChainId:r}){super(`The current chain of the wallet (id: ${r}) does not match the target chain for the transaction (id: ${e.id} – ${e.name}).`,{metaMessages:[`Current Chain ID:  ${r}`,`Expected Chain ID: ${e.id} – ${e.name}`],name:"ChainMismatchError"})}}class vE extends q{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(`
64`),{name:"ChainNotFoundError"})}}class og extends q{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}class Yc extends q{constructor({chainId:e}){super(typeof e=="number"?`Chain ID "${e}
64" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}const Qu="/docs/contract/encodeDeployData";function Zc(t){const{abi:e,args:r,bytecode:n}=t;if(!r||r.length===0)return n;const i=e.find(o=>"type"in o&&o.type==="constructor");if(!i)throw new v5({docsPath:Qu});if(!("inputs"in i))throw new th({docsPath:Qu});if(!i.inputs||i.inputs.length===0)throw new th({docsPath:Qu});const s=ri(i.inputs,r);return Pt([n,s])}function ro({blockNumber:t,chain:e,contract:r}){const n=e?.contracts?.[r];if(!n)throw new il({chain:e,contract:{name:r}});if(t&&n.blockCreated&&n.blockCreated>t)throw new il({blockNumber:t,chain:e,contract:{name:r,blockCreated:n.blockCreated}});return n.address}function ag(t,{docsPath:e,...r}){const n=(()=>{const i=Hc(t,r);return i instanceof va?t:i})();return new E1(n,{docsPath:e,...r})}function w0(){let t=()=>{},e=()=>{};return{promise:new Promise((n,i)=>{t=n,e=i}),resolve:t,reject:e}}const Ju=new Map;function cg({fn:t,id:e,shouldSplitBatch:r,wait:n=0,sort:i}){const s=async()=>{const f=c();o();const d=f.map(({args:m})=>m);d.length!==0&&t(d).then(m=>{i&&Array.isArray(m)&&m.sort(i);for(let g=0;g<f.length;g++){const{resolve:w}=f[g];w?.([m[g],m])}}).catch(m=>{for(let g=0;g<f.length;g++){const{reject:w}=f[g];w?.(m)}})},o=()=>Ju.delete(e),a=()=>c().map(({args:f})=>f),c=()=>Ju.get(e)||[],u=f=>Ju.set(e,[...c(),f]);return{flush:o,async schedule(f){const{promise:d,resolve:m,reject:g}=w0();return r?.([...a(),f])&&s(),c().length>0?(u({args:f,resolve:m,reject:g}),d):(u({args:f,resolve:m,reject:g}),setTimeout(s,n),d)}}}async function no(t,e){const{account:r=t.account,authorizationList:n,batch:i=!!t.batch?.multicall,blockHash:s,blockNumber:o,blockTag:a=t.experimental_blockTag??"latest",requireCanonical:c,accessList:u,blobs:f,blockOverrides:d,code:m,data:g,factory:w,factoryData:A,gas:k,gasPrice:_,maxFeePerBlobGas:B,maxFeePerGas:T,maxPriorityFeePerGas:N,nonce:M,requestOptions:O,to:F,value:L,stateOverride:z,...D}=e,j=r?Ee(r):void 0;if(m&&(w||A))throw new q("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(m&&F)throw new q("Cannot provide both `code` & `to` as parameters.");const Q=m&&g,E=w&&A&&F&&g,l=Q||E,p=Q?fg({code:m,data:g}):E?_E({data:g,factory:w,factoryData:A,to:F}):g;try{Nn(e);const b=Ji({blockHash:s,blockNumber:o,blockTag:a,requireCanonical:c}),x=d?eg(d):void 0,v=e0(z),I=t.chain?.formatters?.transactionRequest?.format,P=(I||ii)({...to(D,{format:I}),accessList:u,account:j,authorizationList:n,blobs:f,data:p,gas:k,gasPrice:_,maxFeePerBlobGas:B,maxFeePerGas:T,maxPriorityFeePerGas:N,nonce:M,to:l?void 0:F,value:L},"call");if(i&&xE({request:P})&&!x&&s===void 0)try{const{deployless:Z=!1}=typeof t.batch?.multicall=="object"?t.batch.multicall:{},y=ug(t,{blockNumber:o,deployless:Z});if(!y||!SE(v,y))return await PE(t,{...P,blockHash:s,blockNumber:o,blockTag:a,multicallAddress:y,requestOptions:O,requireCanonical:c,rpcStateOverride:v})}catch(Z){if(!(Z instanceof og)&&!(Z instanceof il))throw Z}const h=(()=>{const Z=[P,b];return v&&x?[...Z,v,x]:v?[...Z,v]:x?[...Z,{},x]:Z})(),S=await t.request({method:"eth_call",params:h},O);return S==="0x"?{data:void 0}:{data:S}}catch(b){if(O?.signal?.aborted)throw Tr(O.signal);if(ni(b))throw b;const x=IE(b),{offchainLookup:v,offchainLookupSignature:I}=await Fm(async()=>{const{offchainLookup:R,offchainLookupSignature:P}=await Promise.resolve().then(()=>U8);return{offchainLookup:R,offchainLookupSignature:P}},void 0);if(t.ccipRead!==!1&&x?.slice(0,10)===I&&F)return{data:await v(t,{data:x,requestOptions:O,to:F})};throw l&&x?.slice(0,10)==="0x101bb98d"?new rA({factory:w}):ag(b,{...e,account:j,chain:t.chain})}}function xE({request:t}){const{data:e,to:r,...n}=t;return!(!e||e.startsWith(gE)||!r||Object.values(n).filter(i=>typeof i<"u").length>0)}let AE=0;const Th=new WeakMap;function EE(t){if(!t)return"default";const e=Th.get(t);if(e!==void 0)return e;const r=AE++;return Th.set(t,r),r}async function PE(t,e){const{batchSize:r=1024,deployless:n=!1,wait:i=0}=typeof t.batch?.multicall=="object"?t.batch.multicall:{},{blockHash:s,blockNumber:o,blockTag:a=t.experimental_blockTag??"latest",requireCanonical:c,data:u,multicallAddress:f,requestOptions:d,rpcStateOverride:m,to:g}=e,w=f!==void 0?f:ug(t,{blockNumber:o,deployless:n}),A=Ji({blockHash:s,blockNumber:o,blockTag:a,requireCanonical:c}),k=typeof A=="string"?A:JSON.stringify(A),_=m?`.${JSON.stringify(m)}`:"",{schedule:B}=cg({id:`${t.uid}.${k}.${EE(d)}${_}`,wait:i,shouldSplitBatch(M){return M.reduce((F,{data:L})=>F+(L.length-2),0)>r*2},fn:async M=>{const O=M.map(D=>
64({allowFailure:!0,callData:D.data,target:D.to})),F=Lt({abi:zs,args:[O],functionName:"aggregate3"}),L={...w===null?{data:fg({code:b0,data:F})}:{to:w,data:F}},z=await t.request({method:"eth_call",params:m?[L,A,m]:[L,A]},d);return si({abi:zs,args:[O],functionName:"aggregate3",data:z||"0x"})}}),[{returnData:T,success:N}]=await B({data:u,to:g});if(!N)throw new jc({data:T});return T==="0x"?{data:void 0}:{data:T}}function ug(t,e){const{blockNumber:r,deployless:n}=e;if(n)return null;if(t.chain)return ro({blockNumber:r,chain:t.chain,contract:"multicall3"});throw new og}function SE(t,e){return t?Object.keys(t).some(r=>tn(r,e)):!1}function fg(t){const{code:e,data:r}=t;return Zc({abi:Wm(["constructor(bytes, bytes)"]),bytecode:sg,args:[e,r]})}function _E(t){const{data:e,factory:r,factoryData:n,to:i}=t;return Zc({abi:Wm(["constructor(address, bytes, address, bytes)"]),bytecode:yE,args:[i,e,r,n]})}function IE(t){if(!(t instanceof q))return;const e=t.walk();return typeof e?.data=="object"?e.data?.data:e.data}async function wt(t,e){const{abi:r,address:n,args:i,functionName:s,...o}=e,a=Lt({abi:r,args:i,functionName:s});try{const{data:c}=await te(t,no,"call")({...o,data:a,to:n});return si({abi:r,args:i,functionName:s,data:c||"0x"})}catch(c){throw qi(c,{abi:r,address:n,args:i,docsPath:"/docs/contract/readContract",functionName:s})}}async function v0(t,e){const{abi:r,address:n,args:i,functionName:s,dataSuffix:o=typeof t.dataSuffix=="string"?t.dataSuffix:t.dataSuffix?.value,...a}=e,c=a.account?Ee(a.account):t.account,u=Lt({abi:r,args:i,functionName:s});try{const{data:f}=await te(t,no,"call")({batch:!1,data:`${u}${o?o.replace("0x",""):""}`,to:n,...a,account:c}),d=si({abi:r,args:i,functionName:s,data:f||"0x"}),m=r.filter(g=>"name"in g&&g.name===e.functionName);return{result:d,request:{abi:m,address:n,args:i,dataSuffix:o,functionName:s,...a,account:c}}}catch(f){throw qi(f,{abi:r,address:n,args:i,docsPath:"/docs/contract/simulateContract",functionName:s,sender:c?.address})}}const qa=new Map,Yu=new Map;let NE=0;function Pn(t,e,r){const n=++NE,i=()=>qa.get(t)||[],s=()=>{const d=i().filter(m=>m.id!==n);if(d.length===0){qa.delete(t),Yu.delete(t);return}qa.set(t,d)},o=()=>{const f=i();if(!f.some(m=>m.id===n))return;const d=Yu.get(t);if(f.length===1&&d){const m=d();m instanceof Promise&&m.catch(()=>{})}s()},a=i();if(qa.set(t,[...a,{id:n,fns:e}]),a&&a.length>0)return o;const c={};for(const f in e)c[f]=(...d)=>{const m=i();if(m.length!==0)for(const g of m)g.fns[f]?.(...d)};const u=r(c);return typeof u=="function"&&Yu.set(t,u),o}async function sl(t,{signal:e}={}){return new Promise((r,n)=>{if(e?.aborted){n(Tr(e));return}const i=()=>e?.removeEventListener("abort",o),s=setTimeout(()=>{i(),r()},t),o=()=>{clearTimeout(s),i(),n(Tr(e))};e?.addEventListener("abort",o,{once:!0})})}function io(t,{emitOnBegin:e,initialWaitTime:r,interval:n}){let i=!0;const s=()=>i=!1;return(async()=>{let a;e&&(a=await t({unpoll:s}));const c=await r?.(a)??n;await sl(c);const u=async()=>{i&&(await t({unpoll:s}),await sl(n),u())};u()})(),s}const kE=new Map,ME=new Map;function TE(t){const e=(i,s)=>({clear:()=>s.delete(i),get:()=>s.get(i),set:o=>s.set(i,o)}),r=e(t,kE),n=e(t,ME);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}async function RE(t,{cacheKey:e,cacheTime:r=Number.POSITIVE_INFINITY}){const n=TE(e),i=n.response.get();if(i&&r>0&&Date.now()-i.created.getTime()<r)return i.data;let s=n.promise.get();s||(s=t(),n.promise.set(s));try{const o=await s;return n.response.set({created:new Date,data:o}),o}finally{n.promise.clear()}}const CE=t=>`blockNumber.${t}`;async function Ia(t,{cacheTime:e=t.cacheTime}={}){const r=await RE(()=>t.request({method:"eth_blockNumber"}),{cacheKey:CE(t.uid),cacheTime:e});return BigInt(r)}async function Xc(t,{filter:e}){const r="strict"in e&&e.strict,n=await e.request({method:"eth_getFilterChanges",params:[e.id]});if(typeof n[0]=="string")return n;const i=n.map(s=>rn(s));return!("abi"in e)||!e.abi?i:Ea({abi:e.abi,logs:i,strict:r})}async function eu(t,{filter:e}){return e.request({method:"eth_uninstallFilter",params:[e.id]})}function BE(t,e){const{abi:r,address:n,args:i,batch:s=!0,eventName:o,fromBlock:a,onError:c,onLogs:u,poll:f,pollingInterval:d=t.pollingInterval,strict:m}=e;return(typeof f<"u"?f:typeof a=="bigint"?!0:!(t.transport.type==="webSocket"||t.transport.type==="ipc"||t.transport.type==="fallback"&&(t.transport.transports[0].c
64onfig.type==="webSocket"||t.transport.transports[0].config.type==="ipc")))?(()=>{const k=m??!1,_=ut(["watchContractEvent",n,i,s,t.uid,o,d,k,a]);return Pn(_,{onLogs:u,onError:c},B=>{let T;a!==void 0&&(T=a-1n);let N,M=!1;const O=io(async()=>{if(!M){try{N=await te(t,y1,"createContractEventFilter")({abi:r,address:n,args:i,eventName:o,strict:k,fromBlock:a})}catch{}M=!0;return}try{let F;if(N)F=await te(t,Xc,"getFilterChanges")({filter:N});else{const L=await te(t,Ia,"getBlockNumber")({});T&&T<L?F=await te(t,L1,"getContractEvents")({abi:r,address:n,args:i,eventName:o,fromBlock:T+1n,toBlock:L,strict:k}):F=[],T=L}if(F.length===0)return;if(s)B.onLogs(F);else for(const L of F)B.onLogs([L])}catch(F){N&&F instanceof Xn&&(M=!1),B.onError?.(F)}},{emitOnBegin:!0,interval:d});return async()=>{N&&await te(t,eu,"uninstallFilter")({filter:N}),O()}})})():(()=>{const k=m??!1,_=ut(["watchContractEvent",n,i,s,t.uid,o,d,k]);let B=!0,T=()=>B=!1;return Pn(_,{onLogs:u,onError:c},N=>((async()=>{try{const M=(()=>{if(t.transport.type==="fallback"){const L=t.transport.transports.find(z=>z.config.type==="webSocket"||z.config.type==="ipc");return L?L.value:t.transport}return t.transport})(),O=o?ma({abi:r,eventName:o,args:i}):[],{unsubscribe:F}=await M.subscribe({params:["logs",{address:n,topics:O}],onData(L){if(!B)return;const z=L.result;try{const{eventName:D,args:j}=gc({abi:r,data:z.data,topics:z.topics,strict:m}),Q=rn(z,{args:j,eventName:D});N.onLogs([Q])}catch(D){let j,Q;if(D instanceof mc||D instanceof jl){if(m)return;j=D.abiItem.name,Q=D.abiItem.inputs?.some(l=>!("name"in l&&l.name))}const E=rn(z,{args:Q?[]:{},eventName:j});N.onLogs([E])}},onError(L){N.onError?.(L)}});T=F,B||T()}catch(M){c?.(M)}})(),()=>T()))})()}class sn extends q{constructor({docsPath:e}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(`
65`),{docsPath:e,docsSlug:"account",name:"AccountNotFoundError"})}}class Oi extends q{constructor({docsPath:e,metaMessages:r,type:n}){super(`Account type "${n}" is not supported.`,{docsPath:e,metaMessages:r,name:"AccountTypeNotSupportedError"})}}function x0({chain:t,currentChainId:e}){if(!t)throw new vE;if(e!==t.id)throw new wE({chain:t,currentChainId:e})}async function A0(t,{serializedTransaction:e}){return t.request({method:"eth_sendRawTransaction",params:[e]},{retryCount:0})}const Zu=new eo(128);async function tu(t,e){const{account:r=t.account,assertChainId:n=!0,chain:i=t.chain,accessList:s,authorizationList:o,blobs:a,data:c,dataSuffix:u=typeof t.dataSuffix=="string"?t.dataSuffix:t.dataSuffix?.value,gas:f,gasPrice:d,maxFeePerBlobGas:m,maxFeePerGas:g,maxPriorityFeePerGas:w,nonce:A,type:k,value:_,...B}=e;if(typeof r>"u")throw new sn({docsPath:"/docs/actions/wallet/sendTransaction"});const T=r?Ee(r):null;let N;try{Nn(e);const M=await(async()=>{if(e.to)return e.to;if(e.to!==null&&o&&o.length>0)return await Gc({authorization:o[0]}).catch(()=>{throw new q("`to` is required. Could not infer from `authorizationList`.")})})();if(T?.type==="json-rpc"||T===null){let O;i!==null&&(O=await te(t,en,"getChainId")({}),n&&x0({currentChainId:O,chain:i}));const F=t.chain?.formatters?.transactionRequest?.format,z=(F||ii)({...to(B,{format:F}),accessList:s,account:T,authorizationList:o,blobs:a,chainId:O,data:u?Mr([c??"0x",u]):c,gas:f,gasPrice:d,maxFeePerBlobGas:m,maxFeePerGas:g,maxPriorityFeePerGas:w,nonce:A,to:M,type:k,value:_},"sendTransaction"),D=Zu.get(t.uid),j=D?"wallet_sendTransaction":"eth_sendTransaction";try{return await t.request({method:j,params:[z]},{retryCount:0})}catch(Q){if(D===!1)throw Q;const E=Q;if(E.name==="InvalidInputRpcError"||E.name==="InvalidParamsRpcError"||E.name==="MethodNotFoundRpcError"||E.name==="MethodNotSupportedRpcError")return await t.request({method:"wallet_sendTransaction",params:[z]},{retryCount:0}).then(l=>(Zu.set(t.uid,!0),l)).catch(l=>{const p=l;throw p.name==="MethodNotFoundRpcError"||p.name==="MethodNotSupportedRpcError"?(Zu.set(t.uid,!1),E):p});throw E}}if(T?.type==="local"){if(T.nonceManager&&typeof A>"u"){const z=B.chainId,D=await(async()=>typeof z=="number"?z:i?i.id:te(t,en,"getChainId")({}))();N={address:T.address,chainId:D}}const O=await te(t,Aa,"prepareTransactionRequest")({account:T,accessList:s,authorizationList:o,blobs:a,chain:i,data:u?Mr([c??"0x",u]):c,gas:f,gasPrice:d,maxFeePerBlobGas:m,maxFeePerGas:g,maxPriorityFeePerGas:w,nonce:A,nonceManager:T.nonceManager,parameters:[...f0,"sidecars"],type:k,value:_,...B,to:M}),F=i?.serializers?.transaction,L=await T.signTransaction(O,{serializer:F});return await te(t,A0,"sendRawTransaction")({serializedTransaction:L})}throw T?.type==="smart"?new Oi({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new Oi({docsPath:"/docs/actions/wallet/sendTransaction",type:T?.type})}catch(M){throw M instanceof Oi?M:(N&&T?.nonceManager?.reset(N),Kc(M,{...e,account:T,chain:e.chain||void 0}))}}async function Vi(t,e){return Vi.internal(t,tu,"sendTransaction",e)}(function(t){async function e(r,n,i,s){const{abi:o,account:a=r.account,address:c,args:u,functionName:f,...d}=s;if(typeof a>"u")throw new sn({docsPath:"/docs/contract/writeContract"});const m=a?Ee(a):null,g=Lt({abi:o,args:u,functionName:f});try{return await te(r,n,i)({data:g,to:c,account:m,...d})}catch(w){throw qi(w,{abi:o,address:c,args:u,docsPath:"/docs/contract/writeContract",functionName:f,sender:m?.address})}}t.internal=e})(Vi||(Vi={}));class OE extends q{constructor(e){super(`Call bundle failed with status: ${e.statusCode}`,{name:"BundleFailedError"}),Object.defineProperty(this,"result",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.result=e}}function wc(t,{delay:e=100,retryCount:r=2,shouldRetry:n=()=>!0,signal:i}={}){return new Promise((s,o)=>{const a=async({count:c=0}={})=>
65{if(i?.aborted){o(Tr(i));return}const u=async({error:f})=>{const d=typeof e=="function"?e({count:c,error:f}):e;if(d)try{await sl(d,{signal:i})}catch(m){o(m);return}a({count:c+1})};try{const f=await t();s(f)}catch(f){if(i?.aborted){o(Tr(i));return}if(ni(f)){o(f);return}if(c<r&&await n({count:c,error:f}))return u({error:f});o(f)}};a()})}const lg={"0x0":"reverted","0x1":"success"};function ru(t,e){const r={...t,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,contractAddress:t.contractAddress?t.contractAddress:null,cumulativeGasUsed:t.cumulativeGasUsed?BigInt(t.cumulativeGasUsed):null,effectiveGasPrice:t.effectiveGasPrice?BigInt(t.effectiveGasPrice):null,gasUsed:t.gasUsed?BigInt(t.gasUsed):null,logs:t.logs?t.logs.map(n=>rn(n)):null,to:t.to?t.to:null,transactionIndex:t.transactionIndex?hr(t.transactionIndex):null,status:t.status?lg[t.status]:null,type:t.type?N1[t.type]||t.type:null};return t.blobGasPrice&&(r.blobGasPrice=BigInt(t.blobGasPrice)),t.blobGasUsed&&(r.blobGasUsed=BigInt(t.blobGasUsed)),r}const FE=Xl("transactionReceipt",ru),dg="0x5792579257925792579257925792579257925792579257925792579257925792",hg=W(0,{size:32});async function pg(t,e){const{account:r=t.account,chain:n=t.chain,experimental_fallback:i,experimental_fallbackDelay:s=32,forceAtomic:o=!1,id:a,version:c="2.0.0"}=e,u=r?Ee(r):null;let f=e.capabilities;t.dataSuffix&&!e.capabilities?.dataSuffix&&(typeof t.dataSuffix=="string"?f={...e.capabilities,dataSuffix:{value:t.dataSuffix,optional:!0}}:f={...e.capabilities,dataSuffix:{value:t.dataSuffix.value,...t.dataSuffix.required?{}:{optional:!0}}});const d=e.calls.map(m=>{const g=m,w=g.abi?Lt({abi:g.abi,functionName:g.functionName,args:g.args}):g.data;return{data:g.dataSuffix&&w?Mr([w,g.dataSuffix]):w,to:g.to,value:g.value?W(g.value):void 0}});try{const m=await t.request({method:"wallet_sendCalls",params:[{atomicRequired:o,calls:d,capabilities:f,chainId:W(n.id),from:u?.address,id:a,version:c}]},{retryCount:0});return typeof m=="string"?{id:m}:m}catch(m){const g=m;if(i&&(g.name==="MethodNotFoundRpcError"||g.name==="MethodNotSupportedRpcError"||g.name==="UnknownRpcError"||g.details.toLowerCase().includes("does not exist / is not available")||g.details.toLowerCase().includes("missing or invalid. request()")||g.details.toLowerCase().includes("did not match any variant of untagged enum")||g.details.toLowerCase().includes("account upgraded to unsupported contract")||g.details.toLowerCase().includes("eip-7702 not supported")||g.details.toLowerCase().includes("unsupported wc_ method")||g.details.toLowerCase().includes("feature toggled misconfigured")||g.details.toLowerCase().includes("jsonrpcengine: response has no error or result for request"))){if(f&&Object.values(f).some(_=>!_.optional)){const _="non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";throw new Us(new q(_,{details:_}))}if(o&&d.length>1){const k="`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";throw new Ds(new q(k,{details:k}))}const w=[];for(const k of d){try{const _=await tu(t,{account:u,chain:n,data:k.data,to:k.to,value:k.value?bt(k.value):void 0});w.push({status:"fulfilled",value:_})}catch(_){w.push({reason:_,status:"rejected"})}s>0&&await new Promise(_=>setTimeout(_,s))}if(w.every(k=>k.status==="rejected"))throw w[0].reason;const A=w.map(k=>k.status==="fulfilled"?k.value:hg);return{id:Mr([...A,W(n.id,{size:32}),dg])}}throw Kc(m,{...e,account:u,chain:e.chain})}}async function mg(t,e){async function r(f){if(f.endsWith(dg.slice(2))){const m=rr(Df(f,-64,-32)),g=Df(f,0,-64).slice(2).match(/.{1,64}/g),w=await Promise.all(g.map(k=>hg.slice(2)!==k?t.request({method:"eth_getTransactionReceipt",params:[`0x${k}`]},{dedupe:!0}):void 0)),A=w.some(k=>k===null)?100:w.every(k=>k?.status==="0x1")?200:w.every(k=>k?.status==="0x0")?500:600;return{atomic:!1,chainId:hr(m),receipts:w.filter(Boolean),status:A,version:"2.0.0"}}return t.request({method:"wallet_getCallsStatus",params:[f]})}const{atomic:n=!1,chainId:i,receipts:s,version:o="2.0.0",...a}=await r(e.id),[c,u]=(()=>{const f=a.status;return f>=100&&f<200?["pending",f]:f>=200&&f<300?["success",f]:f>=300&&f<700?["failure",f]:f==="CONFIRMED"?["success",200]:f==="PENDING"?["pending",100]:[void 0,f]})();return{...a,atomic:n,chainId:i?hr(i):void 0,receipts:s?.map(f=>({...f,blockNumber:bt(f.blockNumber),gasUsed:bt(f.gasUsed),status:lg[f.status]}))??[],statusCode:u,status:c,version:o}}async function gg(t,e){const{id:r,pollingInterval:n=t.pollingInterval,status:i=({statusCode:A})=>A===200||A>=300,retryCount:s=4,retryDelay:o=({count:A})=>~~(1<<A)*200,timeout:a=6e4,throwOnFailure:c=!1}=e,u=ut(["waitForCallsStatus",t.uid,r]),{promise:f,resolve:d,reject:m}=w0();let g;const w=Pn(u,{resolve:d,reject:m},A=>{const k=io(async()=>{const _=B=>{clearTimeout(g),k(),B(),w()};try{const B=await wc(async()=>{const T=await te(t,mg,"getCallsStatus")({id:r});if(c&&T.status==="failure")throw new OE(T);return T},{retryCount:s,delay:o});if(!i(B))return;_(()=>A.resolve(B))}catch(B){_(()=>A.reject(B))}},{interval:n,emitOnBegin:!0});return k});return g=a?setTimeout(()=>{w(),clearTimeout(g),m(new $E({id:r}))},a):void 0,await f}class $E extends q{constructor({id:e}){super(`Timed out while waiting for call bundle with id "${e}" to be confirmed.`,{name:"WaitForCallsStatusTimeoutError"})}}const ol=256;let ja=ol,Ga;function yg(t=11){if(!Ga||ja+t>ol*2){Ga="",ja=0;for(let e=0;e<ol;e++)Ga+=(256+Math.random()*256|0).toString(16).substring(1)}return Ga.substring(ja,ja+++t)}function bg(t){const{batch:e,chain:r,ccipRead:n,dataSuffix:i,key:s="base",n
vendor: 4,333 bytes, line 65
65ame:o="Base Client",tokens:a,type:c="base"}=t,u=t.experimental_blockTag??(typeof r?.experimental_preconfirmationTime=="number"?"pending":void 0),f=r?.blockTime??12e3,d=Math.min(Math.max(Math.floor(f/2),500),4e3),m=t.pollingInterval??d,g=t.cacheTime??m,w=t.account?Ee(t.account):void 0,{config:A,request:k,value:_}=t.transport({account:w,chain:r,pollingInterval:m}),B={...A,..._},T={account:w,batch:e,cacheTime:g,ccipRead:n,chain:r,dataSuffix:i,key:s,name:o,pollingInterval:m,request:k,tokens:a,transport:B,type:c,uid:yg(),...u?{experimental_blockTag:u}:{}};function N(M){return O=>{const F=O(M);for(const z in T)delete F[z];const L={...M,...F};for(const z in F){const D=M[z],j=F[z];Rh(D)&&Rh(j)&&(L[z]={...D,...j})}return Object.assign(L,{extend:N(L)})}}return Object.assign(T,{extend:N(T)})}function Rh(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}function Qn(t,e){const r=(n={})=>e(t,n);for(const n of["call","calls","callWithPeriod","estimateGas","prepare","simulate"])if(Object.hasOwn(e,n)){const i=e[n];r[n]=(s={})=>i.length===1?i(s):i(t,s)}for(const n of["extractEvent","extractEvents"])Object.hasOwn(e,n)&&(r[n]=e[n]);return r}function E0(t){if(!(t instanceof q))return!1;const e=t.walk(r=>r instanceof Hf);return e instanceof Hf?e.data?.errorName==="HttpError"||e.data?.errorName==="ResolverError"||e.data?.errorName==="ResolverNotContract"||e.data?.errorName==="ResolverNotFound"||e.data?.errorName==="ReverseAddressMismatch"||e.data?.errorName==="UnsupportedResolverProfile":!1}function LE(t){const{abi:e,data:r}=t,n=Zn(r,0,4),i=e.find(s=>s.type==="function"&&n===pa(Nr(s)));if(!i)throw new I5(n,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:i.name,args:"inputs"in i&&i.inputs&&i.inputs.length>0?ga(i.inputs,Zn(r,4)):void 0}}const Xu="/docs/contract/encodeErrorResult";function Ch(t){const{abi:e,errorName:r,args:n}=t;let i=e[0];if(r){const c=Qi({abi:e,args:n,name:r});if(!c)throw new rh(r,{docsPath:Xu});i=c}if(i.type!=="error")throw new rh(void 0,{docsPath:Xu});const s=Nr(i),o=pa(s);let a="0x";if(n&&n.length>0){if(!i.inputs)throw new P5(i.name,{docsPath:Xu});a=ri(i.inputs,n)}return Pt([o,a])}const ef="/docs/contract/encodeFunctionResult";function UE(t){const{abi:e,functionName:r,result:n}=t;let i=e[0];if(r){const o=Qi({abi:e,name:r});if(!o)throw new Bs(r,{docsPath:ef});i=o}if(i.type!=="function")throw new Bs(void 0,{docsPath:ef});if(!i.outputs)throw new Xm(i.name,{docsPath:ef});const s=(()=>{if(i.outputs.length===0)return[];if(i.outputs.length===1)return[n];if(Array.isArray(n))return n;throw new e1(n)})();return ri(i.outputs,s)}const Na="x-batch-gateway:true";async function wg(t){const{data:e,ccipRequest:r}=t,{args:[n]}=LE({abi:nl,data:e}),i=[],s=[];return await Promise.all(n.map(async(o,a)=>{try{s[a]=o.urls.includes(Na)?await wg({data:o.data,ccipRequest:r}):await r(o),i[a]=!1}catch(c){i[a]=!0,s[a]=DE(c)}})),UE({abi:nl,functionName:"query",result:[i,s]})}function DE(t){return t.name==="HttpRequestError"&&t.status?Ch({abi:nl,errorName:"HttpError",args:[t.status,t.shortMessage]}):Ch({abi:[b1],errorName:"Error",args:["shortMessage"in t?t.shortMessage:t.message]})}function vg(t){if(t.length!==66||t.indexOf("[")!==0||t.indexOf("]")!==65)return null;const e=`0x${t.slice(1,65)}`;return kr(e)?e:null}function al(t){let e=new Uint8Array(32).fill(0);if(!t)return pt(e);const r=t.split(".");for(let n=r.length-1;n>=0;n-=1){const i=vg(r[n]),s=i?Xs(i):At(Ri(r[n]),"bytes");e=At(Mr([e,s]),"bytes")}return pt(e)}function zE(t){return`[${t.slice(2)}]`}function qE(t){const e=new Uint8Array(32).fill(0);return t?vg(t)||At(Ri(t)):pt(e)}function P0(t){const e=t.replace(/^\.|\.$/gm,"");if(e.length===0)return new Uint8Array(1);const r=new Uint8Array(Ri(e).byteLength+2);let n=0;const i=e.split(".");for(let s=0;s<i.length;s++){let o=Ri(i[s]);o.byteLength>255&&(o=Ri(zE(qE(i[s])))),r[n]=o.length,r.set(o,n+1),n+=o.length+1}return r.byteLength!==n+1?r.slice(0,n+1):r}async function jE(t,e){const{blockNumber:r,blockTag:n,coinType:i,name:s,gatewayUrls:o,strict:a}=e,{chain:c}=t,u=(()=>{if(e.universalResolverAddress)return e.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return ro({blockNumber:r,chain:c,contract:"ensUniversalResolver"})})(),f=c?.ensTlds;
65if(f&&!f.some(m=>s.endsWith(m)))return null;const d=i!=null?[al(s),BigInt(i)]:[al(s)];try{const m=Lt({abi:ng,functionName:"addr",args:d}),g={address:u,abi:rg,functionName:"resolveWithGateways",args:[Ht(P0(s)),m,o??[Na]],blockNumber:r,blockTag:n},A=await te(t,wt,"readContract")(g);if(A[0]==="0x")return null;const k=GE({coinType:i,data:A[0],args:d});return k==="0x"||rr(k)==="0x00"?null:k}catch(m){if(a)throw m;if(E0(m))return null;throw m}}function GE({coinType:t,data:e,args:r}){try{return si({abi:ng,args:r,functionName:"addr",data:e})}catch(n){if(t==null)throw n;const i=rr(e);if(rt(i)===20)return $s(i);throw n}}class HE extends q{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`],name:"EnsAvatarInvalidMetadataError"})}}class lo extends q{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`,{name:"EnsAvatarInvalidNftUriError"})}}class S0 extends q{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class VE extends q{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const KE=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,WE=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,QE=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,JE=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function YE(t){try{const e=await fetch(t,{method:"HEAD"});return e.status===200?e.headers.get("content-type")?.startsWith("image/"):!1}catch(e){return typeof e=="object"&&typeof e.response<"u"||!Object.hasOwn(globalThis,"Image")?!1:new Promise(r=>{const n=new Image;n.onload=()=>{r(!0)},n.onerror=()=>{r(!1)},n.src=t})}}function Bh(t,e){return t?t.endsWith("/")?t.slice(0,-1):t:e}function xg({uri:t,gatewayUrls:e}){const r=QE.test(t);if(r)return{uri:t,isOnChain:!0,isEncoded:r};const n=Bh(e?.ipfs,"https://ipfs.io"),i=Bh(e?.arweave,"https://arweave.net"),s=t.match(KE),{protocol:o,subpath:a,target:c,subtarget:u=""}=s?.groups||{},f=o==="ipns:/"||a==="ipns/",d=o==="ipfs:/"||a==="ipfs/"||WE.test(t);if(t.startsWith("http")&&!f&&!d){let g=t;return e?.arweave&&(g=t.replace(/https:\/\/arweave.net/g,e?.arweave)),{uri:g,isOnChain:!1,isEncoded:!1}}if((f||d)&&c)return{uri:`${n}/${f?"ipns":"ipfs"}/${c}${u}`,isOnChain:!1,isEncoded:!1};if(o==="ar:/"&&c)return{uri:`${i}/${c}${u||""}`,isOnChain:!1,isEncoded:!1};let m=t.replace(JE,"");if(m.startsWith("<svg")&&(m=`data:image/svg+xml;base64,${btoa(m)}`),m.startsWith("data:")||m.startsWith("{"))return{uri:m,isOnChain:!0,isEncoded:!1};throw new S0({uri:t})}function Ag(t){if(typeof t!="object"||!("image"in t)&&!("image_url"in t)&&!("image_data"in t))throw new HE({data:t});return t.image||t.image_url||t.image_data}async function ZE({gatewayUrls:t,uri:e}){try{const r=await fetch(e).then(i=>i.json());return await _0({gatewayUrls:t,uri:Ag(r)})}catch{throw new S0({uri:e})}}async function _0({gatewayUrls:t,uri:e}){const{uri:r,isOnChain:n}=xg({uri:e,gatewayUrls:t});if(n||await YE(r))return r;throw new S0({uri:e})}function XE(t){let e=t;e.startsWith("did:nft:")&&(e=e.replace("did:nft:","").replace(/_/g,"/"));const[r,n,i]=e.split("/"),[s,o]=r.split(":"),[a,c]=n.split(":");if(!s||s.toLowerCase()!=="eip155")throw new lo({reason:"Only EIP-155 supported"});if(!o)throw new lo({reason:"Chain ID not found"});if(!c)throw new lo({reason:"Contract address not found"});if(!i)throw new lo({reason:"Token ID not found"});if(!a)throw new lo({reason:"ERC namespace not found"});return{chainID:Number.parseInt(o,10),namespace:a.toLowerCase(),contractAddress:c,tokenID:i}}async function e8(t,{nft:e}){if(e.namespace==="erc721")return wt(t,{address:e.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}
65],functionName:"tokenURI",args:[BigInt(e.tokenID)]});if(e.namespace==="erc1155")return wt(t,{address:e.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(e.tokenID)]});throw new VE({namespace:e.namespace})}async function t8(t,{gatewayUrls:e,record:r}){return/eip155:/i.test(r)?r8(t,{gatewayUrls:e,record:r}):_0({uri:r,gatewayUrls:e})}async function r8(t,{gatewayUrls:e,record:r}){const n=XE(r),i=await e8(t,{nft:n}),{uri:s,isOnChain:o,isEncoded:a}=xg({uri:i,gatewayUrls:e});if(o&&(s.includes("data:application/json;base64,")||s.startsWith("{"))){const u=a?atob(s.replace("data:application/json;base64,","")):s,f=JSON.parse(u);return _0({uri:Ag(f),gatewayUrls:e})}let c=n.tokenID;return n.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),ZE({gatewayUrls:e,uri:s.replace(/(?:0x)?{id}/,c)})}async function Eg(t,e){const{blockNumber:r,blockTag:n,key:i,name:s,gatewayUrls:o,strict:a}=e,{chain:c}=t,u=(()=>{if(e.universalResolverAddress)return e.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return ro({blockNumber:r,chain:c,contract:"ensUniversalResolver"})})(),f=c?.ensTlds;if(f&&!f.some(d=>s.endsWith(d)))return null;try{const d={address:u,abi:rg,args:[Ht(P0(s)),Lt({abi:kh,functionName:"text",args:[al(s),i]}),o??[Na]],functionName:"resolveWithGateways",blockNumber:r,blockTag:n},g=await te(t,wt,"readContract")(d);if(g[0]==="0x")return null;const w=si({abi:kh,functionName:"text",data:g[0]});return w===""?null:w}catch(d){if(a)throw d;if(E0(d))return null;throw d}}async function n8(t,{blockNumber:e,blockTag:r,assetGatewayUrls:n,name:i,gatewayUrls:s,strict:o,universalResolverAddress:a}){const c=await te(t,Eg,"getEnsText")({blockNumber:e,blockTag:r,key:"avatar",name:i,universalResolverAddress:a,gatewayUrls:s,strict:o});if(!c)return null;try{return await t8(t,{record:c,gatewayUrls:n})}catch{return null}}async function i8(t,e){const{address:r,blockNumber:n,blockTag:i,coinType:s=60n,gatewayUrls:o,strict:a}=e,{chain:c}=t,u=(()=>{if(e.universalResolverAddress)return e.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return ro({blockNumber:n,chain:c,contract:"ensUniversalResolver"})})();try{const f={address:u,abi:mE,args:[r,s,o??[Na]],functionName:"reverseWithGateways",blockNumber:n,blockTag:i},d=te(t,wt,"readContract"),[m]=await d(f);return m||null}catch(f){if(a)throw f;if(E0(f))return null;throw f}}async function s8(t,e){const{blockNumber:r,blockTag:n,name:i}=e,{chain:s}=t,o=(()=>
65{if(e.universalResolverAddress)return e.universalResolverAddress;if(!s)throw new Error("client chain not configured. universalResolverAddress is required.");return ro({blockNumber:r,chain:s,contract:"ensUniversalResolver"})})(),a=s?.ensTlds;if(a&&!a.some(u=>i.endsWith(u)))throw new Error(`${i} is not a valid ENS TLD (${a?.join(", ")}) for chain "${s.name}" (id: ${s.id}).`);const[c]=await te(t,wt,"readContract")({address:o,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[Ht(P0(i))],blockNumber:r,blockTag:n});return c}async function Pg(t,e){const{account:r=t.account,blockNumber:n,blockTag:i="latest",blobs:s,data:o,gas:a,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:f,maxPriorityFeePerGas:d,to:m,value:g,...w}=e,A=r?Ee(r):void 0;try{Nn(e);const _=(typeof n=="bigint"?W(n):void 0)||i,B=t.chain?.formatters?.transactionRequest?.format,N=(B||ii)({...to(w,{format:B}),account:A,blobs:s,data:o,gas:a,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:f,maxPriorityFeePerGas:d,to:m,value:g},"createAccessList"),M=await t.request({method:"eth_createAccessList",params:[N,_]});if(M.error)throw new q(M.error,{details:M.error});return{accessList:M.accessList,gasUsed:BigInt(M.gasUsed)}}catch(k){throw ag(k,{...e,account:A,chain:t.chain})}}async function o8(t){const e=qc(t,{method:"eth_newBlockFilter"}),r=await t.request({method:"eth_newBlockFilter"});return{id:r,request:e(r),type:"block"}}async function Sg(t,{address:e,args:r,event:n,events:i,fromBlock:s,strict:o,toBlock:a}={}){const c=i??(n?[n]:void 0),u=qc(t,{method:"eth_newFilter"});let f=[];c&&(f=[c.flatMap(g=>ma({abi:[g],eventName:g.name,args:r}))],n&&(f=f[0]));const d=await t.request({method:"eth_newFilter",params:[{address:e,fromBlock:typeof s=="bigint"?W(s):s,toBlock:typeof a=="bigint"?W(a):a,...f.length?{topics:f}:{}}]});return{abi:c,args:r,eventName:n?n.name:void 0,fromBlock:s,id:d,request:u(d),strict:!!o,toBlock:a,type:"event"}}async function _g(t){const e=qc(t,{method:"eth_newPendingTransactionFilter"}),r=await t.request({method:"eth_newPendingTransactionFilter"});return{id:r,request:e(r),type:"transaction"}}async function a8(t,{address:e,blockHash:r,blockNumber:n,blockTag:i=t.experimental_blockTag??"latest",requireCanonical:s}){const o=Ji({blockHash:r,blockNumber:n,blockTag:i,requireCanonical:s});if(t.batch?.multicall&&t.chain?.contracts?.multicall3){const c=t.chain.contracts.multicall3.address,u=Lt({abi:zs,functionName:"getEthBalance",args:[e]}),{data:f}=await te(t,no,"call")({to:c,data:u,blockHash:r,blockNumber:n,blockTag:i,requireCanonical:s});return si({abi:zs,functionName:"getEthBalance",args:[e],data:f||"0x"})}const a=await t.request({method:"eth_getBalance",params:[e,o]});return BigInt(a)}async function c8(t){const e=await t.request({method:"eth_blobBaseFee"});return BigInt(e)}async function u8(t,{blockHash:e,blockNumber:r,blockTag:n=t.experimental_blockTag??"latest"}={}){const i=r!==void 0?W(r):void 0,s=await t.request({method:"eth_getBlockReceipts",params:[e||i||n]},{dedupe:!!(e||i)});if(!s)throw new r0({blockHash:e,blockNumber:r});const o=t.chain?.formatters?.transactionReceipt?.format||ru;return s.map(a=>o(a,"getBlockReceipts"))}async function f8(t,{blockHash:e,blockNumber:r,blockTag:n="latest"}={}){const i=r!==void 0?W(r):void 0;let s;return e?s=await t.request({method:"eth_getBlockTransactionCountByHash",params:[e]},{dedupe:!0}):s=await t.request({method:"eth_getBlockTransactionCountByNumber",params:[i||n]},{dedupe:!!i}),hr(s)}async function vc(t,{address:e,blockHash:r,blockNumber:n,blockTag:i="latest",requireCanonical:s}){const o=Ji({blockHash:r,blockNumber:n,blockTag:i,requireCanonical:s}),a=await t.request({method:"eth_getCode",params:[e,o]},{dedupe:typeof n=="bigint"||r!==void 0});if(a!=="0x")return a}async function l8(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=await vc(t,{address:e,...r!==void 0?{blockNumber:r}:{blockTag:n}});if(i&&rt(i)===23&&i.startsWith("0xef0100"))return $s(Zn(i,3,23))}class d8 extends q{constructor({address:e}){super(`No EIP-712 domain found on contract "${e}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${e}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function h8(t,e){const{address:r,factory:n,factoryData:i}=e;try{const[s,o,a,c,u,f,d]=await te(t,wt,"readContract")({abi:p8,address:r,functionName:"eip712Domain",factory:n,factoryData:i});return{domain:{name:o,version:a,chainId:Number(c),verifyingContract:u,salt:f},extensions:d,fields:s}}catch(s){const o=s;throw o.name==="ContractFunctionExecutionError"&&o.cause.name==="ContractFunctionZeroDataError"?new d8({address:r}):o}}const p8=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];function m8(t){return{baseFeePerGas:t.baseFeePerGas.map(e=>BigInt(e)),gasUsedRatio:t.gasUsedRatio,oldestBlock:BigInt(t.oldestBlock),reward:t.reward?.map(e=>e.map(r=>BigInt(r)))}}async function g8(t,{blockCount:e,blockNumber:r,blockTag:n="latest",rewardPercentiles:i}){const s=typeof r=="bigint"?W(r):void 0,o=await t.request({method:"eth_feeHistory",params:[W(e),s||n,i]},{dedupe:!!s});return m8(o)}async function y8(t,{filter:e}){const r=e.strict??!1,i=(await e.request({method:"eth_getFilterLogs",params:[e.id]})).map(s=>rn(s));return e.abi?Ea({abi:e.abi,logs:i,strict:r}):i}function b8(t){const{authorizationList:e}=t;if(e)for(const r of e){const{chainId:n}=r,i=r.address;if(!ft(i))throw new Ft({address:i});if(n<0)throw new Yc({chainId:n})}I0(t)}function w8(t){const{blobVersionedHashes:e}=t;if(e){if(e.length===0)throw new O1;for(const r of e){const n=rt(r),i=hr(Zn(r,0,1));if(n!==32)throw new RA({hash:r,size:n});if(i!==B1)throw new CA({hash:r,version:i})}}I0(t)}function I0(t){const{chainId:e,maxPriorityFeePerGas:r,maxFeePerGas:n,to:i}=t;if(e<=0)throw new Yc({chainId:e});if(i&&!ft(i))throw new Ft({address:i});if(n&&n>Vc)throw new ji({maxFeePerGas:n});if(r&&n&&r>n)throw new Jo({maxFeePerGas:n,maxPriorityFeePerGas:r})}function v8(t){const{chainId:e,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:i,to:s}=t;if(e<=0)throw new Yc({chainId:e});if(s&&!ft(s))throw new Ft({address:s});if(r||i)throw new q("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(n&&n>Vc)throw new ji({maxFeePerGas:n})}function x8(t){const{chainId:e,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:i,to:s}=t;if(s&&!ft(s))throw new Ft({address:s});if(typeof e<"u"&&e<=0)throw new Yc({chainId:e});if(r||i)throw new q("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(n&&n>Vc)throw new ji({maxFeePerGas:n})}function nu(t){if(!t||t.length===0)return[];const e=[];for(let r=0;r<t.length;r++){const{address:n,storageKeys:i}=t[r];for(let s=0;s<i.length;s++)if(i[s].length-2!==64)throw new Yx({storageKey:i[s]});if(!ft(n,{strict:!1}))throw new Ft({address:n});e.push([n,i])}return e}function A8(t,e){const r=$1(t);return r==="eip1559"?S8(t,e):r==="eip2930"?_8(t,e):r==="eip4844"?P8(t,e):r==="eip7702"?E8(t,e):I8(t,e)}function E8(t,e){const{authorizationList:r,chainId:n,gas:i,nonce:s,to:o,value:a,maxFeePerGas:c,maxPriorityFeePerGas:u,accessList:f,data:d}=t;b8(t);const m=nu(f),g=N8(r);return Pt(["0x04",ei([W(n),s?W(s):"0x",u?W(u):"0x",c?W(c):"0x",i?W(i):"0x",o??"0x",a?W(a):"0x",d??"0x",m,g,...ka(t,e)])])}function P8(t,e){const{chainId:r,gas:n,nonce:i,to:s,value:o,maxFeePerBlobGas:a,maxFeePerGas:c,maxPriorityFeePerGas:u,accessList:f,data:d}=t;w8(t);let m=t.blobVersionedHashes,g=t.sidecars;if(t.blobs&&(typeof m>"u"||typeof g>"u")){const T=typeof t.blobs[0]=="string"?t.blobs:t.blobs.map(O=>pt(O)),N=t.kzg,M=o0({blobs:T,kzg:N});if(typeof m>"u"&&(m=T1({commitments:M})),typeof g>"u"){const O=a0({blobs:T,commitments:M,kzg:N});g=F1({blobs:T,commitments:M,proofs:O})}}const w=nu(f),A=[W(r),i?W(i):"0x",u?W(u):"0x",c?W(c):"0x",n?W(n):"0x",s??"0x",o?W(o):"0x",d??"0x",w,a?W(a):"0x",m??[],...ka(t,e)],k=[],_=[],B=[];if(g)for(let T=0;T<g.length;T++){const{blob:N,commitment:M,proof:O}=g[T];k.push(N),_.push(M),B.push(O)}return Pt(["0x03",ei(g?[A,k,_,B]:A)])}function S8(t,e){const{chainId:r,gas:n,nonce:i,to:s,value:o,maxFeePerGas:a,maxPriorityFeePerGas:c,accessList:u,data:f}=t;I0(t);const d=nu(u),m=[W(r),i?W(i):"0x",c?W(c):"0x",a?W(a):"0x",n?W(n):"0x",s??"0x",o?W(o):"0x",f??"0x",d,...ka(t,e)];return Pt(["0x02",ei(m)])}function _8(t,e){const{chainId:r,gas:n,data:i,nonce:s,to:o,value:a,accessList:c,gasPrice:u}=t;v8(t);const f=nu(c),d=[W(r),s?W(s):"0x",u?W(u):"0x",n?W(n):"0x",o??"0x",a?W(a):"0x",i??"0x",f,...ka(t,e)];return Pt(["0x01",ei(d)])}function I8(t,e){const{chainId:r=0,gas:n,data:i,nonce:s,to:o,value:a,gasPrice:c}=t;x8(t);let u=[s?W(s):"0x",c?W(c):"0x",n?W(n):"0x",o??"0x",a?W(a):"0x",i??"0x"];if(e){const f=(()=>
65{if(e.v>=35n)return(e.v-35n)/2n>0?e.v:27n+(e.v===35n?0n:1n);if(r>0)return BigInt(r*2)+BigInt(35n+e.v-27n);const g=27n+(e.v===27n?0n:1n);if(e.v!==g)throw new Qx({v:e.v});return g})(),d=rr(e.r),m=rr(e.s);u=[...u,W(f),d==="0x00"?"0x":d,m==="0x00"?"0x":m]}else r>0&&(u=[...u,W(r),"0x","0x"]);return ei(u)}function ka(t,e){const r=e??t,{v:n,yParity:i}=r;if(typeof r.r>"u")return[];if(typeof r.s>"u")return[];if(typeof n>"u"&&typeof i>"u")return[];const s=rr(r.r),o=rr(r.s);return[typeof i=="number"?i?W(1):"0x":n===0n?"0x":n===1n?W(1):n===27n?"0x":W(1),s==="0x00"?"0x":s,o==="0x00"?"0x":o]}function N8(t){if(!t||t.length===0)return[];const e=[];for(const r of t){const{chainId:n,nonce:i,...s}=r,o=r.address;e.push([n?Ht(n):"0x",o,i?Ht(i):"0x",...ka({},s)])}return e}async function k8({address:t,authorization:e,signature:r}){return tn($s(t),await Gc({authorization:e,signature:r}))}const Ha=new eo(8192);function M8(t,{enabled:e=!0,id:r}){if(!e||!r)return t();if(Ha.get(r))return Ha.get(r);const n=t().finally(()=>Ha.delete(r));return Ha.set(r,n),n}function T8(t,e={}){return async(r,n={})=>{const{dedupe:i=!1,methods:s,retryDelay:o=150,retryCount:a=3,signal:c,uid:u}={...e,...n},{method:f}=r;if(s?.exclude?.includes(f))throw new Ai(new Error("method not supported"),{method:f});if(s?.include&&!s.include.includes(f))throw new Ai(new Error("method not supported"),{method:f});if(c?.aborted)throw Tr(c);const d=i?C8(`${u}.${ut(r)}`):void 0;return M8(()=>wc(async()=>{try{return await t(r,c?{signal:c}:void 0)}catch(m){if(c?.aborted)throw Tr(c);if(ni(m))throw m;const g=m;switch(g.code){case To.code:throw new To(g);case Ro.code:throw new Ro(g);case Co.code:throw new Co(g,{method:r.method});case Bo.code:throw new Bo(g);case zi.code:throw new zi(g);case Xn.code:throw new Xn(g);case Oo.code:throw new Oo(g);case Fo.code:throw new Fo(g);case $o.code:throw new $o(g);case Ai.code:throw new Ai(g,{method:r.method});case Ls.code:throw new Ls(g);case Lo.code:throw new Lo(g);case hs.code:throw new hs(g);case Uo.code:throw new Uo(g);case Do.code:throw new Do(g);case zo.code:throw new zo(g);case qo.code:throw new qo(g);case jo.code:throw new jo(g);case Us.code:throw new Us(g);case Go.code:throw new Go(g);case Ho.code:throw new Ho(g);case Vo.code:throw new Vo(g);case Ko.code:throw new Ko(g);case Wo.code:throw new Wo(g);case Ds.code:throw new Ds(g);case 5e3:throw new hs(g);case Qo.code:throw new Qo(g);default:throw m instanceof q?m:new iA(g)}}},{delay:({count:m,error:g})=>{if(g&&g instanceof Ci){const w=g?.headers?.get("Retry-After");if(w?.match(/\d/))return Number.parseInt(w,10)*1e3}return~~(1<<m)*o},retryCount:a,signal:c,shouldRetry:({error:m})=>R8(m)}),{enabled:i,id:d})}}function R8(t){return ni(t)?!1:"code"in t&&typeof t.code=="number"?t.code===-1||t.code===Ls.code||t.code===zi.code||t.code===429:t instanceof Ci&&t.status?t.status===403||t.status===408||t.status===413||t.status===429||t.status===500||t.status===502||t.status===503||t.status===504:!0}function C8(t,e=0){let r=3735928559^e,n=1103547991^e;for(let i=0;i<t.length;i++){const s=t.charCodeAt(i);r=Math.imul(r^s,2654435761),n=Math.imul(n^s,1597334677)}return r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>16,3266489909),n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>16,3266489909),(4294967296*(2097151&n)+(r>>>0)).toString(36)}class B8 extends q{constructor({callbackSelector:e,cause:r,data:n,extraData:i,sender:s,urls:o}){super(r.shortMessage||"An error occurred while fetching for an offchain result.",{cause:r,metaMessages:[...r.metaMessages||[],r.metaMessages?.length?"":[],"Offchain Gateway Call:",o&&["  Gateway URL(s):",...o.map(a=>`    ${wa(a)}`)],`  Sender: ${s}`,`  Data: ${n}`,`  Callback selector: ${e}`,`  Extra data: ${i}`].flat(),name:"OffchainLookupError"})}}class O8 extends q{constructor({result:e,url:r}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${wa(r)}`,`Response: ${ut(e)}`],name:"OffchainLookupResponseMalformedError"})}}class F8 extends q{constructor({sender:e,to:r}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${r}`,`OffchainLookup sender address: ${e}`],name:"OffchainLookupSenderMismatchError"})}}const $8="0x556f1830",Ig={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function L8(t,{blockNumber:e,blockTag:r,data:n,requestOptions:i,to:s}){const{args:o}=v1({data:n,abi:[Ig]}),[a,c,u,f,d]=o,{ccipRead:m}=t,g=m&&typeof m?.request=="function"?m.request:Ng;try{if(!tn(s,a))throw new F8({sender:a,to:s});const w=c.includes(Na)?await wg({data:u,ccipRequest:k=>g({...k,requestOptions:i})}):await g({data:u,requestOptions:i,sender:a,urls:c}),{data:A}=await no(t,{blockNumber:e,blockTag:r,data:Mr([f,ri([{type:"bytes"},{type:"bytes"}
65],[w,d])]),requestOptions:i,to:s});return A}catch(w){throw i?.signal?.aborted?Tr(i.signal):ni(w)?w:new B8({callbackSelector:f,cause:w,data:n,extraData:d,sender:a,urls:c})}}async function Ng({data:t,requestOptions:e,sender:r,urls:n}){let i=new Error("An unknown error occurred.");for(let s=0;s<n.length;s++){if(e?.signal?.aborted)throw Tr(e.signal);const o=n[s],a=o.includes("{data}")?"GET":"POST",c=a==="POST"?{data:t,sender:r}:void 0,u=a==="POST"?{"Content-Type":"application/json"}:{};try{const f=await fetch(o.replace("{sender}",r.toLowerCase()).replace("{data}",t),{body:JSON.stringify(c),headers:u,method:a,...e?.signal?{signal:e.signal}:{}});let d;if(f.headers.get("Content-Type")?.startsWith("application/json")?d=(await f.json()).data:d=await f.text(),!f.ok){i=new Ci({body:c,details:d?.error?ut(d.error):f.statusText,headers:f.headers,status:f.status,url:o});continue}if(!kr(d)){i=new O8({result:d,url:o});continue}return d}catch(f){if(e?.signal?.aborted)throw Tr(e.signal);if(ni(f))throw f;i=new Ci({body:c,details:f.message,url:o})}}throw i}const U8=Object.freeze(Object.defineProperty({__proto__:null,ccipRequest:Ng,offchainLookup:L8,offchainLookupAbiItem:Ig,offchainLookupSignature:$8},Symbol.toStringTag,{value:"Module"}));function kg(t){const e={formatters:void 0,fees:void 0,serializers:void 0,...t};function r(n){return i=>{const s=typeof i=="function"?i(n):i,o={...n,...s};return Object.assign(o,{extend:r(o)})}}return Object.assign(e,{extend:r(e)})}function D8(t,{errorInstance:e=new Error("timed out"),timeout:r,signal:n}){return new Promise((i,s)=>{(async()=>{let o;const a=new AbortController;try{r>0&&(o=setTimeout(()=>{n?a.abort():s(e)},r)),i(await t({signal:a?.signal||null}))}catch(c){if(a?.signal.aborted&&ni(c)){s(e);return}s(c)}finally{clearTimeout(o)}})()})}function z8(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const Oh=z8(),q8=10485760;function j8(t,e={}){const{url:r,headers:n}=H8(t);return{async request(i){const{body:s,fetchFn:o=e.fetchFn??fetch,maxResponseBodySize:a=e.maxResponseBodySize??q8,onRequest:c=e.onRequest,onResponse:u=e.onResponse,timeout:f=e.timeout??1e4}=i,d={...e.fetchOptions??{},...i.fetchOptions??{}},{headers:m,method:g,signal:w}=d;try{const A=await D8(async({signal:B})=>{const T={...d,body:Array.isArray(s)?ut(s.map(F=>({jsonrpc:"2.0",id:F.id??Oh.take(),...F}))):ut({jsonrpc:"2.0",id:s.id??Oh.take(),...s}),headers:{...n,"Content-Type":"application/json",...m},method:g||"POST",signal:w||(f>0?B:null)},N=new Request(r,T),M=await c?.(N,T)??{...T,url:r};return await o(M.url??r,M)},{errorInstance:new gh({body:s,url:r}),timeout:f,signal:!0});u&&await u(A);let k;const _=await G8(A,{maxResponseBodySize:a});if(A.headers.get("Content-Type")?.startsWith("application/json"))k=JSON.parse(_);else{k=_;try{k=JSON.parse(k||"{}")}catch(B){if(A.ok)throw B;k={error:k}}}if(!A.ok){if(typeof k.error?.code=="number"&&typeof k.error?.message=="string")return k;throw new Ci({body:s,details:ut(k.error)||A.statusText,headers:A.headers,status:A.status,url:r})}return k}catch(A){throw w?.aborted?Tr(w):ni(A)||A instanceof Ci||A instanceof rc||A instanceof gh?A:new Ci({body:s,cause:A,url:r})}}}}async function G8(t,{maxResponseBodySize:e}){if(e===!1)return t.text();const r=t.headers.get("Content-Length");if(r){const a=Number(r);if(a>e)throw new rc({maxSize:e,size:a})}if(!t.body){const a=await t.text(),c=new TextEncoder().encode(a).length;if(c>e)throw new rc({maxSize:e,size:c});return a}const n=t.body.getReader(),i=new TextDecoder;let s="",o=0;try{for(;;){const{done:a,value:c}=await n.read();if(a)break;if(o+=c.byteLength,o>e)throw await n.cancel(),new rc({maxSize:e,size:o});s+=i.decode(c,{stream:!0})}return s+=i.decode(),s}finally{n.releaseLock()}}function H8(t){try{const e=new URL(t),r=(()=>{if(e.username){const n=`${decodeURIComponent(e.username)}:${decodeURIComponent(e.password)}`;return e.username="",e.password="",{url:e.toString(),headers:{Authorization:`Basic ${btoa(n)}`}}}})();return{url:e.toString(),...r}}catch{return{url:t}}}const V8=`�Ethereum Signed Message:
66`;function K8(t){const e=typeof t=="string"?No(t):typeof t.raw=="string"?t.raw:
66pt(t.raw),r=No(`${V8}${rt(e)}`);return Mr([r,e])}function Mg(t,e){return At(K8(t),e)}class W8 extends q{constructor({domain:e}){super(`Invalid domain "${ut(e)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class Q8 extends q{constructor({primaryType:e,types:r}){super(`Invalid primary type \`${e}\` must be one of \`${JSON.stringify(Object.keys(r))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class J8 extends q{constructor({type:e}){super(`Struct type "${e}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function Y8(t){const{domain:e,message:r,primaryType:n,types:i}=t,s=(c,u)=>{const f={...u};for(const d of c){const{name:m,type:g}=d;g==="address"&&(f[m]=f[m].toLowerCase())}return f},o=i.EIP712Domain?e?s(i.EIP712Domain,e):{}:{},a=(()=>{if(n!=="EIP712Domain")return s(i[n],r)})();return ut({domain:o,message:a,primaryType:n,types:i})}function Tg(t){const{domain:e,message:r,primaryType:n,types:i}=t,s=(o,a)=>{for(const c of o){const{name:u,type:f}=c,d=a[u],m=f.match(m1);if(m&&(typeof d=="number"||typeof d=="bigint")){const[A,k,_]=m;W(d,{signed:k==="int",size:Number.parseInt(_,10)/8})}if(f==="address"&&typeof d=="string"&&!ft(d))throw new Ft({address:d});const g=f.match(vx);if(g){const[A,k]=g;if(k&&rt(d)!==Number.parseInt(k,10))throw new k5({expectedSize:Number.parseInt(k,10),givenSize:rt(d)})}const w=i[f];w&&(Z8(f),s(w,d))}};if(i.EIP712Domain&&e){if(typeof e!="object")throw new W8({domain:e});s(i.EIP712Domain,e)}if(n!=="EIP712Domain")if(i[n])s(i[n],r);else throw new Q8({primaryType:n,types:i})}function Rg({domain:t}){return[typeof t?.name=="string"&&{name:"name",type:"string"},t?.version&&{name:"version",type:"string"},(typeof t?.chainId=="number"||typeof t?.chainId=="bigint")&&{name:"chainId",type:"uint256"},t?.verifyingContract&&{name:"verifyingContract",type:"address"},t?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}function Z8(t){if(t==="address"||t==="bool"||t==="string"||t.startsWith("bytes")||t.startsWith("uint")||t.startsWith("int"))throw new J8({type:t})}function X8(t){const{domain:e={},message:r,primaryType:n}=t,i={EIP712Domain:Rg({domain:e}),...t.types};Tg({domain:e,message:r,primaryType:n,types:i});const s=["0x1901"];return e&&s.push(e3({domain:e,types:i})),n!=="EIP712Domain"&&s.push(Cg({data:r,primaryType:n,types:i})),At(Mr(s))}function e3({domain:t,types:e}){return Cg({data:t,primaryType:"EIP712Domain",types:e})}function Cg({data:t,primaryType:e,types:r}){const n=Bg({data:t,primaryType:e,types:r});return At(n)}function Bg({data:t,primaryType:e,types:r}){const n=[{type:"bytes32"}],i=[t3({primaryType:e,types:r})];for(const s of r[e]){const[o,a]=Fg({types:r,name:s.name,type:s.type,value:t[s.name]});n.push(o),i.push(a)}return ri(n,i)}function t3({primaryType:t,types:e}){const r=Ht(r3({primaryType:t,types:e}));return At(r)}function r3({primaryType:t,types:e}){let r="";const n=Og({primaryType:t,types:e});n.delete(t);const i=[t,...Array.from(n).sort()];for(const s of i)r+=`${s}(${e[s].map(({name:o,type:a})=>`${a} ${o}`).join(",")})`;return r}function Og({primaryType:t,types:e},r=new Set){const i=t.match(/^\w*/u)?.[0];if(r.has(i)||e[i]===void 0)return r;r.add(i);for(const s of e[i])Og({primaryType:s.type,types:e},r);return r}function Fg({types:t,name:e,type:r,value:n}){if(t[r]!==void 0)return[{type:"bytes32"},At(Bg({data:n,primaryType:r,types:t}))];if(r==="bytes")return[{type:"bytes32"},At(n)];if(r==="string")return[{type:"bytes32"},At(Ht(n))];if(r.lastIndexOf("]")===r.length-1){const i=r.slice(0,r.lastIndexOf("[")),s=n.map(o=>Fg({name:e,type:i,types:t,value:o}));return[{type:"bytes32"},At(ri(s.map(([o])=>o),s.map(([,o])=>o)))]}return[{type:r},n]}class n3 extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const r=super.get(e);return super.has(e)&&r!==void 0&&(this.delete(e),super.set(e,r)),r}set(e,r){if(super.set(e,r),this.maxSize&&this.size>this.maxSize){const n=this.keys().next().value;n&&this.delete(n)}return this}}const i3={checksum:new n3(8192)},tf=i3.checksum;class $g extends Hl{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,Y5(e);const n=Uc(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;o<s.length;o++)s[o]^=54;this.iHash.update(s),this.oHash=e.create();for(let o=0;o<s.length;o++)s[o]^=106;this.oHash.update(s),Fs(s)}update(e){return Os(this),this.iHash.update(e),this}digestInto(e){Os(this),Di(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:r,iHash:n,finished:i,destroyed:s,blockLen:o,outputLen:a}=this;return e=e,e.finished=i,e.destroyed=s,e.blockLen=o,e.outputLen=a,e.oHash=r._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Lg=(t,e,r)=>new $g(t,e).update(r).digest();Lg.create=(t,e)=>new $g(t,e);function Ug(t,e={}){const{as:r=typeof t=="string"?"Hex":"Bytes"}=e,n=f1(QA(t));return r==="Bytes"?n:Cr(n)}const s3=/^0x[a-fA-F0-9]{40}$/;function iu(t,e={}){const{strict:r=!0}=e;if(!s3.test(t))throw new Fh({address:t,cause:new o3});if(r){if(t.toLowerCase()===t)return;if(Dg(t)!==t)throw new Fh({address:t,cause:new a3})}}function Dg(t){if(tf.has(t))return tf.get(t);iu(t,{strict:!1});const e=t.substring(2).toLowerCase(),r=Ug(YA(e),{as:"Bytes"}),n=e.split("");for(let s=0;s<40;s+=2)r[s>>1]>>4>=8&&n[s]&&(n[s]=n[s].toUpperCase()),(r[s>>1]&15)>=8&&n[s+1]&&(n[s+1]=n[s+1].toUpperCase());const i=`0x${n.join("")}`;return tf.set(t,i),i}function cl(t,e={}){const{strict:r=!0}=e??{};try{return iu(t,{strict:r}),!0}catch{return!1}}class Fh extends ue{constructor({address:e,cause:r}){super(`Address "${e}
66" is invalid.`,{cause:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class o3 extends ue{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class a3 extends ue{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}const c3=/^(.*)\[([0-9]*)\]$/,u3=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,zg=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,$h=2n**256n-1n;function ms(t,e,r){const{checksumAddress:n,staticPosition:i}=r,s=M0(e.type);if(s){const[o,a]=s;return l3(t,{...e,type:a},{checksumAddress:n,length:o,staticPosition:i})}if(e.type==="tuple")return m3(t,e,{checksumAddress:n,staticPosition:i});if(e.type==="address")return f3(t,{checksum:n});if(e.type==="bool")return d3(t);if(e.type.startsWith("bytes"))return h3(t,e,{staticPosition:i});if(e.type.startsWith("uint")||e.type.startsWith("int"))return p3(t,e);if(e.type==="string")return g3(t,{staticPosition:i});throw new R0(e.type)}const Lh=32,ul=32;function f3(t,e={}){const{checksum:r=!1}=e,n=t.readBytes(32);return[(s=>r?Dg(s):s)(Cr(XA(n,-20))),32]}function l3(t,e,r){const{checksumAddress:n,length:i,staticPosition:s}=r;if(!i){const c=wn(t.readBytes(ul)),u=s+c,f=u+Lh;t.setPosition(u);const d=wn(t.readBytes(Lh)),m=Xo(e);let g=0;const w=[];for(let A=0;A<d;++A){t.setPosition(f+(m?A*32:g));const[k,_]=ms(t,e,{checksumAddress:n,staticPosition:f});g+=_,w.push(k)}return t.setPosition(s+32),[w,32]}if(Xo(e)){const c=wn(t.readBytes(ul)),u=s+c,f=[];for(let d=0;d<i;++d){t.setPosition(u+d*32);const[m]=ms(t,e,{checksumAddress:n,staticPosition:u});f.push(m)}return t.setPosition(s+32),[f,32]}let o=0;const a=[];for(let c=0;c<i;++c){const[u,f]=ms(t,e,{checksumAddress:n,staticPosition:s+o});o+=f,a.push(u)}return[a,o]}function d3(t){return[tE(t.readBytes(32),{size:32}),32]}function h3(t,e,{staticPosition:r}){const[n,i]=e.type.split("bytes");if(!i){const o=wn(t.readBytes(32));t.setPosition(r+o);const a=wn(t.readBytes(32));if(a===0)return t.setPosition(r+32),["0x",32];const c=t.readBytes(a);return t.setPosition(r+32),[Cr(c),32]}return[Cr(t.readBytes(Number.parseInt(i,10),32)),32]}function p3(t,e){const r=e.type.startsWith("int"),n=Number.parseInt(e.type.split("int")[1]||"256",10),i=t.readBytes(32);return[n>48?eE(i,{signed:r}):wn(i,{signed:r}),32]}function m3(t,e,r){const{checksumAddress:n,staticPosition:i}=r,s=e.components.length===0||e.components.some(({name:c})=>!c),o=s?[]:{};let a=0;if(Xo(e)){const c=wn(t.readBytes(ul)),u=i+c;for(let f=0;f<e.components.length;++f){const d=e.components[f];t.setPosition(u+a);const[m,g]=ms(t,d,{checksumAddress:n,staticPosition:u});a+=g,o[s?f:d?.name]=m}return t.setPosition(i+32),[o,32]}for(let c=0;c<e.components.length;++c){const u=e.components[c],[f,d]=ms(t,u,{checksumAddress:n,staticPosition:i});o[s?c:u?.name]=f,a+=d}return[o,a]}function g3(t,{staticPosition:e}){const r=wn(t.readBytes(32)),n=e+r;t.setPosition(n);const i=wn(t.readBytes(32));if(i===0)return t.setPosition(e+32),["",32];const s=t.readBytes(i,32),o=rE(W1(s));return t.setPosition(e+32),[o,32]}function y3({checksumAddress:t,parameters:e,values:r}){const n=[];for(let i=0;i<e.length;i++)n.push(N0({checksumAddress:t,parameter:e[i],value:r[i]}));return n}function N0({checksumAddress:t=!1,parameter:e,value:r}){const n=e,i=M0(n.type);if(i){const[s,o]=i;return w3(r,{checksumAddress:t,length:s,parameter:{...n,type:o}})}if(n.type==="tuple")return P3(r,{checksumAddress:t,parameter:n});if(n.type==="address")return b3(r,{checksum:t});if(n.type==="bool")return x3(r);if(n.type.startsWith("uint")||n.type.startsWith("int")){const s=n.type.startsWith("int"),[,,o="256"]=zg.exec(n.type)??[];return A3(r,{signed:s,size:Number(o)})}if(n.type.startsWith("bytes"))return v3(r,{type:n.type});if(n.type==="string")return E3(r);throw new R0(n.type)}function k0(t){let e=0;for(let s=0;s<t.length;s++){const{dynamic:o,encoded:a}=t[s];o?e+=32:e+=nr(a)}const r=[],n=[];let i=0;for(let s=0;s<t.length;s++){const{dynamic:o,encoded:a}=t[s];o?(r.push(Ct(e+i,{size:32})),n.push(a),i+=nr(a)):r.push(a)}return Rr(...r,...n)}function b3(t,e){const{checksum:r=!1}=e;return iu(t,{strict:r}),{dynamic:!1,encoded:Gi(t.toLowerCase())}}function w3(t,e){const{checksumAddress:r,length:n,parameter:i}=e,s=n===null;if(!Array.isArray(t))throw new C3(t);if(!s&&t.length!==n)throw new R3({expectedLength:n,givenLength:t.length,type:`${i.type}[${n}]`});let o=!1;const a=[];for(let c=0;c<t.length;c++){const u=N0({checksumAddress:r,parameter:i,value:t[c]});u.dynamic&&(o=!0),a.push(u)}if(s||o){const c=k0(a);if(s){const u=Ct(a.length,{size:32});return{dynamic:!0,encoded:a.length>0?Rr(u,c):u}}if(o)return{dynamic:!0,encoded:c}}return{dynamic:!1,encoded:Rr(...a.map(({encoded:c})=>c))}}function v3(t,{type:e}){const[,r]=e.split("bytes"),n=nr(t);if(!r){let i=t;return n%32!==0&&(i=Hi(i,Math.ceil((t.length-2)/2/32)*32)),{dynamic:!0,encoded:Rr(Gi(Ct(n,{size:32})),i)}}if(n!==Number.parseInt(r,10))throw new jg({expectedSize:Number.parseInt(r,10),value:t});return{dynamic:!1,encoded:Hi(t)}}function x3(t){if(typeof t!="boolean")throw new ue(`Invalid boolean value: "${t}" (type: ${typeof t}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Gi(Q1(t))}}function A3(t,{signed:e,size:r}){if(typeof r=="number"){const n=2n**(BigInt(r)-(e?1n:0n))-1n,i=e?-n-1n:0n;if(t>n||t<i)throw new Z1({max:n.toString(),min:i.toString(),signed:e,size:r/8,value:t.toString()})}return{dynamic:!1,encoded:Ct(t,{size:32,signed:e})}}function E3(t){const e=y0(t),r=Math.ceil(nr(e)/32),n=[];for(let i=0;i<r;
vendor: 5,412 bytes, line 66
66i++)n.push(Hi(Qr(e,i*32,(i+1)*32)));return{dynamic:!0,encoded:Rr(Hi(Ct(nr(e),{size:32})),...n)}}function P3(t,e){const{checksumAddress:r,parameter:n}=e;let i=!1;const s=[];for(let o=0;o<n.components.length;o++){const a=n.components[o],c=Array.isArray(t)?o:a.name,u=N0({checksumAddress:r,parameter:a,value:t[c]});s.push(u),u.dynamic&&(i=!0)}return{dynamic:i,encoded:i?k0(s):Rr(...s.map(({encoded:o})=>o))}}function M0(t){const e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}function Xo(t){const{type:e}=t;if(e==="string"||e==="bytes"||e.endsWith("[]"))return!0;if(e==="tuple")return t.components?.some(Xo);const r=M0(t.type);return!!(r&&Xo({...t,type:r[1]}))}const S3={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new N3({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(t){if(t<0||t>this.bytes.length-1)throw new I3({length:this.bytes.length,position:t})},decrementPosition(t){if(t<0)throw new Uh({offset:t});const e=this.position-t;this.assertPosition(e),this.position=e},getReadCount(t){return this.positionReadCount.get(t||this.position)||0},incrementPosition(t){if(t<0)throw new Uh({offset:t});const e=this.position+t;this.assertPosition(e),this.position=e},inspectByte(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectBytes(t,e){const r=e??this.position;return this.assertPosition(r+t-1),this.bytes.subarray(r,r+t)},inspectUint8(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectUint16(t){const e=t??this.position;return this.assertPosition(e+1),this.dataView.getUint16(e)},inspectUint24(t){const e=t??this.position;return this.assertPosition(e+2),(this.dataView.getUint16(e)<<8)+this.dataView.getUint8(e+2)},inspectUint32(t){const e=t??this.position;return this.assertPosition(e+3),this.dataView.getUint32(e)},pushByte(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushBytes(t){this.assertPosition(this.position+t.length-1),this.bytes.set(t,this.position),this.position+=t.length},pushUint8(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushUint16(t){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,t),this.position+=2},pushUint24(t){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,t>>8),this.dataView.setUint8(this.position+2,t&255),this.position+=3},pushUint32(t){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,t),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const t=this.inspectByte();return this.position++,t},readBytes(t,e){this.assertReadLimit(),this._touch();const r=this.inspectBytes(t);return this.position+=e??t,r},readUint8(){this.assertReadLimit(),this._touch();const t=this.inspectUint8();return this.position+=1,t},readUint16(){this.assertReadLimit(),this._touch();const t=this.inspectUint16();return this.position+=2,t},readUint24(){this.assertReadLimit(),this._touch();const t=this.inspectUint24();return this.position+=3,t},readUint32(){this.assertReadLimit(),this._touch();const t=this.inspectUint32();return this.position+=4,t},get remaining(){return this.bytes.length-this.position},setPosition(t){const e=this.position;return this.assertPosition(t),this.position=t,()=>this.position=e},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const t=this.getReadCount();this.positionReadCount.set(this.position,t+1),t>0&&this.recursiveReadCount++}};function _3(t,{recursiveReadLimit:e=8192}={}){const r=Object.create(S3);return r.bytes=t,r.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=e,r}class Uh extends ue{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class I3 extends ue{constructor({length:e,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class N3 extends ue{constructor({count:e,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function k3(t,e,r={}){const{as:n="Array",checksumAddress:i=!1}=r,s=typeof e=="string"?K1(e):e,o=_3(s);if(os(s)===0&&t.length>0)throw new T3;if(os(s)&&os(s)<32)throw new M3({data:typeof e=="string"?e:Cr(e),parameters:t,size:os(s)});let a=0;const c=n==="Array"?[]:{};for(let u=0;u<t.length;++u){const f=t[u];o.setPosition(a);const[d,m]=ms(o,f,{checksumAddress:i,staticPosition:0});a+=m,n==="Array"?c.push(d):c[f.name??u]=d}return c}function T0(t,e,r){const{checksumAddress:n=!1}={};if(t.length!==e.length)throw new Gg({expectedLength:t.length,givenLength:e.length});const i=y3({checksumAddress:n,parameters:t,values:e}),s=k0(i);return s.length===0?"0x":s}function fl(t,e){if(t.length!==e.length)throw new Gg({expectedLength:t.length,givenLength:e.length});const r=[];for(let n=0;n<t.length;n++){const i=t[n],s=e[n];
vendor: 16,683 bytes, lines 66-67
66r.push(fl.encode(i,s))}return Rr(...r)}(function(t){function e(r,n,i=!1){if(r==="address"){const c=n;return iu(c),Gi(c.toLowerCase(),i?32:0)}if(r==="string")return y0(n);if(r==="bytes")return n;if(r==="bool")return Gi(Q1(n),i?32:1);const s=r.match(zg);if(s){const[c,u,f="256"]=s,d=Number.parseInt(f,10)/8;return Ct(n,{size:i?32:d,signed:u==="int"})}const o=r.match(u3);if(o){const[c,u]=o;if(Number.parseInt(u,10)!==(n.length-2)/2)throw new jg({expectedSize:Number.parseInt(u,10),value:n});return Hi(n,i?32:0)}const a=r.match(c3);if(a&&Array.isArray(n)){const[c,u]=a,f=[];for(let d=0;d<n.length;d++)f.push(e(u,n[d],!0));return f.length===0?"0x":Rr(...f)}throw new R0(r)}t.encode=e})(fl||(fl={}));function qg(t){return Array.isArray(t)&&typeof t[0]=="string"||typeof t=="string"?eh(t):t}class M3 extends ue{constructor({data:e,parameters:r,size:n}){super(`Data size of ${n} bytes is too small for given parameters.`,{metaMessages:[`Params: (${ts(r)})`,`Data:   ${e} (${n} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class T3 extends ue{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class R3 extends ue{constructor({expectedLength:e,givenLength:r,type:n}){super(`Array length mismatch for type \`${n}\`. Expected: \`${e}\`. Given: \`${r}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class jg extends ue{constructor({expectedSize:e,value:r}){super(`Size of bytes "${r}" (bytes${nr(r)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class Gg extends ue{constructor({expectedLength:e,givenLength:r}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${e}`,`Given length (values): ${r}`].join(`
67`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class C3 extends ue{constructor(e){super(`Value \`${e}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class R0 extends ue{constructor(e){super(`Type \`${e}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Gt=BigInt(0),Ot=BigInt(1),Ei=BigInt(2),B3=BigInt(3),Hg=BigInt(4),Vg=BigInt(5),Kg=BigInt(8);function zt(t,e){const r=t%e;return r>=Gt?r:e+r}function or(t,e,r){let n=t;for(;e-- >Gt;)n*=n,n%=r;return n}function ll(t,e){if(t===Gt)throw new Error("invert: expected non-zero number");if(e<=Gt)throw new Error("invert: expected positive modulus, got "+e);let r=zt(t,e),n=e,i=Gt,s=Ot;for(;r!==Gt;){const a=n/r,c=n%r,u=i-s*a;n=r,r=c,i=s,s=u}if(n!==Ot)throw new Error("invert: does not exist");return zt(i,e)}function Wg(t,e){const r=(t.ORDER+Ot)/Hg,n=t.pow(e,r);if(!t.eql(t.sqr(n),e))throw new Error("Cannot find square root");return n}function O3(t,e){const r=(t.ORDER-Vg)/Kg,n=t.mul(e,Ei),i=t.pow(n,r),s=t.mul(e,i),o=t.mul(t.mul(s,Ei),i),a=t.mul(s,t.sub(o,t.ONE));if(!t.eql(t.sqr(a),e))throw new Error("Cannot find square root");return a}function F3(t){if(t<BigInt(3))throw new Error("sqrt is not defined for small field");let e=t-Ot,r=0;for(;e%Ei===Gt;)e/=Ei,r++;let n=Ei;const i=C0(t);for(;Dh(i,n)===1;)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return Wg;let s=i.pow(n,e);const o=(e+Ot)/Ei;return function(c,u){if(c.is0(u))return u;if(Dh(c,u)!==1)throw new Error("Cannot find square root");let f=r,d=c.mul(c.ONE,s),m=c.pow(u,e),g=c.pow(u,o);for(;!c.eql(m,c.ONE);){if(c.is0(m))return c.ZERO;let w=1,A=c.sqr(m);for(;!c.eql(A,c.ONE);)if(w++,A=c.sqr(A),w===f)throw new Error("Cannot find square root");const k=Ot<<BigInt(f-w-1),_=c.pow(d,k);f=w,d=c.sqr(_),m=c.mul(m,d),g=c.mul(g,_)}return g}}function $3(t){return t%Hg===B3?Wg:t%Kg===Vg?O3:F3(t)}const L3=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function U3(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=L3.reduce((n,i)=>(n[i]="function",n),e);return Qc(t,r)}function D3(t,e,r){if(r<Gt)throw new Error("invalid exponent, negatives unsupported");if(r===Gt)return t.ONE;if(r===Ot)return e;let n=t.ONE,i=e;for(;r>Gt;)r&Ot&&(n=t.mul(n,i)),i=t.sqr(i),r>>=Ot;return n}function Qg(t,e,r=!1){const n=new Array(e.length).fill(r?t.ZERO:void 0),i=e.reduce((o,a,c)=>t.is0(a)?o:(n[c]=o,t.mul(o,a)),t.ONE),s=t.inv(i);return e.reduceRight((o,a,c)=>t.is0(a)?o:(n[c]=t.mul(o,n[c]),t.mul(o,a)),s),n}function Dh(t,e){const r=(t.ORDER-Ot)/Ei,n=t.pow(e,r),i=t.eql(n,t.ONE),s=t.eql(n,t.ZERO),o=t.eql(n,t.neg(t.ONE));if(!i&&!s&&!o)throw new Error("invalid Legendre symbol result");return i?1:s?0:-1}function Jg(t,e){e!==void 0&&ko(e);const r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function C0(t,e,r=!1,n={}){if(t<=Gt)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:i,nByteLength:s}=Jg(t,e);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let o;const a=Object.freeze({ORDER:t,isLE:r,BITS:i,BYTES:s,MASK:Wc(i),ZERO:Gt,ONE:Ot,create:c=>zt(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return Gt<=c&&c<t},is0:c=>c===Gt,isOdd:c=>(c&Ot)===Ot,neg:c=>zt(-c,t),eql:(c,u)=>c===u,sqr:c=>zt(c*c,t),add:(c,u)=>zt(c+u,t),sub:(c,u)=>zt(c-u,t),mul:(c,u)=>zt(c*u,t),pow:(c,u)=>D3(a,c,u),div:(c,u)=>zt(c*ll(u,t),t),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>ll(c,t),sqrt:n.sqrt||(c=>(o||(o=$3(t)),o(a,c))),toBytes:c=>r?q1(c,s):Sa(c,s),fromBytes:c=>{if(c.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+c.length);return r?z1(c):Bi(c)},invertBatch:c=>Qg(a,c),cmov:(c,u,f)=>f?u:c});return Object.freeze(a)}function Yg(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function Zg(t){const e=Yg(t);return e+Math.ceil(e/2)}function z3(t,e,r=!1){const n=t.length,i=Yg(e),s=Zg(e);if(n<16||n<s||n>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+n);const o=r?z1(t):Bi(t),a=zt(o,e-Ot)+Ot;return r?q1(a,i):Sa(a,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const zh=BigInt(0),dl=BigInt(1);function rf(t,e){const r=e.negate();return t?r:e}function Xg(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function nf(t,e){Xg(t,e);const r=Math.ceil(e/t)+1,n=2**(t-1),i=2**t,s=Wc(t),o=BigInt(t);return{windows:r,windowSize:n,mask:s,maxNumber:i,shiftBy:o}}function qh(t,e,r){const{windowSize:n,mask:i,maxNumber:s,shiftBy:o}=r;let a=Number(t&i),c=t>>o;a>n&&(a-=s,c+=dl);const u=e*n,f=u+Math.abs(a)-1,d=a===0,m=a<0,g=e%2!==0;return{nextN:c,offset:f,isZero:d,isNeg:m,isNegF:g,offsetF:u}}function q3(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((r,n)=>{if(!(r instanceof e))throw new Error("invalid point at index "+n)})}function j3(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((r,n)=>{if(!e.isValid(r))throw new Error("invalid scalar at index "+n)})}const sf=new WeakMap,ey=new WeakMap;function of(t){return ey.get(t)||1}function G3(t,e){return{constTimeNegate:rf,hasPrecomputes(r){return of(r)!==1},unsafeLadder(r,n,i=t.ZERO){let s=r;for(;n>zh;)n&dl&&(i=i.add(s)),s=s.double(),n>>=dl;return i},precomputeWindow(r,n){const{windows:i,windowSize:s}=nf(n,e),o=[];let a=r,c=a;for(let u=0;u<i;u++){c=a,o.push(c);for(let f=1;f<s;f++)c=c.add(a),o.push(c);a=c.double()}return o},wNAF(r,n,i){let s=t.ZERO,o=t.BASE;const a=nf(r,e);for(let c=0;c<a.windows;c++){const{nextN:u,offset:f,isZero:d,isNeg:m,isNegF:g,offsetF:w}=qh(i,c,a);i=u,d?o=o.add(rf(g,n[w])):s=s.add(rf(m,n[f]))}return{p:s,f:o}},wNAFUnsafe(r,n,i,s=t.ZERO){const o=nf(r,e);for(let a=0;a<o.windows&&i!==zh;a++){const{nextN:c,offset:u,isZero:f,isNeg:d}=qh(i,a,o);if(i=c,!f){const m=n[u];s=s.add(d?m.negate():m)}}return s},getPrecomputes(r,n,i){let s=sf.get(n);return s||(s=this.precomputeWindow(n,r),r!==1&&sf.set(n,i(s))),s},wNAFCached(r,n,i){const s=of(r);return this.wNAF(s,this.getPrecomputes(s,r,i),n)},wNAFCachedUnsafe(r,n,i,s){const o=of(r);return o===1?this.unsafeLadder(r,n,s):this.wNAFUnsafe(o,this.getPrecomputes(o,r,i),n,s)},setWindowSize(r,n){Xg(n,e),ey.set(r,n),sf.delete(r)}}}function H3(t,e,r,n){q3(r,t),j3(n,e);const i=r.length,s=n.length;if(i!==s)throw new Error("arrays of points and scalars must have equal length");const o=t.ZERO,a=LA(BigInt(i));let c=1;a>12?c=a-3:a>4?c=a-2:a>0&&(c=2);const u=Wc(c),f=new Array(Number(u)+1).fill(o),d=Math.floor((e.BITS-1)/c)*c;let m=o;for(let g=d;g>=0;g-=c){f.fill(o);for(let A=0;A<s;A++){const k=n[A],_=Number(k>>BigInt(g)&u);f[_]=f[_].add(r[A])}let w=o;for(let A=f.length-1,k=o;A>0;A--)k=k.add(f[A]),w=w.add(k);if(m=m.add(w),g!==0)for(let A=0;A<c;A++)m=m.double()}return m}function ty(t){return U3(t.Fp),Qc(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Jg(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function jh(t){t.lowS!==void 0&&Yo("lowS",t.lowS),t.prehash!==void 0&&Yo("prehash",t.prehash)}function V3(t){const e=ty(t);Qc(e,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...e})}class K3 extends Error{constructor(e=""){super(e)}}const hn={Err:K3,_tlv:{encode:(t,e)=>{const{Err:r}=hn;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(e.length&1)throw new r("tlv.encode: unpadded data");const n=e.length/2,i=za(n);if(i.length/2&128)throw new r("tlv.encode: long form length too big");const s=n>127?za(i.length/2|128):"";return za(t)+s+i+e},decode(t,e){const{Err:r}=hn;let n=0;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(e.length<2||e[n++]!==t)throw new r("tlv.decode: wrong tlv");const i=e[n++],s=!!(i&128);let o=0;if(!s)o=i;else{const c=i&127;if(!c)throw new r("tlv.decode(long): indefinite length not supported");if(c>4)throw new r("tlv.decode(long): byte length is too big");const u=e.subarray(n,n+c);if(u.length!==c)throw new r("tlv.decode: length bytes not complete");if(u[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(const f of u)o=o<<8|f;if(n+=c,o<128)throw new r("tlv.decode(long): not minimal encoding")}const a=e.subarray(n,n+o);if(a.length!==o)throw new r("tlv.decode: wrong value length");return{v:a,l:e.subarray(n+o)}}},_int:{encode(t){const{Err:e}=hn;if(t<gn)throw new e("integer: negative integers are not allowed");let r=za(t);if(Number.parseInt(r[0],16)&8&&(r="00"+r),r.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return r},decode(t){const{Err:e}=hn;if(t[0]&128)throw new e("invalid signature integer: negative");if(t[0]===0&&!(t[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return Bi(t)}},toSig(t){const{Err:e,_int:r,_tlv:n}=hn,i=cr("signature",t),{v:s,l:o}=n.decode(48,i);if(o.length)throw new e("invalid signature: left bytes after parsing");const{v:a,l:c}=n.decode(2,s),{v:u,l:f}=n.decode(2,c);if(f.length)throw new e("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(u)}},hexFromSig(t){const{_tlv:e,_int:r}=hn,n=e.encode(2,r.encode(t.r)),i=e.encode(2,r.encode(t.s)),s=n+i;return e.encode(48,s)}};function af(t,e){return Zo(Sa(t,e))}const gn=BigInt(0),gt=BigInt(1);BigInt(2);const cf=BigInt(3),W3=BigInt(4);function Q3(t){const e=V3(t),{Fp:r}=e,n=C0(e.n,e.nBitLength),i=e.toBytes||((T,N,M)=>{const O=N.toAffine();return bc(Uint8Array.from([4]),r.toBytes(O.x),r.toBytes(O.y))}),s=e.fromBytes||(T=>{const N=T.subarray(1),M=r.fromBytes(N.subarray(0,r.BYTES)),O=r.fromBytes(N.subarray(r.BYTES,2*r.BYTES));return{x:M,y:O}});function o(T){const{a:N,b:M}=e,O=r.sqr(T),F=r.mul(O,T);return r.add(r.add(F,r.mul(T,N)),M)}function a(T,N){const M=r.sqr(N),O=o(T);return r.eql(M,O)}if(!a(e.Gx,e.Gy))throw new Error("bad curve params: generator point");const c=r.mul(r.pow(e.a,cf),W3),u=r.mul(r.sqr(e.b),BigInt(27));if(r.is0(r.add(c,u)))throw new Error("bad curve params: a or b");function f(T){return g0(T,gt,e.n)}function d(T){const{allowedPrivateKeyLengths:N,nByteLength:M,wrapPrivateKey:O,n:F}=e;if(N&&typeof T!="bigint"){if(Pa(T)&&(T=Zo(T)),typeof T!="string"||!N.includes(T.length))throw new Error("invalid private key");T=T.padStart(M*2,"0")}let L;try{L=typeof T=="bigint"?T:Bi(cr("private key",T,M))}catch{throw new Error("invalid private key, expected hex or "+M+" bytes, got "+typeof T)}return O&&(L=zt(L,F)),ps("private key",L,gt,F),L}function m(T){if(!(T instanceof A))throw new Error("ProjectivePoint expected")}const g=Sh((T,N)=>{const{px:M,py:O,pz:F}=T;if(r.eql(F,r.ONE))return{x:M,y:O};const L=T.is0();N==null&&(N=L?r.ONE:r.inv(F));const z=r.mul(M,N),D=r.mul(O,N),j=r.mul(F,N);if(L)return{x:r.ZERO,y:r.ZERO};if(!r.eql(j,r.ONE))throw new Error("invZ was invalid");return{x:z,y:D}}),w=Sh(T=>{if(T.is0()){if(e.allowInfinityPoint&&!r.is0(T.py))return;throw new Error("bad point: ZERO")}const{x:N,y:M}=T.toAffine();if(!r.isValid(N)||!r.isValid(M))throw new Error("bad point: x or y not FE");if(!a(N,M))throw new Error("bad point: equation left != right");if(!T.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class A{constructor(N,M,O){if(N==null||!r.isValid(N))throw new Error("x required");if(M==null||!r.isValid(M)||r.is0(M))throw new Error("y required");if(O==null||!r.isValid(O))throw new Error("z required");this.px=N,this.py=M,this.pz=O,Object.freeze(this)}static fromAffine(N){const{x:M,y:O}=N||{};if(!N||!r.isValid(M)||!r.isValid(O))throw new Error("invalid affine point");if(N instanceof A)throw new Error("projective point not allowed");const F=L=>r.eql(L,r.ZERO);return F(M)&&F(O)?A.ZERO:new A(M,O,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(N){const M=Qg(r,N.map(O=>O.pz));return N.map((O,F)=>O.toAffine(M[F])).map(A.fromAffine)}static fromHex(N){const M=A.fromAffine(s(cr("pointHex",N)));return M.assertValidity(),M}static fromPrivateKey(N){return A.BASE.multiply(d(N))}static msm(N,M){return H3(A,n,N,M)}_setWindowSize(N){B.setWindowSize(this,N)}assertValidity(){w(this)}hasEvenY(){const{y:N}=this.toAffine();if(r.isOdd)return!r.isOdd(N);throw new Error("Field doesn't support isOdd")}equals(N){m(N);const{px:M,py:O,pz:F}=this,{px:L,py:z,pz:D}=N,j=r.eql(r.mul(M,D),r.mul(L,F)),Q=r.eql(r.mul(O,D),r.mul(z,F));return j&&Q}negate(){return new A(this.px,r.neg(this.py),this.pz)}double(){const{a:N,b:M}=e,O=r.mul(M,cf),{px:F,py:L,pz:z}=this;let D=r.ZERO,j=r.ZERO,Q=r.ZERO,E=r.mul(F,F),l=r.mul(L,L),p=r.mul(z,z),b=r.mul(F,L);return b=r.add(b,b),Q=r.mul(F,z),Q=r.add(Q,Q),D=r.mul(N,Q),j=r.mul(O,p),j=r.add(D,j),D=r.sub(l,j),j=r.add(l,j),j=r.mul(D,j),D=r.mul(b,D),Q=r.mul(O,Q),p=r.mul(N,p),b=r.sub(E,p),b=r.mul(N,b),b=r.add(b,Q),Q=r.add(E,E),E=r.add(Q,E),E=r.add(E,p),E=r.mul(E,b),j=r.add(j,E),p=r.mul(L,z),p=r.add(p,p),E=r.mul(p,b),D=r.sub(D,E),Q=r.mul(p,l),Q=r.add(Q,Q),Q=r.add(Q,Q),new A(D,j,Q)}add(N){m(N);const{px:M,py:O,pz:F}=this,{px:L,py:z,pz:D}=N;let j=r.ZERO,Q=r.ZERO,E=r.ZERO;const l=e.a,p=r.mul(e.b,cf);let b=r.mul(M,L),x=r.mul(O,z),v=r.mul(F,D),I=r.add(M,O),R=r.add(L,z);I=r.mul(I,R),R=r.add(b,x),I=r.sub(I,R),R=r.add(M,F);let P=r.add(L,D);return R=r.mul(R,P),P=r.add(b,v),R=r.sub(R,P),P=r.add(O,F),j=r.add(z,D),P=r.mul(P,j),j=r.add(x,v),P=r.sub(P,j),E=r.mul(l,R),j=r.mul(p,v),E=r.add(j,E),j=r.sub(x,E),E=r.add(x,E),Q=r.mul(j,E),x=r.add(b,b),x=r.add(x,b),v=r.mul(l,v),R=r.mul(p,R),x=r.add(x,v),v=r.sub(b,v),v=r.mul(l,v),R=r.add(R,v),b=r.mul(x,R),Q=r.add(Q,b),b=r.mul(P,R),j=r.mul(I,j),j=r.sub(j,b),b=r.mul(I,x),E=r.mul(P,E),E=r.add(E,b),new A(j,Q,E)}subtract(N){return this.add(N.negate())}is0(){return this.equals(A.ZERO)}wNAF(N){return B.wNAFCached(this,N,A.normalizeZ)}
vendor: 4,755 bytes, line 67
67multiplyUnsafe(N){const{endo:M,n:O}=e;ps("scalar",N,gn,O);const F=A.ZERO;if(N===gn)return F;if(this.is0()||N===gt)return this;if(!M||B.hasPrecomputes(this))return B.wNAFCachedUnsafe(this,N,A.normalizeZ);let{k1neg:L,k1:z,k2neg:D,k2:j}=M.splitScalar(N),Q=F,E=F,l=this;for(;z>gn||j>gn;)z&gt&&(Q=Q.add(l)),j&gt&&(E=E.add(l)),l=l.double(),z>>=gt,j>>=gt;return L&&(Q=Q.negate()),D&&(E=E.negate()),E=new A(r.mul(E.px,M.beta),E.py,E.pz),Q.add(E)}multiply(N){const{endo:M,n:O}=e;ps("scalar",N,gt,O);let F,L;if(M){const{k1neg:z,k1:D,k2neg:j,k2:Q}=M.splitScalar(N);let{p:E,f:l}=this.wNAF(D),{p,f:b}=this.wNAF(Q);E=B.constTimeNegate(z,E),p=B.constTimeNegate(j,p),p=new A(r.mul(p.px,M.beta),p.py,p.pz),F=E.add(p),L=l.add(b)}else{const{p:z,f:D}=this.wNAF(N);F=z,L=D}return A.normalizeZ([F,L])[0]}multiplyAndAddUnsafe(N,M,O){const F=A.BASE,L=(D,j)=>j===gn||j===gt||!D.equals(F)?D.multiplyUnsafe(j):D.multiply(j),z=L(this,M).add(L(N,O));return z.is0()?void 0:z}toAffine(N){return g(this,N)}isTorsionFree(){const{h:N,isTorsionFree:M}=e;if(N===gt)return!0;if(M)return M(A,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:N,clearCofactor:M}=e;return N===gt?this:M?M(A,this):this.multiplyUnsafe(e.h)}toRawBytes(N=!0){return Yo("isCompressed",N),this.assertValidity(),i(A,this,N)}toHex(N=!0){return Yo("isCompressed",N),Zo(this.toRawBytes(N))}}A.BASE=new A(e.Gx,e.Gy,r.ONE),A.ZERO=new A(r.ZERO,r.ONE,r.ZERO);const{endo:k,nBitLength:_}=e,B=G3(A,k?Math.ceil(_/2):_);return{CURVE:e,ProjectivePoint:A,normPrivateKeyToScalar:d,weierstrassEquation:o,isWithinCurveOrder:f}}function J3(t){const e=ty(t);return Qc(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function Y3(t){const e=J3(t),{Fp:r,n,nByteLength:i,nBitLength:s}=e,o=r.BYTES+1,a=2*r.BYTES+1;function c(p){return zt(p,n)}function u(p){return ll(p,n)}const{ProjectivePoint:f,normPrivateKeyToScalar:d,weierstrassEquation:m,isWithinCurveOrder:g}=Q3({...e,toBytes(p,b,x){const v=b.toAffine(),I=r.toBytes(v.x),R=bc;return Yo("isCompressed",x),x?R(Uint8Array.from([b.hasEvenY()?2:3]),I):R(Uint8Array.from([4]),I,r.toBytes(v.y))},fromBytes(p){const b=p.length,x=p[0],v=p.subarray(1);if(b===o&&(x===2||x===3)){const I=Bi(v);if(!g0(I,gt,r.ORDER))throw new Error("Point is not on curve");const R=m(I);let P;try{P=r.sqrt(R)}catch(Z){const y=Z instanceof Error?": "+Z.message:"";throw new Error("Point is not on curve"+y)}const h=(P&gt)===gt;return(x&1)===1!==h&&(P=r.neg(P)),{x:I,y:P}}else if(b===a&&x===4){const I=r.fromBytes(v.subarray(0,r.BYTES)),R=r.fromBytes(v.subarray(r.BYTES,2*r.BYTES));return{x:I,y:R}}else{const I=o,R=a;throw new Error("invalid Point, expected length of "+I+", or uncompressed "+R+", got "+b)}}});function w(p){const b=n>>gt;return p>b}function A(p){return w(p)?c(-p):p}const k=(p,b,x)=>Bi(p.slice(b,x));class _{constructor(b,x,v){ps("r",b,gt,n),ps("s",x,gt,n),this.r=b,this.s=x,v!=null&&(this.recovery=v),Object.freeze(this)}static fromCompact(b){const x=i;return b=cr("compactSignature",b,x*2),new _(k(b,0,x),k(b,x,2*x))}static fromDER(b){const{r:x,s:v}=hn.toSig(cr("DER",b));return new _(x,v)}assertValidity(){}addRecoveryBit(b){return new _(this.r,this.s,b)}recoverPublicKey(b){const{r:x,s:v,recovery:I}=this,R=F(cr("msgHash",b));if(I==null||![0,1,2,3].includes(I))throw new Error("recovery id invalid");const P=I===2||I===3?x+e.n:x;if(P>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const h=I&1?"03":"02",S=f.fromHex(h+af(P,r.BYTES)),Z=u(P),y=c(-R*Z),U=c(v*Z),G=f.BASE.multiplyAndAddUnsafe(S,y,U);if(!G)throw new Error("point at infinify");return G.assertValidity(),G}hasHighS(){return w(this.s)}normalizeS(){return this.hasHighS()?new _(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return yc(this.toDERHex())}toDERHex(){return hn.hexFromSig(this)}toCompactRawBytes(){return yc(this.toCompactHex())}toCompactHex(){const b=i;return af(this.r,b)+af(this.s,b)}}const B={isValidPrivateKey(p){try{return d(p),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const p=Zg(e.n);return z3(e.randomBytes(p),e.n)},precompute(p=8,b=f.BASE){return b._setWindowSize(p),b.multiply(BigInt(3)),b}};function T(p,b=!0){return f.fromPrivateKey(p).toRawBytes(b)}function N(p){if(typeof p=="bigint")return!1;if(p instanceof f)return!0;const x=cr("key",p).length,v=r.BYTES,I=v+1,R=2*v+1;if(!(e.allowedPrivateKeyLengths||i===I))return x===I||x===R}function M(p,b,x=!0){if(N(p)===!0)throw new Error("first arg must be private key");if(N(b)===!1)throw new Error("second arg must be public key");return f.fromHex(b).multiply(d(p)).toRawBytes(x)}const O=e.bits2int||function(p){if(p.length>8192)throw new Error("input is too large");
vendor: 5,262 bytes, line 67
67const b=Bi(p),x=p.length*8-s;return x>0?b>>BigInt(x):b},F=e.bits2int_modN||function(p){return c(O(p))},L=Wc(s);function z(p){return ps("num < 2^"+s,p,gn,L),Sa(p,i)}function D(p,b,x=j){if(["recovered","canonical"].some(V=>V in x))throw new Error("sign() legacy options not supported");const{hash:v,randomBytes:I}=e;let{lowS:R,prehash:P,extraEntropy:h}=x;R==null&&(R=!0),p=cr("msgHash",p),jh(x),P&&(p=cr("prehashed msgHash",v(p)));const S=F(p),Z=d(b),y=[z(Z),z(S)];if(h!=null&&h!==!1){const V=h===!0?I(r.BYTES):h;y.push(cr("extraEntropy",V))}const U=bc(...y),G=S;function H(V){const ie=O(V);if(!g(ie))return;const X=u(ie),Y=f.BASE.multiply(ie).toAffine(),xe=c(Y.x);if(xe===gn)return;const ee=c(X*c(G+xe*Z));if(ee===gn)return;let ae=(Y.x===xe?0:2)|Number(Y.y&gt),Or=ee;return R&&w(ee)&&(Or=A(ee),ae^=1),new _(xe,Or,ae)}return{seed:U,k2sig:H}}const j={lowS:e.lowS,prehash:!1},Q={lowS:e.lowS,prehash:!1};function E(p,b,x=j){const{seed:v,k2sig:I}=D(p,b,x),R=e;return UA(R.hash.outputLen,R.nByteLength,R.hmac)(v,I)}f.BASE._setWindowSize(8);function l(p,b,x,v=Q){const I=p;b=cr("msgHash",b),x=cr("publicKey",x);const{lowS:R,prehash:P,format:h}=v;if(jh(v),"strict"in v)throw new Error("options.strict was renamed to lowS");if(h!==void 0&&h!=="compact"&&h!=="der")throw new Error("format must be compact or der");const S=typeof I=="string"||Pa(I),Z=!S&&!h&&typeof I=="object"&&I!==null&&typeof I.r=="bigint"&&typeof I.s=="bigint";if(!S&&!Z)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let y,U;try{if(Z&&(y=new _(I.r,I.s)),S){try{h!=="compact"&&(y=_.fromDER(I))}catch(ae){if(!(ae instanceof hn.Err))throw ae}!y&&h!=="der"&&(y=_.fromCompact(I))}U=f.fromHex(x)}catch{return!1}if(!y||R&&y.hasHighS())return!1;P&&(b=e.hash(b));const{r:G,s:H}=y,V=F(b),ie=u(H),X=c(V*ie),Y=c(G*ie),xe=f.BASE.multiplyAndAddUnsafe(U,X,Y)?.toAffine();return xe?c(xe.x)===G:!1}return{CURVE:e,getPublicKey:T,getSharedSecret:M,sign:E,verify:l,ProjectivePoint:f,Signature:_,utils:B}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Z3(t){return{hash:t,hmac:(e,...r)=>Lg(t,e,nx(...r)),randomBytes:ix}}function X3(t,e){const r=n=>Y3({...t,...Z3(n)});return{...r(e),create:r}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ry=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Gh=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),e4=BigInt(0),t4=BigInt(1),hl=BigInt(2),Hh=(t,e)=>(t+e/hl)/e;function r4(t){const e=ry,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),u=t*t*t%e,f=u*u*t%e,d=or(f,r,e)*f%e,m=or(d,r,e)*f%e,g=or(m,hl,e)*u%e,w=or(g,i,e)*g%e,A=or(w,s,e)*w%e,k=or(A,a,e)*A%e,_=or(k,c,e)*k%e,B=or(_,a,e)*A%e,T=or(B,r,e)*f%e,N=or(T,o,e)*w%e,M=or(N,n,e)*u%e,O=or(M,hl,e);if(!pl.eql(pl.sqr(O),t))throw new Error("Cannot find square root");return O}const pl=C0(ry,void 0,void 0,{sqrt:r4}),ny=X3({a:e4,b:BigInt(7),Fp:pl,n:Gh,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=Gh,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-t4*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,o=BigInt("0x100000000000000000000000000000000"),a=Hh(s*t,e),c=Hh(-n*t,e);let u=zt(t-a*r-c*i,e),f=zt(-a*n-c*s,e);const d=u>o,m=f>o;if(d&&(u=e-u),m&&(f=e-f),u>o||f>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:d,k1:u,k2neg:m,k2:f}}}},M1),n4=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:ny},Symbol.toStringTag,{value:"Module"}));function iy(t,e={}){const{recovered:r}=e;if(typeof t.r>"u")throw new uf({signature:t});if(typeof t.s>"u")throw new uf({signature:t});if(r&&typeof t.yParity>"u")throw new uf({signature:t});if(t.r<0n||t.r>$h)throw new f4({value:t.r});if(t.s<0n||t.s>$h)throw new l4({value:t.s});if(typeof t.yParity=="number"&&t.yParity!==0&&t.yParity!==1)throw new O0({value:t.yParity})}function i4(t){return sy(Cr(t))}function sy(t){if(t.length!==130&&t.length!==132)throw new u4({signature:t});const e=BigInt(Qr(t,0,32)),r=BigInt(Qr(t,32,64)),n=(()=>{const i=+`0x${t.slice(130)}`;if(!Number.isNaN(i))try{return B0(i)}catch{throw new O0({value:i})}})();return typeof n>"u"?{r:e,s:r}:{r:e,s:r,yParity:n}}function s4(t){if(!(typeof t.r>"u")&&!(typeof t.s>"u"))return o4(t)}function o4(t){const e=typeof t=="string"?sy(t):t instanceof Uint8Array?i4(t):typeof t.r=="string"?c4(t):t.v?a4(t):{r:t.r,s:t.s,...typeof t.yParity<"u"?{yParity:t.yParity}:{}};return iy(e),e}function a4(t){return{r:t.r,s:t.s,yParity:B0(t.v)}}function c4(t){const e=(()=>{const r=t.v?Number(t.v):void 0;let n=t.yParity?Number(t.yParity):void 0;if(typeof r=="number"&&typeof n!="number"&&(n=B0(r)),typeof n!="number")throw new O0({value:t.yParity});return n})();return{r:BigInt(t.r),s:BigInt(t.s),yParity:e}}function B0(t){if(t===0||t===27)return 0;if(t===1||t===28)return 1;if(t>=35)return t%2===0?1:0;throw new d4({value:t})}class u4 extends ue{constructor({signature:e}){super(`Value \`${e}
67\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${nr(fE(e))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class uf extends ue{constructor({signature:e}){super(`Signature \`${V1(e)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class f4 extends ue{constructor({value:e}){super(`Value \`${e}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class l4 extends ue{constructor({value:e}){super(`Value \`${e}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class O0 extends ue{constructor({value:e}){super(`Value \`${e}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class d4 extends ue{constructor({value:e}){super(`Value \`${e}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}function h4(t,e={}){return typeof t.chainId=="string"?p4(t):{...t,...e.signature}}function p4(t){const{address:e,chainId:r,nonce:n}=t,i=s4(t);return{address:e,chainId:Number(r),nonce:BigInt(n),...i}}const m4="0x8010801080108010801080108010801080108010801080108010801080108010",g4=qg("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function oy(t){if(typeof t=="string"){if(Qr(t,-32)!==m4)throw new w4(t)}else iy(t.authorization)}function y4(t){oy(t);const e=Y1(Qr(t,-64,-32)),r=Qr(t,-e-64,-64),n=Qr(t,0,-e-64),[i,s,o]=k3(g4,r);return{authorization:h4({address:i.delegation,chainId:Number(i.chainId),nonce:i.nonce,yParity:i.yParity,r:i.r,s:i.s}),signature:n,...o&&o!=="0x"?{data:o,to:s}:{}}}function b4(t){try{return oy(t),!0}catch{return!1}}let w4=class extends ue{constructor(e){super(`Value \`${e}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}};class v4 extends q{constructor({value:e}){super(`Number \`${e}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function x4(t,e){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(t))throw new v4({value:t});let[r,n="0"]=t.split(".");const i=r.startsWith("-");if(i&&(r=r.slice(1)),n=n.replace(/(0+)$/,""),e===0)Math.round(+`.${n}`)===1&&(r=`${BigInt(r)+1n}`),n="";else if(n.length>e){const[s,o,a]=[n.slice(0,e-1),n.slice(e-1,e),n.slice(e)],c=Math.round(+`${o}.${a}`);c>9?n=`${BigInt(s)+BigInt(1)}0`.padStart(s.length+1,"0"):n=`${s}${c}`,n.length>e&&(n=n.slice(1),r=`${BigInt(r)+1n}`),n=n.slice(0,e)}else n=n.padEnd(e,"0");return BigInt(`${i?"-":""}${r}${n}`)}function A4(t){return t.map(e=>({...e,value:BigInt(e.value)}))}function E4(t){return{...t,balance:t.balance?BigInt(t.balance):void 0,nonce:t.nonce?hr(t.nonce):void 0,storageProof:t.storageProof?A4(t.storageProof):void 0}}async function P4(t,{address:e,blockHash:r,blockNumber:n,blockTag:i="latest",requireCanonical:s,storageKeys:o}){const a=Ji({blockHash:r,blockNumber:n,blockTag:i,requireCanonical:s}),c=await t.request({method:"eth_getProof",params:[e,o,a]});return E4(c)}async function S4(t,{hash:e}){const r=await t.request({method:"eth_getRawTransactionByHash",params:[e]},{dedupe:!0});if(!r)throw new Yl({hash:e});return r}async function _4(t,{address:e,blockHash:r,blockNumber:n,blockTag:i="latest",requireCanonical:s,slot:o}){const a=Ji({blockHash:r,blockNumber:n,blockTag:i,requireCanonical:s});return await t.request({method:"eth_getStorageAt",params:[e,o,a]})}async function F0(t,{blockHash:e,blockNumber:r,blockTag:n,hash:i,index:s,sender:o,nonce:a}){const c=n||"latest",u=r!==void 0?W(r):void 0;let f=null;if(i?f=await t.request({method:"eth_getTransactionByHash",params:[i]},{dedupe:!0}):e?f=await t.request({method:"eth_getTransactionByBlockHashAndIndex",params:[e,W(s)]},{dedupe:!0}
67):(u||c)&&typeof s=="number"?f=await t.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[u||c,W(s)]},{dedupe:!!u}):o&&typeof a=="number"&&(f=await t.request({method:"eth_getTransactionBySenderAndNonce",params:[o,W(a)]},{dedupe:!0})),!f)throw new Yl({blockHash:e,blockNumber:r,blockTag:c,hash:i,index:s});return(t.chain?.formatters?.transaction?.format||xa)(f,"getTransaction")}async function I4(t,{hash:e,transactionReceipt:r}){const[n,i]=await Promise.all([te(t,Ia,"getBlockNumber")({}),e?te(t,F0,"getTransaction")({hash:e}):void 0]),s=r?.blockNumber||i?.blockNumber;return s?n-s+1n:0n}async function nc(t,{hash:e}){const r=await t.request({method:"eth_getTransactionReceipt",params:[e]},{dedupe:!0});if(!r)throw new A1({hash:e});return(t.chain?.formatters?.transactionReceipt?.format||ru)(r,"getTransactionReceipt")}async function N4(t,e){const{account:r,authorizationList:n,allowFailure:i=!0,blockHash:s,blockNumber:o,blockOverrides:a,blockTag:c,requireCanonical:u,stateOverride:f}=e,d=e.contracts,{batchSize:m=e.batchSize??1024,deployless:g=e.deployless??!1}=typeof t.batch?.multicall=="object"?t.batch.multicall:{},w=(()=>{if(e.multicallAddress)return e.multicallAddress;if(g)return null;if(t.chain)return ro({blockNumber:o,chain:t.chain,contract:"multicall3"});throw new Error("client chain not configured. multicallAddress is required.")})(),A=[[]];let k=0,_=0;for(let N=0;N<d.length;N++){const{abi:M,address:O,args:F,functionName:L}=d[N];try{const z=Lt({abi:M,args:F,functionName:L});_+=(z.length-2)/2,m>0&&_>m&&A[k].length>0&&(k++,_=(z.length-2)/2,A[k]=[]),A[k]=[...A[k],{allowFailure:!0,callData:z,target:O}]}catch(z){const D=qi(z,{abi:M,address:O,args:F,docsPath:"/docs/contract/multicall",functionName:L,sender:r});if(!i)throw D;A[k]=[...A[k],{allowFailure:!0,callData:"0x",target:O}]}}const B=await Promise.allSettled(A.map(N=>te(t,wt,"readContract")({...w===null?{code:b0}:{address:w},abi:zs,account:r,args:[N],authorizationList:n,blockHash:s,blockNumber:o,blockOverrides:a,blockTag:c,functionName:"aggregate3",requireCanonical:u,stateOverride:f}))),T=[];for(let N=0;N<B.length;N++){const M=B[N];if(M.status==="rejected"){if(!i)throw M.reason;for(let F=0;F<A[N].length;F++)T.push({status:"failure",error:M.reason,result:void 0});continue}const O=M.value;for(let F=0;F<O.length;F++){const{returnData:L,success:z}=O[F],{callData:D}=A[N][F],{abi:j,address:Q,functionName:E,args:l}=d[T.length];try{if(D==="0x")throw new da;if(!z)throw new jc({data:L});const p=si({abi:j,args:l,data:L,functionName:E});T.push(i?{result:p,status:"success"}:p)}catch(p){const b=qi(p,{abi:j,address:Q,args:l,docsPath:"/docs/contract/multicall",functionName:E});if(!i)throw b;T.push({error:b,result:void 0,status:"failure"})}}}if(T.length!==d.length)throw new q("multicall results mismatch");return T}async function ml(t,e){const{blockNumber:r,blockTag:n=t.experimental_blockTag??"latest",blocks:i,returnFullTransactions:s,traceTransfers:o,validation:a}=e;try{const c=[];for(const m of i){const g=m.blockOverrides?eg(m.blockOverrides):void 0,w=m.calls.map(k=>{const _=k,B=_.account?Ee(_.account):void 0,T=_.abi?Lt(_):_.data,N={..._,account:B,data:_.dataSuffix?Mr([T||"0x",_.dataSuffix]):T,from:_.from??B?.address};return Nn(N),ii(N)}),A=m.stateOverrides?e0(m.stateOverrides):void 0;c.push({blockOverrides:g,calls:w,stateOverrides:A})}const f=(typeof r=="bigint"?W(r):void 0)||n;return(await t.request({method:"eth_simulateV1",params:[{blockStateCalls:c,returnFullTransactions:s,traceTransfers:o,validation:a},f]})).map((m,g)=>({...n0(m),calls:m.calls.map((w,A)=>{const{abi:k,args:_,functionName:B,to:T}=i[g].calls[A],N=w.error?.data??w.returnData,M=BigInt(w.gasUsed),O=w.logs?.map(D=>rn(D)),F=w.status==="0x1"?"success":"failure",L=k&&F==="success"&&N!=="0x"?si({abi:k,data:N,functionName:B}):null,z=(()=>{if(F==="success")return;let D;if(N==="0x"?D=new da:N&&(D=new jc({data:N})),!!D)return qi(D,{abi:k??[],address:T??"0x",args:_,functionName:B??"<unknown>"})})();return{data:N,gasUsed:M,logs:O,status:F,...F==="success"?{result:L}:{error:z}}})}))}catch(c){const u=c,f=Hc(u,{});throw f instanceof va?u:f}}function gl(t){let e=!0,r="",n=0,i="",s=!1;for(let o=0;o<t.length;o++){const a=t[o];if(["(",")",","].includes(a)&&(e=!0),a==="("&&n++,a===")"&&n--,!!e){if(n===0){if(a===" "&&["event","function","error",""].includes(i))i="";else if(i+=a,a===")"){s=!0;break}continue}if(a===" "){t[o-1]!==","&&r!==","&&r!==",("&&(r="",e=!1);continue}i+=a,r+=a}}if(!s)throw new ue("Unable to normalize signature.");return i}function yl(t,e){const r=typeof t,n=e.type;switch(n){case"address":return cl(t,{strict:!1});case"bool":return r==="boolean";case"function":return r==="string";case"string":return r==="string";default:return n==="tuple"&&"components"in e?Object.values(e.components).every((i,s)=>yl(Object.values(t)[s],i)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(n)?r==="number"||r==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n)?r==="string"||t instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n)?Array.isArray(t)&&t.every(i=>yl(i,{...e,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function ay(t,e,r){for(const n in t){const i=t[n],s=e[n];if(i.type==="tuple"&&s.type==="tuple"&&"components"in i&&"components"in s)return ay(i.components,s.components,r[n]);const o=[i.type,s.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?cl(r[n],{strict:!1}):o.includes("address")&&o.includes("bytes")?cl(r[n],{strict:!1}):!1)return o}}function cy(t,e={}){const{prepare:r=!0}=e,n=Array.isArray(t)||typeof t=="string"?Xd(t):t;return{...n,...r?{hash:as(n)}:{}}}function su(t,e,r){const{args:n=[],prepare:i=!0}=r??{},s=lE(e,{strict:!1}),o=t.filter(u=>s?u.type==="function"||u.type==="error"?uy(u)===Qr(e,0,4):u.type==="event"?as(u)===e:!1:"name"in u&&u.name===e);if(o.length===0)throw new xc({name:e});if(o.length===1)return{...o[0],...i?{hash:as(o[0])}:{}};let a;for(const u of o){if(!("inputs"in u))continue;if(!n||n.length===0){if(!u.inputs||u.inputs.length===0)return{...u,...i?{hash:as(u)}:{}};continue}if(!u.inputs||u.inputs.length===0||u.inputs.length!==n.length)continue;if(n.every((d,m)=>{const g="inputs"in u&&u.inputs[m];return g?yl(d,g):!1}
vendor: 4,864 bytes, line 67
67)){if(a&&"inputs"in a&&a.inputs){const d=ay(u.inputs,a.inputs,n);if(d)throw new M4({abiItem:u,type:d[0]},{abiItem:a,type:d[1]})}a=u}}const c=(()=>{if(a)return a;const[u,...f]=o;return{...u,overloads:f}})();if(!c)throw new xc({name:e});return{...c,...i?{hash:as(c)}:{}}}function uy(...t){const e=(()=>{if(Array.isArray(t[0])){const[r,n]=t;return su(r,n)}return t[0]})();return Qr(as(e),0,4)}function k4(...t){const e=(()=>{if(Array.isArray(t[0])){const[n,i]=t;return su(n,i)}return t[0]})(),r=typeof e=="string"?e:pc(e);return gl(r)}function as(...t){const e=(()=>{if(Array.isArray(t[0])){const[r,n]=t;return su(r,n)}return t[0]})();return typeof e!="string"&&"hash"in e&&e.hash?e.hash:Ug(y0(k4(e)))}class M4 extends ue{constructor(e,r){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${e.type}\` in \`${gl(pc(e.abiItem))}\`, and`,`\`${r.type}\` in \`${gl(pc(r.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class xc extends ue{constructor({name:e,data:r,type:n="item"}){const i=e?` with name "${e}"`:r?` with data "${r}"`:"";super(`ABI ${n}${i} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}function T4(...t){const[e,r]=(()=>{if(Array.isArray(t[0])){const[s,o]=t;return[C4(s),o]}return t})(),{bytecode:n,args:i}=r;return Rr(n,e.inputs?.length&&i?.length?T0(e.inputs,i):"0x")}function R4(t){return cy(t)}function C4(t){const e=t.find(r=>r.type==="constructor");if(!e)throw new xc({name:"constructor"});return e}function B4(...t){const[e,r=[]]=(()=>{if(Array.isArray(t[0])){const[u,f,d]=t;return[Vh(u,f,{args:d}),d]}const[a,c]=t;return[a,c]})(),{overloads:n}=e,i=n?Vh([e,...n],e.name,{args:r}):e,s=O4(i),o=r.length>0?T0(i.inputs,r):void 0;return o?Rr(s,o):s}function Xi(t,e={}){return cy(t,e)}function Vh(t,e,r){const n=su(t,e,r);if(n.type!=="function")throw new xc({name:e,type:"function"});return n}function O4(t){return uy(t)}const F4="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",br="0x0000000000000000000000000000000000000000",$4="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function L4(t,e){const{blockNumber:r,blockTag:n,calls:i,stateOverrides:s,traceAssetChanges:o,traceTransfers:a,validation:c}=e,u=e.account?Ee(e.account):void 0;if(o&&!u)throw new q("`account` is required when `traceAssetChanges` is true");const f=u?T4(R4("constructor(bytes, bytes)"),{bytecode:sg,args:[$4,B4(Xi("function getBalance(address)"),[u.address])]}):void 0,d=o?await Promise.all(e.calls.map(async v=>{if(!v.data&&!v.abi)return;const{accessList:I}=await Pg(t,{account:u.address,...v,data:v.abi?Lt(v):v.data});return I.map(({address:R,storageKeys:P})=>P.length>0?R:null)})).then(v=>v.flat().filter(Boolean)):[],m=await ml(t,{blockNumber:r,blockTag:n,blocks:[...o?[{calls:[{data:f}],stateOverrides:s},{calls:d.map((v,I)=>({abi:[Xi("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:v,from:br,nonce:I})),stateOverrides:[{address:br,nonce:0}]}]:[],{calls:[...i,{to:br}].map(v=>({...v,from:u?.address})),stateOverrides:s},...o?[{calls:[{data:f}]},{calls:d.map((v,I)=>({abi:[Xi("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:v,from:br,nonce:I})),stateOverrides:[{address:br,nonce:0}]},{calls:d.map((v,I)=>({to:v,abi:[Xi("function decimals() returns (uint256)")],functionName:"decimals",from:br,nonce:I})),stateOverrides:[{address:br,nonce:0}]},{calls:d.map((v,I)=>({to:v,abi:[Xi("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:br,nonce:I})),stateOverrides:[{address:br,nonce:0}]},{calls:d.map((v,I)=>({to:v,abi:[Xi("function symbol() returns (string)")],functionName:"symbol",from:br,nonce:I})),stateOverrides:[{address:br,nonce:0}]}]:[]],traceTransfers:a,validation:c}),g=o?m[2]:m[0],[w,A,,k,_,B,T,N]=o?m:[],{calls:M,...O}=g,F=M.slice(0,-1)??[],L=w?.calls??[],z=A?.calls??[],D=[...L,...z].map(v
67=>v.status==="success"?bt(v.data):null),j=k?.calls??[],Q=_?.calls??[],E=[...j,...Q].map(v=>v.status==="success"?bt(v.data):null),l=(B?.calls??[]).map(v=>v.status==="success"?v.result:null),p=(N?.calls??[]).map(v=>v.status==="success"?v.result:null),b=(T?.calls??[]).map(v=>v.status==="success"?v.result:null),x=[];for(const[v,I]of E.entries()){const R=D[v];if(typeof I!="bigint"||typeof R!="bigint")continue;const P=l[v-1],h=p[v-1],S=b[v-1],Z=v===0?{address:F4,decimals:18,symbol:"ETH"}:{address:d[v-1],decimals:S||P?Number(P??1):void 0,symbol:h??void 0};x.some(y=>y.token.address===Z.address)||x.push({token:Z,value:{pre:R,post:I,diff:I-R}})}return{assetChanges:x,block:O,results:F}}const fy="0x6492649264926492649264926492649264926492649264926492649264926492";function U4(t){if(Qr(t,-32)!==fy)throw new q4(t)}function D4(t){const{data:e,signature:r,to:n}=t;return Rr(T0(qg("address, bytes, bytes"),[n,e,r]),fy)}function z4(t){try{return U4(t),!0}catch{return!1}}class q4 extends ue{constructor(e){super(`Value \`${e}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}function j4({r:t,s:e,to:r="hex",v:n,yParity:i}){const s=(()=>{if(i===0||i===1)return i;if(n&&(n===27n||n===28n||n>=35n))return n%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),o=`0x${new ny.Signature(bt(t),bt(e)).toCompactHex()}${s===0?"1b":"1c"}`;return r==="hex"?o:Xr(o)}async function ou(t,e){const{address:r,chain:n=t.chain,hash:i,erc6492VerifierAddress:s=e.universalSignatureVerifierAddress??n?.contracts?.erc6492Verifier?.address,multicallAddress:o=e.multicallAddress??n?.contracts?.multicall3?.address,mode:a="auto"}=e;if(n?.verifyHash)return await n.verifyHash(t,e);const c=(()=>{const u=e.signature;return kr(u)?u:typeof u=="object"&&"r"in u&&"s"in u?j4(u):pt(u)})();try{if(a==="eoa")try{if(tn($s(r),await Vf({hash:i,signature:c})))return!0}catch{}return b4(c)?await G4(t,{...e,multicallAddress:o,signature:c}):await H4(t,{...e,verifierAddress:s,signature:c})}catch(u){if(a!=="eoa")try{if(tn($s(r),await Vf({hash:i,signature:c})))return!0}catch{}if(u instanceof Ki)return!1;throw u}}async function G4(t,e){const{address:r,blockNumber:n,blockTag:i,hash:s,multicallAddress:o}=e,{authorization:a,data:c,signature:u,to:f}=y4(e.signature);if(await vc(t,{address:r,blockNumber:n,blockTag:i})===Pt(["0xef0100",a.address]))return await V4(t,{address:r,blockNumber:n,blockTag:i,hash:s,signature:u});const m={address:a.address,chainId:Number(a.chainId),nonce:Number(a.nonce),r:W(a.r,{size:32}),s:W(a.s,{size:32}),yParity:a.yParity};if(!await k8({address:r,authorization:m}))throw new Ki;const w=await te(t,wt,"readContract")({...o?{address:o}:{code:b0},authorizationList:[m],abi:zs,blockNumber:n,blockTag:"pending",functionName:"aggregate3",args:[[...c?[{allowFailure:!0,target:f??r,callData:c}]:[],{allowFailure:!0,target:r,callData:Lt({abi:ig,functionName:"isValidSignature",args:[s,u]})}]]});if(w[w.length-1]?.returnData?.startsWith("0x1626ba7e"))return!0;throw new Ki}async function H4(t,e){const{address:r,factory:n,factoryData:i,hash:s,signature:o,verifierAddress:a,...c}=e,u=await(async()=>!n&&!i||z4(o)?o:D4({data:i,signature:o,to:n}))(),f=a?{to:a,data:Lt({abi:Mh,functionName:"isValidSig",args:[r,s,u]}),...c}:{data:Zc({abi:Mh,args:[r,s,u],bytecode:bE}),...c},{data:d}=await te(t,no,"call")(f).catch(m=>{throw m instanceof E1?new Ki:m});if(L5(d??"0x0"))return!0;throw new Ki}async function V4(t,e){const{address:r,blockNumber:n,blockTag:i,hash:s,signature:o}=e;if((await te(t,wt,"readContract")({address:r,abi:ig,args:[s,o],blockNumber:n,blockTag:i,functionName:"isValidSignature"}).catch(c=>{throw c instanceof P1?new Ki:c})).startsWith("0x1626ba7e"))return!0;throw new Ki}
67class Ki extends Error{}async function K4(t,{address:e,message:r,factory:n,factoryData:i,signature:s,...o}){const a=Mg(r);return te(t,ou,"verifyHash")({address:e,factory:n,factoryData:i,hash:a,signature:s,...o})}async function W4(t,e){const{address:r,factory:n,factoryData:i,signature:s,message:o,primaryType:a,types:c,domain:u,...f}=e,d=X8({message:o,primaryType:a,types:c,domain:u});return te(t,ou,"verifyHash")({address:r,factory:n,factoryData:i,hash:d,signature:s,...f})}function ly(t,{emitOnBegin:e=!1,emitMissed:r=!1,onBlockNumber:n,onError:i,poll:s,pollingInterval:o=t.pollingInterval}){const a=typeof s<"u"?s:!(t.transport.type==="webSocket"||t.transport.type==="ipc"||t.transport.type==="fallback"&&(t.transport.transports[0].config.type==="webSocket"||t.transport.transports[0].config.type==="ipc"));let c;return a?(()=>{const d=ut(["watchBlockNumber",t.uid,e,r,o]);return Pn(d,{onBlockNumber:n,onError:i},m=>io(async()=>{try{const g=await te(t,Ia,"getBlockNumber")({cacheTime:0});if(c!==void 0){if(g===c)return;if(g-c>1&&r)for(let w=c+1n;w<g;w++)m.onBlockNumber(w,c),c=w}(c===void 0||g>c)&&(m.onBlockNumber(g,c),c=g)}catch(g){m.onError?.(g)}},{emitOnBegin:e,interval:o}))})():(()=>{const d=ut(["watchBlockNumber",t.uid,e,r]);return Pn(d,{onBlockNumber:n,onError:i},m=>{let g=!0,w=()=>g=!1;return(async()=>{try{const A=(()=>{if(t.transport.type==="fallback"){const _=t.transport.transports.find(B=>B.config.type==="webSocket"||B.config.type==="ipc");return _?_.value:t.transport}return t.transport})(),{unsubscribe:k}=await A.subscribe({params:["newHeads"],onData(_){if(!g)return;const B=bt(_.result?.number);m.onBlockNumber(B,c),c=B},onError(_){m.onError?.(_)}});w=k,g||w()}catch(A){i?.(A)}})(),()=>w()})})()}async function dy(t,e){const{checkReplacement:r=!0,confirmations:n=1,hash:i,onReplaced:s,retryCount:o=6,retryDelay:a=({count:M})=>~~(1<<M)*200,timeout:c=18e4}=e,u=ut(["waitForTransactionReceipt",t.uid,i]),f=e.pollingInterval?e.pollingInterval:t.chain?.experimental_preconfirmationTime?t.chain.experimental_preconfirmationTime:t.pollingInterval;let d,m,g,w=!1,A,k;const{promise:_,resolve:B,reject:T}=w0(),N=c?setTimeout(()=>{k?.(),A?.(),T(new Xx({hash:i}))},c):void 0;return A=Pn(u,{onReplaced:s,resolve:B,reject:T},async M=>{if(g=await te(t,nc,"getTransactionReceipt")({hash:i}).catch(()=>{}),g&&n<=1){clearTimeout(N),M.resolve(g),A?.();return}k=te(t,ly,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:f,async onBlockNumber(O){const F=z=>{clearTimeout(N),k?.(),z(),A?.()};let L=O;if(!w)try{if(g){if(n>1&&(!g.blockNumber||L-g.blockNumber+1n<n))return;F(()=>M.resolve(g));return}if(r&&!d&&(w=!0,await wc(async()=>{d=await te(t,F0,"getTransaction")({hash:i}),d.blockNumber&&(L=d.blockNumber)},{delay:a,retryCount:o}),w=!1),g=await te(t,nc,"getTransactionReceipt")({hash:i}),n>1&&(!g.blockNumber||L-g.blockNumber+1n<n))return;F(()=>M.resolve(g))}catch(z){if(z instanceof Yl||z instanceof A1){if(!d){w=!1;return}try{m=d,w=!0;const D=await wc(()=>te(t,_r,"getBlock")({blockNumber:L,includeTransactions:!0}),{delay:a,retryCount:o,shouldRetry:({error:E})=>E instanceof r0});w=!1;const j=D.transactions.find(({from:E,nonce:l})=>E===m.from&&l===m.nonce);if(!j||(g=await te(t,nc,"getTransactionReceipt")({hash:j.hash}),n>1&&(!g.blockNumber||L-g.blockNumber+1n<n)))return;let Q="replaced";j.to===m.to&&j.value===m.value&&j.input===m.input?Q="repriced":j.from===j.to&&j.value===0n&&(Q="cancelled"),F(()=>{M.onReplaced?.({reason:Q,replacedTransaction:m,transaction:j,transactionReceipt:g}),M.resolve(g)})}catch(D){F(()=>M.reject(D))}}else F(()=>M.reject(z))}}})}),_}function Q4(t,{blockTag:e=t.experimental_blockTag??"latest",emitMissed:r=!1,emitOnBegin:n=!1,onBlock:i,onError:s,includeTransactions:o,poll:a,pollingInterval:c=t.pollingInterval}){const u=typeof a<"u"?a:!(t.transport.type==="webSocket"||t.transport.type==="ipc"||t.transport.type==="fallback"&&(t.transport.transports[0].c
67onfig.type==="webSocket"||t.transport.transports[0].config.type==="ipc")),f=o??!1;let d;return u?(()=>{const w=ut(["watchBlocks",t.uid,e,r,n,f,c]);return Pn(w,{onBlock:i,onError:s},A=>io(async()=>{try{const k=await te(t,_r,"getBlock")({blockTag:e,includeTransactions:f});if(k.number!==null&&d?.number!=null){if(k.number===d.number)return;if(k.number-d.number>1&&r)for(let _=d?.number+1n;_<k.number;_++){const B=await te(t,_r,"getBlock")({blockNumber:_,includeTransactions:f});A.onBlock(B,d),d=B}}(d?.number==null||e==="pending"&&k?.number==null||k.number!==null&&k.number>d.number)&&(A.onBlock(k,d),d=k)}catch(k){A.onError?.(k)}},{emitOnBegin:n,interval:c}))})():(()=>{let w=!0,A=!0,k=()=>w=!1;return(async()=>{try{n&&te(t,_r,"getBlock")({blockTag:e,includeTransactions:f}).then(T=>{w&&A&&(i(T,void 0),A=!1)}).catch(s);const _=(()=>{if(t.transport.type==="fallback"){const T=t.transport.transports.find(N=>N.config.type==="webSocket"||N.config.type==="ipc");return T?T.value:t.transport}return t.transport})(),{unsubscribe:B}=await _.subscribe({params:["newHeads"],async onData(T){if(!w)return;const N=await te(t,_r,"getBlock")({blockNumber:T.result?.number,includeTransactions:f}).catch(()=>{});w&&(i(N,d),A=!1,d=N)},onError(T){s?.(T)}});k=B,w||k()}catch(_){s?.(_)}})(),()=>k()})()}function J4(t,{address:e,args:r,batch:n=!0,event:i,events:s,fromBlock:o,onError:a,onLogs:c,poll:u,pollingInterval:f=t.pollingInterval,strict:d}){const m=typeof u<"u"?u:typeof o=="bigint"?!0:!(t.transport.type==="webSocket"||t.transport.type==="ipc"||t.transport.type==="fallback"&&(t.transport.transports[0].c
67onfig.type==="webSocket"||t.transport.transports[0].config.type==="ipc")),g=d??!1;return m?(()=>{const k=ut(["watchEvent",e,r,n,t.uid,i,f,o]);return Pn(k,{onLogs:c,onError:a},_=>{let B;o!==void 0&&(B=o-1n);let T,N=!1;const M=io(async()=>{if(!N){try{T=await te(t,Sg,"createEventFilter")({address:e,args:r,event:i,events:s,strict:g,fromBlock:o})}catch{}N=!0;return}try{let O;if(T)O=await te(t,Xc,"getFilterChanges")({filter:T});else{const F=await te(t,Ia,"getBlockNumber")({});B&&B!==F?O=await te(t,h0,"getLogs")({address:e,args:r,event:i,events:s,fromBlock:B+1n,toBlock:F}):O=[],B=F}if(O.length===0)return;if(n)_.onLogs(O);else for(const F of O)_.onLogs([F])}catch(O){T&&O instanceof Xn&&(N=!1),_.onError?.(O)}},{emitOnBegin:!0,interval:f});return async()=>{T&&await te(t,eu,"uninstallFilter")({filter:T}),M()}})})():(()=>{let k=!0,_=()=>k=!1;return(async()=>{try{const B=(()=>{if(t.transport.type==="fallback"){const O=t.transport.transports.find(F=>F.config.type==="webSocket"||F.config.type==="ipc");return O?O.value:t.transport}return t.transport})(),T=s??(i?[i]:void 0);let N=[];T&&(N=[T.flatMap(F=>ma({abi:[F],eventName:F.name,args:r}))],i&&(N=N[0]));const{unsubscribe:M}=await B.subscribe({params:["logs",{address:e,topics:N}],onData(O){if(!k)return;const F=O.result;try{const{eventName:L,args:z}=gc({abi:T??[],data:F.data,topics:F.topics,strict:g}),D=rn(F,{args:z,eventName:L});c([D])}catch(L){let z,D;if(L instanceof mc||L instanceof jl){if(d)return;z=L.abiItem.name,D=L.abiItem.inputs?.some(Q=>!("name"in Q&&Q.name))}const j=rn(F,{args:D?[]:{},eventName:z});c([j])}},onError(O){a?.(O)}});_=M,k||_()}catch(B){a?.(B)}})(),()=>_()})()}function Y4(t,{batch:e=!0,onError:r,onTransactions:n,poll:i,pollingInterval:s=t.pollingInterval}){return(typeof i<"u"?i:t.transport.type!=="webSocket"&&t.transport.type!=="ipc")?(()=>{const u=ut(["watchPendingTransactions",t.uid,e,s]);return Pn(u,{onTransactions:n,onError:r},f=>{let d;const m=io(async()=>{try{if(!d)try{d=await te(t,_g,"createPendingTransactionFilter")({});return}catch(w){throw m(),w}const g=await te(t,Xc,"getFilterChanges")({filter:d});if(g.length===0)return;if(e)f.onTransactions(g);else for(const w of g)f.onTransactions([w])}catch(g){f.onError?.(g)}},{emitOnBegin:!0,interval:s});return async()=>{d&&await te(t,eu,"uninstallFilter")({filter:d}),m()}})})():(()=>{let u=!0,f=()=>u=!1;return(async()=>{try{const{unsubscribe:d}=await t.transport.subscribe({params:["newPendingTransactions"],onData(m){if(!u)return;const g=m.result;n([g])},onError(m){r?.(m)}});f=d,u||f()}catch(d){r?.(d)}})(),()=>f()})()}function Z4(t){const{scheme:e,statement:r,...n}=t.match(X4)?.groups??{},{chainId:i,expirationTime:s,issuedAt:o,notBefore:a,requestId:c,...u}=t.match(eP)?.groups??{},f=t.split("Resources:")[1]?.split(`
68- `).slice(1);return{...n,...u,...i?{chainId:Number(i)}:{},...s?{expirationTime:new Date(s)}:{},...o?{issuedAt:new Date(o)}:{},...a?{notBefore:new Date(a)}:{},...c?{requestId:c}:{},...f?{resources:f}:{},...e?{scheme:e}:{},...r?{statement:r}:{}}}const X4=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,eP=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;function tP(t){const{address:e,domain:r,message:n,nonce:i,scheme:s,time:o=new Date}=t;if(r&&n.domain!==r||i&&n.nonce!==i||s&&n.scheme!==s||n.expirationTime&&o>=n.expirationTime||n.notBefore&&o<n.notBefore)return!1;try{if(!n.address||!ft(n.address,{strict:!1})||e&&!tn(n.address,e))return!1}catch{return!1}return!0}async function rP(t,e){const{address:r,domain:n,message:i,nonce:s,scheme:o,signature:a,time:c=new Date,...u}=e,f=Z4(i);if(!f.address||!tP({address:r,domain:n,message:f,nonce:s,scheme:o,time:c}))return!1;const m=Mg(i);return ou(t,{address:f.address,hash:m,signature:a,...u})}function $0(t,e){return{amount:t,decimals:e,formatted:ya(t,e)}}function hy(t,e){if(typeof t=="bigint")return t;const r=t.decimals??e;return x4(t.formatted,nP(r))}function nP(t){if(t===void 0)throw new Error("Token decimals are required. Pass `amount.decimals` or select a declared token.");return t}function py(t,e){return typeof t=="bigint"?e:t.decimals??e}function kn(t,e){const{decimals:r,token:n}=e,i=my(t,n);if(i)return{address:i.address,decimals:r??i.decimals};if(ft(n,{strict:!1}))return{address:n,decimals:r??sP(t,n)};throw new Error(`Token "${n}" is not a declared ERC-20 token on the client's \`tokens\` array (with an address for the client's chain), and is not a valid address.`)}function my(t,e){const r=t.tokens,n=t.chain?.id;if(!r||n===void 0)return;const i=iP(r,e);if(i)return bl(i,n);if(ft(e,{strict:!1}))for(const s of r){const o=bl(s,n);if(o&&tn(o.address,e))return o}}function bl(t,e){const r=t.addresses[e];if(r)return{address:r,currency:t.currency,decimals:t.decimals,name:t.name,popular:t.popular,symbol:t.symbol}}function iP(t,e){const r=e.toLowerCase();for(const n of t)if(n.symbol?.toLowerCase()===r)return n}function sP(t,e){const r=t.tokens,n=t.chain?.id;if(r&&n!==void 0)for(const i of r){const s=bl(i,n);if(s&&tn(s.address,e))return s.decimals}}async function L0(t,e){const{address:r,decimals:n}=kn(t,e);return n!==void 0?{address:r,decimals:n}:{address:r,decimals:await wt(t,{abi:lr,address:r,functionName:"decimals"})}}function Ac(t){const{account:e,chain:r,gas:n,maxFeePerGas:i,maxPriorityFeePerGas:s,nonce:o}=t;return{account:e,chain:r,gas:n,maxFeePerGas:i,maxPriorityFeePerGas:s,nonce:o}}function Ma(t){return{...t,data:Lt(t),to:t.address}}async function qs(t,e){return qs.inner(Vi,t,e)}(function(t){async function e(o,a,c){return await o(a,{...c,...t.call(a,c)})}t.inner=e;function r(o,a){return Ma(oP(o,a))}t.call=r;async function n(o,a){return d0(o,{...Ac(a),...t.call(o,a)})}t.estimateGas=n;async function i(o,a){return v0(o,{...Ac(a),...t.call(o,a)})}t.simulate=i;function s(o){const[a]=Ea({abi:lr,logs:o,eventName:"Approval",strict:!0});if(!a)throw new Error("`Approval` event not found.");return a}t.extractEvent=s}
68)(qs||(qs={}));function oP(t,e){const{amount:r,spender:n,token:i}=e,{address:s,decimals:o}=kn(t,{token:i});return{abi:lr,address:s,args:[n,hy(r,o)],functionName:"approve"}}async function U0(t,{serializedTransaction:e,throwOnReceiptRevert:r,timeout:n}){const i=await t.request({method:"eth_sendRawTransactionSync",params:n?[e,n]:[e]},{retryCount:0}),o=(t.chain?.formatters?.transactionReceipt?.format||ru)(i);if(o.status==="reverted"&&r)throw new Gf({receipt:o});return o}const ff=new eo(128);async function gy(t,e){const{account:r=t.account,assertChainId:n=!0,chain:i=t.chain,accessList:s,authorizationList:o,blobs:a,data:c,dataSuffix:u=typeof t.dataSuffix=="string"?t.dataSuffix:t.dataSuffix?.value,gas:f,gasPrice:d,maxFeePerBlobGas:m,maxFeePerGas:g,maxPriorityFeePerGas:w,nonce:A,pollingInterval:k,throwOnReceiptRevert:_,type:B,value:T,...N}=e,M=e.timeout??Math.max((i?.blockTime??0)*3,5e3);if(typeof r>"u")throw new sn({docsPath:"/docs/actions/wallet/sendTransactionSync"});const O=r?Ee(r):null;let F;try{Nn(e);const L=await(async()=>{if(e.to)return e.to;if(e.to!==null&&o&&o.length>0)return await Gc({authorization:o[0]}).catch(()=>{throw new q("`to` is required. Could not infer from `authorizationList`.")})})();if(O?.type==="json-rpc"||O===null){let z;i!==null&&(z=await te(t,en,"getChainId")({}),n&&x0({currentChainId:z,chain:i}));const D=t.chain?.formatters?.transactionRequest?.format,Q=(D||ii)({...to(N,{format:D}),accessList:s,account:O,authorizationList:o,blobs:a,chainId:z,data:u?Mr([c??"0x",u]):c,gas:f,gasPrice:d,maxFeePerBlobGas:m,maxFeePerGas:g,maxPriorityFeePerGas:w,nonce:A,to:L,type:B,value:T},"sendTransaction"),E=ff.get(t.uid),l=E?"wallet_sendTransaction":"eth_sendTransaction",p=await(async()=>{try{return await t.request({method:l,params:[Q]},{retryCount:0})}catch(x){if(E===!1)throw x;const v=x;if(v.name==="InvalidInputRpcError"||v.name==="InvalidParamsRpcError"||v.name==="MethodNotFoundRpcError"||v.name==="MethodNotSupportedRpcError")return await t.request({method:"wallet_sendTransaction",params:[Q]},{retryCount:0}).then(I=>(ff.set(t.uid,!0),I)).catch(I=>{const R=I;throw R.name==="MethodNotFoundRpcError"||R.name==="MethodNotSupportedRpcError"?(ff.set(t.uid,!1),v):R});throw v}})(),b=await te(t,dy,"waitForTransactionReceipt")({checkReplacement:!1,hash:p,pollingInterval:k,timeout:M});if(_&&b.status==="reverted")throw new Gf({receipt:b});return b}if(O?.type==="local"){if(O.nonceManager&&typeof A>"u"){const Q=N.chainId,E=await(async()=>typeof Q=="number"?Q:i?i.id:te(t,en,"getChainId")({}))();F={address:O.address,chainId:E}}const z=await te(t,Aa,"prepareTransactionRequest")({account:O,accessList:s,authorizationList:o,blobs:a,chain:i,data:u?Mr([c??"0x",u]):c,gas:f,gasPrice:d,maxFeePerBlobGas:m,maxFeePerGas:g,maxPriorityFeePerGas:w,nonce:A,nonceManager:O.nonceManager,parameters:[...f0,"sidecars"],type:B,value:T,...N,to:L}),D=i?.serializers?.transaction,j=await O.signTransaction(z,{serializer:D});return await te(t,U0,"sendRawTransactionSync")({serializedTransaction:j,throwOnReceiptRevert:_,timeout:e.timeout})}throw O?.type==="smart"?new Oi({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new Oi({docsPath:"/docs/actions/wallet/sendTransactionSync",type:O?.type})}catch(L){throw L instanceof Oi?L:(F&&!(L instanceof Gf)&&O?.nonceManager?.reset(F),Kc(L,{...e,account:O,chain:e.chain||void 0}))}}async function D0(t,e){return Vi.internal(t,gy,"sendTransactionSync",e)}async function aP(t,e){const{amount:r,token:n,throwOnReceiptRevert:i=!0}=e,{decimals:s}=kn(t,{token:n}),o=py(r,s),a=await qs.inner(D0,t,{...e,throwOnReceiptRevert:i}),{args:c}=qs.extractEvent(a.logs);return{...c,...o===void 0?{}:{decimals:o,formatted:ya(c.value,o)},receipt:a}}async function Ec(t,e){const{account:r,decimals:n,spender:i,token:s,...o}=e,[a,{decimals:c}]=await Promise.all([wt(t,{...o,...Ec.call(t,{account:r,spender:i,token:s})}),L0(t,{decimals:n,token:s})]);return $0(a,c)}(function(t){function e(r,n){return Ma({address:kn(r,n).address,abi:lr,functionName:"allowance",args:[n.account,n.spender]})}t.call=e})(Ec||(Ec={}));async function Pc(t,e){const{account:r=t.account,decimals:n,token:i,...s}=e;if(!r)throw new sn;const o=Ee(r).address,[a,{decimals:c}]=await Promise.all([wt(t,{...s,...Pc.call(t,{account:o,token:i})}),L0(t,{decimals:n,token:i})]);return $0(a,c)}(function(t){function e(r,n){const i=n.account??r.account;if(!i)throw new sn;const s=Ee(i).address;return Ma({address:kn(r,n).address,abi:lr,functionName:"balanceOf",args:[s]})}t.call=e})(Pc||(Pc={}));async function cP(t,e){const{token:r,...n}=e,{address:i}=kn(t,{token:r}),s=my(t,r),[o,a,c]=await Promise.all([s?.decimals??wt(t,{...n,abi:lr,address:i,functionName:"decimals"}),s?.name??wt(t,{...n,abi:lr,address:i,functionName:"name"}),s?.symbol??wt(t,{...n,abi:lr,address:i,functionName:"symbol"})]);return{decimals:o,name:a,symbol:c}}async function Sc(t,e){const{decimals:r,token:n,...i}=e,[s,{decimals:o}]=await Promise.all([wt(t,{...i,...Sc.call(t,{token:n})}),L0(t,{decimals:r,token:n})]);return $0(s,o)}(function(t){function e(r,n){return Ma({address:kn(r,n).address,abi:lr,args:[],functionName:"totalSupply"})}t.call=e})(Sc||(Sc={}));async function js(t,e){return js.inner(Vi,t,e)}(function(t){async function e(o,a,c){return await o(a,{...c,...t.call(a,c)})}t.inner=e;function r(o,a){return Ma(uP(o,a))}t.call=r;async function n(o,a){return d0(o,{...Ac(a),...t.call(o,a)})}t.estimateGas=n;async function i(o,a){return v0(o,{...Ac(a),...t.call(o,a)})}t.simulate=i;function s(o){const[a]=Ea({abi:lr,logs:o,eventName:"Transfer",strict:!0});if(!a)throw new Error("`Transfer` event not found.");return a}t.extractEvent=s})(js||(js={}));function uP(t,e){const{amount:r,from:n,to:i,token:s}=e,{address:o,decimals:a}=kn(t,{token:s}),c=hy(r,a);return n?{abi:lr,address:o,args:[n,i,c],functionName:"transferFrom"}:{abi:lr,address:o,args:[i,c],functionName:"transfer"}}async function fP(t,e){const{amount:r,token:n,throwOnReceiptRevert:i=!0}
68=e,{decimals:s}=kn(t,{token:n}),o=py(r,s),a=await js.inner(D0,t,{...e,throwOnReceiptRevert:i}),{args:c}=js.extractEvent(a.logs);return{...c,...o===void 0?{}:{decimals:o,formatted:ya(c.value,o)},receipt:a}}function lP(t){return{call:e=>no(t,e),createAccessList:e=>Pg(t,e),createBlockFilter:()=>o8(t),createContractEventFilter:e=>y1(t,e),createEventFilter:e=>Sg(t,e),createPendingTransactionFilter:()=>_g(t),estimateContractGas:e=>d0(t,e),estimateGas:e=>l0(t,e),getBalance:e=>a8(t,e),getBlobBaseFee:()=>c8(t),getBlock:e=>_r(t,e),getBlockNumber:e=>Ia(t,e),getBlockReceipts:e=>u8(t,e),getBlockTransactionCount:e=>f8(t,e),getBytecode:e=>vc(t,e),getChainId:()=>en(t),getCode:e=>vc(t,e),getContractEvents:e=>L1(t,e),getDelegation:e=>l8(t,e),getEip712Domain:e=>h8(t,e),getEnsAddress:e=>jE(t,e),getEnsAvatar:e=>n8(t,e),getEnsName:e=>i8(t,e),getEnsResolver:e=>s8(t,e),getEnsText:e=>Eg(t,e),getFeeHistory:e=>g8(t,e),estimateFeesPerGas:e=>xA(t,e),getFilterChanges:e=>Xc(t,e),getFilterLogs:e=>y8(t,e),getGasPrice:()=>i0(t),getLogs:e=>h0(t,e),getProof:e=>P4(t,e),estimateMaxPriorityFeePerGas:e=>vA(t,e),fillTransaction:e=>u0(t,e),getRawTransaction:e=>S4(t,e),getStorageAt:e=>_4(t,e),getTransaction:e=>F0(t,e),getTransactionConfirmations:e=>I4(t,e),getTransactionCount:e=>s0(t,e),getTransactionReceipt:e=>nc(t,e),multicall:e=>N4(t,e),prepareTransactionRequest:e=>Aa(t,e),readContract:e=>wt(t,e),sendRawTransaction:e=>A0(t,e),sendRawTransactionSync:e=>U0(t,e),simulate:e=>ml(t,e),simulateBlocks:e=>ml(t,e),simulateCalls:e=>L4(t,e),simulateContract:e=>v0(t,e),verifyHash:e=>ou(t,e),verifyMessage:e=>K4(t,e),verifySiweMessage:e=>rP(t,e),verifyTypedData:e=>W4(t,e),uninstallFilter:e=>eu(t,e),waitForTransactionReceipt:e=>dy(t,e),watchBlocks:e=>Q4(t,e),watchBlockNumber:e=>ly(t,e),watchContractEvent:e=>BE(t,e),watchEvent:e=>J4(t,e),watchPendingTransactions:e=>Y4(t,e),token:dP(t)}}function dP(t){return{getAllowance:Qn(t,Ec),getBalance:Qn(t,Pc),getMetadata:Qn(t,cP),getTotalSupply:Qn(t,Sc)}}function l9(t){const{key:e="public",name:r="Public Client"}=t;return bg({...t,key:e,name:r,type:"publicClient"}).extend(lP)}async function hP(t,{chain:e}){const{id:r,name:n,nativeCurrency:i,rpcUrls:s,blockExplorers:o}=e;await t.request({method:"wallet_addEthereumChain",params:[{chainId:W(r),chainName:n,nativeCurrency:i,rpcUrls:s.default.http,blockExplorerUrls:o?Object.values(o).map(({url:a})=>a):void 0}]},{dedupe:!0,retryCount:0})}function pP(t,e){const{abi:r,args:n,bytecode:i,...s}=e,o=Zc({abi:r,args:n,bytecode:i});return tu(t,{...s,...s.authorizationList?{to:null}:{},data:o})}async function mP(t){return t.account?.type==="local"?[t.account.address]:(await t.request({method:"eth_accounts"},{dedupe:!0})).map(r=>ha(r))}async function gP(t,e={}){const{account:r=t.account,chainId:n}=e,i=r?Ee(r):void 0,s=n?[i?.address,[W(n)]]:[i?.address],o=await t.request({method:"wallet_getCapabilities",params:s}),a={};for(const[c,u]of Object.entries(o)){a[Number(c)]={};for(let[f,d]of Object.entries(u))f==="addSubAccount"&&(f="unstable_addSubAccount"),a[Number(c)][f]=d}return typeof n=="number"?a[n]:a}async function yP(t){return await t.request({method:"wallet_getPermissions"},{dedupe:!0})}async function yy(t,e){const{account:r=t.account,chainId:n,nonce:i}=e;if(!r)throw new sn({docsPath:"/docs/eip7702/prepareAuthorization"});const s=Ee(r),o=(()=>{if(e.executor)return e.executor==="self"?e.executor:Ee(e.executor)})(),a={address:e.contractAddress??e.address,chainId:n,nonce:i};return typeof a.chainId>"u"&&(a.chainId=t.chain?.id??await te(t,en,"getChainId")({})),typeof a.nonce>"u"&&(a.nonce=await te(t,s0,"getTransactionCount")({address:s.address,blockTag:"pending"}),(o==="self"||o?.address&&tn(o.address,s.address))&&(a.nonce+=1)),a}async function bP(t){return(await t.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(r=>$s(r))}async function wP(t,e){return t.request({method:"wallet_requestPermissions",params:[e]},{retryCount:0})}async function vP(t,e){const{chain:r=t.chain}=e,n=e.timeout??Math.max((r?.blockTime??0)*3,5e3),i=await te(t,pg,"sendCalls")(e);return await te(t,gg,"waitForCallsStatus")({...e,id:i.id,timeout:n})}async function xP(t,e){const{id:r}=e;await t.request({method:"wallet_showCallsStatus",params:[r]})}async function AP(t,e){const{account:r=t.account}=e;if(!r)throw new sn({docsPath:"/docs/eip7702/signAuthorization"});const n=Ee(r);if(!n.signAuthorization)throw new Oi({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:n.type});const i=await yy(t,e);return n.signAuthorization(i)}async function EP(t,{account:e=t.account,message:r}){if(!e)throw new sn({docsPath:"/docs/actions/wallet/signMessage"});const n=Ee(e);if(n.signMessage)return n.signMessage({message:r});const i=typeof r=="string"?No(r):r.raw instanceof Uint8Array?Ht(r.raw):r.raw;return t.request({method:"personal_sign",params:[i,n.address]},{retryCount:0})}async function PP(t,e){const{account:r=t.account,chain:n=t.chain,...i}=e;if(!r)throw new sn({docsPath:"/docs/actions/wallet/signTransaction"});const s=Ee(r);Nn({account:s,...e});const o=await te(t,en,"getChainId")({});n!==null&&x0({currentChainId:o,chain:n});const c=(n?.formatters||t.chain?.formatters)?.transactionRequest?.format||ii;return s.signTransaction?s.signTransaction({...i,account:s,chainId:o},{serializer:t.chain?.serializers?.transaction}):await t.request({method:"eth_signTransaction",params:[{...c({...i,account:s},"signTransaction"),chainId:W(o),from:s.address}]},{retryCount:0})}async function SP(t,e){const{account:r=t.account,domain:n,message:i,primaryType:s}=e;if(!r)throw new sn({docsPath:"/docs/actions/wallet/signTypedData"});const o=Ee(r),a={EIP712Domain:Rg({domain:n}),...e.types};if(Tg({domain:n,message:i,primaryType:s,types:a}),o.signTypedData)return o.signTypedData({domain:n,message:i,primaryType:s,types:a});const c=Y8({domain:n,message:i,primaryType:s,types:a});return t.request({method:"eth_signTypedData_v4",params:[o.address,c]},{retryCount:0})}async function _P(t,{id:e}){await t.request({method:"wallet_switchEthereumChain",params:[{chainId:W(e)}]},{retryCount:0})}async function IP(t,e){return await t.request({method:"wallet_watchAsset",params:e},{retryCount:0})}function NP(t){return{addChain:e=>hP(t,e),deployContract:e=>pP(t,e),fillTransaction:e=>u0(t,e),getAddresses:()=>mP(t),getCallsStatus:e=>mg(t,e),getCapabilities:e=>gP(t,e),getChainId:()=>en(t),getPermissions:()=>yP(t),prepareAuthorization:e=>yy(t,e),prepareTransactionRequest:e=>Aa(t,e),requestAddresses:()=>bP(t),requestPermissions:e=>wP(t,e),sendCalls:e=>pg(t,e),sendCallsSync:e=>vP(t,e),sendRawTransaction:e=>A0(t,e),sendRawTransactionSync:e=>U0(t,e),sendTransaction:e=>tu(t,e),sendTransactionSync:e=>gy(t,e),showCallsStatus:e=>xP(t,e),signAuthorization:e=>AP(t,e),signMessage:e=>EP(t,e),signTransaction:e=>PP(t,e),signTypedData:e=>SP(t,e),switchChain:e=>_P(t,e),waitForCallsStatus:e=>gg(t,e),watchAsset:e=>IP(t,e),writeContract:e=>Vi(t,e),writeContractSync:e=>D0(t,e),token:{approve:Qn(t,qs),approveSync:Qn(t,aP),transfer:Qn(t,js),transferSync:Qn(t,fP)}}}function d9(t){const{key:e="wallet",name:r="Wallet Client",transport:n}=t;
68return bg({...t,key:e,name:r,transport:n,type:"walletClient"}).extend(NP)}function by({key:t,methods:e,name:r,request:n,retryCount:i=3,retryDelay:s=150,timeout:o,type:a},c){const u=yg();return{config:{key:t,methods:e,name:r,request:n,retryCount:i,retryDelay:s,timeout:o,type:a},request:T8(n,{methods:e,retryCount:i,retryDelay:s,uid:u}),value:c}}function h9(t,e={}){const{key:r="custom",methods:n,name:i="Custom Provider",retryDelay:s}=e;return({retryCount:o})=>by({key:r,methods:n,name:i,request:t.request.bind(t),retryCount:e.retryCount??o,retryDelay:s,type:"custom"})}class kP extends q{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}let MP=0;const Kh=new WeakMap;function TP(t){if(!t)return"default";const e=Kh.get(t);if(e!==void 0)return e;const r=MP++;return Kh.set(t,r),r}function p9(t,e={}){const{batch:r,fetchFn:n,fetchOptions:i,key:s="http",maxResponseBodySize:o,methods:a,name:c="HTTP JSON-RPC",onFetchRequest:u,onFetchResponse:f,retryDelay:d,raw:m}=e;return({chain:g,retryCount:w,timeout:A})=>{const{batchSize:k=1e3,wait:_=0}=typeof r=="object"?r:{},B=e.retryCount??w,T=A??e.timeout??1e4,N=t||g?.rpcUrls.default.http[0];if(!N)throw new kP;const M=j8(N,{fetchFn:n,fetchOptions:i,maxResponseBodySize:o,onRequest:u,onResponse:f,timeout:T});return by({key:s,methods:a,name:c,async request({method:O,params:F},L){const z={method:O,params:F},D=L?.signal?{signal:L.signal}:void 0,{schedule:j}=cg({id:`${N}.${TP(L?.signal)}`,wait:_,shouldSplitBatch(p){return p.length>k},fn:p=>M.request({body:p,fetchOptions:D}),sort:(p,b)=>p.id-b.id}),Q=async p=>r?j(p):[await M.request({body:p,fetchOptions:D})],[{error:E,result:l}]=await Q(z);if(m)return{error:E,result:l};if(E)throw new Zl({body:z,error:E,url:N});return l},retryCount:B,retryDelay:d,timeout:T,type:"http"},{fetchOptions:i,url:N})}}const RP={gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},CP={block:wA({format(t){return{transactions:t.transactions?.map(r=>{if(typeof r=="string")return r;const n=xa(r);return n.typeHex==="0x7e"&&(n.isSystemTx=r.isSystemTx,n.mint=r.mint?bt(r.mint):void 0,n.sourceHash=r.sourceHash,n.type="deposit"),n}),stateRoot:t.stateRoot}}}),transaction:yA({format(t){const e={};return t.type==="0x7e"&&(e.isSystemTx=t.isSystemTx,e.mint=t.mint?bt(t.mint):void 0,e.sourceHash=t.sourceHash,e.type="deposit"),e}}),transactionReceipt:FE({format(t){return{l1GasPrice:t.l1GasPrice?bt(t.l1GasPrice):null,l1GasUsed:t.l1GasUsed?bt(t.l1GasUsed):null,l1Fee:t.l1Fee?bt(t.l1Fee):null,l1FeeScalar:t.l1FeeScalar?Number(t.l1FeeScalar):null}}})};function BP(t,e){return $P(t)?FP(t):A8(t,e)}const OP={transaction:BP};function FP(t){LP(t);const{sourceHash:e,data:r,from:n,gas:i,isSystemTx:s,mint:o,to:a,value:c}=t,u=[e,n,a??"0x",o?Ht(o):"0x",c?Ht(c):"0x",i?Ht(i):"0x",s?"0x1":"0x",r??"0x"];return Pt(["0x7e",ei(u)])}function $P(t){return t.type==="deposit"||typeof t.sourceHash<"u"}function LP(t){const{from:e,to:r}=t;if(e&&!ft(e))throw new Ft({address:e});if(r&&!ft(r))throw new Ft({address:r})}const Wh={blockTime:2e3,contracts:RP,formatters:CP,serializers:OP},ho=1,UP=kg({...Wh,id:8453,name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://basescan.org",apiUrl:"https://api.basescan.org/api"}},contracts:{...Wh.contracts,disputeGameFactory:{[ho]:{address:"0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e"}},l2OutputOracle:{[ho]:{address:"0x56315b90c40730925ec5485cf004d835058518A0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022},portal:{[ho]:{address:"0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",blockCreated:17482143}},l1StandardBridge:{[ho]:{address:"0x3154Cf16ccdb4C6d922629664174b904d80F2C35",blockCreated:17482143}}},sourceId:ho});({...UP});export{HP as C,_2 as J,GP as Q,zP as R,WP as W,Fm as _,Fy as a,vy as b,ip as c,cb as d,$s as e,Lt as f,ia as g,l9 as h,ks as i,qP as j,p9 as k,d9 as l,Vc as m,Nt as n,UP as o,h9 as p,QP as q,El as r,jP as s,Ht as t,VP as v};

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.