@orbs-network/spot-react 0.0.32 → 0.0.33
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as p, g as m, s as w, d as k, i as b, l as L, a as O, c as E, b as x, e as R, H as y, f as M } from "./index-
|
|
1
|
+
import { B as p, g as m, s as w, d as k, i as b, l as L, a as O, c as E, b as x, e as R, H as y, f as M } from "./index-GTPvxAxS.js";
|
|
2
2
|
class S extends p {
|
|
3
3
|
constructor({ callbackSelector: r, cause: a, data: n, extraData: i, sender: f, urls: t }) {
|
|
4
4
|
var o;
|
|
@@ -2880,7 +2880,7 @@ const Hw = async ({
|
|
|
2880
2880
|
}) => (await Promise.all([
|
|
2881
2881
|
s ? Hw({ chainId: r, signal: e, page: t, limit: n, filters: { accounts: [a], configs: [s] } }) : Promise.resolve([]),
|
|
2882
2882
|
Ow({ chainId: r, signal: e, account: a })
|
|
2883
|
-
]).then(([c, l]) => [...c, ...l])).sort((c, l) => l.createdAt - c.createdAt), Ww = "0.0.
|
|
2883
|
+
]).then(([c, l]) => [...c, ...l])).sort((c, l) => l.createdAt - c.createdAt), Ww = "0.0.33", qw = {
|
|
2884
2884
|
version: Ww
|
|
2885
2885
|
};
|
|
2886
2886
|
var yo = class {
|
|
@@ -27806,7 +27806,7 @@ async function ku(e, t) {
|
|
|
27806
27806
|
});
|
|
27807
27807
|
return ie === "0x" ? { data: void 0 } : { data: ie };
|
|
27808
27808
|
} catch (U) {
|
|
27809
|
-
const F = OD(U), { offchainLookup: N, offchainLookupSignature: z } = await import("./ccip-
|
|
27809
|
+
const F = OD(U), { offchainLookup: N, offchainLookupSignature: z } = await import("./ccip-CsAa3Hg-.js");
|
|
27810
27810
|
if (e.ccipRead !== !1 && (F == null ? void 0 : F.slice(0, 10)) === z && C)
|
|
27811
27811
|
return { data: await N(e, { data: F, to: C }) };
|
|
27812
27812
|
throw A && (F == null ? void 0 : F.slice(0, 10)) === "0x101bb98d" ? new ZA({ factory: f }) : Zf(U, {
|
package/dist/spot-react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aT as e, C as r, a9 as t, D as i, aD as n, aR as E, aP as o, aS as _, aQ as T, aN as P, aH as u, al as l, aF as A, aE as I, ak as R, J as S, aC as O, au as L, as as d, at as g, aw as D, av as M, Q as m, aK as C, aL as U, aJ as p, aI as N, aM as b, O as c, N as F, P as k, M as y, aO as B, am as G, aG as h, ar as x, S as f, K as Y, L as H, ax as v, an as W, ao as w, ad as K, ae as Q, aa as V, be as X, T as z, a0 as j, a6 as q, U as J, X as Z, aj as $, aq as aa, aY as sa, bc as ea, a$ as ra, aU as ta, aV as ia, aX as na, b0 as Ea, a8 as oa, bb as _a, b2 as Ta, b7 as Pa, aZ as ua, b9 as la, Z as Aa, b8 as Ia, ba as Ra, a_ as Sa, ac as Oa, _ as La, af as da, $ as ga, a3 as Da, ah as Ma, aB as ma, bd as Ca, ag as Ua, b1 as pa, b5 as Na, b3 as ba, b6 as ca, b4 as Fa, aW as ka, a7 as ya, Y as Ba, V as Ga, aA as ha, a1 as xa, a2 as fa, az as Ya, ai as Ha, W as va, R as Wa, ap as wa, ab as Ka, a5 as Qa, a4 as Va, bf as Xa, A as za, r as ja, n as qa, h as Ja, j as Za, I as $a, v as as, t as ss, k as es, F as rs, p as ts, G as is, z as ns, m as Es, E as os, q as _s, w as Ts, u as Ps, y as us, o as ls, x as As, ay as Is } from "./index-
|
|
1
|
+
import { aT as e, C as r, a9 as t, D as i, aD as n, aR as E, aP as o, aS as _, aQ as T, aN as P, aH as u, al as l, aF as A, aE as I, ak as R, J as S, aC as O, au as L, as as d, at as g, aw as D, av as M, Q as m, aK as C, aL as U, aJ as p, aI as N, aM as b, O as c, N as F, P as k, M as y, aO as B, am as G, aG as h, ar as x, S as f, K as Y, L as H, ax as v, an as W, ao as w, ad as K, ae as Q, aa as V, be as X, T as z, a0 as j, a6 as q, U as J, X as Z, aj as $, aq as aa, aY as sa, bc as ea, a$ as ra, aU as ta, aV as ia, aX as na, b0 as Ea, a8 as oa, bb as _a, b2 as Ta, b7 as Pa, aZ as ua, b9 as la, Z as Aa, b8 as Ia, ba as Ra, a_ as Sa, ac as Oa, _ as La, af as da, $ as ga, a3 as Da, ah as Ma, aB as ma, bd as Ca, ag as Ua, b1 as pa, b5 as Na, b3 as ba, b6 as ca, b4 as Fa, aW as ka, a7 as ya, Y as Ba, V as Ga, aA as ha, a1 as xa, a2 as fa, az as Ya, ai as Ha, W as va, R as Wa, ap as wa, ab as Ka, a5 as Qa, a4 as Va, bf as Xa, A as za, r as ja, n as qa, h as Ja, j as Za, I as $a, v as as, t as ss, k as es, F as rs, p as ts, G as is, z as ns, m as Es, E as os, q as _s, w as Ts, u as Ps, y as us, o as ls, x as As, ay as Is } from "./index-GTPvxAxS.js";
|
|
2
2
|
export {
|
|
3
3
|
e as CRASH_ERROR_MESSAGE,
|
|
4
4
|
r as Components,
|
package/dist/spot-react.umd.cjs
CHANGED
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
dollarValueOut
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
`,extractResults:d=>{var f;return(((f=d.data)==null?void 0:f.orderFilleds)||[]).map(m=>({...m,timestamp:new Date(m.timestamp).getTime()}))}})};class kw extends Error{constructor(){super("No graph endpoint found"),this.name="NoGraphEndpointError"}}const Cw=async({chainId:e,signal:t,page:r,limit:n,filters:s})=>{const a=await ww({chainId:e,signal:t,page:r,limit:n,filters:s}),[o,i]=await Promise.all([Ew({chainId:e,orders:a,signal:t}),vw({chainId:e,orders:a,signal:t})]);return a.map(l=>{const u=o==null?void 0:o.filter(d=>d.TWAP_id===Number(l.Contract_id)&&Ps(d.exchange,l.exchange)&&Ps(d.twapAddress,l.twapAddress));return gw(l,e,u,Tw(l,u||[],i))}).sort((l,u)=>u.createdAt-l.createdAt)},Tw=(e,t,r)=>{var i;const n=(i=r==null?void 0:r.find(c=>c.twapId===e.Contract_id.toString()&&Ps(c.twapAddress,e.twapAddress)))==null?void 0:i.status,a=Th(t).reduce((c,l)=>c.plus(l.inAmount),new j(0)).toFixed(),o=Ah(e.ask_srcAmount,a);return Sw(o,e.ask_deadline*1e3,n)},Ah=(e,t)=>{if(!t||!e)return 0;const r=j(t).dividedBy(e).toNumber();return r>=.99?100:r<=0?0:Number((r*100).toFixed(2))},Sw=(e,t,r)=>e===100?lt.Completed:r==="CANCELED"?lt.Canceled:r==="COMPLETED"?lt.Completed:t>Date.now()?lt.Open:lt.Expired,Ph=async({signal:e,page:t,chainId:r,limit:n,config:s,account:a})=>(await Promise.all([s?Cw({chainId:r,signal:e,page:t,limit:n,filters:{accounts:[a],configs:[s]}}):Promise.resolve([]),bw({chainId:r,signal:e,account:a})]).then(([c,l])=>[...c,...l])).sort((c,l)=>l.createdAt-c.createdAt),Aw={version:"0.0.32"};var Ta=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Pw={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Iw=(f5=class{constructor(){le(this,dn,Pw);le(this,pa,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&N(this,pa)&&e!==N(this,dn)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:N(this,dn),provider:e}),ee(this,dn,e),process.env.NODE_ENV!=="production"&&ee(this,pa,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&ee(this,pa,!0),N(this,dn).setTimeout(e,t)}clearTimeout(e){N(this,dn).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&ee(this,pa,!0),N(this,dn).setInterval(e,t)}clearInterval(e){N(this,dn).clearInterval(e)}},dn=new WeakMap,pa=new WeakMap,f5),Fs=new Iw;function Bw(e){setTimeout(e,0)}var Us=typeof window>"u"||"Deno"in globalThis;function jt(){}function Fw(e,t){return typeof e=="function"?e(t):e}function fd(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ih(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Xn(e,t){return typeof e=="function"?e(t):e}function Er(e,t){return typeof e=="function"?e(t):e}function Bh(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:a,queryKey:o,stale:i}=e;if(o){if(n){if(t.queryHash!==md(o,t.options))return!1}else if(!Uo(t.queryKey,o))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof i=="boolean"&&t.isStale()!==i||s&&s!==t.state.fetchStatus||a&&!a(t))}function Fh(e,t){const{exact:r,status:n,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(Os(t.options.mutationKey)!==Os(a))return!1}else if(!Uo(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function md(e,t){return((t==null?void 0:t.queryKeyHashFn)||Os)(e)}function Os(e){return JSON.stringify(e,(t,r)=>bd(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function Uo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Uo(e[r],t[r])):!1}var Uw=Object.prototype.hasOwnProperty;function hd(e,t){if(e===t)return e;const r=Uh(e)&&Uh(t);if(!r&&!(bd(e)&&bd(t)))return t;const s=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,i=r?new Array(o):{};let c=0;for(let l=0;l<o;l++){const u=r?l:a[l],d=e[u],f=t[u];if(d===f){i[u]=d,(r?l<s:Uw.call(e,u))&&c++;continue}if(d===null||f===null||typeof d!="object"||typeof f!="object"){i[u]=f;continue}const m=hd(d,f);i[u]=m,m===d&&c++}return s===o&&c===s?e:i}function Oc(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function Uh(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function bd(e){if(!Oh(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!Oh(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Oh(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ow(e){return new Promise(t=>{Fs.setTimeout(t,e)})}function yd(e,t,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(e,t);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return hd(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return hd(e,t)}return t}function Dw(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function _w(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Dc=Symbol();function Dh(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Dc&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Dc?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function _h(e,t){return typeof e=="function"?e(...t):!!e}var Mw=(m5=class extends Ta{constructor(){super();le(this,fa);le(this,gs);le(this,go);ee(this,go,t=>{if(!Us&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){N(this,gs)||this.setEventListener(N(this,go))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,gs))==null||t.call(this),ee(this,gs,void 0))}setEventListener(t){var r;ee(this,go,t),(r=N(this,gs))==null||r.call(this),ee(this,gs,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){N(this,fa)!==t&&(ee(this,fa,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof N(this,fa)=="boolean"?N(this,fa):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},fa=new WeakMap,gs=new WeakMap,go=new WeakMap,m5),gd=new Mw;function xd(){let e,t;const r=new Promise((s,a)=>{e=s,t=a});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}var Nw=Bw;function Lw(){let e=[],t=0,r=i=>{i()},n=i=>{i()},s=Nw;const a=i=>{t?e.push(i):s(()=>{r(i)})},o=()=>{const i=e;e=[],i.length&&s(()=>{n(()=>{i.forEach(c=>{r(c)})})})};return{batch:i=>{let c;t++;try{c=i()}finally{t--,t||o()}return c},batchCalls:i=>(...c)=>{a(()=>{i(...c)})},schedule:a,setNotifyFunction:i=>{r=i},setBatchNotifyFunction:i=>{n=i},setScheduler:i=>{s=i}}}var kt=Lw(),zw=(h5=class extends Ta{constructor(){super();le(this,xo,!0);le(this,xs);le(this,wo);ee(this,wo,t=>{if(!Us&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){N(this,xs)||this.setEventListener(N(this,wo))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,xs))==null||t.call(this),ee(this,xs,void 0))}setEventListener(t){var r;ee(this,wo,t),(r=N(this,xs))==null||r.call(this),ee(this,xs,t(this.setOnline.bind(this)))}setOnline(t){N(this,xo)!==t&&(ee(this,xo,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return N(this,xo)}},xo=new WeakMap,xs=new WeakMap,wo=new WeakMap,h5),_c=new zw;function Rw(e){return Math.min(1e3*2**e,3e4)}function Mh(e){return(e??"online")==="online"?_c.isOnline():!0}var wd=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Nh(e){let t=!1,r=0,n;const s=xd(),a=()=>s.status!=="pending",o=g=>{var E;if(!a()){const v=new wd(g);f(v),(E=e.onCancel)==null||E.call(e,v)}},i=()=>{t=!0},c=()=>{t=!1},l=()=>gd.isFocused()&&(e.networkMode==="always"||_c.isOnline())&&e.canRun(),u=()=>Mh(e.networkMode)&&e.canRun(),d=g=>{a()||(n==null||n(),s.resolve(g))},f=g=>{a()||(n==null||n(),s.reject(g))},m=()=>new Promise(g=>{var E;n=v=>{(a()||l())&&g(v)},(E=e.onPause)==null||E.call(e)}).then(()=>{var g;n=void 0,a()||(g=e.onContinue)==null||g.call(e)}),y=()=>{if(a())return;let g;const E=r===0?e.initialPromise:void 0;try{g=E??e.fn()}catch(v){g=Promise.reject(v)}Promise.resolve(g).then(d).catch(v=>{var L;if(a())return;const w=e.retry??(Us?0:3),A=e.retryDelay??Rw,C=typeof A=="function"?A(r,v):A,D=w===!0||typeof w=="number"&&r<w||typeof w=="function"&&w(r,v);if(t||!D){f(v);return}r++,(L=e.onFail)==null||L.call(e,r,v),Ow(C).then(()=>l()?void 0:m()).then(()=>{t?f(v):y()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(n==null||n(),s),cancelRetry:i,continueRetry:c,canStart:u,start:()=>(u()?y():m().then(y),s)}}var Lh=(b5=class{constructor(){le(this,ma)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),fd(this.gcTime)&&ee(this,ma,Fs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Us?1/0:300*1e3))}clearGcTimeout(){N(this,ma)&&(Fs.clearTimeout(N(this,ma)),ee(this,ma,void 0))}},ma=new WeakMap,b5),Hw=(y5=class extends Lh{constructor(t){super();le(this,Yr);le(this,ha);le(this,vo);le(this,Br);le(this,ba);le(this,Bt);le(this,wc);le(this,ya);ee(this,ya,!1),ee(this,wc,t.defaultOptions),this.setOptions(t.options),this.observers=[],ee(this,ba,t.client),ee(this,Br,N(this,ba).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ee(this,ha,Hh(this.options)),this.state=t.state??N(this,ha),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=N(this,Bt))==null?void 0:t.promise}setOptions(t){if(this.options={...N(this,wc),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=Hh(this.options);r.data!==void 0&&(this.setState(Rh(r.data,r.dataUpdatedAt)),ee(this,ha,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&N(this,Br).remove(this)}setData(t,r){const n=yd(this.state.data,t,this.options);return Ae(this,Yr,Yn).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){Ae(this,Yr,Yn).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,s;const r=(n=N(this,Bt))==null?void 0:n.promise;return(s=N(this,Bt))==null||s.cancel(t),r?r.then(jt).catch(jt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(N(this,ha))}isActive(){return this.observers.some(t=>Er(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Dc||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Xn(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Ih(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=N(this,Bt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=N(this,Bt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),N(this,Br).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(N(this,Bt)&&(N(this,ya)?N(this,Bt).cancel({revert:!0}):N(this,Bt).cancelRetry()),this.scheduleGc()),N(this,Br).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ae(this,Yr,Yn).call(this,{type:"invalidate"})}async fetch(t,r){var c,l,u,d,f,m,y,g,E,v,w,A;if(this.state.fetchStatus!=="idle"&&((c=N(this,Bt))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(N(this,Bt))return N(this,Bt).continueRetry(),N(this,Bt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const C=this.observers.find(D=>D.options.queryFn);C&&this.setOptions(C.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,s=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(ee(this,ya,!0),n.signal)})},a=()=>{const C=Dh(this.options,r),L=(()=>{const T={client:N(this,ba),queryKey:this.queryKey,meta:this.meta};return s(T),T})();return ee(this,ya,!1),this.options.persister?this.options.persister(C,L,this):C(L)},i=(()=>{const C={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:N(this,ba),state:this.state,fetchFn:a};return s(C),C})();(l=this.options.behavior)==null||l.onFetch(i,this),ee(this,vo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=i.fetchOptions)==null?void 0:u.meta))&&Ae(this,Yr,Yn).call(this,{type:"fetch",meta:(d=i.fetchOptions)==null?void 0:d.meta}),ee(this,Bt,Nh({initialPromise:r==null?void 0:r.initialPromise,fn:i.fetchFn,onCancel:C=>{C instanceof wd&&C.revert&&this.setState({...N(this,vo),fetchStatus:"idle"}),n.abort()},onFail:(C,D)=>{Ae(this,Yr,Yn).call(this,{type:"failed",failureCount:C,error:D})},onPause:()=>{Ae(this,Yr,Yn).call(this,{type:"pause"})},onContinue:()=>{Ae(this,Yr,Yn).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}));try{const C=await N(this,Bt).start();if(C===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(C),(m=(f=N(this,Br).config).onSuccess)==null||m.call(f,C,this),(g=(y=N(this,Br).config).onSettled)==null||g.call(y,C,this.state.error,this),C}catch(C){if(C instanceof wd){if(C.silent)return N(this,Bt).promise;if(C.revert){if(this.state.data===void 0)throw C;return this.state.data}}throw Ae(this,Yr,Yn).call(this,{type:"error",error:C}),(v=(E=N(this,Br).config).onError)==null||v.call(E,C,this),(A=(w=N(this,Br).config).onSettled)==null||A.call(w,this.state.data,C,this),C}finally{this.scheduleGc()}}},ha=new WeakMap,vo=new WeakMap,Br=new WeakMap,ba=new WeakMap,Bt=new WeakMap,wc=new WeakMap,ya=new WeakMap,Yr=new WeakSet,Yn=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...zh(n.data,this.options),fetchMeta:t.meta??null};case"success":const s={...n,...Rh(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ee(this,vo,t.manual?s:void 0),s;case"error":const a=t.error;return{...n,error:a,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),kt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),N(this,Br).notify({query:this,type:"updated",action:t})})},y5);function zh(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Mh(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Rh(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Hh(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var $w=(g5=class extends Ta{constructor(t,r){super();le(this,Ve);le(this,sr);le(this,De);le(this,vc);le(this,qt);le(this,ga);le(this,Eo);le(this,Gn);le(this,ws);le(this,Ec);le(this,ko);le(this,Co);le(this,xa);le(this,wa);le(this,vs);le(this,To,new Set);this.options=r,ee(this,sr,t),ee(this,ws,null),ee(this,Gn,xd()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(N(this,De).addObserver(this),$h(N(this,De),this.options)?Ae(this,Ve,Tc).call(this):this.updateResult(),Ae(this,Ve,Tm).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return vd(N(this,De),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return vd(N(this,De),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ae(this,Ve,Sm).call(this),Ae(this,Ve,Am).call(this),N(this,De).removeObserver(this)}setOptions(t){const r=this.options,n=N(this,De);if(this.options=N(this,sr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Er(this.options.enabled,N(this,De))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ae(this,Ve,Pm).call(this),N(this,De).setOptions(this.options),r._defaulted&&!Oc(this.options,r)&&N(this,sr).getQueryCache().notify({type:"observerOptionsUpdated",query:N(this,De),observer:this});const s=this.hasListeners();s&&Gh(N(this,De),n,this.options,r)&&Ae(this,Ve,Tc).call(this),this.updateResult(),s&&(N(this,De)!==n||Er(this.options.enabled,N(this,De))!==Er(r.enabled,N(this,De))||Xn(this.options.staleTime,N(this,De))!==Xn(r.staleTime,N(this,De)))&&Ae(this,Ve,Em).call(this);const a=Ae(this,Ve,km).call(this);s&&(N(this,De)!==n||Er(this.options.enabled,N(this,De))!==Er(r.enabled,N(this,De))||a!==N(this,vs))&&Ae(this,Ve,Cm).call(this,a)}getOptimisticResult(t){const r=N(this,sr).getQueryCache().build(N(this,sr),t),n=this.createResult(r,t);return jw(this,n)&&(ee(this,qt,n),ee(this,Eo,this.options),ee(this,ga,N(this,De).state)),n}getCurrentResult(){return N(this,qt)}trackResult(t,r){return new Proxy(t,{get:(n,s)=>(this.trackProp(s),r==null||r(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&N(this,Gn).status==="pending"&&N(this,Gn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(t){N(this,To).add(t)}getCurrentQuery(){return N(this,De)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=N(this,sr).defaultQueryOptions(t),n=N(this,sr).getQueryCache().build(N(this,sr),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Ae(this,Ve,Tc).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),N(this,qt)))}createResult(t,r){var b;const n=N(this,De),s=this.options,a=N(this,qt),o=N(this,ga),i=N(this,Eo),l=t!==n?t.state:N(this,vc),{state:u}=t;let d={...u},f=!1,m;if(r._optimisticResults){const x=this.hasListeners(),S=!x&&$h(t,r),I=x&&Gh(t,n,r,s);(S||I)&&(d={...d,...zh(u.data,t.options)}),r._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:y,errorUpdatedAt:g,status:E}=d;m=d.data;let v=!1;if(r.placeholderData!==void 0&&m===void 0&&E==="pending"){let x;a!=null&&a.isPlaceholderData&&r.placeholderData===(i==null?void 0:i.placeholderData)?(x=a.data,v=!0):x=typeof r.placeholderData=="function"?r.placeholderData((b=N(this,Co))==null?void 0:b.state.data,N(this,Co)):r.placeholderData,x!==void 0&&(E="success",m=yd(a==null?void 0:a.data,x,r),f=!0)}if(r.select&&m!==void 0&&!v)if(a&&m===(o==null?void 0:o.data)&&r.select===N(this,Ec))m=N(this,ko);else try{ee(this,Ec,r.select),m=r.select(m),m=yd(a==null?void 0:a.data,m,r),ee(this,ko,m),ee(this,ws,null)}catch(x){ee(this,ws,x)}N(this,ws)&&(y=N(this,ws),m=N(this,ko),g=Date.now(),E="error");const w=d.fetchStatus==="fetching",A=E==="pending",C=E==="error",D=A&&w,L=m!==void 0,h={status:E,fetchStatus:d.fetchStatus,isPending:A,isSuccess:E==="success",isError:C,isInitialLoading:D,isLoading:D,data:m,dataUpdatedAt:d.dataUpdatedAt,error:y,errorUpdatedAt:g,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:w,isRefetching:w&&!A,isLoadingError:C&&!L,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:C&&L,isStale:Ed(t,r),refetch:this.refetch,promise:N(this,Gn),isEnabled:Er(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const x=F=>{h.status==="error"?F.reject(h.error):h.data!==void 0&&F.resolve(h.data)},S=()=>{const F=ee(this,Gn,h.promise=xd());x(F)},I=N(this,Gn);switch(I.status){case"pending":t.queryHash===n.queryHash&&x(I);break;case"fulfilled":(h.status==="error"||h.data!==I.value)&&S();break;case"rejected":(h.status!=="error"||h.error!==I.reason)&&S();break}}return h}updateResult(){const t=N(this,qt),r=this.createResult(N(this,De),this.options);if(ee(this,ga,N(this,De).state),ee(this,Eo,this.options),N(this,ga).data!==void 0&&ee(this,Co,N(this,De)),Oc(r,t))return;ee(this,qt,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!N(this,To).size)return!0;const o=new Set(a??N(this,To));return this.options.throwOnError&&o.add("error"),Object.keys(N(this,qt)).some(i=>{const c=i;return N(this,qt)[c]!==t[c]&&o.has(c)})};Ae(this,Ve,F5).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ae(this,Ve,Tm).call(this)}},sr=new WeakMap,De=new WeakMap,vc=new WeakMap,qt=new WeakMap,ga=new WeakMap,Eo=new WeakMap,Gn=new WeakMap,ws=new WeakMap,Ec=new WeakMap,ko=new WeakMap,Co=new WeakMap,xa=new WeakMap,wa=new WeakMap,vs=new WeakMap,To=new WeakMap,Ve=new WeakSet,Tc=function(t){Ae(this,Ve,Pm).call(this);let r=N(this,De).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(jt)),r},Em=function(){Ae(this,Ve,Sm).call(this);const t=Xn(this.options.staleTime,N(this,De));if(Us||N(this,qt).isStale||!fd(t))return;const n=Ih(N(this,qt).dataUpdatedAt,t)+1;ee(this,xa,Fs.setTimeout(()=>{N(this,qt).isStale||this.updateResult()},n))},km=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(N(this,De)):this.options.refetchInterval)??!1},Cm=function(t){Ae(this,Ve,Am).call(this),ee(this,vs,t),!(Us||Er(this.options.enabled,N(this,De))===!1||!fd(N(this,vs))||N(this,vs)===0)&&ee(this,wa,Fs.setInterval(()=>{(this.options.refetchIntervalInBackground||gd.isFocused())&&Ae(this,Ve,Tc).call(this)},N(this,vs)))},Tm=function(){Ae(this,Ve,Em).call(this),Ae(this,Ve,Cm).call(this,Ae(this,Ve,km).call(this))},Sm=function(){N(this,xa)&&(Fs.clearTimeout(N(this,xa)),ee(this,xa,void 0))},Am=function(){N(this,wa)&&(Fs.clearInterval(N(this,wa)),ee(this,wa,void 0))},Pm=function(){const t=N(this,sr).getQueryCache().build(N(this,sr),this.options);if(t===N(this,De))return;const r=N(this,De);ee(this,De,t),ee(this,vc,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},F5=function(t){kt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(N(this,qt))}),N(this,sr).getQueryCache().notify({query:N(this,De),type:"observerResultsUpdated"})})},g5);function Gw(e,t){return Er(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function $h(e,t){return Gw(e,t)||e.state.data!==void 0&&vd(e,t,t.refetchOnMount)}function vd(e,t,r){if(Er(t.enabled,e)!==!1&&Xn(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Ed(e,t)}return!1}function Gh(e,t,r,n){return(e!==t||Er(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Ed(e,r)}function Ed(e,t){return Er(t.enabled,e)!==!1&&e.isStaleByTime(Xn(t.staleTime,e))}function jw(e,t){return!Oc(e.getCurrentResult(),t)}function jh(e){return{onFetch:(t,r)=>{var u,d,f,m,y;const n=t.options,s=(f=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,a=((m=t.state.data)==null?void 0:m.pages)||[],o=((y=t.state.data)==null?void 0:y.pageParams)||[];let i={pages:[],pageParams:[]},c=0;const l=async()=>{let g=!1;const E=A=>{Object.defineProperty(A,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},v=Dh(t.options,t.fetchOptions),w=async(A,C,D)=>{if(g)return Promise.reject();if(C==null&&A.pages.length)return Promise.resolve(A);const T=(()=>{const S={client:t.client,queryKey:t.queryKey,pageParam:C,direction:D?"backward":"forward",meta:t.options.meta};return E(S),S})(),h=await v(T),{maxPages:b}=t.options,x=D?_w:Dw;return{pages:x(A.pages,h,b),pageParams:x(A.pageParams,C,b)}};if(s&&a.length){const A=s==="backward",C=A?Vw:Vh,D={pages:a,pageParams:o},L=C(n,D);i=await w(D,L,A)}else{const A=e??a.length;do{const C=c===0?o[0]??n.initialPageParam:Vh(n,i);if(c>0&&C==null)break;i=await w(i,C),c++}while(c<A)}return i};t.options.persister?t.fetchFn=()=>{var g,E;return(E=(g=t.options).persister)==null?void 0:E.call(g,l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=l}}}function Vh(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function Vw(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var Ww=(x5=class extends Lh{constructor(t){super();le(this,fn);le(this,kc);le(this,pn);le(this,Yt);le(this,va);ee(this,kc,t.client),this.mutationId=t.mutationId,ee(this,Yt,t.mutationCache),ee(this,pn,[]),this.state=t.state||Wh(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){N(this,pn).includes(t)||(N(this,pn).push(t),this.clearGcTimeout(),N(this,Yt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ee(this,pn,N(this,pn).filter(r=>r!==t)),this.scheduleGc(),N(this,Yt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){N(this,pn).length||(this.state.status==="pending"?this.scheduleGc():N(this,Yt).remove(this))}continue(){var t;return((t=N(this,va))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,c,l,u,d,f,m,y,g,E,v,w,A,C,D,L,T,h,b;const r=()=>{Ae(this,fn,Ss).call(this,{type:"continue"})},n={client:N(this,kc),meta:this.options.meta,mutationKey:this.options.mutationKey};ee(this,va,Nh({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(x,S)=>{Ae(this,fn,Ss).call(this,{type:"failed",failureCount:x,error:S})},onPause:()=>{Ae(this,fn,Ss).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>N(this,Yt).canRun(this)}));const s=this.state.status==="pending",a=!N(this,va).canStart();try{if(s)r();else{Ae(this,fn,Ss).call(this,{type:"pending",variables:t,isPaused:a}),await((i=(o=N(this,Yt).config).onMutate)==null?void 0:i.call(o,t,this,n));const S=await((l=(c=this.options).onMutate)==null?void 0:l.call(c,t,n));S!==this.state.context&&Ae(this,fn,Ss).call(this,{type:"pending",context:S,variables:t,isPaused:a})}const x=await N(this,va).start();return await((d=(u=N(this,Yt).config).onSuccess)==null?void 0:d.call(u,x,t,this.state.context,this,n)),await((m=(f=this.options).onSuccess)==null?void 0:m.call(f,x,t,this.state.context,n)),await((g=(y=N(this,Yt).config).onSettled)==null?void 0:g.call(y,x,null,this.state.variables,this.state.context,this,n)),await((v=(E=this.options).onSettled)==null?void 0:v.call(E,x,null,t,this.state.context,n)),Ae(this,fn,Ss).call(this,{type:"success",data:x}),x}catch(x){try{throw await((A=(w=N(this,Yt).config).onError)==null?void 0:A.call(w,x,t,this.state.context,this,n)),await((D=(C=this.options).onError)==null?void 0:D.call(C,x,t,this.state.context,n)),await((T=(L=N(this,Yt).config).onSettled)==null?void 0:T.call(L,void 0,x,this.state.variables,this.state.context,this,n)),await((b=(h=this.options).onSettled)==null?void 0:b.call(h,void 0,x,t,this.state.context,n)),x}finally{Ae(this,fn,Ss).call(this,{type:"error",error:x})}}finally{N(this,Yt).runNext(this)}}},kc=new WeakMap,pn=new WeakMap,Yt=new WeakMap,va=new WeakMap,fn=new WeakSet,Ss=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),kt.batch(()=>{N(this,pn).forEach(n=>{n.onMutationUpdate(t)}),N(this,Yt).notify({mutation:this,type:"updated",action:t})})},x5);function Wh(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var qw=(w5=class extends Ta{constructor(t={}){super();le(this,jn);le(this,Kr);le(this,Cc);this.config=t,ee(this,jn,new Set),ee(this,Kr,new Map),ee(this,Cc,0)}build(t,r,n){const s=new Ww({client:t,mutationCache:this,mutationId:++Ku(this,Cc)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){N(this,jn).add(t);const r=Mc(t);if(typeof r=="string"){const n=N(this,Kr).get(r);n?n.push(t):N(this,Kr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(N(this,jn).delete(t)){const r=Mc(t);if(typeof r=="string"){const n=N(this,Kr).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&N(this,Kr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Mc(t);if(typeof r=="string"){const n=N(this,Kr).get(r),s=n==null?void 0:n.find(a=>a.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=Mc(t);if(typeof r=="string"){const s=(n=N(this,Kr).get(r))==null?void 0:n.find(a=>a!==t&&a.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){kt.batch(()=>{N(this,jn).forEach(t=>{this.notify({type:"removed",mutation:t})}),N(this,jn).clear(),N(this,Kr).clear()})}getAll(){return Array.from(N(this,jn))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Fh(r,n))}findAll(t={}){return this.getAll().filter(r=>Fh(t,r))}notify(t){kt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return kt.batch(()=>Promise.all(t.map(r=>r.continue().catch(jt))))}},jn=new WeakMap,Kr=new WeakMap,Cc=new WeakMap,w5);function Mc(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Yw=(v5=class extends Ta{constructor(t,r){super();le(this,qn);le(this,Vn);le(this,Es);le(this,ar);le(this,Wn);ee(this,Vn,t),this.setOptions(r),this.bindMethods(),Ae(this,qn,Zu).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var n;const r=this.options;this.options=N(this,Vn).defaultMutationOptions(t),Oc(this.options,r)||N(this,Vn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:N(this,ar),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Os(r.mutationKey)!==Os(this.options.mutationKey)?this.reset():((n=N(this,ar))==null?void 0:n.state.status)==="pending"&&N(this,ar).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=N(this,ar))==null||t.removeObserver(this)}onMutationUpdate(t){Ae(this,qn,Zu).call(this),Ae(this,qn,Im).call(this,t)}getCurrentResult(){return N(this,Es)}reset(){var t;(t=N(this,ar))==null||t.removeObserver(this),ee(this,ar,void 0),Ae(this,qn,Zu).call(this),Ae(this,qn,Im).call(this)}mutate(t,r){var n;return ee(this,Wn,r),(n=N(this,ar))==null||n.removeObserver(this),ee(this,ar,N(this,Vn).getMutationCache().build(N(this,Vn),this.options)),N(this,ar).addObserver(this),N(this,ar).execute(t)}},Vn=new WeakMap,Es=new WeakMap,ar=new WeakMap,Wn=new WeakMap,qn=new WeakSet,Zu=function(){var r;const t=((r=N(this,ar))==null?void 0:r.state)??Wh();ee(this,Es,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},Im=function(t){kt.batch(()=>{var r,n,s,a,o,i,c,l;if(N(this,Wn)&&this.hasListeners()){const u=N(this,Es).variables,d=N(this,Es).context,f={client:N(this,Vn),meta:this.options.meta,mutationKey:this.options.mutationKey};(t==null?void 0:t.type)==="success"?((n=(r=N(this,Wn)).onSuccess)==null||n.call(r,t.data,u,d,f),(a=(s=N(this,Wn)).onSettled)==null||a.call(s,t.data,null,u,d,f)):(t==null?void 0:t.type)==="error"&&((i=(o=N(this,Wn)).onError)==null||i.call(o,t.error,u,d,f),(l=(c=N(this,Wn)).onSettled)==null||l.call(c,void 0,t.error,u,d,f))}this.listeners.forEach(u=>{u(N(this,Es))})})},v5),Kw=(E5=class extends Ta{constructor(t={}){super();le(this,mn);this.config=t,ee(this,mn,new Map)}build(t,r,n){const s=r.queryKey,a=r.queryHash??md(s,r);let o=this.get(a);return o||(o=new Hw({client:t,queryKey:s,queryHash:a,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){N(this,mn).has(t.queryHash)||(N(this,mn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=N(this,mn).get(t.queryHash);r&&(t.destroy(),r===t&&N(this,mn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){kt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return N(this,mn).get(t)}getAll(){return[...N(this,mn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Bh(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Bh(t,n)):r}notify(t){kt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){kt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){kt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},mn=new WeakMap,E5),Zw=(k5=class{constructor(e={}){le(this,ft);le(this,ks);le(this,Cs);le(this,So);le(this,Ao);le(this,Ts);le(this,Po);le(this,Io);ee(this,ft,e.queryCache||new Kw),ee(this,ks,e.mutationCache||new qw),ee(this,Cs,e.defaultOptions||{}),ee(this,So,new Map),ee(this,Ao,new Map),ee(this,Ts,0)}mount(){Ku(this,Ts)._++,N(this,Ts)===1&&(ee(this,Po,gd.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,ft).onFocus())})),ee(this,Io,_c.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,ft).onOnline())})))}unmount(){var e,t;Ku(this,Ts)._--,N(this,Ts)===0&&((e=N(this,Po))==null||e.call(this),ee(this,Po,void 0),(t=N(this,Io))==null||t.call(this),ee(this,Io,void 0))}isFetching(e){return N(this,ft).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return N(this,ks).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=N(this,ft).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=N(this,ft).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Xn(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return N(this,ft).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=N(this,ft).get(n.queryHash),a=s==null?void 0:s.state.data,o=Fw(t,a);if(o!==void 0)return N(this,ft).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return kt.batch(()=>N(this,ft).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=N(this,ft).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=N(this,ft);kt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=N(this,ft);return kt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=kt.batch(()=>N(this,ft).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(jt).catch(jt)}invalidateQueries(e,t={}){return kt.batch(()=>(N(this,ft).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=kt.batch(()=>N(this,ft).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let a=s.fetch(void 0,r);return r.throwOnError||(a=a.catch(jt)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(jt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=N(this,ft).build(this,t);return r.isStaleByTime(Xn(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(jt).catch(jt)}fetchInfiniteQuery(e){return e.behavior=jh(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(jt).catch(jt)}ensureInfiniteQueryData(e){return e.behavior=jh(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return _c.isOnline()?N(this,ks).resumePausedMutations():Promise.resolve()}getQueryCache(){return N(this,ft)}getMutationCache(){return N(this,ks)}getDefaultOptions(){return N(this,Cs)}setDefaultOptions(e){ee(this,Cs,e)}setQueryDefaults(e,t){N(this,So).set(Os(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...N(this,So).values()],r={};return t.forEach(n=>{Uo(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){N(this,Ao).set(Os(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...N(this,Ao).values()],r={};return t.forEach(n=>{Uo(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...N(this,Cs).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=md(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Dc&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...N(this,Cs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){N(this,ft).clear(),N(this,ks).clear()}},ft=new WeakMap,ks=new WeakMap,Cs=new WeakMap,So=new WeakMap,Ao=new WeakMap,Ts=new WeakMap,Po=new WeakMap,Io=new WeakMap,k5),qh=xt.createContext(void 0),Nc=e=>{const t=xt.useContext(qh);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Xw=({client:e,children:t})=>(xt.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),B.jsx(qh.Provider,{value:e,children:t})),Yh=xt.createContext(!1),Qw=()=>xt.useContext(Yh);Yh.Provider;function Jw(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var e3=xt.createContext(Jw()),t3=()=>xt.useContext(e3),r3=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},n3=e=>{xt.useEffect(()=>{e.clearReset()},[e])},s3=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||_h(r,[e.error,n])),a3=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},o3=(e,t)=>e.isLoading&&e.isFetching&&!t,i3=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Kh=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function c3(e,t,r){var d,f,m,y,g;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=Qw(),s=t3(),a=Nc(),o=a.defaultQueryOptions(e);(f=(d=a.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||f.call(d,o),process.env.NODE_ENV!=="production"&&(o.queryFn||console.error(`[${o.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),o._optimisticResults=n?"isRestoring":"optimistic",a3(o),r3(o,s),n3(s);const i=!a.getQueryCache().get(o.queryHash),[c]=xt.useState(()=>new t(a,o)),l=c.getOptimisticResult(o),u=!n&&e.subscribed!==!1;if(xt.useSyncExternalStore(xt.useCallback(E=>{const v=u?c.subscribe(kt.batchCalls(E)):jt;return c.updateResult(),v},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),xt.useEffect(()=>{c.setOptions(o)},[o,c]),i3(o,l))throw Kh(o,c,s);if(s3({result:l,errorResetBoundary:s,throwOnError:o.throwOnError,query:a.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw l.error;if((y=(m=a.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||y.call(m,o,l),o.experimental_prefetchInRender&&!Us&&o3(l,n)){const E=i?Kh(o,c,s):(g=a.getQueryCache().get(o.queryHash))==null?void 0:g.promise;E==null||E.catch(jt).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?l:c.trackResult(l)}function l3(e,t){return c3(e,$w)}function gn(e,t){const r=Nc(),[n]=xt.useState(()=>new Yw(r,e));xt.useEffect(()=>{n.setOptions(e)},[n,e]);const s=xt.useSyncExternalStore(xt.useCallback(o=>n.subscribe(kt.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),a=xt.useCallback((o,i)=>{n.mutate(o,i).catch(jt)},[n]);if(s.error&&_h(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}const u3=M.createContext(null),kd={didCatch:!1,error:null};class d3 extends M.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=kd}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var r,n,s=arguments.length,a=new Array(s),o=0;o<s;o++)a[o]=arguments[o];(r=(n=this.props).onReset)===null||r===void 0||r.call(n,{args:a,reason:"imperative-api"}),this.setState(kd)}}componentDidCatch(t,r){var n,s;(n=(s=this.props).onError)===null||n===void 0||n.call(s,t,r)}componentDidUpdate(t,r){const{didCatch:n}=this.state,{resetKeys:s}=this.props;if(n&&r.error!==null&&p3(t.resetKeys,s)){var a,o;(a=(o=this.props).onReset)===null||a===void 0||a.call(o,{next:s,prev:t.resetKeys,reason:"keys"}),this.setState(kd)}}render(){const{children:t,fallbackRender:r,FallbackComponent:n,fallback:s}=this.props,{didCatch:a,error:o}=this.state;let i=t;if(a){const c={error:o,resetErrorBoundary:this.resetErrorBoundary};if(typeof r=="function")i=r(c);else if(n)i=M.createElement(n,c);else if(s!==void 0)i=s;else throw o}return M.createElement(u3.Provider,{value:{didCatch:a,error:o,resetErrorBoundary:this.resetErrorBoundary}},i)}}function p3(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((r,n)=>!Object.is(r,t[n]))}const Zh=e=>{let t;const r=new Set,n=(l,u)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const f=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),r.forEach(m=>m(t,f))}},s=()=>t,i={setState:n,getState:s,getInitialState:()=>c,subscribe:l=>(r.add(l),()=>r.delete(l))},c=t=e(n,s,i);return i},f3=(e=>e?Zh(e):Zh),m3=e=>e;function h3(e,t=m3){const r=M.useSyncExternalStore(e.subscribe,M.useCallback(()=>t(e.getState()),[e,t]),M.useCallback(()=>t(e.getInitialState()),[e,t]));return M.useDebugValue(r),r}const Xh=e=>{const t=f3(e),r=n=>h3(t,n);return Object.assign(r,t),r},b3=(e=>e?Xh(e):Xh),Qh={disclaimerAccepted:!0,currentTime:Date.now(),swapExecution:{}},Z=b3((e,t)=>({state:Qh,updateState:r=>e(n=>({state:{...n.state,...r}})),updateSwapExecution:r=>e(n=>({state:{...n.state,swapExecution:{...n.state.swapExecution,...r}}})),resetState:()=>{e({state:{...Qh,currentTime:Date.now(),swapExecution:t().state.swapExecution,isMarketOrder:t().state.isMarketOrder}})}}));(function(){try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".orbs_OrbsLogo{object-fit:contain;display:inline}.orbs_PoweredBy{border-radius:8px;margin-left:auto;margin-right:auto}.orbs_PoweredBy a{display:flex;align-items:center;justify-content:center;text-decoration:none;color:inherit}.orbs_PoweredBy span{font-size:14px}.orbs_PoweredBy .orbs_OrbsLogo{margin-left:6px;margin-right:6px;width:18px;height:18px}.orbs_Text{margin:0;padding:0}.orbs_Spinner{width:var(--size, 38px);height:var(--size, 38px);border:var(--border-width, 3px) solid var(--border-color, white);border-bottom-color:var(--bottom-border-color, rgba(255, 255, 255, .2));border-radius:50%;display:inline-block;box-sizing:border-box;animation:orbs_rotation 1s linear infinite}@keyframes orbs_rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.orbs_TradeStepLayout{--layout-min-height: 220px;--layout-width: 100%;--layout-display: flex;--layout-direction: column;--layout-align: center;--layout-overflow: visible;display:var(--layout-display);flex-direction:var(--layout-direction);align-items:var(--layout-align);width:var(--layout-width);min-height:var(--layout-min-height);overflow:var(--layout-overflow)}.orbs_TradeStepLayoutBody{--body-gap: 20px;--body-margin-top: 30px;--body-width: 100%;--body-display: flex;--body-direction: column;--body-align: center;--body-overflow: visible;gap:var(--body-gap);align-items:var(--body-align);display:var(--body-display);flex-direction:var(--body-direction);width:var(--body-width);margin-top:var(--body-margin-top);overflow:var(--body-overflow)}.orbs_TradeStepLayoutHeader{--header-gap: 30px;--header-display: flex;--header-direction: column;--header-align: center;--header-justify: center;--header-overflow: visible;display:var(--header-display);flex-direction:var(--header-direction);align-items:var(--header-align);justify-content:var(--header-justify);gap:var(--header-gap);overflow:var(--header-overflow)}.orbs_TradeStepLayoutTitle{--title-font-size: 18px;--title-font-weight: 500;--title-line-height: normal;--title-color: inherit;--title-text-align: center;--title-margin: 0;--title-padding: 0;font-size:var(--title-font-size);font-weight:var(--title-font-weight);line-height:var(--title-line-height);color:var(--title-color);text-align:var(--title-text-align);margin:var(--title-margin);padding:var(--title-padding)}.orbs_StepIndicator{--indicator-display: flex;--indicator-align: center;--indicator-justify: flex-start;--indicator-height: 7px;--indicator-width: 120px;--indicator-border-radius: 999px;--indicator-bg-color: white;--indicator-margin-bottom: 20px;--indicator-position: relative;--indicator-overflow: hidden;--indicator-border: none;--indicator-box-shadow: none;display:var(--indicator-display);align-items:var(--indicator-align);justify-content:var(--indicator-justify);height:var(--indicator-height);width:var(--indicator-width);border-radius:var(--indicator-border-radius);overflow:var(--indicator-overflow);background-color:var(--indicator-bg-color);margin-bottom:var(--indicator-margin-bottom);position:var(--indicator-position);border:var(--indicator-border);box-shadow:var(--indicator-box-shadow)}.orbs_StepIndicatorLine{--line-height: 100%;--line-bg-color: black;--line-position: absolute;--line-top: 0;--line-left: 0;--line-right: 0;--line-bottom: 0;--line-transition: all .3s ease;--line-border-radius: inherit;--line-box-shadow: none;height:var(--line-height);background-color:var(--line-bg-color);position:var(--line-position);top:var(--line-top);left:var(--line-left);right:var(--line-right);bottom:var(--line-bottom);transition:var(--line-transition);border-radius:var(--line-border-radius);box-shadow:var(--line-box-shadow)}.orbs_TradeStepLayoutFooter{--footer-display: flex;--footer-align: center;--footer-justify: center;--footer-direction: column;--footer-margin-top: auto;--footer-padding-top: 30px;--footer-width: 100%;--footer-overflow: visible;--footer-border-top: none;display:var(--footer-display);align-items:var(--footer-align);justify-content:var(--footer-justify);flex-direction:var(--footer-direction);margin-top:var(--footer-margin-top);padding-top:var(--footer-padding-top);width:var(--footer-width);overflow:var(--footer-overflow);border-top:var(--footer-border-top)}.orbs_TradeStepLayoutFooter p{--footer-text-font-size: 15px;--footer-text-line-height: normal;--footer-text-color: inherit;--footer-text-margin: 0;--footer-text-padding: 0;font-size:var(--footer-text-font-size);line-height:var(--footer-text-line-height);color:var(--footer-text-color);margin:var(--footer-text-margin);padding:var(--footer-text-padding)}.orbs_TradeStepLayoutFooterLink{--link-color: inherit;--link-text-decoration: none;--link-font-size: 15px;--link-text-align: center;--link-margin: auto;--link-outline: none;--link-line-height: normal;--link-padding: 0;--link-transition: color .2s ease;--link-hover-color: inherit;--link-hover-text-decoration: underline;color:var(--link-color);text-decoration:var(--link-text-decoration);font-size:var(--link-font-size);text-align:var(--link-text-align);margin-left:var(--link-margin);margin-right:var(--link-margin);outline:var(--link-outline);line-height:var(--link-line-height);padding:var(--link-padding);transition:var(--link-transition)}.orbs_TradeStepLayoutFooterLink:hover{color:var(--link-hover-color);text-decoration:var(--link-hover-text-decoration)}.orbs_TradeStepLayoutSuccessIcon{--success-icon-display: flex;--success-icon-justify: center;--success-icon-align: center;--success-icon-width: 60px;--success-icon-height: 60px;--success-icon-border-radius: 50%;--success-icon-overflow: visible;--success-icon-bg-color: transparent;--success-icon-border: none;--success-icon-box-shadow: none;display:var(--success-icon-display);justify-content:var(--success-icon-justify);align-items:var(--success-icon-align);width:var(--success-icon-width);height:var(--success-icon-height);border-radius:var(--success-icon-border-radius);overflow:var(--success-icon-overflow);background-color:var(--success-icon-bg-color);border:var(--success-icon-border);box-shadow:var(--success-icon-box-shadow)}.orbs_TradeStepLayoutErrorIcon{--error-icon-width: 80px;--error-icon-height: 80px;--error-icon-display: flex;--error-icon-justify: center;--error-icon-align: center;--error-icon-overflow: visible;--error-icon-bg-color: transparent;--error-icon-border: none;--error-icon-box-shadow: none;width:var(--error-icon-width);height:var(--error-icon-height);display:var(--error-icon-display);justify-content:var(--error-icon-justify);align-items:var(--error-icon-align);overflow:var(--error-icon-overflow);background-color:var(--error-icon-bg-color);border:var(--error-icon-border);box-shadow:var(--error-icon-box-shadow)}.orbs_FailedContentMsg{font-size:22px;font-weight:500}.orbs_TradePreview{display:flex;align-items:center;justify-content:center;gap:8px;width:100%}.orbs_TradePreviewToken{display:flex;align-items:center;gap:6px;max-width:calc(50% - 30px)}.orbs_TradePreviewToken p{--token-font-size: 15px;--token-white-space: nowrap;--token-overflow: hidden;--token-text-overflow: ellipsis;--token-flex: 1;--token-margin: 0;--token-padding: 0;font-size:var(--token-font-size);white-space:var(--token-white-space);overflow:var(--token-overflow);text-overflow:var(--token-text-overflow);flex:var(--token-flex);margin:var(--token-margin)}.orbs_TradepPreviewIcon{width:22px;height:22px}.orbs_TradepPreviewLogo{width:24px;height:24px;border-radius:50%;overflow:hidden}.orbs_FlexRow{display:flex;flex-direction:row}.orbs_FlexColumn{display:flex;flex-direction:column}@keyframes orbs_skeletonAnimation{0%{opacity:.2}to{opacity:.4}}.orbs_SkeletonLoader{animation:orbs_skeletonAnimation 1s linear infinite alternate;background-color:#fff}.orbs_Main-wrapper{width:100%}.orbs_Main{width:100%;display:flex;flex-direction:column;gap:28px}.orbs_MainToken{display:flex;flex-direction:row;align-items:center;justify-content:space-between;width:100%;gap:8px}.orbs_MainTokenLeft{display:flex;flex-direction:column;align-items:flex-start;gap:8px}.orbs_MainTokenUsd{display:flex;align-items:center;gap:5px}.orbs_MainTokenUsd small{font-size:12px;opacity:.6}.orbs_MainContentLoader{width:100%;display:flex;gap:15px;align-items:center;margin-top:20px}.orbs_MainContentRectengularLoader{flex:1;height:20px;max-width:250px;border-radius:20px}.orbs_MainContentCircleLoader{width:30px;height:30px;border-radius:50%}.orbs_MainTokenLogo{--width: 40px;--height: 40px;width:var(--width);height:var(--height)}.orbs_MainTokenLogo img{width:100%;height:100%;object-fit:cover}.orbs_SwapFlow{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%}.orbs_SwapFlow *{box-sizing:border-box}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();const Ne=e=>`orbs_${e}`;function Oo({children:e,className:t=""}){return B.jsx("p",{className:`${t} ${Ne("Text")}`,children:e})}const Jh=M.createContext({});function y3({children:e,...t}){return B.jsx(Jh.Provider,{value:t,children:e})}const Zr=()=>M.useContext(Jh);var mt=(e=>(e[e.LOADING=1]="LOADING",e[e.SUCCESS=2]="SUCCESS",e[e.FAILED=3]="FAILED",e))(mt||{});const g3=({className:e="",size:t=38,borderWidth:r=3,borderColor:n="white",bottomBorderColor:s="rgba(255, 255, 255, 0.2)"})=>{const a={"--size":`${t}px`,"--border-width":`${r}px`,"--border-color":n,"--bottom-border-color":s};return B.jsx("div",{className:`${Ne("Spinner")} ${e}`,style:a})};function Lc({className:e="",body:t,footerLink:r,footerText:n,title:s,children:a}){return B.jsxs("div",{className:`${Ne("TradeStepLayout")} ${e}`,children:[B.jsxs("div",{className:Ne("TradeStepLayoutHeader"),children:[B.jsx(k3,{}),s&&B.jsx(Oo,{className:Ne("TradeStepLayoutTitle"),children:s})]}),t&&B.jsx("div",{className:Ne("TradeStepLayoutBody"),children:t}),B.jsx(x3,{link:r,text:n}),a]})}const x3=({link:e,text:t})=>{const{swapStatus:r}=Zr();return!e&&!t?null:B.jsxs("div",{className:Ne("TradeStepLayoutFooter"),children:[B.jsx(T3,{}),e?B.jsx(w3,{link:e,text:t}):r===mt.FAILED?void 0:B.jsx(Oo,{children:t})]})},w3=({link:e,text:t})=>B.jsx("a",{target:"_blank",className:Ne("TradeStepLayoutFooterLink"),href:e,children:t});function v3(){const{components:e}=Zr();return e.SuccessIcon?e.SuccessIcon:B.jsxs("svg",{fill:"none",viewBox:"0 0 16 16",className:Ne("TradeStepLayoutSuccessIcon"),children:[B.jsx("circle",{cx:"8",cy:"8",r:"7",strokeWidth:"1.5",stroke:"#00C853"}),B.jsx("path",{strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",stroke:"#00C853",d:"M5 8l2 2 4-4"})]})}function E3(){const{components:e}=Zr();return e.FailedIcon?e.FailedIcon:B.jsxs("svg",{className:Ne("TradeStepLayoutErrorIcon"),viewBox:"0 0 16 16",fill:"none",children:[B.jsx("circle",{cx:"8",cy:"8",r:"7",strokeWidth:"1.5",stroke:"#FF3D00"}),B.jsx("path",{strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",stroke:"#FF3D00",d:"M8 4v5M8 11h.01"})]})}const k3=()=>{const{swapStatus:e}=Zr();return e===mt.SUCCESS?B.jsx(v3,{}):e===mt.FAILED?B.jsx(E3,{}):B.jsx(C3,{})},C3=()=>{const{components:e}=Zr();return e.Loader?e.Loader:B.jsx(g3,{size:60,borderWidth:5,className:Ne("TradeStepLayoutSpinner")})},T3=()=>{const{totalSteps:e,currentStepIndex:t=0,swapStatus:r}=Zr();return r!==mt.LOADING||e===1?null:B.jsx("div",{className:Ne("StepIndicator"),children:B.jsx("div",{style:{width:`${100/(e||0)}%`,left:`${t*100/(e||0)}%`},className:Ne("StepIndicatorLine")})})},S3=({error:e,footerLink:t,footerText:r})=>B.jsx(Lc,{footerLink:t,footerText:r,body:e||B.jsx("p",{className:Ne("FailedContentMsg"),children:"Something went wrong"}),className:Ne("FailedContent")});function A3(){return B.jsx("svg",{fill:"currentColor",viewBox:"0 0 16 16",className:Ne("TradepPreviewIcon"),children:B.jsx("path",{fillRule:"evenodd",d:"M4 8a.5.5 0 01.5-.5h5.793L8.146 5.354a.5.5 0 11.708-.708l3 3a.5.5 0 010 .708l-3 3a.5.5 0 01-.708-.708L10.293 8.5H4.5A.5.5 0 014 8z"})})}const e1=({inTokenOnly:e})=>{const{inToken:t,outToken:r,inAmount:n,outAmount:s,components:a}=Zr();return B.jsxs("div",{className:Ne("TradePreview"),children:[B.jsx(t1,{token:t,amount:n,Logo:a==null?void 0:a.SrcTokenLogo}),!e&&B.jsxs(B.Fragment,{children:[B.jsx(A3,{}),B.jsx(t1,{token:r,amount:s,Logo:a==null?void 0:a.DstTokenLogo})]})]})},t1=({token:e,amount:t,Logo:r})=>B.jsxs("div",{className:Ne("TradePreviewToken"),children:[r||B.jsx("img",{src:e==null?void 0:e.logoUrl,className:Ne("TradepPreviewLogo"),alt:`${e==null?void 0:e.symbol} logo`}),B.jsxs(Oo,{children:[t," ",e==null?void 0:e.symbol]})]});function P3({title:e,footerLink:t,footerText:r,hideTokens:n}){return B.jsx(Lc,{title:e,className:Ne("Success"),body:!n&&B.jsx(e1,{}),footerLink:t,footerText:r})}const r1=({$gap:e=10,$alignItems:t="flex-start",children:r,className:n="",customStyles:s={}})=>{const a={gap:`${e}px`,alignItems:t,width:"100%",...s};return B.jsx("div",{className:`${Ne("FlexColumn")} ${n}`,style:a,children:r})};function n1({styles:e={},className:t=""}){return B.jsx("div",{style:e,className:`${Ne("SkeletonLoader")} ${t}`})}const I3=()=>B.jsxs("div",{className:`${Ne("MainContentLoader")}`,children:[B.jsx(n1,{className:`${Ne("MainContentCircleLoader")}`}),B.jsx(n1,{className:`${Ne("MainContentRectengularLoader")}`})]}),B3=({fromTitle:e,toTitle:t,inUsd:r,outUsd:n})=>{const{swapStatus:s,outAmount:a,inAmount:o,inToken:i,outToken:c,components:l,totalSteps:u}=Zr(),d=B.jsx(a1,{fromTitle:e,inUsd:r,inToken:i,toTitle:t,outUsd:n,outToken:c,inAmount:o,outAmount:a,SrcTokenLogo:l.SrcTokenLogo,DstTokenLogo:l.DstTokenLogo});return s?u?B.jsx(F3,{}):B.jsxs(r1,{children:[d,B.jsx(I3,{})]}):B.jsx(r1,{children:d})},s1=({amount:e,token:t,usd:r,title:n,Logo:s})=>B.jsxs("div",{className:`${Ne("MainToken")}`,children:[B.jsxs("div",{className:`${Ne("MainTokenLeft")}`,children:[B.jsx(Oo,{className:`${Ne("MainTokenTitle")}`,children:n}),B.jsx(Oo,{className:` ${Ne("MainTokenAmount")}`,children:`${e&&Number(e)>0?e:""} ${(t==null?void 0:t.symbol)||""}`}),r&&B.jsx("div",{className:` ${Ne("MainTokenUsd")}`,children:r})]}),s||B.jsx("div",{className:` ${Ne("MainTokenLogo")}`,children:t!=null&&t.logoUrl?B.jsx("img",{src:t==null?void 0:t.logoUrl,alt:"Token logo"}):null})]});function F3(){const{currentStep:e}=Zr();return e?B.jsx(Lc,{footerLink:e.footerLink,footerText:e.footerText,title:e.title,body:e.hideTokens?void 0:B.jsx(e1,{inTokenOnly:e==null?void 0:e.inTokenOnly})}):null}const a1=({fromTitle:e,inUsd:t,inToken:r,toTitle:n,outUsd:s,outToken:a,inAmount:o,outAmount:i,SrcTokenLogo:c,DstTokenLogo:l})=>B.jsxs("div",{className:`${Ne("Main")}`,children:[B.jsx(s1,{title:e||"Swap from",usd:t,token:r,amount:o,Logo:c}),B.jsx(s1,{title:n||"Swap to",usd:s,token:a,amount:i,Logo:l})]}),Qn=e=>B.jsx(y3,{...e,children:B.jsx(U3,{})}),U3=()=>{const{swapStatus:e,components:t,className:r}=Zr();return B.jsx("div",{className:`${Ne("SwapFlow")} ${r}`,children:e===mt.SUCCESS?t==null?void 0:t.Success:e===mt.FAILED?t==null?void 0:t.Failed:t==null?void 0:t.Main})};Qn.Success=P3,Qn.Failed=S3,Qn.Main=B3,Qn.StepLayout=Lc;var Mt=(e=>(e[e.EMPTY_LIMIT_PRICE=0]="EMPTY_LIMIT_PRICE",e[e.MAX_CHUNKS=1]="MAX_CHUNKS",e[e.MIN_CHUNKS=2]="MIN_CHUNKS",e[e.MIN_TRADE_SIZE=3]="MIN_TRADE_SIZE",e[e.MAX_FILL_DELAY=4]="MAX_FILL_DELAY",e[e.MIN_FILL_DELAY=5]="MIN_FILL_DELAY",e[e.MAX_ORDER_DURATION=6]="MAX_ORDER_DURATION",e[e.MIN_ORDER_DURATION=7]="MIN_ORDER_DURATION",e[e.MISSING_LIMIT_PRICE=8]="MISSING_LIMIT_PRICE",e[e.STOP_LOSS_TRIGGER_PRICE_GREATER_THAN_MARKET_PRICE=9]="STOP_LOSS_TRIGGER_PRICE_GREATER_THAN_MARKET_PRICE",e[e.TRIGGER_LIMIT_PRICE_GREATER_THAN_TRIGGER_PRICE=10]="TRIGGER_LIMIT_PRICE_GREATER_THAN_TRIGGER_PRICE",e[e.TAKE_PROFIT_TRIGGER_PRICE_LESS_THAN_MARKET_PRICE=11]="TAKE_PROFIT_TRIGGER_PRICE_LESS_THAN_MARKET_PRICE",e[e.EMPTY_TRIGGER_PRICE=12]="EMPTY_TRIGGER_PRICE",e[e.INSUFFICIENT_BALANCE=13]="INSUFFICIENT_BALANCE",e[e.MAX_ORDER_SIZE=14]="MAX_ORDER_SIZE",e))(Mt||{}),Ds=(e=>(e.WRAP="wrap",e.APPROVE="approve",e.CREATE="create",e))(Ds||{});const O3=e=>e.replace(/,/g,""),D3=async e=>{if(!(navigator!=null&&navigator.clipboard))return console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(e),!0}catch(t){return console.warn("Copy failed",t),!1}},o1=e=>{if(!e)return"";const t=Math.floor(e/1e3),r=Math.floor(t/(1440*60)),n=Math.floor(t%(1440*60)/3600),s=Math.floor(t%3600/60),a=t%60,o=[];return r&&o.push(`${r} days `),n&&o.push(`${n} hours `),s&&o.push(`${s} minutes`),a&&o.push(`${a} seconds`),o.join(" ")},Cd=(e,t)=>e?`${e.substring(0,(t==null?void 0:t.start)||6)}...${e.substring(e.length-((t==null?void 0:t.end)||5))}`:"",_3=e=>{const t="An error occurred.";if(!e||!e.message)return t;try{return e.message.toLowerCase().indexOf("rejected")?"Transaction Rejected":t}catch{return t}};function Do(e,t=6,r=8){if(!e)return"";const n=e.startsWith("-")?"-":"",s=n?e.slice(1):e,[a,o=""]=s.split(".");if(!o||Number(o)===0)return n+a;if(a!=="0"){const f=o.slice(0,t).replace(/0+$/,""),m=f?"."+f:"";return n+a+m}const i=o.search(/[^0]/);if(i===-1||i+1>r)return"0";const c=o.slice(0,i),u=o.slice(i).slice(0,t).replace(/0+$/,"");return u?n+"0."+c+u:"0"}const Td=e=>{var t,r,n,s;if(e!=null&&e.message)return((r=(t=e.message)==null?void 0:t.toLowerCase())==null?void 0:r.includes("rejected"))||((s=(n=e.message)==null?void 0:n.toLowerCase())==null?void 0:s.includes("denied"))},M3=e=>{switch(e){case Ft.base.id:return 1e-4;default:return .01}},i1=(e,t,r)=>{if(!j(e.srcAmountFilled||0).gt(0)||!j(e.dstAmountFilled||0).gt(0))return"";const n=bn(t,e.srcAmountFilled),s=bn(r,e.dstAmountFilled);return j(s).div(n).toFixed()},c1=(e,t,r)=>{if(e.type===ut.TWAP_MARKET)return"";const n=bn(t,e.srcAmountPerTrade),s=bn(r,e.dstMinAmountPerTrade);return j(s).div(n).toFixed()},l1=(e,t)=>{const r=Bs(t);return r&&Is(e.address)?r.wToken:e};function u1(e){return e?e/864e5:0}function Sd(e){return e?e/6e4:0}const N3=(e,t)=>e?ut.TWAP_MARKET:t===1?ut.LIMIT:ut.TWAP_LIMIT,Ad=(e,t,r)=>{const n=Bs(r);return Is((e==null?void 0:e.address)||"")&&Ps((t==null?void 0:t.address)||"",(n==null?void 0:n.wToken.address)||"")},Pd=(e,t,r)=>{const n=Bs(r);return Ps((e==null?void 0:e.address)||"",(n==null?void 0:n.wToken.address)||"")&&Is((t==null?void 0:t.address)||"")},_o=(e,t)=>{if(!t)return"";const r=Bs(t);return`${r==null?void 0:r.explorer}/tx/${e}`};function p(e){const t={formatters:void 0,fees:void 0,serializers:void 0,...e};function r(n){return s=>{const a=typeof s=="function"?s(n):s,o={...n,...a};return Object.assign(o,{extend:r(o)})}}return Object.assign(t,{extend:r(t)})}function L3(){return{}}const z3=p({id:16600,name:"0G Newton Testnet",nativeCurrency:{name:"A0GI",symbol:"A0GI",decimals:18},rpcUrls:{default:{http:["https://evmrpc-testnet.0g.ai"]}},blockExplorers:{default:{name:"0G BlockChain Explorer",url:"https://chainscan-newton.0g.ai"}},testnet:!0}),R3=p({id:16601,name:"0G Galileo Testnet",nativeCurrency:{name:"A0GI",symbol:"A0GI",decimals:18},rpcUrls:{default:{http:["https://evmrpc-testnet.0g.ai"]}},blockExplorers:{default:{name:"0G BlockChain Explorer",url:"https://chainscan-galileo.0g.ai"}},testnet:!0}),H3=p({id:16661,name:"0G Mainnet",nativeCurrency:{name:"0G",symbol:"0G",decimals:18},rpcUrls:{default:{http:["https://evmrpc.0g.ai"]}},blockExplorers:{default:{name:"0G BlockChain Explorer",url:"https://chainscan.0g.ai"}},testnet:!1}),$3=p({id:16602,name:"0G Galileo Testnet",nativeCurrency:{name:"A0GI",symbol:"A0GI",decimals:18},rpcUrls:{default:{http:["https://evmrpc-testnet.0g.ai"]}},blockExplorers:{default:{name:"0G BlockChain Explorer",url:"https://chainscan-galileo.0g.ai"}},testnet:!0}),G3=p({id:995,name:"5ireChain",nativeCurrency:{name:"5ire Token",symbol:"5IRE",decimals:18},rpcUrls:{default:{http:["https://rpc.5ire.network"]}},blockExplorers:{default:{name:"5ireChain Mainnet Explorer",url:"https://5irescan.io/"}},testnet:!1}),j3=p({id:179,name:"ABEY Mainnet",nativeCurrency:{name:"ABEY",symbol:"ABEY",decimals:18},rpcUrls:{default:{http:["https://rpc.abeychain.com"]}},blockExplorers:{default:{name:"Abey Scan",url:"https://abeyscan.com"}},testnet:!1}),d1="2.43.3";let Mo={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${d1}`},$=class Bm extends Error{constructor(t,r={}){var i;const n=(()=>{var c;return r.cause instanceof Bm?r.cause.details:(c=r.cause)!=null&&c.message?r.cause.message:r.details})(),s=r.cause instanceof Bm&&r.cause.docsPath||r.docsPath,a=(i=Mo.getDocsUrl)==null?void 0:i.call(Mo,{...r,docsPath:s}),o=[t||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...n?[`Details: ${n}`]:[],...Mo.version?[`Version: ${Mo.version}`]:[]].join(`
|
|
64
|
+
`,extractResults:d=>{var f;return(((f=d.data)==null?void 0:f.orderFilleds)||[]).map(m=>({...m,timestamp:new Date(m.timestamp).getTime()}))}})};class kw extends Error{constructor(){super("No graph endpoint found"),this.name="NoGraphEndpointError"}}const Cw=async({chainId:e,signal:t,page:r,limit:n,filters:s})=>{const a=await ww({chainId:e,signal:t,page:r,limit:n,filters:s}),[o,i]=await Promise.all([Ew({chainId:e,orders:a,signal:t}),vw({chainId:e,orders:a,signal:t})]);return a.map(l=>{const u=o==null?void 0:o.filter(d=>d.TWAP_id===Number(l.Contract_id)&&Ps(d.exchange,l.exchange)&&Ps(d.twapAddress,l.twapAddress));return gw(l,e,u,Tw(l,u||[],i))}).sort((l,u)=>u.createdAt-l.createdAt)},Tw=(e,t,r)=>{var i;const n=(i=r==null?void 0:r.find(c=>c.twapId===e.Contract_id.toString()&&Ps(c.twapAddress,e.twapAddress)))==null?void 0:i.status,a=Th(t).reduce((c,l)=>c.plus(l.inAmount),new j(0)).toFixed(),o=Ah(e.ask_srcAmount,a);return Sw(o,e.ask_deadline*1e3,n)},Ah=(e,t)=>{if(!t||!e)return 0;const r=j(t).dividedBy(e).toNumber();return r>=.99?100:r<=0?0:Number((r*100).toFixed(2))},Sw=(e,t,r)=>e===100?lt.Completed:r==="CANCELED"?lt.Canceled:r==="COMPLETED"?lt.Completed:t>Date.now()?lt.Open:lt.Expired,Ph=async({signal:e,page:t,chainId:r,limit:n,config:s,account:a})=>(await Promise.all([s?Cw({chainId:r,signal:e,page:t,limit:n,filters:{accounts:[a],configs:[s]}}):Promise.resolve([]),bw({chainId:r,signal:e,account:a})]).then(([c,l])=>[...c,...l])).sort((c,l)=>l.createdAt-c.createdAt),Aw={version:"0.0.33"};var Ta=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Pw={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Iw=(f5=class{constructor(){le(this,dn,Pw);le(this,pa,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&N(this,pa)&&e!==N(this,dn)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:N(this,dn),provider:e}),ee(this,dn,e),process.env.NODE_ENV!=="production"&&ee(this,pa,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&ee(this,pa,!0),N(this,dn).setTimeout(e,t)}clearTimeout(e){N(this,dn).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&ee(this,pa,!0),N(this,dn).setInterval(e,t)}clearInterval(e){N(this,dn).clearInterval(e)}},dn=new WeakMap,pa=new WeakMap,f5),Fs=new Iw;function Bw(e){setTimeout(e,0)}var Us=typeof window>"u"||"Deno"in globalThis;function jt(){}function Fw(e,t){return typeof e=="function"?e(t):e}function fd(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ih(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Xn(e,t){return typeof e=="function"?e(t):e}function Er(e,t){return typeof e=="function"?e(t):e}function Bh(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:a,queryKey:o,stale:i}=e;if(o){if(n){if(t.queryHash!==md(o,t.options))return!1}else if(!Uo(t.queryKey,o))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof i=="boolean"&&t.isStale()!==i||s&&s!==t.state.fetchStatus||a&&!a(t))}function Fh(e,t){const{exact:r,status:n,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(Os(t.options.mutationKey)!==Os(a))return!1}else if(!Uo(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function md(e,t){return((t==null?void 0:t.queryKeyHashFn)||Os)(e)}function Os(e){return JSON.stringify(e,(t,r)=>bd(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function Uo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Uo(e[r],t[r])):!1}var Uw=Object.prototype.hasOwnProperty;function hd(e,t){if(e===t)return e;const r=Uh(e)&&Uh(t);if(!r&&!(bd(e)&&bd(t)))return t;const s=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,i=r?new Array(o):{};let c=0;for(let l=0;l<o;l++){const u=r?l:a[l],d=e[u],f=t[u];if(d===f){i[u]=d,(r?l<s:Uw.call(e,u))&&c++;continue}if(d===null||f===null||typeof d!="object"||typeof f!="object"){i[u]=f;continue}const m=hd(d,f);i[u]=m,m===d&&c++}return s===o&&c===s?e:i}function Oc(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function Uh(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function bd(e){if(!Oh(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!Oh(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Oh(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ow(e){return new Promise(t=>{Fs.setTimeout(t,e)})}function yd(e,t,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(e,t);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return hd(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return hd(e,t)}return t}function Dw(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function _w(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Dc=Symbol();function Dh(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Dc&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Dc?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function _h(e,t){return typeof e=="function"?e(...t):!!e}var Mw=(m5=class extends Ta{constructor(){super();le(this,fa);le(this,gs);le(this,go);ee(this,go,t=>{if(!Us&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){N(this,gs)||this.setEventListener(N(this,go))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,gs))==null||t.call(this),ee(this,gs,void 0))}setEventListener(t){var r;ee(this,go,t),(r=N(this,gs))==null||r.call(this),ee(this,gs,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){N(this,fa)!==t&&(ee(this,fa,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof N(this,fa)=="boolean"?N(this,fa):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},fa=new WeakMap,gs=new WeakMap,go=new WeakMap,m5),gd=new Mw;function xd(){let e,t;const r=new Promise((s,a)=>{e=s,t=a});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}var Nw=Bw;function Lw(){let e=[],t=0,r=i=>{i()},n=i=>{i()},s=Nw;const a=i=>{t?e.push(i):s(()=>{r(i)})},o=()=>{const i=e;e=[],i.length&&s(()=>{n(()=>{i.forEach(c=>{r(c)})})})};return{batch:i=>{let c;t++;try{c=i()}finally{t--,t||o()}return c},batchCalls:i=>(...c)=>{a(()=>{i(...c)})},schedule:a,setNotifyFunction:i=>{r=i},setBatchNotifyFunction:i=>{n=i},setScheduler:i=>{s=i}}}var kt=Lw(),zw=(h5=class extends Ta{constructor(){super();le(this,xo,!0);le(this,xs);le(this,wo);ee(this,wo,t=>{if(!Us&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){N(this,xs)||this.setEventListener(N(this,wo))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,xs))==null||t.call(this),ee(this,xs,void 0))}setEventListener(t){var r;ee(this,wo,t),(r=N(this,xs))==null||r.call(this),ee(this,xs,t(this.setOnline.bind(this)))}setOnline(t){N(this,xo)!==t&&(ee(this,xo,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return N(this,xo)}},xo=new WeakMap,xs=new WeakMap,wo=new WeakMap,h5),_c=new zw;function Rw(e){return Math.min(1e3*2**e,3e4)}function Mh(e){return(e??"online")==="online"?_c.isOnline():!0}var wd=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Nh(e){let t=!1,r=0,n;const s=xd(),a=()=>s.status!=="pending",o=g=>{var E;if(!a()){const v=new wd(g);f(v),(E=e.onCancel)==null||E.call(e,v)}},i=()=>{t=!0},c=()=>{t=!1},l=()=>gd.isFocused()&&(e.networkMode==="always"||_c.isOnline())&&e.canRun(),u=()=>Mh(e.networkMode)&&e.canRun(),d=g=>{a()||(n==null||n(),s.resolve(g))},f=g=>{a()||(n==null||n(),s.reject(g))},m=()=>new Promise(g=>{var E;n=v=>{(a()||l())&&g(v)},(E=e.onPause)==null||E.call(e)}).then(()=>{var g;n=void 0,a()||(g=e.onContinue)==null||g.call(e)}),y=()=>{if(a())return;let g;const E=r===0?e.initialPromise:void 0;try{g=E??e.fn()}catch(v){g=Promise.reject(v)}Promise.resolve(g).then(d).catch(v=>{var L;if(a())return;const w=e.retry??(Us?0:3),A=e.retryDelay??Rw,C=typeof A=="function"?A(r,v):A,D=w===!0||typeof w=="number"&&r<w||typeof w=="function"&&w(r,v);if(t||!D){f(v);return}r++,(L=e.onFail)==null||L.call(e,r,v),Ow(C).then(()=>l()?void 0:m()).then(()=>{t?f(v):y()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(n==null||n(),s),cancelRetry:i,continueRetry:c,canStart:u,start:()=>(u()?y():m().then(y),s)}}var Lh=(b5=class{constructor(){le(this,ma)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),fd(this.gcTime)&&ee(this,ma,Fs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Us?1/0:300*1e3))}clearGcTimeout(){N(this,ma)&&(Fs.clearTimeout(N(this,ma)),ee(this,ma,void 0))}},ma=new WeakMap,b5),Hw=(y5=class extends Lh{constructor(t){super();le(this,Yr);le(this,ha);le(this,vo);le(this,Br);le(this,ba);le(this,Bt);le(this,wc);le(this,ya);ee(this,ya,!1),ee(this,wc,t.defaultOptions),this.setOptions(t.options),this.observers=[],ee(this,ba,t.client),ee(this,Br,N(this,ba).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ee(this,ha,Hh(this.options)),this.state=t.state??N(this,ha),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=N(this,Bt))==null?void 0:t.promise}setOptions(t){if(this.options={...N(this,wc),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=Hh(this.options);r.data!==void 0&&(this.setState(Rh(r.data,r.dataUpdatedAt)),ee(this,ha,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&N(this,Br).remove(this)}setData(t,r){const n=yd(this.state.data,t,this.options);return Ae(this,Yr,Yn).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){Ae(this,Yr,Yn).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,s;const r=(n=N(this,Bt))==null?void 0:n.promise;return(s=N(this,Bt))==null||s.cancel(t),r?r.then(jt).catch(jt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(N(this,ha))}isActive(){return this.observers.some(t=>Er(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Dc||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Xn(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Ih(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=N(this,Bt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=N(this,Bt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),N(this,Br).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(N(this,Bt)&&(N(this,ya)?N(this,Bt).cancel({revert:!0}):N(this,Bt).cancelRetry()),this.scheduleGc()),N(this,Br).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ae(this,Yr,Yn).call(this,{type:"invalidate"})}async fetch(t,r){var c,l,u,d,f,m,y,g,E,v,w,A;if(this.state.fetchStatus!=="idle"&&((c=N(this,Bt))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(N(this,Bt))return N(this,Bt).continueRetry(),N(this,Bt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const C=this.observers.find(D=>D.options.queryFn);C&&this.setOptions(C.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,s=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(ee(this,ya,!0),n.signal)})},a=()=>{const C=Dh(this.options,r),L=(()=>{const T={client:N(this,ba),queryKey:this.queryKey,meta:this.meta};return s(T),T})();return ee(this,ya,!1),this.options.persister?this.options.persister(C,L,this):C(L)},i=(()=>{const C={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:N(this,ba),state:this.state,fetchFn:a};return s(C),C})();(l=this.options.behavior)==null||l.onFetch(i,this),ee(this,vo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=i.fetchOptions)==null?void 0:u.meta))&&Ae(this,Yr,Yn).call(this,{type:"fetch",meta:(d=i.fetchOptions)==null?void 0:d.meta}),ee(this,Bt,Nh({initialPromise:r==null?void 0:r.initialPromise,fn:i.fetchFn,onCancel:C=>{C instanceof wd&&C.revert&&this.setState({...N(this,vo),fetchStatus:"idle"}),n.abort()},onFail:(C,D)=>{Ae(this,Yr,Yn).call(this,{type:"failed",failureCount:C,error:D})},onPause:()=>{Ae(this,Yr,Yn).call(this,{type:"pause"})},onContinue:()=>{Ae(this,Yr,Yn).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}));try{const C=await N(this,Bt).start();if(C===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(C),(m=(f=N(this,Br).config).onSuccess)==null||m.call(f,C,this),(g=(y=N(this,Br).config).onSettled)==null||g.call(y,C,this.state.error,this),C}catch(C){if(C instanceof wd){if(C.silent)return N(this,Bt).promise;if(C.revert){if(this.state.data===void 0)throw C;return this.state.data}}throw Ae(this,Yr,Yn).call(this,{type:"error",error:C}),(v=(E=N(this,Br).config).onError)==null||v.call(E,C,this),(A=(w=N(this,Br).config).onSettled)==null||A.call(w,this.state.data,C,this),C}finally{this.scheduleGc()}}},ha=new WeakMap,vo=new WeakMap,Br=new WeakMap,ba=new WeakMap,Bt=new WeakMap,wc=new WeakMap,ya=new WeakMap,Yr=new WeakSet,Yn=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...zh(n.data,this.options),fetchMeta:t.meta??null};case"success":const s={...n,...Rh(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ee(this,vo,t.manual?s:void 0),s;case"error":const a=t.error;return{...n,error:a,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),kt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),N(this,Br).notify({query:this,type:"updated",action:t})})},y5);function zh(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Mh(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Rh(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Hh(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var $w=(g5=class extends Ta{constructor(t,r){super();le(this,Ve);le(this,sr);le(this,De);le(this,vc);le(this,qt);le(this,ga);le(this,Eo);le(this,Gn);le(this,ws);le(this,Ec);le(this,ko);le(this,Co);le(this,xa);le(this,wa);le(this,vs);le(this,To,new Set);this.options=r,ee(this,sr,t),ee(this,ws,null),ee(this,Gn,xd()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(N(this,De).addObserver(this),$h(N(this,De),this.options)?Ae(this,Ve,Tc).call(this):this.updateResult(),Ae(this,Ve,Tm).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return vd(N(this,De),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return vd(N(this,De),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ae(this,Ve,Sm).call(this),Ae(this,Ve,Am).call(this),N(this,De).removeObserver(this)}setOptions(t){const r=this.options,n=N(this,De);if(this.options=N(this,sr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Er(this.options.enabled,N(this,De))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ae(this,Ve,Pm).call(this),N(this,De).setOptions(this.options),r._defaulted&&!Oc(this.options,r)&&N(this,sr).getQueryCache().notify({type:"observerOptionsUpdated",query:N(this,De),observer:this});const s=this.hasListeners();s&&Gh(N(this,De),n,this.options,r)&&Ae(this,Ve,Tc).call(this),this.updateResult(),s&&(N(this,De)!==n||Er(this.options.enabled,N(this,De))!==Er(r.enabled,N(this,De))||Xn(this.options.staleTime,N(this,De))!==Xn(r.staleTime,N(this,De)))&&Ae(this,Ve,Em).call(this);const a=Ae(this,Ve,km).call(this);s&&(N(this,De)!==n||Er(this.options.enabled,N(this,De))!==Er(r.enabled,N(this,De))||a!==N(this,vs))&&Ae(this,Ve,Cm).call(this,a)}getOptimisticResult(t){const r=N(this,sr).getQueryCache().build(N(this,sr),t),n=this.createResult(r,t);return jw(this,n)&&(ee(this,qt,n),ee(this,Eo,this.options),ee(this,ga,N(this,De).state)),n}getCurrentResult(){return N(this,qt)}trackResult(t,r){return new Proxy(t,{get:(n,s)=>(this.trackProp(s),r==null||r(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&N(this,Gn).status==="pending"&&N(this,Gn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(t){N(this,To).add(t)}getCurrentQuery(){return N(this,De)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=N(this,sr).defaultQueryOptions(t),n=N(this,sr).getQueryCache().build(N(this,sr),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Ae(this,Ve,Tc).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),N(this,qt)))}createResult(t,r){var b;const n=N(this,De),s=this.options,a=N(this,qt),o=N(this,ga),i=N(this,Eo),l=t!==n?t.state:N(this,vc),{state:u}=t;let d={...u},f=!1,m;if(r._optimisticResults){const x=this.hasListeners(),S=!x&&$h(t,r),I=x&&Gh(t,n,r,s);(S||I)&&(d={...d,...zh(u.data,t.options)}),r._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:y,errorUpdatedAt:g,status:E}=d;m=d.data;let v=!1;if(r.placeholderData!==void 0&&m===void 0&&E==="pending"){let x;a!=null&&a.isPlaceholderData&&r.placeholderData===(i==null?void 0:i.placeholderData)?(x=a.data,v=!0):x=typeof r.placeholderData=="function"?r.placeholderData((b=N(this,Co))==null?void 0:b.state.data,N(this,Co)):r.placeholderData,x!==void 0&&(E="success",m=yd(a==null?void 0:a.data,x,r),f=!0)}if(r.select&&m!==void 0&&!v)if(a&&m===(o==null?void 0:o.data)&&r.select===N(this,Ec))m=N(this,ko);else try{ee(this,Ec,r.select),m=r.select(m),m=yd(a==null?void 0:a.data,m,r),ee(this,ko,m),ee(this,ws,null)}catch(x){ee(this,ws,x)}N(this,ws)&&(y=N(this,ws),m=N(this,ko),g=Date.now(),E="error");const w=d.fetchStatus==="fetching",A=E==="pending",C=E==="error",D=A&&w,L=m!==void 0,h={status:E,fetchStatus:d.fetchStatus,isPending:A,isSuccess:E==="success",isError:C,isInitialLoading:D,isLoading:D,data:m,dataUpdatedAt:d.dataUpdatedAt,error:y,errorUpdatedAt:g,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:w,isRefetching:w&&!A,isLoadingError:C&&!L,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:C&&L,isStale:Ed(t,r),refetch:this.refetch,promise:N(this,Gn),isEnabled:Er(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const x=F=>{h.status==="error"?F.reject(h.error):h.data!==void 0&&F.resolve(h.data)},S=()=>{const F=ee(this,Gn,h.promise=xd());x(F)},I=N(this,Gn);switch(I.status){case"pending":t.queryHash===n.queryHash&&x(I);break;case"fulfilled":(h.status==="error"||h.data!==I.value)&&S();break;case"rejected":(h.status!=="error"||h.error!==I.reason)&&S();break}}return h}updateResult(){const t=N(this,qt),r=this.createResult(N(this,De),this.options);if(ee(this,ga,N(this,De).state),ee(this,Eo,this.options),N(this,ga).data!==void 0&&ee(this,Co,N(this,De)),Oc(r,t))return;ee(this,qt,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!N(this,To).size)return!0;const o=new Set(a??N(this,To));return this.options.throwOnError&&o.add("error"),Object.keys(N(this,qt)).some(i=>{const c=i;return N(this,qt)[c]!==t[c]&&o.has(c)})};Ae(this,Ve,F5).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ae(this,Ve,Tm).call(this)}},sr=new WeakMap,De=new WeakMap,vc=new WeakMap,qt=new WeakMap,ga=new WeakMap,Eo=new WeakMap,Gn=new WeakMap,ws=new WeakMap,Ec=new WeakMap,ko=new WeakMap,Co=new WeakMap,xa=new WeakMap,wa=new WeakMap,vs=new WeakMap,To=new WeakMap,Ve=new WeakSet,Tc=function(t){Ae(this,Ve,Pm).call(this);let r=N(this,De).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(jt)),r},Em=function(){Ae(this,Ve,Sm).call(this);const t=Xn(this.options.staleTime,N(this,De));if(Us||N(this,qt).isStale||!fd(t))return;const n=Ih(N(this,qt).dataUpdatedAt,t)+1;ee(this,xa,Fs.setTimeout(()=>{N(this,qt).isStale||this.updateResult()},n))},km=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(N(this,De)):this.options.refetchInterval)??!1},Cm=function(t){Ae(this,Ve,Am).call(this),ee(this,vs,t),!(Us||Er(this.options.enabled,N(this,De))===!1||!fd(N(this,vs))||N(this,vs)===0)&&ee(this,wa,Fs.setInterval(()=>{(this.options.refetchIntervalInBackground||gd.isFocused())&&Ae(this,Ve,Tc).call(this)},N(this,vs)))},Tm=function(){Ae(this,Ve,Em).call(this),Ae(this,Ve,Cm).call(this,Ae(this,Ve,km).call(this))},Sm=function(){N(this,xa)&&(Fs.clearTimeout(N(this,xa)),ee(this,xa,void 0))},Am=function(){N(this,wa)&&(Fs.clearInterval(N(this,wa)),ee(this,wa,void 0))},Pm=function(){const t=N(this,sr).getQueryCache().build(N(this,sr),this.options);if(t===N(this,De))return;const r=N(this,De);ee(this,De,t),ee(this,vc,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},F5=function(t){kt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(N(this,qt))}),N(this,sr).getQueryCache().notify({query:N(this,De),type:"observerResultsUpdated"})})},g5);function Gw(e,t){return Er(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function $h(e,t){return Gw(e,t)||e.state.data!==void 0&&vd(e,t,t.refetchOnMount)}function vd(e,t,r){if(Er(t.enabled,e)!==!1&&Xn(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Ed(e,t)}return!1}function Gh(e,t,r,n){return(e!==t||Er(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Ed(e,r)}function Ed(e,t){return Er(t.enabled,e)!==!1&&e.isStaleByTime(Xn(t.staleTime,e))}function jw(e,t){return!Oc(e.getCurrentResult(),t)}function jh(e){return{onFetch:(t,r)=>{var u,d,f,m,y;const n=t.options,s=(f=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,a=((m=t.state.data)==null?void 0:m.pages)||[],o=((y=t.state.data)==null?void 0:y.pageParams)||[];let i={pages:[],pageParams:[]},c=0;const l=async()=>{let g=!1;const E=A=>{Object.defineProperty(A,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},v=Dh(t.options,t.fetchOptions),w=async(A,C,D)=>{if(g)return Promise.reject();if(C==null&&A.pages.length)return Promise.resolve(A);const T=(()=>{const S={client:t.client,queryKey:t.queryKey,pageParam:C,direction:D?"backward":"forward",meta:t.options.meta};return E(S),S})(),h=await v(T),{maxPages:b}=t.options,x=D?_w:Dw;return{pages:x(A.pages,h,b),pageParams:x(A.pageParams,C,b)}};if(s&&a.length){const A=s==="backward",C=A?Vw:Vh,D={pages:a,pageParams:o},L=C(n,D);i=await w(D,L,A)}else{const A=e??a.length;do{const C=c===0?o[0]??n.initialPageParam:Vh(n,i);if(c>0&&C==null)break;i=await w(i,C),c++}while(c<A)}return i};t.options.persister?t.fetchFn=()=>{var g,E;return(E=(g=t.options).persister)==null?void 0:E.call(g,l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=l}}}function Vh(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function Vw(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var Ww=(x5=class extends Lh{constructor(t){super();le(this,fn);le(this,kc);le(this,pn);le(this,Yt);le(this,va);ee(this,kc,t.client),this.mutationId=t.mutationId,ee(this,Yt,t.mutationCache),ee(this,pn,[]),this.state=t.state||Wh(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){N(this,pn).includes(t)||(N(this,pn).push(t),this.clearGcTimeout(),N(this,Yt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ee(this,pn,N(this,pn).filter(r=>r!==t)),this.scheduleGc(),N(this,Yt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){N(this,pn).length||(this.state.status==="pending"?this.scheduleGc():N(this,Yt).remove(this))}continue(){var t;return((t=N(this,va))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,c,l,u,d,f,m,y,g,E,v,w,A,C,D,L,T,h,b;const r=()=>{Ae(this,fn,Ss).call(this,{type:"continue"})},n={client:N(this,kc),meta:this.options.meta,mutationKey:this.options.mutationKey};ee(this,va,Nh({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(x,S)=>{Ae(this,fn,Ss).call(this,{type:"failed",failureCount:x,error:S})},onPause:()=>{Ae(this,fn,Ss).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>N(this,Yt).canRun(this)}));const s=this.state.status==="pending",a=!N(this,va).canStart();try{if(s)r();else{Ae(this,fn,Ss).call(this,{type:"pending",variables:t,isPaused:a}),await((i=(o=N(this,Yt).config).onMutate)==null?void 0:i.call(o,t,this,n));const S=await((l=(c=this.options).onMutate)==null?void 0:l.call(c,t,n));S!==this.state.context&&Ae(this,fn,Ss).call(this,{type:"pending",context:S,variables:t,isPaused:a})}const x=await N(this,va).start();return await((d=(u=N(this,Yt).config).onSuccess)==null?void 0:d.call(u,x,t,this.state.context,this,n)),await((m=(f=this.options).onSuccess)==null?void 0:m.call(f,x,t,this.state.context,n)),await((g=(y=N(this,Yt).config).onSettled)==null?void 0:g.call(y,x,null,this.state.variables,this.state.context,this,n)),await((v=(E=this.options).onSettled)==null?void 0:v.call(E,x,null,t,this.state.context,n)),Ae(this,fn,Ss).call(this,{type:"success",data:x}),x}catch(x){try{throw await((A=(w=N(this,Yt).config).onError)==null?void 0:A.call(w,x,t,this.state.context,this,n)),await((D=(C=this.options).onError)==null?void 0:D.call(C,x,t,this.state.context,n)),await((T=(L=N(this,Yt).config).onSettled)==null?void 0:T.call(L,void 0,x,this.state.variables,this.state.context,this,n)),await((b=(h=this.options).onSettled)==null?void 0:b.call(h,void 0,x,t,this.state.context,n)),x}finally{Ae(this,fn,Ss).call(this,{type:"error",error:x})}}finally{N(this,Yt).runNext(this)}}},kc=new WeakMap,pn=new WeakMap,Yt=new WeakMap,va=new WeakMap,fn=new WeakSet,Ss=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),kt.batch(()=>{N(this,pn).forEach(n=>{n.onMutationUpdate(t)}),N(this,Yt).notify({mutation:this,type:"updated",action:t})})},x5);function Wh(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var qw=(w5=class extends Ta{constructor(t={}){super();le(this,jn);le(this,Kr);le(this,Cc);this.config=t,ee(this,jn,new Set),ee(this,Kr,new Map),ee(this,Cc,0)}build(t,r,n){const s=new Ww({client:t,mutationCache:this,mutationId:++Ku(this,Cc)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){N(this,jn).add(t);const r=Mc(t);if(typeof r=="string"){const n=N(this,Kr).get(r);n?n.push(t):N(this,Kr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(N(this,jn).delete(t)){const r=Mc(t);if(typeof r=="string"){const n=N(this,Kr).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&N(this,Kr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Mc(t);if(typeof r=="string"){const n=N(this,Kr).get(r),s=n==null?void 0:n.find(a=>a.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=Mc(t);if(typeof r=="string"){const s=(n=N(this,Kr).get(r))==null?void 0:n.find(a=>a!==t&&a.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){kt.batch(()=>{N(this,jn).forEach(t=>{this.notify({type:"removed",mutation:t})}),N(this,jn).clear(),N(this,Kr).clear()})}getAll(){return Array.from(N(this,jn))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Fh(r,n))}findAll(t={}){return this.getAll().filter(r=>Fh(t,r))}notify(t){kt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return kt.batch(()=>Promise.all(t.map(r=>r.continue().catch(jt))))}},jn=new WeakMap,Kr=new WeakMap,Cc=new WeakMap,w5);function Mc(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Yw=(v5=class extends Ta{constructor(t,r){super();le(this,qn);le(this,Vn);le(this,Es);le(this,ar);le(this,Wn);ee(this,Vn,t),this.setOptions(r),this.bindMethods(),Ae(this,qn,Zu).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var n;const r=this.options;this.options=N(this,Vn).defaultMutationOptions(t),Oc(this.options,r)||N(this,Vn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:N(this,ar),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Os(r.mutationKey)!==Os(this.options.mutationKey)?this.reset():((n=N(this,ar))==null?void 0:n.state.status)==="pending"&&N(this,ar).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=N(this,ar))==null||t.removeObserver(this)}onMutationUpdate(t){Ae(this,qn,Zu).call(this),Ae(this,qn,Im).call(this,t)}getCurrentResult(){return N(this,Es)}reset(){var t;(t=N(this,ar))==null||t.removeObserver(this),ee(this,ar,void 0),Ae(this,qn,Zu).call(this),Ae(this,qn,Im).call(this)}mutate(t,r){var n;return ee(this,Wn,r),(n=N(this,ar))==null||n.removeObserver(this),ee(this,ar,N(this,Vn).getMutationCache().build(N(this,Vn),this.options)),N(this,ar).addObserver(this),N(this,ar).execute(t)}},Vn=new WeakMap,Es=new WeakMap,ar=new WeakMap,Wn=new WeakMap,qn=new WeakSet,Zu=function(){var r;const t=((r=N(this,ar))==null?void 0:r.state)??Wh();ee(this,Es,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},Im=function(t){kt.batch(()=>{var r,n,s,a,o,i,c,l;if(N(this,Wn)&&this.hasListeners()){const u=N(this,Es).variables,d=N(this,Es).context,f={client:N(this,Vn),meta:this.options.meta,mutationKey:this.options.mutationKey};(t==null?void 0:t.type)==="success"?((n=(r=N(this,Wn)).onSuccess)==null||n.call(r,t.data,u,d,f),(a=(s=N(this,Wn)).onSettled)==null||a.call(s,t.data,null,u,d,f)):(t==null?void 0:t.type)==="error"&&((i=(o=N(this,Wn)).onError)==null||i.call(o,t.error,u,d,f),(l=(c=N(this,Wn)).onSettled)==null||l.call(c,void 0,t.error,u,d,f))}this.listeners.forEach(u=>{u(N(this,Es))})})},v5),Kw=(E5=class extends Ta{constructor(t={}){super();le(this,mn);this.config=t,ee(this,mn,new Map)}build(t,r,n){const s=r.queryKey,a=r.queryHash??md(s,r);let o=this.get(a);return o||(o=new Hw({client:t,queryKey:s,queryHash:a,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){N(this,mn).has(t.queryHash)||(N(this,mn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=N(this,mn).get(t.queryHash);r&&(t.destroy(),r===t&&N(this,mn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){kt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return N(this,mn).get(t)}getAll(){return[...N(this,mn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Bh(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Bh(t,n)):r}notify(t){kt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){kt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){kt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},mn=new WeakMap,E5),Zw=(k5=class{constructor(e={}){le(this,ft);le(this,ks);le(this,Cs);le(this,So);le(this,Ao);le(this,Ts);le(this,Po);le(this,Io);ee(this,ft,e.queryCache||new Kw),ee(this,ks,e.mutationCache||new qw),ee(this,Cs,e.defaultOptions||{}),ee(this,So,new Map),ee(this,Ao,new Map),ee(this,Ts,0)}mount(){Ku(this,Ts)._++,N(this,Ts)===1&&(ee(this,Po,gd.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,ft).onFocus())})),ee(this,Io,_c.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,ft).onOnline())})))}unmount(){var e,t;Ku(this,Ts)._--,N(this,Ts)===0&&((e=N(this,Po))==null||e.call(this),ee(this,Po,void 0),(t=N(this,Io))==null||t.call(this),ee(this,Io,void 0))}isFetching(e){return N(this,ft).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return N(this,ks).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=N(this,ft).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=N(this,ft).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Xn(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return N(this,ft).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=N(this,ft).get(n.queryHash),a=s==null?void 0:s.state.data,o=Fw(t,a);if(o!==void 0)return N(this,ft).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return kt.batch(()=>N(this,ft).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=N(this,ft).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=N(this,ft);kt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=N(this,ft);return kt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=kt.batch(()=>N(this,ft).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(jt).catch(jt)}invalidateQueries(e,t={}){return kt.batch(()=>(N(this,ft).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=kt.batch(()=>N(this,ft).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let a=s.fetch(void 0,r);return r.throwOnError||(a=a.catch(jt)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(jt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=N(this,ft).build(this,t);return r.isStaleByTime(Xn(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(jt).catch(jt)}fetchInfiniteQuery(e){return e.behavior=jh(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(jt).catch(jt)}ensureInfiniteQueryData(e){return e.behavior=jh(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return _c.isOnline()?N(this,ks).resumePausedMutations():Promise.resolve()}getQueryCache(){return N(this,ft)}getMutationCache(){return N(this,ks)}getDefaultOptions(){return N(this,Cs)}setDefaultOptions(e){ee(this,Cs,e)}setQueryDefaults(e,t){N(this,So).set(Os(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...N(this,So).values()],r={};return t.forEach(n=>{Uo(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){N(this,Ao).set(Os(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...N(this,Ao).values()],r={};return t.forEach(n=>{Uo(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...N(this,Cs).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=md(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Dc&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...N(this,Cs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){N(this,ft).clear(),N(this,ks).clear()}},ft=new WeakMap,ks=new WeakMap,Cs=new WeakMap,So=new WeakMap,Ao=new WeakMap,Ts=new WeakMap,Po=new WeakMap,Io=new WeakMap,k5),qh=xt.createContext(void 0),Nc=e=>{const t=xt.useContext(qh);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Xw=({client:e,children:t})=>(xt.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),B.jsx(qh.Provider,{value:e,children:t})),Yh=xt.createContext(!1),Qw=()=>xt.useContext(Yh);Yh.Provider;function Jw(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var e3=xt.createContext(Jw()),t3=()=>xt.useContext(e3),r3=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},n3=e=>{xt.useEffect(()=>{e.clearReset()},[e])},s3=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||_h(r,[e.error,n])),a3=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},o3=(e,t)=>e.isLoading&&e.isFetching&&!t,i3=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Kh=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function c3(e,t,r){var d,f,m,y,g;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=Qw(),s=t3(),a=Nc(),o=a.defaultQueryOptions(e);(f=(d=a.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||f.call(d,o),process.env.NODE_ENV!=="production"&&(o.queryFn||console.error(`[${o.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),o._optimisticResults=n?"isRestoring":"optimistic",a3(o),r3(o,s),n3(s);const i=!a.getQueryCache().get(o.queryHash),[c]=xt.useState(()=>new t(a,o)),l=c.getOptimisticResult(o),u=!n&&e.subscribed!==!1;if(xt.useSyncExternalStore(xt.useCallback(E=>{const v=u?c.subscribe(kt.batchCalls(E)):jt;return c.updateResult(),v},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),xt.useEffect(()=>{c.setOptions(o)},[o,c]),i3(o,l))throw Kh(o,c,s);if(s3({result:l,errorResetBoundary:s,throwOnError:o.throwOnError,query:a.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw l.error;if((y=(m=a.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||y.call(m,o,l),o.experimental_prefetchInRender&&!Us&&o3(l,n)){const E=i?Kh(o,c,s):(g=a.getQueryCache().get(o.queryHash))==null?void 0:g.promise;E==null||E.catch(jt).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?l:c.trackResult(l)}function l3(e,t){return c3(e,$w)}function gn(e,t){const r=Nc(),[n]=xt.useState(()=>new Yw(r,e));xt.useEffect(()=>{n.setOptions(e)},[n,e]);const s=xt.useSyncExternalStore(xt.useCallback(o=>n.subscribe(kt.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),a=xt.useCallback((o,i)=>{n.mutate(o,i).catch(jt)},[n]);if(s.error&&_h(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}const u3=M.createContext(null),kd={didCatch:!1,error:null};class d3 extends M.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=kd}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var r,n,s=arguments.length,a=new Array(s),o=0;o<s;o++)a[o]=arguments[o];(r=(n=this.props).onReset)===null||r===void 0||r.call(n,{args:a,reason:"imperative-api"}),this.setState(kd)}}componentDidCatch(t,r){var n,s;(n=(s=this.props).onError)===null||n===void 0||n.call(s,t,r)}componentDidUpdate(t,r){const{didCatch:n}=this.state,{resetKeys:s}=this.props;if(n&&r.error!==null&&p3(t.resetKeys,s)){var a,o;(a=(o=this.props).onReset)===null||a===void 0||a.call(o,{next:s,prev:t.resetKeys,reason:"keys"}),this.setState(kd)}}render(){const{children:t,fallbackRender:r,FallbackComponent:n,fallback:s}=this.props,{didCatch:a,error:o}=this.state;let i=t;if(a){const c={error:o,resetErrorBoundary:this.resetErrorBoundary};if(typeof r=="function")i=r(c);else if(n)i=M.createElement(n,c);else if(s!==void 0)i=s;else throw o}return M.createElement(u3.Provider,{value:{didCatch:a,error:o,resetErrorBoundary:this.resetErrorBoundary}},i)}}function p3(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((r,n)=>!Object.is(r,t[n]))}const Zh=e=>{let t;const r=new Set,n=(l,u)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const f=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),r.forEach(m=>m(t,f))}},s=()=>t,i={setState:n,getState:s,getInitialState:()=>c,subscribe:l=>(r.add(l),()=>r.delete(l))},c=t=e(n,s,i);return i},f3=(e=>e?Zh(e):Zh),m3=e=>e;function h3(e,t=m3){const r=M.useSyncExternalStore(e.subscribe,M.useCallback(()=>t(e.getState()),[e,t]),M.useCallback(()=>t(e.getInitialState()),[e,t]));return M.useDebugValue(r),r}const Xh=e=>{const t=f3(e),r=n=>h3(t,n);return Object.assign(r,t),r},b3=(e=>e?Xh(e):Xh),Qh={disclaimerAccepted:!0,currentTime:Date.now(),swapExecution:{}},Z=b3((e,t)=>({state:Qh,updateState:r=>e(n=>({state:{...n.state,...r}})),updateSwapExecution:r=>e(n=>({state:{...n.state,swapExecution:{...n.state.swapExecution,...r}}})),resetState:()=>{e({state:{...Qh,currentTime:Date.now(),swapExecution:t().state.swapExecution,isMarketOrder:t().state.isMarketOrder}})}}));(function(){try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".orbs_OrbsLogo{object-fit:contain;display:inline}.orbs_PoweredBy{border-radius:8px;margin-left:auto;margin-right:auto}.orbs_PoweredBy a{display:flex;align-items:center;justify-content:center;text-decoration:none;color:inherit}.orbs_PoweredBy span{font-size:14px}.orbs_PoweredBy .orbs_OrbsLogo{margin-left:6px;margin-right:6px;width:18px;height:18px}.orbs_Text{margin:0;padding:0}.orbs_Spinner{width:var(--size, 38px);height:var(--size, 38px);border:var(--border-width, 3px) solid var(--border-color, white);border-bottom-color:var(--bottom-border-color, rgba(255, 255, 255, .2));border-radius:50%;display:inline-block;box-sizing:border-box;animation:orbs_rotation 1s linear infinite}@keyframes orbs_rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.orbs_TradeStepLayout{--layout-min-height: 220px;--layout-width: 100%;--layout-display: flex;--layout-direction: column;--layout-align: center;--layout-overflow: visible;display:var(--layout-display);flex-direction:var(--layout-direction);align-items:var(--layout-align);width:var(--layout-width);min-height:var(--layout-min-height);overflow:var(--layout-overflow)}.orbs_TradeStepLayoutBody{--body-gap: 20px;--body-margin-top: 30px;--body-width: 100%;--body-display: flex;--body-direction: column;--body-align: center;--body-overflow: visible;gap:var(--body-gap);align-items:var(--body-align);display:var(--body-display);flex-direction:var(--body-direction);width:var(--body-width);margin-top:var(--body-margin-top);overflow:var(--body-overflow)}.orbs_TradeStepLayoutHeader{--header-gap: 30px;--header-display: flex;--header-direction: column;--header-align: center;--header-justify: center;--header-overflow: visible;display:var(--header-display);flex-direction:var(--header-direction);align-items:var(--header-align);justify-content:var(--header-justify);gap:var(--header-gap);overflow:var(--header-overflow)}.orbs_TradeStepLayoutTitle{--title-font-size: 18px;--title-font-weight: 500;--title-line-height: normal;--title-color: inherit;--title-text-align: center;--title-margin: 0;--title-padding: 0;font-size:var(--title-font-size);font-weight:var(--title-font-weight);line-height:var(--title-line-height);color:var(--title-color);text-align:var(--title-text-align);margin:var(--title-margin);padding:var(--title-padding)}.orbs_StepIndicator{--indicator-display: flex;--indicator-align: center;--indicator-justify: flex-start;--indicator-height: 7px;--indicator-width: 120px;--indicator-border-radius: 999px;--indicator-bg-color: white;--indicator-margin-bottom: 20px;--indicator-position: relative;--indicator-overflow: hidden;--indicator-border: none;--indicator-box-shadow: none;display:var(--indicator-display);align-items:var(--indicator-align);justify-content:var(--indicator-justify);height:var(--indicator-height);width:var(--indicator-width);border-radius:var(--indicator-border-radius);overflow:var(--indicator-overflow);background-color:var(--indicator-bg-color);margin-bottom:var(--indicator-margin-bottom);position:var(--indicator-position);border:var(--indicator-border);box-shadow:var(--indicator-box-shadow)}.orbs_StepIndicatorLine{--line-height: 100%;--line-bg-color: black;--line-position: absolute;--line-top: 0;--line-left: 0;--line-right: 0;--line-bottom: 0;--line-transition: all .3s ease;--line-border-radius: inherit;--line-box-shadow: none;height:var(--line-height);background-color:var(--line-bg-color);position:var(--line-position);top:var(--line-top);left:var(--line-left);right:var(--line-right);bottom:var(--line-bottom);transition:var(--line-transition);border-radius:var(--line-border-radius);box-shadow:var(--line-box-shadow)}.orbs_TradeStepLayoutFooter{--footer-display: flex;--footer-align: center;--footer-justify: center;--footer-direction: column;--footer-margin-top: auto;--footer-padding-top: 30px;--footer-width: 100%;--footer-overflow: visible;--footer-border-top: none;display:var(--footer-display);align-items:var(--footer-align);justify-content:var(--footer-justify);flex-direction:var(--footer-direction);margin-top:var(--footer-margin-top);padding-top:var(--footer-padding-top);width:var(--footer-width);overflow:var(--footer-overflow);border-top:var(--footer-border-top)}.orbs_TradeStepLayoutFooter p{--footer-text-font-size: 15px;--footer-text-line-height: normal;--footer-text-color: inherit;--footer-text-margin: 0;--footer-text-padding: 0;font-size:var(--footer-text-font-size);line-height:var(--footer-text-line-height);color:var(--footer-text-color);margin:var(--footer-text-margin);padding:var(--footer-text-padding)}.orbs_TradeStepLayoutFooterLink{--link-color: inherit;--link-text-decoration: none;--link-font-size: 15px;--link-text-align: center;--link-margin: auto;--link-outline: none;--link-line-height: normal;--link-padding: 0;--link-transition: color .2s ease;--link-hover-color: inherit;--link-hover-text-decoration: underline;color:var(--link-color);text-decoration:var(--link-text-decoration);font-size:var(--link-font-size);text-align:var(--link-text-align);margin-left:var(--link-margin);margin-right:var(--link-margin);outline:var(--link-outline);line-height:var(--link-line-height);padding:var(--link-padding);transition:var(--link-transition)}.orbs_TradeStepLayoutFooterLink:hover{color:var(--link-hover-color);text-decoration:var(--link-hover-text-decoration)}.orbs_TradeStepLayoutSuccessIcon{--success-icon-display: flex;--success-icon-justify: center;--success-icon-align: center;--success-icon-width: 60px;--success-icon-height: 60px;--success-icon-border-radius: 50%;--success-icon-overflow: visible;--success-icon-bg-color: transparent;--success-icon-border: none;--success-icon-box-shadow: none;display:var(--success-icon-display);justify-content:var(--success-icon-justify);align-items:var(--success-icon-align);width:var(--success-icon-width);height:var(--success-icon-height);border-radius:var(--success-icon-border-radius);overflow:var(--success-icon-overflow);background-color:var(--success-icon-bg-color);border:var(--success-icon-border);box-shadow:var(--success-icon-box-shadow)}.orbs_TradeStepLayoutErrorIcon{--error-icon-width: 80px;--error-icon-height: 80px;--error-icon-display: flex;--error-icon-justify: center;--error-icon-align: center;--error-icon-overflow: visible;--error-icon-bg-color: transparent;--error-icon-border: none;--error-icon-box-shadow: none;width:var(--error-icon-width);height:var(--error-icon-height);display:var(--error-icon-display);justify-content:var(--error-icon-justify);align-items:var(--error-icon-align);overflow:var(--error-icon-overflow);background-color:var(--error-icon-bg-color);border:var(--error-icon-border);box-shadow:var(--error-icon-box-shadow)}.orbs_FailedContentMsg{font-size:22px;font-weight:500}.orbs_TradePreview{display:flex;align-items:center;justify-content:center;gap:8px;width:100%}.orbs_TradePreviewToken{display:flex;align-items:center;gap:6px;max-width:calc(50% - 30px)}.orbs_TradePreviewToken p{--token-font-size: 15px;--token-white-space: nowrap;--token-overflow: hidden;--token-text-overflow: ellipsis;--token-flex: 1;--token-margin: 0;--token-padding: 0;font-size:var(--token-font-size);white-space:var(--token-white-space);overflow:var(--token-overflow);text-overflow:var(--token-text-overflow);flex:var(--token-flex);margin:var(--token-margin)}.orbs_TradepPreviewIcon{width:22px;height:22px}.orbs_TradepPreviewLogo{width:24px;height:24px;border-radius:50%;overflow:hidden}.orbs_FlexRow{display:flex;flex-direction:row}.orbs_FlexColumn{display:flex;flex-direction:column}@keyframes orbs_skeletonAnimation{0%{opacity:.2}to{opacity:.4}}.orbs_SkeletonLoader{animation:orbs_skeletonAnimation 1s linear infinite alternate;background-color:#fff}.orbs_Main-wrapper{width:100%}.orbs_Main{width:100%;display:flex;flex-direction:column;gap:28px}.orbs_MainToken{display:flex;flex-direction:row;align-items:center;justify-content:space-between;width:100%;gap:8px}.orbs_MainTokenLeft{display:flex;flex-direction:column;align-items:flex-start;gap:8px}.orbs_MainTokenUsd{display:flex;align-items:center;gap:5px}.orbs_MainTokenUsd small{font-size:12px;opacity:.6}.orbs_MainContentLoader{width:100%;display:flex;gap:15px;align-items:center;margin-top:20px}.orbs_MainContentRectengularLoader{flex:1;height:20px;max-width:250px;border-radius:20px}.orbs_MainContentCircleLoader{width:30px;height:30px;border-radius:50%}.orbs_MainTokenLogo{--width: 40px;--height: 40px;width:var(--width);height:var(--height)}.orbs_MainTokenLogo img{width:100%;height:100%;object-fit:cover}.orbs_SwapFlow{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%}.orbs_SwapFlow *{box-sizing:border-box}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();const Ne=e=>`orbs_${e}`;function Oo({children:e,className:t=""}){return B.jsx("p",{className:`${t} ${Ne("Text")}`,children:e})}const Jh=M.createContext({});function y3({children:e,...t}){return B.jsx(Jh.Provider,{value:t,children:e})}const Zr=()=>M.useContext(Jh);var mt=(e=>(e[e.LOADING=1]="LOADING",e[e.SUCCESS=2]="SUCCESS",e[e.FAILED=3]="FAILED",e))(mt||{});const g3=({className:e="",size:t=38,borderWidth:r=3,borderColor:n="white",bottomBorderColor:s="rgba(255, 255, 255, 0.2)"})=>{const a={"--size":`${t}px`,"--border-width":`${r}px`,"--border-color":n,"--bottom-border-color":s};return B.jsx("div",{className:`${Ne("Spinner")} ${e}`,style:a})};function Lc({className:e="",body:t,footerLink:r,footerText:n,title:s,children:a}){return B.jsxs("div",{className:`${Ne("TradeStepLayout")} ${e}`,children:[B.jsxs("div",{className:Ne("TradeStepLayoutHeader"),children:[B.jsx(k3,{}),s&&B.jsx(Oo,{className:Ne("TradeStepLayoutTitle"),children:s})]}),t&&B.jsx("div",{className:Ne("TradeStepLayoutBody"),children:t}),B.jsx(x3,{link:r,text:n}),a]})}const x3=({link:e,text:t})=>{const{swapStatus:r}=Zr();return!e&&!t?null:B.jsxs("div",{className:Ne("TradeStepLayoutFooter"),children:[B.jsx(T3,{}),e?B.jsx(w3,{link:e,text:t}):r===mt.FAILED?void 0:B.jsx(Oo,{children:t})]})},w3=({link:e,text:t})=>B.jsx("a",{target:"_blank",className:Ne("TradeStepLayoutFooterLink"),href:e,children:t});function v3(){const{components:e}=Zr();return e.SuccessIcon?e.SuccessIcon:B.jsxs("svg",{fill:"none",viewBox:"0 0 16 16",className:Ne("TradeStepLayoutSuccessIcon"),children:[B.jsx("circle",{cx:"8",cy:"8",r:"7",strokeWidth:"1.5",stroke:"#00C853"}),B.jsx("path",{strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",stroke:"#00C853",d:"M5 8l2 2 4-4"})]})}function E3(){const{components:e}=Zr();return e.FailedIcon?e.FailedIcon:B.jsxs("svg",{className:Ne("TradeStepLayoutErrorIcon"),viewBox:"0 0 16 16",fill:"none",children:[B.jsx("circle",{cx:"8",cy:"8",r:"7",strokeWidth:"1.5",stroke:"#FF3D00"}),B.jsx("path",{strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",stroke:"#FF3D00",d:"M8 4v5M8 11h.01"})]})}const k3=()=>{const{swapStatus:e}=Zr();return e===mt.SUCCESS?B.jsx(v3,{}):e===mt.FAILED?B.jsx(E3,{}):B.jsx(C3,{})},C3=()=>{const{components:e}=Zr();return e.Loader?e.Loader:B.jsx(g3,{size:60,borderWidth:5,className:Ne("TradeStepLayoutSpinner")})},T3=()=>{const{totalSteps:e,currentStepIndex:t=0,swapStatus:r}=Zr();return r!==mt.LOADING||e===1?null:B.jsx("div",{className:Ne("StepIndicator"),children:B.jsx("div",{style:{width:`${100/(e||0)}%`,left:`${t*100/(e||0)}%`},className:Ne("StepIndicatorLine")})})},S3=({error:e,footerLink:t,footerText:r})=>B.jsx(Lc,{footerLink:t,footerText:r,body:e||B.jsx("p",{className:Ne("FailedContentMsg"),children:"Something went wrong"}),className:Ne("FailedContent")});function A3(){return B.jsx("svg",{fill:"currentColor",viewBox:"0 0 16 16",className:Ne("TradepPreviewIcon"),children:B.jsx("path",{fillRule:"evenodd",d:"M4 8a.5.5 0 01.5-.5h5.793L8.146 5.354a.5.5 0 11.708-.708l3 3a.5.5 0 010 .708l-3 3a.5.5 0 01-.708-.708L10.293 8.5H4.5A.5.5 0 014 8z"})})}const e1=({inTokenOnly:e})=>{const{inToken:t,outToken:r,inAmount:n,outAmount:s,components:a}=Zr();return B.jsxs("div",{className:Ne("TradePreview"),children:[B.jsx(t1,{token:t,amount:n,Logo:a==null?void 0:a.SrcTokenLogo}),!e&&B.jsxs(B.Fragment,{children:[B.jsx(A3,{}),B.jsx(t1,{token:r,amount:s,Logo:a==null?void 0:a.DstTokenLogo})]})]})},t1=({token:e,amount:t,Logo:r})=>B.jsxs("div",{className:Ne("TradePreviewToken"),children:[r||B.jsx("img",{src:e==null?void 0:e.logoUrl,className:Ne("TradepPreviewLogo"),alt:`${e==null?void 0:e.symbol} logo`}),B.jsxs(Oo,{children:[t," ",e==null?void 0:e.symbol]})]});function P3({title:e,footerLink:t,footerText:r,hideTokens:n}){return B.jsx(Lc,{title:e,className:Ne("Success"),body:!n&&B.jsx(e1,{}),footerLink:t,footerText:r})}const r1=({$gap:e=10,$alignItems:t="flex-start",children:r,className:n="",customStyles:s={}})=>{const a={gap:`${e}px`,alignItems:t,width:"100%",...s};return B.jsx("div",{className:`${Ne("FlexColumn")} ${n}`,style:a,children:r})};function n1({styles:e={},className:t=""}){return B.jsx("div",{style:e,className:`${Ne("SkeletonLoader")} ${t}`})}const I3=()=>B.jsxs("div",{className:`${Ne("MainContentLoader")}`,children:[B.jsx(n1,{className:`${Ne("MainContentCircleLoader")}`}),B.jsx(n1,{className:`${Ne("MainContentRectengularLoader")}`})]}),B3=({fromTitle:e,toTitle:t,inUsd:r,outUsd:n})=>{const{swapStatus:s,outAmount:a,inAmount:o,inToken:i,outToken:c,components:l,totalSteps:u}=Zr(),d=B.jsx(a1,{fromTitle:e,inUsd:r,inToken:i,toTitle:t,outUsd:n,outToken:c,inAmount:o,outAmount:a,SrcTokenLogo:l.SrcTokenLogo,DstTokenLogo:l.DstTokenLogo});return s?u?B.jsx(F3,{}):B.jsxs(r1,{children:[d,B.jsx(I3,{})]}):B.jsx(r1,{children:d})},s1=({amount:e,token:t,usd:r,title:n,Logo:s})=>B.jsxs("div",{className:`${Ne("MainToken")}`,children:[B.jsxs("div",{className:`${Ne("MainTokenLeft")}`,children:[B.jsx(Oo,{className:`${Ne("MainTokenTitle")}`,children:n}),B.jsx(Oo,{className:` ${Ne("MainTokenAmount")}`,children:`${e&&Number(e)>0?e:""} ${(t==null?void 0:t.symbol)||""}`}),r&&B.jsx("div",{className:` ${Ne("MainTokenUsd")}`,children:r})]}),s||B.jsx("div",{className:` ${Ne("MainTokenLogo")}`,children:t!=null&&t.logoUrl?B.jsx("img",{src:t==null?void 0:t.logoUrl,alt:"Token logo"}):null})]});function F3(){const{currentStep:e}=Zr();return e?B.jsx(Lc,{footerLink:e.footerLink,footerText:e.footerText,title:e.title,body:e.hideTokens?void 0:B.jsx(e1,{inTokenOnly:e==null?void 0:e.inTokenOnly})}):null}const a1=({fromTitle:e,inUsd:t,inToken:r,toTitle:n,outUsd:s,outToken:a,inAmount:o,outAmount:i,SrcTokenLogo:c,DstTokenLogo:l})=>B.jsxs("div",{className:`${Ne("Main")}`,children:[B.jsx(s1,{title:e||"Swap from",usd:t,token:r,amount:o,Logo:c}),B.jsx(s1,{title:n||"Swap to",usd:s,token:a,amount:i,Logo:l})]}),Qn=e=>B.jsx(y3,{...e,children:B.jsx(U3,{})}),U3=()=>{const{swapStatus:e,components:t,className:r}=Zr();return B.jsx("div",{className:`${Ne("SwapFlow")} ${r}`,children:e===mt.SUCCESS?t==null?void 0:t.Success:e===mt.FAILED?t==null?void 0:t.Failed:t==null?void 0:t.Main})};Qn.Success=P3,Qn.Failed=S3,Qn.Main=B3,Qn.StepLayout=Lc;var Mt=(e=>(e[e.EMPTY_LIMIT_PRICE=0]="EMPTY_LIMIT_PRICE",e[e.MAX_CHUNKS=1]="MAX_CHUNKS",e[e.MIN_CHUNKS=2]="MIN_CHUNKS",e[e.MIN_TRADE_SIZE=3]="MIN_TRADE_SIZE",e[e.MAX_FILL_DELAY=4]="MAX_FILL_DELAY",e[e.MIN_FILL_DELAY=5]="MIN_FILL_DELAY",e[e.MAX_ORDER_DURATION=6]="MAX_ORDER_DURATION",e[e.MIN_ORDER_DURATION=7]="MIN_ORDER_DURATION",e[e.MISSING_LIMIT_PRICE=8]="MISSING_LIMIT_PRICE",e[e.STOP_LOSS_TRIGGER_PRICE_GREATER_THAN_MARKET_PRICE=9]="STOP_LOSS_TRIGGER_PRICE_GREATER_THAN_MARKET_PRICE",e[e.TRIGGER_LIMIT_PRICE_GREATER_THAN_TRIGGER_PRICE=10]="TRIGGER_LIMIT_PRICE_GREATER_THAN_TRIGGER_PRICE",e[e.TAKE_PROFIT_TRIGGER_PRICE_LESS_THAN_MARKET_PRICE=11]="TAKE_PROFIT_TRIGGER_PRICE_LESS_THAN_MARKET_PRICE",e[e.EMPTY_TRIGGER_PRICE=12]="EMPTY_TRIGGER_PRICE",e[e.INSUFFICIENT_BALANCE=13]="INSUFFICIENT_BALANCE",e[e.MAX_ORDER_SIZE=14]="MAX_ORDER_SIZE",e))(Mt||{}),Ds=(e=>(e.WRAP="wrap",e.APPROVE="approve",e.CREATE="create",e))(Ds||{});const O3=e=>e.replace(/,/g,""),D3=async e=>{if(!(navigator!=null&&navigator.clipboard))return console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(e),!0}catch(t){return console.warn("Copy failed",t),!1}},o1=e=>{if(!e)return"";const t=Math.floor(e/1e3),r=Math.floor(t/(1440*60)),n=Math.floor(t%(1440*60)/3600),s=Math.floor(t%3600/60),a=t%60,o=[];return r&&o.push(`${r} days `),n&&o.push(`${n} hours `),s&&o.push(`${s} minutes`),a&&o.push(`${a} seconds`),o.join(" ")},Cd=(e,t)=>e?`${e.substring(0,(t==null?void 0:t.start)||6)}...${e.substring(e.length-((t==null?void 0:t.end)||5))}`:"",_3=e=>{const t="An error occurred.";if(!e||!e.message)return t;try{return e.message.toLowerCase().indexOf("rejected")?"Transaction Rejected":t}catch{return t}};function Do(e,t=6,r=8){if(!e)return"";const n=e.startsWith("-")?"-":"",s=n?e.slice(1):e,[a,o=""]=s.split(".");if(!o||Number(o)===0)return n+a;if(a!=="0"){const f=o.slice(0,t).replace(/0+$/,""),m=f?"."+f:"";return n+a+m}const i=o.search(/[^0]/);if(i===-1||i+1>r)return"0";const c=o.slice(0,i),u=o.slice(i).slice(0,t).replace(/0+$/,"");return u?n+"0."+c+u:"0"}const Td=e=>{var t,r,n,s;if(e!=null&&e.message)return((r=(t=e.message)==null?void 0:t.toLowerCase())==null?void 0:r.includes("rejected"))||((s=(n=e.message)==null?void 0:n.toLowerCase())==null?void 0:s.includes("denied"))},M3=e=>{switch(e){case Ft.base.id:return 1e-4;default:return .01}},i1=(e,t,r)=>{if(!j(e.srcAmountFilled||0).gt(0)||!j(e.dstAmountFilled||0).gt(0))return"";const n=bn(t,e.srcAmountFilled),s=bn(r,e.dstAmountFilled);return j(s).div(n).toFixed()},c1=(e,t,r)=>{if(e.type===ut.TWAP_MARKET)return"";const n=bn(t,e.srcAmountPerTrade),s=bn(r,e.dstMinAmountPerTrade);return j(s).div(n).toFixed()},l1=(e,t)=>{const r=Bs(t);return r&&Is(e.address)?r.wToken:e};function u1(e){return e?e/864e5:0}function Sd(e){return e?e/6e4:0}const N3=(e,t)=>e?ut.TWAP_MARKET:t===1?ut.LIMIT:ut.TWAP_LIMIT,Ad=(e,t,r)=>{const n=Bs(r);return Is((e==null?void 0:e.address)||"")&&Ps((t==null?void 0:t.address)||"",(n==null?void 0:n.wToken.address)||"")},Pd=(e,t,r)=>{const n=Bs(r);return Ps((e==null?void 0:e.address)||"",(n==null?void 0:n.wToken.address)||"")&&Is((t==null?void 0:t.address)||"")},_o=(e,t)=>{if(!t)return"";const r=Bs(t);return`${r==null?void 0:r.explorer}/tx/${e}`};function p(e){const t={formatters:void 0,fees:void 0,serializers:void 0,...e};function r(n){return s=>{const a=typeof s=="function"?s(n):s,o={...n,...a};return Object.assign(o,{extend:r(o)})}}return Object.assign(t,{extend:r(t)})}function L3(){return{}}const z3=p({id:16600,name:"0G Newton Testnet",nativeCurrency:{name:"A0GI",symbol:"A0GI",decimals:18},rpcUrls:{default:{http:["https://evmrpc-testnet.0g.ai"]}},blockExplorers:{default:{name:"0G BlockChain Explorer",url:"https://chainscan-newton.0g.ai"}},testnet:!0}),R3=p({id:16601,name:"0G Galileo Testnet",nativeCurrency:{name:"A0GI",symbol:"A0GI",decimals:18},rpcUrls:{default:{http:["https://evmrpc-testnet.0g.ai"]}},blockExplorers:{default:{name:"0G BlockChain Explorer",url:"https://chainscan-galileo.0g.ai"}},testnet:!0}),H3=p({id:16661,name:"0G Mainnet",nativeCurrency:{name:"0G",symbol:"0G",decimals:18},rpcUrls:{default:{http:["https://evmrpc.0g.ai"]}},blockExplorers:{default:{name:"0G BlockChain Explorer",url:"https://chainscan.0g.ai"}},testnet:!1}),$3=p({id:16602,name:"0G Galileo Testnet",nativeCurrency:{name:"A0GI",symbol:"A0GI",decimals:18},rpcUrls:{default:{http:["https://evmrpc-testnet.0g.ai"]}},blockExplorers:{default:{name:"0G BlockChain Explorer",url:"https://chainscan-galileo.0g.ai"}},testnet:!0}),G3=p({id:995,name:"5ireChain",nativeCurrency:{name:"5ire Token",symbol:"5IRE",decimals:18},rpcUrls:{default:{http:["https://rpc.5ire.network"]}},blockExplorers:{default:{name:"5ireChain Mainnet Explorer",url:"https://5irescan.io/"}},testnet:!1}),j3=p({id:179,name:"ABEY Mainnet",nativeCurrency:{name:"ABEY",symbol:"ABEY",decimals:18},rpcUrls:{default:{http:["https://rpc.abeychain.com"]}},blockExplorers:{default:{name:"Abey Scan",url:"https://abeyscan.com"}},testnet:!1}),d1="2.43.3";let Mo={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${d1}`},$=class Bm extends Error{constructor(t,r={}){var i;const n=(()=>{var c;return r.cause instanceof Bm?r.cause.details:(c=r.cause)!=null&&c.message?r.cause.message:r.details})(),s=r.cause instanceof Bm&&r.cause.docsPath||r.docsPath,a=(i=Mo.getDocsUrl)==null?void 0:i.call(Mo,{...r,docsPath:s}),o=[t||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...n?[`Details: ${n}`]:[],...Mo.version?[`Version: ${Mo.version}`]:[]].join(`
|
|
65
65
|
`);super(o,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=s,this.metaMessages=r.metaMessages,this.name=r.name??this.name,this.shortMessage=t,this.version=d1}walk(t){return p1(this,t)}};function p1(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?p1(e.cause,t):t?null:e}let f1=class extends ${constructor({max:t,min:r,signed:n,size:s,value:a}){super(`Number "${a}" is not in safe ${s?`${s*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${t?`(${r} to ${t})`:`(above ${r})`}`,{name:"IntegerOutOfRangeError"})}},V3=class extends ${constructor(t){super(`Bytes value "${t}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}};class W3 extends ${constructor(t){super(`Hex value "${t}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}let q3=class extends ${constructor({givenSize:t,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}};function Or(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function ct(e){return Or(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function Zt(e,{dir:t="left"}={}){let r=typeof e=="string"?e.replace("0x",""):e,n=0;for(let s=0;s<r.length-1&&r[t==="left"?s:r.length-s-1].toString()==="0";s++)n++;return r=t==="left"?r.slice(n):r.slice(0,r.length-n),typeof e=="string"?(r.length===1&&t==="right"&&(r=`${r}0`),`0x${r.length%2===1?`0${r}`:r}`):r}let m1=class extends ${constructor({offset:t,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${n}).`,{name:"SliceOffsetOutOfBoundsError"})}},h1=class extends ${constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${t}) exceeds padding size (${r}).`,{name:"SizeExceedsPaddingSizeError"})}};class b1 extends ${constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} is expected to be ${r} ${n} long, but is ${t} ${n} long.`,{name:"InvalidBytesLengthError"})}}function _s(e,{dir:t,size:r=32}={}){return typeof e=="string"?Jn(e,{dir:t,size:r}):Y3(e,{dir:t,size:r})}function Jn(e,{dir:t,size:r=32}={}){if(r===null)return e;const n=e.replace("0x","");if(n.length>r*2)throw new h1({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n[t==="right"?"padEnd":"padStart"](r*2,"0")}`}function Y3(e,{dir:t,size:r=32}={}){if(r===null)return e;if(e.length>r)throw new h1({size:e.length,targetSize:r,type:"bytes"});const n=new Uint8Array(r);for(let s=0;s<r;s++){const a=t==="right";n[a?s:r-s-1]=e[a?s:e.length-s-1]}return n}const K3=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Fe(e,t={}){return typeof e=="number"||typeof e=="bigint"?q(e,t):typeof e=="string"?Sa(e,t):typeof e=="boolean"?y1(e,t):vt(e,t)}function y1(e,t={}){const r=`0x${Number(e)}`;return typeof t.size=="number"?(Dr(r,{size:t.size}),_s(r,{size:t.size})):r}function vt(e,t={}){let r="";for(let s=0;s<e.length;s++)r+=K3[e[s]];const n=`0x${r}`;return typeof t.size=="number"?(Dr(n,{size:t.size}),_s(n,{dir:"right",size:t.size})):n}function q(e,t={}){const{signed:r,size:n}=t,s=BigInt(e);let a;n?r?a=(1n<<BigInt(n)*8n-1n)-1n:a=2n**(BigInt(n)*8n)-1n:typeof e=="number"&&(a=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof a=="bigint"&&r?-a-1n:0;if(a&&s>a||s<o){const c=typeof e=="bigint"?"n":"";throw new f1({max:a?`${a}${c}`:void 0,min:`${o}${c}`,signed:r,size:n,value:`${e}${c}`})}const i=`0x${(r&&s<0?(1n<<BigInt(n*8))+BigInt(s):s).toString(16)}`;return n?_s(i,{size:n}):i}const Z3=new TextEncoder;function Sa(e,t={}){const r=Z3.encode(e);return vt(r,t)}const X3=new TextEncoder;function xn(e,t={}){return typeof e=="number"||typeof e=="bigint"?J3(e,t):typeof e=="boolean"?Q3(e,t):Or(e)?or(e,t):Ms(e,t)}function Q3(e,t={}){const r=new Uint8Array(1);return r[0]=Number(e),typeof t.size=="number"?(Dr(r,{size:t.size}),_s(r,{size:t.size})):r}const wn={zero:48,nine:57,A:65,F:70,a:97,f:102};function g1(e){if(e>=wn.zero&&e<=wn.nine)return e-wn.zero;if(e>=wn.A&&e<=wn.F)return e-(wn.A-10);if(e>=wn.a&&e<=wn.f)return e-(wn.a-10)}function or(e,t={}){let r=e;t.size&&(Dr(r,{size:t.size}),r=_s(r,{dir:"right",size:t.size}));let n=r.slice(2);n.length%2&&(n=`0${n}`);const s=n.length/2,a=new Uint8Array(s);for(let o=0,i=0;o<s;o++){const c=g1(n.charCodeAt(i++)),l=g1(n.charCodeAt(i++));if(c===void 0||l===void 0)throw new $(`Invalid byte sequence ("${n[i-2]}${n[i-1]}" in "${n}").`);a[o]=c*16+l}return a}function J3(e,t){const r=q(e,t);return or(r)}function Ms(e,t={}){const r=X3.encode(e);return typeof t.size=="number"?(Dr(r,{size:t.size}),_s(r,{dir:"right",size:t.size})):r}function Dr(e,{size:t}){if(ct(e)>t)throw new q3({givenSize:ct(e),maxSize:t})}function Le(e,t={}){const{signed:r}=t;t.size&&Dr(e,{size:t.size});const n=BigInt(e);if(!r)return n;const s=(e.length-2)/2,a=(1n<<BigInt(s)*8n-1n)-1n;return n<=a?n:n-BigInt(`0x${"f".padStart(s*2,"f")}`)-1n}function e8(e,t={}){let r=e;if(t.size&&(Dr(r,{size:t.size}),r=Zt(r)),Zt(r)==="0x00")return!1;if(Zt(r)==="0x01")return!0;throw new W3(r)}function ir(e,t={}){return Number(Le(e,t))}function zc(e,t){return({exclude:r,format:n})=>({exclude:r,format:(s,a)=>{const o=t(s,a);if(r)for(const i of r)delete o[i];return{...o,...n(s,a)}},type:e})}const x1={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function Ns(e,t){const r={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?ir(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?ir(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?x1[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(r.authorizationList=t8(e.authorizationList)),r.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof r.v=="bigint"){if(r.v===0n||r.v===27n)return 0;if(r.v===1n||r.v===28n)return 1;if(r.v>=35n)return r.v%2n===0n?1:0}})(),r.type==="legacy"&&(delete r.accessList,delete r.maxFeePerBlobGas,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas,delete r.yParity),r.type==="eip2930"&&(delete r.maxFeePerBlobGas,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas),r.type==="eip1559"&&delete r.maxFeePerBlobGas,r}const Rc=zc("transaction",Ns);function t8(e){return e.map(t=>({address:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}function Id(e,t){const r=(e.transactions??[]).map(n=>typeof n=="string"?n:Ns(n));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:r,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const Bd=zc("block",Id);function Xr(e,{args:t,eventName:r}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,blockTimestamp:e.blockTimestamp?BigInt(e.blockTimestamp):e.blockTimestamp===null?null:void 0,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...r?{args:t,eventName:r}:{}}}const w1={"0x0":"reverted","0x1":"success"};function Hc(e,t){const r={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(n=>Xr(n)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?ir(e.transactionIndex):null,status:e.status?w1[e.status]:null,type:e.type?x1[e.type]||e.type:null};return e.blobGasPrice&&(r.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(r.blobGasUsed=BigInt(e.blobGasUsed)),r}const Fd=zc("transactionReceipt",Hc),r8={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function _r(e,t){const r={};return typeof e.authorizationList<"u"&&(r.authorizationList=n8(e.authorizationList)),typeof e.accessList<"u"&&(r.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(r.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?r.blobs=e.blobs.map(n=>vt(n)):r.blobs=e.blobs),typeof e.data<"u"&&(r.data=e.data),e.account&&(r.from=e.account.address),typeof e.from<"u"&&(r.from=e.from),typeof e.gas<"u"&&(r.gas=q(e.gas)),typeof e.gasPrice<"u"&&(r.gasPrice=q(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(r.maxFeePerBlobGas=q(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(r.maxFeePerGas=q(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(r.maxPriorityFeePerGas=q(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(r.nonce=q(e.nonce)),typeof e.to<"u"&&(r.to=e.to),typeof e.type<"u"&&(r.type=r8[e.type]),typeof e.value<"u"&&(r.value=q(e.value)),r}const Ud=zc("transactionRequest",_r);function n8(e){return e.map(t=>({address:t.address,r:t.r?q(BigInt(t.r)):t.r,s:t.s?q(BigInt(t.s)):t.s,chainId:q(t.chainId),nonce:q(t.nonce),...typeof t.yParity<"u"?{yParity:q(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:q(t.v)}:{}}))}const s8=2n**16n-1n,Ls=2n**256n-1n,Od=50000n,v1=s8*32n,E1={block:Bd({format(e){var r;const t=(r=e.transactions)==null?void 0:r.map(n=>{var a;if(typeof n=="string")return n;const s=(a=E1.transaction)==null?void 0:a.format(n);return s.typeHex==="0x71"?s.type="eip712":s.typeHex==="0xff"&&(s.type="priority"),s});return{l1BatchNumber:e.l1BatchNumber?Le(e.l1BatchNumber):null,l1BatchTimestamp:e.l1BatchTimestamp?Le(e.l1BatchTimestamp):null,transactions:t}}}),transaction:Rc({format(e){const t={};return e.type==="0x71"?t.type="eip712":e.type==="0xff"&&(t.type="priority"),{...t,l1BatchNumber:e.l1BatchNumber?Le(e.l1BatchNumber):null,l1BatchTxIndex:e.l1BatchTxIndex?Le(e.l1BatchTxIndex):null}}}),transactionReceipt:Fd({format(e){return{l1BatchNumber:e.l1BatchNumber?Le(e.l1BatchNumber):null,l1BatchTxIndex:e.l1BatchTxIndex?Le(e.l1BatchTxIndex):null,logs:e.logs.map(t=>({...Xr(t),l1BatchNumber:t.l1BatchNumber?Le(t.l1BatchNumber):null,transactionLogIndex:ir(t.transactionLogIndex),logType:t.logType})),l2ToL1Logs:e.l2ToL1Logs.map(t=>({blockNumber:Le(t.blockHash),blockHash:t.blockHash,l1BatchNumber:t.l1BatchNumber?Le(t.l1BatchNumber):null,transactionIndex:Le(t.transactionIndex),shardId:Le(t.shardId),isService:t.isService,sender:t.sender,key:t.key,value:t.value,transactionHash:t.transactionHash,logIndex:Le(t.logIndex)}))}}}),transactionRequest:Ud({exclude:["customSignature","factoryDeps","gasPerPubdata","paymaster","paymasterInput"],format(e){return e.gasPerPubdata||e.paymaster&&e.paymasterInput||e.factoryDeps||e.customSignature?{eip712Meta:{...e.gasPerPubdata?{gasPerPubdata:Fe(e.gasPerPubdata)}:{gasPerPubdata:Fe(Od)},...e.paymaster&&e.paymasterInput?{paymasterParams:{paymaster:e.paymaster,paymasterInput:Array.from(or(e.paymasterInput))}}:{},...e.factoryDeps?{factoryDeps:e.factoryDeps.map(t=>Array.from(or(t)))}:{},...e.customSignature?{customSignature:Array.from(or(e.customSignature))}:{}},type:"0x71"}:{}}})};function cr(e){return typeof e[0]=="string"?lr(e):a8(e)}function a8(e){let t=0;for(const s of e)t+=s.length;const r=new Uint8Array(t);let n=0;for(const s of e)r.set(s,n),n+=s.length;return r}function lr(e){return`0x${e.reduce((t,r)=>t+r.replace("0x",""),"")}`}let k1=class extends ${constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}},C1=class extends ${constructor({length:t,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}},o8=class extends ${constructor({count:t,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}};const i8={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new o8({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new C1({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new k1({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new k1({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const r=t??this.position;return this.assertPosition(r+e-1),this.bytes.subarray(r,r+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const r=this.inspectBytes(e);return this.position+=t??e,r},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function Dd(e,{recursiveReadLimit:t=8192}={}){const r=Object.create(i8);return r.bytes=e,r.dataView=new DataView(e.buffer??e,e.byteOffset,e.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=t,r}function Qr(e,t="hex"){const r=T1(e),n=Dd(new Uint8Array(r.length));return r.encode(n),t==="hex"?vt(n.bytes):n.bytes}function T1(e){return Array.isArray(e)?c8(e.map(t=>T1(t))):l8(e)}function c8(e){const t=e.reduce((s,a)=>s+a.length,0),r=S1(t);return{length:t<=55?1+t:1+r+t,encode(s){t<=55?s.pushByte(192+t):(s.pushByte(247+r),r===1?s.pushUint8(t):r===2?s.pushUint16(t):r===3?s.pushUint24(t):s.pushUint32(t));for(const{encode:a}of e)a(s)}}}function l8(e){const t=typeof e=="string"?or(e):e,r=S1(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+r+t.length,encode(s){t.length===1&&t[0]<128?s.pushBytes(t):t.length<=55?(s.pushByte(128+t.length),s.pushBytes(t)):(s.pushByte(183+r),r===1?s.pushUint8(t.length):r===2?s.pushUint16(t.length):r===3?s.pushUint24(t.length):s.pushUint32(t.length),s.pushBytes(t))}}}function S1(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new $("Length is too large.")}const u8={gwei:9,wei:18},d8={ether:-9,wei:9};function A1(e,t){let r=e.toString();const n=r.startsWith("-");n&&(r=r.slice(1)),r=r.padStart(t,"0");let[s,a]=[r.slice(0,r.length-t),r.slice(r.length-t)];return a=a.replace(/(0+)$/,""),`${n?"-":""}${s||"0"}${a?`.${a}`:""}`}function _d(e,t="wei"){return A1(e,u8[t])}function Xt(e,t="wei"){return A1(e,d8[t])}function No(e){const t=Object.entries(e).map(([n,s])=>s===void 0||s===!1?null:[n,s]).filter(Boolean),r=t.reduce((n,[s])=>Math.max(n,s.length),0);return t.map(([n,s])=>` ${`${n}:`.padEnd(r+1)} ${s}`).join(`
|
|
66
66
|
`)}class p8 extends ${constructor({v:t}){super(`Invalid \`v\` value "${t}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class f8 extends ${constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",No(t),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}let m8=class extends ${constructor({storageKey:t}){super(`Size for storage key "${t}" is invalid. Expected 32 bytes. Got ${Math.floor((t.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}};class h8 extends ${constructor(t,{account:r,docsPath:n,chain:s,data:a,gas:o,gasPrice:i,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:d,value:f}){var y;const m=No({chain:s&&`${s==null?void 0:s.name} (id: ${s==null?void 0:s.id})`,from:r==null?void 0:r.address,to:d,value:typeof f<"u"&&`${_d(f)} ${((y=s==null?void 0:s.nativeCurrency)==null?void 0:y.symbol)||"ETH"}`,data:a,gas:o,gasPrice:typeof i<"u"&&`${Xt(i)} gwei`,maxFeePerGas:typeof c<"u"&&`${Xt(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${Xt(l)} gwei`,nonce:u});super(t.shortMessage,{cause:t,docsPath:n,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Request Arguments:",m].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class P1 extends ${constructor({blockHash:t,blockNumber:r,blockTag:n,hash:s,index:a}){let o="Transaction";n&&a!==void 0&&(o=`Transaction at block time "${n}" at index "${a}"`),t&&a!==void 0&&(o=`Transaction at block hash "${t}" at index "${a}"`),r&&a!==void 0&&(o=`Transaction at block number "${r}" at index "${a}"`),s&&(o=`Transaction with hash "${s}"`),super(`${o} could not be found.`,{name:"TransactionNotFoundError"})}}class I1 extends ${constructor({hash:t}){super(`Transaction receipt with hash "${t}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}class B1 extends ${constructor({receipt:t}){super(`Transaction with hash "${t.transactionHash}" reverted.`,{metaMessages:['The receipt marked the transaction as "reverted". This could mean that the function on the contract you are trying to call threw an error.'," ","You can attempt to extract the revert reason by:","- calling the `simulateContract` or `simulateCalls` Action with the `abi` and `functionName` of the contract","- using the `call` Action with raw `data`"],name:"TransactionReceiptRevertedError"}),Object.defineProperty(this,"receipt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.receipt=t}}class b8 extends ${constructor({hash:t}){super(`Timed out while waiting for transaction with hash "${t}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}function y8(e){if(!e||e.length===0)return[];const t=[];for(const r of e){const{chainId:n,nonce:s,...a}=r,o=r.address;t.push([n?Fe(n):"0x",o,s?Fe(s):"0x",..._a({},a)])}return t}function Md(e){const{kzg:t}=e,r=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),n=typeof e.blobs[0]=="string"?e.blobs.map(a=>or(a)):e.blobs,s=[];for(const a of n)s.push(Uint8Array.from(t.blobToKzgCommitment(a)));return r==="bytes"?s:s.map(a=>vt(a))}function Nd(e){const{kzg:t}=e,r=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),n=typeof e.blobs[0]=="string"?e.blobs.map(o=>or(o)):e.blobs,s=typeof e.commitments[0]=="string"?e.commitments.map(o=>or(o)):e.commitments,a=[];for(let o=0;o<n.length;o++){const i=n[o],c=s[o];a.push(Uint8Array.from(t.computeBlobKzgProof(i,c)))}return r==="bytes"?a:a.map(o=>vt(o))}const Aa=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function g8(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Lo(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function zs(e,...t){if(!g8(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function x8(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");Lo(e.outputLen),Lo(e.blockLen)}function Pa(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function F1(e,t){zs(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function w8(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function es(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Ld(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Jr(e,t){return e<<32-t|e>>>t}const v8=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function E8(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function k8(e){for(let t=0;t<e.length;t++)e[t]=E8(e[t]);return e}const U1=v8?e=>e:k8;function C8(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function $c(e){return typeof e=="string"&&(e=C8(e)),zs(e),e}function T8(...e){let t=0;for(let n=0;n<e.length;n++){const s=e[n];zs(s),t+=s.length}const r=new Uint8Array(t);for(let n=0,s=0;n<e.length;n++){const a=e[n];r.set(a,s),s+=a.length}return r}class zd{}function Gc(e){const t=n=>e().update($c(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function S8(e=32){if(Aa&&typeof Aa.getRandomValues=="function")return Aa.getRandomValues(new Uint8Array(e));if(Aa&&typeof Aa.randomBytes=="function")return Uint8Array.from(Aa.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}function A8(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);const s=BigInt(32),a=BigInt(4294967295),o=Number(r>>s&a),i=Number(r&a),c=n?4:0,l=n?0:4;e.setUint32(t+c,o,n),e.setUint32(t+l,i,n)}function P8(e,t,r){return e&t^~e&r}function I8(e,t,r){return e&t^e&r^t&r}class O1 extends zd{constructor(t,r,n,s){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=s,this.buffer=new Uint8Array(t),this.view=Ld(this.buffer)}update(t){Pa(this),t=$c(t),zs(t);const{view:r,buffer:n,blockLen:s}=this,a=t.length;for(let o=0;o<a;){const i=Math.min(s-this.pos,a-o);if(i===s){const c=Ld(t);for(;s<=a-o;o+=s)this.process(c,o);continue}n.set(t.subarray(o,o+i),this.pos),this.pos+=i,o+=i,this.pos===s&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Pa(this),F1(t,this),this.finished=!0;const{buffer:r,view:n,blockLen:s,isLE:a}=this;let{pos:o}=this;r[o++]=128,es(this.buffer.subarray(o)),this.padOffset>s-o&&(this.process(n,0),o=0);for(let d=o;d<s;d++)r[d]=0;A8(n,s-8,BigInt(this.length*8),a),this.process(n,0);const i=Ld(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=c/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<l;d++)i.setUint32(4*d,u[d],a)}digest(){const{buffer:t,outputLen:r}=this;this.digestInto(t);const n=t.slice(0,r);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:r,buffer:n,length:s,finished:a,destroyed:o,pos:i}=this;return t.destroyed=o,t.finished=a,t.length=s,t.pos=i,s%r&&t.buffer.set(n),t}clone(){return this._cloneInto()}}const ts=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Nt=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),Lt=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),jc=BigInt(2**32-1),D1=BigInt(32);function B8(e,t=!1){return t?{h:Number(e&jc),l:Number(e>>D1&jc)}:{h:Number(e>>D1&jc)|0,l:Number(e&jc)|0}}function _1(e,t=!1){const r=e.length;let n=new Uint32Array(r),s=new Uint32Array(r);for(let a=0;a<r;a++){const{h:o,l:i}=B8(e[a],t);[n[a],s[a]]=[o,i]}return[n,s]}const M1=(e,t,r)=>e>>>r,N1=(e,t,r)=>e<<32-r|t>>>r,Ia=(e,t,r)=>e>>>r|t<<32-r,Ba=(e,t,r)=>e<<32-r|t>>>r,Vc=(e,t,r)=>e<<64-r|t>>>r-32,Wc=(e,t,r)=>e>>>r-32|t<<64-r,F8=(e,t,r)=>e<<r|t>>>32-r,U8=(e,t,r)=>t<<r|e>>>32-r,O8=(e,t,r)=>t<<r-32|e>>>64-r,D8=(e,t,r)=>e<<r-32|t>>>64-r;function vn(e,t,r,n){const s=(t>>>0)+(n>>>0);return{h:e+r+(s/2**32|0)|0,l:s|0}}const _8=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),M8=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,N8=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),L8=(e,t,r,n,s)=>t+r+n+s+(e/2**32|0)|0,z8=(e,t,r,n,s)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(s>>>0),R8=(e,t,r,n,s,a)=>t+r+n+s+a+(e/2**32|0)|0,H8=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),rs=new Uint32Array(64);class $8 extends O1{constructor(t=32){super(64,t,8,!1),this.A=ts[0]|0,this.B=ts[1]|0,this.C=ts[2]|0,this.D=ts[3]|0,this.E=ts[4]|0,this.F=ts[5]|0,this.G=ts[6]|0,this.H=ts[7]|0}get(){const{A:t,B:r,C:n,D:s,E:a,F:o,G:i,H:c}=this;return[t,r,n,s,a,o,i,c]}set(t,r,n,s,a,o,i,c){this.A=t|0,this.B=r|0,this.C=n|0,this.D=s|0,this.E=a|0,this.F=o|0,this.G=i|0,this.H=c|0}process(t,r){for(let d=0;d<16;d++,r+=4)rs[d]=t.getUint32(r,!1);for(let d=16;d<64;d++){const f=rs[d-15],m=rs[d-2],y=Jr(f,7)^Jr(f,18)^f>>>3,g=Jr(m,17)^Jr(m,19)^m>>>10;rs[d]=g+rs[d-7]+y+rs[d-16]|0}let{A:n,B:s,C:a,D:o,E:i,F:c,G:l,H:u}=this;for(let d=0;d<64;d++){const f=Jr(i,6)^Jr(i,11)^Jr(i,25),m=u+f+P8(i,c,l)+H8[d]+rs[d]|0,g=(Jr(n,2)^Jr(n,13)^Jr(n,22))+I8(n,s,a)|0;u=l,l=c,c=i,i=o+m|0,o=a,a=s,s=n,n=m+g|0}n=n+this.A|0,s=s+this.B|0,a=a+this.C|0,o=o+this.D|0,i=i+this.E|0,c=c+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(n,s,a,o,i,c,l,u)}roundClean(){es(rs)}destroy(){this.set(0,0,0,0,0,0,0,0),es(this.buffer)}}const L1=_1(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),G8=L1[0],j8=L1[1],ns=new Uint32Array(80),ss=new Uint32Array(80);class z1 extends O1{constructor(t=64){super(128,t,16,!1),this.Ah=Lt[0]|0,this.Al=Lt[1]|0,this.Bh=Lt[2]|0,this.Bl=Lt[3]|0,this.Ch=Lt[4]|0,this.Cl=Lt[5]|0,this.Dh=Lt[6]|0,this.Dl=Lt[7]|0,this.Eh=Lt[8]|0,this.El=Lt[9]|0,this.Fh=Lt[10]|0,this.Fl=Lt[11]|0,this.Gh=Lt[12]|0,this.Gl=Lt[13]|0,this.Hh=Lt[14]|0,this.Hl=Lt[15]|0}get(){const{Ah:t,Al:r,Bh:n,Bl:s,Ch:a,Cl:o,Dh:i,Dl:c,Eh:l,El:u,Fh:d,Fl:f,Gh:m,Gl:y,Hh:g,Hl:E}=this;return[t,r,n,s,a,o,i,c,l,u,d,f,m,y,g,E]}set(t,r,n,s,a,o,i,c,l,u,d,f,m,y,g,E){this.Ah=t|0,this.Al=r|0,this.Bh=n|0,this.Bl=s|0,this.Ch=a|0,this.Cl=o|0,this.Dh=i|0,this.Dl=c|0,this.Eh=l|0,this.El=u|0,this.Fh=d|0,this.Fl=f|0,this.Gh=m|0,this.Gl=y|0,this.Hh=g|0,this.Hl=E|0}process(t,r){for(let A=0;A<16;A++,r+=4)ns[A]=t.getUint32(r),ss[A]=t.getUint32(r+=4);for(let A=16;A<80;A++){const C=ns[A-15]|0,D=ss[A-15]|0,L=Ia(C,D,1)^Ia(C,D,8)^M1(C,D,7),T=Ba(C,D,1)^Ba(C,D,8)^N1(C,D,7),h=ns[A-2]|0,b=ss[A-2]|0,x=Ia(h,b,19)^Vc(h,b,61)^M1(h,b,6),S=Ba(h,b,19)^Wc(h,b,61)^N1(h,b,6),I=N8(T,S,ss[A-7],ss[A-16]),F=L8(I,L,x,ns[A-7],ns[A-16]);ns[A]=F|0,ss[A]=I|0}let{Ah:n,Al:s,Bh:a,Bl:o,Ch:i,Cl:c,Dh:l,Dl:u,Eh:d,El:f,Fh:m,Fl:y,Gh:g,Gl:E,Hh:v,Hl:w}=this;for(let A=0;A<80;A++){const C=Ia(d,f,14)^Ia(d,f,18)^Vc(d,f,41),D=Ba(d,f,14)^Ba(d,f,18)^Wc(d,f,41),L=d&m^~d&g,T=f&y^~f&E,h=z8(w,D,T,j8[A],ss[A]),b=R8(h,v,C,L,G8[A],ns[A]),x=h|0,S=Ia(n,s,28)^Vc(n,s,34)^Vc(n,s,39),I=Ba(n,s,28)^Wc(n,s,34)^Wc(n,s,39),F=n&a^n&i^a&i,_=s&o^s&c^o&c;v=g|0,w=E|0,g=m|0,E=y|0,m=d|0,y=f|0,{h:d,l:f}=vn(l|0,u|0,b|0,x|0),l=i|0,u=c|0,i=a|0,c=o|0,a=n|0,o=s|0;const k=_8(x,I,_);n=M8(k,b,S,F),s=k|0}({h:n,l:s}=vn(this.Ah|0,this.Al|0,n|0,s|0)),{h:a,l:o}=vn(this.Bh|0,this.Bl|0,a|0,o|0),{h:i,l:c}=vn(this.Ch|0,this.Cl|0,i|0,c|0),{h:l,l:u}=vn(this.Dh|0,this.Dl|0,l|0,u|0),{h:d,l:f}=vn(this.Eh|0,this.El|0,d|0,f|0),{h:m,l:y}=vn(this.Fh|0,this.Fl|0,m|0,y|0),{h:g,l:E}=vn(this.Gh|0,this.Gl|0,g|0,E|0),{h:v,l:w}=vn(this.Hh|0,this.Hl|0,v|0,w|0),this.set(n,s,a,o,i,c,l,u,d,f,m,y,g,E,v,w)}roundClean(){es(ns,ss)}destroy(){es(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class V8 extends z1{constructor(){super(48),this.Ah=Nt[0]|0,this.Al=Nt[1]|0,this.Bh=Nt[2]|0,this.Bl=Nt[3]|0,this.Ch=Nt[4]|0,this.Cl=Nt[5]|0,this.Dh=Nt[6]|0,this.Dl=Nt[7]|0,this.Eh=Nt[8]|0,this.El=Nt[9]|0,this.Fh=Nt[10]|0,this.Fl=Nt[11]|0,this.Gh=Nt[12]|0,this.Gl=Nt[13]|0,this.Hh=Nt[14]|0,this.Hl=Nt[15]|0}}const Rd=Gc(()=>new $8),W8=Gc(()=>new z1),q8=Gc(()=>new V8),R1=Rd;function H1(e,t){const r=t||"hex",n=R1(Or(e,{strict:!1})?xn(e):e);return r==="bytes"?n:Fe(n)}function Y8(e){const{commitment:t,version:r=1}=e,n=e.to??(typeof t=="string"?"hex":"bytes"),s=H1(t,"bytes");return s.set([r],0),n==="bytes"?s:vt(s)}function $1(e){const{commitments:t,version:r}=e,n=e.to??(typeof t[0]=="string"?"hex":"bytes"),s=[];for(const a of t)s.push(Y8({commitment:a,to:n,version:r}));return s}const G1=6,j1=32,Hd=4096,V1=j1*Hd,W1=V1*G1-1-1*Hd*G1,q1=1;class K8 extends ${constructor({maxSize:t,size:r}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${r} bytes`],name:"BlobSizeTooLargeError"})}}class Y1 extends ${constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class Z8 extends ${constructor({hash:t,size:r}){super(`Versioned hash "${t}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${r}`],name:"InvalidVersionedHashSizeError"})}}class X8 extends ${constructor({hash:t,version:r}){super(`Versioned hash "${t}" version is invalid.`,{metaMessages:[`Expected: ${q1}`,`Received: ${r}`],name:"InvalidVersionedHashVersionError"})}}function Q8(e){const t=e.to??(typeof e.data=="string"?"hex":"bytes"),r=typeof e.data=="string"?or(e.data):e.data,n=ct(r);if(!n)throw new Y1;if(n>W1)throw new K8({maxSize:W1,size:n});const s=[];let a=!0,o=0;for(;a;){const i=Dd(new Uint8Array(V1));let c=0;for(;c<Hd;){const l=r.slice(o,o+(j1-1));if(i.pushByte(0),i.pushBytes(l),l.length<31){i.pushByte(128),a=!1;break}c++,o+=31}s.push(i)}return t==="bytes"?s.map(i=>i.bytes):s.map(i=>vt(i.bytes))}function K1(e){const{data:t,kzg:r,to:n}=e,s=e.blobs??Q8({data:t,to:n}),a=e.commitments??Md({blobs:s,kzg:r,to:n}),o=e.proofs??Nd({blobs:s,commitments:a,kzg:r,to:n}),i=[];for(let c=0;c<s.length;c++)i.push({blob:s[c],commitment:a[c],proof:o[c]});return i}let Ct=class extends ${constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}};class $d extends ${constructor({blockNumber:t,chain:r,contract:n}){super(`Chain "${r.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...t&&n.blockCreated&&n.blockCreated>t?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${t}).`]:[`- The chain does not have the contract "${n.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class J8 extends ${constructor({chain:t,currentChainId:r}){super(`The current chain of the wallet (id: ${r}) does not match the target chain for the transaction (id: ${t.id} – ${t.name}).`,{metaMessages:[`Current Chain ID: ${r}`,`Expected Chain ID: ${t.id} – ${t.name}`],name:"ChainMismatchError"})}}class ev extends ${constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(`
|
|
67
67
|
`),{name:"ChainNotFoundError"})}}class Z1 extends ${constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}let Fa=class extends ${constructor({chainId:t}){super(typeof t=="number"?`Chain ID "${t}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}};class Ua extends ${constructor({cause:t,message:r}={}){var s;const n=(s=r==null?void 0:r.replace("execution reverted: ",""))==null?void 0:s.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}}Object.defineProperty(Ua,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(Ua,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});let as=class extends ${constructor({cause:t,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${Xt(r)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}};Object.defineProperty(as,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class Gd extends ${constructor({cause:t,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${Xt(r)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}}Object.defineProperty(Gd,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class jd extends ${constructor({cause:t,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}}Object.defineProperty(jd,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class Vd extends ${constructor({cause:t,nonce:r}={}){super([`Nonce provided for the transaction ${r?`(${r}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
|