@ethersphere/bee-dashboard 0.34.0 → 0.35.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/assets/__vite-browser-external-BmZ7Lxtg.js +2 -0
- package/build/assets/{download.browser-C9Uz7OzH.js → download.browser-BISIRUf5.js} +1 -1
- package/build/assets/{download.node-tVxxcrzZ.js → download.node-C7FKEca1.js} +1 -1
- package/build/assets/fs.node-DO9PavmO.js +2 -0
- package/build/assets/index-BmV9k6jK.js +116 -0
- package/build/assets/index-DMp5phAM.css +1 -0
- package/build/assets/vendor-ethers-BjcsqZe1.js +25 -0
- package/build/assets/{vendor-react-mui-CMfvLA_U.js → vendor-react-mui-Dv6xxk4a.js} +1 -1
- package/build/index.html +4 -4
- package/lib/{App-DJxgFkgf.js → App-BsgbFuqW.js} +663 -456
- package/lib/{App-CyZvPEkk.mjs → App-CtEEza9I.mjs} +663 -456
- package/lib/App.cjs.js +1 -1
- package/lib/App.css +51 -51
- package/lib/App.js +1 -1
- package/lib/components/StampExtensionModal.d.ts +10 -4
- package/lib/constants.d.ts +2 -0
- package/lib/{download.browser-Bp7NWws0.js → download.browser-BhXh2eCY.js} +1 -1
- package/lib/{download.browser-Cta85Yx2.mjs → download.browser-JHhkjxaR.mjs} +1 -1
- package/lib/{download.node-B-ryR03L.mjs → download.node-Bf2R_PzI.mjs} +1 -1
- package/lib/{download.node-C_IiKmHA.js → download.node-CzhxALxQ.js} +1 -1
- package/lib/{fs.node-l47yAJ14.mjs → fs.node-CR5kFsrm.mjs} +1 -1
- package/lib/{fs.node-DOrfMQwF.js → fs.node-DrM1ewLt.js} +1 -1
- package/lib/modules/filemanager/components/ConfirmModal/ConfirmModal.d.ts +1 -1
- package/lib/modules/filemanager/components/ExpiringNotificationModal/ExpiringNotificationModal.d.ts +4 -2
- package/lib/pages/files/AssetPreview.d.ts +1 -0
- package/lib/{upload.node-D_XLym_5.mjs → upload.node-BUOo237h.mjs} +3 -3
- package/lib/{upload.node-DUSvlJwc.js → upload.node-DRiLZjhW.js} +3 -3
- package/lib/utils/chain.d.ts +6 -0
- package/lib/utils/file.d.ts +11 -0
- package/lib/utils/index.d.ts +0 -7
- package/lib/utils/stamp.d.ts +8 -0
- package/package.json +1 -1
- package/build/assets/fs.node-B2ZMKqzu.js +0 -2
- package/build/assets/index-BTuZ_M-A.js +0 -116
- package/build/assets/index-CPiKID9h.css +0 -1
- package/build/assets/upload.node-W5QYw_5j.js +0 -2
- package/build/assets/vendor-ethers-DTkFbbYN.js +0 -16
- package/lib/modules/filemanager/utils/view.d.ts +0 -11
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{g as hs,p as Wi,c as bc,a as B0}from"./vendor-react-mui-CMfvLA_U.js";var gc={},R0;function gw(){return R0||(R0=1,(function(r){var e;Object.defineProperty(r,"__esModule",{value:!0}),r.Vector=r.Cache=r.Assertions=r.Strings=r.Types=r.Objects=r.Dates=r.Promises=r.Numbers=r.System=r.Arrays=r.Random=r.Elliptic=r.Binary=r.Lock=r.Solver=r.RollingValueProvider=r.TrieRouter=r.AsyncQueue=r.PubSubChannel=r.FixedPointNumber=r.MerkleTree=r.Chunk=r.Uint8ArrayWriter=r.Uint8ArrayReader=r.AsyncLazy=r.Lazy=r.Optional=void 0;async function t(s){return new Promise((o,u)=>s.then(u,o))}async function n(s){return t(Promise.all(s.map(t)))}async function i(s,o=1){const u=Qf(s,o),d=[],g=u.map(async B=>{for(const I of B)d.push(await I())});return await Promise.all(g),d}async function a(s){return new Promise(o=>setTimeout(()=>{o(!0)},s))}function c(s,o=Math.random){for(let u=s.length-1;u>0;u--){const d=Math.floor(o()*(u+1)),g=s[u];s[u]=s[d],s[d]=g}return s}function l(s){if(s.length===1)return s[0];throw Error(`Expected exactly one element, actual: ${s.length}`)}function f(s){return s.length===1?s[0]:null}function p(s){return s.length>0?s[0]:null}function h(s){if(!s.length)throw Error("Received empty array");return s[0]}function x(s,o){const u=[];for(let d=0;d<s;d++)u.push(o(d));return u}function y(s){const o=[];for(let u=0;u<s[0].length;u++){o.push([]);for(let d=0;d<s.length;d++)o[u].push(s[d][u])}return o}function E(s,o,u){const d=[];for(let g=0;g<s;g++){d.push([]);for(let B=0;B<o;B++)d[g].push(u)}return d}function v(s,o,u,d){if(u<0||d<0||d+o[0].length>s[0].length||u+o.length>s.length)return!1;for(let g=0;g<o.length;g++)for(let B=0;B<o[g].length;B++)if(o[g][B]!==void 0&&s[u+g][d+B]!==o[g][B])return!1;return!0}function R(s,o,u=Math.random){return c(xf(0,s.length-1),u).slice(0,o)}function C(s,o){return s.map(u=>u[o])}function S(s){let o=s,u=3405648695,d=3735928559;return function(){return o+=u,u^=o<<7,o*=d,d^=o<<13,o^=u^d,(o>>>0)/4294967296}}function D(s,o,u=Math.random){return Math.floor(u()*(o-s+1))+s}function U(s,o,u=Math.random){return u()*(o-s)+s}function K(){return Math.random()*2-1}function H(s,o,u){return o>=s.x&&o<s.x+s.width&&u>=s.y&&u<s.y+s.height}function j(s,o,u,d=Math.random){let g,B;do g=D(0,s-1,d),B=D(0,o-1,d);while(u&&H(u,g,B));return[g,B]}function F(s,o=Math.random){const u=Math.floor(s),d=s-u;return z(d,o)?u+1:u}function z(s,o=Math.random){return o()<s}function W(s,o=Math.random){return s[Math.floor(s.length*o())]}function ne(s,o,u=Math.random){if(o>s.length)throw new Error(`Count (${o}) is greater than array length (${s.length})`);return R(s,o,u).map(d=>s[d])}function ie(s,o,u,d=Math.random){if(o>s.length)throw new Error(`Count (${o}) is greater than array length (${s.length})`);const g=[];for(;g.length<o;){const B=W(s,d);g.some(I=>u(I,B))||g.push(B)}return g}function de(s,o,u,d,g,B=Math.random){const I=s.filter(L=>L!==o&&L!==u),V=[];for(o!==null&&V.push(o);I.length&&V.length<d;){const L=r.Random.intBetween(0,I.length-1,B);g(I[L],V)&&V.push(I[L]),I.splice(L,1)}return c(V,B),{values:V,indexOfGuaranteed:o!==null?V.indexOf(o):-1}}function he(s){if(!s.length)throw Error("Received empty array");return s[s.length-1]}function ye(s,o,u){return u(o.reduce((d,g)=>g(d),s))}function q(s,o){return u=>ye(u,s,o)}function Q(s,o,u){if(u===void 0&&(u=Math.random()),s.length!==o.length)throw new Error("Array length mismatch");let d=o.reduce((B,I)=>B+I,0);const g=u*d;for(let B=0;B<s.length-1;B++)if(d-=o[B],g>=d)return s[B];return he(s)}function ae(s,o,u=Math.random){const d=o.map(B=>u()*B),g=[];for(let B=0;B<s.length;B++)g.push([s[B],d[B]]);return g.sort((B,I)=>I[1]-B[1]).map(B=>B[0])}function ce(s,o){if(s==null)return null;const u=o.split(".");let d=s;for(const g of u){if(d[g]===null||d[g]===void 0)return null;d=d[g]}return d}function le(s,o,u){const d=o.split(/\.|\[/);let g=s;for(let B=0;B<d.length;B++){const I=d[B],V=B<d.length-1&&d[B+1].includes("]"),L=I.includes("]")?I.replace(/\[|\]/g,""):I;if(B===d.length-1)return g[L]=u,u;Ut(g[L])||(V?g[L]=[]:g[L]={}),g=g[L]}return u}function Re(s,o,u=1){const d=ce(s,o)||0;return le(s,o,d+u),d}function P(s,o,u){return ce(s,o)||le(s,o,u)}function X(s,o){const u=to(o,"."),d=mf(o,".");if(!u||!d)return;const g=ce(s,u);g&&delete g[d]}function oe(s,o,u){const d=ce(s,o);if(!d)throw new Error("Key '"+o+"' does not exist.");return le(s,o,u),d}function ue(s,o,u){for(const d of o){const g=ce(s,d);if(g)return g}if(u){const d=Object.values(s);if(d.length)return d[0]}return null}async function fe(s,o,u){for(;;){try{await s()}catch(d){u&&u("Error in forever",d)}await a(o)}}function ke(s,o){s();const u=setInterval(()=>{s()},o);return()=>clearInterval(u)}function Ye(){const s=globalThis.process;return s?s.browser===!0?"browser":"node":"browser"}async function Jt(s,o,u,d,g,B){let I=null;for(let V=0;V<=o;V++)try{return await s()}catch(L){if(I=L,V===o)break;const te=u+(d-u)*(V/(o-1));g&&g("Error in withRetries, retrying",{attempt:V+1,allowedFailures:o,delayMillis:te,error:L}),B&&B(),await a(te)}throw I}function Ft(s){return s/1024/1024}function Wt(s,o=1024){return s>=o*o*o*o?(s/o/o/o/o).toFixed(3)+" TB":s>=o*o*o?(s/o/o/o).toFixed(3)+" GB":s>=o*o?(s/o/o).toFixed(3)+" MB":s>=o?(s/o).toFixed(3)+" KB":s+" B"}function Yt(s){const o=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(s.toLowerCase());if(!o)throw new Error("Invalid hex color: "+s);return[parseInt(o[1],16),parseInt(o[2],16),parseInt(o[3],16)]}function ht(s){return"#"+s.map(o=>o.toString(16).padStart(2,"0")).join("")}function Xt(s,o,u,d){const g=s*Math.PI/180,B=u*Math.PI/180,I=(u-s)*Math.PI/180,V=(d-o)*Math.PI/180,L=Math.sin(I/2)*Math.sin(I/2)+Math.cos(g)*Math.cos(B)*Math.sin(V/2)*Math.sin(V/2);return 6371e3*(2*Math.atan2(Math.sqrt(L),Math.sqrt(1-L)))}function Zt(s,o){return Math.round(s/o)*o}function sr(s){return s>1e3?(s/1e3).toFixed(0)+" km":s>=500?Zt(s,100)+" m":s>=100?Zt(s,50)+" m":Zt(s,10)+" m"}function en(s){return s*(s+1)/2}function ar(s){const o=s.match(/-?\d+(\.\d+)?/);if(!o)throw Error("No float found in "+s);return parseFloat(o[0])}function Ya(s,o,u=Math.random){const d=s*o,g=Math.sqrt(s*o*(1-o)),B=(u()+u()+u()+u()+u()+u()-3)*Math.SQRT2,I=Math.round(d+g*B);return Math.max(0,Math.min(s,I))}function Xa(s,o){if(!s.includes("."))return s;if(parseFloat(s)===0)return"0";const[u,d]=s.split("."),g=u.replace("-",""),B=g.length;if(B>=o)return u;if(g!=="0"){const L=o-B,te=d.slice(0,L);return/[1-9]/.test(te)?`${u}.${te.replace(/0+$/,"")}`:u}const I=d.match(/^0*/)?.[0].length??0,V=o+I;return`${u}.${d.slice(0,V)}`}function Ut(s,o=!0){return!s||o&&!Vn(s._readableState)||o&&s.constructor&&(s.constructor.isBuffer||s.constructor.name=="AbortController"||s.constructor.name=="AbortSignal"||s.constructor.name=="Uint8Array"||s.constructor.name==="ArrayBuffer"||s.constructor.name==="ReadableStream")?!1:typeof s=="object"}function Mn(s){return Ut(s)&&!Array.isArray(s)}function Ts(s){return Array.isArray(s)&&s.length===0}function vs(s){return Mn(s)&&Object.keys(s).length===0}function Vn(s){return s===void 0}function yt(s){return Object.prototype.toString.call(s)==="[object Function]"||Object.prototype.toString.call(s)==="[object AsyncFunction]"}function Xe(s){return Object.prototype.toString.call(s)==="[object String]"}function ln(s){return typeof s=="number"&&isFinite(s)}function tn(s){return s===!0||s===!1}function Gn(s){return Object.prototype.toString.call(s)==="[object Date]"}function A(s){return!Xe(s)||s.trim().length===0}function m(s){return ln(s)&&Number.isInteger(s)&&s>=1}function b(s){return Xe(s)&&s.match(/^-?\d+$/)!==null}function T(s){return Xe(s)&&s.match(/^(0x)?[0-9a-f]+$/i)!==null}const N="!@#$%^&*()_+-=[]{}|;:<>?,./",k="!@#$%^&*()_+-=[]{}|;:<>?,./".split(""),M="abcdefghijklmnopqrstuvwxyz",ge="ABCDEFGHIJKLMNOPQRSTUVWXYZ",Ge="1234567890",Ie=M+ge+Ge,Me=Ie+N,Se=["—","\\","東","京","都","𝖆","𝖇","𝖈","👾","🙇","💁","🙅","ᚠ","ᛇ","ᚻ","ᛦ"],of="0123456789abcdef";function Tb(s,o=Math.random){let u="";for(let d=0;d<s;d++)u+=M[Math.floor(o()*M.length)];return u}function vb(s,o=Math.random){let u="";for(let d=0;d<s;d++)u+=Ie[Math.floor(o()*Ie.length)];return u}function Ob(s,o=Math.random){let u="";for(let d=0;d<s;d++)u+=Me[Math.floor(o()*Me.length)];return u}function Cb(s,o=Math.random){let u="";for(let d=0;d<s;d++)u+=Se[Math.floor(o()*Se.length)];return u}function Sb(s,o){const u=new RegExp(`[0-9a-f]{${o}}`,"i"),d=s.match(u);return d?d[0]:null}function Nb(s,o,u=k){const d=bf(s,u);for(const g of d)if(o(g))return g;return null}function Ib(s,o=Math.random){let u="";for(let d=0;d<s;d++)u+=of[Math.floor(o()*of.length)];return u}function Pb(s,o){if(!b(s))throw new TypeError(`Expected integer string${o?.name?` for ${o.name}`:""}, got: `+s);const u=BigInt(s);if(o&&(o.min&&u<o.min||o.max&&u>o.max))throw RangeError(`Expected integer string${o?.name?` for ${o.name}`:""} in range: ${o.min??"-inf"}..${o.max??"inf"}; got: `+u);return s}function cf(s,o){if(A(s))throw new TypeError(`Expected string${o?.name?` for ${o.name}`:""}, got: `+s);if(o&&(o.min!==void 0&&s.length<o.min||o.max!==void 0&&s.length>o.max))throw RangeError(`Expected string${o?.name?` for ${o.name}`:""} length in range: ${o.min??"-inf"}..${o.max??"inf"}; got: ${s.length}`);return s}function kb(s,o){if(!T(s))throw new TypeError(`Expected hex string${o?.name?` for ${o.name}`:""}, got: `+s);if(o?.strictPrefix&&!s.startsWith("0x")&&!s.startsWith("0X"))throw new TypeError(`Expected hex string with 0x prefix${o?.name?` for ${o.name}`:""}, got: `+s);const u=s.replace(/^0x/i,"");if(u.length%2!==0&&!o?.uneven)throw RangeError(`Expected even number of hex digits${o?.name?` for ${o.name}`:""}; got: `+s);if(o&&o.byteLength&&u.length!==o.byteLength*2)throw RangeError(`Expected hex string${o?.name?` for ${o.name}`:""} of byte length ${o.byteLength}; got: `+u);return`0x${u}`}function Db(s,o){if(!cf(s,o).split("").every(u=>u==="_"||Ei(u)))throw new TypeError(`Expected safe string${o?.name?` for ${o.name}`:""}, got: `+s);return s}function uf(s,o){if(o.min!==void 0&&s<o.min||o.max!==void 0&&s>o.max)throw RangeError(`Expected value${o?.name?` for ${o.name}`:""} in range: ${o.min??"-inf"}..${o.max??"inf"}; got: ${s}`)}function Fb(s,o){if(!yt(s))throw new TypeError(`Expected function${o?.name?` for ${o.name}`:""}, got: `+s);return s}function yi(s,o){if(ln(s))return o&&uf(s,o),s;if(!Xe(s)||!s.match(/^-?\d+(\.\d+)?$/))throw new TypeError(`Expected number${o?.name?` for ${o.name}`:""}, got: `+s);const u=parseFloat(s);return o&&uf(u,o),u}function Os(s,o){return Math.trunc(yi(s,o))}function Ub(s,o){if(s==="true")return!0;if(s==="false")return!1;if(!tn(s))throw new TypeError(`Expected boolean${o?.name?` for ${o.name}`:""}, got: `+s);return s}function Lb(s,o){if(!Gn(s))throw new TypeError(`Expected date${o?.name?` for ${o.name}`:""}, got: `+s);return s}function Mb(s){return A(s)?null:s}function Vb(s,o){if(!Xe(s))throw new TypeError(`Expected string${o?.name?` for ${o.name}`:""}, got: `+s);return s}function Gb(s,o){if(m(s))return s;const u=parseInt(s,10);if(!m(u))throw new TypeError(`Expected id${o?.name?` for ${o.name}`:""}, got: `+s);return u}function zb(s,o){if(!Xe(s))throw new TypeError(`Expected time${o?.name?` for ${o.name}`:""}, got: `+s);const u=s.split(":");if(u.length!==2)throw new TypeError(`Expected time${o?.name?` for ${o.name}`:""}, got: `+s);const d=parseInt(u[0],10),g=parseInt(u[1],10);if(!ln(d)||!ln(g)||d<0||d>23||g<0||g>59)throw new TypeError(`Expected time, got${o?.name?` for ${o.name}`:""}: `+s);return`${String(d).padStart(2,"0")}:${String(g).padStart(2,"0")}`}function Hb(s,o){if(!Array.isArray(s))throw new TypeError(`Expected array${o?.name?` for ${o.name}`:""}, got: `+s);return s}function Cs(s,o){if(!Mn(s))throw new TypeError(`Expected object${o?.name?` for ${o.name}`:""}, got: `+s);return s}function $b(s,o){return s===null?null:Cs(s,o)}function _b(s,o){const u=Cs(s,o);for(const d of Object.keys(u))if(!Xe(u[d]))throw new TypeError(`Expected string map${o?.name?` for ${o.name}`:""}, got: `+s);return u}function jb(s,o){const u=Cs(s),d=Object.keys(u),g=Object.values(u);if(!d.every(Xe)||!g.every(ln))throw new TypeError(`Expected numeric dictionary${o?.name?` for ${o.name}`:""}, got: `+s);return u}function lf(s){return Xe(s)&&s.match(/^https?:\/\/.+/)!==null}function qb(s,o){if(!lf(s))throw new TypeError(`Expected url${o?.name?` for ${o.name}`:""}, got: `+s);return s}function ff(s){return typeof s=="bigint"}function hf(s,o){if(!ff(s))throw new TypeError(`Expected bigint${o?.name?` for ${o.name}`:""}, got: `+s);if(o?.min!==void 0&&s<o?.min||o?.max!==void 0&&s>o?.max)throw RangeError(`Expected value${o?.name?` for ${o.name}`:""} in range: ${o.min??"-inf"}..${o.max??"inf"}; got: ${s}`);return s}function Kb(s,o){return o==null?!0:s(o)}function Qb(s,o){return o==null?null:s(o)}function Jb(s,o){return o===""?void 0:s(o)}function Wb(s,o){return o==null?void 0:s(o)}function df(s,o){for(const[u,d]of Object.entries(o))if(!d(s[u]))throw TypeError(`${u} in value does not exist or match shape`);for(const u of Object.keys(s))if(!o[u])throw TypeError(`${u} exists in value but not in shape`);return!0}function Yb(s,o){return s.every(u=>df(u,o))}function wi(s,o="json",u=0){if(s&&yt(s.represent)){const d=s.represent();if(Xe(d))return o==="json"&&u===0?JSON.stringify(d):d}if(Ut(s,!1)){if(u>1)return"[object Object]";if(o==="json"){if(Array.isArray(s)){const g=s.map(B=>wi(B,"json",u+1));return u===0?JSON.stringify(g):g}const d={};s.message&&(d.message=wi(s.message,"json",u+1));for(const[g,B]of Object.entries(s))d[g]=wi(B,"json",u+1);return u===0?JSON.stringify(d):d}else if(o==="key-value"){const d=Object.keys(s);return s.message&&!d.includes("message")&&d.unshift("message"),d.map(g=>`${g}=${JSON.stringify(wi(s[g],"json",u+1))}`).join(" ")}}return Vn(s)&&(s="undefined"),u===0?JSON.stringify(s):s}function Xb(s,o){if(Xe(s))return s;const u=Object.keys(s);s.message&&!u.includes("message")&&u.push("message");const d=u.map(g=>`${g}: ${s[g]}`).join("; ");return o&&s.stack?d+`
|
|
2
|
-
`+s.stack:d}function or(s,o){if(Mn(s)&&Mn(o))for(const u in o)Mn(o[u])?(s[u]||(s[u]={}),or(s[u],o[u])):Array.isArray(o[u])?s[u]=[...o[u]]:(o[u]!==null&&o[u]!==void 0||s[u]===null||s[u]===void 0)&&(s[u]=o[u]);return s}function Zb(s,o){const u={};return or(u,s),or(u,o),u}function eg(s,o,u){const d={};return or(d,s),or(d,o),or(d,u),d}function pf(s,o){const u={};for(const d of s)for(const g of Object.keys(d))u[g]?u[g]=o(u[g],d[g]):u[g]=d[g];return u}function tg(s){return pf(s,(o,u)=>o+u)}function ng(s,o,u){s[o]||(s[o]=[]),s[o].push(u)}function rg(s,o,u){for(s.unshift(o);s.length>u;)s.pop()}function ig(s,o){let u=o%s.length;return u<0&&(u+=s.length),s[u]}function Ss(s,o){Array.prototype.push.apply(s,o)}function sg(s,o){Array.prototype.unshift.apply(s,o)}async function ag(s,o){const u=[];for(const d of s)u.push(await o(d));return u}function og(s,o){const u=[];for(let d=0;d<s.length;d++)u.push(s[d]),d<s.length-1&&(yt(o)?u.push(o()):u.push(o));return u}function cg(s,o){if(s!==o)throw Error(`Expected [${s}] to equal [${o}]`);return[s,o]}function ug(s){if(s!==!0)throw Error(`Expected [true], got: [${s}]`);return s}function lg(s){if(!s)throw Error(`Expected truthy value, got: [${s}]`);return s}function fg(s){if(s!==!1)throw Error(`Expected [false], got: [${s}]`);return s}function hg(s){if(s)throw Error(`Expected falsy value, got: [${s}]`);return s}function dg(s,o){if(!o.includes(s))throw Error(`Expected any of [${o.join(", ")}], got: [${s}]`);return s}function pg(s,o){for(let u=0;u<s.length;u++){const d=s[u],g=o[u],B=Math.max(0,g.getTime()-Date.now());setTimeout(d,B)}}function xg(s,o,u){return s+(o-s)*u}function mg(s){return s.reduce((o,u)=>o+u,0)}function bg(s){return s.reduce((o,u)=>o+u,0)/s.length}function gg(s){const o=[...s].sort((d,g)=>d-g),u=Math.floor(o.length/2);return o.length%2===0?(o[u]+o[u-1])/2:o[u]}function yg(s,o){return s-(o-1)/2}function xf(s,o){const u=[];for(let d=s;d<=o;d++)u.push(d);return u}function wg(s,o){return o.some(u=>s.includes(u))}function Ag(s){return/^[\u4E00-\u9FA5]+$/.test(s)}function Za(s,o=()=>!1){return s.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").split("").map(u=>/[a-z0-9]/.test(u)||o(u)?u:"-").join("").replace(/-+/g,"-").replace(/^-|-$/g,"")}function Eg(s){return Za(s).replaceAll("-","")}function Bg(s){return Ps(s.replace(/([A-Z])/g," $1"))}function Rg(s){return s.split("-").map(Ps).join(" ")}function Tg(s){return yf(s.split("-").map(Ps).join(""))}function vg(s,o=", ",u=" and "){return!s||!s.length?"":s.length===1?s[0]:s.length===2?`${s[0]}${u}${s[1]}`:`${s.slice(0,s.length-1).join(o)}${u}${s[s.length-1]}`}function Og(s,o){return o+s.split("").join(o)+o}function Cg(s){return Za(s).replace(/-/g,"_").toUpperCase()}function Ns(s,o){if(o.length===0)return 0;const u=s.toLowerCase(),d=o.toLowerCase();return s===o?1e4:u.startsWith(d)?1e4-s.length:u.includes(d)?5e3-s.length:new RegExp(".*"+d.split("").join(".*")+".*").test(u)?1e3-s.length:0}function Sg(s,o){return s.filter(u=>Ns(u,o)).sort((u,d)=>Ns(d,o)-Ns(u,o))}function Ng(s){return s.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}const Ig={"&":"&",""":'"',"'":"'",">":">","<":"<"};function Pg(s){let o=s.replace(/&#(\d+);/g,(u,d)=>String.fromCharCode(d)).replace(/&#x(\d+);/g,(u,d)=>String.fromCharCode(parseInt(d,16)));for(const[u,d]of Object.entries(Ig))o=o.replaceAll(u,d);return o}function eo(s,o){const u=s.indexOf(o);return u===-1?null:s.slice(0,u)}function Is(s,o){const u=s.indexOf(o);return u===-1?null:s.slice(u+o.length)}function to(s,o){const u=s.lastIndexOf(o);return u===-1?null:s.slice(0,u)}function mf(s,o){const u=s.lastIndexOf(o);return u===-1?null:s.slice(u+o.length)}function kg(s,o,u){const d=to(s,u);return d?Is(d,o):null}function Dg(s,o,u){const d=Is(s,o);return d?eo(d,u):null}function no(s,o,u=!1){const d=u?s.lastIndexOf(o):s.indexOf(o);return d===-1?u?[null,s]:[s,null]:[s.slice(0,d),s.slice(d+o.length)]}function bf(s,o){let u=[s];for(const d of o)u=u.flatMap(g=>g.split(d));return u.filter(d=>d)}function ro(s){const o=he(s.split(/\\|\//g)),u=o.lastIndexOf(".",o.length-1);return u<=0?"":o.slice(u+1)}function io(s){const o=he(s.split(/\\|\//g)),u=o.lastIndexOf(".",o.length-1);return u<=0?o:o.slice(0,u)}function Fg(s){let[o,u]=s.split("@");o=Ai(o.replaceAll(".","").toLowerCase()).replaceAll(" ","");const[d]=o.split("+");if(!d||!u||u.indexOf(".")===-1||u.indexOf(".")===u.length-1)throw new Error("Invalid email");return u=Ai(u.toLowerCase()).replaceAll(" ",""),`${d}@${u}`}function Ug(s){const o=io(s),u=ro(s);return u?`${o}.${u}`:o}function Lg(s){const o=io(s),u=ro(s);return{basename:o,extension:u,filename:u?`${o}.${u}`:o}}function Mg(s,o=Math.random){return s.replace(/\{(.+?)\}/g,(u,d)=>W(d.split("|"),o))}function gf(s){const o=/\{(.+?)\}/,u=s.match(o);if(!u||!u.index)return[s];const d=u[1].split(","),g=s.slice(0,u.index),B=s.slice(u.index+u[0].length);let I=[];for(const V of d){const L=gf(g+V+B);I=I.concat(L)}return I}function Ai(s){return s.split(`
|
|
3
|
-
`).map(o=>o.trim().replace(/\s+/g," ")).filter(o=>o.length>0).join(`
|
|
4
|
-
`)}function Ps(s){return s.charAt(0).toUpperCase()+s.slice(1)}function yf(s){return s.charAt(0).toLowerCase()+s.slice(1)}function wf(s){if(!s)return!1;const o=s.charCodeAt(0);return o>=65&&o<=90||o>=97&&o<=122}function Af(s){if(!s)return!1;const o=s.charCodeAt(0);return o>=48&&o<=57}function Ei(s){return wf(s)||Af(s)}const Vg=`
|
|
5
|
-
\r.,?!:;"'\`(){}[]~@#$%^&*-+=|<>/\\`.split("");function Gg(s){return Vg.includes(s)}function zg(s){return Ei(s)||s==="."||s==="["||s==="]"||s==="_"}function Hg(s,o,u,d,g){return s.slice(0,o)+d+s.slice(o,o+u)+g+s.slice(o+u)}function Ef(s,o,u=0){const d=o.exec(s.slice(u));return d?{index:d.index,match:d[0]}:null}function Bf(s,o,u=!0){if(!u)return o.every(g=>g instanceof RegExp?g.test(s):s.indexOf(g,0)!==-1);let d=0;for(const g of o)if(g instanceof RegExp){const B=Ef(s,g,d);if(!B)return!1;d=B.index+B.match.length}else{const B=s.indexOf(g,d);if(B===-1)return!1;d=B+g.length}return!0}function $g(s,o,u=!0){let d=0;for(const g of o){let B=!1;for(;!B&&d<s.length;)Bf(s[d],g,u)&&(B=!0),d++;if(!B)return!1}return!0}function _g(s){return s.match(/"|,/)?`"${s.replace(/"/g,'""')}"`:s}function Rf(s,o,u=0){const d=[];let g=s.indexOf(o,u);for(;g!==-1;)d.push(g),g=s.indexOf(o,g+o.length);return d}function kr(s,o,u=0){let d=-1;for(const g of o){const B=s.indexOf(g,u);B!==-1&&(d===-1||B<d)&&(d=B)}return d}function jg(s,o=0){for(let u=o;u<s.length;u++)if(Gg(s[u]))return u;return-1}function qg(s,o=0){for(let u=o;u<s.length;u++)if(s[u]==="#"&&Ei(s[u+1]))return u;return-1}function Tf(s,o,u=0){return s.slice(0,u).lastIndexOf(o)}function vf(s,o=0,u="{",d="}"){let g=1;for(let B=o;B<s.length;B++)if(s.slice(B,B+d.length)===d){if(--g===0)return B}else s.slice(B,B+u.length)===u&&g++;return-1}function Of(s,o){const u=o.wordBoundary?kr(s,[`${o.opening} `,`${o.opening}
|
|
6
|
-
`],o.start||0):s.indexOf(o.opening,o.start||0);if(u===-1)return null;const d=vf(s,u+o.opening.length,o.opening,o.closing);return d===-1?null:o.exclusive?s.slice(u+o.opening.length,d):s.slice(u,d+o.closing.length)}function Kg(s,o){const u=[];let d=o.wordBoundary?kr(s,[`${o.opening} `,`${o.opening}
|
|
7
|
-
`],o.start||0):s.indexOf(o.opening,o.start||0);for(;;){if(d===-1)return u;const g=Of(s,{...o,start:d});if(!g)return u;u.push(g),d=o.wordBoundary?kr(s,[`${o.opening} `,`${o.opening}
|
|
8
|
-
`],d+g.length):s.indexOf(o.opening,d+g.length)}}function Qg(s,o,u){let d=0;for(;;){const g=r.Strings.extractBlock(s,{...u,start:d});if(!g)return s;const B=o(g);d=s.indexOf(g,d)+B.length,s=s.replace(g,B)}}function Jg(s,o){const u=[];let d=0;for(;d<s.length;){const g=s.indexOf(o,d);if(g===-1){u.push({string:s.slice(d),symbol:null});break}const B=s.indexOf(o,g+o.length);if(g>d&&B!==-1&&u.push({string:s.slice(d,g),symbol:null}),B===-1){u.push({string:s.slice(d),symbol:null});break}u.push({string:s.slice(g+o.length,B),symbol:o}),d=B+o.length}return u}function Wg(s){const o=[];let u=0;for(;u<s.length;){const d=qg(s,u);if(d===-1){o.push({string:s.slice(u),symbol:null});break}const g=jg(s,d+1);if(g===-1){o.push({string:s.slice(u,d),symbol:null}),o.push({string:s.slice(d+1),symbol:"#"});break}d>u&&o.push({string:s.slice(u,d),symbol:null}),o.push({string:s.slice(d+1,g),symbol:"#"}),u=g}return o}function Yg(s){const o=[];let u=0;for(;u<s.length;){const d=kr(s,["http://","https://"],u);if(d===-1){o.push({string:s.slice(u),symbol:null});break}const g=kr(s,[" ",`
|
|
9
|
-
`],d);if(g===-1){d>u&&o.push({string:s.slice(u,d),symbol:null}),o.push({string:s.slice(d),symbol:"http"});break}d>u&&o.push({string:s.slice(u,d),symbol:null}),o.push({string:s.slice(d,g),symbol:"http"}),u=g}return o}const Cf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Sf="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";function Xg(s){return Nf(s,Cf)}function Zg(s){return If(s,Cf)}function e1(s){return Nf(s,Sf)}function t1(s){return If(s,Sf)}function Nf(s,o){const d=o.length;let g=0,B=0;const I=[];for(let V=0;V<s.length;V++){const L=s[V];if(L==="=")break;const te=o.indexOf(L);if(te===-1)throw new Error(`Invalid character: ${L}`);B=B<<Math.log2(d)|te,g+=Math.log2(d),g>=8&&(g-=8,I.push(B>>g&255))}return new Uint8Array(I)}function If(s,o){const u=o.length;let d=0,g=0,B="";for(let I=0;I<s.length;I++)for(g=g<<8|s[I],d+=8;d>=Math.log2(u);)d-=Math.log2(u),B+=o[g>>d&u-1];return d>0&&(B+=o[g<<Math.log2(u)-d&u-1]),B.length%4!==0&&(B+="=".repeat(4-B.length%4)),B}function n1(s){(s.startsWith("0x")||s.startsWith("0X"))&&(s=s.slice(2));const o=s.length/2,u=new Uint8Array(o);for(let d=0;d<o;d++){const g=parseInt(s.slice(d*2,d*2+2),16);u[d]=g}return u}function r1(s){return Array.from(s).map(o=>o.toString(16).padStart(2,"0")).join("")}function i1(s){return Array.from(s).map(o=>o.toString(2).padStart(8,"0")).join("")}function s1(s){const o=Math.ceil(s.length/8),u=new Uint8Array(o);for(let d=0;d<o;d++){const g=parseInt(s.slice(d*8,d*8+8),2);u[d]=g}return u}function a1(s,o){const u=s.split("/").filter(B=>B),d=o.split("/").filter(B=>B);if(u.length!==d.length)return null;const g={};for(let B=0;B<u.length;B++){const I=u[B];if(I.startsWith(":"))g[I.slice(1)]=d[B];else if(I!==d[B])return null}return g}function so(s,o,u){const d=[];for(const g of u)g!==o&&d.push(s.replace(o,g));return d}function o1(s,o,u,d=Math.random){const g=r.Arrays.shuffle(o.map(I=>({variants:r.Arrays.shuffle(I.variants.map(V=>V),d),avoid:I.avoid})),d),B=[];for(const I of g){const V=I.variants.filter(te=>te!==I.avoid),L=V.find(te=>s.includes(te));if(L&&(Ss(B,so(s,L,V)),B.length>=u))break}if(B.length<u)for(const I of g){const V=I.variants.find(L=>s.includes(L));if(V&&(Ss(B,so(s,V,I.variants)),B.length>=u))break}return B.slice(0,u)}function c1(s,o,u,d=!1){const g=new RegExp(d?`(?<=\\s|^)${o}(?=\\s|$)`:`\\b${o}\\b`,"g");return s.replace(g,u)}function u1(s,o){const u=/\b[A-Z][a-zA-Z0-9]*\b/g;return s.replace(u,d=>d.toUpperCase()===d?d:o(d))}function l1(s){return s.replace(/<[^>]*>/g,"")}function Pf(s){const o=s.lastIndexOf(" ");if(o===-1)return{line:s,rest:""};const u=s.slice(0,o),d=s.slice(o+1);return{line:u,rest:d}}function f1(s,o={}){return[...s].reduce((u,d)=>u+(o[d]||1),0)}function h1(s,o,u={}){const d=[];let g="",B=0;for(let I=0;I<s.length;I++){const V=s[I],L=u[V]||1;if(g+=V,B+=L,B>o){const{line:te,rest:Ze}=Pf(g);d.push(te),g=Ze,B=Ze.split("").map(wt=>u[wt]||1).reduce((wt,Mr)=>wt+Mr,0)}}return g&&d.push(g),d}function d1(s,o){const u=[];for(let d=0;d<=s.length;d++)u[d]=[d];for(let d=0;d<=o.length;d++)u[0][d]=d;for(let d=1;d<=s.length;d++)for(let g=1;g<=o.length;g++){const B=s[d-1]===o[g-1]?0:1;u[d][g]=Math.min(u[d-1][g]+1,u[d][g-1]+1,u[d-1][g-1]+B)}return u[s.length][o.length]}function kf(s){const o=s.reduce((d,g)=>d.length<g.length?d:g);let u="";for(let d=0;d<o.length;d++){const g=o[d];if(s.every(B=>B[d]===g))u+=g;else break}return u}function p1(s){const o=kf(s),u=o.lastIndexOf("/");return u===-1?"":o.slice(0,u+1)}function ao(s,o){return new RegExp(`\\b${o}\\b`).test(s)}function x1(s,o,u){return u==="any"?o.some(d=>ao(s,d)):o.every(d=>ao(s,d))}function m1(s){const o={},u=s.match(/([a-z\-]+)="([^"]+)"/g);if(u)for(const d of u){const[g,B]=no(d,"=");o[g]=B.slice(1,B.length-1)}return o}function Bi(s,o,u=[]){let d="";for(;o<s.length&&(Ei(s[o])||u.includes(s[o]));)d+=s[o++];return d}function b1(s,o,u=[]){const d=Rf(s,o),g=[];for(const B of d)g.push(Bi(s,B+o.length,u));return g}function g1(s,o,u="$",d=":"){for(const g in o)s=Df(s,g,o[g],u,d);return s=Ff(s),s}function Df(s,o,u,d="$",g=":"){if(u==="")return s;let B=s.indexOf(`${d}${o}`);for(;B!==-1;){if(s[B+o.length+1]===g)if(s[B+o.length+2]===g)s=s.replace(`${d}${o}${g}${g}`,u);else{const I=Bi(s,B+o.length+2,["_"]);s=s.replace(`${d}${o}${g}${I}`,u)}else s=s.replace(`${d}${o}`,u);B=s.indexOf(`${d}${o}`,B+u.length)}return s}function Ff(s,o="$",u=":"){let d=s.indexOf(o);for(;d!==-1;){const g=Bi(s,d+1);if(s[d+g.length+1]===u)if(s[d+g.length+2]===u)s=s.replace(`${o}${g}${u}${u}`,"");else{const B=Bi(s,d+g.length+2);s=s.replace(`${o}${g}${u}${B}`,B)}d=s.indexOf(o,d+1)}return s}function y1(s,o){let u=s.indexOf("](");for(;u!==-1;){const d=Tf(s,"[",u),g=s.indexOf(")",u);if(d!==-1&&g!==-1){const[B,I]=s.slice(d+1,g).split("]("),V=o(B,I);s=s.slice(0,d)+V+s.slice(g+1)}u=s.indexOf("](",u+1)}return s}function Uf(s,o=!0){const u=Object.entries(s).filter(([d,g])=>g!=null).map(([d,g])=>`${d}=${encodeURIComponent(g)}`).join("&");return u?(o?"?":"")+u:""}function w1(s){const o={},u=s.split("&");for(const d of u){const[g,B]=d.split("=");g&&B&&(o[g]=decodeURIComponent(B))}return o}function A1(s,o){return Object.prototype.hasOwnProperty.call(s,o)}function E1(s,o){let u=null,d=-1/0;for(const[g,B]of Object.entries(s)){const I=o(B);I>d&&(d=I,u=g)}return u?[u,s[u]]:null}function B1(s,o,u,d){const g=s.find(I=>I[o]===u),B=s.find(I=>I[o]===u+d);g&&B?(g[o]=u+d,B[o]=u):g&&(g[o]=u+d),s.sort((I,V)=>yi(I[o])-yi(V[o])),s.forEach((I,V)=>I[o]=V+1)}function R1(s){const o=Object.keys(s);if(o.length===1)return s[o[0]];throw new Error("Expected object to have a single key")}function T1(s,o=":"){return Object.fromEntries(s.map(u=>no(u,o)).map(u=>u[0]&&u[1]?[Ai(u[0]),Ai(u[1])]:null).filter(u=>u))}function v1(s,o){if(!s)return!1;const u=s.message;return typeof u=="string"&&u.includes(o)}function O1(s,o,u){return Gf([s,o])+Uf(u||{})}function C1(s,o=",",u='"'){const d=[];let g="",B=!1;const I=s.split("");for(const V of I)V===o&&!B?(d.push(g),g=""):V===u&&(!g&&!B||B)?B=!B:g+=V;return d.push(g),d}function S1(s){return`[${Math.floor(s.progress*100)}%] ${ks(s.deltaMs)} out of ${ks(s.totalTimeMs)} (${ks(s.remainingTimeMs)} left) [${Math.round(s.baseTimeMs)} ms each]`}async function N1(s,o){let u=o.requiredConsecutivePasses||1,d=0;for(let g=0;g<o.attempts;g++){try{if(await s()){if(d++,d>=u)return}else d=0}catch{d=0}g<o.attempts-1&&await a(o.waitMillis)}throw Error("Timed out waiting for predicate")}function I1(s,o){const u=[];for(let d=s.length-1;d>=0;d--)o(s[d])&&u.push(s.splice(d,1)[0]);return u}function P1(s){return JSON.parse(JSON.stringify(s))}function k1(s){return Math.ceil((s||Date.now())/1e3)}function D1(s){return(s||new Date).toISOString().slice(0,10)}function F1(s){return(s||new Date).toISOString().slice(0,19).replace(/T|:/g,"-")}function U1(s){const o=new Date(s);return new Date(o.getTime()-o.getTimezoneOffset()*6e4)}function L1(s){return new Date(s)}function fn(s){return String(Math.floor(s)).padStart(2,"0")}function M1(s){let[o,u]=s.split(":");ln(parseInt(o,10))||(o="0"),ln(parseInt(u,10))||(u="0");let d=lo(Os(o),0,23),g=lo(Os(u),0,59);return`${fn(d)}:${fn(g)}`}function ks(s){const o=Math.floor(s/36e5);s=s%36e5;const u=Math.floor(s/6e4);s=s%6e4;const d=Math.floor(s/1e3);return o?`${fn(o)}:${fn(u)}:${fn(d)}`:`${fn(u)}:${fn(d)}`}function cr(s){return Math.floor((Gn(s)?s.getTime():s)/864e5)}const V1={today:(s,o)=>fn(s)+":"+fn(o),yesterday:()=>"Yesterday",monday:()=>"Mon",tuesday:()=>"Tue",wednesday:()=>"Wed",thursday:()=>"Thu",friday:()=>"Fri",saturday:()=>"Sat",sunday:()=>"Sun",weeks:s=>`${s}w`};function G1(s,o){const u=new Date(o?.now||Date.now()),d=o?.labels||V1,g=Gn(s)?s:new Date(s);if(cr(u)===cr(g))return d.today(g.getUTCHours(),g.getUTCMinutes(),g.getUTCHours()>12);if(cr(u)-cr(g)===1)return d.yesterday();const B=co(g);return cr(u)-cr(g)<7?d[B.day]():d.weeks(Math.round((u.getTime()-g.getTime())/6048e5))}const Lf={now:()=>"A few seconds",seconds:s=>`${s} seconds`,minutes:s=>`${s} minutes`,hours:s=>`${s} hours`,days:s=>`${s} days`,weeks:s=>`${s} weeks`};function Mf(s,o){const u=o?.now??Date.now(),d=o?.labels||Lf,g=r.Types.isDate(s)?s.getTime():s;let B=(u-g)/1e3;return B<10?d.now():B<120?d.seconds(Math.floor(B)):(B/=60,B<120?d.minutes(Math.floor(B)):(B/=60,B<48?d.hours(Math.floor(B)):(B/=24,B<14?d.days(Math.floor(B)):(B/=7,d.weeks(Math.floor(B))))))}function z1(s,o=Lf){return Mf(0,{now:s*1e3,labels:o})}function H1(s,o,u){const d=(u?.now??Date.now())-s,g=Math.floor(d/o),B=o/(u?.precision??1)-Math.ceil(d%o/(u?.precision??1));return{cycles:g,remaining:B}}const oo={};function $1(s,o){return!oo[s]||Date.now()>oo[s]?(oo[s]=Date.now()+o,!0):!1}const _1={s:1e3,m:6e4,h:36e5,d:864e5};function j1(s,o,u){return o=Gn(o)?o.getTime():o,u=u?Gn(u)?u.getTime():u:Date.now(),(u-o)/_1[s]}function q1(s,o,u,d){d||(d=Date.now());const g=o/u,B=d-s,I=B/o,V=I*u,L=V-B;return{deltaMs:B,progress:g,baseTimeMs:I,totalTimeMs:V,remainingTimeMs:L}}const K1={0:"sunday",1:"monday",2:"tuesday",3:"wednesday",4:"thursday",5:"friday",6:"saturday"};function Vf(s){return{zeroBasedIndex:s,day:K1[s]}}function co(s){return Vf(s.getDay())}function Q1(s){return co(new Date(s))}function J1(s){return s*1e3}function W1(s){return s*6e4}function Y1(s){return s*36e5}function X1(s){return s*864e5}const Z1={ms:1,milli:1,millis:1,millisecond:1,milliseconds:1,s:1e3,sec:1e3,second:1e3,seconds:1e3,m:6e4,min:6e4,minute:6e4,minutes:6e4,h:36e5,hour:36e5,hours:36e5,d:864e5,day:864e5,days:864e5,w:6048e5,week:6048e5,weeks:6048e5,month:2592e6,months:2592e6,y:31536e6,year:31536e6,years:31536e6};function ey(s){const o=parseFloat(s);if(isNaN(o))throw Error("makeDate got NaN for input");const u=s.replace(/^-?[0-9.]+/,"").trim().toLowerCase(),d=u===""?1:Z1[u];if(!d)throw Error(`Unknown unit: "${u}"`);return Math.ceil(o*d)}const ty={b:0,byte:0,bytes:0,kb:1,kilobyte:1,kilobytes:1,mb:2,megabyte:2,megabytes:2,gb:3,gigabyte:3,gigabytes:3,tb:4,terabyte:4,terabytes:4};function ny(s,o=1024){const u=parseFloat(s);if(isNaN(u))throw Error("makeStorage got NaN for input");const d=s.replace(/^-?[0-9.]+/,"").trim().toLowerCase(),g=d===""?0:ty[d];if(g==null)throw Error(`Unknown unit: "${d}"`);return Math.ceil(u*o**g)}function ry(s){return s.replace(/ +/g," ").replace(/^ /gm,"")}const Dr=new Map;async function iy(s,o,u){const d=Date.now(),g=Dr.get(s);if(g&&g.validUntil>d)return g.value;const B=await u(),I=d+o;return Dr.set(s,{value:B,validUntil:I}),B}function sy(s){Dr.delete(s)}function ay(){const s=Date.now();for(const[o,u]of Dr.entries())u.validUntil<=s&&Dr.delete(o)}function oy(){return Dr.size}function Gf(s,o=!1){s=s.filter(B=>B),o&&Xe(s[1])&&(s[1]="../"+s[1]);let u="";Xe(s[0])&&s[0].includes("://")&&(u=eo(s[0],"://")??"",s[0]=Is(s[0],"://")??"");const d=s.map(B=>String(B)).flatMap(B=>B.split("/")),g=[];for(let B=0;B<d.length;B++)d[B]!=="."&&(d[B]===".."?(!u||g.length>1)&&g.pop():g.push(d[B]));return(u?u+"://":"")+g.join("/").replaceAll(/\/{2,}/g,"/")}function cy(s,o,u,d,g=!0){const B=s.indexOf(o),I=s.indexOf(u,B+o.length);if(B===-1||I===-1)throw Error("Start or end not found");return g?s.substring(0,B+o.length)+d+s.substring(I):s.substring(0,B)+d+s.substring(I+u.length)}function uy(s){let o="p";s.startsWith("#")?(o="h1",s=s.slice(1).trim()):s.startsWith("-")&&(o="li",s=s.slice(1).trim());const u=s[0]===s[0].toUpperCase(),d=/[.?!]$/.test(s),g=/:$/.test(s);return{type:o,isCapitalized:u,hasPunctuation:d,endsWithColon:g}}function ly(s,o="(",u=")"){let d=0,g=0;for(;g<s.length;)if(s.startsWith(o,g)?(d++,g+=o.length):s.startsWith(u,g)?(d--,g+=u.length):g++,d<0)return!1;return o===u?d%2===0:d===0}function fy(s){s=s.normalize("NFD").replace(/[\u0300-\u036f]/g,"");let o=s.length;for(;s=s.replace(/(\w+)[\s,']+\w+/g,"$1"),s.length!==o;)o=s.length;return s=s.replaceAll(/[A-Z][a-zA-Z0-9]*/g,"A"),s=s.replaceAll(/[a-z][a-zA-Z0-9]*/g,"a"),s=s.replaceAll(/[\u4E00-\u9FA5]+/g,"Z"),s}function zf(s){const o=Object.keys(s).sort((d,g)=>d.localeCompare(g)),u={};for(const d of o)u[d]=ur(s[d]);return u}function Hf(s){const o=[];return s.sort((u,d)=>JSON.stringify(ur(u)).localeCompare(JSON.stringify(ur(d)))).forEach(u=>o.push(ur(u))),o}function ur(s){return Array.isArray(s)?Hf(s):Ut(s)?zf(s):s}function $f(s,o){return JSON.stringify(ur(s))===JSON.stringify(ur(o))}function hy(...s){for(let o=1;o<s.length;o++)if(!$f(s[o-1],s[o]))return!1;return!0}function dy(s){try{return JSON.parse(s)}catch{return null}}function py(){let s=0;return{next:()=>s++}}function xy(s){let o=0;return{next:()=>s[o++%s.length]}}function my(s){let o;return u=>{const d=u===s&&o!==s;return o=u,d}}function by(s,o,u,d,g){const B={};for(const I of Object.keys(o))B[I]=[];B[d]=[],g&&(s=s.sort(g));for(const I of s){const V=I[u],L=o[V]?V:d;B[L].length>=o[L]?B[d].push(I):B[L].push(I)}return B}function gy(s,o){const u=Object.keys(s),d=Object.keys(o);return{uniqueToA:u.filter(g=>!d.includes(g)),uniqueToB:d.filter(g=>!u.includes(g))}}function _f(s){const o=Object.keys(s);return o[Math.floor(Math.random()*o.length)]}function yy(s,o){const u=_f(s);return s[u]=o(s[u]),u}function wy(s){return s=s.replace(/\r\n/g,`
|
|
10
|
-
`),s=s.replace(/(\w+)\((.+)\)/g,(o,u,d)=>`${u}(${d.replaceAll(",",",")})`),s=s.replace(/(,)(\s+})/g,"$2"),s=s.replace(/\.\.\..+?,/g,""),s=s.replace(/({\s+)([a-zA-Z]\w+),/g,"$1$2: '$2',"),s=s.replace(/(,\s+)([a-zA-Z]\w+),/g,"$1$2: '$2',"),s=s.replace(/:(.+)\?(.+):/g,(o,u,d)=>`: (${u.trim()} && ${d.trim()}) ||`),s=s.replace(/([a-zA-Z0-9]+)( ?: ?{)/g,'"$1"$2'),s=s.replace(/([a-zA-Z0-9]+) ?: ?(.+?)(,|\n|})/g,(o,u,d,g)=>`"${u}":"${d.trim()}"${g}`),s=s.replace(/("'|'")/g,'"'),s=s.replaceAll(",",","),JSON.parse(s)}const zn=[1e3,1e6,1e9,1e12,1e15,1e18,1e21,1e24,1e27,1e30,1e9,1e16,1e18,1e18,1e18,1e33],Ay=["thousand","million","billion","trillion","quadrillion","quintillion","sextillion","septillion","octillion","nonillion","gwei","bzz","btc","eth","dai","decillion"],jf=["K","M","B","T","Qa","Qi","Sx","Sp","O","N","gwei","bzz","eth","btc","dai","D"];function Ey(s,o,u){let d=s.length-o;if(d<=0)return"0."+"0".repeat(-d)+s+(u?" "+u:"");let g=s.substring(0,d),B=s.substring(d);return g===""&&(g="0"),g+"."+B+(u?" "+u:"")}function By(s,o){const u=o?.longForm??!1,d=o?.unit?` ${o.unit}`:"",g=u?Ay:jf,B=o?.precision??1;if(s<zn[0])return`${s}${d}`;for(let I=0;I<zn.length-1;I++)if(s<zn[I+1])return`${(s/zn[I]).toFixed(B)}${u?" ":""}${g[I]}${d}`;return`${(s/zn[zn.length-1]).toFixed(B)}${u?" ":""}${g[zn.length-1]}${d}`}function uo(s){const o=parseFloat(s);if(isNaN(o))throw Error("makeNumber got NaN for input");const u=s.replace(/^-?[0-9.]+/,"").trim(),d=jf.findIndex(g=>g.toLowerCase()===u.toLowerCase());return d===-1?o:o*zn[d]}function lo(s,o,u){return s<o?o:s>u?u:s}function Ry(s,o,u){const d=s+o;return d>u?u:d}function Ty(s,o,u){const d=s-o;return d<u?u:d}function vy(s,o){return o(s),s}function Oy(s,o){s&&o(s)}function Cy(s,o){const u=Object.keys(o);for(const d of u)Array.isArray(o[d])&&Array.isArray(s[d])&&Ss(s[d],o[d])}function Sy(s){return s.splice(0,s.length),s}function Ny(s){for(const o of Object.keys(s))(Ts(s[o])||Array.isArray(s[o])&&s[o].every(u=>u==null))&&delete s[o];return s}function Iy(s){for(const o of Object.entries(s))(o[1]===null||o[1]===void 0||Xe(o[1])&&A(o[1]))&&delete s[o[0]];return s}function Py(s,o){const u={};for(const[d,g]of Object.entries(s))o(d)&&(u[d]=g);return u}function ky(s,o){const u={};for(const[d,g]of Object.entries(s))o(g)&&(u[d]=g);return u}function Dy(s,o){const u={};for(const d of Object.entries(s))u[d[0]]=o(d[1]);return u}function Fy(s,o){const u=[];let d=0;for(const g of s)u.push(o(g,d++));return u}async function Uy(s,o){try{return await s()}catch{throw o}}function Ly(s,o,u){u!=null&&(s[o]=u)}function My(s,o,u,d){const g=ce(u,d);g!=null&&le(s,o,g)}function Vy(s){const o={};for(const[u,d]of Object.entries(s))o[d]=u;return o}function Gy(s){const o=Object.keys(s),u=o.map(V=>s[V].length),d=u.reduce((V,L)=>V*=L);let g=1;const B=[1];for(let V=0;V<u.length-1;V++)g*=u[V],B.push(g);const I=[];for(let V=0;V<d;V++){const L={};for(let te=0;te<o.length;te++){const Ze=s[o[te]],wt=Math.floor(V/B[te])%Ze.length;L[o[te]]=Ze[wt]}I.push(L)}return I}function zy(s){return Object.values(s).filter(o=>o).length}function Hy(s,o,u){return s+(u?"["+o+"]":(s.length?".":"")+o)}function Ds(s,o,u,d,g){if(!Ut(o))return o;for(const[B,I]of Object.entries(o)){const V=Hy(u,B,d);Array.isArray(I)?g?Ds(s,I,V,!0,g):s[V]=I.map(L=>Ds(Array.isArray(L)?[]:{},L,"",!1,g)):Ut(I)?Ds(s,I,V,!1,g):s[V]=I}return s}function $y(s,o=!1,u){return Ds({},s,u||"",!1,o)}function qf(s){if(!Ut(s))return s;const o=Array.isArray(s)?[]:{};for(const[u,d]of Object.entries(s))Array.isArray(d)?le(o,u,d.map(g=>qf(g))):le(o,u,d);return o}function _y(s,o,u){return o[s]?o[s]:u}function Kf(s,o){const u={};for(const d of s){const g=o(d);u[g]=d}return u}function jy(s,o){const u={};for(const d of s){const g=o(d);u[g]||(u[g]=[]),u[g].push(d)}return u}function qy(s,o){const u=[];for(let d=0;d<s.length;d+=o)u.push(s.slice(d,d+o));return u}function Qf(s,o){const u=Math.ceil(s.length/o),d=[];for(let g=0;g<s.length;g+=u)d.push(s.slice(g,g+u));return d}function Jf(s,o){const u=[],d=Math.ceil(s.length/o);for(let g=0;g<d;g++)u.push(s.slice(g*o,g*o+o));return u}function Ky(s,o){const u=Math.ceil(s.length/o);return Jf(s,u)}function Qy(s,o){return Object.values(Kf(s,o))}function Jy(s,o,u,d,g){const B=o?s.map(o):s,I={};for(const L of B)I[L]=(I[L]||0)+1;const V=d?Wf(I,g?(L,te)=>L[1]-te[1]:(L,te)=>te[1]-L[1]):I;return u?Object.keys(V):V}function Wf(s,o){return Object.fromEntries(Object.entries(s).sort(o))}function Wy(s){const o=[],u=Object.keys(s),d=s[u[0]].length;for(let g=0;g<d;g++){const B={};for(const I of u)B[I]=s[I][g];o.push(B)}return o}function Yy(s,o,u=1){for(const d of s)d[o]+=u}function Xy(s,o,u){for(const d of s)d[o]=u}function fo(s,o){const u=[];let d=[];return s.forEach((g,B)=>{(B===0||!o(g,s[B-1]))&&(d=[],u.push(d)),d.push(g)}),u}function Zy(){return{map:new Map,keys:[]}}function e2(){return{map:new Map,keys:[]}}function Yf(s,o,u,d=100){if(s.map.has(o)){const g=s.keys.indexOf(o);s.keys.splice(g,1)}if(s.map.set(o,u),s.keys.push(o),s.keys.length>d){const g=s.keys.shift();g&&s.map.delete(g)}}function t2(s,o,u,d=100){if(s.map.has(o)){const g=s.keys.indexOf(o);s.keys.splice(g,1)}if(s.map.set(o,u),s.keys.unshift(o),s.keys.length>d){const g=s.keys.shift();g&&s.map.delete(g)}}function n2(s,o,u,d,g=100){Yf(s,o,{validUntil:Date.now()+d,data:u},g)}function r2(s,o){const u=s.map.get(o);return u&&u.validUntil>Date.now()?u.data:null}class Hn{constructor(o){this.value=o}static of(o){return new Hn(o)}static empty(){return new Hn(null)}map(o){return new Hn(this.value!==null&&this.value!==void 0?o(this.value):null)}mapAsync(o){return this.value!==null&&this.value!==void 0?o(this.value).then(u=>Hn.of(u)):Promise.resolve(Hn.empty())}ifPresent(o){return this.value!==null&&this.value!==void 0&&o(this.value),this}ifPresentAsync(o){return this.value!==null&&this.value!==void 0?o(this.value).then(()=>this):Promise.resolve(this)}ifAbsent(o){return(this.value===null||this.value===void 0)&&o(),this}ifAbsentAsync(o){return this.value===null||this.value===void 0?o().then(()=>this):Promise.resolve(this)}getOrFallback(o){return this.value??o()}getOrFallbackAsync(o){return this.value!==null&&this.value!==void 0?Promise.resolve(this.value):o()}getOrThrow(){if(this.value===null||this.value===void 0)throw Error("Optional.value is empty");return this.value}}r.Optional=Hn;class i2{constructor(o){this.supplier=o,this.value=null}get(){return this.value||(this.value=this.supplier()),this.value}}r.Lazy=i2;class s2{constructor(o){this.supplier=o,this.value=null}async get(){return this.value||(this.value=await this.supplier()),this.value}}r.AsyncLazy=s2;function a2(s){return()=>s.forEach(o=>o())}function o2(s,o){return s.reduce((u,d)=>o(u)>o(d)?u:d)}function c2(s,o){const u=s.find(d=>d instanceof o);return Hn.of(u)}function u2(s,o){return s.filter(u=>u instanceof o)}function l2(s,o){const u=[],d=Math.max(s.length,o.length);for(let g=0;g<d;g++)s[g]&&u.push(s[g]),o[g]&&u.push(o[g]);return u}function f2(s,o){return s.includes(o)?s.filter(u=>u!==o):[...s,o]}class h2{constructor(o){this.value=o,this.children=[]}}function d2(s,o,u,d,g=!1){const B=new Map,I=[];s.forEach(L=>{const te=new h2(L);B.set(L[o],te)}),s.forEach(L=>{const te=B.get(L[o]);if(!te)return;const Ze=L[u];if(Ze){const wt=B.get(Ze);wt&&wt.children.push(te)}else I.push(te)});const V=L=>{L.children.sort((te,Ze)=>{const wt=te.value[d],Mr=Ze.value[d];return g?Mr-wt:wt-Mr}),L.children.forEach(V)};return I.forEach(V),I}function Xf(s,o){if(Math.log2(s.length)%1!==0)throw new Error("Array length must be a power of 2");let u=[...s];for(;u.length>1;){const d=[];for(let g=0;g<u.length;g+=2){const B=u[g+1];d.push(o(u[g],B))}u=d}return u[0]}function Fr(...s){const o=s.reduce((g,B)=>g+B.length,0),u=new Uint8Array(o);let d=0;return s.forEach(g=>{u.set(g,d),d+=g.length}),u}function Zf(s){return s[0]===137&&s[1]===80&&s[2]===78&&s[3]===71}function e0(s){return s[0]===255&&s[1]===216}function t0(s){return s[8]===87&&s[9]===69&&s[10]===66&&s[11]===80}function p2(s){return Zf(s)||e0(s)||t0(s)}function x2(s){return new Uint8Array([s])}function m2(s){return s[0]}function b2(s,o){const u=new ArrayBuffer(2);return new DataView(u).setUint16(0,s,o==="LE"),new Uint8Array(u)}function g2(s,o){return new DataView(s.buffer).getUint16(s.byteOffset,o==="LE")}function y2(s,o){const u=new ArrayBuffer(4);return new DataView(u).setUint32(0,s,o==="LE"),new Uint8Array(u)}function w2(s,o){return new DataView(s.buffer).getUint32(s.byteOffset,o==="LE")}function ho(s,o){const u=new ArrayBuffer(8);return new DataView(u).setBigUint64(0,BigInt(s),o==="LE"),new Uint8Array(u)}function A2(s,o){return new DataView(s.buffer).getBigUint64(s.byteOffset,o==="LE")}function Ur(s,o){const u=new Uint8Array(32);let d=s;if(o==="LE"){for(let g=0;g<32;g++)u[g]=Number(d&0xffn),d>>=8n;return u}for(let g=31;g>=0;g--)u[g]=Number(d&0xffn),d>>=8n;return u}function Lr(s,o){let u=0n;if(o==="LE"){for(let d=31;d>=0;d--)u=u<<8n|BigInt(s[d]);return u}for(let d=0;d<32;d++)u=u<<8n|BigInt(s[d]);return u}function E2(s,o){const u=[];let d=0;for(const g of o)u.push(s.subarray(d,d+g)),d+=g;return u}function po(s,o){const u=[];for(let d=0;d<s.length;d+=o)u.push(s.subarray(d,d+o));return u}const n0=[0,1,0,32898,2147483648,32906,2147483648,2147516416,0,32907,0,2147483649,2147483648,2147516545,2147483648,32777,0,138,0,136,0,2147516425,0,2147483658,0,2147516555,2147483648,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,0,32778,2147483648,2147483658,2147483648,2147516545,2147483648,32896,0,2147483649,2147483648,2147516424];function B2(s){for(let o=0;o<24;o++){const u=s[0]^s[10]^s[20]^s[30]^s[40],d=s[1]^s[11]^s[21]^s[31]^s[41],g=s[2]^s[12]^s[22]^s[32]^s[42],B=s[3]^s[13]^s[23]^s[33]^s[43],I=s[4]^s[14]^s[24]^s[34]^s[44],V=s[5]^s[15]^s[25]^s[35]^s[45],L=s[6]^s[16]^s[26]^s[36]^s[46],te=s[7]^s[17]^s[27]^s[37]^s[47],Ze=s[8]^s[18]^s[28]^s[38]^s[48],wt=s[9]^s[19]^s[29]^s[39]^s[49],Mr=g<<1|B>>>31,uw=B<<1|g>>>31,vi=Ze^Mr,Oi=wt^uw,lw=I<<1|V>>>31,fw=V<<1|I>>>31,Ci=u^lw,Si=d^fw,hw=L<<1|te>>>31,dw=te<<1|L>>>31,Ni=g^hw,Ii=B^dw,pw=Ze<<1|wt>>>31,xw=wt<<1|Ze>>>31,Pi=I^pw,ki=V^xw,mw=u<<1|d>>>31,bw=d<<1|u>>>31,Di=L^mw,Fi=te^bw;s[0]^=vi,s[1]^=Oi,s[2]^=Ci,s[3]^=Si,s[4]^=Ni,s[5]^=Ii,s[6]^=Pi,s[7]^=ki,s[8]^=Di,s[9]^=Fi,s[10]^=vi,s[11]^=Oi,s[12]^=Ci,s[13]^=Si,s[14]^=Ni,s[15]^=Ii,s[16]^=Pi,s[17]^=ki,s[18]^=Di,s[19]^=Fi,s[20]^=vi,s[21]^=Oi,s[22]^=Ci,s[23]^=Si,s[24]^=Ni,s[25]^=Ii,s[26]^=Pi,s[27]^=ki,s[28]^=Di,s[29]^=Fi,s[30]^=vi,s[31]^=Oi,s[32]^=Ci,s[33]^=Si,s[34]^=Ni,s[35]^=Ii,s[36]^=Pi,s[37]^=ki,s[38]^=Di,s[39]^=Fi,s[40]^=vi,s[41]^=Oi,s[42]^=Ci,s[43]^=Si,s[44]^=Ni,s[45]^=Ii,s[46]^=Pi,s[47]^=ki,s[48]^=Di,s[49]^=Fi;const Ao=s[0],Eo=s[1],Bo=s[2]<<1|s[3]>>>31,Ro=s[3]<<1|s[2]>>>31,To=s[5]<<30|s[4]>>>2,vo=s[4]<<30|s[5]>>>2,Oo=s[6]<<28|s[7]>>>4,Co=s[7]<<28|s[6]>>>4,So=s[8]<<27|s[9]>>>5,No=s[9]<<27|s[8]>>>5,Io=s[11]<<4|s[10]>>>28,Po=s[10]<<4|s[11]>>>28,ko=s[13]<<12|s[12]>>>20,Do=s[12]<<12|s[13]>>>20,Fo=s[14]<<6|s[15]>>>26,Uo=s[15]<<6|s[14]>>>26,Lo=s[17]<<23|s[16]>>>9,Mo=s[16]<<23|s[17]>>>9,Vo=s[18]<<20|s[19]>>>12,Go=s[19]<<20|s[18]>>>12,zo=s[20]<<3|s[21]>>>29,Ho=s[21]<<3|s[20]>>>29,$o=s[22]<<10|s[23]>>>22,_o=s[23]<<10|s[22]>>>22,jo=s[25]<<11|s[24]>>>21,qo=s[24]<<11|s[25]>>>21,Ko=s[26]<<25|s[27]>>>7,Qo=s[27]<<25|s[26]>>>7,Jo=s[29]<<7|s[28]>>>25,Wo=s[28]<<7|s[29]>>>25,Yo=s[31]<<9|s[30]>>>23,Xo=s[30]<<9|s[31]>>>23,Zo=s[33]<<13|s[32]>>>19,ec=s[32]<<13|s[33]>>>19,tc=s[34]<<15|s[35]>>>17,nc=s[35]<<15|s[34]>>>17,rc=s[36]<<21|s[37]>>>11,ic=s[37]<<21|s[36]>>>11,sc=s[38]<<8|s[39]>>>24,ac=s[39]<<8|s[38]>>>24,oc=s[40]<<18|s[41]>>>14,cc=s[41]<<18|s[40]>>>14,uc=s[42]<<2|s[43]>>>30,lc=s[43]<<2|s[42]>>>30,fc=s[45]<<29|s[44]>>>3,hc=s[44]<<29|s[45]>>>3,dc=s[47]<<24|s[46]>>>8,pc=s[46]<<24|s[47]>>>8,xc=s[48]<<14|s[49]>>>18,mc=s[49]<<14|s[48]>>>18;s[0]=Ao^~ko&jo,s[1]=Eo^~Do&qo,s[2]=ko^~jo&rc,s[3]=Do^~qo&ic,s[4]=jo^~rc&xc,s[5]=qo^~ic&mc,s[6]=rc^~xc&Ao,s[7]=ic^~mc&Eo,s[8]=xc^~Ao&ko,s[9]=mc^~Eo&Do,s[10]=Oo^~Vo&zo,s[11]=Co^~Go&Ho,s[12]=Vo^~zo&Zo,s[13]=Go^~Ho&ec,s[14]=zo^~Zo&fc,s[15]=Ho^~ec&hc,s[16]=Zo^~fc&Oo,s[17]=ec^~hc&Co,s[18]=fc^~Oo&Vo,s[19]=hc^~Co&Go,s[20]=Bo^~Fo&Ko,s[21]=Ro^~Uo&Qo,s[22]=Fo^~Ko&sc,s[23]=Uo^~Qo&ac,s[24]=Ko^~sc&oc,s[25]=Qo^~ac&cc,s[26]=sc^~oc&Bo,s[27]=ac^~cc&Ro,s[28]=oc^~Bo&Fo,s[29]=cc^~Ro&Uo,s[30]=So^~Io&$o,s[31]=No^~Po&_o,s[32]=Io^~$o&tc,s[33]=Po^~_o&nc,s[34]=$o^~tc&dc,s[35]=_o^~nc&pc,s[36]=tc^~dc&So,s[37]=nc^~pc&No,s[38]=dc^~So&Io,s[39]=pc^~No&Po,s[40]=To^~Lo&Jo,s[41]=vo^~Mo&Wo,s[42]=Lo^~Jo&Yo,s[43]=Mo^~Wo&Xo,s[44]=Jo^~Yo&uc,s[45]=Wo^~Xo&lc,s[46]=Yo^~uc&To,s[47]=Xo^~lc&vo,s[48]=uc^~To&Lo,s[49]=lc^~vo&Mo,s[0]^=n0[o*2],s[1]^=n0[o*2+1]}}function r0(s){const o=[];for(let u=0;u<s.length;u+=4)o.push(s[u]|s[u+1]<<8|s[u+2]<<16|s[u+3]<<24);return o}function i0(s,o){if(!s.length){const g=new Uint8Array(136);return g[0]=o,g[135]=128,[r0(g)]}const u=po(s,136),d=u[u.length-1];if(d.length<136){const g=new Uint8Array(136);g.set(d),g[d.length]=o,g[135]|=128,u[u.length-1]=g}if(d.length===136){const g=new Uint8Array(136);g[0]=o,g[135]=128,u.push(g)}return u.map(r0)}function s0(s,o){for(const u of o){for(let d=0;d<34;d+=2)s[d]^=u[d+1],s[d+1]^=u[d];B2(s)}return s}function a0(s){return new Uint8Array([s[1],s[1]>>-24,s[1]>>-16,s[1]>>-8,s[0],s[0]>>8,s[0]>>16,s[0]>>24,s[3],s[3]>>-24,s[3]>>-16,s[3]>>-8,s[2],s[2]>>8,s[2]>>16,s[2]>>24,s[5],s[5]>>-24,s[5]>>-16,s[5]>>-8,s[4],s[4]>>8,s[4]>>16,s[4]>>24,s[7],s[7]>>-24,s[7]>>-16,s[7]>>-8,s[6],s[6]>>8,s[6]>>16,s[6]>>24])}function $n(s){return a0(s0(new Array(50).fill(0),i0(s,1)))}function R2(s){return a0(s0(new Array(50).fill(0),i0(s,6)))}function T2(s,o){const u=Math.min(s.length,o.length);for(let d=0;d<u;d++){const g=s[d]^o[d];for(let B=0;B<8;B++)if(g>>7-B&1)return d*8+B}return Math.min(s.length,o.length)*8}function v2(s,o){const u=Math.min(s.length,o.length);for(let d=0;d<u;d++)if(s[d]!==o[d])return s.subarray(0,d);return s.subarray(0,u)}function O2(s,o,u,d){const g=Math.floor(o/8),B=o%8;u===1?s[g]|=1<<(d==="BE"?7-B:B):s[g]&=~(1<<(d==="BE"?7-B:B))}function C2(s,o,u){const d=Math.floor(o/8),g=o%8;return s[d]>>(u==="BE"?7-g:g)&1}function S2(s,o,u=0){for(let d=u;d<s.length;d++)for(let g=0;g<o.length&&s[d+g]===o[g];g++)if(g===o.length-1)return d;return-1}function o0(s,o,u=0){if(s.length>=o)return s;const d=new Uint8Array(o);return d.fill(u),d.set(s,o-s.length),d}function N2(s,o,u=0){const d=s.length%o;return d===0?s:o0(s,s.length+o-d,u)}function c0(s,o,u=0){if(s.length>=o)return s;const d=new Uint8Array(o);return d.fill(u),d.set(s,0),d}function I2(s,o,u=0){const d=s.length%o;return d===0?s:c0(s,s.length+o-d,u)}function P2(s,o){const u=new Uint8Array(s.length);for(let d=0;d<s.length;d++)u[d]=s[d]^o[d%o.length];return u}function k2(s){for(let o=0;o<s.length;o++){const u=s[o];if(!(u<128))if((u&224)===192){if(o+1>=s.length||(s[o+1]&192)!==128)return!1;o+=1}else if((u&240)===224){if(o+2>=s.length||(s[o+1]&192)!==128||(s[o+2]&192)!==128)return!1;o+=2}else if((u&248)===240){if(o+3>=s.length||(s[o+1]&192)!==128||(s[o+2]&192)!==128||(s[o+3]&192)!==128)return!1;o+=3}else return!1}return!0}function D2(s,o){if(s.length!==o.length)return!1;for(let u=0;u<s.length;u++)if(s[u]!==o[u])return!1;return!0}function Fe(s,o){return(s%o+o)%o}function Ri(s,o){s=Fe(s,o);let[u,d]=[0n,1n],[g,B]=[o,s];for(;B!==0n;){const I=g/B;[u,d]=[d,u-I*d],[g,B]=[B,g-I*B]}if(g>1n)throw new Error("a is not invertible");return u<0n&&(u+=o),u}function F2(s,o,u){let d=1n;for(s=Fe(s,u);o>0;)o%2n===1n&&(d=Fe(d*s,u)),s=Fe(s*s,u),o=o/2n;return d}function u0(s,o){return Fe(s,o)===0n?0n:o%4n===3n?F2(s,(o+1n)/4n,o):null}const dt=0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2fn,nt=0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n,Fs=0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798n,Us=0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8n;function xo(s,o,u){if(o===0n)return[0n,0n];const d=Fe(3n*s*s*Ri(2n*o,u),u),g=Fe(d*d-2n*s,u),B=Fe(d*(s-g)-o,u);return[g,B]}function Ls(s,o,u,d,g){if(s===0n&&o===0n)return[u,d];if(u===0n&&d===0n)return[s,o];if(s===u&&o===Fe(-d,g))return[0n,0n];if(s===u&&o===d)return xo(s,o,g);const B=Fe((d-o)*Ri(u-s,g),g),I=Fe(B*B-s-u,g),V=Fe(B*(s-I)-o,g);return[I,V]}function U2(s){if(s<=0n||s>=nt)throw new Error("Invalid private key");return lr(Fs,Us,s,dt)}function L2(s){const o=s[1]%2n===0n?2:3;return new Uint8Array([o,...Ur(s[0],"BE")])}function M2(s){if(s.length!==33||s[0]!==2&&s[0]!==3)throw new Error("Invalid compressed public key");const o=Lr(s.slice(1),"BE"),u=u0(Fe(o**3n+7n,dt),dt);if(!u)throw Error("Invalid x: does not correspond to a valid curve point");const d=Fe(-u,dt),g=u%2n===0n;return[o,s[0]===2?g?u:d:g?d:u]}function V2(s){const o=new Uint8Array(20),u=$n(Fr(Ur(s[0],"BE"),Ur(s[1],"BE")));return o.set(u.subarray(12)),o}function G2(s){const o=r.Binary.uint8ArrayToHex(s),u=r.Binary.uint8ArrayToHex(r.Binary.keccak256(new Uint8Array([...o].map(g=>g.charCodeAt(0)))));let d="0x";for(let g=0;g<o.length;g++)parseInt(u[g],16)>7?d+=o[g].toUpperCase():d+=o[g];return d}function lr(s,o,u,d){let g=[0n,0n],B=[s,o];const I=u.toString(2);for(const V of I)V==="0"?(B=Ls(g[0],g[1],B[0],B[1],d),g=xo(g[0],g[1],d)):(g=Ls(g[0],g[1],B[0],B[1],d),B=xo(B[0],B[1],d));return g}function z2(s,o,u){return l0(Lr($n(s),"BE"),o,u)}function l0(s,o,u){if(o<=0n||o>=nt)throw new Error("Invalid private key");if(u||(u=Fe(Lr($n(Fr($n(Ur(o,"BE")),Ur(s,"BE"))),"BE"),nt)),u<=0n||u>=nt)throw new Error("Invalid nonce");const d=Fe(s,nt),g=lr(Fs,Us,u,dt),B=Fe(g[0],nt);let I=Fe((d+Fe(B,nt)*o)*Ri(u,nt),nt);if(B===0n||I===0n)throw new Error("Invalid r or s value");let V=g[1]%2n===0n?27n:28n;return I>nt/2n&&(I=nt-I,V=V===27n?28n:27n),[B,I,V]}function H2(s,o,u,d){const g=u0(Fe(o**3n+7n,dt),dt);if(!g)throw new Error("Invalid r: does not correspond to a valid curve point");const B=d===27n?0n:1n,I=g%2n===B?g:dt-g,V=Fe(Lr($n(s),"BE"),nt),L=lr(o,I,u,dt),te=lr(Fs,Us,V,dt),Ze=Ls(L[0],L[1],te[0],Fe(-te[1],dt),dt);return lr(Ze[0],Ze[1],Ri(o,nt),dt)}function $2(s,o,u,d){const g=Fe(Lr($n(s),"BE"),nt),B=Ri(d,nt),I=Fe(g*B,nt),V=Fe(u*B,nt),L=lr(Fs,Us,I,dt),te=lr(o[0],o[1],V,dt),Ze=Ls(L[0],L[1],te[0],te[1],dt);return u===Fe(Ze[0],nt)}class f0{constructor(o){this.cursor=0,this.buffer=o}read(o){const u=this.buffer.subarray(this.cursor,this.cursor+o);return this.cursor+=o,u}max(){return this.buffer.length-this.cursor}}r.Uint8ArrayReader=f0;class h0{constructor(o){this.buffer=o,this.cursor=0}write(o){const u=Math.min(this.max(),o.max());return this.buffer.set(o.read(u),this.cursor),this.cursor+=u,u}max(){return this.buffer.length-this.cursor}}r.Uint8ArrayWriter=h0;class _n{constructor(o,u=0n){this.span=u,this.writer=new h0(new Uint8Array(o))}build(){return Fr(ho(this.span,"LE"),this.writer.buffer)}hash(){const o=Xf(po(this.writer.buffer,32),(u,d)=>_n.hashFunction(Fr(u,d)));return _n.hashFunction(Fr(ho(this.span,"LE"),o))}}r.Chunk=_n,_n.hashFunction=$n;class mo{constructor(o,u=4096){this.counters=[1],this.capacity=u,this.chunks=[new _n(u)],this.onChunk=o}static async root(o,u=4096){const d=new e(e.NOOP,u);return await d.append(o),d.finalize()}async append(o,u=0,d=0n){const g=new f0(o);for(;g.max()>0;){this.chunks[u].writer.max()===0&&await this.elevate(u);const B=this.chunks[u].writer.write(g);d?this.chunks[u].span+=d:this.chunks[0].span+=BigInt(B)}}async elevate(o){this.counters[o]=++this.counters[o]%(this.capacity/32),this.chunks[o+1]||(this.chunks.push(new _n(this.capacity)),this.counters.push(1)),await this.append(this.chunks[o].hash(),o+1,this.chunks[o].span),await this.onChunk(this.chunks[o]),this.chunks[o]=new _n(this.capacity)}async finalize(o=0){return this.chunks[o+1]?this.counters[o]===1?(await this.elevate(o+1),this.chunks[o+1]=this.chunks[o],this.finalize(o+1)):(await this.elevate(o),this.finalize(o+1)):(await this.onChunk(this.chunks[o]),this.chunks[o])}}r.MerkleTree=mo,e=mo,mo.NOOP=async s=>{};class Nt{constructor(o,u){if(u<0)throw Error("Scale must be non-negative");this.value=BigInt(o),this.scale=u}static cast(o){if(!o)throw Error("Cannot cast falsy value to FixedPointNumber");if(o instanceof Nt)return o;const u=hf(o.value),d=yi(o.scale);return new Nt(u,d)}static fromDecimalString(o,u){/e\-\d+$/i.test(o)&&(o=parseFloat(o).toFixed(u));let[d,g]=o.split(".");return g=(g||"").padEnd(u,"0").slice(0,u),new Nt(BigInt(d+g),u)}static fromFloat(o,u){return Nt.fromDecimalString(o.toString(),u)}add(o){return this.assertSameScale(o),new Nt(this.value+o.value,this.scale)}subtract(o){return this.assertSameScale(o),new Nt(this.value-o.value,this.scale)}multiply(o){return new Nt(this.value*o,this.scale)}divmod(o){if(o===0n)throw new Error("Division by zero is not allowed");const u=this.value/o,d=this.value%o;return[new Nt(u,this.scale),new Nt(d,this.scale)]}exchange(o,u,d){if(o==="*"){const B=this.value*u.value/10n**BigInt(this.scale);return new Nt(B,d)}this.assertSameScale(u);const g=this.value*10n**BigInt(d)/u.value;return new Nt(g,d)}compare(o){return this.assertSameScale(o),this.value>o.value?1:this.value<o.value?-1:0}toDecimalString(){if(this.scale===0)return this.value.toString();const o=this.value.toString(),u=o.slice(0,-this.scale)||"0",d=o.slice(-this.scale).padStart(this.scale,"0");return`${u}.${d}`}toString(){return this.value.toString()}toJSON(){return this.toString()}toFloat(){return parseFloat(this.toDecimalString())}assertSameScale(o){if(this.scale!==o.scale)throw new Error(`Scale mismatch: expected ${this.scale}, but got ${o.scale}`)}}r.FixedPointNumber=Nt;function _2(s){if(s.length===0)return null;const o=s[0];return o.ttlMax?--o.ttl<=0&&s.shift():o.ttlMax=o.ttl,{progress:(o.ttlMax-o.ttl)/o.ttlMax,data:o.data}}function Ms(s,o,u,d){const g=s.findIndex(V=>V===`--${o}`||V.startsWith(`--${o}=`)),B=s[g];if(!B)return(u||{})[d||o||""]||null;if(B.includes("="))return B.split("=")[1];const I=s[g+1];return I&&!I.startsWith("-")?I:(u||{})[d||o||""]||null}function j2(s,o,u,d){const g=Ms(s,o,u,d);if(!g)return null;try{return uo(g)}catch{throw new Error(`Invalid number argument ${o}: ${g}`)}}function q2(s,o,u,d){const g=s.some(L=>L.endsWith("-"+o)),B=Ms(s,o,u,d);if(!B&&g)return!0;if(!B&&!g)return null;const I=["true","1","yes","y","on"],V=["false","0","no","n","off"];if(I.includes(B.toLowerCase()))return!0;if(V.includes(B.toLowerCase()))return!1;throw Error(`Invalid boolean argument ${o}: ${B}`)}function d0(s,o,u,d){const g=Ms(s,o,u,d);if(!g)throw new Error(`Missing argument ${o}`);return g}function K2(s,o,u,d){const g=d0(s,o,u,d);try{return uo(g)}catch{throw new Error(`Invalid argument ${o}: ${g}`)}}function p0(s,o){const u=s[o];s.splice(o,1),s.unshift(u)}function Q2(s,o){const u=[...s];return p0(u,o),u}function x0(s,o){return{x:s.x+o.x,y:s.y+o.y}}function J2(s,o){return{x:s.x-o.x,y:s.y-o.y}}function bo(s,o){return{x:s.x*o,y:s.y*o}}function W2(s){const o=Math.sqrt(s.x*s.x+s.y*s.y);return{x:s.x/o,y:s.y/o}}function m0(s,o,u){return{x:s.x+Math.cos(o)*u,y:s.y+Math.sin(o)*u}}function b0(s,o){return Math.sqrt((s.x-o.x)**2+(s.y-o.y)**2)}function Ti(s,o,u="row-first"){const d=[];if(u==="column-first")for(let g=0;g<s.length;g++)for(let B=0;B<s[0].length;B++)o(g,B)&&d.push({x:g,y:B});else for(let g=0;g<s[0].length;g++)for(let B=0;B<s.length;B++)o(B,g)&&d.push({x:B,y:g});return d}function Y2(s,o,u){return s[o+1]?.[u]&&s[o-1]?.[u]&&!s[o][u-1]&&!s[o][u+1]}function X2(s,o,u){return s[o][u+1]&&s[o][u-1]&&!s[o-1]?.[u]&&!s[o+1]?.[u]}function g0(s,o,u){return!s[o-1]?.[u]}function y0(s,o,u){return!s[o+1]?.[u]}function w0(s,o,u){return!s[o][u-1]}function A0(s,o,u){return!s[o][u+1]}function Z2(s,o,u){const d=[];return s[o][u]?Y2(s,o,u)||X2(s,o,u)?[]:(!s[o-1]?.[u-1]&&g0(s,o,u)&&w0(s,o,u)&&d.push({x:o,y:u}),!s[o+1]?.[u-1]&&y0(s,o,u)&&w0(s,o,u)&&d.push({x:o+1,y:u}),!s[o-1]?.[u+1]&&g0(s,o,u)&&A0(s,o,u)&&d.push({x:o,y:u+1}),!s[o+1]?.[u+1]&&y0(s,o,u)&&A0(s,o,u)&&d.push({x:o+1,y:u+1}),d):(s[o-1]?.[u]&&s[o][u-1]&&d.push({x:o,y:u}),s[o+1]?.[u]&&s[o][u-1]&&d.push({x:o+1,y:u}),s[o-1]?.[u]&&s[o][u+1]&&d.push({x:o,y:u+1}),s[o+1]?.[u]&&s[o][u+1]&&d.push({x:o+1,y:u+1}),d)}function ew(s,o,u,d){const g=[{x:0,y:0},{x:u,y:0},{x:0,y:d},{x:u,y:d}];for(let B=0;B<s.length;B++)for(let I=0;I<s[0].length;I++){const V=Z2(s,B,I);for(const L of V)g.some(te=>te.x===L.x&&te.y===L.y)||g.push(L)}return g.map(B=>({x:B.x*o,y:B.y*o}))}function tw(s,o){const u=Ti(s,(L,te)=>s[L][te]===0&&s[L][te+1]!==0,"row-first").map(L=>({...L,dx:1,dy:0})),d=Ti(s,(L,te)=>s[L][te]===0&&s[L][te-1]!==0,"row-first").map(L=>({...L,dx:1,dy:0})),g=Ti(s,(L,te)=>s[L][te]===0&&s[L-1]?.[te]!==0,"column-first").map(L=>({...L,dx:0,dy:1})),B=Ti(s,(L,te)=>s[L][te]===0&&s[L+1]?.[te]!==0,"column-first").map(L=>({...L,dx:0,dy:1}));u.forEach(L=>L.y++),B.forEach(L=>L.x++);const I=fo([...g,...B],(L,te)=>L.x===te.x&&L.y-1===te.y),V=fo([...d,...u],(L,te)=>L.y===te.y&&L.x-1===te.x);return[...I,...V].map(L=>({start:L[0],end:he(L)})).map(L=>({start:bo(L.start,o),end:bo(x0(L.end,{x:L.start.dx,y:L.start.dy}),o)}))}function nw(s,o){return Math.atan2(o.y-s.y,o.x-s.x)}function rw(s,o){return o.map(u=>nw(s,u)).sort((u,d)=>u-d)}function E0(s,o,u,d){const g=(d.y-u.y)*(o.x-s.x)-(d.x-u.x)*(o.y-s.y);if(g===0)return null;let B=s.y-u.y,I=s.x-u.x;const V=(d.x-u.x)*B-(d.y-u.y)*I,L=(o.x-s.x)*B-(o.y-s.y)*I;return B=V/g,I=L/g,B>0&&B<1&&I>0&&I<1?{x:s.x+B*(o.x-s.x),y:s.y+B*(o.y-s.y)}:null}function go(s,o,u){const d=[],g=m0(s,u,1e4);for(const B of o){const I=E0(s,g,B.start,B.end);I&&d.push(I)}return d.length?d.reduce((B,I)=>{const V=b0(s,I),L=b0(s,B);return V<L?I:B}):null}function iw(s,o,u){const d=rw(s,u),g=[];for(const B of d){const I=go(s,o,B-.001),V=go(s,o,B+.001);I&&g.push(I),V&&g.push(V)}return g}class yo{constructor(){this.subscribers=[]}subscribe(o){return this.subscribers.push(o),()=>{this.subscribers=this.subscribers.filter(u=>u!==o)}}publish(o){this.subscribers.forEach(u=>u(o))}clear(){this.subscribers=[]}getSubscriberCount(){return this.subscribers.length}}r.PubSubChannel=yo;class sw{constructor(o,u){this.queue=[],this.running=0,this.onProcessed=new yo,this.onDrained=new yo,this.concurrency=o,this.capacity=u}process(){if(this.running>=this.concurrency)return;const o=this.queue.shift();o&&(this.running++,o().finally(()=>{this.running--,this.process(),this.onProcessed.publish(),this.running===0&&this.onDrained.publish()}))}enqueue(o){if(this.queue.length<this.capacity)return this.queue.push(o),this.process(),Promise.resolve();if(this.onProcessed.getSubscriberCount())throw Error("Queue capacity is full");return new Promise(u=>{this.onProcessed.subscribe(()=>{this.queue.length<this.capacity&&(this.queue.push(o),this.process(),this.onProcessed.clear(),u())})})}drain(){if(this.running===0)return Promise.resolve();if(this.onDrained.getSubscriberCount())throw Error("Already draining");return new Promise(o=>{this.onDrained.subscribe(()=>{this.onDrained.clear(),o()})})}}r.AsyncQueue=sw;class wo{constructor(){this.forks=new Map}insert(o,u){if(o.length===0){this.handler=u;return}const d=o[0];let g=d,B;if(d.startsWith(":")&&(g=":",B=d.slice(1)),!this.forks.has(g)){const I=new wo;B&&(I.variableName=B),this.forks.set(g,I)}this.forks.get(g).insert(o.slice(1),u)}async handle(o,u,d,g){if(o.length===0)return this.handler?(await this.handler(u,d,g),!0):!1;const B=o[0],I=this.forks.get(B);if(I)return I.handle(o.slice(1),u,d,g);const V=this.forks.get(":");if(V)return V.variableName&&g.set(V.variableName,decodeURIComponent(B)),V.handle(o.slice(1),u,d,g);const L=this.forks.get("*");return L?(g.set("wildcard",o.join("/")),L.handler?(await L.handler(u,d,g),!0):!1):!1}}r.TrieRouter=wo;class aw{constructor(o){this.index=0,this.values=o}current(){return this.values[this.index]}next(){return this.index=(this.index+1)%this.values.length,this.values[this.index]}}r.RollingValueProvider=aw;class ow{constructor(){this.status="pending",this.steps=[],this.onStatusChange=async()=>{},this.onStepChange=async()=>{},this.onFinish=async()=>{},this.onError=async()=>{},this.context=new Map}getStatus(){return this.status}createInitialState(){return Object.fromEntries(this.steps.map(o=>[o.name,"pending"]))}setHooks(o){o.onStatusChange&&(this.onStatusChange=o.onStatusChange),o.onStepChange&&(this.onStepChange=o.onStepChange),o.onFinish&&(this.onFinish=o.onFinish),o.onError&&(this.onError=o.onError)}addStep(o){if(this.steps.find(u=>u.name===o.name))throw Error(`Step with name ${o.name} already exists`);this.steps.push(o)}async execute(){if(this.status!=="pending")throw Error(`Cannot execute solver in status ${this.status}`);this.status="in-progress",await this.onStatusChange(this.status);let o=this.createInitialState();for(const u of this.steps)try{if(u.transientSkipStepName){const d=o[u.transientSkipStepName];if(d==="skipped"||d==="failed"){o={...o,[u.name]:"skipped"},await this.onStepChange(o);continue}}if(!(!u.precondition||await u.precondition(this.context))){o={...o,[u.name]:"skipped"},await this.onStepChange(o);continue}o={...o,[u.name]:"in-progress"},await this.onStepChange(o);for(let d=0;await u.action(this.context,d)==="retry";d++);o={...o,[u.name]:"completed"},await this.onStepChange(o)}catch(d){throw o={...o,[u.name]:"failed"},this.status="failed",await this.onStatusChange(this.status),await this.onStepChange(o),await this.onError(d),d}return this.status="completed",await this.onStatusChange(this.status),await this.onFinish(),this.context}}r.Solver=ow;class cw{constructor(o){this.queryFunction=o.queryFunction,this.lockFunction=o.lockFunction,this.unlockFunction=o.unlockFunction,this.timeoutMillis=o.timeoutMillis}async couldLock(){const o=await this.queryFunction();try{const u=Os(o);if(Date.now()<u+this.timeoutMillis)return new Date(u+this.timeoutMillis)}catch{}return await this.lockFunction(Date.now().toString()),!0}async unlock(){await this.unlockFunction()}}r.Lock=cw,r.Binary={hexToUint8Array:n1,uint8ArrayToHex:r1,binaryToUint8Array:s1,uint8ArrayToBinary:i1,base64ToUint8Array:Xg,uint8ArrayToBase64:Zg,base32ToUint8Array:e1,uint8ArrayToBase32:t1,log2Reduce:Xf,partition:po,concatBytes:Fr,numberToUint8:x2,uint8ToNumber:m2,numberToUint16:b2,uint16ToNumber:g2,numberToUint32:y2,uint32ToNumber:w2,numberToUint64:ho,uint64ToNumber:A2,numberToUint256:Ur,uint256ToNumber:Lr,sliceBytes:E2,keccak256:$n,sha3_256:R2,proximity:T2,commonPrefix:v2,setBit:O2,getBit:C2,indexOf:S2,equals:D2,padStart:o0,padStartToMultiple:N2,padEnd:c0,padEndToMultiple:I2,xorCypher:P2,isUtf8:k2},r.Elliptic={privateKeyToPublicKey:U2,compressPublicKey:L2,publicKeyFromCompressed:M2,publicKeyToAddress:V2,signMessage:z2,signHash:l0,verifySignature:$2,recoverPublicKey:H2,checksumEncode:G2},r.Random={intBetween:D,floatBetween:U,chance:z,signed:K,makeSeededRng:S,point:j,procs:F},r.Arrays={countUnique:Jy,makeUnique:Qy,splitBySize:qy,splitByCount:Qf,index:Kf,indexCollection:jy,onlyOrThrow:l,onlyOrNull:f,firstOrThrow:h,firstOrNull:p,shuffle:c,initialize:x,initialize2D:E,rotate2D:y,containsShape:v,glue:og,pluck:C,pick:W,pickMany:ne,pickManyUnique:ie,pickWeighted:Q,pickRandomIndices:R,pickGuaranteed:de,last:he,pipe:ye,makePipe:q,sortWeighted:ae,pushAll:Ss,unshiftAll:sg,filterAndRemove:I1,merge:Cy,empty:Sy,pushToBucket:ng,unshiftAndLimit:rg,atRolling:ig,group:fo,createOscillator:xy,organiseWithLimits:by,tickPlaybook:_2,getArgument:Ms,getBooleanArgument:q2,getNumberArgument:j2,requireStringArgument:d0,requireNumberArgument:K2,bringToFront:Q2,bringToFrontInPlace:p0,findInstance:c2,filterInstances:u2,interleave:l2,toggle:f2,createHierarchy:d2,multicall:a2,maxBy:o2},r.System={sleepMillis:a,forever:fe,scheduleMany:pg,waitFor:N1,expandError:Xb,runAndSetInterval:ke,whereAmI:Ye,withRetries:Jt},r.Numbers={make:uo,sum:mg,average:bg,median:gg,getDistanceFromMidpoint:yg,clamp:lo,range:xf,interpolate:xg,createSequence:py,increment:Ry,decrement:Ty,format:By,fromDecimals:Ey,makeStorage:ny,asMegabytes:Ft,convertBytes:Wt,hexToRgb:Yt,rgbToHex:ht,haversineDistanceToMeters:Xt,roundToNearest:Zt,formatDistance:sr,triangularNumber:en,searchFloat:ar,binomialSample:Ya,toSignificantDigits:Xa},r.Promises={raceFulfilled:n,invert:t,runInParallelBatches:i},r.Dates={getTimestamp:G1,getTimeDelta:Mf,secondsToHumanTime:z1,countCycles:H1,isoDate:D1,throttle:$1,timeSince:j1,dateTimeSlug:F1,unixTimestamp:k1,fromUtcString:U1,fromMillis:L1,getProgress:q1,humanizeTime:ks,humanizeProgress:S1,createTimeDigits:fn,mapDayNumber:Vf,getDayInfoFromDate:co,getDayInfoFromDateTimeString:Q1,seconds:J1,minutes:W1,hours:Y1,days:X1,make:ey,normalizeTime:M1,absoluteDays:cr},r.Objects={safeParse:dy,deleteDeep:X,getDeep:ce,setDeep:le,incrementDeep:Re,ensureDeep:P,replaceDeep:oe,getFirstDeep:ue,deepMergeInPlace:or,deepMerge2:Zb,deepMerge3:eg,mapAllAsync:ag,cloneWithJson:P1,sortObject:zf,sortArray:Hf,sortAny:ur,deepEquals:$f,deepEqualsEvery:hy,runOn:vy,ifPresent:Oy,zip:pf,zipSum:tg,removeEmptyArrays:Ny,removeEmptyValues:Iy,flatten:$y,unflatten:qf,match:_y,sort:Wf,map:Dy,mapIterable:Fy,filterKeys:Py,filterValues:ky,rethrow:Uy,setSomeOnObject:Ly,setSomeDeep:My,flip:Vy,getAllPermutations:Gy,countTruthyValues:zy,transformToArray:Wy,setMulti:Xy,incrementMulti:Yy,createBidirectionalMap:Zy,createTemporalBidirectionalMap:e2,pushToBidirectionalMap:Yf,unshiftToBidirectionalMap:t2,addToTemporalBidirectionalMap:n2,getFromTemporalBidirectionalMap:r2,createStatefulToggle:my,diffKeys:gy,pickRandomKey:_f,mapRandomKey:yy,fromObjectString:wy,toQueryString:Uf,parseQueryString:w1,hasKey:A1,selectMax:E1,reposition:B1,unwrapSingleKey:R1,parseKeyValues:T1,errorMatches:v1},r.Types={isFunction:yt,isObject:Ut,isStrictlyObject:Mn,isEmptyArray:Ts,isEmptyObject:vs,isUndefined:Vn,isString:Xe,isNumber:ln,isBoolean:tn,isDate:Gn,isBlank:A,isId:m,isIntegerString:b,isHexString:T,isUrl:lf,isBigint:ff,isNullable:Kb,asString:cf,asHexString:kb,asSafeString:Db,asIntegerString:Pb,asNumber:yi,asFunction:Fb,asInteger:Os,asBoolean:Ub,asDate:Lb,asNullableString:Mb,asEmptiableString:Vb,asId:Gb,asTime:zb,asArray:Hb,asObject:Cs,asNullableObject:$b,asStringMap:_b,asNumericDictionary:jb,asUrl:qb,asBigint:hf,asEmptiable:Jb,asNullable:Qb,asOptional:Wb,enforceObjectShape:df,enforceArrayShape:Yb,isPng:Zf,isJpg:e0,isWebp:t0,isImage:p2},r.Strings={tokenizeByCount:Ky,tokenizeByLength:Jf,searchHex:Sb,searchSubstring:Nb,randomHex:Ib,randomLetter:Tb,randomAlphanumeric:vb,randomRichAscii:Ob,randomUnicode:Cb,includesAny:wg,slugify:Za,normalForm:Eg,enumify:Cg,escapeHtml:Ng,decodeHtmlEntities:Pg,after:Is,afterLast:mf,before:eo,beforeLast:to,betweenWide:kg,betweenNarrow:Dg,getPreLine:ry,containsWord:ao,containsWords:x1,joinUrl:Gf,getFuzzyMatchScore:Ns,sortByFuzzyScore:Sg,splitOnce:no,splitAll:bf,randomize:Mg,expand:gf,shrinkTrim:Ai,capitalize:Ps,decapitalize:yf,csvEscape:_g,parseCsv:C1,surroundInOut:Og,getExtension:ro,getBasename:io,normalizeEmail:Fg,normalizeFilename:Ug,parseFilename:Lg,camelToTitle:Bg,slugToTitle:Rg,slugToCamel:Tg,joinHumanly:vg,findWeightedPair:vf,extractBlock:Of,extractAllBlocks:Kg,replaceBlocks:Qg,indexOfEarliest:kr,lastIndexOfBefore:Tf,parseHtmlAttributes:m1,readNextWord:Bi,readWordsAfterAll:b1,resolveVariables:g1,resolveVariableWithDefaultSyntax:Df,resolveRemainingVariablesWithDefaults:Ff,isLetter:wf,isDigit:Af,isLetterOrDigit:Ei,isValidObjectPathCharacter:zg,insert:Hg,indexOfRegex:Ef,allIndexOf:Rf,lineMatches:Bf,linesMatchInOrder:$g,represent:wi,resolveMarkdownLinks:y1,buildUrl:O1,isChinese:Ag,replaceBetweenStrings:cy,describeMarkdown:uy,isBalanced:ly,textToFormat:fy,splitFormatting:Jg,splitHashtags:Wg,splitUrls:Yg,route:a1,explodeReplace:so,generateVariants:o1,replaceWord:c1,replacePascalCaseWords:u1,stripHtml:l1,breakLine:Pf,measureTextWidth:f1,toLines:h1,levenshteinDistance:d1,findCommonPrefix:kf,findCommonDirectory:p1},r.Assertions={asEqual:cg,asTrue:ug,asTruthy:lg,asFalse:fg,asFalsy:hg,asEither:dg},r.Cache={get:iy,delete:sy,deleteExpired:ay,size:oy},r.Vector={addPoint:x0,subtractPoint:J2,multiplyPoint:bo,normalizePoint:W2,pushPoint:m0,filterCoordinates:Ti,findCorners:ew,findLines:tw,raycast:go,raycastCircle:iw,getLineIntersectionPoint:E0}})(gc)),gc}var yw=gw();const Ne=hs(yw);Ne.Arrays;Ne.Assertions;const $=Ne.Binary;Ne.Cache;const $u=Ne.Dates,Ar=Ne.Elliptic,T0=Ne.Numbers,Yi=Ne.Objects;Ne.Pagination;Ne.Promises;Ne.Random;const gl=Ne.Strings,va=Ne.System,w=Ne.Types,ut=Ne.Optional;Ne.Vector;Ne.PubSubChannel;Ne.Chunk;const ap=Ne.MerkleTree,bn=Ne.FixedPointNumber;Ne.Lazy;Ne.AsyncLazy;const ww=Ne.AsyncQueue,Aw=Ne.Uint8ArrayReader;Ne.Uint8ArrayWriter;Ne.TrieRouter;Ne.RollingValueProvider;Ne.Solver;Ne.Lock;var Vs={exports:{}},yc,v0;function Ew(){if(v0)return yc;v0=1;var r=1e3,e=r*60,t=e*60,n=t*24,i=n*7,a=n*365.25;yc=function(h,x){x=x||{};var y=typeof h;if(y==="string"&&h.length>0)return c(h);if(y==="number"&&isFinite(h))return x.long?f(h):l(h);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(h))};function c(h){if(h=String(h),!(h.length>100)){var x=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(h);if(x){var y=parseFloat(x[1]),E=(x[2]||"ms").toLowerCase();switch(E){case"years":case"year":case"yrs":case"yr":case"y":return y*a;case"weeks":case"week":case"w":return y*i;case"days":case"day":case"d":return y*n;case"hours":case"hour":case"hrs":case"hr":case"h":return y*t;case"minutes":case"minute":case"mins":case"min":case"m":return y*e;case"seconds":case"second":case"secs":case"sec":case"s":return y*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return y;default:return}}}}function l(h){var x=Math.abs(h);return x>=n?Math.round(h/n)+"d":x>=t?Math.round(h/t)+"h":x>=e?Math.round(h/e)+"m":x>=r?Math.round(h/r)+"s":h+"ms"}function f(h){var x=Math.abs(h);return x>=n?p(h,x,n,"day"):x>=t?p(h,x,t,"hour"):x>=e?p(h,x,e,"minute"):x>=r?p(h,x,r,"second"):h+" ms"}function p(h,x,y,E){var v=x>=y*1.5;return Math.round(h/y)+" "+E+(v?"s":"")}return yc}var wc,O0;function Bw(){if(O0)return wc;O0=1;function r(e){n.debug=n,n.default=n,n.coerce=p,n.disable=l,n.enable=a,n.enabled=f,n.humanize=Ew(),n.destroy=h,Object.keys(e).forEach(x=>{n[x]=e[x]}),n.names=[],n.skips=[],n.formatters={};function t(x){let y=0;for(let E=0;E<x.length;E++)y=(y<<5)-y+x.charCodeAt(E),y|=0;return n.colors[Math.abs(y)%n.colors.length]}n.selectColor=t;function n(x){let y,E=null,v,R;function C(...S){if(!C.enabled)return;const D=C,U=Number(new Date),K=U-(y||U);D.diff=K,D.prev=y,D.curr=U,y=U,S[0]=n.coerce(S[0]),typeof S[0]!="string"&&S.unshift("%O");let H=0;S[0]=S[0].replace(/%([a-zA-Z%])/g,(F,z)=>{if(F==="%%")return"%";H++;const W=n.formatters[z];if(typeof W=="function"){const ne=S[H];F=W.call(D,ne),S.splice(H,1),H--}return F}),n.formatArgs.call(D,S),(D.log||n.log).apply(D,S)}return C.namespace=x,C.useColors=n.useColors(),C.color=n.selectColor(x),C.extend=i,C.destroy=n.destroy,Object.defineProperty(C,"enabled",{enumerable:!0,configurable:!1,get:()=>E!==null?E:(v!==n.namespaces&&(v=n.namespaces,R=n.enabled(x)),R),set:S=>{E=S}}),typeof n.init=="function"&&n.init(C),C}function i(x,y){const E=n(this.namespace+(typeof y>"u"?":":y)+x);return E.log=this.log,E}function a(x){n.save(x),n.namespaces=x,n.names=[],n.skips=[];const y=(typeof x=="string"?x:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const E of y)E[0]==="-"?n.skips.push(E.slice(1)):n.names.push(E)}function c(x,y){let E=0,v=0,R=-1,C=0;for(;E<x.length;)if(v<y.length&&(y[v]===x[E]||y[v]==="*"))y[v]==="*"?(R=v,C=E,v++):(E++,v++);else if(R!==-1)v=R+1,C++,E=C;else return!1;for(;v<y.length&&y[v]==="*";)v++;return v===y.length}function l(){const x=[...n.names,...n.skips.map(y=>"-"+y)].join(",");return n.enable(""),x}function f(x){for(const y of n.skips)if(c(x,y))return!1;for(const y of n.names)if(c(x,y))return!0;return!1}function p(x){return x instanceof Error?x.stack||x.message:x}function h(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}return wc=r,wc}var C0;function Rw(){return C0||(C0=1,(function(r,e){var t={};e.formatArgs=i,e.save=a,e.load=c,e.useColors=n,e.storage=l(),e.destroy=(()=>{let p=!1;return()=>{p||(p=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let p;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(p=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(p[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function i(p){if(p[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+p[0]+(this.useColors?"%c ":" ")+"+"+r.exports.humanize(this.diff),!this.useColors)return;const h="color: "+this.color;p.splice(1,0,h,"color: inherit");let x=0,y=0;p[0].replace(/%[a-zA-Z%]/g,E=>{E!=="%%"&&(x++,E==="%c"&&(y=x))}),p.splice(y,0,h)}e.log=console.debug||console.log||(()=>{});function a(p){try{p?e.storage.setItem("debug",p):e.storage.removeItem("debug")}catch{}}function c(){let p;try{p=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch{}return!p&&typeof Wi<"u"&&"env"in Wi&&(p=t.DEBUG),p}function l(){try{return localStorage}catch{}}r.exports=Bw()(e);const{formatters:f}=r.exports;f.j=function(p){try{return JSON.stringify(p)}catch(h){return"[UnexpectedJSONParseError]: "+h.message}}})(Vs,Vs.exports)),Vs.exports}var Tw=Rw();const yl=hs(Tw),vw=yl("bee-js:bytes"),Ow=new TextDecoder,Cw=new TextEncoder;class we{constructor(e,t){if(!e)throw Error(`Bytes#constructor: constructor parameter is falsy: ${e}`);if(e instanceof we)this.bytes=e.bytes;else if(typeof e=="string")this.bytes=$.hexToUint8Array(w.asHexString(e,{name:"Bytes#constructor(bytes)"}));else if(e instanceof ArrayBuffer)this.bytes=new Uint8Array(e);else if(e instanceof Uint8Array)this.bytes=e;else{const n=e,i=Yi.getDeep(n,"toHex");if(w.isFunction(i)){const a=i.call(n);this.bytes=$.hexToUint8Array(w.asHexString(a,{name:"Bytes#constructor(bytes)"}))}else throw vw("bytes",e),new Error(`Bytes#constructor: unsupported type: ${typeof e}`)}if(this.length=this.bytes.length,t){if(Array.isArray(t)){if(!t.includes(this.length))throw new Error(`Bytes#checkByteLength: bytes length is ${this.length} but expected ${t.join(" or ")}`)}else if(this.length!==t)throw new Error(`Bytes#checkByteLength: bytes length is ${this.length} but expected ${t}`)}}static keccak256(e){return new we($.keccak256(new we(e).toUint8Array()))}static fromUtf8(e){return new we(Cw.encode(e))}static fromSlice(e,t,n){return n===void 0?new we(e.slice(t)):new we(e.slice(t,t+n))}offset(e){return new Uint8Array(this.bytes.slice(e))}toUint8Array(){return new Uint8Array(this.bytes)}toHex(){return $.uint8ArrayToHex(this.bytes)}toBase64(){return $.uint8ArrayToBase64(this.bytes)}toBase32(){return $.uint8ArrayToBase32(this.bytes)}toString(){return this.toHex()}toUtf8(){return Ow.decode(this.bytes)}toJSON(){return JSON.parse(this.toUtf8())}equals(e){return this.toHex()===new we(e).toHex()}represent(){return this.toHex()}}function op(r){const e={B:1,kB:1e3,MB:1e6,GB:1e9,TB:1e12,PB:1e15},t=r.match(/^([\d.]+)\s*(B|kB|MB|GB|TB|PB)$/);if(!t)throw new Error(`Invalid size format: ${r}`);const n=parseFloat(t[1]),i=t[2];return Math.ceil(n*e[i])}const cp=250,up=251,S0={[cp]:"manifest",[up]:"feed"};function Sw(r,e){r=new se(r);const t="b",n=new Uint8Array([1]),i=new Uint8Array([e==="feed"?up:cp]),a=new Uint8Array([1]),c=new Uint8Array([27]),l=new Uint8Array([32]),f=$.uint8ArrayToBase32($.concatBytes(n,i,a,c,l)).replace(/\=+$/,""),p=r.toBase32().replace(/\=+$/,"");return`${t}${f}${p}`.toLowerCase()}function Nw(r){const e=$.base32ToUint8Array(r.toUpperCase().slice(1)),t=e[1];if(!S0[t])throw new Error("Unknown codec");const n=new se(e.slice(-32));return{type:S0[t],reference:n}}const ti=new TextEncoder;class vn extends we{constructor(e){super(e,32)}publicKey(){const[e,t]=Ar.privateKeyToPublicKey($.uint256ToNumber(this.bytes,"BE"));return new qt($.concatBytes($.numberToUint256(e,"BE"),$.numberToUint256(t,"BE")))}sign(e){const t=$.concatBytes(ti.encode(`Ethereum Signed Message:
|
|
11
|
-
32`),$.keccak256(e instanceof Uint8Array?e:ti.encode(e))),[n,i,a]=Ar.signMessage(t,$.uint256ToNumber(this.bytes,"BE"));return new tr($.concatBytes($.numberToUint256(n,"BE"),$.numberToUint256(i,"BE"),new Uint8Array([Number(a)])))}}vn.LENGTH=32;class qt extends we{constructor(e){const t=new we(e);if(t.length===33){const[n,i]=Ar.publicKeyFromCompressed(t.toUint8Array());super($.concatBytes($.numberToUint256(n,"BE"),$.numberToUint256(i,"BE")),64)}else super(e,64)}address(){const e=$.uint256ToNumber(this.bytes.slice(0,32),"BE"),t=$.uint256ToNumber(this.bytes.slice(32,64),"BE");return new mt(Ar.publicKeyToAddress([e,t]))}toCompressedUint8Array(){const e=$.uint256ToNumber(this.bytes.slice(0,32),"BE"),t=$.uint256ToNumber(this.bytes.slice(32,64),"BE");return Ar.compressPublicKey([e,t])}toCompressedHex(){return $.uint8ArrayToHex(this.toCompressedUint8Array())}}qt.LENGTH=64;class mt extends we{constructor(e){super(e,20)}toChecksum(){return Ar.checksumEncode(this.bytes)}}mt.LENGTH=20;class it extends we{constructor(e){super(e,32)}static fromString(e){return new it($.keccak256(ti.encode(e)))}}it.LENGTH=32;class se extends we{constructor(e){if(typeof e=="string"&&e.startsWith("bah5")){const t=Nw(e);super(t.reference.bytes,32)}else super(e,[32,64])}toCid(e){return Sw(this.bytes,e)}static isValid(e){try{return new se(e),!0}catch{return!1}}}se.LENGTH=32;class Rt extends we{constructor(e){super(e,32)}}Rt.LENGTH=32;class et extends we{constructor(e){super(e,8)}static fromBigInt(e){return new et($.numberToUint64(e,"LE"))}toBigInt(){return $.uint64ToNumber(this.bytes,"LE")}static fromSlice(e,t){return new et(e.slice(t,t+et.LENGTH))}}et.LENGTH=8;class nn extends we{constructor(e){super(e,32)}}nn.LENGTH=32;class De extends we{constructor(e){super(e,32)}}De.LENGTH=32;let tr=class _u extends we{constructor(e){super(e,65)}static fromSlice(e,t){return new _u(e.slice(t,t+_u.LENGTH))}recoverPublicKey(e){const t=$.uint256ToNumber(this.bytes.slice(0,32),"BE"),n=$.uint256ToNumber(this.bytes.slice(32,64),"BE"),i=BigInt(this.bytes[64]),[a,c]=Ar.recoverPublicKey($.concatBytes(ti.encode(`Ethereum Signed Message:
|
|
12
|
-
32`),$.keccak256(e instanceof Uint8Array?e:ti.encode(e))),t,n,i);return new qt($.concatBytes($.numberToUint256(a,"BE"),$.numberToUint256(c,"BE")))}isValid(e,t){return this.recoverPublicKey(e).address().equals(t)}};tr.LENGTH=65;class On extends we{constructor(e){super(e,32)}static fromString(e){return new On($.keccak256(ti.encode(e)))}}On.LENGTH=32;const lp=new Uint8Array(8).fill(255,0,8);class bt extends we{constructor(e){super(e,8)}static fromBigInt(e){return new bt($.numberToUint64(e,"BE"))}toBigInt(){return $.uint64ToNumber(this.bytes,"BE")}next(){return $.equals(this.bytes,lp)?bt.fromBigInt(0n):bt.fromBigInt(this.toBigInt()+1n)}}bt.LENGTH=8;bt.MINUS_ONE=new bt(lp);class cn extends Error{constructor(e){super(e)}}class xn extends cn{constructor(e,t){super(e),this.value=t}}class wl extends cn{constructor(e,t,n,i,a,c){super(n),this.method=e,this.url=t,this.responseBody=i,this.status=a,this.statusText=c}}const Ac=4096,Iw=32;function fp(r){const e=r.slice(0,et.LENGTH),t=r.slice(et.LENGTH),n=Pw(t),i=$.keccak256($.concatBytes(e,n));return new se(i)}function Pw(r){if(r.length>Ac)throw new xn(`payload size ${r.length} exceeds maximum chunk payload size ${Ac}`,r);const e=new Uint8Array(Ac);return e.set(r),$.log2Reduce($.partition(e,Iw),(t,n)=>$.keccak256($.concatBytes(t,n)))}var Kr;(function(r){r.FULL="full",r.LIGHT="light",r.ULTRA_LIGHT="ultra-light",r.DEV="dev"})(Kr||(Kr={}));function hp(r){switch(r){case"full":return Kr.FULL;case"light":return Kr.LIGHT;case"ultra-light":return Kr.ULTRA_LIGHT;case"dev":return Kr.DEV;default:throw new Error(`Unknown Bee mode: ${r}`)}}const kw=32,Dw=128,Gs=kw*Dw,N0=17,I0=255,Fw=1,Uw=1e3;var pt;(function(r){r[r.OFF=0]="OFF",r[r.MEDIUM=1]="MEDIUM",r[r.STRONG=2]="STRONG",r[r.INSANE=3]="INSANE",r[r.PARANOID=4]="PARANOID"})(pt||(pt={}));var P0;(function(r){r[r.NONE=0]="NONE",r[r.DATA=1]="DATA",r[r.PROX=2]="PROX",r[r.RACE=3]="RACE"})(P0||(P0={}));const dp={ENCRYPTION_OFF:{[pt.OFF]:[{theoreticalVolume:"536.87 MB",effectiveVolume:"44.70 kB",batchDepth:17,utilizationRate:"0.01%"},{theoreticalVolume:"1.07 GB",effectiveVolume:"6.66 MB",batchDepth:18,utilizationRate:"0.61%"},{theoreticalVolume:"2.15 GB",effectiveVolume:"112.06 MB",batchDepth:19,utilizationRate:"5.09%"},{theoreticalVolume:"4.29 GB",effectiveVolume:"687.62 MB",batchDepth:20,utilizationRate:"15.65%"},{theoreticalVolume:"8.59 GB",effectiveVolume:"2.60 GB",batchDepth:21,utilizationRate:"30.27%"},{theoreticalVolume:"17.18 GB",effectiveVolume:"7.73 GB",batchDepth:22,utilizationRate:"44.99%"},{theoreticalVolume:"34.36 GB",effectiveVolume:"19.94 GB",batchDepth:23,utilizationRate:"58.03%"},{theoreticalVolume:"68.72 GB",effectiveVolume:"47.06 GB",batchDepth:24,utilizationRate:"68.48%"},{theoreticalVolume:"137.44 GB",effectiveVolume:"105.51 GB",batchDepth:25,utilizationRate:"76.77%"},{theoreticalVolume:"274.88 GB",effectiveVolume:"227.98 GB",batchDepth:26,utilizationRate:"82.94%"},{theoreticalVolume:"549.76 GB",effectiveVolume:"476.68 GB",batchDepth:27,utilizationRate:"86.71%"},{theoreticalVolume:"1.10 TB",effectiveVolume:"993.65 GB",batchDepth:28,utilizationRate:"88.37%"},{theoreticalVolume:"2.20 TB",effectiveVolume:"2.04 TB",batchDepth:29,utilizationRate:"92.88%"},{theoreticalVolume:"4.40 TB",effectiveVolume:"4.17 TB",batchDepth:30,utilizationRate:"94.81%"},{theoreticalVolume:"8.80 TB",effectiveVolume:"8.45 TB",batchDepth:31,utilizationRate:"96.06%"},{theoreticalVolume:"17.59 TB",effectiveVolume:"17.07 TB",batchDepth:32,utilizationRate:"97.01%"},{theoreticalVolume:"35.18 TB",effectiveVolume:"34.36 TB",batchDepth:33,utilizationRate:"97.65%"},{theoreticalVolume:"70.37 TB",effectiveVolume:"69.04 TB",batchDepth:34,utilizationRate:"98.11%"},{theoreticalVolume:"140.74 TB",effectiveVolume:"138.54 TB",batchDepth:35,utilizationRate:"98.44%"},{theoreticalVolume:"281.47 TB",effectiveVolume:"277.72 TB",batchDepth:36,utilizationRate:"98.67%"},{theoreticalVolume:"562.95 TB",effectiveVolume:"556.35 TB",batchDepth:37,utilizationRate:"98.83%"},{theoreticalVolume:"1.13 PB",effectiveVolume:"1.11 PB",batchDepth:38,utilizationRate:"98.91%"},{theoreticalVolume:"2.25 PB",effectiveVolume:"2.23 PB",batchDepth:39,utilizationRate:"98.96%"},{theoreticalVolume:"4.50 PB",effectiveVolume:"4.46 PB",batchDepth:40,utilizationRate:"98.98%"},{theoreticalVolume:"9.01 PB",effectiveVolume:"8.93 PB",batchDepth:41,utilizationRate:"99.11%"}],[pt.MEDIUM]:[{theoreticalVolume:"536.87 MB",effectiveVolume:"41.56 kB",batchDepth:17,utilizationRate:"0.01%"},{theoreticalVolume:"1.07 GB",effectiveVolume:"6.19 MB",batchDepth:18,utilizationRate:"0.57%"},{theoreticalVolume:"2.15 GB",effectiveVolume:"104.18 MB",batchDepth:19,utilizationRate:"4.73%"},{theoreticalVolume:"4.29 GB",effectiveVolume:"639.27 MB",batchDepth:20,utilizationRate:"14.54%"},{theoreticalVolume:"8.59 GB",effectiveVolume:"2.41 GB",batchDepth:21,utilizationRate:"28.11%"},{theoreticalVolume:"17.18 GB",effectiveVolume:"7.18 GB",batchDepth:22,utilizationRate:"41.79%"},{theoreticalVolume:"34.36 GB",effectiveVolume:"18.54 GB",batchDepth:23,utilizationRate:"53.95%"},{theoreticalVolume:"68.72 GB",effectiveVolume:"43.75 GB",batchDepth:24,utilizationRate:"63.66%"},{theoreticalVolume:"137.44 GB",effectiveVolume:"98.09 GB",batchDepth:25,utilizationRate:"71.37%"},{theoreticalVolume:"274.88 GB",effectiveVolume:"211.95 GB",batchDepth:26,utilizationRate:"77.11%"},{theoreticalVolume:"549.76 GB",effectiveVolume:"443.16 GB",batchDepth:27,utilizationRate:"80.61%"},{theoreticalVolume:"1.10 TB",effectiveVolume:"923.78 GB",batchDepth:28,utilizationRate:"82.16%"},{theoreticalVolume:"2.20 TB",effectiveVolume:"1.90 TB",batchDepth:29,utilizationRate:"86.30%"},{theoreticalVolume:"4.40 TB",effectiveVolume:"3.88 TB",batchDepth:30,utilizationRate:"88.14%"},{theoreticalVolume:"8.80 TB",effectiveVolume:"7.86 TB",batchDepth:31,utilizationRate:"89.26%"},{theoreticalVolume:"17.59 TB",effectiveVolume:"15.87 TB",batchDepth:32,utilizationRate:"90.21%"},{theoreticalVolume:"35.18 TB",effectiveVolume:"31.94 TB",batchDepth:33,utilizationRate:"90.77%"},{theoreticalVolume:"70.37 TB",effectiveVolume:"64.19 TB",batchDepth:34,utilizationRate:"91.22%"},{theoreticalVolume:"140.74 TB",effectiveVolume:"128.80 TB",batchDepth:35,utilizationRate:"91.52%"},{theoreticalVolume:"281.47 TB",effectiveVolume:"258.19 TB",batchDepth:36,utilizationRate:"91.73%"},{theoreticalVolume:"562.95 TB",effectiveVolume:"517.23 TB",batchDepth:37,utilizationRate:"91.88%"},{theoreticalVolume:"1.13 PB",effectiveVolume:"1.04 PB",batchDepth:38,utilizationRate:"91.95%"},{theoreticalVolume:"2.25 PB",effectiveVolume:"2.07 PB",batchDepth:39,utilizationRate:"92.00%"},{theoreticalVolume:"4.50 PB",effectiveVolume:"4.15 PB",batchDepth:40,utilizationRate:"92.15%"},{theoreticalVolume:"9.01 PB",effectiveVolume:"8.30 PB",batchDepth:41,utilizationRate:"92.14%"}],[pt.STRONG]:[{theoreticalVolume:"536.87 MB",effectiveVolume:"37.37 kB",batchDepth:17,utilizationRate:"0.01%"},{theoreticalVolume:"1.07 GB",effectiveVolume:"5.57 MB",batchDepth:18,utilizationRate:"0.51%"},{theoreticalVolume:"2.15 GB",effectiveVolume:"93.68 MB",batchDepth:19,utilizationRate:"4.25%"},{theoreticalVolume:"4.29 GB",effectiveVolume:"574.81 MB",batchDepth:20,utilizationRate:"13.07%"},{theoreticalVolume:"8.59 GB",effectiveVolume:"2.17 GB",batchDepth:21,utilizationRate:"25.26%"},{theoreticalVolume:"17.18 GB",effectiveVolume:"6.46 GB",batchDepth:22,utilizationRate:"37.58%"},{theoreticalVolume:"34.36 GB",effectiveVolume:"16.67 GB",batchDepth:23,utilizationRate:"48.50%"},{theoreticalVolume:"68.72 GB",effectiveVolume:"39.34 GB",batchDepth:24,utilizationRate:"57.24%"},{theoreticalVolume:"137.44 GB",effectiveVolume:"88.20 GB",batchDepth:25,utilizationRate:"64.17%"},{theoreticalVolume:"274.88 GB",effectiveVolume:"190.58 GB",batchDepth:26,utilizationRate:"69.33%"},{theoreticalVolume:"549.76 GB",effectiveVolume:"398.47 GB",batchDepth:27,utilizationRate:"72.48%"},{theoreticalVolume:"1.10 TB",effectiveVolume:"830.63 GB",batchDepth:28,utilizationRate:"73.85%"},{theoreticalVolume:"2.20 TB",effectiveVolume:"1.71 TB",batchDepth:29,utilizationRate:"77.59%"},{theoreticalVolume:"4.40 TB",effectiveVolume:"3.49 TB",batchDepth:30,utilizationRate:"79.27%"},{theoreticalVolume:"8.80 TB",effectiveVolume:"7.07 TB",batchDepth:31,utilizationRate:"80.34%"},{theoreticalVolume:"17.59 TB",effectiveVolume:"14.27 TB",batchDepth:32,utilizationRate:"81.12%"},{theoreticalVolume:"35.18 TB",effectiveVolume:"28.72 TB",batchDepth:33,utilizationRate:"81.63%"},{theoreticalVolume:"70.37 TB",effectiveVolume:"57.71 TB",batchDepth:34,utilizationRate:"82.01%"},{theoreticalVolume:"140.74 TB",effectiveVolume:"115.81 TB",batchDepth:35,utilizationRate:"82.29%"},{theoreticalVolume:"281.47 TB",effectiveVolume:"232.16 TB",batchDepth:36,utilizationRate:"82.48%"},{theoreticalVolume:"562.95 TB",effectiveVolume:"465.07 TB",batchDepth:37,utilizationRate:"82.61%"},{theoreticalVolume:"1.13 PB",effectiveVolume:"931.23 TB",batchDepth:38,utilizationRate:"82.67%"},{theoreticalVolume:"2.25 PB",effectiveVolume:"1.86 PB",batchDepth:39,utilizationRate:"82.71%"},{theoreticalVolume:"4.50 PB",effectiveVolume:"3.73 PB",batchDepth:40,utilizationRate:"82.78%"},{theoreticalVolume:"9.01 PB",effectiveVolume:"7.46 PB",batchDepth:41,utilizationRate:"82.79%"}],[pt.INSANE]:[{theoreticalVolume:"536.87 MB",effectiveVolume:"33.88 kB",batchDepth:17,utilizationRate:"0.01%"},{theoreticalVolume:"1.07 GB",effectiveVolume:"5.05 MB",batchDepth:18,utilizationRate:"0.46%"},{theoreticalVolume:"2.15 GB",effectiveVolume:"84.92 MB",batchDepth:19,utilizationRate:"3.86%"},{theoreticalVolume:"4.29 GB",effectiveVolume:"521.09 MB",batchDepth:20,utilizationRate:"11.85%"},{theoreticalVolume:"8.59 GB",effectiveVolume:"1.97 GB",batchDepth:21,utilizationRate:"22.90%"},{theoreticalVolume:"17.18 GB",effectiveVolume:"5.86 GB",batchDepth:22,utilizationRate:"34.09%"},{theoreticalVolume:"34.36 GB",effectiveVolume:"15.11 GB",batchDepth:23,utilizationRate:"43.97%"},{theoreticalVolume:"68.72 GB",effectiveVolume:"35.66 GB",batchDepth:24,utilizationRate:"51.90%"},{theoreticalVolume:"137.44 GB",effectiveVolume:"79.96 GB",batchDepth:25,utilizationRate:"58.18%"},{theoreticalVolume:"274.88 GB",effectiveVolume:"172.77 GB",batchDepth:26,utilizationRate:"62.85%"},{theoreticalVolume:"549.76 GB",effectiveVolume:"361.23 GB",batchDepth:27,utilizationRate:"65.70%"},{theoreticalVolume:"1.10 TB",effectiveVolume:"753.00 GB",batchDepth:28,utilizationRate:"66.95%"},{theoreticalVolume:"2.20 TB",effectiveVolume:"1.55 TB",batchDepth:29,utilizationRate:"70.38%"},{theoreticalVolume:"4.40 TB",effectiveVolume:"3.16 TB",batchDepth:30,utilizationRate:"71.92%"},{theoreticalVolume:"8.80 TB",effectiveVolume:"6.41 TB",batchDepth:31,utilizationRate:"72.85%"},{theoreticalVolume:"17.59 TB",effectiveVolume:"12.93 TB",batchDepth:32,utilizationRate:"73.53%"},{theoreticalVolume:"35.18 TB",effectiveVolume:"26.04 TB",batchDepth:33,utilizationRate:"74.01%"},{theoreticalVolume:"70.37 TB",effectiveVolume:"52.32 TB",batchDepth:34,utilizationRate:"74.35%"},{theoreticalVolume:"140.74 TB",effectiveVolume:"104.99 TB",batchDepth:35,utilizationRate:"74.60%"},{theoreticalVolume:"281.47 TB",effectiveVolume:"210.46 TB",batchDepth:36,utilizationRate:"74.77%"},{theoreticalVolume:"562.95 TB",effectiveVolume:"421.61 TB",batchDepth:37,utilizationRate:"74.89%"},{theoreticalVolume:"1.13 PB",effectiveVolume:"844.20 TB",batchDepth:38,utilizationRate:"74.94%"},{theoreticalVolume:"2.25 PB",effectiveVolume:"1.69 PB",batchDepth:39,utilizationRate:"74.98%"},{theoreticalVolume:"4.50 PB",effectiveVolume:"3.38 PB",batchDepth:40,utilizationRate:"75.03%"},{theoreticalVolume:"9.01 PB",effectiveVolume:"6.77 PB",batchDepth:41,utilizationRate:"75.10%"}],[pt.PARANOID]:[{theoreticalVolume:"536.87 MB",effectiveVolume:"13.27 kB",batchDepth:17,utilizationRate:"0.00%"},{theoreticalVolume:"1.07 GB",effectiveVolume:"1.98 MB",batchDepth:18,utilizationRate:"0.18%"},{theoreticalVolume:"2.15 GB",effectiveVolume:"33.27 MB",batchDepth:19,utilizationRate:"1.51%"},{theoreticalVolume:"4.29 GB",effectiveVolume:"204.14 MB",batchDepth:20,utilizationRate:"4.64%"},{theoreticalVolume:"8.59 GB",effectiveVolume:"771.13 MB",batchDepth:21,utilizationRate:"8.75%"},{theoreticalVolume:"17.18 GB",effectiveVolume:"2.29 GB",batchDepth:22,utilizationRate:"13.34%"},{theoreticalVolume:"34.36 GB",effectiveVolume:"5.92 GB",batchDepth:23,utilizationRate:"17.22%"},{theoreticalVolume:"68.72 GB",effectiveVolume:"13.97 GB",batchDepth:24,utilizationRate:"20.33%"},{theoreticalVolume:"137.44 GB",effectiveVolume:"31.32 GB",batchDepth:25,utilizationRate:"22.79%"},{theoreticalVolume:"274.88 GB",effectiveVolume:"67.68 GB",batchDepth:26,utilizationRate:"24.62%"},{theoreticalVolume:"549.76 GB",effectiveVolume:"141.51 GB",batchDepth:27,utilizationRate:"25.74%"},{theoreticalVolume:"1.10 TB",effectiveVolume:"294.99 GB",batchDepth:28,utilizationRate:"26.23%"},{theoreticalVolume:"2.20 TB",effectiveVolume:"606.90 GB",batchDepth:29,utilizationRate:"27.56%"},{theoreticalVolume:"4.40 TB",effectiveVolume:"1.24 TB",batchDepth:30,utilizationRate:"28.15%"},{theoreticalVolume:"8.80 TB",effectiveVolume:"2.51 TB",batchDepth:31,utilizationRate:"28.54%"},{theoreticalVolume:"17.59 TB",effectiveVolume:"5.07 TB",batchDepth:32,utilizationRate:"28.82%"},{theoreticalVolume:"35.18 TB",effectiveVolume:"10.20 TB",batchDepth:33,utilizationRate:"28.99%"},{theoreticalVolume:"70.37 TB",effectiveVolume:"20.50 TB",batchDepth:34,utilizationRate:"29.13%"},{theoreticalVolume:"140.74 TB",effectiveVolume:"41.13 TB",batchDepth:35,utilizationRate:"29.22%"},{theoreticalVolume:"281.47 TB",effectiveVolume:"82.45 TB",batchDepth:36,utilizationRate:"29.29%"},{theoreticalVolume:"562.95 TB",effectiveVolume:"165.17 TB",batchDepth:37,utilizationRate:"29.34%"},{theoreticalVolume:"1.13 PB",effectiveVolume:"330.72 TB",batchDepth:38,utilizationRate:"29.37%"},{theoreticalVolume:"2.25 PB",effectiveVolume:"661.97 TB",batchDepth:39,utilizationRate:"29.39%"},{theoreticalVolume:"4.50 PB",effectiveVolume:"1.32 PB",batchDepth:40,utilizationRate:"29.41%"},{theoreticalVolume:"9.01 PB",effectiveVolume:"2.65 PB",batchDepth:41,utilizationRate:"29.43%"}]},ENCRYPTION_ON:{[pt.OFF]:[{theoreticalVolume:"536.87 MB",effectiveVolume:"44.35 kB",batchDepth:17,utilizationRate:"0.01%"},{theoreticalVolume:"1.07 GB",effectiveVolume:"6.61 MB",batchDepth:18,utilizationRate:"0.60%"},{theoreticalVolume:"2.15 GB",effectiveVolume:"111.18 MB",batchDepth:19,utilizationRate:"5.05%"},{theoreticalVolume:"4.29 GB",effectiveVolume:"682.21 MB",batchDepth:20,utilizationRate:"15.52%"},{theoreticalVolume:"8.59 GB",effectiveVolume:"2.58 GB",batchDepth:21,utilizationRate:"30.04%"},{theoreticalVolume:"17.18 GB",effectiveVolume:"7.67 GB",batchDepth:22,utilizationRate:"44.62%"},{theoreticalVolume:"34.36 GB",effectiveVolume:"19.78 GB",batchDepth:23,utilizationRate:"57.56%"},{theoreticalVolume:"68.72 GB",effectiveVolume:"46.69 GB",batchDepth:24,utilizationRate:"67.93%"},{theoreticalVolume:"137.44 GB",effectiveVolume:"104.68 GB",batchDepth:25,utilizationRate:"76.16%"},{theoreticalVolume:"274.88 GB",effectiveVolume:"226.19 GB",batchDepth:26,utilizationRate:"82.29%"},{theoreticalVolume:"549.76 GB",effectiveVolume:"472.93 GB",batchDepth:27,utilizationRate:"86.02%"},{theoreticalVolume:"1.10 TB",effectiveVolume:"985.83 GB",batchDepth:28,utilizationRate:"87.66%"},{theoreticalVolume:"2.20 TB",effectiveVolume:"2.03 TB",batchDepth:29,utilizationRate:"92.25%"},{theoreticalVolume:"4.40 TB",effectiveVolume:"4.14 TB",batchDepth:30,utilizationRate:"94.21%"},{theoreticalVolume:"8.80 TB",effectiveVolume:"8.39 TB",batchDepth:31,utilizationRate:"95.37%"},{theoreticalVolume:"17.59 TB",effectiveVolume:"16.93 TB",batchDepth:32,utilizationRate:"96.22%"},{theoreticalVolume:"35.18 TB",effectiveVolume:"34.09 TB",batchDepth:33,utilizationRate:"96.88%"},{theoreticalVolume:"70.37 TB",effectiveVolume:"68.50 TB",batchDepth:34,utilizationRate:"97.34%"},{theoreticalVolume:"140.74 TB",effectiveVolume:"137.45 TB",batchDepth:35,utilizationRate:"97.67%"},{theoreticalVolume:"281.47 TB",effectiveVolume:"275.53 TB",batchDepth:36,utilizationRate:"97.89%"},{theoreticalVolume:"562.95 TB",effectiveVolume:"551.97 TB",batchDepth:37,utilizationRate:"98.05%"},{theoreticalVolume:"1.13 PB",effectiveVolume:"1.11 PB",batchDepth:38,utilizationRate:"98.13%"},{theoreticalVolume:"2.25 PB",effectiveVolume:"2.21 PB",batchDepth:39,utilizationRate:"98.18%"},{theoreticalVolume:"4.50 PB",effectiveVolume:"4.43 PB",batchDepth:40,utilizationRate:"98.36%"},{theoreticalVolume:"9.01 PB",effectiveVolume:"8.86 PB",batchDepth:41,utilizationRate:"98.37%"}],[pt.MEDIUM]:[{theoreticalVolume:"536.87 MB",effectiveVolume:"40.89 kB",batchDepth:17,utilizationRate:"0.01%"},{theoreticalVolume:"1.07 GB",effectiveVolume:"6.09 MB",batchDepth:18,utilizationRate:"0.56%"},{theoreticalVolume:"2.15 GB",effectiveVolume:"102.49 MB",batchDepth:19,utilizationRate:"4.65%"},{theoreticalVolume:"4.29 GB",effectiveVolume:"628.91 MB",batchDepth:20,utilizationRate:"14.30%"},{theoreticalVolume:"8.59 GB",effectiveVolume:"2.38 GB",batchDepth:21,utilizationRate:"27.68%"},{theoreticalVolume:"17.18 GB",effectiveVolume:"7.07 GB",batchDepth:22,utilizationRate:"41.15%"},{theoreticalVolume:"34.36 GB",effectiveVolume:"18.24 GB",batchDepth:23,utilizationRate:"53.09%"},{theoreticalVolume:"68.72 GB",effectiveVolume:"43.04 GB",batchDepth:24,utilizationRate:"62.63%"},{theoreticalVolume:"137.44 GB",effectiveVolume:"96.50 GB",batchDepth:25,utilizationRate:"70.21%"},{theoreticalVolume:"274.88 GB",effectiveVolume:"208.52 GB",batchDepth:26,utilizationRate:"75.86%"},{theoreticalVolume:"549.76 GB",effectiveVolume:"435.98 GB",batchDepth:27,utilizationRate:"79.30%"},{theoreticalVolume:"1.10 TB",effectiveVolume:"908.81 GB",batchDepth:28,utilizationRate:"80.82%"},{theoreticalVolume:"2.20 TB",effectiveVolume:"1.87 TB",batchDepth:29,utilizationRate:"84.98%"},{theoreticalVolume:"4.40 TB",effectiveVolume:"3.81 TB",batchDepth:30,utilizationRate:"86.67%"},{theoreticalVolume:"8.80 TB",effectiveVolume:"7.73 TB",batchDepth:31,utilizationRate:"87.84%"},{theoreticalVolume:"17.59 TB",effectiveVolume:"15.61 TB",batchDepth:32,utilizationRate:"88.74%"},{theoreticalVolume:"35.18 TB",effectiveVolume:"31.43 TB",batchDepth:33,utilizationRate:"89.34%"},{theoreticalVolume:"70.37 TB",effectiveVolume:"63.15 TB",batchDepth:34,utilizationRate:"89.74%"},{theoreticalVolume:"140.74 TB",effectiveVolume:"126.71 TB",batchDepth:35,utilizationRate:"90.03%"},{theoreticalVolume:"281.47 TB",effectiveVolume:"254.01 TB",batchDepth:36,utilizationRate:"90.24%"},{theoreticalVolume:"562.95 TB",effectiveVolume:"508.85 TB",batchDepth:37,utilizationRate:"90.39%"},{theoreticalVolume:"1.13 PB",effectiveVolume:"1.02 PB",batchDepth:38,utilizationRate:"90.47%"},{theoreticalVolume:"2.25 PB",effectiveVolume:"2.04 PB",batchDepth:39,utilizationRate:"90.51%"},{theoreticalVolume:"4.50 PB",effectiveVolume:"4.08 PB",batchDepth:40,utilizationRate:"90.64%"},{theoreticalVolume:"9.01 PB",effectiveVolume:"8.17 PB",batchDepth:41,utilizationRate:"90.65%"}],[pt.STRONG]:[{theoreticalVolume:"536.87 MB",effectiveVolume:"36.73 kB",batchDepth:17,utilizationRate:"0.01%"},{theoreticalVolume:"1.07 GB",effectiveVolume:"5.47 MB",batchDepth:18,utilizationRate:"0.50%"},{theoreticalVolume:"2.15 GB",effectiveVolume:"92.07 MB",batchDepth:19,utilizationRate:"4.18%"},{theoreticalVolume:"4.29 GB",effectiveVolume:"564.95 MB",batchDepth:20,utilizationRate:"12.85%"},{theoreticalVolume:"8.59 GB",effectiveVolume:"2.13 GB",batchDepth:21,utilizationRate:"24.86%"},{theoreticalVolume:"17.18 GB",effectiveVolume:"6.35 GB",batchDepth:22,utilizationRate:"36.97%"},{theoreticalVolume:"34.36 GB",effectiveVolume:"16.38 GB",batchDepth:23,utilizationRate:"47.67%"},{theoreticalVolume:"68.72 GB",effectiveVolume:"38.66 GB",batchDepth:24,utilizationRate:"56.26%"},{theoreticalVolume:"137.44 GB",effectiveVolume:"86.69 GB",batchDepth:25,utilizationRate:"63.07%"},{theoreticalVolume:"274.88 GB",effectiveVolume:"187.31 GB",batchDepth:26,utilizationRate:"68.14%"},{theoreticalVolume:"549.76 GB",effectiveVolume:"391.64 GB",batchDepth:27,utilizationRate:"71.24%"},{theoreticalVolume:"1.10 TB",effectiveVolume:"816.39 GB",batchDepth:28,utilizationRate:"72.59%"},{theoreticalVolume:"2.20 TB",effectiveVolume:"1.68 TB",batchDepth:29,utilizationRate:"76.34%"},{theoreticalVolume:"4.40 TB",effectiveVolume:"3.43 TB",batchDepth:30,utilizationRate:"77.89%"},{theoreticalVolume:"8.80 TB",effectiveVolume:"6.94 TB",batchDepth:31,utilizationRate:"78.86%"},{theoreticalVolume:"17.59 TB",effectiveVolume:"14.02 TB",batchDepth:32,utilizationRate:"79.71%"},{theoreticalVolume:"35.18 TB",effectiveVolume:"28.23 TB",batchDepth:33,utilizationRate:"80.23%"},{theoreticalVolume:"70.37 TB",effectiveVolume:"56.72 TB",batchDepth:34,utilizationRate:"80.60%"},{theoreticalVolume:"140.74 TB",effectiveVolume:"113.82 TB",batchDepth:35,utilizationRate:"80.88%"},{theoreticalVolume:"281.47 TB",effectiveVolume:"228.18 TB",batchDepth:36,utilizationRate:"81.06%"},{theoreticalVolume:"562.95 TB",effectiveVolume:"457.10 TB",batchDepth:37,utilizationRate:"81.20%"},{theoreticalVolume:"1.13 PB",effectiveVolume:"915.26 TB",batchDepth:38,utilizationRate:"81.26%"},{theoreticalVolume:"2.25 PB",effectiveVolume:"1.83 PB",batchDepth:39,utilizationRate:"81.30%"},{theoreticalVolume:"4.50 PB",effectiveVolume:"3.67 PB",batchDepth:40,utilizationRate:"81.43%"},{theoreticalVolume:"9.01 PB",effectiveVolume:"7.34 PB",batchDepth:41,utilizationRate:"81.45%"}],[pt.INSANE]:[{theoreticalVolume:"536.87 MB",effectiveVolume:"33.26 kB",batchDepth:17,utilizationRate:"0.01%"},{theoreticalVolume:"1.07 GB",effectiveVolume:"4.96 MB",batchDepth:18,utilizationRate:"0.45%"},{theoreticalVolume:"2.15 GB",effectiveVolume:"83.38 MB",batchDepth:19,utilizationRate:"3.79%"},{theoreticalVolume:"4.29 GB",effectiveVolume:"511.65 MB",batchDepth:20,utilizationRate:"11.64%"},{theoreticalVolume:"8.59 GB",effectiveVolume:"1.93 GB",batchDepth:21,utilizationRate:"22.52%"},{theoreticalVolume:"17.18 GB",effectiveVolume:"5.75 GB",batchDepth:22,utilizationRate:"33.50%"},{theoreticalVolume:"34.36 GB",effectiveVolume:"14.84 GB",batchDepth:23,utilizationRate:"43.19%"},{theoreticalVolume:"68.72 GB",effectiveVolume:"35.02 GB",batchDepth:24,utilizationRate:"50.96%"},{theoreticalVolume:"137.44 GB",effectiveVolume:"78.51 GB",batchDepth:25,utilizationRate:"57.12%"},{theoreticalVolume:"274.88 GB",effectiveVolume:"169.64 GB",batchDepth:26,utilizationRate:"61.71%"},{theoreticalVolume:"549.76 GB",effectiveVolume:"354.69 GB",batchDepth:27,utilizationRate:"64.52%"},{theoreticalVolume:"1.10 TB",effectiveVolume:"739.37 GB",batchDepth:28,utilizationRate:"65.74%"},{theoreticalVolume:"2.20 TB",effectiveVolume:"1.52 TB",batchDepth:29,utilizationRate:"69.15%"},{theoreticalVolume:"4.40 TB",effectiveVolume:"3.10 TB",batchDepth:30,utilizationRate:"70.56%"},{theoreticalVolume:"8.80 TB",effectiveVolume:"6.29 TB",batchDepth:31,utilizationRate:"71.48%"},{theoreticalVolume:"17.59 TB",effectiveVolume:"12.70 TB",batchDepth:32,utilizationRate:"72.18%"},{theoreticalVolume:"35.18 TB",effectiveVolume:"25.57 TB",batchDepth:33,utilizationRate:"72.67%"},{theoreticalVolume:"70.37 TB",effectiveVolume:"51.37 TB",batchDepth:34,utilizationRate:"73.00%"},{theoreticalVolume:"140.74 TB",effectiveVolume:"103.08 TB",batchDepth:35,utilizationRate:"73.24%"},{theoreticalVolume:"281.47 TB",effectiveVolume:"206.65 TB",batchDepth:36,utilizationRate:"73.42%"},{theoreticalVolume:"562.95 TB",effectiveVolume:"413.98 TB",batchDepth:37,utilizationRate:"73.54%"},{theoreticalVolume:"1.13 PB",effectiveVolume:"828.91 TB",batchDepth:38,utilizationRate:"73.59%"},{theoreticalVolume:"2.25 PB",effectiveVolume:"1.66 PB",batchDepth:39,utilizationRate:"73.62%"},{theoreticalVolume:"4.50 PB",effectiveVolume:"3.32 PB",batchDepth:40,utilizationRate:"73.72%"},{theoreticalVolume:"9.01 PB",effectiveVolume:"6.64 PB",batchDepth:41,utilizationRate:"73.74%"}],[pt.PARANOID]:[{theoreticalVolume:"536.87 MB",effectiveVolume:"13.17 kB",batchDepth:17,utilizationRate:"0.00%"},{theoreticalVolume:"1.07 GB",effectiveVolume:"1.96 MB",batchDepth:18,utilizationRate:"0.18%"},{theoreticalVolume:"2.15 GB",effectiveVolume:"33.01 MB",batchDepth:19,utilizationRate:"1.50%"},{theoreticalVolume:"4.29 GB",effectiveVolume:"202.53 MB",batchDepth:20,utilizationRate:"4.61%"},{theoreticalVolume:"8.59 GB",effectiveVolume:"765.05 MB",batchDepth:21,utilizationRate:"8.68%"},{theoreticalVolume:"17.18 GB",effectiveVolume:"2.28 GB",batchDepth:22,utilizationRate:"13.27%"},{theoreticalVolume:"34.36 GB",effectiveVolume:"5.87 GB",batchDepth:23,utilizationRate:"17.08%"},{theoreticalVolume:"68.72 GB",effectiveVolume:"13.86 GB",batchDepth:24,utilizationRate:"20.17%"},{theoreticalVolume:"137.44 GB",effectiveVolume:"31.08 GB",batchDepth:25,utilizationRate:"22.61%"},{theoreticalVolume:"274.88 GB",effectiveVolume:"67.15 GB",batchDepth:26,utilizationRate:"24.43%"},{theoreticalVolume:"549.76 GB",effectiveVolume:"140.40 GB",batchDepth:27,utilizationRate:"25.54%"},{theoreticalVolume:"1.10 TB",effectiveVolume:"292.67 GB",batchDepth:28,utilizationRate:"26.03%"},{theoreticalVolume:"2.20 TB",effectiveVolume:"602.12 GB",batchDepth:29,utilizationRate:"27.35%"},{theoreticalVolume:"4.40 TB",effectiveVolume:"1.23 TB",batchDepth:30,utilizationRate:"27.94%"},{theoreticalVolume:"8.80 TB",effectiveVolume:"2.49 TB",batchDepth:31,utilizationRate:"28.32%"},{theoreticalVolume:"17.59 TB",effectiveVolume:"5.03 TB",batchDepth:32,utilizationRate:"28.60%"},{theoreticalVolume:"35.18 TB",effectiveVolume:"10.12 TB",batchDepth:33,utilizationRate:"28.77%"},{theoreticalVolume:"70.37 TB",effectiveVolume:"20.34 TB",batchDepth:34,utilizationRate:"28.91%"},{theoreticalVolume:"140.74 TB",effectiveVolume:"40.80 TB",batchDepth:35,utilizationRate:"29.00%"},{theoreticalVolume:"281.47 TB",effectiveVolume:"81.80 TB",batchDepth:36,utilizationRate:"29.06%"},{theoreticalVolume:"562.95 TB",effectiveVolume:"163.87 TB",batchDepth:37,utilizationRate:"29.11%"},{theoreticalVolume:"1.13 PB",effectiveVolume:"328.11 TB",batchDepth:38,utilizationRate:"29.14%"},{theoreticalVolume:"2.25 PB",effectiveVolume:"656.76 TB",batchDepth:39,utilizationRate:"29.16%"},{theoreticalVolume:"4.50 PB",effectiveVolume:"1.31 PB",batchDepth:40,utilizationRate:"29.18%"},{theoreticalVolume:"9.01 PB",effectiveVolume:"2.63 PB",batchDepth:41,utilizationRate:"29.19%"}]}};class Pt{constructor(e){this.seconds=Math.ceil(e),e<0&&(this.seconds=0)}static fromMilliseconds(e){return new Pt(e/1e3)}static fromSeconds(e){return new Pt(e)}static fromHours(e){return new Pt(e*60*60)}static fromDays(e){return new Pt(e*24*60*60)}static fromWeeks(e){return new Pt(e*7*24*60*60)}static fromYears(e){return new Pt(e*365*24*60*60)}static fromEndDate(e,t){return new Pt((e.getTime()-(t??new Date).getTime())/1e3)}static parseFromString(e){return Pt.fromSeconds($u.make(e)/1e3)}toSeconds(){return this.seconds}toHours(){return this.seconds/60/60}toDays(){return this.seconds/24/60/60}toWeeks(){return this.seconds/7/24/60/60}toYears(){return this.seconds/365/24/60/60}toEndDate(e){return new Date((e??new Date).getTime()+this.seconds*1e3)}represent(){return $u.secondsToHumanTime(this.seconds)}isZero(){return this.seconds===0}}Pt.ZERO=new Pt(0);class an{constructor(e){if(this.bytes=Math.ceil(e),e<0)throw Error("Size must be at least 0")}static fromBytes(e){return new an(e)}static fromKilobytes(e){return new an(e*1e3)}static fromMegabytes(e){return new an(e*1e3*1e3)}static fromGigabytes(e){return new an(e*1e3*1e3*1e3)}static parseFromString(e){return an.fromBytes(T0.makeStorage(e,1e3))}toBytes(){return this.bytes}toGigabytes(){return this.bytes/1e3/1e3/1e3}toFormattedString(){return T0.convertBytes(this.bytes,1e3)}represent(){return this.toFormattedString()}}class me{constructor(e){this.state=e}static fromDecimalString(e){return new me(bn.fromDecimalString(e,me.DIGITS))}static fromPLUR(e){return new me(new bn(e,me.DIGITS))}toPLURString(){return this.state.toString()}toPLURBigInt(){return this.state.value}toDecimalString(){return this.state.toDecimalString()}toSignificantDigits(e){return this.toDecimalString().slice(0,this.toDecimalString().indexOf(".")+e+1)}plus(e){return new me(this.state.add(e instanceof me?e.state:new bn(e,me.DIGITS)))}minus(e){return new me(this.state.subtract(e instanceof me?e.state:new bn(e,me.DIGITS)))}divide(e){return new me(this.state.divmod(e)[0])}gt(e){return this.state.compare(e.state)===1}gte(e){return this.state.compare(e.state)!==-1}lt(e){return this.state.compare(e.state)===-1}lte(e){return this.state.compare(e.state)!==1}eq(e){return this.state.compare(e.state)===0}exchangeToDAI(e){return qe.fromWei(this.state.exchange("*",new bn(e.toWeiBigInt(),qe.DIGITS),qe.DIGITS).value)}}me.DIGITS=16;class qe{constructor(e){this.state=e}static fromDecimalString(e){return new qe(bn.fromDecimalString(e,qe.DIGITS))}static fromWei(e){return new qe(new bn(e,qe.DIGITS))}toWeiString(){return this.state.toString()}toWeiBigInt(){return this.state.value}toDecimalString(){return this.state.toDecimalString()}toSignificantDigits(e){return this.toDecimalString().slice(0,this.toDecimalString().indexOf(".")+e+1)}plus(e){return new qe(this.state.add(e instanceof qe?e.state:new bn(e,qe.DIGITS)))}minus(e){return new qe(this.state.subtract(e instanceof qe?e.state:new bn(e,qe.DIGITS)))}divide(e){return new qe(this.state.divmod(e)[0])}gt(e){return this.state.compare(e.state)===1}gte(e){return this.state.compare(e.state)!==-1}lt(e){return this.state.compare(e.state)===-1}lte(e){return this.state.compare(e.state)!==1}eq(e){return this.state.compare(e.state)===0}exchangeToBZZ(e){return me.fromPLUR(this.state.exchange("/",new bn(e.toWeiBigInt(),qe.DIGITS),me.DIGITS).value)}}qe.DIGITS=18;const F9=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function pp(r){if(typeof File=="function"&&r instanceof File)return!0;const e=r;return typeof e=="object"&&typeof e.name=="string"&&(typeof e.stream=="function"||typeof e.arrayBuffer=="function")}async function xp(r){return r.arrayBuffer?r.arrayBuffer():new Promise(e=>{const t=new FileReader;t.onload=()=>e(t.result),t.readAsArrayBuffer(r)})}function be(r,e){return typeof r=="bigint"&&(r=r.toString()),w.asIntegerString(r,e)}function Lw(r){const e=w.asObject(r,{name:"BeeRequestOptions"});return{baseURL:w.asOptional(t=>w.asString(t,{name:"baseURL"}),e.baseURL),timeout:w.asOptional(t=>w.asInteger(t,{name:"timeout",min:0}),e.timeout),headers:w.asOptional(t=>w.asStringMap(t,{name:"headers"}),e.headers),onRequest:w.asOptional(t=>w.asFunction(t,{name:"onRequest"}),e.onRequest),httpAgent:e.httpAgent,httpsAgent:e.httpsAgent,endlesslyRetry:w.asOptional(t=>w.asBoolean(t,{name:"endlesslyRetry"}),e.endlesslyRetry),signal:e.signal}}function Wn(r){const e=w.asObject(r,{name:"DownloadOptions"});return{redundancyStrategy:w.asOptional(t=>w.asInteger(t,{name:"redundancyStrategy"}),e.redundancyStrategy),fallback:w.asOptional(t=>w.asBoolean(t,{name:"fallback"}),e.fallback),timeoutMs:w.asOptional(t=>w.asInteger(t,{name:"timeoutMs",min:0}),e.timeoutMs),actPublisher:w.asOptional(t=>new qt(t),e.actPublisher),actHistoryAddress:w.asOptional(t=>new se(t),e.actHistoryAddress),actTimestamp:w.asOptional(t=>w.asNumber(t,{name:"actTimestamp"}),e.actTimestamp)}}function Xi(r,e="UploadOptions"){const t=w.asObject(r,{name:e});return{act:w.asOptional(n=>w.asBoolean(n,{name:"act"}),t.act),actHistoryAddress:w.asOptional(n=>new se(n),t.actHistoryAddress),deferred:w.asOptional(n=>w.asBoolean(n,{name:"deferred"}),t.deferred),encrypt:w.asOptional(n=>w.asBoolean(n,{name:"encrypt"}),t.encrypt),pin:w.asOptional(n=>w.asBoolean(n,{name:"pin"}),t.pin),tag:w.asOptional(n=>w.asInteger(n,{name:"tag",min:0}),t.tag)}}function Mw(r,e="UploadOptions"){const t=Xi(r,e),n=w.asObject(r,{name:e});return{...t,redundancyLevel:w.asOptional(i=>w.asInteger(i,{name:"redundancyLevel",min:0}),n.redundancyLevel)}}function Vw(r){const e=Xi(r,"FileUploadOptions"),t=w.asObject(r,{name:"FileUploadOptions"});return{...e,size:w.asOptional(n=>w.asInteger(n,{name:"size",min:0}),t.size),contentType:w.asOptional(n=>w.asString(n,{name:"contentType"}),t.contentType),redundancyLevel:w.asOptional(n=>w.asInteger(n,{name:"redundancyLevel",min:0}),t.redundancyLevel)}}function Ec(r){const e=Xi(r,"CollectionUploadOptions"),t=w.asObject(r,{name:"CollectionUploadOptions"});return{...e,errorDocument:w.asOptional(n=>w.asString(n,{name:"errorDocument"}),t.errorDocument),indexDocument:w.asOptional(n=>w.asString(n,{name:"indexDocument"}),t.indexDocument),redundancyLevel:w.asOptional(n=>w.asInteger(n,{name:"redundancyLevel",min:0}),t.redundancyLevel)}}function Gw(r){try{const e=w.asObject(r,{name:"Tag"});return w.asInteger(e.uid,{name:"Tag.uid"}),!0}catch{return!1}}function zw(r){const e=w.asObject(r,{name:"PssMessageHandler"});return{onMessage:w.asFunction(e.onMessage,{name:"onMessage"}),onError:w.asFunction(e.onError,{name:"onError"}),onClose:w.asFunction(e.onClose,{name:"onClose"})}}function Hw(r){const e=w.asObject(r,{name:"GsocMessageHandler"});return{onMessage:w.asFunction(e.onMessage,{name:"onMessage"}),onError:w.asFunction(e.onError,{name:"onError"}),onClose:w.asFunction(e.onClose,{name:"onClose"})}}function k0(r){const e=w.asObject(r,{name:"PostageBatchOptions"});return{gasPrice:w.asOptional(t=>be(t,{name:"gasPrice"}),e.gasPrice),immutableFlag:w.asOptional(t=>w.asBoolean(t,{name:"immutableFlag"}),e.immutableFlag),label:w.asOptional(t=>w.asString(t,{name:"label"}),e.label),waitForUsable:w.asOptional(t=>w.asBoolean(t,{name:"waitForUsable"}),e.waitForUsable),waitForUsableTimeout:w.asOptional(t=>w.asInteger(t,{name:"waitForUsableTimeout",min:0}),e.waitForUsableTimeout)}}function D0(r,e="TransactionOptions"){const t=w.asObject(r,{name:e});return{gasLimit:w.asOptional(n=>be(n,{name:"gasLimit",min:0n}),t.gasLimit),gasPrice:w.asOptional(n=>be(n,{name:"gasPrice",min:0n}),t.gasPrice)}}function F0(r){if(typeof r!="string"&&!(r instanceof Uint8Array))throw new TypeError("Data must be either string or Uint8Array!")}function $w(r){if(typeof r!="string"&&!(r instanceof Uint8Array)&&!pp(r))throw new TypeError("Data must be either string, Readable, Uint8Array or File!")}function _w(r){const e=w.asObject(r,{name:"AllTagsOptions"});return{limit:w.asOptional(t=>w.asInteger(t,{name:"limit",min:Fw,max:Uw}),e.limit),offset:w.asOptional(t=>w.asInteger(t,{name:"offset",min:0}),e.offset)}}function Xn(r){if(r==null)throw new TypeError(`Expected number | Tag | string from tagUid, got: ${r}`);if(Gw(r))return r.uid;if(typeof r=="number"||typeof r=="string")return w.asNumber(r,{name:"tagUid",min:0});throw new TypeError(`Expected number | Tag | string from tagUid, got: ${r}`)}function jw(r){return!Number.isInteger(r)||r<1?1:r>3155695200?3155695200:r}function qw(r){return!Number.isInteger(r)||r<24e3?24e3:r}const Kw=.9;function Qw(r,e,t){return r/Math.pow(2,e-t)}function mp(r){return 4096*2**r}const bp=[[17,4089e-8],[18,.00609],[19,.10249],[20,.62891],[21,2.38],[22,7.07],[23,18.24],[24,43.04],[25,96.5],[26,208.52],[27,435.98],[28,908.81],[29,1870],[30,3810],[31,7730],[32,15610],[33,31430],[34,63150]];function ra(r,e,t){if(r<17)return 0;if(e!==void 0&&t!==void 0){const a=dp[e?"ENCRYPTION_ON":"ENCRYPTION_OFF"][t].find(c=>c.batchDepth===r);if(a?.effectiveVolume)return op(a.effectiveVolume)}else{const n=bp.find(([i,a])=>{if(r===i)return a});if(n)return n[1]*1e3*1e3*1e3}return Math.ceil(mp(r)*Kw)}function U9(r,e){const t=new Map;for(let n=17;n<35;n++)t.set(n,ra(n,r,e));return t}function Vr(r,e){return me.fromPLUR(2n**BigInt(r)*BigInt(e))}function L9(r,e,t){const n=BigInt(be(r));return Pt.fromSeconds(Number(n*BigInt(t)/BigInt(e)))}function hn(r,e,t){return BigInt(r.toSeconds())/BigInt(t)*BigInt(e)+1n}function Gr(r,e,t){if(e!==void 0&&t!==void 0){const a=dp[e?"ENCRYPTION_ON":"ENCRYPTION_OFF"][t].find(c=>r.toBytes()<=op(c.effectiveVolume));if(a?.effectiveVolume)return a.batchDepth}else for(const[n,i]of bp)if(r.toBytes()<=i*1e3*1e3*1e3)return n;return 35}function Jw(r){return Ww(r.signature,r.batchId.toUint8Array(),r.timestamp,r.index)}function Ww(r,e,t,n){if(r.length!==65)throw Error("invalid signature length");if(e.length!==32)throw Error("invalid batch ID length");if(t.length!==8)throw Error("invalid timestamp length");if(n.length!==8)throw Error("invalid index length");return new we($.concatBytes(e,n,t,r))}function gp(r,e,t){const n=Qw(r.utilization,r.depth,r.bucketDepth),i=jw(r.batchTTL),a=Pt.fromSeconds(i),c=ra(r.depth,e,t);return{batchID:new De(r.batchID),utilization:r.utilization,usable:r.usable,label:r.label,depth:r.depth,amount:be(r.amount),bucketDepth:r.bucketDepth,blockNumber:r.blockNumber,immutableFlag:r.immutableFlag,usage:n,usageText:`${Math.round(n*100)}%`,size:an.fromBytes(c),remainingSize:an.fromBytes(Math.ceil(c*(1-n))),theoreticalSize:an.fromBytes(mp(r.depth)),duration:a,calculateSize(l,f){const p=ra(r.depth,l,f);return an.fromBytes(p)},calculateRemainingSize(l,f){const p=ra(r.depth,l,f);return an.fromBytes(Math.ceil(p*(1-this.usage)))}}}function yp(r){const e=Yw(r["content-disposition"]),t=Xw(r["swarm-tag-uid"]),n=r["content-type"]||void 0;return{name:e,tagUid:t,contentType:n}}function Yw(r){if(!r)throw new cn("missing content-disposition header");const e=r.match(/filename\*?=['"]?(?:UTF-\d['"]*)?([^;\r\n"']*)['"]?;?/i);if(e&&e.length>0)return e[1];throw new cn("invalid content-disposition header")}function Xw(r){if(r)return parseInt(r,10)}function gt(r,e){const t={};if(Zw(r)?t["swarm-postage-stamp"]=Jw(r).toHex():r&&(r=new De(r),t["swarm-postage-batch-id"]=r.toHex()),!e)return t;const n=w.asObject(e);return n.size&&(t["content-length"]=String(n.size)),n.contentType&&(t["content-type"]=String(n.contentType)),n.redundancyLevel&&(t["swarm-redundancy-level"]=String(n.redundancyLevel)),w.isBoolean(n.act)&&(t["swarm-act"]=String(n.act)),w.isBoolean(n.pin)&&(t["swarm-pin"]=String(n.pin)),w.isBoolean(n.encrypt)&&(t["swarm-encrypt"]=n.encrypt.toString()),n.tag&&(t["swarm-tag"]=String(n.tag)),w.isBoolean(n.deferred)&&(t["swarm-deferred-upload"]=n.deferred.toString()),n.redundancyStrategy&&(t["swarm-redundancy-strategy"]=String(n.redundancyStrategy)),w.isBoolean(n.fallback)&&(t["swarm-redundancy-fallback-mode"]=n.fallback.toString()),n.timeoutMs&&(t["swarm-chunk-retrieval-timeout"]=String(n.timeoutMs)),n.indexDocument&&(t["swarm-index-document"]=String(n.indexDocument)),n.errorDocument&&(t["swarm-error-document"]=String(n.errorDocument)),n.actPublisher&&(t["swarm-act-publisher"]=new qt(n.actPublisher).toCompressedHex()),n.actHistoryAddress&&(t["swarm-act-history-address"]=new se(n.actHistoryAddress).toHex()),n.actTimestamp&&(t["swarm-act-timestamp"]=String(n.actTimestamp)),(n.actPublisher||n.actHistoryAddress||n.actTimestamp)&&(t["swarm-act"]="true"),n.gasPrice&&(t["gas-price"]=String(n.gasPrice)),n.gasLimit&&(t["gas-limit"]=String(n.gasLimit)),t}function Zw(r){if(!w.isObject(r))return!1;const e=r;return e.issuer!==void 0&&e.index!==void 0&&e.signature!==void 0&&e.timestamp!==void 0&&e.batchId!==void 0}var wp={},Oa={};Oa.byteLength=n3;Oa.toByteArray=i3;Oa.fromByteArray=o3;var gn=[],Ht=[],e3=typeof Uint8Array<"u"?Uint8Array:Array,Bc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var zr=0,t3=Bc.length;zr<t3;++zr)gn[zr]=Bc[zr],Ht[Bc.charCodeAt(zr)]=zr;Ht[45]=62;Ht[95]=63;function Ap(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}function n3(r){var e=Ap(r),t=e[0],n=e[1];return(t+n)*3/4-n}function r3(r,e,t){return(e+t)*3/4-t}function i3(r){var e,t=Ap(r),n=t[0],i=t[1],a=new e3(r3(r,n,i)),c=0,l=i>0?n-4:n,f;for(f=0;f<l;f+=4)e=Ht[r.charCodeAt(f)]<<18|Ht[r.charCodeAt(f+1)]<<12|Ht[r.charCodeAt(f+2)]<<6|Ht[r.charCodeAt(f+3)],a[c++]=e>>16&255,a[c++]=e>>8&255,a[c++]=e&255;return i===2&&(e=Ht[r.charCodeAt(f)]<<2|Ht[r.charCodeAt(f+1)]>>4,a[c++]=e&255),i===1&&(e=Ht[r.charCodeAt(f)]<<10|Ht[r.charCodeAt(f+1)]<<4|Ht[r.charCodeAt(f+2)]>>2,a[c++]=e>>8&255,a[c++]=e&255),a}function s3(r){return gn[r>>18&63]+gn[r>>12&63]+gn[r>>6&63]+gn[r&63]}function a3(r,e,t){for(var n,i=[],a=e;a<t;a+=3)n=(r[a]<<16&16711680)+(r[a+1]<<8&65280)+(r[a+2]&255),i.push(s3(n));return i.join("")}function o3(r){for(var e,t=r.length,n=t%3,i=[],a=16383,c=0,l=t-n;c<l;c+=a)i.push(a3(r,c,c+a>l?l:c+a));return n===1?(e=r[t-1],i.push(gn[e>>2]+gn[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(gn[e>>10]+gn[e>>4&63]+gn[e<<2&63]+"=")),i.join("")}var Al={};Al.read=function(r,e,t,n,i){var a,c,l=i*8-n-1,f=(1<<l)-1,p=f>>1,h=-7,x=t?i-1:0,y=t?-1:1,E=r[e+x];for(x+=y,a=E&(1<<-h)-1,E>>=-h,h+=l;h>0;a=a*256+r[e+x],x+=y,h-=8);for(c=a&(1<<-h)-1,a>>=-h,h+=n;h>0;c=c*256+r[e+x],x+=y,h-=8);if(a===0)a=1-p;else{if(a===f)return c?NaN:(E?-1:1)*(1/0);c=c+Math.pow(2,n),a=a-p}return(E?-1:1)*c*Math.pow(2,a-n)};Al.write=function(r,e,t,n,i,a){var c,l,f,p=a*8-i-1,h=(1<<p)-1,x=h>>1,y=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=n?0:a-1,v=n?1:-1,R=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,c=h):(c=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-c))<1&&(c--,f*=2),c+x>=1?e+=y/f:e+=y*Math.pow(2,1-x),e*f>=2&&(c++,f/=2),c+x>=h?(l=0,c=h):c+x>=1?(l=(e*f-1)*Math.pow(2,i),c=c+x):(l=e*Math.pow(2,x-1)*Math.pow(2,i),c=0));i>=8;r[t+E]=l&255,E+=v,l/=256,i-=8);for(c=c<<i|l,p+=i;p>0;r[t+E]=c&255,E+=v,c/=256,p-=8);r[t+E-v]|=R*128};(function(r){const e=Oa,t=Al,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;r.Buffer=h,r.SlowBuffer=H,r.INSPECT_MAX_BYTES=50;const i=2147483647;r.kMaxLength=i;const{Uint8Array:a,ArrayBuffer:c,SharedArrayBuffer:l}=globalThis;h.TYPED_ARRAY_SUPPORT=f(),!h.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function f(){try{const A=new a(1),m={foo:function(){return 42}};return Object.setPrototypeOf(m,a.prototype),Object.setPrototypeOf(A,m),A.foo()===42}catch{return!1}}Object.defineProperty(h.prototype,"parent",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.buffer}}),Object.defineProperty(h.prototype,"offset",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.byteOffset}});function p(A){if(A>i)throw new RangeError('The value "'+A+'" is invalid for option "size"');const m=new a(A);return Object.setPrototypeOf(m,h.prototype),m}function h(A,m,b){if(typeof A=="number"){if(typeof m=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return v(A)}return x(A,m,b)}h.poolSize=8192;function x(A,m,b){if(typeof A=="string")return R(A,m);if(c.isView(A))return S(A);if(A==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof A);if(yt(A,c)||A&&yt(A.buffer,c)||typeof l<"u"&&(yt(A,l)||A&&yt(A.buffer,l)))return D(A,m,b);if(typeof A=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const T=A.valueOf&&A.valueOf();if(T!=null&&T!==A)return h.from(T,m,b);const N=U(A);if(N)return N;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof A[Symbol.toPrimitive]=="function")return h.from(A[Symbol.toPrimitive]("string"),m,b);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof A)}h.from=function(A,m,b){return x(A,m,b)},Object.setPrototypeOf(h.prototype,a.prototype),Object.setPrototypeOf(h,a);function y(A){if(typeof A!="number")throw new TypeError('"size" argument must be of type number');if(A<0)throw new RangeError('The value "'+A+'" is invalid for option "size"')}function E(A,m,b){return y(A),A<=0?p(A):m!==void 0?typeof b=="string"?p(A).fill(m,b):p(A).fill(m):p(A)}h.alloc=function(A,m,b){return E(A,m,b)};function v(A){return y(A),p(A<0?0:K(A)|0)}h.allocUnsafe=function(A){return v(A)},h.allocUnsafeSlow=function(A){return v(A)};function R(A,m){if((typeof m!="string"||m==="")&&(m="utf8"),!h.isEncoding(m))throw new TypeError("Unknown encoding: "+m);const b=j(A,m)|0;let T=p(b);const N=T.write(A,m);return N!==b&&(T=T.slice(0,N)),T}function C(A){const m=A.length<0?0:K(A.length)|0,b=p(m);for(let T=0;T<m;T+=1)b[T]=A[T]&255;return b}function S(A){if(yt(A,a)){const m=new a(A);return D(m.buffer,m.byteOffset,m.byteLength)}return C(A)}function D(A,m,b){if(m<0||A.byteLength<m)throw new RangeError('"offset" is outside of buffer bounds');if(A.byteLength<m+(b||0))throw new RangeError('"length" is outside of buffer bounds');let T;return m===void 0&&b===void 0?T=new a(A):b===void 0?T=new a(A,m):T=new a(A,m,b),Object.setPrototypeOf(T,h.prototype),T}function U(A){if(h.isBuffer(A)){const m=K(A.length)|0,b=p(m);return b.length===0||A.copy(b,0,0,m),b}if(A.length!==void 0)return typeof A.length!="number"||Xe(A.length)?p(0):C(A);if(A.type==="Buffer"&&Array.isArray(A.data))return C(A.data)}function K(A){if(A>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return A|0}function H(A){return+A!=A&&(A=0),h.alloc(+A)}h.isBuffer=function(m){return m!=null&&m._isBuffer===!0&&m!==h.prototype},h.compare=function(m,b){if(yt(m,a)&&(m=h.from(m,m.offset,m.byteLength)),yt(b,a)&&(b=h.from(b,b.offset,b.byteLength)),!h.isBuffer(m)||!h.isBuffer(b))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(m===b)return 0;let T=m.length,N=b.length;for(let k=0,M=Math.min(T,N);k<M;++k)if(m[k]!==b[k]){T=m[k],N=b[k];break}return T<N?-1:N<T?1:0},h.isEncoding=function(m){switch(String(m).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},h.concat=function(m,b){if(!Array.isArray(m))throw new TypeError('"list" argument must be an Array of Buffers');if(m.length===0)return h.alloc(0);let T;if(b===void 0)for(b=0,T=0;T<m.length;++T)b+=m[T].length;const N=h.allocUnsafe(b);let k=0;for(T=0;T<m.length;++T){let M=m[T];if(yt(M,a))k+M.length>N.length?(h.isBuffer(M)||(M=h.from(M)),M.copy(N,k)):a.prototype.set.call(N,M,k);else if(h.isBuffer(M))M.copy(N,k);else throw new TypeError('"list" argument must be an Array of Buffers');k+=M.length}return N};function j(A,m){if(h.isBuffer(A))return A.length;if(c.isView(A)||yt(A,c))return A.byteLength;if(typeof A!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof A);const b=A.length,T=arguments.length>2&&arguments[2]===!0;if(!T&&b===0)return 0;let N=!1;for(;;)switch(m){case"ascii":case"latin1":case"binary":return b;case"utf8":case"utf-8":return Ut(A).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b*2;case"hex":return b>>>1;case"base64":return vs(A).length;default:if(N)return T?-1:Ut(A).length;m=(""+m).toLowerCase(),N=!0}}h.byteLength=j;function F(A,m,b){let T=!1;if((m===void 0||m<0)&&(m=0),m>this.length||((b===void 0||b>this.length)&&(b=this.length),b<=0)||(b>>>=0,m>>>=0,b<=m))return"";for(A||(A="utf8");;)switch(A){case"hex":return X(this,m,b);case"utf8":case"utf-8":return ae(this,m,b);case"ascii":return Re(this,m,b);case"latin1":case"binary":return P(this,m,b);case"base64":return Q(this,m,b);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return oe(this,m,b);default:if(T)throw new TypeError("Unknown encoding: "+A);A=(A+"").toLowerCase(),T=!0}}h.prototype._isBuffer=!0;function z(A,m,b){const T=A[m];A[m]=A[b],A[b]=T}h.prototype.swap16=function(){const m=this.length;if(m%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let b=0;b<m;b+=2)z(this,b,b+1);return this},h.prototype.swap32=function(){const m=this.length;if(m%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let b=0;b<m;b+=4)z(this,b,b+3),z(this,b+1,b+2);return this},h.prototype.swap64=function(){const m=this.length;if(m%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let b=0;b<m;b+=8)z(this,b,b+7),z(this,b+1,b+6),z(this,b+2,b+5),z(this,b+3,b+4);return this},h.prototype.toString=function(){const m=this.length;return m===0?"":arguments.length===0?ae(this,0,m):F.apply(this,arguments)},h.prototype.toLocaleString=h.prototype.toString,h.prototype.equals=function(m){if(!h.isBuffer(m))throw new TypeError("Argument must be a Buffer");return this===m?!0:h.compare(this,m)===0},h.prototype.inspect=function(){let m="";const b=r.INSPECT_MAX_BYTES;return m=this.toString("hex",0,b).replace(/(.{2})/g,"$1 ").trim(),this.length>b&&(m+=" ... "),"<Buffer "+m+">"},n&&(h.prototype[n]=h.prototype.inspect),h.prototype.compare=function(m,b,T,N,k){if(yt(m,a)&&(m=h.from(m,m.offset,m.byteLength)),!h.isBuffer(m))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof m);if(b===void 0&&(b=0),T===void 0&&(T=m?m.length:0),N===void 0&&(N=0),k===void 0&&(k=this.length),b<0||T>m.length||N<0||k>this.length)throw new RangeError("out of range index");if(N>=k&&b>=T)return 0;if(N>=k)return-1;if(b>=T)return 1;if(b>>>=0,T>>>=0,N>>>=0,k>>>=0,this===m)return 0;let M=k-N,ge=T-b;const Ge=Math.min(M,ge),Ie=this.slice(N,k),Me=m.slice(b,T);for(let Se=0;Se<Ge;++Se)if(Ie[Se]!==Me[Se]){M=Ie[Se],ge=Me[Se];break}return M<ge?-1:ge<M?1:0};function W(A,m,b,T,N){if(A.length===0)return-1;if(typeof b=="string"?(T=b,b=0):b>2147483647?b=2147483647:b<-2147483648&&(b=-2147483648),b=+b,Xe(b)&&(b=N?0:A.length-1),b<0&&(b=A.length+b),b>=A.length){if(N)return-1;b=A.length-1}else if(b<0)if(N)b=0;else return-1;if(typeof m=="string"&&(m=h.from(m,T)),h.isBuffer(m))return m.length===0?-1:ne(A,m,b,T,N);if(typeof m=="number")return m=m&255,typeof a.prototype.indexOf=="function"?N?a.prototype.indexOf.call(A,m,b):a.prototype.lastIndexOf.call(A,m,b):ne(A,[m],b,T,N);throw new TypeError("val must be string, number or Buffer")}function ne(A,m,b,T,N){let k=1,M=A.length,ge=m.length;if(T!==void 0&&(T=String(T).toLowerCase(),T==="ucs2"||T==="ucs-2"||T==="utf16le"||T==="utf-16le")){if(A.length<2||m.length<2)return-1;k=2,M/=2,ge/=2,b/=2}function Ge(Me,Se){return k===1?Me[Se]:Me.readUInt16BE(Se*k)}let Ie;if(N){let Me=-1;for(Ie=b;Ie<M;Ie++)if(Ge(A,Ie)===Ge(m,Me===-1?0:Ie-Me)){if(Me===-1&&(Me=Ie),Ie-Me+1===ge)return Me*k}else Me!==-1&&(Ie-=Ie-Me),Me=-1}else for(b+ge>M&&(b=M-ge),Ie=b;Ie>=0;Ie--){let Me=!0;for(let Se=0;Se<ge;Se++)if(Ge(A,Ie+Se)!==Ge(m,Se)){Me=!1;break}if(Me)return Ie}return-1}h.prototype.includes=function(m,b,T){return this.indexOf(m,b,T)!==-1},h.prototype.indexOf=function(m,b,T){return W(this,m,b,T,!0)},h.prototype.lastIndexOf=function(m,b,T){return W(this,m,b,T,!1)};function ie(A,m,b,T){b=Number(b)||0;const N=A.length-b;T?(T=Number(T),T>N&&(T=N)):T=N;const k=m.length;T>k/2&&(T=k/2);let M;for(M=0;M<T;++M){const ge=parseInt(m.substr(M*2,2),16);if(Xe(ge))return M;A[b+M]=ge}return M}function de(A,m,b,T){return Vn(Ut(m,A.length-b),A,b,T)}function he(A,m,b,T){return Vn(Mn(m),A,b,T)}function ye(A,m,b,T){return Vn(vs(m),A,b,T)}function q(A,m,b,T){return Vn(Ts(m,A.length-b),A,b,T)}h.prototype.write=function(m,b,T,N){if(b===void 0)N="utf8",T=this.length,b=0;else if(T===void 0&&typeof b=="string")N=b,T=this.length,b=0;else if(isFinite(b))b=b>>>0,isFinite(T)?(T=T>>>0,N===void 0&&(N="utf8")):(N=T,T=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const k=this.length-b;if((T===void 0||T>k)&&(T=k),m.length>0&&(T<0||b<0)||b>this.length)throw new RangeError("Attempt to write outside buffer bounds");N||(N="utf8");let M=!1;for(;;)switch(N){case"hex":return ie(this,m,b,T);case"utf8":case"utf-8":return de(this,m,b,T);case"ascii":case"latin1":case"binary":return he(this,m,b,T);case"base64":return ye(this,m,b,T);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return q(this,m,b,T);default:if(M)throw new TypeError("Unknown encoding: "+N);N=(""+N).toLowerCase(),M=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Q(A,m,b){return m===0&&b===A.length?e.fromByteArray(A):e.fromByteArray(A.slice(m,b))}function ae(A,m,b){b=Math.min(A.length,b);const T=[];let N=m;for(;N<b;){const k=A[N];let M=null,ge=k>239?4:k>223?3:k>191?2:1;if(N+ge<=b){let Ge,Ie,Me,Se;switch(ge){case 1:k<128&&(M=k);break;case 2:Ge=A[N+1],(Ge&192)===128&&(Se=(k&31)<<6|Ge&63,Se>127&&(M=Se));break;case 3:Ge=A[N+1],Ie=A[N+2],(Ge&192)===128&&(Ie&192)===128&&(Se=(k&15)<<12|(Ge&63)<<6|Ie&63,Se>2047&&(Se<55296||Se>57343)&&(M=Se));break;case 4:Ge=A[N+1],Ie=A[N+2],Me=A[N+3],(Ge&192)===128&&(Ie&192)===128&&(Me&192)===128&&(Se=(k&15)<<18|(Ge&63)<<12|(Ie&63)<<6|Me&63,Se>65535&&Se<1114112&&(M=Se))}}M===null?(M=65533,ge=1):M>65535&&(M-=65536,T.push(M>>>10&1023|55296),M=56320|M&1023),T.push(M),N+=ge}return le(T)}const ce=4096;function le(A){const m=A.length;if(m<=ce)return String.fromCharCode.apply(String,A);let b="",T=0;for(;T<m;)b+=String.fromCharCode.apply(String,A.slice(T,T+=ce));return b}function Re(A,m,b){let T="";b=Math.min(A.length,b);for(let N=m;N<b;++N)T+=String.fromCharCode(A[N]&127);return T}function P(A,m,b){let T="";b=Math.min(A.length,b);for(let N=m;N<b;++N)T+=String.fromCharCode(A[N]);return T}function X(A,m,b){const T=A.length;(!m||m<0)&&(m=0),(!b||b<0||b>T)&&(b=T);let N="";for(let k=m;k<b;++k)N+=ln[A[k]];return N}function oe(A,m,b){const T=A.slice(m,b);let N="";for(let k=0;k<T.length-1;k+=2)N+=String.fromCharCode(T[k]+T[k+1]*256);return N}h.prototype.slice=function(m,b){const T=this.length;m=~~m,b=b===void 0?T:~~b,m<0?(m+=T,m<0&&(m=0)):m>T&&(m=T),b<0?(b+=T,b<0&&(b=0)):b>T&&(b=T),b<m&&(b=m);const N=this.subarray(m,b);return Object.setPrototypeOf(N,h.prototype),N};function ue(A,m,b){if(A%1!==0||A<0)throw new RangeError("offset is not uint");if(A+m>b)throw new RangeError("Trying to access beyond buffer length")}h.prototype.readUintLE=h.prototype.readUIntLE=function(m,b,T){m=m>>>0,b=b>>>0,T||ue(m,b,this.length);let N=this[m],k=1,M=0;for(;++M<b&&(k*=256);)N+=this[m+M]*k;return N},h.prototype.readUintBE=h.prototype.readUIntBE=function(m,b,T){m=m>>>0,b=b>>>0,T||ue(m,b,this.length);let N=this[m+--b],k=1;for(;b>0&&(k*=256);)N+=this[m+--b]*k;return N},h.prototype.readUint8=h.prototype.readUInt8=function(m,b){return m=m>>>0,b||ue(m,1,this.length),this[m]},h.prototype.readUint16LE=h.prototype.readUInt16LE=function(m,b){return m=m>>>0,b||ue(m,2,this.length),this[m]|this[m+1]<<8},h.prototype.readUint16BE=h.prototype.readUInt16BE=function(m,b){return m=m>>>0,b||ue(m,2,this.length),this[m]<<8|this[m+1]},h.prototype.readUint32LE=h.prototype.readUInt32LE=function(m,b){return m=m>>>0,b||ue(m,4,this.length),(this[m]|this[m+1]<<8|this[m+2]<<16)+this[m+3]*16777216},h.prototype.readUint32BE=h.prototype.readUInt32BE=function(m,b){return m=m>>>0,b||ue(m,4,this.length),this[m]*16777216+(this[m+1]<<16|this[m+2]<<8|this[m+3])},h.prototype.readBigUInt64LE=tn(function(m){m=m>>>0,en(m,"offset");const b=this[m],T=this[m+7];(b===void 0||T===void 0)&&ar(m,this.length-8);const N=b+this[++m]*2**8+this[++m]*2**16+this[++m]*2**24,k=this[++m]+this[++m]*2**8+this[++m]*2**16+T*2**24;return BigInt(N)+(BigInt(k)<<BigInt(32))}),h.prototype.readBigUInt64BE=tn(function(m){m=m>>>0,en(m,"offset");const b=this[m],T=this[m+7];(b===void 0||T===void 0)&&ar(m,this.length-8);const N=b*2**24+this[++m]*2**16+this[++m]*2**8+this[++m],k=this[++m]*2**24+this[++m]*2**16+this[++m]*2**8+T;return(BigInt(N)<<BigInt(32))+BigInt(k)}),h.prototype.readIntLE=function(m,b,T){m=m>>>0,b=b>>>0,T||ue(m,b,this.length);let N=this[m],k=1,M=0;for(;++M<b&&(k*=256);)N+=this[m+M]*k;return k*=128,N>=k&&(N-=Math.pow(2,8*b)),N},h.prototype.readIntBE=function(m,b,T){m=m>>>0,b=b>>>0,T||ue(m,b,this.length);let N=b,k=1,M=this[m+--N];for(;N>0&&(k*=256);)M+=this[m+--N]*k;return k*=128,M>=k&&(M-=Math.pow(2,8*b)),M},h.prototype.readInt8=function(m,b){return m=m>>>0,b||ue(m,1,this.length),this[m]&128?(255-this[m]+1)*-1:this[m]},h.prototype.readInt16LE=function(m,b){m=m>>>0,b||ue(m,2,this.length);const T=this[m]|this[m+1]<<8;return T&32768?T|4294901760:T},h.prototype.readInt16BE=function(m,b){m=m>>>0,b||ue(m,2,this.length);const T=this[m+1]|this[m]<<8;return T&32768?T|4294901760:T},h.prototype.readInt32LE=function(m,b){return m=m>>>0,b||ue(m,4,this.length),this[m]|this[m+1]<<8|this[m+2]<<16|this[m+3]<<24},h.prototype.readInt32BE=function(m,b){return m=m>>>0,b||ue(m,4,this.length),this[m]<<24|this[m+1]<<16|this[m+2]<<8|this[m+3]},h.prototype.readBigInt64LE=tn(function(m){m=m>>>0,en(m,"offset");const b=this[m],T=this[m+7];(b===void 0||T===void 0)&&ar(m,this.length-8);const N=this[m+4]+this[m+5]*2**8+this[m+6]*2**16+(T<<24);return(BigInt(N)<<BigInt(32))+BigInt(b+this[++m]*2**8+this[++m]*2**16+this[++m]*2**24)}),h.prototype.readBigInt64BE=tn(function(m){m=m>>>0,en(m,"offset");const b=this[m],T=this[m+7];(b===void 0||T===void 0)&&ar(m,this.length-8);const N=(b<<24)+this[++m]*2**16+this[++m]*2**8+this[++m];return(BigInt(N)<<BigInt(32))+BigInt(this[++m]*2**24+this[++m]*2**16+this[++m]*2**8+T)}),h.prototype.readFloatLE=function(m,b){return m=m>>>0,b||ue(m,4,this.length),t.read(this,m,!0,23,4)},h.prototype.readFloatBE=function(m,b){return m=m>>>0,b||ue(m,4,this.length),t.read(this,m,!1,23,4)},h.prototype.readDoubleLE=function(m,b){return m=m>>>0,b||ue(m,8,this.length),t.read(this,m,!0,52,8)},h.prototype.readDoubleBE=function(m,b){return m=m>>>0,b||ue(m,8,this.length),t.read(this,m,!1,52,8)};function fe(A,m,b,T,N,k){if(!h.isBuffer(A))throw new TypeError('"buffer" argument must be a Buffer instance');if(m>N||m<k)throw new RangeError('"value" argument is out of bounds');if(b+T>A.length)throw new RangeError("Index out of range")}h.prototype.writeUintLE=h.prototype.writeUIntLE=function(m,b,T,N){if(m=+m,b=b>>>0,T=T>>>0,!N){const ge=Math.pow(2,8*T)-1;fe(this,m,b,T,ge,0)}let k=1,M=0;for(this[b]=m&255;++M<T&&(k*=256);)this[b+M]=m/k&255;return b+T},h.prototype.writeUintBE=h.prototype.writeUIntBE=function(m,b,T,N){if(m=+m,b=b>>>0,T=T>>>0,!N){const ge=Math.pow(2,8*T)-1;fe(this,m,b,T,ge,0)}let k=T-1,M=1;for(this[b+k]=m&255;--k>=0&&(M*=256);)this[b+k]=m/M&255;return b+T},h.prototype.writeUint8=h.prototype.writeUInt8=function(m,b,T){return m=+m,b=b>>>0,T||fe(this,m,b,1,255,0),this[b]=m&255,b+1},h.prototype.writeUint16LE=h.prototype.writeUInt16LE=function(m,b,T){return m=+m,b=b>>>0,T||fe(this,m,b,2,65535,0),this[b]=m&255,this[b+1]=m>>>8,b+2},h.prototype.writeUint16BE=h.prototype.writeUInt16BE=function(m,b,T){return m=+m,b=b>>>0,T||fe(this,m,b,2,65535,0),this[b]=m>>>8,this[b+1]=m&255,b+2},h.prototype.writeUint32LE=h.prototype.writeUInt32LE=function(m,b,T){return m=+m,b=b>>>0,T||fe(this,m,b,4,4294967295,0),this[b+3]=m>>>24,this[b+2]=m>>>16,this[b+1]=m>>>8,this[b]=m&255,b+4},h.prototype.writeUint32BE=h.prototype.writeUInt32BE=function(m,b,T){return m=+m,b=b>>>0,T||fe(this,m,b,4,4294967295,0),this[b]=m>>>24,this[b+1]=m>>>16,this[b+2]=m>>>8,this[b+3]=m&255,b+4};function ke(A,m,b,T,N){sr(m,T,N,A,b,7);let k=Number(m&BigInt(4294967295));A[b++]=k,k=k>>8,A[b++]=k,k=k>>8,A[b++]=k,k=k>>8,A[b++]=k;let M=Number(m>>BigInt(32)&BigInt(4294967295));return A[b++]=M,M=M>>8,A[b++]=M,M=M>>8,A[b++]=M,M=M>>8,A[b++]=M,b}function Ye(A,m,b,T,N){sr(m,T,N,A,b,7);let k=Number(m&BigInt(4294967295));A[b+7]=k,k=k>>8,A[b+6]=k,k=k>>8,A[b+5]=k,k=k>>8,A[b+4]=k;let M=Number(m>>BigInt(32)&BigInt(4294967295));return A[b+3]=M,M=M>>8,A[b+2]=M,M=M>>8,A[b+1]=M,M=M>>8,A[b]=M,b+8}h.prototype.writeBigUInt64LE=tn(function(m,b=0){return ke(this,m,b,BigInt(0),BigInt("0xffffffffffffffff"))}),h.prototype.writeBigUInt64BE=tn(function(m,b=0){return Ye(this,m,b,BigInt(0),BigInt("0xffffffffffffffff"))}),h.prototype.writeIntLE=function(m,b,T,N){if(m=+m,b=b>>>0,!N){const Ge=Math.pow(2,8*T-1);fe(this,m,b,T,Ge-1,-Ge)}let k=0,M=1,ge=0;for(this[b]=m&255;++k<T&&(M*=256);)m<0&&ge===0&&this[b+k-1]!==0&&(ge=1),this[b+k]=(m/M>>0)-ge&255;return b+T},h.prototype.writeIntBE=function(m,b,T,N){if(m=+m,b=b>>>0,!N){const Ge=Math.pow(2,8*T-1);fe(this,m,b,T,Ge-1,-Ge)}let k=T-1,M=1,ge=0;for(this[b+k]=m&255;--k>=0&&(M*=256);)m<0&&ge===0&&this[b+k+1]!==0&&(ge=1),this[b+k]=(m/M>>0)-ge&255;return b+T},h.prototype.writeInt8=function(m,b,T){return m=+m,b=b>>>0,T||fe(this,m,b,1,127,-128),m<0&&(m=255+m+1),this[b]=m&255,b+1},h.prototype.writeInt16LE=function(m,b,T){return m=+m,b=b>>>0,T||fe(this,m,b,2,32767,-32768),this[b]=m&255,this[b+1]=m>>>8,b+2},h.prototype.writeInt16BE=function(m,b,T){return m=+m,b=b>>>0,T||fe(this,m,b,2,32767,-32768),this[b]=m>>>8,this[b+1]=m&255,b+2},h.prototype.writeInt32LE=function(m,b,T){return m=+m,b=b>>>0,T||fe(this,m,b,4,2147483647,-2147483648),this[b]=m&255,this[b+1]=m>>>8,this[b+2]=m>>>16,this[b+3]=m>>>24,b+4},h.prototype.writeInt32BE=function(m,b,T){return m=+m,b=b>>>0,T||fe(this,m,b,4,2147483647,-2147483648),m<0&&(m=4294967295+m+1),this[b]=m>>>24,this[b+1]=m>>>16,this[b+2]=m>>>8,this[b+3]=m&255,b+4},h.prototype.writeBigInt64LE=tn(function(m,b=0){return ke(this,m,b,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),h.prototype.writeBigInt64BE=tn(function(m,b=0){return Ye(this,m,b,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Jt(A,m,b,T,N,k){if(b+T>A.length)throw new RangeError("Index out of range");if(b<0)throw new RangeError("Index out of range")}function Ft(A,m,b,T,N){return m=+m,b=b>>>0,N||Jt(A,m,b,4),t.write(A,m,b,T,23,4),b+4}h.prototype.writeFloatLE=function(m,b,T){return Ft(this,m,b,!0,T)},h.prototype.writeFloatBE=function(m,b,T){return Ft(this,m,b,!1,T)};function Wt(A,m,b,T,N){return m=+m,b=b>>>0,N||Jt(A,m,b,8),t.write(A,m,b,T,52,8),b+8}h.prototype.writeDoubleLE=function(m,b,T){return Wt(this,m,b,!0,T)},h.prototype.writeDoubleBE=function(m,b,T){return Wt(this,m,b,!1,T)},h.prototype.copy=function(m,b,T,N){if(!h.isBuffer(m))throw new TypeError("argument should be a Buffer");if(T||(T=0),!N&&N!==0&&(N=this.length),b>=m.length&&(b=m.length),b||(b=0),N>0&&N<T&&(N=T),N===T||m.length===0||this.length===0)return 0;if(b<0)throw new RangeError("targetStart out of bounds");if(T<0||T>=this.length)throw new RangeError("Index out of range");if(N<0)throw new RangeError("sourceEnd out of bounds");N>this.length&&(N=this.length),m.length-b<N-T&&(N=m.length-b+T);const k=N-T;return this===m&&typeof a.prototype.copyWithin=="function"?this.copyWithin(b,T,N):a.prototype.set.call(m,this.subarray(T,N),b),k},h.prototype.fill=function(m,b,T,N){if(typeof m=="string"){if(typeof b=="string"?(N=b,b=0,T=this.length):typeof T=="string"&&(N=T,T=this.length),N!==void 0&&typeof N!="string")throw new TypeError("encoding must be a string");if(typeof N=="string"&&!h.isEncoding(N))throw new TypeError("Unknown encoding: "+N);if(m.length===1){const M=m.charCodeAt(0);(N==="utf8"&&M<128||N==="latin1")&&(m=M)}}else typeof m=="number"?m=m&255:typeof m=="boolean"&&(m=Number(m));if(b<0||this.length<b||this.length<T)throw new RangeError("Out of range index");if(T<=b)return this;b=b>>>0,T=T===void 0?this.length:T>>>0,m||(m=0);let k;if(typeof m=="number")for(k=b;k<T;++k)this[k]=m;else{const M=h.isBuffer(m)?m:h.from(m,N),ge=M.length;if(ge===0)throw new TypeError('The value "'+m+'" is invalid for argument "value"');for(k=0;k<T-b;++k)this[k+b]=M[k%ge]}return this};const Yt={};function ht(A,m,b){Yt[A]=class extends b{constructor(){super(),Object.defineProperty(this,"message",{value:m.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${A}]`,this.stack,delete this.name}get code(){return A}set code(N){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:N,writable:!0})}toString(){return`${this.name} [${A}]: ${this.message}`}}}ht("ERR_BUFFER_OUT_OF_BOUNDS",function(A){return A?`${A} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ht("ERR_INVALID_ARG_TYPE",function(A,m){return`The "${A}" argument must be of type number. Received type ${typeof m}`},TypeError),ht("ERR_OUT_OF_RANGE",function(A,m,b){let T=`The value of "${A}" is out of range.`,N=b;return Number.isInteger(b)&&Math.abs(b)>2**32?N=Xt(String(b)):typeof b=="bigint"&&(N=String(b),(b>BigInt(2)**BigInt(32)||b<-(BigInt(2)**BigInt(32)))&&(N=Xt(N)),N+="n"),T+=` It must be ${m}. Received ${N}`,T},RangeError);function Xt(A){let m="",b=A.length;const T=A[0]==="-"?1:0;for(;b>=T+4;b-=3)m=`_${A.slice(b-3,b)}${m}`;return`${A.slice(0,b)}${m}`}function Zt(A,m,b){en(m,"offset"),(A[m]===void 0||A[m+b]===void 0)&&ar(m,A.length-(b+1))}function sr(A,m,b,T,N,k){if(A>b||A<m){const M=typeof m=="bigint"?"n":"";let ge;throw m===0||m===BigInt(0)?ge=`>= 0${M} and < 2${M} ** ${(k+1)*8}${M}`:ge=`>= -(2${M} ** ${(k+1)*8-1}${M}) and < 2 ** ${(k+1)*8-1}${M}`,new Yt.ERR_OUT_OF_RANGE("value",ge,A)}Zt(T,N,k)}function en(A,m){if(typeof A!="number")throw new Yt.ERR_INVALID_ARG_TYPE(m,"number",A)}function ar(A,m,b){throw Math.floor(A)!==A?(en(A,b),new Yt.ERR_OUT_OF_RANGE("offset","an integer",A)):m<0?new Yt.ERR_BUFFER_OUT_OF_BOUNDS:new Yt.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${m}`,A)}const Ya=/[^+/0-9A-Za-z-_]/g;function Xa(A){if(A=A.split("=")[0],A=A.trim().replace(Ya,""),A.length<2)return"";for(;A.length%4!==0;)A=A+"=";return A}function Ut(A,m){m=m||1/0;let b;const T=A.length;let N=null;const k=[];for(let M=0;M<T;++M){if(b=A.charCodeAt(M),b>55295&&b<57344){if(!N){if(b>56319){(m-=3)>-1&&k.push(239,191,189);continue}else if(M+1===T){(m-=3)>-1&&k.push(239,191,189);continue}N=b;continue}if(b<56320){(m-=3)>-1&&k.push(239,191,189),N=b;continue}b=(N-55296<<10|b-56320)+65536}else N&&(m-=3)>-1&&k.push(239,191,189);if(N=null,b<128){if((m-=1)<0)break;k.push(b)}else if(b<2048){if((m-=2)<0)break;k.push(b>>6|192,b&63|128)}else if(b<65536){if((m-=3)<0)break;k.push(b>>12|224,b>>6&63|128,b&63|128)}else if(b<1114112){if((m-=4)<0)break;k.push(b>>18|240,b>>12&63|128,b>>6&63|128,b&63|128)}else throw new Error("Invalid code point")}return k}function Mn(A){const m=[];for(let b=0;b<A.length;++b)m.push(A.charCodeAt(b)&255);return m}function Ts(A,m){let b,T,N;const k=[];for(let M=0;M<A.length&&!((m-=2)<0);++M)b=A.charCodeAt(M),T=b>>8,N=b%256,k.push(N),k.push(T);return k}function vs(A){return e.toByteArray(Xa(A))}function Vn(A,m,b,T){let N;for(N=0;N<T&&!(N+b>=m.length||N>=A.length);++N)m[N+b]=A[N];return N}function yt(A,m){return A instanceof m||A!=null&&A.constructor!=null&&A.constructor.name!=null&&A.constructor.name===m.name}function Xe(A){return A!==A}const ln=(function(){const A="0123456789abcdef",m=new Array(256);for(let b=0;b<16;++b){const T=b*16;for(let N=0;N<16;++N)m[T+N]=A[b]+A[N]}return m})();function tn(A){return typeof BigInt>"u"?Gn:A}function Gn(){throw new Error("BigInt not supported")}})(wp);const ju=wp.Buffer;var zs={exports:{}},Rc,U0;function Ep(){return U0||(U0=1,Rc=function(e,t){return function(){return e.apply(t,arguments)}}),Rc}var Tc,L0;function tt(){if(L0)return Tc;L0=1;var r=Ep(),e=Object.prototype.toString,t=(function(P){return function(X){var oe=e.call(X);return P[oe]||(P[oe]=oe.slice(8,-1).toLowerCase())}})(Object.create(null));function n(P){return P=P.toLowerCase(),function(oe){return t(oe)===P}}function i(P){return Array.isArray(P)}function a(P){return typeof P>"u"}function c(P){return P!==null&&!a(P)&&P.constructor!==null&&!a(P.constructor)&&typeof P.constructor.isBuffer=="function"&&P.constructor.isBuffer(P)}var l=n("ArrayBuffer");function f(P){var X;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?X=ArrayBuffer.isView(P):X=P&&P.buffer&&l(P.buffer),X}function p(P){return typeof P=="string"}function h(P){return typeof P=="number"}function x(P){return P!==null&&typeof P=="object"}function y(P){if(t(P)!=="object")return!1;var X=Object.getPrototypeOf(P);return X===null||X===Object.prototype}function E(P){return P&&Object.keys(P).length===0&&Object.getPrototypeOf(P)===Object.prototype}var v=n("Date"),R=n("File"),C=n("Blob"),S=n("FileList");function D(P){return e.call(P)==="[object Function]"}function U(P){return x(P)&&D(P.pipe)}function K(P){var X="[object FormData]";return P&&(typeof FormData=="function"&&P instanceof FormData||e.call(P)===X||D(P.toString)&&P.toString()===X)}var H=n("URLSearchParams");function j(P){return P.trim?P.trim():P.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}function F(){var P;return typeof navigator<"u"&&((P=navigator.product)==="ReactNative"||P==="NativeScript"||P==="NS")?!1:typeof window<"u"&&typeof document<"u"}function z(P,X){if(!(P===null||typeof P>"u"))if(typeof P!="object"&&(P=[P]),i(P))for(var oe=0,ue=P.length;oe<ue;oe++)X.call(null,P[oe],oe,P);else for(var fe in P)Object.prototype.hasOwnProperty.call(P,fe)&&X.call(null,P[fe],fe,P)}function W(){var P={};function X(fe,ke){y(P[ke])&&y(fe)?P[ke]=W(P[ke],fe):y(fe)?P[ke]=W({},fe):i(fe)?P[ke]=fe.slice():P[ke]=fe}for(var oe=0,ue=arguments.length;oe<ue;oe++)z(arguments[oe],X);return P}function ne(P,X,oe){return z(X,function(fe,ke){oe&&typeof fe=="function"?P[ke]=r(fe,oe):P[ke]=fe}),P}function ie(P){return P.charCodeAt(0)===65279&&(P=P.slice(1)),P}function de(P,X,oe,ue){P.prototype=Object.create(X.prototype,ue),P.prototype.constructor=P,oe&&Object.assign(P.prototype,oe)}function he(P,X,oe,ue){var fe,ke,Ye,Jt={};if(X=X||{},P==null)return X;do{for(fe=Object.getOwnPropertyNames(P),ke=fe.length;ke-- >0;)Ye=fe[ke],(!ue||ue(Ye,P,X))&&!Jt[Ye]&&(X[Ye]=P[Ye],Jt[Ye]=!0);P=oe!==!1&&Object.getPrototypeOf(P)}while(P&&(!oe||oe(P,X))&&P!==Object.prototype);return X}function ye(P,X,oe){P=String(P),(oe===void 0||oe>P.length)&&(oe=P.length),oe-=X.length;var ue=P.indexOf(X,oe);return ue!==-1&&ue===oe}function q(P){if(!P)return null;if(i(P))return P;var X=P.length;if(!h(X))return null;for(var oe=new Array(X);X-- >0;)oe[X]=P[X];return oe}var Q=(function(P){return function(X){return P&&X instanceof P}})(typeof Uint8Array<"u"&&Object.getPrototypeOf(Uint8Array));function ae(P,X){for(var oe=P&&P[Symbol.iterator],ue=oe.call(P),fe;(fe=ue.next())&&!fe.done;){var ke=fe.value;X.call(P,ke[0],ke[1])}}function ce(P,X){for(var oe,ue=[];(oe=P.exec(X))!==null;)ue.push(oe);return ue}var le=n("HTMLFormElement"),Re=(function(X){return function(oe,ue){return X.call(oe,ue)}})(Object.prototype.hasOwnProperty);return Tc={isArray:i,isArrayBuffer:l,isBuffer:c,isFormData:K,isArrayBufferView:f,isString:p,isNumber:h,isObject:x,isPlainObject:y,isEmptyObject:E,isUndefined:a,isDate:v,isFile:R,isBlob:C,isFunction:D,isStream:U,isURLSearchParams:H,isStandardBrowserEnv:F,forEach:z,merge:W,extend:ne,trim:j,stripBOM:ie,inherits:de,toFlatObject:he,kindOf:t,kindOfTest:n,endsWith:ye,toArray:q,isTypedArray:Q,isFileList:S,forEachEntry:ae,matchAll:ce,isHTMLForm:le,hasOwnProperty:Re},Tc}var vc,M0;function Sr(){if(M0)return vc;M0=1;var r=tt();function e(i,a,c,l,f){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=i,this.name="AxiosError",a&&(this.code=a),c&&(this.config=c),l&&(this.request=l),f&&(this.response=f)}r.inherits(e,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var t=e.prototype,n={};return["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(function(i){n[i]={value:i}}),Object.defineProperties(e,n),Object.defineProperty(t,"isAxiosError",{value:!0}),e.from=function(i,a,c,l,f,p){var h=Object.create(t);return r.toFlatObject(i,h,function(y){return y!==Error.prototype}),e.call(h,i.message,a,c,l,f),h.cause=i,h.name=i.name,p&&Object.assign(h,p),h},vc=e,vc}var Oc,V0;function c3(){return V0||(V0=1,Oc=typeof self=="object"?self.FormData:window.FormData),Oc}var Cc,G0;function u3(){return G0||(G0=1,Cc=c3()),Cc}var Sc,z0;function Ca(){if(z0)return Sc;z0=1;var r=tt(),e=Sr(),t=u3();function n(h){return r.isPlainObject(h)||r.isArray(h)}function i(h){return r.endsWith(h,"[]")?h.slice(0,-2):h}function a(h,x,y){return h?h.concat(x).map(function(v,R){return v=i(v),!y&&R?"["+v+"]":v}).join(y?".":""):x}function c(h){return r.isArray(h)&&!h.some(n)}var l=r.toFlatObject(r,{},null,function(x){return/^is[A-Z]/.test(x)});function f(h){return h&&r.isFunction(h.append)&&h[Symbol.toStringTag]==="FormData"&&h[Symbol.iterator]}function p(h,x,y){if(!r.isObject(h))throw new TypeError("target must be an object");x=x||new(t||FormData),y=r.toFlatObject(y,{metaTokens:!0,dots:!1,indexes:!1},!1,function(W,ne){return!r.isUndefined(ne[W])});var E=y.metaTokens,v=y.visitor||K,R=y.dots,C=y.indexes,S=y.Blob||typeof Blob<"u"&&Blob,D=S&&f(x);if(!r.isFunction(v))throw new TypeError("visitor must be a function");function U(z){if(z===null)return"";if(r.isDate(z))return z.toISOString();if(!D&&r.isBlob(z))throw new e("Blob is not supported. Use a Buffer instead.");return r.isArrayBuffer(z)||r.isTypedArray(z)?D&&typeof Blob=="function"?new Blob([z]):ju.from(z):z}function K(z,W,ne){var ie=z;if(z&&!ne&&typeof z=="object"){if(r.endsWith(W,"{}"))W=E?W:W.slice(0,-2),z=JSON.stringify(z);else if(r.isArray(z)&&c(z)||r.isFileList(z)||r.endsWith(W,"[]")&&(ie=r.toArray(z)))return W=i(W),ie.forEach(function(he,ye){!(r.isUndefined(he)||he===null)&&x.append(C===!0?a([W],ye,R):C===null?W:W+"[]",U(he))}),!1}return n(z)?!0:(x.append(a(ne,W,R),U(z)),!1)}var H=[],j=Object.assign(l,{defaultVisitor:K,convertValue:U,isVisitable:n});function F(z,W){if(!r.isUndefined(z)){if(H.indexOf(z)!==-1)throw Error("Circular reference detected in "+W.join("."));H.push(z),r.forEach(z,function(ie,de){var he=!(r.isUndefined(ie)||ie===null)&&v.call(x,ie,r.isString(de)?de.trim():de,W,j);he===!0&&F(ie,W?W.concat(de):[de])}),H.pop()}}if(!r.isObject(h))throw new TypeError("data must be an object");return F(h),x}return Sc=p,Sc}var Nc,H0;function Bp(){if(H0)return Nc;H0=1;var r=Ca();function e(i){var a={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(i).replace(/[!'\(\)~]|%20|%00/g,function(l){return a[l]})}function t(i,a){this._pairs=[],i&&r(i,this,a)}var n=t.prototype;return n.append=function(a,c){this._pairs.push([a,c])},n.toString=function(a){var c=a?function(l){return a.call(this,l,e)}:e;return this._pairs.map(function(f){return c(f[0])+"="+c(f[1])},"").join("&")},Nc=t,Nc}var Ic,$0;function Rp(){if($0)return Ic;$0=1;var r=tt(),e=Bp();function t(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}return Ic=function(i,a,c){if(!a)return i;var l=i.indexOf("#");l!==-1&&(i=i.slice(0,l));var f=c&&c.encode||t,p=c&&c.serialize,h;return p?h=p(a,c):h=r.isURLSearchParams(a)?a.toString():new e(a,c).toString(f),h&&(i+=(i.indexOf("?")===-1?"?":"&")+h),i},Ic}var Pc,_0;function l3(){if(_0)return Pc;_0=1;var r=tt();function e(){this.handlers=[]}return e.prototype.use=function(n,i,a){return this.handlers.push({fulfilled:n,rejected:i,synchronous:a?a.synchronous:!1,runWhen:a?a.runWhen:null}),this.handlers.length-1},e.prototype.eject=function(n){this.handlers[n]&&(this.handlers[n]=null)},e.prototype.clear=function(){this.handlers&&(this.handlers=[])},e.prototype.forEach=function(n){r.forEach(this.handlers,function(a){a!==null&&n(a)})},Pc=e,Pc}var kc,j0;function Tp(){if(j0)return kc;j0=1;var r=tt();return kc=function(t,n){r.forEach(t,function(a,c){c!==n&&c.toUpperCase()===n.toUpperCase()&&(t[n]=a,delete t[c])})},kc}var Dc,q0;function vp(){return q0||(q0=1,Dc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}),Dc}var Fc,K0;function f3(){if(K0)return Fc;K0=1;var r=Bp();return Fc=typeof URLSearchParams<"u"?URLSearchParams:r,Fc}var Uc,Q0;function h3(){return Q0||(Q0=1,Uc=FormData),Uc}var Lc,J0;function d3(){return J0||(J0=1,Lc={isBrowser:!0,classes:{URLSearchParams:f3(),FormData:h3(),Blob},protocols:["http","https","file","blob","url","data"]}),Lc}var Mc,W0;function El(){return W0||(W0=1,Mc=d3()),Mc}var Vc,Y0;function p3(){if(Y0)return Vc;Y0=1;var r=tt(),e=Ca(),t=El();return Vc=function(i,a){return e(i,new t.classes.URLSearchParams,Object.assign({visitor:function(c,l,f,p){return t.isNode&&r.isBuffer(c)?(this.append(l,c.toString("base64")),!1):p.defaultVisitor.apply(this,arguments)}},a))},Vc}var Gc,X0;function Op(){if(X0)return Gc;X0=1;var r=tt();function e(i){return r.matchAll(/\w+|\[(\w*)]/g,i).map(function(a){return a[0]==="[]"?"":a[1]||a[0]})}function t(i){var a={},c=Object.keys(i),l,f=c.length,p;for(l=0;l<f;l++)p=c[l],a[p]=i[p];return a}function n(i){function a(l,f,p,h){var x=l[h++];if(x==="__proto__")return!0;var y=Number.isFinite(+x),E=h>=l.length;if(x=!x&&r.isArray(p)?p.length:x,E)return r.hasOwnProperty(p,x)?p[x]=[p[x],f]:p[x]=f,!y;(!p[x]||!r.isObject(p[x]))&&(p[x]=[]);var v=a(l,f,p[x],h);return v&&r.isArray(p[x])&&(p[x]=t(p[x])),!y}if(r.isFormData(i)&&r.isFunction(i.entries)){var c={};return r.forEachEntry(i,function(l,f){a(e(l),f,c,0)}),c}return null}return Gc=n,Gc}var zc,Z0;function x3(){if(Z0)return zc;Z0=1;var r=Sr();return zc=function(t,n,i){var a=i.config.validateStatus;!i.status||!a||a(i.status)?t(i):n(new r("Request failed with status code "+i.status,[r.ERR_BAD_REQUEST,r.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))},zc}var Hc,eh;function m3(){if(eh)return Hc;eh=1;var r=tt();return Hc=r.isStandardBrowserEnv()?(function(){return{write:function(n,i,a,c,l,f){var p=[];p.push(n+"="+encodeURIComponent(i)),r.isNumber(a)&&p.push("expires="+new Date(a).toGMTString()),r.isString(c)&&p.push("path="+c),r.isString(l)&&p.push("domain="+l),f===!0&&p.push("secure"),document.cookie=p.join("; ")},read:function(n){var i=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return i?decodeURIComponent(i[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}})():(function(){return{write:function(){},read:function(){return null},remove:function(){}}})(),Hc}var $c,th;function b3(){return th||(th=1,$c=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}),$c}var _c,nh;function g3(){return nh||(nh=1,_c=function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}),_c}var jc,rh;function Cp(){if(rh)return jc;rh=1;var r=b3(),e=g3();return jc=function(n,i,a){var c=!r(i);return n&&(c||a===!1)?e(n,i):i},jc}var qc,ih;function y3(){if(ih)return qc;ih=1;var r=tt(),e=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return qc=function(n){var i={},a,c,l;return n&&r.forEach(n.split(`
|
|
13
|
-
`),function(p){if(l=p.indexOf(":"),a=r.trim(p.slice(0,l)).toLowerCase(),c=r.trim(p.slice(l+1)),a){if(i[a]&&e.indexOf(a)>=0)return;a==="set-cookie"?i[a]=(i[a]?i[a]:[]).concat([c]):i[a]=i[a]?i[a]+", "+c:c}}),i},qc}var Kc,sh;function w3(){if(sh)return Kc;sh=1;var r=tt();return Kc=r.isStandardBrowserEnv()?(function(){var t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a"),i;function a(c){var l=c;return t&&(n.setAttribute("href",l),l=n.href),n.setAttribute("href",l),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return i=a(window.location.href),function(l){var f=r.isString(l)?a(l):l;return f.protocol===i.protocol&&f.host===i.host}})():(function(){return function(){return!0}})(),Kc}var Qc,ah;function Sa(){if(ah)return Qc;ah=1;var r=Sr(),e=tt();function t(n,i,a){r.call(this,n??"canceled",r.ERR_CANCELED,i,a),this.name="CanceledError"}return e.inherits(t,r,{__CANCEL__:!0}),Qc=t,Qc}var Jc,oh;function A3(){return oh||(oh=1,Jc=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}),Jc}var Wc,ch;function uh(){if(ch)return Wc;ch=1;var r=tt(),e=x3(),t=m3(),n=Rp(),i=Cp(),a=y3(),c=w3(),l=vp(),f=Sr(),p=Sa(),h=A3(),x=El();return Wc=function(E){return new Promise(function(R,C){var S=E.data,D=E.headers,U=E.responseType,K=E.withXSRFToken,H;function j(){E.cancelToken&&E.cancelToken.unsubscribe(H),E.signal&&E.signal.removeEventListener("abort",H)}r.isFormData(S)&&r.isStandardBrowserEnv()&&delete D["Content-Type"];var F=new XMLHttpRequest;if(E.auth){var z=E.auth.username||"",W=E.auth.password?unescape(encodeURIComponent(E.auth.password)):"";D.Authorization="Basic "+btoa(z+":"+W)}var ne=i(E.baseURL,E.url,E.allowAbsoluteUrls);F.open(E.method.toUpperCase(),n(ne,E.params,E.paramsSerializer),!0),F.timeout=E.timeout;function ie(){if(F){var ye="getAllResponseHeaders"in F?a(F.getAllResponseHeaders()):null,q=!U||U==="text"||U==="json"?F.responseText:F.response,Q={data:q,status:F.status,statusText:F.statusText,headers:ye,config:E,request:F};e(function(ce){R(ce),j()},function(ce){C(ce),j()},Q),F=null}}if("onloadend"in F?F.onloadend=ie:F.onreadystatechange=function(){!F||F.readyState!==4||F.status===0&&!(F.responseURL&&F.responseURL.indexOf("file:")===0)||setTimeout(ie)},F.onabort=function(){F&&(C(new f("Request aborted",f.ECONNABORTED,E,F)),F=null)},F.onerror=function(){C(new f("Network Error",f.ERR_NETWORK,E,F)),F=null},F.ontimeout=function(){var q=E.timeout?"timeout of "+E.timeout+"ms exceeded":"timeout exceeded",Q=E.transitional||l;E.timeoutErrorMessage&&(q=E.timeoutErrorMessage),C(new f(q,Q.clarifyTimeoutError?f.ETIMEDOUT:f.ECONNABORTED,E,F)),F=null},r.isStandardBrowserEnv()&&(K&&r.isFunction(K)&&(K=K(E)),K||K!==!1&&c(ne))){var de=E.xsrfHeaderName&&E.xsrfCookieName&&t.read(E.xsrfCookieName);de&&(D[E.xsrfHeaderName]=de)}"setRequestHeader"in F&&r.forEach(D,function(q,Q){typeof S>"u"&&Q.toLowerCase()==="content-type"?delete D[Q]:F.setRequestHeader(Q,q)}),r.isUndefined(E.withCredentials)||(F.withCredentials=!!E.withCredentials),U&&U!=="json"&&(F.responseType=E.responseType),typeof E.onDownloadProgress=="function"&&F.addEventListener("progress",E.onDownloadProgress),typeof E.onUploadProgress=="function"&&F.upload&&F.upload.addEventListener("progress",E.onUploadProgress),(E.cancelToken||E.signal)&&(H=function(ye){F&&(C(!ye||ye.type?new p(null,E,F):ye),F.abort(),F=null)},E.cancelToken&&E.cancelToken.subscribe(H),E.signal&&(E.signal.aborted?H():E.signal.addEventListener("abort",H))),!S&&S!==!1&&S!==0&&S!==""&&(S=null);var he=h(ne);if(he&&x.protocols.indexOf(he)===-1){C(new f("Unsupported protocol "+he+":",f.ERR_BAD_REQUEST,E));return}F.send(S)})},Wc}var Yc,lh;function Bl(){if(lh)return Yc;lh=1;var r=tt(),e=Tp(),t=Sr(),n=vp(),i=Ca(),a=p3(),c=El(),l=Op(),f={"Content-Type":"application/x-www-form-urlencoded"};function p(E,v){!r.isUndefined(E)&&r.isUndefined(E["Content-Type"])&&(E["Content-Type"]=v)}function h(){var E;return(typeof XMLHttpRequest<"u"||typeof Wi<"u"&&Object.prototype.toString.call(Wi)==="[object process]")&&(E=uh()),E}function x(E,v,R){if(r.isString(E))try{return(v||JSON.parse)(E),r.trim(E)}catch(C){if(C.name!=="SyntaxError")throw C}return(R||JSON.stringify)(E)}var y={transitional:n,adapter:h(),transformRequest:[function(v,R){e(R,"Accept"),e(R,"Content-Type");var C=R&&R["Content-Type"]||"",S=C.indexOf("application/json")>-1,D=r.isObject(v);D&&r.isHTMLForm(v)&&(v=new FormData(v));var U=r.isFormData(v);if(U)return S?JSON.stringify(l(v)):v;if(r.isArrayBuffer(v)||r.isBuffer(v)||r.isStream(v)||r.isFile(v)||r.isBlob(v))return v;if(r.isArrayBufferView(v))return v.buffer;if(r.isURLSearchParams(v))return p(R,"application/x-www-form-urlencoded;charset=utf-8"),v.toString();var K;if(D){if(C.indexOf("application/x-www-form-urlencoded")!==-1)return a(v,this.formSerializer).toString();if((K=r.isFileList(v))||C.indexOf("multipart/form-data")>-1){var H=this.env&&this.env.FormData;return i(K?{"files[]":v}:v,H&&new H,this.formSerializer)}}return D||S?(p(R,"application/json"),x(v)):v}],transformResponse:[function(v){var R=this.transitional||y.transitional,C=R&&R.forcedJSONParsing,S=this.responseType==="json";if(v&&r.isString(v)&&(C&&!this.responseType||S)){var D=R&&R.silentJSONParsing,U=!D&&S;try{return JSON.parse(v)}catch(K){if(U)throw K.name==="SyntaxError"?t.from(K,t.ERR_BAD_RESPONSE,this,null,this.response):K}}return v}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:c.classes.FormData,Blob:c.classes.Blob},validateStatus:function(v){return v>=200&&v<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};return r.forEach(["delete","get","head"],function(v){y.headers[v]={}}),r.forEach(["post","put","patch"],function(v){y.headers[v]=r.merge(f)}),Yc=y,Yc}var Xc,fh;function E3(){if(fh)return Xc;fh=1;var r=tt(),e=Bl();return Xc=function(n,i,a,c){var l=this||e;return r.forEach(c,function(p){n=p.call(l,n,i,a)}),n},Xc}var Zc,hh;function Sp(){return hh||(hh=1,Zc=function(e){return!!(e&&e.__CANCEL__)}),Zc}var eu,dh;function B3(){if(dh)return eu;dh=1;var r=tt(),e=E3(),t=Sp(),n=Bl(),i=Sa(),a=Tp();function c(l){if(l.cancelToken&&l.cancelToken.throwIfRequested(),l.signal&&l.signal.aborted)throw new i}return eu=function(f){c(f),f.headers=f.headers||{},f.data=e.call(f,f.data,f.headers,null,f.transformRequest),a(f.headers,"Accept"),a(f.headers,"Content-Type"),f.headers=r.merge(f.headers.common||{},f.headers[f.method]||{},f.headers),r.forEach(["delete","get","head","post","put","patch","common"],function(x){delete f.headers[x]});var p=f.adapter||n.adapter;return p(f).then(function(x){return c(f),x.data=e.call(f,x.data,x.headers,x.status,f.transformResponse),x},function(x){return t(x)||(c(f),x&&x.response&&(x.response.data=e.call(f,x.response.data,x.response.headers,x.response.status,f.transformResponse))),Promise.reject(x)})},eu}var tu,ph;function Np(){if(ph)return tu;ph=1;var r=tt();return tu=function(t,n){n=n||{};var i={};function a(x,y){return r.isPlainObject(x)&&r.isPlainObject(y)?r.merge(x,y):r.isEmptyObject(y)?r.merge({},x):r.isPlainObject(y)?r.merge({},y):r.isArray(y)?y.slice():y}function c(x){if(r.isUndefined(n[x])){if(!r.isUndefined(t[x]))return a(void 0,t[x])}else return a(t[x],n[x])}function l(x){if(!r.isUndefined(n[x]))return a(void 0,n[x])}function f(x){if(r.isUndefined(n[x])){if(!r.isUndefined(t[x]))return a(void 0,t[x])}else return a(void 0,n[x])}function p(x){if(x in n)return a(t[x],n[x]);if(x in t)return a(void 0,t[x])}var h={url:l,method:l,data:l,baseURL:f,transformRequest:f,transformResponse:f,paramsSerializer:f,timeout:f,timeoutMessage:f,withCredentials:f,withXSRFToken:f,adapter:f,responseType:f,xsrfCookieName:f,xsrfHeaderName:f,onUploadProgress:f,onDownloadProgress:f,decompress:f,maxContentLength:f,maxBodyLength:f,beforeRedirect:f,transport:f,httpAgent:f,httpsAgent:f,cancelToken:f,socketPath:f,responseEncoding:f,validateStatus:p};return r.forEach(Object.keys(t).concat(Object.keys(n)),function(y){var E=h[y]||c,v=E(y);r.isUndefined(v)&&E!==p||(i[y]=v)}),i},tu}var nu,xh;function Ip(){return xh||(xh=1,nu={version:"0.30.2"}),nu}var ru,mh;function R3(){if(mh)return ru;mh=1;var r=Ip().version,e=Sr(),t={};["object","boolean","number","function","string","symbol"].forEach(function(a,c){t[a]=function(f){return typeof f===a||"a"+(c<1?"n ":" ")+a}});var n={};t.transitional=function(c,l,f){function p(h,x){return"[Axios v"+r+"] Transitional option '"+h+"'"+x+(f?". "+f:"")}return function(h,x,y){if(c===!1)throw new e(p(x," has been removed"+(l?" in "+l:"")),e.ERR_DEPRECATED);return l&&!n[x]&&(n[x]=!0,console.warn(p(x," has been deprecated since v"+l+" and will be removed in the near future"))),c?c(h,x,y):!0}};function i(a,c,l){if(typeof a!="object")throw new e("options must be an object",e.ERR_BAD_OPTION_VALUE);for(var f=Object.keys(a),p=f.length;p-- >0;){var h=f[p],x=c[h];if(x){var y=a[h],E=y===void 0||x(y,h,a);if(E!==!0)throw new e("option "+h+" must be "+E,e.ERR_BAD_OPTION_VALUE);continue}if(l!==!0)throw new e("Unknown option "+h,e.ERR_BAD_OPTION)}}return ru={assertOptions:i,validators:t},ru}var iu,bh;function T3(){if(bh)return iu;bh=1;var r=tt(),e=Rp(),t=l3(),n=B3(),i=Np(),a=Cp(),c=R3(),l=c.validators;function f(p){this.defaults=p,this.interceptors={request:new t,response:new t}}return f.prototype.request=function(h,x){typeof h=="string"?(x=x||{},x.url=h):x=h||{},x=i(this.defaults,x),x.method?x.method=x.method.toLowerCase():this.defaults.method?x.method=this.defaults.method.toLowerCase():x.method="get";var y=x.transitional;y!==void 0&&c.assertOptions(y,{silentJSONParsing:l.transitional(l.boolean),forcedJSONParsing:l.transitional(l.boolean),clarifyTimeoutError:l.transitional(l.boolean)},!1);var E=x.paramsSerializer;E!=null&&(r.isFunction(E)?x.paramsSerializer={serialize:E}:c.assertOptions(E,{encode:l.function,serialize:l.function},!0));var v=[],R=!0;this.interceptors.request.forEach(function(F){typeof F.runWhen=="function"&&F.runWhen(x)===!1||(R=R&&F.synchronous,v.unshift(F.fulfilled,F.rejected))});var C=[];this.interceptors.response.forEach(function(F){C.push(F.fulfilled,F.rejected)});var S;if(!R){var D=[n,void 0];for(Array.prototype.unshift.apply(D,v),D=D.concat(C),S=Promise.resolve(x);D.length;)S=S.then(D.shift(),D.shift());return S}for(var U=x;v.length;){var K=v.shift(),H=v.shift();try{U=K(U)}catch(j){H(j);break}}try{S=n(U)}catch(j){return Promise.reject(j)}for(;C.length;)S=S.then(C.shift(),C.shift());return S},f.prototype.getUri=function(h){h=i(this.defaults,h);var x=a(h.baseURL,h.url,h.allowAbsoluteUrls);return e(x,h.params,h.paramsSerializer)},r.forEach(["delete","get","head","options"],function(h){f.prototype[h]=function(x,y){return this.request(i(y||{},{method:h,url:x,data:(y||{}).data}))}}),r.forEach(["post","put","patch"],function(h){function x(y){return function(v,R,C){return this.request(i(C||{},{method:h,headers:y?{"Content-Type":"multipart/form-data"}:{},url:v,data:R}))}}f.prototype[h]=x(),f.prototype[h+"Form"]=x(!0)}),iu=f,iu}var su,gh;function v3(){if(gh)return su;gh=1;var r=Sa();function e(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var n;this.promise=new Promise(function(c){n=c});var i=this;this.promise.then(function(a){if(i._listeners){for(var c=i._listeners.length;c-- >0;)i._listeners[c](a);i._listeners=null}}),this.promise.then=function(a){var c,l=new Promise(function(f){i.subscribe(f),c=f}).then(a);return l.cancel=function(){i.unsubscribe(c)},l},t(function(c,l,f){i.reason||(i.reason=new r(c,l,f),n(i.reason))})}return e.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},e.prototype.subscribe=function(n){if(this.reason){n(this.reason);return}this._listeners?this._listeners.push(n):this._listeners=[n]},e.prototype.unsubscribe=function(n){if(this._listeners){var i=this._listeners.indexOf(n);i!==-1&&this._listeners.splice(i,1)}},e.source=function(){var n,i=new e(function(c){n=c});return{token:i,cancel:n}},su=e,su}var au,yh;function O3(){return yh||(yh=1,au=function(e){return function(n){return e.apply(null,n)}}),au}var ou,wh;function C3(){if(wh)return ou;wh=1;var r=tt();return ou=function(t){return r.isObject(t)&&t.isAxiosError===!0},ou}var Ah;function S3(){if(Ah)return zs.exports;Ah=1;var r=tt(),e=Ep(),t=T3(),n=Np(),i=Bl(),a=Op();function c(f){var p=new t(f),h=e(t.prototype.request,p);return r.extend(h,t.prototype,p),r.extend(h,p),h.create=function(y){return c(n(f,y))},h}var l=c(i);return l.Axios=t,l.CanceledError=Sa(),l.CancelToken=v3(),l.isCancel=Sp(),l.VERSION=Ip().version,l.toFormData=Ca(),l.AxiosError=Sr(),l.Cancel=l.CanceledError,l.all=function(p){return Promise.all(p)},l.spread=O3(),l.isAxiosError=C3(),l.formToJSON=function(f){return a(r.isHTMLForm(f)?new FormData(f):f)},zs.exports=l,zs.exports.default=l,zs.exports}var cu,Eh;function N3(){return Eh||(Eh=1,cu=S3()),cu}var I3=N3();const Pp=hs(I3),P3=yl("bee-js:http"),{AxiosError:k3}=Pp,D3=1e5,kp=200,F3=1e3,U3=$u.minutes(1)/kp,L3="Request aborted",M3={headers:{accept:"application/json, text/plain, */*"},maxBodyLength:1/0,maxContentLength:1/0};function uu(r,e,t,n){if(r?.aborted)throw new wl(e.method||"get",e.url||"<unknown>",L3,t,n,"ERR_CANCELED")}async function J(r,e){const t=Yi.deepMerge3(M3,e,r);if(r.signal&&(t.signal=r.signal,uu(r.signal,e)),G3(t),t.params){const i=Object.keys(t.params);for(const a of i)t.params[a]===void 0&&delete t.params[a]}let n=0;for(;n<D3;){uu(r.signal,e);try{return P3(`${t.method||"get"} ${gl.joinUrl([t.baseURL,t.url])}`,{headers:{...t.headers},params:t.params}),V3(r,t),await Pp(t)}catch(i){if(i instanceof k3)if(i.code==="ERR_CANCELED"&&uu({aborted:!0},e,i.response?.data,i.response?.status),i.code==="ECONNABORTED"&&r.endlesslyRetry)n++,await va.sleepMillis(n<U3?kp:F3);else throw new wl(e.method||"get",e.url||"<unknown>",i.message,i.response?.data,i.response?.status,i.response?.statusText);else throw i}}throw Error("Max number of failed attempts reached")}function V3(r,e){r.onRequest&&r.onRequest({method:e.method||"GET",url:gl.joinUrl([e.baseURL,e.url]),headers:{...e.headers},params:e.params})}function G3(r){r.data&&r.data instanceof Uint8Array&&(r.data=r.data.buffer.slice(r.data.byteOffset,r.data.byteOffset+r.data.byteLength)),r.data&&typeof ju<"u"&&ju.isBuffer(r.data)&&(r.data=r.data.buffer.slice(r.data.byteOffset,r.data.byteOffset+r.data.byteLength))}const Dp="chunks";async function z3(r,e,t,n){const i=await J(r,{method:"post",url:`${Dp}`,data:e,headers:{"content-type":"application/octet-stream",...gt(t,n)},responseType:"json"}),a=w.asObject(i.data,{name:"response.data"});return{reference:new se(w.asString(a.reference,{name:"reference"})),tagUid:i.headers["swarm-tag"]?Xn(i.headers["swarm-tag"]):void 0,historyAddress:i.headers["swarm-act-history-address"]?ut.of(new se(i.headers["swarm-act-history-address"])):ut.empty()}}async function ds(r,e,t){e=new se(e);const n=await J(r,{responseType:"arraybuffer",url:`${Dp}/${e}`,headers:gt(null,t)});return new Uint8Array(n.data)}const H3="soc";async function $3(r,e,t,n,i,a,c){const l=await J(r,{method:"post",url:`${H3}/${e}/${t}`,data:i,headers:{"content-type":"application/octet-stream",...gt(a,c)},responseType:"json",params:{sig:n.toHex()}}),f=w.asObject(l.data,{name:"response.data"});return{reference:new se(w.asHexString(f.reference)),tagUid:l.headers["swarm-tag"]?Xn(l.headers["swarm-tag"]):void 0,historyAddress:l.headers["swarm-act-history-address"]?ut.of(new se(l.headers["swarm-act-history-address"])):ut.empty()}}const Fp=it.LENGTH,Up=it.LENGTH+tr.LENGTH,_3=it.LENGTH+tr.LENGTH+et.LENGTH;function j3(r){const e=r.slice(Up),t=fp(e),n=tr.fromSlice(r,Fp),i=we.fromSlice(r,0,it.LENGTH),a=$.concatBytes(i.toUint8Array(),t.toUint8Array());return n.recoverPublicKey(a).address()}function Na(r,e){r=r instanceof we?r.toUint8Array():r,e=new se(e);const t=j3(r),n=we.fromSlice(r,0,it.LENGTH),i=new se($.keccak256($.concatBytes(n.toUint8Array(),t.toUint8Array())));if(!$.equals(e.toUint8Array(),i.toUint8Array()))throw new cn("SOC data does not match given address!");const a=tr.fromSlice(r,Fp),c=et.fromSlice(r,Up),l=we.fromSlice(r,_3);return{data:r,identifier:n,signature:a,span:c,payload:l,address:i,owner:t}}function ji(r,e){return new se($.keccak256($.concatBytes(r.toUint8Array(),e.toUint8Array())))}function Lp(r,e,t,n,i){n=new it(n),i=new vn(i);const a=ji(n,i.publicKey().address()),c=i.sign($.concatBytes(n.toUint8Array(),r.toUint8Array()));return{data:$.concatBytes(n.toUint8Array(),c.toUint8Array(),e.toUint8Array(),t.toUint8Array()),identifier:n,signature:c,span:e,payload:t,address:a,owner:i.publicKey().address()}}async function Rl(r,e,t,n){const i=$.concatBytes(e.span.toUint8Array(),e.payload.toUint8Array());return $3(r,e.owner,e.identifier,e.signature,i,t,n)}async function Tl(r,e,t,n,i,a){e=new vn(e),n=new it(n);const l=Zi(i).toSingleOwnerChunk(n,e);return Rl(r,l,t,a)}async function q3(r,e,t,n,i,a){e=new vn(e),n=new it(n);const c=i.toSingleOwnerChunk(n,e);return Rl(r,c,t,a)}async function K3(r,e,t){t=new it(t),e=new mt(e);const n=ji(t,e),i=await ds(r,n.toHex());return Na(i,n)}const Bh=1,Rh=4096;function Mp(r){return r=new we(r),Zi(r.toUint8Array().slice(et.LENGTH),et.fromSlice(r.toUint8Array(),0))}function Zi(r,e){if(w.isString(r)&&(r=we.fromUtf8(r)),r.length<Bh||r.length>Rh)throw new RangeError(`payload size ${r.length} exceeds limits [${Bh}, ${Rh}]`);const t=e?typeof e=="bigint"?et.fromBigInt(e):e:et.fromBigInt(BigInt(r.length)),n=new we(r),i=$.concatBytes(t.toUint8Array(),n.toUint8Array()),a=fp(i);return{data:i,span:t,payload:n,address:a,toSingleOwnerChunk:(c,l)=>Lp(a,t,n,c,l)}}const Ia="bytes";async function Vp(r,e,t,n){const i=await J(r,{url:Ia,method:"post",responseType:"json",data:e,headers:{"content-type":"application/octet-stream",...gt(t,n)}}),a=w.asObject(i.data,{name:"response.data"});return{reference:new se(w.asHexString(a.reference)),tagUid:i.headers["swarm-tag"]?Xn(i.headers["swarm-tag"]):void 0,historyAddress:i.headers["swarm-act-history-address"]?ut.of(new se(i.headers["swarm-act-history-address"])):ut.empty()}}async function Q3(r,e){e=new se(e);const t=await J(r,{url:`${Ia}/${e}`,method:"head",responseType:"json"});return{contentLength:parseInt(t.headers["content-length"])}}async function Gp(r,e,t){t&&(t=Wn(t));const n=await J(r,{responseType:"arraybuffer",url:`${Ia}/${e}`,headers:gt(null,t)});return new we(n.data)}async function J3(r,e,t){return t&&(t=Wn(t)),(await J(r,{responseType:"stream",url:`${Ia}/${e}`,headers:gt(null,t)})).data}const vl="feeds";async function W3(r,e,t,n,i){const a=await J(r,{method:"post",responseType:"json",url:`${vl}/${e}/${t}`,headers:gt(n,i)}),c=w.asObject(a.data,{name:"response.data"});return new se(w.asHexString(c.reference))}function zp(r){const e=r["swarm-feed-index"],t=r["swarm-feed-index-next"];if(!e)throw new cn("Response did not contain expected swarm-feed-index!");if(!t)throw new cn("Response did not contain expected swarm-feed-index-next!");return{feedIndex:new bt(e),feedIndexNext:new bt(t)}}async function da(r,e,t,n){const i=await J(r,{responseType:"arraybuffer",url:`${vl}/${e}/${t}`,params:n});return{payload:new we(i.data),...zp(i.headers)}}async function Y3(r,e,t){const n=await J(r,{responseType:"arraybuffer",url:`${vl}/${e}/${t}`,params:{"Swarm-Only-Root-Chunk":!0}});return zp(n.headers)}class ia{constructor(e){this.raw=e}toString(){return w.isString(this.raw)&&this.raw.includes(".eth")?this.raw:new se(this.raw).toHex()}}function Ol(r,e){return e=typeof e=="number"?bt.fromBigInt(BigInt(e)):e,new it($.keccak256($.concatBytes(r.toUint8Array(),e.toUint8Array())))}const X3=0,Hp=8,Z3=Hp;async function $p(r,e,t){try{const n=await da(r,e,t);if(!n.feedIndexNext)throw Error("Feed index next is not defined. This should happen when fetching an exact index.");return n.feedIndexNext}catch(n){if(n instanceof wl)return bt.fromBigInt(0n);throw n}}async function e8(r,e,t,n,i,a){n=new se(n);const c=a?.index??await $p(r,e.publicKey().address(),t),l=Ol(t,c),f=a?.at??Date.now()/1e3,p=$.numberToUint64(BigInt(Math.floor(f)),"BE"),h=$.concatBytes(p,n.toUint8Array());return Tl(r,e,i,l,h,a)}async function t8(r,e,t,n,i,a){const c=a?.index??await $p(r,e.publicKey().address(),t),l=Ol(t,c);if(n.length>4096){const f=await Vp(r,n,i,a),p=Mp(await ds(r,f.reference));return q3(r,e,i,l,p,a)}return Tl(r,e,i,l,w.isString(n)?we.fromUtf8(n).toUint8Array():n,a)}function Cl(r,e,t){const n=Ol(e,t);return new se($.keccak256($.concatBytes(n.toUint8Array(),r.toUint8Array())))}async function n8(r,e,t,n,i=!1){n=typeof n=="number"?bt.fromBigInt(BigInt(n)):n;const a=Cl(e,t,n),c=await ds(r,a.toHex()),l=Na(c,a);let f=ut.empty();if(i){const p=we.fromSlice(l.payload.toUint8Array(),X3,Hp);f=ut.of(Number($.uint64ToNumber(p.toUint8Array(),"BE")))}return{timestamp:f,payload:new we(l.payload.offset(i?Z3:0))}}async function r8(r,e,t,n){n=typeof n=="number"?bt.fromBigInt(BigInt(n)):n;const i=Cl(e,t,n),a=await ds(r,i),c=Na(a,i);return Zi(c.payload,c.span)}function _p(r,e,t){const n=async c=>{if(c?.index===void 0)return da(r,t,e);const l=await n8(r,t,e,c.index,c.hasTimestamp??!0),f=typeof c.index=="number"?bt.fromBigInt(BigInt(c.index)):c.index;return{payload:l.payload,feedIndex:f,feedIndexNext:f.next()}};return{download:n,downloadPayload:async c=>{if(c?.index===void 0)return da(r,t,e);const l=await r8(r,t,e,c.index),f=l.span.toBigInt()<=4096n?l.payload:await Gp(r,new ia(l.address)),p=typeof c.index=="number"?bt.fromBigInt(BigInt(c.index)):c.index;return{payload:f,feedIndex:p,feedIndexNext:p.next()}},downloadReference:async c=>{let l=c?.index;l===void 0&&(l=(await Y3(r,t,e)).feedIndex);const f=await n({...c,index:l});return{reference:new se(f.payload.toUint8Array()),feedIndex:f.feedIndex,feedIndexNext:f.feedIndexNext??f.feedIndex.next()}},owner:t,topic:e}}function i8(r,e,t){const n=async(a,c,l)=>e8(r,t,e,c,a,l),i=async(a,c,l)=>t8(r,t,e,c,a,l);return{..._p(r,e,t.publicKey().address()),upload:n,uploadReference:n,uploadPayload:i}}async function s8(r,e,t,n){try{return await r.downloadChunk(e,t,n),!0}catch(i){const a=Yi.getDeep(i,"status");if(a===404||a===500)return!1;throw i}}function a8(r,e,t){const n=t.toBigInt(),i=[];for(let a=0n;a<=n;a++)i.push(Cl(r,e,bt.fromBigInt(a)));return i}async function o8(r,e,t,n,i,a){const c=a8(e,t,n).map(async l=>s8(r,l,i,a));return(await Promise.all(c)).every(l=>l)}function c8(r){return Array.isArray(r)?r.every(e=>typeof e=="object"&&e.path&&e.size!==void 0):!1}function jp(r){if(!c8(r))throw new xn("invalid collection",r)}function qp(r){if(r.webkitRelativePath&&r.webkitRelativePath!=="")return r.webkitRelativePath.replace(/.*?\//i,"");if(r.name)return r.name;throw new TypeError("file is not valid File object")}function u8(r){return Array.from(r).map(e=>({path:qp(e),size:e.size,file:e}))}class l8{constructor(){this.pieces=[],this.currentFileSize=0}get output(){return this.pieces.reduce((e,t)=>{const n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n})}beginFile(e,t){if(e.length>100)throw new Error(`File name too long: ${e}`);const n=f8(e,t);this.pieces.push(n),this.currentFileSize=0}async appendFile(e){this.pieces.push(e),this.currentFileSize+=e.length}async endFile(){const e=this.currentFileSize%512===0?0:512-this.currentFileSize%512;e>0&&this.pieces.push(new Uint8Array(e))}async end(){this.pieces.push(h8())}}function f8(r,e){const t=new TextEncoder;function n(l,f,p){const h=t.encode(l);i.set(h.slice(0,p),f)}const i=new Uint8Array(512);i.fill(0,0,512),n(r.slice(0,100).padEnd(100,"\0"),0,100),n("0000777\0",100,8),n("0001750\0",108,8),n("0001750\0",116,8),n(e.toString(8).padStart(11,"0")+"\0",124,12);const a=Math.floor(new Date().getTime()/1e3);n(a.toString(8).padStart(11,"0")+"\0",136,12),n(" ",148,8),n("0",156,1),n("ustar\0\0",257,8);let c=0;for(let l=0;l<512;l++)c+=i[l];return n(c.toString(8).padStart(6,"0")+"\0 ",148,8),i}function h8(){return new Uint8Array(1024)}async function d8(r,e){for(const t of r)if(t.file)e.beginFile(t.path,t.file.size),await e.appendFile(new Uint8Array(await xp(t.file))),await e.endFile();else throw new Error("Invalid collection item")}const p8="bzz";async function x8(r,e,t,n){const i=new l8;return await d8(e,i),await i.end(),await J(r,{method:"post",url:p8,data:i.output,responseType:"json",headers:{"content-type":"application/x-tar","swarm-collection":"true",...gt(t,n)}})}const Sl="bzz";async function Th(r,e,t,n,i){const a=await J(r,{method:"post",url:Sl,data:e,headers:gt(t,i),params:{name:n},responseType:"json"}),c=w.asObject(a.data,{name:"response.data"});return{reference:new se(w.asHexString(c.reference)),tagUid:a.headers["swarm-tag"]?Xn(a.headers["swarm-tag"]):void 0,historyAddress:a.headers["swarm-act-history-address"]?ut.of(new se(a.headers["swarm-act-history-address"])):ut.empty()}}async function m8(r,e,t="",n){const i=await J(r,{method:"GET",responseType:"arraybuffer",url:`${Sl}/${e}/${t}`,headers:gt(null,n)});return{...yp(i.headers),data:new we(i.data)}}async function b8(r,e,t="",n){e=new se(e);const i=await J(r,{method:"GET",responseType:"stream",url:`${Sl}/${e}/${t}`,headers:gt(null,n)});return{...yp(i.headers),data:i.data}}async function lu(r,e,t,n){jp(e);const i=await x8(r,e,t,n),a=w.asObject(i.data,{name:"response.data"});return{reference:new se(w.asHexString(a.reference)),tagUid:i.headers["swarm-tag"]?Xn(i.headers["swarm-tag"]):void 0,historyAddress:i.headers["swarm-act-history-address"]?ut.of(new se(i.headers["swarm-act-history-address"])):ut.empty()}}const Kp="balances",Qp="consumed";async function g8(r){const e=await J(r,{url:Kp,responseType:"json"}),t=w.asObject(e.data,{name:"response.data"});return{balances:w.asArray(t.balances,{name:"balances"}).map(i=>w.asObject(i,{name:"balance"})).map(i=>({peer:w.asString(i.peer,{name:"peer"}),balance:me.fromPLUR(be(i.balance,{name:"balance"}))}))}}async function y8(r,e){const t=await J(r,{url:`${Kp}/${e}`,responseType:"json"}),n=w.asObject(t.data,{name:"response.data"});return{peer:w.asString(n.peer,{name:"peer"}),balance:me.fromPLUR(be(n.balance,{name:"balance"}))}}async function w8(r){const e=await J(r,{url:Qp,responseType:"json"}),t=w.asObject(e.data,{name:"response.data"});return{balances:w.asArray(t.balances,{name:"balances"}).map(i=>w.asObject(i,{name:"balance"})).map(i=>({peer:w.asString(i.peer,{name:"peer"}),balance:me.fromPLUR(be(i.balance,{name:"balance"}))}))}}async function A8(r,e){const t=await J(r,{url:`${Qp}/${e}`,responseType:"json"}),n=w.asObject(t.data,{name:"response.data"});return{peer:w.asString(n.peer,{name:"peer"}),balance:me.fromPLUR(be(n.balance,{name:"balance"}))}}const nr="chequebook";async function E8(r){const e=await J(r,{url:nr+"/address",responseType:"json"}),t=w.asObject(e.data,{name:"response.data"});return{chequebookAddress:new mt(w.asString(t.chequebookAddress,{name:"chequebookAddress"}))}}async function B8(r){const e=await J(r,{url:nr+"/balance",responseType:"json"}),t=w.asObject(e.data,{name:"response.data"});return{availableBalance:me.fromPLUR(be(t.availableBalance,{name:"availableBalance"})),totalBalance:me.fromPLUR(be(t.totalBalance,{name:"totalBalance"}))}}async function R8(r,e){const t=await J(r,{url:nr+`/cashout/${e}`,responseType:"json"}),n=w.asObject(t.data,{name:"response.data"});return{peer:w.asString(n.peer,{name:"peer"}),uncashedAmount:me.fromPLUR(be(n.uncashedAmount,{name:"uncashedAmount"})),transactionHash:w.asNullableString(n.transactionHash),lastCashedCheque:w.asNullable(i=>es(i),n.lastCashedCheque),result:w.asNullable(i=>C8(i),n.result)}}async function T8(r,e,t){const n=await J(r,{method:"post",url:nr+`/cashout/${e}`,responseType:"json",headers:gt(null,t)}),i=w.asObject(n.data,{name:"response.data"});return new Rt(w.asString(i.transactionHash,{name:"transactionHash"}))}async function v8(r,e){const t=await J(r,{url:nr+`/cheque/${e}`,responseType:"json"}),n=w.asObject(t.data,{name:"response.data"});return{peer:w.asString(n.peer,{name:"peer"}),lastreceived:w.asNullable(i=>es(i),n.lastreceived),lastsent:w.asNullable(i=>es(i),n.lastsent)}}async function O8(r){const e=await J(r,{url:nr+"/cheque",responseType:"json"}),t=w.asObject(e.data,{name:"response.data"});return{lastcheques:w.asArray(t.lastcheques,{name:"lastcheques"}).map(i=>w.asObject(i,{name:"lastcheque"})).map(i=>({peer:w.asString(i.peer,{name:"peer"}),lastreceived:w.asNullable(a=>es(a),i.lastreceived),lastsent:w.asNullable(a=>es(a),i.lastsent)}))}}function es(r){const e=w.asObject(r,{name:"cheque"});return{beneficiary:new mt(w.asString(e.beneficiary,{name:"beneficiary"})),chequebook:new mt(w.asString(e.chequebook,{name:"chequebook"})),payout:me.fromPLUR(be(e.payout,{name:"payout"}))}}function C8(r){const e=w.asObject(r,{name:"cashout result"});return{recipient:w.asString(e.recipient,{name:"recipient"}),lastPayout:me.fromPLUR(be(e.lastPayout,{name:"lastPayout"})),bounced:w.asBoolean(e.bounced,{name:"bounced"})}}async function S8(r,e,t){const n={};t&&(n["gas-price"]=t.toString());const i=await J(r,{method:"post",url:nr+"/deposit",responseType:"json",params:{amount:e.toString(10)},headers:n}),a=w.asObject(i.data,{name:"response.data"});return new Rt(w.asString(a.transactionHash,{name:"transactionHash"}))}async function N8(r,e,t){const n={};t&&(n["gas-price"]=t.toString());const i=await J(r,{method:"post",url:nr+"/withdraw",responseType:"json",params:{amount:e.toString(10)},headers:n}),a=w.asObject(i.data,{name:"response.data"});return new Rt(w.asString(a.transactionHash,{name:"transactionHash"}))}async function I8(r){const e=await J(r,{url:"addresses",responseType:"json"}),t=w.asObject(e.data,{name:"response.data"});return{overlay:new nn(w.asString(t.overlay,{name:"overlay"})),underlay:w.asArray(t.underlay,{name:"underlay"}).map(n=>w.asString(n,{name:"underlay"})),ethereum:new mt(w.asString(t.ethereum,{name:"ethereum"})),publicKey:new qt(w.asString(t.publicKey,{name:"publicKey"})),pssPublicKey:new qt(w.asString(t.pssPublicKey,{name:"pssPublicKey"}))}}async function P8(r){const e=await J(r,{url:"peers",responseType:"json"}),t=w.asObject(e.data,{name:"response.data"});return w.asArray(t.peers,{name:"peers"}).map(n=>({address:w.asString(w.asObject(n,{name:"peer"}).address,{name:"address"}),fullNode:w.asBoolean(w.asObject(n,{name:"peer"}).fullNode,{name:"fullNode"})}))}async function k8(r){return(await J(r,{url:"blocklist",responseType:"json"})).data.peers}async function D8(r,e){return(await J(r,{url:`peers/${e}`,responseType:"json",method:"DELETE"})).data}async function F8(r){const e=await J(r,{url:"topology",responseType:"json"}),t=w.asObject(e.data,{name:"response.data"}),n=w.asObject(t.bins,{name:"bins"});return{baseAddr:w.asString(t.baseAddr,{name:"baseAddr"}),population:w.asNumber(t.population,{name:"population"}),connected:w.asNumber(t.connected,{name:"connected"}),timestamp:w.asString(t.timestamp,{name:"timestamp"}),nnLowWatermark:w.asNumber(t.nnLowWatermark,{name:"nnLowWatermark"}),depth:w.asNumber(t.depth,{name:"depth"}),reachability:w.asString(t.reachability,{name:"reachability"}),networkAvailability:w.asString(t.networkAvailability,{name:"networkAvailability"}),bins:{bin_0:Te(n.bin_0,"bin_0"),bin_1:Te(n.bin_1,"bin_1"),bin_2:Te(n.bin_2,"bin_2"),bin_3:Te(n.bin_3,"bin_3"),bin_4:Te(n.bin_4,"bin_4"),bin_5:Te(n.bin_5,"bin_5"),bin_6:Te(n.bin_6,"bin_6"),bin_7:Te(n.bin_7,"bin_7"),bin_8:Te(n.bin_8,"bin_8"),bin_9:Te(n.bin_9,"bin_9"),bin_10:Te(n.bin_10,"bin_10"),bin_11:Te(n.bin_11,"bin_11"),bin_12:Te(n.bin_12,"bin_12"),bin_13:Te(n.bin_13,"bin_13"),bin_14:Te(n.bin_14,"bin_14"),bin_15:Te(n.bin_15,"bin_15"),bin_16:Te(n.bin_16,"bin_16"),bin_17:Te(n.bin_17,"bin_17"),bin_18:Te(n.bin_18,"bin_18"),bin_19:Te(n.bin_19,"bin_19"),bin_20:Te(n.bin_20,"bin_20"),bin_21:Te(n.bin_21,"bin_21"),bin_22:Te(n.bin_22,"bin_22"),bin_23:Te(n.bin_23,"bin_23"),bin_24:Te(n.bin_24,"bin_24"),bin_25:Te(n.bin_25,"bin_25"),bin_26:Te(n.bin_26,"bin_26"),bin_27:Te(n.bin_27,"bin_27"),bin_28:Te(n.bin_28,"bin_28"),bin_29:Te(n.bin_29,"bin_29"),bin_30:Te(n.bin_30,"bin_30"),bin_31:Te(n.bin_31,"bin_31")}}}async function U8(r,e){return(await J(r,{url:`pingpong/${e}`,responseType:"json",method:"POST"})).data}function Te(r,e){const t=w.asObject(r,{name:e});return t.disconnectedPeers||(t.disconnectedPeers=[]),t.connectedPeers||(t.connectedPeers=[]),{population:w.asNumber(t.population,{name:"population"}),connected:w.asNumber(t.connected,{name:"connected"}),connectedPeers:w.asArray(t.connectedPeers,{name:"connectedPeers"}).map(n=>({address:w.asString(w.asObject(n,{name:"connectedPeer"}).address,{name:"address"})})),disconnectedPeers:w.asArray(t.disconnectedPeers,{name:"disconnectedPeers"}).map(n=>({address:w.asString(w.asObject(n,{name:"disconnectedPeer"}).address,{name:"address"})}))}}const Jp="settlements";async function L8(r,e){const t=await J(r,{url:`${Jp}/${e}`,responseType:"json"}),n=w.asObject(t.data,{name:"response.data"});return{peer:w.asString(n.peer,{name:"peer"}),sent:me.fromPLUR(be(n.sent,{name:"sent"})),received:me.fromPLUR(be(n.received,{name:"received"}))}}async function M8(r){const e=await J(r,{url:Jp,responseType:"json"}),t=w.asObject(e.data,{name:"response.data"}),n=me.fromPLUR(be(t.totalSent,{name:"totalSent"})),i=me.fromPLUR(be(t.totalReceived,{name:"totalReceived"})),a=w.asArray(t.settlements,{name:"settlements"}).map(c=>w.asObject(c,{name:"settlement"}));return{totalSent:n,totalReceived:i,settlements:a.map(c=>({peer:w.asString(c.peer,{name:"peer"}),sent:me.fromPLUR(be(c.sent,{name:"sent"})),received:me.fromPLUR(be(c.received,{name:"received"}))}))}}const ps="stake",V8="redistributionstate";async function G8(r){const e=await J(r,{method:"get",responseType:"json",url:`${ps}`}),t=w.asObject(e.data,{name:"response.data"});return me.fromPLUR(be(t.stakedAmount,{name:"stakedAmount"}))}async function z8(r){const e=await J(r,{method:"get",responseType:"json",url:`${ps}/withdrawable`}),t=w.asObject(e.data,{name:"response.data"});return me.fromPLUR(be(t.withdrawableAmount,{name:"withdrawableAmount"}))}async function H8(r){const e=await J(r,{method:"delete",responseType:"json",url:`${ps}/withdrawable`}),t=w.asObject(e.data,{name:"response.data"});return new Rt(w.asHexString(t.txHash,{name:"txHash"}))}async function $8(r){const e=await J(r,{method:"delete",responseType:"json",url:ps}),t=w.asObject(e.data,{name:"response.data"});return new Rt(w.asHexString(t.txHash,{name:"txHash"}))}async function _8(r,e,t){const n=await J(r,{method:"post",responseType:"json",url:`${ps}/${e}`,headers:gt(null,t)}),i=w.asObject(n.data,{name:"response.data"});return new Rt(w.asHexString(i.txHash,{name:"txHash"}))}async function j8(r){const e=await J(r,{method:"get",responseType:"json",url:V8}),t=w.asObject(e.data,{name:"response.data"});return{minimumGasFunds:qe.fromWei(be(t.minimumGasFunds,{name:"minimumGasFunds"})),hasSufficientFunds:w.asBoolean(t.hasSufficientFunds,{name:"hasSufficientFunds"}),isFrozen:w.asBoolean(t.isFrozen,{name:"isFrozen"}),isFullySynced:w.asBoolean(t.isFullySynced,{name:"isFullySynced"}),phase:w.asString(t.phase,{name:"phase"}),round:w.asNumber(t.round,{name:"round"}),lastWonRound:w.asNumber(t.lastWonRound,{name:"lastWonRound"}),lastPlayedRound:w.asNumber(t.lastPlayedRound,{name:"lastPlayedRound"}),lastFrozenRound:w.asNumber(t.lastFrozenRound,{name:"lastFrozenRound"}),lastSelectedRound:w.asNumber(t.lastSelectedRound,{name:"lastSelectedRound"}),lastSampleDurationSeconds:w.asNumber(t.lastSampleDurationSeconds,{name:"lastSampleDurationSeconds"}),block:w.asNumber(t.block,{name:"block"}),reward:me.fromPLUR(be(t.reward,{name:"reward"})),fees:qe.fromWei(be(t.fees,{name:"fees"})),isHealthy:w.asBoolean(t.isHealthy,{name:"isHealthy"})}}const hi="stamps",q8="batches";async function vh(r){const e=await J(r,{method:"get",url:`${q8}`,responseType:"json"}),t=w.asObject(e.data,{name:"response.data"});return w.asArray(t.batches,{name:"batches"}).map(i=>w.asObject(i,{name:"batch"})).map(i=>({batchID:new De(w.asString(i.batchID,{name:"batchID"})),batchTTL:w.asNumber(i.batchTTL,{name:"batchTTL"}),bucketDepth:w.asNumber(i.bucketDepth,{name:"bucketDepth"}),depth:w.asNumber(i.depth,{name:"depth"}),immutable:w.asBoolean(i.immutable,{name:"immutable"}),owner:new mt(w.asString(i.owner,{name:"owner"})),start:w.asNumber(i.start,{name:"start"}),value:be(i.value,{name:"value"})}))}async function Oh(r){const e=await J(r,{method:"get",url:`${hi}`,responseType:"json"}),t=w.asObject(e.data,{name:"response.data"});return w.asArray(t.stamps,{name:"stamps"}).map(i=>w.asObject(i,{name:"stamp"})).map(i=>gp(Wp(i)))}async function K8(r,e,t,n){const i=await J(r,{method:"get",url:`${hi}/${e}`,responseType:"json"}),a=w.asObject(i.data,{name:"response.data"});return gp(Wp(a),t,n)}async function Q8(r,e){const t=await J(r,{method:"get",url:`${hi}/${e}/buckets`,responseType:"json"}),n=w.asObject(t.data,{name:"response.data"});return{depth:w.asNumber(n.depth,{name:"depth"}),bucketDepth:w.asNumber(n.bucketDepth,{name:"bucketDepth"}),bucketUpperBound:w.asNumber(n.bucketUpperBound,{name:"bucketUpperBound"}),buckets:w.asArray(n.buckets,{name:"buckets"}).map(i=>w.asObject(i,{name:"bucket"})).map(i=>({bucketID:w.asNumber(i.bucketID,{name:"bucketID"}),collisions:w.asNumber(i.collisions,{name:"collisions"})}))}}async function J8(r,e,t,n){const i={};n?.gasPrice&&(i["gas-price"]=n.gasPrice.toString()),n?.immutableFlag!==void 0&&(i.immutable=String(n.immutableFlag));const a=await J(r,{method:"post",url:`${hi}/${e}/${t}`,responseType:"json",params:{label:n?.label},headers:i}),c=w.asObject(a.data,{name:"response.data"});return new De(w.asString(c.batchID,{name:"batchID"}))}async function W8(r,e,t){const n=await J(r,{method:"patch",url:`${hi}/topup/${e}/${t}`,responseType:"json"}),i=w.asObject(n.data,{name:"response.data"});return new De(w.asString(i.batchID,{name:"batchID"}))}async function Y8(r,e,t){const n=await J(r,{method:"patch",url:`${hi}/dilute/${e}/${t}`,responseType:"json"}),i=w.asObject(n.data,{name:"response.data"});return new De(w.asString(i.batchID,{name:"batchID"}))}function Wp(r){return{amount:be(r.amount,{name:"amount"}),batchID:w.asString(r.batchID,{name:"batchID"}),batchTTL:w.asNumber(r.batchTTL,{name:"batchTTL"}),bucketDepth:w.asNumber(r.bucketDepth,{name:"bucketDepth"}),blockNumber:w.asNumber(r.blockNumber,{name:"blockNumber"}),depth:w.asNumber(r.depth,{name:"depth"}),immutableFlag:w.asBoolean(r.immutableFlag,{name:"immutableFlag"}),label:w.asEmptiableString(r.label,{name:"label"}),usable:w.asBoolean(r.usable,{name:"usable"}),utilization:w.asNumber(r.utilization,{name:"utilization"})}}const X8="reservestate",Nl="wallet",Z8="chainstate";async function e4(r){const e=await J(r,{method:"get",url:`${X8}`,responseType:"json"}),t=w.asObject(e.data,{name:"response.data"});return{commitment:w.asNumber(t.commitment,{name:"commitment"}),radius:w.asNumber(t.radius,{name:"radius"}),storageRadius:w.asNumber(t.storageRadius,{name:"storageRadius"}),reserveCapacityDoubling:w.asNumber(t.reserveCapacityDoubling,{name:"reserveCapacityDoubling"})}}async function t4(r){const e=await J(r,{method:"get",url:`${Z8}`,responseType:"json"}),t=w.asObject(e.data,{name:"response.data"});return{block:w.asNumber(t.block,{name:"block"}),chainTip:w.asNumber(t.chainTip,{name:"chainTip"}),totalAmount:be(t.totalAmount,{name:"totalAmount"}),currentPrice:qw(w.asNumber(t.currentPrice,{name:"currentPrice"}))}}async function n4(r){const e=await J(r,{method:"get",url:`${Nl}`,responseType:"json"}),t=w.asObject(e.data,{name:"response.data"});return{bzzBalance:me.fromPLUR(be(t.bzzBalance,{name:"bzzBalance"})),nativeTokenBalance:qe.fromWei(be(t.nativeTokenBalance,{name:"nativeTokenBalance"})),chainID:w.asNumber(t.chainID,{name:"chainID"}),chequebookContractAddress:w.asString(t.chequebookContractAddress,{name:"chequebookContractAddress"}),walletAddress:w.asString(t.walletAddress,{name:"walletAddress"})}}async function r4(r,e,t){const n=await J(r,{method:"post",url:`${Nl}/withdraw/bzz`,responseType:"json",params:{amount:e.toPLURString(),address:t.toHex()}}),i=w.asObject(n.data,{name:"response.data"});return new Rt(w.asString(i.transactionHash,{name:"transactionHash"}))}async function i4(r,e,t){const n=await J(r,{method:"post",url:`${Nl}/withdraw/nativetoken`,responseType:"json",params:{amount:e.toWeiString(),address:t.toHex()}}),i=w.asObject(n.data,{name:"response.data"});return new Rt(w.asString(i.transactionHash,{name:"transactionHash"}))}var fu,Ch;function Yp(){if(Ch)return fu;Ch=1;var r={};return fu=typeof Wi=="object"&&r&&r.NODE_DEBUG&&/\bsemver\b/i.test(r.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{},fu}var hu,Sh;function Xp(){if(Sh)return hu;Sh=1;const r="2.0.0",e=256,t=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,i=e-6;return hu={MAX_LENGTH:e,MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:r,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},hu}var Hs={exports:{}},Nh;function s4(){return Nh||(Nh=1,(function(r,e){const{MAX_SAFE_COMPONENT_LENGTH:t,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=Xp(),a=Yp();e=r.exports={};const c=e.re=[],l=e.safeRe=[],f=e.src=[],p=e.safeSrc=[],h=e.t={};let x=0;const y="[a-zA-Z0-9-]",E=[["\\s",1],["\\d",i],[y,n]],v=C=>{for(const[S,D]of E)C=C.split(`${S}*`).join(`${S}{0,${D}}`).split(`${S}+`).join(`${S}{1,${D}}`);return C},R=(C,S,D)=>{const U=v(S),K=x++;a(C,K,S),h[C]=K,f[K]=S,p[K]=U,c[K]=new RegExp(S,D?"g":void 0),l[K]=new RegExp(U,D?"g":void 0)};R("NUMERICIDENTIFIER","0|[1-9]\\d*"),R("NUMERICIDENTIFIERLOOSE","\\d+"),R("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${y}*`),R("MAINVERSION",`(${f[h.NUMERICIDENTIFIER]})\\.(${f[h.NUMERICIDENTIFIER]})\\.(${f[h.NUMERICIDENTIFIER]})`),R("MAINVERSIONLOOSE",`(${f[h.NUMERICIDENTIFIERLOOSE]})\\.(${f[h.NUMERICIDENTIFIERLOOSE]})\\.(${f[h.NUMERICIDENTIFIERLOOSE]})`),R("PRERELEASEIDENTIFIER",`(?:${f[h.NONNUMERICIDENTIFIER]}|${f[h.NUMERICIDENTIFIER]})`),R("PRERELEASEIDENTIFIERLOOSE",`(?:${f[h.NONNUMERICIDENTIFIER]}|${f[h.NUMERICIDENTIFIERLOOSE]})`),R("PRERELEASE",`(?:-(${f[h.PRERELEASEIDENTIFIER]}(?:\\.${f[h.PRERELEASEIDENTIFIER]})*))`),R("PRERELEASELOOSE",`(?:-?(${f[h.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${f[h.PRERELEASEIDENTIFIERLOOSE]})*))`),R("BUILDIDENTIFIER",`${y}+`),R("BUILD",`(?:\\+(${f[h.BUILDIDENTIFIER]}(?:\\.${f[h.BUILDIDENTIFIER]})*))`),R("FULLPLAIN",`v?${f[h.MAINVERSION]}${f[h.PRERELEASE]}?${f[h.BUILD]}?`),R("FULL",`^${f[h.FULLPLAIN]}$`),R("LOOSEPLAIN",`[v=\\s]*${f[h.MAINVERSIONLOOSE]}${f[h.PRERELEASELOOSE]}?${f[h.BUILD]}?`),R("LOOSE",`^${f[h.LOOSEPLAIN]}$`),R("GTLT","((?:<|>)?=?)"),R("XRANGEIDENTIFIERLOOSE",`${f[h.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),R("XRANGEIDENTIFIER",`${f[h.NUMERICIDENTIFIER]}|x|X|\\*`),R("XRANGEPLAIN",`[v=\\s]*(${f[h.XRANGEIDENTIFIER]})(?:\\.(${f[h.XRANGEIDENTIFIER]})(?:\\.(${f[h.XRANGEIDENTIFIER]})(?:${f[h.PRERELEASE]})?${f[h.BUILD]}?)?)?`),R("XRANGEPLAINLOOSE",`[v=\\s]*(${f[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${f[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${f[h.XRANGEIDENTIFIERLOOSE]})(?:${f[h.PRERELEASELOOSE]})?${f[h.BUILD]}?)?)?`),R("XRANGE",`^${f[h.GTLT]}\\s*${f[h.XRANGEPLAIN]}$`),R("XRANGELOOSE",`^${f[h.GTLT]}\\s*${f[h.XRANGEPLAINLOOSE]}$`),R("COERCEPLAIN",`(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`),R("COERCE",`${f[h.COERCEPLAIN]}(?:$|[^\\d])`),R("COERCEFULL",f[h.COERCEPLAIN]+`(?:${f[h.PRERELEASE]})?(?:${f[h.BUILD]})?(?:$|[^\\d])`),R("COERCERTL",f[h.COERCE],!0),R("COERCERTLFULL",f[h.COERCEFULL],!0),R("LONETILDE","(?:~>?)"),R("TILDETRIM",`(\\s*)${f[h.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",R("TILDE",`^${f[h.LONETILDE]}${f[h.XRANGEPLAIN]}$`),R("TILDELOOSE",`^${f[h.LONETILDE]}${f[h.XRANGEPLAINLOOSE]}$`),R("LONECARET","(?:\\^)"),R("CARETTRIM",`(\\s*)${f[h.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",R("CARET",`^${f[h.LONECARET]}${f[h.XRANGEPLAIN]}$`),R("CARETLOOSE",`^${f[h.LONECARET]}${f[h.XRANGEPLAINLOOSE]}$`),R("COMPARATORLOOSE",`^${f[h.GTLT]}\\s*(${f[h.LOOSEPLAIN]})$|^$`),R("COMPARATOR",`^${f[h.GTLT]}\\s*(${f[h.FULLPLAIN]})$|^$`),R("COMPARATORTRIM",`(\\s*)${f[h.GTLT]}\\s*(${f[h.LOOSEPLAIN]}|${f[h.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",R("HYPHENRANGE",`^\\s*(${f[h.XRANGEPLAIN]})\\s+-\\s+(${f[h.XRANGEPLAIN]})\\s*$`),R("HYPHENRANGELOOSE",`^\\s*(${f[h.XRANGEPLAINLOOSE]})\\s+-\\s+(${f[h.XRANGEPLAINLOOSE]})\\s*$`),R("STAR","(<|>)?=?\\s*\\*"),R("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),R("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Hs,Hs.exports)),Hs.exports}var du,Ih;function a4(){if(Ih)return du;Ih=1;const r=Object.freeze({loose:!0}),e=Object.freeze({});return du=n=>n?typeof n!="object"?r:n:e,du}var pu,Ph;function o4(){if(Ph)return pu;Ph=1;const r=/^[0-9]+$/,e=(n,i)=>{if(typeof n=="number"&&typeof i=="number")return n===i?0:n<i?-1:1;const a=r.test(n),c=r.test(i);return a&&c&&(n=+n,i=+i),n===i?0:a&&!c?-1:c&&!a?1:n<i?-1:1};return pu={compareIdentifiers:e,rcompareIdentifiers:(n,i)=>e(i,n)},pu}var xu,kh;function c4(){if(kh)return xu;kh=1;const r=Yp(),{MAX_LENGTH:e,MAX_SAFE_INTEGER:t}=Xp(),{safeRe:n,t:i}=s4(),a=a4(),{compareIdentifiers:c}=o4();class l{constructor(p,h){if(h=a(h),p instanceof l){if(p.loose===!!h.loose&&p.includePrerelease===!!h.includePrerelease)return p;p=p.version}else if(typeof p!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof p}".`);if(p.length>e)throw new TypeError(`version is longer than ${e} characters`);r("SemVer",p,h),this.options=h,this.loose=!!h.loose,this.includePrerelease=!!h.includePrerelease;const x=p.trim().match(h.loose?n[i.LOOSE]:n[i.FULL]);if(!x)throw new TypeError(`Invalid Version: ${p}`);if(this.raw=p,this.major=+x[1],this.minor=+x[2],this.patch=+x[3],this.major>t||this.major<0)throw new TypeError("Invalid major version");if(this.minor>t||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>t||this.patch<0)throw new TypeError("Invalid patch version");x[4]?this.prerelease=x[4].split(".").map(y=>{if(/^[0-9]+$/.test(y)){const E=+y;if(E>=0&&E<t)return E}return y}):this.prerelease=[],this.build=x[5]?x[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(p){if(r("SemVer.compare",this.version,this.options,p),!(p instanceof l)){if(typeof p=="string"&&p===this.version)return 0;p=new l(p,this.options)}return p.version===this.version?0:this.compareMain(p)||this.comparePre(p)}compareMain(p){return p instanceof l||(p=new l(p,this.options)),this.major<p.major?-1:this.major>p.major?1:this.minor<p.minor?-1:this.minor>p.minor?1:this.patch<p.patch?-1:this.patch>p.patch?1:0}comparePre(p){if(p instanceof l||(p=new l(p,this.options)),this.prerelease.length&&!p.prerelease.length)return-1;if(!this.prerelease.length&&p.prerelease.length)return 1;if(!this.prerelease.length&&!p.prerelease.length)return 0;let h=0;do{const x=this.prerelease[h],y=p.prerelease[h];if(r("prerelease compare",h,x,y),x===void 0&&y===void 0)return 0;if(y===void 0)return 1;if(x===void 0)return-1;if(x===y)continue;return c(x,y)}while(++h)}compareBuild(p){p instanceof l||(p=new l(p,this.options));let h=0;do{const x=this.build[h],y=p.build[h];if(r("build compare",h,x,y),x===void 0&&y===void 0)return 0;if(y===void 0)return 1;if(x===void 0)return-1;if(x===y)continue;return c(x,y)}while(++h)}inc(p,h,x){if(p.startsWith("pre")){if(!h&&x===!1)throw new Error("invalid increment argument: identifier is empty");if(h){const y=`-${h}`.match(this.options.loose?n[i.PRERELEASELOOSE]:n[i.PRERELEASE]);if(!y||y[1]!==h)throw new Error(`invalid identifier: ${h}`)}}switch(p){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",h,x);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",h,x);break;case"prepatch":this.prerelease.length=0,this.inc("patch",h,x),this.inc("pre",h,x);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",h,x),this.inc("pre",h,x);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const y=Number(x)?1:0;if(this.prerelease.length===0)this.prerelease=[y];else{let E=this.prerelease.length;for(;--E>=0;)typeof this.prerelease[E]=="number"&&(this.prerelease[E]++,E=-2);if(E===-1){if(h===this.prerelease.join(".")&&x===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(y)}}if(h){let E=[h,y];x===!1&&(E=[h]),c(this.prerelease[0],h)===0?isNaN(this.prerelease[1])&&(this.prerelease=E):this.prerelease=E}break}default:throw new Error(`invalid increment argument: ${p}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return xu=l,xu}var mu,Dh;function u4(){if(Dh)return mu;Dh=1;const r=c4();return mu=(t,n)=>new r(t,n).major,mu}var l4=u4();const Fh=hs(l4),Il="2.7.0-6ddf9b45";Il.split("-")[0];const Zp="7.3.0",f4="node",h4="status",d4="health",p4="readiness";async function x4(r){const e=await J(r,{method:"get",url:h4,responseType:"json"}),t=w.asObject(e.data,{name:"response.data"});return{overlay:w.asString(t.overlay,{name:"overlay"}),proximity:w.asNumber(t.proximity,{name:"proximity"}),beeMode:hp(w.asString(t.beeMode,{name:"beeMode"})),reserveSize:w.asNumber(t.reserveSize,{name:"reserveSize"}),reserveSizeWithinRadius:w.asNumber(t.reserveSizeWithinRadius,{name:"reserveSizeWithinRadius"}),pullsyncRate:w.asNumber(t.pullsyncRate,{name:"pullsyncRate"}),storageRadius:w.asNumber(t.storageRadius,{name:"storageRadius"}),connectedPeers:w.asNumber(t.connectedPeers,{name:"connectedPeers"}),neighborhoodSize:w.asNumber(t.neighborhoodSize,{name:"neighborhoodSize"}),batchCommitment:w.asNumber(t.batchCommitment,{name:"batchCommitment"}),isReachable:w.asBoolean(t.isReachable,{name:"isReachable"}),lastSyncedBlock:w.asNumber(t.lastSyncedBlock,{name:"lastSyncedBlock"}),committedDepth:w.asNumber(t.committedDepth,{name:"committedDepth"}),isWarmingUp:w.asBoolean(t.isWarmingUp,{name:"isWarmingUp"})}}async function Pa(r){const e=await J(r,{method:"get",url:d4,responseType:"json"}),t=w.asObject(e.data,{name:"response.data"});return{apiVersion:w.asString(t.apiVersion,{name:"apiVersion"}),version:w.asString(t.version,{name:"version"}),status:w.asString(t.status,{name:"status"})}}async function m4(r){const e=await J(r,{method:"get",url:p4}),t=w.asObject(e.data,{name:"response.data"});return{apiVersion:w.asString(t.apiVersion,{name:"apiVersion"}),version:w.asString(t.version,{name:"version"}),status:w.asString(t.status,{name:"status"})}}async function b4(r){const e=await J(r,{method:"get",url:f4,responseType:"json"}),t=w.asObject(e.data,{name:"response.data"});return{beeMode:hp(w.asString(t.beeMode,{name:"beeMode"})),chequebookEnabled:w.asBoolean(t.chequebookEnabled,{name:"chequebookEnabled"}),swapEnabled:w.asBoolean(t.swapEnabled,{name:"swapEnabled"})}}async function g4(r){const{version:e}=await Pa(r);return e===Il}async function y4(r){const{apiVersion:e}=await Pa(r);return Fh(e)===Fh(Zp)}async function w4(r){const{version:e,apiVersion:t}=await Pa(r);return{supportedBeeVersion:Il,supportedBeeApiVersion:Zp,beeVersion:e,beeApiVersion:t}}const ka="transactions";async function A4(r){const e=await J(r,{url:ka,responseType:"json"}),t=w.asObject(e.data,{name:"response.data"});return w.asArray(t.pendingTransactions,{name:"pendingTransactions"}).map(ex)}async function E4(r,e){const t=await J(r,{url:`${ka}/${e}`,responseType:"json"}),n=w.asObject(t.data,{name:"response.data"});return ex(n)}function ex(r){const e=w.asObject(r,{name:"transaction"});return{transactionHash:new Rt(w.asString(e.transactionHash,{name:"transactionHash"})),to:w.asString(e.to,{name:"to"}),nonce:w.asNumber(e.nonce,{name:"nonce"}),gasPrice:be(e.gasPrice,{name:"gasPrice"}),gasLimit:w.asNumber(e.gasLimit,{name:"gasLimit"}),data:w.asString(e.data,{name:"data"}),created:w.asString(e.created,{name:"created"}),description:w.asString(e.description,{name:"description"}),value:be(e.value,{name:"value"})}}async function B4(r,e){const t=await J(r,{method:"post",url:`${ka}/${e}`,responseType:"json"}),n=w.asObject(t.data,{name:"response.data"});return new Rt(w.asString(n.transactionHash,{name:"transactionHash"}))}async function R4(r,e,t){const n={};t&&(n["gas-price"]=t.toString());const i=await J(r,{method:"delete",headers:n,url:`${ka}/${e}`,responseType:"json"}),a=w.asObject(i.data,{name:"response.data"});return new Rt(w.asString(a.transactionHash,{name:"transactionHash"}))}const T4="envelope";async function v4(r,e,t){const n=await J(r,{method:"post",responseType:"json",url:`${T4}/${t}`,headers:{"swarm-postage-batch-id":e.toHex()}}),i=w.asObject(n.data,{name:"response.data"});return{issuer:$.hexToUint8Array(w.asHexString(i.issuer,{name:"issuer",byteLength:20})),index:$.hexToUint8Array(w.asHexString(i.index,{name:"index",byteLength:8})),timestamp:$.hexToUint8Array(w.asHexString(i.timestamp,{name:"timestamp",byteLength:8})),signature:$.hexToUint8Array(w.asHexString(i.signature,{name:"signature",byteLength:65})),batchId:e}}const Pl="grantee";async function O4(r,e){const t=await J(e,{method:"get",url:`${Pl}/${r}`,responseType:"json"}),n=w.asArray(t.data,{name:"response.data"}).map(i=>new qt(w.asString(i,{name:"grantee"})));return{status:t.status,statusText:t.statusText,grantees:n}}async function C4(r,e,t){const n=await J(r,{method:"post",url:Pl,data:{grantees:t.map(a=>a.toCompressedHex())},headers:gt(e),responseType:"json"}),i=w.asObject(n.data,{name:"response.data"});return{status:n.status,statusText:n.statusText,ref:new se(w.asString(i.ref,{name:"ref"})),historyref:new se(w.asString(i.historyref,{name:"historyref"}))}}async function S4(r,e,t,n,i){const a=await J(i,{method:"patch",url:`${Pl}/${e}`,data:{add:n.add?.map(l=>l.toCompressedHex()),revoke:n.revoke?.map(l=>l.toCompressedHex())},headers:{...gt(r),"swarm-act-history-address":t.toHex()},responseType:"json"}),c=w.asObject(a.data,{name:"response.data"});return{status:a.status,statusText:a.statusText,ref:new se(w.asString(c.ref,{name:"ref"})),historyref:new se(w.asString(c.historyref,{name:"historyref"}))}}var bu,Uh;function N4(){if(Uh)return bu;Uh=1;var r=null;return typeof WebSocket<"u"?r=WebSocket:typeof MozWebSocket<"u"?r=MozWebSocket:typeof bc<"u"?r=bc.WebSocket||bc.MozWebSocket:typeof window<"u"?r=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(r=self.WebSocket||self.MozWebSocket),bu=r,bu}var I4=N4();const pa=hs(I4),Lh="gsoc";async function P4(r,e,t,n){return Rl(r,e,t,n)}function k4(r,e,t){const n=r.replace(/^http/i,"ws");return va.whereAmI()==="browser"?new pa(`${n}/${Lh}/subscribe/${e.toHex()}`):new pa(`${n}/${Lh}/subscribe/${e.toHex()}`,{headers:t})}const Da="pins";async function D4(r,e){await J(r,{method:"post",responseType:"json",url:`${Da}/${e}`})}async function F4(r,e){await J(r,{method:"delete",responseType:"json",url:`${Da}/${e}`})}async function U4(r,e){const t=await J(r,{method:"get",responseType:"json",url:`${Da}/${e}`}),n=w.asObject(t.data,{name:"response.data"});return{reference:new se(w.asString(n.reference,{name:"reference"}))}}async function L4(r){const e=await J(r,{method:"get",responseType:"json",url:`${Da}`}),t=w.asObject(e.data,{name:"response.data"});return t.references===null?[]:w.asArray(t.references,{name:"references"}).map(i=>w.asString(i,{name:"reference"})).map(i=>new se(i))}const qu="pss";async function Mh(r,e,t,n,i,a){await J(r,{method:"post",url:`${qu}/send/${e}/${t}`,data:n,responseType:"json",params:{recipient:a},headers:gt(i)})}function M4(r,e,t){const n=r.replace(/^http/i,"ws");return va.whereAmI()==="browser"?new pa(`${n}/${qu}/subscribe/${e.toHex()}`):new pa(`${n}/${qu}/subscribe/${e.toHex()}`,{headers:t})}const V4="rchash";async function G4(r,e,t,n){const i=await J(r,{responseType:"json",url:`${V4}/${e}/${t}/${n}`}),a=w.asObject(i.data,{name:"response.data"});return w.asNumber(a.durationSeconds,{name:"durationSeconds"})}async function Vh(r){await J(r,{url:""})}async function z4(r){try{const e=await J(r,{url:"/gateway"}),t=w.asObject(e.data);return w.asBoolean(t.gateway)}catch{return!1}}const tx="stewardship";async function H4(r,e,t){await J(r,{method:"put",url:`${tx}/${t}`,headers:{"swarm-postage-batch-id":e.toHex()}})}async function $4(r,e){e=new se(e);const t=await J(r,{method:"get",responseType:"json",url:`${tx}/${e}`}),n=w.asObject(t.data,{name:"response.data"});return w.asBoolean(n.isRetrievable,{name:"isRetrievable"})}const xs="tags";async function _4(r){const e=await J(r,{method:"post",url:xs,responseType:"json"}),t=w.asObject(e.data,{name:"response.data"});return{address:w.asEmptiableString(t.address,{name:"address"}),seen:w.asNumber(t.seen,{name:"seen"}),sent:w.asNumber(t.sent,{name:"sent"}),split:w.asNumber(t.split,{name:"split"}),startedAt:w.asString(t.startedAt,{name:"startedAt"}),stored:w.asNumber(t.stored,{name:"stored"}),synced:w.asNumber(t.synced,{name:"synced"}),uid:w.asNumber(t.uid,{name:"uid"})}}async function j4(r,e){const t=await J(r,{url:`${xs}/${e}`,responseType:"json"}),n=w.asObject(t.data,{name:"response.data"});return{address:w.asEmptiableString(n.address,{name:"address"}),seen:w.asNumber(n.seen,{name:"seen"}),sent:w.asNumber(n.sent,{name:"sent"}),split:w.asNumber(n.split,{name:"split"}),startedAt:w.asString(n.startedAt,{name:"startedAt"}),stored:w.asNumber(n.stored,{name:"stored"}),synced:w.asNumber(n.synced,{name:"synced"}),uid:w.asNumber(n.uid,{name:"uid"})}}async function q4(r,e,t){const n=await J(r,{url:xs,params:{offset:e,limit:t},responseType:"json"}),i=w.asObject(n.data,{name:"response.data"});return w.asArray(i.tags,{name:"tags"}).map(c=>w.asObject(c,{name:"tag"})).map(c=>({address:w.asEmptiableString(c.address,{name:"address"}),seen:w.asNumber(c.seen,{name:"seen"}),sent:w.asNumber(c.sent,{name:"sent"}),split:w.asNumber(c.split,{name:"split"}),startedAt:w.asString(c.startedAt,{name:"startedAt"}),stored:w.asNumber(c.stored,{name:"stored"}),synced:w.asNumber(c.synced,{name:"synced"}),uid:w.asNumber(c.uid,{name:"uid"})}))}async function K4(r,e){await J(r,{method:"delete",url:`${xs}/${e}`})}async function Q4(r,e,t){await J(r,{method:"patch",url:`${xs}/${e}`,data:{reference:t}})}const Ku=yl("bee-js:manifest"),sa=new TextEncoder,qi=new TextDecoder,J4=2,W4=4,Y4=8,nx=16,gu=new Uint8Array([47]),X4="5768b3b6a7db56d21d1abff40d41cebfc83448fed8d7e9b06ec0d3b073f28f7b",Gh=$.hexToUint8Array(X4);class Yn{constructor(e,t){this.prefix=e,this.node=t}static split(e,t){const n=$.commonPrefix(e.prefix,t.prefix);if(n.length===e.prefix.length){const l=t.prefix.slice(n.length);return t.node.path=t.prefix.slice(n.length),t.prefix=t.prefix.slice(n.length),t.node.parent=e.node,e.node.forks.set(l[0],t),e}if(n.length===t.prefix.length){const l=e.prefix.slice(n.length);return e.node.path=e.prefix.slice(n.length),e.prefix=e.prefix.slice(n.length),e.node.parent=t.node,t.node.forks.set(l[0],e),t}const i=new Er({path:n}),a=new Yn(e.prefix.slice(n.length),e.node),c=new Yn(t.prefix.slice(n.length),t.node);return e.node.path=e.prefix.slice(n.length),t.node.path=t.prefix.slice(n.length),e.prefix=e.prefix.slice(n.length),t.prefix=t.prefix.slice(n.length),i.forks.set(a.prefix[0],a),i.forks.set(c.prefix[0],c),a.node.parent=i,c.node.parent=i,new Yn(n,i)}marshal(){if(!this.node.selfAddress)throw Error("Fork#marshal node.selfAddress is not set");const e=[];if(e.push(new Uint8Array([this.node.determineType()])),e.push($.numberToUint8(this.prefix.length)),e.push(this.prefix),this.prefix.length<30&&e.push(new Uint8Array(30-this.prefix.length)),e.push(this.node.selfAddress),Ku("marshalling fork",{prefixLength:this.prefix.length,prefix:qi.decode(this.prefix),address:$.uint8ArrayToHex(this.node.selfAddress)}),this.node.metadata){const t=$.padEndToMultiple(new Uint8Array([0,0,...sa.encode(JSON.stringify(this.node.metadata))]),32,10),n=$.numberToUint16(t.length-2,"BE");t.set(n,0),e.push(t)}return $.concatBytes(...e)}static unmarshal(e,t){const n=$.uint8ToNumber(e.read(1)),i=$.uint8ToNumber(e.read(1)),a=e.read(i);i<30&&e.read(30-i);const c=e.read(t);Ku("unmarshalling fork",{type:n,prefixLength:i,prefix:qi.decode(a),addressLength:t,address:$.uint8ArrayToHex(c)});let l;if(Z4(n,nx)){const f=$.uint16ToNumber(e.read(2),"BE");l=JSON.parse(qi.decode(e.read(f)))}return new Yn(a,new Er({selfAddress:c,metadata:l,path:a}))}}class Er{constructor(e){this.obfuscationKey=new Uint8Array(32),this.selfAddress=null,this.targetAddress=new Uint8Array(32),this.metadata=null,this.path=new Uint8Array(0),this.forks=new Map,this.parent=null,e?.targetAddress&&(this.targetAddress=e.targetAddress),e?.selfAddress&&(this.selfAddress=e.selfAddress),e?.metadata&&(this.metadata=e.metadata),e?.obfuscationKey&&(this.obfuscationKey=e.obfuscationKey),e?.path&&(this.path=e.path),e?.parent&&(this.parent=e.parent)}get fullPath(){return $.concatBytes(this.parent?.fullPath??new Uint8Array(0),this.path)}get fullPathString(){return qi.decode(this.fullPath)}getRootMetadata(){const e=this.find("/");return e&&e.metadata?ut.of(e.metadata):ut.empty()}getDocsMetadata(){const e=this.find("/");return!e||!e.metadata?{indexDocument:null,errorDocument:null}:{indexDocument:e.metadata["website-index-document"]??null,errorDocument:e.metadata["website-error-document"]??null}}async resolveFeed(e,t){const n=this.find("/");if(!n||!n.metadata)return ut.empty();const i=n.metadata["swarm-feed-owner"],a=n.metadata["swarm-feed-topic"];return!i||!a?ut.empty():ut.of(await e.fetchLatestFeedUpdate(a,i,t))}async marshal(){for(const a of this.forks.values())a.node.selfAddress||(a.node.selfAddress=(await a.node.calculateSelfAddress()).toUint8Array());const e=new Uint8Array(32);e.set(Gh,0),e.set($.equals(this.targetAddress,jr)&&$.equals(this.path,new Uint8Array([47]))?$.numberToUint8(0):$.numberToUint8(this.targetAddress.length),31);const t=new Uint8Array(32);for(const a of this.forks.keys())$.setBit(t,a,1,"LE");const n=[];for(let a=0;a<256;a++)$.getBit(t,a,"LE")&&n.push(this.forks.get(a).marshal());const i=$.xorCypher($.concatBytes(e,$.equals(this.targetAddress,jr)&&$.equals(this.path,new Uint8Array([47]))?new Uint8Array(0):this.targetAddress,t,...n),this.obfuscationKey);return $.concatBytes(this.obfuscationKey,i)}static async unmarshal(e,t,n,i){t=new se(t);const a=(await e.downloadData(t,n,i)).toUint8Array();return this.unmarshalFromData(a,t.toUint8Array())}static unmarshalFromData(e,t){const n=e.subarray(0,32),i=$.xorCypher(e.subarray(32),n),a=new Aw(i),c=a.read(31);if(!$.equals(c,Gh.slice(0,31)))throw new Error("MantarayNode#unmarshal invalid version hash");const l=$.uint8ToNumber(a.read(1)),f=l?a.read(l):jr,p=new Er({selfAddress:t,targetAddress:f,obfuscationKey:n}),h=a.read(32);for(let x=0;x<256;x++)if($.getBit(h,x,"LE")){const y=Yn.unmarshal(a,t.length);p.forks.set(x,y),y.node.parent=p}return p}addFork(e,t,n){this.selfAddress=null,e=e instanceof Uint8Array?e:sa.encode(e),Ku("adding fork",{path:qi.decode(e),reference:new se(t).represent()});let i=this;for(;e.length;){const a=e.slice(0,30);e=e.slice(30);const c=e.length===0,[l,f]=i.findClosest(a),p=a.slice(f.length);if(f.length&&(i=l),!p.length)continue;const h=new Yn(p,new Er({targetAddress:c?new se(t).toUint8Array():void 0,metadata:c?n:void 0,path:p})),x=l.forks.get(p[0]);if(x){const y=Yn.split(h,x);i.forks.set(p[0],y),y.node.parent=i,i.selfAddress=null,i=h.node}else i.forks.set(p[0],h),h.node.parent=i,i.selfAddress=null,i=h.node}}removeFork(e){if(this.selfAddress=null,e=e instanceof Uint8Array?e:sa.encode(e),e.length===0)throw Error("MantarayNode#removeFork [path] parameter cannot be empty");const t=this.find(e);if(!t)throw Error("MantarayNode#removeFork fork not found");const[n,i]=this.findClosest(e.slice(0,e.length-1));n.forks.delete(e.slice(i.length)[0]);for(const a of t.forks.values())n.addFork($.concatBytes(t.path,a.prefix),a.node.targetAddress,a.node.metadata)}async calculateSelfAddress(){return this.selfAddress?new se(this.selfAddress):new se((await ap.root(await this.marshal())).hash())}async saveRecursively(e,t,n,i){for(const c of this.forks.values()){const l=await c.node.saveRecursively(e,t,n,i);if(n?.act){let f;l.historyAddress.ifPresent(p=>f=p),f&&(c.node.metadata||(c.node.metadata={}),c.node.metadata["swarm-act-history-address"]=f.toHex())}}const a=await e.uploadData(t,await this.marshal(),n,i);return this.selfAddress=a.reference.toUint8Array(),a}async loadRecursively(e,t,n){for(const i of this.forks.values()){if(!i.node.selfAddress)throw Error("MantarayNode#loadRecursively fork.node.selfAddress is not set");let a=t;i.node.metadata&&i.node.metadata["swarm-act-history-address"]&&(a={...t,actHistoryAddress:i.node.metadata["swarm-act-history-address"]});const c=await Er.unmarshal(e,i.node.selfAddress,a,n);i.node.targetAddress=c.targetAddress,i.node.forks=c.forks,i.node.path=i.prefix,i.node.parent=this,await i.node.loadRecursively(e,t,n)}}find(e){const[t,n]=this.findClosest(e);return n.length===e.length?t:null}findClosest(e,t=new Uint8Array){if(e=e instanceof Uint8Array?e:sa.encode(e),e.length===0)return[this,t];const n=this.forks.get(e[0]);return n&&$.commonPrefix(n.prefix,e).length===n.prefix.length?n.node.findClosest(e.slice(n.prefix.length),$.concatBytes(t,n.prefix)):[this,t]}collect(e=[]){for(const t of this.forks.values())$.equals(t.node.targetAddress,jr)||e.push(t.node),t.node.collect(e);return e}collectAndMap(){const e=this.collect(),t={};for(const n of e)t[n.fullPathString]=new se(n.targetAddress).toHex();return t}determineType(){let e=0;return(!$.equals(this.targetAddress,jr)||$.equals(this.path,gu))&&(e|=J4),this.forks.size>0&&(e|=W4),$.indexOf(this.path,gu)!==-1&&!$.equals(this.path,gu)&&(e|=Y4),this.metadata&&(e|=nx),e}}function Z4(r,e){return(r&e)===e}function eA(r){function n(a){if(a<=1)return a;const c=Math.ceil(a/128);return a+n(c)}const i=Math.ceil(r/4096);return n(i)}const tA={aac:"audio/aac",abw:"application/x-abiword",ai:"application/postscript",arc:"application/octet-stream",avi:"video/x-msvideo",azw:"application/vnd.amazon.ebook",bin:"application/octet-stream",bz:"application/x-bzip",bz2:"application/x-bzip2",csh:"application/x-csh",css:"text/css",csv:"text/csv",doc:"application/msword",dll:"application/octet-stream",dmg:"application/x-apple-diskimage",eot:"application/vnd.ms-fontobject",epub:"application/epub+zip",gif:"image/gif",htm:"text/html",html:"text/html",ico:"image/x-icon",ics:"text/calendar",jar:"application/java-archive",jpeg:"image/jpeg",jpg:"image/jpeg",js:"application/javascript",json:"application/json",mid:"audio/midi",midi:"audio/midi",mp2:"audio/mpeg",mp3:"audio/mpeg",mp4:"video/mp4",mpa:"video/mpeg",mpe:"video/mpeg",mpeg:"video/mpeg",mpkg:"application/vnd.apple.installer+xml",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",oga:"audio/ogg",ogv:"video/ogg",ogx:"application/ogg",otf:"font/otf",png:"image/png",pdf:"application/pdf",ppt:"application/vnd.ms-powerpoint",rar:"application/x-rar-compressed",rtf:"application/rtf",sh:"application/x-sh",svg:"image/svg+xml",swf:"application/x-shockwave-flash",tar:"application/x-tar",tif:"image/tiff",tiff:"image/tiff",ts:"application/typescript",ttf:"font/ttf",txt:"text/plain",vsd:"application/vnd.visio",wav:"audio/x-wav",weba:"audio/webm",webm:"video/webm",webp:"image/webp",woff:"font/woff",woff2:"font/woff2",xhtml:"application/xhtml+xml",xls:"application/vnd.ms-excel",xlsx:"application/vnd.ms-excel",xml:"application/xml",xul:"application/vnd.mozilla.xul+xml",zip:"application/zip","3gp":"video/3gpp","3gp2":"video/3gpp2","7z":"application/x-7z-compressed"};async function nA(r){throw new Error("Hashing directories is not supported in browsers!")}async function rA(r,e,t,n,i,a){throw new Error("Streaming directories is not supported in browsers!")}async function iA(r,e,t,n,i,a){const c=a?.signal;if(c?.aborted)throw new Error("Request aborted");const l=new ww(64,64);let f=0,p=0;for(const y of e)f+=eA(y.size);t=new De(t);async function h(y){await l.enqueue(async()=>{if(!c?.aborted)try{await r.uploadChunk(t,y.build(),i,a),n?.({total:f,processed:++p})}catch(E){if(c?.aborted)return;throw E}})}const x=new Er;for(const y of e){if(c?.aborted)throw new Error("Request aborted");const E=await new Promise((C,S)=>{const D=new ap(h);let U=0;const K=new FileReader;K.onerror=()=>{S(K.error)};const H=async()=>{if(c?.aborted){S(new Error("Request aborted"));return}if(U>=y.size){const F=await D.finalize();C(F);return}const j=y.slice(U,U+4096);K.readAsArrayBuffer(j)};K.onload=async j=>{if(!j.target){S("No event target");return}const F=j.target.result;F&&(await D.append(new Uint8Array(F)),U+=4096),H()},H()});await l.drain();const{filename:v,extension:R}=gl.parseFilename(y.name);x.addFork(qp(y),E.hash(),{"Content-Type":sA(tA[R.toLowerCase()]||"application/octet-stream"),Filename:v}),y.name==="index.html"&&x.addFork("/",jr,{"website-index-document":"index.html"})}if(c?.aborted)throw new Error("Request aborted");return x.saveRecursively(r,t,i,a)}function sA(r){return["text/html","text/css"].includes(r)?`${r}; charset=utf-8`:r}async function aA(r){throw new Error("Creating Collection from File System is not supported in browsers!")}async function zh(r){if(typeof r=="string")return new TextEncoder().encode(r);if(r instanceof ArrayBuffer)return new Uint8Array(r);if(r instanceof Blob)return new Uint8Array(await new Response(r).arrayBuffer());throw new TypeError("unknown websocket data type")}function oA(r){try{if(typeof r!="string")return!1;const e=new URL(r);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}}function cA(r){if(!oA(r))throw new xn("URL is not valid!",r)}function uA(r){return r.endsWith("/")?r.slice(0,-1):r}class V9{constructor(e,t){cA(e),this.url=uA(e),t?.signer&&(this.signer=new vn(t.signer)),this.network=t?.network??"gnosis",this.requestOptions={baseURL:this.url,timeout:t?.timeout??0,headers:t?.headers,onRequest:t?.onRequest,httpAgent:t?.httpAgent,httpsAgent:t?.httpsAgent}}async uploadData(e,t,n,i){return e=new De(e),F0(t),n&&(n=Mw(n)),Vp(this.getRequestOptionsForCall(i),t,e,n)}async probeData(e,t){return e=new se(e),Q3(this.getRequestOptionsForCall(t),e)}async downloadData(e,t,n){return t&&(t=Wn(t)),Gp(this.getRequestOptionsForCall(n),new ia(e),t)}async downloadReadableData(e,t,n){return t&&(t=Wn(t)),J3(this.getRequestOptionsForCall(n),new ia(e),t)}async uploadChunk(e,t,n,i){const a="identifier"in t&&"signature"in t&&"owner"in t;if(t=t instanceof Uint8Array?t:t.data,n&&(n=Xi(n)),t.length<et.LENGTH)throw new xn(`Chunk has to have size of at least ${et.LENGTH}.`,t);if(!a&&t.length>Gs+et.LENGTH)throw new xn(`Content Addressed Chunk must not exceed ${Gs+et.LENGTH} bytes.`,t);if(a&&t.length>Gs+et.LENGTH+tr.LENGTH+it.LENGTH)throw new xn(`Single Owner Chunk must not exceed ${Gs+et.LENGTH+tr.LENGTH+it.LENGTH} bytes.`,t);return z3(this.getRequestOptionsForCall(i),t,e,n)}async downloadChunk(e,t,n){return e=new se(e),t&&(t=Wn(t)),ds(this.getRequestOptionsForCall(n),e,t)}async createGrantees(e,t,n){return e=new De(e),t=t.map(i=>new qt(i)),C4(this.getRequestOptionsForCall(n),e,t)}async getGrantees(e,t){return e=new se(e),O4(e,this.getRequestOptionsForCall(t))}async patchGrantees(e,t,n,i,a){e=new De(e),t=new se(t),n=new se(n);const c={add:i.add?.map(l=>new qt(l))??[],revoke:i.revoke?.map(l=>new qt(l))??[]};return S4(e,t,n,c,this.getRequestOptionsForCall(a))}async uploadFile(e,t,n,i,a){if(e=new De(e),$w(t),i&&(i=Vw(i)),n&&typeof n!="string")throw new TypeError("name has to be string or undefined!");if(pp(t)){const c=await xp(t),l=n??t.name,p={contentType:t.type,...i};return Th(this.getRequestOptionsForCall(a),c,e,l,p)}else return Th(this.getRequestOptionsForCall(a),t,e,n,i)}async downloadFile(e,t="",n,i){return n&&(n=Wn(n)),m8(this.getRequestOptionsForCall(i),new ia(e),t,n)}async downloadReadableFile(e,t="",n,i){return e=new se(e),n&&(n=Wn(n)),b8(this.getRequestOptionsForCall(i),e,t,n)}async uploadFiles(e,t,n,i){e=new De(e),n&&(n=Ec(n));const a=u8(t);return lu(this.getRequestOptionsForCall(i),a,e,n)}async hashDirectory(e){return nA()}async streamDirectory(e,t,n,i,a){return e=new De(e),rA(this,t,e,n,i,this.getRequestOptionsForCall(a))}async streamFiles(e,t,n,i,a){return e=new De(e),iA(this,t,e,n,i,this.getRequestOptionsForCall(a))}async uploadCollection(e,t,n,i){return e=new De(e),jp(t),n&&(n=Ec(n)),lu(this.getRequestOptionsForCall(i),t,e,n)}async uploadFilesFromDirectory(e,t,n,i){e=new De(e),n&&(n=Ec(n));const a=await aA();return lu(this.getRequestOptionsForCall(i),a,e,n)}async createTag(e){return _4(this.getRequestOptionsForCall(e))}async getAllTags(e,t){return e&&(e=_w(e)),q4(this.getRequestOptionsForCall(t),e?.offset,e?.limit)}async retrieveTag(e,t){return e=Xn(e),j4(this.getRequestOptionsForCall(t),e)}async deleteTag(e,t){return e=Xn(e),K4(this.getRequestOptionsForCall(t),e)}async updateTag(e,t,n){return t=new se(t),e=Xn(e),Q4(this.getRequestOptionsForCall(n),e,t)}async pin(e,t){return e=new se(e),D4(this.getRequestOptionsForCall(t),e)}async unpin(e,t){return e=new se(e),F4(this.getRequestOptionsForCall(t),e)}async getAllPins(e){return L4(this.getRequestOptionsForCall(e))}async getPin(e,t){return e=new se(e),U4(this.getRequestOptionsForCall(t),e)}async reuploadPinnedData(e,t,n){e=new De(e),t=new se(t),await H4(this.getRequestOptionsForCall(n),e,t)}async isReferenceRetrievable(e,t){return e=new se(e),$4(this.getRequestOptionsForCall(t),e)}async isFeedRetrievable(e,t,n,i,a){if(e=new mt(e),t=new On(t),i&&(i=Wn(i)),!n)try{return await this.makeFeedReader(t,e,a).download(),!0}catch(c){const l=Yi.getDeep(c,"status");if(l===404||l===500)return!1;throw c}return o8(this,e,t,n,i,this.getRequestOptionsForCall(a))}async pssSend(e,t,n,i,a,c){return e=new De(e),F0(i),a?(a=new qt(a),Mh(this.getRequestOptionsForCall(c),t,n,i,e,a)):Mh(this.getRequestOptionsForCall(c),t,n,i,e)}pssSubscribe(e,t){t=zw(t);const n=M4(this.url,e,this.requestOptions.headers);let i=!1;const c={topic:e,cancel:()=>{i||(i=!0,n.terminate?n.terminate():n.close())}};return n.onmessage=async l=>{const f=await zh(l.data);f.length&&t.onMessage(new we(f),c)},n.onerror=l=>{i||t.onError(new cn(l.message),c)},n.onclose=()=>{t.onClose(c)},c}async pssReceive(e,t=0){if(typeof t!="number")throw new TypeError("timeoutMsc parameter has to be a number!");return new Promise((n,i)=>{let a;const c=this.pssSubscribe(e,{onError:l=>{clearTimeout(a),c.cancel(),i(l.message)},onMessage:l=>{clearTimeout(a),c.cancel(),n(l)},onClose:()=>{clearTimeout(a),c.cancel()}});t>0&&(a=setTimeout(()=>{c.cancel(),i(new cn("pssReceive timeout"))},t))})}gsocMine(e,t,n=12){e=new nn(e),t=new it(t);const i=0xb33n;for(let a=0n;a<0xffffn;a++){const c=new vn($.numberToUint256(i+a,"BE")),l=ji(t,c.publicKey().address());if(256-$.proximity(l.toUint8Array(),e.toUint8Array())<=256-n)return c}throw Error("Could not mine a valid signer")}async gsocSend(e,t,n,i,a,c){e=new De(e),t=new vn(t),n=new it(n);const f=Zi(i).toSingleOwnerChunk(n,t);return P4(this.getRequestOptionsForCall(c),f,e,a)}gsocSubscribe(e,t,n){e=new mt(e),t=new it(t),n=Hw(n);const i=ji(t,e),a=k4(this.url,i,this.requestOptions.headers);let c=!1;const f={address:e,cancel:()=>{c||(c=!0,a.terminate?a.terminate():a.close())}};return a.onmessage=async p=>{const h=await zh(p.data);h.length&&n.onMessage(new we(h),f)},a.onerror=p=>{c||n.onError(new cn(p.message),f)},a.onclose=()=>{n.onClose(f)},f}async createFeedManifest(e,t,n,i,a){return e=new De(e),t=new On(t),n=new mt(n),i&&(i=Xi(i)),W3(this.getRequestOptionsForCall(a),n,t,e,i)}makeFeedReader(e,t,n){return e=new On(e),t=new mt(t),_p(this.getRequestOptionsForCall(n),e,t)}makeFeedWriter(e,t,n){if(e=new On(e),t=t?new vn(t):this.signer,!t)throw Error("No signer provided");return i8(this.getRequestOptionsForCall(n),e,t)}async fetchLatestFeedUpdate(e,t,n){return e=new On(e),t=new mt(t),da(this.getRequestOptionsForCall(n),t,e)}makeContentAddressedChunk(e,t){return Zi(e,t)}unmarshalContentAddressedChunk(e){return Mp(e)}makeSingleOwnerChunk(e,t,n,i,a){return Lp(e,t,n,i,a)}calculateSingleOwnerChunkAddress(e,t){return ji(e,t)}unmarshalSingleOwnerChunk(e,t){return Na(e,t)}makeSOCReader(e,t){return e=new mt(e),{owner:e,download:K3.bind(null,this.getRequestOptionsForCall(t),e)}}makeSOCWriter(e,t){if(e=e?new vn(e):this.signer,!e)throw Error("No signer provided");return{...this.makeSOCReader(e.publicKey().address(),t),upload:Tl.bind(null,this.getRequestOptionsForCall(t),e)}}async createEnvelope(e,t,n){return e=new De(e),t=new se(t),v4(this.getRequestOptionsForCall(n),e,t)}async rchash(e,t,n,i){return G4(this.getRequestOptionsForCall(i),e,t,n)}async checkConnection(e){return Vh(this.getRequestOptionsForCall(e))}async isConnected(e){try{await Vh(this.getRequestOptionsForCall(e))}catch{return!1}return!0}async isGateway(e){return z4(this.getRequestOptionsForCall(e))}async getNodeAddresses(e){return I8(this.getRequestOptionsForCall(e))}async getBlocklist(e){return k8(this.getRequestOptionsForCall(e))}async getPeers(e){return P8(this.getRequestOptionsForCall(e))}async removePeer(e,t){return e=new nn(e),D8(this.getRequestOptionsForCall(t),e)}async getTopology(e){return F8(this.getRequestOptionsForCall(e))}async pingPeer(e,t){return e=new nn(e),U8(this.getRequestOptionsForCall(t),e)}async getAllBalances(e){return g8(this.getRequestOptionsForCall(e))}async getPeerBalance(e,t){return e=new nn(e),y8(this.getRequestOptionsForCall(t),e)}async getPastDueConsumptionBalances(e){return w8(this.getRequestOptionsForCall(e))}async getPastDueConsumptionPeerBalance(e,t){return e=new nn(e),A8(this.getRequestOptionsForCall(t),e)}async getChequebookAddress(e){return E8(this.getRequestOptionsForCall(e))}async getChequebookBalance(e){return B8(this.getRequestOptionsForCall(e))}async getLastCheques(e){return O8(this.getRequestOptionsForCall(e))}async getLastChequesForPeer(e,t){return e=new nn(e),v8(this.getRequestOptionsForCall(t),e)}async getLastCashoutAction(e,t){return e=new nn(e),R8(this.getRequestOptionsForCall(t),e)}async cashoutLastCheque(e,t,n){return e=new nn(e),t&&D0(t),T8(this.getRequestOptionsForCall(n),e,t)}async depositTokens(e,t,n){return this.depositBZZToChequebook(e,t,n)}async depositBZZToChequebook(e,t,n){const i=e instanceof me?e.toPLURString():be(e,{min:1n,name:"amount"});let a;return t&&(a=be(e,{min:0n,name:"gasPrice"})),S8(this.getRequestOptionsForCall(n),i,a)}async withdrawTokens(e,t,n){return this.withdrawBZZFromChequebook(e,t,n)}async withdrawBZZFromChequebook(e,t,n){const i=e instanceof me?e.toPLURString():be(e,{min:1n,name:"amount"});let a;return t&&(a=be(e,{min:0n,name:"gasPrice"})),N8(this.getRequestOptionsForCall(n),i,a)}async withdrawBZZToExternalWallet(e,t,n){return e=e instanceof me?e:me.fromPLUR(e),t=new mt(t),r4(this.getRequestOptionsForCall(n),e,t)}async withdrawDAIToExternalWallet(e,t,n){return e=e instanceof qe?e:qe.fromWei(e),t=new mt(t),i4(this.getRequestOptionsForCall(n),e,t)}async getSettlements(e,t){return e=new nn(e),L8(this.getRequestOptionsForCall(t),e)}async getAllSettlements(e){return M8(this.getRequestOptionsForCall(e))}async getStatus(e){return x4(this.getRequestOptionsForCall(e))}async getHealth(e){return Pa(this.getRequestOptionsForCall(e))}async getReadiness(e){return m4(this.getRequestOptionsForCall(e))}async getNodeInfo(e){return b4(this.getRequestOptionsForCall(e))}async isSupportedExactVersion(e){return g4(this.getRequestOptionsForCall(e))}async isSupportedApiVersion(e){return y4(this.getRequestOptionsForCall(e))}async getVersions(e){return w4(this.getRequestOptionsForCall(e))}async getReserveState(e){return e4(this.getRequestOptionsForCall(e))}async getChainState(e){return t4(this.getRequestOptionsForCall(e))}async getWalletBalance(e){return n4(this.getRequestOptionsForCall(e))}async createPostageBatch(e,t,n,i){const a=be(e,{min:0n,name:"amount"});if(n&&(n=k0(n)),t<N0||t>I0)throw new xn(`Depth has to be between ${N0}..${I0}`,t);const c=await this.getChainState(),l=BigInt(c.currentPrice)*17280n+1n;if(BigInt(a)<l)throw new xn(`Amount has to be at least ${l} (1 day at current price ${c.currentPrice})`,a);const f=await J8(this.getRequestOptionsForCall(i),a,t,n);return n?.waitForUsable!==!1&&await this.waitForUsablePostageStamp(f,n?.waitForUsableTimeout),f}async buyStorage(e,t,n,i,a,c){const l=await this.getChainState(i),f=hn(t,l.currentPrice,this.network==="gnosis"?5:15),p=Gr(e,a,c);return n&&(n=k0(n)),this.createPostageBatch(f,p,n,i)}async getStorageCost(e,t,n,i,a){const c=await this.getChainState(n),l=hn(t,c.currentPrice,this.network==="gnosis"?5:15),f=Gr(e,i,a);return Vr(f,l)}async extendStorage(e,t,n,i,a,c){const l=await this.getPostageBatch(e,i),f=Gr(t,a,c),p=await this.getChainState(i),h=f-l.depth,x=h<=0?1n:2n**BigInt(h),y=this.network==="gnosis"?5:15,E=hn(n,p.currentPrice,y),v=hn(l.duration,p.currentPrice,y),C=(n.isZero()?v*x:(v+E)*x)-v,S=await this.topUpBatch(l.batchID,C,i);return h>0?this.diluteBatch(l.batchID,f,i):S}async extendStorageSize(e,t,n,i,a){const c=await this.getChainState(n),l=await this.getPostageBatch(e,n),f=Gr(t,i,a),p=f-l.depth;if(p<=0)throw new xn("New depth has to be greater than the original depth",f);const h=hn(l.duration,c.currentPrice,this.network==="gnosis"?5:15);return await this.topUpBatch(l.batchID,h*(2n**BigInt(p)-1n)+1n,n),this.diluteBatch(l.batchID,f,n)}async extendStorageDuration(e,t,n){const i=await this.getPostageBatch(e,n),a=await this.getChainState(n),c=hn(t,a.currentPrice,this.network==="gnosis"?5:15);return this.topUpBatch(i.batchID,c,n)}async getExtensionCost(e,t,n,i,a,c){const l=await this.getPostageBatch(e,i),f=await this.getChainState(i),p=this.network==="gnosis"?5:15,h=n.isZero()?0n:hn(n,f.currentPrice,p),x=Gr(t,a,c),y=hn(l.duration,f.currentPrice,p),E=Vr(l.depth,y);return Vr(Math.max(l.depth,x),y+h).minus(E)}async getSizeExtensionCost(e,t,n,i,a){const c=await this.getPostageBatch(e,n),l=await this.getChainState(n),f=Gr(t,i,a);if(f-c.depth<=0)throw new xn("New depth has to be greater than the original depth",f);const h=hn(c.duration,l.currentPrice,this.network==="gnosis"?5:15),x=Vr(c.depth,h);return Vr(f,h).minus(x)}async getDurationExtensionCost(e,t,n){const i=await this.getPostageBatch(e,n),a=await this.getChainState(n),c=hn(t,a.currentPrice,this.network==="gnosis"?5:15);return Vr(i.depth,c)}async topUpBatch(e,t,n){e=new De(e);const i=be(t,{min:1n,name:"amount"});return W8(this.getRequestOptionsForCall(n),e,i)}async diluteBatch(e,t,n){return e=new De(e),t=w.asNumber(t,{name:"depth",min:18,max:255}),Y8(this.getRequestOptionsForCall(n),e,t)}async getPostageBatch(e,t,n,i){return e=new De(e),K8(this.getRequestOptionsForCall(t),e,n,i)}async getPostageBatchBuckets(e,t){return e=new De(e),Q8(this.getRequestOptionsForCall(t),e)}async getAllPostageBatch(e){return Oh(this.getRequestOptionsForCall(e))}async getAllGlobalPostageBatch(e){return vh(this.getRequestOptionsForCall(e))}async getPostageBatches(e){return Oh(this.getRequestOptionsForCall(e))}async getGlobalPostageBatches(e){return vh(this.getRequestOptionsForCall(e))}async getAllPendingTransactions(e){return A4(this.getRequestOptionsForCall(e))}async getPendingTransaction(e,t){return e=new Rt(e),E4(this.getRequestOptionsForCall(t),e)}async rebroadcastPendingTransaction(e,t){return e=new Rt(e),B4(this.getRequestOptionsForCall(t),e)}async cancelPendingTransaction(e,t,n){e=new Rt(e);let i;return t&&(i=be(t,{min:0n,name:"gasPrice"})),R4(this.getRequestOptionsForCall(n),e,i)}async getStake(e){return G8(this.getRequestOptionsForCall(e))}async getWithdrawableStake(e){return z8(this.getRequestOptionsForCall(e))}async withdrawSurplusStake(e){return H8(this.getRequestOptionsForCall(e))}async migrateStake(e){return $8(this.getRequestOptionsForCall(e))}async depositStake(e,t,n){const i=e instanceof me?e.toPLURString():be(e,{min:1n,name:"amount"});return t&&(t=D0(t)),_8(this.getRequestOptionsForCall(n),i,t)}async getRedistributionState(e){return j8(this.getRequestOptionsForCall(e))}async waitForUsablePostageStamp(e,t=24e4){for(let i=0;i<t;i+=3e3){try{if((await this.getPostageBatch(e)).usable)return}catch{}await va.sleepMillis(3e3)}throw new cn("Timeout on waiting for postage stamp to become usable")}getRequestOptionsForCall(e){return e&&(e=Lw(e)),e?Yi.deepMerge2(this.requestOptions,e):this.requestOptions}}new De("0000000000000000000000000000000000000000000000000000000000000000");const G9=new On("0000000000000000000000000000000000000000000000000000000000000000"),jr=new Uint8Array(32);pt.MEDIUM;pt.STRONG;pt.INSANE;pt.PARANOID;const rx="6.16.0";function lA(r,e,t){const n=e.split("|").map(a=>a.trim());for(let a=0;a<n.length;a++)switch(e){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof r===e)return}const i=new Error(`invalid value for type ${e}`);throw i.code="INVALID_ARGUMENT",i.argument=`value.${t}`,i.value=r,i}async function xt(r){const e=Object.keys(r);return(await Promise.all(e.map(n=>Promise.resolve(r[n])))).reduce((n,i,a)=>(n[e[a]]=i,n),{})}function re(r,e,t){for(let n in e){let i=e[n];const a=t?t[n]:null;a&&lA(i,a,n),Object.defineProperty(r,n,{enumerable:!0,value:i,writable:!1})}}function Qr(r,e){if(r==null)return"null";if(e==null&&(e=new Set),typeof r=="object"){if(e.has(r))return"[Circular]";e.add(r)}if(Array.isArray(r))return"[ "+r.map(t=>Qr(t,e)).join(", ")+" ]";if(r instanceof Uint8Array){const t="0123456789abcdef";let n="0x";for(let i=0;i<r.length;i++)n+=t[r[i]>>4],n+=t[r[i]&15];return n}if(typeof r=="object"&&typeof r.toJSON=="function")return Qr(r.toJSON(),e);switch(typeof r){case"boolean":case"number":case"symbol":return r.toString();case"bigint":return BigInt(r).toString();case"string":return JSON.stringify(r);case"object":{const t=Object.keys(r);return t.sort(),"{ "+t.map(n=>`${Qr(n,e)}: ${Qr(r[n],e)}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function lt(r,e){return r&&r.code===e}function kl(r){return lt(r,"CALL_EXCEPTION")}function He(r,e,t){let n=r;{const a=[];if(t){if("message"in t||"code"in t||"name"in t)throw new Error(`value will overwrite populated values: ${Qr(t)}`);for(const c in t){if(c==="shortMessage")continue;const l=t[c];a.push(c+"="+Qr(l))}}a.push(`code=${e}`),a.push(`version=${rx}`),a.length&&(r+=" ("+a.join(", ")+")")}let i;switch(e){case"INVALID_ARGUMENT":i=new TypeError(r);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":i=new RangeError(r);break;default:i=new Error(r)}return re(i,{code:e}),t&&Object.assign(i,t),i.shortMessage==null&&re(i,{shortMessage:n}),i}function G(r,e,t,n){if(!r)throw He(e,t,n)}function O(r,e,t,n){G(r,e,"INVALID_ARGUMENT",{argument:t,value:n})}function ix(r,e,t){t==null&&(t=""),t&&(t=": "+t),G(r>=e,"missing argument"+t,"MISSING_ARGUMENT",{count:r,expectedCount:e}),G(r<=e,"too many arguments"+t,"UNEXPECTED_ARGUMENT",{count:r,expectedCount:e})}const fA=["NFD","NFC","NFKD","NFKC"].reduce((r,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");r.push(e)}catch{}return r},[]);function sx(r){G(fA.indexOf(r)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:r}})}function Nr(r,e,t){if(t==null&&(t=""),r!==e){let n=t,i="new";t&&(n+=".",i+=" "+t),G(!1,`private constructor; use ${n}from* methods`,"UNSUPPORTED_OPERATION",{operation:i})}}function ax(r,e,t){if(r instanceof Uint8Array)return t?new Uint8Array(r):r;if(typeof r=="string"&&r.length%2===0&&r.match(/^0x[0-9a-f]*$/i)){const n=new Uint8Array((r.length-2)/2);let i=2;for(let a=0;a<n.length;a++)n[a]=parseInt(r.substring(i,i+2),16),i+=2;return n}O(!1,"invalid BytesLike value",e||"value",r)}function Y(r,e){return ax(r,e,!1)}function ft(r,e){return ax(r,e,!0)}function Le(r,e){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||typeof e=="number"&&r.length!==2+2*e||e===!0&&r.length%2!==0)}function Fa(r){return Le(r,!0)||r instanceof Uint8Array}const Hh="0123456789abcdef";function _(r){const e=Y(r);let t="0x";for(let n=0;n<e.length;n++){const i=e[n];t+=Hh[(i&240)>>4]+Hh[i&15]}return t}function Ce(r){return"0x"+r.map(e=>_(e).substring(2)).join("")}function Wr(r){return Le(r,!0)?(r.length-2)/2:Y(r).length}function Ve(r,e,t){const n=Y(r);return t!=null&&t>n.length&&G(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:t}),_(n.slice(e??0,t??n.length))}function ox(r,e,t){const n=Y(r);G(e>=n.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(n),length:e,offset:e+1});const i=new Uint8Array(e);return i.fill(0),t?i.set(n,e-n.length):i.set(n,0),_(i)}function kn(r,e){return ox(r,e,!0)}function hA(r,e){return ox(r,e,!1)}const ms=BigInt(0),on=BigInt(1),Jr=9007199254740991;function dA(r,e){const t=Ua(r,"value"),n=BigInt(pe(e,"width"));if(G(t>>n===ms,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:r}),t>>n-on){const i=(on<<n)-on;return-((~t&i)+on)}return t}function cx(r,e){let t=Z(r,"value");const n=BigInt(pe(e,"width")),i=on<<n-on;if(t<ms){t=-t,G(t<=i,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:r});const a=(on<<n)-on;return(~t&a)+on}else G(t<i,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:r});return t}function Vi(r,e){const t=Ua(r,"value"),n=BigInt(pe(e,"bits"));return t&(on<<n)-on}function Z(r,e){switch(typeof r){case"bigint":return r;case"number":return O(Number.isInteger(r),"underflow",e||"value",r),O(r>=-Jr&&r<=Jr,"overflow",e||"value",r),BigInt(r);case"string":try{if(r==="")throw new Error("empty string");return r[0]==="-"&&r[1]!=="-"?-BigInt(r.substring(1)):BigInt(r)}catch(t){O(!1,`invalid BigNumberish string: ${t.message}`,e||"value",r)}}O(!1,"invalid BigNumberish value",e||"value",r)}function Ua(r,e){const t=Z(r,e);return G(t>=ms,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:r}),t}const $h="0123456789abcdef";function La(r){if(r instanceof Uint8Array){let e="0x0";for(const t of r)e+=$h[t>>4],e+=$h[t&15];return BigInt(e)}return Z(r)}function pe(r,e){switch(typeof r){case"bigint":return O(r>=-Jr&&r<=Jr,"overflow",e||"value",r),Number(r);case"number":return O(Number.isInteger(r),"underflow",e||"value",r),O(r>=-Jr&&r<=Jr,"overflow",e||"value",r),r;case"string":try{if(r==="")throw new Error("empty string");return pe(BigInt(r),e)}catch(t){O(!1,`invalid numeric string: ${t.message}`,e||"value",r)}}O(!1,"invalid numeric value",e||"value",r)}function pA(r){return pe(La(r))}function Dn(r,e){const t=Ua(r,"value");let n=t.toString(16);if(e==null)n.length%2&&(n="0"+n);else{const i=pe(e,"width");if(i===0&&t===ms)return"0x";for(G(i*2>=n.length,`value exceeds width (${i} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:r});n.length<i*2;)n="0"+n}return"0x"+n}function je(r,e){const t=Ua(r,"value");if(t===ms)return new Uint8Array(0);let n=t.toString(16);n.length%2&&(n="0"+n);const i=new Uint8Array(n.length/2);for(let a=0;a<i.length;a++){const c=a*2;i[a]=parseInt(n.substring(c,c+2),16)}return i}function sn(r){let e=_(Fa(r)?r:je(r)).substring(2);for(;e.startsWith("0");)e=e.substring(1);return e===""&&(e="0"),"0x"+e}const xa="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";let $s=null;function xA(r){if($s==null){$s={};for(let t=0;t<xa.length;t++)$s[xa[t]]=BigInt(t)}const e=$s[r];return O(e!=null,"invalid base58 value","letter",r),e}const mA=BigInt(0),Qu=BigInt(58);function ux(r){const e=Y(r);let t=La(e),n="";for(;t;)n=xa[Number(t%Qu)]+n,t/=Qu;for(let i=0;i<e.length&&!e[i];i++)n=xa[0]+n;return n}function bA(r){let e=mA;for(let t=0;t<r.length;t++)e*=Qu,e+=xA(r[t]);return e}function gA(r){r=atob(r);const e=new Uint8Array(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return Y(e)}function yA(r){const e=Y(r);let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}class lx{filter;emitter;#e;constructor(e,t,n){this.#e=t,re(this,{emitter:e,filter:n})}async removeListener(){this.#e!=null&&await this.emitter.off(this.filter,this.#e)}}function wA(r,e,t,n,i){O(!1,`invalid codepoint at offset ${e}; ${r}`,"bytes",t)}function fx(r,e,t,n,i){if(r==="BAD_PREFIX"||r==="UNEXPECTED_CONTINUE"){let a=0;for(let c=e+1;c<t.length&&t[c]>>6===2;c++)a++;return a}return r==="OVERRUN"?t.length-e-1:0}function AA(r,e,t,n,i){return r==="OVERLONG"?(O(typeof i=="number","invalid bad code point for replacement","badCodepoint",i),n.push(i),0):(n.push(65533),fx(r,e,t))}const EA=Object.freeze({error:wA,ignore:fx,replace:AA});function BA(r,e){e==null&&(e=EA.error);const t=Y(r,"bytes"),n=[];let i=0;for(;i<t.length;){const a=t[i++];if(a>>7===0){n.push(a);continue}let c=null,l=null;if((a&224)===192)c=1,l=127;else if((a&240)===224)c=2,l=2047;else if((a&248)===240)c=3,l=65535;else{(a&192)===128?i+=e("UNEXPECTED_CONTINUE",i-1,t,n):i+=e("BAD_PREFIX",i-1,t,n);continue}if(i-1+c>=t.length){i+=e("OVERRUN",i-1,t,n);continue}let f=a&(1<<8-c-1)-1;for(let p=0;p<c;p++){let h=t[i];if((h&192)!=128){i+=e("MISSING_CONTINUE",i,t,n),f=null;break}f=f<<6|h&63,i++}if(f!==null){if(f>1114111){i+=e("OUT_OF_RANGE",i-1-c,t,n,f);continue}if(f>=55296&&f<=57343){i+=e("UTF16_SURROGATE",i-1-c,t,n,f);continue}if(f<=l){i+=e("OVERLONG",i-1-c,t,n,f);continue}n.push(f)}}return n}function Tt(r,e){O(typeof r=="string","invalid string value","str",r),e!=null&&(sx(e),r=r.normalize(e));let t=[];for(let n=0;n<r.length;n++){const i=r.charCodeAt(n);if(i<128)t.push(i);else if(i<2048)t.push(i>>6|192),t.push(i&63|128);else if((i&64512)==55296){n++;const a=r.charCodeAt(n);O(n<r.length&&(a&64512)===56320,"invalid surrogate pair","str",r);const c=65536+((i&1023)<<10)+(a&1023);t.push(c>>18|240),t.push(c>>12&63|128),t.push(c>>6&63|128),t.push(c&63|128)}else t.push(i>>12|224),t.push(i>>6&63|128),t.push(i&63|128)}return new Uint8Array(t)}function RA(r){return r.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function ma(r,e){return RA(BA(r,e))}function hx(r){async function e(t,n){G(n==null||!n.cancelled,"request cancelled before sending","CANCELLED");const i=t.url.split(":")[0].toLowerCase();G(i==="http"||i==="https",`unsupported protocol ${i}`,"UNSUPPORTED_OPERATION",{info:{protocol:i},operation:"request"}),G(i==="https"||!t.credentials||t.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let a=null;const c=new AbortController,l=setTimeout(()=>{a=He("request timeout","TIMEOUT"),c.abort()},t.timeout);n&&n.addListener(()=>{a=He("request cancelled","CANCELLED"),c.abort()});const f=Object.assign({},r,{method:t.method,headers:new Headers(Array.from(t)),body:t.body||void 0,signal:c.signal});let p;try{p=await fetch(t.url,f)}catch(E){throw clearTimeout(l),a||E}clearTimeout(l);const h={};p.headers.forEach((E,v)=>{h[v.toLowerCase()]=E});const x=await p.arrayBuffer(),y=x==null?null:new Uint8Array(x);return{statusCode:p.status,statusMessage:p.statusText,headers:h,body:y}}return e}const TA=12,vA=250;let _h=hx();const OA=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),CA=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let yu=!1;async function dx(r,e){try{const t=r.match(OA);if(!t)throw new Error("invalid data");return new Zn(200,"OK",{"content-type":t[1]||"text/plain"},t[2]?gA(t[3]):NA(t[3]))}catch{return new Zn(599,"BAD REQUEST (invalid data: URI)",{},null,new En(r))}}function px(r){async function e(t,n){try{const i=t.match(CA);if(!i)throw new Error("invalid link");return new En(`${r}${i[2]}`)}catch{return new Zn(599,"BAD REQUEST (invalid IPFS URI)",{},null,new En(t))}}return e}const _s={data:dx,ipfs:px("https://gateway.ipfs.io/ipfs/")},xx=new WeakMap;class SA{#e;#t;constructor(e){this.#e=[],this.#t=!1,xx.set(e,()=>{if(!this.#t){this.#t=!0;for(const t of this.#e)setTimeout(()=>{t()},0);this.#e=[]}})}addListener(e){G(!this.#t,"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),this.#e.push(e)}get cancelled(){return this.#t}checkSignal(){G(!this.cancelled,"cancelled","CANCELLED",{})}}function js(r){if(r==null)throw new Error("missing signal; should not happen");return r.checkSignal(),r}class En{#e;#t;#n;#r;#i;#a;#s;#o;#d;#u;#p;#x;#c;#l;#f;get url(){return this.#a}set url(e){this.#a=String(e)}get body(){return this.#s==null?null:new Uint8Array(this.#s)}set body(e){if(e==null)this.#s=void 0,this.#o=void 0;else if(typeof e=="string")this.#s=Tt(e),this.#o="text/plain";else if(e instanceof Uint8Array)this.#s=e,this.#o="application/octet-stream";else if(typeof e=="object")this.#s=Tt(JSON.stringify(e)),this.#o="application/json";else throw new Error("invalid body")}hasBody(){return this.#s!=null}get method(){return this.#r?this.#r:this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),this.#r=String(e).toUpperCase()}get headers(){const e=Object.assign({},this.#n);return this.#d&&(e.authorization=`Basic ${yA(Tt(this.#d))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&this.#o&&(e["content-type"]=this.#o),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,t){this.#n[String(e).toLowerCase()]=String(t)}clearHeaders(){this.#n={}}[Symbol.iterator](){const e=this.headers,t=Object.keys(e);let n=0;return{next:()=>{if(n<t.length){const i=t[n++];return{value:[i,e[i]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return this.#d||null}setCredentials(e,t){O(!e.match(/:/),"invalid basic authentication username","username","[REDACTED]"),this.#d=`${e}:${t}`}get allowGzip(){return this.#t}set allowGzip(e){this.#t=!!e}get allowInsecureAuthentication(){return!!this.#e}set allowInsecureAuthentication(e){this.#e=!!e}get timeout(){return this.#i}set timeout(e){O(e>=0,"timeout must be non-zero","timeout",e),this.#i=e}get preflightFunc(){return this.#u||null}set preflightFunc(e){this.#u=e}get processFunc(){return this.#p||null}set processFunc(e){this.#p=e}get retryFunc(){return this.#x||null}set retryFunc(e){this.#x=e}get getUrlFunc(){return this.#f||_h}set getUrlFunc(e){this.#f=e}constructor(e){this.#a=String(e),this.#e=!1,this.#t=!0,this.#n={},this.#r="",this.#i=3e5,this.#l={slotInterval:vA,maxAttempts:TA},this.#f=null}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${this.#s?_(this.#s):"null"}>`}setThrottleParams(e){e.slotInterval!=null&&(this.#l.slotInterval=e.slotInterval),e.maxAttempts!=null&&(this.#l.maxAttempts=e.maxAttempts)}async#h(e,t,n,i,a){if(e>=this.#l.maxAttempts)return a.makeServerError("exceeded maximum retry limit");G(jh()<=t,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:i}),n>0&&await IA(n);let c=this.clone();const l=(c.url.split(":")[0]||"").toLowerCase();if(l in _s){const h=await _s[l](c.url,js(i.#c));if(h instanceof Zn){let x=h;if(this.processFunc){js(i.#c);try{x=await this.processFunc(c,x)}catch(y){(y.throttle==null||typeof y.stall!="number")&&x.makeServerError("error in post-processing function",y).assertOk()}}return x}c=h}this.preflightFunc&&(c=await this.preflightFunc(c));const f=await this.getUrlFunc(c,js(i.#c));let p=new Zn(f.statusCode,f.statusMessage,f.headers,f.body,i);if(p.statusCode===301||p.statusCode===302){try{const h=p.headers.location||"";return c.redirect(h).#h(e+1,t,0,i,p)}catch{}return p}else if(p.statusCode===429&&(this.retryFunc==null||await this.retryFunc(c,p,e))){const h=p.headers["retry-after"];let x=this.#l.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof h=="string"&&h.match(/^[1-9][0-9]*$/)&&(x=parseInt(h)),c.clone().#h(e+1,t,x,i,p)}if(this.processFunc){js(i.#c);try{p=await this.processFunc(c,p)}catch(h){(h.throttle==null||typeof h.stall!="number")&&p.makeServerError("error in post-processing function",h).assertOk();let x=this.#l.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return h.stall>=0&&(x=h.stall),c.clone().#h(e+1,t,x,i,p)}}return p}send(){return G(this.#c==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),this.#c=new SA(this),this.#h(0,jh()+this.timeout,0,this,new Zn(0,"",{},null,this))}cancel(){G(this.#c!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=xx.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const t=this.url.split(":")[0].toLowerCase(),n=e.split(":")[0].toLowerCase();G(this.method==="GET"&&(t!=="https"||n!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const i=new En(e);return i.method="GET",i.allowGzip=this.allowGzip,i.timeout=this.timeout,i.#n=Object.assign({},this.#n),this.#s&&(i.#s=new Uint8Array(this.#s)),i.#o=this.#o,i}clone(){const e=new En(this.url);return e.#r=this.#r,this.#s&&(e.#s=this.#s),e.#o=this.#o,e.#n=Object.assign({},this.#n),e.#d=this.#d,this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),e.#u=this.#u,e.#p=this.#p,e.#x=this.#x,e.#l=Object.assign({},this.#l),e.#f=this.#f,e}static lockConfig(){yu=!0}static getGateway(e){return _s[e.toLowerCase()]||null}static registerGateway(e,t){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(yu)throw new Error("gateways locked");_s[e]=t}static registerGetUrl(e){if(yu)throw new Error("gateways locked");_h=e}static createGetUrlFunc(e){return hx(e)}static createDataGateway(){return dx}static createIpfsGatewayFunc(e){return px(e)}}class Zn{#e;#t;#n;#r;#i;#a;toString(){return`<FetchResponse status=${this.statusCode} body=${this.#r?_(this.#r):"null"}>`}get statusCode(){return this.#e}get statusMessage(){return this.#t}get headers(){return Object.assign({},this.#n)}get body(){return this.#r==null?null:new Uint8Array(this.#r)}get bodyText(){try{return this.#r==null?"":ma(this.#r)}catch{G(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{G(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,t=Object.keys(e);let n=0;return{next:()=>{if(n<t.length){const i=t[n++];return{value:[i,e[i]],done:!1}}return{value:void 0,done:!0}}}}constructor(e,t,n,i,a){this.#e=e,this.#t=t,this.#n=Object.keys(n).reduce((c,l)=>(c[l.toLowerCase()]=String(n[l]),c),{}),this.#r=i==null?null:new Uint8Array(i),this.#i=a||null,this.#a={message:""}}makeServerError(e,t){let n;e?n=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${e})`:(e=`${this.statusCode} ${this.statusMessage}`,n=`CLIENT ESCALATED SERVER ERROR (${e})`);const i=new Zn(599,n,this.headers,this.body,this.#i||void 0);return i.#a={message:e,error:t},i}throwThrottleError(e,t){t==null?t=-1:O(Number.isInteger(t)&&t>=0,"invalid stall timeout","stall",t);const n=new Error(e||"throttling requests");throw re(n,{stall:t,throttle:!0}),n}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return this.#r!=null}get request(){return this.#i}ok(){return this.#a.message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:t}=this.#a;e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let n=null;this.request&&(n=this.request.url);let i=null;try{this.#r&&(i=ma(this.#r))}catch{}G(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:t,info:{requestUrl:n,responseBody:i,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}}function jh(){return new Date().getTime()}function NA(r){return Tt(r.replace(/%([0-9a-f][0-9a-f])/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))}function IA(r){return new Promise(e=>setTimeout(e,r))}function PA(r){let e=r.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function qh(r,e,t){let n=0;for(let i=0;i<t;i++)n=n*256+r[e+i];return n}function Kh(r,e,t,n){const i=[];for(;t<e+1+n;){const a=mx(r,t);i.push(a.result),t+=a.consumed,G(t<=e+1+n,"child data too short","BUFFER_OVERRUN",{buffer:r,length:n,offset:e})}return{consumed:1+n,result:i}}function mx(r,e){G(r.length!==0,"data too short","BUFFER_OVERRUN",{buffer:r,length:0,offset:1});const t=n=>{G(n<=r.length,"data short segment too short","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:n})};if(r[e]>=248){const n=r[e]-247;t(e+1+n);const i=qh(r,e+1,n);return t(e+1+n+i),Kh(r,e,e+1+n,n+i)}else if(r[e]>=192){const n=r[e]-192;return t(e+1+n),Kh(r,e,e+1,n)}else if(r[e]>=184){const n=r[e]-183;t(e+1+n);const i=qh(r,e+1,n);t(e+1+n+i);const a=_(r.slice(e+1+n,e+1+n+i));return{consumed:1+n+i,result:a}}else if(r[e]>=128){const n=r[e]-128;t(e+1+n);const i=_(r.slice(e+1,e+1+n));return{consumed:1+n,result:i}}return{consumed:1,result:PA(r[e])}}function bs(r){const e=Y(r,"data"),t=mx(e,0);return O(t.consumed===e.length,"unexpected junk after rlp payload","data",r),t.result}function Qh(r){const e=[];for(;r;)e.unshift(r&255),r>>=8;return e}function bx(r){if(Array.isArray(r)){let n=[];if(r.forEach(function(a){n=n.concat(bx(a))}),n.length<=55)return n.unshift(192+n.length),n;const i=Qh(n.length);return i.unshift(247+i.length),i.concat(n)}const e=Array.prototype.slice.call(Y(r,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const t=Qh(e.length);return t.unshift(183+t.length),t.concat(e)}const Jh="0123456789abcdef";function An(r){let e="0x";for(const t of bx(r))e+=Jh[t>>4],e+=Jh[t&15];return e}function kA(r){const e=Y(r,"randomBytes");e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=_(e);return[t.substring(2,10),t.substring(10,14),t.substring(14,18),t.substring(18,22),t.substring(22,34)].join("-")}const Et=32,Ju=new Uint8Array(Et),DA=["then"],qs={},gx=new WeakMap;function xr(r){return gx.get(r)}function Wh(r,e){gx.set(r,e)}function Ui(r,e){const t=new Error(`deferred error during ABI decoding triggered accessing ${r}`);throw t.error=e,t}function Wu(r,e,t){return r.indexOf(null)>=0?e.map((n,i)=>n instanceof Sn?Wu(xr(n),n,t):n):r.reduce((n,i,a)=>{let c=e.getValue(i);return i in n||(t&&c instanceof Sn&&(c=Wu(xr(c),c,t)),n[i]=c),n},{})}class Sn extends Array{#e;constructor(...e){const t=e[0];let n=e[1],i=(e[2]||[]).slice(),a=!0;t!==qs&&(n=e,i=[],a=!1),super(n.length),n.forEach((f,p)=>{this[p]=f});const c=i.reduce((f,p)=>(typeof p=="string"&&f.set(p,(f.get(p)||0)+1),f),new Map);if(Wh(this,Object.freeze(n.map((f,p)=>{const h=i[p];return h!=null&&c.get(h)===1?h:null}))),this.#e=[],this.#e==null&&this.#e,!a)return;Object.freeze(this);const l=new Proxy(this,{get:(f,p,h)=>{if(typeof p=="string"){if(p.match(/^[0-9]+$/)){const y=pe(p,"%index");if(y<0||y>=this.length)throw new RangeError("out of result range");const E=f[y];return E instanceof Error&&Ui(`index ${y}`,E),E}if(DA.indexOf(p)>=0)return Reflect.get(f,p,h);const x=f[p];if(x instanceof Function)return function(...y){return x.apply(this===h?f:this,y)};if(!(p in f))return f.getValue.apply(this===h?f:this,[p])}return Reflect.get(f,p,h)}});return Wh(l,xr(this)),l}toArray(e){const t=[];return this.forEach((n,i)=>{n instanceof Error&&Ui(`index ${i}`,n),e&&n instanceof Sn&&(n=n.toArray(e)),t.push(n)}),t}toObject(e){const t=xr(this);return t.reduce((n,i,a)=>(G(i!=null,`value at index ${a} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),Wu(t,this,e)),{})}slice(e,t){e==null&&(e=0),e<0&&(e+=this.length,e<0&&(e=0)),t==null&&(t=this.length),t<0&&(t+=this.length,t<0&&(t=0)),t>this.length&&(t=this.length);const n=xr(this),i=[],a=[];for(let c=e;c<t;c++)i.push(this[c]),a.push(n[c]);return new Sn(qs,i,a)}filter(e,t){const n=xr(this),i=[],a=[];for(let c=0;c<this.length;c++){const l=this[c];l instanceof Error&&Ui(`index ${c}`,l),e.call(t,l,c,this)&&(i.push(l),a.push(n[c]))}return new Sn(qs,i,a)}map(e,t){const n=[];for(let i=0;i<this.length;i++){const a=this[i];a instanceof Error&&Ui(`index ${i}`,a),n.push(e.call(t,a,i,this))}return n}getValue(e){const t=xr(this).indexOf(e);if(t===-1)return;const n=this[t];return n instanceof Error&&Ui(`property ${JSON.stringify(e)}`,n.error),n}static fromItems(e,t){return new Sn(qs,e,t)}}function Yh(r){let e=je(r);return G(e.length<=Et,"value out-of-bounds","BUFFER_OVERRUN",{buffer:e,length:Et,offset:e.length}),e.length!==Et&&(e=ft(Ce([Ju.slice(e.length%Et),e]))),e}class Ln{name;type;localName;dynamic;constructor(e,t,n,i){re(this,{name:e,type:t,localName:n,dynamic:i},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(e,t){O(!1,e,this.localName,t)}}class Yu{#e;#t;constructor(){this.#e=[],this.#t=0}get data(){return Ce(this.#e)}get length(){return this.#t}#n(e){return this.#e.push(e),this.#t+=e.length,e.length}appendWriter(e){return this.#n(ft(e.data))}writeBytes(e){let t=ft(e);const n=t.length%Et;return n&&(t=ft(Ce([t,Ju.slice(n)]))),this.#n(t)}writeValue(e){return this.#n(Yh(e))}writeUpdatableValue(){const e=this.#e.length;return this.#e.push(Ju),this.#t+=Et,t=>{this.#e[e]=Yh(t)}}}class Dl{allowLoose;#e;#t;#n;#r;#i;constructor(e,t,n){re(this,{allowLoose:!!t}),this.#e=ft(e),this.#n=0,this.#r=null,this.#i=n??1024,this.#t=0}get data(){return _(this.#e)}get dataLength(){return this.#e.length}get consumed(){return this.#t}get bytes(){return new Uint8Array(this.#e)}#a(e){if(this.#r)return this.#r.#a(e);this.#n+=e,G(this.#i<1||this.#n<=this.#i*this.dataLength,`compressed ABI data exceeds inflation ratio of ${this.#i} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:ft(this.#e),offset:this.#t,length:e,info:{bytesRead:this.#n,dataLength:this.dataLength}})}#s(e,t,n){let i=Math.ceil(t/Et)*Et;return this.#t+i>this.#e.length&&(this.allowLoose&&n&&this.#t+t<=this.#e.length?i=t:G(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:ft(this.#e),length:this.#e.length,offset:this.#t+i})),this.#e.slice(this.#t,this.#t+i)}subReader(e){const t=new Dl(this.#e.slice(this.#t+e),this.allowLoose,this.#i);return t.#r=this,t}readBytes(e,t){let n=this.#s(0,e,!!t);return this.#a(e),this.#t+=n.length,n.slice(0,e)}readValue(){return La(this.readBytes(Et))}readIndex(){return pA(this.readBytes(Et))}}function kt(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}function Fl(r,...e){if(!(r instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(r.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${r.length}`)}function yx(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");kt(r.outputLen),kt(r.blockLen)}function ni(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}function wx(r,e){Fl(r);const t=e.outputLen;if(r.length<t)throw new Error(`digestInto() expects output buffer of length at least ${t}`)}const wu=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;const Ax=r=>r instanceof Uint8Array,aa=r=>new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4)),oa=r=>new DataView(r.buffer,r.byteOffset,r.byteLength),dn=(r,e)=>r<<32-e|r>>>e,FA=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!FA)throw new Error("Non little-endian hardware is not supported");const UA=async()=>{};async function Xh(r,e,t){let n=Date.now();for(let i=0;i<r;i++){t(i);const a=Date.now()-n;a>=0&&a<e||(await UA(),n+=a)}}function LA(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function ri(r){if(typeof r=="string"&&(r=LA(r)),!Ax(r))throw new Error(`expected Uint8Array, got ${typeof r}`);return r}function MA(...r){const e=new Uint8Array(r.reduce((n,i)=>n+i.length,0));let t=0;return r.forEach(n=>{if(!Ax(n))throw new Error("Uint8Array expected");e.set(n,t),t+=n.length}),e}class Ul{clone(){return this._cloneInto()}}const VA={}.toString;function Ex(r,e){if(e!==void 0&&VA.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(r,e)}function Ma(r){const e=n=>r().update(ri(n)).digest(),t=r();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>r(),e}function GA(r=32){if(wu&&typeof wu.getRandomValues=="function")return wu.getRandomValues(new Uint8Array(r));throw new Error("crypto.getRandomValues must be defined")}class Bx extends Ul{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,yx(e);const n=ri(t);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,a=new Uint8Array(i);a.set(n.length>i?e.create().update(n).digest():n);for(let c=0;c<a.length;c++)a[c]^=54;this.iHash.update(a),this.oHash=e.create();for(let c=0;c<a.length;c++)a[c]^=106;this.oHash.update(a),a.fill(0)}update(e){return ni(this),this.iHash.update(e),this}digestInto(e){ni(this),Fl(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:n,finished:i,destroyed:a,blockLen:c,outputLen:l}=this;return e=e,e.finished=i,e.destroyed=a,e.blockLen=c,e.outputLen=l,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Va=(r,e,t)=>new Bx(r,e).update(t).digest();Va.create=(r,e)=>new Bx(r,e);function zA(r,e,t,n){yx(r);const i=Ex({dkLen:32,asyncTick:10},n),{c:a,dkLen:c,asyncTick:l}=i;if(kt(a),kt(c),kt(l),a<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const f=ri(e),p=ri(t),h=new Uint8Array(c),x=Va.create(r,f),y=x._cloneInto().update(p);return{c:a,dkLen:c,asyncTick:l,DK:h,PRF:x,PRFSalt:y}}function HA(r,e,t,n,i){return r.destroy(),e.destroy(),n&&n.destroy(),i.fill(0),t}function Ll(r,e,t,n){const{c:i,dkLen:a,DK:c,PRF:l,PRFSalt:f}=zA(r,e,t,n);let p;const h=new Uint8Array(4),x=oa(h),y=new Uint8Array(l.outputLen);for(let E=1,v=0;v<a;E++,v+=l.outputLen){const R=c.subarray(v,v+l.outputLen);x.setInt32(0,E,!1),(p=f._cloneInto(p)).update(h).digestInto(y),R.set(y.subarray(0,R.length));for(let C=1;C<i;C++){l._cloneInto(p).update(y).digestInto(y);for(let S=0;S<R.length;S++)R[S]^=y[S]}}return HA(l,f,c,p,y)}function $A(r,e,t,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(e,t,n);const i=BigInt(32),a=BigInt(4294967295),c=Number(t>>i&a),l=Number(t&a),f=n?4:0,p=n?0:4;r.setUint32(e+f,c,n),r.setUint32(e+p,l,n)}class Ml extends Ul{constructor(e,t,n,i){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=oa(this.buffer)}update(e){ni(this);const{view:t,buffer:n,blockLen:i}=this;e=ri(e);const a=e.length;for(let c=0;c<a;){const l=Math.min(i-this.pos,a-c);if(l===i){const f=oa(e);for(;i<=a-c;c+=i)this.process(f,c);continue}n.set(e.subarray(c,c+l),this.pos),this.pos+=l,c+=l,this.pos===i&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){ni(this),wx(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:i,isLE:a}=this;let{pos:c}=this;t[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>i-c&&(this.process(n,0),c=0);for(let x=c;x<i;x++)t[x]=0;$A(n,i-8,BigInt(this.length*8),a),this.process(n,0);const l=oa(e),f=this.outputLen;if(f%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const p=f/4,h=this.get();if(p>h.length)throw new Error("_sha2: outputLen bigger than state");for(let x=0;x<p;x++)l.setUint32(4*x,h[x],a)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:n,length:i,finished:a,destroyed:c,pos:l}=this;return e.length=i,e.pos=l,e.finished=a,e.destroyed=c,i%t&&e.buffer.set(n),e}}const _A=(r,e,t)=>r&e^~r&t,jA=(r,e,t)=>r&e^r&t^e&t,qA=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),jn=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),qn=new Uint32Array(64);class KA extends Ml{constructor(){super(64,32,8,!1),this.A=jn[0]|0,this.B=jn[1]|0,this.C=jn[2]|0,this.D=jn[3]|0,this.E=jn[4]|0,this.F=jn[5]|0,this.G=jn[6]|0,this.H=jn[7]|0}get(){const{A:e,B:t,C:n,D:i,E:a,F:c,G:l,H:f}=this;return[e,t,n,i,a,c,l,f]}set(e,t,n,i,a,c,l,f){this.A=e|0,this.B=t|0,this.C=n|0,this.D=i|0,this.E=a|0,this.F=c|0,this.G=l|0,this.H=f|0}process(e,t){for(let x=0;x<16;x++,t+=4)qn[x]=e.getUint32(t,!1);for(let x=16;x<64;x++){const y=qn[x-15],E=qn[x-2],v=dn(y,7)^dn(y,18)^y>>>3,R=dn(E,17)^dn(E,19)^E>>>10;qn[x]=R+qn[x-7]+v+qn[x-16]|0}let{A:n,B:i,C:a,D:c,E:l,F:f,G:p,H:h}=this;for(let x=0;x<64;x++){const y=dn(l,6)^dn(l,11)^dn(l,25),E=h+y+_A(l,f,p)+qA[x]+qn[x]|0,R=(dn(n,2)^dn(n,13)^dn(n,22))+jA(n,i,a)|0;h=p,p=f,f=l,l=c+E|0,c=a,a=i,i=n,n=E+R|0}n=n+this.A|0,i=i+this.B|0,a=a+this.C|0,c=c+this.D|0,l=l+this.E|0,f=f+this.F|0,p=p+this.G|0,h=h+this.H|0,this.set(n,i,a,c,l,f,p,h)}roundClean(){qn.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const di=Ma(()=>new KA),Ks=BigInt(2**32-1),Xu=BigInt(32);function Rx(r,e=!1){return e?{h:Number(r&Ks),l:Number(r>>Xu&Ks)}:{h:Number(r>>Xu&Ks)|0,l:Number(r&Ks)|0}}function Tx(r,e=!1){let t=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let i=0;i<r.length;i++){const{h:a,l:c}=Rx(r[i],e);[t[i],n[i]]=[a,c]}return[t,n]}const QA=(r,e)=>BigInt(r>>>0)<<Xu|BigInt(e>>>0),JA=(r,e,t)=>r>>>t,WA=(r,e,t)=>r<<32-t|e>>>t,YA=(r,e,t)=>r>>>t|e<<32-t,XA=(r,e,t)=>r<<32-t|e>>>t,ZA=(r,e,t)=>r<<64-t|e>>>t-32,e6=(r,e,t)=>r>>>t-32|e<<64-t,t6=(r,e)=>e,n6=(r,e)=>r,vx=(r,e,t)=>r<<t|e>>>32-t,Ox=(r,e,t)=>e<<t|r>>>32-t,Cx=(r,e,t)=>e<<t-32|r>>>64-t,Sx=(r,e,t)=>r<<t-32|e>>>64-t;function r6(r,e,t,n){const i=(e>>>0)+(n>>>0);return{h:r+t+(i/2**32|0)|0,l:i|0}}const i6=(r,e,t)=>(r>>>0)+(e>>>0)+(t>>>0),s6=(r,e,t,n)=>e+t+n+(r/2**32|0)|0,a6=(r,e,t,n)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0),o6=(r,e,t,n,i)=>e+t+n+i+(r/2**32|0)|0,c6=(r,e,t,n,i)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0)+(i>>>0),u6=(r,e,t,n,i,a)=>e+t+n+i+a+(r/2**32|0)|0,xe={fromBig:Rx,split:Tx,toBig:QA,shrSH:JA,shrSL:WA,rotrSH:YA,rotrSL:XA,rotrBH:ZA,rotrBL:e6,rotr32H:t6,rotr32L:n6,rotlSH:vx,rotlSL:Ox,rotlBH:Cx,rotlBL:Sx,add:r6,add3L:i6,add3H:s6,add4L:a6,add4H:o6,add5H:u6,add5L:c6},[l6,f6]=xe.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))),Kn=new Uint32Array(80),Qn=new Uint32Array(80);class h6 extends Ml{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:n,Bl:i,Ch:a,Cl:c,Dh:l,Dl:f,Eh:p,El:h,Fh:x,Fl:y,Gh:E,Gl:v,Hh:R,Hl:C}=this;return[e,t,n,i,a,c,l,f,p,h,x,y,E,v,R,C]}set(e,t,n,i,a,c,l,f,p,h,x,y,E,v,R,C){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=i|0,this.Ch=a|0,this.Cl=c|0,this.Dh=l|0,this.Dl=f|0,this.Eh=p|0,this.El=h|0,this.Fh=x|0,this.Fl=y|0,this.Gh=E|0,this.Gl=v|0,this.Hh=R|0,this.Hl=C|0}process(e,t){for(let U=0;U<16;U++,t+=4)Kn[U]=e.getUint32(t),Qn[U]=e.getUint32(t+=4);for(let U=16;U<80;U++){const K=Kn[U-15]|0,H=Qn[U-15]|0,j=xe.rotrSH(K,H,1)^xe.rotrSH(K,H,8)^xe.shrSH(K,H,7),F=xe.rotrSL(K,H,1)^xe.rotrSL(K,H,8)^xe.shrSL(K,H,7),z=Kn[U-2]|0,W=Qn[U-2]|0,ne=xe.rotrSH(z,W,19)^xe.rotrBH(z,W,61)^xe.shrSH(z,W,6),ie=xe.rotrSL(z,W,19)^xe.rotrBL(z,W,61)^xe.shrSL(z,W,6),de=xe.add4L(F,ie,Qn[U-7],Qn[U-16]),he=xe.add4H(de,j,ne,Kn[U-7],Kn[U-16]);Kn[U]=he|0,Qn[U]=de|0}let{Ah:n,Al:i,Bh:a,Bl:c,Ch:l,Cl:f,Dh:p,Dl:h,Eh:x,El:y,Fh:E,Fl:v,Gh:R,Gl:C,Hh:S,Hl:D}=this;for(let U=0;U<80;U++){const K=xe.rotrSH(x,y,14)^xe.rotrSH(x,y,18)^xe.rotrBH(x,y,41),H=xe.rotrSL(x,y,14)^xe.rotrSL(x,y,18)^xe.rotrBL(x,y,41),j=x&E^~x&R,F=y&v^~y&C,z=xe.add5L(D,H,F,f6[U],Qn[U]),W=xe.add5H(z,S,K,j,l6[U],Kn[U]),ne=z|0,ie=xe.rotrSH(n,i,28)^xe.rotrBH(n,i,34)^xe.rotrBH(n,i,39),de=xe.rotrSL(n,i,28)^xe.rotrBL(n,i,34)^xe.rotrBL(n,i,39),he=n&a^n&l^a&l,ye=i&c^i&f^c&f;S=R|0,D=C|0,R=E|0,C=v|0,E=x|0,v=y|0,{h:x,l:y}=xe.add(p|0,h|0,W|0,ne|0),p=l|0,h=f|0,l=a|0,f=c|0,a=n|0,c=i|0;const q=xe.add3L(ne,de,ye);n=xe.add3H(q,W,ie,he),i=q|0}({h:n,l:i}=xe.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:a,l:c}=xe.add(this.Bh|0,this.Bl|0,a|0,c|0),{h:l,l:f}=xe.add(this.Ch|0,this.Cl|0,l|0,f|0),{h:p,l:h}=xe.add(this.Dh|0,this.Dl|0,p|0,h|0),{h:x,l:y}=xe.add(this.Eh|0,this.El|0,x|0,y|0),{h:E,l:v}=xe.add(this.Fh|0,this.Fl|0,E|0,v|0),{h:R,l:C}=xe.add(this.Gh|0,this.Gl|0,R|0,C|0),{h:S,l:D}=xe.add(this.Hh|0,this.Hl|0,S|0,D|0),this.set(n,i,a,c,l,f,p,h,x,y,E,v,R,C,S,D)}roundClean(){Kn.fill(0),Qn.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const Vl=Ma(()=>new h6);function d6(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof B0<"u")return B0;throw new Error("unable to locate global object")}const Zh=d6(),ed=Zh.crypto||Zh.msCrypto;function p6(r){switch(r){case"sha256":return di.create();case"sha512":return Vl.create()}O(!1,"invalid hashing algorithm name","algorithm",r)}function x6(r,e){const t={sha256:di,sha512:Vl}[r];return O(t!=null,"invalid hmac algorithm","algorithm",r),Va.create(t,e)}function m6(r,e,t,n,i){const a={sha256:di,sha512:Vl}[i];return O(a!=null,"invalid pbkdf2 algorithm","algorithm",i),Ll(a,r,e,{c:t,dkLen:n})}function b6(r){G(ed!=null,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),O(Number.isInteger(r)&&r>0&&r<=1024,"invalid length","length",r);const e=new Uint8Array(r);return ed.getRandomValues(e),e}let Nx=!1;const Ix=function(r,e,t){return x6(r,e).update(t).digest()};let Px=Ix;function pi(r,e,t){const n=Y(e,"key"),i=Y(t,"data");return _(Px(r,n,i))}pi._=Ix;pi.lock=function(){Nx=!0};pi.register=function(r){if(Nx)throw new Error("computeHmac is locked");Px=r};Object.freeze(pi);const[kx,Dx,Fx]=[[],[],[]],g6=BigInt(0),Li=BigInt(1),y6=BigInt(2),w6=BigInt(7),A6=BigInt(256),E6=BigInt(113);for(let r=0,e=Li,t=1,n=0;r<24;r++){[t,n]=[n,(2*t+3*n)%5],kx.push(2*(5*n+t)),Dx.push((r+1)*(r+2)/2%64);let i=g6;for(let a=0;a<7;a++)e=(e<<Li^(e>>w6)*E6)%A6,e&y6&&(i^=Li<<(Li<<BigInt(a))-Li);Fx.push(i)}const[B6,R6]=Tx(Fx,!0),td=(r,e,t)=>t>32?Cx(r,e,t):vx(r,e,t),nd=(r,e,t)=>t>32?Sx(r,e,t):Ox(r,e,t);function T6(r,e=24){const t=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let c=0;c<10;c++)t[c]=r[c]^r[c+10]^r[c+20]^r[c+30]^r[c+40];for(let c=0;c<10;c+=2){const l=(c+8)%10,f=(c+2)%10,p=t[f],h=t[f+1],x=td(p,h,1)^t[l],y=nd(p,h,1)^t[l+1];for(let E=0;E<50;E+=10)r[c+E]^=x,r[c+E+1]^=y}let i=r[2],a=r[3];for(let c=0;c<24;c++){const l=Dx[c],f=td(i,a,l),p=nd(i,a,l),h=kx[c];i=r[h],a=r[h+1],r[h]=f,r[h+1]=p}for(let c=0;c<50;c+=10){for(let l=0;l<10;l++)t[l]=r[c+l];for(let l=0;l<10;l++)r[c+l]^=~t[(l+2)%10]&t[(l+4)%10]}r[0]^=B6[n],r[1]^=R6[n]}t.fill(0)}class Gl extends Ul{constructor(e,t,n,i=!1,a=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=i,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,kt(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=aa(this.state)}keccak(){T6(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){ni(this);const{blockLen:t,state:n}=this;e=ri(e);const i=e.length;for(let a=0;a<i;){const c=Math.min(t-this.pos,i-a);for(let l=0;l<c;l++)n[this.pos++]^=e[a++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:n,blockLen:i}=this;e[n]^=t,(t&128)!==0&&n===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){ni(this,!1),Fl(e),this.finish();const t=this.state,{blockLen:n}=this;for(let i=0,a=e.length;i<a;){this.posOut>=n&&this.keccak();const c=Math.min(n-this.posOut,a-i);e.set(t.subarray(this.posOut,this.posOut+c),i),this.posOut+=c,i+=c}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return kt(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(wx(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:n,outputLen:i,rounds:a,enableXOF:c}=this;return e||(e=new Gl(t,n,i,c,a)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=a,e.suffix=n,e.outputLen=i,e.enableXOF=c,e.destroyed=this.destroyed,e}}const v6=(r,e,t)=>Ma(()=>new Gl(e,r,t)),O6=v6(1,136,256/8);let Ux=!1;const Lx=function(r){return O6(r)};let Mx=Lx;function ze(r){const e=Y(r,"data");return _(Mx(e))}ze._=Lx;ze.lock=function(){Ux=!0};ze.register=function(r){if(Ux)throw new TypeError("keccak256 is locked");Mx=r};Object.freeze(ze);const C6=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Vx=Uint8Array.from({length:16},(r,e)=>e),S6=Vx.map(r=>(9*r+5)%16);let zl=[Vx],Hl=[S6];for(let r=0;r<4;r++)for(let e of[zl,Hl])e.push(e[r].map(t=>C6[t]));const Gx=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(r=>new Uint8Array(r)),N6=zl.map((r,e)=>r.map(t=>Gx[e][t])),I6=Hl.map((r,e)=>r.map(t=>Gx[e][t])),P6=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),k6=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),Qs=(r,e)=>r<<e|r>>>32-e;function rd(r,e,t,n){return r===0?e^t^n:r===1?e&t|~e&n:r===2?(e|~t)^n:r===3?e&n|t&~n:e^(t|~n)}const Js=new Uint32Array(16);class D6 extends Ml{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:t,h2:n,h3:i,h4:a}=this;return[e,t,n,i,a]}set(e,t,n,i,a){this.h0=e|0,this.h1=t|0,this.h2=n|0,this.h3=i|0,this.h4=a|0}process(e,t){for(let E=0;E<16;E++,t+=4)Js[E]=e.getUint32(t,!0);let n=this.h0|0,i=n,a=this.h1|0,c=a,l=this.h2|0,f=l,p=this.h3|0,h=p,x=this.h4|0,y=x;for(let E=0;E<5;E++){const v=4-E,R=P6[E],C=k6[E],S=zl[E],D=Hl[E],U=N6[E],K=I6[E];for(let H=0;H<16;H++){const j=Qs(n+rd(E,a,l,p)+Js[S[H]]+R,U[H])+x|0;n=x,x=p,p=Qs(l,10)|0,l=a,a=j}for(let H=0;H<16;H++){const j=Qs(i+rd(v,c,f,h)+Js[D[H]]+C,K[H])+y|0;i=y,y=h,h=Qs(f,10)|0,f=c,c=j}}this.set(this.h1+l+h|0,this.h2+p+y|0,this.h3+x+i|0,this.h4+n+c|0,this.h0+a+f|0)}roundClean(){Js.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const F6=Ma(()=>new D6);let zx=!1;const Hx=function(r){return F6(r)};let $x=Hx;function xi(r){const e=Y(r,"data");return _($x(e))}xi._=Hx;xi.lock=function(){zx=!0};xi.register=function(r){if(zx)throw new TypeError("ripemd160 is locked");$x=r};Object.freeze(xi);let _x=!1;const jx=function(r,e,t,n,i){return m6(r,e,t,n,i)};let qx=jx;function rr(r,e,t,n,i){const a=Y(r,"password"),c=Y(e,"salt");return _(qx(a,c,t,n,i))}rr._=jx;rr.lock=function(){_x=!0};rr.register=function(r){if(_x)throw new Error("pbkdf2 is locked");qx=r};Object.freeze(rr);let Kx=!1;const Qx=function(r){return new Uint8Array(b6(r))};let Jx=Qx;function In(r){return Jx(r)}In._=Qx;In.lock=function(){Kx=!0};In.register=function(r){if(Kx)throw new Error("randomBytes is locked");Jx=r};Object.freeze(In);const ve=(r,e)=>r<<e|r>>>32-e;function id(r,e,t,n,i,a){let c=r[e++]^t[n++],l=r[e++]^t[n++],f=r[e++]^t[n++],p=r[e++]^t[n++],h=r[e++]^t[n++],x=r[e++]^t[n++],y=r[e++]^t[n++],E=r[e++]^t[n++],v=r[e++]^t[n++],R=r[e++]^t[n++],C=r[e++]^t[n++],S=r[e++]^t[n++],D=r[e++]^t[n++],U=r[e++]^t[n++],K=r[e++]^t[n++],H=r[e++]^t[n++],j=c,F=l,z=f,W=p,ne=h,ie=x,de=y,he=E,ye=v,q=R,Q=C,ae=S,ce=D,le=U,Re=K,P=H;for(let X=0;X<8;X+=2)ne^=ve(j+ce|0,7),ye^=ve(ne+j|0,9),ce^=ve(ye+ne|0,13),j^=ve(ce+ye|0,18),q^=ve(ie+F|0,7),le^=ve(q+ie|0,9),F^=ve(le+q|0,13),ie^=ve(F+le|0,18),Re^=ve(Q+de|0,7),z^=ve(Re+Q|0,9),de^=ve(z+Re|0,13),Q^=ve(de+z|0,18),W^=ve(P+ae|0,7),he^=ve(W+P|0,9),ae^=ve(he+W|0,13),P^=ve(ae+he|0,18),F^=ve(j+W|0,7),z^=ve(F+j|0,9),W^=ve(z+F|0,13),j^=ve(W+z|0,18),de^=ve(ie+ne|0,7),he^=ve(de+ie|0,9),ne^=ve(he+de|0,13),ie^=ve(ne+he|0,18),ae^=ve(Q+q|0,7),ye^=ve(ae+Q|0,9),q^=ve(ye+ae|0,13),Q^=ve(q+ye|0,18),ce^=ve(P+Re|0,7),le^=ve(ce+P|0,9),Re^=ve(le+ce|0,13),P^=ve(Re+le|0,18);i[a++]=c+j|0,i[a++]=l+F|0,i[a++]=f+z|0,i[a++]=p+W|0,i[a++]=h+ne|0,i[a++]=x+ie|0,i[a++]=y+de|0,i[a++]=E+he|0,i[a++]=v+ye|0,i[a++]=R+q|0,i[a++]=C+Q|0,i[a++]=S+ae|0,i[a++]=D+ce|0,i[a++]=U+le|0,i[a++]=K+Re|0,i[a++]=H+P|0}function Yr(r,e,t,n,i){let a=n+0,c=n+16*i;for(let l=0;l<16;l++)t[c+l]=r[e+(2*i-1)*16+l];for(let l=0;l<i;l++,a+=16,e+=16)id(t,c,r,e,t,a),l>0&&(c+=16),id(t,a,r,e+=16,t,c)}function Wx(r,e,t){const n=Ex({dkLen:32,asyncTick:10,maxmem:1073742848},t),{N:i,r:a,p:c,dkLen:l,asyncTick:f,maxmem:p,onProgress:h}=n;if(kt(i),kt(a),kt(c),kt(l),kt(f),kt(p),h!==void 0&&typeof h!="function")throw new Error("progressCb should be function");const x=128*a,y=x/4;if(i<=1||(i&i-1)!==0||i>=2**(x/8)||i>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(c<0||c>(2**32-1)*32/x)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(l<0||l>(2**32-1)*32)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const E=x*(i+c);if(E>p)throw new Error(`Scrypt: parameters too large, ${E} (128 * r * (N + p)) > ${p} (maxmem)`);const v=Ll(di,r,e,{c:1,dkLen:x*c}),R=aa(v),C=aa(new Uint8Array(x*i)),S=aa(new Uint8Array(x));let D=()=>{};if(h){const U=2*i*c,K=Math.max(Math.floor(U/1e4),1);let H=0;D=()=>{H++,h&&(!(H%K)||H===U)&&h(H/U)}}return{N:i,r:a,p:c,dkLen:l,blockSize32:y,V:C,B32:R,B:v,tmp:S,blockMixCb:D,asyncTick:f}}function Yx(r,e,t,n,i){const a=Ll(di,r,t,{c:1,dkLen:e});return t.fill(0),n.fill(0),i.fill(0),a}function U6(r,e,t){const{N:n,r:i,p:a,dkLen:c,blockSize32:l,V:f,B32:p,B:h,tmp:x,blockMixCb:y}=Wx(r,e,t);for(let E=0;E<a;E++){const v=l*E;for(let R=0;R<l;R++)f[R]=p[v+R];for(let R=0,C=0;R<n-1;R++)Yr(f,C,f,C+=l,i),y();Yr(f,(n-1)*l,p,v,i),y();for(let R=0;R<n;R++){const C=p[v+l-16]%n;for(let S=0;S<l;S++)x[S]=p[v+S]^f[C*l+S];Yr(x,0,p,v,i),y()}}return Yx(r,c,h,f,x)}async function L6(r,e,t){const{N:n,r:i,p:a,dkLen:c,blockSize32:l,V:f,B32:p,B:h,tmp:x,blockMixCb:y,asyncTick:E}=Wx(r,e,t);for(let v=0;v<a;v++){const R=l*v;for(let S=0;S<l;S++)f[S]=p[R+S];let C=0;await Xh(n-1,E,()=>{Yr(f,C,f,C+=l,i),y()}),Yr(f,(n-1)*l,p,R,i),y(),await Xh(n,E,()=>{const S=p[R+l-16]%n;for(let D=0;D<l;D++)x[D]=p[R+D]^f[S*l+D];Yr(x,0,p,R,i),y()})}return Yx(r,c,h,f,x)}let Xx=!1,Zx=!1;const em=async function(r,e,t,n,i,a,c){return await L6(r,e,{N:t,r:n,p:i,dkLen:a,onProgress:c})},tm=function(r,e,t,n,i,a){return U6(r,e,{N:t,r:n,p:i,dkLen:a})};let nm=em,rm=tm;async function mi(r,e,t,n,i,a,c){const l=Y(r,"passwd"),f=Y(e,"salt");return _(await nm(l,f,t,n,i,a,c))}mi._=em;mi.lock=function(){Zx=!0};mi.register=function(r){if(Zx)throw new Error("scrypt is locked");nm=r};Object.freeze(mi);function bi(r,e,t,n,i,a){const c=Y(r,"passwd"),l=Y(e,"salt");return _(rm(c,l,t,n,i,a))}bi._=tm;bi.lock=function(){Xx=!0};bi.register=function(r){if(Xx)throw new Error("scryptSync is locked");rm=r};Object.freeze(bi);const im=function(r){return p6("sha256").update(r).digest()};let sm=im,am=!1;function Kt(r){const e=Y(r,"data");return _(sm(e))}Kt._=im;Kt.lock=function(){am=!0};Kt.register=function(r){if(am)throw new Error("sha256 is locked");sm=r};Object.freeze(Kt);Object.freeze(Kt);BigInt(0);const M6=BigInt(1),V6=BigInt(2),Ga=r=>r instanceof Uint8Array,G6=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function ii(r){if(!Ga(r))throw new Error("Uint8Array expected");let e="";for(let t=0;t<r.length;t++)e+=G6[r[t]];return e}function $l(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);return BigInt(r===""?"0":`0x${r}`)}function ts(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);const e=r.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const t=new Uint8Array(e/2);for(let n=0;n<t.length;n++){const i=n*2,a=r.slice(i,i+2),c=Number.parseInt(a,16);if(Number.isNaN(c)||c<0)throw new Error("Invalid byte sequence");t[n]=c}return t}function Br(r){return $l(ii(r))}function _l(r){if(!Ga(r))throw new Error("Uint8Array expected");return $l(ii(Uint8Array.from(r).reverse()))}function si(r,e){return ts(r.toString(16).padStart(e*2,"0"))}function jl(r,e){return si(r,e).reverse()}function rn(r,e,t){let n;if(typeof e=="string")try{n=ts(e)}catch(a){throw new Error(`${r} must be valid hex string, got "${e}". Cause: ${a}`)}else if(Ga(e))n=Uint8Array.from(e);else throw new Error(`${r} must be hex string or Uint8Array`);const i=n.length;if(typeof t=="number"&&i!==t)throw new Error(`${r} expected ${t} bytes, got ${i}`);return n}function ns(...r){const e=new Uint8Array(r.reduce((n,i)=>n+i.length,0));let t=0;return r.forEach(n=>{if(!Ga(n))throw new Error("Uint8Array expected");e.set(n,t),t+=n.length}),e}const ql=r=>(V6<<BigInt(r-1))-M6,Au=r=>new Uint8Array(r),sd=r=>Uint8Array.from(r);function om(r,e,t){if(typeof r!="number"||r<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 t!="function")throw new Error("hmacFn must be a function");let n=Au(r),i=Au(r),a=0;const c=()=>{n.fill(1),i.fill(0),a=0},l=(...x)=>t(i,n,...x),f=(x=Au())=>{i=l(sd([0]),x),n=l(),x.length!==0&&(i=l(sd([1]),x),n=l())},p=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let x=0;const y=[];for(;x<e;){n=l();const E=n.slice();y.push(E),x+=n.length}return ns(...y)};return(x,y)=>{c(),f(x);let E;for(;!(E=y(p()));)f();return c(),E}}const z6={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",stringOrUint8Array:r=>typeof r=="string"||r instanceof Uint8Array,isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,e)=>e.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)};function gs(r,e,t={}){const n=(i,a,c)=>{const l=z6[a];if(typeof l!="function")throw new Error(`Invalid validator "${a}", expected function`);const f=r[i];if(!(c&&f===void 0)&&!l(f,r))throw new Error(`Invalid param ${String(i)}=${f} (${typeof f}), expected ${a}`)};for(const[i,a]of Object.entries(e))n(i,a,!1);for(const[i,a]of Object.entries(t))n(i,a,!0);return r}const H6=Object.freeze(Object.defineProperty({__proto__:null,bitMask:ql,bytesToHex:ii,bytesToNumberBE:Br,bytesToNumberLE:_l,concatBytes:ns,createHmacDrbg:om,ensureBytes:rn,hexToBytes:ts,hexToNumber:$l,numberToBytesBE:si,numberToBytesLE:jl,validateObject:gs},Symbol.toStringTag,{value:"Module"}));const st=BigInt(0),We=BigInt(1),mr=BigInt(2),$6=BigInt(3),Zu=BigInt(4),ad=BigInt(5),od=BigInt(8);BigInt(9);BigInt(16);function vt(r,e){const t=r%e;return t>=st?t:e+t}function _6(r,e,t){if(t<=st||e<st)throw new Error("Expected power/modulo > 0");if(t===We)return st;let n=We;for(;e>st;)e&We&&(n=n*r%t),r=r*r%t,e>>=We;return n}function Lt(r,e,t){let n=r;for(;e-- >st;)n*=n,n%=t;return n}function el(r,e){if(r===st||e<=st)throw new Error(`invert: expected positive integers, got n=${r} mod=${e}`);let t=vt(r,e),n=e,i=st,a=We;for(;t!==st;){const l=n/t,f=n%t,p=i-a*l;n=t,t=f,i=a,a=p}if(n!==We)throw new Error("invert: does not exist");return vt(i,e)}function j6(r){const e=(r-We)/mr;let t,n,i;for(t=r-We,n=0;t%mr===st;t/=mr,n++);for(i=mr;i<r&&_6(i,e,r)!==r-We;i++);if(n===1){const c=(r+We)/Zu;return function(f,p){const h=f.pow(p,c);if(!f.eql(f.sqr(h),p))throw new Error("Cannot find square root");return h}}const a=(t+We)/mr;return function(l,f){if(l.pow(f,e)===l.neg(l.ONE))throw new Error("Cannot find square root");let p=n,h=l.pow(l.mul(l.ONE,i),t),x=l.pow(f,a),y=l.pow(f,t);for(;!l.eql(y,l.ONE);){if(l.eql(y,l.ZERO))return l.ZERO;let E=1;for(let R=l.sqr(y);E<p&&!l.eql(R,l.ONE);E++)R=l.sqr(R);const v=l.pow(h,We<<BigInt(p-E-1));h=l.sqr(v),x=l.mul(x,v),y=l.mul(y,h),p=E}return x}}function q6(r){if(r%Zu===$6){const e=(r+We)/Zu;return function(n,i){const a=n.pow(i,e);if(!n.eql(n.sqr(a),i))throw new Error("Cannot find square root");return a}}if(r%od===ad){const e=(r-ad)/od;return function(n,i){const a=n.mul(i,mr),c=n.pow(a,e),l=n.mul(i,c),f=n.mul(n.mul(l,mr),c),p=n.mul(l,n.sub(f,n.ONE));if(!n.eql(n.sqr(p),i))throw new Error("Cannot find square root");return p}}return j6(r)}const K6=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Q6(r){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=K6.reduce((n,i)=>(n[i]="function",n),e);return gs(r,t)}function J6(r,e,t){if(t<st)throw new Error("Expected power > 0");if(t===st)return r.ONE;if(t===We)return e;let n=r.ONE,i=e;for(;t>st;)t&We&&(n=r.mul(n,i)),i=r.sqr(i),t>>=We;return n}function W6(r,e){const t=new Array(e.length),n=e.reduce((a,c,l)=>r.is0(c)?a:(t[l]=a,r.mul(a,c)),r.ONE),i=r.inv(n);return e.reduceRight((a,c,l)=>r.is0(c)?a:(t[l]=r.mul(a,t[l]),r.mul(a,c)),i),t}function cm(r,e){const t=e!==void 0?e:r.toString(2).length,n=Math.ceil(t/8);return{nBitLength:t,nByteLength:n}}function Y6(r,e,t=!1,n={}){if(r<=st)throw new Error(`Expected Field ORDER > 0, got ${r}`);const{nBitLength:i,nByteLength:a}=cm(r,e);if(a>2048)throw new Error("Field lengths over 2048 bytes are not supported");const c=q6(r),l=Object.freeze({ORDER:r,BITS:i,BYTES:a,MASK:ql(i),ZERO:st,ONE:We,create:f=>vt(f,r),isValid:f=>{if(typeof f!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof f}`);return st<=f&&f<r},is0:f=>f===st,isOdd:f=>(f&We)===We,neg:f=>vt(-f,r),eql:(f,p)=>f===p,sqr:f=>vt(f*f,r),add:(f,p)=>vt(f+p,r),sub:(f,p)=>vt(f-p,r),mul:(f,p)=>vt(f*p,r),pow:(f,p)=>J6(l,f,p),div:(f,p)=>vt(f*el(p,r),r),sqrN:f=>f*f,addN:(f,p)=>f+p,subN:(f,p)=>f-p,mulN:(f,p)=>f*p,inv:f=>el(f,r),sqrt:n.sqrt||(f=>c(l,f)),invertBatch:f=>W6(l,f),cmov:(f,p,h)=>h?p:f,toBytes:f=>t?jl(f,a):si(f,a),fromBytes:f=>{if(f.length!==a)throw new Error(`Fp.fromBytes: expected ${a}, got ${f.length}`);return t?_l(f):Br(f)}});return Object.freeze(l)}function um(r){if(typeof r!="bigint")throw new Error("field order must be bigint");const e=r.toString(2).length;return Math.ceil(e/8)}function lm(r){const e=um(r);return e+Math.ceil(e/2)}function X6(r,e,t=!1){const n=r.length,i=um(e),a=lm(e);if(n<16||n<a||n>1024)throw new Error(`expected ${a}-1024 bytes of input, got ${n}`);const c=t?Br(r):_l(r),l=vt(c,e-We)+We;return t?jl(l,i):si(l,i)}const Z6=BigInt(0),Eu=BigInt(1);function e5(r,e){const t=(i,a)=>{const c=a.negate();return i?c:a},n=i=>{const a=Math.ceil(e/i)+1,c=2**(i-1);return{windows:a,windowSize:c}};return{constTimeNegate:t,unsafeLadder(i,a){let c=r.ZERO,l=i;for(;a>Z6;)a&Eu&&(c=c.add(l)),l=l.double(),a>>=Eu;return c},precomputeWindow(i,a){const{windows:c,windowSize:l}=n(a),f=[];let p=i,h=p;for(let x=0;x<c;x++){h=p,f.push(h);for(let y=1;y<l;y++)h=h.add(p),f.push(h);p=h.double()}return f},wNAF(i,a,c){const{windows:l,windowSize:f}=n(i);let p=r.ZERO,h=r.BASE;const x=BigInt(2**i-1),y=2**i,E=BigInt(i);for(let v=0;v<l;v++){const R=v*f;let C=Number(c&x);c>>=E,C>f&&(C-=y,c+=Eu);const S=R,D=R+Math.abs(C)-1,U=v%2!==0,K=C<0;C===0?h=h.add(t(U,a[S])):p=p.add(t(K,a[D]))}return{p,f:h}},wNAFCached(i,a,c,l){const f=i._WINDOW_SIZE||1;let p=a.get(i);return p||(p=this.precomputeWindow(i,f),f!==1&&a.set(i,l(p))),this.wNAF(f,p,c)}}}function fm(r){return Q6(r.Fp),gs(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...cm(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}function t5(r){const e=fm(r);gs(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:t,Fp:n,a:i}=e;if(t){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:n5,hexToBytes:r5}=H6,gr={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(r){const{Err:e}=gr;if(r.length<2||r[0]!==2)throw new e("Invalid signature integer tag");const t=r[1],n=r.subarray(2,t+2);if(!t||n.length!==t)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:n5(n),l:r.subarray(t+2)}},toSig(r){const{Err:e}=gr,t=typeof r=="string"?r5(r):r;if(!(t instanceof Uint8Array))throw new Error("ui8a expected");let n=t.length;if(n<2||t[0]!=48)throw new e("Invalid signature tag");if(t[1]!==n-2)throw new e("Invalid signature: incorrect length");const{d:i,l:a}=gr._parseInt(t.subarray(2)),{d:c,l}=gr._parseInt(a);if(l.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:c}},hexFromSig(r){const e=p=>Number.parseInt(p[0],16)&8?"00"+p:p,t=p=>{const h=p.toString(16);return h.length&1?`0${h}`:h},n=e(t(r.s)),i=e(t(r.r)),a=n.length/2,c=i.length/2,l=t(a),f=t(c);return`30${t(c+a+4)}02${f}${i}02${l}${n}`}},Cn=BigInt(0),$t=BigInt(1);BigInt(2);const cd=BigInt(3);BigInt(4);function i5(r){const e=t5(r),{Fp:t}=e,n=e.toBytes||((v,R,C)=>{const S=R.toAffine();return ns(Uint8Array.from([4]),t.toBytes(S.x),t.toBytes(S.y))}),i=e.fromBytes||(v=>{const R=v.subarray(1),C=t.fromBytes(R.subarray(0,t.BYTES)),S=t.fromBytes(R.subarray(t.BYTES,2*t.BYTES));return{x:C,y:S}});function a(v){const{a:R,b:C}=e,S=t.sqr(v),D=t.mul(S,v);return t.add(t.add(D,t.mul(v,R)),C)}if(!t.eql(t.sqr(e.Gy),a(e.Gx)))throw new Error("bad generator point: equation left != right");function c(v){return typeof v=="bigint"&&Cn<v&&v<e.n}function l(v){if(!c(v))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function f(v){const{allowedPrivateKeyLengths:R,nByteLength:C,wrapPrivateKey:S,n:D}=e;if(R&&typeof v!="bigint"){if(v instanceof Uint8Array&&(v=ii(v)),typeof v!="string"||!R.includes(v.length))throw new Error("Invalid key");v=v.padStart(C*2,"0")}let U;try{U=typeof v=="bigint"?v:Br(rn("private key",v,C))}catch{throw new Error(`private key must be ${C} bytes, hex or bigint, not ${typeof v}`)}return S&&(U=vt(U,D)),l(U),U}const p=new Map;function h(v){if(!(v instanceof x))throw new Error("ProjectivePoint expected")}class x{constructor(R,C,S){if(this.px=R,this.py=C,this.pz=S,R==null||!t.isValid(R))throw new Error("x required");if(C==null||!t.isValid(C))throw new Error("y required");if(S==null||!t.isValid(S))throw new Error("z required")}static fromAffine(R){const{x:C,y:S}=R||{};if(!R||!t.isValid(C)||!t.isValid(S))throw new Error("invalid affine point");if(R instanceof x)throw new Error("projective point not allowed");const D=U=>t.eql(U,t.ZERO);return D(C)&&D(S)?x.ZERO:new x(C,S,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(R){const C=t.invertBatch(R.map(S=>S.pz));return R.map((S,D)=>S.toAffine(C[D])).map(x.fromAffine)}static fromHex(R){const C=x.fromAffine(i(rn("pointHex",R)));return C.assertValidity(),C}static fromPrivateKey(R){return x.BASE.multiply(f(R))}_setWindowSize(R){this._WINDOW_SIZE=R,p.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:R,y:C}=this.toAffine();if(!t.isValid(R)||!t.isValid(C))throw new Error("bad point: x or y not FE");const S=t.sqr(C),D=a(R);if(!t.eql(S,D))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:R}=this.toAffine();if(t.isOdd)return!t.isOdd(R);throw new Error("Field doesn't support isOdd")}equals(R){h(R);const{px:C,py:S,pz:D}=this,{px:U,py:K,pz:H}=R,j=t.eql(t.mul(C,H),t.mul(U,D)),F=t.eql(t.mul(S,H),t.mul(K,D));return j&&F}negate(){return new x(this.px,t.neg(this.py),this.pz)}double(){const{a:R,b:C}=e,S=t.mul(C,cd),{px:D,py:U,pz:K}=this;let H=t.ZERO,j=t.ZERO,F=t.ZERO,z=t.mul(D,D),W=t.mul(U,U),ne=t.mul(K,K),ie=t.mul(D,U);return ie=t.add(ie,ie),F=t.mul(D,K),F=t.add(F,F),H=t.mul(R,F),j=t.mul(S,ne),j=t.add(H,j),H=t.sub(W,j),j=t.add(W,j),j=t.mul(H,j),H=t.mul(ie,H),F=t.mul(S,F),ne=t.mul(R,ne),ie=t.sub(z,ne),ie=t.mul(R,ie),ie=t.add(ie,F),F=t.add(z,z),z=t.add(F,z),z=t.add(z,ne),z=t.mul(z,ie),j=t.add(j,z),ne=t.mul(U,K),ne=t.add(ne,ne),z=t.mul(ne,ie),H=t.sub(H,z),F=t.mul(ne,W),F=t.add(F,F),F=t.add(F,F),new x(H,j,F)}add(R){h(R);const{px:C,py:S,pz:D}=this,{px:U,py:K,pz:H}=R;let j=t.ZERO,F=t.ZERO,z=t.ZERO;const W=e.a,ne=t.mul(e.b,cd);let ie=t.mul(C,U),de=t.mul(S,K),he=t.mul(D,H),ye=t.add(C,S),q=t.add(U,K);ye=t.mul(ye,q),q=t.add(ie,de),ye=t.sub(ye,q),q=t.add(C,D);let Q=t.add(U,H);return q=t.mul(q,Q),Q=t.add(ie,he),q=t.sub(q,Q),Q=t.add(S,D),j=t.add(K,H),Q=t.mul(Q,j),j=t.add(de,he),Q=t.sub(Q,j),z=t.mul(W,q),j=t.mul(ne,he),z=t.add(j,z),j=t.sub(de,z),z=t.add(de,z),F=t.mul(j,z),de=t.add(ie,ie),de=t.add(de,ie),he=t.mul(W,he),q=t.mul(ne,q),de=t.add(de,he),he=t.sub(ie,he),he=t.mul(W,he),q=t.add(q,he),ie=t.mul(de,q),F=t.add(F,ie),ie=t.mul(Q,q),j=t.mul(ye,j),j=t.sub(j,ie),ie=t.mul(ye,de),z=t.mul(Q,z),z=t.add(z,ie),new x(j,F,z)}subtract(R){return this.add(R.negate())}is0(){return this.equals(x.ZERO)}wNAF(R){return E.wNAFCached(this,p,R,C=>{const S=t.invertBatch(C.map(D=>D.pz));return C.map((D,U)=>D.toAffine(S[U])).map(x.fromAffine)})}multiplyUnsafe(R){const C=x.ZERO;if(R===Cn)return C;if(l(R),R===$t)return this;const{endo:S}=e;if(!S)return E.unsafeLadder(this,R);let{k1neg:D,k1:U,k2neg:K,k2:H}=S.splitScalar(R),j=C,F=C,z=this;for(;U>Cn||H>Cn;)U&$t&&(j=j.add(z)),H&$t&&(F=F.add(z)),z=z.double(),U>>=$t,H>>=$t;return D&&(j=j.negate()),K&&(F=F.negate()),F=new x(t.mul(F.px,S.beta),F.py,F.pz),j.add(F)}multiply(R){l(R);let C=R,S,D;const{endo:U}=e;if(U){const{k1neg:K,k1:H,k2neg:j,k2:F}=U.splitScalar(C);let{p:z,f:W}=this.wNAF(H),{p:ne,f:ie}=this.wNAF(F);z=E.constTimeNegate(K,z),ne=E.constTimeNegate(j,ne),ne=new x(t.mul(ne.px,U.beta),ne.py,ne.pz),S=z.add(ne),D=W.add(ie)}else{const{p:K,f:H}=this.wNAF(C);S=K,D=H}return x.normalizeZ([S,D])[0]}multiplyAndAddUnsafe(R,C,S){const D=x.BASE,U=(H,j)=>j===Cn||j===$t||!H.equals(D)?H.multiplyUnsafe(j):H.multiply(j),K=U(this,C).add(U(R,S));return K.is0()?void 0:K}toAffine(R){const{px:C,py:S,pz:D}=this,U=this.is0();R==null&&(R=U?t.ONE:t.inv(D));const K=t.mul(C,R),H=t.mul(S,R),j=t.mul(D,R);if(U)return{x:t.ZERO,y:t.ZERO};if(!t.eql(j,t.ONE))throw new Error("invZ was invalid");return{x:K,y:H}}isTorsionFree(){const{h:R,isTorsionFree:C}=e;if(R===$t)return!0;if(C)return C(x,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:R,clearCofactor:C}=e;return R===$t?this:C?C(x,this):this.multiplyUnsafe(e.h)}toRawBytes(R=!0){return this.assertValidity(),n(x,this,R)}toHex(R=!0){return ii(this.toRawBytes(R))}}x.BASE=new x(e.Gx,e.Gy,t.ONE),x.ZERO=new x(t.ZERO,t.ONE,t.ZERO);const y=e.nBitLength,E=e5(x,e.endo?Math.ceil(y/2):y);return{CURVE:e,ProjectivePoint:x,normPrivateKeyToScalar:f,weierstrassEquation:a,isWithinCurveOrder:c}}function s5(r){const e=fm(r);return gs(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function a5(r){const e=s5(r),{Fp:t,n}=e,i=t.BYTES+1,a=2*t.BYTES+1;function c(q){return Cn<q&&q<t.ORDER}function l(q){return vt(q,n)}function f(q){return el(q,n)}const{ProjectivePoint:p,normPrivateKeyToScalar:h,weierstrassEquation:x,isWithinCurveOrder:y}=i5({...e,toBytes(q,Q,ae){const ce=Q.toAffine(),le=t.toBytes(ce.x),Re=ns;return ae?Re(Uint8Array.from([Q.hasEvenY()?2:3]),le):Re(Uint8Array.from([4]),le,t.toBytes(ce.y))},fromBytes(q){const Q=q.length,ae=q[0],ce=q.subarray(1);if(Q===i&&(ae===2||ae===3)){const le=Br(ce);if(!c(le))throw new Error("Point is not on curve");const Re=x(le);let P=t.sqrt(Re);const X=(P&$t)===$t;return(ae&1)===1!==X&&(P=t.neg(P)),{x:le,y:P}}else if(Q===a&&ae===4){const le=t.fromBytes(ce.subarray(0,t.BYTES)),Re=t.fromBytes(ce.subarray(t.BYTES,2*t.BYTES));return{x:le,y:Re}}else throw new Error(`Point of length ${Q} was invalid. Expected ${i} compressed bytes or ${a} uncompressed bytes`)}}),E=q=>ii(si(q,e.nByteLength));function v(q){const Q=n>>$t;return q>Q}function R(q){return v(q)?l(-q):q}const C=(q,Q,ae)=>Br(q.slice(Q,ae));class S{constructor(Q,ae,ce){this.r=Q,this.s=ae,this.recovery=ce,this.assertValidity()}static fromCompact(Q){const ae=e.nByteLength;return Q=rn("compactSignature",Q,ae*2),new S(C(Q,0,ae),C(Q,ae,2*ae))}static fromDER(Q){const{r:ae,s:ce}=gr.toSig(rn("DER",Q));return new S(ae,ce)}assertValidity(){if(!y(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!y(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(Q){return new S(this.r,this.s,Q)}recoverPublicKey(Q){const{r:ae,s:ce,recovery:le}=this,Re=F(rn("msgHash",Q));if(le==null||![0,1,2,3].includes(le))throw new Error("recovery id invalid");const P=le===2||le===3?ae+e.n:ae;if(P>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");const X=(le&1)===0?"02":"03",oe=p.fromHex(X+E(P)),ue=f(P),fe=l(-Re*ue),ke=l(ce*ue),Ye=p.BASE.multiplyAndAddUnsafe(oe,fe,ke);if(!Ye)throw new Error("point at infinify");return Ye.assertValidity(),Ye}hasHighS(){return v(this.s)}normalizeS(){return this.hasHighS()?new S(this.r,l(-this.s),this.recovery):this}toDERRawBytes(){return ts(this.toDERHex())}toDERHex(){return gr.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return ts(this.toCompactHex())}toCompactHex(){return E(this.r)+E(this.s)}}const D={isValidPrivateKey(q){try{return h(q),!0}catch{return!1}},normPrivateKeyToScalar:h,randomPrivateKey:()=>{const q=lm(e.n);return X6(e.randomBytes(q),e.n)},precompute(q=8,Q=p.BASE){return Q._setWindowSize(q),Q.multiply(BigInt(3)),Q}};function U(q,Q=!0){return p.fromPrivateKey(q).toRawBytes(Q)}function K(q){const Q=q instanceof Uint8Array,ae=typeof q=="string",ce=(Q||ae)&&q.length;return Q?ce===i||ce===a:ae?ce===2*i||ce===2*a:q instanceof p}function H(q,Q,ae=!0){if(K(q))throw new Error("first arg must be private key");if(!K(Q))throw new Error("second arg must be public key");return p.fromHex(Q).multiply(h(q)).toRawBytes(ae)}const j=e.bits2int||function(q){const Q=Br(q),ae=q.length*8-e.nBitLength;return ae>0?Q>>BigInt(ae):Q},F=e.bits2int_modN||function(q){return l(j(q))},z=ql(e.nBitLength);function W(q){if(typeof q!="bigint")throw new Error("bigint expected");if(!(Cn<=q&&q<z))throw new Error(`bigint expected < 2^${e.nBitLength}`);return si(q,e.nByteLength)}function ne(q,Q,ae=ie){if(["recovered","canonical"].some(Ft=>Ft in ae))throw new Error("sign() legacy options not supported");const{hash:ce,randomBytes:le}=e;let{lowS:Re,prehash:P,extraEntropy:X}=ae;Re==null&&(Re=!0),q=rn("msgHash",q),P&&(q=rn("prehashed msgHash",ce(q)));const oe=F(q),ue=h(Q),fe=[W(ue),W(oe)];if(X!=null){const Ft=X===!0?le(t.BYTES):X;fe.push(rn("extraEntropy",Ft))}const ke=ns(...fe),Ye=oe;function Jt(Ft){const Wt=j(Ft);if(!y(Wt))return;const Yt=f(Wt),ht=p.BASE.multiply(Wt).toAffine(),Xt=l(ht.x);if(Xt===Cn)return;const Zt=l(Yt*l(Ye+Xt*ue));if(Zt===Cn)return;let sr=(ht.x===Xt?0:2)|Number(ht.y&$t),en=Zt;return Re&&v(Zt)&&(en=R(Zt),sr^=1),new S(Xt,en,sr)}return{seed:ke,k2sig:Jt}}const ie={lowS:e.lowS,prehash:!1},de={lowS:e.lowS,prehash:!1};function he(q,Q,ae=ie){const{seed:ce,k2sig:le}=ne(q,Q,ae),Re=e;return om(Re.hash.outputLen,Re.nByteLength,Re.hmac)(ce,le)}p.BASE._setWindowSize(8);function ye(q,Q,ae,ce=de){const le=q;if(Q=rn("msgHash",Q),ae=rn("publicKey",ae),"strict"in ce)throw new Error("options.strict was renamed to lowS");const{lowS:Re,prehash:P}=ce;let X,oe;try{if(typeof le=="string"||le instanceof Uint8Array)try{X=S.fromDER(le)}catch(ht){if(!(ht instanceof gr.Err))throw ht;X=S.fromCompact(le)}else if(typeof le=="object"&&typeof le.r=="bigint"&&typeof le.s=="bigint"){const{r:ht,s:Xt}=le;X=new S(ht,Xt)}else throw new Error("PARSE");oe=p.fromHex(ae)}catch(ht){if(ht.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(Re&&X.hasHighS())return!1;P&&(Q=e.hash(Q));const{r:ue,s:fe}=X,ke=F(Q),Ye=f(fe),Jt=l(ke*Ye),Ft=l(ue*Ye),Wt=p.BASE.multiplyAndAddUnsafe(oe,Jt,Ft)?.toAffine();return Wt?l(Wt.x)===ue:!1}return{CURVE:e,getPublicKey:U,getSharedSecret:H,sign:he,verify:ye,ProjectivePoint:p,Signature:S,utils:D}}function o5(r){return{hash:r,hmac:(e,...t)=>Va(r,e,MA(...t)),randomBytes:GA}}function c5(r,e){const t=n=>a5({...r,...o5(n)});return Object.freeze({...t(e),create:t})}const hm=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),ud=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),u5=BigInt(1),tl=BigInt(2),ld=(r,e)=>(r+e/tl)/e;function l5(r){const e=hm,t=BigInt(3),n=BigInt(6),i=BigInt(11),a=BigInt(22),c=BigInt(23),l=BigInt(44),f=BigInt(88),p=r*r*r%e,h=p*p*r%e,x=Lt(h,t,e)*h%e,y=Lt(x,t,e)*h%e,E=Lt(y,tl,e)*p%e,v=Lt(E,i,e)*E%e,R=Lt(v,a,e)*v%e,C=Lt(R,l,e)*R%e,S=Lt(C,f,e)*C%e,D=Lt(S,l,e)*R%e,U=Lt(D,t,e)*h%e,K=Lt(U,c,e)*v%e,H=Lt(K,n,e)*p%e,j=Lt(H,tl,e);if(!nl.eql(nl.sqr(j),r))throw new Error("Cannot find square root");return j}const nl=Y6(hm,void 0,void 0,{sqrt:l5}),Jn=c5({a:BigInt(0),b:BigInt(7),Fp:nl,n:ud,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:r=>{const e=ud,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-u5*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=t,c=BigInt("0x100000000000000000000000000000000"),l=ld(a*r,e),f=ld(-n*r,e);let p=vt(r-l*t-f*i,e),h=vt(-l*n-f*a,e);const x=p>c,y=h>c;if(x&&(p=e-p),y&&(h=e-h),p>c||h>c)throw new Error("splitScalar: Endomorphism failed, k="+r);return{k1neg:x,k1:p,k2neg:y,k2:h}}}},di);BigInt(0);Jn.ProjectivePoint;const rs="0x0000000000000000000000000000000000000000",fd="0x0000000000000000000000000000000000000000000000000000000000000000",f5=`Ethereum Signed Message:
|
|
14
|
-
`,hd=BigInt(0),dd=BigInt(1),rl=BigInt(2),pd=BigInt(27),xd=BigInt(28),Ws=BigInt(35),dm=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h5=dm/rl,d5=Symbol.for("nodejs.util.inspect.custom"),fr={};function Bu(r){return kn(je(r),32)}class $e{#e;#t;#n;#r;get r(){return this.#e}set r(e){O(Wr(e)===32,"invalid r","value",e),this.#e=_(e)}get s(){return O(parseInt(this.#t.substring(0,3))<8,"non-canonical s; use ._s","s",this.#t),this.#t}set s(e){O(Wr(e)===32,"invalid s","value",e),this.#t=_(e)}get _s(){return this.#t}isValid(){return BigInt(this.#t)<=h5}get v(){return this.#n}set v(e){const t=pe(e,"value");O(t===27||t===28,"invalid v","v",e),this.#n=t}get networkV(){return this.#r}get legacyChainId(){const e=this.networkV;return e==null?null:$e.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=Y(this.s);return this.yParity&&(e[0]|=128),_(e)}get compactSerialized(){return Ce([this.r,this.yParityAndS])}get serialized(){return Ce([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(e,t,n,i){Nr(e,fr,"Signature"),this.#e=t,this.#t=n,this.#n=i,this.#r=null}getCanonical(){if(this.isValid())return this;const e=dm-BigInt(this._s),t=55-this.v,n=new $e(fr,this.r,Bu(e),t);return this.networkV&&(n.#r=this.networkV),n}clone(){const e=new $e(fr,this.r,this._s,this.v);return this.networkV&&(e.#r=this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this._s,v:this.v}}[d5](){return this.toString()}toString(){return this.isValid()?`Signature { r: ${this.r}, s: ${this._s}, v: ${this.v} }`:`Signature { r: ${this.r}, s: ${this._s}, v: ${this.v}, valid: false }`}static getChainId(e){const t=Z(e,"v");return t==pd||t==xd?hd:(O(t>=Ws,"invalid EIP-155 v","v",e),(t-Ws)/rl)}static getChainIdV(e,t){return Z(e)*rl+BigInt(35+t-27)}static getNormalizedV(e){const t=Z(e);return t===hd||t===pd?27:t===dd||t===xd?28:(O(t>=Ws,"invalid v","v",e),t&dd?27:28)}static from(e){function t(p,h){O(p,h,"signature",e)}if(e==null)return new $e(fr,fd,fd,27);if(typeof e=="string"){const p=Y(e,"signature");if(p.length===64){const h=_(p.slice(0,32)),x=p.slice(32,64),y=x[0]&128?28:27;return x[0]&=127,new $e(fr,h,_(x),y)}if(p.length===65){const h=_(p.slice(0,32)),x=_(p.slice(32,64)),y=$e.getNormalizedV(p[64]);return new $e(fr,h,x,y)}t(!1,"invalid raw signature length")}if(e instanceof $e)return e.clone();const n=e.r;t(n!=null,"missing r");const i=Bu(n),a=(function(p,h){if(p!=null)return Bu(p);if(h!=null){t(Le(h,32),"invalid yParityAndS");const x=Y(h);return x[0]&=127,_(x)}t(!1,"missing s")})(e.s,e.yParityAndS),{networkV:c,v:l}=(function(p,h,x){if(p!=null){const y=Z(p);return{networkV:y>=Ws?y:void 0,v:$e.getNormalizedV(y)}}if(h!=null)return t(Le(h,32),"invalid yParityAndS"),{v:Y(h)[0]&128?28:27};if(x!=null){switch(pe(x,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}t(!1,"invalid yParity")}t(!1,"missing v")})(e.v,e.yParityAndS,e.yParity),f=new $e(fr,i,a,l);return c&&(f.#r=c),t(e.yParity==null||pe(e.yParity,"sig.yParity")===f.yParity,"yParity mismatch"),t(e.yParityAndS==null||e.yParityAndS===f.yParityAndS,"yParityAndS mismatch"),f}}class Ct{#e;constructor(e){O(Wr(e)===32,"invalid private key","privateKey","[REDACTED]"),this.#e=_(e)}get privateKey(){return this.#e}get publicKey(){return Ct.computePublicKey(this.#e)}get compressedPublicKey(){return Ct.computePublicKey(this.#e,!0)}sign(e){O(Wr(e)===32,"invalid digest length","digest",e);const t=Jn.sign(ft(e),ft(this.#e),{lowS:!0});return $e.from({r:Dn(t.r,32),s:Dn(t.s,32),v:t.recovery?28:27})}computeSharedSecret(e){const t=Ct.computePublicKey(e);return _(Jn.getSharedSecret(ft(this.#e),Y(t),!1))}static computePublicKey(e,t){let n=Y(e,"key");if(n.length===32){const a=Jn.getPublicKey(n,!!t);return _(a)}if(n.length===64){const a=new Uint8Array(65);a[0]=4,a.set(n,1),n=a}const i=Jn.ProjectivePoint.fromHex(n);return _(i.toRawBytes(t))}static recoverPublicKey(e,t){O(Wr(e)===32,"invalid digest length","digest",e);const n=$e.from(t);let i=Jn.Signature.fromCompact(ft(Ce([n.r,n.s])));i=i.addRecoveryBit(n.yParity);const a=i.recoverPublicKey(ft(e));return O(a!=null,"invalid signature for digest","signature",t),"0x"+a.toHex(!1)}static addPoints(e,t,n){const i=Jn.ProjectivePoint.fromHex(Ct.computePublicKey(e).substring(2)),a=Jn.ProjectivePoint.fromHex(Ct.computePublicKey(t).substring(2));return"0x"+i.add(a).toHex(!!n)}}const p5=BigInt(0),x5=BigInt(36);function md(r){r=r.toLowerCase();const e=r.substring(2).split(""),t=new Uint8Array(40);for(let i=0;i<40;i++)t[i]=e[i].charCodeAt(0);const n=Y(ze(t));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 Kl={};for(let r=0;r<10;r++)Kl[String(r)]=String(r);for(let r=0;r<26;r++)Kl[String.fromCharCode(65+r)]=String(10+r);const bd=15;function m5(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let e=r.split("").map(n=>Kl[n]).join("");for(;e.length>=bd;){let n=e.substring(0,bd);e=parseInt(n,10)%97+e.substring(n.length)}let t=String(98-parseInt(e,10)%97);for(;t.length<2;)t="0"+t;return t}const b5=(function(){const r={};for(let e=0;e<36;e++){const t="0123456789abcdefghijklmnopqrstuvwxyz"[e];r[t]=BigInt(e)}return r})();function g5(r){r=r.toLowerCase();let e=p5;for(let t=0;t<r.length;t++)e=e*x5+b5[r[t]];return e}function Be(r){if(O(typeof r=="string","invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/)){r.startsWith("0x")||(r="0x"+r);const e=md(r);return O(!r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||e===r,"bad address checksum","address",r),e}if(r.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){O(r.substring(2,4)===m5(r),"bad icap checksum","address",r);let e=g5(r.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return md("0x"+e)}O(!1,"invalid address","address",r)}function y5(r){const e=Be(r.from);let n=Z(r.nonce,"tx.nonce").toString(16);return n==="0"?n="0x":n.length%2?n="0x0"+n:n="0x"+n,Be(Ve(ze(An([e,n])),12))}function pm(r){return r&&typeof r.getAddress=="function"}async function Ru(r,e){const t=await e;return(t==null||t==="0x0000000000000000000000000000000000000000")&&(G(typeof r!="string","unconfigured name","UNCONFIGURED_NAME",{value:r}),O(!1,"invalid AddressLike value; did not resolve to a value address","target",r)),Be(t)}function at(r,e){if(typeof r=="string")return r.match(/^0x[0-9a-f]{40}$/i)?Be(r):(G(e!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),Ru(r,e.resolveName(r)));if(pm(r))return Ru(r,r.getAddress());if(r&&typeof r.then=="function")return Ru(r,r);O(!1,"unsupported addressable value","target",r)}const Rn={};function ee(r,e){let t=!1;return e<0&&(t=!0,e*=-1),new Ke(Rn,`${t?"":"u"}int${e}`,r,{signed:t,width:e})}function Oe(r,e){return new Ke(Rn,`bytes${e||""}`,r,{size:e})}const gd=Symbol.for("_ethers_typed");class Ke{type;value;#e;_typedSymbol;constructor(e,t,n,i){i==null&&(i=null),Nr(Rn,e,"Typed"),re(this,{_typedSymbol:gd,type:t,value:n}),this.#e=i,this.format()}format(){if(this.type==="array")throw new Error("");if(this.type==="dynamicArray")throw new Error("");return this.type==="tuple"?`tuple(${this.value.map(e=>e.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return this.#e}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return this.#e===!0?-1:this.#e===!1?this.value.length:null}static from(e,t){return new Ke(Rn,e,t)}static uint8(e){return ee(e,8)}static uint16(e){return ee(e,16)}static uint24(e){return ee(e,24)}static uint32(e){return ee(e,32)}static uint40(e){return ee(e,40)}static uint48(e){return ee(e,48)}static uint56(e){return ee(e,56)}static uint64(e){return ee(e,64)}static uint72(e){return ee(e,72)}static uint80(e){return ee(e,80)}static uint88(e){return ee(e,88)}static uint96(e){return ee(e,96)}static uint104(e){return ee(e,104)}static uint112(e){return ee(e,112)}static uint120(e){return ee(e,120)}static uint128(e){return ee(e,128)}static uint136(e){return ee(e,136)}static uint144(e){return ee(e,144)}static uint152(e){return ee(e,152)}static uint160(e){return ee(e,160)}static uint168(e){return ee(e,168)}static uint176(e){return ee(e,176)}static uint184(e){return ee(e,184)}static uint192(e){return ee(e,192)}static uint200(e){return ee(e,200)}static uint208(e){return ee(e,208)}static uint216(e){return ee(e,216)}static uint224(e){return ee(e,224)}static uint232(e){return ee(e,232)}static uint240(e){return ee(e,240)}static uint248(e){return ee(e,248)}static uint256(e){return ee(e,256)}static uint(e){return ee(e,256)}static int8(e){return ee(e,-8)}static int16(e){return ee(e,-16)}static int24(e){return ee(e,-24)}static int32(e){return ee(e,-32)}static int40(e){return ee(e,-40)}static int48(e){return ee(e,-48)}static int56(e){return ee(e,-56)}static int64(e){return ee(e,-64)}static int72(e){return ee(e,-72)}static int80(e){return ee(e,-80)}static int88(e){return ee(e,-88)}static int96(e){return ee(e,-96)}static int104(e){return ee(e,-104)}static int112(e){return ee(e,-112)}static int120(e){return ee(e,-120)}static int128(e){return ee(e,-128)}static int136(e){return ee(e,-136)}static int144(e){return ee(e,-144)}static int152(e){return ee(e,-152)}static int160(e){return ee(e,-160)}static int168(e){return ee(e,-168)}static int176(e){return ee(e,-176)}static int184(e){return ee(e,-184)}static int192(e){return ee(e,-192)}static int200(e){return ee(e,-200)}static int208(e){return ee(e,-208)}static int216(e){return ee(e,-216)}static int224(e){return ee(e,-224)}static int232(e){return ee(e,-232)}static int240(e){return ee(e,-240)}static int248(e){return ee(e,-248)}static int256(e){return ee(e,-256)}static int(e){return ee(e,-256)}static bytes1(e){return Oe(e,1)}static bytes2(e){return Oe(e,2)}static bytes3(e){return Oe(e,3)}static bytes4(e){return Oe(e,4)}static bytes5(e){return Oe(e,5)}static bytes6(e){return Oe(e,6)}static bytes7(e){return Oe(e,7)}static bytes8(e){return Oe(e,8)}static bytes9(e){return Oe(e,9)}static bytes10(e){return Oe(e,10)}static bytes11(e){return Oe(e,11)}static bytes12(e){return Oe(e,12)}static bytes13(e){return Oe(e,13)}static bytes14(e){return Oe(e,14)}static bytes15(e){return Oe(e,15)}static bytes16(e){return Oe(e,16)}static bytes17(e){return Oe(e,17)}static bytes18(e){return Oe(e,18)}static bytes19(e){return Oe(e,19)}static bytes20(e){return Oe(e,20)}static bytes21(e){return Oe(e,21)}static bytes22(e){return Oe(e,22)}static bytes23(e){return Oe(e,23)}static bytes24(e){return Oe(e,24)}static bytes25(e){return Oe(e,25)}static bytes26(e){return Oe(e,26)}static bytes27(e){return Oe(e,27)}static bytes28(e){return Oe(e,28)}static bytes29(e){return Oe(e,29)}static bytes30(e){return Oe(e,30)}static bytes31(e){return Oe(e,31)}static bytes32(e){return Oe(e,32)}static address(e){return new Ke(Rn,"address",e)}static bool(e){return new Ke(Rn,"bool",!!e)}static bytes(e){return new Ke(Rn,"bytes",e)}static string(e){return new Ke(Rn,"string",e)}static array(e,t){throw new Error("not implemented yet")}static tuple(e,t){throw new Error("not implemented yet")}static overrides(e){return new Ke(Rn,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===gd}static dereference(e,t){if(Ke.isTyped(e)){if(e.type!==t)throw new Error(`invalid type: expecetd ${t}, got ${e.type}`);return e.value}return e}}class w5 extends Ln{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){let n=Ke.dereference(t,"string");try{n=Be(n)}catch(i){return this._throwError(i.message,t)}return e.writeValue(n)}decode(e){return Be(Dn(e.readValue(),20))}}class A5 extends Ln{coder;constructor(e){super(e.name,e.type,"_",e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}function xm(r,e,t){let n=[];if(Array.isArray(t))n=t;else if(t&&typeof t=="object"){let f={};n=e.map(p=>{const h=p.localName;return G(h,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:p},value:t}),G(!f[h],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:p},value:t}),f[h]=!0,t[h]})}else O(!1,"invalid tuple value","tuple",t);O(e.length===n.length,"types/value length mismatch","tuple",t);let i=new Yu,a=new Yu,c=[];e.forEach((f,p)=>{let h=n[p];if(f.dynamic){let x=a.length;f.encode(a,h);let y=i.writeUpdatableValue();c.push(E=>{y(E+x)})}else f.encode(i,h)}),c.forEach(f=>{f(i.length)});let l=r.appendWriter(i);return l+=r.appendWriter(a),l}function mm(r,e){let t=[],n=[],i=r.subReader(0);return e.forEach(a=>{let c=null;if(a.dynamic){let l=r.readIndex(),f=i.subReader(l);try{c=a.decode(f)}catch(p){if(lt(p,"BUFFER_OVERRUN"))throw p;c=p,c.baseType=a.name,c.name=a.localName,c.type=a.type}}else try{c=a.decode(r)}catch(l){if(lt(l,"BUFFER_OVERRUN"))throw l;c=l,c.baseType=a.name,c.name=a.localName,c.type=a.type}if(c==null)throw new Error("investigate");t.push(c),n.push(a.localName||null)}),Sn.fromItems(t,n)}class E5 extends Ln{coder;length;constructor(e,t,n){const i=e.type+"["+(t>=0?t:"")+"]",a=t===-1||e.dynamic;super("array",i,n,a),re(this,{coder:e,length:t})}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let n=0;n<this.length;n++)t.push(e);return t}encode(e,t){const n=Ke.dereference(t,"array");Array.isArray(n)||this._throwError("expected array value",n);let i=this.length;i===-1&&(i=n.length,e.writeValue(n.length)),ix(n.length,i,"coder array"+(this.localName?" "+this.localName:""));let a=[];for(let c=0;c<n.length;c++)a.push(this.coder);return xm(e,a,n)}decode(e){let t=this.length;t===-1&&(t=e.readIndex(),G(t*Et<=e.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:e.bytes,offset:t*Et,length:e.dataLength}));let n=[];for(let i=0;i<t;i++)n.push(new A5(this.coder));return mm(e,n)}}class B5 extends Ln{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){const n=Ke.dereference(t,"bool");return e.writeValue(n?1:0)}decode(e){return!!e.readValue()}}class bm extends Ln{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=ft(t);let n=e.writeValue(t.length);return n+=e.writeBytes(t),n}decode(e){return e.readBytes(e.readIndex(),!0)}}class R5 extends bm{constructor(e){super("bytes",e)}decode(e){return _(super.decode(e))}}class T5 extends Ln{size;constructor(e,t){let n="bytes"+String(e);super(n,n,t,!1),re(this,{size:e},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(e,t){let n=ft(Ke.dereference(t,this.type));return n.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(n)}decode(e){return _(e.readBytes(this.size))}}const v5=new Uint8Array([]);class O5 extends Ln{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return t!=null&&this._throwError("not null",t),e.writeBytes(v5)}decode(e){return e.readBytes(0),null}}const C5=BigInt(0),S5=BigInt(1),N5=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class I5 extends Ln{size;signed;constructor(e,t,n){const i=(t?"int":"uint")+e*8;super(i,i,n,!1),re(this,{size:e,signed:t},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(e,t){let n=Z(Ke.dereference(t,this.type)),i=Vi(N5,Et*8);if(this.signed){let a=Vi(i,this.size*8-1);(n>a||n<-(a+S5))&&this._throwError("value out-of-bounds",t),n=cx(n,8*Et)}else(n<C5||n>Vi(i,this.size*8))&&this._throwError("value out-of-bounds",t);return e.writeValue(n)}decode(e){let t=Vi(e.readValue(),this.size*8);return this.signed&&(t=dA(t,this.size*8)),t}}class P5 extends bm{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,Tt(Ke.dereference(t,"string")))}decode(e){return ma(super.decode(e))}}class Ys extends Ln{coders;constructor(e,t){let n=!1;const i=[];e.forEach(c=>{c.dynamic&&(n=!0),i.push(c.type)});const a="tuple("+i.join(",")+")";super("tuple",a,t,n),re(this,{coders:Object.freeze(e.slice())})}defaultValue(){const e=[];this.coders.forEach(n=>{e.push(n.defaultValue())});const t=this.coders.reduce((n,i)=>{const a=i.localName;return a&&(n[a]||(n[a]=0),n[a]++),n},{});return this.coders.forEach((n,i)=>{let a=n.localName;!a||t[a]!==1||(a==="length"&&(a="_length"),e[a]==null&&(e[a]=e[i]))}),Object.freeze(e)}encode(e,t){const n=Ke.dereference(t,"tuple");return xm(e,this.coders,n)}decode(e){return mm(e,this.coders)}}function Tu(r,e){return{address:Be(r),storageKeys:e.map((t,n)=>(O(Le(t,32),"invalid slot",`storageKeys[${n}]`,t),t.toLowerCase()))}}function Ir(r){if(Array.isArray(r))return r.map((t,n)=>Array.isArray(t)?(O(t.length===2,"invalid slot set",`value[${n}]`,t),Tu(t[0],t[1])):(O(t!=null&&typeof t=="object","invalid address-slot set","value",r),Tu(t.address,t.storageKeys)));O(r!=null&&typeof r=="object","invalid access list","value",r);const e=Object.keys(r).map(t=>{const n=r[t].reduce((i,a)=>(i[a]=!0,i),{});return Tu(t,Object.keys(n).sort())});return e.sort((t,n)=>t.address.localeCompare(n.address)),e}function gm(r){return{address:Be(r.address),nonce:Z(r.nonce!=null?r.nonce:0),chainId:Z(r.chainId!=null?r.chainId:0),signature:$e.from(r.signature)}}function ys(r){let e;return typeof r=="string"?e=Ct.computePublicKey(r,!1):e=r.publicKey,Be(ze("0x"+e.substring(4)).substring(26))}function k5(r,e){return ys(Ct.recoverPublicKey(r,e))}const rt=BigInt(0),D5=BigInt(2),F5=BigInt(27),U5=BigInt(28),L5=BigInt(35),M5=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),V5=Symbol.for("nodejs.util.inspect.custom"),vu=4096*32,ca=128;function G5(r){return{blobToKzgCommitment:n=>{if("computeBlobProof"in r){if("blobToKzgCommitment"in r&&typeof r.blobToKzgCommitment=="function")return Y(r.blobToKzgCommitment(_(n)))}else if("blobToKzgCommitment"in r&&typeof r.blobToKzgCommitment=="function")return Y(r.blobToKzgCommitment(n));if("blobToKZGCommitment"in r&&typeof r.blobToKZGCommitment=="function")return Y(r.blobToKZGCommitment(_(n)));O(!1,"unsupported KZG library","kzg",r)},computeBlobKzgProof:(n,i)=>{if("computeBlobProof"in r&&typeof r.computeBlobProof=="function")return Y(r.computeBlobProof(_(n),_(i)));if("computeBlobKzgProof"in r&&typeof r.computeBlobKzgProof=="function")return r.computeBlobKzgProof(n,i);if("computeBlobKZGProof"in r&&typeof r.computeBlobKZGProof=="function")return Y(r.computeBlobKZGProof(_(n),_(i)));O(!1,"unsupported KZG library","kzg",r)}}}function yd(r,e){let t=r.toString(16);for(;t.length<2;)t="0"+t;return t+=Kt(e).substring(4),"0x"+t}function gi(r){return r==="0x"?null:Be(r)}function za(r,e){try{return Ir(r)}catch(t){O(!1,t.message,e,r)}}function z5(r,e){try{if(!Array.isArray(r))throw new Error("authorizationList: invalid array");const t=[];for(let n=0;n<r.length;n++){const i=r[n];if(!Array.isArray(i))throw new Error(`authorization[${n}]: invalid array`);if(i.length!==6)throw new Error(`authorization[${n}]: wrong length`);if(!i[1])throw new Error(`authorization[${n}]: null address`);t.push({address:gi(i[1]),nonce:Pe(i[2],"nonce"),chainId:Pe(i[0],"chainId"),signature:$e.from({yParity:Pr(i[3],"yParity"),r:kn(i[4],32),s:kn(i[5],32)})})}return t}catch(t){O(!1,t.message,e,r)}}function Pr(r,e){return r==="0x"?0:pe(r,e)}function Pe(r,e){if(r==="0x")return rt;const t=Z(r,e);return O(t<=M5,"value exceeds uint size",e,t),t}function Ee(r,e){const t=Z(r,"value"),n=je(t);return O(n.length<=32,"value too large",`tx.${e}`,t),n}function Ha(r){return Ir(r).map(e=>[e.address,e.storageKeys])}function H5(r){return r.map(e=>[Ee(e.chainId,"chainId"),e.address,Ee(e.nonce,"nonce"),Ee(e.signature.yParity,"yParity"),je(e.signature.r),je(e.signature._s)])}function $5(r,e){O(Array.isArray(r),`invalid ${e}`,"value",r);for(let t=0;t<r.length;t++)O(Le(r[t],32),"invalid ${ param } hash",`value[${t}]`,r[t]);return r}function _5(r){const e=bs(r);O(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",r);const t={type:0,nonce:Pr(e[0],"nonce"),gasPrice:Pe(e[1],"gasPrice"),gasLimit:Pe(e[2],"gasLimit"),to:gi(e[3]),value:Pe(e[4],"value"),data:_(e[5]),chainId:rt};if(e.length===6)return t;const n=Pe(e[6],"v"),i=Pe(e[7],"r"),a=Pe(e[8],"s");if(i===rt&&a===rt)t.chainId=n;else{let c=(n-L5)/D5;c<rt&&(c=rt),t.chainId=c,O(c!==rt||n===F5||n===U5,"non-canonical legacy v","v",e[6]),t.signature=$e.from({r:kn(e[7],32),s:kn(e[8],32),v:n})}return t}function j5(r,e){const t=[Ee(r.nonce,"nonce"),Ee(r.gasPrice||0,"gasPrice"),Ee(r.gasLimit,"gasLimit"),r.to||"0x",Ee(r.value,"value"),r.data];let n=rt;if(r.chainId!=rt)n=Z(r.chainId,"tx.chainId"),O(!e||e.networkV==null||e.legacyChainId===n,"tx.chainId/sig.v mismatch","sig",e);else if(r.signature){const a=r.signature.legacyChainId;a!=null&&(n=a)}if(!e)return n!==rt&&(t.push(je(n)),t.push("0x"),t.push("0x")),An(t);let i=BigInt(27+e.yParity);return n!==rt?i=$e.getChainIdV(n,e.v):BigInt(e.v)!==i&&O(!1,"tx.chainId/sig.v mismatch","sig",e),t.push(je(i)),t.push(je(e.r)),t.push(je(e._s)),An(t)}function $a(r,e){let t;try{if(t=Pr(e[0],"yParity"),t!==0&&t!==1)throw new Error("bad yParity")}catch{O(!1,"invalid yParity","yParity",e[0])}const n=kn(e[1],32),i=kn(e[2],32),a=$e.from({r:n,s:i,yParity:t});r.signature=a}function q5(r){const e=bs(Y(r).slice(1));O(Array.isArray(e)&&(e.length===9||e.length===12),"invalid field count for transaction type: 2","data",_(r));const t={type:2,chainId:Pe(e[0],"chainId"),nonce:Pr(e[1],"nonce"),maxPriorityFeePerGas:Pe(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Pe(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Pe(e[4],"gasLimit"),to:gi(e[5]),value:Pe(e[6],"value"),data:_(e[7]),accessList:za(e[8],"accessList")};return e.length===9||$a(t,e.slice(9)),t}function K5(r,e){const t=[Ee(r.chainId,"chainId"),Ee(r.nonce,"nonce"),Ee(r.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Ee(r.maxFeePerGas||0,"maxFeePerGas"),Ee(r.gasLimit,"gasLimit"),r.to||"0x",Ee(r.value,"value"),r.data,Ha(r.accessList||[])];return e&&(t.push(Ee(e.yParity,"yParity")),t.push(je(e.r)),t.push(je(e.s))),Ce(["0x02",An(t)])}function Q5(r){const e=bs(Y(r).slice(1));O(Array.isArray(e)&&(e.length===8||e.length===11),"invalid field count for transaction type: 1","data",_(r));const t={type:1,chainId:Pe(e[0],"chainId"),nonce:Pr(e[1],"nonce"),gasPrice:Pe(e[2],"gasPrice"),gasLimit:Pe(e[3],"gasLimit"),to:gi(e[4]),value:Pe(e[5],"value"),data:_(e[6]),accessList:za(e[7],"accessList")};return e.length===8||$a(t,e.slice(8)),t}function J5(r,e){const t=[Ee(r.chainId,"chainId"),Ee(r.nonce,"nonce"),Ee(r.gasPrice||0,"gasPrice"),Ee(r.gasLimit,"gasLimit"),r.to||"0x",Ee(r.value,"value"),r.data,Ha(r.accessList||[])];return e&&(t.push(Ee(e.yParity,"recoveryParam")),t.push(je(e.r)),t.push(je(e.s))),Ce(["0x01",An(t)])}function W5(r){let e=bs(Y(r).slice(1)),t="3",n=null,i=null;if(e.length===4&&Array.isArray(e[0])){t="3 (network format)";const c=e[1],l=e[2],f=e[3];O(Array.isArray(c),"invalid network format: blobs not an array","fields[1]",c),O(Array.isArray(l),"invalid network format: commitments not an array","fields[2]",l),O(Array.isArray(f),"invalid network format: proofs not an array","fields[3]",f),O(c.length===l.length,"invalid network format: blobs/commitments length mismatch","fields",e),O(c.length===f.length,"invalid network format: blobs/proofs length mismatch","fields",e),i=[];for(let p=0;p<e[1].length;p++)i.push({data:c[p],commitment:l[p],proof:f[p]});e=e[0]}else if(e.length===5&&Array.isArray(e[0])){t="3 (EIP-7594 network format)",n=pe(e[1]);const c=e[2],l=e[3],f=e[4];O(n===1,`unsupported EIP-7594 network format version: ${n}`,"fields[1]",n),O(Array.isArray(c),"invalid EIP-7594 network format: blobs not an array","fields[2]",c),O(Array.isArray(l),"invalid EIP-7594 network format: commitments not an array","fields[3]",l),O(Array.isArray(f),"invalid EIP-7594 network format: proofs not an array","fields[4]",f),O(c.length===l.length,"invalid network format: blobs/commitments length mismatch","fields",e),O(c.length*ca===f.length,"invalid network format: blobs/proofs length mismatch","fields",e),i=[];for(let p=0;p<c.length;p++){const h=[];for(let x=0;x<ca;x++)h.push(f[p*ca+x]);i.push({data:c[p],commitment:l[p],proof:Ce(h)})}e=e[0]}O(Array.isArray(e)&&(e.length===11||e.length===14),`invalid field count for transaction type: ${t}`,"data",_(r));const a={type:3,chainId:Pe(e[0],"chainId"),nonce:Pr(e[1],"nonce"),maxPriorityFeePerGas:Pe(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Pe(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Pe(e[4],"gasLimit"),to:gi(e[5]),value:Pe(e[6],"value"),data:_(e[7]),accessList:za(e[8],"accessList"),maxFeePerBlobGas:Pe(e[9],"maxFeePerBlobGas"),blobVersionedHashes:e[10],blobWrapperVersion:n};i&&(a.blobs=i),O(a.to!=null,`invalid address for transaction type: ${t}`,"data",r),O(Array.isArray(a.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",r);for(let c=0;c<a.blobVersionedHashes.length;c++)O(Le(a.blobVersionedHashes[c],32),`invalid blobVersionedHash at index ${c}: must be length 32`,"data",r);return e.length===11||$a(a,e.slice(11)),a}function Y5(r,e,t){const n=[Ee(r.chainId,"chainId"),Ee(r.nonce,"nonce"),Ee(r.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Ee(r.maxFeePerGas||0,"maxFeePerGas"),Ee(r.gasLimit,"gasLimit"),r.to||rs,Ee(r.value,"value"),r.data,Ha(r.accessList||[]),Ee(r.maxFeePerBlobGas||0,"maxFeePerBlobGas"),$5(r.blobVersionedHashes||[],"blobVersionedHashes")];if(e&&(n.push(Ee(e.yParity,"yParity")),n.push(je(e.r)),n.push(je(e.s)),t)){if(r.blobWrapperVersion!=null){const i=je(r.blobWrapperVersion),a=[];for(const{proof:c}of t){const l=Y(c),f=l.length/ca;for(let p=0;p<l.length;p+=f)a.push(l.subarray(p,p+f))}return Ce(["0x03",An([n,i,t.map(c=>c.data),t.map(c=>c.commitment),a])])}return Ce(["0x03",An([n,t.map(i=>i.data),t.map(i=>i.commitment),t.map(i=>i.proof)])])}return Ce(["0x03",An(n)])}function X5(r){const e=bs(Y(r).slice(1));O(Array.isArray(e)&&(e.length===10||e.length===13),"invalid field count for transaction type: 4","data",_(r));const t={type:4,chainId:Pe(e[0],"chainId"),nonce:Pr(e[1],"nonce"),maxPriorityFeePerGas:Pe(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Pe(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Pe(e[4],"gasLimit"),to:gi(e[5]),value:Pe(e[6],"value"),data:_(e[7]),accessList:za(e[8],"accessList"),authorizationList:z5(e[9],"authorizationList")};return e.length===10||$a(t,e.slice(10)),t}function Z5(r,e){const t=[Ee(r.chainId,"chainId"),Ee(r.nonce,"nonce"),Ee(r.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Ee(r.maxFeePerGas||0,"maxFeePerGas"),Ee(r.gasLimit,"gasLimit"),r.to||"0x",Ee(r.value,"value"),r.data,Ha(r.accessList||[]),H5(r.authorizationList||[])];return e&&(t.push(Ee(e.yParity,"yParity")),t.push(je(e.r)),t.push(je(e.s))),Ce(["0x04",An(t)])}class _t{#e;#t;#n;#r;#i;#a;#s;#o;#d;#u;#p;#x;#c;#l;#f;#h;#g;#m;get type(){return this.#e}set type(e){switch(e){case null:this.#e=null;break;case 0:case"legacy":this.#e=0;break;case 1:case"berlin":case"eip-2930":this.#e=1;break;case 2:case"london":case"eip-1559":this.#e=2;break;case 3:case"cancun":case"eip-4844":this.#e=3;break;case 4:case"pectra":case"eip-7702":this.#e=4;break;default:O(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844";case 4:return"eip-7702"}return null}get to(){const e=this.#t;return e==null&&this.type===3?rs:e}set to(e){this.#t=e==null?null:Be(e)}get nonce(){return this.#r}set nonce(e){this.#r=pe(e,"value")}get gasLimit(){return this.#i}set gasLimit(e){this.#i=Z(e)}get gasPrice(){const e=this.#a;return e==null&&(this.type===0||this.type===1)?rt:e}set gasPrice(e){this.#a=e==null?null:Z(e,"gasPrice")}get maxPriorityFeePerGas(){const e=this.#s;return e??(this.type===2||this.type===3?rt:null)}set maxPriorityFeePerGas(e){this.#s=e==null?null:Z(e,"maxPriorityFeePerGas")}get maxFeePerGas(){const e=this.#o;return e??(this.type===2||this.type===3?rt:null)}set maxFeePerGas(e){this.#o=e==null?null:Z(e,"maxFeePerGas")}get data(){return this.#n}set data(e){this.#n=_(e)}get value(){return this.#d}set value(e){this.#d=Z(e,"value")}get chainId(){return this.#u}set chainId(e){this.#u=Z(e)}get signature(){return this.#p||null}set signature(e){this.#p=e==null?null:$e.from(e)}isValid(){const e=this.signature;if(e&&!e.isValid())return!1;const t=this.authorizationList;if(t){for(const n of t)if(!n.signature.isValid())return!1}return!0}get accessList(){const e=this.#x||null;return e??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(e){this.#x=e==null?null:Ir(e)}get authorizationList(){const e=this.#g||null;return e==null&&this.type===4?[]:e}set authorizationList(e){this.#g=e==null?null:e.map(t=>gm(t))}get maxFeePerBlobGas(){const e=this.#c;return e==null&&this.type===3?rt:e}set maxFeePerBlobGas(e){this.#c=e==null?null:Z(e,"maxFeePerBlobGas")}get blobVersionedHashes(){let e=this.#l;return e==null&&this.type===3?[]:e}set blobVersionedHashes(e){if(e!=null){O(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let t=0;t<e.length;t++)O(Le(e[t],32),"invalid blobVersionedHash",`value[${t}]`,e[t])}this.#l=e}get blobs(){return this.#h==null?null:this.#h.map(e=>Object.assign({},e))}set blobs(e){if(e==null){this.#h=null;return}const t=[],n=[];for(let i=0;i<e.length;i++){const a=e[i];if(Fa(a)){G(this.#f,"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let c=Y(a);if(O(c.length<=vu,"blob is too large",`blobs[${i}]`,a),c.length!==vu){const p=new Uint8Array(vu);p.set(c),c=p}const l=this.#f.blobToKzgCommitment(c),f=_(this.#f.computeBlobKzgProof(c,l));t.push({data:_(c),commitment:_(l),proof:f}),n.push(yd(1,l))}else{const c=_(a.data),l=_(a.commitment),f=_(a.proof);t.push({data:c,commitment:l,proof:f}),n.push(yd(1,l))}}this.#h=t,this.#l=n}get kzg(){return this.#f}set kzg(e){e==null?this.#f=null:this.#f=G5(e)}get blobWrapperVersion(){return this.#m}set blobWrapperVersion(e){this.#m=e}constructor(){this.#e=null,this.#t=null,this.#r=0,this.#i=rt,this.#a=null,this.#s=null,this.#o=null,this.#n="0x",this.#d=rt,this.#u=rt,this.#p=null,this.#x=null,this.#c=null,this.#l=null,this.#f=null,this.#h=null,this.#g=null,this.#m=null}get hash(){return this.signature==null?null:ze(this.#b(!0,!1))}get unsignedHash(){return ze(this.unsignedSerialized)}get from(){return this.signature==null?null:k5(this.unsignedHash,this.signature.getCanonical())}get fromPublicKey(){return this.signature==null?null:Ct.recoverPublicKey(this.unsignedHash,this.signature.getCanonical())}isSigned(){return this.signature!=null}#b(e,t){G(!e||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const n=e?this.signature:null;switch(this.inferType()){case 0:return j5(this,n);case 1:return J5(this,n);case 2:return K5(this,n);case 3:return Y5(this,n,t?this.blobs:null);case 4:return Z5(this,n)}G(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get serialized(){return this.#b(!0,!0)}get unsignedSerialized(){return this.#b(!1,!1)}inferType(){const e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){const e=this.gasPrice!=null,t=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,n=this.accessList!=null,i=this.#c!=null||this.#l;this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&G(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),G(!t||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),G(this.type!==0||!n,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const a=[];return this.type!=null?a.push(this.type):this.authorizationList&&this.authorizationList.length?a.push(4):t?a.push(2):e?(a.push(1),n||a.push(0)):n?(a.push(1),a.push(2)):(i&&this.to||(a.push(0),a.push(1),a.push(2)),a.push(3)),a.sort(),a}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return _t.from(this)}toJSON(){const e=t=>t==null?null:t.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}[V5](){return this.toString()}toString(){const e=[],t=i=>{let a=this[i];typeof a=="string"&&(a=JSON.stringify(a)),e.push(`${i}: ${a}`)};this.type&&t("type"),t("to"),t("data"),t("nonce"),t("gasLimit"),t("value"),this.chainId!=null&&t("chainId"),this.signature&&(t("from"),e.push(`signature: ${this.signature.toString()}`));const n=this.authorizationList;if(n){const i=[];for(const a of n){const c=[];c.push(`address: ${JSON.stringify(a.address)}`),a.nonce!=null&&c.push(`nonce: ${a.nonce}`),a.chainId!=null&&c.push(`chainId: ${a.chainId}`),a.signature&&c.push(`signature: ${a.signature.toString()}`),i.push(`Authorization { ${c.join(", ")} }`)}e.push(`authorizations: [ ${i.join(", ")} ]`)}return`Transaction { ${e.join(", ")} }`}static from(e){if(e==null)return new _t;if(typeof e=="string"){const n=Y(e);if(n[0]>=127)return _t.from(_5(n));switch(n[0]){case 1:return _t.from(Q5(n));case 2:return _t.from(q5(n));case 3:return _t.from(W5(n));case 4:return _t.from(X5(n))}G(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const t=new _t;return e.type!=null&&(t.type=e.type),e.to!=null&&(t.to=e.to),e.nonce!=null&&(t.nonce=e.nonce),e.gasLimit!=null&&(t.gasLimit=e.gasLimit),e.gasPrice!=null&&(t.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(t.maxFeePerGas=e.maxFeePerGas),e.maxFeePerBlobGas!=null&&(t.maxFeePerBlobGas=e.maxFeePerBlobGas),e.data!=null&&(t.data=e.data),e.value!=null&&(t.value=e.value),e.chainId!=null&&(t.chainId=e.chainId),e.signature!=null&&(t.signature=$e.from(e.signature)),e.accessList!=null&&(t.accessList=e.accessList),e.authorizationList!=null&&(t.authorizationList=e.authorizationList),e.blobVersionedHashes!=null&&(t.blobVersionedHashes=e.blobVersionedHashes),e.kzg!=null&&(t.kzg=e.kzg),e.blobWrapperVersion!=null&&(t.blobWrapperVersion=e.blobWrapperVersion),e.blobs!=null&&(t.blobs=e.blobs),e.hash!=null&&(O(t.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),O(t.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(O(t.isSigned(),"unsigned transaction cannot define '.from'","tx",e),O(t.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),t}}function eE(r){return O(typeof r.address=="string","invalid address for hashAuthorization","auth.address",r),ze(Ce(["0x05",An([r.chainId!=null?je(r.chainId):"0x",Be(r.address),r.nonce!=null?je(r.nonce):"0x"])]))}function Fn(r){return ze(Tt(r))}var tE="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";const wd=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),Ad=4;function nE(r){let e=0;function t(){return r[e++]<<8|r[e++]}let n=t(),i=1,a=[0,1];for(let H=1;H<n;H++)a.push(i+=t());let c=t(),l=e;e+=c;let f=0,p=0;function h(){return f==0&&(p=p<<8|r[e++],f=8),p>>--f&1}const x=31,y=2**x,E=y>>>1,v=E>>1,R=y-1;let C=0;for(let H=0;H<x;H++)C=C<<1|h();let S=[],D=0,U=y;for(;;){let H=Math.floor(((C-D+1)*i-1)/U),j=0,F=n;for(;F-j>1;){let ne=j+F>>>1;H<a[ne]?F=ne:j=ne}if(j==0)break;S.push(j);let z=D+Math.floor(U*a[j]/i),W=D+Math.floor(U*a[j+1]/i)-1;for(;((z^W)&E)==0;)C=C<<1&R|h(),z=z<<1&R,W=W<<1&R|1;for(;z&~W&v;)C=C&E|C<<1&R>>>1|h(),z=z<<1^E,W=(W^E)<<1|E|1;D=z,U=1+W-z}let K=n-4;return S.map(H=>{switch(H-K){case 3:return K+65792+(r[l++]<<16|r[l++]<<8|r[l++]);case 2:return K+256+(r[l++]<<8|r[l++]);case 1:return K+r[l++];default:return H-1}})}function rE(r){let e=0;return()=>r[e++]}function ym(r){return rE(nE(iE(r)))}function iE(r){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,a)=>e[i.charCodeAt(0)]=a);let t=r.length,n=new Uint8Array(6*t>>3);for(let i=0,a=0,c=0,l=0;i<t;i++)l=l<<6|e[r.charCodeAt(i)],c+=6,c>=8&&(n[a++]=l>>(c-=8));return n}function sE(r){return r&1?~r>>1:r>>1}function aE(r,e){let t=Array(r);for(let n=0,i=0;n<r;n++)t[n]=i+=sE(e());return t}function is(r,e=0){let t=[];for(;;){let n=r(),i=r();if(!i)break;e+=n;for(let a=0;a<i;a++)t.push(e+a);e+=i+1}return t}function wm(r){return ss(()=>{let e=is(r);if(e.length)return e})}function Am(r){let e=[];for(;;){let t=r();if(t==0)break;e.push(oE(t,r))}for(;;){let t=r()-1;if(t<0)break;e.push(cE(t,r))}return e.flat()}function ss(r){let e=[];for(;;){let t=r(e.length);if(!t)break;e.push(t)}return e}function Em(r,e,t){let n=Array(r).fill().map(()=>[]);for(let i=0;i<e;i++)aE(r,t).forEach((a,c)=>n[c].push(a));return n}function oE(r,e){let t=1+e(),n=e(),i=ss(e);return Em(i.length,1+r,e).flatMap((c,l)=>{let[f,...p]=c;return Array(i[l]).fill().map((h,x)=>{let y=x*n;return[f+x*t,p.map(E=>E+y)]})})}function cE(r,e){let t=1+e();return Em(t,1+r,e).map(i=>[i[0],i.slice(1)])}function uE(r){let e=[],t=is(r);return i(n([]),[]),e;function n(a){let c=r(),l=ss(()=>{let f=is(r).map(p=>t[p]);if(f.length)return n(f)});return{S:c,B:l,Q:a}}function i({S:a,B:c},l,f){if(!(a&4&&f===l[l.length-1])){a&2&&(f=l[l.length-1]),a&1&&e.push(l);for(let p of c)for(let h of p.Q)i(p,[...l,h],f)}}}function lE(r){return r.toString(16).toUpperCase().padStart(2,"0")}function Bm(r){return`{${lE(r)}}`}function fE(r){let e=[];for(let t=0,n=r.length;t<n;){let i=r.codePointAt(t);t+=i<65536?1:2,e.push(i)}return e}function ai(r){let t=r.length;if(t<4096)return String.fromCodePoint(...r);let n=[];for(let i=0;i<t;)n.push(String.fromCodePoint(...r.slice(i,i+=4096)));return n.join("")}function hE(r,e){let t=r.length,n=t-e.length;for(let i=0;n==0&&i<t;i++)n=r[i]-e[i];return n}var dE="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";const as=44032,ba=4352,ga=4449,ya=4519,Rm=19,Tm=21,oi=28,wa=Tm*oi,pE=Rm*wa,xE=as+pE,mE=ba+Rm,bE=ga+Tm,gE=ya+oi;function Gi(r){return r>>24&255}function vm(r){return r&16777215}let il,Ed,sl,ua;function yE(){let r=ym(dE);il=new Map(wm(r).flatMap((e,t)=>e.map(n=>[n,t+1<<24]))),Ed=new Set(is(r)),sl=new Map,ua=new Map;for(let[e,t]of Am(r)){if(!Ed.has(e)&&t.length==2){let[n,i]=t,a=ua.get(n);a||(a=new Map,ua.set(n,a)),a.set(i,e)}sl.set(e,t.reverse())}}function Om(r){return r>=as&&r<xE}function wE(r,e){if(r>=ba&&r<mE&&e>=ga&&e<bE)return as+(r-ba)*wa+(e-ga)*oi;if(Om(r)&&e>ya&&e<gE&&(r-as)%oi==0)return r+(e-ya);{let t=ua.get(r);return t&&(t=t.get(e),t)?t:-1}}function Cm(r){il||yE();let e=[],t=[],n=!1;function i(a){let c=il.get(a);c&&(n=!0,a|=c),e.push(a)}for(let a of r)for(;;){if(a<128)e.push(a);else if(Om(a)){let c=a-as,l=c/wa|0,f=c%wa/oi|0,p=c%oi;i(ba+l),i(ga+f),p>0&&i(ya+p)}else{let c=sl.get(a);c?t.push(...c):i(a)}if(!t.length)break;a=t.pop()}if(n&&e.length>1){let a=Gi(e[0]);for(let c=1;c<e.length;c++){let l=Gi(e[c]);if(l==0||a<=l){a=l;continue}let f=c-1;for(;;){let p=e[f+1];if(e[f+1]=e[f],e[f]=p,!f||(a=Gi(e[--f]),a<=l))break}a=Gi(e[c])}}return e}function AE(r){let e=[],t=[],n=-1,i=0;for(let a of r){let c=Gi(a),l=vm(a);if(n==-1)c==0?n=l:e.push(l);else if(i>0&&i>=c)c==0?(e.push(n,...t),t.length=0,n=l):t.push(l),i=c;else{let f=wE(n,l);f>=0?n=f:i==0&&c==0?(e.push(n),n=l):(t.push(l),i=c)}}return n>=0&&e.push(n,...t),e}function Sm(r){return Cm(r).map(vm)}function EE(r){return AE(Cm(r))}const Bd=45,Nm=".",Im=65039,Pm=1,Aa=r=>Array.from(r);function os(r,e){return r.P.has(e)||r.Q.has(e)}class BE extends Array{get is_emoji(){return!0}}let al,km,yr,ol,Dm,Xr,Ou,qr,dr,Rd,cl;function Ql(){if(al)return;let r=ym(tE);const e=()=>is(r),t=()=>new Set(e()),n=(h,x)=>x.forEach(y=>h.add(y));al=new Map(Am(r)),km=t(),yr=e(),ol=new Set(e().map(h=>yr[h])),yr=new Set(yr),Dm=t(),t();let i=wm(r),a=r();const c=()=>{let h=new Set;return e().forEach(x=>n(h,i[x])),n(h,e()),h};Xr=ss(h=>{let x=ss(r).map(y=>y+96);if(x.length){let y=h>=a;x[0]-=32,x=ai(x),y&&(x=`Restricted[${x}]`);let E=c(),v=c(),R=!r();return{N:x,P:E,Q:v,M:R,R:y}}}),Ou=t(),qr=new Map;let l=e().concat(Aa(Ou)).sort((h,x)=>h-x);l.forEach((h,x)=>{let y=r(),E=l[x]=y?l[x-y]:{V:[],M:new Map};E.V.push(h),Ou.has(h)||qr.set(h,E)});for(let{V:h,M:x}of new Set(qr.values())){let y=[];for(let v of h){let R=Xr.filter(S=>os(S,v)),C=y.find(({G:S})=>R.some(D=>S.has(D)));C||(C={G:new Set,V:[]},y.push(C)),C.V.push(v),n(C.G,R)}let E=y.flatMap(v=>Aa(v.G));for(let{G:v,V:R}of y){let C=new Set(E.filter(S=>!v.has(S)));for(let S of R)x.set(S,C)}}dr=new Set;let f=new Set;const p=h=>dr.has(h)?f.add(h):dr.add(h);for(let h of Xr){for(let x of h.P)p(x);for(let x of h.Q)p(x)}for(let h of dr)!qr.has(h)&&!f.has(h)&&qr.set(h,Pm);n(dr,Sm(dr)),Rd=uE(r).map(h=>BE.from(h)).sort(hE),cl=new Map;for(let h of Rd){let x=[cl];for(let y of h){let E=x.map(v=>{let R=v.get(y);return R||(R=new Map,v.set(y,R)),R});y===Im?x.push(...E):x=E}for(let y of x)y.V=h}}function Jl(r){return(Fm(r)?"":`${Wl(_a([r]))} `)+Bm(r)}function Wl(r){return`"${r}"`}function RE(r){if(r.length>=4&&r[2]==Bd&&r[3]==Bd)throw new Error(`invalid label extension: "${ai(r.slice(0,4))}"`)}function TE(r){for(let t=r.lastIndexOf(95);t>0;)if(r[--t]!==95)throw new Error("underscore allowed only at start")}function vE(r){let e=r[0],t=wd.get(e);if(t)throw Ki(`leading ${t}`);let n=r.length,i=-1;for(let a=1;a<n;a++){e=r[a];let c=wd.get(e);if(c){if(i==a)throw Ki(`${t} + ${c}`);i=a+1,t=c}}if(i==n)throw Ki(`trailing ${t}`)}function _a(r,e=1/0,t=Bm){let n=[];OE(r[0])&&n.push("◌"),r.length>e&&(e>>=1,r=[...r.slice(0,e),8230,...r.slice(-e)]);let i=0,a=r.length;for(let c=0;c<a;c++){let l=r[c];Fm(l)&&(n.push(ai(r.slice(i,c))),n.push(t(l)),i=c+1)}return n.push(ai(r.slice(i,a))),n.join("")}function OE(r){return Ql(),yr.has(r)}function Fm(r){return Ql(),Dm.has(r)}function CE(r){return PE(SE(r,EE,FE))}function SE(r,e,t){if(!r)return[];Ql();let n=0;return r.split(Nm).map(i=>{let a=fE(i),c={input:a,offset:n};n+=a.length+1;try{let l=c.tokens=DE(a,e,t),f=l.length,p;if(!f)throw new Error("empty label");let h=c.output=l.flat();if(TE(h),!(c.emoji=f>1||l[0].is_emoji)&&h.every(y=>y<128))RE(h),p="ASCII";else{let y=l.flatMap(E=>E.is_emoji?[]:E);if(!y.length)p="Emoji";else{if(yr.has(h[0]))throw Ki("leading combining mark");for(let R=1;R<f;R++){let C=l[R];if(!C.is_emoji&&yr.has(C[0]))throw Ki(`emoji + combining mark: "${ai(l[R-1])} + ${_a([C[0]])}"`)}vE(h);let E=Aa(new Set(y)),[v]=IE(E);kE(v,y),NE(v,E),p=v.N}}c.type=p}catch(l){c.error=l}return c})}function NE(r,e){let t,n=[];for(let i of e){let a=qr.get(i);if(a===Pm)return;if(a){let c=a.M.get(i);if(t=t?t.filter(l=>c.has(l)):Aa(c),!t.length)return}else n.push(i)}if(t){for(let i of t)if(n.every(a=>os(i,a)))throw new Error(`whole-script confusable: ${r.N}/${i.N}`)}}function IE(r){let e=Xr;for(let t of r){let n=e.filter(i=>os(i,t));if(!n.length)throw Xr.some(i=>os(i,t))?Lm(e[0],t):Um(t);if(e=n,n.length==1)break}return e}function PE(r){return r.map(({input:e,error:t,output:n})=>{if(t){let i=t.message;throw new Error(r.length==1?i:`Invalid label ${Wl(_a(e,63))}: ${i}`)}return ai(n)}).join(Nm)}function Um(r){return new Error(`disallowed character: ${Jl(r)}`)}function Lm(r,e){let t=Jl(e),n=Xr.find(i=>i.P.has(e));return n&&(t=`${n.N} ${t}`),new Error(`illegal mixture: ${r.N} + ${t}`)}function Ki(r){return new Error(`illegal placement: ${r}`)}function kE(r,e){for(let t of e)if(!os(r,t))throw Lm(r,t);if(r.M){let t=Sm(e);for(let n=1,i=t.length;n<i;n++)if(ol.has(t[n])){let a=n+1;for(let c;a<i&&ol.has(c=t[a]);a++)for(let l=n;l<a;l++)if(t[l]==c)throw new Error(`duplicate non-spacing marks: ${Jl(c)}`);if(a-n>Ad)throw new Error(`excessive non-spacing marks: ${Wl(_a(t.slice(n-1,a)))} (${a-n}/${Ad})`);n=a}}}function DE(r,e,t){let n=[],i=[];for(r=r.slice().reverse();r.length;){let a=UE(r);if(a)i.length&&(n.push(e(i)),i=[]),n.push(t(a));else{let c=r.pop();if(dr.has(c))i.push(c);else{let l=al.get(c);if(l)i.push(...l);else if(!km.has(c))throw Um(c)}}}return i.length&&n.push(e(i)),n}function FE(r){return r.filter(e=>e!=Im)}function UE(r,e){let t=cl,n,i=r.length;for(;i&&(t=t.get(r[--i]),!!t);){let{V:a}=t;a&&(n=a,r.length=i)}return n}const Mm=new Uint8Array(32);Mm.fill(0);function Td(r){return O(r.length!==0,"invalid ENS name; empty component","comp",r),r}function Vm(r){const e=Tt(LE(r)),t=[];if(r.length===0)return t;let n=0;for(let i=0;i<e.length;i++)e[i]===46&&(t.push(Td(e.slice(n,i))),n=i+1);return O(n<e.length,"invalid ENS name; empty component","name",r),t.push(Td(e.slice(n))),t}function LE(r){try{if(r.length===0)throw new Error("empty label");return CE(r)}catch(e){O(!1,`invalid ENS name (${e.message})`,"name",r)}}function ul(r){O(typeof r=="string","invalid ENS name; not a string","name",r),O(r.length,"invalid ENS name (empty label)","name",r);let e=Mm;const t=Vm(r);for(;t.length;)e=ze(Ce([e,ze(t.pop())]));return _(e)}function ME(r,e){const t=e;return O(t<=255,"DNS encoded label cannot exceed 255","length",t),_(Ce(Vm(r).map(n=>{O(n.length<=t,`label ${JSON.stringify(r)} exceeds ${t} bytes`,"name",r);const i=new Uint8Array(n.length+1);return i.set(n,1),i[0]=i.length-1,i})))+"00"}function VE(r){return typeof r=="string"&&(r=Tt(r)),ze(Ce([Tt(f5),Tt(String(r.length)),r]))}const Gm=new Uint8Array(32);Gm.fill(0);const GE=BigInt(-1),zm=BigInt(0),Hm=BigInt(1),zE=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function HE(r){const e=Y(r),t=e.length%32;return t?Ce([e,Gm.slice(t)]):_(e)}const $E=Dn(Hm,32),_E=Dn(zm,32),vd={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Cu=["name","version","chainId","verifyingContract","salt"];function Od(r){return function(e){return O(typeof e=="string",`invalid domain value for ${JSON.stringify(r)}`,`domain.${r}`,e),e}}const jE={name:Od("name"),version:Od("version"),chainId:function(r){const e=Z(r,"domain.chainId");return O(e>=0,"invalid chain ID","domain.chainId",r),Number.isSafeInteger(e)?Number(e):sn(e)},verifyingContract:function(r){try{return Be(r).toLowerCase()}catch{}O(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",r)},salt:function(r){const e=Y(r,"domain.salt");return O(e.length===32,'invalid domain value "salt"',"domain.salt",r),_(e)}};function Su(r){{const e=r.match(/^(u?)int(\d+)$/);if(e){const t=e[1]==="",n=parseInt(e[2]);O(n%8===0&&n!==0&&n<=256&&e[2]===String(n),"invalid numeric width","type",r);const i=Vi(zE,t?n-1:n),a=t?(i+Hm)*GE:zm;return function(c){const l=Z(c,"value");return O(l>=a&&l<=i,`value out-of-bounds for ${r}`,"value",l),Dn(t?cx(l,256):l,32)}}}{const e=r.match(/^bytes(\d+)$/);if(e){const t=parseInt(e[1]);return O(t!==0&&t<=32&&e[1]===String(t),"invalid bytes width","type",r),function(n){const i=Y(n);return O(i.length===t,`invalid length for ${r}`,"value",n),HE(n)}}}switch(r){case"address":return function(e){return kn(Be(e),32)};case"bool":return function(e){return e?$E:_E};case"bytes":return function(e){return ze(e)};case"string":return function(e){return Fn(e)}}return null}function Cd(r,e){return`${r}(${e.map(({name:t,type:n})=>n+" "+t).join(",")})`}function Xs(r){const e=r.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return e?{base:e[1],index:e[2]+e[4],array:{base:e[1],prefix:e[1]+e[2],count:e[5]?parseInt(e[5]):-1}}:{base:r}}class At{primaryType;#e;get types(){return JSON.parse(this.#e)}#t;#n;constructor(e){this.#t=new Map,this.#n=new Map;const t=new Map,n=new Map,i=new Map,a={};Object.keys(e).forEach(f=>{a[f]=e[f].map(({name:p,type:h})=>{let{base:x,index:y}=Xs(h);return x==="int"&&!e.int&&(x="int256"),x==="uint"&&!e.uint&&(x="uint256"),{name:p,type:x+(y||"")}}),t.set(f,new Set),n.set(f,[]),i.set(f,new Set)}),this.#e=JSON.stringify(a);for(const f in a){const p=new Set;for(const h of a[f]){O(!p.has(h.name),`duplicate variable name ${JSON.stringify(h.name)} in ${JSON.stringify(f)}`,"types",e),p.add(h.name);const x=Xs(h.type).base;O(x!==f,`circular type reference to ${JSON.stringify(x)}`,"types",e),!Su(x)&&(O(n.has(x),`unknown type ${JSON.stringify(x)}`,"types",e),n.get(x).push(f),t.get(f).add(x))}}const c=Array.from(n.keys()).filter(f=>n.get(f).length===0);O(c.length!==0,"missing primary type","types",e),O(c.length===1,`ambiguous primary types or unused types: ${c.map(f=>JSON.stringify(f)).join(", ")}`,"types",e),re(this,{primaryType:c[0]});function l(f,p){O(!p.has(f),`circular type reference to ${JSON.stringify(f)}`,"types",e),p.add(f);for(const h of t.get(f))if(n.has(h)){l(h,p);for(const x of p)i.get(x).add(h)}p.delete(f)}l(this.primaryType,new Set);for(const[f,p]of i){const h=Array.from(p);h.sort(),this.#t.set(f,Cd(f,a[f])+h.map(x=>Cd(x,a[x])).join(""))}}getEncoder(e){let t=this.#n.get(e);return t||(t=this.#r(e),this.#n.set(e,t)),t}#r(e){{const i=Su(e);if(i)return i}const t=Xs(e).array;if(t){const i=t.prefix,a=this.getEncoder(i);return c=>{O(t.count===-1||t.count===c.length,`array length mismatch; expected length ${t.count}`,"value",c);let l=c.map(a);return this.#t.has(i)&&(l=l.map(ze)),ze(Ce(l))}}const n=this.types[e];if(n){const i=Fn(this.#t.get(e));return a=>{const c=n.map(({name:l,type:f})=>{const p=this.getEncoder(f)(a[l]);return this.#t.has(f)?ze(p):p});return c.unshift(i),Ce(c)}}O(!1,`unknown type: ${e}`,"type",e)}encodeType(e){const t=this.#t.get(e);return O(t,`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return ze(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,n){if(Su(e))return n(e,t);const i=Xs(e).array;if(i)return O(i.count===-1||i.count===t.length,`array length mismatch; expected length ${i.count}`,"value",t),t.map(c=>this._visit(i.prefix,c,n));const a=this.types[e];if(a)return a.reduce((c,{name:l,type:f})=>(c[l]=this._visit(f,t[l],n),c),{});O(!1,`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new At(e)}static getPrimaryType(e){return At.from(e).primaryType}static hashStruct(e,t,n){return At.from(t).hashStruct(e,n)}static hashDomain(e){const t=[];for(const n in e){if(e[n]==null)continue;const i=vd[n];O(i,`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),t.push({name:n,type:i})}return t.sort((n,i)=>Cu.indexOf(n.name)-Cu.indexOf(i.name)),At.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,n){return Ce(["0x1901",At.hashDomain(e),At.from(t).hash(n)])}static hash(e,t,n){return ze(At.encode(e,t,n))}static async resolveNames(e,t,n,i){e=Object.assign({},e);for(const l in e)e[l]==null&&delete e[l];const a={};e.verifyingContract&&!Le(e.verifyingContract,20)&&(a[e.verifyingContract]="0x");const c=At.from(t);c.visit(n,(l,f)=>(l==="address"&&!Le(f,20)&&(a[f]="0x"),f));for(const l in a)a[l]=await i(l);return e.verifyingContract&&a[e.verifyingContract]&&(e.verifyingContract=a[e.verifyingContract]),n=c.visit(n,(l,f)=>l==="address"&&a[f]?a[f]:f),{domain:e,value:n}}static getPayload(e,t,n){At.hashDomain(e);const i={},a=[];Cu.forEach(f=>{const p=e[f];p!=null&&(i[f]=jE[f](p),a.push({name:f,type:vd[f]}))});const c=At.from(t);t=c.types;const l=Object.assign({},t);return O(l.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",t),l.EIP712Domain=a,c.encode(n),{types:l,domain:i,primaryType:c.primaryType,message:c.visit(n,(f,p)=>{if(f.match(/^bytes(\d*)/))return _(Y(p));if(f.match(/^u?int/))return Z(p).toString();switch(f){case"address":return p.toLowerCase();case"bool":return!!p;case"string":return O(typeof p=="string","invalid string","value",p),p}O(!1,"unsupported type","type",f)})}}}function Bt(r){const e=new Set;return r.forEach(t=>e.add(t)),Object.freeze(e)}const qE="external public payable override",KE=Bt(qE.split(" ")),$m="constant external internal payable private public pure view override",QE=Bt($m.split(" ")),_m="constructor error event fallback function receive struct",jm=Bt(_m.split(" ")),qm="calldata memory storage payable indexed",JE=Bt(qm.split(" ")),WE="tuple returns",YE=[_m,qm,WE,$m].join(" "),XE=Bt(YE.split(" ")),ZE={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},e7=new RegExp("^(\\s*)"),t7=new RegExp("^([0-9]+)"),n7=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),Km=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),Qm=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");class Qt{#e;#t;get offset(){return this.#e}get length(){return this.#t.length-this.#e}constructor(e){this.#e=0,this.#t=e.slice()}clone(){return new Qt(this.#t)}reset(){this.#e=0}#n(e=0,t=0){return new Qt(this.#t.slice(e,t).map(n=>Object.freeze(Object.assign({},n,{match:n.match-e,linkBack:n.linkBack-e,linkNext:n.linkNext-e}))))}popKeyword(e){const t=this.peek();if(t.type!=="KEYWORD"||!e.has(t.text))throw new Error(`expected keyword ${t.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const t=this.peek();throw new Error(`expected ${e}; got ${t.type} ${JSON.stringify(t.text)}`)}return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const t=this.#n(this.#e+1,e.match+1);return this.#e=e.match+1,t}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const t=[];for(;this.#e<e.match-1;){const n=this.peek().linkNext;t.push(this.#n(this.#e+1,n)),this.#e=n}return this.#e=e.match+1,t}peek(){if(this.#e>=this.#t.length)throw new Error("out-of-bounds");return this.#t[this.#e]}peekKeyword(e){const t=this.peekType("KEYWORD");return t!=null&&e.has(t)?t:null}peekType(e){if(this.length===0)return null;const t=this.peek();return t.type===e?t.text:null}pop(){const e=this.peek();return this.#e++,e}toString(){const e=[];for(let t=this.#e;t<this.#t.length;t++){const n=this.#t[t];e.push(`${n.type}:${n.text}`)}return`<TokenString ${e.join(" ")}>`}}function ir(r){const e=[],t=c=>{const l=a<r.length?JSON.stringify(r[a]):"$EOI";throw new Error(`invalid token ${l} at ${a}: ${c}`)};let n=[],i=[],a=0;for(;a<r.length;){let c=r.substring(a),l=c.match(e7);l&&(a+=l[1].length,c=r.substring(a));const f={depth:n.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:a,value:-1};e.push(f);let p=ZE[c[0]]||"";if(p){if(f.type=p,f.text=c[0],a++,p==="OPEN_PAREN")n.push(e.length-1),i.push(e.length-1);else if(p=="CLOSE_PAREN")n.length===0&&t("no matching open bracket"),f.match=n.pop(),e[f.match].match=e.length-1,f.depth--,f.linkBack=i.pop(),e[f.linkBack].linkNext=e.length-1;else if(p==="COMMA")f.linkBack=i.pop(),e[f.linkBack].linkNext=e.length-1,i.push(e.length-1);else if(p==="OPEN_BRACKET")f.type="BRACKET";else if(p==="CLOSE_BRACKET"){let h=e.pop().text;if(e.length>0&&e[e.length-1].type==="NUMBER"){const x=e.pop().text;h=x+h,e[e.length-1].value=pe(x)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=h}continue}if(l=c.match(n7),l){if(f.text=l[1],a+=f.text.length,XE.has(f.text)){f.type="KEYWORD";continue}if(f.text.match(Qm)){f.type="TYPE";continue}f.type="ID";continue}if(l=c.match(t7),l){f.text=l[1],f.type="NUMBER",a+=f.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(c[0])} at position ${a}`)}return new Qt(e.map(c=>Object.freeze(c)))}function Sd(r,e){let t=[];for(const n in e.keys())r.has(n)&&t.push(n);if(t.length>1)throw new Error(`conflicting types: ${t.join(", ")}`)}function ja(r,e){if(e.peekKeyword(jm)){const t=e.pop().text;if(t!==r)throw new Error(`expected ${r}, got ${t}`)}return e.popType("ID")}function Un(r,e){const t=new Set;for(;;){const n=r.peekType("KEYWORD");if(n==null||e&&!e.has(n))break;if(r.pop(),t.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);t.add(n)}return Object.freeze(t)}function Jm(r){let e=Un(r,QE);return Sd(e,Bt("constant payable nonpayable".split(" "))),Sd(e,Bt("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function Pn(r,e){return r.popParams().map(t=>Ue.from(t,e))}function Wm(r){if(r.peekType("AT")){if(r.pop(),r.peekType("NUMBER"))return Z(r.pop().text);throw new Error("invalid gas")}return null}function Tr(r){if(r.length)throw new Error(`unexpected tokens at offset ${r.offset}: ${r.toString()}`)}const r7=new RegExp(/^(.*)\[([0-9]*)\]$/);function Nd(r){const e=r.match(Qm);if(O(e,"invalid type","type",r),r==="uint")return"uint256";if(r==="int")return"int256";if(e[2]){const t=parseInt(e[2]);O(t!==0&&t<=32,"invalid bytes length","type",r)}else if(e[3]){const t=parseInt(e[3]);O(t!==0&&t<=256&&t%8===0,"invalid numeric width","type",r)}return r}const _e={},St=Symbol.for("_ethers_internal"),Id="_ParamTypeInternal",Pd="_ErrorInternal",kd="_EventInternal",Dd="_ConstructorInternal",Fd="_FallbackInternal",Ud="_FunctionInternal",Ld="_StructInternal";class Ue{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(e,t,n,i,a,c,l,f){if(Nr(e,_e,"ParamType"),Object.defineProperty(this,St,{value:Id}),c&&(c=Object.freeze(c.slice())),i==="array"){if(l==null||f==null)throw new Error("")}else if(l!=null||f!=null)throw new Error("");if(i==="tuple"){if(c==null)throw new Error("")}else if(c!=null)throw new Error("");re(this,{name:t,type:n,baseType:i,indexed:a,components:c,arrayLength:l,arrayChildren:f})}format(e){if(e==null&&(e="sighash"),e==="json"){const n=this.name||"";if(this.isArray()){const a=JSON.parse(this.arrayChildren.format("json"));return a.name=n,a.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(a)}const i={type:this.baseType==="tuple"?"tuple":this.type,name:n};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.isTuple()&&(i.components=this.components.map(a=>JSON.parse(a.format(e)))),JSON.stringify(i)}let t="";return this.isArray()?(t+=this.arrayChildren.format(e),t+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?t+="("+this.components.map(n=>n.format(e)).join(e==="full"?", ":",")+")":t+=this.type,e!=="sighash"&&(this.indexed===!0&&(t+=" indexed"),e==="full"&&this.name&&(t+=" "+this.name)),t}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,t){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const n=this;return e.map(i=>n.arrayChildren.walk(i,t))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const n=this;return e.map((i,a)=>n.components[a].walk(i,t))}return t(this.type,e)}#e(e,t,n,i){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(this.arrayLength!==-1&&t.length!==this.arrayLength)throw new Error("array is wrong length");const c=this.arrayChildren,l=t.slice();l.forEach((f,p)=>{c.#e(e,f,n,h=>{l[p]=h})}),i(l);return}if(this.isTuple()){const c=this.components;let l;if(Array.isArray(t))l=t.slice();else{if(t==null||typeof t!="object")throw new Error("invalid tuple value");l=c.map(f=>{if(!f.name)throw new Error("cannot use object value with unnamed components");if(!(f.name in t))throw new Error(`missing value for component ${f.name}`);return t[f.name]})}if(l.length!==this.components.length)throw new Error("array is wrong length");l.forEach((f,p)=>{c[p].#e(e,f,n,h=>{l[p]=h})}),i(l);return}const a=n(this.type,t);a.then?e.push((async function(){i(await a)})()):i(a)}async walkAsync(e,t){const n=[],i=[e];return this.#e(n,e,t,a=>{i[0]=a}),n.length&&await Promise.all(n),i[0]}static from(e,t){if(Ue.isParamType(e))return e;if(typeof e=="string")try{return Ue.from(ir(e),t)}catch{O(!1,"invalid param type","obj",e)}else if(e instanceof Qt){let l="",f="",p=null;Un(e,Bt(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(f="tuple",p=e.popParams().map(R=>Ue.from(R)),l=`tuple(${p.map(R=>R.format()).join(",")})`):(l=Nd(e.popType("TYPE")),f=l);let h=null,x=null;for(;e.length&&e.peekType("BRACKET");){const R=e.pop();h=new Ue(_e,"",l,f,null,p,x,h),x=R.value,l+=R.text,f="array",p=null}let y=null;if(Un(e,JE).has("indexed")){if(!t)throw new Error("");y=!0}const v=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new Ue(_e,v,l,f,y,p,x,h)}const n=e.name;O(!n||typeof n=="string"&&n.match(Km),"invalid name","obj.name",n);let i=e.indexed;i!=null&&(O(t,"parameter cannot be indexed","obj.indexed",e.indexed),i=!!i);let a=e.type,c=a.match(r7);if(c){const l=parseInt(c[2]||"-1"),f=Ue.from({type:c[1],components:e.components});return new Ue(_e,n||"",a,"array",i,null,l,f)}if(a==="tuple"||a.startsWith("tuple(")||a.startsWith("(")){const l=e.components!=null?e.components.map(p=>Ue.from(p)):null;return new Ue(_e,n||"",a,"tuple",i,l,null,null)}return a=Nd(e.type),new Ue(_e,n||"",a,a,i,null,null,null)}static isParamType(e){return e&&e[St]===Id}}class vr{type;inputs;constructor(e,t,n){Nr(e,_e,"Fragment"),n=Object.freeze(n.slice()),re(this,{type:t,inputs:n})}static from(e){if(typeof e=="string"){try{vr.from(JSON.parse(e))}catch{}return vr.from(ir(e))}if(e instanceof Qt)switch(e.peekKeyword(jm)){case"constructor":return Nn.from(e);case"error":return Ot.from(e);case"event":return yn.from(e);case"fallback":case"receive":return Tn.from(e);case"function":return wn.from(e);case"struct":return Rr.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return Nn.from(e);case"error":return Ot.from(e);case"event":return yn.from(e);case"fallback":case"receive":return Tn.from(e);case"function":return wn.from(e);case"struct":return Rr.from(e)}G(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}O(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return Nn.isFragment(e)}static isError(e){return Ot.isFragment(e)}static isEvent(e){return yn.isFragment(e)}static isFunction(e){return wn.isFragment(e)}static isStruct(e){return Rr.isFragment(e)}}class qa extends vr{name;constructor(e,t,n,i){super(e,t,i),O(typeof n=="string"&&n.match(Km),"invalid identifier","name",n),i=Object.freeze(i.slice()),re(this,{name:n})}}function cs(r,e){return"("+e.map(t=>t.format(r)).join(r==="full"?", ":",")+")"}class Ot extends qa{constructor(e,t,n){super(e,"error",t,n),Object.defineProperty(this,St,{value:Pd})}get selector(){return Fn(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});const t=[];return e!=="sighash"&&t.push("error"),t.push(this.name+cs(e,this.inputs)),t.join(" ")}static from(e){if(Ot.isFragment(e))return e;if(typeof e=="string")return Ot.from(ir(e));if(e instanceof Qt){const t=ja("error",e),n=Pn(e);return Tr(e),new Ot(_e,t,n)}return new Ot(_e,e.name,e.inputs?e.inputs.map(Ue.from):[])}static isFragment(e){return e&&e[St]===Pd}}class yn extends qa{anonymous;constructor(e,t,n,i){super(e,"event",t,n),Object.defineProperty(this,St,{value:kd}),re(this,{anonymous:i})}get topicHash(){return Fn(this.format("sighash"))}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});const t=[];return e!=="sighash"&&t.push("event"),t.push(this.name+cs(e,this.inputs)),e!=="sighash"&&this.anonymous&&t.push("anonymous"),t.join(" ")}static getTopicHash(e,t){return t=(t||[]).map(i=>Ue.from(i)),new yn(_e,e,t,!1).topicHash}static from(e){if(yn.isFragment(e))return e;if(typeof e=="string")try{return yn.from(ir(e))}catch{O(!1,"invalid event fragment","obj",e)}else if(e instanceof Qt){const t=ja("event",e),n=Pn(e,!0),i=!!Un(e,Bt(["anonymous"])).has("anonymous");return Tr(e),new yn(_e,t,n,i)}return new yn(_e,e.name,e.inputs?e.inputs.map(t=>Ue.from(t,!0)):[],!!e.anonymous)}static isFragment(e){return e&&e[St]===kd}}class Nn extends vr{payable;gas;constructor(e,t,n,i,a){super(e,t,n),Object.defineProperty(this,St,{value:Dd}),re(this,{payable:i,gas:a})}format(e){if(G(e!=null&&e!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),e==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});const t=[`constructor${cs(e,this.inputs)}`];return this.payable&&t.push("payable"),this.gas!=null&&t.push(`@${this.gas.toString()}`),t.join(" ")}static from(e){if(Nn.isFragment(e))return e;if(typeof e=="string")try{return Nn.from(ir(e))}catch{O(!1,"invalid constuctor fragment","obj",e)}else if(e instanceof Qt){Un(e,Bt(["constructor"]));const t=Pn(e),n=!!Un(e,KE).has("payable"),i=Wm(e);return Tr(e),new Nn(_e,"constructor",t,n,i)}return new Nn(_e,"constructor",e.inputs?e.inputs.map(Ue.from):[],!!e.payable,e.gas!=null?e.gas:null)}static isFragment(e){return e&&e[St]===Dd}}class Tn extends vr{payable;constructor(e,t,n){super(e,"fallback",t),Object.defineProperty(this,St,{value:Fd}),re(this,{payable:n})}format(e){const t=this.inputs.length===0?"receive":"fallback";if(e==="json"){const n=this.payable?"payable":"nonpayable";return JSON.stringify({type:t,stateMutability:n})}return`${t}()${this.payable?" payable":""}`}static from(e){if(Tn.isFragment(e))return e;if(typeof e=="string")try{return Tn.from(ir(e))}catch{O(!1,"invalid fallback fragment","obj",e)}else if(e instanceof Qt){const t=e.toString(),n=e.peekKeyword(Bt(["fallback","receive"]));if(O(n,"type must be fallback or receive","obj",t),e.popKeyword(Bt(["fallback","receive"]))==="receive"){const l=Pn(e);return O(l.length===0,"receive cannot have arguments","obj.inputs",l),Un(e,Bt(["payable"])),Tr(e),new Tn(_e,[],!0)}let a=Pn(e);a.length?O(a.length===1&&a[0].type==="bytes","invalid fallback inputs","obj.inputs",a.map(l=>l.format("minimal")).join(", ")):a=[Ue.from("bytes")];const c=Jm(e);if(O(c==="nonpayable"||c==="payable","fallback cannot be constants","obj.stateMutability",c),Un(e,Bt(["returns"])).has("returns")){const l=Pn(e);O(l.length===1&&l[0].type==="bytes","invalid fallback outputs","obj.outputs",l.map(f=>f.format("minimal")).join(", "))}return Tr(e),new Tn(_e,a,c==="payable")}if(e.type==="receive")return new Tn(_e,[],!0);if(e.type==="fallback"){const t=[Ue.from("bytes")],n=e.stateMutability==="payable";return new Tn(_e,t,n)}O(!1,"invalid fallback description","obj",e)}static isFragment(e){return e&&e[St]===Fd}}class wn extends qa{constant;outputs;stateMutability;payable;gas;constructor(e,t,n,i,a,c){super(e,"function",t,i),Object.defineProperty(this,St,{value:Ud}),a=Object.freeze(a.slice()),re(this,{constant:n==="view"||n==="pure",gas:c,outputs:a,payable:n==="payable",stateMutability:n})}get selector(){return Fn(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="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!=null?this.gas:void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e))),outputs:this.outputs.map(n=>JSON.parse(n.format(e)))});const t=[];return e!=="sighash"&&t.push("function"),t.push(this.name+cs(e,this.inputs)),e!=="sighash"&&(this.stateMutability!=="nonpayable"&&t.push(this.stateMutability),this.outputs&&this.outputs.length&&(t.push("returns"),t.push(cs(e,this.outputs))),this.gas!=null&&t.push(`@${this.gas.toString()}`)),t.join(" ")}static getSelector(e,t){return t=(t||[]).map(i=>Ue.from(i)),new wn(_e,e,"view",t,[],null).selector}static from(e){if(wn.isFragment(e))return e;if(typeof e=="string")try{return wn.from(ir(e))}catch{O(!1,"invalid function fragment","obj",e)}else if(e instanceof Qt){const n=ja("function",e),i=Pn(e),a=Jm(e);let c=[];Un(e,Bt(["returns"])).has("returns")&&(c=Pn(e));const l=Wm(e);return Tr(e),new wn(_e,n,a,i,c,l)}let t=e.stateMutability;return t==null&&(t="payable",typeof e.constant=="boolean"?(t="view",e.constant||(t="payable",typeof e.payable=="boolean"&&!e.payable&&(t="nonpayable"))):typeof e.payable=="boolean"&&!e.payable&&(t="nonpayable")),new wn(_e,e.name,t,e.inputs?e.inputs.map(Ue.from):[],e.outputs?e.outputs.map(Ue.from):[],e.gas!=null?e.gas:null)}static isFragment(e){return e&&e[St]===Ud}}class Rr extends qa{constructor(e,t,n){super(e,"struct",t,n),Object.defineProperty(this,St,{value:Ld})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return Rr.from(ir(e))}catch{O(!1,"invalid struct fragment","obj",e)}else if(e instanceof Qt){const t=ja("struct",e),n=Pn(e);return Tr(e),new Rr(_e,t,n)}return new Rr(_e,e.name,e.inputs?e.inputs.map(Ue.from):[])}static isFragment(e){return e&&e[St]===Ld}}const un=new Map;un.set(0,"GENERIC_PANIC");un.set(1,"ASSERT_FALSE");un.set(17,"OVERFLOW");un.set(18,"DIVIDE_BY_ZERO");un.set(33,"ENUM_RANGE_ERROR");un.set(34,"BAD_STORAGE_DATA");un.set(49,"STACK_UNDERFLOW");un.set(50,"ARRAY_RANGE_ERROR");un.set(65,"OUT_OF_MEMORY");un.set(81,"UNINITIALIZED_FUNCTION_CALL");const i7=new RegExp(/^bytes([0-9]*)$/),s7=new RegExp(/^(u?int)([0-9]*)$/);let Nu=null,Md=1024;function a7(r,e,t,n){let i="missing revert data",a=null;const c=null;let l=null;if(t){i="execution reverted";const p=Y(t);if(t=_(t),p.length===0)i+=" (no data present; likely require(false) occurred",a="require(false)";else if(p.length%32!==4)i+=" (could not decode reason; invalid data length)";else if(_(p.slice(0,4))==="0x08c379a0")try{a=n.decode(["string"],p.slice(4))[0],l={signature:"Error(string)",name:"Error",args:[a]},i+=`: ${JSON.stringify(a)}`}catch{i+=" (could not decode reason; invalid string data)"}else if(_(p.slice(0,4))==="0x4e487b71")try{const h=Number(n.decode(["uint256"],p.slice(4))[0]);l={signature:"Panic(uint256)",name:"Panic",args:[h]},a=`Panic due to ${un.get(h)||"UNKNOWN"}(${h})`,i+=`: ${a}`}catch{i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const f={to:e.to?Be(e.to):null,data:e.data||"0x"};return e.from&&(f.from=Be(e.from)),He(i,"CALL_EXCEPTION",{action:r,data:t,reason:a,transaction:f,invocation:c,revert:l})}class ci{#e(e){if(e.isArray())return new E5(this.#e(e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new Ys(e.components.map(n=>this.#e(n)),e.name);switch(e.baseType){case"address":return new w5(e.name);case"bool":return new B5(e.name);case"string":return new P5(e.name);case"bytes":return new R5(e.name);case"":return new O5(e.name)}let t=e.type.match(s7);if(t){let n=parseInt(t[2]||"256");return O(n!==0&&n<=256&&n%8===0,"invalid "+t[1]+" bit length","param",e),new I5(n/8,t[1]==="int",e.name)}if(t=e.type.match(i7),t){let n=parseInt(t[1]);return O(n!==0&&n<=32,"invalid bytes length","param",e),new T5(n,e.name)}O(!1,"invalid type","type",e.type)}getDefaultValue(e){const t=e.map(i=>this.#e(Ue.from(i)));return new Ys(t,"_").defaultValue()}encode(e,t){ix(t.length,e.length,"types/values length mismatch");const n=e.map(c=>this.#e(Ue.from(c))),i=new Ys(n,"_"),a=new Yu;return i.encode(a,t),a.data}decode(e,t,n){const i=e.map(c=>this.#e(Ue.from(c)));return new Ys(i,"_").decode(new Dl(t,n,Md))}static _setDefaultMaxInflation(e){O(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),Md=e}static defaultAbiCoder(){return Nu==null&&(Nu=new ci),Nu}static getBuiltinCallException(e,t,n){return a7(e,t,n,ci.defaultAbiCoder())}}class o7{fragment;name;signature;topic;args;constructor(e,t,n){const i=e.name,a=e.format();re(this,{fragment:e,name:i,signature:a,topic:t,args:n})}}class c7{fragment;name;args;signature;selector;value;constructor(e,t,n,i){const a=e.name,c=e.format();re(this,{fragment:e,name:a,args:n,signature:c,selector:t,value:i})}}class u7{fragment;name;args;signature;selector;constructor(e,t,n){const i=e.name,a=e.format();re(this,{fragment:e,name:i,args:n,signature:a,selector:t})}}class Vd{hash;_isIndexed;static isIndexed(e){return!!(e&&e._isIndexed)}constructor(e){re(this,{hash:e,_isIndexed:!0})}}const Gd={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},zd={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:r=>`reverted with reason string ${JSON.stringify(r)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:r=>{let e="unknown panic code";return r>=0&&r<=255&&Gd[r.toString()]&&(e=Gd[r.toString()]),`reverted with panic code 0x${r.toString(16)} (${e})`}}};class br{fragments;deploy;fallback;receive;#e;#t;#n;#r;constructor(e){let t=[];typeof e=="string"?t=JSON.parse(e):t=e,this.#n=new Map,this.#e=new Map,this.#t=new Map;const n=[];for(const c of t)try{n.push(vr.from(c))}catch(l){console.log(`[Warning] Invalid Fragment ${JSON.stringify(c)}:`,l.message)}re(this,{fragments:Object.freeze(n)});let i=null,a=!1;this.#r=this.getAbiCoder(),this.fragments.forEach((c,l)=>{let f;switch(c.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}re(this,{deploy:c});return;case"fallback":c.inputs.length===0?a=!0:(O(!i||c.payable!==i.payable,"conflicting fallback fragments",`fragments[${l}]`,c),i=c,a=i.payable);return;case"function":f=this.#n;break;case"event":f=this.#t;break;case"error":f=this.#e;break;default:return}const p=c.format();f.has(p)||f.set(p,c)}),this.deploy||re(this,{deploy:Nn.from("constructor()")}),re(this,{fallback:i,receive:a})}format(e){const t=e?"minimal":"full";return this.fragments.map(i=>i.format(t))}formatJson(){const e=this.fragments.map(t=>t.format("json"));return JSON.stringify(e.map(t=>JSON.parse(t)))}getAbiCoder(){return ci.defaultAbiCoder()}#i(e,t,n){if(Le(e)){const a=e.toLowerCase();for(const c of this.#n.values())if(a===c.selector)return c;return null}if(e.indexOf("(")===-1){const a=[];for(const[c,l]of this.#n)c.split("(")[0]===e&&a.push(l);if(t){const c=t.length>0?t[t.length-1]:null;let l=t.length,f=!0;Ke.isTyped(c)&&c.type==="overrides"&&(f=!1,l--);for(let p=a.length-1;p>=0;p--){const h=a[p].inputs.length;h!==l&&(!f||h!==l-1)&&a.splice(p,1)}for(let p=a.length-1;p>=0;p--){const h=a[p].inputs;for(let x=0;x<t.length;x++)if(Ke.isTyped(t[x])){if(x>=h.length){if(t[x].type==="overrides")continue;a.splice(p,1);break}if(t[x].type!==h[x].baseType){a.splice(p,1);break}}}}if(a.length===1&&t&&t.length!==a[0].inputs.length){const c=t[t.length-1];(c==null||Array.isArray(c)||typeof c!="object")&&a.splice(0,1)}if(a.length===0)return null;if(a.length>1&&n){const c=a.map(l=>JSON.stringify(l.format())).join(", ");O(!1,`ambiguous function description (i.e. matches ${c})`,"key",e)}return a[0]}const i=this.#n.get(wn.from(e).format());return i||null}getFunctionName(e){const t=this.#i(e,null,!1);return O(t,"no matching function","key",e),t.name}hasFunction(e){return!!this.#i(e,null,!1)}getFunction(e,t){return this.#i(e,t||null,!0)}forEachFunction(e){const t=Array.from(this.#n.keys());t.sort((n,i)=>n.localeCompare(i));for(let n=0;n<t.length;n++){const i=t[n];e(this.#n.get(i),n)}}#a(e,t,n){if(Le(e)){const a=e.toLowerCase();for(const c of this.#t.values())if(a===c.topicHash)return c;return null}if(e.indexOf("(")===-1){const a=[];for(const[c,l]of this.#t)c.split("(")[0]===e&&a.push(l);if(t){for(let c=a.length-1;c>=0;c--)a[c].inputs.length<t.length&&a.splice(c,1);for(let c=a.length-1;c>=0;c--){const l=a[c].inputs;for(let f=0;f<t.length;f++)if(Ke.isTyped(t[f])&&t[f].type!==l[f].baseType){a.splice(c,1);break}}}if(a.length===0)return null;if(a.length>1&&n){const c=a.map(l=>JSON.stringify(l.format())).join(", ");O(!1,`ambiguous event description (i.e. matches ${c})`,"key",e)}return a[0]}const i=this.#t.get(yn.from(e).format());return i||null}getEventName(e){const t=this.#a(e,null,!1);return O(t,"no matching event","key",e),t.name}hasEvent(e){return!!this.#a(e,null,!1)}getEvent(e,t){return this.#a(e,t||null,!0)}forEachEvent(e){const t=Array.from(this.#t.keys());t.sort((n,i)=>n.localeCompare(i));for(let n=0;n<t.length;n++){const i=t[n];e(this.#t.get(i),n)}}getError(e,t){if(Le(e)){const i=e.toLowerCase();if(zd[i])return Ot.from(zd[i].signature);for(const a of this.#e.values())if(i===a.selector)return a;return null}if(e.indexOf("(")===-1){const i=[];for(const[a,c]of this.#e)a.split("(")[0]===e&&i.push(c);if(i.length===0)return e==="Error"?Ot.from("error Error(string)"):e==="Panic"?Ot.from("error Panic(uint256)"):null;if(i.length>1){const a=i.map(c=>JSON.stringify(c.format())).join(", ");O(!1,`ambiguous error description (i.e. ${a})`,"name",e)}return i[0]}if(e=Ot.from(e).format(),e==="Error(string)")return Ot.from("error Error(string)");if(e==="Panic(uint256)")return Ot.from("error Panic(uint256)");const n=this.#e.get(e);return n||null}forEachError(e){const t=Array.from(this.#e.keys());t.sort((n,i)=>n.localeCompare(i));for(let n=0;n<t.length;n++){const i=t[n];e(this.#e.get(i),n)}}_decodeParams(e,t){return this.#r.decode(e,t)}_encodeParams(e,t){return this.#r.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){if(typeof e=="string"){const n=this.getError(e);O(n,"unknown error","fragment",e),e=n}return O(Ve(t,0,4)===e.selector,`data signature does not match error ${e.name}.`,"data",t),this._decodeParams(e.inputs,Ve(t,4))}encodeErrorResult(e,t){if(typeof e=="string"){const n=this.getError(e);O(n,"unknown error","fragment",e),e=n}return Ce([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionData(e,t){if(typeof e=="string"){const n=this.getFunction(e);O(n,"unknown function","fragment",e),e=n}return O(Ve(t,0,4)===e.selector,`data signature does not match function ${e.name}.`,"data",t),this._decodeParams(e.inputs,Ve(t,4))}encodeFunctionData(e,t){if(typeof e=="string"){const n=this.getFunction(e);O(n,"unknown function","fragment",e),e=n}return Ce([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionResult(e,t){if(typeof e=="string"){const a=this.getFunction(e);O(a,"unknown function","fragment",e),e=a}let n="invalid length for result data";const i=ft(t);if(i.length%32===0)try{return this.#r.decode(e.outputs,i)}catch{n="could not decode result data"}G(!1,n,"BAD_DATA",{value:_(i),info:{method:e.name,signature:e.format()}})}makeError(e,t){const n=Y(e,"data"),i=ci.getBuiltinCallException("call",t,n);if(i.message.startsWith("execution reverted (unknown custom error)")){const l=_(n.slice(0,4)),f=this.getError(l);if(f)try{const p=this.#r.decode(f.inputs,n.slice(4));i.revert={name:f.name,signature:f.format(),args:p},i.reason=i.revert.signature,i.message=`execution reverted: ${i.reason}`}catch{i.message="execution reverted (coult not decode custom error)"}}const c=this.parseTransaction(t);return c&&(i.invocation={method:c.name,signature:c.signature,args:c.args}),i}encodeFunctionResult(e,t){if(typeof e=="string"){const n=this.getFunction(e);O(n,"unknown function","fragment",e),e=n}return _(this.#r.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){if(typeof e=="string"){const a=this.getEvent(e);O(a,"unknown event","eventFragment",e),e=a}G(t.length<=e.inputs.length,`too many arguments for ${e.format()}`,"UNEXPECTED_ARGUMENT",{count:t.length,expectedCount:e.inputs.length});const n=[];e.anonymous||n.push(e.topicHash);const i=(a,c)=>a.type==="string"?Fn(c):a.type==="bytes"?ze(_(c)):(a.type==="bool"&&typeof c=="boolean"?c=c?"0x01":"0x00":a.type.match(/^u?int/)?c=Dn(c):a.type.match(/^bytes/)?c=hA(c,32):a.type==="address"&&this.#r.encode(["address"],[c]),kn(_(c),32));for(t.forEach((a,c)=>{const l=e.inputs[c];if(!l.indexed){O(a==null,"cannot filter non-indexed parameters; must be null","contract."+l.name,a);return}a==null?n.push(null):l.baseType==="array"||l.baseType==="tuple"?O(!1,"filtering with tuples or arrays not supported","contract."+l.name,a):Array.isArray(a)?n.push(a.map(f=>i(l,f))):n.push(i(l,a))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,t){if(typeof e=="string"){const c=this.getEvent(e);O(c,"unknown event","eventFragment",e),e=c}const n=[],i=[],a=[];return e.anonymous||n.push(e.topicHash),O(t.length===e.inputs.length,"event arguments/values mismatch","values",t),e.inputs.forEach((c,l)=>{const f=t[l];if(c.indexed)if(c.type==="string")n.push(Fn(f));else if(c.type==="bytes")n.push(ze(f));else{if(c.baseType==="tuple"||c.baseType==="array")throw new Error("not implemented");n.push(this.#r.encode([c.type],[f]))}else i.push(c),a.push(f)}),{data:this.#r.encode(i,a),topics:n}}decodeEventLog(e,t,n){if(typeof e=="string"){const E=this.getEvent(e);O(E,"unknown event","eventFragment",e),e=E}if(n!=null&&!e.anonymous){const E=e.topicHash;O(Le(n[0],32)&&n[0].toLowerCase()===E,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}const i=[],a=[],c=[];e.inputs.forEach((E,v)=>{E.indexed?E.type==="string"||E.type==="bytes"||E.baseType==="tuple"||E.baseType==="array"?(i.push(Ue.from({type:"bytes32",name:E.name})),c.push(!0)):(i.push(E),c.push(!1)):(a.push(E),c.push(!1))});const l=n!=null?this.#r.decode(i,Ce(n)):null,f=this.#r.decode(a,t,!0),p=[],h=[];let x=0,y=0;return e.inputs.forEach((E,v)=>{let R=null;if(E.indexed)if(l==null)R=new Vd(null);else if(c[v])R=new Vd(l[y++]);else try{R=l[y++]}catch(C){R=C}else try{R=f[x++]}catch(C){R=C}p.push(R),h.push(E.name||null)}),Sn.fromItems(p,h)}parseTransaction(e){const t=Y(e.data,"tx.data"),n=Z(e.value!=null?e.value:0,"tx.value"),i=this.getFunction(_(t.slice(0,4)));if(!i)return null;const a=this.#r.decode(i.inputs,t.slice(4));return new c7(i,i.selector,a,n)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new o7(t,t.topicHash,this.decodeEventLog(t,e.data,e.topics))}parseError(e){const t=_(e),n=this.getError(Ve(t,0,4));if(!n)return null;const i=this.#r.decode(n.inputs,Ve(t,4));return new u7(n,n.selector,i)}static from(e){return e instanceof br?e:typeof e=="string"?new br(JSON.parse(e)):typeof e.formatJson=="function"?new br(e.formatJson()):typeof e.format=="function"?new br(e.format("json")):new br(e)}}const Ym=BigInt(0);function Zr(r){return r??null}function Je(r){return r==null?null:r.toString()}class Hd{gasPrice;maxFeePerGas;maxPriorityFeePerGas;constructor(e,t,n){re(this,{gasPrice:Zr(e),maxFeePerGas:Zr(t),maxPriorityFeePerGas:Zr(n)})}toJSON(){const{gasPrice:e,maxFeePerGas:t,maxPriorityFeePerGas:n}=this;return{_type:"FeeData",gasPrice:Je(e),maxFeePerGas:Je(t),maxPriorityFeePerGas:Je(n)}}}function us(r){const e={};r.to&&(e.to=r.to),r.from&&(e.from=r.from),r.data&&(e.data=_(r.data));const t="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const i of t)!(i in r)||r[i]==null||(e[i]=Z(r[i],`request.${i}`));const n="type,nonce".split(/,/);for(const i of n)!(i in r)||r[i]==null||(e[i]=pe(r[i],`request.${i}`));return r.accessList&&(e.accessList=Ir(r.accessList)),r.authorizationList&&(e.authorizationList=r.authorizationList.slice()),"blockTag"in r&&(e.blockTag=r.blockTag),"enableCcipRead"in r&&(e.enableCcipRead=!!r.enableCcipRead),"customData"in r&&(e.customData=r.customData),"blobVersionedHashes"in r&&r.blobVersionedHashes&&(e.blobVersionedHashes=r.blobVersionedHashes.slice()),"kzg"in r&&(e.kzg=r.kzg),"blobWrapperVersion"in r&&(e.blobWrapperVersion=r.blobWrapperVersion),"blobs"in r&&r.blobs&&(e.blobs=r.blobs.map(i=>Fa(i)?_(i):Object.assign({},i))),e}class l7{provider;number;hash;timestamp;parentHash;parentBeaconBlockRoot;nonce;difficulty;gasLimit;gasUsed;stateRoot;receiptsRoot;blobGasUsed;excessBlobGas;miner;prevRandao;extraData;baseFeePerGas;#e;constructor(e,t){this.#e=e.transactions.map(n=>typeof n!="string"?new As(n,t):n),re(this,{provider:t,hash:Zr(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,prevRandao:Zr(e.prevRandao),extraData:e.extraData,baseFeePerGas:Zr(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return this.#e.map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=this.#e.slice();return e.length===0?[]:(G(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:t,extraData:n,gasLimit:i,gasUsed:a,hash:c,miner:l,prevRandao:f,nonce:p,number:h,parentHash:x,parentBeaconBlockRoot:y,stateRoot:E,receiptsRoot:v,timestamp:R,transactions:C}=this;return{_type:"Block",baseFeePerGas:Je(e),difficulty:Je(t),extraData:n,gasLimit:Je(i),gasUsed:Je(a),blobGasUsed:Je(this.blobGasUsed),excessBlobGas:Je(this.excessBlobGas),hash:c,miner:l,prevRandao:f,nonce:p,number:h,parentHash:x,timestamp:R,parentBeaconBlockRoot:y,stateRoot:E,receiptsRoot:v,transactions:C}}[Symbol.iterator](){let e=0;const t=this.transactions;return{next:()=>e<this.length?{value:t[e++],done:!1}:{value:void 0,done:!0}}}get length(){return this.#e.length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(e){let t;if(typeof e=="number")t=this.#e[e];else{const n=e.toLowerCase();for(const i of this.#e)if(typeof i=="string"){if(i!==n)continue;t=i;break}else{if(i.hash!==n)continue;t=i;break}}if(t==null)throw new Error("no such tx");return typeof t=="string"?await this.provider.getTransaction(t):t}getPrefetchedTransaction(e){const t=this.prefetchedTransactions;if(typeof e=="number")return t[e];e=e.toLowerCase();for(const n of t)if(n.hash===e)return n;O(!1,"no matching transaction","indexOrHash",e)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return f7(this)}}class ws{provider;transactionHash;blockHash;blockNumber;removed;address;data;topics;index;transactionIndex;constructor(e,t){this.provider=t;const n=Object.freeze(e.topics.slice());re(this,{transactionHash:e.transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,removed:e.removed,address:e.address,data:e.data,topics:n,index:e.index,transactionIndex:e.transactionIndex})}toJSON(){const{address:e,blockHash:t,blockNumber:n,data:i,index:a,removed:c,topics:l,transactionHash:f,transactionIndex:p}=this;return{_type:"log",address:e,blockHash:t,blockNumber:n,data:i,index:a,removed:c,topics:l,transactionHash:f,transactionIndex:p}}async getBlock(){const e=await this.provider.getBlock(this.blockHash);return G(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransaction(){const e=await this.provider.getTransaction(this.transactionHash);return G(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransactionReceipt(){const e=await this.provider.getTransactionReceipt(this.transactionHash);return G(!!e,"failed to find transaction receipt","UNKNOWN_ERROR",{}),e}removedEvent(){return h7(this)}}class Xm{provider;to;from;contractAddress;hash;index;blockHash;blockNumber;logsBloom;gasUsed;blobGasUsed;cumulativeGasUsed;gasPrice;blobGasPrice;type;status;root;#e;constructor(e,t){this.#e=Object.freeze(e.logs.map(i=>new ws(i,t)));let n=Ym;e.effectiveGasPrice!=null?n=e.effectiveGasPrice:e.gasPrice!=null&&(n=e.gasPrice),re(this,{provider:t,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:n,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return this.#e}toJSON(){const{to:e,from:t,contractAddress:n,hash:i,index:a,blockHash:c,blockNumber:l,logsBloom:f,logs:p,status:h,root:x}=this;return{_type:"TransactionReceipt",blockHash:c,blockNumber:l,contractAddress:n,cumulativeGasUsed:Je(this.cumulativeGasUsed),from:t,gasPrice:Je(this.gasPrice),blobGasUsed:Je(this.blobGasUsed),blobGasPrice:Je(this.blobGasPrice),gasUsed:Je(this.gasUsed),hash:i,index:a,logs:p,logsBloom:f,root:x,status:h,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e<this.length?{value:this.logs[e++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){const e=await this.provider.getBlock(this.blockHash);if(e==null)throw new Error("TODO");return e}async getTransaction(){const e=await this.provider.getTransaction(this.hash);if(e==null)throw new Error("TODO");return e}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return eb(this)}reorderedEvent(e){return G(!e||e.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),Zm(this,e)}}class As{provider;blockNumber;blockHash;index;hash;type;to;from;nonce;gasLimit;gasPrice;maxPriorityFeePerGas;maxFeePerGas;maxFeePerBlobGas;data;value;chainId;signature;accessList;blobVersionedHashes;authorizationList;#e;constructor(e,t){this.provider=t,this.blockNumber=e.blockNumber!=null?e.blockNumber:null,this.blockHash=e.blockHash!=null?e.blockHash:null,this.hash=e.hash,this.index=e.index,this.type=e.type,this.from=e.from,this.to=e.to||null,this.gasLimit=e.gasLimit,this.nonce=e.nonce,this.data=e.data,this.value=e.value,this.gasPrice=e.gasPrice,this.maxPriorityFeePerGas=e.maxPriorityFeePerGas!=null?e.maxPriorityFeePerGas:null,this.maxFeePerGas=e.maxFeePerGas!=null?e.maxFeePerGas:null,this.maxFeePerBlobGas=e.maxFeePerBlobGas!=null?e.maxFeePerBlobGas:null,this.chainId=e.chainId,this.signature=e.signature,this.accessList=e.accessList!=null?e.accessList:null,this.blobVersionedHashes=e.blobVersionedHashes!=null?e.blobVersionedHashes:null,this.authorizationList=e.authorizationList!=null?e.authorizationList:null,this.#e=-1}toJSON(){const{blockNumber:e,blockHash:t,index:n,hash:i,type:a,to:c,from:l,nonce:f,data:p,signature:h,accessList:x,blobVersionedHashes:y}=this;return{_type:"TransactionResponse",accessList:x,blockNumber:e,blockHash:t,blobVersionedHashes:y,chainId:Je(this.chainId),data:p,from:l,gasLimit:Je(this.gasLimit),gasPrice:Je(this.gasPrice),hash:i,maxFeePerGas:Je(this.maxFeePerGas),maxPriorityFeePerGas:Je(this.maxPriorityFeePerGas),maxFeePerBlobGas:Je(this.maxFeePerBlobGas),nonce:f,signature:h,to:c,index:n,type:a,value:Je(this.value)}}async getBlock(){let e=this.blockNumber;if(e==null){const n=await this.getTransaction();n&&(e=n.blockNumber)}if(e==null)return null;const t=this.provider.getBlock(e);if(t==null)throw new Error("TODO");return t}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){const{tx:t,blockNumber:n}=await xt({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return t==null||t.blockNumber==null?0:n-t.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(e,t){const n=e??1,i=t??0;let a=this.#e,c=-1,l=a===-1;const f=async()=>{if(l)return null;const{blockNumber:y,nonce:E}=await xt({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(E<this.nonce){a=y;return}if(l)return null;const v=await this.getTransaction();if(!(v&&v.blockNumber!=null))for(c===-1&&(c=a-3,c<this.#e&&(c=this.#e));c<=y;){if(l)return null;const R=await this.provider.getBlock(c,!0);if(R==null)return;for(const C of R)if(C===this.hash)return;for(let C=0;C<R.length;C++){const S=await R.getTransaction(C);if(S.from===this.from&&S.nonce===this.nonce){if(l)return null;const D=await this.provider.getTransactionReceipt(S.hash);if(D==null||y-D.blockNumber+1<n)return;let U="replaced";S.data===this.data&&S.to===this.to&&S.value===this.value?U="repriced":S.data==="0x"&&S.from===S.to&&S.value===Ym&&(U="cancelled"),G(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:U==="replaced"||U==="cancelled",reason:U,replacement:S.replaceableTransaction(a),hash:S.hash,receipt:D})}}c++}},p=y=>{if(y==null||y.status!==0)return y;G(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:y.to,from:y.from,data:""},receipt:y})},h=await this.provider.getTransactionReceipt(this.hash);if(n===0)return p(h);if(h){if(n===1||await h.confirmations()>=n)return p(h)}else if(await f(),n===0)return null;return await new Promise((y,E)=>{const v=[],R=()=>{v.forEach(S=>S())};if(v.push(()=>{l=!0}),i>0){const S=setTimeout(()=>{R(),E(He("wait for transaction timeout","TIMEOUT"))},i);v.push(()=>{clearTimeout(S)})}const C=async S=>{if(await S.confirmations()>=n){R();try{y(p(S))}catch(D){E(D)}}};if(v.push(()=>{this.provider.off(this.hash,C)}),this.provider.on(this.hash,C),a>=0){const S=async()=>{try{await f()}catch(D){if(lt(D,"TRANSACTION_REPLACED")){R(),E(D);return}}l||this.provider.once("block",S)};v.push(()=>{this.provider.off("block",S)}),this.provider.once("block",S)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return G(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),eb(this)}reorderedEvent(e){return G(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),G(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Zm(this,e)}replaceableTransaction(e){O(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const t=new As(this,this.provider);return t.#e=e,t}}function f7(r){return{orphan:"drop-block",hash:r.hash,number:r.number}}function Zm(r,e){return{orphan:"reorder-transaction",tx:r,other:e}}function eb(r){return{orphan:"drop-transaction",tx:r}}function h7(r){return{orphan:"drop-log",log:{transactionHash:r.transactionHash,blockHash:r.blockHash,blockNumber:r.blockNumber,address:r.address,data:r.data,topics:Object.freeze(r.topics.slice()),index:r.index}}}class Yl extends ws{interface;fragment;args;constructor(e,t,n){super(e,e.provider);const i=t.decodeEventLog(n,e.data,e.topics);re(this,{args:i,fragment:n,interface:t})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class tb extends ws{error;constructor(e,t){super(e,e.provider),re(this,{error:t})}}class d7 extends Xm{#e;constructor(e,t,n){super(n,t),this.#e=e}get logs(){return super.logs.map(e=>{const t=e.topics.length?this.#e.getEvent(e.topics[0]):null;if(t)try{return new Yl(e,this.#e,t)}catch(n){return new tb(e,n)}return e})}}class Xl extends As{#e;constructor(e,t,n){super(n,t),this.#e=e}async wait(e,t){const n=await super.wait(e,t);return n==null?null:new d7(this.#e,this.provider,n)}}class nb extends lx{log;constructor(e,t,n,i){super(e,t,n),re(this,{log:i})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class p7 extends nb{constructor(e,t,n,i,a){super(e,t,n,new Yl(a,e.interface,i));const c=e.interface.decodeEventLog(i,this.log.data,this.log.topics);re(this,{args:c,fragment:i})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const $d=BigInt(0);function rb(r){return r&&typeof r.call=="function"}function ib(r){return r&&typeof r.estimateGas=="function"}function Ka(r){return r&&typeof r.resolveName=="function"}function sb(r){return r&&typeof r.sendTransaction=="function"}function ab(r){if(r!=null){if(Ka(r))return r;if(r.provider)return r.provider}}class x7{#e;fragment;constructor(e,t,n){if(re(this,{fragment:t}),t.inputs.length<n.length)throw new Error("too many arguments");const i=Or(e.runner,"resolveName"),a=Ka(i)?i:null;this.#e=(async function(){const c=await Promise.all(t.inputs.map((l,f)=>n[f]==null?null:l.walkAsync(n[f],(h,x)=>h==="address"?Array.isArray(x)?Promise.all(x.map(y=>at(y,a))):at(x,a):x)));return e.interface.encodeFilterTopics(t,c)})()}getTopicFilter(){return this.#e}}function Or(r,e){return r==null?null:typeof r[e]=="function"?r:r.provider&&typeof r.provider[e]=="function"?r.provider:null}function wr(r){return r==null?null:r.provider||null}async function ob(r,e){const t=Ke.dereference(r,"overrides");O(typeof t=="object","invalid overrides parameter","overrides",r);const n=us(t);return O(n.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",n.to),O(n.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",n.data),n.from&&(n.from=n.from),n}async function m7(r,e,t){const n=Or(r,"resolveName"),i=Ka(n)?n:null;return await Promise.all(e.map((a,c)=>a.walkAsync(t[c],(l,f)=>(f=Ke.dereference(f,l),l==="address"?at(f,i):f))))}function b7(r){const e=async function(c){const l=await ob(c,["data"]);l.to=await r.getAddress(),l.from&&(l.from=await at(l.from,ab(r.runner)));const f=r.interface,p=Z(l.value||$d,"overrides.value")===$d,h=(l.data||"0x")==="0x";f.fallback&&!f.fallback.payable&&f.receive&&!h&&!p&&O(!1,"cannot send data to receive or send value to non-payable fallback","overrides",c),O(f.fallback||h,"cannot send data to receive-only contract","overrides.data",l.data);const x=f.receive||f.fallback&&f.fallback.payable;return O(x||p,"cannot send value to non-payable fallback","overrides.value",l.value),O(f.fallback||h,"cannot send data to receive-only contract","overrides.data",l.data),l},t=async function(c){const l=Or(r.runner,"call");G(rb(l),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const f=await e(c);try{return await l.call(f)}catch(p){throw kl(p)&&p.data?r.interface.makeError(p.data,f):p}},n=async function(c){const l=r.runner;G(sb(l),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const f=await l.sendTransaction(await e(c)),p=wr(r.runner);return new Xl(r.interface,p,f)},i=async function(c){const l=Or(r.runner,"estimateGas");return G(ib(l),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await l.estimateGas(await e(c))},a=async c=>await n(c);return re(a,{_contract:r,estimateGas:i,populateTransaction:e,send:n,staticCall:t}),a}function g7(r,e){const t=function(...p){const h=r.interface.getFunction(e,p);return G(h,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:p}}),h},n=async function(...p){const h=t(...p);let x={};if(h.inputs.length+1===p.length&&(x=await ob(p.pop()),x.from&&(x.from=await at(x.from,ab(r.runner)))),h.inputs.length!==p.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const y=await m7(r.runner,h.inputs,p);return Object.assign({},x,await xt({to:r.getAddress(),data:r.interface.encodeFunctionData(h,y)}))},i=async function(...p){const h=await l(...p);return h.length===1?h[0]:h},a=async function(...p){const h=r.runner;G(sb(h),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const x=await h.sendTransaction(await n(...p)),y=wr(r.runner);return new Xl(r.interface,y,x)},c=async function(...p){const h=Or(r.runner,"estimateGas");return G(ib(h),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await h.estimateGas(await n(...p))},l=async function(...p){const h=Or(r.runner,"call");G(rb(h),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const x=await n(...p);let y="0x";try{y=await h.call(x)}catch(v){throw kl(v)&&v.data?r.interface.makeError(v.data,x):v}const E=t(...p);return r.interface.decodeFunctionResult(E,y)},f=async(...p)=>t(...p).constant?await i(...p):await a(...p);return re(f,{name:r.interface.getFunctionName(e),_contract:r,_key:e,getFragment:t,estimateGas:c,populateTransaction:n,send:a,staticCall:i,staticCallResult:l}),Object.defineProperty(f,"fragment",{configurable:!1,enumerable:!0,get:()=>{const p=r.interface.getFunction(e);return G(p,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),p}}),f}function y7(r,e){const t=function(...i){const a=r.interface.getEvent(e,i);return G(a,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:i}}),a},n=function(...i){return new x7(r,t(...i),i)};return re(n,{name:r.interface.getEventName(e),_contract:r,_key:e,getFragment:t}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{const i=r.interface.getEvent(e);return G(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),i}}),n}const Ea=Symbol.for("_ethersInternal_contract"),cb=new WeakMap;function w7(r,e){cb.set(r[Ea],e)}function It(r){return cb.get(r[Ea])}function A7(r){return r&&typeof r=="object"&&"getTopicFilter"in r&&typeof r.getTopicFilter=="function"&&r.fragment}async function Zl(r,e){let t,n=null;if(Array.isArray(e)){const a=function(c){if(Le(c,32))return c;const l=r.interface.getEvent(c);return O(l,"unknown fragment","name",c),l.topicHash};t=e.map(c=>c==null?null:Array.isArray(c)?c.map(a):a(c))}else e==="*"?t=[null]:typeof e=="string"?Le(e,32)?t=[e]:(n=r.interface.getEvent(e),O(n,"unknown fragment","event",e),t=[n.topicHash]):A7(e)?t=await e.getTopicFilter():"fragment"in e?(n=e.fragment,t=[n.topicHash]):O(!1,"unknown event name","event",e);t=t.map(a=>{if(a==null)return null;if(Array.isArray(a)){const c=Array.from(new Set(a.map(l=>l.toLowerCase())).values());return c.length===1?c[0]:(c.sort(),c)}return a.toLowerCase()});const i=t.map(a=>a==null?"null":Array.isArray(a)?a.join("|"):a).join("&");return{fragment:n,tag:i,topics:t}}async function zi(r,e){const{subs:t}=It(r);return t.get((await Zl(r,e)).tag)||null}async function _d(r,e,t){const n=wr(r.runner);G(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:i,tag:a,topics:c}=await Zl(r,t),{addr:l,subs:f}=It(r);let p=f.get(a);if(!p){const x={address:l||r,topics:c},y=C=>{let S=i;if(S==null)try{S=r.interface.getEvent(C.topics[0])}catch{}if(S){const D=S,U=i?r.interface.decodeEventLog(i,C.data,C.topics):[];fl(r,t,U,K=>new p7(r,K,t,D,C))}else fl(r,t,[],D=>new nb(r,D,t,C))};let E=[];p={tag:a,listeners:[],start:()=>{E.length||E.push(n.on(x,y))},stop:async()=>{if(E.length==0)return;let C=E;E=[],await Promise.all(C),n.off(x,y)}},f.set(a,p)}return p}let ll=Promise.resolve();async function E7(r,e,t,n){await ll;const i=await zi(r,e);if(!i)return!1;const a=i.listeners.length;return i.listeners=i.listeners.filter(({listener:c,once:l})=>{const f=Array.from(t);n&&f.push(n(l?null:c));try{c.call(r,...f)}catch{}return!l}),i.listeners.length===0&&(i.stop(),It(r).subs.delete(i.tag)),a>0}async function fl(r,e,t,n){try{await ll}catch{}const i=E7(r,e,t,n);return ll=i,await i}const Zs=["then"];class Qi{target;interface;runner;filters;[Ea];fallback;constructor(e,t,n,i){O(typeof e=="string"||pm(e),"invalid value for Contract target","target",e),n==null&&(n=null);const a=br.from(t);re(this,{target:e,runner:n,interface:a}),Object.defineProperty(this,Ea,{value:{}});let c,l=null,f=null;if(i){const x=wr(n);f=new Xl(this.interface,x,i)}let p=new Map;if(typeof e=="string")if(Le(e))l=e,c=Promise.resolve(e);else{const x=Or(n,"resolveName");if(!Ka(x))throw He("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});c=x.resolveName(e).then(y=>{if(y==null)throw He("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return It(this).addr=y,y})}else c=e.getAddress().then(x=>{if(x==null)throw new Error("TODO");return It(this).addr=x,x});w7(this,{addrPromise:c,addr:l,deployTx:f,subs:p});const h=new Proxy({},{get:(x,y,E)=>{if(typeof y=="symbol"||Zs.indexOf(y)>=0)return Reflect.get(x,y,E);try{return this.getEvent(y)}catch(v){if(!lt(v,"INVALID_ARGUMENT")||v.argument!=="key")throw v}},has:(x,y)=>Zs.indexOf(y)>=0?Reflect.has(x,y):Reflect.has(x,y)||this.interface.hasEvent(String(y))});return re(this,{filters:h}),re(this,{fallback:a.receive||a.fallback?b7(this):null}),new Proxy(this,{get:(x,y,E)=>{if(typeof y=="symbol"||y in x||Zs.indexOf(y)>=0)return Reflect.get(x,y,E);try{return x.getFunction(y)}catch(v){if(!lt(v,"INVALID_ARGUMENT")||v.argument!=="key")throw v}},has:(x,y)=>typeof y=="symbol"||y in x||Zs.indexOf(y)>=0?Reflect.has(x,y):x.interface.hasFunction(y)})}connect(e){return new Qi(this.target,this.interface,e)}attach(e){return new Qi(e,this.interface,this.runner)}async getAddress(){return await It(this).addrPromise}async getDeployedCode(){const e=wr(this.runner);G(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const t=await e.getCode(await this.getAddress());return t==="0x"?null:t}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const n=wr(this.runner);return G(n!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((i,a)=>{const c=async()=>{try{if(await this.getDeployedCode()!=null)return i(this);n.once("block",c)}catch(l){a(l)}};c()})}deploymentTransaction(){return It(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),g7(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),y7(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,t,n){t==null&&(t=0),n==null&&(n="latest");const{addr:i,addrPromise:a}=It(this),c=i||await a,{fragment:l,topics:f}=await Zl(this,e),p={address:c,topics:f,fromBlock:t,toBlock:n},h=wr(this.runner);return G(h,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await h.getLogs(p)).map(x=>{let y=l;if(y==null)try{y=this.interface.getEvent(x.topics[0])}catch{}if(y)try{return new Yl(x,this.interface,y)}catch(E){return new tb(x,E)}return new ws(x,h)})}async on(e,t){const n=await _d(this,"on",e);return n.listeners.push({listener:t,once:!1}),n.start(),this}async once(e,t){const n=await _d(this,"once",e);return n.listeners.push({listener:t,once:!0}),n.start(),this}async emit(e,...t){return await fl(this,e,t,null)}async listenerCount(e){if(e){const i=await zi(this,e);return i?i.listeners.length:0}const{subs:t}=It(this);let n=0;for(const{listeners:i}of t.values())n+=i.length;return n}async listeners(e){if(e){const i=await zi(this,e);return i?i.listeners.map(({listener:a})=>a):[]}const{subs:t}=It(this);let n=[];for(const{listeners:i}of t.values())n=n.concat(i.map(({listener:a})=>a));return n}async off(e,t){const n=await zi(this,e);if(!n)return this;if(t){const i=n.listeners.map(({listener:a})=>a).indexOf(t);i>=0&&n.listeners.splice(i,1)}return(t==null||n.listeners.length===0)&&(n.stop(),It(this).subs.delete(n.tag)),this}async removeAllListeners(e){if(e){const t=await zi(this,e);if(!t)return this;t.stop(),It(this).subs.delete(t.tag)}else{const{subs:t}=It(this);for(const{tag:n,stop:i}of t.values())i(),t.delete(n)}return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return await this.off(e,t)}static buildClass(e){class t extends Qi{constructor(i,a=null){super(i,e,a)}}return t}static from(e,t,n){return n==null&&(n=null),new this(e,t,n)}}function B7(){return Qi}class Ji extends B7(){}function Iu(r){return r.match(/^ipfs:\/\/ipfs\//i)?r=r.substring(12):r.match(/^ipfs:\/\//i)?r=r.substring(7):O(!1,"unsupported IPFS format","link",r),`https://gateway.ipfs.io/ipfs/${r}`}class R7{name;constructor(e){re(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,t){throw new Error("unsupported coin")}async decodeAddress(e,t){throw new Error("unsupported coin")}}const ub=new RegExp("^(ipfs)://(.*)$","i"),jd=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),ub,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];class ei{provider;address;name;#e;#t;constructor(e,t,n){re(this,{provider:e,address:t,name:n}),this.#e=null,this.#t=new Ji(t,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e)}async supportsWildcard(){return this.#e==null&&(this.#e=(async()=>{try{return await this.#t.supportsInterface("0x9061b923")}catch(e){if(lt(e,"CALL_EXCEPTION"))return!1;throw this.#e=null,e}})()),await this.#e}async#n(e,t){t=(t||[]).slice();const n=this.#t.interface;t.unshift(ul(this.name));let i=null;await this.supportsWildcard()&&(i=n.getFunction(e),G(i,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),t=[ME(this.name,255),n.encodeFunctionData(i,t)],e="resolve(bytes,bytes)"),t.push({enableCcipRead:!0});try{const a=await this.#t[e](...t);return i?n.decodeFunctionResult(i,a)[0]:a}catch(a){if(!lt(a,"CALL_EXCEPTION"))throw a}return null}async getAddress(e){if(e==null&&(e=60),e===60)try{const a=await this.#n("addr(bytes32)");return a==null||a===rs?null:a}catch(a){if(lt(a,"CALL_EXCEPTION"))return null;throw a}if(e>=0&&e<2147483648){let a=e+2147483648;const c=await this.#n("addr(bytes32,uint)",[a]);if(Le(c,20))return Be(c)}let t=null;for(const a of this.provider.plugins)if(a instanceof R7&&a.supportsCoinType(e)){t=a;break}if(t==null)return null;const n=await this.#n("addr(bytes32,uint)",[e]);if(n==null||n==="0x")return null;const i=await t.decodeAddress(e,n);if(i!=null)return i;G(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:n}})}async getText(e){const t=await this.#n("text(bytes32,string)",[e]);return t==null||t==="0x"?null:t}async getContentHash(){const e=await this.#n("contenthash(bytes32)");if(e==null||e==="0x")return null;const t=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){const i=t[1]==="e3010170"?"ipfs":"ipns",a=parseInt(t[4],16);if(t[5].length===a*2)return`${i}://${ux("0x"+t[2])}`}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&n[1].length===64)return`bzz://${n[1]}`;G(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const t=await this.getText("avatar");if(t==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:t});for(let n=0;n<jd.length;n++){const i=t.match(jd[n]);if(i==null)continue;const a=i[1].toLowerCase();switch(a){case"https":case"data":return e.push({type:"url",value:t}),{linkage:e,url:t};case"ipfs":{const c=Iu(t);return e.push({type:"ipfs",value:t}),e.push({type:"url",value:c}),{linkage:e,url:c}}case"erc721":case"erc1155":{const c=a==="erc721"?"tokenURI(uint256)":"uri(uint256)";e.push({type:a,value:t});const l=await this.getAddress();if(l==null)return e.push({type:"!owner",value:""}),{url:null,linkage:e};const f=(i[2]||"").split("/");if(f.length!==2)return e.push({type:`!${a}caip`,value:i[2]||""}),{url:null,linkage:e};const p=f[1],h=new Ji(f[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if(a==="erc721"){const R=await h.ownerOf(p);if(l!==R)return e.push({type:"!owner",value:R}),{url:null,linkage:e};e.push({type:"owner",value:R})}else if(a==="erc1155"){const R=await h.balanceOf(l,p);if(!R)return e.push({type:"!balance",value:"0"}),{url:null,linkage:e};e.push({type:"balance",value:R.toString()})}let x=await h[c](p);if(x==null||x==="0x")return e.push({type:"!metadata-url",value:""}),{url:null,linkage:e};e.push({type:"metadata-url-base",value:x}),a==="erc1155"&&(x=x.replace("{id}",Dn(p,32).substring(2)),e.push({type:"metadata-url-expanded",value:x})),x.match(/^ipfs:/i)&&(x=Iu(x)),e.push({type:"metadata-url",value:x});let y={};const E=await new En(x).send();E.assertOk();try{y=E.bodyJson}catch{try{e.push({type:"!metadata",value:E.bodyText})}catch{const S=E.body;return S&&e.push({type:"!metadata",value:_(S)}),{url:null,linkage:e}}return{url:null,linkage:e}}if(!y)return e.push({type:"!metadata",value:""}),{url:null,linkage:e};e.push({type:"metadata",value:JSON.stringify(y)});let v=y.image;if(typeof v!="string")return e.push({type:"!imageUrl",value:""}),{url:null,linkage:e};if(!v.match(/^(https:\/\/|data:)/i)){if(v.match(ub)==null)return e.push({type:"!imageUrl-ipfs",value:v}),{url:null,linkage:e};e.push({type:"imageUrl-ipfs",value:v}),v=Iu(v)}return e.push({type:"url",value:v}),{linkage:e,url:v}}}}}catch{}return{linkage:e,url:null}}static async getEnsAddress(e){const t=await e.getNetwork(),n=t.getPlugin("org.ethers.plugins.network.Ens");return G(n,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:t}}),n.address}static async#r(e,t){const n=await ei.getEnsAddress(e);try{const a=await new Ji(n,["function resolver(bytes32) view returns (address)"],e).resolver(ul(t),{enableCcipRead:!0});return a===rs?null:a}catch(i){throw i}return null}static async fromName(e,t){let n=t;for(;;){if(n===""||n==="."||t!=="eth"&&n==="eth")return null;const i=await ei.#r(e,n);if(i!=null){const a=new ei(e,i,t);return n!==t&&!await a.supportsWildcard()?null:a}n=n.split(".").slice(1).join(".")}}}const qd=BigInt(0);function Ae(r,e){return(function(t){return t==null?e:r(t)})}function ls(r,e){return(t=>{if(e&&t==null)return null;if(!Array.isArray(t))throw new Error("not an array");return t.map(n=>r(n))})}function Es(r,e){return(t=>{const n={};for(const i in r){let a=i;if(e&&i in e&&!(a in t)){for(const c of e[i])if(c in t){a=c;break}}try{const c=r[i](t[a]);c!==void 0&&(n[i]=c)}catch(c){const l=c instanceof Error?c.message:"not-an-error";G(!1,`invalid value for value.${i} (${l})`,"BAD_DATA",{value:t})}}return n})}function T7(r){switch(r){case!0:case"true":return!0;case!1:case"false":return!1}O(!1,`invalid boolean; ${JSON.stringify(r)}`,"value",r)}function ui(r){return O(Le(r,!0),"invalid data","value",r),r}function ct(r){return O(Le(r,32),"invalid hash","value",r),r}const v7=Es({address:Be,blockHash:ct,blockNumber:pe,data:ui,index:pe,removed:Ae(T7,!1),topics:ls(ct),transactionHash:ct,transactionIndex:pe},{index:["logIndex"]});function O7(r){return v7(r)}const C7=Es({hash:Ae(ct),parentHash:ct,parentBeaconBlockRoot:Ae(ct,null),number:pe,timestamp:pe,nonce:Ae(ui),difficulty:Z,gasLimit:Z,gasUsed:Z,stateRoot:Ae(ct,null),receiptsRoot:Ae(ct,null),blobGasUsed:Ae(Z,null),excessBlobGas:Ae(Z,null),miner:Ae(Be),prevRandao:Ae(ct,null),extraData:ui,baseFeePerGas:Ae(Z)},{prevRandao:["mixHash"]});function S7(r){const e=C7(r);return e.transactions=r.transactions.map(t=>typeof t=="string"?t:lb(t)),e}const N7=Es({transactionIndex:pe,blockNumber:pe,transactionHash:ct,address:Be,topics:ls(ct),data:ui,index:pe,blockHash:ct},{index:["logIndex"]});function I7(r){return N7(r)}const P7=Es({to:Ae(Be,null),from:Ae(Be,null),contractAddress:Ae(Be,null),index:pe,root:Ae(_),gasUsed:Z,blobGasUsed:Ae(Z,null),logsBloom:Ae(ui),blockHash:ct,hash:ct,logs:ls(I7),blockNumber:pe,cumulativeGasUsed:Z,effectiveGasPrice:Ae(Z),blobGasPrice:Ae(Z,null),status:Ae(pe),type:Ae(pe,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function k7(r){return P7(r)}function lb(r){r.to&&Z(r.to)===qd&&(r.to="0x0000000000000000000000000000000000000000");const e=Es({hash:ct,index:Ae(pe,void 0),type:t=>t==="0x"||t==null?0:pe(t),accessList:Ae(Ir,null),blobVersionedHashes:Ae(ls(ct,!0),null),authorizationList:Ae(ls(t=>{let n;if(t.signature)n=t.signature;else{let i=t.yParity;i==="0x1b"?i=0:i==="0x1c"&&(i=1),n=Object.assign({},t,{yParity:i})}return{address:Be(t.address),chainId:Z(t.chainId),nonce:Z(t.nonce),signature:$e.from(n)}},!1),null),blockHash:Ae(ct,null),blockNumber:Ae(pe,null),transactionIndex:Ae(pe,null),from:Be,gasPrice:Ae(Z),maxPriorityFeePerGas:Ae(Z),maxFeePerGas:Ae(Z),maxFeePerBlobGas:Ae(Z,null),gasLimit:Z,to:Ae(Be,null),value:Z,nonce:pe,data:ui,creates:Ae(Be,null),chainId:Ae(Z,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(r);if(e.to==null&&e.creates==null&&(e.creates=y5(e)),(r.type===1||r.type===2)&&r.accessList==null&&(e.accessList=[]),r.signature?e.signature=$e.from(r.signature):e.signature=$e.from(r),e.chainId==null){const t=e.signature.legacyChainId;t!=null&&(e.chainId=t)}return e.blockHash&&Z(e.blockHash)===qd&&(e.blockHash=null),e}const D7="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class Bs{name;constructor(e){re(this,{name:e})}clone(){return new Bs(this.name)}}class Qa extends Bs{effectiveBlock;txBase;txCreate;txDataZero;txDataNonzero;txAccessListStorageKey;txAccessListAddress;constructor(e,t){e==null&&(e=0),super(`org.ethers.network.plugins.GasCost#${e||0}`);const n={effectiveBlock:e};function i(a,c){let l=(t||{})[a];l==null&&(l=c),O(typeof l=="number",`invalud value for ${a}`,"costs",t),n[a]=l}i("txBase",21e3),i("txCreate",32e3),i("txDataZero",4),i("txDataNonzero",16),i("txAccessListStorageKey",1900),i("txAccessListAddress",2400),re(this,n)}clone(){return new Qa(this.effectiveBlock,this)}}class Ja extends Bs{address;targetNetwork;constructor(e,t){super("org.ethers.plugins.network.Ens"),re(this,{address:e||D7,targetNetwork:t??1})}clone(){return new Ja(this.address,this.targetNetwork)}}class F7 extends Bs{#e;#t;get url(){return this.#e}get processFunc(){return this.#t}constructor(e,t){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin"),this.#e=e,this.#t=t}clone(){return this}}const Pu=new Map;class Dt{#e;#t;#n;constructor(e,t){this.#e=e,this.#t=Z(t),this.#n=new Map}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return this.#e}set name(e){this.#e=e}get chainId(){return this.#t}set chainId(e){this.#t=Z(e,"chainId")}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===Z(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===Z(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===Z(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(this.#n.values())}attachPlugin(e){if(this.#n.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#n.set(e.name,e.clone()),this}getPlugin(e){return this.#n.get(e)||null}getPlugins(e){return this.plugins.filter(t=>t.name.split("#")[0]===e)}clone(){const e=new Dt(this.name,this.chainId);return this.plugins.forEach(t=>{e.attachPlugin(t.clone())}),e}computeIntrinsicGas(e){const t=this.getPlugin("org.ethers.plugins.network.GasCost")||new Qa;let n=t.txBase;if(e.to==null&&(n+=t.txCreate),e.data)for(let i=2;i<e.data.length;i+=2)e.data.substring(i,i+2)==="00"?n+=t.txDataZero:n+=t.txDataNonzero;if(e.accessList){const i=Ir(e.accessList);for(const a in i)n+=t.txAccessListAddress+t.txAccessListStorageKey*i[a].storageKeys.length}return n}static from(e){if(U7(),e==null)return Dt.from("mainnet");if(typeof e=="number"&&(e=BigInt(e)),typeof e=="string"||typeof e=="bigint"){const t=Pu.get(e);if(t)return t();if(typeof e=="bigint")return new Dt("unknown",e);O(!1,"unknown network","network",e)}if(typeof e.clone=="function")return e.clone();if(typeof e=="object"){O(typeof e.name=="string"&&typeof e.chainId=="number","invalid network object name or chainId","network",e);const t=new Dt(e.name,e.chainId);return(e.ensAddress||e.ensNetwork!=null)&&t.attachPlugin(new Ja(e.ensAddress,e.ensNetwork)),t}O(!1,"invalid network","network",e)}static register(e,t){typeof e=="number"&&(e=BigInt(e));const n=Pu.get(e);n&&O(!1,`conflicting network for ${JSON.stringify(n.name)}`,"nameOrChainId",e),Pu.set(e,t)}}function Kd(r,e){const t=String(r);if(!t.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${r}`);const n=t.split(".");if(n.length===1&&n.push(""),n.length!==2)throw new Error(`invalid gwei value: ${r}`);for(;n[1].length<e;)n[1]+="0";if(n[1].length>9){let i=BigInt(n[1].substring(0,9));n[1].substring(9).match(/^0+$/)||i++,n[1]=i.toString()}return BigInt(n[0]+n[1])}function Qd(r){return new F7(r,async(e,t,n)=>{n.setHeader("User-Agent","ethers");let i;try{const[a,c]=await Promise.all([n.send(),e()]);i=a;const l=i.bodyJson.standard;return{gasPrice:c.gasPrice,maxFeePerGas:Kd(l.maxFee,9),maxPriorityFeePerGas:Kd(l.maxPriorityFee,9)}}catch(a){G(!1,`error encountered with polygon gas station (${JSON.stringify(n.url)})`,"SERVER_ERROR",{request:n,response:i,error:a})}})}let Jd=!1;function U7(){if(Jd)return;Jd=!0;function r(e,t,n){const i=function(){const a=new Dt(e,t);return n.ensNetwork!=null&&a.attachPlugin(new Ja(null,n.ensNetwork)),a.attachPlugin(new Qa),(n.plugins||[]).forEach(c=>{a.attachPlugin(c)}),a};Dt.register(e,i),Dt.register(t,i),n.altNames&&n.altNames.forEach(a=>{Dt.register(a,i)})}r("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),r("ropsten",3,{ensNetwork:3}),r("rinkeby",4,{ensNetwork:4}),r("goerli",5,{ensNetwork:5}),r("kovan",42,{ensNetwork:42}),r("sepolia",11155111,{ensNetwork:11155111}),r("holesky",17e3,{ensNetwork:17e3}),r("classic",61,{}),r("classicKotti",6,{}),r("arbitrum",42161,{ensNetwork:1}),r("arbitrum-goerli",421613,{}),r("arbitrum-sepolia",421614,{}),r("base",8453,{ensNetwork:1}),r("base-goerli",84531,{}),r("base-sepolia",84532,{}),r("bnb",56,{ensNetwork:1}),r("bnbt",97,{}),r("filecoin",314,{}),r("filecoin-calibration",314159,{}),r("linea",59144,{ensNetwork:1}),r("linea-goerli",59140,{}),r("linea-sepolia",59141,{}),r("matic",137,{ensNetwork:1,plugins:[Qd("https://gasstation.polygon.technology/v2")]}),r("matic-amoy",80002,{}),r("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[Qd("https://gasstation-testnet.polygon.technology/v2")]}),r("optimism",10,{ensNetwork:1,plugins:[]}),r("optimism-goerli",420,{}),r("optimism-sepolia",11155420,{}),r("xdai",100,{ensNetwork:1})}function hl(r){return JSON.parse(JSON.stringify(r))}class L7{#e;#t;#n;#r;constructor(e){this.#e=e,this.#t=null,this.#n=4e3,this.#r=-2}get pollingInterval(){return this.#n}set pollingInterval(e){this.#n=e}async#i(){try{const e=await this.#e.getBlockNumber();if(this.#r===-2){this.#r=e;return}if(e!==this.#r){for(let t=this.#r+1;t<=e;t++){if(this.#t==null)return;await this.#e.emit("block",t)}this.#r=e}}catch{}this.#t!=null&&(this.#t=this.#e._setTimeout(this.#i.bind(this),this.#n))}start(){this.#t||(this.#t=this.#e._setTimeout(this.#i.bind(this),this.#n),this.#i())}stop(){this.#t&&(this.#e._clearTimeout(this.#t),this.#t=null)}pause(e){this.stop(),e&&(this.#r=-2)}resume(){this.start()}}class ef{#e;#t;#n;constructor(e){this.#e=e,this.#n=!1,this.#t=t=>{this._poll(t,this.#e)}}async _poll(e,t){throw new Error("sub-classes must override this")}start(){this.#n||(this.#n=!0,this.#t(-2),this.#e.on("block",this.#t))}stop(){this.#n&&(this.#n=!1,this.#e.off("block",this.#t))}pause(e){this.stop()}resume(){this.start()}}class M7 extends ef{#e;#t;constructor(e,t){super(e),this.#e=t,this.#t=-2}pause(e){e&&(this.#t=-2),super.pause(e)}async _poll(e,t){const n=await t.getBlock(this.#e);n!=null&&(this.#t===-2?this.#t=n.number:n.number>this.#t&&(t.emit(this.#e,n.number),this.#t=n.number))}}class V7 extends ef{#e;constructor(e,t){super(e),this.#e=hl(t)}async _poll(e,t){throw new Error("@TODO")}}class G7 extends ef{#e;constructor(e,t){super(e),this.#e=t}async _poll(e,t){const n=await t.getTransactionReceipt(this.#e);n&&t.emit(this.#e,n)}}class tf{#e;#t;#n;#r;#i;constructor(e,t){this.#e=e,this.#t=hl(t),this.#n=this.#a.bind(this),this.#r=!1,this.#i=-2}async#a(e){if(this.#i===-2)return;const t=hl(this.#t);t.fromBlock=this.#i+1,t.toBlock=e;const n=await this.#e.getLogs(t);if(n.length===0){this.#i<e-60&&(this.#i=e-60);return}for(const i of n)this.#e.emit(this.#t,i),this.#i=i.blockNumber}start(){this.#r||(this.#r=!0,this.#i===-2&&this.#e.getBlockNumber().then(e=>{this.#i=e}),this.#e.on("block",this.#n))}stop(){this.#r&&(this.#r=!1,this.#e.off("block",this.#n))}pause(e){this.stop(),e&&(this.#i=-2)}resume(){this.start()}}const z7=BigInt(2),H7=10;function ea(r){return r&&typeof r.then=="function"}function la(r,e){return r+":"+JSON.stringify(e,(t,n)=>{if(n==null)return"null";if(typeof n=="bigint")return`bigint:${n.toString()}`;if(typeof n=="string")return n.toLowerCase();if(typeof n=="object"&&!Array.isArray(n)){const i=Object.keys(n);return i.sort(),i.reduce((a,c)=>(a[c]=n[c],a),{})}return n})}class fb{name;constructor(e){re(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function $7(r){return JSON.parse(JSON.stringify(r))}function dl(r){return r=Array.from(new Set(r).values()),r.sort(),r}async function ku(r,e){if(r==null)throw new Error("invalid event");if(Array.isArray(r)&&(r={topics:r}),typeof r=="string")switch(r){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:r,tag:r}}if(Le(r,32)){const t=r.toLowerCase();return{type:"transaction",tag:la("tx",{hash:t}),hash:t}}if(r.orphan){const t=r;return{type:"orphan",tag:la("orphan",t),filter:$7(t)}}if(r.address||r.topics){const t=r,n={topics:(t.topics||[]).map(i=>i==null?null:Array.isArray(i)?dl(i.map(a=>a.toLowerCase())):i.toLowerCase())};if(t.address){const i=[],a=[],c=l=>{Le(l)?i.push(l):a.push((async()=>{i.push(await at(l,e))})())};Array.isArray(t.address)?t.address.forEach(c):c(t.address),a.length&&await Promise.all(a),n.address=dl(i.map(l=>l.toLowerCase()))}return{filter:n,tag:la("event",n),type:"event"}}O(!1,"unknown ProviderEvent","event",r)}function Du(){return new Date().getTime()}const _7={cacheTimeout:250,pollingInterval:4e3};class j7{#e;#t;#n;#r;#i;#a;#s;#o;#d;#u;#p;#x;constructor(e,t){if(this.#x=Object.assign({},_7,t||{}),e==="any")this.#a=!0,this.#i=null;else if(e){const n=Dt.from(e);this.#a=!1,this.#i=Promise.resolve(n),setTimeout(()=>{this.emit("network",n,null)},0)}else this.#a=!1,this.#i=null;this.#o=-1,this.#s=new Map,this.#e=new Map,this.#t=new Map,this.#n=null,this.#r=!1,this.#d=1,this.#u=new Map,this.#p=!1}get pollingInterval(){return this.#x.pollingInterval}get provider(){return this}get plugins(){return Array.from(this.#t.values())}attachPlugin(e){if(this.#t.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#t.set(e.name,e.connect(this)),this}getPlugin(e){return this.#t.get(e)||null}get disableCcipRead(){return this.#p}set disableCcipRead(e){this.#p=!!e}async#c(e){const t=this.#x.cacheTimeout;if(t<0)return await this._perform(e);const n=la(e.method,e);let i=this.#s.get(n);return i||(i=this._perform(e),this.#s.set(n,i),setTimeout(()=>{this.#s.get(n)===i&&this.#s.delete(n)},t)),await i}async ccipReadFetch(e,t,n){if(this.disableCcipRead||n.length===0||e.to==null)return null;const i=e.to.toLowerCase(),a=t.toLowerCase(),c=[];for(let l=0;l<n.length;l++){const f=n[l],p=f.replace("{sender}",i).replace("{data}",a),h=new En(p);f.indexOf("{data}")===-1&&(h.body={data:a,sender:i}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:h,index:l,urls:n});let x="unknown error",y;try{y=await h.send()}catch(E){c.push(E.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:h,result:{error:E}});continue}try{const E=y.bodyJson;if(E.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:h,result:E}),E.data;E.message&&(x=E.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:h,result:E})}catch{}G(y.statusCode<400||y.statusCode>=500,`response not found during CCIP fetch: ${x}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:f,errorMessage:x}}),c.push(x)}G(!1,`error encountered during CCIP fetch: ${c.map(l=>JSON.stringify(l)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:n,errorMessages:c}})}_wrapBlock(e,t){return new l7(S7(e),this)}_wrapLog(e,t){return new ws(O7(e),this)}_wrapTransactionReceipt(e,t){return new Xm(k7(e),this)}_wrapTransactionResponse(e,t){return new As(lb(e),this)}_detectNetwork(){G(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){G(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=pe(await this.#c({method:"getBlockNumber"}),"%response");return this.#o>=0&&(this.#o=e),e}_getAddress(e){return at(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}if(Le(e))return Le(e,32)?e:sn(e);if(typeof e=="bigint"&&(e=pe(e,"blockTag")),typeof e=="number")return e>=0?sn(e):this.#o>=0?sn(this.#o+e):this.getBlockNumber().then(t=>sn(t+e));O(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const t=(e.topics||[]).map(f=>f==null?null:Array.isArray(f)?dl(f.map(p=>p.toLowerCase())):f.toLowerCase()),n="blockHash"in e?e.blockHash:void 0,i=(f,p,h)=>{let x;switch(f.length){case 0:break;case 1:x=f[0];break;default:f.sort(),x=f}if(n&&(p!=null||h!=null))throw new Error("invalid filter");const y={};return x&&(y.address=x),t.length&&(y.topics=t),p&&(y.fromBlock=p),h&&(y.toBlock=h),n&&(y.blockHash=n),y};let a=[];if(e.address)if(Array.isArray(e.address))for(const f of e.address)a.push(this._getAddress(f));else a.push(this._getAddress(e.address));let c;"fromBlock"in e&&(c=this._getBlockTag(e.fromBlock));let l;return"toBlock"in e&&(l=this._getBlockTag(e.toBlock)),a.filter(f=>typeof f!="string").length||c!=null&&typeof c!="string"||l!=null&&typeof l!="string"?Promise.all([Promise.all(a),c,l]).then(f=>i(f[0],f[1],f[2])):i(a,c,l)}_getTransactionRequest(e){const t=us(e),n=[];if(["to","from"].forEach(i=>{if(t[i]==null)return;const a=at(t[i],this);ea(a)?n.push((async function(){t[i]=await a})()):t[i]=a}),t.blockTag!=null){const i=this._getBlockTag(t.blockTag);ea(i)?n.push((async function(){t.blockTag=await i})()):t.blockTag=i}return n.length?(async function(){return await Promise.all(n),t})():t}async getNetwork(){if(this.#i==null){const i=(async()=>{try{const a=await this._detectNetwork();return this.emit("network",a,null),a}catch(a){throw this.#i===i&&(this.#i=null),a}})();return this.#i=i,(await i).clone()}const e=this.#i,[t,n]=await Promise.all([e,this._detectNetwork()]);return t.chainId!==n.chainId&&(this.#a?(this.emit("network",n,t),this.#i===e&&(this.#i=Promise.resolve(n))):G(!1,`network changed: ${t.chainId} => ${n.chainId} `,"NETWORK_ERROR",{event:"changed"})),t.clone()}async getFeeData(){const e=await this.getNetwork(),t=async()=>{const{_block:i,gasPrice:a,priorityFee:c}=await xt({_block:this.#g("latest",!1),gasPrice:(async()=>{try{const h=await this.#c({method:"getGasPrice"});return Z(h,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const h=await this.#c({method:"getPriorityFee"});return Z(h,"%response")}catch{}return null})()});let l=null,f=null;const p=this._wrapBlock(i,e);return p&&p.baseFeePerGas&&(f=c??BigInt("1000000000"),l=p.baseFeePerGas*z7+f),new Hd(a,l,f)},n=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(n){const i=new En(n.url),a=await n.processFunc(t,this,i);return new Hd(a.gasPrice,a.maxFeePerGas,a.maxPriorityFeePerGas)}return await t()}async estimateGas(e){let t=this._getTransactionRequest(e);return ea(t)&&(t=await t),Z(await this.#c({method:"estimateGas",transaction:t}),"%response")}async#l(e,t,n){G(n<H7,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:t,enableCcipRead:!0})});const i=us(e);try{return _(await this._perform({method:"call",transaction:i,blockTag:t}))}catch(a){if(!this.disableCcipRead&&kl(a)&&a.data&&n>=0&&t==="latest"&&i.to!=null&&Ve(a.data,0,4)==="0x556f1830"){const c=a.data,l=await at(i.to,this);let f;try{f=W7(Ve(a.data,4))}catch(x){G(!1,x.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:i,info:{data:c}})}G(f.sender.toLowerCase()===l.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:c,reason:"OffchainLookup",transaction:i,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:f.errorArgs}});const p=await this.ccipReadFetch(i,f.calldata,f.urls);G(p!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:i,info:{data:a.data,errorArgs:f.errorArgs}});const h={to:l,data:Ce([f.selector,J7([p,f.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:h});try{const x=await this.#l(h,t,n+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},h),result:x}),x}catch(x){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},h),error:x}),x}}throw a}}async#f(e){const{value:t}=await xt({network:this.getNetwork(),value:e});return t}async call(e){const{tx:t,blockTag:n}=await xt({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await this.#f(this.#l(t,n,e.enableCcipRead?0:-1))}async#h(e,t,n){let i=this._getAddress(t),a=this._getBlockTag(n);return(typeof i!="string"||typeof a!="string")&&([i,a]=await Promise.all([i,a])),await this.#f(this.#c(Object.assign(e,{address:i,blockTag:a})))}async getBalance(e,t){return Z(await this.#h({method:"getBalance"},e,t),"%response")}async getTransactionCount(e,t){return pe(await this.#h({method:"getTransactionCount"},e,t),"%response")}async getCode(e,t){return _(await this.#h({method:"getCode"},e,t))}async getStorage(e,t,n){const i=Z(t,"position");return _(await this.#h({method:"getStorage",position:i},e,n))}async broadcastTransaction(e){const{blockNumber:t,hash:n,network:i}=await xt({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),a=_t.from(e);if(a.hash!==n)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(a,i).replaceableTransaction(t)}async#g(e,t){if(Le(e,32))return await this.#c({method:"getBlock",blockHash:e,includeTransactions:t});let n=this._getBlockTag(e);return typeof n!="string"&&(n=await n),await this.#c({method:"getBlock",blockTag:n,includeTransactions:t})}async getBlock(e,t){const{network:n,params:i}=await xt({network:this.getNetwork(),params:this.#g(e,!!t)});return i==null?null:this._wrapBlock(i,n)}async getTransaction(e){const{network:t,params:n}=await xt({network:this.getNetwork(),params:this.#c({method:"getTransaction",hash:e})});return n==null?null:this._wrapTransactionResponse(n,t)}async getTransactionReceipt(e){const{network:t,params:n}=await xt({network:this.getNetwork(),params:this.#c({method:"getTransactionReceipt",hash:e})});if(n==null)return null;if(n.gasPrice==null&&n.effectiveGasPrice==null){const i=await this.#c({method:"getTransaction",hash:e});if(i==null)throw new Error("report this; could not find tx or effectiveGasPrice");n.effectiveGasPrice=i.gasPrice}return this._wrapTransactionReceipt(n,t)}async getTransactionResult(e){const{result:t}=await xt({network:this.getNetwork(),result:this.#c({method:"getTransactionResult",hash:e})});return t==null?null:_(t)}async getLogs(e){let t=this._getFilter(e);ea(t)&&(t=await t);const{network:n,params:i}=await xt({network:this.getNetwork(),params:this.#c({method:"getLogs",filter:t})});return i.map(a=>this._wrapLog(a,n))}_getProvider(e){G(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await ei.fromName(this,e)}async getAvatar(e){const t=await this.getResolver(e);return t?await t.getAvatar():null}async resolveName(e){const t=await this.getResolver(e);return t?await t.getAddress():null}async lookupAddress(e){e=Be(e);const t=ul(e.substring(2).toLowerCase()+".addr.reverse");try{const n=await ei.getEnsAddress(this),a=await new Ji(n,["function resolver(bytes32) view returns (address)"],this).resolver(t);if(a==null||a===rs)return null;const l=await new Ji(a,["function name(bytes32) view returns (string)"],this).name(t);return await this.resolveName(l)!==e?null:l}catch(n){if(lt(n,"BAD_DATA")&&n.value==="0x"||lt(n,"CALL_EXCEPTION"))return null;throw n}return null}async waitForTransaction(e,t,n){const i=t??1;return i===0?this.getTransactionReceipt(e):new Promise(async(a,c)=>{let l=null;const f=(async p=>{try{const h=await this.getTransactionReceipt(e);if(h!=null&&p-h.blockNumber+1>=i){a(h),l&&(clearTimeout(l),l=null);return}}catch(h){console.log("EEE",h)}this.once("block",f)});n!=null&&(l=setTimeout(()=>{l!=null&&(l=null,this.off("block",f),c(He("timeout","TIMEOUT",{reason:"timeout"})))},n)),f(await this.getBlockNumber())})}async waitForBlock(e){G(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const t=this.#u.get(e);t&&(t.timer&&clearTimeout(t.timer),this.#u.delete(e))}_setTimeout(e,t){t==null&&(t=0);const n=this.#d++,i=()=>{this.#u.delete(n),e()};if(this.paused)this.#u.set(n,{timer:null,func:i,time:t});else{const a=setTimeout(i,t);this.#u.set(n,{timer:a,func:i,time:Du()})}return n}_forEachSubscriber(e){for(const t of this.#e.values())e(t.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new fb(e.type);case"block":{const t=new L7(this);return t.pollingInterval=this.pollingInterval,t}case"safe":case"finalized":return new M7(this,e.type);case"event":return new tf(this,e.filter);case"transaction":return new G7(this,e.hash);case"orphan":return new V7(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,t){for(const n of this.#e.values())if(n.subscriber===e){n.started&&n.subscriber.stop(),n.subscriber=t,n.started&&t.start(),this.#n!=null&&t.pause(this.#n);break}}async#m(e,t){let n=await ku(e,this);return n.type==="event"&&t&&t.length>0&&t[0].removed===!0&&(n=await ku({orphan:"drop-log",log:t[0]},this)),this.#e.get(n.tag)||null}async#b(e){const t=await ku(e,this),n=t.tag;let i=this.#e.get(n);return i||(i={subscriber:this._getSubscriber(t),tag:n,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},this.#e.set(n,i)),i}async on(e,t){const n=await this.#b(e);return n.listeners.push({listener:t,once:!1}),n.started||(n.subscriber.start(),n.started=!0,this.#n!=null&&n.subscriber.pause(this.#n)),this}async once(e,t){const n=await this.#b(e);return n.listeners.push({listener:t,once:!0}),n.started||(n.subscriber.start(),n.started=!0,this.#n!=null&&n.subscriber.pause(this.#n)),this}async emit(e,...t){const n=await this.#m(e,t);if(!n||n.listeners.length===0)return!1;const i=n.listeners.length;return n.listeners=n.listeners.filter(({listener:a,once:c})=>{const l=new lx(this,c?null:a,e);try{a.call(this,...t,l)}catch{}return!c}),n.listeners.length===0&&(n.started&&n.subscriber.stop(),this.#e.delete(n.tag)),i>0}async listenerCount(e){if(e){const n=await this.#m(e);return n?n.listeners.length:0}let t=0;for(const{listeners:n}of this.#e.values())t+=n.length;return t}async listeners(e){if(e){const n=await this.#m(e);return n?n.listeners.map(({listener:i})=>i):[]}let t=[];for(const{listeners:n}of this.#e.values())t=t.concat(n.map(({listener:i})=>i));return t}async off(e,t){const n=await this.#m(e);if(!n)return this;if(t){const i=n.listeners.map(({listener:a})=>a).indexOf(t);i>=0&&n.listeners.splice(i,1)}return(!t||n.listeners.length===0)&&(n.started&&n.subscriber.stop(),this.#e.delete(n.tag)),this}async removeAllListeners(e){if(e){const{tag:t,started:n,subscriber:i}=await this.#b(e);n&&i.stop(),this.#e.delete(t)}else for(const[t,{started:n,subscriber:i}]of this.#e)n&&i.stop(),this.#e.delete(t);return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return this.off(e,t)}get destroyed(){return this.#r}destroy(){this.removeAllListeners();for(const e of this.#u.keys())this._clearTimeout(e);this.#r=!0}get paused(){return this.#n!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(this.#o=-1,this.#n!=null){if(this.#n==!!e)return;G(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(t=>t.pause(e)),this.#n=!!e;for(const t of this.#u.values())t.timer&&clearTimeout(t.timer),t.time=Du()-t.time}resume(){if(this.#n!=null){this._forEachSubscriber(e=>e.resume()),this.#n=null;for(const e of this.#u.values()){let t=e.time;t<0&&(t=0),e.time=Du(),setTimeout(e.func,t)}}}}function q7(r,e){try{const t=pl(r,e);if(t)return ma(t)}catch{}return null}function pl(r,e){if(r==="0x")return null;try{const t=pe(Ve(r,e,e+32)),n=pe(Ve(r,t,t+32));return Ve(r,t+32,t+32+n)}catch{}return null}function Wd(r){const e=je(r);if(e.length>32)throw new Error("internal; should not happen");const t=new Uint8Array(32);return t.set(e,32-e.length),t}function K7(r){if(r.length%32===0)return r;const e=new Uint8Array(Math.ceil(r.length/32)*32);return e.set(r),e}const Q7=new Uint8Array([]);function J7(r){const e=[];let t=0;for(let n=0;n<r.length;n++)e.push(Q7),t+=32;for(let n=0;n<r.length;n++){const i=Y(r[n]);e[n]=Wd(t),e.push(Wd(i.length)),e.push(K7(i)),t+=32+Math.ceil(i.length/32)*32}return Ce(e)}const Yd="0x0000000000000000000000000000000000000000000000000000000000000000";function W7(r){const e={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};G(Wr(r)>=160,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const t=Ve(r,0,32);G(Ve(t,0,12)===Ve(Yd,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=Ve(t,12);try{const n=[],i=pe(Ve(r,32,64)),a=pe(Ve(r,i,i+32)),c=Ve(r,i+32);for(let l=0;l<a;l++){const f=q7(c,l*32);if(f==null)throw new Error("abort");n.push(f)}e.urls=n}catch{G(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{const n=pl(r,64);if(n==null)throw new Error("abort");e.calldata=n}catch{G(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}G(Ve(r,100,128)===Ve(Yd,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),e.selector=Ve(r,96,100);try{const n=pl(r,128);if(n==null)throw new Error("abort");e.extraData=n}catch{G(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return e.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map(n=>e[n]),e}function hr(r,e){if(r.provider)return r.provider;G(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function Xd(r,e){let t=us(e);if(t.to!=null&&(t.to=at(t.to,r)),t.from!=null){const n=t.from;t.from=Promise.all([r.getAddress(),at(n,r)]).then(([i,a])=>(O(i.toLowerCase()===a.toLowerCase(),"transaction from mismatch","tx.from",a),i))}else t.from=r.getAddress();return await xt(t)}class nf{provider;constructor(e){re(this,{provider:e||null})}async getNonce(e){return hr(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await Xd(this,e)}async populateTransaction(e){const t=hr(this,"populateTransaction"),n=await Xd(this,e);n.nonce==null&&(n.nonce=await this.getNonce("pending")),n.gasLimit==null&&(n.gasLimit=await this.estimateGas(n));const i=await this.provider.getNetwork();if(n.chainId!=null){const c=Z(n.chainId);O(c===i.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else n.chainId=i.chainId;const a=n.maxFeePerGas!=null||n.maxPriorityFeePerGas!=null;if(n.gasPrice!=null&&(n.type===2||a)?O(!1,"eip-1559 transaction do not support gasPrice","tx",e):(n.type===0||n.type===1)&&a&&O(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(n.type===2||n.type==null)&&n.maxFeePerGas!=null&&n.maxPriorityFeePerGas!=null)n.type=2;else if(n.type===0||n.type===1){const c=await t.getFeeData();G(c.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),n.gasPrice==null&&(n.gasPrice=c.gasPrice)}else{const c=await t.getFeeData();if(n.type==null)if(c.maxFeePerGas!=null&&c.maxPriorityFeePerGas!=null)if(n.authorizationList&&n.authorizationList.length?n.type=4:n.type=2,n.gasPrice!=null){const l=n.gasPrice;delete n.gasPrice,n.maxFeePerGas=l,n.maxPriorityFeePerGas=l}else n.maxFeePerGas==null&&(n.maxFeePerGas=c.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=c.maxPriorityFeePerGas);else c.gasPrice!=null?(G(!a,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),n.gasPrice==null&&(n.gasPrice=c.gasPrice),n.type=0):G(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else(n.type===2||n.type===3||n.type===4)&&(n.maxFeePerGas==null&&(n.maxFeePerGas=c.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=c.maxPriorityFeePerGas))}return await xt(n)}async populateAuthorization(e){const t=Object.assign({},e);return t.chainId==null&&(t.chainId=(await hr(this,"getNetwork").getNetwork()).chainId),t.nonce==null&&(t.nonce=await this.getNonce()),t}async estimateGas(e){return hr(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return hr(this,"call").call(await this.populateCall(e))}async resolveName(e){return await hr(this,"resolveName").resolveName(e)}async sendTransaction(e){const t=hr(this,"sendTransaction"),n=await this.populateTransaction(e);delete n.from;const i=_t.from(n);return await t.broadcastTransaction(await this.signTransaction(i))}authorize(e){G(!1,"authorization not implemented for this signer","UNSUPPORTED_OPERATION",{operation:"authorize"})}}class rf extends nf{address;constructor(e,t){super(t),re(this,{address:e})}async getAddress(){return this.address}connect(e){return new rf(this.address,e)}#e(e,t){G(!1,`VoidSigner cannot sign ${e}`,"UNSUPPORTED_OPERATION",{operation:t})}async signTransaction(e){this.#e("transactions","signTransaction")}async signMessage(e){this.#e("messages","signMessage")}async signTypedData(e,t,n){this.#e("typed-data","signTypedData")}}function Y7(r){return JSON.parse(JSON.stringify(r))}class hb{#e;#t;#n;#r;#i;#a;constructor(e){this.#e=e,this.#t=null,this.#n=this.#s.bind(this),this.#r=!1,this.#i=null,this.#a=!1}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,t){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}async#s(e){try{this.#t==null&&(this.#t=this._subscribe(this.#e));let t=null;try{t=await this.#t}catch(a){if(!lt(a,"UNSUPPORTED_OPERATION")||a.operation!=="eth_newFilter")throw a}if(t==null){this.#t=null,this.#e._recoverSubscriber(this,this._recover(this.#e));return}const n=await this.#e.getNetwork();if(this.#i||(this.#i=n),this.#i.chainId!==n.chainId)throw new Error("chaid changed");if(this.#a)return;const i=await this.#e.send("eth_getFilterChanges",[t]);await this._emitResults(this.#e,i)}catch(t){console.log("@TODO",t)}this.#e.once("block",this.#n)}#o(){const e=this.#t;e&&(this.#t=null,e.then(t=>{this.#e.destroyed||this.#e.send("eth_uninstallFilter",[t])}))}start(){this.#r||(this.#r=!0,this.#s(-2))}stop(){this.#r&&(this.#r=!1,this.#a=!0,this.#o(),this.#e.off("block",this.#n))}pause(e){e&&this.#o(),this.#e.off("block",this.#n)}resume(){this.start()}}class X7 extends hb{#e;constructor(e,t){super(e),this.#e=Y7(t)}_recover(e){return new tf(e,this.#e)}async _subscribe(e){return await e.send("eth_newFilter",[this.#e])}async _emitResults(e,t){for(const n of t)e.emit(this.#e,e._wrapLog(n,e._network))}}class Z7 extends hb{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,t){for(const n of t)e.emit("pending",n)}}const e9="bigint,boolean,function,number,string,symbol".split(/,/g);function fa(r){if(r==null||e9.indexOf(typeof r)>=0||typeof r.getAddress=="function")return r;if(Array.isArray(r))return r.map(fa);if(typeof r=="object")return Object.keys(r).reduce((e,t)=>(e[t]=r[t],e),{});throw new Error(`should not happen: ${r} (${typeof r})`)}function t9(r){return new Promise(e=>{setTimeout(e,r)})}function Hr(r){return r&&r.toLowerCase()}function Zd(r){return r&&typeof r.pollingInterval=="number"}const db={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class Fu extends nf{address;constructor(e,t){super(e),t=Be(t),re(this,{address:t})}connect(e){G(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(e){return await this.populateCall(e)}async sendUncheckedTransaction(e){const t=fa(e),n=[];if(t.from){const a=t.from;n.push((async()=>{const c=await at(a,this.provider);O(c!=null&&c.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),t.from=c})())}else t.from=this.address;if(t.gasLimit==null&&n.push((async()=>{t.gasLimit=await this.provider.estimateGas({...t,from:this.address})})()),t.to!=null){const a=t.to;n.push((async()=>{t.to=await at(a,this.provider)})())}n.length&&await Promise.all(n);const i=this.provider.getRpcTransaction(t);return this.provider.send("eth_sendTransaction",[i])}async sendTransaction(e){const t=await this.provider.getBlockNumber(),n=await this.sendUncheckedTransaction(e);return await new Promise((i,a)=>{const c=[1e3,100];let l=0;const f=async()=>{try{const p=await this.provider.getTransaction(n);if(p!=null){i(p.replaceableTransaction(t));return}}catch(p){if(lt(p,"CANCELLED")||lt(p,"BAD_DATA")||lt(p,"NETWORK_ERROR")||lt(p,"UNSUPPORTED_OPERATION")){p.info==null&&(p.info={}),p.info.sendTransactionHash=n,a(p);return}if(lt(p,"INVALID_ARGUMENT")&&(l++,p.info==null&&(p.info={}),p.info.sendTransactionHash=n,l>10)){a(p);return}this.provider.emit("error",He("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:p}))}this.provider._setTimeout(()=>{f()},c.pop()||4e3)};f()})}async signTransaction(e){const t=fa(e);if(t.from){const i=await at(t.from,this.provider);O(i!=null&&i.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),t.from=i}else t.from=this.address;const n=this.provider.getRpcTransaction(t);return await this.provider.send("eth_signTransaction",[n])}async signMessage(e){const t=typeof e=="string"?Tt(e):e;return await this.provider.send("personal_sign",[_(t),this.address.toLowerCase()])}async signTypedData(e,t,n){const i=fa(n),a=await At.resolveNames(e,t,i,async c=>{const l=await at(c);return O(l!=null,"TypedData does not support null address","value",c),l});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(At.getPayload(a.domain,t,a.value))])}async unlock(e){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),e,null])}async _legacySignMessage(e){const t=typeof e=="string"?Tt(e):e;return await this.provider.send("eth_sign",[this.address.toLowerCase(),_(t)])}}class n9 extends j7{#e;#t;#n;#r;#i;#a;#s;#o(){if(this.#r)return;const e=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");this.#r=setTimeout(()=>{this.#r=null;const t=this.#n;for(this.#n=[];t.length;){const n=[t.shift()];for(;t.length&&n.length!==this.#e.batchMaxCount;)if(n.push(t.shift()),JSON.stringify(n.map(a=>a.payload)).length>this.#e.batchMaxSize){t.unshift(n.pop());break}(async()=>{const i=n.length===1?n[0].payload:n.map(a=>a.payload);this.emit("debug",{action:"sendRpcPayload",payload:i});try{const a=await this._send(i);this.emit("debug",{action:"receiveRpcResult",result:a});for(const{resolve:c,reject:l,payload:f}of n){if(this.destroyed){l(He("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:f.method}));continue}const p=a.filter(h=>h.id===f.id)[0];if(p==null){const h=He("missing response for request","BAD_DATA",{value:a,info:{payload:f}});this.emit("error",h),l(h);continue}if("error"in p){l(this.getRpcError(f,p));continue}c(p.result)}}catch(a){this.emit("debug",{action:"receiveRpcError",error:a});for(const{reject:c}of n)c(a)}})()}},e)}constructor(e,t){super(e,t),this.#t=1,this.#e=Object.assign({},db,t||{}),this.#n=[],this.#r=null,this.#a=null,this.#s=null;{let i=null;const a=new Promise(c=>{i=c});this.#i={promise:a,resolve:i}}const n=this._getOption("staticNetwork");typeof n=="boolean"?(O(!n||e!=="any","staticNetwork cannot be used on special network 'any'","options",t),n&&e!=null&&(this.#a=Dt.from(e))):n&&(O(e==null||n.matches(e),"staticNetwork MUST match network object","options",t),this.#a=n)}_getOption(e){return this.#e[e]}get _network(){return G(this.#a,"network is not available yet","NETWORK_ERROR"),this.#a}async _perform(e){if(e.method==="call"||e.method==="estimateGas"){let n=e.transaction;if(n&&n.type!=null&&Z(n.type)&&n.maxFeePerGas==null&&n.maxPriorityFeePerGas==null){const i=await this.getFeeData();i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null&&(e=Object.assign({},e,{transaction:Object.assign({},n,{type:void 0})}))}}const t=this.getRpcRequest(e);return t!=null?await this.send(t.method,t.args):super._perform(e)}async _detectNetwork(){const e=this._getOption("staticNetwork");if(e)if(e===!0){if(this.#a)return this.#a}else return e;return this.#s?await this.#s:this.ready?(this.#s=(async()=>{try{const t=Dt.from(Z(await this.send("eth_chainId",[])));return this.#s=null,t}catch(t){throw this.#s=null,t}})(),await this.#s):(this.#s=(async()=>{const t={id:this.#t++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:t});let n;try{n=(await this._send(t))[0],this.#s=null}catch(i){throw this.#s=null,this.emit("debug",{action:"receiveRpcError",error:i}),i}if(this.emit("debug",{action:"receiveRpcResult",result:n}),"result"in n)return Dt.from(Z(n.result));throw this.getRpcError(t,n)})(),await this.#s)}_start(){this.#i==null||this.#i.resolve==null||(this.#i.resolve(),this.#i=null,(async()=>{for(;this.#a==null&&!this.destroyed;)try{this.#a=await this._detectNetwork()}catch(e){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",He("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:e}})),await t9(1e3)}this.#o()})())}async _waitUntilReady(){if(this.#i!=null)return await this.#i.promise}_getSubscriber(e){return e.type==="pending"?new Z7(this):e.type==="event"?this._getOption("polling")?new tf(this,e.filter):new X7(this,e.filter):e.type==="orphan"&&e.filter.orphan==="drop-log"?new fb("orphan"):super._getSubscriber(e)}get ready(){return this.#i==null}getRpcTransaction(e){const t={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(n=>{if(e[n]==null)return;let i=n;n==="gasLimit"&&(i="gas"),t[i]=sn(Z(e[n],`tx.${n}`))}),["from","to","data"].forEach(n=>{e[n]!=null&&(t[n]=_(e[n]))}),e.accessList&&(t.accessList=Ir(e.accessList)),e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes.map(n=>n.toLowerCase())),e.authorizationList&&(t.authorizationList=e.authorizationList.map(n=>{const i=gm(n);return{address:i.address,nonce:sn(i.nonce),chainId:sn(i.chainId),yParity:sn(i.signature.yParity),r:sn(i.signature.r),s:sn(i.signature.s)}})),t}getRpcRequest(e){switch(e.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[Hr(e.address),e.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[Hr(e.address),e.blockTag]};case"getCode":return{method:"eth_getCode",args:[Hr(e.address),e.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[Hr(e.address),"0x"+e.position.toString(16),e.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[e.signedTransaction]};case"getBlock":if("blockTag"in e)return{method:"eth_getBlockByNumber",args:[e.blockTag,!!e.includeTransactions]};if("blockHash"in e)return{method:"eth_getBlockByHash",args:[e.blockHash,!!e.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[e.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[e.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(e.transaction),e.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(e.transaction)]};case"getLogs":return e.filter&&e.filter.address!=null&&(Array.isArray(e.filter.address)?e.filter.address=e.filter.address.map(Hr):e.filter.address=Hr(e.filter.address)),{method:"eth_getLogs",args:[e.filter]}}return null}getRpcError(e,t){const{method:n}=e,{error:i}=t;if(n==="eth_estimateGas"&&i.message){const l=i.message;if(!l.match(/revert/i)&&l.match(/insufficient funds/i))return He("insufficient funds","INSUFFICIENT_FUNDS",{transaction:e.params[0],info:{payload:e,error:i}});if(l.match(/nonce/i)&&l.match(/too low/i))return He("nonce has already been used","NONCE_EXPIRED",{transaction:e.params[0],info:{payload:e,error:i}})}if(n==="eth_call"||n==="eth_estimateGas"){const l=xl(i),f=ci.getBuiltinCallException(n==="eth_call"?"call":"estimateGas",e.params[0],l?l.data:null);return f.info={error:i,payload:e},f}const a=JSON.stringify(i9(i));if(typeof i.message=="string"&&i.message.match(/user denied|ethers-user-denied/i))return He("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[n]||"unknown",reason:"rejected",info:{payload:e,error:i}});if(n==="eth_sendRawTransaction"||n==="eth_sendTransaction"){const l=e.params[0];if(a.match(/insufficient funds|base fee exceeds gas limit/i))return He("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:l,info:{error:i}});if(a.match(/nonce/i)&&a.match(/too low/i))return He("nonce has already been used","NONCE_EXPIRED",{transaction:l,info:{error:i}});if(a.match(/replacement transaction/i)&&a.match(/underpriced/i))return He("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:l,info:{error:i}});if(a.match(/only replay-protected/i))return He("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:n,info:{transaction:l,info:{error:i}}})}let c=!!a.match(/the method .* does not exist/i);return c||i&&i.details&&i.details.startsWith("Unauthorized method:")&&(c=!0),c?He("unsupported operation","UNSUPPORTED_OPERATION",{operation:e.method,info:{error:i,payload:e}}):He("could not coalesce error","UNKNOWN_ERROR",{error:i,payload:e})}send(e,t){if(this.destroyed)return Promise.reject(He("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e}));const n=this.#t++,i=new Promise((a,c)=>{this.#n.push({resolve:a,reject:c,payload:{method:e,params:t,id:n,jsonrpc:"2.0"}})});return this.#o(),i}async getSigner(e){e==null&&(e=0);const t=this.send("eth_accounts",[]);if(typeof e=="number"){const i=await t;if(e>=i.length)throw new Error("no such account");return new Fu(this,i[e])}const{accounts:n}=await xt({network:this.getNetwork(),accounts:t});e=Be(e);for(const i of n)if(Be(i)===e)return new Fu(this,e);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(t=>new Fu(this,t))}destroy(){this.#r&&(clearTimeout(this.#r),this.#r=null);for(const{payload:e,reject:t}of this.#n)t(He("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e.method}));this.#n=[],super.destroy()}}class r9 extends n9{#e;constructor(e,t){super(e,t);let n=this._getOption("pollingInterval");n==null&&(n=db.pollingInterval),this.#e=n}_getSubscriber(e){const t=super._getSubscriber(e);return Zd(t)&&(t.pollingInterval=this.#e),t}get pollingInterval(){return this.#e}set pollingInterval(e){if(!Number.isInteger(e)||e<0)throw new Error("invalid interval");this.#e=e,this._forEachSubscriber(t=>{Zd(t)&&(t.pollingInterval=this.#e)})}}class H9 extends r9{#e;constructor(e,t,n){e==null&&(e="http://localhost:8545"),super(t,n),typeof e=="string"?this.#e=new En(e):this.#e=e.clone()}_getConnection(){return this.#e.clone()}async send(e,t){return await this._start(),await super.send(e,t)}async _send(e){const t=this._getConnection();t.body=JSON.stringify(e),t.setHeader("content-type","application/json");const n=await t.send();n.assertOk();let i=n.bodyJson;return Array.isArray(i)||(i=[i]),i}}function xl(r){if(r==null)return null;if(typeof r.message=="string"&&r.message.match(/revert/i)&&Le(r.data))return{message:r.message,data:r.data};if(typeof r=="object"){for(const e in r){const t=xl(r[e]);if(t)return t}return null}if(typeof r=="string")try{return xl(JSON.parse(r))}catch{}return null}function ml(r,e){if(r!=null){if(typeof r.message=="string"&&e.push(r.message),typeof r=="object")for(const t in r)ml(r[t],e);if(typeof r=="string")try{return ml(JSON.parse(r),e)}catch{}}}function i9(r){const e=[];return ml(r,e),e}class Wa extends nf{address;#e;constructor(e,t){super(t),O(e&&typeof e.sign=="function","invalid private key","privateKey","[ REDACTED ]"),this.#e=e;const n=ys(this.signingKey.publicKey);re(this,{address:n})}get signingKey(){return this.#e}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(e){return new Wa(this.#e,e)}async signTransaction(e){e=us(e);const{to:t,from:n}=await xt({to:e.to?at(e.to,this):void 0,from:e.from?at(e.from,this):void 0});t!=null&&(e.to=t),n!=null&&(e.from=n),e.from!=null&&(O(Be(e.from)===this.address,"transaction from address mismatch","tx.from",e.from),delete e.from);const i=_t.from(e);return i.signature=this.signingKey.sign(i.unsignedHash),i.serialized}async signMessage(e){return this.signMessageSync(e)}signMessageSync(e){return this.signingKey.sign(VE(e)).serialized}authorizeSync(e){O(typeof e.address=="string","invalid address for authorizeSync","auth.address",e);const t=this.signingKey.sign(eE(e));return Object.assign({},{address:Be(e.address),nonce:Z(e.nonce||0),chainId:Z(e.chainId||0)},{signature:t})}async authorize(e){return e=Object.assign({},e,{address:await at(e.address,this)}),this.authorizeSync(await this.populateAuthorization(e))}async signTypedData(e,t,n){const i=await At.resolveNames(e,t,n,async a=>{G(this.provider!=null,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:a}});const c=await this.provider.resolveName(a);return G(c!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:a}),c});return this.signingKey.sign(At.hash(i.domain,t,i.value)).serialized}}const Ba=" !#$%&'()*+,-./<=>?@[]^_`{|}~",s9=/^[a-z]*$/i;function ep(r,e){let t=97;return r.reduce((n,i)=>(i===e?t++:i.match(s9)?n.push(String.fromCharCode(t)+i):(t=97,n.push(i)),n),[])}function a9(r,e){for(let i=Ba.length-1;i>=0;i--)r=r.split(Ba[i]).join(e.substring(2*i,2*i+2));const t=[],n=r.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(i,a,c,l)=>{if(c)for(let f=parseInt(c);f>=0;f--)t.push(";");else t.push(a.toLowerCase());return""});if(n)throw new Error(`leftovers: ${JSON.stringify(n)}`);return ep(ep(t,";"),":")}function o9(r){return O(r[0]==="0","unsupported auwl data","data",r),a9(r.substring(1+2*Ba.length),r.substring(1,1+2*Ba.length))}class c9{locale;constructor(e){re(this,{locale:e})}split(e){return e.toLowerCase().split(/\s+/g)}join(e){return e.join(" ")}}class u9 extends c9{#e;#t;constructor(e,t,n){super(e),this.#e=t,this.#t=n,this.#n=null}get _data(){return this.#e}_decodeWords(){return o9(this.#e)}#n;#r(){if(this.#n==null){const e=this._decodeWords();if(Fn(e.join(`
|
|
15
|
-
`)+`
|
|
16
|
-
`)!==this.#t)throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);this.#n=e}return this.#n}getWord(e){const t=this.#r();return O(e>=0&&e<t.length,`invalid word index: ${e}`,"index",e),t[e]}getWordIndex(e){return this.#r().indexOf(e)}}const l9="0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN<aNn RRelyRga(R*lSeS-SketTt!3A^AnAutyCau'ComeEfF%eG(Ha=H(dLie=LowLtN^Nef./TrayTt Twe&Y#d3Cyc!DKeNdOlogyRdR`Tt _{AdeAmeAnketA,EakE[IndOodO[omOu'UeUrUsh_rdAtDyIlMbNeNusOkO,Rd R(gRrowSsTtomUn)XY_{etA(AndA[A=EadEezeI{Id+IefIghtIngIskOccoliOk&OnzeOomO` OwnUsh2Bb!DdyD+tFf$oIldLbLkL!tNd!Nk Rd&Rg R,SS(e[SyTt Y Zz:Bba+B(B!CtusGeKe~LmM aMpNN$N)lNdyNn#NoeNvasNy#Pab!P.$Pta(RRb#RdRgoRpetRryRtSeShS(o/!Su$TT$ogT^Teg%yTt!UghtU'Ut]Ve3Il(gL yM|NsusNturyRe$Rta(_irAlkAmp]An+AosApt Ar+A'AtEapE{Ee'EfErryE,I{&IefIldIm}yOi)Oo'R#-U{!UnkUrn0G?Nnam#Rc!Tiz&TyVil_imApArifyAwAyE<ErkEv I{I|IffImbIn-IpO{OgO'O`OudOwnUbUmpU, Ut^_^A,C#utDeFfeeIlInL!@L%LumnMb(eMeMf%tM-Mm#Mp<yNc tNdu@NfirmNg*[N}@Nsid NtrolNv()OkOlPp PyR$ReRnR*@/Tt#U^UntryUp!Ur'Us(V Yo>_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M<dMi'Ni$Nti,NyP?tP&dPos.P`PutyRi=ScribeS tSignSkSpair/royTailTe@VelopVi)Vo>3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-Eg<tEm|Eph<tEvat%I>Se0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-P<dPe@Pi*Pla(Po'P*[T&dTra0EEbrow:Br-CeCultyDeIntI`~L'MeMilyMousNNcyNtasyRmSh]TT$Th TigueUltV%.e3Atu*Bru?yD $EEdElMa!N)/iv$T^V W3B Ct]EldGu*LeLmLt N$NdNeNg NishReRmR,Sc$ShTT}[X_gAmeAshAtAv%EeIghtIpOatO{O%Ow UidUshY_mCusGIlLd~owOdOtR)Re,R+tRkRtu}RumRw?dSsil/ UndX_gi!AmeEqu|EshI&dIn+OgOntO,OwnOz&U.2ElNNnyRna)RyTu*:D+tInLaxy~ yMePRa+Rba+Rd&Rl-Rm|SSpTeTh U+Ze3N $NiusN*Nt!Nu(e/u*2O,0AntFtGg!Ng RaffeRlVe_dAn)A*A[IdeImp'ObeOomOryO=OwUe_tDde[LdOdO'RillaSpelSsipV nWn_bA)A(AntApeA[Av.yEatE&IdIefItOc yOupOwUnt_rdE[IdeIltIt?N3M:B.IrLfMm M, NdPpyRb%RdRshR=,TVeWkZ?d3AdAl`ArtAvyD+hogIght~oLmetLpNRo3Dd&Gh~NtPRe/%y5BbyCkeyLdLeLiday~owMeNeyOdPeRnRr%R'Sp.$/TelUrV 5BGeM<Mb!M%Nd*dNgryNtRd!RryRtSb<d3Brid:1EOn0EaEntifyLe2N%e4LLeg$L}[0A+Ita>M&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryF<tFl-tF%mHa!H .Iti$Je@JuryMa>N Noc|PutQuiryS<eSe@SideSpi*/$lTa@T e,ToVe,V.eVol=3On0L<dOla>Sue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/:Ng?oo3EnEpT^upY3CkDD}yNdNgdomSsTT^&TeTt&Wi4EeIfeO{Ow:BBelB%Dd DyKeMpNgua+PtopR+T T(UghUndryVaWWnWsu.Y Zy3Ad AfArnA=Ctu*FtGG$G&dIsu*M#NdNg`NsOp?dSs#Tt Vel3ArB tyBr?yC&'FeFtGhtKeMbM.NkOnQuid/Tt!VeZ?d5AdAnB, C$CkG-NelyNgOpTt yUdUn+VeY$5CkyGga+Mb N?N^Xury3R-s:Ch(eDG-G}tIdIlInJ%KeMm$NNa+Nda>NgoNs]Nu$P!Rb!R^Rg(R(eRketRria+SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurE<Tob 0Or1FF Fi)T&2L1Ay0DI=Ymp-0It0CeEI#L(eLy1EnEraIn]Po'T]1An+B.Ch?dD D(?yG<I|Ig($Ph<0Tr-h0H 0Tdo%T TputTside0AlEnEr0NN 0Yg&0/ 0O}:CtDd!GeIrLa)LmNdaNelN-N` P RadeR|RkRrotRtySsT^ThTi|TrolTt nU'VeYm|3A)AnutArAs<tL-<NN$tyNcilOp!Pp Rfe@Rm.Rs#T2O}OtoRa'Ys-$0AnoCn-Ctu*E)GGe#~LotNkO} Pe/olT^Zza_)A}tA,-A>AyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOg<OtOwUsh0AllArtI!OkeOo`0A{AkeApIffOw0ApCc Ci$CkDaFtL?Ldi LidLut]L=Me#eNgOnRryRtUlUndUpUr)U`0A)A*Ati$AwnEakEci$EedEllEndH eI)Id IkeInIr.L.OilOns%O#OrtOtRayReadR(gY0Ua*UeezeUir*l_b!AdiumAffA+AirsAmpAndArtA>AyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NN<tNnisNtRm/Xt_nkAtEmeEnE%yE*EyIngIsOughtReeRi=RowUmbUnd 0CketDeG LtMb MeNyPRedSsueT!5A,BaccoDayDdl EGe` I!tK&MatoM%rowNeNgueNightOlO`PP-Pp!R^RnadoRtoi'SsT$Uri,W?dW WnY_{AdeAff-Ag-A(Ansf ApAshA=lAyEatEeEndI$IbeI{Igg ImIpOphyOub!U{UeUlyUmpetU,U`Y2BeIt]Mb!NaN}lRkeyRnRt!1El=EntyI)InI,O1PeP-$:5Ly5B*lla0Ab!Awa*C!Cov D DoFairFoldHappyIf%mIqueItIv 'KnownLo{TilUsu$Veil1Da>GradeHoldOnP Set1B<Ge0A+EEdEfulE![U$0Il.y:C<tCuumGueLidL!yL=NNishP%Rious/Ult3H-!L=tNd%Ntu*NueRbRifyRs]RyS'lT <3Ab!Br<tCiousCt%yDeoEw~a+Nta+Ol(Rtu$RusSaS.Su$T$Vid5C$I)IdLc<oLumeTeYa+:GeG#ItLk~LnutNtRfa*RmRri%ShSp/eT VeY3Al`Ap#ArA'lA` BDd(gEk&dIrdLcome/T_!AtEatEelEnE*IpIsp 0DeD`FeLd~NNdowNeNgNkNn Nt ReSdomSeShT}[5LfM<Nd OdOlRdRkRldRryR`_pE{E,!I,I>Ong::Rd3Ar~ow9UUngU`:3BraRo9NeO",f9="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60";let Uu=null;class Cr extends u9{constructor(){super("en",l9,f9)}static wordlist(){return Uu==null&&(Uu=new Cr),Uu}}function pb(r){return(1<<r)-1<<8-r&255}function h9(r){return(1<<r)-1&255}function Lu(r,e){sx("NFKD"),e==null&&(e=Cr.wordlist());const t=e.split(r);O(t.length%3===0&&t.length>=12&&t.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const n=new Uint8Array(Math.ceil(11*t.length/8));let i=0;for(let p=0;p<t.length;p++){let h=e.getWordIndex(t[p].normalize("NFKD"));O(h>=0,`invalid mnemonic word at index ${p}`,"mnemonic","[ REDACTED ]");for(let x=0;x<11;x++)h&1<<10-x&&(n[i>>3]|=1<<7-i%8),i++}const a=32*t.length/3,c=t.length/3,l=pb(c),f=Y(Kt(n.slice(0,a/8)))[0]&l;return O(f===(n[n.length-1]&l),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),_(n.slice(0,a/8))}function Mu(r,e){O(r.length%4===0&&r.length>=16&&r.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),e==null&&(e=Cr.wordlist());const t=[0];let n=11;for(let c=0;c<r.length;c++)n>8?(t[t.length-1]<<=8,t[t.length-1]|=r[c],n-=8):(t[t.length-1]<<=n,t[t.length-1]|=r[c]>>8-n,t.push(r[c]&h9(8-n)),n+=3);const i=r.length/4,a=parseInt(Kt(r).substring(2,4),16)&pb(i);return t[t.length-1]<<=i,t[t.length-1]|=a>>8-i,e.join(t.map(c=>e.getWord(c)))}const Vu={};class li{phrase;password;wordlist;entropy;constructor(e,t,n,i,a){i==null&&(i=""),a==null&&(a=Cr.wordlist()),Nr(e,Vu,"Mnemonic"),re(this,{phrase:n,password:i,wordlist:a,entropy:t})}computeSeed(){const e=Tt("mnemonic"+this.password,"NFKD");return rr(Tt(this.phrase,"NFKD"),e,2048,64,"sha512")}static fromPhrase(e,t,n){const i=Lu(e,n);return e=Mu(Y(i),n),new li(Vu,i,e,t,n)}static fromEntropy(e,t,n){const i=Y(e,"entropy"),a=Mu(i,n);return new li(Vu,_(i),a,t,n)}static entropyToPhrase(e,t){const n=Y(e,"entropy");return Mu(n,t)}static phraseToEntropy(e,t){return Lu(e,t)}static isValidMnemonic(e,t){try{return Lu(e,t),!0}catch{}return!1}}var ot=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Gu=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ha,Gt,pn;const d9={16:10,24:12,32:14},p9=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],Mt=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],ta=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],x9=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],m9=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],b9=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],g9=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],y9=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],w9=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],A9=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],E9=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],B9=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],R9=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],T9=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],v9=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function zu(r){const e=[];for(let t=0;t<r.length;t+=4)e.push(r[t]<<24|r[t+1]<<16|r[t+2]<<8|r[t+3]);return e}class sf{get key(){return ot(this,ha,"f").slice()}constructor(e){if(ha.set(this,void 0),Gt.set(this,void 0),pn.set(this,void 0),!(this instanceof sf))throw Error("AES must be instanitated with `new`");Gu(this,ha,new Uint8Array(e),"f");const t=d9[this.key.length];if(t==null)throw new TypeError("invalid key size (must be 16, 24 or 32 bytes)");Gu(this,pn,[],"f"),Gu(this,Gt,[],"f");for(let h=0;h<=t;h++)ot(this,pn,"f").push([0,0,0,0]),ot(this,Gt,"f").push([0,0,0,0]);const n=(t+1)*4,i=this.key.length/4,a=zu(this.key);let c;for(let h=0;h<i;h++)c=h>>2,ot(this,pn,"f")[c][h%4]=a[h],ot(this,Gt,"f")[t-c][h%4]=a[h];let l=0,f=i,p;for(;f<n;){if(p=a[i-1],a[0]^=Mt[p>>16&255]<<24^Mt[p>>8&255]<<16^Mt[p&255]<<8^Mt[p>>24&255]^p9[l]<<24,l+=1,i!=8)for(let E=1;E<i;E++)a[E]^=a[E-1];else{for(let E=1;E<i/2;E++)a[E]^=a[E-1];p=a[i/2-1],a[i/2]^=Mt[p&255]^Mt[p>>8&255]<<8^Mt[p>>16&255]<<16^Mt[p>>24&255]<<24;for(let E=i/2+1;E<i;E++)a[E]^=a[E-1]}let h=0,x,y;for(;h<i&&f<n;)x=f>>2,y=f%4,ot(this,pn,"f")[x][y]=a[h],ot(this,Gt,"f")[t-x][y]=a[h++],f++}for(let h=1;h<t;h++)for(let x=0;x<4;x++)p=ot(this,Gt,"f")[h][x],ot(this,Gt,"f")[h][x]=B9[p>>24&255]^R9[p>>16&255]^T9[p>>8&255]^v9[p&255]}encrypt(e){if(e.length!=16)throw new TypeError("invalid plaintext size (must be 16 bytes)");const t=ot(this,pn,"f").length-1,n=[0,0,0,0];let i=zu(e);for(let l=0;l<4;l++)i[l]^=ot(this,pn,"f")[0][l];for(let l=1;l<t;l++){for(let f=0;f<4;f++)n[f]=x9[i[f]>>24&255]^m9[i[(f+1)%4]>>16&255]^b9[i[(f+2)%4]>>8&255]^g9[i[(f+3)%4]&255]^ot(this,pn,"f")[l][f];i=n.slice()}const a=new Uint8Array(16);let c=0;for(let l=0;l<4;l++)c=ot(this,pn,"f")[t][l],a[4*l]=(Mt[i[l]>>24&255]^c>>24)&255,a[4*l+1]=(Mt[i[(l+1)%4]>>16&255]^c>>16)&255,a[4*l+2]=(Mt[i[(l+2)%4]>>8&255]^c>>8)&255,a[4*l+3]=(Mt[i[(l+3)%4]&255]^c)&255;return a}decrypt(e){if(e.length!=16)throw new TypeError("invalid ciphertext size (must be 16 bytes)");const t=ot(this,Gt,"f").length-1,n=[0,0,0,0];let i=zu(e);for(let l=0;l<4;l++)i[l]^=ot(this,Gt,"f")[0][l];for(let l=1;l<t;l++){for(let f=0;f<4;f++)n[f]=y9[i[f]>>24&255]^w9[i[(f+3)%4]>>16&255]^A9[i[(f+2)%4]>>8&255]^E9[i[(f+1)%4]&255]^ot(this,Gt,"f")[l][f];i=n.slice()}const a=new Uint8Array(16);let c=0;for(let l=0;l<4;l++)c=ot(this,Gt,"f")[t][l],a[4*l]=(ta[i[l]>>24&255]^c>>24)&255,a[4*l+1]=(ta[i[(l+3)%4]>>16&255]^c>>16)&255,a[4*l+2]=(ta[i[(l+2)%4]>>8&255]^c>>8)&255,a[4*l+3]=(ta[i[(l+1)%4]&255]^c)&255;return a}}ha=new WeakMap,Gt=new WeakMap,pn=new WeakMap;class xb{constructor(e,t,n){if(n&&!(this instanceof n))throw new Error(`${e} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new sf(t)},name:{enumerable:!0,value:e}})}}var na=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},$r=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Hi,Bn;class af extends xb{constructor(e,t){if(super("ECC",e,af),Hi.set(this,void 0),Bn.set(this,void 0),t){if(t.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");na(this,Hi,new Uint8Array(t),"f")}else na(this,Hi,new Uint8Array(16),"f");na(this,Bn,this.iv,"f")}get iv(){return new Uint8Array($r(this,Hi,"f"))}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16){for(let i=0;i<16;i++)$r(this,Bn,"f")[i]^=e[n+i];na(this,Bn,this.aes.encrypt($r(this,Bn,"f")),"f"),t.set($r(this,Bn,"f"),n)}return t}decrypt(e){if(e.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");const t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16){const i=this.aes.decrypt(e.subarray(n,n+16));for(let a=0;a<16;a++)t[n+a]=i[a]^$r(this,Bn,"f")[a],$r(this,Bn,"f")[a]=e[n+a]}return t}}Hi=new WeakMap,Bn=new WeakMap;var _r=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Vt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},$i,pr,zt;class fi extends xb{constructor(e,t){super("CTR",e,fi),$i.set(this,void 0),pr.set(this,void 0),zt.set(this,void 0),_r(this,zt,new Uint8Array(16),"f"),Vt(this,zt,"f").fill(0),_r(this,$i,Vt(this,zt,"f"),"f"),_r(this,pr,16,"f"),t==null&&(t=1),typeof t=="number"?this.setCounterValue(t):this.setCounterBytes(t)}get counter(){return new Uint8Array(Vt(this,zt,"f"))}setCounterValue(e){if(!Number.isInteger(e)||e<0||e>Number.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let t=15;t>=0;--t)Vt(this,zt,"f")[t]=e%256,e=Math.floor(e/256)}setCounterBytes(e){if(e.length!==16)throw new TypeError("invalid counter initial Uint8Array value length");Vt(this,zt,"f").set(e)}increment(){for(let e=15;e>=0;e--)if(Vt(this,zt,"f")[e]===255)Vt(this,zt,"f")[e]=0;else{Vt(this,zt,"f")[e]++;break}}encrypt(e){var t,n;const i=new Uint8Array(e);for(let a=0;a<i.length;a++)Vt(this,pr,"f")===16&&(_r(this,$i,this.aes.encrypt(Vt(this,zt,"f")),"f"),_r(this,pr,0,"f"),this.increment()),i[a]^=Vt(this,$i,"f")[_r(this,pr,(n=Vt(this,pr,"f"),t=n++,n),"f"),t];return i}decrypt(e){return this.encrypt(e)}}$i=new WeakMap,pr=new WeakMap,zt=new WeakMap;function O9(r){if(r.length<16)throw new TypeError("PKCS#7 invalid length");const e=r[r.length-1];if(e>16)throw new TypeError("PKCS#7 padding byte out of range");const t=r.length-e;for(let n=0;n<e;n++)if(r[t+n]!==e)throw new TypeError("PKCS#7 invalid padding byte");return new Uint8Array(r.subarray(0,t))}function mb(r){return typeof r=="string"&&!r.startsWith("0x")&&(r="0x"+r),ft(r)}function Mi(r,e){for(r=String(r);r.length<e;)r="0"+r;return r}function Rs(r){return typeof r=="string"?Tt(r,"NFKC"):ft(r)}function Qe(r,e){const t=e.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);O(t!=null,"invalid path","path",e);const n=t[1],i=t[3],a=t[4]==="!";let c=r;for(const l of n.toLowerCase().split(".")){if(Array.isArray(c)){if(!l.match(/^[0-9]+$/))break;c=c[parseInt(l)]}else if(typeof c=="object"){let f=null;for(const p in c)if(p.toLowerCase()===l){f=c[p];break}c=f}else c=null;if(c==null)break}if(O(!a||c!=null,"missing required value","path",n),i&&c!=null){if(i==="int"){if(typeof c=="string"&&c.match(/^-?[0-9]+$/))return parseInt(c);if(Number.isSafeInteger(c))return c}if(i==="number"&&typeof c=="string"&&c.match(/^-?[0-9.]*$/))return parseFloat(c);if(i==="data"&&typeof c=="string")return mb(c);if(i==="array"&&Array.isArray(c)||i===typeof c)return c;O(!1,`wrong type found for ${i} `,"path",n)}return c}const bb="m/44'/60'/0'/0/0";function tp(r){try{const e=JSON.parse(r);if((e.version!=null?parseInt(e.version):0)===3)return!0}catch{}return!1}function C9(r,e,t){if(Qe(r,"crypto.cipher:string")==="aes-128-ctr"){const i=Qe(r,"crypto.cipherparams.iv:data!"),a=new fi(e,i);return _(a.decrypt(t))}G(!1,"unsupported cipher","UNSUPPORTED_OPERATION",{operation:"decrypt"})}function Ra(r,e){const t=Y(e),n=Qe(r,"crypto.ciphertext:data!"),i=_(ze(Ce([t.slice(16,32),n]))).substring(2);O(i===Qe(r,"crypto.mac:string!").toLowerCase(),"incorrect password","password","[ REDACTED ]");const a=C9(r,t.slice(0,16),n),c=ys(a);if(r.address){let p=r.address.toLowerCase();p.startsWith("0x")||(p="0x"+p),O(Be(p)===c,"keystore address/privateKey mismatch","address",r.address)}const l={address:c,privateKey:a};if(Qe(r,"x-ethers.version:string")==="0.1"){const p=t.slice(32,64),h=Qe(r,"x-ethers.mnemonicCiphertext:data!"),x=Qe(r,"x-ethers.mnemonicCounter:data!"),y=new fi(p,x);l.mnemonic={path:Qe(r,"x-ethers.path:string")||bb,locale:Qe(r,"x-ethers.locale:string")||"en",entropy:_(Y(y.decrypt(h)))}}return l}function gb(r){const e=Qe(r,"crypto.kdf:string");if(e&&typeof e=="string"){if(e.toLowerCase()==="scrypt"){const t=Qe(r,"crypto.kdfparams.salt:data!"),n=Qe(r,"crypto.kdfparams.n:int!"),i=Qe(r,"crypto.kdfparams.r:int!"),a=Qe(r,"crypto.kdfparams.p:int!");O(n>0&&(n&n-1)===0,"invalid kdf.N","kdf.N",n),O(i>0&&a>0,"invalid kdf","kdf",e);const c=Qe(r,"crypto.kdfparams.dklen:int!");return O(c===32,"invalid kdf.dklen","kdf.dflen",c),{name:"scrypt",salt:t,N:n,r:i,p:a,dkLen:64}}else if(e.toLowerCase()==="pbkdf2"){const t=Qe(r,"crypto.kdfparams.salt:data!"),n=Qe(r,"crypto.kdfparams.prf:string!"),i=n.split("-").pop();O(i==="sha256"||i==="sha512","invalid kdf.pdf","kdf.pdf",n);const a=Qe(r,"crypto.kdfparams.c:int!"),c=Qe(r,"crypto.kdfparams.dklen:int!");return O(c===32,"invalid kdf.dklen","kdf.dklen",c),{name:"pbkdf2",salt:t,count:a,dkLen:c,algorithm:i}}}O(!1,"unsupported key-derivation function","kdf",e)}function S9(r,e){const t=JSON.parse(r),n=Rs(e),i=gb(t);if(i.name==="pbkdf2"){const{salt:x,count:y,dkLen:E,algorithm:v}=i,R=rr(n,x,y,E,v);return Ra(t,R)}G(i.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:i});const{salt:a,N:c,r:l,p:f,dkLen:p}=i,h=bi(n,a,c,l,f,p);return Ra(t,h)}function np(r){return new Promise(e=>{setTimeout(()=>{e()},r)})}async function N9(r,e,t){const n=JSON.parse(r),i=Rs(e),a=gb(n);if(a.name==="pbkdf2"){t&&(t(0),await np(0));const{salt:y,count:E,dkLen:v,algorithm:R}=a,C=rr(i,y,E,v,R);return t&&(t(1),await np(0)),Ra(n,C)}G(a.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:a});const{salt:c,N:l,r:f,p,dkLen:h}=a,x=await mi(i,c,l,f,p,h,t);return Ra(n,x)}function yb(r){const e=r.salt!=null?Y(r.salt,"options.salt"):In(32);let t=1<<17,n=8,i=1;return r.scrypt&&(r.scrypt.N&&(t=r.scrypt.N),r.scrypt.r&&(n=r.scrypt.r),r.scrypt.p&&(i=r.scrypt.p)),O(typeof t=="number"&&t>0&&Number.isSafeInteger(t)&&(BigInt(t)&BigInt(t-1))===BigInt(0),"invalid scrypt N parameter","options.N",t),O(typeof n=="number"&&n>0&&Number.isSafeInteger(n),"invalid scrypt r parameter","options.r",n),O(typeof i=="number"&&i>0&&Number.isSafeInteger(i),"invalid scrypt p parameter","options.p",i),{name:"scrypt",dkLen:32,salt:e,N:t,r:n,p:i}}function wb(r,e,t,n){const i=Y(t.privateKey,"privateKey"),a=n.iv!=null?Y(n.iv,"options.iv"):In(16);O(a.length===16,"invalid options.iv length","options.iv",n.iv);const c=n.uuid!=null?Y(n.uuid,"options.uuid"):In(16);O(c.length===16,"invalid options.uuid length","options.uuid",n.iv);const l=r.slice(0,16),f=r.slice(16,32),p=new fi(l,a),h=Y(p.encrypt(i)),x=ze(Ce([f,h])),y={address:t.address.substring(2).toLowerCase(),id:kA(c),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:_(a).substring(2)},ciphertext:_(h).substring(2),kdf:"scrypt",kdfparams:{salt:_(e.salt).substring(2),n:e.N,dklen:32,p:e.p,r:e.r},mac:x.substring(2)}};if(t.mnemonic){const E=n.client!=null?n.client:`ethers/${rx}`,v=t.mnemonic.path||bb,R=t.mnemonic.locale||"en",C=r.slice(32,64),S=Y(t.mnemonic.entropy,"account.mnemonic.entropy"),D=In(16),U=new fi(C,D),K=Y(U.encrypt(S)),H=new Date,F="UTC--"+(H.getUTCFullYear()+"-"+Mi(H.getUTCMonth()+1,2)+"-"+Mi(H.getUTCDate(),2)+"T"+Mi(H.getUTCHours(),2)+"-"+Mi(H.getUTCMinutes(),2)+"-"+Mi(H.getUTCSeconds(),2)+".0Z")+"--"+y.address;y["x-ethers"]={client:E,gethFilename:F,path:v,locale:R,mnemonicCounter:_(D).substring(2),mnemonicCiphertext:_(K).substring(2),version:"0.1"}}return JSON.stringify(y)}function Ab(r,e,t){t==null&&(t={});const n=Rs(e),i=yb(t),a=bi(n,i.salt,i.N,i.r,i.p,64);return wb(Y(a),i,r,t)}async function Eb(r,e,t){t==null&&(t={});const n=Rs(e),i=yb(t),a=await mi(n,i.salt,i.N,i.r,i.p,64,t.progressCallback);return wb(Y(a),i,r,t)}const Hu="m/44'/60'/0'/0/0",I9=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),er=2147483648,P9=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),k9="0123456789abcdef";function Ta(r,e){let t="";for(;r;)t=k9[r%16]+t,r=Math.trunc(r/16);for(;t.length<e*2;)t="0"+t;return"0x"+t}function bl(r){const e=Y(r),t=Ve(Kt(Kt(e)),0,4),n=Ce([e,t]);return ux(n)}const mn={};function Bb(r,e,t,n){const i=new Uint8Array(37);r&er?(G(n!=null,"cannot derive child of neutered node","UNSUPPORTED_OPERATION",{operation:"deriveChild"}),i.set(Y(n),1)):i.set(Y(t));for(let c=24;c>=0;c-=8)i[33+(c>>3)]=r>>24-c&255;const a=Y(pi("sha512",e,i));return{IL:a.slice(0,32),IR:a.slice(32)}}function Rb(r,e){const t=e.split("/");O(t.length>0,"invalid path","path",e),t[0]==="m"&&(O(r.depth===0,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${r.depth}`,"path",e),t.shift());let n=r;for(let i=0;i<t.length;i++){const a=t[i];if(a.match(/^[0-9]+'$/)){const c=parseInt(a.substring(0,a.length-1));O(c<er,"invalid path index",`path[${i}]`,a),n=n.deriveChild(er+c)}else if(a.match(/^[0-9]+$/)){const c=parseInt(a);O(c<er,"invalid path index",`path[${i}]`,a),n=n.deriveChild(c)}else O(!1,"invalid path component",`path[${i}]`,a)}return n}class jt extends Wa{publicKey;fingerprint;parentFingerprint;mnemonic;chainCode;path;index;depth;constructor(e,t,n,i,a,c,l,f,p){super(t,p),Nr(e,mn,"HDNodeWallet"),re(this,{publicKey:t.compressedPublicKey});const h=Ve(xi(Kt(this.publicKey)),0,4);re(this,{parentFingerprint:n,fingerprint:h,chainCode:i,path:a,index:c,depth:l}),re(this,{mnemonic:f})}connect(e){return new jt(mn,this.signingKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.mnemonic,e)}#e(){const e={address:this.address,privateKey:this.privateKey},t=this.mnemonic;return this.path&&t&&t.wordlist.locale==="en"&&t.password===""&&(e.mnemonic={path:this.path,locale:"en",entropy:t.entropy}),e}async encrypt(e,t){return await Eb(this.#e(),e,{progressCallback:t})}encryptSync(e){return Ab(this.#e(),e)}get extendedKey(){return G(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),bl(Ce(["0x0488ADE4",Ta(this.depth,1),this.parentFingerprint,Ta(this.index,4),this.chainCode,Ce(["0x00",this.privateKey])]))}hasPath(){return this.path!=null}neuter(){return new fs(mn,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.provider)}deriveChild(e){const t=pe(e,"index");O(t<=4294967295,"invalid index","index",t);let n=this.path;n&&(n+="/"+(t&~er),t&er&&(n+="'"));const{IR:i,IL:a}=Bb(t,this.chainCode,this.publicKey,this.privateKey),c=new Ct(Dn((La(a)+BigInt(this.privateKey))%P9,32));return new jt(mn,c,this.fingerprint,_(i),n,t,this.depth+1,this.mnemonic,this.provider)}derivePath(e){return Rb(this,e)}static#t(e,t){O(Fa(e),"invalid seed","seed","[REDACTED]");const n=Y(e,"seed");O(n.length>=16&&n.length<=64,"invalid seed","seed","[REDACTED]");const i=Y(pi("sha512",I9,n)),a=new Ct(_(i.slice(0,32)));return new jt(mn,a,"0x00000000",_(i.slice(32)),"m",0,0,t,null)}static fromExtendedKey(e){const t=je(bA(e));O(t.length===82||bl(t.slice(0,78))===e,"invalid extended key","extendedKey","[ REDACTED ]");const n=t[4],i=_(t.slice(5,9)),a=parseInt(_(t.slice(9,13)).substring(2),16),c=_(t.slice(13,45)),l=t.slice(45,78);switch(_(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":{const f=_(l);return new fs(mn,ys(f),f,i,c,null,a,n,null)}case"0x0488ade4":case"0x04358394 ":if(l[0]!==0)break;return new jt(mn,new Ct(l.slice(1)),i,c,null,a,n,null,null)}O(!1,"invalid extended key prefix","extendedKey","[ REDACTED ]")}static createRandom(e,t,n){e==null&&(e=""),t==null&&(t=Hu),n==null&&(n=Cr.wordlist());const i=li.fromEntropy(In(16),e,n);return jt.#t(i.computeSeed(),i).derivePath(t)}static fromMnemonic(e,t){return t||(t=Hu),jt.#t(e.computeSeed(),e).derivePath(t)}static fromPhrase(e,t,n,i){t==null&&(t=""),n==null&&(n=Hu),i==null&&(i=Cr.wordlist());const a=li.fromPhrase(e,t,i);return jt.#t(a.computeSeed(),a).derivePath(n)}static fromSeed(e){return jt.#t(e,null)}}class fs extends rf{publicKey;fingerprint;parentFingerprint;chainCode;path;index;depth;constructor(e,t,n,i,a,c,l,f,p){super(t,p),Nr(e,mn,"HDNodeVoidWallet"),re(this,{publicKey:n});const h=Ve(xi(Kt(n)),0,4);re(this,{publicKey:n,fingerprint:h,parentFingerprint:i,chainCode:a,path:c,index:l,depth:f})}connect(e){return new fs(mn,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,e)}get extendedKey(){return G(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),bl(Ce(["0x0488B21E",Ta(this.depth,1),this.parentFingerprint,Ta(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return this.path!=null}deriveChild(e){const t=pe(e,"index");O(t<=4294967295,"invalid index","index",t);let n=this.path;n&&(n+="/"+(t&~er),t&er&&(n+="'"));const{IR:i,IL:a}=Bb(t,this.chainCode,this.publicKey,null),c=Ct.addPoints(a,this.publicKey,!0),l=ys(c);return new fs(mn,l,c,this.fingerprint,_(i),n,t,this.depth+1,this.provider)}derivePath(e){return Rb(this,e)}}function rp(r){try{if(JSON.parse(r).encseed)return!0}catch{}return!1}function ip(r,e){const t=JSON.parse(r),n=Rs(e),i=Be(Qe(t,"ethaddr:string!")),a=mb(Qe(t,"encseed:string!"));O(a&&a.length%16===0,"invalid encseed","json",r);const c=Y(rr(n,n,2e3,32,"sha256")).slice(0,16),l=a.slice(0,16),f=a.slice(16),p=new af(c,l),h=O9(Y(p.decrypt(f)));let x="";for(let y=0;y<h.length;y++)x+=String.fromCharCode(h[y]);return{address:i,privateKey:Fn(x)}}function sp(r){return new Promise(e=>{setTimeout(()=>{e()},r)})}class _i extends Wa{constructor(e,t){typeof e=="string"&&!e.startsWith("0x")&&(e="0x"+e);let n=typeof e=="string"?new Ct(e):e;super(n,t)}connect(e){return new _i(this.signingKey,e)}async encrypt(e,t){const n={address:this.address,privateKey:this.privateKey};return await Eb(n,e,{progressCallback:t})}encryptSync(e){const t={address:this.address,privateKey:this.privateKey};return Ab(t,e)}static#e(e){if(O(e,"invalid JSON wallet","json","[ REDACTED ]"),"mnemonic"in e&&e.mnemonic&&e.mnemonic.locale==="en"){const n=li.fromEntropy(e.mnemonic.entropy),i=jt.fromMnemonic(n,e.mnemonic.path);if(i.address===e.address&&i.privateKey===e.privateKey)return i;console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const t=new _i(e.privateKey);return O(t.address===e.address,"address/privateKey mismatch","json","[ REDACTED ]"),t}static async fromEncryptedJson(e,t,n){let i=null;return tp(e)?i=await N9(e,t,n):rp(e)&&(n&&(n(0),await sp(0)),i=ip(e,t),n&&(n(1),await sp(0))),_i.#e(i)}static fromEncryptedJsonSync(e,t){let n=null;return tp(e)?n=S9(e,t):rp(e)?n=ip(e,t):O(!1,"invalid JSON wallet","json","[ REDACTED ]"),_i.#e(n)}static createRandom(e){const t=jt.createRandom();return e?t.connect(e):t}static fromPhrase(e,t){const n=jt.fromPhrase(e);return t?n.connect(t):n}}export{V9 as B,Ji as C,qe as D,mt as E,bt as F,it as I,H9 as J,Er as M,G9 as N,vn as P,se as R,an as S,w as T,_i as W,F9 as _,Pp as a,Kr as b,me as c,De as d,On as e,qt as f,Be as g,jr as h,we as i,pt as j,Pt as k,U9 as l,dp as m,ju as n,mp as o,ra as p,L9 as q,In as r,Vr as s,Gr as t,hn as u};
|