waku-lab/buddybook/assets/index-D4GNEarw.js
status-im-auto 27e589b32f Updates
2024-11-04 16:28:38 +00:00

4273 lines
2.5 MiB
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DrKwSPd8.js","assets/hooks.module-Dd0QlYUx.js","assets/events-CXYVpbcl.js","assets/inherits_browser-Cg-Az14D.js","assets/index-CT_b5y6n.js","assets/index-DY_rTz6S.js","assets/index.es-Bushv2uZ.js"])))=>i.map(i=>d[i]);
var cu=Object.defineProperty;var Us=et=>{throw TypeError(et)};var lu=(et,o,tt)=>o in et?cu(et,o,{enumerable:!0,configurable:!0,writable:!0,value:tt}):et[o]=tt;var wt=(et,o,tt)=>lu(et,typeof o!="symbol"?o+"":o,tt),cs=(et,o,tt)=>o.has(et)||Us("Cannot "+tt);var Ot=(et,o,tt)=>(cs(et,o,"read from private field"),tt?tt.call(et):o.get(et)),fr=(et,o,tt)=>o.has(et)?Us("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(et):o.set(et,tt),lr=(et,o,tt,rt)=>(cs(et,o,"write to private field"),rt?rt.call(et,tt):o.set(et,tt),tt),mr=(et,o,tt)=>(cs(et,o,"access private method"),tt);var Cn=(et,o,tt,rt)=>({set _(nt){lr(et,o,nt,tt)},get _(){return Ot(et,o,rt)}});function _mergeNamespaces(et,o){for(var tt=0;tt<o.length;tt++){const rt=o[tt];if(typeof rt!="string"&&!Array.isArray(rt)){for(const nt in rt)if(nt!=="default"&&!(nt in et)){const ot=Object.getOwnPropertyDescriptor(rt,nt);ot&&Object.defineProperty(et,nt,ot.get?ot:{enumerable:!0,get:()=>rt[nt]})}}}return Object.freeze(Object.defineProperty(et,Symbol.toStringTag,{value:"Module"}))}(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const nt of document.querySelectorAll('link[rel="modulepreload"]'))rt(nt);new MutationObserver(nt=>{for(const ot of nt)if(ot.type==="childList")for(const it of ot.addedNodes)it.tagName==="LINK"&&it.rel==="modulepreload"&&rt(it)}).observe(document,{childList:!0,subtree:!0});function tt(nt){const ot={};return nt.integrity&&(ot.integrity=nt.integrity),nt.referrerPolicy&&(ot.referrerPolicy=nt.referrerPolicy),nt.crossOrigin==="use-credentials"?ot.credentials="include":nt.crossOrigin==="anonymous"?ot.credentials="omit":ot.credentials="same-origin",ot}function rt(nt){if(nt.ep)return;nt.ep=!0;const ot=tt(nt);fetch(nt.href,ot)}})();var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};function getDefaultExportFromCjs(et){return et&&et.__esModule&&Object.prototype.hasOwnProperty.call(et,"default")?et.default:et}function getAugmentedNamespace(et){if(et.__esModule)return et;var o=et.default;if(typeof o=="function"){var tt=function rt(){return this instanceof rt?Reflect.construct(o,arguments,this.constructor):o.apply(this,arguments)};tt.prototype=o.prototype}else tt={};return Object.defineProperty(tt,"__esModule",{value:!0}),Object.keys(et).forEach(function(rt){var nt=Object.getOwnPropertyDescriptor(et,rt);Object.defineProperty(tt,rt,nt.get?nt:{enumerable:!0,get:function(){return et[rt]}})}),tt}var jsxRuntime={exports:{}},reactJsxRuntime_production_min={},react={exports:{}},react_production_min={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var l$4=Symbol.for("react.element"),n$5=Symbol.for("react.portal"),p$6=Symbol.for("react.fragment"),q$6=Symbol.for("react.strict_mode"),r$5=Symbol.for("react.profiler"),t$4=Symbol.for("react.provider"),u$3=Symbol.for("react.context"),v$5=Symbol.for("react.forward_ref"),w$4=Symbol.for("react.suspense"),x$2=Symbol.for("react.memo"),y$3=Symbol.for("react.lazy"),z$3=Symbol.iterator;function A$2(et){return et===null||typeof et!="object"?null:(et=z$3&&et[z$3]||et["@@iterator"],typeof et=="function"?et:null)}var B$2={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C$2=Object.assign,D$2={};function E$2(et,o,tt){this.props=et,this.context=o,this.refs=D$2,this.updater=tt||B$2}E$2.prototype.isReactComponent={};E$2.prototype.setState=function(et,o){if(typeof et!="object"&&typeof et!="function"&&et!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,et,o,"setState")};E$2.prototype.forceUpdate=function(et){this.updater.enqueueForceUpdate(this,et,"forceUpdate")};function F$1(){}F$1.prototype=E$2.prototype;function G$2(et,o,tt){this.props=et,this.context=o,this.refs=D$2,this.updater=tt||B$2}var H$2=G$2.prototype=new F$1;H$2.constructor=G$2;C$2(H$2,E$2.prototype);H$2.isPureReactComponent=!0;var I$2=Array.isArray,J$1=Object.prototype.hasOwnProperty,K$2={current:null},L$2={key:!0,ref:!0,__self:!0,__source:!0};function M$2(et,o,tt){var rt,nt={},ot=null,it=null;if(o!=null)for(rt in o.ref!==void 0&&(it=o.ref),o.key!==void 0&&(ot=""+o.key),o)J$1.call(o,rt)&&!L$2.hasOwnProperty(rt)&&(nt[rt]=o[rt]);var st=arguments.length-2;if(st===1)nt.children=tt;else if(1<st){for(var at=Array(st),ct=0;ct<st;ct++)at[ct]=arguments[ct+2];nt.children=at}if(et&&et.defaultProps)for(rt in st=et.defaultProps,st)nt[rt]===void 0&&(nt[rt]=st[rt]);return{$$typeof:l$4,type:et,key:ot,ref:it,props:nt,_owner:K$2.current}}function N$2(et,o){return{$$typeof:l$4,type:et.type,key:o,ref:et.ref,props:et.props,_owner:et._owner}}function O$1(et){return typeof et=="object"&&et!==null&&et.$$typeof===l$4}function escape$1(et){var o={"=":"=0",":":"=2"};return"$"+et.replace(/[=:]/g,function(tt){return o[tt]})}var P$1=/\/+/g;function Q$2(et,o){return typeof et=="object"&&et!==null&&et.key!=null?escape$1(""+et.key):o.toString(36)}function R$1(et,o,tt,rt,nt){var ot=typeof et;(ot==="undefined"||ot==="boolean")&&(et=null);var it=!1;if(et===null)it=!0;else switch(ot){case"string":case"number":it=!0;break;case"object":switch(et.$$typeof){case l$4:case n$5:it=!0}}if(it)return it=et,nt=nt(it),et=rt===""?"."+Q$2(it,0):rt,I$2(nt)?(tt="",et!=null&&(tt=et.replace(P$1,"$&/")+"/"),R$1(nt,o,tt,"",function(ct){return ct})):nt!=null&&(O$1(nt)&&(nt=N$2(nt,tt+(!nt.key||it&&it.key===nt.key?"":(""+nt.key).replace(P$1,"$&/")+"/")+et)),o.push(nt)),1;if(it=0,rt=rt===""?".":rt+":",I$2(et))for(var st=0;st<et.length;st++){ot=et[st];var at=rt+Q$2(ot,st);it+=R$1(ot,o,tt,at,nt)}else if(at=A$2(et),typeof at=="function")for(et=at.call(et),st=0;!(ot=et.next()).done;)ot=ot.value,at=rt+Q$2(ot,st++),it+=R$1(ot,o,tt,at,nt);else if(ot==="object")throw o=String(et),Error("Objects are not valid as a React child (found: "+(o==="[object Object]"?"object with keys {"+Object.keys(et).join(", ")+"}":o)+"). If you meant to render a collection of children, use an array instead.");return it}function S$2(et,o,tt){if(et==null)return et;var rt=[],nt=0;return R$1(et,rt,"","",function(ot){return o.call(tt,ot,nt++)}),rt}function T$2(et){if(et._status===-1){var o=et._result;o=o(),o.then(function(tt){(et._status===0||et._status===-1)&&(et._status=1,et._result=tt)},function(tt){(et._status===0||et._status===-1)&&(et._status=2,et._result=tt)}),et._status===-1&&(et._status=0,et._result=o)}if(et._status===1)return et._result.default;throw et._result}var U$2={current:null},V$3={transition:null},W$2={ReactCurrentDispatcher:U$2,ReactCurrentBatchConfig:V$3,ReactCurrentOwner:K$2};function X$2(){throw Error("act(...) is not supported in production builds of React.")}react_production_min.Children={map:S$2,forEach:function(et,o,tt){S$2(et,function(){o.apply(this,arguments)},tt)},count:function(et){var o=0;return S$2(et,function(){o++}),o},toArray:function(et){return S$2(et,function(o){return o})||[]},only:function(et){if(!O$1(et))throw Error("React.Children.only expected to receive a single React element child.");return et}};react_production_min.Component=E$2;react_production_min.Fragment=p$6;react_production_min.Profiler=r$5;react_production_min.PureComponent=G$2;react_production_min.StrictMode=q$6;react_production_min.Suspense=w$4;react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W$2;react_production_min.act=X$2;react_production_min.cloneElement=function(et,o,tt){if(et==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+et+".");var rt=C$2({},et.props),nt=et.key,ot=et.ref,it=et._owner;if(o!=null){if(o.ref!==void 0&&(ot=o.ref,it=K$2.current),o.key!==void 0&&(nt=""+o.key),et.type&&et.type.defaultProps)var st=et.type.defaultProps;for(at in o)J$1.call(o,at)&&!L$2.hasOwnProperty(at)&&(rt[at]=o[at]===void 0&&st!==void 0?st[at]:o[at])}var at=arguments.length-2;if(at===1)rt.children=tt;else if(1<at){st=Array(at);for(var ct=0;ct<at;ct++)st[ct]=arguments[ct+2];rt.children=st}return{$$typeof:l$4,type:et.type,key:nt,ref:ot,props:rt,_owner:it}};react_production_min.createContext=function(et){return et={$$typeof:u$3,_currentValue:et,_currentValue2:et,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},et.Provider={$$typeof:t$4,_context:et},et.Consumer=et};react_production_min.createElement=M$2;react_production_min.createFactory=function(et){var o=M$2.bind(null,et);return o.type=et,o};react_production_min.createRef=function(){return{current:null}};react_production_min.forwardRef=function(et){return{$$typeof:v$5,render:et}};react_production_min.isValidElement=O$1;react_production_min.lazy=function(et){return{$$typeof:y$3,_payload:{_status:-1,_result:et},_init:T$2}};react_production_min.memo=function(et,o){return{$$typeof:x$2,type:et,compare:o===void 0?null:o}};react_production_min.startTransition=function(et){var o=V$3.transition;V$3.transition={};try{et()}finally{V$3.transition=o}};react_production_min.unstable_act=X$2;react_production_min.useCallback=function(et,o){return U$2.current.useCallback(et,o)};react_production_min.useContext=function(et){return U$2.current.useContext(et)};react_production_min.useDebugValue=function(){};react_production_min.useDeferredValue=function(et){return U$2.current.useDeferredValue(et)};react_production_min.useEffect=function(et,o){return U$2.current.useEffect(et,o)};react_production_min.useId=function(){return U$2.current.useId()};react_production_min.useImperativeHandle=function(et,o,tt){return U$2.current.useImperativeHandle(et,o,tt)};react_production_min.useInsertionEffect=function(et,o){return U$2.current.useInsertionEffect(et,o)};react_production_min.useLayoutEffect=function(et,o){return U$2.current.useLayoutEffect(et,o)};react_production_min.useMemo=function(et,o){return U$2.current.useMemo(et,o)};react_production_min.useReducer=function(et,o,tt){return U$2.current.useReducer(et,o,tt)};react_production_min.useRef=function(et){return U$2.current.useRef(et)};react_production_min.useState=function(et){return U$2.current.useState(et)};react_production_min.useSyncExternalStore=function(et,o,tt){return U$2.current.useSyncExternalStore(et,o,tt)};react_production_min.useTransition=function(){return U$2.current.useTransition()};react_production_min.version="18.3.1";react.exports=react_production_min;var reactExports=react.exports;const React=getDefaultExportFromCjs(reactExports),React$1=_mergeNamespaces({__proto__:null,default:React},[reactExports]);/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var f$2=reactExports,k$4=Symbol.for("react.element"),l$3=Symbol.for("react.fragment"),m$6=Object.prototype.hasOwnProperty,n$4=f$2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p$5={key:!0,ref:!0,__self:!0,__source:!0};function q$5(et,o,tt){var rt,nt={},ot=null,it=null;tt!==void 0&&(ot=""+tt),o.key!==void 0&&(ot=""+o.key),o.ref!==void 0&&(it=o.ref);for(rt in o)m$6.call(o,rt)&&!p$5.hasOwnProperty(rt)&&(nt[rt]=o[rt]);if(et&&et.defaultProps)for(rt in o=et.defaultProps,o)nt[rt]===void 0&&(nt[rt]=o[rt]);return{$$typeof:k$4,type:et,key:ot,ref:it,props:nt,_owner:n$4.current}}reactJsxRuntime_production_min.Fragment=l$3;reactJsxRuntime_production_min.jsx=q$5;reactJsxRuntime_production_min.jsxs=q$5;jsxRuntime.exports=reactJsxRuntime_production_min;var jsxRuntimeExports=jsxRuntime.exports,buffer$2={},base64Js={};base64Js.byteLength=byteLength;base64Js.toByteArray=toByteArray;base64Js.fromByteArray=fromByteArray;var lookup=[],revLookup=[],Arr=typeof Uint8Array<"u"?Uint8Array:Array,code$3="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var i$1=0,len=code$3.length;i$1<len;++i$1)lookup[i$1]=code$3[i$1],revLookup[code$3.charCodeAt(i$1)]=i$1;revLookup[45]=62;revLookup[95]=63;function getLens(et){var o=et.length;if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var tt=et.indexOf("=");tt===-1&&(tt=o);var rt=tt===o?0:4-tt%4;return[tt,rt]}function byteLength(et){var o=getLens(et),tt=o[0],rt=o[1];return(tt+rt)*3/4-rt}function _byteLength(et,o,tt){return(o+tt)*3/4-tt}function toByteArray(et){var o,tt=getLens(et),rt=tt[0],nt=tt[1],ot=new Arr(_byteLength(et,rt,nt)),it=0,st=nt>0?rt-4:rt,at;for(at=0;at<st;at+=4)o=revLookup[et.charCodeAt(at)]<<18|revLookup[et.charCodeAt(at+1)]<<12|revLookup[et.charCodeAt(at+2)]<<6|revLookup[et.charCodeAt(at+3)],ot[it++]=o>>16&255,ot[it++]=o>>8&255,ot[it++]=o&255;return nt===2&&(o=revLookup[et.charCodeAt(at)]<<2|revLookup[et.charCodeAt(at+1)]>>4,ot[it++]=o&255),nt===1&&(o=revLookup[et.charCodeAt(at)]<<10|revLookup[et.charCodeAt(at+1)]<<4|revLookup[et.charCodeAt(at+2)]>>2,ot[it++]=o>>8&255,ot[it++]=o&255),ot}function tripletToBase64(et){return lookup[et>>18&63]+lookup[et>>12&63]+lookup[et>>6&63]+lookup[et&63]}function encodeChunk(et,o,tt){for(var rt,nt=[],ot=o;ot<tt;ot+=3)rt=(et[ot]<<16&16711680)+(et[ot+1]<<8&65280)+(et[ot+2]&255),nt.push(tripletToBase64(rt));return nt.join("")}function fromByteArray(et){for(var o,tt=et.length,rt=tt%3,nt=[],ot=16383,it=0,st=tt-rt;it<st;it+=ot)nt.push(encodeChunk(et,it,it+ot>st?st:it+ot));return rt===1?(o=et[tt-1],nt.push(lookup[o>>2]+lookup[o<<4&63]+"==")):rt===2&&(o=(et[tt-2]<<8)+et[tt-1],nt.push(lookup[o>>10]+lookup[o>>4&63]+lookup[o<<2&63]+"=")),nt.join("")}var ieee754={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ieee754.read=function(et,o,tt,rt,nt){var ot,it,st=nt*8-rt-1,at=(1<<st)-1,ct=at>>1,lt=-7,dt=tt?nt-1:0,ht=tt?-1:1,mt=et[o+dt];for(dt+=ht,ot=mt&(1<<-lt)-1,mt>>=-lt,lt+=st;lt>0;ot=ot*256+et[o+dt],dt+=ht,lt-=8);for(it=ot&(1<<-lt)-1,ot>>=-lt,lt+=rt;lt>0;it=it*256+et[o+dt],dt+=ht,lt-=8);if(ot===0)ot=1-ct;else{if(ot===at)return it?NaN:(mt?-1:1)*(1/0);it=it+Math.pow(2,rt),ot=ot-ct}return(mt?-1:1)*it*Math.pow(2,ot-rt)};ieee754.write=function(et,o,tt,rt,nt,ot){var it,st,at,ct=ot*8-nt-1,lt=(1<<ct)-1,dt=lt>>1,ht=nt===23?Math.pow(2,-24)-Math.pow(2,-77):0,mt=rt?0:ot-1,ft=rt?1:-1,pt=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(st=isNaN(o)?1:0,it=lt):(it=Math.floor(Math.log(o)/Math.LN2),o*(at=Math.pow(2,-it))<1&&(it--,at*=2),it+dt>=1?o+=ht/at:o+=ht*Math.pow(2,1-dt),o*at>=2&&(it++,at/=2),it+dt>=lt?(st=0,it=lt):it+dt>=1?(st=(o*at-1)*Math.pow(2,nt),it=it+dt):(st=o*Math.pow(2,dt-1)*Math.pow(2,nt),it=0));nt>=8;et[tt+mt]=st&255,mt+=ft,st/=256,nt-=8);for(it=it<<nt|st,ct+=nt;ct>0;et[tt+mt]=it&255,mt+=ft,it/=256,ct-=8);et[tt+mt-ft]|=pt*128};/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/(function(et){const o=base64Js,tt=ieee754,rt=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;et.Buffer=st,et.SlowBuffer=bt,et.INSPECT_MAX_BYTES=50;const nt=2147483647;et.kMaxLength=nt,st.TYPED_ARRAY_SUPPORT=ot(),!st.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function ot(){try{const Tt=new Uint8Array(1),$t={foo:function(){return 42}};return Object.setPrototypeOf($t,Uint8Array.prototype),Object.setPrototypeOf(Tt,$t),Tt.foo()===42}catch{return!1}}Object.defineProperty(st.prototype,"parent",{enumerable:!0,get:function(){if(st.isBuffer(this))return this.buffer}}),Object.defineProperty(st.prototype,"offset",{enumerable:!0,get:function(){if(st.isBuffer(this))return this.byteOffset}});function it(Tt){if(Tt>nt)throw new RangeError('The value "'+Tt+'" is invalid for option "size"');const $t=new Uint8Array(Tt);return Object.setPrototypeOf($t,st.prototype),$t}function st(Tt,$t,Rt){if(typeof Tt=="number"){if(typeof $t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return dt(Tt)}return at(Tt,$t,Rt)}st.poolSize=8192;function at(Tt,$t,Rt){if(typeof Tt=="string")return ht(Tt,$t);if(ArrayBuffer.isView(Tt))return ft(Tt);if(Tt==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Tt);if(_r(Tt,ArrayBuffer)||Tt&&_r(Tt.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(_r(Tt,SharedArrayBuffer)||Tt&&_r(Tt.buffer,SharedArrayBuffer)))return pt(Tt,$t,Rt);if(typeof Tt=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Dt=Tt.valueOf&&Tt.valueOf();if(Dt!=null&&Dt!==Tt)return st.from(Dt,$t,Rt);const Kt=yt(Tt);if(Kt)return Kt;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Tt[Symbol.toPrimitive]=="function")return st.from(Tt[Symbol.toPrimitive]("string"),$t,Rt);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Tt)}st.from=function(Tt,$t,Rt){return at(Tt,$t,Rt)},Object.setPrototypeOf(st.prototype,Uint8Array.prototype),Object.setPrototypeOf(st,Uint8Array);function ct(Tt){if(typeof Tt!="number")throw new TypeError('"size" argument must be of type number');if(Tt<0)throw new RangeError('The value "'+Tt+'" is invalid for option "size"')}function lt(Tt,$t,Rt){return ct(Tt),Tt<=0?it(Tt):$t!==void 0?typeof Rt=="string"?it(Tt).fill($t,Rt):it(Tt).fill($t):it(Tt)}st.alloc=function(Tt,$t,Rt){return lt(Tt,$t,Rt)};function dt(Tt){return ct(Tt),it(Tt<0?0:gt(Tt)|0)}st.allocUnsafe=function(Tt){return dt(Tt)},st.allocUnsafeSlow=function(Tt){return dt(Tt)};function ht(Tt,$t){if((typeof $t!="string"||$t==="")&&($t="utf8"),!st.isEncoding($t))throw new TypeError("Unknown encoding: "+$t);const Rt=xt(Tt,$t)|0;let Dt=it(Rt);const Kt=Dt.write(Tt,$t);return Kt!==Rt&&(Dt=Dt.slice(0,Kt)),Dt}function mt(Tt){const $t=Tt.length<0?0:gt(Tt.length)|0,Rt=it($t);for(let Dt=0;Dt<$t;Dt+=1)Rt[Dt]=Tt[Dt]&255;return Rt}function ft(Tt){if(_r(Tt,Uint8Array)){const $t=new Uint8Array(Tt);return pt($t.buffer,$t.byteOffset,$t.byteLength)}return mt(Tt)}function pt(Tt,$t,Rt){if($t<0||Tt.byteLength<$t)throw new RangeError('"offset" is outside of buffer bounds');if(Tt.byteLength<$t+(Rt||0))throw new RangeError('"length" is outside of buffer bounds');let Dt;return $t===void 0&&Rt===void 0?Dt=new Uint8Array(Tt):Rt===void 0?Dt=new Uint8Array(Tt,$t):Dt=new Uint8Array(Tt,$t,Rt),Object.setPrototypeOf(Dt,st.prototype),Dt}function yt(Tt){if(st.isBuffer(Tt)){const $t=gt(Tt.length)|0,Rt=it($t);return Rt.length===0||Tt.copy(Rt,0,0,$t),Rt}if(Tt.length!==void 0)return typeof Tt.length!="number"||Tr(Tt.length)?it(0):mt(Tt);if(Tt.type==="Buffer"&&Array.isArray(Tt.data))return mt(Tt.data)}function gt(Tt){if(Tt>=nt)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+nt.toString(16)+" bytes");return Tt|0}function bt(Tt){return+Tt!=Tt&&(Tt=0),st.alloc(+Tt)}st.isBuffer=function($t){return $t!=null&&$t._isBuffer===!0&&$t!==st.prototype},st.compare=function($t,Rt){if(_r($t,Uint8Array)&&($t=st.from($t,$t.offset,$t.byteLength)),_r(Rt,Uint8Array)&&(Rt=st.from(Rt,Rt.offset,Rt.byteLength)),!st.isBuffer($t)||!st.isBuffer(Rt))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if($t===Rt)return 0;let Dt=$t.length,Kt=Rt.length;for(let nr=0,sr=Math.min(Dt,Kt);nr<sr;++nr)if($t[nr]!==Rt[nr]){Dt=$t[nr],Kt=Rt[nr];break}return Dt<Kt?-1:Kt<Dt?1:0},st.isEncoding=function($t){switch(String($t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},st.concat=function($t,Rt){if(!Array.isArray($t))throw new TypeError('"list" argument must be an Array of Buffers');if($t.length===0)return st.alloc(0);let Dt;if(Rt===void 0)for(Rt=0,Dt=0;Dt<$t.length;++Dt)Rt+=$t[Dt].length;const Kt=st.allocUnsafe(Rt);let nr=0;for(Dt=0;Dt<$t.length;++Dt){let sr=$t[Dt];if(_r(sr,Uint8Array))nr+sr.length>Kt.length?(st.isBuffer(sr)||(sr=st.from(sr)),sr.copy(Kt,nr)):Uint8Array.prototype.set.call(Kt,sr,nr);else if(st.isBuffer(sr))sr.copy(Kt,nr);else throw new TypeError('"list" argument must be an Array of Buffers');nr+=sr.length}return Kt};function xt(Tt,$t){if(st.isBuffer(Tt))return Tt.length;if(ArrayBuffer.isView(Tt)||_r(Tt,ArrayBuffer))return Tt.byteLength;if(typeof Tt!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Tt);const Rt=Tt.length,Dt=arguments.length>2&&arguments[2]===!0;if(!Dt&&Rt===0)return 0;let Kt=!1;for(;;)switch($t){case"ascii":case"latin1":case"binary":return Rt;case"utf8":case"utf-8":return cr(Tt).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Rt*2;case"hex":return Rt>>>1;case"base64":return pr(Tt).length;default:if(Kt)return Dt?-1:cr(Tt).length;$t=(""+$t).toLowerCase(),Kt=!0}}st.byteLength=xt;function vt(Tt,$t,Rt){let Dt=!1;if(($t===void 0||$t<0)&&($t=0),$t>this.length||((Rt===void 0||Rt>this.length)&&(Rt=this.length),Rt<=0)||(Rt>>>=0,$t>>>=0,Rt<=$t))return"";for(Tt||(Tt="utf8");;)switch(Tt){case"hex":return qt(this,$t,Rt);case"utf8":case"utf-8":return zt(this,$t,Rt);case"ascii":return Wt(this,$t,Rt);case"latin1":case"binary":return Ft(this,$t,Rt);case"base64":return Mt(this,$t,Rt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Pt(this,$t,Rt);default:if(Dt)throw new TypeError("Unknown encoding: "+Tt);Tt=(Tt+"").toLowerCase(),Dt=!0}}st.prototype._isBuffer=!0;function Et(Tt,$t,Rt){const Dt=Tt[$t];Tt[$t]=Tt[Rt],Tt[Rt]=Dt}st.prototype.swap16=function(){const $t=this.length;if($t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Rt=0;Rt<$t;Rt+=2)Et(this,Rt,Rt+1);return this},st.prototype.swap32=function(){const $t=this.length;if($t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let Rt=0;Rt<$t;Rt+=4)Et(this,Rt,Rt+3),Et(this,Rt+1,Rt+2);return this},st.prototype.swap64=function(){const $t=this.length;if($t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let Rt=0;Rt<$t;Rt+=8)Et(this,Rt,Rt+7),Et(this,Rt+1,Rt+6),Et(this,Rt+2,Rt+5),Et(this,Rt+3,Rt+4);return this},st.prototype.toString=function(){const $t=this.length;return $t===0?"":arguments.length===0?zt(this,0,$t):vt.apply(this,arguments)},st.prototype.toLocaleString=st.prototype.toString,st.prototype.equals=function($t){if(!st.isBuffer($t))throw new TypeError("Argument must be a Buffer");return this===$t?!0:st.compare(this,$t)===0},st.prototype.inspect=function(){let $t="";const Rt=et.INSPECT_MAX_BYTES;return $t=this.toString("hex",0,Rt).replace(/(.{2})/g,"$1 ").trim(),this.length>Rt&&($t+=" ... "),"<Buffer "+$t+">"},rt&&(st.prototype[rt]=st.prototype.inspect),st.prototype.compare=function($t,Rt,Dt,Kt,nr){if(_r($t,Uint8Array)&&($t=st.from($t,$t.offset,$t.byteLength)),!st.isBuffer($t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof $t);if(Rt===void 0&&(Rt=0),Dt===void 0&&(Dt=$t?$t.length:0),Kt===void 0&&(Kt=0),nr===void 0&&(nr=this.length),Rt<0||Dt>$t.length||Kt<0||nr>this.length)throw new RangeError("out of range index");if(Kt>=nr&&Rt>=Dt)return 0;if(Kt>=nr)return-1;if(Rt>=Dt)return 1;if(Rt>>>=0,Dt>>>=0,Kt>>>=0,nr>>>=0,this===$t)return 0;let sr=nr-Kt,br=Dt-Rt;const $r=Math.min(sr,br),yr=this.slice(Kt,nr),Ar=$t.slice(Rt,Dt);for(let xr=0;xr<$r;++xr)if(yr[xr]!==Ar[xr]){sr=yr[xr],br=Ar[xr];break}return sr<br?-1:br<sr?1:0};function Ct(Tt,$t,Rt,Dt,Kt){if(Tt.length===0)return-1;if(typeof Rt=="string"?(Dt=Rt,Rt=0):Rt>2147483647?Rt=2147483647:Rt<-2147483648&&(Rt=-2147483648),Rt=+Rt,Tr(Rt)&&(Rt=Kt?0:Tt.length-1),Rt<0&&(Rt=Tt.length+Rt),Rt>=Tt.length){if(Kt)return-1;Rt=Tt.length-1}else if(Rt<0)if(Kt)Rt=0;else return-1;if(typeof $t=="string"&&($t=st.from($t,Dt)),st.isBuffer($t))return $t.length===0?-1:St(Tt,$t,Rt,Dt,Kt);if(typeof $t=="number")return $t=$t&255,typeof Uint8Array.prototype.indexOf=="function"?Kt?Uint8Array.prototype.indexOf.call(Tt,$t,Rt):Uint8Array.prototype.lastIndexOf.call(Tt,$t,Rt):St(Tt,[$t],Rt,Dt,Kt);throw new TypeError("val must be string, number or Buffer")}function St(Tt,$t,Rt,Dt,Kt){let nr=1,sr=Tt.length,br=$t.length;if(Dt!==void 0&&(Dt=String(Dt).toLowerCase(),Dt==="ucs2"||Dt==="ucs-2"||Dt==="utf16le"||Dt==="utf-16le")){if(Tt.length<2||$t.length<2)return-1;nr=2,sr/=2,br/=2,Rt/=2}function $r(Ar,xr){return nr===1?Ar[xr]:Ar.readUInt16BE(xr*nr)}let yr;if(Kt){let Ar=-1;for(yr=Rt;yr<sr;yr++)if($r(Tt,yr)===$r($t,Ar===-1?0:yr-Ar)){if(Ar===-1&&(Ar=yr),yr-Ar+1===br)return Ar*nr}else Ar!==-1&&(yr-=yr-Ar),Ar=-1}else for(Rt+br>sr&&(Rt=sr-br),yr=Rt;yr>=0;yr--){let Ar=!0;for(let xr=0;xr<br;xr++)if($r(Tt,yr+xr)!==$r($t,xr)){Ar=!1;break}if(Ar)return yr}return-1}st.prototype.includes=function($t,Rt,Dt){return this.indexOf($t,Rt,Dt)!==-1},st.prototype.indexOf=function($t,Rt,Dt){return Ct(this,$t,Rt,Dt,!0)},st.prototype.lastIndexOf=function($t,Rt,Dt){return Ct(this,$t,Rt,Dt,!1)};function At(Tt,$t,Rt,Dt){Rt=Number(Rt)||0;const Kt=Tt.length-Rt;Dt?(Dt=Number(Dt),Dt>Kt&&(Dt=Kt)):Dt=Kt;const nr=$t.length;Dt>nr/2&&(Dt=nr/2);let sr;for(sr=0;sr<Dt;++sr){const br=parseInt($t.substr(sr*2,2),16);if(Tr(br))return sr;Tt[Rt+sr]=br}return sr}function kt(Tt,$t,Rt,Dt){return wr(cr($t,Tt.length-Rt),Tt,Rt,Dt)}function It(Tt,$t,Rt,Dt){return wr(hr($t),Tt,Rt,Dt)}function Nt(Tt,$t,Rt,Dt){return wr(pr($t),Tt,Rt,Dt)}function Lt(Tt,$t,Rt,Dt){return wr(Sr($t,Tt.length-Rt),Tt,Rt,Dt)}st.prototype.write=function($t,Rt,Dt,Kt){if(Rt===void 0)Kt="utf8",Dt=this.length,Rt=0;else if(Dt===void 0&&typeof Rt=="string")Kt=Rt,Dt=this.length,Rt=0;else if(isFinite(Rt))Rt=Rt>>>0,isFinite(Dt)?(Dt=Dt>>>0,Kt===void 0&&(Kt="utf8")):(Kt=Dt,Dt=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const nr=this.length-Rt;if((Dt===void 0||Dt>nr)&&(Dt=nr),$t.length>0&&(Dt<0||Rt<0)||Rt>this.length)throw new RangeError("Attempt to write outside buffer bounds");Kt||(Kt="utf8");let sr=!1;for(;;)switch(Kt){case"hex":return At(this,$t,Rt,Dt);case"utf8":case"utf-8":return kt(this,$t,Rt,Dt);case"ascii":case"latin1":case"binary":return It(this,$t,Rt,Dt);case"base64":return Nt(this,$t,Rt,Dt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Lt(this,$t,Rt,Dt);default:if(sr)throw new TypeError("Unknown encoding: "+Kt);Kt=(""+Kt).toLowerCase(),sr=!0}},st.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Mt(Tt,$t,Rt){return $t===0&&Rt===Tt.length?o.fromByteArray(Tt):o.fromByteArray(Tt.slice($t,Rt))}function zt(Tt,$t,Rt){Rt=Math.min(Tt.length,Rt);const Dt=[];let Kt=$t;for(;Kt<Rt;){const nr=Tt[Kt];let sr=null,br=nr>239?4:nr>223?3:nr>191?2:1;if(Kt+br<=Rt){let $r,yr,Ar,xr;switch(br){case 1:nr<128&&(sr=nr);break;case 2:$r=Tt[Kt+1],($r&192)===128&&(xr=(nr&31)<<6|$r&63,xr>127&&(sr=xr));break;case 3:$r=Tt[Kt+1],yr=Tt[Kt+2],($r&192)===128&&(yr&192)===128&&(xr=(nr&15)<<12|($r&63)<<6|yr&63,xr>2047&&(xr<55296||xr>57343)&&(sr=xr));break;case 4:$r=Tt[Kt+1],yr=Tt[Kt+2],Ar=Tt[Kt+3],($r&192)===128&&(yr&192)===128&&(Ar&192)===128&&(xr=(nr&15)<<18|($r&63)<<12|(yr&63)<<6|Ar&63,xr>65535&&xr<1114112&&(sr=xr))}}sr===null?(sr=65533,br=1):sr>65535&&(sr-=65536,Dt.push(sr>>>10&1023|55296),sr=56320|sr&1023),Dt.push(sr),Kt+=br}return Xt(Dt)}const Ut=4096;function Xt(Tt){const $t=Tt.length;if($t<=Ut)return String.fromCharCode.apply(String,Tt);let Rt="",Dt=0;for(;Dt<$t;)Rt+=String.fromCharCode.apply(String,Tt.slice(Dt,Dt+=Ut));return Rt}function Wt(Tt,$t,Rt){let Dt="";Rt=Math.min(Tt.length,Rt);for(let Kt=$t;Kt<Rt;++Kt)Dt+=String.fromCharCode(Tt[Kt]&127);return Dt}function Ft(Tt,$t,Rt){let Dt="";Rt=Math.min(Tt.length,Rt);for(let Kt=$t;Kt<Rt;++Kt)Dt+=String.fromCharCode(Tt[Kt]);return Dt}function qt(Tt,$t,Rt){const Dt=Tt.length;(!$t||$t<0)&&($t=0),(!Rt||Rt<0||Rt>Dt)&&(Rt=Dt);let Kt="";for(let nr=$t;nr<Rt;++nr)Kt+=gr[Tt[nr]];return Kt}function Pt(Tt,$t,Rt){const Dt=Tt.slice($t,Rt);let Kt="";for(let nr=0;nr<Dt.length-1;nr+=2)Kt+=String.fromCharCode(Dt[nr]+Dt[nr+1]*256);return Kt}st.prototype.slice=function($t,Rt){const Dt=this.length;$t=~~$t,Rt=Rt===void 0?Dt:~~Rt,$t<0?($t+=Dt,$t<0&&($t=0)):$t>Dt&&($t=Dt),Rt<0?(Rt+=Dt,Rt<0&&(Rt=0)):Rt>Dt&&(Rt=Dt),Rt<$t&&(Rt=$t);const Kt=this.subarray($t,Rt);return Object.setPrototypeOf(Kt,st.prototype),Kt};function Yt(Tt,$t,Rt){if(Tt%1!==0||Tt<0)throw new RangeError("offset is not uint");if(Tt+$t>Rt)throw new RangeError("Trying to access beyond buffer length")}st.prototype.readUintLE=st.prototype.readUIntLE=function($t,Rt,Dt){$t=$t>>>0,Rt=Rt>>>0,Dt||Yt($t,Rt,this.length);let Kt=this[$t],nr=1,sr=0;for(;++sr<Rt&&(nr*=256);)Kt+=this[$t+sr]*nr;return Kt},st.prototype.readUintBE=st.prototype.readUIntBE=function($t,Rt,Dt){$t=$t>>>0,Rt=Rt>>>0,Dt||Yt($t,Rt,this.length);let Kt=this[$t+--Rt],nr=1;for(;Rt>0&&(nr*=256);)Kt+=this[$t+--Rt]*nr;return Kt},st.prototype.readUint8=st.prototype.readUInt8=function($t,Rt){return $t=$t>>>0,Rt||Yt($t,1,this.length),this[$t]},st.prototype.readUint16LE=st.prototype.readUInt16LE=function($t,Rt){return $t=$t>>>0,Rt||Yt($t,2,this.length),this[$t]|this[$t+1]<<8},st.prototype.readUint16BE=st.prototype.readUInt16BE=function($t,Rt){return $t=$t>>>0,Rt||Yt($t,2,this.length),this[$t]<<8|this[$t+1]},st.prototype.readUint32LE=st.prototype.readUInt32LE=function($t,Rt){return $t=$t>>>0,Rt||Yt($t,4,this.length),(this[$t]|this[$t+1]<<8|this[$t+2]<<16)+this[$t+3]*16777216},st.prototype.readUint32BE=st.prototype.readUInt32BE=function($t,Rt){return $t=$t>>>0,Rt||Yt($t,4,this.length),this[$t]*16777216+(this[$t+1]<<16|this[$t+2]<<8|this[$t+3])},st.prototype.readBigUInt64LE=vr(function($t){$t=$t>>>0,Vt($t,"offset");const Rt=this[$t],Dt=this[$t+7];(Rt===void 0||Dt===void 0)&&er($t,this.length-8);const Kt=Rt+this[++$t]*2**8+this[++$t]*2**16+this[++$t]*2**24,nr=this[++$t]+this[++$t]*2**8+this[++$t]*2**16+Dt*2**24;return BigInt(Kt)+(BigInt(nr)<<BigInt(32))}),st.prototype.readBigUInt64BE=vr(function($t){$t=$t>>>0,Vt($t,"offset");const Rt=this[$t],Dt=this[$t+7];(Rt===void 0||Dt===void 0)&&er($t,this.length-8);const Kt=Rt*2**24+this[++$t]*2**16+this[++$t]*2**8+this[++$t],nr=this[++$t]*2**24+this[++$t]*2**16+this[++$t]*2**8+Dt;return(BigInt(Kt)<<BigInt(32))+BigInt(nr)}),st.prototype.readIntLE=function($t,Rt,Dt){$t=$t>>>0,Rt=Rt>>>0,Dt||Yt($t,Rt,this.length);let Kt=this[$t],nr=1,sr=0;for(;++sr<Rt&&(nr*=256);)Kt+=this[$t+sr]*nr;return nr*=128,Kt>=nr&&(Kt-=Math.pow(2,8*Rt)),Kt},st.prototype.readIntBE=function($t,Rt,Dt){$t=$t>>>0,Rt=Rt>>>0,Dt||Yt($t,Rt,this.length);let Kt=Rt,nr=1,sr=this[$t+--Kt];for(;Kt>0&&(nr*=256);)sr+=this[$t+--Kt]*nr;return nr*=128,sr>=nr&&(sr-=Math.pow(2,8*Rt)),sr},st.prototype.readInt8=function($t,Rt){return $t=$t>>>0,Rt||Yt($t,1,this.length),this[$t]&128?(255-this[$t]+1)*-1:this[$t]},st.prototype.readInt16LE=function($t,Rt){$t=$t>>>0,Rt||Yt($t,2,this.length);const Dt=this[$t]|this[$t+1]<<8;return Dt&32768?Dt|4294901760:Dt},st.prototype.readInt16BE=function($t,Rt){$t=$t>>>0,Rt||Yt($t,2,this.length);const Dt=this[$t+1]|this[$t]<<8;return Dt&32768?Dt|4294901760:Dt},st.prototype.readInt32LE=function($t,Rt){return $t=$t>>>0,Rt||Yt($t,4,this.length),this[$t]|this[$t+1]<<8|this[$t+2]<<16|this[$t+3]<<24},st.prototype.readInt32BE=function($t,Rt){return $t=$t>>>0,Rt||Yt($t,4,this.length),this[$t]<<24|this[$t+1]<<16|this[$t+2]<<8|this[$t+3]},st.prototype.readBigInt64LE=vr(function($t){$t=$t>>>0,Vt($t,"offset");const Rt=this[$t],Dt=this[$t+7];(Rt===void 0||Dt===void 0)&&er($t,this.length-8);const Kt=this[$t+4]+this[$t+5]*2**8+this[$t+6]*2**16+(Dt<<24);return(BigInt(Kt)<<BigInt(32))+BigInt(Rt+this[++$t]*2**8+this[++$t]*2**16+this[++$t]*2**24)}),st.prototype.readBigInt64BE=vr(function($t){$t=$t>>>0,Vt($t,"offset");const Rt=this[$t],Dt=this[$t+7];(Rt===void 0||Dt===void 0)&&er($t,this.length-8);const Kt=(Rt<<24)+this[++$t]*2**16+this[++$t]*2**8+this[++$t];return(BigInt(Kt)<<BigInt(32))+BigInt(this[++$t]*2**24+this[++$t]*2**16+this[++$t]*2**8+Dt)}),st.prototype.readFloatLE=function($t,Rt){return $t=$t>>>0,Rt||Yt($t,4,this.length),tt.read(this,$t,!0,23,4)},st.prototype.readFloatBE=function($t,Rt){return $t=$t>>>0,Rt||Yt($t,4,this.length),tt.read(this,$t,!1,23,4)},st.prototype.readDoubleLE=function($t,Rt){return $t=$t>>>0,Rt||Yt($t,8,this.length),tt.read(this,$t,!0,52,8)},st.prototype.readDoubleBE=function($t,Rt){return $t=$t>>>0,Rt||Yt($t,8,this.length),tt.read(this,$t,!1,52,8)};function Qt(Tt,$t,Rt,Dt,Kt,nr){if(!st.isBuffer(Tt))throw new TypeError('"buffer" argument must be a Buffer instance');if($t>Kt||$t<nr)throw new RangeError('"value" argument is out of bounds');if(Rt+Dt>Tt.length)throw new RangeError("Index out of range")}st.prototype.writeUintLE=st.prototype.writeUIntLE=function($t,Rt,Dt,Kt){if($t=+$t,Rt=Rt>>>0,Dt=Dt>>>0,!Kt){const br=Math.pow(2,8*Dt)-1;Qt(this,$t,Rt,Dt,br,0)}let nr=1,sr=0;for(this[Rt]=$t&255;++sr<Dt&&(nr*=256);)this[Rt+sr]=$t/nr&255;return Rt+Dt},st.prototype.writeUintBE=st.prototype.writeUIntBE=function($t,Rt,Dt,Kt){if($t=+$t,Rt=Rt>>>0,Dt=Dt>>>0,!Kt){const br=Math.pow(2,8*Dt)-1;Qt(this,$t,Rt,Dt,br,0)}let nr=Dt-1,sr=1;for(this[Rt+nr]=$t&255;--nr>=0&&(sr*=256);)this[Rt+nr]=$t/sr&255;return Rt+Dt},st.prototype.writeUint8=st.prototype.writeUInt8=function($t,Rt,Dt){return $t=+$t,Rt=Rt>>>0,Dt||Qt(this,$t,Rt,1,255,0),this[Rt]=$t&255,Rt+1},st.prototype.writeUint16LE=st.prototype.writeUInt16LE=function($t,Rt,Dt){return $t=+$t,Rt=Rt>>>0,Dt||Qt(this,$t,Rt,2,65535,0),this[Rt]=$t&255,this[Rt+1]=$t>>>8,Rt+2},st.prototype.writeUint16BE=st.prototype.writeUInt16BE=function($t,Rt,Dt){return $t=+$t,Rt=Rt>>>0,Dt||Qt(this,$t,Rt,2,65535,0),this[Rt]=$t>>>8,this[Rt+1]=$t&255,Rt+2},st.prototype.writeUint32LE=st.prototype.writeUInt32LE=function($t,Rt,Dt){return $t=+$t,Rt=Rt>>>0,Dt||Qt(this,$t,Rt,4,4294967295,0),this[Rt+3]=$t>>>24,this[Rt+2]=$t>>>16,this[Rt+1]=$t>>>8,this[Rt]=$t&255,Rt+4},st.prototype.writeUint32BE=st.prototype.writeUInt32BE=function($t,Rt,Dt){return $t=+$t,Rt=Rt>>>0,Dt||Qt(this,$t,Rt,4,4294967295,0),this[Rt]=$t>>>24,this[Rt+1]=$t>>>16,this[Rt+2]=$t>>>8,this[Rt+3]=$t&255,Rt+4};function jt(Tt,$t,Rt,Dt,Kt){Bt($t,Dt,Kt,Tt,Rt,7);let nr=Number($t&BigInt(4294967295));Tt[Rt++]=nr,nr=nr>>8,Tt[Rt++]=nr,nr=nr>>8,Tt[Rt++]=nr,nr=nr>>8,Tt[Rt++]=nr;let sr=Number($t>>BigInt(32)&BigInt(4294967295));return Tt[Rt++]=sr,sr=sr>>8,Tt[Rt++]=sr,sr=sr>>8,Tt[Rt++]=sr,sr=sr>>8,Tt[Rt++]=sr,Rt}function Gt(Tt,$t,Rt,Dt,Kt){Bt($t,Dt,Kt,Tt,Rt,7);let nr=Number($t&BigInt(4294967295));Tt[Rt+7]=nr,nr=nr>>8,Tt[Rt+6]=nr,nr=nr>>8,Tt[Rt+5]=nr,nr=nr>>8,Tt[Rt+4]=nr;let sr=Number($t>>BigInt(32)&BigInt(4294967295));return Tt[Rt+3]=sr,sr=sr>>8,Tt[Rt+2]=sr,sr=sr>>8,Tt[Rt+1]=sr,sr=sr>>8,Tt[Rt]=sr,Rt+8}st.prototype.writeBigUInt64LE=vr(function($t,Rt=0){return jt(this,$t,Rt,BigInt(0),BigInt("0xffffffffffffffff"))}),st.prototype.writeBigUInt64BE=vr(function($t,Rt=0){return Gt(this,$t,Rt,BigInt(0),BigInt("0xffffffffffffffff"))}),st.prototype.writeIntLE=function($t,Rt,Dt,Kt){if($t=+$t,Rt=Rt>>>0,!Kt){const $r=Math.pow(2,8*Dt-1);Qt(this,$t,Rt,Dt,$r-1,-$r)}let nr=0,sr=1,br=0;for(this[Rt]=$t&255;++nr<Dt&&(sr*=256);)$t<0&&br===0&&this[Rt+nr-1]!==0&&(br=1),this[Rt+nr]=($t/sr>>0)-br&255;return Rt+Dt},st.prototype.writeIntBE=function($t,Rt,Dt,Kt){if($t=+$t,Rt=Rt>>>0,!Kt){const $r=Math.pow(2,8*Dt-1);Qt(this,$t,Rt,Dt,$r-1,-$r)}let nr=Dt-1,sr=1,br=0;for(this[Rt+nr]=$t&255;--nr>=0&&(sr*=256);)$t<0&&br===0&&this[Rt+nr+1]!==0&&(br=1),this[Rt+nr]=($t/sr>>0)-br&255;return Rt+Dt},st.prototype.writeInt8=function($t,Rt,Dt){return $t=+$t,Rt=Rt>>>0,Dt||Qt(this,$t,Rt,1,127,-128),$t<0&&($t=255+$t+1),this[Rt]=$t&255,Rt+1},st.prototype.writeInt16LE=function($t,Rt,Dt){return $t=+$t,Rt=Rt>>>0,Dt||Qt(this,$t,Rt,2,32767,-32768),this[Rt]=$t&255,this[Rt+1]=$t>>>8,Rt+2},st.prototype.writeInt16BE=function($t,Rt,Dt){return $t=+$t,Rt=Rt>>>0,Dt||Qt(this,$t,Rt,2,32767,-32768),this[Rt]=$t>>>8,this[Rt+1]=$t&255,Rt+2},st.prototype.writeInt32LE=function($t,Rt,Dt){return $t=+$t,Rt=Rt>>>0,Dt||Qt(this,$t,Rt,4,2147483647,-2147483648),this[Rt]=$t&255,this[Rt+1]=$t>>>8,this[Rt+2]=$t>>>16,this[Rt+3]=$t>>>24,Rt+4},st.prototype.writeInt32BE=function($t,Rt,Dt){return $t=+$t,Rt=Rt>>>0,Dt||Qt(this,$t,Rt,4,2147483647,-2147483648),$t<0&&($t=4294967295+$t+1),this[Rt]=$t>>>24,this[Rt+1]=$t>>>16,this[Rt+2]=$t>>>8,this[Rt+3]=$t&255,Rt+4},st.prototype.writeBigInt64LE=vr(function($t,Rt=0){return jt(this,$t,Rt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),st.prototype.writeBigInt64BE=vr(function($t,Rt=0){return Gt(this,$t,Rt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function rr(Tt,$t,Rt,Dt,Kt,nr){if(Rt+Dt>Tt.length)throw new RangeError("Index out of range");if(Rt<0)throw new RangeError("Index out of range")}function Ht(Tt,$t,Rt,Dt,Kt){return $t=+$t,Rt=Rt>>>0,Kt||rr(Tt,$t,Rt,4),tt.write(Tt,$t,Rt,Dt,23,4),Rt+4}st.prototype.writeFloatLE=function($t,Rt,Dt){return Ht(this,$t,Rt,!0,Dt)},st.prototype.writeFloatBE=function($t,Rt,Dt){return Ht(this,$t,Rt,!1,Dt)};function dr(Tt,$t,Rt,Dt,Kt){return $t=+$t,Rt=Rt>>>0,Kt||rr(Tt,$t,Rt,8),tt.write(Tt,$t,Rt,Dt,52,8),Rt+8}st.prototype.writeDoubleLE=function($t,Rt,Dt){return dr(this,$t,Rt,!0,Dt)},st.prototype.writeDoubleBE=function($t,Rt,Dt){return dr(this,$t,Rt,!1,Dt)},st.prototype.copy=function($t,Rt,Dt,Kt){if(!st.isBuffer($t))throw new TypeError("argument should be a Buffer");if(Dt||(Dt=0),!Kt&&Kt!==0&&(Kt=this.length),Rt>=$t.length&&(Rt=$t.length),Rt||(Rt=0),Kt>0&&Kt<Dt&&(Kt=Dt),Kt===Dt||$t.length===0||this.length===0)return 0;if(Rt<0)throw new RangeError("targetStart out of bounds");if(Dt<0||Dt>=this.length)throw new RangeError("Index out of range");if(Kt<0)throw new RangeError("sourceEnd out of bounds");Kt>this.length&&(Kt=this.length),$t.length-Rt<Kt-Dt&&(Kt=$t.length-Rt+Dt);const nr=Kt-Dt;return this===$t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(Rt,Dt,Kt):Uint8Array.prototype.set.call($t,this.subarray(Dt,Kt),Rt),nr},st.prototype.fill=function($t,Rt,Dt,Kt){if(typeof $t=="string"){if(typeof Rt=="string"?(Kt=Rt,Rt=0,Dt=this.length):typeof Dt=="string"&&(Kt=Dt,Dt=this.length),Kt!==void 0&&typeof Kt!="string")throw new TypeError("encoding must be a string");if(typeof Kt=="string"&&!st.isEncoding(Kt))throw new TypeError("Unknown encoding: "+Kt);if($t.length===1){const sr=$t.charCodeAt(0);(Kt==="utf8"&&sr<128||Kt==="latin1")&&($t=sr)}}else typeof $t=="number"?$t=$t&255:typeof $t=="boolean"&&($t=Number($t));if(Rt<0||this.length<Rt||this.length<Dt)throw new RangeError("Out of range index");if(Dt<=Rt)return this;Rt=Rt>>>0,Dt=Dt===void 0?this.length:Dt>>>0,$t||($t=0);let nr;if(typeof $t=="number")for(nr=Rt;nr<Dt;++nr)this[nr]=$t;else{const sr=st.isBuffer($t)?$t:st.from($t,Kt),br=sr.length;if(br===0)throw new TypeError('The value "'+$t+'" is invalid for argument "value"');for(nr=0;nr<Dt-Rt;++nr)this[nr+Rt]=sr[nr%br]}return this};const Zt={};function Jt(Tt,$t,Rt){Zt[Tt]=class extends Rt{constructor(){super(),Object.defineProperty(this,"message",{value:$t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${Tt}]`,this.stack,delete this.name}get code(){return Tt}set code(Kt){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Kt,writable:!0})}toString(){return`${this.name} [${Tt}]: ${this.message}`}}}Jt("ERR_BUFFER_OUT_OF_BOUNDS",function(Tt){return Tt?`${Tt} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Jt("ERR_INVALID_ARG_TYPE",function(Tt,$t){return`The "${Tt}" argument must be of type number. Received type ${typeof $t}`},TypeError),Jt("ERR_OUT_OF_RANGE",function(Tt,$t,Rt){let Dt=`The value of "${Tt}" is out of range.`,Kt=Rt;return Number.isInteger(Rt)&&Math.abs(Rt)>2**32?Kt=tr(String(Rt)):typeof Rt=="bigint"&&(Kt=String(Rt),(Rt>BigInt(2)**BigInt(32)||Rt<-(BigInt(2)**BigInt(32)))&&(Kt=tr(Kt)),Kt+="n"),Dt+=` It must be ${$t}. Received ${Kt}`,Dt},RangeError);function tr(Tt){let $t="",Rt=Tt.length;const Dt=Tt[0]==="-"?1:0;for(;Rt>=Dt+4;Rt-=3)$t=`_${Tt.slice(Rt-3,Rt)}${$t}`;return`${Tt.slice(0,Rt)}${$t}`}function _t(Tt,$t,Rt){Vt($t,"offset"),(Tt[$t]===void 0||Tt[$t+Rt]===void 0)&&er($t,Tt.length-(Rt+1))}function Bt(Tt,$t,Rt,Dt,Kt,nr){if(Tt>Rt||Tt<$t){const sr=typeof $t=="bigint"?"n":"";let br;throw $t===0||$t===BigInt(0)?br=`>= 0${sr} and < 2${sr} ** ${(nr+1)*8}${sr}`:br=`>= -(2${sr} ** ${(nr+1)*8-1}${sr}) and < 2 ** ${(nr+1)*8-1}${sr}`,new Zt.ERR_OUT_OF_RANGE("value",br,Tt)}_t(Dt,Kt,nr)}function Vt(Tt,$t){if(typeof Tt!="number")throw new Zt.ERR_INVALID_ARG_TYPE($t,"number",Tt)}function er(Tt,$t,Rt){throw Math.floor(Tt)!==Tt?(Vt(Tt,Rt),new Zt.ERR_OUT_OF_RANGE("offset","an integer",Tt)):$t<0?new Zt.ERR_BUFFER_OUT_OF_BOUNDS:new Zt.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${$t}`,Tt)}const ar=/[^+/0-9A-Za-z-_]/g;function ur(Tt){if(Tt=Tt.split("=")[0],Tt=Tt.trim().replace(ar,""),Tt.length<2)return"";for(;Tt.length%4!==0;)Tt=Tt+"=";return Tt}function cr(Tt,$t){$t=$t||1/0;let Rt;const Dt=Tt.length;let Kt=null;const nr=[];for(let sr=0;sr<Dt;++sr){if(Rt=Tt.charCodeAt(sr),Rt>55295&&Rt<57344){if(!Kt){if(Rt>56319){($t-=3)>-1&&nr.push(239,191,189);continue}else if(sr+1===Dt){($t-=3)>-1&&nr.push(239,191,189);continue}Kt=Rt;continue}if(Rt<56320){($t-=3)>-1&&nr.push(239,191,189),Kt=Rt;continue}Rt=(Kt-55296<<10|Rt-56320)+65536}else Kt&&($t-=3)>-1&&nr.push(239,191,189);if(Kt=null,Rt<128){if(($t-=1)<0)break;nr.push(Rt)}else if(Rt<2048){if(($t-=2)<0)break;nr.push(Rt>>6|192,Rt&63|128)}else if(Rt<65536){if(($t-=3)<0)break;nr.push(Rt>>12|224,Rt>>6&63|128,Rt&63|128)}else if(Rt<1114112){if(($t-=4)<0)break;nr.push(Rt>>18|240,Rt>>12&63|128,Rt>>6&63|128,Rt&63|128)}else throw new Error("Invalid code point")}return nr}function hr(Tt){const $t=[];for(let Rt=0;Rt<Tt.length;++Rt)$t.push(Tt.charCodeAt(Rt)&255);return $t}function Sr(Tt,$t){let Rt,Dt,Kt;const nr=[];for(let sr=0;sr<Tt.length&&!(($t-=2)<0);++sr)Rt=Tt.charCodeAt(sr),Dt=Rt>>8,Kt=Rt%256,nr.push(Kt),nr.push(Dt);return nr}function pr(Tt){return o.toByteArray(ur(Tt))}function wr(Tt,$t,Rt,Dt){let Kt;for(Kt=0;Kt<Dt&&!(Kt+Rt>=$t.length||Kt>=Tt.length);++Kt)$t[Kt+Rt]=Tt[Kt];return Kt}function _r(Tt,$t){return Tt instanceof $t||Tt!=null&&Tt.constructor!=null&&Tt.constructor.name!=null&&Tt.constructor.name===$t.name}function Tr(Tt){return Tt!==Tt}const gr=function(){const Tt="0123456789abcdef",$t=new Array(256);for(let Rt=0;Rt<16;++Rt){const Dt=Rt*16;for(let Kt=0;Kt<16;++Kt)$t[Dt+Kt]=Tt[Rt]+Tt[Kt]}return $t}();function vr(Tt){return typeof BigInt>"u"?ir:Tt}function ir(){throw new Error("BigInt not supported")}})(buffer$2);var reactDom={exports:{}},reactDom_production_min={},scheduler={exports:{}},scheduler_production_min={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/(function(et){function o(Ft,qt){var Pt=Ft.length;Ft.push(qt);e:for(;0<Pt;){var Yt=Pt-1>>>1,Qt=Ft[Yt];if(0<nt(Qt,qt))Ft[Yt]=qt,Ft[Pt]=Qt,Pt=Yt;else break e}}function tt(Ft){return Ft.length===0?null:Ft[0]}function rt(Ft){if(Ft.length===0)return null;var qt=Ft[0],Pt=Ft.pop();if(Pt!==qt){Ft[0]=Pt;e:for(var Yt=0,Qt=Ft.length,jt=Qt>>>1;Yt<jt;){var Gt=2*(Yt+1)-1,rr=Ft[Gt],Ht=Gt+1,dr=Ft[Ht];if(0>nt(rr,Pt))Ht<Qt&&0>nt(dr,rr)?(Ft[Yt]=dr,Ft[Ht]=Pt,Yt=Ht):(Ft[Yt]=rr,Ft[Gt]=Pt,Yt=Gt);else if(Ht<Qt&&0>nt(dr,Pt))Ft[Yt]=dr,Ft[Ht]=Pt,Yt=Ht;else break e}}return qt}function nt(Ft,qt){var Pt=Ft.sortIndex-qt.sortIndex;return Pt!==0?Pt:Ft.id-qt.id}if(typeof performance=="object"&&typeof performance.now=="function"){var ot=performance;et.unstable_now=function(){return ot.now()}}else{var it=Date,st=it.now();et.unstable_now=function(){return it.now()-st}}var at=[],ct=[],lt=1,dt=null,ht=3,mt=!1,ft=!1,pt=!1,yt=typeof setTimeout=="function"?setTimeout:null,gt=typeof clearTimeout=="function"?clearTimeout:null,bt=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function xt(Ft){for(var qt=tt(ct);qt!==null;){if(qt.callback===null)rt(ct);else if(qt.startTime<=Ft)rt(ct),qt.sortIndex=qt.expirationTime,o(at,qt);else break;qt=tt(ct)}}function vt(Ft){if(pt=!1,xt(Ft),!ft)if(tt(at)!==null)ft=!0,Xt(Et);else{var qt=tt(ct);qt!==null&&Wt(vt,qt.startTime-Ft)}}function Et(Ft,qt){ft=!1,pt&&(pt=!1,gt(At),At=-1),mt=!0;var Pt=ht;try{for(xt(qt),dt=tt(at);dt!==null&&(!(dt.expirationTime>qt)||Ft&&!Nt());){var Yt=dt.callback;if(typeof Yt=="function"){dt.callback=null,ht=dt.priorityLevel;var Qt=Yt(dt.expirationTime<=qt);qt=et.unstable_now(),typeof Qt=="function"?dt.callback=Qt:dt===tt(at)&&rt(at),xt(qt)}else rt(at);dt=tt(at)}if(dt!==null)var jt=!0;else{var Gt=tt(ct);Gt!==null&&Wt(vt,Gt.startTime-qt),jt=!1}return jt}finally{dt=null,ht=Pt,mt=!1}}var Ct=!1,St=null,At=-1,kt=5,It=-1;function Nt(){return!(et.unstable_now()-It<kt)}function Lt(){if(St!==null){var Ft=et.unstable_now();It=Ft;var qt=!0;try{qt=St(!0,Ft)}finally{qt?Mt():(Ct=!1,St=null)}}else Ct=!1}var Mt;if(typeof bt=="function")Mt=function(){bt(Lt)};else if(typeof MessageChannel<"u"){var zt=new MessageChannel,Ut=zt.port2;zt.port1.onmessage=Lt,Mt=function(){Ut.postMessage(null)}}else Mt=function(){yt(Lt,0)};function Xt(Ft){St=Ft,Ct||(Ct=!0,Mt())}function Wt(Ft,qt){At=yt(function(){Ft(et.unstable_now())},qt)}et.unstable_IdlePriority=5,et.unstable_ImmediatePriority=1,et.unstable_LowPriority=4,et.unstable_NormalPriority=3,et.unstable_Profiling=null,et.unstable_UserBlockingPriority=2,et.unstable_cancelCallback=function(Ft){Ft.callback=null},et.unstable_continueExecution=function(){ft||mt||(ft=!0,Xt(Et))},et.unstable_forceFrameRate=function(Ft){0>Ft||125<Ft?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):kt=0<Ft?Math.floor(1e3/Ft):5},et.unstable_getCurrentPriorityLevel=function(){return ht},et.unstable_getFirstCallbackNode=function(){return tt(at)},et.unstable_next=function(Ft){switch(ht){case 1:case 2:case 3:var qt=3;break;default:qt=ht}var Pt=ht;ht=qt;try{return Ft()}finally{ht=Pt}},et.unstable_pauseExecution=function(){},et.unstable_requestPaint=function(){},et.unstable_runWithPriority=function(Ft,qt){switch(Ft){case 1:case 2:case 3:case 4:case 5:break;default:Ft=3}var Pt=ht;ht=Ft;try{return qt()}finally{ht=Pt}},et.unstable_scheduleCallback=function(Ft,qt,Pt){var Yt=et.unstable_now();switch(typeof Pt=="object"&&Pt!==null?(Pt=Pt.delay,Pt=typeof Pt=="number"&&0<Pt?Yt+Pt:Yt):Pt=Yt,Ft){case 1:var Qt=-1;break;case 2:Qt=250;break;case 5:Qt=1073741823;break;case 4:Qt=1e4;break;default:Qt=5e3}return Qt=Pt+Qt,Ft={id:lt++,callback:qt,priorityLevel:Ft,startTime:Pt,expirationTime:Qt,sortIndex:-1},Pt>Yt?(Ft.sortIndex=Pt,o(ct,Ft),tt(at)===null&&Ft===tt(ct)&&(pt?(gt(At),At=-1):pt=!0,Wt(vt,Pt-Yt))):(Ft.sortIndex=Qt,o(at,Ft),ft||mt||(ft=!0,Xt(Et))),Ft},et.unstable_shouldYield=Nt,et.unstable_wrapCallback=function(Ft){var qt=ht;return function(){var Pt=ht;ht=qt;try{return Ft.apply(this,arguments)}finally{ht=Pt}}}})(scheduler_production_min);scheduler.exports=scheduler_production_min;var schedulerExports=scheduler.exports;/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var aa=reactExports,ca$1=schedulerExports;function p$4(et){for(var o="https://reactjs.org/docs/error-decoder.html?invariant="+et,tt=1;tt<arguments.length;tt++)o+="&args[]="+encodeURIComponent(arguments[tt]);return"Minified React error #"+et+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var da=new Set,ea={};function fa(et,o){ha(et,o),ha(et+"Capture",o)}function ha(et,o){for(ea[et]=o,et=0;et<o.length;et++)da.add(o[et])}var ia=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ja=Object.prototype.hasOwnProperty,ka=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,la={},ma={};function oa(et){return ja.call(ma,et)?!0:ja.call(la,et)?!1:ka.test(et)?ma[et]=!0:(la[et]=!0,!1)}function pa(et,o,tt,rt){if(tt!==null&&tt.type===0)return!1;switch(typeof o){case"function":case"symbol":return!0;case"boolean":return rt?!1:tt!==null?!tt.acceptsBooleans:(et=et.toLowerCase().slice(0,5),et!=="data-"&&et!=="aria-");default:return!1}}function qa(et,o,tt,rt){if(o===null||typeof o>"u"||pa(et,o,tt,rt))return!0;if(rt)return!1;if(tt!==null)switch(tt.type){case 3:return!o;case 4:return o===!1;case 5:return isNaN(o);case 6:return isNaN(o)||1>o}return!1}function v$4(et,o,tt,rt,nt,ot,it){this.acceptsBooleans=o===2||o===3||o===4,this.attributeName=rt,this.attributeNamespace=nt,this.mustUseProperty=tt,this.propertyName=et,this.type=o,this.sanitizeURL=ot,this.removeEmptyString=it}var z$2={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(et){z$2[et]=new v$4(et,0,!1,et,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(et){var o=et[0];z$2[o]=new v$4(o,1,!1,et[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(et){z$2[et]=new v$4(et,2,!1,et.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(et){z$2[et]=new v$4(et,2,!1,et,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(et){z$2[et]=new v$4(et,3,!1,et.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(et){z$2[et]=new v$4(et,3,!0,et,null,!1,!1)});["capture","download"].forEach(function(et){z$2[et]=new v$4(et,4,!1,et,null,!1,!1)});["cols","rows","size","span"].forEach(function(et){z$2[et]=new v$4(et,6,!1,et,null,!1,!1)});["rowSpan","start"].forEach(function(et){z$2[et]=new v$4(et,5,!1,et.toLowerCase(),null,!1,!1)});var ra$1=/[\-:]([a-z])/g;function sa(et){return et[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(et){var o=et.replace(ra$1,sa);z$2[o]=new v$4(o,1,!1,et,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(et){var o=et.replace(ra$1,sa);z$2[o]=new v$4(o,1,!1,et,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(et){var o=et.replace(ra$1,sa);z$2[o]=new v$4(o,1,!1,et,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(et){z$2[et]=new v$4(et,1,!1,et.toLowerCase(),null,!1,!1)});z$2.xlinkHref=new v$4("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(et){z$2[et]=new v$4(et,1,!1,et.toLowerCase(),null,!0,!0)});function ta(et,o,tt,rt){var nt=z$2.hasOwnProperty(o)?z$2[o]:null;(nt!==null?nt.type!==0:rt||!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(qa(o,tt,nt,rt)&&(tt=null),rt||nt===null?oa(o)&&(tt===null?et.removeAttribute(o):et.setAttribute(o,""+tt)):nt.mustUseProperty?et[nt.propertyName]=tt===null?nt.type===3?!1:"":tt:(o=nt.attributeName,rt=nt.attributeNamespace,tt===null?et.removeAttribute(o):(nt=nt.type,tt=nt===3||nt===4&&tt===!0?"":""+tt,rt?et.setAttributeNS(rt,o,tt):et.setAttribute(o,tt))))}var ua=aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,va=Symbol.for("react.element"),wa=Symbol.for("react.portal"),ya=Symbol.for("react.fragment"),za=Symbol.for("react.strict_mode"),Aa=Symbol.for("react.profiler"),Ba=Symbol.for("react.provider"),Ca=Symbol.for("react.context"),Da=Symbol.for("react.forward_ref"),Ea=Symbol.for("react.suspense"),Fa=Symbol.for("react.suspense_list"),Ga=Symbol.for("react.memo"),Ha=Symbol.for("react.lazy"),Ia=Symbol.for("react.offscreen"),Ja=Symbol.iterator;function Ka(et){return et===null||typeof et!="object"?null:(et=Ja&&et[Ja]||et["@@iterator"],typeof et=="function"?et:null)}var A$1=Object.assign,La;function Ma(et){if(La===void 0)try{throw Error()}catch(tt){var o=tt.stack.trim().match(/\n( *(at )?)/);La=o&&o[1]||""}return`
`+La+et}var Na=!1;function Oa(et,o){if(!et||Na)return"";Na=!0;var tt=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(o)if(o=function(){throw Error()},Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(ct){var rt=ct}Reflect.construct(et,[],o)}else{try{o.call()}catch(ct){rt=ct}et.call(o.prototype)}else{try{throw Error()}catch(ct){rt=ct}et()}}catch(ct){if(ct&&rt&&typeof ct.stack=="string"){for(var nt=ct.stack.split(`
`),ot=rt.stack.split(`
`),it=nt.length-1,st=ot.length-1;1<=it&&0<=st&&nt[it]!==ot[st];)st--;for(;1<=it&&0<=st;it--,st--)if(nt[it]!==ot[st]){if(it!==1||st!==1)do if(it--,st--,0>st||nt[it]!==ot[st]){var at=`
`+nt[it].replace(" at new "," at ");return et.displayName&&at.includes("<anonymous>")&&(at=at.replace("<anonymous>",et.displayName)),at}while(1<=it&&0<=st);break}}}finally{Na=!1,Error.prepareStackTrace=tt}return(et=et?et.displayName||et.name:"")?Ma(et):""}function Pa(et){switch(et.tag){case 5:return Ma(et.type);case 16:return Ma("Lazy");case 13:return Ma("Suspense");case 19:return Ma("SuspenseList");case 0:case 2:case 15:return et=Oa(et.type,!1),et;case 11:return et=Oa(et.type.render,!1),et;case 1:return et=Oa(et.type,!0),et;default:return""}}function Qa(et){if(et==null)return null;if(typeof et=="function")return et.displayName||et.name||null;if(typeof et=="string")return et;switch(et){case ya:return"Fragment";case wa:return"Portal";case Aa:return"Profiler";case za:return"StrictMode";case Ea:return"Suspense";case Fa:return"SuspenseList"}if(typeof et=="object")switch(et.$$typeof){case Ca:return(et.displayName||"Context")+".Consumer";case Ba:return(et._context.displayName||"Context")+".Provider";case Da:var o=et.render;return et=et.displayName,et||(et=o.displayName||o.name||"",et=et!==""?"ForwardRef("+et+")":"ForwardRef"),et;case Ga:return o=et.displayName||null,o!==null?o:Qa(et.type)||"Memo";case Ha:o=et._payload,et=et._init;try{return Qa(et(o))}catch{}}return null}function Ra(et){var o=et.type;switch(et.tag){case 24:return"Cache";case 9:return(o.displayName||"Context")+".Consumer";case 10:return(o._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return et=o.render,et=et.displayName||et.name||"",o.displayName||(et!==""?"ForwardRef("+et+")":"ForwardRef");case 7:return"Fragment";case 5:return o;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Qa(o);case 8:return o===za?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o}return null}function Sa(et){switch(typeof et){case"boolean":case"number":case"string":case"undefined":return et;case"object":return et;default:return""}}function Ta(et){var o=et.type;return(et=et.nodeName)&&et.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Ua(et){var o=Ta(et)?"checked":"value",tt=Object.getOwnPropertyDescriptor(et.constructor.prototype,o),rt=""+et[o];if(!et.hasOwnProperty(o)&&typeof tt<"u"&&typeof tt.get=="function"&&typeof tt.set=="function"){var nt=tt.get,ot=tt.set;return Object.defineProperty(et,o,{configurable:!0,get:function(){return nt.call(this)},set:function(it){rt=""+it,ot.call(this,it)}}),Object.defineProperty(et,o,{enumerable:tt.enumerable}),{getValue:function(){return rt},setValue:function(it){rt=""+it},stopTracking:function(){et._valueTracker=null,delete et[o]}}}}function Va(et){et._valueTracker||(et._valueTracker=Ua(et))}function Wa(et){if(!et)return!1;var o=et._valueTracker;if(!o)return!0;var tt=o.getValue(),rt="";return et&&(rt=Ta(et)?et.checked?"true":"false":et.value),et=rt,et!==tt?(o.setValue(et),!0):!1}function Xa(et){if(et=et||(typeof document<"u"?document:void 0),typeof et>"u")return null;try{return et.activeElement||et.body}catch{return et.body}}function Ya(et,o){var tt=o.checked;return A$1({},o,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:tt??et._wrapperState.initialChecked})}function Za(et,o){var tt=o.defaultValue==null?"":o.defaultValue,rt=o.checked!=null?o.checked:o.defaultChecked;tt=Sa(o.value!=null?o.value:tt),et._wrapperState={initialChecked:rt,initialValue:tt,controlled:o.type==="checkbox"||o.type==="radio"?o.checked!=null:o.value!=null}}function ab(et,o){o=o.checked,o!=null&&ta(et,"checked",o,!1)}function bb(et,o){ab(et,o);var tt=Sa(o.value),rt=o.type;if(tt!=null)rt==="number"?(tt===0&&et.value===""||et.value!=tt)&&(et.value=""+tt):et.value!==""+tt&&(et.value=""+tt);else if(rt==="submit"||rt==="reset"){et.removeAttribute("value");return}o.hasOwnProperty("value")?cb$1(et,o.type,tt):o.hasOwnProperty("defaultValue")&&cb$1(et,o.type,Sa(o.defaultValue)),o.checked==null&&o.defaultChecked!=null&&(et.defaultChecked=!!o.defaultChecked)}function db(et,o,tt){if(o.hasOwnProperty("value")||o.hasOwnProperty("defaultValue")){var rt=o.type;if(!(rt!=="submit"&&rt!=="reset"||o.value!==void 0&&o.value!==null))return;o=""+et._wrapperState.initialValue,tt||o===et.value||(et.value=o),et.defaultValue=o}tt=et.name,tt!==""&&(et.name=""),et.defaultChecked=!!et._wrapperState.initialChecked,tt!==""&&(et.name=tt)}function cb$1(et,o,tt){(o!=="number"||Xa(et.ownerDocument)!==et)&&(tt==null?et.defaultValue=""+et._wrapperState.initialValue:et.defaultValue!==""+tt&&(et.defaultValue=""+tt))}var eb=Array.isArray;function fb(et,o,tt,rt){if(et=et.options,o){o={};for(var nt=0;nt<tt.length;nt++)o["$"+tt[nt]]=!0;for(tt=0;tt<et.length;tt++)nt=o.hasOwnProperty("$"+et[tt].value),et[tt].selected!==nt&&(et[tt].selected=nt),nt&&rt&&(et[tt].defaultSelected=!0)}else{for(tt=""+Sa(tt),o=null,nt=0;nt<et.length;nt++){if(et[nt].value===tt){et[nt].selected=!0,rt&&(et[nt].defaultSelected=!0);return}o!==null||et[nt].disabled||(o=et[nt])}o!==null&&(o.selected=!0)}}function gb(et,o){if(o.dangerouslySetInnerHTML!=null)throw Error(p$4(91));return A$1({},o,{value:void 0,defaultValue:void 0,children:""+et._wrapperState.initialValue})}function hb(et,o){var tt=o.value;if(tt==null){if(tt=o.children,o=o.defaultValue,tt!=null){if(o!=null)throw Error(p$4(92));if(eb(tt)){if(1<tt.length)throw Error(p$4(93));tt=tt[0]}o=tt}o==null&&(o=""),tt=o}et._wrapperState={initialValue:Sa(tt)}}function ib(et,o){var tt=Sa(o.value),rt=Sa(o.defaultValue);tt!=null&&(tt=""+tt,tt!==et.value&&(et.value=tt),o.defaultValue==null&&et.defaultValue!==tt&&(et.defaultValue=tt)),rt!=null&&(et.defaultValue=""+rt)}function jb(et){var o=et.textContent;o===et._wrapperState.initialValue&&o!==""&&o!==null&&(et.value=o)}function kb(et){switch(et){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function lb(et,o){return et==null||et==="http://www.w3.org/1999/xhtml"?kb(o):et==="http://www.w3.org/2000/svg"&&o==="foreignObject"?"http://www.w3.org/1999/xhtml":et}var mb,nb=function(et){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(o,tt,rt,nt){MSApp.execUnsafeLocalFunction(function(){return et(o,tt,rt,nt)})}:et}(function(et,o){if(et.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in et)et.innerHTML=o;else{for(mb=mb||document.createElement("div"),mb.innerHTML="<svg>"+o.valueOf().toString()+"</svg>",o=mb.firstChild;et.firstChild;)et.removeChild(et.firstChild);for(;o.firstChild;)et.appendChild(o.firstChild)}});function ob(et,o){if(o){var tt=et.firstChild;if(tt&&tt===et.lastChild&&tt.nodeType===3){tt.nodeValue=o;return}}et.textContent=o}var pb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qb=["Webkit","ms","Moz","O"];Object.keys(pb).forEach(function(et){qb.forEach(function(o){o=o+et.charAt(0).toUpperCase()+et.substring(1),pb[o]=pb[et]})});function rb(et,o,tt){return o==null||typeof o=="boolean"||o===""?"":tt||typeof o!="number"||o===0||pb.hasOwnProperty(et)&&pb[et]?(""+o).trim():o+"px"}function sb(et,o){et=et.style;for(var tt in o)if(o.hasOwnProperty(tt)){var rt=tt.indexOf("--")===0,nt=rb(tt,o[tt],rt);tt==="float"&&(tt="cssFloat"),rt?et.setProperty(tt,nt):et[tt]=nt}}var tb=A$1({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ub(et,o){if(o){if(tb[et]&&(o.children!=null||o.dangerouslySetInnerHTML!=null))throw Error(p$4(137,et));if(o.dangerouslySetInnerHTML!=null){if(o.children!=null)throw Error(p$4(60));if(typeof o.dangerouslySetInnerHTML!="object"||!("__html"in o.dangerouslySetInnerHTML))throw Error(p$4(61))}if(o.style!=null&&typeof o.style!="object")throw Error(p$4(62))}}function vb(et,o){if(et.indexOf("-")===-1)return typeof o.is=="string";switch(et){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var wb=null;function xb(et){return et=et.target||et.srcElement||window,et.correspondingUseElement&&(et=et.correspondingUseElement),et.nodeType===3?et.parentNode:et}var yb=null,zb=null,Ab=null;function Bb(et){if(et=Cb(et)){if(typeof yb!="function")throw Error(p$4(280));var o=et.stateNode;o&&(o=Db(o),yb(et.stateNode,et.type,o))}}function Eb(et){zb?Ab?Ab.push(et):Ab=[et]:zb=et}function Fb(){if(zb){var et=zb,o=Ab;if(Ab=zb=null,Bb(et),o)for(et=0;et<o.length;et++)Bb(o[et])}}function Gb(et,o){return et(o)}function Hb(){}var Ib=!1;function Jb(et,o,tt){if(Ib)return et(o,tt);Ib=!0;try{return Gb(et,o,tt)}finally{Ib=!1,(zb!==null||Ab!==null)&&(Hb(),Fb())}}function Kb(et,o){var tt=et.stateNode;if(tt===null)return null;var rt=Db(tt);if(rt===null)return null;tt=rt[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(rt=!rt.disabled)||(et=et.type,rt=!(et==="button"||et==="input"||et==="select"||et==="textarea")),et=!rt;break e;default:et=!1}if(et)return null;if(tt&&typeof tt!="function")throw Error(p$4(231,o,typeof tt));return tt}var Lb=!1;if(ia)try{var Mb={};Object.defineProperty(Mb,"passive",{get:function(){Lb=!0}}),window.addEventListener("test",Mb,Mb),window.removeEventListener("test",Mb,Mb)}catch{Lb=!1}function Nb(et,o,tt,rt,nt,ot,it,st,at){var ct=Array.prototype.slice.call(arguments,3);try{o.apply(tt,ct)}catch(lt){this.onError(lt)}}var Ob=!1,Pb=null,Qb=!1,Rb=null,Sb={onError:function(et){Ob=!0,Pb=et}};function Tb(et,o,tt,rt,nt,ot,it,st,at){Ob=!1,Pb=null,Nb.apply(Sb,arguments)}function Ub(et,o,tt,rt,nt,ot,it,st,at){if(Tb.apply(this,arguments),Ob){if(Ob){var ct=Pb;Ob=!1,Pb=null}else throw Error(p$4(198));Qb||(Qb=!0,Rb=ct)}}function Vb(et){var o=et,tt=et;if(et.alternate)for(;o.return;)o=o.return;else{et=o;do o=et,o.flags&4098&&(tt=o.return),et=o.return;while(et)}return o.tag===3?tt:null}function Wb(et){if(et.tag===13){var o=et.memoizedState;if(o===null&&(et=et.alternate,et!==null&&(o=et.memoizedState)),o!==null)return o.dehydrated}return null}function Xb(et){if(Vb(et)!==et)throw Error(p$4(188))}function Yb(et){var o=et.alternate;if(!o){if(o=Vb(et),o===null)throw Error(p$4(188));return o!==et?null:et}for(var tt=et,rt=o;;){var nt=tt.return;if(nt===null)break;var ot=nt.alternate;if(ot===null){if(rt=nt.return,rt!==null){tt=rt;continue}break}if(nt.child===ot.child){for(ot=nt.child;ot;){if(ot===tt)return Xb(nt),et;if(ot===rt)return Xb(nt),o;ot=ot.sibling}throw Error(p$4(188))}if(tt.return!==rt.return)tt=nt,rt=ot;else{for(var it=!1,st=nt.child;st;){if(st===tt){it=!0,tt=nt,rt=ot;break}if(st===rt){it=!0,rt=nt,tt=ot;break}st=st.sibling}if(!it){for(st=ot.child;st;){if(st===tt){it=!0,tt=ot,rt=nt;break}if(st===rt){it=!0,rt=ot,tt=nt;break}st=st.sibling}if(!it)throw Error(p$4(189))}}if(tt.alternate!==rt)throw Error(p$4(190))}if(tt.tag!==3)throw Error(p$4(188));return tt.stateNode.current===tt?et:o}function Zb(et){return et=Yb(et),et!==null?$b(et):null}function $b(et){if(et.tag===5||et.tag===6)return et;for(et=et.child;et!==null;){var o=$b(et);if(o!==null)return o;et=et.sibling}return null}var ac=ca$1.unstable_scheduleCallback,bc=ca$1.unstable_cancelCallback,cc$1=ca$1.unstable_shouldYield,dc=ca$1.unstable_requestPaint,B$1=ca$1.unstable_now,ec=ca$1.unstable_getCurrentPriorityLevel,fc=ca$1.unstable_ImmediatePriority,gc=ca$1.unstable_UserBlockingPriority,hc=ca$1.unstable_NormalPriority,ic=ca$1.unstable_LowPriority,jc=ca$1.unstable_IdlePriority,kc=null,lc=null;function mc(et){if(lc&&typeof lc.onCommitFiberRoot=="function")try{lc.onCommitFiberRoot(kc,et,void 0,(et.current.flags&128)===128)}catch{}}var oc=Math.clz32?Math.clz32:nc,pc=Math.log,qc=Math.LN2;function nc(et){return et>>>=0,et===0?32:31-(pc(et)/qc|0)|0}var rc=64,sc=4194304;function tc(et){switch(et&-et){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return et&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return et&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return et}}function uc(et,o){var tt=et.pendingLanes;if(tt===0)return 0;var rt=0,nt=et.suspendedLanes,ot=et.pingedLanes,it=tt&268435455;if(it!==0){var st=it&~nt;st!==0?rt=tc(st):(ot&=it,ot!==0&&(rt=tc(ot)))}else it=tt&~nt,it!==0?rt=tc(it):ot!==0&&(rt=tc(ot));if(rt===0)return 0;if(o!==0&&o!==rt&&!(o&nt)&&(nt=rt&-rt,ot=o&-o,nt>=ot||nt===16&&(ot&4194240)!==0))return o;if(rt&4&&(rt|=tt&16),o=et.entangledLanes,o!==0)for(et=et.entanglements,o&=rt;0<o;)tt=31-oc(o),nt=1<<tt,rt|=et[tt],o&=~nt;return rt}function vc(et,o){switch(et){case 1:case 2:case 4:return o+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function wc(et,o){for(var tt=et.suspendedLanes,rt=et.pingedLanes,nt=et.expirationTimes,ot=et.pendingLanes;0<ot;){var it=31-oc(ot),st=1<<it,at=nt[it];at===-1?(!(st&tt)||st&rt)&&(nt[it]=vc(st,o)):at<=o&&(et.expiredLanes|=st),ot&=~st}}function xc(et){return et=et.pendingLanes&-1073741825,et!==0?et:et&1073741824?1073741824:0}function yc(){var et=rc;return rc<<=1,!(rc&4194240)&&(rc=64),et}function zc(et){for(var o=[],tt=0;31>tt;tt++)o.push(et);return o}function Ac(et,o,tt){et.pendingLanes|=o,o!==536870912&&(et.suspendedLanes=0,et.pingedLanes=0),et=et.eventTimes,o=31-oc(o),et[o]=tt}function Bc(et,o){var tt=et.pendingLanes&~o;et.pendingLanes=o,et.suspendedLanes=0,et.pingedLanes=0,et.expiredLanes&=o,et.mutableReadLanes&=o,et.entangledLanes&=o,o=et.entanglements;var rt=et.eventTimes;for(et=et.expirationTimes;0<tt;){var nt=31-oc(tt),ot=1<<nt;o[nt]=0,rt[nt]=-1,et[nt]=-1,tt&=~ot}}function Cc(et,o){var tt=et.entangledLanes|=o;for(et=et.entanglements;tt;){var rt=31-oc(tt),nt=1<<rt;nt&o|et[rt]&o&&(et[rt]|=o),tt&=~nt}}var C$1=0;function Dc(et){return et&=-et,1<et?4<et?et&268435455?16:536870912:4:1}var Ec,Fc,Gc,Hc,Ic,Jc=!1,Kc=[],Lc=null,Mc=null,Nc=null,Oc=new Map,Pc=new Map,Qc=[],Rc="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Sc(et,o){switch(et){case"focusin":case"focusout":Lc=null;break;case"dragenter":case"dragleave":Mc=null;break;case"mouseover":case"mouseout":Nc=null;break;case"pointerover":case"pointerout":Oc.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pc.delete(o.pointerId)}}function Tc(et,o,tt,rt,nt,ot){return et===null||et.nativeEvent!==ot?(et={blockedOn:o,domEventName:tt,eventSystemFlags:rt,nativeEvent:ot,targetContainers:[nt]},o!==null&&(o=Cb(o),o!==null&&Fc(o)),et):(et.eventSystemFlags|=rt,o=et.targetContainers,nt!==null&&o.indexOf(nt)===-1&&o.push(nt),et)}function Uc(et,o,tt,rt,nt){switch(o){case"focusin":return Lc=Tc(Lc,et,o,tt,rt,nt),!0;case"dragenter":return Mc=Tc(Mc,et,o,tt,rt,nt),!0;case"mouseover":return Nc=Tc(Nc,et,o,tt,rt,nt),!0;case"pointerover":var ot=nt.pointerId;return Oc.set(ot,Tc(Oc.get(ot)||null,et,o,tt,rt,nt)),!0;case"gotpointercapture":return ot=nt.pointerId,Pc.set(ot,Tc(Pc.get(ot)||null,et,o,tt,rt,nt)),!0}return!1}function Vc(et){var o=Wc(et.target);if(o!==null){var tt=Vb(o);if(tt!==null){if(o=tt.tag,o===13){if(o=Wb(tt),o!==null){et.blockedOn=o,Ic(et.priority,function(){Gc(tt)});return}}else if(o===3&&tt.stateNode.current.memoizedState.isDehydrated){et.blockedOn=tt.tag===3?tt.stateNode.containerInfo:null;return}}}et.blockedOn=null}function Xc(et){if(et.blockedOn!==null)return!1;for(var o=et.targetContainers;0<o.length;){var tt=Yc(et.domEventName,et.eventSystemFlags,o[0],et.nativeEvent);if(tt===null){tt=et.nativeEvent;var rt=new tt.constructor(tt.type,tt);wb=rt,tt.target.dispatchEvent(rt),wb=null}else return o=Cb(tt),o!==null&&Fc(o),et.blockedOn=tt,!1;o.shift()}return!0}function Zc(et,o,tt){Xc(et)&&tt.delete(o)}function $c(){Jc=!1,Lc!==null&&Xc(Lc)&&(Lc=null),Mc!==null&&Xc(Mc)&&(Mc=null),Nc!==null&&Xc(Nc)&&(Nc=null),Oc.forEach(Zc),Pc.forEach(Zc)}function ad(et,o){et.blockedOn===o&&(et.blockedOn=null,Jc||(Jc=!0,ca$1.unstable_scheduleCallback(ca$1.unstable_NormalPriority,$c)))}function bd(et){function o(nt){return ad(nt,et)}if(0<Kc.length){ad(Kc[0],et);for(var tt=1;tt<Kc.length;tt++){var rt=Kc[tt];rt.blockedOn===et&&(rt.blockedOn=null)}}for(Lc!==null&&ad(Lc,et),Mc!==null&&ad(Mc,et),Nc!==null&&ad(Nc,et),Oc.forEach(o),Pc.forEach(o),tt=0;tt<Qc.length;tt++)rt=Qc[tt],rt.blockedOn===et&&(rt.blockedOn=null);for(;0<Qc.length&&(tt=Qc[0],tt.blockedOn===null);)Vc(tt),tt.blockedOn===null&&Qc.shift()}var cd=ua.ReactCurrentBatchConfig,dd=!0;function ed(et,o,tt,rt){var nt=C$1,ot=cd.transition;cd.transition=null;try{C$1=1,fd(et,o,tt,rt)}finally{C$1=nt,cd.transition=ot}}function gd(et,o,tt,rt){var nt=C$1,ot=cd.transition;cd.transition=null;try{C$1=4,fd(et,o,tt,rt)}finally{C$1=nt,cd.transition=ot}}function fd(et,o,tt,rt){if(dd){var nt=Yc(et,o,tt,rt);if(nt===null)hd(et,o,rt,id$1,tt),Sc(et,rt);else if(Uc(nt,et,o,tt,rt))rt.stopPropagation();else if(Sc(et,rt),o&4&&-1<Rc.indexOf(et)){for(;nt!==null;){var ot=Cb(nt);if(ot!==null&&Ec(ot),ot=Yc(et,o,tt,rt),ot===null&&hd(et,o,rt,id$1,tt),ot===nt)break;nt=ot}nt!==null&&rt.stopPropagation()}else hd(et,o,rt,null,tt)}}var id$1=null;function Yc(et,o,tt,rt){if(id$1=null,et=xb(rt),et=Wc(et),et!==null)if(o=Vb(et),o===null)et=null;else if(tt=o.tag,tt===13){if(et=Wb(o),et!==null)return et;et=null}else if(tt===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;et=null}else o!==et&&(et=null);return id$1=et,null}function jd(et){switch(et){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ec()){case fc:return 1;case gc:return 4;case hc:case ic:return 16;case jc:return 536870912;default:return 16}default:return 16}}var kd=null,ld=null,md=null;function nd(){if(md)return md;var et,o=ld,tt=o.length,rt,nt="value"in kd?kd.value:kd.textContent,ot=nt.length;for(et=0;et<tt&&o[et]===nt[et];et++);var it=tt-et;for(rt=1;rt<=it&&o[tt-rt]===nt[ot-rt];rt++);return md=nt.slice(et,1<rt?1-rt:void 0)}function od(et){var o=et.keyCode;return"charCode"in et?(et=et.charCode,et===0&&o===13&&(et=13)):et=o,et===10&&(et=13),32<=et||et===13?et:0}function pd(){return!0}function qd(){return!1}function rd(et){function o(tt,rt,nt,ot,it){this._reactName=tt,this._targetInst=nt,this.type=rt,this.nativeEvent=ot,this.target=it,this.currentTarget=null;for(var st in et)et.hasOwnProperty(st)&&(tt=et[st],this[st]=tt?tt(ot):ot[st]);return this.isDefaultPrevented=(ot.defaultPrevented!=null?ot.defaultPrevented:ot.returnValue===!1)?pd:qd,this.isPropagationStopped=qd,this}return A$1(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var tt=this.nativeEvent;tt&&(tt.preventDefault?tt.preventDefault():typeof tt.returnValue!="unknown"&&(tt.returnValue=!1),this.isDefaultPrevented=pd)},stopPropagation:function(){var tt=this.nativeEvent;tt&&(tt.stopPropagation?tt.stopPropagation():typeof tt.cancelBubble!="unknown"&&(tt.cancelBubble=!0),this.isPropagationStopped=pd)},persist:function(){},isPersistent:pd}),o}var sd={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(et){return et.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},td=rd(sd),ud=A$1({},sd,{view:0,detail:0}),vd=rd(ud),wd,xd,yd,Ad=A$1({},ud,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zd,button:0,buttons:0,relatedTarget:function(et){return et.relatedTarget===void 0?et.fromElement===et.srcElement?et.toElement:et.fromElement:et.relatedTarget},movementX:function(et){return"movementX"in et?et.movementX:(et!==yd&&(yd&&et.type==="mousemove"?(wd=et.screenX-yd.screenX,xd=et.screenY-yd.screenY):xd=wd=0,yd=et),wd)},movementY:function(et){return"movementY"in et?et.movementY:xd}}),Bd=rd(Ad),Cd=A$1({},Ad,{dataTransfer:0}),Dd=rd(Cd),Ed=A$1({},ud,{relatedTarget:0}),Fd=rd(Ed),Gd=A$1({},sd,{animationName:0,elapsedTime:0,pseudoElement:0}),Hd=rd(Gd),Id=A$1({},sd,{clipboardData:function(et){return"clipboardData"in et?et.clipboardData:window.clipboardData}}),Jd=rd(Id),Kd=A$1({},sd,{data:0}),Ld=rd(Kd),Md={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Nd={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Od={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Pd(et){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(et):(et=Od[et])?!!o[et]:!1}function zd(){return Pd}var Qd=A$1({},ud,{key:function(et){if(et.key){var o=Md[et.key]||et.key;if(o!=="Unidentified")return o}return et.type==="keypress"?(et=od(et),et===13?"Enter":String.fromCharCode(et)):et.type==="keydown"||et.type==="keyup"?Nd[et.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zd,charCode:function(et){return et.type==="keypress"?od(et):0},keyCode:function(et){return et.type==="keydown"||et.type==="keyup"?et.keyCode:0},which:function(et){return et.type==="keypress"?od(et):et.type==="keydown"||et.type==="keyup"?et.keyCode:0}}),Rd=rd(Qd),Sd=A$1({},Ad,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Td=rd(Sd),Ud=A$1({},ud,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zd}),Vd=rd(Ud),Wd=A$1({},sd,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xd=rd(Wd),Yd=A$1({},Ad,{deltaX:function(et){return"deltaX"in et?et.deltaX:"wheelDeltaX"in et?-et.wheelDeltaX:0},deltaY:function(et){return"deltaY"in et?et.deltaY:"wheelDeltaY"in et?-et.wheelDeltaY:"wheelDelta"in et?-et.wheelDelta:0},deltaZ:0,deltaMode:0}),Zd=rd(Yd),$d=[9,13,27,32],ae$1=ia&&"CompositionEvent"in window,be$1=null;ia&&"documentMode"in document&&(be$1=document.documentMode);var ce$1=ia&&"TextEvent"in window&&!be$1,de$1=ia&&(!ae$1||be$1&&8<be$1&&11>=be$1),ee$1=" ",fe$1=!1;function ge$1(et,o){switch(et){case"keyup":return $d.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function he$1(et){return et=et.detail,typeof et=="object"&&"data"in et?et.data:null}var ie$1=!1;function je$1(et,o){switch(et){case"compositionend":return he$1(o);case"keypress":return o.which!==32?null:(fe$1=!0,ee$1);case"textInput":return et=o.data,et===ee$1&&fe$1?null:et;default:return null}}function ke$1(et,o){if(ie$1)return et==="compositionend"||!ae$1&&ge$1(et,o)?(et=nd(),md=ld=kd=null,ie$1=!1,et):null;switch(et){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return de$1&&o.locale!=="ko"?null:o.data;default:return null}}var le$1={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function me(et){var o=et&&et.nodeName&&et.nodeName.toLowerCase();return o==="input"?!!le$1[et.type]:o==="textarea"}function ne$1(et,o,tt,rt){Eb(rt),o=oe$1(o,"onChange"),0<o.length&&(tt=new td("onChange","change",null,tt,rt),et.push({event:tt,listeners:o}))}var pe$1=null,qe$1=null;function re$2(et){se$1(et,0)}function te$1(et){var o=ue(et);if(Wa(o))return et}function ve$1(et,o){if(et==="change")return o}var we$1=!1;if(ia){var xe$1;if(ia){var ye$1="oninput"in document;if(!ye$1){var ze$1=document.createElement("div");ze$1.setAttribute("oninput","return;"),ye$1=typeof ze$1.oninput=="function"}xe$1=ye$1}else xe$1=!1;we$1=xe$1&&(!document.documentMode||9<document.documentMode)}function Ae$1(){pe$1&&(pe$1.detachEvent("onpropertychange",Be$1),qe$1=pe$1=null)}function Be$1(et){if(et.propertyName==="value"&&te$1(qe$1)){var o=[];ne$1(o,qe$1,et,xb(et)),Jb(re$2,o)}}function Ce(et,o,tt){et==="focusin"?(Ae$1(),pe$1=o,qe$1=tt,pe$1.attachEvent("onpropertychange",Be$1)):et==="focusout"&&Ae$1()}function De$1(et){if(et==="selectionchange"||et==="keyup"||et==="keydown")return te$1(qe$1)}function Ee$1(et,o){if(et==="click")return te$1(o)}function Fe$1(et,o){if(et==="input"||et==="change")return te$1(o)}function Ge(et,o){return et===o&&(et!==0||1/et===1/o)||et!==et&&o!==o}var He=typeof Object.is=="function"?Object.is:Ge;function Ie(et,o){if(He(et,o))return!0;if(typeof et!="object"||et===null||typeof o!="object"||o===null)return!1;var tt=Object.keys(et),rt=Object.keys(o);if(tt.length!==rt.length)return!1;for(rt=0;rt<tt.length;rt++){var nt=tt[rt];if(!ja.call(o,nt)||!He(et[nt],o[nt]))return!1}return!0}function Je(et){for(;et&&et.firstChild;)et=et.firstChild;return et}function Ke(et,o){var tt=Je(et);et=0;for(var rt;tt;){if(tt.nodeType===3){if(rt=et+tt.textContent.length,et<=o&&rt>=o)return{node:tt,offset:o-et};et=rt}e:{for(;tt;){if(tt.nextSibling){tt=tt.nextSibling;break e}tt=tt.parentNode}tt=void 0}tt=Je(tt)}}function Le$1(et,o){return et&&o?et===o?!0:et&&et.nodeType===3?!1:o&&o.nodeType===3?Le$1(et,o.parentNode):"contains"in et?et.contains(o):et.compareDocumentPosition?!!(et.compareDocumentPosition(o)&16):!1:!1}function Me$1(){for(var et=window,o=Xa();o instanceof et.HTMLIFrameElement;){try{var tt=typeof o.contentWindow.location.href=="string"}catch{tt=!1}if(tt)et=o.contentWindow;else break;o=Xa(et.document)}return o}function Ne$1(et){var o=et&&et.nodeName&&et.nodeName.toLowerCase();return o&&(o==="input"&&(et.type==="text"||et.type==="search"||et.type==="tel"||et.type==="url"||et.type==="password")||o==="textarea"||et.contentEditable==="true")}function Oe$1(et){var o=Me$1(),tt=et.focusedElem,rt=et.selectionRange;if(o!==tt&&tt&&tt.ownerDocument&&Le$1(tt.ownerDocument.documentElement,tt)){if(rt!==null&&Ne$1(tt)){if(o=rt.start,et=rt.end,et===void 0&&(et=o),"selectionStart"in tt)tt.selectionStart=o,tt.selectionEnd=Math.min(et,tt.value.length);else if(et=(o=tt.ownerDocument||document)&&o.defaultView||window,et.getSelection){et=et.getSelection();var nt=tt.textContent.length,ot=Math.min(rt.start,nt);rt=rt.end===void 0?ot:Math.min(rt.end,nt),!et.extend&&ot>rt&&(nt=rt,rt=ot,ot=nt),nt=Ke(tt,ot);var it=Ke(tt,rt);nt&&it&&(et.rangeCount!==1||et.anchorNode!==nt.node||et.anchorOffset!==nt.offset||et.focusNode!==it.node||et.focusOffset!==it.offset)&&(o=o.createRange(),o.setStart(nt.node,nt.offset),et.removeAllRanges(),ot>rt?(et.addRange(o),et.extend(it.node,it.offset)):(o.setEnd(it.node,it.offset),et.addRange(o)))}}for(o=[],et=tt;et=et.parentNode;)et.nodeType===1&&o.push({element:et,left:et.scrollLeft,top:et.scrollTop});for(typeof tt.focus=="function"&&tt.focus(),tt=0;tt<o.length;tt++)et=o[tt],et.element.scrollLeft=et.left,et.element.scrollTop=et.top}}var Pe=ia&&"documentMode"in document&&11>=document.documentMode,Qe=null,Re$1=null,Se$1=null,Te$1=!1;function Ue(et,o,tt){var rt=tt.window===tt?tt.document:tt.nodeType===9?tt:tt.ownerDocument;Te$1||Qe==null||Qe!==Xa(rt)||(rt=Qe,"selectionStart"in rt&&Ne$1(rt)?rt={start:rt.selectionStart,end:rt.selectionEnd}:(rt=(rt.ownerDocument&&rt.ownerDocument.defaultView||window).getSelection(),rt={anchorNode:rt.anchorNode,anchorOffset:rt.anchorOffset,focusNode:rt.focusNode,focusOffset:rt.focusOffset}),Se$1&&Ie(Se$1,rt)||(Se$1=rt,rt=oe$1(Re$1,"onSelect"),0<rt.length&&(o=new td("onSelect","select",null,o,tt),et.push({event:o,listeners:rt}),o.target=Qe)))}function Ve$1(et,o){var tt={};return tt[et.toLowerCase()]=o.toLowerCase(),tt["Webkit"+et]="webkit"+o,tt["Moz"+et]="moz"+o,tt}var We$1={animationend:Ve$1("Animation","AnimationEnd"),animationiteration:Ve$1("Animation","AnimationIteration"),animationstart:Ve$1("Animation","AnimationStart"),transitionend:Ve$1("Transition","TransitionEnd")},Xe={},Ye$1={};ia&&(Ye$1=document.createElement("div").style,"AnimationEvent"in window||(delete We$1.animationend.animation,delete We$1.animationiteration.animation,delete We$1.animationstart.animation),"TransitionEvent"in window||delete We$1.transitionend.transition);function Ze(et){if(Xe[et])return Xe[et];if(!We$1[et])return et;var o=We$1[et],tt;for(tt in o)if(o.hasOwnProperty(tt)&&tt in Ye$1)return Xe[et]=o[tt];return et}var $e=Ze("animationend"),af=Ze("animationiteration"),bf=Ze("animationstart"),cf=Ze("transitionend"),df=new Map,ef="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ff(et,o){df.set(et,o),fa(o,[et])}for(var gf=0;gf<ef.length;gf++){var hf=ef[gf],jf=hf.toLowerCase(),kf=hf[0].toUpperCase()+hf.slice(1);ff(jf,"on"+kf)}ff($e,"onAnimationEnd");ff(af,"onAnimationIteration");ff(bf,"onAnimationStart");ff("dblclick","onDoubleClick");ff("focusin","onFocus");ff("focusout","onBlur");ff(cf,"onTransitionEnd");ha("onMouseEnter",["mouseout","mouseover"]);ha("onMouseLeave",["mouseout","mouseover"]);ha("onPointerEnter",["pointerout","pointerover"]);ha("onPointerLeave",["pointerout","pointerover"]);fa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));fa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));fa("onBeforeInput",["compositionend","keypress","textInput","paste"]);fa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));fa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));fa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var lf="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),mf=new Set("cancel close invalid load scroll toggle".split(" ").concat(lf));function nf(et,o,tt){var rt=et.type||"unknown-event";et.currentTarget=tt,Ub(rt,o,void 0,et),et.currentTarget=null}function se$1(et,o){o=(o&4)!==0;for(var tt=0;tt<et.length;tt++){var rt=et[tt],nt=rt.event;rt=rt.listeners;e:{var ot=void 0;if(o)for(var it=rt.length-1;0<=it;it--){var st=rt[it],at=st.instance,ct=st.currentTarget;if(st=st.listener,at!==ot&&nt.isPropagationStopped())break e;nf(nt,st,ct),ot=at}else for(it=0;it<rt.length;it++){if(st=rt[it],at=st.instance,ct=st.currentTarget,st=st.listener,at!==ot&&nt.isPropagationStopped())break e;nf(nt,st,ct),ot=at}}}if(Qb)throw et=Rb,Qb=!1,Rb=null,et}function D$1(et,o){var tt=o[of];tt===void 0&&(tt=o[of]=new Set);var rt=et+"__bubble";tt.has(rt)||(pf(o,et,2,!1),tt.add(rt))}function qf(et,o,tt){var rt=0;o&&(rt|=4),pf(tt,et,rt,o)}var rf="_reactListening"+Math.random().toString(36).slice(2);function sf(et){if(!et[rf]){et[rf]=!0,da.forEach(function(tt){tt!=="selectionchange"&&(mf.has(tt)||qf(tt,!1,et),qf(tt,!0,et))});var o=et.nodeType===9?et:et.ownerDocument;o===null||o[rf]||(o[rf]=!0,qf("selectionchange",!1,o))}}function pf(et,o,tt,rt){switch(jd(o)){case 1:var nt=ed;break;case 4:nt=gd;break;default:nt=fd}tt=nt.bind(null,o,tt,et),nt=void 0,!Lb||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(nt=!0),rt?nt!==void 0?et.addEventListener(o,tt,{capture:!0,passive:nt}):et.addEventListener(o,tt,!0):nt!==void 0?et.addEventListener(o,tt,{passive:nt}):et.addEventListener(o,tt,!1)}function hd(et,o,tt,rt,nt){var ot=rt;if(!(o&1)&&!(o&2)&&rt!==null)e:for(;;){if(rt===null)return;var it=rt.tag;if(it===3||it===4){var st=rt.stateNode.containerInfo;if(st===nt||st.nodeType===8&&st.parentNode===nt)break;if(it===4)for(it=rt.return;it!==null;){var at=it.tag;if((at===3||at===4)&&(at=it.stateNode.containerInfo,at===nt||at.nodeType===8&&at.parentNode===nt))return;it=it.return}for(;st!==null;){if(it=Wc(st),it===null)return;if(at=it.tag,at===5||at===6){rt=ot=it;continue e}st=st.parentNode}}rt=rt.return}Jb(function(){var ct=ot,lt=xb(tt),dt=[];e:{var ht=df.get(et);if(ht!==void 0){var mt=td,ft=et;switch(et){case"keypress":if(od(tt)===0)break e;case"keydown":case"keyup":mt=Rd;break;case"focusin":ft="focus",mt=Fd;break;case"focusout":ft="blur",mt=Fd;break;case"beforeblur":case"afterblur":mt=Fd;break;case"click":if(tt.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":mt=Bd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":mt=Dd;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":mt=Vd;break;case $e:case af:case bf:mt=Hd;break;case cf:mt=Xd;break;case"scroll":mt=vd;break;case"wheel":mt=Zd;break;case"copy":case"cut":case"paste":mt=Jd;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":mt=Td}var pt=(o&4)!==0,yt=!pt&&et==="scroll",gt=pt?ht!==null?ht+"Capture":null:ht;pt=[];for(var bt=ct,xt;bt!==null;){xt=bt;var vt=xt.stateNode;if(xt.tag===5&&vt!==null&&(xt=vt,gt!==null&&(vt=Kb(bt,gt),vt!=null&&pt.push(tf(bt,vt,xt)))),yt)break;bt=bt.return}0<pt.length&&(ht=new mt(ht,ft,null,tt,lt),dt.push({event:ht,listeners:pt}))}}if(!(o&7)){e:{if(ht=et==="mouseover"||et==="pointerover",mt=et==="mouseout"||et==="pointerout",ht&&tt!==wb&&(ft=tt.relatedTarget||tt.fromElement)&&(Wc(ft)||ft[uf]))break e;if((mt||ht)&&(ht=lt.window===lt?lt:(ht=lt.ownerDocument)?ht.defaultView||ht.parentWindow:window,mt?(ft=tt.relatedTarget||tt.toElement,mt=ct,ft=ft?Wc(ft):null,ft!==null&&(yt=Vb(ft),ft!==yt||ft.tag!==5&&ft.tag!==6)&&(ft=null)):(mt=null,ft=ct),mt!==ft)){if(pt=Bd,vt="onMouseLeave",gt="onMouseEnter",bt="mouse",(et==="pointerout"||et==="pointerover")&&(pt=Td,vt="onPointerLeave",gt="onPointerEnter",bt="pointer"),yt=mt==null?ht:ue(mt),xt=ft==null?ht:ue(ft),ht=new pt(vt,bt+"leave",mt,tt,lt),ht.target=yt,ht.relatedTarget=xt,vt=null,Wc(lt)===ct&&(pt=new pt(gt,bt+"enter",ft,tt,lt),pt.target=xt,pt.relatedTarget=yt,vt=pt),yt=vt,mt&&ft)t:{for(pt=mt,gt=ft,bt=0,xt=pt;xt;xt=vf(xt))bt++;for(xt=0,vt=gt;vt;vt=vf(vt))xt++;for(;0<bt-xt;)pt=vf(pt),bt--;for(;0<xt-bt;)gt=vf(gt),xt--;for(;bt--;){if(pt===gt||gt!==null&&pt===gt.alternate)break t;pt=vf(pt),gt=vf(gt)}pt=null}else pt=null;mt!==null&&wf(dt,ht,mt,pt,!1),ft!==null&&yt!==null&&wf(dt,yt,ft,pt,!0)}}e:{if(ht=ct?ue(ct):window,mt=ht.nodeName&&ht.nodeName.toLowerCase(),mt==="select"||mt==="input"&&ht.type==="file")var Et=ve$1;else if(me(ht))if(we$1)Et=Fe$1;else{Et=De$1;var Ct=Ce}else(mt=ht.nodeName)&&mt.toLowerCase()==="input"&&(ht.type==="checkbox"||ht.type==="radio")&&(Et=Ee$1);if(Et&&(Et=Et(et,ct))){ne$1(dt,Et,tt,lt);break e}Ct&&Ct(et,ht,ct),et==="focusout"&&(Ct=ht._wrapperState)&&Ct.controlled&&ht.type==="number"&&cb$1(ht,"number",ht.value)}switch(Ct=ct?ue(ct):window,et){case"focusin":(me(Ct)||Ct.contentEditable==="true")&&(Qe=Ct,Re$1=ct,Se$1=null);break;case"focusout":Se$1=Re$1=Qe=null;break;case"mousedown":Te$1=!0;break;case"contextmenu":case"mouseup":case"dragend":Te$1=!1,Ue(dt,tt,lt);break;case"selectionchange":if(Pe)break;case"keydown":case"keyup":Ue(dt,tt,lt)}var St;if(ae$1)e:{switch(et){case"compositionstart":var At="onCompositionStart";break e;case"compositionend":At="onCompositionEnd";break e;case"compositionupdate":At="onCompositionUpdate";break e}At=void 0}else ie$1?ge$1(et,tt)&&(At="onCompositionEnd"):et==="keydown"&&tt.keyCode===229&&(At="onCompositionStart");At&&(de$1&&tt.locale!=="ko"&&(ie$1||At!=="onCompositionStart"?At==="onCompositionEnd"&&ie$1&&(St=nd()):(kd=lt,ld="value"in kd?kd.value:kd.textContent,ie$1=!0)),Ct=oe$1(ct,At),0<Ct.length&&(At=new Ld(At,et,null,tt,lt),dt.push({event:At,listeners:Ct}),St?At.data=St:(St=he$1(tt),St!==null&&(At.data=St)))),(St=ce$1?je$1(et,tt):ke$1(et,tt))&&(ct=oe$1(ct,"onBeforeInput"),0<ct.length&&(lt=new Ld("onBeforeInput","beforeinput",null,tt,lt),dt.push({event:lt,listeners:ct}),lt.data=St))}se$1(dt,o)})}function tf(et,o,tt){return{instance:et,listener:o,currentTarget:tt}}function oe$1(et,o){for(var tt=o+"Capture",rt=[];et!==null;){var nt=et,ot=nt.stateNode;nt.tag===5&&ot!==null&&(nt=ot,ot=Kb(et,tt),ot!=null&&rt.unshift(tf(et,ot,nt)),ot=Kb(et,o),ot!=null&&rt.push(tf(et,ot,nt))),et=et.return}return rt}function vf(et){if(et===null)return null;do et=et.return;while(et&&et.tag!==5);return et||null}function wf(et,o,tt,rt,nt){for(var ot=o._reactName,it=[];tt!==null&&tt!==rt;){var st=tt,at=st.alternate,ct=st.stateNode;if(at!==null&&at===rt)break;st.tag===5&&ct!==null&&(st=ct,nt?(at=Kb(tt,ot),at!=null&&it.unshift(tf(tt,at,st))):nt||(at=Kb(tt,ot),at!=null&&it.push(tf(tt,at,st)))),tt=tt.return}it.length!==0&&et.push({event:o,listeners:it})}var xf=/\r\n?/g,yf=/\u0000|\uFFFD/g;function zf(et){return(typeof et=="string"?et:""+et).replace(xf,`
`).replace(yf,"")}function Af(et,o,tt){if(o=zf(o),zf(et)!==o&&tt)throw Error(p$4(425))}function Bf(){}var Cf=null,Df=null;function Ef(et,o){return et==="textarea"||et==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var Ff=typeof setTimeout=="function"?setTimeout:void 0,Gf=typeof clearTimeout=="function"?clearTimeout:void 0,Hf=typeof Promise=="function"?Promise:void 0,Jf=typeof queueMicrotask=="function"?queueMicrotask:typeof Hf<"u"?function(et){return Hf.resolve(null).then(et).catch(If)}:Ff;function If(et){setTimeout(function(){throw et})}function Kf(et,o){var tt=o,rt=0;do{var nt=tt.nextSibling;if(et.removeChild(tt),nt&&nt.nodeType===8)if(tt=nt.data,tt==="/$"){if(rt===0){et.removeChild(nt),bd(o);return}rt--}else tt!=="$"&&tt!=="$?"&&tt!=="$!"||rt++;tt=nt}while(tt);bd(o)}function Lf(et){for(;et!=null;et=et.nextSibling){var o=et.nodeType;if(o===1||o===3)break;if(o===8){if(o=et.data,o==="$"||o==="$!"||o==="$?")break;if(o==="/$")return null}}return et}function Mf(et){et=et.previousSibling;for(var o=0;et;){if(et.nodeType===8){var tt=et.data;if(tt==="$"||tt==="$!"||tt==="$?"){if(o===0)return et;o--}else tt==="/$"&&o++}et=et.previousSibling}return null}var Nf=Math.random().toString(36).slice(2),Of="__reactFiber$"+Nf,Pf="__reactProps$"+Nf,uf="__reactContainer$"+Nf,of="__reactEvents$"+Nf,Qf="__reactListeners$"+Nf,Rf="__reactHandles$"+Nf;function Wc(et){var o=et[Of];if(o)return o;for(var tt=et.parentNode;tt;){if(o=tt[uf]||tt[Of]){if(tt=o.alternate,o.child!==null||tt!==null&&tt.child!==null)for(et=Mf(et);et!==null;){if(tt=et[Of])return tt;et=Mf(et)}return o}et=tt,tt=et.parentNode}return null}function Cb(et){return et=et[Of]||et[uf],!et||et.tag!==5&&et.tag!==6&&et.tag!==13&&et.tag!==3?null:et}function ue(et){if(et.tag===5||et.tag===6)return et.stateNode;throw Error(p$4(33))}function Db(et){return et[Pf]||null}var Sf=[],Tf=-1;function Uf(et){return{current:et}}function E$1(et){0>Tf||(et.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G$1(et,o){Tf++,Sf[Tf]=et.current,et.current=o}var Vf={},H$1=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(et,o){var tt=et.type.contextTypes;if(!tt)return Vf;var rt=et.stateNode;if(rt&&rt.__reactInternalMemoizedUnmaskedChildContext===o)return rt.__reactInternalMemoizedMaskedChildContext;var nt={},ot;for(ot in tt)nt[ot]=o[ot];return rt&&(et=et.stateNode,et.__reactInternalMemoizedUnmaskedChildContext=o,et.__reactInternalMemoizedMaskedChildContext=nt),nt}function Zf(et){return et=et.childContextTypes,et!=null}function $f(){E$1(Wf),E$1(H$1)}function ag(et,o,tt){if(H$1.current!==Vf)throw Error(p$4(168));G$1(H$1,o),G$1(Wf,tt)}function bg(et,o,tt){var rt=et.stateNode;if(o=o.childContextTypes,typeof rt.getChildContext!="function")return tt;rt=rt.getChildContext();for(var nt in rt)if(!(nt in o))throw Error(p$4(108,Ra(et)||"Unknown",nt));return A$1({},tt,rt)}function cg(et){return et=(et=et.stateNode)&&et.__reactInternalMemoizedMergedChildContext||Vf,Xf=H$1.current,G$1(H$1,et),G$1(Wf,Wf.current),!0}function dg(et,o,tt){var rt=et.stateNode;if(!rt)throw Error(p$4(169));tt?(et=bg(et,o,Xf),rt.__reactInternalMemoizedMergedChildContext=et,E$1(Wf),E$1(H$1),G$1(H$1,et)):E$1(Wf),G$1(Wf,tt)}var eg=null,fg=!1,gg=!1;function hg(et){eg===null?eg=[et]:eg.push(et)}function ig(et){fg=!0,hg(et)}function jg(){if(!gg&&eg!==null){gg=!0;var et=0,o=C$1;try{var tt=eg;for(C$1=1;et<tt.length;et++){var rt=tt[et];do rt=rt(!0);while(rt!==null)}eg=null,fg=!1}catch(nt){throw eg!==null&&(eg=eg.slice(et+1)),ac(fc,jg),nt}finally{C$1=o,gg=!1}}return null}var kg=[],lg=0,mg=null,ng=0,og=[],pg=0,qg=null,rg=1,sg="";function tg(et,o){kg[lg++]=ng,kg[lg++]=mg,mg=et,ng=o}function ug(et,o,tt){og[pg++]=rg,og[pg++]=sg,og[pg++]=qg,qg=et;var rt=rg;et=sg;var nt=32-oc(rt)-1;rt&=~(1<<nt),tt+=1;var ot=32-oc(o)+nt;if(30<ot){var it=nt-nt%5;ot=(rt&(1<<it)-1).toString(32),rt>>=it,nt-=it,rg=1<<32-oc(o)+nt|tt<<nt|rt,sg=ot+et}else rg=1<<ot|tt<<nt|rt,sg=et}function vg(et){et.return!==null&&(tg(et,1),ug(et,1,0))}function wg(et){for(;et===mg;)mg=kg[--lg],kg[lg]=null,ng=kg[--lg],kg[lg]=null;for(;et===qg;)qg=og[--pg],og[pg]=null,sg=og[--pg],og[pg]=null,rg=og[--pg],og[pg]=null}var xg=null,yg=null,I$1=!1,zg=null;function Ag(et,o){var tt=Bg(5,null,null,0);tt.elementType="DELETED",tt.stateNode=o,tt.return=et,o=et.deletions,o===null?(et.deletions=[tt],et.flags|=16):o.push(tt)}function Cg(et,o){switch(et.tag){case 5:var tt=et.type;return o=o.nodeType!==1||tt.toLowerCase()!==o.nodeName.toLowerCase()?null:o,o!==null?(et.stateNode=o,xg=et,yg=Lf(o.firstChild),!0):!1;case 6:return o=et.pendingProps===""||o.nodeType!==3?null:o,o!==null?(et.stateNode=o,xg=et,yg=null,!0):!1;case 13:return o=o.nodeType!==8?null:o,o!==null?(tt=qg!==null?{id:rg,overflow:sg}:null,et.memoizedState={dehydrated:o,treeContext:tt,retryLane:1073741824},tt=Bg(18,null,null,0),tt.stateNode=o,tt.return=et,et.child=tt,xg=et,yg=null,!0):!1;default:return!1}}function Dg(et){return(et.mode&1)!==0&&(et.flags&128)===0}function Eg(et){if(I$1){var o=yg;if(o){var tt=o;if(!Cg(et,o)){if(Dg(et))throw Error(p$4(418));o=Lf(tt.nextSibling);var rt=xg;o&&Cg(et,o)?Ag(rt,tt):(et.flags=et.flags&-4097|2,I$1=!1,xg=et)}}else{if(Dg(et))throw Error(p$4(418));et.flags=et.flags&-4097|2,I$1=!1,xg=et}}}function Fg(et){for(et=et.return;et!==null&&et.tag!==5&&et.tag!==3&&et.tag!==13;)et=et.return;xg=et}function Gg(et){if(et!==xg)return!1;if(!I$1)return Fg(et),I$1=!0,!1;var o;if((o=et.tag!==3)&&!(o=et.tag!==5)&&(o=et.type,o=o!=="head"&&o!=="body"&&!Ef(et.type,et.memoizedProps)),o&&(o=yg)){if(Dg(et))throw Hg(),Error(p$4(418));for(;o;)Ag(et,o),o=Lf(o.nextSibling)}if(Fg(et),et.tag===13){if(et=et.memoizedState,et=et!==null?et.dehydrated:null,!et)throw Error(p$4(317));e:{for(et=et.nextSibling,o=0;et;){if(et.nodeType===8){var tt=et.data;if(tt==="/$"){if(o===0){yg=Lf(et.nextSibling);break e}o--}else tt!=="$"&&tt!=="$!"&&tt!=="$?"||o++}et=et.nextSibling}yg=null}}else yg=xg?Lf(et.stateNode.nextSibling):null;return!0}function Hg(){for(var et=yg;et;)et=Lf(et.nextSibling)}function Ig(){yg=xg=null,I$1=!1}function Jg(et){zg===null?zg=[et]:zg.push(et)}var Kg=ua.ReactCurrentBatchConfig;function Lg(et,o,tt){if(et=tt.ref,et!==null&&typeof et!="function"&&typeof et!="object"){if(tt._owner){if(tt=tt._owner,tt){if(tt.tag!==1)throw Error(p$4(309));var rt=tt.stateNode}if(!rt)throw Error(p$4(147,et));var nt=rt,ot=""+et;return o!==null&&o.ref!==null&&typeof o.ref=="function"&&o.ref._stringRef===ot?o.ref:(o=function(it){var st=nt.refs;it===null?delete st[ot]:st[ot]=it},o._stringRef=ot,o)}if(typeof et!="string")throw Error(p$4(284));if(!tt._owner)throw Error(p$4(290,et))}return et}function Mg(et,o){throw et=Object.prototype.toString.call(o),Error(p$4(31,et==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":et))}function Ng(et){var o=et._init;return o(et._payload)}function Og(et){function o(gt,bt){if(et){var xt=gt.deletions;xt===null?(gt.deletions=[bt],gt.flags|=16):xt.push(bt)}}function tt(gt,bt){if(!et)return null;for(;bt!==null;)o(gt,bt),bt=bt.sibling;return null}function rt(gt,bt){for(gt=new Map;bt!==null;)bt.key!==null?gt.set(bt.key,bt):gt.set(bt.index,bt),bt=bt.sibling;return gt}function nt(gt,bt){return gt=Pg(gt,bt),gt.index=0,gt.sibling=null,gt}function ot(gt,bt,xt){return gt.index=xt,et?(xt=gt.alternate,xt!==null?(xt=xt.index,xt<bt?(gt.flags|=2,bt):xt):(gt.flags|=2,bt)):(gt.flags|=1048576,bt)}function it(gt){return et&&gt.alternate===null&&(gt.flags|=2),gt}function st(gt,bt,xt,vt){return bt===null||bt.tag!==6?(bt=Qg(xt,gt.mode,vt),bt.return=gt,bt):(bt=nt(bt,xt),bt.return=gt,bt)}function at(gt,bt,xt,vt){var Et=xt.type;return Et===ya?lt(gt,bt,xt.props.children,vt,xt.key):bt!==null&&(bt.elementType===Et||typeof Et=="object"&&Et!==null&&Et.$$typeof===Ha&&Ng(Et)===bt.type)?(vt=nt(bt,xt.props),vt.ref=Lg(gt,bt,xt),vt.return=gt,vt):(vt=Rg(xt.type,xt.key,xt.props,null,gt.mode,vt),vt.ref=Lg(gt,bt,xt),vt.return=gt,vt)}function ct(gt,bt,xt,vt){return bt===null||bt.tag!==4||bt.stateNode.containerInfo!==xt.containerInfo||bt.stateNode.implementation!==xt.implementation?(bt=Sg(xt,gt.mode,vt),bt.return=gt,bt):(bt=nt(bt,xt.children||[]),bt.return=gt,bt)}function lt(gt,bt,xt,vt,Et){return bt===null||bt.tag!==7?(bt=Tg(xt,gt.mode,vt,Et),bt.return=gt,bt):(bt=nt(bt,xt),bt.return=gt,bt)}function dt(gt,bt,xt){if(typeof bt=="string"&&bt!==""||typeof bt=="number")return bt=Qg(""+bt,gt.mode,xt),bt.return=gt,bt;if(typeof bt=="object"&&bt!==null){switch(bt.$$typeof){case va:return xt=Rg(bt.type,bt.key,bt.props,null,gt.mode,xt),xt.ref=Lg(gt,null,bt),xt.return=gt,xt;case wa:return bt=Sg(bt,gt.mode,xt),bt.return=gt,bt;case Ha:var vt=bt._init;return dt(gt,vt(bt._payload),xt)}if(eb(bt)||Ka(bt))return bt=Tg(bt,gt.mode,xt,null),bt.return=gt,bt;Mg(gt,bt)}return null}function ht(gt,bt,xt,vt){var Et=bt!==null?bt.key:null;if(typeof xt=="string"&&xt!==""||typeof xt=="number")return Et!==null?null:st(gt,bt,""+xt,vt);if(typeof xt=="object"&&xt!==null){switch(xt.$$typeof){case va:return xt.key===Et?at(gt,bt,xt,vt):null;case wa:return xt.key===Et?ct(gt,bt,xt,vt):null;case Ha:return Et=xt._init,ht(gt,bt,Et(xt._payload),vt)}if(eb(xt)||Ka(xt))return Et!==null?null:lt(gt,bt,xt,vt,null);Mg(gt,xt)}return null}function mt(gt,bt,xt,vt,Et){if(typeof vt=="string"&&vt!==""||typeof vt=="number")return gt=gt.get(xt)||null,st(bt,gt,""+vt,Et);if(typeof vt=="object"&&vt!==null){switch(vt.$$typeof){case va:return gt=gt.get(vt.key===null?xt:vt.key)||null,at(bt,gt,vt,Et);case wa:return gt=gt.get(vt.key===null?xt:vt.key)||null,ct(bt,gt,vt,Et);case Ha:var Ct=vt._init;return mt(gt,bt,xt,Ct(vt._payload),Et)}if(eb(vt)||Ka(vt))return gt=gt.get(xt)||null,lt(bt,gt,vt,Et,null);Mg(bt,vt)}return null}function ft(gt,bt,xt,vt){for(var Et=null,Ct=null,St=bt,At=bt=0,kt=null;St!==null&&At<xt.length;At++){St.index>At?(kt=St,St=null):kt=St.sibling;var It=ht(gt,St,xt[At],vt);if(It===null){St===null&&(St=kt);break}et&&St&&It.alternate===null&&o(gt,St),bt=ot(It,bt,At),Ct===null?Et=It:Ct.sibling=It,Ct=It,St=kt}if(At===xt.length)return tt(gt,St),I$1&&tg(gt,At),Et;if(St===null){for(;At<xt.length;At++)St=dt(gt,xt[At],vt),St!==null&&(bt=ot(St,bt,At),Ct===null?Et=St:Ct.sibling=St,Ct=St);return I$1&&tg(gt,At),Et}for(St=rt(gt,St);At<xt.length;At++)kt=mt(St,gt,At,xt[At],vt),kt!==null&&(et&&kt.alternate!==null&&St.delete(kt.key===null?At:kt.key),bt=ot(kt,bt,At),Ct===null?Et=kt:Ct.sibling=kt,Ct=kt);return et&&St.forEach(function(Nt){return o(gt,Nt)}),I$1&&tg(gt,At),Et}function pt(gt,bt,xt,vt){var Et=Ka(xt);if(typeof Et!="function")throw Error(p$4(150));if(xt=Et.call(xt),xt==null)throw Error(p$4(151));for(var Ct=Et=null,St=bt,At=bt=0,kt=null,It=xt.next();St!==null&&!It.done;At++,It=xt.next()){St.index>At?(kt=St,St=null):kt=St.sibling;var Nt=ht(gt,St,It.value,vt);if(Nt===null){St===null&&(St=kt);break}et&&St&&Nt.alternate===null&&o(gt,St),bt=ot(Nt,bt,At),Ct===null?Et=Nt:Ct.sibling=Nt,Ct=Nt,St=kt}if(It.done)return tt(gt,St),I$1&&tg(gt,At),Et;if(St===null){for(;!It.done;At++,It=xt.next())It=dt(gt,It.value,vt),It!==null&&(bt=ot(It,bt,At),Ct===null?Et=It:Ct.sibling=It,Ct=It);return I$1&&tg(gt,At),Et}for(St=rt(gt,St);!It.done;At++,It=xt.next())It=mt(St,gt,At,It.value,vt),It!==null&&(et&&It.alternate!==null&&St.delete(It.key===null?At:It.key),bt=ot(It,bt,At),Ct===null?Et=It:Ct.sibling=It,Ct=It);return et&&St.forEach(function(Lt){return o(gt,Lt)}),I$1&&tg(gt,At),Et}function yt(gt,bt,xt,vt){if(typeof xt=="object"&&xt!==null&&xt.type===ya&&xt.key===null&&(xt=xt.props.children),typeof xt=="object"&&xt!==null){switch(xt.$$typeof){case va:e:{for(var Et=xt.key,Ct=bt;Ct!==null;){if(Ct.key===Et){if(Et=xt.type,Et===ya){if(Ct.tag===7){tt(gt,Ct.sibling),bt=nt(Ct,xt.props.children),bt.return=gt,gt=bt;break e}}else if(Ct.elementType===Et||typeof Et=="object"&&Et!==null&&Et.$$typeof===Ha&&Ng(Et)===Ct.type){tt(gt,Ct.sibling),bt=nt(Ct,xt.props),bt.ref=Lg(gt,Ct,xt),bt.return=gt,gt=bt;break e}tt(gt,Ct);break}else o(gt,Ct);Ct=Ct.sibling}xt.type===ya?(bt=Tg(xt.props.children,gt.mode,vt,xt.key),bt.return=gt,gt=bt):(vt=Rg(xt.type,xt.key,xt.props,null,gt.mode,vt),vt.ref=Lg(gt,bt,xt),vt.return=gt,gt=vt)}return it(gt);case wa:e:{for(Ct=xt.key;bt!==null;){if(bt.key===Ct)if(bt.tag===4&&bt.stateNode.containerInfo===xt.containerInfo&&bt.stateNode.implementation===xt.implementation){tt(gt,bt.sibling),bt=nt(bt,xt.children||[]),bt.return=gt,gt=bt;break e}else{tt(gt,bt);break}else o(gt,bt);bt=bt.sibling}bt=Sg(xt,gt.mode,vt),bt.return=gt,gt=bt}return it(gt);case Ha:return Ct=xt._init,yt(gt,bt,Ct(xt._payload),vt)}if(eb(xt))return ft(gt,bt,xt,vt);if(Ka(xt))return pt(gt,bt,xt,vt);Mg(gt,xt)}return typeof xt=="string"&&xt!==""||typeof xt=="number"?(xt=""+xt,bt!==null&&bt.tag===6?(tt(gt,bt.sibling),bt=nt(bt,xt),bt.return=gt,gt=bt):(tt(gt,bt),bt=Qg(xt,gt.mode,vt),bt.return=gt,gt=bt),it(gt)):tt(gt,bt)}return yt}var Ug=Og(!0),Vg=Og(!1),Wg=Uf(null),Xg=null,Yg=null,Zg=null;function $g(){Zg=Yg=Xg=null}function ah(et){var o=Wg.current;E$1(Wg),et._currentValue=o}function bh(et,o,tt){for(;et!==null;){var rt=et.alternate;if((et.childLanes&o)!==o?(et.childLanes|=o,rt!==null&&(rt.childLanes|=o)):rt!==null&&(rt.childLanes&o)!==o&&(rt.childLanes|=o),et===tt)break;et=et.return}}function ch(et,o){Xg=et,Zg=Yg=null,et=et.dependencies,et!==null&&et.firstContext!==null&&(et.lanes&o&&(dh=!0),et.firstContext=null)}function eh(et){var o=et._currentValue;if(Zg!==et)if(et={context:et,memoizedValue:o,next:null},Yg===null){if(Xg===null)throw Error(p$4(308));Yg=et,Xg.dependencies={lanes:0,firstContext:et}}else Yg=Yg.next=et;return o}var fh=null;function gh(et){fh===null?fh=[et]:fh.push(et)}function hh(et,o,tt,rt){var nt=o.interleaved;return nt===null?(tt.next=tt,gh(o)):(tt.next=nt.next,nt.next=tt),o.interleaved=tt,ih(et,rt)}function ih(et,o){et.lanes|=o;var tt=et.alternate;for(tt!==null&&(tt.lanes|=o),tt=et,et=et.return;et!==null;)et.childLanes|=o,tt=et.alternate,tt!==null&&(tt.childLanes|=o),tt=et,et=et.return;return tt.tag===3?tt.stateNode:null}var jh=!1;function kh(et){et.updateQueue={baseState:et.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function lh(et,o){et=et.updateQueue,o.updateQueue===et&&(o.updateQueue={baseState:et.baseState,firstBaseUpdate:et.firstBaseUpdate,lastBaseUpdate:et.lastBaseUpdate,shared:et.shared,effects:et.effects})}function mh(et,o){return{eventTime:et,lane:o,tag:0,payload:null,callback:null,next:null}}function nh(et,o,tt){var rt=et.updateQueue;if(rt===null)return null;if(rt=rt.shared,K$1&2){var nt=rt.pending;return nt===null?o.next=o:(o.next=nt.next,nt.next=o),rt.pending=o,ih(et,tt)}return nt=rt.interleaved,nt===null?(o.next=o,gh(rt)):(o.next=nt.next,nt.next=o),rt.interleaved=o,ih(et,tt)}function oh(et,o,tt){if(o=o.updateQueue,o!==null&&(o=o.shared,(tt&4194240)!==0)){var rt=o.lanes;rt&=et.pendingLanes,tt|=rt,o.lanes=tt,Cc(et,tt)}}function ph(et,o){var tt=et.updateQueue,rt=et.alternate;if(rt!==null&&(rt=rt.updateQueue,tt===rt)){var nt=null,ot=null;if(tt=tt.firstBaseUpdate,tt!==null){do{var it={eventTime:tt.eventTime,lane:tt.lane,tag:tt.tag,payload:tt.payload,callback:tt.callback,next:null};ot===null?nt=ot=it:ot=ot.next=it,tt=tt.next}while(tt!==null);ot===null?nt=ot=o:ot=ot.next=o}else nt=ot=o;tt={baseState:rt.baseState,firstBaseUpdate:nt,lastBaseUpdate:ot,shared:rt.shared,effects:rt.effects},et.updateQueue=tt;return}et=tt.lastBaseUpdate,et===null?tt.firstBaseUpdate=o:et.next=o,tt.lastBaseUpdate=o}function qh(et,o,tt,rt){var nt=et.updateQueue;jh=!1;var ot=nt.firstBaseUpdate,it=nt.lastBaseUpdate,st=nt.shared.pending;if(st!==null){nt.shared.pending=null;var at=st,ct=at.next;at.next=null,it===null?ot=ct:it.next=ct,it=at;var lt=et.alternate;lt!==null&&(lt=lt.updateQueue,st=lt.lastBaseUpdate,st!==it&&(st===null?lt.firstBaseUpdate=ct:st.next=ct,lt.lastBaseUpdate=at))}if(ot!==null){var dt=nt.baseState;it=0,lt=ct=at=null,st=ot;do{var ht=st.lane,mt=st.eventTime;if((rt&ht)===ht){lt!==null&&(lt=lt.next={eventTime:mt,lane:0,tag:st.tag,payload:st.payload,callback:st.callback,next:null});e:{var ft=et,pt=st;switch(ht=o,mt=tt,pt.tag){case 1:if(ft=pt.payload,typeof ft=="function"){dt=ft.call(mt,dt,ht);break e}dt=ft;break e;case 3:ft.flags=ft.flags&-65537|128;case 0:if(ft=pt.payload,ht=typeof ft=="function"?ft.call(mt,dt,ht):ft,ht==null)break e;dt=A$1({},dt,ht);break e;case 2:jh=!0}}st.callback!==null&&st.lane!==0&&(et.flags|=64,ht=nt.effects,ht===null?nt.effects=[st]:ht.push(st))}else mt={eventTime:mt,lane:ht,tag:st.tag,payload:st.payload,callback:st.callback,next:null},lt===null?(ct=lt=mt,at=dt):lt=lt.next=mt,it|=ht;if(st=st.next,st===null){if(st=nt.shared.pending,st===null)break;ht=st,st=ht.next,ht.next=null,nt.lastBaseUpdate=ht,nt.shared.pending=null}}while(!0);if(lt===null&&(at=dt),nt.baseState=at,nt.firstBaseUpdate=ct,nt.lastBaseUpdate=lt,o=nt.shared.interleaved,o!==null){nt=o;do it|=nt.lane,nt=nt.next;while(nt!==o)}else ot===null&&(nt.shared.lanes=0);rh|=it,et.lanes=it,et.memoizedState=dt}}function sh(et,o,tt){if(et=o.effects,o.effects=null,et!==null)for(o=0;o<et.length;o++){var rt=et[o],nt=rt.callback;if(nt!==null){if(rt.callback=null,rt=tt,typeof nt!="function")throw Error(p$4(191,nt));nt.call(rt)}}}var th={},uh=Uf(th),vh$1=Uf(th),wh=Uf(th);function xh(et){if(et===th)throw Error(p$4(174));return et}function yh(et,o){switch(G$1(wh,o),G$1(vh$1,et),G$1(uh,th),et=o.nodeType,et){case 9:case 11:o=(o=o.documentElement)?o.namespaceURI:lb(null,"");break;default:et=et===8?o.parentNode:o,o=et.namespaceURI||null,et=et.tagName,o=lb(o,et)}E$1(uh),G$1(uh,o)}function zh(){E$1(uh),E$1(vh$1),E$1(wh)}function Ah(et){xh(wh.current);var o=xh(uh.current),tt=lb(o,et.type);o!==tt&&(G$1(vh$1,et),G$1(uh,tt))}function Bh(et){vh$1.current===et&&(E$1(uh),E$1(vh$1))}var L$1=Uf(0);function Ch(et){for(var o=et;o!==null;){if(o.tag===13){var tt=o.memoizedState;if(tt!==null&&(tt=tt.dehydrated,tt===null||tt.data==="$?"||tt.data==="$!"))return o}else if(o.tag===19&&o.memoizedProps.revealOrder!==void 0){if(o.flags&128)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===et)break;for(;o.sibling===null;){if(o.return===null||o.return===et)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Dh=[];function Eh(){for(var et=0;et<Dh.length;et++)Dh[et]._workInProgressVersionPrimary=null;Dh.length=0}var Fh=ua.ReactCurrentDispatcher,Gh=ua.ReactCurrentBatchConfig,Hh=0,M$1=null,N$1=null,O=null,Ih=!1,Jh=!1,Kh=0,Lh=0;function P(){throw Error(p$4(321))}function Mh(et,o){if(o===null)return!1;for(var tt=0;tt<o.length&&tt<et.length;tt++)if(!He(et[tt],o[tt]))return!1;return!0}function Nh(et,o,tt,rt,nt,ot){if(Hh=ot,M$1=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,Fh.current=et===null||et.memoizedState===null?Oh:Ph,et=tt(rt,nt),Jh){ot=0;do{if(Jh=!1,Kh=0,25<=ot)throw Error(p$4(301));ot+=1,O=N$1=null,o.updateQueue=null,Fh.current=Qh,et=tt(rt,nt)}while(Jh)}if(Fh.current=Rh,o=N$1!==null&&N$1.next!==null,Hh=0,O=N$1=M$1=null,Ih=!1,o)throw Error(p$4(300));return et}function Sh(){var et=Kh!==0;return Kh=0,et}function Th(){var et={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return O===null?M$1.memoizedState=O=et:O=O.next=et,O}function Uh(){if(N$1===null){var et=M$1.alternate;et=et!==null?et.memoizedState:null}else et=N$1.next;var o=O===null?M$1.memoizedState:O.next;if(o!==null)O=o,N$1=et;else{if(et===null)throw Error(p$4(310));N$1=et,et={memoizedState:N$1.memoizedState,baseState:N$1.baseState,baseQueue:N$1.baseQueue,queue:N$1.queue,next:null},O===null?M$1.memoizedState=O=et:O=O.next=et}return O}function Vh(et,o){return typeof o=="function"?o(et):o}function Wh(et){var o=Uh(),tt=o.queue;if(tt===null)throw Error(p$4(311));tt.lastRenderedReducer=et;var rt=N$1,nt=rt.baseQueue,ot=tt.pending;if(ot!==null){if(nt!==null){var it=nt.next;nt.next=ot.next,ot.next=it}rt.baseQueue=nt=ot,tt.pending=null}if(nt!==null){ot=nt.next,rt=rt.baseState;var st=it=null,at=null,ct=ot;do{var lt=ct.lane;if((Hh&lt)===lt)at!==null&&(at=at.next={lane:0,action:ct.action,hasEagerState:ct.hasEagerState,eagerState:ct.eagerState,next:null}),rt=ct.hasEagerState?ct.eagerState:et(rt,ct.action);else{var dt={lane:lt,action:ct.action,hasEagerState:ct.hasEagerState,eagerState:ct.eagerState,next:null};at===null?(st=at=dt,it=rt):at=at.next=dt,M$1.lanes|=lt,rh|=lt}ct=ct.next}while(ct!==null&&ct!==ot);at===null?it=rt:at.next=st,He(rt,o.memoizedState)||(dh=!0),o.memoizedState=rt,o.baseState=it,o.baseQueue=at,tt.lastRenderedState=rt}if(et=tt.interleaved,et!==null){nt=et;do ot=nt.lane,M$1.lanes|=ot,rh|=ot,nt=nt.next;while(nt!==et)}else nt===null&&(tt.lanes=0);return[o.memoizedState,tt.dispatch]}function Xh(et){var o=Uh(),tt=o.queue;if(tt===null)throw Error(p$4(311));tt.lastRenderedReducer=et;var rt=tt.dispatch,nt=tt.pending,ot=o.memoizedState;if(nt!==null){tt.pending=null;var it=nt=nt.next;do ot=et(ot,it.action),it=it.next;while(it!==nt);He(ot,o.memoizedState)||(dh=!0),o.memoizedState=ot,o.baseQueue===null&&(o.baseState=ot),tt.lastRenderedState=ot}return[ot,rt]}function Yh(){}function Zh(et,o){var tt=M$1,rt=Uh(),nt=o(),ot=!He(rt.memoizedState,nt);if(ot&&(rt.memoizedState=nt,dh=!0),rt=rt.queue,$h(ai.bind(null,tt,rt,et),[et]),rt.getSnapshot!==o||ot||O!==null&&O.memoizedState.tag&1){if(tt.flags|=2048,bi(9,ci.bind(null,tt,rt,nt,o),void 0,null),Q$1===null)throw Error(p$4(349));Hh&30||di(tt,o,nt)}return nt}function di(et,o,tt){et.flags|=16384,et={getSnapshot:o,value:tt},o=M$1.updateQueue,o===null?(o={lastEffect:null,stores:null},M$1.updateQueue=o,o.stores=[et]):(tt=o.stores,tt===null?o.stores=[et]:tt.push(et))}function ci(et,o,tt,rt){o.value=tt,o.getSnapshot=rt,ei(o)&&fi(et)}function ai(et,o,tt){return tt(function(){ei(o)&&fi(et)})}function ei(et){var o=et.getSnapshot;et=et.value;try{var tt=o();return!He(et,tt)}catch{return!0}}function fi(et){var o=ih(et,1);o!==null&&gi(o,et,1,-1)}function hi(et){var o=Th();return typeof et=="function"&&(et=et()),o.memoizedState=o.baseState=et,et={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Vh,lastRenderedState:et},o.queue=et,et=et.dispatch=ii.bind(null,M$1,et),[o.memoizedState,et]}function bi(et,o,tt,rt){return et={tag:et,create:o,destroy:tt,deps:rt,next:null},o=M$1.updateQueue,o===null?(o={lastEffect:null,stores:null},M$1.updateQueue=o,o.lastEffect=et.next=et):(tt=o.lastEffect,tt===null?o.lastEffect=et.next=et:(rt=tt.next,tt.next=et,et.next=rt,o.lastEffect=et)),et}function ji(){return Uh().memoizedState}function ki(et,o,tt,rt){var nt=Th();M$1.flags|=et,nt.memoizedState=bi(1|o,tt,void 0,rt===void 0?null:rt)}function li(et,o,tt,rt){var nt=Uh();rt=rt===void 0?null:rt;var ot=void 0;if(N$1!==null){var it=N$1.memoizedState;if(ot=it.destroy,rt!==null&&Mh(rt,it.deps)){nt.memoizedState=bi(o,tt,ot,rt);return}}M$1.flags|=et,nt.memoizedState=bi(1|o,tt,ot,rt)}function mi(et,o){return ki(8390656,8,et,o)}function $h(et,o){return li(2048,8,et,o)}function ni(et,o){return li(4,2,et,o)}function oi(et,o){return li(4,4,et,o)}function pi(et,o){if(typeof o=="function")return et=et(),o(et),function(){o(null)};if(o!=null)return et=et(),o.current=et,function(){o.current=null}}function qi(et,o,tt){return tt=tt!=null?tt.concat([et]):null,li(4,4,pi.bind(null,o,et),tt)}function ri(){}function si(et,o){var tt=Uh();o=o===void 0?null:o;var rt=tt.memoizedState;return rt!==null&&o!==null&&Mh(o,rt[1])?rt[0]:(tt.memoizedState=[et,o],et)}function ti(et,o){var tt=Uh();o=o===void 0?null:o;var rt=tt.memoizedState;return rt!==null&&o!==null&&Mh(o,rt[1])?rt[0]:(et=et(),tt.memoizedState=[et,o],et)}function ui(et,o,tt){return Hh&21?(He(tt,o)||(tt=yc(),M$1.lanes|=tt,rh|=tt,et.baseState=!0),o):(et.baseState&&(et.baseState=!1,dh=!0),et.memoizedState=tt)}function vi(et,o){var tt=C$1;C$1=tt!==0&&4>tt?tt:4,et(!0);var rt=Gh.transition;Gh.transition={};try{et(!1),o()}finally{C$1=tt,Gh.transition=rt}}function wi(){return Uh().memoizedState}function xi(et,o,tt){var rt=yi(et);if(tt={lane:rt,action:tt,hasEagerState:!1,eagerState:null,next:null},zi(et))Ai(o,tt);else if(tt=hh(et,o,tt,rt),tt!==null){var nt=R();gi(tt,et,rt,nt),Bi(tt,o,rt)}}function ii(et,o,tt){var rt=yi(et),nt={lane:rt,action:tt,hasEagerState:!1,eagerState:null,next:null};if(zi(et))Ai(o,nt);else{var ot=et.alternate;if(et.lanes===0&&(ot===null||ot.lanes===0)&&(ot=o.lastRenderedReducer,ot!==null))try{var it=o.lastRenderedState,st=ot(it,tt);if(nt.hasEagerState=!0,nt.eagerState=st,He(st,it)){var at=o.interleaved;at===null?(nt.next=nt,gh(o)):(nt.next=at.next,at.next=nt),o.interleaved=nt;return}}catch{}finally{}tt=hh(et,o,nt,rt),tt!==null&&(nt=R(),gi(tt,et,rt,nt),Bi(tt,o,rt))}}function zi(et){var o=et.alternate;return et===M$1||o!==null&&o===M$1}function Ai(et,o){Jh=Ih=!0;var tt=et.pending;tt===null?o.next=o:(o.next=tt.next,tt.next=o),et.pending=o}function Bi(et,o,tt){if(tt&4194240){var rt=o.lanes;rt&=et.pendingLanes,tt|=rt,o.lanes=tt,Cc(et,tt)}}var Rh={readContext:eh,useCallback:P,useContext:P,useEffect:P,useImperativeHandle:P,useInsertionEffect:P,useLayoutEffect:P,useMemo:P,useReducer:P,useRef:P,useState:P,useDebugValue:P,useDeferredValue:P,useTransition:P,useMutableSource:P,useSyncExternalStore:P,useId:P,unstable_isNewReconciler:!1},Oh={readContext:eh,useCallback:function(et,o){return Th().memoizedState=[et,o===void 0?null:o],et},useContext:eh,useEffect:mi,useImperativeHandle:function(et,o,tt){return tt=tt!=null?tt.concat([et]):null,ki(4194308,4,pi.bind(null,o,et),tt)},useLayoutEffect:function(et,o){return ki(4194308,4,et,o)},useInsertionEffect:function(et,o){return ki(4,2,et,o)},useMemo:function(et,o){var tt=Th();return o=o===void 0?null:o,et=et(),tt.memoizedState=[et,o],et},useReducer:function(et,o,tt){var rt=Th();return o=tt!==void 0?tt(o):o,rt.memoizedState=rt.baseState=o,et={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:et,lastRenderedState:o},rt.queue=et,et=et.dispatch=xi.bind(null,M$1,et),[rt.memoizedState,et]},useRef:function(et){var o=Th();return et={current:et},o.memoizedState=et},useState:hi,useDebugValue:ri,useDeferredValue:function(et){return Th().memoizedState=et},useTransition:function(){var et=hi(!1),o=et[0];return et=vi.bind(null,et[1]),Th().memoizedState=et,[o,et]},useMutableSource:function(){},useSyncExternalStore:function(et,o,tt){var rt=M$1,nt=Th();if(I$1){if(tt===void 0)throw Error(p$4(407));tt=tt()}else{if(tt=o(),Q$1===null)throw Error(p$4(349));Hh&30||di(rt,o,tt)}nt.memoizedState=tt;var ot={value:tt,getSnapshot:o};return nt.queue=ot,mi(ai.bind(null,rt,ot,et),[et]),rt.flags|=2048,bi(9,ci.bind(null,rt,ot,tt,o),void 0,null),tt},useId:function(){var et=Th(),o=Q$1.identifierPrefix;if(I$1){var tt=sg,rt=rg;tt=(rt&~(1<<32-oc(rt)-1)).toString(32)+tt,o=":"+o+"R"+tt,tt=Kh++,0<tt&&(o+="H"+tt.toString(32)),o+=":"}else tt=Lh++,o=":"+o+"r"+tt.toString(32)+":";return et.memoizedState=o},unstable_isNewReconciler:!1},Ph={readContext:eh,useCallback:si,useContext:eh,useEffect:$h,useImperativeHandle:qi,useInsertionEffect:ni,useLayoutEffect:oi,useMemo:ti,useReducer:Wh,useRef:ji,useState:function(){return Wh(Vh)},useDebugValue:ri,useDeferredValue:function(et){var o=Uh();return ui(o,N$1.memoizedState,et)},useTransition:function(){var et=Wh(Vh)[0],o=Uh().memoizedState;return[et,o]},useMutableSource:Yh,useSyncExternalStore:Zh,useId:wi,unstable_isNewReconciler:!1},Qh={readContext:eh,useCallback:si,useContext:eh,useEffect:$h,useImperativeHandle:qi,useInsertionEffect:ni,useLayoutEffect:oi,useMemo:ti,useReducer:Xh,useRef:ji,useState:function(){return Xh(Vh)},useDebugValue:ri,useDeferredValue:function(et){var o=Uh();return N$1===null?o.memoizedState=et:ui(o,N$1.memoizedState,et)},useTransition:function(){var et=Xh(Vh)[0],o=Uh().memoizedState;return[et,o]},useMutableSource:Yh,useSyncExternalStore:Zh,useId:wi,unstable_isNewReconciler:!1};function Ci(et,o){if(et&&et.defaultProps){o=A$1({},o),et=et.defaultProps;for(var tt in et)o[tt]===void 0&&(o[tt]=et[tt]);return o}return o}function Di(et,o,tt,rt){o=et.memoizedState,tt=tt(rt,o),tt=tt==null?o:A$1({},o,tt),et.memoizedState=tt,et.lanes===0&&(et.updateQueue.baseState=tt)}var Ei={isMounted:function(et){return(et=et._reactInternals)?Vb(et)===et:!1},enqueueSetState:function(et,o,tt){et=et._reactInternals;var rt=R(),nt=yi(et),ot=mh(rt,nt);ot.payload=o,tt!=null&&(ot.callback=tt),o=nh(et,ot,nt),o!==null&&(gi(o,et,nt,rt),oh(o,et,nt))},enqueueReplaceState:function(et,o,tt){et=et._reactInternals;var rt=R(),nt=yi(et),ot=mh(rt,nt);ot.tag=1,ot.payload=o,tt!=null&&(ot.callback=tt),o=nh(et,ot,nt),o!==null&&(gi(o,et,nt,rt),oh(o,et,nt))},enqueueForceUpdate:function(et,o){et=et._reactInternals;var tt=R(),rt=yi(et),nt=mh(tt,rt);nt.tag=2,o!=null&&(nt.callback=o),o=nh(et,nt,rt),o!==null&&(gi(o,et,rt,tt),oh(o,et,rt))}};function Fi(et,o,tt,rt,nt,ot,it){return et=et.stateNode,typeof et.shouldComponentUpdate=="function"?et.shouldComponentUpdate(rt,ot,it):o.prototype&&o.prototype.isPureReactComponent?!Ie(tt,rt)||!Ie(nt,ot):!0}function Gi(et,o,tt){var rt=!1,nt=Vf,ot=o.contextType;return typeof ot=="object"&&ot!==null?ot=eh(ot):(nt=Zf(o)?Xf:H$1.current,rt=o.contextTypes,ot=(rt=rt!=null)?Yf(et,nt):Vf),o=new o(tt,ot),et.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=Ei,et.stateNode=o,o._reactInternals=et,rt&&(et=et.stateNode,et.__reactInternalMemoizedUnmaskedChildContext=nt,et.__reactInternalMemoizedMaskedChildContext=ot),o}function Hi(et,o,tt,rt){et=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(tt,rt),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(tt,rt),o.state!==et&&Ei.enqueueReplaceState(o,o.state,null)}function Ii(et,o,tt,rt){var nt=et.stateNode;nt.props=tt,nt.state=et.memoizedState,nt.refs={},kh(et);var ot=o.contextType;typeof ot=="object"&&ot!==null?nt.context=eh(ot):(ot=Zf(o)?Xf:H$1.current,nt.context=Yf(et,ot)),nt.state=et.memoizedState,ot=o.getDerivedStateFromProps,typeof ot=="function"&&(Di(et,o,ot,tt),nt.state=et.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof nt.getSnapshotBeforeUpdate=="function"||typeof nt.UNSAFE_componentWillMount!="function"&&typeof nt.componentWillMount!="function"||(o=nt.state,typeof nt.componentWillMount=="function"&&nt.componentWillMount(),typeof nt.UNSAFE_componentWillMount=="function"&&nt.UNSAFE_componentWillMount(),o!==nt.state&&Ei.enqueueReplaceState(nt,nt.state,null),qh(et,tt,nt,rt),nt.state=et.memoizedState),typeof nt.componentDidMount=="function"&&(et.flags|=4194308)}function Ji(et,o){try{var tt="",rt=o;do tt+=Pa(rt),rt=rt.return;while(rt);var nt=tt}catch(ot){nt=`
Error generating stack: `+ot.message+`
`+ot.stack}return{value:et,source:o,stack:nt,digest:null}}function Ki(et,o,tt){return{value:et,source:null,stack:tt??null,digest:o??null}}function Li(et,o){try{console.error(o.value)}catch(tt){setTimeout(function(){throw tt})}}var Mi=typeof WeakMap=="function"?WeakMap:Map;function Ni(et,o,tt){tt=mh(-1,tt),tt.tag=3,tt.payload={element:null};var rt=o.value;return tt.callback=function(){Oi||(Oi=!0,Pi=rt),Li(et,o)},tt}function Qi(et,o,tt){tt=mh(-1,tt),tt.tag=3;var rt=et.type.getDerivedStateFromError;if(typeof rt=="function"){var nt=o.value;tt.payload=function(){return rt(nt)},tt.callback=function(){Li(et,o)}}var ot=et.stateNode;return ot!==null&&typeof ot.componentDidCatch=="function"&&(tt.callback=function(){Li(et,o),typeof rt!="function"&&(Ri===null?Ri=new Set([this]):Ri.add(this));var it=o.stack;this.componentDidCatch(o.value,{componentStack:it!==null?it:""})}),tt}function Si(et,o,tt){var rt=et.pingCache;if(rt===null){rt=et.pingCache=new Mi;var nt=new Set;rt.set(o,nt)}else nt=rt.get(o),nt===void 0&&(nt=new Set,rt.set(o,nt));nt.has(tt)||(nt.add(tt),et=Ti.bind(null,et,o,tt),o.then(et,et))}function Ui(et){do{var o;if((o=et.tag===13)&&(o=et.memoizedState,o=o!==null?o.dehydrated!==null:!0),o)return et;et=et.return}while(et!==null);return null}function Vi(et,o,tt,rt,nt){return et.mode&1?(et.flags|=65536,et.lanes=nt,et):(et===o?et.flags|=65536:(et.flags|=128,tt.flags|=131072,tt.flags&=-52805,tt.tag===1&&(tt.alternate===null?tt.tag=17:(o=mh(-1,1),o.tag=2,nh(tt,o,1))),tt.lanes|=1),et)}var Wi=ua.ReactCurrentOwner,dh=!1;function Xi(et,o,tt,rt){o.child=et===null?Vg(o,null,tt,rt):Ug(o,et.child,tt,rt)}function Yi(et,o,tt,rt,nt){tt=tt.render;var ot=o.ref;return ch(o,nt),rt=Nh(et,o,tt,rt,ot,nt),tt=Sh(),et!==null&&!dh?(o.updateQueue=et.updateQueue,o.flags&=-2053,et.lanes&=~nt,Zi(et,o,nt)):(I$1&&tt&&vg(o),o.flags|=1,Xi(et,o,rt,nt),o.child)}function $i(et,o,tt,rt,nt){if(et===null){var ot=tt.type;return typeof ot=="function"&&!aj(ot)&&ot.defaultProps===void 0&&tt.compare===null&&tt.defaultProps===void 0?(o.tag=15,o.type=ot,bj(et,o,ot,rt,nt)):(et=Rg(tt.type,null,rt,o,o.mode,nt),et.ref=o.ref,et.return=o,o.child=et)}if(ot=et.child,!(et.lanes&nt)){var it=ot.memoizedProps;if(tt=tt.compare,tt=tt!==null?tt:Ie,tt(it,rt)&&et.ref===o.ref)return Zi(et,o,nt)}return o.flags|=1,et=Pg(ot,rt),et.ref=o.ref,et.return=o,o.child=et}function bj(et,o,tt,rt,nt){if(et!==null){var ot=et.memoizedProps;if(Ie(ot,rt)&&et.ref===o.ref)if(dh=!1,o.pendingProps=rt=ot,(et.lanes&nt)!==0)et.flags&131072&&(dh=!0);else return o.lanes=et.lanes,Zi(et,o,nt)}return cj(et,o,tt,rt,nt)}function dj(et,o,tt){var rt=o.pendingProps,nt=rt.children,ot=et!==null?et.memoizedState:null;if(rt.mode==="hidden")if(!(o.mode&1))o.memoizedState={baseLanes:0,cachePool:null,transitions:null},G$1(ej,fj),fj|=tt;else{if(!(tt&1073741824))return et=ot!==null?ot.baseLanes|tt:tt,o.lanes=o.childLanes=1073741824,o.memoizedState={baseLanes:et,cachePool:null,transitions:null},o.updateQueue=null,G$1(ej,fj),fj|=et,null;o.memoizedState={baseLanes:0,cachePool:null,transitions:null},rt=ot!==null?ot.baseLanes:tt,G$1(ej,fj),fj|=rt}else ot!==null?(rt=ot.baseLanes|tt,o.memoizedState=null):rt=tt,G$1(ej,fj),fj|=rt;return Xi(et,o,nt,tt),o.child}function gj(et,o){var tt=o.ref;(et===null&&tt!==null||et!==null&&et.ref!==tt)&&(o.flags|=512,o.flags|=2097152)}function cj(et,o,tt,rt,nt){var ot=Zf(tt)?Xf:H$1.current;return ot=Yf(o,ot),ch(o,nt),tt=Nh(et,o,tt,rt,ot,nt),rt=Sh(),et!==null&&!dh?(o.updateQueue=et.updateQueue,o.flags&=-2053,et.lanes&=~nt,Zi(et,o,nt)):(I$1&&rt&&vg(o),o.flags|=1,Xi(et,o,tt,nt),o.child)}function hj(et,o,tt,rt,nt){if(Zf(tt)){var ot=!0;cg(o)}else ot=!1;if(ch(o,nt),o.stateNode===null)ij(et,o),Gi(o,tt,rt),Ii(o,tt,rt,nt),rt=!0;else if(et===null){var it=o.stateNode,st=o.memoizedProps;it.props=st;var at=it.context,ct=tt.contextType;typeof ct=="object"&&ct!==null?ct=eh(ct):(ct=Zf(tt)?Xf:H$1.current,ct=Yf(o,ct));var lt=tt.getDerivedStateFromProps,dt=typeof lt=="function"||typeof it.getSnapshotBeforeUpdate=="function";dt||typeof it.UNSAFE_componentWillReceiveProps!="function"&&typeof it.componentWillReceiveProps!="function"||(st!==rt||at!==ct)&&Hi(o,it,rt,ct),jh=!1;var ht=o.memoizedState;it.state=ht,qh(o,rt,it,nt),at=o.memoizedState,st!==rt||ht!==at||Wf.current||jh?(typeof lt=="function"&&(Di(o,tt,lt,rt),at=o.memoizedState),(st=jh||Fi(o,tt,st,rt,ht,at,ct))?(dt||typeof it.UNSAFE_componentWillMount!="function"&&typeof it.componentWillMount!="function"||(typeof it.componentWillMount=="function"&&it.componentWillMount(),typeof it.UNSAFE_componentWillMount=="function"&&it.UNSAFE_componentWillMount()),typeof it.componentDidMount=="function"&&(o.flags|=4194308)):(typeof it.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=rt,o.memoizedState=at),it.props=rt,it.state=at,it.context=ct,rt=st):(typeof it.componentDidMount=="function"&&(o.flags|=4194308),rt=!1)}else{it=o.stateNode,lh(et,o),st=o.memoizedProps,ct=o.type===o.elementType?st:Ci(o.type,st),it.props=ct,dt=o.pendingProps,ht=it.context,at=tt.contextType,typeof at=="object"&&at!==null?at=eh(at):(at=Zf(tt)?Xf:H$1.current,at=Yf(o,at));var mt=tt.getDerivedStateFromProps;(lt=typeof mt=="function"||typeof it.getSnapshotBeforeUpdate=="function")||typeof it.UNSAFE_componentWillReceiveProps!="function"&&typeof it.componentWillReceiveProps!="function"||(st!==dt||ht!==at)&&Hi(o,it,rt,at),jh=!1,ht=o.memoizedState,it.state=ht,qh(o,rt,it,nt);var ft=o.memoizedState;st!==dt||ht!==ft||Wf.current||jh?(typeof mt=="function"&&(Di(o,tt,mt,rt),ft=o.memoizedState),(ct=jh||Fi(o,tt,ct,rt,ht,ft,at)||!1)?(lt||typeof it.UNSAFE_componentWillUpdate!="function"&&typeof it.componentWillUpdate!="function"||(typeof it.componentWillUpdate=="function"&&it.componentWillUpdate(rt,ft,at),typeof it.UNSAFE_componentWillUpdate=="function"&&it.UNSAFE_componentWillUpdate(rt,ft,at)),typeof it.componentDidUpdate=="function"&&(o.flags|=4),typeof it.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof it.componentDidUpdate!="function"||st===et.memoizedProps&&ht===et.memoizedState||(o.flags|=4),typeof it.getSnapshotBeforeUpdate!="function"||st===et.memoizedProps&&ht===et.memoizedState||(o.flags|=1024),o.memoizedProps=rt,o.memoizedState=ft),it.props=rt,it.state=ft,it.context=at,rt=ct):(typeof it.componentDidUpdate!="function"||st===et.memoizedProps&&ht===et.memoizedState||(o.flags|=4),typeof it.getSnapshotBeforeUpdate!="function"||st===et.memoizedProps&&ht===et.memoizedState||(o.flags|=1024),rt=!1)}return jj(et,o,tt,rt,ot,nt)}function jj(et,o,tt,rt,nt,ot){gj(et,o);var it=(o.flags&128)!==0;if(!rt&&!it)return nt&&dg(o,tt,!1),Zi(et,o,ot);rt=o.stateNode,Wi.current=o;var st=it&&typeof tt.getDerivedStateFromError!="function"?null:rt.render();return o.flags|=1,et!==null&&it?(o.child=Ug(o,et.child,null,ot),o.child=Ug(o,null,st,ot)):Xi(et,o,st,ot),o.memoizedState=rt.state,nt&&dg(o,tt,!0),o.child}function kj(et){var o=et.stateNode;o.pendingContext?ag(et,o.pendingContext,o.pendingContext!==o.context):o.context&&ag(et,o.context,!1),yh(et,o.containerInfo)}function lj(et,o,tt,rt,nt){return Ig(),Jg(nt),o.flags|=256,Xi(et,o,tt,rt),o.child}var mj={dehydrated:null,treeContext:null,retryLane:0};function nj(et){return{baseLanes:et,cachePool:null,transitions:null}}function oj(et,o,tt){var rt=o.pendingProps,nt=L$1.current,ot=!1,it=(o.flags&128)!==0,st;if((st=it)||(st=et!==null&&et.memoizedState===null?!1:(nt&2)!==0),st?(ot=!0,o.flags&=-129):(et===null||et.memoizedState!==null)&&(nt|=1),G$1(L$1,nt&1),et===null)return Eg(o),et=o.memoizedState,et!==null&&(et=et.dehydrated,et!==null)?(o.mode&1?et.data==="$!"?o.lanes=8:o.lanes=1073741824:o.lanes=1,null):(it=rt.children,et=rt.fallback,ot?(rt=o.mode,ot=o.child,it={mode:"hidden",children:it},!(rt&1)&&ot!==null?(ot.childLanes=0,ot.pendingProps=it):ot=pj(it,rt,0,null),et=Tg(et,rt,tt,null),ot.return=o,et.return=o,ot.sibling=et,o.child=ot,o.child.memoizedState=nj(tt),o.memoizedState=mj,et):qj(o,it));if(nt=et.memoizedState,nt!==null&&(st=nt.dehydrated,st!==null))return rj(et,o,it,rt,st,nt,tt);if(ot){ot=rt.fallback,it=o.mode,nt=et.child,st=nt.sibling;var at={mode:"hidden",children:rt.children};return!(it&1)&&o.child!==nt?(rt=o.child,rt.childLanes=0,rt.pendingProps=at,o.deletions=null):(rt=Pg(nt,at),rt.subtreeFlags=nt.subtreeFlags&14680064),st!==null?ot=Pg(st,ot):(ot=Tg(ot,it,tt,null),ot.flags|=2),ot.return=o,rt.return=o,rt.sibling=ot,o.child=rt,rt=ot,ot=o.child,it=et.child.memoizedState,it=it===null?nj(tt):{baseLanes:it.baseLanes|tt,cachePool:null,transitions:it.transitions},ot.memoizedState=it,ot.childLanes=et.childLanes&~tt,o.memoizedState=mj,rt}return ot=et.child,et=ot.sibling,rt=Pg(ot,{mode:"visible",children:rt.children}),!(o.mode&1)&&(rt.lanes=tt),rt.return=o,rt.sibling=null,et!==null&&(tt=o.deletions,tt===null?(o.deletions=[et],o.flags|=16):tt.push(et)),o.child=rt,o.memoizedState=null,rt}function qj(et,o){return o=pj({mode:"visible",children:o},et.mode,0,null),o.return=et,et.child=o}function sj(et,o,tt,rt){return rt!==null&&Jg(rt),Ug(o,et.child,null,tt),et=qj(o,o.pendingProps.children),et.flags|=2,o.memoizedState=null,et}function rj(et,o,tt,rt,nt,ot,it){if(tt)return o.flags&256?(o.flags&=-257,rt=Ki(Error(p$4(422))),sj(et,o,it,rt)):o.memoizedState!==null?(o.child=et.child,o.flags|=128,null):(ot=rt.fallback,nt=o.mode,rt=pj({mode:"visible",children:rt.children},nt,0,null),ot=Tg(ot,nt,it,null),ot.flags|=2,rt.return=o,ot.return=o,rt.sibling=ot,o.child=rt,o.mode&1&&Ug(o,et.child,null,it),o.child.memoizedState=nj(it),o.memoizedState=mj,ot);if(!(o.mode&1))return sj(et,o,it,null);if(nt.data==="$!"){if(rt=nt.nextSibling&&nt.nextSibling.dataset,rt)var st=rt.dgst;return rt=st,ot=Error(p$4(419)),rt=Ki(ot,rt,void 0),sj(et,o,it,rt)}if(st=(it&et.childLanes)!==0,dh||st){if(rt=Q$1,rt!==null){switch(it&-it){case 4:nt=2;break;case 16:nt=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:nt=32;break;case 536870912:nt=268435456;break;default:nt=0}nt=nt&(rt.suspendedLanes|it)?0:nt,nt!==0&&nt!==ot.retryLane&&(ot.retryLane=nt,ih(et,nt),gi(rt,et,nt,-1))}return tj(),rt=Ki(Error(p$4(421))),sj(et,o,it,rt)}return nt.data==="$?"?(o.flags|=128,o.child=et.child,o=uj.bind(null,et),nt._reactRetry=o,null):(et=ot.treeContext,yg=Lf(nt.nextSibling),xg=o,I$1=!0,zg=null,et!==null&&(og[pg++]=rg,og[pg++]=sg,og[pg++]=qg,rg=et.id,sg=et.overflow,qg=o),o=qj(o,rt.children),o.flags|=4096,o)}function vj(et,o,tt){et.lanes|=o;var rt=et.alternate;rt!==null&&(rt.lanes|=o),bh(et.return,o,tt)}function wj(et,o,tt,rt,nt){var ot=et.memoizedState;ot===null?et.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:rt,tail:tt,tailMode:nt}:(ot.isBackwards=o,ot.rendering=null,ot.renderingStartTime=0,ot.last=rt,ot.tail=tt,ot.tailMode=nt)}function xj(et,o,tt){var rt=o.pendingProps,nt=rt.revealOrder,ot=rt.tail;if(Xi(et,o,rt.children,tt),rt=L$1.current,rt&2)rt=rt&1|2,o.flags|=128;else{if(et!==null&&et.flags&128)e:for(et=o.child;et!==null;){if(et.tag===13)et.memoizedState!==null&&vj(et,tt,o);else if(et.tag===19)vj(et,tt,o);else if(et.child!==null){et.child.return=et,et=et.child;continue}if(et===o)break e;for(;et.sibling===null;){if(et.return===null||et.return===o)break e;et=et.return}et.sibling.return=et.return,et=et.sibling}rt&=1}if(G$1(L$1,rt),!(o.mode&1))o.memoizedState=null;else switch(nt){case"forwards":for(tt=o.child,nt=null;tt!==null;)et=tt.alternate,et!==null&&Ch(et)===null&&(nt=tt),tt=tt.sibling;tt=nt,tt===null?(nt=o.child,o.child=null):(nt=tt.sibling,tt.sibling=null),wj(o,!1,nt,tt,ot);break;case"backwards":for(tt=null,nt=o.child,o.child=null;nt!==null;){if(et=nt.alternate,et!==null&&Ch(et)===null){o.child=nt;break}et=nt.sibling,nt.sibling=tt,tt=nt,nt=et}wj(o,!0,tt,null,ot);break;case"together":wj(o,!1,null,null,void 0);break;default:o.memoizedState=null}return o.child}function ij(et,o){!(o.mode&1)&&et!==null&&(et.alternate=null,o.alternate=null,o.flags|=2)}function Zi(et,o,tt){if(et!==null&&(o.dependencies=et.dependencies),rh|=o.lanes,!(tt&o.childLanes))return null;if(et!==null&&o.child!==et.child)throw Error(p$4(153));if(o.child!==null){for(et=o.child,tt=Pg(et,et.pendingProps),o.child=tt,tt.return=o;et.sibling!==null;)et=et.sibling,tt=tt.sibling=Pg(et,et.pendingProps),tt.return=o;tt.sibling=null}return o.child}function yj(et,o,tt){switch(o.tag){case 3:kj(o),Ig();break;case 5:Ah(o);break;case 1:Zf(o.type)&&cg(o);break;case 4:yh(o,o.stateNode.containerInfo);break;case 10:var rt=o.type._context,nt=o.memoizedProps.value;G$1(Wg,rt._currentValue),rt._currentValue=nt;break;case 13:if(rt=o.memoizedState,rt!==null)return rt.dehydrated!==null?(G$1(L$1,L$1.current&1),o.flags|=128,null):tt&o.child.childLanes?oj(et,o,tt):(G$1(L$1,L$1.current&1),et=Zi(et,o,tt),et!==null?et.sibling:null);G$1(L$1,L$1.current&1);break;case 19:if(rt=(tt&o.childLanes)!==0,et.flags&128){if(rt)return xj(et,o,tt);o.flags|=128}if(nt=o.memoizedState,nt!==null&&(nt.rendering=null,nt.tail=null,nt.lastEffect=null),G$1(L$1,L$1.current),rt)break;return null;case 22:case 23:return o.lanes=0,dj(et,o,tt)}return Zi(et,o,tt)}var zj,Aj,Bj,Cj;zj=function(et,o){for(var tt=o.child;tt!==null;){if(tt.tag===5||tt.tag===6)et.appendChild(tt.stateNode);else if(tt.tag!==4&&tt.child!==null){tt.child.return=tt,tt=tt.child;continue}if(tt===o)break;for(;tt.sibling===null;){if(tt.return===null||tt.return===o)return;tt=tt.return}tt.sibling.return=tt.return,tt=tt.sibling}};Aj=function(){};Bj=function(et,o,tt,rt){var nt=et.memoizedProps;if(nt!==rt){et=o.stateNode,xh(uh.current);var ot=null;switch(tt){case"input":nt=Ya(et,nt),rt=Ya(et,rt),ot=[];break;case"select":nt=A$1({},nt,{value:void 0}),rt=A$1({},rt,{value:void 0}),ot=[];break;case"textarea":nt=gb(et,nt),rt=gb(et,rt),ot=[];break;default:typeof nt.onClick!="function"&&typeof rt.onClick=="function"&&(et.onclick=Bf)}ub(tt,rt);var it;tt=null;for(ct in nt)if(!rt.hasOwnProperty(ct)&&nt.hasOwnProperty(ct)&&nt[ct]!=null)if(ct==="style"){var st=nt[ct];for(it in st)st.hasOwnProperty(it)&&(tt||(tt={}),tt[it]="")}else ct!=="dangerouslySetInnerHTML"&&ct!=="children"&&ct!=="suppressContentEditableWarning"&&ct!=="suppressHydrationWarning"&&ct!=="autoFocus"&&(ea.hasOwnProperty(ct)?ot||(ot=[]):(ot=ot||[]).push(ct,null));for(ct in rt){var at=rt[ct];if(st=nt!=null?nt[ct]:void 0,rt.hasOwnProperty(ct)&&at!==st&&(at!=null||st!=null))if(ct==="style")if(st){for(it in st)!st.hasOwnProperty(it)||at&&at.hasOwnProperty(it)||(tt||(tt={}),tt[it]="");for(it in at)at.hasOwnProperty(it)&&st[it]!==at[it]&&(tt||(tt={}),tt[it]=at[it])}else tt||(ot||(ot=[]),ot.push(ct,tt)),tt=at;else ct==="dangerouslySetInnerHTML"?(at=at?at.__html:void 0,st=st?st.__html:void 0,at!=null&&st!==at&&(ot=ot||[]).push(ct,at)):ct==="children"?typeof at!="string"&&typeof at!="number"||(ot=ot||[]).push(ct,""+at):ct!=="suppressContentEditableWarning"&&ct!=="suppressHydrationWarning"&&(ea.hasOwnProperty(ct)?(at!=null&&ct==="onScroll"&&D$1("scroll",et),ot||st===at||(ot=[])):(ot=ot||[]).push(ct,at))}tt&&(ot=ot||[]).push("style",tt);var ct=ot;(o.updateQueue=ct)&&(o.flags|=4)}};Cj=function(et,o,tt,rt){tt!==rt&&(o.flags|=4)};function Dj(et,o){if(!I$1)switch(et.tailMode){case"hidden":o=et.tail;for(var tt=null;o!==null;)o.alternate!==null&&(tt=o),o=o.sibling;tt===null?et.tail=null:tt.sibling=null;break;case"collapsed":tt=et.tail;for(var rt=null;tt!==null;)tt.alternate!==null&&(rt=tt),tt=tt.sibling;rt===null?o||et.tail===null?et.tail=null:et.tail.sibling=null:rt.sibling=null}}function S$1(et){var o=et.alternate!==null&&et.alternate.child===et.child,tt=0,rt=0;if(o)for(var nt=et.child;nt!==null;)tt|=nt.lanes|nt.childLanes,rt|=nt.subtreeFlags&14680064,rt|=nt.flags&14680064,nt.return=et,nt=nt.sibling;else for(nt=et.child;nt!==null;)tt|=nt.lanes|nt.childLanes,rt|=nt.subtreeFlags,rt|=nt.flags,nt.return=et,nt=nt.sibling;return et.subtreeFlags|=rt,et.childLanes=tt,o}function Ej(et,o,tt){var rt=o.pendingProps;switch(wg(o),o.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return S$1(o),null;case 1:return Zf(o.type)&&$f(),S$1(o),null;case 3:return rt=o.stateNode,zh(),E$1(Wf),E$1(H$1),Eh(),rt.pendingContext&&(rt.context=rt.pendingContext,rt.pendingContext=null),(et===null||et.child===null)&&(Gg(o)?o.flags|=4:et===null||et.memoizedState.isDehydrated&&!(o.flags&256)||(o.flags|=1024,zg!==null&&(Fj(zg),zg=null))),Aj(et,o),S$1(o),null;case 5:Bh(o);var nt=xh(wh.current);if(tt=o.type,et!==null&&o.stateNode!=null)Bj(et,o,tt,rt,nt),et.ref!==o.ref&&(o.flags|=512,o.flags|=2097152);else{if(!rt){if(o.stateNode===null)throw Error(p$4(166));return S$1(o),null}if(et=xh(uh.current),Gg(o)){rt=o.stateNode,tt=o.type;var ot=o.memoizedProps;switch(rt[Of]=o,rt[Pf]=ot,et=(o.mode&1)!==0,tt){case"dialog":D$1("cancel",rt),D$1("close",rt);break;case"iframe":case"object":case"embed":D$1("load",rt);break;case"video":case"audio":for(nt=0;nt<lf.length;nt++)D$1(lf[nt],rt);break;case"source":D$1("error",rt);break;case"img":case"image":case"link":D$1("error",rt),D$1("load",rt);break;case"details":D$1("toggle",rt);break;case"input":Za(rt,ot),D$1("invalid",rt);break;case"select":rt._wrapperState={wasMultiple:!!ot.multiple},D$1("invalid",rt);break;case"textarea":hb(rt,ot),D$1("invalid",rt)}ub(tt,ot),nt=null;for(var it in ot)if(ot.hasOwnProperty(it)){var st=ot[it];it==="children"?typeof st=="string"?rt.textContent!==st&&(ot.suppressHydrationWarning!==!0&&Af(rt.textContent,st,et),nt=["children",st]):typeof st=="number"&&rt.textContent!==""+st&&(ot.suppressHydrationWarning!==!0&&Af(rt.textContent,st,et),nt=["children",""+st]):ea.hasOwnProperty(it)&&st!=null&&it==="onScroll"&&D$1("scroll",rt)}switch(tt){case"input":Va(rt),db(rt,ot,!0);break;case"textarea":Va(rt),jb(rt);break;case"select":case"option":break;default:typeof ot.onClick=="function"&&(rt.onclick=Bf)}rt=nt,o.updateQueue=rt,rt!==null&&(o.flags|=4)}else{it=nt.nodeType===9?nt:nt.ownerDocument,et==="http://www.w3.org/1999/xhtml"&&(et=kb(tt)),et==="http://www.w3.org/1999/xhtml"?tt==="script"?(et=it.createElement("div"),et.innerHTML="<script><\/script>",et=et.removeChild(et.firstChild)):typeof rt.is=="string"?et=it.createElement(tt,{is:rt.is}):(et=it.createElement(tt),tt==="select"&&(it=et,rt.multiple?it.multiple=!0:rt.size&&(it.size=rt.size))):et=it.createElementNS(et,tt),et[Of]=o,et[Pf]=rt,zj(et,o,!1,!1),o.stateNode=et;e:{switch(it=vb(tt,rt),tt){case"dialog":D$1("cancel",et),D$1("close",et),nt=rt;break;case"iframe":case"object":case"embed":D$1("load",et),nt=rt;break;case"video":case"audio":for(nt=0;nt<lf.length;nt++)D$1(lf[nt],et);nt=rt;break;case"source":D$1("error",et),nt=rt;break;case"img":case"image":case"link":D$1("error",et),D$1("load",et),nt=rt;break;case"details":D$1("toggle",et),nt=rt;break;case"input":Za(et,rt),nt=Ya(et,rt),D$1("invalid",et);break;case"option":nt=rt;break;case"select":et._wrapperState={wasMultiple:!!rt.multiple},nt=A$1({},rt,{value:void 0}),D$1("invalid",et);break;case"textarea":hb(et,rt),nt=gb(et,rt),D$1("invalid",et);break;default:nt=rt}ub(tt,nt),st=nt;for(ot in st)if(st.hasOwnProperty(ot)){var at=st[ot];ot==="style"?sb(et,at):ot==="dangerouslySetInnerHTML"?(at=at?at.__html:void 0,at!=null&&nb(et,at)):ot==="children"?typeof at=="string"?(tt!=="textarea"||at!=="")&&ob(et,at):typeof at=="number"&&ob(et,""+at):ot!=="suppressContentEditableWarning"&&ot!=="suppressHydrationWarning"&&ot!=="autoFocus"&&(ea.hasOwnProperty(ot)?at!=null&&ot==="onScroll"&&D$1("scroll",et):at!=null&&ta(et,ot,at,it))}switch(tt){case"input":Va(et),db(et,rt,!1);break;case"textarea":Va(et),jb(et);break;case"option":rt.value!=null&&et.setAttribute("value",""+Sa(rt.value));break;case"select":et.multiple=!!rt.multiple,ot=rt.value,ot!=null?fb(et,!!rt.multiple,ot,!1):rt.defaultValue!=null&&fb(et,!!rt.multiple,rt.defaultValue,!0);break;default:typeof nt.onClick=="function"&&(et.onclick=Bf)}switch(tt){case"button":case"input":case"select":case"textarea":rt=!!rt.autoFocus;break e;case"img":rt=!0;break e;default:rt=!1}}rt&&(o.flags|=4)}o.ref!==null&&(o.flags|=512,o.flags|=2097152)}return S$1(o),null;case 6:if(et&&o.stateNode!=null)Cj(et,o,et.memoizedProps,rt);else{if(typeof rt!="string"&&o.stateNode===null)throw Error(p$4(166));if(tt=xh(wh.current),xh(uh.current),Gg(o)){if(rt=o.stateNode,tt=o.memoizedProps,rt[Of]=o,(ot=rt.nodeValue!==tt)&&(et=xg,et!==null))switch(et.tag){case 3:Af(rt.nodeValue,tt,(et.mode&1)!==0);break;case 5:et.memoizedProps.suppressHydrationWarning!==!0&&Af(rt.nodeValue,tt,(et.mode&1)!==0)}ot&&(o.flags|=4)}else rt=(tt.nodeType===9?tt:tt.ownerDocument).createTextNode(rt),rt[Of]=o,o.stateNode=rt}return S$1(o),null;case 13:if(E$1(L$1),rt=o.memoizedState,et===null||et.memoizedState!==null&&et.memoizedState.dehydrated!==null){if(I$1&&yg!==null&&o.mode&1&&!(o.flags&128))Hg(),Ig(),o.flags|=98560,ot=!1;else if(ot=Gg(o),rt!==null&&rt.dehydrated!==null){if(et===null){if(!ot)throw Error(p$4(318));if(ot=o.memoizedState,ot=ot!==null?ot.dehydrated:null,!ot)throw Error(p$4(317));ot[Of]=o}else Ig(),!(o.flags&128)&&(o.memoizedState=null),o.flags|=4;S$1(o),ot=!1}else zg!==null&&(Fj(zg),zg=null),ot=!0;if(!ot)return o.flags&65536?o:null}return o.flags&128?(o.lanes=tt,o):(rt=rt!==null,rt!==(et!==null&&et.memoizedState!==null)&&rt&&(o.child.flags|=8192,o.mode&1&&(et===null||L$1.current&1?T$1===0&&(T$1=3):tj())),o.updateQueue!==null&&(o.flags|=4),S$1(o),null);case 4:return zh(),Aj(et,o),et===null&&sf(o.stateNode.containerInfo),S$1(o),null;case 10:return ah(o.type._context),S$1(o),null;case 17:return Zf(o.type)&&$f(),S$1(o),null;case 19:if(E$1(L$1),ot=o.memoizedState,ot===null)return S$1(o),null;if(rt=(o.flags&128)!==0,it=ot.rendering,it===null)if(rt)Dj(ot,!1);else{if(T$1!==0||et!==null&&et.flags&128)for(et=o.child;et!==null;){if(it=Ch(et),it!==null){for(o.flags|=128,Dj(ot,!1),rt=it.updateQueue,rt!==null&&(o.updateQueue=rt,o.flags|=4),o.subtreeFlags=0,rt=tt,tt=o.child;tt!==null;)ot=tt,et=rt,ot.flags&=14680066,it=ot.alternate,it===null?(ot.childLanes=0,ot.lanes=et,ot.child=null,ot.subtreeFlags=0,ot.memoizedProps=null,ot.memoizedState=null,ot.updateQueue=null,ot.dependencies=null,ot.stateNode=null):(ot.childLanes=it.childLanes,ot.lanes=it.lanes,ot.child=it.child,ot.subtreeFlags=0,ot.deletions=null,ot.memoizedProps=it.memoizedProps,ot.memoizedState=it.memoizedState,ot.updateQueue=it.updateQueue,ot.type=it.type,et=it.dependencies,ot.dependencies=et===null?null:{lanes:et.lanes,firstContext:et.firstContext}),tt=tt.sibling;return G$1(L$1,L$1.current&1|2),o.child}et=et.sibling}ot.tail!==null&&B$1()>Gj&&(o.flags|=128,rt=!0,Dj(ot,!1),o.lanes=4194304)}else{if(!rt)if(et=Ch(it),et!==null){if(o.flags|=128,rt=!0,tt=et.updateQueue,tt!==null&&(o.updateQueue=tt,o.flags|=4),Dj(ot,!0),ot.tail===null&&ot.tailMode==="hidden"&&!it.alternate&&!I$1)return S$1(o),null}else 2*B$1()-ot.renderingStartTime>Gj&&tt!==1073741824&&(o.flags|=128,rt=!0,Dj(ot,!1),o.lanes=4194304);ot.isBackwards?(it.sibling=o.child,o.child=it):(tt=ot.last,tt!==null?tt.sibling=it:o.child=it,ot.last=it)}return ot.tail!==null?(o=ot.tail,ot.rendering=o,ot.tail=o.sibling,ot.renderingStartTime=B$1(),o.sibling=null,tt=L$1.current,G$1(L$1,rt?tt&1|2:tt&1),o):(S$1(o),null);case 22:case 23:return Hj(),rt=o.memoizedState!==null,et!==null&&et.memoizedState!==null!==rt&&(o.flags|=8192),rt&&o.mode&1?fj&1073741824&&(S$1(o),o.subtreeFlags&6&&(o.flags|=8192)):S$1(o),null;case 24:return null;case 25:return null}throw Error(p$4(156,o.tag))}function Ij(et,o){switch(wg(o),o.tag){case 1:return Zf(o.type)&&$f(),et=o.flags,et&65536?(o.flags=et&-65537|128,o):null;case 3:return zh(),E$1(Wf),E$1(H$1),Eh(),et=o.flags,et&65536&&!(et&128)?(o.flags=et&-65537|128,o):null;case 5:return Bh(o),null;case 13:if(E$1(L$1),et=o.memoizedState,et!==null&&et.dehydrated!==null){if(o.alternate===null)throw Error(p$4(340));Ig()}return et=o.flags,et&65536?(o.flags=et&-65537|128,o):null;case 19:return E$1(L$1),null;case 4:return zh(),null;case 10:return ah(o.type._context),null;case 22:case 23:return Hj(),null;case 24:return null;default:return null}}var Jj=!1,U$1=!1,Kj=typeof WeakSet=="function"?WeakSet:Set,V$2=null;function Lj(et,o){var tt=et.ref;if(tt!==null)if(typeof tt=="function")try{tt(null)}catch(rt){W$1(et,o,rt)}else tt.current=null}function Mj(et,o,tt){try{tt()}catch(rt){W$1(et,o,rt)}}var Nj=!1;function Oj(et,o){if(Cf=dd,et=Me$1(),Ne$1(et)){if("selectionStart"in et)var tt={start:et.selectionStart,end:et.selectionEnd};else e:{tt=(tt=et.ownerDocument)&&tt.defaultView||window;var rt=tt.getSelection&&tt.getSelection();if(rt&&rt.rangeCount!==0){tt=rt.anchorNode;var nt=rt.anchorOffset,ot=rt.focusNode;rt=rt.focusOffset;try{tt.nodeType,ot.nodeType}catch{tt=null;break e}var it=0,st=-1,at=-1,ct=0,lt=0,dt=et,ht=null;t:for(;;){for(var mt;dt!==tt||nt!==0&&dt.nodeType!==3||(st=it+nt),dt!==ot||rt!==0&&dt.nodeType!==3||(at=it+rt),dt.nodeType===3&&(it+=dt.nodeValue.length),(mt=dt.firstChild)!==null;)ht=dt,dt=mt;for(;;){if(dt===et)break t;if(ht===tt&&++ct===nt&&(st=it),ht===ot&&++lt===rt&&(at=it),(mt=dt.nextSibling)!==null)break;dt=ht,ht=dt.parentNode}dt=mt}tt=st===-1||at===-1?null:{start:st,end:at}}else tt=null}tt=tt||{start:0,end:0}}else tt=null;for(Df={focusedElem:et,selectionRange:tt},dd=!1,V$2=o;V$2!==null;)if(o=V$2,et=o.child,(o.subtreeFlags&1028)!==0&&et!==null)et.return=o,V$2=et;else for(;V$2!==null;){o=V$2;try{var ft=o.alternate;if(o.flags&1024)switch(o.tag){case 0:case 11:case 15:break;case 1:if(ft!==null){var pt=ft.memoizedProps,yt=ft.memoizedState,gt=o.stateNode,bt=gt.getSnapshotBeforeUpdate(o.elementType===o.type?pt:Ci(o.type,pt),yt);gt.__reactInternalSnapshotBeforeUpdate=bt}break;case 3:var xt=o.stateNode.containerInfo;xt.nodeType===1?xt.textContent="":xt.nodeType===9&&xt.documentElement&&xt.removeChild(xt.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p$4(163))}}catch(vt){W$1(o,o.return,vt)}if(et=o.sibling,et!==null){et.return=o.return,V$2=et;break}V$2=o.return}return ft=Nj,Nj=!1,ft}function Pj(et,o,tt){var rt=o.updateQueue;if(rt=rt!==null?rt.lastEffect:null,rt!==null){var nt=rt=rt.next;do{if((nt.tag&et)===et){var ot=nt.destroy;nt.destroy=void 0,ot!==void 0&&Mj(o,tt,ot)}nt=nt.next}while(nt!==rt)}}function Qj(et,o){if(o=o.updateQueue,o=o!==null?o.lastEffect:null,o!==null){var tt=o=o.next;do{if((tt.tag&et)===et){var rt=tt.create;tt.destroy=rt()}tt=tt.next}while(tt!==o)}}function Rj(et){var o=et.ref;if(o!==null){var tt=et.stateNode;switch(et.tag){case 5:et=tt;break;default:et=tt}typeof o=="function"?o(et):o.current=et}}function Sj(et){var o=et.alternate;o!==null&&(et.alternate=null,Sj(o)),et.child=null,et.deletions=null,et.sibling=null,et.tag===5&&(o=et.stateNode,o!==null&&(delete o[Of],delete o[Pf],delete o[of],delete o[Qf],delete o[Rf])),et.stateNode=null,et.return=null,et.dependencies=null,et.memoizedProps=null,et.memoizedState=null,et.pendingProps=null,et.stateNode=null,et.updateQueue=null}function Tj(et){return et.tag===5||et.tag===3||et.tag===4}function Uj(et){e:for(;;){for(;et.sibling===null;){if(et.return===null||Tj(et.return))return null;et=et.return}for(et.sibling.return=et.return,et=et.sibling;et.tag!==5&&et.tag!==6&&et.tag!==18;){if(et.flags&2||et.child===null||et.tag===4)continue e;et.child.return=et,et=et.child}if(!(et.flags&2))return et.stateNode}}function Vj(et,o,tt){var rt=et.tag;if(rt===5||rt===6)et=et.stateNode,o?tt.nodeType===8?tt.parentNode.insertBefore(et,o):tt.insertBefore(et,o):(tt.nodeType===8?(o=tt.parentNode,o.insertBefore(et,tt)):(o=tt,o.appendChild(et)),tt=tt._reactRootContainer,tt!=null||o.onclick!==null||(o.onclick=Bf));else if(rt!==4&&(et=et.child,et!==null))for(Vj(et,o,tt),et=et.sibling;et!==null;)Vj(et,o,tt),et=et.sibling}function Wj(et,o,tt){var rt=et.tag;if(rt===5||rt===6)et=et.stateNode,o?tt.insertBefore(et,o):tt.appendChild(et);else if(rt!==4&&(et=et.child,et!==null))for(Wj(et,o,tt),et=et.sibling;et!==null;)Wj(et,o,tt),et=et.sibling}var X$1=null,Xj=!1;function Yj(et,o,tt){for(tt=tt.child;tt!==null;)Zj(et,o,tt),tt=tt.sibling}function Zj(et,o,tt){if(lc&&typeof lc.onCommitFiberUnmount=="function")try{lc.onCommitFiberUnmount(kc,tt)}catch{}switch(tt.tag){case 5:U$1||Lj(tt,o);case 6:var rt=X$1,nt=Xj;X$1=null,Yj(et,o,tt),X$1=rt,Xj=nt,X$1!==null&&(Xj?(et=X$1,tt=tt.stateNode,et.nodeType===8?et.parentNode.removeChild(tt):et.removeChild(tt)):X$1.removeChild(tt.stateNode));break;case 18:X$1!==null&&(Xj?(et=X$1,tt=tt.stateNode,et.nodeType===8?Kf(et.parentNode,tt):et.nodeType===1&&Kf(et,tt),bd(et)):Kf(X$1,tt.stateNode));break;case 4:rt=X$1,nt=Xj,X$1=tt.stateNode.containerInfo,Xj=!0,Yj(et,o,tt),X$1=rt,Xj=nt;break;case 0:case 11:case 14:case 15:if(!U$1&&(rt=tt.updateQueue,rt!==null&&(rt=rt.lastEffect,rt!==null))){nt=rt=rt.next;do{var ot=nt,it=ot.destroy;ot=ot.tag,it!==void 0&&(ot&2||ot&4)&&Mj(tt,o,it),nt=nt.next}while(nt!==rt)}Yj(et,o,tt);break;case 1:if(!U$1&&(Lj(tt,o),rt=tt.stateNode,typeof rt.componentWillUnmount=="function"))try{rt.props=tt.memoizedProps,rt.state=tt.memoizedState,rt.componentWillUnmount()}catch(st){W$1(tt,o,st)}Yj(et,o,tt);break;case 21:Yj(et,o,tt);break;case 22:tt.mode&1?(U$1=(rt=U$1)||tt.memoizedState!==null,Yj(et,o,tt),U$1=rt):Yj(et,o,tt);break;default:Yj(et,o,tt)}}function ak(et){var o=et.updateQueue;if(o!==null){et.updateQueue=null;var tt=et.stateNode;tt===null&&(tt=et.stateNode=new Kj),o.forEach(function(rt){var nt=bk.bind(null,et,rt);tt.has(rt)||(tt.add(rt),rt.then(nt,nt))})}}function ck(et,o){var tt=o.deletions;if(tt!==null)for(var rt=0;rt<tt.length;rt++){var nt=tt[rt];try{var ot=et,it=o,st=it;e:for(;st!==null;){switch(st.tag){case 5:X$1=st.stateNode,Xj=!1;break e;case 3:X$1=st.stateNode.containerInfo,Xj=!0;break e;case 4:X$1=st.stateNode.containerInfo,Xj=!0;break e}st=st.return}if(X$1===null)throw Error(p$4(160));Zj(ot,it,nt),X$1=null,Xj=!1;var at=nt.alternate;at!==null&&(at.return=null),nt.return=null}catch(ct){W$1(nt,o,ct)}}if(o.subtreeFlags&12854)for(o=o.child;o!==null;)dk(o,et),o=o.sibling}function dk(et,o){var tt=et.alternate,rt=et.flags;switch(et.tag){case 0:case 11:case 14:case 15:if(ck(o,et),ek(et),rt&4){try{Pj(3,et,et.return),Qj(3,et)}catch(pt){W$1(et,et.return,pt)}try{Pj(5,et,et.return)}catch(pt){W$1(et,et.return,pt)}}break;case 1:ck(o,et),ek(et),rt&512&&tt!==null&&Lj(tt,tt.return);break;case 5:if(ck(o,et),ek(et),rt&512&&tt!==null&&Lj(tt,tt.return),et.flags&32){var nt=et.stateNode;try{ob(nt,"")}catch(pt){W$1(et,et.return,pt)}}if(rt&4&&(nt=et.stateNode,nt!=null)){var ot=et.memoizedProps,it=tt!==null?tt.memoizedProps:ot,st=et.type,at=et.updateQueue;if(et.updateQueue=null,at!==null)try{st==="input"&&ot.type==="radio"&&ot.name!=null&&ab(nt,ot),vb(st,it);var ct=vb(st,ot);for(it=0;it<at.length;it+=2){var lt=at[it],dt=at[it+1];lt==="style"?sb(nt,dt):lt==="dangerouslySetInnerHTML"?nb(nt,dt):lt==="children"?ob(nt,dt):ta(nt,lt,dt,ct)}switch(st){case"input":bb(nt,ot);break;case"textarea":ib(nt,ot);break;case"select":var ht=nt._wrapperState.wasMultiple;nt._wrapperState.wasMultiple=!!ot.multiple;var mt=ot.value;mt!=null?fb(nt,!!ot.multiple,mt,!1):ht!==!!ot.multiple&&(ot.defaultValue!=null?fb(nt,!!ot.multiple,ot.defaultValue,!0):fb(nt,!!ot.multiple,ot.multiple?[]:"",!1))}nt[Pf]=ot}catch(pt){W$1(et,et.return,pt)}}break;case 6:if(ck(o,et),ek(et),rt&4){if(et.stateNode===null)throw Error(p$4(162));nt=et.stateNode,ot=et.memoizedProps;try{nt.nodeValue=ot}catch(pt){W$1(et,et.return,pt)}}break;case 3:if(ck(o,et),ek(et),rt&4&&tt!==null&&tt.memoizedState.isDehydrated)try{bd(o.containerInfo)}catch(pt){W$1(et,et.return,pt)}break;case 4:ck(o,et),ek(et);break;case 13:ck(o,et),ek(et),nt=et.child,nt.flags&8192&&(ot=nt.memoizedState!==null,nt.stateNode.isHidden=ot,!ot||nt.alternate!==null&&nt.alternate.memoizedState!==null||(fk=B$1())),rt&4&&ak(et);break;case 22:if(lt=tt!==null&&tt.memoizedState!==null,et.mode&1?(U$1=(ct=U$1)||lt,ck(o,et),U$1=ct):ck(o,et),ek(et),rt&8192){if(ct=et.memoizedState!==null,(et.stateNode.isHidden=ct)&&!lt&&et.mode&1)for(V$2=et,lt=et.child;lt!==null;){for(dt=V$2=lt;V$2!==null;){switch(ht=V$2,mt=ht.child,ht.tag){case 0:case 11:case 14:case 15:Pj(4,ht,ht.return);break;case 1:Lj(ht,ht.return);var ft=ht.stateNode;if(typeof ft.componentWillUnmount=="function"){rt=ht,tt=ht.return;try{o=rt,ft.props=o.memoizedProps,ft.state=o.memoizedState,ft.componentWillUnmount()}catch(pt){W$1(rt,tt,pt)}}break;case 5:Lj(ht,ht.return);break;case 22:if(ht.memoizedState!==null){gk(dt);continue}}mt!==null?(mt.return=ht,V$2=mt):gk(dt)}lt=lt.sibling}e:for(lt=null,dt=et;;){if(dt.tag===5){if(lt===null){lt=dt;try{nt=dt.stateNode,ct?(ot=nt.style,typeof ot.setProperty=="function"?ot.setProperty("display","none","important"):ot.display="none"):(st=dt.stateNode,at=dt.memoizedProps.style,it=at!=null&&at.hasOwnProperty("display")?at.display:null,st.style.display=rb("display",it))}catch(pt){W$1(et,et.return,pt)}}}else if(dt.tag===6){if(lt===null)try{dt.stateNode.nodeValue=ct?"":dt.memoizedProps}catch(pt){W$1(et,et.return,pt)}}else if((dt.tag!==22&&dt.tag!==23||dt.memoizedState===null||dt===et)&&dt.child!==null){dt.child.return=dt,dt=dt.child;continue}if(dt===et)break e;for(;dt.sibling===null;){if(dt.return===null||dt.return===et)break e;lt===dt&&(lt=null),dt=dt.return}lt===dt&&(lt=null),dt.sibling.return=dt.return,dt=dt.sibling}}break;case 19:ck(o,et),ek(et),rt&4&&ak(et);break;case 21:break;default:ck(o,et),ek(et)}}function ek(et){var o=et.flags;if(o&2){try{e:{for(var tt=et.return;tt!==null;){if(Tj(tt)){var rt=tt;break e}tt=tt.return}throw Error(p$4(160))}switch(rt.tag){case 5:var nt=rt.stateNode;rt.flags&32&&(ob(nt,""),rt.flags&=-33);var ot=Uj(et);Wj(et,ot,nt);break;case 3:case 4:var it=rt.stateNode.containerInfo,st=Uj(et);Vj(et,st,it);break;default:throw Error(p$4(161))}}catch(at){W$1(et,et.return,at)}et.flags&=-3}o&4096&&(et.flags&=-4097)}function hk(et,o,tt){V$2=et,ik(et)}function ik(et,o,tt){for(var rt=(et.mode&1)!==0;V$2!==null;){var nt=V$2,ot=nt.child;if(nt.tag===22&&rt){var it=nt.memoizedState!==null||Jj;if(!it){var st=nt.alternate,at=st!==null&&st.memoizedState!==null||U$1;st=Jj;var ct=U$1;if(Jj=it,(U$1=at)&&!ct)for(V$2=nt;V$2!==null;)it=V$2,at=it.child,it.tag===22&&it.memoizedState!==null?jk(nt):at!==null?(at.return=it,V$2=at):jk(nt);for(;ot!==null;)V$2=ot,ik(ot),ot=ot.sibling;V$2=nt,Jj=st,U$1=ct}kk(et)}else nt.subtreeFlags&8772&&ot!==null?(ot.return=nt,V$2=ot):kk(et)}}function kk(et){for(;V$2!==null;){var o=V$2;if(o.flags&8772){var tt=o.alternate;try{if(o.flags&8772)switch(o.tag){case 0:case 11:case 15:U$1||Qj(5,o);break;case 1:var rt=o.stateNode;if(o.flags&4&&!U$1)if(tt===null)rt.componentDidMount();else{var nt=o.elementType===o.type?tt.memoizedProps:Ci(o.type,tt.memoizedProps);rt.componentDidUpdate(nt,tt.memoizedState,rt.__reactInternalSnapshotBeforeUpdate)}var ot=o.updateQueue;ot!==null&&sh(o,ot,rt);break;case 3:var it=o.updateQueue;if(it!==null){if(tt=null,o.child!==null)switch(o.child.tag){case 5:tt=o.child.stateNode;break;case 1:tt=o.child.stateNode}sh(o,it,tt)}break;case 5:var st=o.stateNode;if(tt===null&&o.flags&4){tt=st;var at=o.memoizedProps;switch(o.type){case"button":case"input":case"select":case"textarea":at.autoFocus&&tt.focus();break;case"img":at.src&&(tt.src=at.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(o.memoizedState===null){var ct=o.alternate;if(ct!==null){var lt=ct.memoizedState;if(lt!==null){var dt=lt.dehydrated;dt!==null&&bd(dt)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(p$4(163))}U$1||o.flags&512&&Rj(o)}catch(ht){W$1(o,o.return,ht)}}if(o===et){V$2=null;break}if(tt=o.sibling,tt!==null){tt.return=o.return,V$2=tt;break}V$2=o.return}}function gk(et){for(;V$2!==null;){var o=V$2;if(o===et){V$2=null;break}var tt=o.sibling;if(tt!==null){tt.return=o.return,V$2=tt;break}V$2=o.return}}function jk(et){for(;V$2!==null;){var o=V$2;try{switch(o.tag){case 0:case 11:case 15:var tt=o.return;try{Qj(4,o)}catch(at){W$1(o,tt,at)}break;case 1:var rt=o.stateNode;if(typeof rt.componentDidMount=="function"){var nt=o.return;try{rt.componentDidMount()}catch(at){W$1(o,nt,at)}}var ot=o.return;try{Rj(o)}catch(at){W$1(o,ot,at)}break;case 5:var it=o.return;try{Rj(o)}catch(at){W$1(o,it,at)}}}catch(at){W$1(o,o.return,at)}if(o===et){V$2=null;break}var st=o.sibling;if(st!==null){st.return=o.return,V$2=st;break}V$2=o.return}}var lk=Math.ceil,mk=ua.ReactCurrentDispatcher,nk=ua.ReactCurrentOwner,ok$2=ua.ReactCurrentBatchConfig,K$1=0,Q$1=null,Y$1=null,Z$1=0,fj=0,ej=Uf(0),T$1=0,pk=null,rh=0,qk=0,rk=0,sk=null,tk=null,fk=0,Gj=1/0,uk=null,Oi=!1,Pi=null,Ri=null,vk=!1,wk=null,xk=0,yk=0,zk=null,Ak=-1,Bk=0;function R(){return K$1&6?B$1():Ak!==-1?Ak:Ak=B$1()}function yi(et){return et.mode&1?K$1&2&&Z$1!==0?Z$1&-Z$1:Kg.transition!==null?(Bk===0&&(Bk=yc()),Bk):(et=C$1,et!==0||(et=window.event,et=et===void 0?16:jd(et.type)),et):1}function gi(et,o,tt,rt){if(50<yk)throw yk=0,zk=null,Error(p$4(185));Ac(et,tt,rt),(!(K$1&2)||et!==Q$1)&&(et===Q$1&&(!(K$1&2)&&(qk|=tt),T$1===4&&Ck(et,Z$1)),Dk(et,rt),tt===1&&K$1===0&&!(o.mode&1)&&(Gj=B$1()+500,fg&&jg()))}function Dk(et,o){var tt=et.callbackNode;wc(et,o);var rt=uc(et,et===Q$1?Z$1:0);if(rt===0)tt!==null&&bc(tt),et.callbackNode=null,et.callbackPriority=0;else if(o=rt&-rt,et.callbackPriority!==o){if(tt!=null&&bc(tt),o===1)et.tag===0?ig(Ek.bind(null,et)):hg(Ek.bind(null,et)),Jf(function(){!(K$1&6)&&jg()}),tt=null;else{switch(Dc(rt)){case 1:tt=fc;break;case 4:tt=gc;break;case 16:tt=hc;break;case 536870912:tt=jc;break;default:tt=hc}tt=Fk(tt,Gk.bind(null,et))}et.callbackPriority=o,et.callbackNode=tt}}function Gk(et,o){if(Ak=-1,Bk=0,K$1&6)throw Error(p$4(327));var tt=et.callbackNode;if(Hk()&&et.callbackNode!==tt)return null;var rt=uc(et,et===Q$1?Z$1:0);if(rt===0)return null;if(rt&30||rt&et.expiredLanes||o)o=Ik(et,rt);else{o=rt;var nt=K$1;K$1|=2;var ot=Jk();(Q$1!==et||Z$1!==o)&&(uk=null,Gj=B$1()+500,Kk(et,o));do try{Lk();break}catch(st){Mk(et,st)}while(!0);$g(),mk.current=ot,K$1=nt,Y$1!==null?o=0:(Q$1=null,Z$1=0,o=T$1)}if(o!==0){if(o===2&&(nt=xc(et),nt!==0&&(rt=nt,o=Nk(et,nt))),o===1)throw tt=pk,Kk(et,0),Ck(et,rt),Dk(et,B$1()),tt;if(o===6)Ck(et,rt);else{if(nt=et.current.alternate,!(rt&30)&&!Ok(nt)&&(o=Ik(et,rt),o===2&&(ot=xc(et),ot!==0&&(rt=ot,o=Nk(et,ot))),o===1))throw tt=pk,Kk(et,0),Ck(et,rt),Dk(et,B$1()),tt;switch(et.finishedWork=nt,et.finishedLanes=rt,o){case 0:case 1:throw Error(p$4(345));case 2:Pk(et,tk,uk);break;case 3:if(Ck(et,rt),(rt&130023424)===rt&&(o=fk+500-B$1(),10<o)){if(uc(et,0)!==0)break;if(nt=et.suspendedLanes,(nt&rt)!==rt){R(),et.pingedLanes|=et.suspendedLanes&nt;break}et.timeoutHandle=Ff(Pk.bind(null,et,tk,uk),o);break}Pk(et,tk,uk);break;case 4:if(Ck(et,rt),(rt&4194240)===rt)break;for(o=et.eventTimes,nt=-1;0<rt;){var it=31-oc(rt);ot=1<<it,it=o[it],it>nt&&(nt=it),rt&=~ot}if(rt=nt,rt=B$1()-rt,rt=(120>rt?120:480>rt?480:1080>rt?1080:1920>rt?1920:3e3>rt?3e3:4320>rt?4320:1960*lk(rt/1960))-rt,10<rt){et.timeoutHandle=Ff(Pk.bind(null,et,tk,uk),rt);break}Pk(et,tk,uk);break;case 5:Pk(et,tk,uk);break;default:throw Error(p$4(329))}}}return Dk(et,B$1()),et.callbackNode===tt?Gk.bind(null,et):null}function Nk(et,o){var tt=sk;return et.current.memoizedState.isDehydrated&&(Kk(et,o).flags|=256),et=Ik(et,o),et!==2&&(o=tk,tk=tt,o!==null&&Fj(o)),et}function Fj(et){tk===null?tk=et:tk.push.apply(tk,et)}function Ok(et){for(var o=et;;){if(o.flags&16384){var tt=o.updateQueue;if(tt!==null&&(tt=tt.stores,tt!==null))for(var rt=0;rt<tt.length;rt++){var nt=tt[rt],ot=nt.getSnapshot;nt=nt.value;try{if(!He(ot(),nt))return!1}catch{return!1}}}if(tt=o.child,o.subtreeFlags&16384&&tt!==null)tt.return=o,o=tt;else{if(o===et)break;for(;o.sibling===null;){if(o.return===null||o.return===et)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Ck(et,o){for(o&=~rk,o&=~qk,et.suspendedLanes|=o,et.pingedLanes&=~o,et=et.expirationTimes;0<o;){var tt=31-oc(o),rt=1<<tt;et[tt]=-1,o&=~rt}}function Ek(et){if(K$1&6)throw Error(p$4(327));Hk();var o=uc(et,0);if(!(o&1))return Dk(et,B$1()),null;var tt=Ik(et,o);if(et.tag!==0&&tt===2){var rt=xc(et);rt!==0&&(o=rt,tt=Nk(et,rt))}if(tt===1)throw tt=pk,Kk(et,0),Ck(et,o),Dk(et,B$1()),tt;if(tt===6)throw Error(p$4(345));return et.finishedWork=et.current.alternate,et.finishedLanes=o,Pk(et,tk,uk),Dk(et,B$1()),null}function Qk(et,o){var tt=K$1;K$1|=1;try{return et(o)}finally{K$1=tt,K$1===0&&(Gj=B$1()+500,fg&&jg())}}function Rk(et){wk!==null&&wk.tag===0&&!(K$1&6)&&Hk();var o=K$1;K$1|=1;var tt=ok$2.transition,rt=C$1;try{if(ok$2.transition=null,C$1=1,et)return et()}finally{C$1=rt,ok$2.transition=tt,K$1=o,!(K$1&6)&&jg()}}function Hj(){fj=ej.current,E$1(ej)}function Kk(et,o){et.finishedWork=null,et.finishedLanes=0;var tt=et.timeoutHandle;if(tt!==-1&&(et.timeoutHandle=-1,Gf(tt)),Y$1!==null)for(tt=Y$1.return;tt!==null;){var rt=tt;switch(wg(rt),rt.tag){case 1:rt=rt.type.childContextTypes,rt!=null&&$f();break;case 3:zh(),E$1(Wf),E$1(H$1),Eh();break;case 5:Bh(rt);break;case 4:zh();break;case 13:E$1(L$1);break;case 19:E$1(L$1);break;case 10:ah(rt.type._context);break;case 22:case 23:Hj()}tt=tt.return}if(Q$1=et,Y$1=et=Pg(et.current,null),Z$1=fj=o,T$1=0,pk=null,rk=qk=rh=0,tk=sk=null,fh!==null){for(o=0;o<fh.length;o++)if(tt=fh[o],rt=tt.interleaved,rt!==null){tt.interleaved=null;var nt=rt.next,ot=tt.pending;if(ot!==null){var it=ot.next;ot.next=nt,rt.next=it}tt.pending=rt}fh=null}return et}function Mk(et,o){do{var tt=Y$1;try{if($g(),Fh.current=Rh,Ih){for(var rt=M$1.memoizedState;rt!==null;){var nt=rt.queue;nt!==null&&(nt.pending=null),rt=rt.next}Ih=!1}if(Hh=0,O=N$1=M$1=null,Jh=!1,Kh=0,nk.current=null,tt===null||tt.return===null){T$1=1,pk=o,Y$1=null;break}e:{var ot=et,it=tt.return,st=tt,at=o;if(o=Z$1,st.flags|=32768,at!==null&&typeof at=="object"&&typeof at.then=="function"){var ct=at,lt=st,dt=lt.tag;if(!(lt.mode&1)&&(dt===0||dt===11||dt===15)){var ht=lt.alternate;ht?(lt.updateQueue=ht.updateQueue,lt.memoizedState=ht.memoizedState,lt.lanes=ht.lanes):(lt.updateQueue=null,lt.memoizedState=null)}var mt=Ui(it);if(mt!==null){mt.flags&=-257,Vi(mt,it,st,ot,o),mt.mode&1&&Si(ot,ct,o),o=mt,at=ct;var ft=o.updateQueue;if(ft===null){var pt=new Set;pt.add(at),o.updateQueue=pt}else ft.add(at);break e}else{if(!(o&1)){Si(ot,ct,o),tj();break e}at=Error(p$4(426))}}else if(I$1&&st.mode&1){var yt=Ui(it);if(yt!==null){!(yt.flags&65536)&&(yt.flags|=256),Vi(yt,it,st,ot,o),Jg(Ji(at,st));break e}}ot=at=Ji(at,st),T$1!==4&&(T$1=2),sk===null?sk=[ot]:sk.push(ot),ot=it;do{switch(ot.tag){case 3:ot.flags|=65536,o&=-o,ot.lanes|=o;var gt=Ni(ot,at,o);ph(ot,gt);break e;case 1:st=at;var bt=ot.type,xt=ot.stateNode;if(!(ot.flags&128)&&(typeof bt.getDerivedStateFromError=="function"||xt!==null&&typeof xt.componentDidCatch=="function"&&(Ri===null||!Ri.has(xt)))){ot.flags|=65536,o&=-o,ot.lanes|=o;var vt=Qi(ot,st,o);ph(ot,vt);break e}}ot=ot.return}while(ot!==null)}Sk(tt)}catch(Et){o=Et,Y$1===tt&&tt!==null&&(Y$1=tt=tt.return);continue}break}while(!0)}function Jk(){var et=mk.current;return mk.current=Rh,et===null?Rh:et}function tj(){(T$1===0||T$1===3||T$1===2)&&(T$1=4),Q$1===null||!(rh&268435455)&&!(qk&268435455)||Ck(Q$1,Z$1)}function Ik(et,o){var tt=K$1;K$1|=2;var rt=Jk();(Q$1!==et||Z$1!==o)&&(uk=null,Kk(et,o));do try{Tk();break}catch(nt){Mk(et,nt)}while(!0);if($g(),K$1=tt,mk.current=rt,Y$1!==null)throw Error(p$4(261));return Q$1=null,Z$1=0,T$1}function Tk(){for(;Y$1!==null;)Uk(Y$1)}function Lk(){for(;Y$1!==null&&!cc$1();)Uk(Y$1)}function Uk(et){var o=Vk(et.alternate,et,fj);et.memoizedProps=et.pendingProps,o===null?Sk(et):Y$1=o,nk.current=null}function Sk(et){var o=et;do{var tt=o.alternate;if(et=o.return,o.flags&32768){if(tt=Ij(tt,o),tt!==null){tt.flags&=32767,Y$1=tt;return}if(et!==null)et.flags|=32768,et.subtreeFlags=0,et.deletions=null;else{T$1=6,Y$1=null;return}}else if(tt=Ej(tt,o,fj),tt!==null){Y$1=tt;return}if(o=o.sibling,o!==null){Y$1=o;return}Y$1=o=et}while(o!==null);T$1===0&&(T$1=5)}function Pk(et,o,tt){var rt=C$1,nt=ok$2.transition;try{ok$2.transition=null,C$1=1,Wk(et,o,tt,rt)}finally{ok$2.transition=nt,C$1=rt}return null}function Wk(et,o,tt,rt){do Hk();while(wk!==null);if(K$1&6)throw Error(p$4(327));tt=et.finishedWork;var nt=et.finishedLanes;if(tt===null)return null;if(et.finishedWork=null,et.finishedLanes=0,tt===et.current)throw Error(p$4(177));et.callbackNode=null,et.callbackPriority=0;var ot=tt.lanes|tt.childLanes;if(Bc(et,ot),et===Q$1&&(Y$1=Q$1=null,Z$1=0),!(tt.subtreeFlags&2064)&&!(tt.flags&2064)||vk||(vk=!0,Fk(hc,function(){return Hk(),null})),ot=(tt.flags&15990)!==0,tt.subtreeFlags&15990||ot){ot=ok$2.transition,ok$2.transition=null;var it=C$1;C$1=1;var st=K$1;K$1|=4,nk.current=null,Oj(et,tt),dk(tt,et),Oe$1(Df),dd=!!Cf,Df=Cf=null,et.current=tt,hk(tt),dc(),K$1=st,C$1=it,ok$2.transition=ot}else et.current=tt;if(vk&&(vk=!1,wk=et,xk=nt),ot=et.pendingLanes,ot===0&&(Ri=null),mc(tt.stateNode),Dk(et,B$1()),o!==null)for(rt=et.onRecoverableError,tt=0;tt<o.length;tt++)nt=o[tt],rt(nt.value,{componentStack:nt.stack,digest:nt.digest});if(Oi)throw Oi=!1,et=Pi,Pi=null,et;return xk&1&&et.tag!==0&&Hk(),ot=et.pendingLanes,ot&1?et===zk?yk++:(yk=0,zk=et):yk=0,jg(),null}function Hk(){if(wk!==null){var et=Dc(xk),o=ok$2.transition,tt=C$1;try{if(ok$2.transition=null,C$1=16>et?16:et,wk===null)var rt=!1;else{if(et=wk,wk=null,xk=0,K$1&6)throw Error(p$4(331));var nt=K$1;for(K$1|=4,V$2=et.current;V$2!==null;){var ot=V$2,it=ot.child;if(V$2.flags&16){var st=ot.deletions;if(st!==null){for(var at=0;at<st.length;at++){var ct=st[at];for(V$2=ct;V$2!==null;){var lt=V$2;switch(lt.tag){case 0:case 11:case 15:Pj(8,lt,ot)}var dt=lt.child;if(dt!==null)dt.return=lt,V$2=dt;else for(;V$2!==null;){lt=V$2;var ht=lt.sibling,mt=lt.return;if(Sj(lt),lt===ct){V$2=null;break}if(ht!==null){ht.return=mt,V$2=ht;break}V$2=mt}}}var ft=ot.alternate;if(ft!==null){var pt=ft.child;if(pt!==null){ft.child=null;do{var yt=pt.sibling;pt.sibling=null,pt=yt}while(pt!==null)}}V$2=ot}}if(ot.subtreeFlags&2064&&it!==null)it.return=ot,V$2=it;else e:for(;V$2!==null;){if(ot=V$2,ot.flags&2048)switch(ot.tag){case 0:case 11:case 15:Pj(9,ot,ot.return)}var gt=ot.sibling;if(gt!==null){gt.return=ot.return,V$2=gt;break e}V$2=ot.return}}var bt=et.current;for(V$2=bt;V$2!==null;){it=V$2;var xt=it.child;if(it.subtreeFlags&2064&&xt!==null)xt.return=it,V$2=xt;else e:for(it=bt;V$2!==null;){if(st=V$2,st.flags&2048)try{switch(st.tag){case 0:case 11:case 15:Qj(9,st)}}catch(Et){W$1(st,st.return,Et)}if(st===it){V$2=null;break e}var vt=st.sibling;if(vt!==null){vt.return=st.return,V$2=vt;break e}V$2=st.return}}if(K$1=nt,jg(),lc&&typeof lc.onPostCommitFiberRoot=="function")try{lc.onPostCommitFiberRoot(kc,et)}catch{}rt=!0}return rt}finally{C$1=tt,ok$2.transition=o}}return!1}function Xk(et,o,tt){o=Ji(tt,o),o=Ni(et,o,1),et=nh(et,o,1),o=R(),et!==null&&(Ac(et,1,o),Dk(et,o))}function W$1(et,o,tt){if(et.tag===3)Xk(et,et,tt);else for(;o!==null;){if(o.tag===3){Xk(o,et,tt);break}else if(o.tag===1){var rt=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof rt.componentDidCatch=="function"&&(Ri===null||!Ri.has(rt))){et=Ji(tt,et),et=Qi(o,et,1),o=nh(o,et,1),et=R(),o!==null&&(Ac(o,1,et),Dk(o,et));break}}o=o.return}}function Ti(et,o,tt){var rt=et.pingCache;rt!==null&&rt.delete(o),o=R(),et.pingedLanes|=et.suspendedLanes&tt,Q$1===et&&(Z$1&tt)===tt&&(T$1===4||T$1===3&&(Z$1&130023424)===Z$1&&500>B$1()-fk?Kk(et,0):rk|=tt),Dk(et,o)}function Yk(et,o){o===0&&(et.mode&1?(o=sc,sc<<=1,!(sc&130023424)&&(sc=4194304)):o=1);var tt=R();et=ih(et,o),et!==null&&(Ac(et,o,tt),Dk(et,tt))}function uj(et){var o=et.memoizedState,tt=0;o!==null&&(tt=o.retryLane),Yk(et,tt)}function bk(et,o){var tt=0;switch(et.tag){case 13:var rt=et.stateNode,nt=et.memoizedState;nt!==null&&(tt=nt.retryLane);break;case 19:rt=et.stateNode;break;default:throw Error(p$4(314))}rt!==null&&rt.delete(o),Yk(et,tt)}var Vk;Vk=function(et,o,tt){if(et!==null)if(et.memoizedProps!==o.pendingProps||Wf.current)dh=!0;else{if(!(et.lanes&tt)&&!(o.flags&128))return dh=!1,yj(et,o,tt);dh=!!(et.flags&131072)}else dh=!1,I$1&&o.flags&1048576&&ug(o,ng,o.index);switch(o.lanes=0,o.tag){case 2:var rt=o.type;ij(et,o),et=o.pendingProps;var nt=Yf(o,H$1.current);ch(o,tt),nt=Nh(null,o,rt,et,nt,tt);var ot=Sh();return o.flags|=1,typeof nt=="object"&&nt!==null&&typeof nt.render=="function"&&nt.$$typeof===void 0?(o.tag=1,o.memoizedState=null,o.updateQueue=null,Zf(rt)?(ot=!0,cg(o)):ot=!1,o.memoizedState=nt.state!==null&&nt.state!==void 0?nt.state:null,kh(o),nt.updater=Ei,o.stateNode=nt,nt._reactInternals=o,Ii(o,rt,et,tt),o=jj(null,o,rt,!0,ot,tt)):(o.tag=0,I$1&&ot&&vg(o),Xi(null,o,nt,tt),o=o.child),o;case 16:rt=o.elementType;e:{switch(ij(et,o),et=o.pendingProps,nt=rt._init,rt=nt(rt._payload),o.type=rt,nt=o.tag=Zk(rt),et=Ci(rt,et),nt){case 0:o=cj(null,o,rt,et,tt);break e;case 1:o=hj(null,o,rt,et,tt);break e;case 11:o=Yi(null,o,rt,et,tt);break e;case 14:o=$i(null,o,rt,Ci(rt.type,et),tt);break e}throw Error(p$4(306,rt,""))}return o;case 0:return rt=o.type,nt=o.pendingProps,nt=o.elementType===rt?nt:Ci(rt,nt),cj(et,o,rt,nt,tt);case 1:return rt=o.type,nt=o.pendingProps,nt=o.elementType===rt?nt:Ci(rt,nt),hj(et,o,rt,nt,tt);case 3:e:{if(kj(o),et===null)throw Error(p$4(387));rt=o.pendingProps,ot=o.memoizedState,nt=ot.element,lh(et,o),qh(o,rt,null,tt);var it=o.memoizedState;if(rt=it.element,ot.isDehydrated)if(ot={element:rt,isDehydrated:!1,cache:it.cache,pendingSuspenseBoundaries:it.pendingSuspenseBoundaries,transitions:it.transitions},o.updateQueue.baseState=ot,o.memoizedState=ot,o.flags&256){nt=Ji(Error(p$4(423)),o),o=lj(et,o,rt,tt,nt);break e}else if(rt!==nt){nt=Ji(Error(p$4(424)),o),o=lj(et,o,rt,tt,nt);break e}else for(yg=Lf(o.stateNode.containerInfo.firstChild),xg=o,I$1=!0,zg=null,tt=Vg(o,null,rt,tt),o.child=tt;tt;)tt.flags=tt.flags&-3|4096,tt=tt.sibling;else{if(Ig(),rt===nt){o=Zi(et,o,tt);break e}Xi(et,o,rt,tt)}o=o.child}return o;case 5:return Ah(o),et===null&&Eg(o),rt=o.type,nt=o.pendingProps,ot=et!==null?et.memoizedProps:null,it=nt.children,Ef(rt,nt)?it=null:ot!==null&&Ef(rt,ot)&&(o.flags|=32),gj(et,o),Xi(et,o,it,tt),o.child;case 6:return et===null&&Eg(o),null;case 13:return oj(et,o,tt);case 4:return yh(o,o.stateNode.containerInfo),rt=o.pendingProps,et===null?o.child=Ug(o,null,rt,tt):Xi(et,o,rt,tt),o.child;case 11:return rt=o.type,nt=o.pendingProps,nt=o.elementType===rt?nt:Ci(rt,nt),Yi(et,o,rt,nt,tt);case 7:return Xi(et,o,o.pendingProps,tt),o.child;case 8:return Xi(et,o,o.pendingProps.children,tt),o.child;case 12:return Xi(et,o,o.pendingProps.children,tt),o.child;case 10:e:{if(rt=o.type._context,nt=o.pendingProps,ot=o.memoizedProps,it=nt.value,G$1(Wg,rt._currentValue),rt._currentValue=it,ot!==null)if(He(ot.value,it)){if(ot.children===nt.children&&!Wf.current){o=Zi(et,o,tt);break e}}else for(ot=o.child,ot!==null&&(ot.return=o);ot!==null;){var st=ot.dependencies;if(st!==null){it=ot.child;for(var at=st.firstContext;at!==null;){if(at.context===rt){if(ot.tag===1){at=mh(-1,tt&-tt),at.tag=2;var ct=ot.updateQueue;if(ct!==null){ct=ct.shared;var lt=ct.pending;lt===null?at.next=at:(at.next=lt.next,lt.next=at),ct.pending=at}}ot.lanes|=tt,at=ot.alternate,at!==null&&(at.lanes|=tt),bh(ot.return,tt,o),st.lanes|=tt;break}at=at.next}}else if(ot.tag===10)it=ot.type===o.type?null:ot.child;else if(ot.tag===18){if(it=ot.return,it===null)throw Error(p$4(341));it.lanes|=tt,st=it.alternate,st!==null&&(st.lanes|=tt),bh(it,tt,o),it=ot.sibling}else it=ot.child;if(it!==null)it.return=ot;else for(it=ot;it!==null;){if(it===o){it=null;break}if(ot=it.sibling,ot!==null){ot.return=it.return,it=ot;break}it=it.return}ot=it}Xi(et,o,nt.children,tt),o=o.child}return o;case 9:return nt=o.type,rt=o.pendingProps.children,ch(o,tt),nt=eh(nt),rt=rt(nt),o.flags|=1,Xi(et,o,rt,tt),o.child;case 14:return rt=o.type,nt=Ci(rt,o.pendingProps),nt=Ci(rt.type,nt),$i(et,o,rt,nt,tt);case 15:return bj(et,o,o.type,o.pendingProps,tt);case 17:return rt=o.type,nt=o.pendingProps,nt=o.elementType===rt?nt:Ci(rt,nt),ij(et,o),o.tag=1,Zf(rt)?(et=!0,cg(o)):et=!1,ch(o,tt),Gi(o,rt,nt),Ii(o,rt,nt,tt),jj(null,o,rt,!0,et,tt);case 19:return xj(et,o,tt);case 22:return dj(et,o,tt)}throw Error(p$4(156,o.tag))};function Fk(et,o){return ac(et,o)}function $k(et,o,tt,rt){this.tag=et,this.key=tt,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=rt,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bg(et,o,tt,rt){return new $k(et,o,tt,rt)}function aj(et){return et=et.prototype,!(!et||!et.isReactComponent)}function Zk(et){if(typeof et=="function")return aj(et)?1:0;if(et!=null){if(et=et.$$typeof,et===Da)return 11;if(et===Ga)return 14}return 2}function Pg(et,o){var tt=et.alternate;return tt===null?(tt=Bg(et.tag,o,et.key,et.mode),tt.elementType=et.elementType,tt.type=et.type,tt.stateNode=et.stateNode,tt.alternate=et,et.alternate=tt):(tt.pendingProps=o,tt.type=et.type,tt.flags=0,tt.subtreeFlags=0,tt.deletions=null),tt.flags=et.flags&14680064,tt.childLanes=et.childLanes,tt.lanes=et.lanes,tt.child=et.child,tt.memoizedProps=et.memoizedProps,tt.memoizedState=et.memoizedState,tt.updateQueue=et.updateQueue,o=et.dependencies,tt.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},tt.sibling=et.sibling,tt.index=et.index,tt.ref=et.ref,tt}function Rg(et,o,tt,rt,nt,ot){var it=2;if(rt=et,typeof et=="function")aj(et)&&(it=1);else if(typeof et=="string")it=5;else e:switch(et){case ya:return Tg(tt.children,nt,ot,o);case za:it=8,nt|=8;break;case Aa:return et=Bg(12,tt,o,nt|2),et.elementType=Aa,et.lanes=ot,et;case Ea:return et=Bg(13,tt,o,nt),et.elementType=Ea,et.lanes=ot,et;case Fa:return et=Bg(19,tt,o,nt),et.elementType=Fa,et.lanes=ot,et;case Ia:return pj(tt,nt,ot,o);default:if(typeof et=="object"&&et!==null)switch(et.$$typeof){case Ba:it=10;break e;case Ca:it=9;break e;case Da:it=11;break e;case Ga:it=14;break e;case Ha:it=16,rt=null;break e}throw Error(p$4(130,et==null?et:typeof et,""))}return o=Bg(it,tt,o,nt),o.elementType=et,o.type=rt,o.lanes=ot,o}function Tg(et,o,tt,rt){return et=Bg(7,et,rt,o),et.lanes=tt,et}function pj(et,o,tt,rt){return et=Bg(22,et,rt,o),et.elementType=Ia,et.lanes=tt,et.stateNode={isHidden:!1},et}function Qg(et,o,tt){return et=Bg(6,et,null,o),et.lanes=tt,et}function Sg(et,o,tt){return o=Bg(4,et.children!==null?et.children:[],et.key,o),o.lanes=tt,o.stateNode={containerInfo:et.containerInfo,pendingChildren:null,implementation:et.implementation},o}function al(et,o,tt,rt,nt){this.tag=o,this.containerInfo=et,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zc(0),this.expirationTimes=zc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zc(0),this.identifierPrefix=rt,this.onRecoverableError=nt,this.mutableSourceEagerHydrationData=null}function bl(et,o,tt,rt,nt,ot,it,st,at){return et=new al(et,o,tt,st,at),o===1?(o=1,ot===!0&&(o|=8)):o=0,ot=Bg(3,null,null,o),et.current=ot,ot.stateNode=et,ot.memoizedState={element:rt,isDehydrated:tt,cache:null,transitions:null,pendingSuspenseBoundaries:null},kh(ot),et}function cl(et,o,tt){var rt=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:wa,key:rt==null?null:""+rt,children:et,containerInfo:o,implementation:tt}}function dl(et){if(!et)return Vf;et=et._reactInternals;e:{if(Vb(et)!==et||et.tag!==1)throw Error(p$4(170));var o=et;do{switch(o.tag){case 3:o=o.stateNode.context;break e;case 1:if(Zf(o.type)){o=o.stateNode.__reactInternalMemoizedMergedChildContext;break e}}o=o.return}while(o!==null);throw Error(p$4(171))}if(et.tag===1){var tt=et.type;if(Zf(tt))return bg(et,tt,o)}return o}function el(et,o,tt,rt,nt,ot,it,st,at){return et=bl(tt,rt,!0,et,nt,ot,it,st,at),et.context=dl(null),tt=et.current,rt=R(),nt=yi(tt),ot=mh(rt,nt),ot.callback=o??null,nh(tt,ot,nt),et.current.lanes=nt,Ac(et,nt,rt),Dk(et,rt),et}function fl(et,o,tt,rt){var nt=o.current,ot=R(),it=yi(nt);return tt=dl(tt),o.context===null?o.context=tt:o.pendingContext=tt,o=mh(ot,it),o.payload={element:et},rt=rt===void 0?null:rt,rt!==null&&(o.callback=rt),et=nh(nt,o,it),et!==null&&(gi(et,nt,it,ot),oh(et,nt,it)),it}function gl(et){if(et=et.current,!et.child)return null;switch(et.child.tag){case 5:return et.child.stateNode;default:return et.child.stateNode}}function hl(et,o){if(et=et.memoizedState,et!==null&&et.dehydrated!==null){var tt=et.retryLane;et.retryLane=tt!==0&&tt<o?tt:o}}function il(et,o){hl(et,o),(et=et.alternate)&&hl(et,o)}function jl(){return null}var kl=typeof reportError=="function"?reportError:function(et){console.error(et)};function ll(et){this._internalRoot=et}ml.prototype.render=ll.prototype.render=function(et){var o=this._internalRoot;if(o===null)throw Error(p$4(409));fl(et,o,null,null)};ml.prototype.unmount=ll.prototype.unmount=function(){var et=this._internalRoot;if(et!==null){this._internalRoot=null;var o=et.containerInfo;Rk(function(){fl(null,et,null,null)}),o[uf]=null}};function ml(et){this._internalRoot=et}ml.prototype.unstable_scheduleHydration=function(et){if(et){var o=Hc();et={blockedOn:null,target:et,priority:o};for(var tt=0;tt<Qc.length&&o!==0&&o<Qc[tt].priority;tt++);Qc.splice(tt,0,et),tt===0&&Vc(et)}};function nl(et){return!(!et||et.nodeType!==1&&et.nodeType!==9&&et.nodeType!==11)}function ol(et){return!(!et||et.nodeType!==1&&et.nodeType!==9&&et.nodeType!==11&&(et.nodeType!==8||et.nodeValue!==" react-mount-point-unstable "))}function pl(){}function ql(et,o,tt,rt,nt){if(nt){if(typeof rt=="function"){var ot=rt;rt=function(){var ct=gl(it);ot.call(ct)}}var it=el(o,rt,et,0,null,!1,!1,"",pl);return et._reactRootContainer=it,et[uf]=it.current,sf(et.nodeType===8?et.parentNode:et),Rk(),it}for(;nt=et.lastChild;)et.removeChild(nt);if(typeof rt=="function"){var st=rt;rt=function(){var ct=gl(at);st.call(ct)}}var at=bl(et,0,!1,null,null,!1,!1,"",pl);return et._reactRootContainer=at,et[uf]=at.current,sf(et.nodeType===8?et.parentNode:et),Rk(function(){fl(o,at,tt,rt)}),at}function rl(et,o,tt,rt,nt){var ot=tt._reactRootContainer;if(ot){var it=ot;if(typeof nt=="function"){var st=nt;nt=function(){var at=gl(it);st.call(at)}}fl(o,it,et,nt)}else it=ql(tt,o,et,nt,rt);return gl(it)}Ec=function(et){switch(et.tag){case 3:var o=et.stateNode;if(o.current.memoizedState.isDehydrated){var tt=tc(o.pendingLanes);tt!==0&&(Cc(o,tt|1),Dk(o,B$1()),!(K$1&6)&&(Gj=B$1()+500,jg()))}break;case 13:Rk(function(){var rt=ih(et,1);if(rt!==null){var nt=R();gi(rt,et,1,nt)}}),il(et,1)}};Fc=function(et){if(et.tag===13){var o=ih(et,134217728);if(o!==null){var tt=R();gi(o,et,134217728,tt)}il(et,134217728)}};Gc=function(et){if(et.tag===13){var o=yi(et),tt=ih(et,o);if(tt!==null){var rt=R();gi(tt,et,o,rt)}il(et,o)}};Hc=function(){return C$1};Ic=function(et,o){var tt=C$1;try{return C$1=et,o()}finally{C$1=tt}};yb=function(et,o,tt){switch(o){case"input":if(bb(et,tt),o=tt.name,tt.type==="radio"&&o!=null){for(tt=et;tt.parentNode;)tt=tt.parentNode;for(tt=tt.querySelectorAll("input[name="+JSON.stringify(""+o)+'][type="radio"]'),o=0;o<tt.length;o++){var rt=tt[o];if(rt!==et&&rt.form===et.form){var nt=Db(rt);if(!nt)throw Error(p$4(90));Wa(rt),bb(rt,nt)}}}break;case"textarea":ib(et,tt);break;case"select":o=tt.value,o!=null&&fb(et,!!tt.multiple,o,!1)}};Gb=Qk;Hb=Rk;var sl={usingClientEntryPoint:!1,Events:[Cb,ue,Db,Eb,Fb,Qk]},tl={findFiberByHostInstance:Wc,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ul={bundleType:tl.bundleType,version:tl.version,rendererPackageName:tl.rendererPackageName,rendererConfig:tl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ua.ReactCurrentDispatcher,findHostInstanceByFiber:function(et){return et=Zb(et),et===null?null:et.stateNode},findFiberByHostInstance:tl.findFiberByHostInstance||jl,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vl.isDisabled&&vl.supportsFiber)try{kc=vl.inject(ul),lc=vl}catch{}}reactDom_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=sl;reactDom_production_min.createPortal=function(et,o){var tt=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!nl(o))throw Error(p$4(200));return cl(et,o,null,tt)};reactDom_production_min.createRoot=function(et,o){if(!nl(et))throw Error(p$4(299));var tt=!1,rt="",nt=kl;return o!=null&&(o.unstable_strictMode===!0&&(tt=!0),o.identifierPrefix!==void 0&&(rt=o.identifierPrefix),o.onRecoverableError!==void 0&&(nt=o.onRecoverableError)),o=bl(et,1,!1,null,null,tt,!1,rt,nt),et[uf]=o.current,sf(et.nodeType===8?et.parentNode:et),new ll(o)};reactDom_production_min.findDOMNode=function(et){if(et==null)return null;if(et.nodeType===1)return et;var o=et._reactInternals;if(o===void 0)throw typeof et.render=="function"?Error(p$4(188)):(et=Object.keys(et).join(","),Error(p$4(268,et)));return et=Zb(o),et=et===null?null:et.stateNode,et};reactDom_production_min.flushSync=function(et){return Rk(et)};reactDom_production_min.hydrate=function(et,o,tt){if(!ol(o))throw Error(p$4(200));return rl(null,et,o,!0,tt)};reactDom_production_min.hydrateRoot=function(et,o,tt){if(!nl(et))throw Error(p$4(405));var rt=tt!=null&&tt.hydratedSources||null,nt=!1,ot="",it=kl;if(tt!=null&&(tt.unstable_strictMode===!0&&(nt=!0),tt.identifierPrefix!==void 0&&(ot=tt.identifierPrefix),tt.onRecoverableError!==void 0&&(it=tt.onRecoverableError)),o=el(o,null,et,1,tt??null,nt,!1,ot,it),et[uf]=o.current,sf(et),rt)for(et=0;et<rt.length;et++)tt=rt[et],nt=tt._getVersion,nt=nt(tt._source),o.mutableSourceEagerHydrationData==null?o.mutableSourceEagerHydrationData=[tt,nt]:o.mutableSourceEagerHydrationData.push(tt,nt);return new ml(o)};reactDom_production_min.render=function(et,o,tt){if(!ol(o))throw Error(p$4(200));return rl(null,et,o,!1,tt)};reactDom_production_min.unmountComponentAtNode=function(et){if(!ol(et))throw Error(p$4(40));return et._reactRootContainer?(Rk(function(){rl(null,null,et,!1,function(){et._reactRootContainer=null,et[uf]=null})}),!0):!1};reactDom_production_min.unstable_batchedUpdates=Qk;reactDom_production_min.unstable_renderSubtreeIntoContainer=function(et,o,tt,rt){if(!ol(tt))throw Error(p$4(200));if(et==null||et._reactInternals===void 0)throw Error(p$4(38));return rl(et,o,tt,!1,rt)};reactDom_production_min.version="18.3.1-next-f1338f8080-20240426";function checkDCE(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE)}catch(et){console.error(et)}}checkDCE(),reactDom.exports=reactDom_production_min;var reactDomExports=reactDom.exports,createRoot,m$5=reactDomExports;createRoot=m$5.createRoot,m$5.hydrateRoot;const version$8="2.21.28";let errorConfig={getDocsUrl:({docsBaseUrl:et,docsPath:o="",docsSlug:tt})=>o?`${et??"https://viem.sh"}${o}${tt?`#${tt}`:""}`:void 0,version:version$8},BaseError$3=class ks extends Error{constructor(o,tt={}){var st;const rt=(()=>{var at;return tt.cause instanceof ks?tt.cause.details:(at=tt.cause)!=null&&at.message?tt.cause.message:tt.details})(),nt=tt.cause instanceof ks&&tt.cause.docsPath||tt.docsPath,ot=(st=errorConfig.getDocsUrl)==null?void 0:st.call(errorConfig,{...tt,docsPath:nt}),it=[o||"An error occurred.","",...tt.metaMessages?[...tt.metaMessages,""]:[],...ot?[`Docs: ${ot}`]:[],...rt?[`Details: ${rt}`]:[],`Version: ${errorConfig.version}`].join(`
`);super(it,tt.cause?{cause:tt.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=rt,this.docsPath=nt,this.metaMessages=tt.metaMessages,this.name=tt.name??this.name,this.shortMessage=o,this.version=version$8}walk(o){return walk(this,o)}};function walk(et,o){return o!=null&&o(et)?et:et&&typeof et=="object"&&"cause"in et?walk(et.cause,o):o?null:et}class IntegerOutOfRangeError extends BaseError$3{constructor({max:o,min:tt,signed:rt,size:nt,value:ot}){super(`Number "${ot}" is not in safe ${nt?`${nt*8}-bit ${rt?"signed":"unsigned"} `:""}integer range ${o?`(${tt} to ${o})`:`(above ${tt})`}`,{name:"IntegerOutOfRangeError"})}}class InvalidBytesBooleanError extends BaseError$3{constructor(o){super(`Bytes value "${o}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}class SizeOverflowError extends BaseError$3{constructor({givenSize:o,maxSize:tt}){super(`Size cannot exceed ${tt} bytes. Given size: ${o} bytes.`,{name:"SizeOverflowError"})}}class SliceOffsetOutOfBoundsError extends BaseError$3{constructor({offset:o,position:tt,size:rt}){super(`Slice ${tt==="start"?"starting":"ending"} at offset "${o}" is out-of-bounds (size: ${rt}).`,{name:"SliceOffsetOutOfBoundsError"})}}class SizeExceedsPaddingSizeError extends BaseError$3{constructor({size:o,targetSize:tt,type:rt}){super(`${rt.charAt(0).toUpperCase()}${rt.slice(1).toLowerCase()} size (${o}) exceeds padding size (${tt}).`,{name:"SizeExceedsPaddingSizeError"})}}class InvalidBytesLengthError extends BaseError$3{constructor({size:o,targetSize:tt,type:rt}){super(`${rt.charAt(0).toUpperCase()}${rt.slice(1).toLowerCase()} is expected to be ${tt} ${rt} long, but is ${o} ${rt} long.`,{name:"InvalidBytesLengthError"})}}function pad(et,{dir:o,size:tt=32}={}){return typeof et=="string"?padHex(et,{dir:o,size:tt}):padBytes(et,{dir:o,size:tt})}function padHex(et,{dir:o,size:tt=32}={}){if(tt===null)return et;const rt=et.replace("0x","");if(rt.length>tt*2)throw new SizeExceedsPaddingSizeError({size:Math.ceil(rt.length/2),targetSize:tt,type:"hex"});return`0x${rt[o==="right"?"padEnd":"padStart"](tt*2,"0")}`}function padBytes(et,{dir:o,size:tt=32}={}){if(tt===null)return et;if(et.length>tt)throw new SizeExceedsPaddingSizeError({size:et.length,targetSize:tt,type:"bytes"});const rt=new Uint8Array(tt);for(let nt=0;nt<tt;nt++){const ot=o==="right";rt[ot?nt:tt-nt-1]=et[ot?nt:et.length-nt-1]}return rt}function isHex(et,{strict:o=!0}={}){return!et||typeof et!="string"?!1:o?/^0x[0-9a-fA-F]*$/.test(et):et.startsWith("0x")}function size$2(et){return isHex(et,{strict:!1})?Math.ceil((et.length-2)/2):et.length}function trim$1(et,{dir:o="left"}={}){let tt=typeof et=="string"?et.replace("0x",""):et,rt=0;for(let nt=0;nt<tt.length-1&&tt[o==="left"?nt:tt.length-nt-1].toString()==="0";nt++)rt++;return tt=o==="left"?tt.slice(rt):tt.slice(0,tt.length-rt),typeof et=="string"?(tt.length===1&&o==="right"&&(tt=`${tt}0`),`0x${tt.length%2===1?`0${tt}`:tt}`):tt}const encoder$3=new TextEncoder;function toBytes$3(et,o={}){return typeof et=="number"||typeof et=="bigint"?numberToBytes$1(et,o):typeof et=="boolean"?boolToBytes(et,o):isHex(et)?hexToBytes$3(et,o):stringToBytes(et,o)}function boolToBytes(et,o={}){const tt=new Uint8Array(1);return tt[0]=Number(et),typeof o.size=="number"?(assertSize(tt,{size:o.size}),pad(tt,{size:o.size})):tt}const charCodeMap={zero:48,nine:57,A:65,F:70,a:97,f:102};function charCodeToBase16(et){if(et>=charCodeMap.zero&&et<=charCodeMap.nine)return et-charCodeMap.zero;if(et>=charCodeMap.A&&et<=charCodeMap.F)return et-(charCodeMap.A-10);if(et>=charCodeMap.a&&et<=charCodeMap.f)return et-(charCodeMap.a-10)}function hexToBytes$3(et,o={}){let tt=et;o.size&&(assertSize(tt,{size:o.size}),tt=pad(tt,{dir:"right",size:o.size}));let rt=tt.slice(2);rt.length%2&&(rt=`0${rt}`);const nt=rt.length/2,ot=new Uint8Array(nt);for(let it=0,st=0;it<nt;it++){const at=charCodeToBase16(rt.charCodeAt(st++)),ct=charCodeToBase16(rt.charCodeAt(st++));if(at===void 0||ct===void 0)throw new BaseError$3(`Invalid byte sequence ("${rt[st-2]}${rt[st-1]}" in "${rt}").`);ot[it]=at*16+ct}return ot}function numberToBytes$1(et,o){const tt=numberToHex(et,o);return hexToBytes$3(tt)}function stringToBytes(et,o={}){const tt=encoder$3.encode(et);return typeof o.size=="number"?(assertSize(tt,{size:o.size}),pad(tt,{dir:"right",size:o.size})):tt}function assertSize(et,{size:o}){if(size$2(et)>o)throw new SizeOverflowError({givenSize:size$2(et),maxSize:o})}function hexToBigInt(et,o={}){const{signed:tt}=o;o.size&&assertSize(et,{size:o.size});const rt=BigInt(et);if(!tt)return rt;const nt=(et.length-2)/2,ot=(1n<<BigInt(nt)*8n-1n)-1n;return rt<=ot?rt:rt-BigInt(`0x${"f".padStart(nt*2,"f")}`)-1n}function hexToNumber$2(et,o={}){return Number(hexToBigInt(et,o))}function hexToString(et,o={}){let tt=hexToBytes$3(et);return o.size&&(assertSize(tt,{size:o.size}),tt=trim$1(tt,{dir:"right"})),new TextDecoder().decode(tt)}const hexes$2=Array.from({length:256},(et,o)=>o.toString(16).padStart(2,"0"));function toHex(et,o={}){return typeof et=="number"||typeof et=="bigint"?numberToHex(et,o):typeof et=="string"?stringToHex(et,o):typeof et=="boolean"?boolToHex(et,o):bytesToHex$3(et,o)}function boolToHex(et,o={}){const tt=`0x${Number(et)}`;return typeof o.size=="number"?(assertSize(tt,{size:o.size}),pad(tt,{size:o.size})):tt}function bytesToHex$3(et,o={}){let tt="";for(let nt=0;nt<et.length;nt++)tt+=hexes$2[et[nt]];const rt=`0x${tt}`;return typeof o.size=="number"?(assertSize(rt,{size:o.size}),pad(rt,{dir:"right",size:o.size})):rt}function numberToHex(et,o={}){const{signed:tt,size:rt}=o,nt=BigInt(et);let ot;rt?tt?ot=(1n<<BigInt(rt)*8n-1n)-1n:ot=2n**(BigInt(rt)*8n)-1n:typeof et=="number"&&(ot=BigInt(Number.MAX_SAFE_INTEGER));const it=typeof ot=="bigint"&&tt?-ot-1n:0;if(ot&&nt>ot||nt<it){const at=typeof et=="bigint"?"n":"";throw new IntegerOutOfRangeError({max:ot?`${ot}${at}`:void 0,min:`${it}${at}`,signed:tt,size:rt,value:`${et}${at}`})}const st=`0x${(tt&&nt<0?(1n<<BigInt(rt*8))+BigInt(nt):nt).toString(16)}`;return rt?pad(st,{size:rt}):st}const encoder$2=new TextEncoder;function stringToHex(et,o={}){const tt=encoder$2.encode(et);return bytesToHex$3(tt,o)}function formatAbiItem$1(et,{includeName:o=!1}={}){if(et.type!=="function"&&et.type!=="event"&&et.type!=="error")throw new InvalidDefinitionTypeError(et.type);return`${et.name}(${formatAbiParams(et.inputs,{includeName:o})})`}function formatAbiParams(et,{includeName:o=!1}={}){return et?et.map(tt=>formatAbiParam(tt,{includeName:o})).join(o?", ":","):""}function formatAbiParam(et,{includeName:o}){return et.type.startsWith("tuple")?`(${formatAbiParams(et.components,{includeName:o})})${et.type.slice(5)}`:et.type+(o&&et.name?` ${et.name}`:"")}class AbiConstructorNotFoundError extends BaseError$3{constructor({docsPath:o}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
`),{docsPath:o,name:"AbiConstructorNotFoundError"})}}class AbiConstructorParamsNotFoundError extends BaseError$3{constructor({docsPath:o}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
`),{docsPath:o,name:"AbiConstructorParamsNotFoundError"})}}class AbiDecodingDataSizeTooSmallError extends BaseError$3{constructor({data:o,params:tt,size:rt}){super([`Data size of ${rt} bytes is too small for given parameters.`].join(`
`),{metaMessages:[`Params: (${formatAbiParams(tt,{includeName:!0})})`,`Data: ${o} (${rt} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=o,this.params=tt,this.size=rt}}class AbiDecodingZeroDataError extends BaseError$3{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class AbiEncodingArrayLengthMismatchError extends BaseError$3{constructor({expectedLength:o,givenLength:tt,type:rt}){super([`ABI encoding array length mismatch for type ${rt}.`,`Expected length: ${o}`,`Given length: ${tt}`].join(`
`),{name:"AbiEncodingArrayLengthMismatchError"})}}class AbiEncodingBytesSizeMismatchError extends BaseError$3{constructor({expectedSize:o,value:tt}){super(`Size of bytes "${tt}" (bytes${size$2(tt)}) does not match expected size (bytes${o}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class AbiEncodingLengthMismatchError extends BaseError$3{constructor({expectedLength:o,givenLength:tt}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${o}`,`Given length (values): ${tt}`].join(`
`),{name:"AbiEncodingLengthMismatchError"})}}class AbiErrorSignatureNotFoundError extends BaseError$3{constructor(o,{docsPath:tt}){super([`Encoded error signature "${o}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${o}.`].join(`
`),{docsPath:tt,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=o}}class AbiFunctionNotFoundError extends BaseError$3{constructor(o,{docsPath:tt}={}){super([`Function ${o?`"${o}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
`),{docsPath:tt,name:"AbiFunctionNotFoundError"})}}class AbiFunctionOutputsNotFoundError extends BaseError$3{constructor(o,{docsPath:tt}){super([`Function "${o}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(`
`),{docsPath:tt,name:"AbiFunctionOutputsNotFoundError"})}}class AbiItemAmbiguityError extends BaseError$3{constructor(o,tt){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${o.type}\` in \`${formatAbiItem$1(o.abiItem)}\`, and`,`\`${tt.type}\` in \`${formatAbiItem$1(tt.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}class BytesSizeMismatchError extends BaseError$3{constructor({expectedSize:o,givenSize:tt}){super(`Expected bytes${o}, got bytes${tt}.`,{name:"BytesSizeMismatchError"})}}class InvalidAbiEncodingTypeError extends BaseError$3{constructor(o,{docsPath:tt}){super([`Type "${o}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
`),{docsPath:tt,name:"InvalidAbiEncodingType"})}}class InvalidAbiDecodingTypeError extends BaseError$3{constructor(o,{docsPath:tt}){super([`Type "${o}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
`),{docsPath:tt,name:"InvalidAbiDecodingType"})}}class InvalidArrayError extends BaseError$3{constructor(o){super([`Value "${o}" is not a valid array.`].join(`
`),{name:"InvalidArrayError"})}}class InvalidDefinitionTypeError extends BaseError$3{constructor(o){super([`"${o}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
`),{name:"InvalidDefinitionTypeError"})}}function concat$6(et){return typeof et[0]=="string"?concatHex(et):concatBytes$3(et)}function concatBytes$3(et){let o=0;for(const nt of et)o+=nt.length;const tt=new Uint8Array(o);let rt=0;for(const nt of et)tt.set(nt,rt),rt+=nt.length;return tt}function concatHex(et){return`0x${et.reduce((o,tt)=>o+tt.replace("0x",""),"")}`}class InvalidAddressError extends BaseError$3{constructor({address:o}){super(`Address "${o}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class LruMap extends Map{constructor(o){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=o}get(o){const tt=super.get(o);return super.has(o)&&tt!==void 0&&(this.delete(o),super.set(o,tt)),tt}set(o,tt){if(super.set(o,tt),this.maxSize&&this.size>this.maxSize){const rt=this.keys().next().value;rt&&this.delete(rt)}return this}}function number$4(et){if(!Number.isSafeInteger(et)||et<0)throw new Error(`positive integer expected, not ${et}`)}function isBytes$3(et){return et instanceof Uint8Array||et!=null&&typeof et=="object"&&et.constructor.name==="Uint8Array"}function bytes$1(et,...o){if(!isBytes$3(et))throw new Error("Uint8Array expected");if(o.length>0&&!o.includes(et.length))throw new Error(`Uint8Array expected of length ${o}, not of length=${et.length}`)}function hash$1(et){if(typeof et!="function"||typeof et.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number$4(et.outputLen),number$4(et.blockLen)}function exists$1(et,o=!0){if(et.destroyed)throw new Error("Hash instance has been destroyed");if(o&&et.finished)throw new Error("Hash#digest() has already been called")}function output$1(et,o){bytes$1(et);const tt=o.outputLen;if(et.length<tt)throw new Error(`digestInto() expects output buffer of length at least ${tt}`)}const U32_MASK64=BigInt(2**32-1),_32n=BigInt(32);function fromBig(et,o=!1){return o?{h:Number(et&U32_MASK64),l:Number(et>>_32n&U32_MASK64)}:{h:Number(et>>_32n&U32_MASK64)|0,l:Number(et&U32_MASK64)|0}}function split$1(et,o=!1){let tt=new Uint32Array(et.length),rt=new Uint32Array(et.length);for(let nt=0;nt<et.length;nt++){const{h:ot,l:it}=fromBig(et[nt],o);[tt[nt],rt[nt]]=[ot,it]}return[tt,rt]}const toBig=(et,o)=>BigInt(et>>>0)<<_32n|BigInt(o>>>0),shrSH=(et,o,tt)=>et>>>tt,shrSL=(et,o,tt)=>et<<32-tt|o>>>tt,rotrSH=(et,o,tt)=>et>>>tt|o<<32-tt,rotrSL=(et,o,tt)=>et<<32-tt|o>>>tt,rotrBH=(et,o,tt)=>et<<64-tt|o>>>tt-32,rotrBL=(et,o,tt)=>et>>>tt-32|o<<64-tt,rotr32H=(et,o)=>o,rotr32L=(et,o)=>et,rotlSH=(et,o,tt)=>et<<tt|o>>>32-tt,rotlSL=(et,o,tt)=>o<<tt|et>>>32-tt,rotlBH=(et,o,tt)=>o<<tt-32|et>>>64-tt,rotlBL=(et,o,tt)=>et<<tt-32|o>>>64-tt;function add(et,o,tt,rt){const nt=(o>>>0)+(rt>>>0);return{h:et+tt+(nt/2**32|0)|0,l:nt|0}}const add3L=(et,o,tt)=>(et>>>0)+(o>>>0)+(tt>>>0),add3H=(et,o,tt,rt)=>o+tt+rt+(et/2**32|0)|0,add4L=(et,o,tt,rt)=>(et>>>0)+(o>>>0)+(tt>>>0)+(rt>>>0),add4H=(et,o,tt,rt,nt)=>o+tt+rt+nt+(et/2**32|0)|0,add5L=(et,o,tt,rt,nt)=>(et>>>0)+(o>>>0)+(tt>>>0)+(rt>>>0)+(nt>>>0),add5H=(et,o,tt,rt,nt,ot)=>o+tt+rt+nt+ot+(et/2**32|0)|0,u64={fromBig,split:split$1,toBig,shrSH,shrSL,rotrSH,rotrSL,rotrBH,rotrBL,rotr32H,rotr32L,rotlSH,rotlSL,rotlBH,rotlBL,add,add3L,add3H,add4L,add4H,add5H,add5L},crypto$2=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const u32$1=et=>new Uint32Array(et.buffer,et.byteOffset,Math.floor(et.byteLength/4)),createView$1=et=>new DataView(et.buffer,et.byteOffset,et.byteLength),rotr=(et,o)=>et<<32-o|et>>>o,isLE$1=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,byteSwap=et=>et<<24&4278190080|et<<8&16711680|et>>>8&65280|et>>>24&255;function byteSwap32(et){for(let o=0;o<et.length;o++)et[o]=byteSwap(et[o])}function utf8ToBytes$3(et){if(typeof et!="string")throw new Error(`utf8ToBytes expected string, got ${typeof et}`);return new Uint8Array(new TextEncoder().encode(et))}function toBytes$2(et){return typeof et=="string"&&(et=utf8ToBytes$3(et)),bytes$1(et),et}function concatBytes$2(...et){let o=0;for(let rt=0;rt<et.length;rt++){const nt=et[rt];bytes$1(nt),o+=nt.length}const tt=new Uint8Array(o);for(let rt=0,nt=0;rt<et.length;rt++){const ot=et[rt];tt.set(ot,nt),nt+=ot.length}return tt}class Hash{clone(){return this._cloneInto()}}function wrapConstructor(et){const o=rt=>et().update(toBytes$2(rt)).digest(),tt=et();return o.outputLen=tt.outputLen,o.blockLen=tt.blockLen,o.create=()=>et(),o}function randomBytes$1(et=32){if(crypto$2&&typeof crypto$2.getRandomValues=="function")return crypto$2.getRandomValues(new Uint8Array(et));if(crypto$2&&typeof crypto$2.randomBytes=="function")return crypto$2.randomBytes(et);throw new Error("crypto.getRandomValues must be defined")}const SHA3_PI=[],SHA3_ROTL=[],_SHA3_IOTA=[],_0n$7=BigInt(0),_1n$9=BigInt(1),_2n$6=BigInt(2),_7n=BigInt(7),_256n=BigInt(256),_0x71n=BigInt(113);for(let et=0,o=_1n$9,tt=1,rt=0;et<24;et++){[tt,rt]=[rt,(2*tt+3*rt)%5],SHA3_PI.push(2*(5*rt+tt)),SHA3_ROTL.push((et+1)*(et+2)/2%64);let nt=_0n$7;for(let ot=0;ot<7;ot++)o=(o<<_1n$9^(o>>_7n)*_0x71n)%_256n,o&_2n$6&&(nt^=_1n$9<<(_1n$9<<BigInt(ot))-_1n$9);_SHA3_IOTA.push(nt)}const[SHA3_IOTA_H,SHA3_IOTA_L]=split$1(_SHA3_IOTA,!0),rotlH=(et,o,tt)=>tt>32?rotlBH(et,o,tt):rotlSH(et,o,tt),rotlL=(et,o,tt)=>tt>32?rotlBL(et,o,tt):rotlSL(et,o,tt);function keccakP(et,o=24){const tt=new Uint32Array(10);for(let rt=24-o;rt<24;rt++){for(let it=0;it<10;it++)tt[it]=et[it]^et[it+10]^et[it+20]^et[it+30]^et[it+40];for(let it=0;it<10;it+=2){const st=(it+8)%10,at=(it+2)%10,ct=tt[at],lt=tt[at+1],dt=rotlH(ct,lt,1)^tt[st],ht=rotlL(ct,lt,1)^tt[st+1];for(let mt=0;mt<50;mt+=10)et[it+mt]^=dt,et[it+mt+1]^=ht}let nt=et[2],ot=et[3];for(let it=0;it<24;it++){const st=SHA3_ROTL[it],at=rotlH(nt,ot,st),ct=rotlL(nt,ot,st),lt=SHA3_PI[it];nt=et[lt],ot=et[lt+1],et[lt]=at,et[lt+1]=ct}for(let it=0;it<50;it+=10){for(let st=0;st<10;st++)tt[st]=et[it+st];for(let st=0;st<10;st++)et[it+st]^=~tt[(st+2)%10]&tt[(st+4)%10]}et[0]^=SHA3_IOTA_H[rt],et[1]^=SHA3_IOTA_L[rt]}tt.fill(0)}class Keccak extends Hash{constructor(o,tt,rt,nt=!1,ot=24){if(super(),this.blockLen=o,this.suffix=tt,this.outputLen=rt,this.enableXOF=nt,this.rounds=ot,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,number$4(rt),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=u32$1(this.state)}keccak(){isLE$1||byteSwap32(this.state32),keccakP(this.state32,this.rounds),isLE$1||byteSwap32(this.state32),this.posOut=0,this.pos=0}update(o){exists$1(this);const{blockLen:tt,state:rt}=this;o=toBytes$2(o);const nt=o.length;for(let ot=0;ot<nt;){const it=Math.min(tt-this.pos,nt-ot);for(let st=0;st<it;st++)rt[this.pos++]^=o[ot++];this.pos===tt&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:o,suffix:tt,pos:rt,blockLen:nt}=this;o[rt]^=tt,tt&128&&rt===nt-1&&this.keccak(),o[nt-1]^=128,this.keccak()}writeInto(o){exists$1(this,!1),bytes$1(o),this.finish();const tt=this.state,{blockLen:rt}=this;for(let nt=0,ot=o.length;nt<ot;){this.posOut>=rt&&this.keccak();const it=Math.min(rt-this.posOut,ot-nt);o.set(tt.subarray(this.posOut,this.posOut+it),nt),this.posOut+=it,nt+=it}return o}xofInto(o){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(o)}xof(o){return number$4(o),this.xofInto(new Uint8Array(o))}digestInto(o){if(output$1(o,this),this.finished)throw new Error("digest() was already called");return this.writeInto(o),this.destroy(),o}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(o){const{blockLen:tt,suffix:rt,outputLen:nt,rounds:ot,enableXOF:it}=this;return o||(o=new Keccak(tt,rt,nt,it,ot)),o.state32.set(this.state32),o.pos=this.pos,o.posOut=this.posOut,o.finished=this.finished,o.rounds=ot,o.suffix=rt,o.outputLen=nt,o.enableXOF=it,o.destroyed=this.destroyed,o}}const gen=(et,o,tt)=>wrapConstructor(()=>new Keccak(o,et,tt)),keccak_256=gen(1,136,256/8);function keccak256$1(et,o){const tt=o||"hex",rt=keccak_256(isHex(et,{strict:!1})?toBytes$3(et):et);return tt==="bytes"?rt:toHex(rt)}const checksumAddressCache=new LruMap(8192);function checksumAddress(et,o){if(checksumAddressCache.has(`${et}.${o}`))return checksumAddressCache.get(`${et}.${o}`);const tt=o?`${o}${et.toLowerCase()}`:et.substring(2).toLowerCase(),rt=keccak256$1(stringToBytes(tt),"bytes"),nt=(o?tt.substring(`${o}0x`.length):tt).split("");for(let it=0;it<40;it+=2)rt[it>>1]>>4>=8&&nt[it]&&(nt[it]=nt[it].toUpperCase()),(rt[it>>1]&15)>=8&&nt[it+1]&&(nt[it+1]=nt[it+1].toUpperCase());const ot=`0x${nt.join("")}`;return checksumAddressCache.set(`${et}.${o}`,ot),ot}function getAddress(et,o){if(!isAddress(et,{strict:!1}))throw new InvalidAddressError({address:et});return checksumAddress(et,o)}const addressRegex=/^0x[a-fA-F0-9]{40}$/,isAddressCache=new LruMap(8192);function isAddress(et,o){const{strict:tt=!0}=o??{},rt=`${et}.${tt}`;if(isAddressCache.has(rt))return isAddressCache.get(rt);const nt=addressRegex.test(et)?et.toLowerCase()===et?!0:tt?checksumAddress(et)===et:!0:!1;return isAddressCache.set(rt,nt),nt}function slice(et,o,tt,{strict:rt}={}){return isHex(et,{strict:!1})?sliceHex(et,o,tt,{strict:rt}):sliceBytes(et,o,tt,{strict:rt})}function assertStartOffset(et,o){if(typeof o=="number"&&o>0&&o>size$2(et)-1)throw new SliceOffsetOutOfBoundsError({offset:o,position:"start",size:size$2(et)})}function assertEndOffset(et,o,tt){if(typeof o=="number"&&typeof tt=="number"&&size$2(et)!==tt-o)throw new SliceOffsetOutOfBoundsError({offset:tt,position:"end",size:size$2(et)})}function sliceBytes(et,o,tt,{strict:rt}={}){assertStartOffset(et,o);const nt=et.slice(o,tt);return rt&&assertEndOffset(nt,o,tt),nt}function sliceHex(et,o,tt,{strict:rt}={}){assertStartOffset(et,o);const nt=`0x${et.replace("0x","").slice((o??0)*2,(tt??et.length)*2)}`;return rt&&assertEndOffset(nt,o,tt),nt}function encodeAbiParameters(et,o){if(et.length!==o.length)throw new AbiEncodingLengthMismatchError({expectedLength:et.length,givenLength:o.length});const tt=prepareParams({params:et,values:o}),rt=encodeParams(tt);return rt.length===0?"0x":rt}function prepareParams({params:et,values:o}){const tt=[];for(let rt=0;rt<et.length;rt++)tt.push(prepareParam({param:et[rt],value:o[rt]}));return tt}function prepareParam({param:et,value:o}){const tt=getArrayComponents(et.type);if(tt){const[rt,nt]=tt;return encodeArray(o,{length:rt,param:{...et,type:nt}})}if(et.type==="tuple")return encodeTuple(o,{param:et});if(et.type==="address")return encodeAddress(o);if(et.type==="bool")return encodeBool(o);if(et.type.startsWith("uint")||et.type.startsWith("int")){const rt=et.type.startsWith("int");return encodeNumber(o,{signed:rt})}if(et.type.startsWith("bytes"))return encodeBytes(o,{param:et});if(et.type==="string")return encodeString(o);throw new InvalidAbiEncodingTypeError(et.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function encodeParams(et){let o=0;for(let ot=0;ot<et.length;ot++){const{dynamic:it,encoded:st}=et[ot];it?o+=32:o+=size$2(st)}const tt=[],rt=[];let nt=0;for(let ot=0;ot<et.length;ot++){const{dynamic:it,encoded:st}=et[ot];it?(tt.push(numberToHex(o+nt,{size:32})),rt.push(st),nt+=size$2(st)):tt.push(st)}return concat$6([...tt,...rt])}function encodeAddress(et){if(!isAddress(et))throw new InvalidAddressError({address:et});return{dynamic:!1,encoded:padHex(et.toLowerCase())}}function encodeArray(et,{length:o,param:tt}){const rt=o===null;if(!Array.isArray(et))throw new InvalidArrayError(et);if(!rt&&et.length!==o)throw new AbiEncodingArrayLengthMismatchError({expectedLength:o,givenLength:et.length,type:`${tt.type}[${o}]`});let nt=!1;const ot=[];for(let it=0;it<et.length;it++){const st=prepareParam({param:tt,value:et[it]});st.dynamic&&(nt=!0),ot.push(st)}if(rt||nt){const it=encodeParams(ot);if(rt){const st=numberToHex(ot.length,{size:32});return{dynamic:!0,encoded:ot.length>0?concat$6([st,it]):st}}if(nt)return{dynamic:!0,encoded:it}}return{dynamic:!1,encoded:concat$6(ot.map(({encoded:it})=>it))}}function encodeBytes(et,{param:o}){const[,tt]=o.type.split("bytes"),rt=size$2(et);if(!tt){let nt=et;return rt%32!==0&&(nt=padHex(nt,{dir:"right",size:Math.ceil((et.length-2)/2/32)*32})),{dynamic:!0,encoded:concat$6([padHex(numberToHex(rt,{size:32})),nt])}}if(rt!==Number.parseInt(tt))throw new AbiEncodingBytesSizeMismatchError({expectedSize:Number.parseInt(tt),value:et});return{dynamic:!1,encoded:padHex(et,{dir:"right"})}}function encodeBool(et){if(typeof et!="boolean")throw new BaseError$3(`Invalid boolean value: "${et}" (type: ${typeof et}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:padHex(boolToHex(et))}}function encodeNumber(et,{signed:o}){return{dynamic:!1,encoded:numberToHex(et,{size:32,signed:o})}}function encodeString(et){const o=stringToHex(et),tt=Math.ceil(size$2(o)/32),rt=[];for(let nt=0;nt<tt;nt++)rt.push(padHex(slice(o,nt*32,(nt+1)*32),{dir:"right"}));return{dynamic:!0,encoded:concat$6([padHex(numberToHex(size$2(o),{size:32})),...rt])}}function encodeTuple(et,{param:o}){let tt=!1;const rt=[];for(let nt=0;nt<o.components.length;nt++){const ot=o.components[nt],it=Array.isArray(et)?nt:ot.name,st=prepareParam({param:ot,value:et[it]});rt.push(st),st.dynamic&&(tt=!0)}return{dynamic:tt,encoded:tt?encodeParams(rt):concat$6(rt.map(({encoded:nt})=>nt))}}function getArrayComponents(et){const o=et.match(/^(.*)\[(\d+)?\]$/);return o?[o[2]?Number(o[2]):null,o[1]]:void 0}const docsPath$2="/docs/contract/encodeDeployData";function encodeDeployData(et){const{abi:o,args:tt,bytecode:rt}=et;if(!tt||tt.length===0)return rt;const nt=o.find(it=>"type"in it&&it.type==="constructor");if(!nt)throw new AbiConstructorNotFoundError({docsPath:docsPath$2});if(!("inputs"in nt))throw new AbiConstructorParamsNotFoundError({docsPath:docsPath$2});if(!nt.inputs||nt.inputs.length===0)throw new AbiConstructorParamsNotFoundError({docsPath:docsPath$2});const ot=encodeAbiParameters(nt.inputs,tt);return concatHex([rt,ot])}function parseAccount(et){return typeof et=="string"?{address:et,type:"json-rpc"}:et}class AccountNotFoundError extends BaseError$3{constructor({docsPath:o}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(`
`),{docsPath:o,docsSlug:"account",name:"AccountNotFoundError"})}}const scriptRel="modulepreload",assetsURL=function(et){return"/buddybook/"+et},seen={},__vitePreload=function(o,tt,rt){let nt=Promise.resolve();if(tt&&tt.length>0){document.getElementsByTagName("link");const it=document.querySelector("meta[property=csp-nonce]"),st=(it==null?void 0:it.nonce)||(it==null?void 0:it.getAttribute("nonce"));nt=Promise.allSettled(tt.map(at=>{if(at=assetsURL(at),at in seen)return;seen[at]=!0;const ct=at.endsWith(".css"),lt=ct?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${at}"]${lt}`))return;const dt=document.createElement("link");if(dt.rel=ct?"stylesheet":scriptRel,ct||(dt.as="script"),dt.crossOrigin="",dt.href=at,st&&dt.setAttribute("nonce",st),document.head.appendChild(dt),ct)return new Promise((ht,mt)=>{dt.addEventListener("load",ht),dt.addEventListener("error",()=>mt(new Error(`Unable to preload CSS for ${at}`)))})}))}function ot(it){const st=new Event("vite:preloadError",{cancelable:!0});if(st.payload=it,window.dispatchEvent(st),!st.defaultPrevented)throw it}return nt.then(it=>{for(const st of it||[])st.status==="rejected"&&ot(st.reason);return o().catch(ot)})};class NegativeOffsetError extends BaseError$3{constructor({offset:o}){super(`Offset \`${o}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class PositionOutOfBoundsError extends BaseError$3{constructor({length:o,position:tt}){super(`Position \`${tt}\` is out of bounds (\`0 < position < ${o}\`).`,{name:"PositionOutOfBoundsError"})}}class RecursiveReadLimitExceededError extends BaseError$3{constructor({count:o,limit:tt}){super(`Recursive read limit of \`${tt}\` exceeded (recursive read count: \`${o}\`).`,{name:"RecursiveReadLimitExceededError"})}}const staticCursor={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 RecursiveReadLimitExceededError({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(et){if(et<0||et>this.bytes.length-1)throw new PositionOutOfBoundsError({length:this.bytes.length,position:et})},decrementPosition(et){if(et<0)throw new NegativeOffsetError({offset:et});const o=this.position-et;this.assertPosition(o),this.position=o},getReadCount(et){return this.positionReadCount.get(et||this.position)||0},incrementPosition(et){if(et<0)throw new NegativeOffsetError({offset:et});const o=this.position+et;this.assertPosition(o),this.position=o},inspectByte(et){const o=et??this.position;return this.assertPosition(o),this.bytes[o]},inspectBytes(et,o){const tt=o??this.position;return this.assertPosition(tt+et-1),this.bytes.subarray(tt,tt+et)},inspectUint8(et){const o=et??this.position;return this.assertPosition(o),this.bytes[o]},inspectUint16(et){const o=et??this.position;return this.assertPosition(o+1),this.dataView.getUint16(o)},inspectUint24(et){const o=et??this.position;return this.assertPosition(o+2),(this.dataView.getUint16(o)<<8)+this.dataView.getUint8(o+2)},inspectUint32(et){const o=et??this.position;return this.assertPosition(o+3),this.dataView.getUint32(o)},pushByte(et){this.assertPosition(this.position),this.bytes[this.position]=et,this.position++},pushBytes(et){this.assertPosition(this.position+et.length-1),this.bytes.set(et,this.position),this.position+=et.length},pushUint8(et){this.assertPosition(this.position),this.bytes[this.position]=et,this.position++},pushUint16(et){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,et),this.position+=2},pushUint24(et){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,et>>8),this.dataView.setUint8(this.position+2,et&255),this.position+=3},pushUint32(et){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,et),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const et=this.inspectByte();return this.position++,et},readBytes(et,o){this.assertReadLimit(),this._touch();const tt=this.inspectBytes(et);return this.position+=o??et,tt},readUint8(){this.assertReadLimit(),this._touch();const et=this.inspectUint8();return this.position+=1,et},readUint16(){this.assertReadLimit(),this._touch();const et=this.inspectUint16();return this.position+=2,et},readUint24(){this.assertReadLimit(),this._touch();const et=this.inspectUint24();return this.position+=3,et},readUint32(){this.assertReadLimit(),this._touch();const et=this.inspectUint32();return this.position+=4,et},get remaining(){return this.bytes.length-this.position},setPosition(et){const o=this.position;return this.assertPosition(et),this.position=et,()=>this.position=o},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const et=this.getReadCount();this.positionReadCount.set(this.position,et+1),et>0&&this.recursiveReadCount++}};function createCursor(et,{recursiveReadLimit:o=8192}={}){const tt=Object.create(staticCursor);return tt.bytes=et,tt.dataView=new DataView(et.buffer,et.byteOffset,et.byteLength),tt.positionReadCount=new Map,tt.recursiveReadLimit=o,tt}function toRlp(et,o="hex"){const tt=getEncodable(et),rt=createCursor(new Uint8Array(tt.length));return tt.encode(rt),o==="hex"?bytesToHex$3(rt.bytes):rt.bytes}function getEncodable(et){return Array.isArray(et)?getEncodableList(et.map(o=>getEncodable(o))):getEncodableBytes(et)}function getEncodableList(et){const o=et.reduce((nt,ot)=>nt+ot.length,0),tt=getSizeOfLength(o);return{length:o<=55?1+o:1+tt+o,encode(nt){o<=55?nt.pushByte(192+o):(nt.pushByte(247+tt),tt===1?nt.pushUint8(o):tt===2?nt.pushUint16(o):tt===3?nt.pushUint24(o):nt.pushUint32(o));for(const{encode:ot}of et)ot(nt)}}}function getEncodableBytes(et){const o=typeof et=="string"?hexToBytes$3(et):et,tt=getSizeOfLength(o.length);return{length:o.length===1&&o[0]<128?1:o.length<=55?1+o.length:1+tt+o.length,encode(nt){o.length===1&&o[0]<128?nt.pushBytes(o):o.length<=55?(nt.pushByte(128+o.length),nt.pushBytes(o)):(nt.pushByte(183+tt),tt===1?nt.pushUint8(o.length):tt===2?nt.pushUint16(o.length):tt===3?nt.pushUint24(o.length):nt.pushUint32(o.length),nt.pushBytes(o))}}}function getSizeOfLength(et){if(et<2**8)return 1;if(et<2**16)return 2;if(et<2**24)return 3;if(et<2**32)return 4;throw new BaseError$3("Length is too large.")}class ChainDoesNotSupportContract extends BaseError$3{constructor({blockNumber:o,chain:tt,contract:rt}){super(`Chain "${tt.name}" does not support contract "${rt.name}".`,{metaMessages:["This could be due to any of the following:",...o&&rt.blockCreated&&rt.blockCreated>o?[`- The contract "${rt.name}" was not deployed until block ${rt.blockCreated} (current block ${o}).`]:[`- The chain does not have the contract "${rt.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class ClientChainNotConfiguredError extends BaseError$3{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}class InvalidChainIdError extends BaseError$3{constructor({chainId:o}){super(typeof o=="number"?`Chain ID "${o}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}const etherUnits={gwei:9,wei:18},gweiUnits={ether:-9,wei:9},weiUnits={ether:-18,gwei:-9};function formatUnits(et,o){let tt=et.toString();const rt=tt.startsWith("-");rt&&(tt=tt.slice(1)),tt=tt.padStart(o,"0");let[nt,ot]=[tt.slice(0,tt.length-o),tt.slice(tt.length-o)];return ot=ot.replace(/(0+)$/,""),`${rt?"-":""}${nt||"0"}${ot?`.${ot}`:""}`}function formatGwei(et,o="wei"){return formatUnits(et,gweiUnits[o])}class ExecutionRevertedError extends BaseError$3{constructor({cause:o,message:tt}={}){var nt;const rt=(nt=tt==null?void 0:tt.replace("execution reverted: ",""))==null?void 0:nt.replace("execution reverted","");super(`Execution reverted ${rt?`with reason: ${rt}`:"for an unknown reason"}.`,{cause:o,name:"ExecutionRevertedError"})}}Object.defineProperty(ExecutionRevertedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(ExecutionRevertedError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class FeeCapTooHighError extends BaseError$3{constructor({cause:o,maxFeePerGas:tt}={}){super(`The fee cap (\`maxFeePerGas\`${tt?` = ${formatGwei(tt)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:o,name:"FeeCapTooHighError"})}}Object.defineProperty(FeeCapTooHighError,"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 FeeCapTooLowError extends BaseError$3{constructor({cause:o,maxFeePerGas:tt}={}){super(`The fee cap (\`maxFeePerGas\`${tt?` = ${formatGwei(tt)}`:""} gwei) cannot be lower than the block base fee.`,{cause:o,name:"FeeCapTooLowError"})}}Object.defineProperty(FeeCapTooLowError,"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 NonceTooHighError extends BaseError$3{constructor({cause:o,nonce:tt}={}){super(`Nonce provided for the transaction ${tt?`(${tt}) `:""}is higher than the next one expected.`,{cause:o,name:"NonceTooHighError"})}}Object.defineProperty(NonceTooHighError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class NonceTooLowError extends BaseError$3{constructor({cause:o,nonce:tt}={}){super([`Nonce provided for the transaction ${tt?`(${tt}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
`),{cause:o,name:"NonceTooLowError"})}}Object.defineProperty(NonceTooLowError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class NonceMaxValueError extends BaseError$3{constructor({cause:o,nonce:tt}={}){super(`Nonce provided for the transaction ${tt?`(${tt}) `:""}exceeds the maximum allowed nonce.`,{cause:o,name:"NonceMaxValueError"})}}Object.defineProperty(NonceMaxValueError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class InsufficientFundsError extends BaseError$3{constructor({cause:o}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
`),{cause:o,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(InsufficientFundsError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class IntrinsicGasTooHighError extends BaseError$3{constructor({cause:o,gas:tt}={}){super(`The amount of gas ${tt?`(${tt}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:o,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(IntrinsicGasTooHighError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class IntrinsicGasTooLowError extends BaseError$3{constructor({cause:o,gas:tt}={}){super(`The amount of gas ${tt?`(${tt}) `:""}provided for the transaction is too low.`,{cause:o,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(IntrinsicGasTooLowError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class TransactionTypeNotSupportedError extends BaseError$3{constructor({cause:o}){super("The transaction type is not supported for this chain.",{cause:o,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(TransactionTypeNotSupportedError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class TipAboveFeeCapError extends BaseError$3{constructor({cause:o,maxPriorityFeePerGas:tt,maxFeePerGas:rt}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${tt?` = ${formatGwei(tt)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${rt?` = ${formatGwei(rt)} gwei`:""}).`].join(`
`),{cause:o,name:"TipAboveFeeCapError"})}}Object.defineProperty(TipAboveFeeCapError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class UnknownNodeError extends BaseError$3{constructor({cause:o}){super(`An error occurred while executing: ${o==null?void 0:o.shortMessage}`,{cause:o,name:"UnknownNodeError"})}}function formatEther(et,o="wei"){return formatUnits(et,etherUnits[o])}function prettyPrint(et){const o=Object.entries(et).map(([rt,nt])=>nt===void 0||nt===!1?null:[rt,nt]).filter(Boolean),tt=o.reduce((rt,[nt])=>Math.max(rt,nt.length),0);return o.map(([rt,nt])=>` ${`${rt}:`.padEnd(tt+1)} ${nt}`).join(`
`)}class FeeConflictError extends BaseError$3{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(`
`),{name:"FeeConflictError"})}}class InvalidLegacyVError extends BaseError$3{constructor({v:o}){super(`Invalid \`v\` value "${o}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class InvalidSerializableTransactionError extends BaseError$3{constructor({transaction:o}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",prettyPrint(o),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class InvalidStorageKeySizeError extends BaseError$3{constructor({storageKey:o}){super(`Size for storage key "${o}" is invalid. Expected 32 bytes. Got ${Math.floor((o.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}const stringify$2=(et,o,tt)=>JSON.stringify(et,(rt,nt)=>typeof nt=="bigint"?nt.toString():nt,tt),getContractAddress=et=>et,getUrl=et=>et;class HttpRequestError extends BaseError$3{constructor({body:o,cause:tt,details:rt,headers:nt,status:ot,url:it}){super("HTTP request failed.",{cause:tt,details:rt,metaMessages:[ot&&`Status: ${ot}`,`URL: ${getUrl(it)}`,o&&`Request body: ${stringify$2(o)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=o,this.headers=nt,this.status=ot,this.url=it}}class RpcRequestError extends BaseError$3{constructor({body:o,error:tt,url:rt}){super("RPC Request failed.",{cause:tt,details:tt.message,metaMessages:[`URL: ${getUrl(rt)}`,`Request body: ${stringify$2(o)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=tt.code}}let TimeoutError$4=class extends BaseError$3{constructor({body:o,url:tt}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${getUrl(tt)}`,`Request body: ${stringify$2(o)}`],name:"TimeoutError"})}};const unknownErrorCode=-1;class RpcError extends BaseError$3{constructor(o,{code:tt,docsPath:rt,metaMessages:nt,name:ot,shortMessage:it}){super(it,{cause:o,docsPath:rt,metaMessages:nt||(o==null?void 0:o.metaMessages),name:ot||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=ot||o.name,this.code=o instanceof RpcRequestError?o.code:tt??unknownErrorCode}}class ProviderRpcError extends RpcError{constructor(o,tt){super(o,tt),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=tt.data}}class ParseRpcError extends RpcError{constructor(o){super(o,{code:ParseRpcError.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(ParseRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class InvalidRequestRpcError extends RpcError{constructor(o){super(o,{code:InvalidRequestRpcError.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(InvalidRequestRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class MethodNotFoundRpcError extends RpcError{constructor(o,{method:tt}={}){super(o,{code:MethodNotFoundRpcError.code,name:"MethodNotFoundRpcError",shortMessage:`The method${tt?` "${tt}"`:""} does not exist / is not available.`})}}Object.defineProperty(MethodNotFoundRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class InvalidParamsRpcError extends RpcError{constructor(o){super(o,{code:InvalidParamsRpcError.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
`)})}}Object.defineProperty(InvalidParamsRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class InternalRpcError extends RpcError{constructor(o){super(o,{code:InternalRpcError.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(InternalRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class InvalidInputRpcError extends RpcError{constructor(o){super(o,{code:InvalidInputRpcError.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
`)})}}Object.defineProperty(InvalidInputRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class ResourceNotFoundRpcError extends RpcError{constructor(o){super(o,{code:ResourceNotFoundRpcError.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(ResourceNotFoundRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class ResourceUnavailableRpcError extends RpcError{constructor(o){super(o,{code:ResourceUnavailableRpcError.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(ResourceUnavailableRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class TransactionRejectedRpcError extends RpcError{constructor(o){super(o,{code:TransactionRejectedRpcError.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(TransactionRejectedRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class MethodNotSupportedRpcError extends RpcError{constructor(o,{method:tt}={}){super(o,{code:MethodNotSupportedRpcError.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${tt?` "${tt}"`:""} is not implemented.`})}}Object.defineProperty(MethodNotSupportedRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class LimitExceededRpcError extends RpcError{constructor(o){super(o,{code:LimitExceededRpcError.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(LimitExceededRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class JsonRpcVersionUnsupportedError extends RpcError{constructor(o){super(o,{code:JsonRpcVersionUnsupportedError.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(JsonRpcVersionUnsupportedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class UserRejectedRequestError extends ProviderRpcError{constructor(o){super(o,{code:UserRejectedRequestError.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(UserRejectedRequestError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class UnauthorizedProviderError extends ProviderRpcError{constructor(o){super(o,{code:UnauthorizedProviderError.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(UnauthorizedProviderError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class UnsupportedProviderMethodError extends ProviderRpcError{constructor(o,{method:tt}={}){super(o,{code:UnsupportedProviderMethodError.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${tt?` " ${tt}"`:""}.`})}}Object.defineProperty(UnsupportedProviderMethodError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class ProviderDisconnectedError extends ProviderRpcError{constructor(o){super(o,{code:ProviderDisconnectedError.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(ProviderDisconnectedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class ChainDisconnectedError extends ProviderRpcError{constructor(o){super(o,{code:ChainDisconnectedError.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(ChainDisconnectedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class SwitchChainError extends ProviderRpcError{constructor(o){super(o,{code:SwitchChainError.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(SwitchChainError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class UnknownRpcError extends RpcError{constructor(o){super(o,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}function getNodeError(et,o){const tt=(et.details||"").toLowerCase(),rt=et instanceof BaseError$3?et.walk(nt=>(nt==null?void 0:nt.code)===ExecutionRevertedError.code):et;return rt instanceof BaseError$3?new ExecutionRevertedError({cause:et,message:rt.details}):ExecutionRevertedError.nodeMessage.test(tt)?new ExecutionRevertedError({cause:et,message:et.details}):FeeCapTooHighError.nodeMessage.test(tt)?new FeeCapTooHighError({cause:et,maxFeePerGas:o==null?void 0:o.maxFeePerGas}):FeeCapTooLowError.nodeMessage.test(tt)?new FeeCapTooLowError({cause:et,maxFeePerGas:o==null?void 0:o.maxFeePerGas}):NonceTooHighError.nodeMessage.test(tt)?new NonceTooHighError({cause:et,nonce:o==null?void 0:o.nonce}):NonceTooLowError.nodeMessage.test(tt)?new NonceTooLowError({cause:et,nonce:o==null?void 0:o.nonce}):NonceMaxValueError.nodeMessage.test(tt)?new NonceMaxValueError({cause:et,nonce:o==null?void 0:o.nonce}):InsufficientFundsError.nodeMessage.test(tt)?new InsufficientFundsError({cause:et}):IntrinsicGasTooHighError.nodeMessage.test(tt)?new IntrinsicGasTooHighError({cause:et,gas:o==null?void 0:o.gas}):IntrinsicGasTooLowError.nodeMessage.test(tt)?new IntrinsicGasTooLowError({cause:et,gas:o==null?void 0:o.gas}):TransactionTypeNotSupportedError.nodeMessage.test(tt)?new TransactionTypeNotSupportedError({cause:et}):TipAboveFeeCapError.nodeMessage.test(tt)?new TipAboveFeeCapError({cause:et,maxFeePerGas:o==null?void 0:o.maxFeePerGas,maxPriorityFeePerGas:o==null?void 0:o.maxPriorityFeePerGas}):new UnknownNodeError({cause:et})}function extract$1(et,{format:o}){if(!o)return{};const tt={};function rt(ot){const it=Object.keys(ot);for(const st of it)st in et&&(tt[st]=et[st]),ot[st]&&typeof ot[st]=="object"&&!Array.isArray(ot[st])&&rt(ot[st])}const nt=o(et||{});return rt(nt),tt}function defineFormatter(et,o){return({exclude:tt,format:rt})=>({exclude:tt,format:nt=>{const ot=o(nt);if(tt)for(const it of tt)delete ot[it];return{...ot,...rt(nt)}},type:et})}const rpcTransactionType={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function formatTransactionRequest(et){const o={};return typeof et.authorizationList<"u"&&(o.authorizationList=formatAuthorizationList$1(et.authorizationList)),typeof et.accessList<"u"&&(o.accessList=et.accessList),typeof et.blobVersionedHashes<"u"&&(o.blobVersionedHashes=et.blobVersionedHashes),typeof et.blobs<"u"&&(typeof et.blobs[0]!="string"?o.blobs=et.blobs.map(tt=>bytesToHex$3(tt)):o.blobs=et.blobs),typeof et.data<"u"&&(o.data=et.data),typeof et.from<"u"&&(o.from=et.from),typeof et.gas<"u"&&(o.gas=numberToHex(et.gas)),typeof et.gasPrice<"u"&&(o.gasPrice=numberToHex(et.gasPrice)),typeof et.maxFeePerBlobGas<"u"&&(o.maxFeePerBlobGas=numberToHex(et.maxFeePerBlobGas)),typeof et.maxFeePerGas<"u"&&(o.maxFeePerGas=numberToHex(et.maxFeePerGas)),typeof et.maxPriorityFeePerGas<"u"&&(o.maxPriorityFeePerGas=numberToHex(et.maxPriorityFeePerGas)),typeof et.nonce<"u"&&(o.nonce=numberToHex(et.nonce)),typeof et.to<"u"&&(o.to=et.to),typeof et.type<"u"&&(o.type=rpcTransactionType[et.type]),typeof et.value<"u"&&(o.value=numberToHex(et.value)),o}function formatAuthorizationList$1(et){return et.map(o=>({address:o.contractAddress,r:o.r,s:o.s,chainId:numberToHex(o.chainId),nonce:numberToHex(o.nonce),...typeof o.yParity<"u"?{yParity:numberToHex(o.yParity)}:{},...typeof o.v<"u"&&typeof o.yParity>"u"?{v:numberToHex(o.v)}:{}}))}function getAction$1(et,o,tt){const rt=et[o.name];if(typeof rt=="function")return rt;const nt=et[tt];return typeof nt=="function"?nt:ot=>o(et,ot)}const maxUint256=2n**256n-1n;function assertRequest(et){const{account:o,gasPrice:tt,maxFeePerGas:rt,maxPriorityFeePerGas:nt,to:ot}=et,it=o?parseAccount(o):void 0;if(it&&!isAddress(it.address))throw new InvalidAddressError({address:it.address});if(ot&&!isAddress(ot))throw new InvalidAddressError({address:ot});if(typeof tt<"u"&&(typeof rt<"u"||typeof nt<"u"))throw new FeeConflictError;if(rt&&rt>maxUint256)throw new FeeCapTooHighError({maxFeePerGas:rt});if(nt&&rt&&nt>rt)throw new TipAboveFeeCapError({maxFeePerGas:rt,maxPriorityFeePerGas:nt})}const transactionType={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function formatTransaction(et){const o={...et,blockHash:et.blockHash?et.blockHash:null,blockNumber:et.blockNumber?BigInt(et.blockNumber):null,chainId:et.chainId?hexToNumber$2(et.chainId):void 0,gas:et.gas?BigInt(et.gas):void 0,gasPrice:et.gasPrice?BigInt(et.gasPrice):void 0,maxFeePerBlobGas:et.maxFeePerBlobGas?BigInt(et.maxFeePerBlobGas):void 0,maxFeePerGas:et.maxFeePerGas?BigInt(et.maxFeePerGas):void 0,maxPriorityFeePerGas:et.maxPriorityFeePerGas?BigInt(et.maxPriorityFeePerGas):void 0,nonce:et.nonce?hexToNumber$2(et.nonce):void 0,to:et.to?et.to:null,transactionIndex:et.transactionIndex?Number(et.transactionIndex):null,type:et.type?transactionType[et.type]:void 0,typeHex:et.type?et.type:void 0,value:et.value?BigInt(et.value):void 0,v:et.v?BigInt(et.v):void 0};return et.authorizationList&&(o.authorizationList=formatAuthorizationList(et.authorizationList)),o.yParity=(()=>{if(et.yParity)return Number(et.yParity);if(typeof o.v=="bigint"){if(o.v===0n||o.v===27n)return 0;if(o.v===1n||o.v===28n)return 1;if(o.v>=35n)return o.v%2n===0n?1:0}})(),o.type==="legacy"&&(delete o.accessList,delete o.maxFeePerBlobGas,delete o.maxFeePerGas,delete o.maxPriorityFeePerGas,delete o.yParity),o.type==="eip2930"&&(delete o.maxFeePerBlobGas,delete o.maxFeePerGas,delete o.maxPriorityFeePerGas),o.type==="eip1559"&&delete o.maxFeePerBlobGas,o}const defineTransaction=defineFormatter("transaction",formatTransaction);function formatAuthorizationList(et){return et.map(o=>({contractAddress:o.address,chainId:Number(o.chainId),nonce:Number(o.nonce),r:o.r,s:o.s,yParity:Number(o.yParity)}))}function formatBlock(et){var tt;const o=(tt=et.transactions)==null?void 0:tt.map(rt=>typeof rt=="string"?rt:formatTransaction(rt));return{...et,baseFeePerGas:et.baseFeePerGas?BigInt(et.baseFeePerGas):null,blobGasUsed:et.blobGasUsed?BigInt(et.blobGasUsed):void 0,difficulty:et.difficulty?BigInt(et.difficulty):void 0,excessBlobGas:et.excessBlobGas?BigInt(et.excessBlobGas):void 0,gasLimit:et.gasLimit?BigInt(et.gasLimit):void 0,gasUsed:et.gasUsed?BigInt(et.gasUsed):void 0,hash:et.hash?et.hash:null,logsBloom:et.logsBloom?et.logsBloom:null,nonce:et.nonce?et.nonce:null,number:et.number?BigInt(et.number):null,size:et.size?BigInt(et.size):void 0,timestamp:et.timestamp?BigInt(et.timestamp):void 0,transactions:o,totalDifficulty:et.totalDifficulty?BigInt(et.totalDifficulty):null}}const defineBlock=defineFormatter("block",formatBlock);class AccountStateConflictError extends BaseError$3{constructor({address:o}){super(`State for account "${o}" is set multiple times.`,{name:"AccountStateConflictError"})}}class StateAssignmentConflictError extends BaseError$3{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function prettyStateMapping(et){return et.reduce((o,{slot:tt,value:rt})=>`${o} ${tt}: ${rt}
`,"")}function prettyStateOverride(et){return et.reduce((o,{address:tt,...rt})=>{let nt=`${o} ${tt}:
`;return rt.nonce&&(nt+=` nonce: ${rt.nonce}
`),rt.balance&&(nt+=` balance: ${rt.balance}
`),rt.code&&(nt+=` code: ${rt.code}
`),rt.state&&(nt+=` state:
`,nt+=prettyStateMapping(rt.state)),rt.stateDiff&&(nt+=` stateDiff:
`,nt+=prettyStateMapping(rt.stateDiff)),nt},` State Override:
`).slice(0,-1)}function serializeStateMapping(et){if(!(!et||et.length===0))return et.reduce((o,{slot:tt,value:rt})=>{if(tt.length!==66)throw new InvalidBytesLengthError({size:tt.length,targetSize:66,type:"hex"});if(rt.length!==66)throw new InvalidBytesLengthError({size:rt.length,targetSize:66,type:"hex"});return o[tt]=rt,o},{})}function serializeAccountStateOverride(et){const{balance:o,nonce:tt,state:rt,stateDiff:nt,code:ot}=et,it={};if(ot!==void 0&&(it.code=ot),o!==void 0&&(it.balance=numberToHex(o)),tt!==void 0&&(it.nonce=numberToHex(tt)),rt!==void 0&&(it.state=serializeStateMapping(rt)),nt!==void 0){if(it.state)throw new StateAssignmentConflictError;it.stateDiff=serializeStateMapping(nt)}return it}function serializeStateOverride(et){if(!et)return;const o={};for(const{address:tt,...rt}of et){if(!isAddress(tt,{strict:!1}))throw new InvalidAddressError({address:tt});if(o[tt])throw new AccountStateConflictError({address:tt});o[tt]=serializeAccountStateOverride(rt)}return o}async function getBalance$1(et,{address:o,blockNumber:tt,blockTag:rt="latest"}){const nt=tt?numberToHex(tt):void 0,ot=await et.request({method:"eth_getBalance",params:[o,nt||rt]});return BigInt(ot)}function blobsToCommitments(et){const{kzg:o}=et,tt=et.to??(typeof et.blobs[0]=="string"?"hex":"bytes"),rt=typeof et.blobs[0]=="string"?et.blobs.map(ot=>hexToBytes$3(ot)):et.blobs,nt=[];for(const ot of rt)nt.push(Uint8Array.from(o.blobToKzgCommitment(ot)));return tt==="bytes"?nt:nt.map(ot=>bytesToHex$3(ot))}function blobsToProofs(et){const{kzg:o}=et,tt=et.to??(typeof et.blobs[0]=="string"?"hex":"bytes"),rt=typeof et.blobs[0]=="string"?et.blobs.map(it=>hexToBytes$3(it)):et.blobs,nt=typeof et.commitments[0]=="string"?et.commitments.map(it=>hexToBytes$3(it)):et.commitments,ot=[];for(let it=0;it<rt.length;it++){const st=rt[it],at=nt[it];ot.push(Uint8Array.from(o.computeBlobKzgProof(st,at)))}return tt==="bytes"?ot:ot.map(it=>bytesToHex$3(it))}function setBigUint64$1(et,o,tt,rt){if(typeof et.setBigUint64=="function")return et.setBigUint64(o,tt,rt);const nt=BigInt(32),ot=BigInt(4294967295),it=Number(tt>>nt&ot),st=Number(tt&ot),at=rt?4:0,ct=rt?0:4;et.setUint32(o+at,it,rt),et.setUint32(o+ct,st,rt)}const Chi=(et,o,tt)=>et&o^~et&tt,Maj=(et,o,tt)=>et&o^et&tt^o&tt;class HashMD extends Hash{constructor(o,tt,rt,nt){super(),this.blockLen=o,this.outputLen=tt,this.padOffset=rt,this.isLE=nt,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(o),this.view=createView$1(this.buffer)}update(o){exists$1(this);const{view:tt,buffer:rt,blockLen:nt}=this;o=toBytes$2(o);const ot=o.length;for(let it=0;it<ot;){const st=Math.min(nt-this.pos,ot-it);if(st===nt){const at=createView$1(o);for(;nt<=ot-it;it+=nt)this.process(at,it);continue}rt.set(o.subarray(it,it+st),this.pos),this.pos+=st,it+=st,this.pos===nt&&(this.process(tt,0),this.pos=0)}return this.length+=o.length,this.roundClean(),this}digestInto(o){exists$1(this),output$1(o,this),this.finished=!0;const{buffer:tt,view:rt,blockLen:nt,isLE:ot}=this;let{pos:it}=this;tt[it++]=128,this.buffer.subarray(it).fill(0),this.padOffset>nt-it&&(this.process(rt,0),it=0);for(let dt=it;dt<nt;dt++)tt[dt]=0;setBigUint64$1(rt,nt-8,BigInt(this.length*8),ot),this.process(rt,0);const st=createView$1(o),at=this.outputLen;if(at%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const ct=at/4,lt=this.get();if(ct>lt.length)throw new Error("_sha2: outputLen bigger than state");for(let dt=0;dt<ct;dt++)st.setUint32(4*dt,lt[dt],ot)}digest(){const{buffer:o,outputLen:tt}=this;this.digestInto(o);const rt=o.slice(0,tt);return this.destroy(),rt}_cloneInto(o){o||(o=new this.constructor),o.set(...this.get());const{blockLen:tt,buffer:rt,length:nt,finished:ot,destroyed:it,pos:st}=this;return o.length=nt,o.pos=st,o.finished=ot,o.destroyed=it,nt%tt&&o.buffer.set(rt),o}}const SHA256_K=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),SHA256_IV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),SHA256_W=new Uint32Array(64);class SHA256 extends HashMD{constructor(){super(64,32,8,!1),this.A=SHA256_IV[0]|0,this.B=SHA256_IV[1]|0,this.C=SHA256_IV[2]|0,this.D=SHA256_IV[3]|0,this.E=SHA256_IV[4]|0,this.F=SHA256_IV[5]|0,this.G=SHA256_IV[6]|0,this.H=SHA256_IV[7]|0}get(){const{A:o,B:tt,C:rt,D:nt,E:ot,F:it,G:st,H:at}=this;return[o,tt,rt,nt,ot,it,st,at]}set(o,tt,rt,nt,ot,it,st,at){this.A=o|0,this.B=tt|0,this.C=rt|0,this.D=nt|0,this.E=ot|0,this.F=it|0,this.G=st|0,this.H=at|0}process(o,tt){for(let dt=0;dt<16;dt++,tt+=4)SHA256_W[dt]=o.getUint32(tt,!1);for(let dt=16;dt<64;dt++){const ht=SHA256_W[dt-15],mt=SHA256_W[dt-2],ft=rotr(ht,7)^rotr(ht,18)^ht>>>3,pt=rotr(mt,17)^rotr(mt,19)^mt>>>10;SHA256_W[dt]=pt+SHA256_W[dt-7]+ft+SHA256_W[dt-16]|0}let{A:rt,B:nt,C:ot,D:it,E:st,F:at,G:ct,H:lt}=this;for(let dt=0;dt<64;dt++){const ht=rotr(st,6)^rotr(st,11)^rotr(st,25),mt=lt+ht+Chi(st,at,ct)+SHA256_K[dt]+SHA256_W[dt]|0,pt=(rotr(rt,2)^rotr(rt,13)^rotr(rt,22))+Maj(rt,nt,ot)|0;lt=ct,ct=at,at=st,st=it+mt|0,it=ot,ot=nt,nt=rt,rt=mt+pt|0}rt=rt+this.A|0,nt=nt+this.B|0,ot=ot+this.C|0,it=it+this.D|0,st=st+this.E|0,at=at+this.F|0,ct=ct+this.G|0,lt=lt+this.H|0,this.set(rt,nt,ot,it,st,at,ct,lt)}roundClean(){SHA256_W.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const sha256$3=wrapConstructor(()=>new SHA256);function sha256$2(et,o){return sha256$3(isHex(et,{strict:!1})?toBytes$3(et):et)}function commitmentToVersionedHash(et){const{commitment:o,version:tt=1}=et,rt=et.to??(typeof o=="string"?"hex":"bytes"),nt=sha256$2(o);return nt.set([tt],0),rt==="bytes"?nt:bytesToHex$3(nt)}function commitmentsToVersionedHashes(et){const{commitments:o,version:tt}=et,rt=et.to??(typeof o[0]=="string"?"hex":"bytes"),nt=[];for(const ot of o)nt.push(commitmentToVersionedHash({commitment:ot,to:rt,version:tt}));return nt}const blobsPerTransaction=6,bytesPerFieldElement=32,fieldElementsPerBlob=4096,bytesPerBlob=bytesPerFieldElement*fieldElementsPerBlob,maxBytesPerTransaction=bytesPerBlob*blobsPerTransaction-1-1*fieldElementsPerBlob*blobsPerTransaction,versionedHashVersionKzg=1;class BlobSizeTooLargeError extends BaseError$3{constructor({maxSize:o,size:tt}){super("Blob size is too large.",{metaMessages:[`Max: ${o} bytes`,`Given: ${tt} bytes`],name:"BlobSizeTooLargeError"})}}class EmptyBlobError extends BaseError$3{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class InvalidVersionedHashSizeError extends BaseError$3{constructor({hash:o,size:tt}){super(`Versioned hash "${o}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${tt}`],name:"InvalidVersionedHashSizeError"})}}class InvalidVersionedHashVersionError extends BaseError$3{constructor({hash:o,version:tt}){super(`Versioned hash "${o}" version is invalid.`,{metaMessages:[`Expected: ${versionedHashVersionKzg}`,`Received: ${tt}`],name:"InvalidVersionedHashVersionError"})}}function toBlobs(et){const o=et.to??(typeof et.data=="string"?"hex":"bytes"),tt=typeof et.data=="string"?hexToBytes$3(et.data):et.data,rt=size$2(tt);if(!rt)throw new EmptyBlobError;if(rt>maxBytesPerTransaction)throw new BlobSizeTooLargeError({maxSize:maxBytesPerTransaction,size:rt});const nt=[];let ot=!0,it=0;for(;ot;){const st=createCursor(new Uint8Array(bytesPerBlob));let at=0;for(;at<fieldElementsPerBlob;){const ct=tt.slice(it,it+(bytesPerFieldElement-1));if(st.pushByte(0),st.pushBytes(ct),ct.length<31){st.pushByte(128),ot=!1;break}at++,it+=31}nt.push(st)}return o==="bytes"?nt.map(st=>st.bytes):nt.map(st=>bytesToHex$3(st.bytes))}function toBlobSidecars(et){const{data:o,kzg:tt,to:rt}=et,nt=et.blobs??toBlobs({data:o,to:rt}),ot=et.commitments??blobsToCommitments({blobs:nt,kzg:tt,to:rt}),it=et.proofs??blobsToProofs({blobs:nt,commitments:ot,kzg:tt,to:rt}),st=[];for(let at=0;at<nt.length;at++)st.push({blob:nt[at],commitment:ot[at],proof:it[at]});return st}function getTransactionType(et){if(et.type)return et.type;if(typeof et.authorizationList<"u")return"eip7702";if(typeof et.blobs<"u"||typeof et.blobVersionedHashes<"u"||typeof et.maxFeePerBlobGas<"u"||typeof et.sidecars<"u")return"eip4844";if(typeof et.maxFeePerGas<"u"||typeof et.maxPriorityFeePerGas<"u")return"eip1559";if(typeof et.gasPrice<"u")return typeof et.accessList<"u"?"eip2930":"legacy";throw new InvalidSerializableTransactionError({transaction:et})}const multicall3Abi=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],universalResolverErrors=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}],universalResolverResolveAbi=[...universalResolverErrors,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],universalResolverReverseAbi=[...universalResolverErrors,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],textResolverAbi=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],addressResolverAbi=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}];function bytesToBigInt(et,o={}){typeof o.size<"u"&&assertSize(et,{size:o.size});const tt=bytesToHex$3(et,o);return hexToBigInt(tt,o)}function bytesToBool(et,o={}){let tt=et;if(typeof o.size<"u"&&(assertSize(tt,{size:o.size}),tt=trim$1(tt)),tt.length>1||tt[0]>1)throw new InvalidBytesBooleanError(tt);return!!tt[0]}function bytesToNumber$1(et,o={}){typeof o.size<"u"&&assertSize(et,{size:o.size});const tt=bytesToHex$3(et,o);return hexToNumber$2(tt,o)}function bytesToString(et,o={}){let tt=et;return typeof o.size<"u"&&(assertSize(tt,{size:o.size}),tt=trim$1(tt,{dir:"right"})),new TextDecoder().decode(tt)}function decodeAbiParameters(et,o){const tt=typeof o=="string"?hexToBytes$3(o):o,rt=createCursor(tt);if(size$2(tt)===0&&et.length>0)throw new AbiDecodingZeroDataError;if(size$2(o)&&size$2(o)<32)throw new AbiDecodingDataSizeTooSmallError({data:typeof o=="string"?o:bytesToHex$3(o),params:et,size:size$2(o)});let nt=0;const ot=[];for(let it=0;it<et.length;++it){const st=et[it];rt.setPosition(nt);const[at,ct]=decodeParameter(rt,st,{staticPosition:0});nt+=ct,ot.push(at)}return ot}function decodeParameter(et,o,{staticPosition:tt}){const rt=getArrayComponents(o.type);if(rt){const[nt,ot]=rt;return decodeArray(et,{...o,type:ot},{length:nt,staticPosition:tt})}if(o.type==="tuple")return decodeTuple(et,o,{staticPosition:tt});if(o.type==="address")return decodeAddress(et);if(o.type==="bool")return decodeBool(et);if(o.type.startsWith("bytes"))return decodeBytes(et,o,{staticPosition:tt});if(o.type.startsWith("uint")||o.type.startsWith("int"))return decodeNumber(et,o);if(o.type==="string")return decodeString$1(et,{staticPosition:tt});throw new InvalidAbiDecodingTypeError(o.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const sizeOfLength=32,sizeOfOffset=32;function decodeAddress(et){const o=et.readBytes(32);return[checksumAddress(bytesToHex$3(sliceBytes(o,-20))),32]}function decodeArray(et,o,{length:tt,staticPosition:rt}){if(!tt){const it=bytesToNumber$1(et.readBytes(sizeOfOffset)),st=rt+it,at=st+sizeOfLength;et.setPosition(st);const ct=bytesToNumber$1(et.readBytes(sizeOfLength)),lt=hasDynamicChild(o);let dt=0;const ht=[];for(let mt=0;mt<ct;++mt){et.setPosition(at+(lt?mt*32:dt));const[ft,pt]=decodeParameter(et,o,{staticPosition:at});dt+=pt,ht.push(ft)}return et.setPosition(rt+32),[ht,32]}if(hasDynamicChild(o)){const it=bytesToNumber$1(et.readBytes(sizeOfOffset)),st=rt+it,at=[];for(let ct=0;ct<tt;++ct){et.setPosition(st+ct*32);const[lt]=decodeParameter(et,o,{staticPosition:st});at.push(lt)}return et.setPosition(rt+32),[at,32]}let nt=0;const ot=[];for(let it=0;it<tt;++it){const[st,at]=decodeParameter(et,o,{staticPosition:rt+nt});nt+=at,ot.push(st)}return[ot,nt]}function decodeBool(et){return[bytesToBool(et.readBytes(32),{size:32}),32]}function decodeBytes(et,o,{staticPosition:tt}){const[rt,nt]=o.type.split("bytes");if(!nt){const it=bytesToNumber$1(et.readBytes(32));et.setPosition(tt+it);const st=bytesToNumber$1(et.readBytes(32));if(st===0)return et.setPosition(tt+32),["0x",32];const at=et.readBytes(st);return et.setPosition(tt+32),[bytesToHex$3(at),32]}return[bytesToHex$3(et.readBytes(Number.parseInt(nt),32)),32]}function decodeNumber(et,o){const tt=o.type.startsWith("int"),rt=Number.parseInt(o.type.split("int")[1]||"256"),nt=et.readBytes(32);return[rt>48?bytesToBigInt(nt,{signed:tt}):bytesToNumber$1(nt,{signed:tt}),32]}function decodeTuple(et,o,{staticPosition:tt}){const rt=o.components.length===0||o.components.some(({name:it})=>!it),nt=rt?[]:{};let ot=0;if(hasDynamicChild(o)){const it=bytesToNumber$1(et.readBytes(sizeOfOffset)),st=tt+it;for(let at=0;at<o.components.length;++at){const ct=o.components[at];et.setPosition(st+ot);const[lt,dt]=decodeParameter(et,ct,{staticPosition:st});ot+=dt,nt[rt?at:ct==null?void 0:ct.name]=lt}return et.setPosition(tt+32),[nt,32]}for(let it=0;it<o.components.length;++it){const st=o.components[it],[at,ct]=decodeParameter(et,st,{staticPosition:tt});nt[rt?it:st==null?void 0:st.name]=at,ot+=ct}return[nt,ot]}function decodeString$1(et,{staticPosition:o}){const tt=bytesToNumber$1(et.readBytes(32)),rt=o+tt;et.setPosition(rt);const nt=bytesToNumber$1(et.readBytes(32));if(nt===0)return et.setPosition(o+32),["",32];const ot=et.readBytes(nt,32),it=bytesToString(trim$1(ot));return et.setPosition(o+32),[it,32]}function hasDynamicChild(et){var rt;const{type:o}=et;if(o==="string"||o==="bytes"||o.endsWith("[]"))return!0;if(o==="tuple")return(rt=et.components)==null?void 0:rt.some(hasDynamicChild);const tt=getArrayComponents(et.type);return!!(tt&&hasDynamicChild({...et,type:tt[1]}))}const hash=et=>keccak256$1(toBytes$3(et));function hashSignature(et){return hash(et)}const version$7="1.0.6";let BaseError$2=class Rs extends Error{constructor(o,tt={}){var it;const rt=tt.cause instanceof Rs?tt.cause.details:(it=tt.cause)!=null&&it.message?tt.cause.message:tt.details,nt=tt.cause instanceof Rs&&tt.cause.docsPath||tt.docsPath,ot=[o||"An error occurred.","",...tt.metaMessages?[...tt.metaMessages,""]:[],...nt?[`Docs: https://abitype.dev${nt}`]:[],...rt?[`Details: ${rt}`]:[],`Version: abitype@${version$7}`].join(`
`);super(ot),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),tt.cause&&(this.cause=tt.cause),this.details=rt,this.docsPath=nt,this.metaMessages=tt.metaMessages,this.shortMessage=o}};function execTyped(et,o){const tt=et.exec(o);return tt==null?void 0:tt.groups}const bytesRegex=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,integerRegex=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,isTupleRegex=/^\(.+?\).*?$/,tupleRegex=/^tuple(?<array>(\[(\d*)\])*)$/;function formatAbiParameter(et){let o=et.type;if(tupleRegex.test(et.type)&&"components"in et){o="(";const tt=et.components.length;for(let nt=0;nt<tt;nt++){const ot=et.components[nt];o+=formatAbiParameter(ot),nt<tt-1&&(o+=", ")}const rt=execTyped(tupleRegex,et.type);return o+=`)${(rt==null?void 0:rt.array)??""}`,formatAbiParameter({...et,type:o})}return"indexed"in et&&et.indexed&&(o=`${o} indexed`),et.name?`${o} ${et.name}`:o}function formatAbiParameters(et){let o="";const tt=et.length;for(let rt=0;rt<tt;rt++){const nt=et[rt];o+=formatAbiParameter(nt),rt!==tt-1&&(o+=", ")}return o}function formatAbiItem(et){return et.type==="function"?`function ${et.name}(${formatAbiParameters(et.inputs)})${et.stateMutability&&et.stateMutability!=="nonpayable"?` ${et.stateMutability}`:""}${et.outputs.length?` returns (${formatAbiParameters(et.outputs)})`:""}`:et.type==="event"?`event ${et.name}(${formatAbiParameters(et.inputs)})`:et.type==="error"?`error ${et.name}(${formatAbiParameters(et.inputs)})`:et.type==="constructor"?`constructor(${formatAbiParameters(et.inputs)})${et.stateMutability==="payable"?" payable":""}`:et.type==="fallback"?"fallback()":"receive() external payable"}const errorSignatureRegex=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function isErrorSignature(et){return errorSignatureRegex.test(et)}function execErrorSignature(et){return execTyped(errorSignatureRegex,et)}const eventSignatureRegex=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function isEventSignature(et){return eventSignatureRegex.test(et)}function execEventSignature(et){return execTyped(eventSignatureRegex,et)}const functionSignatureRegex=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function isFunctionSignature(et){return functionSignatureRegex.test(et)}function execFunctionSignature(et){return execTyped(functionSignatureRegex,et)}const structSignatureRegex=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function isStructSignature(et){return structSignatureRegex.test(et)}function execStructSignature(et){return execTyped(structSignatureRegex,et)}const constructorSignatureRegex=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function isConstructorSignature(et){return constructorSignatureRegex.test(et)}function execConstructorSignature(et){return execTyped(constructorSignatureRegex,et)}const fallbackSignatureRegex=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function isFallbackSignature(et){return fallbackSignatureRegex.test(et)}const receiveSignatureRegex=/^receive\(\) external payable$/;function isReceiveSignature(et){return receiveSignatureRegex.test(et)}const eventModifiers=new Set(["indexed"]),functionModifiers=new Set(["calldata","memory","storage"]);class UnknownTypeError extends BaseError$2{constructor({type:o}){super("Unknown type.",{metaMessages:[`Type "${o}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class UnknownSolidityTypeError extends BaseError$2{constructor({type:o}){super("Unknown type.",{metaMessages:[`Type "${o}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class InvalidParameterError extends BaseError$2{constructor({param:o}){super("Invalid ABI parameter.",{details:o}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class SolidityProtectedKeywordError extends BaseError$2{constructor({param:o,name:tt}){super("Invalid ABI parameter.",{details:o,metaMessages:[`"${tt}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class InvalidModifierError extends BaseError$2{constructor({param:o,type:tt,modifier:rt}){super("Invalid ABI parameter.",{details:o,metaMessages:[`Modifier "${rt}" not allowed${tt?` in "${tt}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class InvalidFunctionModifierError extends BaseError$2{constructor({param:o,type:tt,modifier:rt}){super("Invalid ABI parameter.",{details:o,metaMessages:[`Modifier "${rt}" not allowed${tt?` in "${tt}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${rt}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class InvalidAbiTypeParameterError extends BaseError$2{constructor({abiParameter:o}){super("Invalid ABI parameter.",{details:JSON.stringify(o,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}let InvalidSignatureError$1=class extends BaseError$2{constructor({signature:o,type:tt}){super(`Invalid ${tt} signature.`,{details:o}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}};class UnknownSignatureError extends BaseError$2{constructor({signature:o}){super("Unknown signature.",{details:o}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class InvalidStructSignatureError extends BaseError$2{constructor({signature:o}){super("Invalid struct signature.",{details:o,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class CircularReferenceError extends BaseError$2{constructor({type:o}){super("Circular reference detected.",{metaMessages:[`Struct "${o}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class InvalidParenthesisError extends BaseError$2{constructor({current:o,depth:tt}){super("Unbalanced parentheses.",{metaMessages:[`"${o.trim()}" has too many ${tt>0?"opening":"closing"} parentheses.`],details:`Depth "${tt}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function getParameterCacheKey(et,o){return o?`${o}:${et}`:et}const parameterCache=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function parseSignature(et,o={}){if(isFunctionSignature(et)){const tt=execFunctionSignature(et);if(!tt)throw new InvalidSignatureError$1({signature:et,type:"function"});const rt=splitParameters(tt.parameters),nt=[],ot=rt.length;for(let st=0;st<ot;st++)nt.push(parseAbiParameter(rt[st],{modifiers:functionModifiers,structs:o,type:"function"}));const it=[];if(tt.returns){const st=splitParameters(tt.returns),at=st.length;for(let ct=0;ct<at;ct++)it.push(parseAbiParameter(st[ct],{modifiers:functionModifiers,structs:o,type:"function"}))}return{name:tt.name,type:"function",stateMutability:tt.stateMutability??"nonpayable",inputs:nt,outputs:it}}if(isEventSignature(et)){const tt=execEventSignature(et);if(!tt)throw new InvalidSignatureError$1({signature:et,type:"event"});const rt=splitParameters(tt.parameters),nt=[],ot=rt.length;for(let it=0;it<ot;it++)nt.push(parseAbiParameter(rt[it],{modifiers:eventModifiers,structs:o,type:"event"}));return{name:tt.name,type:"event",inputs:nt}}if(isErrorSignature(et)){const tt=execErrorSignature(et);if(!tt)throw new InvalidSignatureError$1({signature:et,type:"error"});const rt=splitParameters(tt.parameters),nt=[],ot=rt.length;for(let it=0;it<ot;it++)nt.push(parseAbiParameter(rt[it],{structs:o,type:"error"}));return{name:tt.name,type:"error",inputs:nt}}if(isConstructorSignature(et)){const tt=execConstructorSignature(et);if(!tt)throw new InvalidSignatureError$1({signature:et,type:"constructor"});const rt=splitParameters(tt.parameters),nt=[],ot=rt.length;for(let it=0;it<ot;it++)nt.push(parseAbiParameter(rt[it],{structs:o,type:"constructor"}));return{type:"constructor",stateMutability:tt.stateMutability??"nonpayable",inputs:nt}}if(isFallbackSignature(et))return{type:"fallback"};if(isReceiveSignature(et))return{type:"receive",stateMutability:"payable"};throw new UnknownSignatureError({signature:et})}const abiParameterWithoutTupleRegex=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,abiParameterWithTupleRegex=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,dynamicIntegerRegex=/^u?int$/;function parseAbiParameter(et,o){var dt,ht;const tt=getParameterCacheKey(et,o==null?void 0:o.type);if(parameterCache.has(tt))return parameterCache.get(tt);const rt=isTupleRegex.test(et),nt=execTyped(rt?abiParameterWithTupleRegex:abiParameterWithoutTupleRegex,et);if(!nt)throw new InvalidParameterError({param:et});if(nt.name&&isSolidityKeyword(nt.name))throw new SolidityProtectedKeywordError({param:et,name:nt.name});const ot=nt.name?{name:nt.name}:{},it=nt.modifier==="indexed"?{indexed:!0}:{},st=(o==null?void 0:o.structs)??{};let at,ct={};if(rt){at="tuple";const mt=splitParameters(nt.type),ft=[],pt=mt.length;for(let yt=0;yt<pt;yt++)ft.push(parseAbiParameter(mt[yt],{structs:st}));ct={components:ft}}else if(nt.type in st)at="tuple",ct={components:st[nt.type]};else if(dynamicIntegerRegex.test(nt.type))at=`${nt.type}256`;else if(at=nt.type,(o==null?void 0:o.type)!=="struct"&&!isSolidityType(at))throw new UnknownSolidityTypeError({type:at});if(nt.modifier){if(!((ht=(dt=o==null?void 0:o.modifiers)==null?void 0:dt.has)!=null&&ht.call(dt,nt.modifier)))throw new InvalidModifierError({param:et,type:o==null?void 0:o.type,modifier:nt.modifier});if(functionModifiers.has(nt.modifier)&&!isValidDataLocation(at,!!nt.array))throw new InvalidFunctionModifierError({param:et,type:o==null?void 0:o.type,modifier:nt.modifier})}const lt={type:`${at}${nt.array??""}`,...ot,...it,...ct};return parameterCache.set(tt,lt),lt}function splitParameters(et,o=[],tt="",rt=0){const nt=et.trim().length;for(let ot=0;ot<nt;ot++){const it=et[ot],st=et.slice(ot+1);switch(it){case",":return rt===0?splitParameters(st,[...o,tt.trim()]):splitParameters(st,o,`${tt}${it}`,rt);case"(":return splitParameters(st,o,`${tt}${it}`,rt+1);case")":return splitParameters(st,o,`${tt}${it}`,rt-1);default:return splitParameters(st,o,`${tt}${it}`,rt)}}if(tt==="")return o;if(rt!==0)throw new InvalidParenthesisError({current:tt,depth:rt});return o.push(tt.trim()),o}function isSolidityType(et){return et==="address"||et==="bool"||et==="function"||et==="string"||bytesRegex.test(et)||integerRegex.test(et)}const protectedKeywordsRegex=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function isSolidityKeyword(et){return et==="address"||et==="bool"||et==="function"||et==="string"||et==="tuple"||bytesRegex.test(et)||integerRegex.test(et)||protectedKeywordsRegex.test(et)}function isValidDataLocation(et,o){return o||et==="bytes"||et==="string"||et==="tuple"}function parseStructs(et){const o={},tt=et.length;for(let it=0;it<tt;it++){const st=et[it];if(!isStructSignature(st))continue;const at=execStructSignature(st);if(!at)throw new InvalidSignatureError$1({signature:st,type:"struct"});const ct=at.properties.split(";"),lt=[],dt=ct.length;for(let ht=0;ht<dt;ht++){const ft=ct[ht].trim();if(!ft)continue;const pt=parseAbiParameter(ft,{type:"struct"});lt.push(pt)}if(!lt.length)throw new InvalidStructSignatureError({signature:st});o[at.name]=lt}const rt={},nt=Object.entries(o),ot=nt.length;for(let it=0;it<ot;it++){const[st,at]=nt[it];rt[st]=resolveStructs(at,o)}return rt}const typeWithoutTupleRegex=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function resolveStructs(et,o,tt=new Set){const rt=[],nt=et.length;for(let ot=0;ot<nt;ot++){const it=et[ot];if(isTupleRegex.test(it.type))rt.push(it);else{const at=execTyped(typeWithoutTupleRegex,it.type);if(!(at!=null&&at.type))throw new InvalidAbiTypeParameterError({abiParameter:it});const{array:ct,type:lt}=at;if(lt in o){if(tt.has(lt))throw new CircularReferenceError({type:lt});rt.push({...it,type:`tuple${ct??""}`,components:resolveStructs(o[lt]??[],o,new Set([...tt,lt]))})}else if(isSolidityType(lt))rt.push(it);else throw new UnknownTypeError({type:lt})}}return rt}function parseAbi(et){const o=parseStructs(et),tt=[],rt=et.length;for(let nt=0;nt<rt;nt++){const ot=et[nt];isStructSignature(ot)||tt.push(parseSignature(ot,o))}return tt}function normalizeSignature$1(et){let o=!0,tt="",rt=0,nt="",ot=!1;for(let it=0;it<et.length;it++){const st=et[it];if(["(",")",","].includes(st)&&(o=!0),st==="("&&rt++,st===")"&&rt--,!!o){if(rt===0){if(st===" "&&["event","function",""].includes(nt))nt="";else if(nt+=st,st===")"){ot=!0;break}continue}if(st===" "){et[it-1]!==","&&tt!==","&&tt!==",("&&(tt="",o=!1);continue}nt+=st,tt+=st}}if(!ot)throw new BaseError$3("Unable to normalize signature.");return nt}const toSignature=et=>{const o=typeof et=="string"?et:formatAbiItem(et);return normalizeSignature$1(o)};function toSignatureHash(et){return hashSignature(toSignature(et))}const toEventSelector=toSignatureHash,toFunctionSelector=et=>slice(toSignatureHash(et),0,4);function getAbiItem(et){const{abi:o,args:tt=[],name:rt}=et,nt=isHex(rt,{strict:!1}),ot=o.filter(st=>nt?st.type==="function"?toFunctionSelector(st)===rt:st.type==="event"?toEventSelector(st)===rt:!1:"name"in st&&st.name===rt);if(ot.length===0)return;if(ot.length===1)return ot[0];let it;for(const st of ot){if(!("inputs"in st))continue;if(!tt||tt.length===0){if(!st.inputs||st.inputs.length===0)return st;continue}if(!st.inputs||st.inputs.length===0||st.inputs.length!==tt.length)continue;if(tt.every((ct,lt)=>{const dt="inputs"in st&&st.inputs[lt];return dt?isArgOfType(ct,dt):!1})){if(it&&"inputs"in it&&it.inputs){const ct=getAmbiguousTypes(st.inputs,it.inputs,tt);if(ct)throw new AbiItemAmbiguityError({abiItem:st,type:ct[0]},{abiItem:it,type:ct[1]})}it=st}}return it||ot[0]}function isArgOfType(et,o){const tt=typeof et,rt=o.type;switch(rt){case"address":return isAddress(et,{strict:!1});case"bool":return tt==="boolean";case"function":return tt==="string";case"string":return tt==="string";default:return rt==="tuple"&&"components"in o?Object.values(o.components).every((nt,ot)=>isArgOfType(Object.values(et)[ot],nt)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(rt)?tt==="number"||tt==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(rt)?tt==="string"||et instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(rt)?Array.isArray(et)&&et.every(nt=>isArgOfType(nt,{...o,type:rt.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function getAmbiguousTypes(et,o,tt){for(const rt in et){const nt=et[rt],ot=o[rt];if(nt.type==="tuple"&&ot.type==="tuple"&&"components"in nt&&"components"in ot)return getAmbiguousTypes(nt.components,ot.components,tt[rt]);const it=[nt.type,ot.type];if(it.includes("address")&&it.includes("bytes20")?!0:it.includes("address")&&it.includes("string")?isAddress(tt[rt],{strict:!1}):it.includes("address")&&it.includes("bytes")?isAddress(tt[rt],{strict:!1}):!1)return it}}const docsPath$1="/docs/contract/decodeFunctionResult";function decodeFunctionResult(et){const{abi:o,args:tt,functionName:rt,data:nt}=et;let ot=o[0];if(rt){const st=getAbiItem({abi:o,args:tt,name:rt});if(!st)throw new AbiFunctionNotFoundError(rt,{docsPath:docsPath$1});ot=st}if(ot.type!=="function")throw new AbiFunctionNotFoundError(void 0,{docsPath:docsPath$1});if(!ot.outputs)throw new AbiFunctionOutputsNotFoundError(ot.name,{docsPath:docsPath$1});const it=decodeAbiParameters(ot.outputs,nt);if(it&&it.length>1)return it;if(it&&it.length===1)return it[0]}const docsPath="/docs/contract/encodeFunctionData";function prepareEncodeFunctionData(et){const{abi:o,args:tt,functionName:rt}=et;let nt=o[0];if(rt){const ot=getAbiItem({abi:o,args:tt,name:rt});if(!ot)throw new AbiFunctionNotFoundError(rt,{docsPath});nt=ot}if(nt.type!=="function")throw new AbiFunctionNotFoundError(void 0,{docsPath});return{abi:[nt],functionName:toFunctionSelector(formatAbiItem$1(nt))}}function encodeFunctionData(et){const{args:o}=et,{abi:tt,functionName:rt}=(()=>{var st;return et.abi.length===1&&((st=et.functionName)!=null&&st.startsWith("0x"))?et:prepareEncodeFunctionData(et)})(),nt=tt[0],ot=rt,it="inputs"in nt&&nt.inputs?encodeAbiParameters(nt.inputs,o??[]):void 0;return concatHex([ot,it??"0x"])}function getChainContractAddress({blockNumber:et,chain:o,contract:tt}){var nt;const rt=(nt=o==null?void 0:o.contracts)==null?void 0:nt[tt];if(!rt)throw new ChainDoesNotSupportContract({chain:o,contract:{name:tt}});if(et&&rt.blockCreated&&rt.blockCreated>et)throw new ChainDoesNotSupportContract({blockNumber:et,chain:o,contract:{name:tt,blockCreated:rt.blockCreated}});return rt.address}const panicReasons={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},solidityError={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},solidityPanic={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function decodeErrorResult(et){const{abi:o,data:tt}=et,rt=slice(tt,0,4);if(rt==="0x")throw new AbiDecodingZeroDataError;const ot=[...o||[],solidityError,solidityPanic].find(it=>it.type==="error"&&rt===toFunctionSelector(formatAbiItem$1(it)));if(!ot)throw new AbiErrorSignatureNotFoundError(rt,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:ot,args:"inputs"in ot&&ot.inputs&&ot.inputs.length>0?decodeAbiParameters(ot.inputs,slice(tt,4)):void 0,errorName:ot.name}}function formatAbiItemWithArgs({abiItem:et,args:o,includeFunctionName:tt=!0,includeName:rt=!1}){if("name"in et&&"inputs"in et&&et.inputs)return`${tt?et.name:""}(${et.inputs.map((nt,ot)=>`${rt&&nt.name?`${nt.name}: `:""}${typeof o[ot]=="object"?stringify$2(o[ot]):o[ot]}`).join(", ")})`}class CallExecutionError extends BaseError$3{constructor(o,{account:tt,docsPath:rt,chain:nt,data:ot,gas:it,gasPrice:st,maxFeePerGas:at,maxPriorityFeePerGas:ct,nonce:lt,to:dt,value:ht,stateOverride:mt}){var yt;const ft=tt?parseAccount(tt):void 0;let pt=prettyPrint({from:ft==null?void 0:ft.address,to:dt,value:typeof ht<"u"&&`${formatEther(ht)} ${((yt=nt==null?void 0:nt.nativeCurrency)==null?void 0:yt.symbol)||"ETH"}`,data:ot,gas:it,gasPrice:typeof st<"u"&&`${formatGwei(st)} gwei`,maxFeePerGas:typeof at<"u"&&`${formatGwei(at)} gwei`,maxPriorityFeePerGas:typeof ct<"u"&&`${formatGwei(ct)} gwei`,nonce:lt});mt&&(pt+=`
${prettyStateOverride(mt)}`),super(o.shortMessage,{cause:o,docsPath:rt,metaMessages:[...o.metaMessages?[...o.metaMessages," "]:[],"Raw Call Arguments:",pt].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=o}}class ContractFunctionExecutionError extends BaseError$3{constructor(o,{abi:tt,args:rt,contractAddress:nt,docsPath:ot,functionName:it,sender:st}){const at=getAbiItem({abi:tt,args:rt,name:it}),ct=at?formatAbiItemWithArgs({abiItem:at,args:rt,includeFunctionName:!1,includeName:!1}):void 0,lt=at?formatAbiItem$1(at,{includeName:!0}):void 0,dt=prettyPrint({address:nt&&getContractAddress(nt),function:lt,args:ct&&ct!=="()"&&`${[...Array((it==null?void 0:it.length)??0).keys()].map(()=>" ").join("")}${ct}`,sender:st});super(o.shortMessage||`An unknown error occurred while executing the contract function "${it}".`,{cause:o,docsPath:ot,metaMessages:[...o.metaMessages?[...o.metaMessages," "]:[],dt&&"Contract Call:",dt].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=tt,this.args=rt,this.cause=o,this.contractAddress=nt,this.functionName=it,this.sender=st}}class ContractFunctionRevertedError extends BaseError$3{constructor({abi:o,data:tt,functionName:rt,message:nt}){let ot,it,st,at;if(tt&&tt!=="0x")try{it=decodeErrorResult({abi:o,data:tt});const{abiItem:lt,errorName:dt,args:ht}=it;if(dt==="Error")at=ht[0];else if(dt==="Panic"){const[mt]=ht;at=panicReasons[mt]}else{const mt=lt?formatAbiItem$1(lt,{includeName:!0}):void 0,ft=lt&&ht?formatAbiItemWithArgs({abiItem:lt,args:ht,includeFunctionName:!1,includeName:!1}):void 0;st=[mt?`Error: ${mt}`:"",ft&&ft!=="()"?` ${[...Array((dt==null?void 0:dt.length)??0).keys()].map(()=>" ").join("")}${ft}`:""]}}catch(lt){ot=lt}else nt&&(at=nt);let ct;ot instanceof AbiErrorSignatureNotFoundError&&(ct=ot.signature,st=[`Unable to decode signature "${ct}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${ct}.`]),super(at&&at!=="execution reverted"||ct?[`The contract function "${rt}" reverted with the following ${ct?"signature":"reason"}:`,at||ct].join(`
`):`The contract function "${rt}" reverted.`,{cause:ot,metaMessages:st,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=it,this.reason=at,this.signature=ct}}class ContractFunctionZeroDataError extends BaseError$3{constructor({functionName:o}){super(`The contract function "${o}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${o}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}class CounterfactualDeploymentFailedError extends BaseError$3{constructor({factory:o}){super(`Deployment for counterfactual contract call failed${o?` for factory "${o}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class RawContractError extends BaseError$3{constructor({data:o,message:tt}){super(tt||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=o}}function isNullUniversalResolverError(et,o){var rt,nt,ot,it,st,at;if(!(et instanceof BaseError$3))return!1;const tt=et.walk(ct=>ct instanceof ContractFunctionRevertedError);return tt instanceof ContractFunctionRevertedError?!!(((rt=tt.data)==null?void 0:rt.errorName)==="ResolverNotFound"||((nt=tt.data)==null?void 0:nt.errorName)==="ResolverWildcardNotSupported"||((ot=tt.data)==null?void 0:ot.errorName)==="ResolverNotContract"||((it=tt.data)==null?void 0:it.errorName)==="ResolverError"||((st=tt.data)==null?void 0:st.errorName)==="HttpError"||(at=tt.reason)!=null&&at.includes("Wildcard on non-extended resolvers is not supported")||o==="reverse"&&tt.reason===panicReasons[50]):!1}function encodedLabelToLabelhash(et){if(et.length!==66||et.indexOf("[")!==0||et.indexOf("]")!==65)return null;const o=`0x${et.slice(1,65)}`;return isHex(o)?o:null}function namehash(et){let o=new Uint8Array(32).fill(0);if(!et)return bytesToHex$3(o);const tt=et.split(".");for(let rt=tt.length-1;rt>=0;rt-=1){const nt=encodedLabelToLabelhash(tt[rt]),ot=nt?toBytes$3(nt):keccak256$1(stringToBytes(tt[rt]),"bytes");o=keccak256$1(concat$6([o,ot]),"bytes")}return bytesToHex$3(o)}function encodeLabelhash(et){return`[${et.slice(2)}]`}function labelhash(et){const o=new Uint8Array(32).fill(0);return et?encodedLabelToLabelhash(et)||keccak256$1(stringToBytes(et)):bytesToHex$3(o)}function packetToBytes(et){const o=et.replace(/^\.|\.$/gm,"");if(o.length===0)return new Uint8Array(1);const tt=new Uint8Array(stringToBytes(o).byteLength+2);let rt=0;const nt=o.split(".");for(let ot=0;ot<nt.length;ot++){let it=stringToBytes(nt[ot]);it.byteLength>255&&(it=stringToBytes(encodeLabelhash(labelhash(nt[ot])))),tt[rt]=it.length,tt.set(it,rt+1),rt+=it.length+1}return tt.byteLength!==rt+1?tt.slice(0,rt+1):tt}const EXECUTION_REVERTED_ERROR_CODE=3;function getContractError(et,{abi:o,address:tt,args:rt,docsPath:nt,functionName:ot,sender:it}){const{code:st,data:at,message:ct,shortMessage:lt}=et instanceof RawContractError?et:et instanceof BaseError$3?et.walk(ht=>"data"in ht)||et.walk():{},dt=et instanceof AbiDecodingZeroDataError?new ContractFunctionZeroDataError({functionName:ot}):[EXECUTION_REVERTED_ERROR_CODE,InternalRpcError.code].includes(st)&&(at||ct||lt)?new ContractFunctionRevertedError({abi:o,data:typeof at=="object"?at.data:at,functionName:ot,message:lt??ct}):et;return new ContractFunctionExecutionError(dt,{abi:o,args:rt,contractAddress:tt,docsPath:nt,functionName:ot,sender:it})}const aggregate3Signature="0x82ad56cb",deploylessCallViaBytecodeBytecode="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",deploylessCallViaFactoryBytecode="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe";function getCallError(et,{docsPath:o,...tt}){const rt=(()=>{const nt=getNodeError(et,tt);return nt instanceof UnknownNodeError?et:nt})();return new CallExecutionError(rt,{docsPath:o,...tt})}const schedulerCache=new Map;function createBatchScheduler({fn:et,id:o,shouldSplitBatch:tt,wait:rt=0,sort:nt}){const ot=async()=>{const lt=at();it();const dt=lt.map(({args:ht})=>ht);dt.length!==0&&et(dt).then(ht=>{var mt;nt&&Array.isArray(ht)&&ht.sort(nt);for(let ft=0;ft<lt.length;ft++){const{pendingPromise:pt}=lt[ft];(mt=pt.resolve)==null||mt.call(pt,[ht[ft],ht])}}).catch(ht=>{var mt;for(let ft=0;ft<lt.length;ft++){const{pendingPromise:pt}=lt[ft];(mt=pt.reject)==null||mt.call(pt,ht)}})},it=()=>schedulerCache.delete(o),st=()=>at().map(({args:lt})=>lt),at=()=>schedulerCache.get(o)||[],ct=lt=>schedulerCache.set(o,[...at(),lt]);return{flush:it,async schedule(lt){const dt={},ht=new Promise((pt,yt)=>{dt.resolve=pt,dt.reject=yt});return(tt==null?void 0:tt([...st(),lt]))&&ot(),at().length>0?(ct({args:lt,pendingPromise:dt}),ht):(ct({args:lt,pendingPromise:dt}),setTimeout(ot,rt),ht)}}}async function call(et,o){var Nt,Lt,Mt,zt;const{account:tt=et.account,batch:rt=!!((Nt=et.batch)!=null&&Nt.multicall),blockNumber:nt,blockTag:ot="latest",accessList:it,blobs:st,code:at,data:ct,factory:lt,factoryData:dt,gas:ht,gasPrice:mt,maxFeePerBlobGas:ft,maxFeePerGas:pt,maxPriorityFeePerGas:yt,nonce:gt,to:bt,value:xt,stateOverride:vt,...Et}=o,Ct=tt?parseAccount(tt):void 0;if(at&&(lt||dt))throw new BaseError$3("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(at&&bt)throw new BaseError$3("Cannot provide both `code` & `to` as parameters.");const St=at&&ct,At=lt&&dt&&bt&&ct,kt=St||At,It=St?toDeploylessCallViaBytecodeData({code:at,data:ct}):At?toDeploylessCallViaFactoryData({data:ct,factory:lt,factoryData:dt,to:bt}):ct;try{assertRequest(o);const Xt=(nt?numberToHex(nt):void 0)||ot,Wt=serializeStateOverride(vt),Ft=(zt=(Mt=(Lt=et.chain)==null?void 0:Lt.formatters)==null?void 0:Mt.transactionRequest)==null?void 0:zt.format,Pt=(Ft||formatTransactionRequest)({...extract$1(Et,{format:Ft}),from:Ct==null?void 0:Ct.address,accessList:it,blobs:st,data:It,gas:ht,gasPrice:mt,maxFeePerBlobGas:ft,maxFeePerGas:pt,maxPriorityFeePerGas:yt,nonce:gt,to:kt?void 0:bt,value:xt});if(rt&&shouldPerformMulticall({request:Pt})&&!Wt)try{return await scheduleMulticall(et,{...Pt,blockNumber:nt,blockTag:ot})}catch(Qt){if(!(Qt instanceof ClientChainNotConfiguredError)&&!(Qt instanceof ChainDoesNotSupportContract))throw Qt}const Yt=await et.request({method:"eth_call",params:Wt?[Pt,Xt,Wt]:[Pt,Xt]});return Yt==="0x"?{data:void 0}:{data:Yt}}catch(Ut){const Xt=getRevertErrorData(Ut),{offchainLookup:Wt,offchainLookupSignature:Ft}=await __vitePreload(async()=>{const{offchainLookup:qt,offchainLookupSignature:Pt}=await import("./ccip-pRo4jQj5.js");return{offchainLookup:qt,offchainLookupSignature:Pt}},[]);if(et.ccipRead!==!1&&(Xt==null?void 0:Xt.slice(0,10))===Ft&&bt)return{data:await Wt(et,{data:Xt,to:bt})};throw kt&&(Xt==null?void 0:Xt.slice(0,10))==="0x101bb98d"?new CounterfactualDeploymentFailedError({factory:lt}):getCallError(Ut,{...o,account:Ct,chain:et.chain})}}function shouldPerformMulticall({request:et}){const{data:o,to:tt,...rt}=et;return!(!o||o.startsWith(aggregate3Signature)||!tt||Object.values(rt).filter(nt=>typeof nt<"u").length>0)}async function scheduleMulticall(et,o){var pt;const{batchSize:tt=1024,wait:rt=0}=typeof((pt=et.batch)==null?void 0:pt.multicall)=="object"?et.batch.multicall:{},{blockNumber:nt,blockTag:ot="latest",data:it,multicallAddress:st,to:at}=o;let ct=st;if(!ct){if(!et.chain)throw new ClientChainNotConfiguredError;ct=getChainContractAddress({blockNumber:nt,chain:et.chain,contract:"multicall3"})}const dt=(nt?numberToHex(nt):void 0)||ot,{schedule:ht}=createBatchScheduler({id:`${et.uid}.${dt}`,wait:rt,shouldSplitBatch(yt){return yt.reduce((bt,{data:xt})=>bt+(xt.length-2),0)>tt*2},fn:async yt=>{const gt=yt.map(vt=>({allowFailure:!0,callData:vt.data,target:vt.to})),bt=encodeFunctionData({abi:multicall3Abi,args:[gt],functionName:"aggregate3"}),xt=await et.request({method:"eth_call",params:[{data:bt,to:ct},dt]});return decodeFunctionResult({abi:multicall3Abi,args:[gt],functionName:"aggregate3",data:xt||"0x"})}}),[{returnData:mt,success:ft}]=await ht({data:it,to:at});if(!ft)throw new RawContractError({data:mt});return mt==="0x"?{data:void 0}:{data:mt}}function toDeploylessCallViaBytecodeData(et){const{code:o,data:tt}=et;return encodeDeployData({abi:parseAbi(["constructor(bytes, bytes)"]),bytecode:deploylessCallViaBytecodeBytecode,args:[o,tt]})}function toDeploylessCallViaFactoryData(et){const{data:o,factory:tt,factoryData:rt,to:nt}=et;return encodeDeployData({abi:parseAbi(["constructor(address, bytes, address, bytes)"]),bytecode:deploylessCallViaFactoryBytecode,args:[nt,o,tt,rt]})}function getRevertErrorData(et){var tt;if(!(et instanceof BaseError$3))return;const o=et.walk();return typeof(o==null?void 0:o.data)=="object"?(tt=o.data)==null?void 0:tt.data:o.data}async function readContract$1(et,o){const{abi:tt,address:rt,args:nt,functionName:ot,...it}=o,st=encodeFunctionData({abi:tt,args:nt,functionName:ot});try{const{data:at}=await getAction$1(et,call,"call")({...it,data:st,to:rt});return decodeFunctionResult({abi:tt,args:nt,functionName:ot,data:at||"0x"})}catch(at){throw getContractError(at,{abi:tt,address:rt,args:nt,docsPath:"/docs/contract/readContract",functionName:ot})}}async function getEnsAddress$1(et,{blockNumber:o,blockTag:tt,coinType:rt,name:nt,gatewayUrls:ot,strict:it,universalResolverAddress:st}){let at=st;if(!at){if(!et.chain)throw new Error("client chain not configured. universalResolverAddress is required.");at=getChainContractAddress({blockNumber:o,chain:et.chain,contract:"ensUniversalResolver"})}try{const ct=encodeFunctionData({abi:addressResolverAbi,functionName:"addr",...rt!=null?{args:[namehash(nt),BigInt(rt)]}:{args:[namehash(nt)]}}),lt={address:at,abi:universalResolverResolveAbi,functionName:"resolve",args:[toHex(packetToBytes(nt)),ct],blockNumber:o,blockTag:tt},dt=getAction$1(et,readContract$1,"readContract"),ht=ot?await dt({...lt,args:[...lt.args,ot]}):await dt(lt);if(ht[0]==="0x")return null;const mt=decodeFunctionResult({abi:addressResolverAbi,args:rt!=null?[namehash(nt),BigInt(rt)]:void 0,functionName:"addr",data:ht[0]});return mt==="0x"||trim$1(mt)==="0x00"?null:mt}catch(ct){if(it)throw ct;if(isNullUniversalResolverError(ct,"resolve"))return null;throw ct}}class EnsAvatarInvalidMetadataError extends BaseError$3{constructor({data:o}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(o)}`],name:"EnsAvatarInvalidMetadataError"})}}class EnsAvatarInvalidNftUriError extends BaseError$3{constructor({reason:o}){super(`ENS NFT avatar URI is invalid. ${o}`,{name:"EnsAvatarInvalidNftUriError"})}}class EnsAvatarUriResolutionError extends BaseError$3{constructor({uri:o}){super(`Unable to resolve ENS avatar URI "${o}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class EnsAvatarUnsupportedNamespaceError extends BaseError$3{constructor({namespace:o}){super(`ENS NFT avatar namespace "${o}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const networkRegex=/(?<protocol>https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,ipfsHashRegex=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,base64Regex=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,dataURIRegex=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function isImageUri(et){try{const o=await fetch(et,{method:"HEAD"});if(o.status===200){const tt=o.headers.get("content-type");return tt==null?void 0:tt.startsWith("image/")}return!1}catch(o){return typeof o=="object"&&typeof o.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(tt=>{const rt=new Image;rt.onload=()=>{tt(!0)},rt.onerror=()=>{tt(!1)},rt.src=et})}}function getGateway(et,o){return et?et.endsWith("/")?et.slice(0,-1):et:o}function resolveAvatarUri({uri:et,gatewayUrls:o}){const tt=base64Regex.test(et);if(tt)return{uri:et,isOnChain:!0,isEncoded:tt};const rt=getGateway(o==null?void 0:o.ipfs,"https://ipfs.io"),nt=getGateway(o==null?void 0:o.arweave,"https://arweave.net"),ot=et.match(networkRegex),{protocol:it,subpath:st,target:at,subtarget:ct=""}=(ot==null?void 0:ot.groups)||{},lt=it==="ipns:/"||st==="ipns/",dt=it==="ipfs:/"||st==="ipfs/"||ipfsHashRegex.test(et);if(et.startsWith("http")&&!lt&&!dt){let mt=et;return o!=null&&o.arweave&&(mt=et.replace(/https:\/\/arweave.net/g,o==null?void 0:o.arweave)),{uri:mt,isOnChain:!1,isEncoded:!1}}if((lt||dt)&&at)return{uri:`${rt}/${lt?"ipns":"ipfs"}/${at}${ct}`,isOnChain:!1,isEncoded:!1};if(it==="ar:/"&&at)return{uri:`${nt}/${at}${ct||""}`,isOnChain:!1,isEncoded:!1};let ht=et.replace(dataURIRegex,"");if(ht.startsWith("<svg")&&(ht=`data:image/svg+xml;base64,${btoa(ht)}`),ht.startsWith("data:")||ht.startsWith("{"))return{uri:ht,isOnChain:!0,isEncoded:!1};throw new EnsAvatarUriResolutionError({uri:et})}function getJsonImage(et){if(typeof et!="object"||!("image"in et)&&!("image_url"in et)&&!("image_data"in et))throw new EnsAvatarInvalidMetadataError({data:et});return et.image||et.image_url||et.image_data}async function getMetadataAvatarUri({gatewayUrls:et,uri:o}){try{const tt=await fetch(o).then(nt=>nt.json());return await parseAvatarUri({gatewayUrls:et,uri:getJsonImage(tt)})}catch{throw new EnsAvatarUriResolutionError({uri:o})}}async function parseAvatarUri({gatewayUrls:et,uri:o}){const{uri:tt,isOnChain:rt}=resolveAvatarUri({uri:o,gatewayUrls:et});if(rt||await isImageUri(tt))return tt;throw new EnsAvatarUriResolutionError({uri:o})}function parseNftUri(et){let o=et;o.startsWith("did:nft:")&&(o=o.replace("did:nft:","").replace(/_/g,"/"));const[tt,rt,nt]=o.split("/"),[ot,it]=tt.split(":"),[st,at]=rt.split(":");if(!ot||ot.toLowerCase()!=="eip155")throw new EnsAvatarInvalidNftUriError({reason:"Only EIP-155 supported"});if(!it)throw new EnsAvatarInvalidNftUriError({reason:"Chain ID not found"});if(!at)throw new EnsAvatarInvalidNftUriError({reason:"Contract address not found"});if(!nt)throw new EnsAvatarInvalidNftUriError({reason:"Token ID not found"});if(!st)throw new EnsAvatarInvalidNftUriError({reason:"ERC namespace not found"});return{chainID:Number.parseInt(it),namespace:st.toLowerCase(),contractAddress:at,tokenID:nt}}async function getNftTokenUri(et,{nft:o}){if(o.namespace==="erc721")return readContract$1(et,{address:o.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(o.tokenID)]});if(o.namespace==="erc1155")return readContract$1(et,{address:o.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(o.tokenID)]});throw new EnsAvatarUnsupportedNamespaceError({namespace:o.namespace})}async function parseAvatarRecord(et,{gatewayUrls:o,record:tt}){return/eip155:/i.test(tt)?parseNftAvatarUri(et,{gatewayUrls:o,record:tt}):parseAvatarUri({uri:tt,gatewayUrls:o})}async function parseNftAvatarUri(et,{gatewayUrls:o,record:tt}){const rt=parseNftUri(tt),nt=await getNftTokenUri(et,{nft:rt}),{uri:ot,isOnChain:it,isEncoded:st}=resolveAvatarUri({uri:nt,gatewayUrls:o});if(it&&(ot.includes("data:application/json;base64,")||ot.startsWith("{"))){const ct=st?atob(ot.replace("data:application/json;base64,","")):ot,lt=JSON.parse(ct);return parseAvatarUri({uri:getJsonImage(lt),gatewayUrls:o})}let at=rt.tokenID;return rt.namespace==="erc1155"&&(at=at.replace("0x","").padStart(64,"0")),getMetadataAvatarUri({gatewayUrls:o,uri:ot.replace(/(?:0x)?{id}/,at)})}async function getEnsText(et,{blockNumber:o,blockTag:tt,name:rt,key:nt,gatewayUrls:ot,strict:it,universalResolverAddress:st}){let at=st;if(!at){if(!et.chain)throw new Error("client chain not configured. universalResolverAddress is required.");at=getChainContractAddress({blockNumber:o,chain:et.chain,contract:"ensUniversalResolver"})}try{const ct={address:at,abi:universalResolverResolveAbi,functionName:"resolve",args:[toHex(packetToBytes(rt)),encodeFunctionData({abi:textResolverAbi,functionName:"text",args:[namehash(rt),nt]})],blockNumber:o,blockTag:tt},lt=getAction$1(et,readContract$1,"readContract"),dt=ot?await lt({...ct,args:[...ct.args,ot]}):await lt(ct);if(dt[0]==="0x")return null;const ht=decodeFunctionResult({abi:textResolverAbi,functionName:"text",data:dt[0]});return ht===""?null:ht}catch(ct){if(it)throw ct;if(isNullUniversalResolverError(ct,"resolve"))return null;throw ct}}async function getEnsAvatar$1(et,{blockNumber:o,blockTag:tt,assetGatewayUrls:rt,name:nt,gatewayUrls:ot,strict:it,universalResolverAddress:st}){const at=await getAction$1(et,getEnsText,"getEnsText")({blockNumber:o,blockTag:tt,key:"avatar",name:nt,universalResolverAddress:st,gatewayUrls:ot,strict:it});if(!at)return null;try{return await parseAvatarRecord(et,{record:at,gatewayUrls:rt})}catch{return null}}async function getEnsName$1(et,{address:o,blockNumber:tt,blockTag:rt,gatewayUrls:nt,strict:ot,universalResolverAddress:it}){let st=it;if(!st){if(!et.chain)throw new Error("client chain not configured. universalResolverAddress is required.");st=getChainContractAddress({blockNumber:tt,chain:et.chain,contract:"ensUniversalResolver"})}const at=`${o.toLowerCase().substring(2)}.addr.reverse`;try{const ct={address:st,abi:universalResolverReverseAbi,functionName:"reverse",args:[toHex(packetToBytes(at))],blockNumber:tt,blockTag:rt},lt=getAction$1(et,readContract$1,"readContract"),[dt,ht]=nt?await lt({...ct,args:[...ct.args,nt]}):await lt(ct);return o.toLowerCase()!==ht.toLowerCase()?null:dt}catch(ct){if(ot)throw ct;if(isNullUniversalResolverError(ct,"reverse"))return null;throw ct}}const promiseCache$1=new Map,responseCache=new Map;function getCache(et){const o=(nt,ot)=>({clear:()=>ot.delete(nt),get:()=>ot.get(nt),set:it=>ot.set(nt,it)}),tt=o(et,promiseCache$1),rt=o(et,responseCache);return{clear:()=>{tt.clear(),rt.clear()},promise:tt,response:rt}}async function withCache(et,{cacheKey:o,cacheTime:tt=Number.POSITIVE_INFINITY}){const rt=getCache(o),nt=rt.response.get();if(nt&&tt>0&&new Date().getTime()-nt.created.getTime()<tt)return nt.data;let ot=rt.promise.get();ot||(ot=et(),rt.promise.set(ot));try{const it=await ot;return rt.response.set({created:new Date,data:it}),it}finally{rt.promise.clear()}}const cacheKey=et=>`blockNumber.${et}`;async function getBlockNumber$1(et,{cacheTime:o=et.cacheTime}={}){const tt=await withCache(()=>et.request({method:"eth_blockNumber"}),{cacheKey:cacheKey(et.uid),cacheTime:o});return BigInt(tt)}function formatLog(et,{args:o,eventName:tt}={}){return{...et,blockHash:et.blockHash?et.blockHash:null,blockNumber:et.blockNumber?BigInt(et.blockNumber):null,logIndex:et.logIndex?Number(et.logIndex):null,transactionHash:et.transactionHash?et.transactionHash:null,transactionIndex:et.transactionIndex?Number(et.transactionIndex):null,...tt?{args:o,eventName:tt}:{}}}const receiptStatuses={"0x0":"reverted","0x1":"success"};function formatTransactionReceipt(et){const o={...et,blockNumber:et.blockNumber?BigInt(et.blockNumber):null,contractAddress:et.contractAddress?et.contractAddress:null,cumulativeGasUsed:et.cumulativeGasUsed?BigInt(et.cumulativeGasUsed):null,effectiveGasPrice:et.effectiveGasPrice?BigInt(et.effectiveGasPrice):null,gasUsed:et.gasUsed?BigInt(et.gasUsed):null,logs:et.logs?et.logs.map(tt=>formatLog(tt)):null,to:et.to?et.to:null,transactionIndex:et.transactionIndex?hexToNumber$2(et.transactionIndex):null,status:et.status?receiptStatuses[et.status]:null,type:et.type?transactionType[et.type]||et.type:null};return et.blobGasPrice&&(o.blobGasPrice=BigInt(et.blobGasPrice)),et.blobGasUsed&&(o.blobGasUsed=BigInt(et.blobGasUsed)),o}const defineTransactionReceipt=defineFormatter("transactionReceipt",formatTransactionReceipt);async function multicall$1(et,o){var yt;const{allowFailure:tt=!0,batchSize:rt,blockNumber:nt,blockTag:ot,multicallAddress:it,stateOverride:st}=o,at=o.contracts,ct=rt??(typeof((yt=et.batch)==null?void 0:yt.multicall)=="object"&&et.batch.multicall.batchSize||1024);let lt=it;if(!lt){if(!et.chain)throw new Error("client chain not configured. multicallAddress is required.");lt=getChainContractAddress({blockNumber:nt,chain:et.chain,contract:"multicall3"})}const dt=[[]];let ht=0,mt=0;for(let gt=0;gt<at.length;gt++){const{abi:bt,address:xt,args:vt,functionName:Et}=at[gt];try{const Ct=encodeFunctionData({abi:bt,args:vt,functionName:Et});mt+=(Ct.length-2)/2,ct>0&&mt>ct&&dt[ht].length>0&&(ht++,mt=(Ct.length-2)/2,dt[ht]=[]),dt[ht]=[...dt[ht],{allowFailure:!0,callData:Ct,target:xt}]}catch(Ct){const St=getContractError(Ct,{abi:bt,address:xt,args:vt,docsPath:"/docs/contract/multicall",functionName:Et});if(!tt)throw St;dt[ht]=[...dt[ht],{allowFailure:!0,callData:"0x",target:xt}]}}const ft=await Promise.allSettled(dt.map(gt=>getAction$1(et,readContract$1,"readContract")({abi:multicall3Abi,address:lt,args:[gt],blockNumber:nt,blockTag:ot,functionName:"aggregate3",stateOverride:st}))),pt=[];for(let gt=0;gt<ft.length;gt++){const bt=ft[gt];if(bt.status==="rejected"){if(!tt)throw bt.reason;for(let vt=0;vt<dt[gt].length;vt++)pt.push({status:"failure",error:bt.reason,result:void 0});continue}const xt=bt.value;for(let vt=0;vt<xt.length;vt++){const{returnData:Et,success:Ct}=xt[vt],{callData:St}=dt[gt][vt],{abi:At,address:kt,functionName:It,args:Nt}=at[pt.length];try{if(St==="0x")throw new AbiDecodingZeroDataError;if(!Ct)throw new RawContractError({data:Et});const Lt=decodeFunctionResult({abi:At,args:Nt,data:Et,functionName:It});pt.push(tt?{result:Lt,status:"success"}:Lt)}catch(Lt){const Mt=getContractError(Lt,{abi:At,address:kt,args:Nt,docsPath:"/docs/contract/multicall",functionName:It});if(!tt)throw Mt;pt.push({error:Mt,result:void 0,status:"failure"})}}}if(pt.length!==at.length)throw new BaseError$3("multicall results mismatch");return pt}const listenersCache=new Map,cleanupCache=new Map;let callbackCount=0;function observe(et,o,tt){const rt=++callbackCount,nt=()=>listenersCache.get(et)||[],ot=()=>{const lt=nt();listenersCache.set(et,lt.filter(dt=>dt.id!==rt))},it=()=>{const lt=cleanupCache.get(et);nt().length===1&&lt&&lt(),ot()},st=nt();if(listenersCache.set(et,[...st,{id:rt,fns:o}]),st&&st.length>0)return it;const at={};for(const lt in o)at[lt]=(...dt)=>{var mt,ft;const ht=nt();if(ht.length!==0)for(const pt of ht)(ft=(mt=pt.fns)[lt])==null||ft.call(mt,...dt)};const ct=tt(at);return typeof ct=="function"&&cleanupCache.set(et,ct),it}async function wait$1(et){return new Promise(o=>setTimeout(o,et))}function poll(et,{emitOnBegin:o,initialWaitTime:tt,interval:rt}){let nt=!0;const ot=()=>nt=!1;return(async()=>{let st;o&&(st=await et({unpoll:ot}));const at=await(tt==null?void 0:tt(st))??rt;await wait$1(at);const ct=async()=>{nt&&(await et({unpoll:ot}),await wait$1(rt),ct())};ct()})(),ot}function watchBlockNumber$1(et,{emitOnBegin:o=!1,emitMissed:tt=!1,onBlockNumber:rt,onError:nt,poll:ot,pollingInterval:it=et.pollingInterval}){const st=typeof ot<"u"?ot:!(et.transport.type==="webSocket"||et.transport.type==="fallback"&&et.transport.transports[0].config.type==="webSocket");let at;return st?(()=>{const dt=stringify$2(["watchBlockNumber",et.uid,o,tt,it]);return observe(dt,{onBlockNumber:rt,onError:nt},ht=>poll(async()=>{var mt;try{const ft=await getAction$1(et,getBlockNumber$1,"getBlockNumber")({cacheTime:0});if(at){if(ft===at)return;if(ft-at>1&&tt)for(let pt=at+1n;pt<ft;pt++)ht.onBlockNumber(pt,at),at=pt}(!at||ft>at)&&(ht.onBlockNumber(ft,at),at=ft)}catch(ft){(mt=ht.onError)==null||mt.call(ht,ft)}},{emitOnBegin:o,interval:it}))})():(()=>{const dt=stringify$2(["watchBlockNumber",et.uid,o,tt]);return observe(dt,{onBlockNumber:rt,onError:nt},ht=>{let mt=!0,ft=()=>mt=!1;return(async()=>{try{const pt=(()=>{if(et.transport.type==="fallback"){const gt=et.transport.transports.find(bt=>bt.config.type==="webSocket");return gt?gt.value:et.transport}return et.transport})(),{unsubscribe:yt}=await pt.subscribe({params:["newHeads"],onData(gt){var xt;if(!mt)return;const bt=hexToBigInt((xt=gt.result)==null?void 0:xt.number);ht.onBlockNumber(bt,at),at=bt},onError(gt){var bt;(bt=ht.onError)==null||bt.call(ht,gt)}});ft=yt,mt||ft()}catch(pt){nt==null||nt(pt)}})(),()=>ft()})})()}const promiseCache=new LruMap(8192);function withDedupe(et,{enabled:o=!0,id:tt}){if(!o||!tt)return et();if(promiseCache.get(tt))return promiseCache.get(tt);const rt=et().finally(()=>promiseCache.delete(tt));return promiseCache.set(tt,rt),rt}function withRetry(et,{delay:o=100,retryCount:tt=2,shouldRetry:rt=()=>!0}={}){return new Promise((nt,ot)=>{const it=async({count:st=0}={})=>{const at=async({error:ct})=>{const lt=typeof o=="function"?o({count:st,error:ct}):o;lt&&await wait$1(lt),it({count:st+1})};try{const ct=await et();nt(ct)}catch(ct){if(st<tt&&await rt({count:st,error:ct}))return at({error:ct});ot(ct)}};it()})}function buildRequest(et,o={}){return async(tt,rt={})=>{const{dedupe:nt=!1,retryDelay:ot=150,retryCount:it=3,uid:st}={...o,...rt},at=nt?keccak256$1(stringToHex(`${st}.${stringify$2(tt)}`)):void 0;return withDedupe(()=>withRetry(async()=>{try{return await et(tt)}catch(ct){const lt=ct;switch(lt.code){case ParseRpcError.code:throw new ParseRpcError(lt);case InvalidRequestRpcError.code:throw new InvalidRequestRpcError(lt);case MethodNotFoundRpcError.code:throw new MethodNotFoundRpcError(lt,{method:tt.method});case InvalidParamsRpcError.code:throw new InvalidParamsRpcError(lt);case InternalRpcError.code:throw new InternalRpcError(lt);case InvalidInputRpcError.code:throw new InvalidInputRpcError(lt);case ResourceNotFoundRpcError.code:throw new ResourceNotFoundRpcError(lt);case ResourceUnavailableRpcError.code:throw new ResourceUnavailableRpcError(lt);case TransactionRejectedRpcError.code:throw new TransactionRejectedRpcError(lt);case MethodNotSupportedRpcError.code:throw new MethodNotSupportedRpcError(lt,{method:tt.method});case LimitExceededRpcError.code:throw new LimitExceededRpcError(lt);case JsonRpcVersionUnsupportedError.code:throw new JsonRpcVersionUnsupportedError(lt);case UserRejectedRequestError.code:throw new UserRejectedRequestError(lt);case UnauthorizedProviderError.code:throw new UnauthorizedProviderError(lt);case UnsupportedProviderMethodError.code:throw new UnsupportedProviderMethodError(lt);case ProviderDisconnectedError.code:throw new ProviderDisconnectedError(lt);case ChainDisconnectedError.code:throw new ChainDisconnectedError(lt);case SwitchChainError.code:throw new SwitchChainError(lt);case 5e3:throw new UserRejectedRequestError(lt);default:throw ct instanceof BaseError$3?ct:new UnknownRpcError(lt)}}},{delay:({count:ct,error:lt})=>{var dt;if(lt&&lt instanceof HttpRequestError){const ht=(dt=lt==null?void 0:lt.headers)==null?void 0:dt.get("Retry-After");if(ht!=null&&ht.match(/\d/))return Number.parseInt(ht)*1e3}return~~(1<<ct)*ot},retryCount:it,shouldRetry:({error:ct})=>shouldRetry(ct)}),{enabled:nt,id:at})}}function shouldRetry(et){return"code"in et&&typeof et.code=="number"?et.code===-1||et.code===LimitExceededRpcError.code||et.code===InternalRpcError.code:et instanceof HttpRequestError&&et.status?et.status===403||et.status===408||et.status===413||et.status===429||et.status===500||et.status===502||et.status===503||et.status===504:!0}function defineChain(et){return{formatters:void 0,fees:void 0,serializers:void 0,...et}}function withTimeout(et,{errorInstance:o=new Error("timed out"),timeout:tt,signal:rt}){return new Promise((nt,ot)=>{(async()=>{let it;try{const st=new AbortController;tt>0&&(it=setTimeout(()=>{rt?st.abort():ot(o)},tt)),nt(await et({signal:(st==null?void 0:st.signal)||null}))}catch(st){(st==null?void 0:st.name)==="AbortError"&&ot(o),ot(st)}finally{clearTimeout(it)}})()})}function createIdStore(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const idCache=createIdStore();function getHttpRpcClient(et,o={}){return{async request(tt){var dt;const{body:rt,onRequest:nt=o.onRequest,onResponse:ot=o.onResponse,timeout:it=o.timeout??1e4}=tt,st={...o.fetchOptions??{},...tt.fetchOptions??{}},{headers:at,method:ct,signal:lt}=st;try{const ht=await withTimeout(async({signal:ft})=>{const pt={...st,body:Array.isArray(rt)?stringify$2(rt.map(xt=>({jsonrpc:"2.0",id:xt.id??idCache.take(),...xt}))):stringify$2({jsonrpc:"2.0",id:rt.id??idCache.take(),...rt}),headers:{"Content-Type":"application/json",...at},method:ct||"POST",signal:lt||(it>0?ft:null)},yt=new Request(et,pt),gt=await(nt==null?void 0:nt(yt,pt))??{...pt,url:et};return await fetch(gt.url??et,gt)},{errorInstance:new TimeoutError$4({body:rt,url:et}),timeout:it,signal:!0});ot&&await ot(ht);let mt;if((dt=ht.headers.get("Content-Type"))!=null&&dt.startsWith("application/json"))mt=await ht.json();else{mt=await ht.text();try{mt=JSON.parse(mt||"{}")}catch(ft){if(ht.ok)throw ft;mt={error:mt}}}if(!ht.ok)throw new HttpRequestError({body:rt,details:stringify$2(mt.error)||ht.statusText,headers:ht.headers,status:ht.status,url:et});return mt}catch(ht){throw ht instanceof HttpRequestError||ht instanceof TimeoutError$4?ht:new HttpRequestError({body:rt,cause:ht,url:et})}}}}function assertTransactionEIP7702(et){const{authorizationList:o}=et;if(o)for(const tt of o){const{contractAddress:rt,chainId:nt}=tt;if(!isAddress(rt))throw new InvalidAddressError({address:rt});if(nt<=0)throw new InvalidChainIdError({chainId:nt})}assertTransactionEIP1559(et)}function assertTransactionEIP4844(et){const{blobVersionedHashes:o}=et;if(o){if(o.length===0)throw new EmptyBlobError;for(const tt of o){const rt=size$2(tt),nt=hexToNumber$2(slice(tt,0,1));if(rt!==32)throw new InvalidVersionedHashSizeError({hash:tt,size:rt});if(nt!==versionedHashVersionKzg)throw new InvalidVersionedHashVersionError({hash:tt,version:nt})}}assertTransactionEIP1559(et)}function assertTransactionEIP1559(et){const{chainId:o,maxPriorityFeePerGas:tt,maxFeePerGas:rt,to:nt}=et;if(o<=0)throw new InvalidChainIdError({chainId:o});if(nt&&!isAddress(nt))throw new InvalidAddressError({address:nt});if(rt&&rt>maxUint256)throw new FeeCapTooHighError({maxFeePerGas:rt});if(tt&&rt&&tt>rt)throw new TipAboveFeeCapError({maxFeePerGas:rt,maxPriorityFeePerGas:tt})}function assertTransactionEIP2930(et){const{chainId:o,maxPriorityFeePerGas:tt,gasPrice:rt,maxFeePerGas:nt,to:ot}=et;if(o<=0)throw new InvalidChainIdError({chainId:o});if(ot&&!isAddress(ot))throw new InvalidAddressError({address:ot});if(tt||nt)throw new BaseError$3("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(rt&&rt>maxUint256)throw new FeeCapTooHighError({maxFeePerGas:rt})}function assertTransactionLegacy(et){const{chainId:o,maxPriorityFeePerGas:tt,gasPrice:rt,maxFeePerGas:nt,to:ot}=et;if(ot&&!isAddress(ot))throw new InvalidAddressError({address:ot});if(typeof o<"u"&&o<=0)throw new InvalidChainIdError({chainId:o});if(tt||nt)throw new BaseError$3("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(rt&&rt>maxUint256)throw new FeeCapTooHighError({maxFeePerGas:rt})}function serializeAuthorizationList(et){if(!et||et.length===0)return[];const o=[];for(const tt of et){const{contractAddress:rt,chainId:nt,nonce:ot,...it}=tt;o.push([toHex(nt),rt,ot?toHex(ot):"0x",...toYParitySignatureArray({},it)])}return o}function serializeAccessList(et){if(!et||et.length===0)return[];const o=[];for(let tt=0;tt<et.length;tt++){const{address:rt,storageKeys:nt}=et[tt];for(let ot=0;ot<nt.length;ot++)if(nt[ot].length-2!==64)throw new InvalidStorageKeySizeError({storageKey:nt[ot]});if(!isAddress(rt,{strict:!1}))throw new InvalidAddressError({address:rt});o.push([rt,nt])}return o}function serializeTransaction$1(et,o){const tt=getTransactionType(et);return tt==="eip1559"?serializeTransactionEIP1559(et,o):tt==="eip2930"?serializeTransactionEIP2930(et,o):tt==="eip4844"?serializeTransactionEIP4844(et,o):tt==="eip7702"?serializeTransactionEIP7702(et,o):serializeTransactionLegacy(et,o)}function serializeTransactionEIP7702(et,o){const{authorizationList:tt,chainId:rt,gas:nt,nonce:ot,to:it,value:st,maxFeePerGas:at,maxPriorityFeePerGas:ct,accessList:lt,data:dt}=et;assertTransactionEIP7702(et);const ht=serializeAccessList(lt),mt=serializeAuthorizationList(tt);return concatHex(["0x04",toRlp([toHex(rt),ot?toHex(ot):"0x",ct?toHex(ct):"0x",at?toHex(at):"0x",nt?toHex(nt):"0x",it??"0x",st?toHex(st):"0x",dt??"0x",ht,mt,...toYParitySignatureArray(et,o)])])}function serializeTransactionEIP4844(et,o){const{chainId:tt,gas:rt,nonce:nt,to:ot,value:it,maxFeePerBlobGas:st,maxFeePerGas:at,maxPriorityFeePerGas:ct,accessList:lt,data:dt}=et;assertTransactionEIP4844(et);let ht=et.blobVersionedHashes,mt=et.sidecars;if(et.blobs&&(typeof ht>"u"||typeof mt>"u")){const xt=typeof et.blobs[0]=="string"?et.blobs:et.blobs.map(Ct=>bytesToHex$3(Ct)),vt=et.kzg,Et=blobsToCommitments({blobs:xt,kzg:vt});if(typeof ht>"u"&&(ht=commitmentsToVersionedHashes({commitments:Et})),typeof mt>"u"){const Ct=blobsToProofs({blobs:xt,commitments:Et,kzg:vt});mt=toBlobSidecars({blobs:xt,commitments:Et,proofs:Ct})}}const ft=serializeAccessList(lt),pt=[toHex(tt),nt?toHex(nt):"0x",ct?toHex(ct):"0x",at?toHex(at):"0x",rt?toHex(rt):"0x",ot??"0x",it?toHex(it):"0x",dt??"0x",ft,st?toHex(st):"0x",ht??[],...toYParitySignatureArray(et,o)],yt=[],gt=[],bt=[];if(mt)for(let xt=0;xt<mt.length;xt++){const{blob:vt,commitment:Et,proof:Ct}=mt[xt];yt.push(vt),gt.push(Et),bt.push(Ct)}return concatHex(["0x03",toRlp(mt?[pt,yt,gt,bt]:pt)])}function serializeTransactionEIP1559(et,o){const{chainId:tt,gas:rt,nonce:nt,to:ot,value:it,maxFeePerGas:st,maxPriorityFeePerGas:at,accessList:ct,data:lt}=et;assertTransactionEIP1559(et);const dt=serializeAccessList(ct),ht=[toHex(tt),nt?toHex(nt):"0x",at?toHex(at):"0x",st?toHex(st):"0x",rt?toHex(rt):"0x",ot??"0x",it?toHex(it):"0x",lt??"0x",dt,...toYParitySignatureArray(et,o)];return concatHex(["0x02",toRlp(ht)])}function serializeTransactionEIP2930(et,o){const{chainId:tt,gas:rt,data:nt,nonce:ot,to:it,value:st,accessList:at,gasPrice:ct}=et;assertTransactionEIP2930(et);const lt=serializeAccessList(at),dt=[toHex(tt),ot?toHex(ot):"0x",ct?toHex(ct):"0x",rt?toHex(rt):"0x",it??"0x",st?toHex(st):"0x",nt??"0x",lt,...toYParitySignatureArray(et,o)];return concatHex(["0x01",toRlp(dt)])}function serializeTransactionLegacy(et,o){const{chainId:tt=0,gas:rt,data:nt,nonce:ot,to:it,value:st,gasPrice:at}=et;assertTransactionLegacy(et);let ct=[ot?toHex(ot):"0x",at?toHex(at):"0x",rt?toHex(rt):"0x",it??"0x",st?toHex(st):"0x",nt??"0x"];if(o){const lt=(()=>{if(o.v>=35n)return(o.v-35n)/2n>0?o.v:27n+(o.v===35n?0n:1n);if(tt>0)return BigInt(tt*2)+BigInt(35n+o.v-27n);const mt=27n+(o.v===27n?0n:1n);if(o.v!==mt)throw new InvalidLegacyVError({v:o.v});return mt})(),dt=trim$1(o.r),ht=trim$1(o.s);ct=[...ct,toHex(lt),dt==="0x00"?"0x":dt,ht==="0x00"?"0x":ht]}else tt>0&&(ct=[...ct,toHex(tt),"0x","0x"]);return toRlp(ct)}function toYParitySignatureArray(et,o){const tt=o??et,{v:rt,yParity:nt}=tt;if(typeof tt.r>"u")return[];if(typeof tt.s>"u")return[];if(typeof rt>"u"&&typeof nt>"u")return[];const ot=trim$1(tt.r),it=trim$1(tt.s);return[typeof nt=="number"?nt?toHex(1):"0x":rt===0n?"0x":rt===1n?toHex(1):rt===27n?"0x":toHex(1),ot==="0x00"?"0x":ot,it==="0x00"?"0x":it]}async function signMessage$1(et,{account:o=et.account,message:tt}){if(!o)throw new AccountNotFoundError({docsPath:"/docs/actions/wallet/signMessage"});const rt=parseAccount(o);if(rt.signMessage)return rt.signMessage({message:tt});const nt=typeof tt=="string"?stringToHex(tt):tt.raw instanceof Uint8Array?toHex(tt.raw):tt.raw;return et.request({method:"personal_sign",params:[nt,rt.address]},{retryCount:0})}class HMAC extends Hash{constructor(o,tt){super(),this.finished=!1,this.destroyed=!1,hash$1(o);const rt=toBytes$2(tt);if(this.iHash=o.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const nt=this.blockLen,ot=new Uint8Array(nt);ot.set(rt.length>nt?o.create().update(rt).digest():rt);for(let it=0;it<ot.length;it++)ot[it]^=54;this.iHash.update(ot),this.oHash=o.create();for(let it=0;it<ot.length;it++)ot[it]^=106;this.oHash.update(ot),ot.fill(0)}update(o){return exists$1(this),this.iHash.update(o),this}digestInto(o){exists$1(this),bytes$1(o,this.outputLen),this.finished=!0,this.iHash.digestInto(o),this.oHash.update(o),this.oHash.digestInto(o),this.destroy()}digest(){const o=new Uint8Array(this.oHash.outputLen);return this.digestInto(o),o}_cloneInto(o){o||(o=Object.create(Object.getPrototypeOf(this),{}));const{oHash:tt,iHash:rt,finished:nt,destroyed:ot,blockLen:it,outputLen:st}=this;return o=o,o.finished=nt,o.destroyed=ot,o.blockLen=it,o.outputLen=st,o.oHash=tt._cloneInto(o.oHash),o.iHash=rt._cloneInto(o.iHash),o}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const hmac=(et,o,tt)=>new HMAC(et,o).update(tt).digest();hmac.create=(et,o)=>new HMAC(et,o);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$6=BigInt(0),_1n$8=BigInt(1),_2n$5=BigInt(2);function isBytes$2(et){return et instanceof Uint8Array||et!=null&&typeof et=="object"&&et.constructor.name==="Uint8Array"}function abytes(et){if(!isBytes$2(et))throw new Error("Uint8Array expected")}function abool(et,o){if(typeof o!="boolean")throw new Error(`${et} must be valid boolean, got "${o}".`)}const hexes$1=Array.from({length:256},(et,o)=>o.toString(16).padStart(2,"0"));function bytesToHex$2(et){abytes(et);let o="";for(let tt=0;tt<et.length;tt++)o+=hexes$1[et[tt]];return o}function numberToHexUnpadded$1(et){const o=et.toString(16);return o.length&1?`0${o}`:o}function hexToNumber$1(et){if(typeof et!="string")throw new Error("hex string expected, got "+typeof et);return BigInt(et===""?"0":`0x${et}`)}const asciis={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function asciiToBase16(et){if(et>=asciis._0&&et<=asciis._9)return et-asciis._0;if(et>=asciis._A&&et<=asciis._F)return et-(asciis._A-10);if(et>=asciis._a&&et<=asciis._f)return et-(asciis._a-10)}function hexToBytes$2(et){if(typeof et!="string")throw new Error("hex string expected, got "+typeof et);const o=et.length,tt=o/2;if(o%2)throw new Error("padded hex string expected, got unpadded hex of length "+o);const rt=new Uint8Array(tt);for(let nt=0,ot=0;nt<tt;nt++,ot+=2){const it=asciiToBase16(et.charCodeAt(ot)),st=asciiToBase16(et.charCodeAt(ot+1));if(it===void 0||st===void 0){const at=et[ot]+et[ot+1];throw new Error('hex string expected, got non-hex character "'+at+'" at index '+ot)}rt[nt]=it*16+st}return rt}function bytesToNumberBE(et){return hexToNumber$1(bytesToHex$2(et))}function bytesToNumberLE(et){return abytes(et),hexToNumber$1(bytesToHex$2(Uint8Array.from(et).reverse()))}function numberToBytesBE(et,o){return hexToBytes$2(et.toString(16).padStart(o*2,"0"))}function numberToBytesLE(et,o){return numberToBytesBE(et,o).reverse()}function numberToVarBytesBE(et){return hexToBytes$2(numberToHexUnpadded$1(et))}function ensureBytes$1(et,o,tt){let rt;if(typeof o=="string")try{rt=hexToBytes$2(o)}catch(ot){throw new Error(`${et} must be valid hex string, got "${o}". Cause: ${ot}`)}else if(isBytes$2(o))rt=Uint8Array.from(o);else throw new Error(`${et} must be hex string or Uint8Array`);const nt=rt.length;if(typeof tt=="number"&&nt!==tt)throw new Error(`${et} expected ${tt} bytes, got ${nt}`);return rt}function concatBytes$1(...et){let o=0;for(let rt=0;rt<et.length;rt++){const nt=et[rt];abytes(nt),o+=nt.length}const tt=new Uint8Array(o);for(let rt=0,nt=0;rt<et.length;rt++){const ot=et[rt];tt.set(ot,nt),nt+=ot.length}return tt}function equalBytes$1(et,o){if(et.length!==o.length)return!1;let tt=0;for(let rt=0;rt<et.length;rt++)tt|=et[rt]^o[rt];return tt===0}function utf8ToBytes$2(et){if(typeof et!="string")throw new Error(`utf8ToBytes expected string, got ${typeof et}`);return new Uint8Array(new TextEncoder().encode(et))}const isPosBig=et=>typeof et=="bigint"&&_0n$6<=et;function inRange(et,o,tt){return isPosBig(et)&&isPosBig(o)&&isPosBig(tt)&&o<=et&&et<tt}function aInRange(et,o,tt,rt){if(!inRange(o,tt,rt))throw new Error(`expected valid ${et}: ${tt} <= n < ${rt}, got ${typeof o} ${o}`)}function bitLen(et){let o;for(o=0;et>_0n$6;et>>=_1n$8,o+=1);return o}function bitGet(et,o){return et>>BigInt(o)&_1n$8}function bitSet(et,o,tt){return et|(tt?_1n$8:_0n$6)<<BigInt(o)}const bitMask=et=>(_2n$5<<BigInt(et-1))-_1n$8,u8n=et=>new Uint8Array(et),u8fr=et=>Uint8Array.from(et);function createHmacDrbg(et,o,tt){if(typeof et!="number"||et<2)throw new Error("hashLen must be a number");if(typeof o!="number"||o<2)throw new Error("qByteLen must be a number");if(typeof tt!="function")throw new Error("hmacFn must be a function");let rt=u8n(et),nt=u8n(et),ot=0;const it=()=>{rt.fill(1),nt.fill(0),ot=0},st=(...dt)=>tt(nt,rt,...dt),at=(dt=u8n())=>{nt=st(u8fr([0]),dt),rt=st(),dt.length!==0&&(nt=st(u8fr([1]),dt),rt=st())},ct=()=>{if(ot++>=1e3)throw new Error("drbg: tried 1000 values");let dt=0;const ht=[];for(;dt<o;){rt=st();const mt=rt.slice();ht.push(mt),dt+=rt.length}return concatBytes$1(...ht)};return(dt,ht)=>{it(),at(dt);let mt;for(;!(mt=ht(ct()));)at();return it(),mt}}const validatorFns={bigint:et=>typeof et=="bigint",function:et=>typeof et=="function",boolean:et=>typeof et=="boolean",string:et=>typeof et=="string",stringOrUint8Array:et=>typeof et=="string"||isBytes$2(et),isSafeInteger:et=>Number.isSafeInteger(et),array:et=>Array.isArray(et),field:(et,o)=>o.Fp.isValid(et),hash:et=>typeof et=="function"&&Number.isSafeInteger(et.outputLen)};function validateObject(et,o,tt={}){const rt=(nt,ot,it)=>{const st=validatorFns[ot];if(typeof st!="function")throw new Error(`Invalid validator "${ot}", expected function`);const at=et[nt];if(!(it&&at===void 0)&&!st(at,et))throw new Error(`Invalid param ${String(nt)}=${at} (${typeof at}), expected ${ot}`)};for(const[nt,ot]of Object.entries(o))rt(nt,ot,!1);for(const[nt,ot]of Object.entries(tt))rt(nt,ot,!0);return et}const notImplemented=()=>{throw new Error("not implemented")};function memoized(et){const o=new WeakMap;return(tt,...rt)=>{const nt=o.get(tt);if(nt!==void 0)return nt;const ot=et(tt,...rt);return o.set(tt,ot),ot}}const ut=Object.freeze(Object.defineProperty({__proto__:null,aInRange,abool,abytes,bitGet,bitLen,bitMask,bitSet,bytesToHex:bytesToHex$2,bytesToNumberBE,bytesToNumberLE,concatBytes:concatBytes$1,createHmacDrbg,ensureBytes:ensureBytes$1,equalBytes:equalBytes$1,hexToBytes:hexToBytes$2,hexToNumber:hexToNumber$1,inRange,isBytes:isBytes$2,memoized,notImplemented,numberToBytesBE,numberToBytesLE,numberToHexUnpadded:numberToHexUnpadded$1,numberToVarBytesBE,utf8ToBytes:utf8ToBytes$2,validateObject},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$5=BigInt(0),_1n$7=BigInt(1),_2n$4=BigInt(2),_3n$3=BigInt(3),_4n=BigInt(4),_5n$1=BigInt(5),_8n$3=BigInt(8);BigInt(9);BigInt(16);function mod$1(et,o){const tt=et%o;return tt>=_0n$5?tt:o+tt}function pow(et,o,tt){if(tt<=_0n$5||o<_0n$5)throw new Error("Expected power/modulo > 0");if(tt===_1n$7)return _0n$5;let rt=_1n$7;for(;o>_0n$5;)o&_1n$7&&(rt=rt*et%tt),et=et*et%tt,o>>=_1n$7;return rt}function pow2$1(et,o,tt){let rt=et;for(;o-- >_0n$5;)rt*=rt,rt%=tt;return rt}function invert$1(et,o){if(et===_0n$5||o<=_0n$5)throw new Error(`invert: expected positive integers, got n=${et} mod=${o}`);let tt=mod$1(et,o),rt=o,nt=_0n$5,ot=_1n$7;for(;tt!==_0n$5;){const st=rt/tt,at=rt%tt,ct=nt-ot*st;rt=tt,tt=at,nt=ot,ot=ct}if(rt!==_1n$7)throw new Error("invert: does not exist");return mod$1(nt,o)}function tonelliShanks(et){const o=(et-_1n$7)/_2n$4;let tt,rt,nt;for(tt=et-_1n$7,rt=0;tt%_2n$4===_0n$5;tt/=_2n$4,rt++);for(nt=_2n$4;nt<et&&pow(nt,o,et)!==et-_1n$7;nt++);if(rt===1){const it=(et+_1n$7)/_4n;return function(at,ct){const lt=at.pow(ct,it);if(!at.eql(at.sqr(lt),ct))throw new Error("Cannot find square root");return lt}}const ot=(tt+_1n$7)/_2n$4;return function(st,at){if(st.pow(at,o)===st.neg(st.ONE))throw new Error("Cannot find square root");let ct=rt,lt=st.pow(st.mul(st.ONE,nt),tt),dt=st.pow(at,ot),ht=st.pow(at,tt);for(;!st.eql(ht,st.ONE);){if(st.eql(ht,st.ZERO))return st.ZERO;let mt=1;for(let pt=st.sqr(ht);mt<ct&&!st.eql(pt,st.ONE);mt++)pt=st.sqr(pt);const ft=st.pow(lt,_1n$7<<BigInt(ct-mt-1));lt=st.sqr(ft),dt=st.mul(dt,ft),ht=st.mul(ht,lt),ct=mt}return dt}}function FpSqrt(et){if(et%_4n===_3n$3){const o=(et+_1n$7)/_4n;return function(rt,nt){const ot=rt.pow(nt,o);if(!rt.eql(rt.sqr(ot),nt))throw new Error("Cannot find square root");return ot}}if(et%_8n$3===_5n$1){const o=(et-_5n$1)/_8n$3;return function(rt,nt){const ot=rt.mul(nt,_2n$4),it=rt.pow(ot,o),st=rt.mul(nt,it),at=rt.mul(rt.mul(st,_2n$4),it),ct=rt.mul(st,rt.sub(at,rt.ONE));if(!rt.eql(rt.sqr(ct),nt))throw new Error("Cannot find square root");return ct}}return tonelliShanks(et)}const isNegativeLE=(et,o)=>(mod$1(et,o)&_1n$7)===_1n$7,FIELD_FIELDS=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function validateField(et){const o={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},tt=FIELD_FIELDS.reduce((rt,nt)=>(rt[nt]="function",rt),o);return validateObject(et,tt)}function FpPow(et,o,tt){if(tt<_0n$5)throw new Error("Expected power > 0");if(tt===_0n$5)return et.ONE;if(tt===_1n$7)return o;let rt=et.ONE,nt=o;for(;tt>_0n$5;)tt&_1n$7&&(rt=et.mul(rt,nt)),nt=et.sqr(nt),tt>>=_1n$7;return rt}function FpInvertBatch(et,o){const tt=new Array(o.length),rt=o.reduce((ot,it,st)=>et.is0(it)?ot:(tt[st]=ot,et.mul(ot,it)),et.ONE),nt=et.inv(rt);return o.reduceRight((ot,it,st)=>et.is0(it)?ot:(tt[st]=et.mul(ot,tt[st]),et.mul(ot,it)),nt),tt}function nLength(et,o){const tt=o!==void 0?o:et.toString(2).length,rt=Math.ceil(tt/8);return{nBitLength:tt,nByteLength:rt}}function Field$1(et,o,tt=!1,rt={}){if(et<=_0n$5)throw new Error(`Expected Field ORDER > 0, got ${et}`);const{nBitLength:nt,nByteLength:ot}=nLength(et,o);if(ot>2048)throw new Error("Field lengths over 2048 bytes are not supported");const it=FpSqrt(et),st=Object.freeze({ORDER:et,BITS:nt,BYTES:ot,MASK:bitMask(nt),ZERO:_0n$5,ONE:_1n$7,create:at=>mod$1(at,et),isValid:at=>{if(typeof at!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof at}`);return _0n$5<=at&&at<et},is0:at=>at===_0n$5,isOdd:at=>(at&_1n$7)===_1n$7,neg:at=>mod$1(-at,et),eql:(at,ct)=>at===ct,sqr:at=>mod$1(at*at,et),add:(at,ct)=>mod$1(at+ct,et),sub:(at,ct)=>mod$1(at-ct,et),mul:(at,ct)=>mod$1(at*ct,et),pow:(at,ct)=>FpPow(st,at,ct),div:(at,ct)=>mod$1(at*invert$1(ct,et),et),sqrN:at=>at*at,addN:(at,ct)=>at+ct,subN:(at,ct)=>at-ct,mulN:(at,ct)=>at*ct,inv:at=>invert$1(at,et),sqrt:rt.sqrt||(at=>it(st,at)),invertBatch:at=>FpInvertBatch(st,at),cmov:(at,ct,lt)=>lt?ct:at,toBytes:at=>tt?numberToBytesLE(at,ot):numberToBytesBE(at,ot),fromBytes:at=>{if(at.length!==ot)throw new Error(`Fp.fromBytes: expected ${ot}, got ${at.length}`);return tt?bytesToNumberLE(at):bytesToNumberBE(at)}});return Object.freeze(st)}function getFieldBytesLength(et){if(typeof et!="bigint")throw new Error("field order must be bigint");const o=et.toString(2).length;return Math.ceil(o/8)}function getMinHashLength(et){const o=getFieldBytesLength(et);return o+Math.ceil(o/2)}function mapHashToField(et,o,tt=!1){const rt=et.length,nt=getFieldBytesLength(o),ot=getMinHashLength(o);if(rt<16||rt<ot||rt>1024)throw new Error(`expected ${ot}-1024 bytes of input, got ${rt}`);const it=tt?bytesToNumberBE(et):bytesToNumberLE(et),st=mod$1(it,o-_1n$7)+_1n$7;return tt?numberToBytesLE(st,nt):numberToBytesBE(st,nt)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$4=BigInt(0),_1n$6=BigInt(1),pointPrecomputes$1=new WeakMap,pointWindowSizes=new WeakMap;function wNAF(et,o){const tt=(ot,it)=>{const st=it.negate();return ot?st:it},rt=ot=>{if(!Number.isSafeInteger(ot)||ot<=0||ot>o)throw new Error(`Wrong window size=${ot}, should be [1..${o}]`)},nt=ot=>{rt(ot);const it=Math.ceil(o/ot)+1,st=2**(ot-1);return{windows:it,windowSize:st}};return{constTimeNegate:tt,unsafeLadder(ot,it){let st=et.ZERO,at=ot;for(;it>_0n$4;)it&_1n$6&&(st=st.add(at)),at=at.double(),it>>=_1n$6;return st},precomputeWindow(ot,it){const{windows:st,windowSize:at}=nt(it),ct=[];let lt=ot,dt=lt;for(let ht=0;ht<st;ht++){dt=lt,ct.push(dt);for(let mt=1;mt<at;mt++)dt=dt.add(lt),ct.push(dt);lt=dt.double()}return ct},wNAF(ot,it,st){const{windows:at,windowSize:ct}=nt(ot);let lt=et.ZERO,dt=et.BASE;const ht=BigInt(2**ot-1),mt=2**ot,ft=BigInt(ot);for(let pt=0;pt<at;pt++){const yt=pt*ct;let gt=Number(st&ht);st>>=ft,gt>ct&&(gt-=mt,st+=_1n$6);const bt=yt,xt=yt+Math.abs(gt)-1,vt=pt%2!==0,Et=gt<0;gt===0?dt=dt.add(tt(vt,it[bt])):lt=lt.add(tt(Et,it[xt]))}return{p:lt,f:dt}},wNAFCached(ot,it,st){const at=pointWindowSizes.get(ot)||1;let ct=pointPrecomputes$1.get(ot);return ct||(ct=this.precomputeWindow(ot,at),at!==1&&pointPrecomputes$1.set(ot,st(ct))),this.wNAF(at,ct,it)},setWindowSize(ot,it){rt(it),pointWindowSizes.set(ot,it),pointPrecomputes$1.delete(ot)}}}function pippenger(et,o,tt,rt){if(!Array.isArray(tt)||!Array.isArray(rt)||rt.length!==tt.length)throw new Error("arrays of points and scalars must have equal length");rt.forEach((lt,dt)=>{if(!o.isValid(lt))throw new Error(`wrong scalar at index ${dt}`)}),tt.forEach((lt,dt)=>{if(!(lt instanceof et))throw new Error(`wrong point at index ${dt}`)});const nt=bitLen(BigInt(tt.length)),ot=nt>12?nt-3:nt>4?nt-2:nt?2:1,it=(1<<ot)-1,st=new Array(it+1).fill(et.ZERO),at=Math.floor((o.BITS-1)/ot)*ot;let ct=et.ZERO;for(let lt=at;lt>=0;lt-=ot){st.fill(et.ZERO);for(let ht=0;ht<rt.length;ht++){const mt=rt[ht],ft=Number(mt>>BigInt(lt)&BigInt(it));st[ft]=st[ft].add(tt[ht])}let dt=et.ZERO;for(let ht=st.length-1,mt=et.ZERO;ht>0;ht--)mt=mt.add(st[ht]),dt=dt.add(mt);if(ct=ct.add(dt),lt!==0)for(let ht=0;ht<ot;ht++)ct=ct.double()}return ct}function validateBasic(et){return validateField(et.Fp),validateObject(et,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...nLength(et.n,et.nBitLength),...et,p:et.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function validateSigVerOpts(et){et.lowS!==void 0&&abool("lowS",et.lowS),et.prehash!==void 0&&abool("prehash",et.prehash)}function validatePointOpts(et){const o=validateBasic(et);validateObject(o,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:tt,Fp:rt,a:nt}=o;if(tt){if(!rt.eql(nt,rt.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof tt!="object"||typeof tt.beta!="bigint"||typeof tt.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...o})}const{bytesToNumberBE:b2n,hexToBytes:h2b}=ut,DER={Err:class extends Error{constructor(o=""){super(o)}},_tlv:{encode:(et,o)=>{const{Err:tt}=DER;if(et<0||et>256)throw new tt("tlv.encode: wrong tag");if(o.length&1)throw new tt("tlv.encode: unpadded data");const rt=o.length/2,nt=numberToHexUnpadded$1(rt);if(nt.length/2&128)throw new tt("tlv.encode: long form length too big");const ot=rt>127?numberToHexUnpadded$1(nt.length/2|128):"";return`${numberToHexUnpadded$1(et)}${ot}${nt}${o}`},decode(et,o){const{Err:tt}=DER;let rt=0;if(et<0||et>256)throw new tt("tlv.encode: wrong tag");if(o.length<2||o[rt++]!==et)throw new tt("tlv.decode: wrong tlv");const nt=o[rt++],ot=!!(nt&128);let it=0;if(!ot)it=nt;else{const at=nt&127;if(!at)throw new tt("tlv.decode(long): indefinite length not supported");if(at>4)throw new tt("tlv.decode(long): byte length is too big");const ct=o.subarray(rt,rt+at);if(ct.length!==at)throw new tt("tlv.decode: length bytes not complete");if(ct[0]===0)throw new tt("tlv.decode(long): zero leftmost byte");for(const lt of ct)it=it<<8|lt;if(rt+=at,it<128)throw new tt("tlv.decode(long): not minimal encoding")}const st=o.subarray(rt,rt+it);if(st.length!==it)throw new tt("tlv.decode: wrong value length");return{v:st,l:o.subarray(rt+it)}}},_int:{encode(et){const{Err:o}=DER;if(et<_0n$3)throw new o("integer: negative integers are not allowed");let tt=numberToHexUnpadded$1(et);if(Number.parseInt(tt[0],16)&8&&(tt="00"+tt),tt.length&1)throw new o("unexpected assertion");return tt},decode(et){const{Err:o}=DER;if(et[0]&128)throw new o("Invalid signature integer: negative");if(et[0]===0&&!(et[1]&128))throw new o("Invalid signature integer: unnecessary leading zero");return b2n(et)}},toSig(et){const{Err:o,_int:tt,_tlv:rt}=DER,nt=typeof et=="string"?h2b(et):et;abytes(nt);const{v:ot,l:it}=rt.decode(48,nt);if(it.length)throw new o("Invalid signature: left bytes after parsing");const{v:st,l:at}=rt.decode(2,ot),{v:ct,l:lt}=rt.decode(2,at);if(lt.length)throw new o("Invalid signature: left bytes after parsing");return{r:tt.decode(st),s:tt.decode(ct)}},hexFromSig(et){const{_tlv:o,_int:tt}=DER,rt=`${o.encode(2,tt.encode(et.r))}${o.encode(2,tt.encode(et.s))}`;return o.encode(48,rt)}},_0n$3=BigInt(0),_1n$5=BigInt(1);BigInt(2);const _3n$2=BigInt(3);BigInt(4);function weierstrassPoints(et){const o=validatePointOpts(et),{Fp:tt}=o,rt=Field$1(o.n,o.nBitLength),nt=o.toBytes||((pt,yt,gt)=>{const bt=yt.toAffine();return concatBytes$1(Uint8Array.from([4]),tt.toBytes(bt.x),tt.toBytes(bt.y))}),ot=o.fromBytes||(pt=>{const yt=pt.subarray(1),gt=tt.fromBytes(yt.subarray(0,tt.BYTES)),bt=tt.fromBytes(yt.subarray(tt.BYTES,2*tt.BYTES));return{x:gt,y:bt}});function it(pt){const{a:yt,b:gt}=o,bt=tt.sqr(pt),xt=tt.mul(bt,pt);return tt.add(tt.add(xt,tt.mul(pt,yt)),gt)}if(!tt.eql(tt.sqr(o.Gy),it(o.Gx)))throw new Error("bad generator point: equation left != right");function st(pt){return inRange(pt,_1n$5,o.n)}function at(pt){const{allowedPrivateKeyLengths:yt,nByteLength:gt,wrapPrivateKey:bt,n:xt}=o;if(yt&&typeof pt!="bigint"){if(isBytes$2(pt)&&(pt=bytesToHex$2(pt)),typeof pt!="string"||!yt.includes(pt.length))throw new Error("Invalid key");pt=pt.padStart(gt*2,"0")}let vt;try{vt=typeof pt=="bigint"?pt:bytesToNumberBE(ensureBytes$1("private key",pt,gt))}catch{throw new Error(`private key must be ${gt} bytes, hex or bigint, not ${typeof pt}`)}return bt&&(vt=mod$1(vt,xt)),aInRange("private key",vt,_1n$5,xt),vt}function ct(pt){if(!(pt instanceof ht))throw new Error("ProjectivePoint expected")}const lt=memoized((pt,yt)=>{const{px:gt,py:bt,pz:xt}=pt;if(tt.eql(xt,tt.ONE))return{x:gt,y:bt};const vt=pt.is0();yt==null&&(yt=vt?tt.ONE:tt.inv(xt));const Et=tt.mul(gt,yt),Ct=tt.mul(bt,yt),St=tt.mul(xt,yt);if(vt)return{x:tt.ZERO,y:tt.ZERO};if(!tt.eql(St,tt.ONE))throw new Error("invZ was invalid");return{x:Et,y:Ct}}),dt=memoized(pt=>{if(pt.is0()){if(o.allowInfinityPoint&&!tt.is0(pt.py))return;throw new Error("bad point: ZERO")}const{x:yt,y:gt}=pt.toAffine();if(!tt.isValid(yt)||!tt.isValid(gt))throw new Error("bad point: x or y not FE");const bt=tt.sqr(gt),xt=it(yt);if(!tt.eql(bt,xt))throw new Error("bad point: equation left != right");if(!pt.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class ht{constructor(yt,gt,bt){if(this.px=yt,this.py=gt,this.pz=bt,yt==null||!tt.isValid(yt))throw new Error("x required");if(gt==null||!tt.isValid(gt))throw new Error("y required");if(bt==null||!tt.isValid(bt))throw new Error("z required");Object.freeze(this)}static fromAffine(yt){const{x:gt,y:bt}=yt||{};if(!yt||!tt.isValid(gt)||!tt.isValid(bt))throw new Error("invalid affine point");if(yt instanceof ht)throw new Error("projective point not allowed");const xt=vt=>tt.eql(vt,tt.ZERO);return xt(gt)&&xt(bt)?ht.ZERO:new ht(gt,bt,tt.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(yt){const gt=tt.invertBatch(yt.map(bt=>bt.pz));return yt.map((bt,xt)=>bt.toAffine(gt[xt])).map(ht.fromAffine)}static fromHex(yt){const gt=ht.fromAffine(ot(ensureBytes$1("pointHex",yt)));return gt.assertValidity(),gt}static fromPrivateKey(yt){return ht.BASE.multiply(at(yt))}static msm(yt,gt){return pippenger(ht,rt,yt,gt)}_setWindowSize(yt){ft.setWindowSize(this,yt)}assertValidity(){dt(this)}hasEvenY(){const{y:yt}=this.toAffine();if(tt.isOdd)return!tt.isOdd(yt);throw new Error("Field doesn't support isOdd")}equals(yt){ct(yt);const{px:gt,py:bt,pz:xt}=this,{px:vt,py:Et,pz:Ct}=yt,St=tt.eql(tt.mul(gt,Ct),tt.mul(vt,xt)),At=tt.eql(tt.mul(bt,Ct),tt.mul(Et,xt));return St&&At}negate(){return new ht(this.px,tt.neg(this.py),this.pz)}double(){const{a:yt,b:gt}=o,bt=tt.mul(gt,_3n$2),{px:xt,py:vt,pz:Et}=this;let Ct=tt.ZERO,St=tt.ZERO,At=tt.ZERO,kt=tt.mul(xt,xt),It=tt.mul(vt,vt),Nt=tt.mul(Et,Et),Lt=tt.mul(xt,vt);return Lt=tt.add(Lt,Lt),At=tt.mul(xt,Et),At=tt.add(At,At),Ct=tt.mul(yt,At),St=tt.mul(bt,Nt),St=tt.add(Ct,St),Ct=tt.sub(It,St),St=tt.add(It,St),St=tt.mul(Ct,St),Ct=tt.mul(Lt,Ct),At=tt.mul(bt,At),Nt=tt.mul(yt,Nt),Lt=tt.sub(kt,Nt),Lt=tt.mul(yt,Lt),Lt=tt.add(Lt,At),At=tt.add(kt,kt),kt=tt.add(At,kt),kt=tt.add(kt,Nt),kt=tt.mul(kt,Lt),St=tt.add(St,kt),Nt=tt.mul(vt,Et),Nt=tt.add(Nt,Nt),kt=tt.mul(Nt,Lt),Ct=tt.sub(Ct,kt),At=tt.mul(Nt,It),At=tt.add(At,At),At=tt.add(At,At),new ht(Ct,St,At)}add(yt){ct(yt);const{px:gt,py:bt,pz:xt}=this,{px:vt,py:Et,pz:Ct}=yt;let St=tt.ZERO,At=tt.ZERO,kt=tt.ZERO;const It=o.a,Nt=tt.mul(o.b,_3n$2);let Lt=tt.mul(gt,vt),Mt=tt.mul(bt,Et),zt=tt.mul(xt,Ct),Ut=tt.add(gt,bt),Xt=tt.add(vt,Et);Ut=tt.mul(Ut,Xt),Xt=tt.add(Lt,Mt),Ut=tt.sub(Ut,Xt),Xt=tt.add(gt,xt);let Wt=tt.add(vt,Ct);return Xt=tt.mul(Xt,Wt),Wt=tt.add(Lt,zt),Xt=tt.sub(Xt,Wt),Wt=tt.add(bt,xt),St=tt.add(Et,Ct),Wt=tt.mul(Wt,St),St=tt.add(Mt,zt),Wt=tt.sub(Wt,St),kt=tt.mul(It,Xt),St=tt.mul(Nt,zt),kt=tt.add(St,kt),St=tt.sub(Mt,kt),kt=tt.add(Mt,kt),At=tt.mul(St,kt),Mt=tt.add(Lt,Lt),Mt=tt.add(Mt,Lt),zt=tt.mul(It,zt),Xt=tt.mul(Nt,Xt),Mt=tt.add(Mt,zt),zt=tt.sub(Lt,zt),zt=tt.mul(It,zt),Xt=tt.add(Xt,zt),Lt=tt.mul(Mt,Xt),At=tt.add(At,Lt),Lt=tt.mul(Wt,Xt),St=tt.mul(Ut,St),St=tt.sub(St,Lt),Lt=tt.mul(Ut,Mt),kt=tt.mul(Wt,kt),kt=tt.add(kt,Lt),new ht(St,At,kt)}subtract(yt){return this.add(yt.negate())}is0(){return this.equals(ht.ZERO)}wNAF(yt){return ft.wNAFCached(this,yt,ht.normalizeZ)}multiplyUnsafe(yt){aInRange("scalar",yt,_0n$3,o.n);const gt=ht.ZERO;if(yt===_0n$3)return gt;if(yt===_1n$5)return this;const{endo:bt}=o;if(!bt)return ft.unsafeLadder(this,yt);let{k1neg:xt,k1:vt,k2neg:Et,k2:Ct}=bt.splitScalar(yt),St=gt,At=gt,kt=this;for(;vt>_0n$3||Ct>_0n$3;)vt&_1n$5&&(St=St.add(kt)),Ct&_1n$5&&(At=At.add(kt)),kt=kt.double(),vt>>=_1n$5,Ct>>=_1n$5;return xt&&(St=St.negate()),Et&&(At=At.negate()),At=new ht(tt.mul(At.px,bt.beta),At.py,At.pz),St.add(At)}multiply(yt){const{endo:gt,n:bt}=o;aInRange("scalar",yt,_1n$5,bt);let xt,vt;if(gt){const{k1neg:Et,k1:Ct,k2neg:St,k2:At}=gt.splitScalar(yt);let{p:kt,f:It}=this.wNAF(Ct),{p:Nt,f:Lt}=this.wNAF(At);kt=ft.constTimeNegate(Et,kt),Nt=ft.constTimeNegate(St,Nt),Nt=new ht(tt.mul(Nt.px,gt.beta),Nt.py,Nt.pz),xt=kt.add(Nt),vt=It.add(Lt)}else{const{p:Et,f:Ct}=this.wNAF(yt);xt=Et,vt=Ct}return ht.normalizeZ([xt,vt])[0]}multiplyAndAddUnsafe(yt,gt,bt){const xt=ht.BASE,vt=(Ct,St)=>St===_0n$3||St===_1n$5||!Ct.equals(xt)?Ct.multiplyUnsafe(St):Ct.multiply(St),Et=vt(this,gt).add(vt(yt,bt));return Et.is0()?void 0:Et}toAffine(yt){return lt(this,yt)}isTorsionFree(){const{h:yt,isTorsionFree:gt}=o;if(yt===_1n$5)return!0;if(gt)return gt(ht,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:yt,clearCofactor:gt}=o;return yt===_1n$5?this:gt?gt(ht,this):this.multiplyUnsafe(o.h)}toRawBytes(yt=!0){return abool("isCompressed",yt),this.assertValidity(),nt(ht,this,yt)}toHex(yt=!0){return abool("isCompressed",yt),bytesToHex$2(this.toRawBytes(yt))}}ht.BASE=new ht(o.Gx,o.Gy,tt.ONE),ht.ZERO=new ht(tt.ZERO,tt.ONE,tt.ZERO);const mt=o.nBitLength,ft=wNAF(ht,o.endo?Math.ceil(mt/2):mt);return{CURVE:o,ProjectivePoint:ht,normPrivateKeyToScalar:at,weierstrassEquation:it,isWithinCurveOrder:st}}function validateOpts$2(et){const o=validateBasic(et);return validateObject(o,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...o})}function weierstrass$1(et){const o=validateOpts$2(et),{Fp:tt,n:rt}=o,nt=tt.BYTES+1,ot=2*tt.BYTES+1;function it(zt){return mod$1(zt,rt)}function st(zt){return invert$1(zt,rt)}const{ProjectivePoint:at,normPrivateKeyToScalar:ct,weierstrassEquation:lt,isWithinCurveOrder:dt}=weierstrassPoints({...o,toBytes(zt,Ut,Xt){const Wt=Ut.toAffine(),Ft=tt.toBytes(Wt.x),qt=concatBytes$1;return abool("isCompressed",Xt),Xt?qt(Uint8Array.from([Ut.hasEvenY()?2:3]),Ft):qt(Uint8Array.from([4]),Ft,tt.toBytes(Wt.y))},fromBytes(zt){const Ut=zt.length,Xt=zt[0],Wt=zt.subarray(1);if(Ut===nt&&(Xt===2||Xt===3)){const Ft=bytesToNumberBE(Wt);if(!inRange(Ft,_1n$5,tt.ORDER))throw new Error("Point is not on curve");const qt=lt(Ft);let Pt;try{Pt=tt.sqrt(qt)}catch(jt){const Gt=jt instanceof Error?": "+jt.message:"";throw new Error("Point is not on curve"+Gt)}const Yt=(Pt&_1n$5)===_1n$5;return(Xt&1)===1!==Yt&&(Pt=tt.neg(Pt)),{x:Ft,y:Pt}}else if(Ut===ot&&Xt===4){const Ft=tt.fromBytes(Wt.subarray(0,tt.BYTES)),qt=tt.fromBytes(Wt.subarray(tt.BYTES,2*tt.BYTES));return{x:Ft,y:qt}}else throw new Error(`Point of length ${Ut} was invalid. Expected ${nt} compressed bytes or ${ot} uncompressed bytes`)}}),ht=zt=>bytesToHex$2(numberToBytesBE(zt,o.nByteLength));function mt(zt){const Ut=rt>>_1n$5;return zt>Ut}function ft(zt){return mt(zt)?it(-zt):zt}const pt=(zt,Ut,Xt)=>bytesToNumberBE(zt.slice(Ut,Xt));class yt{constructor(Ut,Xt,Wt){this.r=Ut,this.s=Xt,this.recovery=Wt,this.assertValidity()}static fromCompact(Ut){const Xt=o.nByteLength;return Ut=ensureBytes$1("compactSignature",Ut,Xt*2),new yt(pt(Ut,0,Xt),pt(Ut,Xt,2*Xt))}static fromDER(Ut){const{r:Xt,s:Wt}=DER.toSig(ensureBytes$1("DER",Ut));return new yt(Xt,Wt)}assertValidity(){aInRange("r",this.r,_1n$5,rt),aInRange("s",this.s,_1n$5,rt)}addRecoveryBit(Ut){return new yt(this.r,this.s,Ut)}recoverPublicKey(Ut){const{r:Xt,s:Wt,recovery:Ft}=this,qt=Ct(ensureBytes$1("msgHash",Ut));if(Ft==null||![0,1,2,3].includes(Ft))throw new Error("recovery id invalid");const Pt=Ft===2||Ft===3?Xt+o.n:Xt;if(Pt>=tt.ORDER)throw new Error("recovery id 2 or 3 invalid");const Yt=Ft&1?"03":"02",Qt=at.fromHex(Yt+ht(Pt)),jt=st(Pt),Gt=it(-qt*jt),rr=it(Wt*jt),Ht=at.BASE.multiplyAndAddUnsafe(Qt,Gt,rr);if(!Ht)throw new Error("point at infinify");return Ht.assertValidity(),Ht}hasHighS(){return mt(this.s)}normalizeS(){return this.hasHighS()?new yt(this.r,it(-this.s),this.recovery):this}toDERRawBytes(){return hexToBytes$2(this.toDERHex())}toDERHex(){return DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return hexToBytes$2(this.toCompactHex())}toCompactHex(){return ht(this.r)+ht(this.s)}}const gt={isValidPrivateKey(zt){try{return ct(zt),!0}catch{return!1}},normPrivateKeyToScalar:ct,randomPrivateKey:()=>{const zt=getMinHashLength(o.n);return mapHashToField(o.randomBytes(zt),o.n)},precompute(zt=8,Ut=at.BASE){return Ut._setWindowSize(zt),Ut.multiply(BigInt(3)),Ut}};function bt(zt,Ut=!0){return at.fromPrivateKey(zt).toRawBytes(Ut)}function xt(zt){const Ut=isBytes$2(zt),Xt=typeof zt=="string",Wt=(Ut||Xt)&&zt.length;return Ut?Wt===nt||Wt===ot:Xt?Wt===2*nt||Wt===2*ot:zt instanceof at}function vt(zt,Ut,Xt=!0){if(xt(zt))throw new Error("first arg must be private key");if(!xt(Ut))throw new Error("second arg must be public key");return at.fromHex(Ut).multiply(ct(zt)).toRawBytes(Xt)}const Et=o.bits2int||function(zt){const Ut=bytesToNumberBE(zt),Xt=zt.length*8-o.nBitLength;return Xt>0?Ut>>BigInt(Xt):Ut},Ct=o.bits2int_modN||function(zt){return it(Et(zt))},St=bitMask(o.nBitLength);function At(zt){return aInRange(`num < 2^${o.nBitLength}`,zt,_0n$3,St),numberToBytesBE(zt,o.nByteLength)}function kt(zt,Ut,Xt=It){if(["recovered","canonical"].some(Zt=>Zt in Xt))throw new Error("sign() legacy options not supported");const{hash:Wt,randomBytes:Ft}=o;let{lowS:qt,prehash:Pt,extraEntropy:Yt}=Xt;qt==null&&(qt=!0),zt=ensureBytes$1("msgHash",zt),validateSigVerOpts(Xt),Pt&&(zt=ensureBytes$1("prehashed msgHash",Wt(zt)));const Qt=Ct(zt),jt=ct(Ut),Gt=[At(jt),At(Qt)];if(Yt!=null&&Yt!==!1){const Zt=Yt===!0?Ft(tt.BYTES):Yt;Gt.push(ensureBytes$1("extraEntropy",Zt))}const rr=concatBytes$1(...Gt),Ht=Qt;function dr(Zt){const Jt=Et(Zt);if(!dt(Jt))return;const tr=st(Jt),_t=at.BASE.multiply(Jt).toAffine(),Bt=it(_t.x);if(Bt===_0n$3)return;const Vt=it(tr*it(Ht+Bt*jt));if(Vt===_0n$3)return;let er=(_t.x===Bt?0:2)|Number(_t.y&_1n$5),ar=Vt;return qt&&mt(Vt)&&(ar=ft(Vt),er^=1),new yt(Bt,ar,er)}return{seed:rr,k2sig:dr}}const It={lowS:o.lowS,prehash:!1},Nt={lowS:o.lowS,prehash:!1};function Lt(zt,Ut,Xt=It){const{seed:Wt,k2sig:Ft}=kt(zt,Ut,Xt),qt=o;return createHmacDrbg(qt.hash.outputLen,qt.nByteLength,qt.hmac)(Wt,Ft)}at.BASE._setWindowSize(8);function Mt(zt,Ut,Xt,Wt=Nt){var _t;const Ft=zt;if(Ut=ensureBytes$1("msgHash",Ut),Xt=ensureBytes$1("publicKey",Xt),"strict"in Wt)throw new Error("options.strict was renamed to lowS");validateSigVerOpts(Wt);const{lowS:qt,prehash:Pt}=Wt;let Yt,Qt;try{if(typeof Ft=="string"||isBytes$2(Ft))try{Yt=yt.fromDER(Ft)}catch(Bt){if(!(Bt instanceof DER.Err))throw Bt;Yt=yt.fromCompact(Ft)}else if(typeof Ft=="object"&&typeof Ft.r=="bigint"&&typeof Ft.s=="bigint"){const{r:Bt,s:Vt}=Ft;Yt=new yt(Bt,Vt)}else throw new Error("PARSE");Qt=at.fromHex(Xt)}catch(Bt){if(Bt.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(qt&&Yt.hasHighS())return!1;Pt&&(Ut=o.hash(Ut));const{r:jt,s:Gt}=Yt,rr=Ct(Ut),Ht=st(Gt),dr=it(rr*Ht),Zt=it(jt*Ht),Jt=(_t=at.BASE.multiplyAndAddUnsafe(Qt,dr,Zt))==null?void 0:_t.toAffine();return Jt?it(Jt.x)===jt:!1}return{CURVE:o,getPublicKey:bt,getSharedSecret:vt,sign:Lt,verify:Mt,ProjectivePoint:at,Signature:yt,utils:gt}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function getHash(et){return{hash:et,hmac:(o,...tt)=>hmac(et,o,concatBytes$2(...tt)),randomBytes:randomBytes$1}}function createCurve(et,o){const tt=rt=>weierstrass$1({...et,...getHash(rt)});return Object.freeze({...tt(o),create:tt})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const secp256k1P=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),secp256k1N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),_1n$4=BigInt(1),_2n$3=BigInt(2),divNearest$1=(et,o)=>(et+o/_2n$3)/o;function sqrtMod$1(et){const o=secp256k1P,tt=BigInt(3),rt=BigInt(6),nt=BigInt(11),ot=BigInt(22),it=BigInt(23),st=BigInt(44),at=BigInt(88),ct=et*et*et%o,lt=ct*ct*et%o,dt=pow2$1(lt,tt,o)*lt%o,ht=pow2$1(dt,tt,o)*lt%o,mt=pow2$1(ht,_2n$3,o)*ct%o,ft=pow2$1(mt,nt,o)*mt%o,pt=pow2$1(ft,ot,o)*ft%o,yt=pow2$1(pt,st,o)*pt%o,gt=pow2$1(yt,at,o)*yt%o,bt=pow2$1(gt,st,o)*pt%o,xt=pow2$1(bt,tt,o)*lt%o,vt=pow2$1(xt,it,o)*ft%o,Et=pow2$1(vt,rt,o)*ct%o,Ct=pow2$1(Et,_2n$3,o);if(!Fp$1.eql(Fp$1.sqr(Ct),et))throw new Error("Cannot find square root");return Ct}const Fp$1=Field$1(secp256k1P,void 0,void 0,{sqrt:sqrtMod$1}),secp256k1=createCurve({a:BigInt(0),b:BigInt(7),Fp:Fp$1,n:secp256k1N,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:et=>{const o=secp256k1N,tt=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),rt=-_1n$4*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),nt=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),ot=tt,it=BigInt("0x100000000000000000000000000000000"),st=divNearest$1(ot*et,o),at=divNearest$1(-rt*et,o);let ct=mod$1(et-st*tt-at*nt,o),lt=mod$1(-st*rt-at*ot,o);const dt=ct>it,ht=lt>it;if(dt&&(ct=o-ct),ht&&(lt=o-lt),ct>it||lt>it)throw new Error("splitScalar: Endomorphism failed, k="+et);return{k1neg:dt,k1:ct,k2neg:ht,k2:lt}}}},sha256$3);BigInt(0);secp256k1.ProjectivePoint;function getAction(et,o,tt){const rt=et[o.name];if(typeof rt=="function")return rt;const nt=et[tt];return typeof nt=="function"?nt:ot=>o(et,ot)}const version$6="2.13.8",getVersion$1=()=>`@wagmi/core@${version$6}`;var __classPrivateFieldGet$1=function(et,o,tt,rt){if(tt==="a"&&!rt)throw new TypeError("Private accessor was defined without a getter");if(typeof o=="function"?et!==o||!rt:!o.has(et))throw new TypeError("Cannot read private member from an object whose class did not declare it");return tt==="m"?rt:tt==="a"?rt.call(et):rt?rt.value:o.get(et)},_BaseError_instances,_BaseError_walk;let BaseError$1=class _s extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return getVersion$1()}constructor(o,tt={}){var ot;super(),_BaseError_instances.add(this),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});const rt=tt.cause instanceof _s?tt.cause.details:(ot=tt.cause)!=null&&ot.message?tt.cause.message:tt.details,nt=tt.cause instanceof _s&&tt.cause.docsPath||tt.docsPath;this.message=[o||"An error occurred.","",...tt.metaMessages?[...tt.metaMessages,""]:[],...nt?[`Docs: ${this.docsBaseUrl}${nt}.html${tt.docsSlug?`#${tt.docsSlug}`:""}`]:[],...rt?[`Details: ${rt}`]:[],`Version: ${this.version}`].join(`
`),tt.cause&&(this.cause=tt.cause),this.details=rt,this.docsPath=nt,this.metaMessages=tt.metaMessages,this.shortMessage=o}walk(o){return __classPrivateFieldGet$1(this,_BaseError_instances,"m",_BaseError_walk).call(this,this,o)}};_BaseError_instances=new WeakSet,_BaseError_walk=function et(o,tt){return tt!=null&&tt(o)?o:o.cause?__classPrivateFieldGet$1(this,_BaseError_instances,"m",et).call(this,o.cause,tt):o};class ChainNotConfiguredError extends BaseError$1{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class ConnectorAlreadyConnectedError extends BaseError$1{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class ConnectorNotConnectedError extends BaseError$1{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class ConnectorAccountNotFoundError extends BaseError$1{constructor({address:o,connector:tt}){super(`Account "${o}" not found for connector "${tt.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}class ConnectorChainMismatchError extends BaseError$1{constructor({connectionChainId:o,connectorChainId:tt}){super(`The current chain of the connector (id: ${tt}) does not match the connection's chain (id: ${o}).`,{metaMessages:[`Current Chain ID: ${tt}`,`Expected Chain ID: ${o}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorChainMismatchError"})}}class ConnectorUnavailableReconnectingError extends BaseError$1{constructor({connector:o}){super(`Connector "${o.name}" unavailable while reconnecting.`,{details:["During the reconnection step, the only connector methods guaranteed to be available are: `id`, `name`, `type`, `uuid`.","All other methods are not guaranteed to be available until reconnection completes and connectors are fully restored.","This error commonly occurs for connectors that asynchronously inject after reconnection has already started."].join(" ")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorUnavailableReconnectingError"})}}async function connect$1(et,o){var rt;let tt;if(typeof o.connector=="function"?tt=et._internal.connectors.setup(o.connector):tt=o.connector,tt.uid===et.state.current)throw new ConnectorAlreadyConnectedError;try{et.setState(it=>({...it,status:"connecting"})),tt.emitter.emit("message",{type:"connecting"});const nt=await tt.connect({chainId:o.chainId}),ot=nt.accounts;return tt.emitter.off("connect",et._internal.events.connect),tt.emitter.on("change",et._internal.events.change),tt.emitter.on("disconnect",et._internal.events.disconnect),await((rt=et.storage)==null?void 0:rt.setItem("recentConnectorId",tt.id)),et.setState(it=>({...it,connections:new Map(it.connections).set(tt.uid,{accounts:ot,chainId:nt.chainId,connector:tt}),current:tt.uid,status:"connected"})),{accounts:ot,chainId:nt.chainId}}catch(nt){throw et.setState(ot=>({...ot,status:ot.current?"connected":"disconnected"})),nt}}const size$1=256;let index$3=size$1,buffer$1;function uid$1(et=11){if(!buffer$1||index$3+et>size$1*2){buffer$1="",index$3=0;for(let o=0;o<size$1;o++)buffer$1+=(256+Math.random()*256|0).toString(16).substring(1)}return buffer$1.substring(index$3,index$3+++et)}function createClient(et){const{batch:o,cacheTime:tt=et.pollingInterval??4e3,ccipRead:rt,key:nt="base",name:ot="Base Client",pollingInterval:it=4e3,type:st="base"}=et,at=et.chain,ct=et.account?parseAccount(et.account):void 0,{config:lt,request:dt,value:ht}=et.transport({chain:at,pollingInterval:it}),mt={...lt,...ht},ft={account:ct,batch:o,cacheTime:tt,ccipRead:rt,chain:at,key:nt,name:ot,pollingInterval:it,request:dt,transport:mt,type:st,uid:uid$1()};function pt(yt){return gt=>{const bt=gt(yt);for(const vt in ft)delete bt[vt];const xt={...yt,...bt};return Object.assign(xt,{extend:pt(xt)})}}return Object.assign(ft,{extend:pt(ft)})}function createTransport({key:et,name:o,request:tt,retryCount:rt=3,retryDelay:nt=150,timeout:ot,type:it},st){const at=uid$1();return{config:{key:et,name:o,request:tt,retryCount:rt,retryDelay:nt,timeout:ot,type:it},request:buildRequest(tt,{retryCount:rt,retryDelay:nt,uid:at}),value:st}}function custom(et,o={}){const{key:tt="custom",name:rt="Custom Provider",retryDelay:nt}=o;return({retryCount:ot})=>createTransport({key:tt,name:rt,request:et.request.bind(et),retryCount:o.retryCount??ot,retryDelay:nt,type:"custom"})}class UrlRequiredError extends BaseError$3{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function http(et,o={}){const{batch:tt,fetchOptions:rt,key:nt="http",name:ot="HTTP JSON-RPC",onFetchRequest:it,onFetchResponse:st,retryDelay:at}=o;return({chain:ct,retryCount:lt,timeout:dt})=>{const{batchSize:ht=1e3,wait:mt=0}=typeof tt=="object"?tt:{},ft=o.retryCount??lt,pt=dt??o.timeout??1e4,yt=ct==null?void 0:ct.rpcUrls.default.http[0];if(!yt)throw new UrlRequiredError;const gt=getHttpRpcClient(yt,{fetchOptions:rt,onRequest:it,onResponse:st,timeout:pt});return createTransport({key:nt,name:ot,async request({method:bt,params:xt}){const vt={method:bt,params:xt},{schedule:Et}=createBatchScheduler({id:yt,wait:mt,shouldSplitBatch(kt){return kt.length>ht},fn:kt=>gt.request({body:kt}),sort:(kt,It)=>kt.id-It.id}),Ct=async kt=>tt?Et(kt):[await gt.request({body:kt})],[{error:St,result:At}]=await Ct(vt);if(St)throw new RpcRequestError({body:vt,error:St,url:yt});return At},retryCount:ft,retryDelay:at,timeout:pt,type:"http"},{fetchOptions:rt,url:yt})}}async function getConnectorClient(et,o={}){let tt;if(o.connector){const{connector:ct}=o;if(et.state.status==="reconnecting"&&!ct.getAccounts&&!ct.getChainId)throw new ConnectorUnavailableReconnectingError({connector:ct});const[lt,dt]=await Promise.all([ct.getAccounts(),ct.getChainId()]);tt={accounts:lt,chainId:dt,connector:ct}}else tt=et.state.connections.get(et.state.current);if(!tt)throw new ConnectorNotConnectedError;const rt=o.chainId??tt.chainId,nt=await tt.connector.getChainId();if(nt!==tt.chainId)throw new ConnectorChainMismatchError({connectionChainId:tt.chainId,connectorChainId:nt});const ot=tt.connector;if(ot.getClient)return ot.getClient({chainId:rt});const it=parseAccount(o.account??tt.accounts[0]);if(it.address=getAddress(it.address),o.account&&!tt.accounts.some(ct=>ct.toLowerCase()===it.address.toLowerCase()))throw new ConnectorAccountNotFoundError({address:it.address,connector:ot});const st=et.chains.find(ct=>ct.id===rt),at=await tt.connector.getProvider({chainId:rt});return createClient({account:it,chain:st,name:"Connector Client",transport:ct=>custom(at)({...ct,retryCount:0})})}async function disconnect(et,o={}){var nt,ot;let tt;if(o.connector)tt=o.connector;else{const{connections:it,current:st}=et.state,at=it.get(st);tt=at==null?void 0:at.connector}const rt=et.state.connections;tt&&(await tt.disconnect(),tt.emitter.off("change",et._internal.events.change),tt.emitter.off("disconnect",et._internal.events.disconnect),tt.emitter.on("connect",et._internal.events.connect),rt.delete(tt.uid)),et.setState(it=>{if(rt.size===0)return{...it,connections:new Map,current:null,status:"disconnected"};const st=rt.values().next().value;return{...it,connections:new Map(rt),current:st.connector.uid}});{const it=et.state.current;if(!it)return;const st=(nt=et.state.connections.get(it))==null?void 0:nt.connector;if(!st)return;await((ot=et.storage)==null?void 0:ot.setItem("recentConnectorId",st.id))}}function getUnit(et){return typeof et=="number"?et:et==="wei"?0:Math.abs(weiUnits[et])}function getAccount(et){const o=et.state.current,tt=et.state.connections.get(o),rt=tt==null?void 0:tt.accounts,nt=rt==null?void 0:rt[0],ot=et.chains.find(st=>st.id===(tt==null?void 0:tt.chainId)),it=et.state.status;switch(it){case"connected":return{address:nt,addresses:rt,chain:ot,chainId:tt==null?void 0:tt.chainId,connector:tt==null?void 0:tt.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:it};case"reconnecting":return{address:nt,addresses:rt,chain:ot,chainId:tt==null?void 0:tt.chainId,connector:tt==null?void 0:tt.connector,isConnected:!!nt,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:it};case"connecting":return{address:nt,addresses:rt,chain:ot,chainId:tt==null?void 0:tt.chainId,connector:tt==null?void 0:tt.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:it};case"disconnected":return{address:void 0,addresses:void 0,chain:void 0,chainId:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:it}}}async function multicall(et,o){const{allowFailure:tt=!0,chainId:rt,contracts:nt,...ot}=o,it=et.getClient({chainId:rt});return getAction(it,multicall$1,"multicall")({allowFailure:tt,contracts:nt,...ot})}function readContract(et,o){const{chainId:tt,...rt}=o,nt=et.getClient({chainId:tt});return getAction(nt,readContract$1,"readContract")(rt)}async function readContracts(et,o){var st;const{allowFailure:tt=!0,blockNumber:rt,blockTag:nt,...ot}=o,it=o.contracts;try{const at={};for(const[ht,mt]of it.entries()){const ft=mt.chainId??et.state.chainId;at[ft]||(at[ft]=[]),(st=at[ft])==null||st.push({contract:mt,index:ht})}const ct=()=>Object.entries(at).map(([ht,mt])=>multicall(et,{...ot,allowFailure:tt,blockNumber:rt,blockTag:nt,chainId:Number.parseInt(ht),contracts:mt.map(({contract:ft})=>ft)})),lt=(await Promise.all(ct())).flat(),dt=Object.values(at).flatMap(ht=>ht.map(({index:mt})=>mt));return lt.reduce((ht,mt,ft)=>(ht&&(ht[dt[ft]]=mt),ht),[])}catch(at){if(at instanceof ContractFunctionExecutionError)throw at;const ct=()=>it.map(lt=>readContract(et,{...lt,blockNumber:rt,blockTag:nt}));return tt?(await Promise.allSettled(ct())).map(lt=>lt.status==="fulfilled"?{result:lt.value,status:"success"}:{error:lt.reason,result:void 0,status:"failure"}):await Promise.all(ct())}}async function getBalance(et,o){const{address:tt,blockNumber:rt,blockTag:nt,chainId:ot,token:it,unit:st="ether"}=o;if(it)try{return getTokenBalance(et,{balanceAddress:tt,chainId:ot,symbolType:"string",tokenAddress:it})}catch(ht){if(ht instanceof ContractFunctionExecutionError){const mt=await getTokenBalance(et,{balanceAddress:tt,chainId:ot,symbolType:"bytes32",tokenAddress:it}),ft=hexToString(trim$1(mt.symbol,{dir:"right"}));return{...mt,symbol:ft}}throw ht}const at=et.getClient({chainId:ot}),lt=await getAction(at,getBalance$1,"getBalance")(rt?{address:tt,blockNumber:rt}:{address:tt,blockTag:nt}),dt=et.chains.find(ht=>ht.id===ot)??at.chain;return{decimals:dt.nativeCurrency.decimals,formatted:formatUnits(lt,getUnit(st)),symbol:dt.nativeCurrency.symbol,value:lt}}async function getTokenBalance(et,o){const{balanceAddress:tt,chainId:rt,symbolType:nt,tokenAddress:ot,unit:it}=o,st={abi:[{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:nt}]}],address:ot},[at,ct,lt]=await readContracts(et,{allowFailure:!1,contracts:[{...st,functionName:"balanceOf",args:[tt],chainId:rt},{...st,functionName:"decimals",chainId:rt},{...st,functionName:"symbol",chainId:rt}]}),dt=formatUnits(at??"0",getUnit(it??ct));return{decimals:ct,formatted:dt,symbol:lt,value:at}}function getBlockNumber(et,o={}){const{chainId:tt,...rt}=o,nt=et.getClient({chainId:tt});return getAction(nt,getBlockNumber$1,"getBlockNumber")(rt)}function getChainId(et){return et.state.chainId}function deepEqual(et,o){if(et===o)return!0;if(et&&o&&typeof et=="object"&&typeof o=="object"){if(et.constructor!==o.constructor)return!1;let tt,rt;if(Array.isArray(et)&&Array.isArray(o)){if(tt=et.length,tt!==o.length)return!1;for(rt=tt;rt--!==0;)if(!deepEqual(et[rt],o[rt]))return!1;return!0}if(et.valueOf!==Object.prototype.valueOf)return et.valueOf()===o.valueOf();if(et.toString!==Object.prototype.toString)return et.toString()===o.toString();const nt=Object.keys(et);if(tt=nt.length,tt!==Object.keys(o).length)return!1;for(rt=tt;rt--!==0;)if(!Object.prototype.hasOwnProperty.call(o,nt[rt]))return!1;for(rt=tt;rt--!==0;){const ot=nt[rt];if(ot&&!deepEqual(et[ot],o[ot]))return!1}return!0}return et!==et&&o!==o}let previousChains=[];function getChains(et){const o=et.chains;return deepEqual(previousChains,o)?previousChains:(previousChains=o,o)}let previousConnections=[];function getConnections(et){const o=[...et.state.connections.values()];return et.state.status==="reconnecting"||deepEqual(previousConnections,o)?previousConnections:(previousConnections=o,o)}let previousConnectors=[];function getConnectors(et){const o=et.connectors;return deepEqual(previousConnectors,o)?previousConnectors:(previousConnectors=o,o)}function getEnsAddress(et,o){const{chainId:tt,...rt}=o,nt=et.getClient({chainId:tt});return getAction(nt,getEnsAddress$1,"getEnsAddress")(rt)}function getEnsAvatar(et,o){const{chainId:tt,...rt}=o,nt=et.getClient({chainId:tt});return getAction(nt,getEnsAvatar$1,"getEnsAvatar")(rt)}function getEnsName(et,o){const{chainId:tt,...rt}=o,nt=et.getClient({chainId:tt});return getAction(nt,getEnsName$1,"getEnsName")(rt)}let isReconnecting=!1;async function reconnect(et,o={}){var ct,lt;if(isReconnecting)return[];isReconnecting=!0,et.setState(dt=>({...dt,status:dt.current?"reconnecting":"connecting"}));const tt=[];if((ct=o.connectors)!=null&&ct.length)for(const dt of o.connectors){let ht;typeof dt=="function"?ht=et._internal.connectors.setup(dt):ht=dt,tt.push(ht)}else tt.push(...et.connectors);let rt;try{rt=await((lt=et.storage)==null?void 0:lt.getItem("recentConnectorId"))}catch{}const nt={};for(const[,dt]of et.state.connections)nt[dt.connector.id]=1;rt&&(nt[rt]=0);const ot=Object.keys(nt).length>0?[...tt].sort((dt,ht)=>(nt[dt.id]??10)-(nt[ht.id]??10)):tt;let it=!1;const st=[],at=[];for(const dt of ot){const ht=await dt.getProvider().catch(()=>{});if(!ht||at.some(pt=>pt===ht)||!await dt.isAuthorized())continue;const ft=await dt.connect({isReconnecting:!0}).catch(()=>null);ft&&(dt.emitter.off("connect",et._internal.events.connect),dt.emitter.on("change",et._internal.events.change),dt.emitter.on("disconnect",et._internal.events.disconnect),et.setState(pt=>{const yt=new Map(it?pt.connections:new Map).set(dt.uid,{accounts:ft.accounts,chainId:ft.chainId,connector:dt});return{...pt,current:it?pt.current:dt.uid,connections:yt}}),st.push({accounts:ft.accounts,chainId:ft.chainId,connector:dt}),at.push(ht),it=!0)}return(et.state.status==="reconnecting"||et.state.status==="connecting")&&(it?et.setState(dt=>({...dt,status:"connected"})):et.setState(dt=>({...dt,connections:new Map,current:null,status:"disconnected"}))),isReconnecting=!1,st}async function signMessage(et,o){const{account:tt,connector:rt,...nt}=o;let ot;return typeof tt=="object"&&tt.type==="local"?ot=et.getClient():ot=await getConnectorClient(et,{account:tt,connector:rt}),getAction(ot,signMessage$1,"signMessage")({...nt,...tt?{account:tt}:{}})}class ProviderNotFoundError extends BaseError$1{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class SwitchChainNotSupportedError extends BaseError$1{constructor({connector:o}){super(`"${o.name}" does not support programmatic chain switching.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainNotSupportedError"})}}async function switchChain(et,o){var it;const{addEthereumChainParameter:tt,chainId:rt}=o,nt=et.state.connections.get(((it=o.connector)==null?void 0:it.uid)??et.state.current);if(nt){const st=nt.connector;if(!st.switchChain)throw new SwitchChainNotSupportedError({connector:st});return await st.switchChain({addEthereumChainParameter:tt,chainId:rt})}const ot=et.chains.find(st=>st.id===rt);if(!ot)throw new ChainNotConfiguredError;return et.setState(st=>({...st,chainId:rt})),ot}function watchAccount(et,o){const{onChange:tt}=o;return et.subscribe(()=>getAccount(et),tt,{equalityFn(rt,nt){const{connector:ot,...it}=rt,{connector:st,...at}=nt;return deepEqual(it,at)&&(ot==null?void 0:ot.id)===(st==null?void 0:st.id)&&(ot==null?void 0:ot.uid)===(st==null?void 0:st.uid)}})}function watchBlockNumber(et,o){const{syncConnectedChain:tt=et._internal.syncConnectedChain,...rt}=o;let nt;const ot=at=>{nt&&nt();const ct=et.getClient({chainId:at});return nt=getAction(ct,watchBlockNumber$1,"watchBlockNumber")(rt),nt},it=ot(o.chainId);let st;return tt&&!o.chainId&&(st=et.subscribe(({chainId:at})=>at,async at=>ot(at))),()=>{it==null||it(),st==null||st()}}function watchChainId(et,o){const{onChange:tt}=o;return et.subscribe(rt=>rt.chainId,tt)}function watchConnections(et,o){const{onChange:tt}=o;return et.subscribe(()=>getConnections(et),tt,{equalityFn:deepEqual})}function watchConnectors(et,o){const{onChange:tt}=o;return et._internal.connectors.subscribe((rt,nt)=>{tt(Object.values(rt),nt)})}function createConnector(et){return et}const supportsSimulationIdRegex=/(rabby|trustwallet)/,targetMap={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(et){return et!=null&&et.coinbaseWalletExtension?et.coinbaseWalletExtension:findProvider(et,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(et){return findProvider(et,o=>{if(!o.isMetaMask||o.isBraveWallet&&!o._events&&!o._state)return!1;const tt=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPortal","isRabby","isTokenPocket","isTokenary","isZerion"];for(const rt of tt)if(o[rt])return!1;return!0})}},phantom:{id:"phantom",name:"Phantom",provider(et){var o,tt;return(o=et==null?void 0:et.phantom)!=null&&o.ethereum?(tt=et.phantom)==null?void 0:tt.ethereum:findProvider(et,"isPhantom")}}};injected.type="injected";function injected(et={}){const{shimDisconnect:o=!0,unstable_shimAsyncInject:tt}=et;function rt(){const at=et.target;if(typeof at=="function"){const ct=at();if(ct)return ct}return typeof at=="object"?at:typeof at=="string"?{...targetMap[at]??{id:at,name:`${at[0].toUpperCase()}${at.slice(1)}`,provider:`is${at[0].toUpperCase()}${at.slice(1)}`}}:{id:"injected",name:"Injected",provider(ct){return ct==null?void 0:ct.ethereum}}}let nt,ot,it,st;return at=>({get icon(){return rt().icon},get id(){return rt().id},get name(){return rt().name},get supportsSimulation(){return supportsSimulationIdRegex.test(this.id.toLowerCase())},type:injected.type,async setup(){const ct=await this.getProvider();ct!=null&&ct.on&&et.target&&(it||(it=this.onConnect.bind(this),ct.on("connect",it)),nt||(nt=this.onAccountsChanged.bind(this),ct.on("accountsChanged",nt)))},async connect({chainId:ct,isReconnecting:lt}={}){var mt,ft,pt,yt,gt,bt;const dt=await this.getProvider();if(!dt)throw new ProviderNotFoundError;let ht=[];if(lt)ht=await this.getAccounts().catch(()=>[]);else if(o)try{ht=(yt=(pt=(ft=(mt=(await dt.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:mt.caveats)==null?void 0:ft[0])==null?void 0:pt.value)==null?void 0:yt.map(vt=>getAddress(vt)),ht.length>0&&(ht=await this.getAccounts())}catch(xt){const vt=xt;if(vt.code===UserRejectedRequestError.code)throw new UserRejectedRequestError(vt);if(vt.code===ResourceUnavailableRpcError.code)throw vt}try{!(ht!=null&&ht.length)&&!lt&&(ht=(await dt.request({method:"eth_requestAccounts"})).map(Et=>getAddress(Et))),it&&(dt.removeListener("connect",it),it=void 0),nt||(nt=this.onAccountsChanged.bind(this),dt.on("accountsChanged",nt)),ot||(ot=this.onChainChanged.bind(this),dt.on("chainChanged",ot)),st||(st=this.onDisconnect.bind(this),dt.on("disconnect",st));let xt=await this.getChainId();if(ct&&xt!==ct){const vt=await this.switchChain({chainId:ct}).catch(Et=>{if(Et.code===UserRejectedRequestError.code)throw Et;return{id:xt}});xt=(vt==null?void 0:vt.id)??xt}return o&&await((gt=at.storage)==null?void 0:gt.removeItem(`${this.id}.disconnected`)),et.target||await((bt=at.storage)==null?void 0:bt.setItem("injected.connected",!0)),{accounts:ht,chainId:xt}}catch(xt){const vt=xt;throw vt.code===UserRejectedRequestError.code?new UserRejectedRequestError(vt):vt.code===ResourceUnavailableRpcError.code?new ResourceUnavailableRpcError(vt):vt}},async disconnect(){var lt,dt;const ct=await this.getProvider();if(!ct)throw new ProviderNotFoundError;ot&&(ct.removeListener("chainChanged",ot),ot=void 0),st&&(ct.removeListener("disconnect",st),st=void 0),it||(it=this.onConnect.bind(this),ct.on("connect",it));try{await withTimeout(()=>ct.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}o&&await((lt=at.storage)==null?void 0:lt.setItem(`${this.id}.disconnected`,!0)),et.target||await((dt=at.storage)==null?void 0:dt.removeItem("injected.connected"))},async getAccounts(){const ct=await this.getProvider();if(!ct)throw new ProviderNotFoundError;return(await ct.request({method:"eth_accounts"})).map(dt=>getAddress(dt))},async getChainId(){const ct=await this.getProvider();if(!ct)throw new ProviderNotFoundError;const lt=await ct.request({method:"eth_chainId"});return Number(lt)},async getProvider(){if(typeof window>"u")return;let ct;const lt=rt();return typeof lt.provider=="function"?ct=lt.provider(window):typeof lt.provider=="string"?ct=findProvider(window,lt.provider):ct=lt.provider,ct&&!ct.removeListener&&("off"in ct&&typeof ct.off=="function"?ct.removeListener=ct.off:ct.removeListener=()=>{}),ct},async isAuthorized(){var ct,lt;try{if(o&&await((ct=at.storage)==null?void 0:ct.getItem(`${this.id}.disconnected`))||!et.target&&!await((lt=at.storage)==null?void 0:lt.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(tt!==void 0&&tt!==!1){const ft=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",ft),!!await this.getProvider()),pt=typeof tt=="number"?tt:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(gt=>window.addEventListener("ethereum#initialized",()=>gt(ft()),{once:!0}))]:[],new Promise(gt=>setTimeout(()=>gt(ft()),pt))]))return!0}throw new ProviderNotFoundError}return!!(await withRetry(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:ct,chainId:lt}){var mt,ft,pt,yt;const dt=await this.getProvider();if(!dt)throw new ProviderNotFoundError;const ht=at.chains.find(gt=>gt.id===lt);if(!ht)throw new SwitchChainError(new ChainNotConfiguredError);try{return await Promise.all([dt.request({method:"wallet_switchEthereumChain",params:[{chainId:numberToHex(lt)}]}).then(async()=>{await this.getChainId()===lt&&at.emitter.emit("change",{chainId:lt})}),new Promise(gt=>{const bt=xt=>{"chainId"in xt&&xt.chainId===lt&&(at.emitter.off("change",bt),gt())};at.emitter.on("change",bt)})]),ht}catch(gt){const bt=gt;if(bt.code===4902||((ft=(mt=bt==null?void 0:bt.data)==null?void 0:mt.originalError)==null?void 0:ft.code)===4902)try{const{default:xt,...vt}=ht.blockExplorers??{};let Et;ct!=null&&ct.blockExplorerUrls?Et=ct.blockExplorerUrls:xt&&(Et=[xt.url,...Object.values(vt).map(kt=>kt.url)]);let Ct;(pt=ct==null?void 0:ct.rpcUrls)!=null&&pt.length?Ct=ct.rpcUrls:Ct=[((yt=ht.rpcUrls.default)==null?void 0:yt.http[0])??""];const St={blockExplorerUrls:Et,chainId:numberToHex(lt),chainName:(ct==null?void 0:ct.chainName)??ht.name,iconUrls:ct==null?void 0:ct.iconUrls,nativeCurrency:(ct==null?void 0:ct.nativeCurrency)??ht.nativeCurrency,rpcUrls:Ct};if(await dt.request({method:"wallet_addEthereumChain",params:[St]}),await this.getChainId()!==lt)throw new UserRejectedRequestError(new Error("User rejected switch after adding network."));return ht}catch(xt){throw new UserRejectedRequestError(xt)}throw bt.code===UserRejectedRequestError.code?new UserRejectedRequestError(bt):new SwitchChainError(bt)}},async onAccountsChanged(ct){var lt;if(ct.length===0)this.onDisconnect();else if(at.emitter.listenerCount("connect")){const dt=(await this.getChainId()).toString();this.onConnect({chainId:dt}),o&&await((lt=at.storage)==null?void 0:lt.removeItem(`${this.id}.disconnected`))}else at.emitter.emit("change",{accounts:ct.map(dt=>getAddress(dt))})},onChainChanged(ct){const lt=Number(ct);at.emitter.emit("change",{chainId:lt})},async onConnect(ct){const lt=await this.getAccounts();if(lt.length===0)return;const dt=Number(ct.chainId);at.emitter.emit("connect",{accounts:lt,chainId:dt});const ht=await this.getProvider();ht&&(it&&(ht.removeListener("connect",it),it=void 0),nt||(nt=this.onAccountsChanged.bind(this),ht.on("accountsChanged",nt)),ot||(ot=this.onChainChanged.bind(this),ht.on("chainChanged",ot)),st||(st=this.onDisconnect.bind(this),ht.on("disconnect",st)))},async onDisconnect(ct){const lt=await this.getProvider();ct&&ct.code===1013&&lt&&(await this.getAccounts()).length||(at.emitter.emit("disconnect"),lt&&(ot&&(lt.removeListener("chainChanged",ot),ot=void 0),st&&(lt.removeListener("disconnect",st),st=void 0),it||(it=this.onConnect.bind(this),lt.on("connect",it))))}})}function findProvider(et,o){function tt(nt){return typeof o=="function"?o(nt):typeof o=="string"?nt[o]:!0}const rt=et.ethereum;if(rt!=null&&rt.providers)return rt.providers.find(nt=>tt(nt));if(rt&&tt(rt))return rt}function requestProviders(et){if(typeof window>"u")return;const o=tt=>et(tt.detail);return window.addEventListener("eip6963:announceProvider",o),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",o)}function createStore$1(){const et=new Set;let o=[];const tt=()=>requestProviders(nt=>{o.some(({info:ot})=>ot.uuid===nt.info.uuid)||(o=[...o,nt],et.forEach(ot=>ot(o,{added:[nt]})))});let rt=tt();return{_listeners(){return et},clear(){et.forEach(nt=>nt([],{removed:[...o]})),o=[]},destroy(){this.clear(),et.clear(),rt==null||rt()},findProvider({rdns:nt}){return o.find(ot=>ot.info.rdns===nt)},getProviders(){return o},reset(){this.clear(),rt==null||rt(),rt=tt()},subscribe(nt,{emitImmediately:ot}={}){return et.add(nt),ot&&nt(o,{added:o}),()=>et.delete(nt)}}}const __vite_import_meta_env__$1={BASE_URL:"/buddybook/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_WALLETCONNECT_PROJECT_ID:"1d93edc21291f98e3bed6ff7617ff539"},subscribeWithSelectorImpl=et=>(o,tt,rt)=>{const nt=rt.subscribe;return rt.subscribe=(it,st,at)=>{let ct=it;if(st){const lt=(at==null?void 0:at.equalityFn)||Object.is;let dt=it(rt.getState());ct=ht=>{const mt=it(ht);if(!lt(dt,mt)){const ft=dt;st(dt=mt,ft)}},at!=null&&at.fireImmediately&&st(dt,dt)}return nt(ct)},et(o,tt,rt)},subscribeWithSelector=subscribeWithSelectorImpl;function createJSONStorage(et,o){let tt;try{tt=et()}catch{return}return{getItem:nt=>{var ot;const it=at=>at===null?null:JSON.parse(at,void 0),st=(ot=tt.getItem(nt))!=null?ot:null;return st instanceof Promise?st.then(it):it(st)},setItem:(nt,ot)=>tt.setItem(nt,JSON.stringify(ot,void 0)),removeItem:nt=>tt.removeItem(nt)}}const toThenable=et=>o=>{try{const tt=et(o);return tt instanceof Promise?tt:{then(rt){return toThenable(rt)(tt)},catch(rt){return this}}}catch(tt){return{then(rt){return this},catch(rt){return toThenable(rt)(tt)}}}},oldImpl=(et,o)=>(tt,rt,nt)=>{let ot={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:yt=>yt,version:0,merge:(yt,gt)=>({...gt,...yt}),...o},it=!1;const st=new Set,at=new Set;let ct;try{ct=ot.getStorage()}catch{}if(!ct)return et((...yt)=>{console.warn(`[zustand persist middleware] Unable to update item '${ot.name}', the given storage is currently unavailable.`),tt(...yt)},rt,nt);const lt=toThenable(ot.serialize),dt=()=>{const yt=ot.partialize({...rt()});let gt;const bt=lt({state:yt,version:ot.version}).then(xt=>ct.setItem(ot.name,xt)).catch(xt=>{gt=xt});if(gt)throw gt;return bt},ht=nt.setState;nt.setState=(yt,gt)=>{ht(yt,gt),dt()};const mt=et((...yt)=>{tt(...yt),dt()},rt,nt);let ft;const pt=()=>{var yt;if(!ct)return;it=!1,st.forEach(bt=>bt(rt()));const gt=((yt=ot.onRehydrateStorage)==null?void 0:yt.call(ot,rt()))||void 0;return toThenable(ct.getItem.bind(ct))(ot.name).then(bt=>{if(bt)return ot.deserialize(bt)}).then(bt=>{if(bt)if(typeof bt.version=="number"&&bt.version!==ot.version){if(ot.migrate)return ot.migrate(bt.state,bt.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return bt.state}).then(bt=>{var xt;return ft=ot.merge(bt,(xt=rt())!=null?xt:mt),tt(ft,!0),dt()}).then(()=>{gt==null||gt(ft,void 0),it=!0,at.forEach(bt=>bt(ft))}).catch(bt=>{gt==null||gt(void 0,bt)})};return nt.persist={setOptions:yt=>{ot={...ot,...yt},yt.getStorage&&(ct=yt.getStorage())},clearStorage:()=>{ct==null||ct.removeItem(ot.name)},getOptions:()=>ot,rehydrate:()=>pt(),hasHydrated:()=>it,onHydrate:yt=>(st.add(yt),()=>{st.delete(yt)}),onFinishHydration:yt=>(at.add(yt),()=>{at.delete(yt)})},pt(),ft||mt},newImpl=(et,o)=>(tt,rt,nt)=>{let ot={storage:createJSONStorage(()=>localStorage),partialize:pt=>pt,version:0,merge:(pt,yt)=>({...yt,...pt}),...o},it=!1;const st=new Set,at=new Set;let ct=ot.storage;if(!ct)return et((...pt)=>{console.warn(`[zustand persist middleware] Unable to update item '${ot.name}', the given storage is currently unavailable.`),tt(...pt)},rt,nt);const lt=()=>{const pt=ot.partialize({...rt()});return ct.setItem(ot.name,{state:pt,version:ot.version})},dt=nt.setState;nt.setState=(pt,yt)=>{dt(pt,yt),lt()};const ht=et((...pt)=>{tt(...pt),lt()},rt,nt);let mt;const ft=()=>{var pt,yt;if(!ct)return;it=!1,st.forEach(bt=>{var xt;return bt((xt=rt())!=null?xt:ht)});const gt=((yt=ot.onRehydrateStorage)==null?void 0:yt.call(ot,(pt=rt())!=null?pt:ht))||void 0;return toThenable(ct.getItem.bind(ct))(ot.name).then(bt=>{if(bt)if(typeof bt.version=="number"&&bt.version!==ot.version){if(ot.migrate)return ot.migrate(bt.state,bt.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return bt.state}).then(bt=>{var xt;return mt=ot.merge(bt,(xt=rt())!=null?xt:ht),tt(mt,!0),lt()}).then(()=>{gt==null||gt(mt,void 0),mt=rt(),it=!0,at.forEach(bt=>bt(mt))}).catch(bt=>{gt==null||gt(void 0,bt)})};return nt.persist={setOptions:pt=>{ot={...ot,...pt},pt.storage&&(ct=pt.storage)},clearStorage:()=>{ct==null||ct.removeItem(ot.name)},getOptions:()=>ot,rehydrate:()=>ft(),hasHydrated:()=>it,onHydrate:pt=>(st.add(pt),()=>{st.delete(pt)}),onFinishHydration:pt=>(at.add(pt),()=>{at.delete(pt)})},ot.skipHydration||ft(),mt||ht},persistImpl=(et,o)=>"getStorage"in o||"serialize"in o||"deserialize"in o?((__vite_import_meta_env__$1?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),oldImpl(et,o)):newImpl(et,o),persist=persistImpl,__vite_import_meta_env__={BASE_URL:"/buddybook/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_WALLETCONNECT_PROJECT_ID:"1d93edc21291f98e3bed6ff7617ff539"},createStoreImpl=et=>{let o;const tt=new Set,rt=(at,ct)=>{const lt=typeof at=="function"?at(o):at;if(!Object.is(lt,o)){const dt=o;o=ct??typeof lt!="object"?lt:Object.assign({},o,lt),tt.forEach(ht=>ht(o,dt))}},nt=()=>o,st={setState:rt,getState:nt,subscribe:at=>(tt.add(at),()=>tt.delete(at)),destroy:()=>{(__vite_import_meta_env__?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),tt.clear()}};return o=et(rt,nt,st),st},createStore=et=>et?createStoreImpl(et):createStoreImpl;var eventemitter3={exports:{}};(function(et){var o=Object.prototype.hasOwnProperty,tt="~";function rt(){}Object.create&&(rt.prototype=Object.create(null),new rt().__proto__||(tt=!1));function nt(at,ct,lt){this.fn=at,this.context=ct,this.once=lt||!1}function ot(at,ct,lt,dt,ht){if(typeof lt!="function")throw new TypeError("The listener must be a function");var mt=new nt(lt,dt||at,ht),ft=tt?tt+ct:ct;return at._events[ft]?at._events[ft].fn?at._events[ft]=[at._events[ft],mt]:at._events[ft].push(mt):(at._events[ft]=mt,at._eventsCount++),at}function it(at,ct){--at._eventsCount===0?at._events=new rt:delete at._events[ct]}function st(){this._events=new rt,this._eventsCount=0}st.prototype.eventNames=function(){var ct=[],lt,dt;if(this._eventsCount===0)return ct;for(dt in lt=this._events)o.call(lt,dt)&&ct.push(tt?dt.slice(1):dt);return Object.getOwnPropertySymbols?ct.concat(Object.getOwnPropertySymbols(lt)):ct},st.prototype.listeners=function(ct){var lt=tt?tt+ct:ct,dt=this._events[lt];if(!dt)return[];if(dt.fn)return[dt.fn];for(var ht=0,mt=dt.length,ft=new Array(mt);ht<mt;ht++)ft[ht]=dt[ht].fn;return ft},st.prototype.listenerCount=function(ct){var lt=tt?tt+ct:ct,dt=this._events[lt];return dt?dt.fn?1:dt.length:0},st.prototype.emit=function(ct,lt,dt,ht,mt,ft){var pt=tt?tt+ct:ct;if(!this._events[pt])return!1;var yt=this._events[pt],gt=arguments.length,bt,xt;if(yt.fn){switch(yt.once&&this.removeListener(ct,yt.fn,void 0,!0),gt){case 1:return yt.fn.call(yt.context),!0;case 2:return yt.fn.call(yt.context,lt),!0;case 3:return yt.fn.call(yt.context,lt,dt),!0;case 4:return yt.fn.call(yt.context,lt,dt,ht),!0;case 5:return yt.fn.call(yt.context,lt,dt,ht,mt),!0;case 6:return yt.fn.call(yt.context,lt,dt,ht,mt,ft),!0}for(xt=1,bt=new Array(gt-1);xt<gt;xt++)bt[xt-1]=arguments[xt];yt.fn.apply(yt.context,bt)}else{var vt=yt.length,Et;for(xt=0;xt<vt;xt++)switch(yt[xt].once&&this.removeListener(ct,yt[xt].fn,void 0,!0),gt){case 1:yt[xt].fn.call(yt[xt].context);break;case 2:yt[xt].fn.call(yt[xt].context,lt);break;case 3:yt[xt].fn.call(yt[xt].context,lt,dt);break;case 4:yt[xt].fn.call(yt[xt].context,lt,dt,ht);break;default:if(!bt)for(Et=1,bt=new Array(gt-1);Et<gt;Et++)bt[Et-1]=arguments[Et];yt[xt].fn.apply(yt[xt].context,bt)}}return!0},st.prototype.on=function(ct,lt,dt){return ot(this,ct,lt,dt,!1)},st.prototype.once=function(ct,lt,dt){return ot(this,ct,lt,dt,!0)},st.prototype.removeListener=function(ct,lt,dt,ht){var mt=tt?tt+ct:ct;if(!this._events[mt])return this;if(!lt)return it(this,mt),this;var ft=this._events[mt];if(ft.fn)ft.fn===lt&&(!ht||ft.once)&&(!dt||ft.context===dt)&&it(this,mt);else{for(var pt=0,yt=[],gt=ft.length;pt<gt;pt++)(ft[pt].fn!==lt||ht&&!ft[pt].once||dt&&ft[pt].context!==dt)&&yt.push(ft[pt]);yt.length?this._events[mt]=yt.length===1?yt[0]:yt:it(this,mt)}return this},st.prototype.removeAllListeners=function(ct){var lt;return ct?(lt=tt?tt+ct:ct,this._events[lt]&&it(this,lt)):(this._events=new rt,this._eventsCount=0),this},st.prototype.off=st.prototype.removeListener,st.prototype.addListener=st.prototype.on,st.prefixed=tt,st.EventEmitter=st,et.exports=st})(eventemitter3);var eventemitter3Exports=eventemitter3.exports;const EventEmitter$1=getDefaultExportFromCjs(eventemitter3Exports);class Emitter{constructor(o){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:new EventEmitter$1})}on(o,tt){this._emitter.on(o,tt)}once(o,tt){this._emitter.once(o,tt)}off(o,tt){this._emitter.off(o,tt)}emit(o,...tt){const rt=tt[0];this._emitter.emit(o,{uid:this.uid,...rt})}listenerCount(o){return this._emitter.listenerCount(o)}}function createEmitter(et){return new Emitter(et)}function deserialize$1(et,o){return JSON.parse(et,(tt,rt)=>{let nt=rt;return(nt==null?void 0:nt.__type)==="bigint"&&(nt=BigInt(nt.value)),(nt==null?void 0:nt.__type)==="Map"&&(nt=new Map(nt.value)),(o==null?void 0:o(tt,nt))??nt})}function getReferenceKey(et,o){return et.slice(0,o).join(".")||"."}function getCutoff(et,o){const{length:tt}=et;for(let rt=0;rt<tt;++rt)if(et[rt]===o)return rt+1;return 0}function createReplacer(et,o){const tt=typeof et=="function",rt=typeof o=="function",nt=[],ot=[];return function(st,at){if(typeof at=="object")if(nt.length){const ct=getCutoff(nt,this);ct===0?nt[nt.length]=this:(nt.splice(ct),ot.splice(ct)),ot[ot.length]=st;const lt=getCutoff(nt,at);if(lt!==0)return rt?o.call(this,st,at,getReferenceKey(ot,lt)):`[ref=${getReferenceKey(ot,lt)}]`}else nt[0]=at,ot[0]=st;return tt?et.call(this,st,at):at}}function serialize$1(et,o,tt,rt){return JSON.stringify(et,createReplacer((nt,ot)=>{let it=ot;return typeof it=="bigint"&&(it={__type:"bigint",value:ot.toString()}),it instanceof Map&&(it={__type:"Map",value:Array.from(ot.entries())}),(o==null?void 0:o(nt,it))??it},rt),tt??void 0)}function createStorage(et){const{deserialize:o=deserialize$1,key:tt="wagmi",serialize:rt=serialize$1,storage:nt=noopStorage}=et;function ot(it){return it instanceof Promise?it.then(st=>st).catch(()=>null):it}return{...nt,key:tt,async getItem(it,st){const at=nt.getItem(`${tt}.${it}`),ct=await ot(at);return ct?o(ct)??null:st??null},async setItem(it,st){const at=`${tt}.${it}`;st===null?await ot(nt.removeItem(at)):await ot(nt.setItem(at,rt(st)))},async removeItem(it){await ot(nt.removeItem(`${tt}.${it}`))}}}const noopStorage={getItem:()=>null,setItem:()=>{},removeItem:()=>{}},size=256;let index$2=size,buffer;function uid(et=11){if(!buffer||index$2+et>size*2){buffer="",index$2=0;for(let o=0;o<size;o++)buffer+=(256+Math.random()*256|0).toString(16).substring(1)}return buffer.substring(index$2,index$2+++et)}function createConfig(et){const{multiInjectedProviderDiscovery:o=!0,storage:tt=createStorage({storage:typeof window<"u"&&window.localStorage?window.localStorage:noopStorage}),syncConnectedChain:rt=!0,ssr:nt=!1,...ot}=et,it=typeof window<"u"&&o?createStore$1():void 0,st=createStore(()=>ot.chains),at=createStore(()=>[...ot.connectors??[],...nt?[]:(it==null?void 0:it.getProviders().map(lt))??[]].map(ct));function ct(Et){var At;const Ct=createEmitter(uid()),St={...Et({emitter:Ct,chains:st.getState(),storage:tt,transports:ot.transports}),emitter:Ct,uid:Ct.uid};return Ct.on("connect",xt),(At=St.setup)==null||At.call(St),St}function lt(Et){const{info:Ct}=Et,St=Et.provider;return injected({target:{...Ct,id:Ct.rdns,provider:St}})}const dt=new Map;function ht(Et={}){const Ct=Et.chainId??yt.getState().chainId,St=st.getState().find(kt=>kt.id===Ct);if(Et.chainId&&!St)throw new ChainNotConfiguredError;{const kt=dt.get(yt.getState().chainId);if(kt&&!St)return kt;if(!St)throw new ChainNotConfiguredError}{const kt=dt.get(Ct);if(kt)return kt}let At;if(ot.client)At=ot.client({chain:St});else{const kt=St.id,It=st.getState().map(Mt=>Mt.id),Nt={},Lt=Object.entries(ot);for(const[Mt,zt]of Lt)if(!(Mt==="chains"||Mt==="client"||Mt==="connectors"||Mt==="transports"))if(typeof zt=="object")if(kt in zt)Nt[Mt]=zt[kt];else{if(It.some(Xt=>Xt in zt))continue;Nt[Mt]=zt}else Nt[Mt]=zt;At=createClient({...Nt,chain:St,batch:Nt.batch??{multicall:!0},transport:Mt=>ot.transports[kt]({...Mt,connectors:at})})}return dt.set(Ct,At),At}function mt(){return{chainId:st.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let ft;const pt="0.0.0-canary-";version$6.startsWith(pt)?ft=Number.parseInt(version$6.replace(pt,"")):ft=Number.parseInt(version$6.split(".")[0]??"0");const yt=createStore(subscribeWithSelector(tt?persist(mt,{migrate(Et,Ct){if(Ct===ft)return Et;const St=mt(),At=gt(Et,St.chainId);return{...St,chainId:At}},name:"store",partialize(Et){return{connections:{__type:"Map",value:Array.from(Et.connections.entries()).map(([Ct,St])=>{const{id:At,name:kt,type:It,uid:Nt}=St.connector;return[Ct,{...St,connector:{id:At,name:kt,type:It,uid:Nt}}]})},chainId:Et.chainId,current:Et.current}},merge(Et,Ct){typeof Et=="object"&&Et&&"status"in Et&&delete Et.status;const St=gt(Et,Ct.chainId);return{...Ct,...Et,chainId:St}},skipHydration:nt,storage:tt,version:ft}):mt));function gt(Et,Ct){return Et&&typeof Et=="object"&&"chainId"in Et&&typeof Et.chainId=="number"&&st.getState().some(St=>St.id===Et.chainId)?Et.chainId:Ct}rt&&yt.subscribe(({connections:Et,current:Ct})=>{var St;return Ct?(St=Et.get(Ct))==null?void 0:St.chainId:void 0},Et=>{if(st.getState().some(St=>St.id===Et))return yt.setState(St=>({...St,chainId:Et??St.chainId}))}),it==null||it.subscribe(Et=>{const Ct=new Map;for(const At of at.getState())Ct.set(At.id,!0);const St=[];for(const At of Et){const kt=ct(lt(At));Ct.has(kt.id)||St.push(kt)}tt&&!yt.persist.hasHydrated()||at.setState(At=>[...At,...St],!0)});function bt(Et){yt.setState(Ct=>{const St=Ct.connections.get(Et.uid);return St?{...Ct,connections:new Map(Ct.connections).set(Et.uid,{accounts:Et.accounts??St.accounts,chainId:Et.chainId??St.chainId,connector:St.connector})}:Ct})}function xt(Et){yt.getState().status==="connecting"||yt.getState().status==="reconnecting"||yt.setState(Ct=>{const St=at.getState().find(At=>At.uid===Et.uid);return St?(St.emitter.listenerCount("connect")&&St.emitter.off("connect",bt),St.emitter.listenerCount("change")||St.emitter.on("change",bt),St.emitter.listenerCount("disconnect")||St.emitter.on("disconnect",vt),{...Ct,connections:new Map(Ct.connections).set(Et.uid,{accounts:Et.accounts,chainId:Et.chainId,connector:St}),current:Et.uid,status:"connected"}):Ct})}function vt(Et){yt.setState(Ct=>{const St=Ct.connections.get(Et.uid);if(St){const kt=St.connector;kt.emitter.listenerCount("change")&&St.connector.emitter.off("change",bt),kt.emitter.listenerCount("disconnect")&&St.connector.emitter.off("disconnect",vt),kt.emitter.listenerCount("connect")||St.connector.emitter.on("connect",xt)}if(Ct.connections.delete(Et.uid),Ct.connections.size===0)return{...Ct,connections:new Map,current:null,status:"disconnected"};const At=Ct.connections.values().next().value;return{...Ct,connections:new Map(Ct.connections),current:At.connector.uid}})}return{get chains(){return st.getState()},get connectors(){return at.getState()},storage:tt,getClient:ht,get state(){return yt.getState()},setState(Et){let Ct;typeof Et=="function"?Ct=Et(yt.getState()):Ct=Et;const St=mt();typeof Ct!="object"&&(Ct=St),Object.keys(St).some(kt=>!(kt in Ct))&&(Ct=St),yt.setState(Ct,!0)},subscribe(Et,Ct,St){return yt.subscribe(Et,Ct,St?{...St,fireImmediately:St.emitImmediately}:void 0)},_internal:{mipd:it,store:yt,ssr:!!nt,syncConnectedChain:rt,transports:ot.transports,chains:{setState(Et){const Ct=typeof Et=="function"?Et(st.getState()):Et;if(Ct.length!==0)return st.setState(Ct,!0)},subscribe(Et){return st.subscribe(Et)}},connectors:{providerDetailToConnector:lt,setup:ct,setState(Et){return at.setState(typeof Et=="function"?Et(at.getState()):Et,!0)},subscribe(Et){return at.subscribe(Et)}},events:{change:bt,connect:xt,disconnect:vt}}}}function hydrate(et,o){const{initialState:tt,reconnectOnMount:rt}=o;return tt&&!et._internal.store.persist.hasHydrated()&&et.setState({...tt,chainId:et.chains.some(nt=>nt.id===tt.chainId)?tt.chainId:et.chains[0].id,connections:rt?tt.connections:new Map,status:rt?"reconnecting":"disconnected"}),{async onMount(){var nt;if(et._internal.ssr){await et._internal.store.persist.rehydrate();const ot=(nt=et._internal.mipd)==null?void 0:nt.getProviders().map(et._internal.connectors.providerDetailToConnector).map(et._internal.connectors.setup);et._internal.connectors.setState(it=>[...it,...ot??[]])}rt?reconnect(et):et.storage&&et.setState(ot=>({...ot,connections:new Map}))}}}function extractRpcUrls(et){var ot,it,st;const{chain:o}=et,tt=o.rpcUrls.default.http[0];if(!et.transports)return[tt];const rt=(it=(ot=et.transports)==null?void 0:ot[o.id])==null?void 0:it.call(ot,{chain:o});return(((st=rt==null?void 0:rt.value)==null?void 0:st.transports)||[rt]).map(({value:at})=>(at==null?void 0:at.url)||tt)}function Hydrate(et){const{children:o,config:tt,initialState:rt,reconnectOnMount:nt=!0}=et,{onMount:ot}=hydrate(tt,{initialState:rt,reconnectOnMount:nt});tt._internal.ssr||ot();const it=reactExports.useRef(!0);return reactExports.useEffect(()=>{if(it.current&&tt._internal.ssr)return ot(),()=>{it.current=!1}},[]),o}const WagmiContext=reactExports.createContext(void 0);function WagmiProvider(et){const{children:o,config:tt}=et,rt={value:tt};return reactExports.createElement(Hydrate,et,reactExports.createElement(WagmiContext.Provider,rt,o))}const version$5="2.12.19",getVersion=()=>`wagmi@${version$5}`;class BaseError extends BaseError$1{constructor(){super(...arguments),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiError"})}get docsBaseUrl(){return"https://wagmi.sh/react"}get version(){return getVersion()}}class WagmiProviderNotFoundError extends BaseError{constructor(){super("`useConfig` must be used within `WagmiProvider`.",{docsPath:"/api/WagmiProvider"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiProviderNotFoundError"})}}function useConfig(et={}){const o=et.config??reactExports.useContext(WagmiContext);if(!o)throw new WagmiProviderNotFoundError;return o}function watchChains(et,o){const{onChange:tt}=o;return et._internal.chains.subscribe((rt,nt)=>{tt(rt,nt)})}var withSelector={exports:{}},withSelector_production_min={},shim={exports:{}},useSyncExternalStoreShim_production_min={};/**
* @license React
* use-sync-external-store-shim.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var e$2=reactExports;function h$4(et,o){return et===o&&(et!==0||1/et===1/o)||et!==et&&o!==o}var k$3=typeof Object.is=="function"?Object.is:h$4,l$2=e$2.useState,m$4=e$2.useEffect,n$3=e$2.useLayoutEffect,p$3=e$2.useDebugValue;function q$4(et,o){var tt=o(),rt=l$2({inst:{value:tt,getSnapshot:o}}),nt=rt[0].inst,ot=rt[1];return n$3(function(){nt.value=tt,nt.getSnapshot=o,r$4(nt)&&ot({inst:nt})},[et,tt,o]),m$4(function(){return r$4(nt)&&ot({inst:nt}),et(function(){r$4(nt)&&ot({inst:nt})})},[et]),p$3(tt),tt}function r$4(et){var o=et.getSnapshot;et=et.value;try{var tt=o();return!k$3(et,tt)}catch{return!0}}function t$3(et,o){return o()}var u$2=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?t$3:q$4;useSyncExternalStoreShim_production_min.useSyncExternalStore=e$2.useSyncExternalStore!==void 0?e$2.useSyncExternalStore:u$2;shim.exports=useSyncExternalStoreShim_production_min;var shimExports=shim.exports;/**
* @license React
* use-sync-external-store-shim/with-selector.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var h$3=reactExports,n$2=shimExports;function p$2(et,o){return et===o&&(et!==0||1/et===1/o)||et!==et&&o!==o}var q$3=typeof Object.is=="function"?Object.is:p$2,r$3=n$2.useSyncExternalStore,t$2=h$3.useRef,u$1=h$3.useEffect,v$3=h$3.useMemo,w$3=h$3.useDebugValue;withSelector_production_min.useSyncExternalStoreWithSelector=function(et,o,tt,rt,nt){var ot=t$2(null);if(ot.current===null){var it={hasValue:!1,value:null};ot.current=it}else it=ot.current;ot=v$3(function(){function at(mt){if(!ct){if(ct=!0,lt=mt,mt=rt(mt),nt!==void 0&&it.hasValue){var ft=it.value;if(nt(ft,mt))return dt=ft}return dt=mt}if(ft=dt,q$3(lt,mt))return ft;var pt=rt(mt);return nt!==void 0&&nt(ft,pt)?ft:(lt=mt,dt=pt)}var ct=!1,lt,dt,ht=tt===void 0?null:tt;return[function(){return at(o())},ht===null?void 0:function(){return at(ht())}]},[o,tt,rt,nt]);var st=r$3(et,ot[0],ot[1]);return u$1(function(){it.hasValue=!0,it.value=st},[st]),w$3(st),st};withSelector.exports=withSelector_production_min;var withSelectorExports=withSelector.exports;const isPlainObject$4=et=>typeof et=="object"&&!Array.isArray(et);function useSyncExternalStoreWithTracked(et,o,tt=o,rt=deepEqual){const nt=reactExports.useRef([]),ot=withSelectorExports.useSyncExternalStoreWithSelector(et,o,tt,it=>it,(it,st)=>{if(isPlainObject$4(it)&&isPlainObject$4(st)&&nt.current.length){for(const at of nt.current)if(!rt(it[at],st[at]))return!1;return!0}return rt(it,st)});return reactExports.useMemo(()=>{if(isPlainObject$4(ot)){const it={...ot};let st={};for(const[at,ct]of Object.entries(it))st={...st,[at]:{configurable:!1,enumerable:!0,get:()=>(nt.current.includes(at)||nt.current.push(at),ct)}};return Object.defineProperties(it,st),it}return ot},[ot])}function useAccount(et={}){const o=useConfig(et);return useSyncExternalStoreWithTracked(tt=>watchAccount(o,{onChange:tt}),()=>getAccount(o))}function useAccountEffect(et={}){const{onConnect:o,onDisconnect:tt}=et,rt=useConfig(et);reactExports.useEffect(()=>watchAccount(rt,{onChange(nt,ot){if((ot.status==="reconnecting"||ot.status==="connecting"&&ot.address===void 0)&&nt.status==="connected"){const{address:it,addresses:st,chain:at,chainId:ct,connector:lt}=nt,dt=ot.status==="reconnecting"||ot.status===void 0;o==null||o({address:it,addresses:st,chain:at,chainId:ct,connector:lt,isReconnected:dt})}else ot.status==="connected"&&nt.status==="disconnected"&&(tt==null||tt())}}),[rt,o,tt])}var Subscribable=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(et){return this.listeners.add(et),this.onSubscribe(),()=>{this.listeners.delete(et),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},isServer=typeof window>"u"||"Deno"in globalThis;function noop$4(){}function functionalUpdate(et,o){return typeof et=="function"?et(o):et}function isValidTimeout(et){return typeof et=="number"&&et>=0&&et!==1/0}function timeUntilStale(et,o){return Math.max(et+(o||0)-Date.now(),0)}function resolveStaleTime(et,o){return typeof et=="function"?et(o):et}function resolveEnabled(et,o){return typeof et=="function"?et(o):et}function matchQuery(et,o){const{type:tt="all",exact:rt,fetchStatus:nt,predicate:ot,queryKey:it,stale:st}=et;if(it){if(rt){if(o.queryHash!==hashQueryKeyByOptions(it,o.options))return!1}else if(!partialMatchKey(o.queryKey,it))return!1}if(tt!=="all"){const at=o.isActive();if(tt==="active"&&!at||tt==="inactive"&&at)return!1}return!(typeof st=="boolean"&&o.isStale()!==st||nt&&nt!==o.state.fetchStatus||ot&&!ot(o))}function matchMutation(et,o){const{exact:tt,status:rt,predicate:nt,mutationKey:ot}=et;if(ot){if(!o.options.mutationKey)return!1;if(tt){if(hashKey(o.options.mutationKey)!==hashKey(ot))return!1}else if(!partialMatchKey(o.options.mutationKey,ot))return!1}return!(rt&&o.state.status!==rt||nt&&!nt(o))}function hashQueryKeyByOptions(et,o){return((o==null?void 0:o.queryKeyHashFn)||hashKey)(et)}function hashKey(et){return JSON.stringify(et,(o,tt)=>isPlainObject$3(tt)?Object.keys(tt).sort().reduce((rt,nt)=>(rt[nt]=tt[nt],rt),{}):tt)}function partialMatchKey(et,o){return et===o?!0:typeof et!=typeof o?!1:et&&o&&typeof et=="object"&&typeof o=="object"?!Object.keys(o).some(tt=>!partialMatchKey(et[tt],o[tt])):!1}function replaceEqualDeep(et,o){if(et===o)return et;const tt=isPlainArray(et)&&isPlainArray(o);if(tt||isPlainObject$3(et)&&isPlainObject$3(o)){const rt=tt?et:Object.keys(et),nt=rt.length,ot=tt?o:Object.keys(o),it=ot.length,st=tt?[]:{};let at=0;for(let ct=0;ct<it;ct++){const lt=tt?ct:ot[ct];(!tt&&rt.includes(lt)||tt)&&et[lt]===void 0&&o[lt]===void 0?(st[lt]=void 0,at++):(st[lt]=replaceEqualDeep(et[lt],o[lt]),st[lt]===et[lt]&&et[lt]!==void 0&&at++)}return nt===it&&at===nt?et:st}return o}function shallowEqualObjects(et,o){if(!o||Object.keys(et).length!==Object.keys(o).length)return!1;for(const tt in et)if(et[tt]!==o[tt])return!1;return!0}function isPlainArray(et){return Array.isArray(et)&&et.length===Object.keys(et).length}function isPlainObject$3(et){if(!hasObjectPrototype$1(et))return!1;const o=et.constructor;if(o===void 0)return!0;const tt=o.prototype;return!(!hasObjectPrototype$1(tt)||!tt.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(et)!==Object.prototype)}function hasObjectPrototype$1(et){return Object.prototype.toString.call(et)==="[object Object]"}function sleep(et){return new Promise(o=>{setTimeout(o,et)})}function replaceData(et,o,tt){return typeof tt.structuralSharing=="function"?tt.structuralSharing(et,o):tt.structuralSharing!==!1?replaceEqualDeep(et,o):o}function addToEnd(et,o,tt=0){const rt=[...et,o];return tt&&rt.length>tt?rt.slice(1):rt}function addToStart(et,o,tt=0){const rt=[o,...et];return tt&&rt.length>tt?rt.slice(0,-1):rt}var skipToken=Symbol();function ensureQueryFn(et,o){return!et.queryFn&&(o!=null&&o.initialPromise)?()=>o.initialPromise:!et.queryFn||et.queryFn===skipToken?()=>Promise.reject(new Error(`Missing queryFn: '${et.queryHash}'`)):et.queryFn}var kn,hn,Mn,zs,FocusManager=(zs=class extends Subscribable{constructor(){super();fr(this,kn);fr(this,hn);fr(this,Mn);lr(this,Mn,o=>{if(!isServer&&window.addEventListener){const tt=()=>o();return window.addEventListener("visibilitychange",tt,!1),()=>{window.removeEventListener("visibilitychange",tt)}}})}onSubscribe(){Ot(this,hn)||this.setEventListener(Ot(this,Mn))}onUnsubscribe(){var o;this.hasListeners()||((o=Ot(this,hn))==null||o.call(this),lr(this,hn,void 0))}setEventListener(o){var tt;lr(this,Mn,o),(tt=Ot(this,hn))==null||tt.call(this),lr(this,hn,o(rt=>{typeof rt=="boolean"?this.setFocused(rt):this.onFocus()}))}setFocused(o){Ot(this,kn)!==o&&(lr(this,kn,o),this.onFocus())}onFocus(){const o=this.isFocused();this.listeners.forEach(tt=>{tt(o)})}isFocused(){var o;return typeof Ot(this,kn)=="boolean"?Ot(this,kn):((o=globalThis.document)==null?void 0:o.visibilityState)!=="hidden"}},kn=new WeakMap,hn=new WeakMap,Mn=new WeakMap,zs),focusManager=new FocusManager,Bn,fn,Fn,Vs,OnlineManager=(Vs=class extends Subscribable{constructor(){super();fr(this,Bn,!0);fr(this,fn);fr(this,Fn);lr(this,Fn,o=>{if(!isServer&&window.addEventListener){const tt=()=>o(!0),rt=()=>o(!1);return window.addEventListener("online",tt,!1),window.addEventListener("offline",rt,!1),()=>{window.removeEventListener("online",tt),window.removeEventListener("offline",rt)}}})}onSubscribe(){Ot(this,fn)||this.setEventListener(Ot(this,Fn))}onUnsubscribe(){var o;this.hasListeners()||((o=Ot(this,fn))==null||o.call(this),lr(this,fn,void 0))}setEventListener(o){var tt;lr(this,Fn,o),(tt=Ot(this,fn))==null||tt.call(this),lr(this,fn,o(this.setOnline.bind(this)))}setOnline(o){Ot(this,Bn)!==o&&(lr(this,Bn,o),this.listeners.forEach(rt=>{rt(o)}))}isOnline(){return Ot(this,Bn)}},Bn=new WeakMap,fn=new WeakMap,Fn=new WeakMap,Vs),onlineManager=new OnlineManager;function pendingThenable(){let et,o;const tt=new Promise((nt,ot)=>{et=nt,o=ot});tt.status="pending",tt.catch(()=>{});function rt(nt){Object.assign(tt,nt),delete tt.resolve,delete tt.reject}return tt.resolve=nt=>{rt({status:"fulfilled",value:nt}),et(nt)},tt.reject=nt=>{rt({status:"rejected",reason:nt}),o(nt)},tt}function defaultRetryDelay(et){return Math.min(1e3*2**et,3e4)}function canFetch(et){return(et??"online")==="online"?onlineManager.isOnline():!0}var CancelledError=class extends Error{constructor(et){super("CancelledError"),this.revert=et==null?void 0:et.revert,this.silent=et==null?void 0:et.silent}};function isCancelledError(et){return et instanceof CancelledError}function createRetryer(et){let o=!1,tt=0,rt=!1,nt;const ot=pendingThenable(),it=pt=>{var yt;rt||(ht(new CancelledError(pt)),(yt=et.abort)==null||yt.call(et))},st=()=>{o=!0},at=()=>{o=!1},ct=()=>focusManager.isFocused()&&(et.networkMode==="always"||onlineManager.isOnline())&&et.canRun(),lt=()=>canFetch(et.networkMode)&&et.canRun(),dt=pt=>{var yt;rt||(rt=!0,(yt=et.onSuccess)==null||yt.call(et,pt),nt==null||nt(),ot.resolve(pt))},ht=pt=>{var yt;rt||(rt=!0,(yt=et.onError)==null||yt.call(et,pt),nt==null||nt(),ot.reject(pt))},mt=()=>new Promise(pt=>{var yt;nt=gt=>{(rt||ct())&&pt(gt)},(yt=et.onPause)==null||yt.call(et)}).then(()=>{var pt;nt=void 0,rt||(pt=et.onContinue)==null||pt.call(et)}),ft=()=>{if(rt)return;let pt;const yt=tt===0?et.initialPromise:void 0;try{pt=yt??et.fn()}catch(gt){pt=Promise.reject(gt)}Promise.resolve(pt).then(dt).catch(gt=>{var Ct;if(rt)return;const bt=et.retry??(isServer?0:3),xt=et.retryDelay??defaultRetryDelay,vt=typeof xt=="function"?xt(tt,gt):xt,Et=bt===!0||typeof bt=="number"&&tt<bt||typeof bt=="function"&&bt(tt,gt);if(o||!Et){ht(gt);return}tt++,(Ct=et.onFail)==null||Ct.call(et,tt,gt),sleep(vt).then(()=>ct()?void 0:mt()).then(()=>{o?ht(gt):ft()})})};return{promise:ot,cancel:it,continue:()=>(nt==null||nt(),ot),cancelRetry:st,continueRetry:at,canStart:lt,start:()=>(lt()?ft():mt().then(ft),ot)}}function createNotifyManager(){let et=[],o=0,tt=st=>{st()},rt=st=>{st()},nt=st=>setTimeout(st,0);const ot=st=>{o?et.push(st):nt(()=>{tt(st)})},it=()=>{const st=et;et=[],st.length&&nt(()=>{rt(()=>{st.forEach(at=>{tt(at)})})})};return{batch:st=>{let at;o++;try{at=st()}finally{o--,o||it()}return at},batchCalls:st=>(...at)=>{ot(()=>{st(...at)})},schedule:ot,setNotifyFunction:st=>{tt=st},setBatchNotifyFunction:st=>{rt=st},setScheduler:st=>{nt=st}}}var notifyManager=createNotifyManager(),Rn,Hs,Removable=(Hs=class{constructor(){fr(this,Rn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),isValidTimeout(this.gcTime)&&lr(this,Rn,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(et){this.gcTime=Math.max(this.gcTime||0,et??(isServer?1/0:5*60*1e3))}clearGcTimeout(){Ot(this,Rn)&&(clearTimeout(Ot(this,Rn)),lr(this,Rn,void 0))}},Rn=new WeakMap,Hs),Un,zn,Vr,Lr,io,_n,Gr,nn,Ws,Query=(Ws=class extends Removable{constructor(o){super();fr(this,Gr);fr(this,Un);fr(this,zn);fr(this,Vr);fr(this,Lr);fr(this,io);fr(this,_n);lr(this,_n,!1),lr(this,io,o.defaultOptions),this.setOptions(o.options),this.observers=[],lr(this,Vr,o.cache),this.queryKey=o.queryKey,this.queryHash=o.queryHash,lr(this,Un,getDefaultState$1(this.options)),this.state=o.state??Ot(this,Un),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var o;return(o=Ot(this,Lr))==null?void 0:o.promise}setOptions(o){this.options={...Ot(this,io),...o},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Ot(this,Vr).remove(this)}setData(o,tt){const rt=replaceData(this.state.data,o,this.options);return mr(this,Gr,nn).call(this,{data:rt,type:"success",dataUpdatedAt:tt==null?void 0:tt.updatedAt,manual:tt==null?void 0:tt.manual}),rt}setState(o,tt){mr(this,Gr,nn).call(this,{type:"setState",state:o,setStateOptions:tt})}cancel(o){var rt,nt;const tt=(rt=Ot(this,Lr))==null?void 0:rt.promise;return(nt=Ot(this,Lr))==null||nt.cancel(o),tt?tt.then(noop$4).catch(noop$4):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Ot(this,Un))}isActive(){return this.observers.some(o=>resolveEnabled(o.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===skipToken||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(o=>o.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(o=0){return this.state.isInvalidated||this.state.data===void 0||!timeUntilStale(this.state.dataUpdatedAt,o)}onFocus(){var tt;const o=this.observers.find(rt=>rt.shouldFetchOnWindowFocus());o==null||o.refetch({cancelRefetch:!1}),(tt=Ot(this,Lr))==null||tt.continue()}onOnline(){var tt;const o=this.observers.find(rt=>rt.shouldFetchOnReconnect());o==null||o.refetch({cancelRefetch:!1}),(tt=Ot(this,Lr))==null||tt.continue()}addObserver(o){this.observers.includes(o)||(this.observers.push(o),this.clearGcTimeout(),Ot(this,Vr).notify({type:"observerAdded",query:this,observer:o}))}removeObserver(o){this.observers.includes(o)&&(this.observers=this.observers.filter(tt=>tt!==o),this.observers.length||(Ot(this,Lr)&&(Ot(this,_n)?Ot(this,Lr).cancel({revert:!0}):Ot(this,Lr).cancelRetry()),this.scheduleGc()),Ot(this,Vr).notify({type:"observerRemoved",query:this,observer:o}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||mr(this,Gr,nn).call(this,{type:"invalidate"})}fetch(o,tt){var at,ct,lt;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(tt!=null&&tt.cancelRefetch))this.cancel({silent:!0});else if(Ot(this,Lr))return Ot(this,Lr).continueRetry(),Ot(this,Lr).promise}if(o&&this.setOptions(o),!this.options.queryFn){const dt=this.observers.find(ht=>ht.options.queryFn);dt&&this.setOptions(dt.options)}const rt=new AbortController,nt=dt=>{Object.defineProperty(dt,"signal",{enumerable:!0,get:()=>(lr(this,_n,!0),rt.signal)})},ot=()=>{const dt=ensureQueryFn(this.options,tt),ht={queryKey:this.queryKey,meta:this.meta};return nt(ht),lr(this,_n,!1),this.options.persister?this.options.persister(dt,ht,this):dt(ht)},it={fetchOptions:tt,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:ot};nt(it),(at=this.options.behavior)==null||at.onFetch(it,this),lr(this,zn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((ct=it.fetchOptions)==null?void 0:ct.meta))&&mr(this,Gr,nn).call(this,{type:"fetch",meta:(lt=it.fetchOptions)==null?void 0:lt.meta});const st=dt=>{var ht,mt,ft,pt;isCancelledError(dt)&&dt.silent||mr(this,Gr,nn).call(this,{type:"error",error:dt}),isCancelledError(dt)||((mt=(ht=Ot(this,Vr).config).onError)==null||mt.call(ht,dt,this),(pt=(ft=Ot(this,Vr).config).onSettled)==null||pt.call(ft,this.state.data,dt,this)),this.scheduleGc()};return lr(this,Lr,createRetryer({initialPromise:tt==null?void 0:tt.initialPromise,fn:it.fetchFn,abort:rt.abort.bind(rt),onSuccess:dt=>{var ht,mt,ft,pt;if(dt===void 0){st(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(dt)}catch(yt){st(yt);return}(mt=(ht=Ot(this,Vr).config).onSuccess)==null||mt.call(ht,dt,this),(pt=(ft=Ot(this,Vr).config).onSettled)==null||pt.call(ft,dt,this.state.error,this),this.scheduleGc()},onError:st,onFail:(dt,ht)=>{mr(this,Gr,nn).call(this,{type:"failed",failureCount:dt,error:ht})},onPause:()=>{mr(this,Gr,nn).call(this,{type:"pause"})},onContinue:()=>{mr(this,Gr,nn).call(this,{type:"continue"})},retry:it.options.retry,retryDelay:it.options.retryDelay,networkMode:it.options.networkMode,canRun:()=>!0})),Ot(this,Lr).start()}},Un=new WeakMap,zn=new WeakMap,Vr=new WeakMap,Lr=new WeakMap,io=new WeakMap,_n=new WeakMap,Gr=new WeakSet,nn=function(o){const tt=rt=>{switch(o.type){case"failed":return{...rt,fetchFailureCount:o.failureCount,fetchFailureReason:o.error};case"pause":return{...rt,fetchStatus:"paused"};case"continue":return{...rt,fetchStatus:"fetching"};case"fetch":return{...rt,...fetchState(rt.data,this.options),fetchMeta:o.meta??null};case"success":return{...rt,data:o.data,dataUpdateCount:rt.dataUpdateCount+1,dataUpdatedAt:o.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!o.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const nt=o.error;return isCancelledError(nt)&&nt.revert&&Ot(this,zn)?{...Ot(this,zn),fetchStatus:"idle"}:{...rt,error:nt,errorUpdateCount:rt.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:rt.fetchFailureCount+1,fetchFailureReason:nt,fetchStatus:"idle",status:"error"};case"invalidate":return{...rt,isInvalidated:!0};case"setState":return{...rt,...o.state}}};this.state=tt(this.state),notifyManager.batch(()=>{this.observers.forEach(rt=>{rt.onQueryUpdate()}),Ot(this,Vr).notify({query:this,type:"updated",action:o})})},Ws);function fetchState(et,o){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:canFetch(o.networkMode)?"fetching":"paused",...et===void 0&&{error:null,status:"pending"}}}function getDefaultState$1(et){const o=typeof et.initialData=="function"?et.initialData():et.initialData,tt=o!==void 0,rt=tt?typeof et.initialDataUpdatedAt=="function"?et.initialDataUpdatedAt():et.initialDataUpdatedAt:0;return{data:o,dataUpdateCount:0,dataUpdatedAt:tt?rt??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:tt?"success":"pending",fetchStatus:"idle"}}var qr,Gs,QueryCache=(Gs=class extends Subscribable{constructor(o={}){super();fr(this,qr);this.config=o,lr(this,qr,new Map)}build(o,tt,rt){const nt=tt.queryKey,ot=tt.queryHash??hashQueryKeyByOptions(nt,tt);let it=this.get(ot);return it||(it=new Query({cache:this,queryKey:nt,queryHash:ot,options:o.defaultQueryOptions(tt),state:rt,defaultOptions:o.getQueryDefaults(nt)}),this.add(it)),it}add(o){Ot(this,qr).has(o.queryHash)||(Ot(this,qr).set(o.queryHash,o),this.notify({type:"added",query:o}))}remove(o){const tt=Ot(this,qr).get(o.queryHash);tt&&(o.destroy(),tt===o&&Ot(this,qr).delete(o.queryHash),this.notify({type:"removed",query:o}))}clear(){notifyManager.batch(()=>{this.getAll().forEach(o=>{this.remove(o)})})}get(o){return Ot(this,qr).get(o)}getAll(){return[...Ot(this,qr).values()]}find(o){const tt={exact:!0,...o};return this.getAll().find(rt=>matchQuery(tt,rt))}findAll(o={}){const tt=this.getAll();return Object.keys(o).length>0?tt.filter(rt=>matchQuery(o,rt)):tt}notify(o){notifyManager.batch(()=>{this.listeners.forEach(tt=>{tt(o)})})}onFocus(){notifyManager.batch(()=>{this.getAll().forEach(o=>{o.onFocus()})})}onOnline(){notifyManager.batch(()=>{this.getAll().forEach(o=>{o.onOnline()})})}},qr=new WeakMap,Gs),Kr,Or,Tn,Qr,un,qs,Mutation=(qs=class extends Removable{constructor(o){super();fr(this,Qr);fr(this,Kr);fr(this,Or);fr(this,Tn);this.mutationId=o.mutationId,lr(this,Or,o.mutationCache),lr(this,Kr,[]),this.state=o.state||getDefaultState(),this.setOptions(o.options),this.scheduleGc()}setOptions(o){this.options=o,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(o){Ot(this,Kr).includes(o)||(Ot(this,Kr).push(o),this.clearGcTimeout(),Ot(this,Or).notify({type:"observerAdded",mutation:this,observer:o}))}removeObserver(o){lr(this,Kr,Ot(this,Kr).filter(tt=>tt!==o)),this.scheduleGc(),Ot(this,Or).notify({type:"observerRemoved",mutation:this,observer:o})}optionalRemove(){Ot(this,Kr).length||(this.state.status==="pending"?this.scheduleGc():Ot(this,Or).remove(this))}continue(){var o;return((o=Ot(this,Tn))==null?void 0:o.continue())??this.execute(this.state.variables)}async execute(o){var nt,ot,it,st,at,ct,lt,dt,ht,mt,ft,pt,yt,gt,bt,xt,vt,Et,Ct,St;lr(this,Tn,createRetryer({fn:()=>this.options.mutationFn?this.options.mutationFn(o):Promise.reject(new Error("No mutationFn found")),onFail:(At,kt)=>{mr(this,Qr,un).call(this,{type:"failed",failureCount:At,error:kt})},onPause:()=>{mr(this,Qr,un).call(this,{type:"pause"})},onContinue:()=>{mr(this,Qr,un).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Ot(this,Or).canRun(this)}));const tt=this.state.status==="pending",rt=!Ot(this,Tn).canStart();try{if(!tt){mr(this,Qr,un).call(this,{type:"pending",variables:o,isPaused:rt}),await((ot=(nt=Ot(this,Or).config).onMutate)==null?void 0:ot.call(nt,o,this));const kt=await((st=(it=this.options).onMutate)==null?void 0:st.call(it,o));kt!==this.state.context&&mr(this,Qr,un).call(this,{type:"pending",context:kt,variables:o,isPaused:rt})}const At=await Ot(this,Tn).start();return await((ct=(at=Ot(this,Or).config).onSuccess)==null?void 0:ct.call(at,At,o,this.state.context,this)),await((dt=(lt=this.options).onSuccess)==null?void 0:dt.call(lt,At,o,this.state.context)),await((mt=(ht=Ot(this,Or).config).onSettled)==null?void 0:mt.call(ht,At,null,this.state.variables,this.state.context,this)),await((pt=(ft=this.options).onSettled)==null?void 0:pt.call(ft,At,null,o,this.state.context)),mr(this,Qr,un).call(this,{type:"success",data:At}),At}catch(At){try{throw await((gt=(yt=Ot(this,Or).config).onError)==null?void 0:gt.call(yt,At,o,this.state.context,this)),await((xt=(bt=this.options).onError)==null?void 0:xt.call(bt,At,o,this.state.context)),await((Et=(vt=Ot(this,Or).config).onSettled)==null?void 0:Et.call(vt,void 0,At,this.state.variables,this.state.context,this)),await((St=(Ct=this.options).onSettled)==null?void 0:St.call(Ct,void 0,At,o,this.state.context)),At}finally{mr(this,Qr,un).call(this,{type:"error",error:At})}}finally{Ot(this,Or).runNext(this)}}},Kr=new WeakMap,Or=new WeakMap,Tn=new WeakMap,Qr=new WeakSet,un=function(o){const tt=rt=>{switch(o.type){case"failed":return{...rt,failureCount:o.failureCount,failureReason:o.error};case"pause":return{...rt,isPaused:!0};case"continue":return{...rt,isPaused:!1};case"pending":return{...rt,context:o.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:o.isPaused,status:"pending",variables:o.variables,submittedAt:Date.now()};case"success":return{...rt,data:o.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...rt,data:void 0,error:o.error,failureCount:rt.failureCount+1,failureReason:o.error,isPaused:!1,status:"error"}}};this.state=tt(this.state),notifyManager.batch(()=>{Ot(this,Kr).forEach(rt=>{rt.onMutationUpdate(o)}),Ot(this,Or).notify({mutation:this,type:"updated",action:o})})},qs);function getDefaultState(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var zr,so,Ks,MutationCache=(Ks=class extends Subscribable{constructor(o={}){super();fr(this,zr);fr(this,so);this.config=o,lr(this,zr,new Map),lr(this,so,Date.now())}build(o,tt,rt){const nt=new Mutation({mutationCache:this,mutationId:++Cn(this,so)._,options:o.defaultMutationOptions(tt),state:rt});return this.add(nt),nt}add(o){const tt=scopeFor(o),rt=Ot(this,zr).get(tt)??[];rt.push(o),Ot(this,zr).set(tt,rt),this.notify({type:"added",mutation:o})}remove(o){var rt;const tt=scopeFor(o);if(Ot(this,zr).has(tt)){const nt=(rt=Ot(this,zr).get(tt))==null?void 0:rt.filter(ot=>ot!==o);nt&&(nt.length===0?Ot(this,zr).delete(tt):Ot(this,zr).set(tt,nt))}this.notify({type:"removed",mutation:o})}canRun(o){var rt;const tt=(rt=Ot(this,zr).get(scopeFor(o)))==null?void 0:rt.find(nt=>nt.state.status==="pending");return!tt||tt===o}runNext(o){var rt;const tt=(rt=Ot(this,zr).get(scopeFor(o)))==null?void 0:rt.find(nt=>nt!==o&&nt.state.isPaused);return(tt==null?void 0:tt.continue())??Promise.resolve()}clear(){notifyManager.batch(()=>{this.getAll().forEach(o=>{this.remove(o)})})}getAll(){return[...Ot(this,zr).values()].flat()}find(o){const tt={exact:!0,...o};return this.getAll().find(rt=>matchMutation(tt,rt))}findAll(o={}){return this.getAll().filter(tt=>matchMutation(o,tt))}notify(o){notifyManager.batch(()=>{this.listeners.forEach(tt=>{tt(o)})})}resumePausedMutations(){const o=this.getAll().filter(tt=>tt.state.isPaused);return notifyManager.batch(()=>Promise.all(o.map(tt=>tt.continue().catch(noop$4))))}},zr=new WeakMap,so=new WeakMap,Ks);function scopeFor(et){var o;return((o=et.options.scope)==null?void 0:o.id)??String(et.mutationId)}function infiniteQueryBehavior(et){return{onFetch:(o,tt)=>{var lt,dt,ht,mt,ft;const rt=o.options,nt=(ht=(dt=(lt=o.fetchOptions)==null?void 0:lt.meta)==null?void 0:dt.fetchMore)==null?void 0:ht.direction,ot=((mt=o.state.data)==null?void 0:mt.pages)||[],it=((ft=o.state.data)==null?void 0:ft.pageParams)||[];let st={pages:[],pageParams:[]},at=0;const ct=async()=>{let pt=!1;const yt=xt=>{Object.defineProperty(xt,"signal",{enumerable:!0,get:()=>(o.signal.aborted?pt=!0:o.signal.addEventListener("abort",()=>{pt=!0}),o.signal)})},gt=ensureQueryFn(o.options,o.fetchOptions),bt=async(xt,vt,Et)=>{if(pt)return Promise.reject();if(vt==null&&xt.pages.length)return Promise.resolve(xt);const Ct={queryKey:o.queryKey,pageParam:vt,direction:Et?"backward":"forward",meta:o.options.meta};yt(Ct);const St=await gt(Ct),{maxPages:At}=o.options,kt=Et?addToStart:addToEnd;return{pages:kt(xt.pages,St,At),pageParams:kt(xt.pageParams,vt,At)}};if(nt&&ot.length){const xt=nt==="backward",vt=xt?getPreviousPageParam:getNextPageParam,Et={pages:ot,pageParams:it},Ct=vt(rt,Et);st=await bt(Et,Ct,xt)}else{const xt=et??ot.length;do{const vt=at===0?it[0]??rt.initialPageParam:getNextPageParam(rt,st);if(at>0&&vt==null)break;st=await bt(st,vt),at++}while(at<xt)}return st};o.options.persister?o.fetchFn=()=>{var pt,yt;return(yt=(pt=o.options).persister)==null?void 0:yt.call(pt,ct,{queryKey:o.queryKey,meta:o.options.meta,signal:o.signal},tt)}:o.fetchFn=ct}}}function getNextPageParam(et,{pages:o,pageParams:tt}){const rt=o.length-1;return o.length>0?et.getNextPageParam(o[rt],o,tt[rt],tt):void 0}function getPreviousPageParam(et,{pages:o,pageParams:tt}){var rt;return o.length>0?(rt=et.getPreviousPageParam)==null?void 0:rt.call(et,o[0],o,tt[0],tt):void 0}var Pr,pn,mn,Vn,Hn,gn,Wn,Gn,Qs,QueryClient=(Qs=class{constructor(et={}){fr(this,Pr);fr(this,pn);fr(this,mn);fr(this,Vn);fr(this,Hn);fr(this,gn);fr(this,Wn);fr(this,Gn);lr(this,Pr,et.queryCache||new QueryCache),lr(this,pn,et.mutationCache||new MutationCache),lr(this,mn,et.defaultOptions||{}),lr(this,Vn,new Map),lr(this,Hn,new Map),lr(this,gn,0)}mount(){Cn(this,gn)._++,Ot(this,gn)===1&&(lr(this,Wn,focusManager.subscribe(async et=>{et&&(await this.resumePausedMutations(),Ot(this,Pr).onFocus())})),lr(this,Gn,onlineManager.subscribe(async et=>{et&&(await this.resumePausedMutations(),Ot(this,Pr).onOnline())})))}unmount(){var et,o;Cn(this,gn)._--,Ot(this,gn)===0&&((et=Ot(this,Wn))==null||et.call(this),lr(this,Wn,void 0),(o=Ot(this,Gn))==null||o.call(this),lr(this,Gn,void 0))}isFetching(et){return Ot(this,Pr).findAll({...et,fetchStatus:"fetching"}).length}isMutating(et){return Ot(this,pn).findAll({...et,status:"pending"}).length}getQueryData(et){var tt;const o=this.defaultQueryOptions({queryKey:et});return(tt=Ot(this,Pr).get(o.queryHash))==null?void 0:tt.state.data}ensureQueryData(et){const o=this.getQueryData(et.queryKey);if(o===void 0)return this.fetchQuery(et);{const tt=this.defaultQueryOptions(et),rt=Ot(this,Pr).build(this,tt);return et.revalidateIfStale&&rt.isStaleByTime(resolveStaleTime(tt.staleTime,rt))&&this.prefetchQuery(tt),Promise.resolve(o)}}getQueriesData(et){return Ot(this,Pr).findAll(et).map(({queryKey:o,state:tt})=>{const rt=tt.data;return[o,rt]})}setQueryData(et,o,tt){const rt=this.defaultQueryOptions({queryKey:et}),nt=Ot(this,Pr).get(rt.queryHash),ot=nt==null?void 0:nt.state.data,it=functionalUpdate(o,ot);if(it!==void 0)return Ot(this,Pr).build(this,rt).setData(it,{...tt,manual:!0})}setQueriesData(et,o,tt){return notifyManager.batch(()=>Ot(this,Pr).findAll(et).map(({queryKey:rt})=>[rt,this.setQueryData(rt,o,tt)]))}getQueryState(et){var tt;const o=this.defaultQueryOptions({queryKey:et});return(tt=Ot(this,Pr).get(o.queryHash))==null?void 0:tt.state}removeQueries(et){const o=Ot(this,Pr);notifyManager.batch(()=>{o.findAll(et).forEach(tt=>{o.remove(tt)})})}resetQueries(et,o){const tt=Ot(this,Pr),rt={type:"active",...et};return notifyManager.batch(()=>(tt.findAll(et).forEach(nt=>{nt.reset()}),this.refetchQueries(rt,o)))}cancelQueries(et={},o={}){const tt={revert:!0,...o},rt=notifyManager.batch(()=>Ot(this,Pr).findAll(et).map(nt=>nt.cancel(tt)));return Promise.all(rt).then(noop$4).catch(noop$4)}invalidateQueries(et={},o={}){return notifyManager.batch(()=>{if(Ot(this,Pr).findAll(et).forEach(rt=>{rt.invalidate()}),et.refetchType==="none")return Promise.resolve();const tt={...et,type:et.refetchType??et.type??"active"};return this.refetchQueries(tt,o)})}refetchQueries(et={},o){const tt={...o,cancelRefetch:(o==null?void 0:o.cancelRefetch)??!0},rt=notifyManager.batch(()=>Ot(this,Pr).findAll(et).filter(nt=>!nt.isDisabled()).map(nt=>{let ot=nt.fetch(void 0,tt);return tt.throwOnError||(ot=ot.catch(noop$4)),nt.state.fetchStatus==="paused"?Promise.resolve():ot}));return Promise.all(rt).then(noop$4)}fetchQuery(et){const o=this.defaultQueryOptions(et);o.retry===void 0&&(o.retry=!1);const tt=Ot(this,Pr).build(this,o);return tt.isStaleByTime(resolveStaleTime(o.staleTime,tt))?tt.fetch(o):Promise.resolve(tt.state.data)}prefetchQuery(et){return this.fetchQuery(et).then(noop$4).catch(noop$4)}fetchInfiniteQuery(et){return et.behavior=infiniteQueryBehavior(et.pages),this.fetchQuery(et)}prefetchInfiniteQuery(et){return this.fetchInfiniteQuery(et).then(noop$4).catch(noop$4)}ensureInfiniteQueryData(et){return et.behavior=infiniteQueryBehavior(et.pages),this.ensureQueryData(et)}resumePausedMutations(){return onlineManager.isOnline()?Ot(this,pn).resumePausedMutations():Promise.resolve()}getQueryCache(){return Ot(this,Pr)}getMutationCache(){return Ot(this,pn)}getDefaultOptions(){return Ot(this,mn)}setDefaultOptions(et){lr(this,mn,et)}setQueryDefaults(et,o){Ot(this,Vn).set(hashKey(et),{queryKey:et,defaultOptions:o})}getQueryDefaults(et){const o=[...Ot(this,Vn).values()];let tt={};return o.forEach(rt=>{partialMatchKey(et,rt.queryKey)&&(tt={...tt,...rt.defaultOptions})}),tt}setMutationDefaults(et,o){Ot(this,Hn).set(hashKey(et),{mutationKey:et,defaultOptions:o})}getMutationDefaults(et){const o=[...Ot(this,Hn).values()];let tt={};return o.forEach(rt=>{partialMatchKey(et,rt.mutationKey)&&(tt={...tt,...rt.defaultOptions})}),tt}defaultQueryOptions(et){if(et._defaulted)return et;const o={...Ot(this,mn).queries,...this.getQueryDefaults(et.queryKey),...et,_defaulted:!0};return o.queryHash||(o.queryHash=hashQueryKeyByOptions(o.queryKey,o)),o.refetchOnReconnect===void 0&&(o.refetchOnReconnect=o.networkMode!=="always"),o.throwOnError===void 0&&(o.throwOnError=!!o.suspense),!o.networkMode&&o.persister&&(o.networkMode="offlineFirst"),o.enabled!==!0&&o.queryFn===skipToken&&(o.enabled=!1),o}defaultMutationOptions(et){return et!=null&&et._defaulted?et:{...Ot(this,mn).mutations,...(et==null?void 0:et.mutationKey)&&this.getMutationDefaults(et.mutationKey),...et,_defaulted:!0}}clear(){Ot(this,Pr).clear(),Ot(this,pn).clear()}},Pr=new WeakMap,pn=new WeakMap,mn=new WeakMap,Vn=new WeakMap,Hn=new WeakMap,gn=new WeakMap,Wn=new WeakMap,Gn=new WeakMap,Qs),Br,Cr,ao,Mr,In,qn,bn,Xr,co,Kn,Qn,Pn,jn,yn,Xn,Rr,oo,Ts,Is,Ps,js,Ns,Ds,Ls,tu,Xs,QueryObserver=(Xs=class extends Subscribable{constructor(o,tt){super();fr(this,Rr);fr(this,Br);fr(this,Cr);fr(this,ao);fr(this,Mr);fr(this,In);fr(this,qn);fr(this,bn);fr(this,Xr);fr(this,co);fr(this,Kn);fr(this,Qn);fr(this,Pn);fr(this,jn);fr(this,yn);fr(this,Xn,new Set);this.options=tt,lr(this,Br,o),lr(this,Xr,null),lr(this,bn,pendingThenable()),this.options.experimental_prefetchInRender||Ot(this,bn).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(tt)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Ot(this,Cr).addObserver(this),shouldFetchOnMount(Ot(this,Cr),this.options)?mr(this,Rr,oo).call(this):this.updateResult(),mr(this,Rr,js).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return shouldFetchOn(Ot(this,Cr),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return shouldFetchOn(Ot(this,Cr),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,mr(this,Rr,Ns).call(this),mr(this,Rr,Ds).call(this),Ot(this,Cr).removeObserver(this)}setOptions(o,tt){const rt=this.options,nt=Ot(this,Cr);if(this.options=Ot(this,Br).defaultQueryOptions(o),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof resolveEnabled(this.options.enabled,Ot(this,Cr))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");mr(this,Rr,Ls).call(this),Ot(this,Cr).setOptions(this.options),rt._defaulted&&!shallowEqualObjects(this.options,rt)&&Ot(this,Br).getQueryCache().notify({type:"observerOptionsUpdated",query:Ot(this,Cr),observer:this});const ot=this.hasListeners();ot&&shouldFetchOptionally(Ot(this,Cr),nt,this.options,rt)&&mr(this,Rr,oo).call(this),this.updateResult(tt),ot&&(Ot(this,Cr)!==nt||resolveEnabled(this.options.enabled,Ot(this,Cr))!==resolveEnabled(rt.enabled,Ot(this,Cr))||resolveStaleTime(this.options.staleTime,Ot(this,Cr))!==resolveStaleTime(rt.staleTime,Ot(this,Cr)))&&mr(this,Rr,Ts).call(this);const it=mr(this,Rr,Is).call(this);ot&&(Ot(this,Cr)!==nt||resolveEnabled(this.options.enabled,Ot(this,Cr))!==resolveEnabled(rt.enabled,Ot(this,Cr))||it!==Ot(this,yn))&&mr(this,Rr,Ps).call(this,it)}getOptimisticResult(o){const tt=Ot(this,Br).getQueryCache().build(Ot(this,Br),o),rt=this.createResult(tt,o);return shouldAssignObserverCurrentProperties(this,rt)&&(lr(this,Mr,rt),lr(this,qn,this.options),lr(this,In,Ot(this,Cr).state)),rt}getCurrentResult(){return Ot(this,Mr)}trackResult(o,tt){const rt={};return Object.keys(o).forEach(nt=>{Object.defineProperty(rt,nt,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(nt),tt==null||tt(nt),o[nt])})}),rt}trackProp(o){Ot(this,Xn).add(o)}getCurrentQuery(){return Ot(this,Cr)}refetch({...o}={}){return this.fetch({...o})}fetchOptimistic(o){const tt=Ot(this,Br).defaultQueryOptions(o),rt=Ot(this,Br).getQueryCache().build(Ot(this,Br),tt);return rt.fetch().then(()=>this.createResult(rt,tt))}fetch(o){return mr(this,Rr,oo).call(this,{...o,cancelRefetch:o.cancelRefetch??!0}).then(()=>(this.updateResult(),Ot(this,Mr)))}createResult(o,tt){var At;const rt=Ot(this,Cr),nt=this.options,ot=Ot(this,Mr),it=Ot(this,In),st=Ot(this,qn),ct=o!==rt?o.state:Ot(this,ao),{state:lt}=o;let dt={...lt},ht=!1,mt;if(tt._optimisticResults){const kt=this.hasListeners(),It=!kt&&shouldFetchOnMount(o,tt),Nt=kt&&shouldFetchOptionally(o,rt,tt,nt);(It||Nt)&&(dt={...dt,...fetchState(lt.data,o.options)}),tt._optimisticResults==="isRestoring"&&(dt.fetchStatus="idle")}let{error:ft,errorUpdatedAt:pt,status:yt}=dt;if(tt.select&&dt.data!==void 0)if(ot&&dt.data===(it==null?void 0:it.data)&&tt.select===Ot(this,co))mt=Ot(this,Kn);else try{lr(this,co,tt.select),mt=tt.select(dt.data),mt=replaceData(ot==null?void 0:ot.data,mt,tt),lr(this,Kn,mt),lr(this,Xr,null)}catch(kt){lr(this,Xr,kt)}else mt=dt.data;if(tt.placeholderData!==void 0&&mt===void 0&&yt==="pending"){let kt;if(ot!=null&&ot.isPlaceholderData&&tt.placeholderData===(st==null?void 0:st.placeholderData))kt=ot.data;else if(kt=typeof tt.placeholderData=="function"?tt.placeholderData((At=Ot(this,Qn))==null?void 0:At.state.data,Ot(this,Qn)):tt.placeholderData,tt.select&&kt!==void 0)try{kt=tt.select(kt),lr(this,Xr,null)}catch(It){lr(this,Xr,It)}kt!==void 0&&(yt="success",mt=replaceData(ot==null?void 0:ot.data,kt,tt),ht=!0)}Ot(this,Xr)&&(ft=Ot(this,Xr),mt=Ot(this,Kn),pt=Date.now(),yt="error");const gt=dt.fetchStatus==="fetching",bt=yt==="pending",xt=yt==="error",vt=bt&&gt,Et=mt!==void 0,St={status:yt,fetchStatus:dt.fetchStatus,isPending:bt,isSuccess:yt==="success",isError:xt,isInitialLoading:vt,isLoading:vt,data:mt,dataUpdatedAt:dt.dataUpdatedAt,error:ft,errorUpdatedAt:pt,failureCount:dt.fetchFailureCount,failureReason:dt.fetchFailureReason,errorUpdateCount:dt.errorUpdateCount,isFetched:dt.dataUpdateCount>0||dt.errorUpdateCount>0,isFetchedAfterMount:dt.dataUpdateCount>ct.dataUpdateCount||dt.errorUpdateCount>ct.errorUpdateCount,isFetching:gt,isRefetching:gt&&!bt,isLoadingError:xt&&!Et,isPaused:dt.fetchStatus==="paused",isPlaceholderData:ht,isRefetchError:xt&&Et,isStale:isStale(o,tt),refetch:this.refetch,promise:Ot(this,bn)};if(this.options.experimental_prefetchInRender){const kt=Lt=>{St.status==="error"?Lt.reject(St.error):St.data!==void 0&&Lt.resolve(St.data)},It=()=>{const Lt=lr(this,bn,St.promise=pendingThenable());kt(Lt)},Nt=Ot(this,bn);switch(Nt.status){case"pending":o.queryHash===rt.queryHash&&kt(Nt);break;case"fulfilled":(St.status==="error"||St.data!==Nt.value)&&It();break;case"rejected":(St.status!=="error"||St.error!==Nt.reason)&&It();break}}return St}updateResult(o){const tt=Ot(this,Mr),rt=this.createResult(Ot(this,Cr),this.options);if(lr(this,In,Ot(this,Cr).state),lr(this,qn,this.options),Ot(this,In).data!==void 0&&lr(this,Qn,Ot(this,Cr)),shallowEqualObjects(rt,tt))return;lr(this,Mr,rt);const nt={},ot=()=>{if(!tt)return!0;const{notifyOnChangeProps:it}=this.options,st=typeof it=="function"?it():it;if(st==="all"||!st&&!Ot(this,Xn).size)return!0;const at=new Set(st??Ot(this,Xn));return this.options.throwOnError&&at.add("error"),Object.keys(Ot(this,Mr)).some(ct=>{const lt=ct;return Ot(this,Mr)[lt]!==tt[lt]&&at.has(lt)})};(o==null?void 0:o.listeners)!==!1&&ot()&&(nt.listeners=!0),mr(this,Rr,tu).call(this,{...nt,...o})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&mr(this,Rr,js).call(this)}},Br=new WeakMap,Cr=new WeakMap,ao=new WeakMap,Mr=new WeakMap,In=new WeakMap,qn=new WeakMap,bn=new WeakMap,Xr=new WeakMap,co=new WeakMap,Kn=new WeakMap,Qn=new WeakMap,Pn=new WeakMap,jn=new WeakMap,yn=new WeakMap,Xn=new WeakMap,Rr=new WeakSet,oo=function(o){mr(this,Rr,Ls).call(this);let tt=Ot(this,Cr).fetch(this.options,o);return o!=null&&o.throwOnError||(tt=tt.catch(noop$4)),tt},Ts=function(){mr(this,Rr,Ns).call(this);const o=resolveStaleTime(this.options.staleTime,Ot(this,Cr));if(isServer||Ot(this,Mr).isStale||!isValidTimeout(o))return;const rt=timeUntilStale(Ot(this,Mr).dataUpdatedAt,o)+1;lr(this,Pn,setTimeout(()=>{Ot(this,Mr).isStale||this.updateResult()},rt))},Is=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Ot(this,Cr)):this.options.refetchInterval)??!1},Ps=function(o){mr(this,Rr,Ds).call(this),lr(this,yn,o),!(isServer||resolveEnabled(this.options.enabled,Ot(this,Cr))===!1||!isValidTimeout(Ot(this,yn))||Ot(this,yn)===0)&&lr(this,jn,setInterval(()=>{(this.options.refetchIntervalInBackground||focusManager.isFocused())&&mr(this,Rr,oo).call(this)},Ot(this,yn)))},js=function(){mr(this,Rr,Ts).call(this),mr(this,Rr,Ps).call(this,mr(this,Rr,Is).call(this))},Ns=function(){Ot(this,Pn)&&(clearTimeout(Ot(this,Pn)),lr(this,Pn,void 0))},Ds=function(){Ot(this,jn)&&(clearInterval(Ot(this,jn)),lr(this,jn,void 0))},Ls=function(){const o=Ot(this,Br).getQueryCache().build(Ot(this,Br),this.options);if(o===Ot(this,Cr))return;const tt=Ot(this,Cr);lr(this,Cr,o),lr(this,ao,o.state),this.hasListeners()&&(tt==null||tt.removeObserver(this),o.addObserver(this))},tu=function(o){notifyManager.batch(()=>{o.listeners&&this.listeners.forEach(tt=>{tt(Ot(this,Mr))}),Ot(this,Br).getQueryCache().notify({query:Ot(this,Cr),type:"observerResultsUpdated"})})},Xs);function shouldLoadOnMount(et,o){return resolveEnabled(o.enabled,et)!==!1&&et.state.data===void 0&&!(et.state.status==="error"&&o.retryOnMount===!1)}function shouldFetchOnMount(et,o){return shouldLoadOnMount(et,o)||et.state.data!==void 0&&shouldFetchOn(et,o,o.refetchOnMount)}function shouldFetchOn(et,o,tt){if(resolveEnabled(o.enabled,et)!==!1){const rt=typeof tt=="function"?tt(et):tt;return rt==="always"||rt!==!1&&isStale(et,o)}return!1}function shouldFetchOptionally(et,o,tt,rt){return(et!==o||resolveEnabled(rt.enabled,et)===!1)&&(!tt.suspense||et.state.status!=="error")&&isStale(et,tt)}function isStale(et,o){return resolveEnabled(o.enabled,et)!==!1&&et.isStaleByTime(resolveStaleTime(o.staleTime,et))}function shouldAssignObserverCurrentProperties(et,o){return!shallowEqualObjects(et.getCurrentResult(),o)}var xn,vn,Fr,sn,ln,Jo,Os,Ys,MutationObserver$1=(Ys=class extends Subscribable{constructor(tt,rt){super();fr(this,ln);fr(this,xn);fr(this,vn);fr(this,Fr);fr(this,sn);lr(this,xn,tt),this.setOptions(rt),this.bindMethods(),mr(this,ln,Jo).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(tt){var nt;const rt=this.options;this.options=Ot(this,xn).defaultMutationOptions(tt),shallowEqualObjects(this.options,rt)||Ot(this,xn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Ot(this,Fr),observer:this}),rt!=null&&rt.mutationKey&&this.options.mutationKey&&hashKey(rt.mutationKey)!==hashKey(this.options.mutationKey)?this.reset():((nt=Ot(this,Fr))==null?void 0:nt.state.status)==="pending"&&Ot(this,Fr).setOptions(this.options)}onUnsubscribe(){var tt;this.hasListeners()||(tt=Ot(this,Fr))==null||tt.removeObserver(this)}onMutationUpdate(tt){mr(this,ln,Jo).call(this),mr(this,ln,Os).call(this,tt)}getCurrentResult(){return Ot(this,vn)}reset(){var tt;(tt=Ot(this,Fr))==null||tt.removeObserver(this),lr(this,Fr,void 0),mr(this,ln,Jo).call(this),mr(this,ln,Os).call(this)}mutate(tt,rt){var nt;return lr(this,sn,rt),(nt=Ot(this,Fr))==null||nt.removeObserver(this),lr(this,Fr,Ot(this,xn).getMutationCache().build(Ot(this,xn),this.options)),Ot(this,Fr).addObserver(this),Ot(this,Fr).execute(tt)}},xn=new WeakMap,vn=new WeakMap,Fr=new WeakMap,sn=new WeakMap,ln=new WeakSet,Jo=function(){var rt;const tt=((rt=Ot(this,Fr))==null?void 0:rt.state)??getDefaultState();lr(this,vn,{...tt,isPending:tt.status==="pending",isSuccess:tt.status==="success",isError:tt.status==="error",isIdle:tt.status==="idle",mutate:this.mutate,reset:this.reset})},Os=function(tt){notifyManager.batch(()=>{var rt,nt,ot,it,st,at,ct,lt;if(Ot(this,sn)&&this.hasListeners()){const dt=Ot(this,vn).variables,ht=Ot(this,vn).context;(tt==null?void 0:tt.type)==="success"?((nt=(rt=Ot(this,sn)).onSuccess)==null||nt.call(rt,tt.data,dt,ht),(it=(ot=Ot(this,sn)).onSettled)==null||it.call(ot,tt.data,null,dt,ht)):(tt==null?void 0:tt.type)==="error"&&((at=(st=Ot(this,sn)).onError)==null||at.call(st,tt.error,dt,ht),(lt=(ct=Ot(this,sn)).onSettled)==null||lt.call(ct,void 0,tt.error,dt,ht))}this.listeners.forEach(dt=>{dt(Ot(this,vn))})})},Ys);function hashFn(et){return JSON.stringify(et,(o,tt)=>isPlainObject$2(tt)?Object.keys(tt).sort().reduce((rt,nt)=>(rt[nt]=tt[nt],rt),{}):typeof tt=="bigint"?tt.toString():tt)}function isPlainObject$2(et){if(!hasObjectPrototype(et))return!1;const o=et.constructor;if(typeof o>"u")return!0;const tt=o.prototype;return!(!hasObjectPrototype(tt)||!tt.hasOwnProperty("isPrototypeOf"))}function hasObjectPrototype(et){return Object.prototype.toString.call(et)==="[object Object]"}function filterQueryOptions(et){const{_defaulted:o,behavior:tt,gcTime:rt,initialData:nt,initialDataUpdatedAt:ot,maxPages:it,meta:st,networkMode:at,queryFn:ct,queryHash:lt,queryKey:dt,queryKeyHashFn:ht,retry:mt,retryDelay:ft,structuralSharing:pt,getPreviousPageParam:yt,getNextPageParam:gt,initialPageParam:bt,_optimisticResults:xt,enabled:vt,notifyOnChangeProps:Et,placeholderData:Ct,refetchInterval:St,refetchIntervalInBackground:At,refetchOnMount:kt,refetchOnReconnect:It,refetchOnWindowFocus:Nt,retryOnMount:Lt,select:Mt,staleTime:zt,suspense:Ut,throwOnError:Xt,config:Wt,connector:Ft,query:qt,...Pt}=et;return Pt}function connectMutationOptions(et){return{mutationFn(o){return connect$1(et,o)},mutationKey:["connect"]}}function disconnectMutationOptions(et){return{mutationFn(o){return disconnect(et,o)},mutationKey:["disconnect"]}}function getBalanceQueryOptions(et,o={}){return{async queryFn({queryKey:tt}){const{address:rt,scopeKey:nt,...ot}=tt[1];if(!rt)throw new Error("address is required");return await getBalance(et,{...ot,address:rt})??null},queryKey:getBalanceQueryKey(o)}}function getBalanceQueryKey(et={}){return["balance",filterQueryOptions(et)]}function getBlockNumberQueryOptions(et,o={}){return{gcTime:0,async queryFn({queryKey:tt}){const{scopeKey:rt,...nt}=tt[1];return await getBlockNumber(et,nt)??null},queryKey:getBlockNumberQueryKey(o)}}function getBlockNumberQueryKey(et={}){return["blockNumber",filterQueryOptions(et)]}function getEnsAddressQueryOptions(et,o={}){return{async queryFn({queryKey:tt}){const{name:rt,scopeKey:nt,...ot}=tt[1];if(!rt)throw new Error("name is required");return getEnsAddress(et,{...ot,name:rt})},queryKey:getEnsAddressQueryKey(o)}}function getEnsAddressQueryKey(et={}){return["ensAddress",filterQueryOptions(et)]}function getEnsAvatarQueryOptions(et,o={}){return{async queryFn({queryKey:tt}){const{name:rt,scopeKey:nt,...ot}=tt[1];if(!rt)throw new Error("name is required");return getEnsAvatar(et,{...ot,name:rt})},queryKey:getEnsAvatarQueryKey(o)}}function getEnsAvatarQueryKey(et={}){return["ensAvatar",filterQueryOptions(et)]}function getEnsNameQueryOptions(et,o={}){return{async queryFn({queryKey:tt}){const{address:rt,scopeKey:nt,...ot}=tt[1];if(!rt)throw new Error("address is required");return getEnsName(et,{...ot,address:rt})},queryKey:getEnsNameQueryKey(o)}}function getEnsNameQueryKey(et={}){return["ensName",filterQueryOptions(et)]}function signMessageMutationOptions(et){return{mutationFn(o){return signMessage(et,o)},mutationKey:["signMessage"]}}function switchChainMutationOptions(et){return{mutationFn(o){return switchChain(et,o)},mutationKey:["switchChain"]}}var QueryClientContext=reactExports.createContext(void 0),useQueryClient=et=>{const o=reactExports.useContext(QueryClientContext);if(!o)throw new Error("No QueryClient set, use QueryClientProvider to set one");return o},QueryClientProvider=({client:et,children:o})=>(reactExports.useEffect(()=>(et.mount(),()=>{et.unmount()}),[et]),jsxRuntimeExports.jsx(QueryClientContext.Provider,{value:et,children:o})),IsRestoringContext=reactExports.createContext(!1),useIsRestoring=()=>reactExports.useContext(IsRestoringContext);IsRestoringContext.Provider;function createValue(){let et=!1;return{clearReset:()=>{et=!1},reset:()=>{et=!0},isReset:()=>et}}var QueryErrorResetBoundaryContext=reactExports.createContext(createValue()),useQueryErrorResetBoundary=()=>reactExports.useContext(QueryErrorResetBoundaryContext);function shouldThrowError(et,o){return typeof et=="function"?et(...o):!!et}function noop$3(){}var ensurePreventErrorBoundaryRetry=(et,o)=>{(et.suspense||et.throwOnError)&&(o.isReset()||(et.retryOnMount=!1))},useClearResetErrorBoundary=et=>{reactExports.useEffect(()=>{et.clearReset()},[et])},getHasError=({result:et,errorResetBoundary:o,throwOnError:tt,query:rt})=>et.isError&&!o.isReset()&&!et.isFetching&&rt&&shouldThrowError(tt,[et.error,rt]),ensureSuspenseTimers=et=>{et.suspense&&(et.staleTime===void 0&&(et.staleTime=1e3),typeof et.gcTime=="number"&&(et.gcTime=Math.max(et.gcTime,1e3)))},willFetch=(et,o)=>et.isLoading&&et.isFetching&&!o,shouldSuspend=(et,o)=>(et==null?void 0:et.suspense)&&o.isPending,fetchOptimistic=(et,o,tt)=>o.fetchOptimistic(et).catch(()=>{tt.clearReset()});function useBaseQuery(et,o,tt){var lt,dt,ht,mt,ft;const rt=useQueryClient(),nt=useIsRestoring(),ot=useQueryErrorResetBoundary(),it=rt.defaultQueryOptions(et);(dt=(lt=rt.getDefaultOptions().queries)==null?void 0:lt._experimental_beforeQuery)==null||dt.call(lt,it),it._optimisticResults=nt?"isRestoring":"optimistic",ensureSuspenseTimers(it),ensurePreventErrorBoundaryRetry(it,ot),useClearResetErrorBoundary(ot);const st=!rt.getQueryCache().get(it.queryHash),[at]=reactExports.useState(()=>new o(rt,it)),ct=at.getOptimisticResult(it);if(reactExports.useSyncExternalStore(reactExports.useCallback(pt=>{const yt=nt?()=>{}:at.subscribe(notifyManager.batchCalls(pt));return at.updateResult(),yt},[at,nt]),()=>at.getCurrentResult(),()=>at.getCurrentResult()),reactExports.useEffect(()=>{at.setOptions(it,{listeners:!1})},[it,at]),shouldSuspend(it,ct))throw fetchOptimistic(it,at,ot);if(getHasError({result:ct,errorResetBoundary:ot,throwOnError:it.throwOnError,query:rt.getQueryCache().get(it.queryHash)}))throw ct.error;if((mt=(ht=rt.getDefaultOptions().queries)==null?void 0:ht._experimental_afterQuery)==null||mt.call(ht,it,ct),it.experimental_prefetchInRender&&!isServer&&willFetch(ct,nt)){const pt=st?fetchOptimistic(it,at,ot):(ft=rt.getQueryCache().get(it.queryHash))==null?void 0:ft.promise;pt==null||pt.catch(noop$3).finally(()=>{at.hasListeners()||at.updateResult()})}return it.notifyOnChangeProps?ct:at.trackResult(ct)}function useQuery$1(et,o){return useBaseQuery(et,QueryObserver)}function useMutation(et,o){const tt=useQueryClient(),[rt]=reactExports.useState(()=>new MutationObserver$1(tt,et));reactExports.useEffect(()=>{rt.setOptions(et)},[rt,et]);const nt=reactExports.useSyncExternalStore(reactExports.useCallback(it=>rt.subscribe(notifyManager.batchCalls(it)),[rt]),()=>rt.getCurrentResult(),()=>rt.getCurrentResult()),ot=reactExports.useCallback((it,st)=>{rt.mutate(it,st).catch(noop$3)},[rt]);if(nt.error&&shouldThrowError(rt.options.throwOnError,[nt.error]))throw nt.error;return{...nt,mutate:ot,mutateAsync:nt.mutate}}function useQuery(et){const o=useQuery$1({...et,queryKeyHashFn:hashFn});return o.queryKey=et.queryKey,o}function useChainId(et={}){const o=useConfig(et);return reactExports.useSyncExternalStore(tt=>watchChainId(o,{onChange:tt}),()=>getChainId(o),()=>getChainId(o))}function useBalance(et={}){const{address:o,query:tt={}}=et,rt=useConfig(et),nt=useChainId({config:rt}),ot=getBalanceQueryOptions(rt,{...et,chainId:et.chainId??nt}),it=!!(o&&(tt.enabled??!0));return useQuery({...tt,...ot,enabled:it})}function useWatchBlockNumber(et={}){const{enabled:o=!0,onBlockNumber:tt,config:rt,...nt}=et,ot=useConfig(et),it=useChainId({config:ot}),st=et.chainId??it;reactExports.useEffect(()=>{if(o&&tt)return watchBlockNumber(ot,{...nt,chainId:st,onBlockNumber:tt})},[st,ot,o,tt,nt.onError,nt.emitMissed,nt.emitOnBegin,nt.poll,nt.pollingInterval,nt.syncConnectedChain])}function useBlockNumber(et={}){const{query:o={},watch:tt}=et,rt=useConfig(et),nt=useQueryClient(),ot=useChainId({config:rt}),it=et.chainId??ot,st=getBlockNumberQueryOptions(rt,{...et,chainId:it});return useWatchBlockNumber({config:et.config,chainId:et.chainId,...typeof tt=="object"?tt:{},enabled:!!((o.enabled??!0)&&(typeof tt=="object"?tt.enabled:tt)),onBlockNumber(at){nt.setQueryData(st.queryKey,at)}}),useQuery({...o,...st})}function useChains$1(et={}){const o=useConfig(et);return reactExports.useSyncExternalStore(tt=>watchChains(o,{onChange:tt}),()=>getChains(o),()=>getChains(o))}function useConnectors$1(et={}){const o=useConfig(et);return reactExports.useSyncExternalStore(tt=>watchConnectors(o,{onChange:tt}),()=>getConnectors(o),()=>getConnectors(o))}function useConnect$1(et={}){const{mutation:o}=et,tt=useConfig(et),rt=connectMutationOptions(tt),{mutate:nt,mutateAsync:ot,...it}=useMutation({...o,...rt});return reactExports.useEffect(()=>tt.subscribe(({status:st})=>st,(st,at)=>{at==="connected"&&st==="disconnected"&&it.reset()}),[tt,it.reset]),{...it,connect:nt,connectAsync:ot,connectors:useConnectors$1({config:tt})}}function useConnections(et={}){const o=useConfig(et);return reactExports.useSyncExternalStore(tt=>watchConnections(o,{onChange:tt}),()=>getConnections(o),()=>getConnections(o))}function useDisconnect(et={}){const{mutation:o}=et,tt=useConfig(et),rt=disconnectMutationOptions(tt),{mutate:nt,mutateAsync:ot,...it}=useMutation({...o,...rt});return{...it,connectors:useConnections({config:tt}).map(st=>st.connector),disconnect:nt,disconnectAsync:ot}}function useEnsAddress(et={}){const{name:o,query:tt={}}=et,rt=useConfig(et),nt=useChainId({config:rt}),ot=getEnsAddressQueryOptions(rt,{...et,chainId:et.chainId??nt}),it=!!(o&&(tt.enabled??!0));return useQuery({...tt,...ot,enabled:it})}function useEnsAvatar(et={}){const{name:o,query:tt={}}=et,rt=useConfig(et),nt=useChainId({config:rt}),ot=getEnsAvatarQueryOptions(rt,{...et,chainId:et.chainId??nt}),it=!!(o&&(tt.enabled??!0));return useQuery({...tt,...ot,enabled:it})}function useEnsName(et={}){const{address:o,query:tt={}}=et,rt=useConfig(et),nt=useChainId({config:rt}),ot=getEnsNameQueryOptions(rt,{...et,chainId:et.chainId??nt}),it=!!(o&&(tt.enabled??!0));return useQuery({...tt,...ot,enabled:it})}function useSignMessage(et={}){const{mutation:o}=et,tt=useConfig(et),rt=signMessageMutationOptions(tt),{mutate:nt,mutateAsync:ot,...it}=useMutation({...o,...rt});return{...it,signMessage:nt,signMessageAsync:ot}}function useSwitchChain(et={}){const{mutation:o}=et,tt=useConfig(et),rt=switchChainMutationOptions(tt),{mutate:nt,mutateAsync:ot,...it}=useMutation({...o,...rt});return{...it,chains:useChains$1({config:tt}),switchChain:nt,switchChainAsync:ot}}const contracts={gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},formatters={block:defineBlock({format(et){var tt;return{transactions:(tt=et.transactions)==null?void 0:tt.map(rt=>{if(typeof rt=="string")return rt;const nt=formatTransaction(rt);return nt.typeHex==="0x7e"&&(nt.isSystemTx=rt.isSystemTx,nt.mint=rt.mint?hexToBigInt(rt.mint):void 0,nt.sourceHash=rt.sourceHash,nt.type="deposit"),nt}),stateRoot:et.stateRoot}}}),transaction:defineTransaction({format(et){const o={};return et.type==="0x7e"&&(o.isSystemTx=et.isSystemTx,o.mint=et.mint?hexToBigInt(et.mint):void 0,o.sourceHash=et.sourceHash,o.type="deposit"),o}}),transactionReceipt:defineTransactionReceipt({format(et){return{l1GasPrice:et.l1GasPrice?hexToBigInt(et.l1GasPrice):null,l1GasUsed:et.l1GasUsed?hexToBigInt(et.l1GasUsed):null,l1Fee:et.l1Fee?hexToBigInt(et.l1Fee):null,l1FeeScalar:et.l1FeeScalar?Number(et.l1FeeScalar):null}}})};function serializeTransaction(et,o){return isDeposit(et)?serializeTransactionDeposit(et):serializeTransaction$1(et,o)}const serializers={transaction:serializeTransaction};function serializeTransactionDeposit(et){assertTransactionDeposit(et);const{sourceHash:o,data:tt,from:rt,gas:nt,isSystemTx:ot,mint:it,to:st,value:at}=et,ct=[o,rt,st??"0x",it?toHex(it):"0x",at?toHex(at):"0x",nt?toHex(nt):"0x",ot?"0x1":"0x",tt??"0x"];return concatHex(["0x7e",toRlp(ct)])}function isDeposit(et){return et.type==="deposit"||typeof et.sourceHash<"u"}function assertTransactionDeposit(et){const{from:o,to:tt}=et;if(o&&!isAddress(o))throw new InvalidAddressError({address:o});if(tt&&!isAddress(tt))throw new InvalidAddressError({address:tt})}const chainConfig={contracts,formatters,serializers},arbitrum=defineChain({id:42161,name:"Arbitrum One",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://arbiscan.io",apiUrl:"https://api.arbiscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}}}),mainnet=defineChain({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://cloudflare-eth.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),sourceId=1,optimism=defineChain({...chainConfig,id:10,name:"OP Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.optimism.io"]}},blockExplorers:{default:{name:"Optimism Explorer",url:"https://optimistic.etherscan.io",apiUrl:"https://api-optimistic.etherscan.io/api"}},contracts:{...chainConfig.contracts,disputeGameFactory:{[sourceId]:{address:"0xe5965Ab5962eDc7477C8520243A95517CD252fA9"}},l2OutputOracle:{[sourceId]:{address:"0xdfe97868233d1aa22e815a266982f2cf17685a27"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263},portal:{[sourceId]:{address:"0xbEb5Fc579115071764c7423A4f12eDde41f106Ed"}},l1StandardBridge:{[sourceId]:{address:"0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1"}}},sourceId}),polygon=defineChain({id:137,name:"Polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://polygon-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com",apiUrl:"https://api.polygonscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}});coinbaseWallet.type="coinbaseWallet";function coinbaseWallet(et={}){return et.version==="3"||et.headlessMode?version3(et):version4(et)}function version4(et){let o,tt,rt,nt,ot;return it=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",supportsSimulation:!0,type:coinbaseWallet.type,async connect({chainId:st}={}){try{const at=await this.getProvider(),ct=(await at.request({method:"eth_requestAccounts"})).map(dt=>getAddress(dt));rt||(rt=this.onAccountsChanged.bind(this),at.on("accountsChanged",rt)),nt||(nt=this.onChainChanged.bind(this),at.on("chainChanged",nt)),ot||(ot=this.onDisconnect.bind(this),at.on("disconnect",ot));let lt=await this.getChainId();if(st&&lt!==st){const dt=await this.switchChain({chainId:st}).catch(ht=>{if(ht.code===UserRejectedRequestError.code)throw ht;return{id:lt}});lt=(dt==null?void 0:dt.id)??lt}return{accounts:ct,chainId:lt}}catch(at){throw/(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(at.message)?new UserRejectedRequestError(at):at}},async disconnect(){var at;const st=await this.getProvider();rt&&(st.removeListener("accountsChanged",rt),rt=void 0),nt&&(st.removeListener("chainChanged",nt),nt=void 0),ot&&(st.removeListener("disconnect",ot),ot=void 0),st.disconnect(),(at=st.close)==null||at.call(st)},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(at=>getAddress(at))},async getChainId(){const at=await(await this.getProvider()).request({method:"eth_chainId"});return Number(at)},async getProvider(){if(!tt){const st=await(async()=>{const{default:at}=await __vitePreload(async()=>{const{default:ct}=await import("./index-DrKwSPd8.js").then(lt=>lt.i);return{default:ct}},__vite__mapDeps([0,1,2,3]));return typeof at!="function"&&typeof at.default=="function"?at.default:at})();o=new st({...et,appChainIds:it.chains.map(at=>at.id)}),tt=o.makeWeb3Provider({...et,options:et.preference??"all"})}return tt},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:st,chainId:at}){var dt,ht,mt,ft;const ct=it.chains.find(pt=>pt.id===at);if(!ct)throw new SwitchChainError(new ChainNotConfiguredError);const lt=await this.getProvider();try{return await lt.request({method:"wallet_switchEthereumChain",params:[{chainId:numberToHex(ct.id)}]}),ct}catch(pt){if(pt.code===4902)try{let yt;st!=null&&st.blockExplorerUrls?yt=st.blockExplorerUrls:yt=(dt=ct.blockExplorers)!=null&&dt.default.url?[(ht=ct.blockExplorers)==null?void 0:ht.default.url]:[];let gt;(mt=st==null?void 0:st.rpcUrls)!=null&&mt.length?gt=st.rpcUrls:gt=[((ft=ct.rpcUrls.default)==null?void 0:ft.http[0])??""];const bt={blockExplorerUrls:yt,chainId:numberToHex(at),chainName:(st==null?void 0:st.chainName)??ct.name,iconUrls:st==null?void 0:st.iconUrls,nativeCurrency:(st==null?void 0:st.nativeCurrency)??ct.nativeCurrency,rpcUrls:gt};return await lt.request({method:"wallet_addEthereumChain",params:[bt]}),ct}catch(yt){throw new UserRejectedRequestError(yt)}throw new SwitchChainError(pt)}},onAccountsChanged(st){st.length===0?this.onDisconnect():it.emitter.emit("change",{accounts:st.map(at=>getAddress(at))})},onChainChanged(st){const at=Number(st);it.emitter.emit("change",{chainId:at})},async onDisconnect(st){it.emitter.emit("disconnect");const at=await this.getProvider();rt&&(at.removeListener("accountsChanged",rt),rt=void 0),nt&&(at.removeListener("chainChanged",nt),nt=void 0),ot&&(at.removeListener("disconnect",ot),ot=void 0)}})}function version3(et){let tt,rt,nt,ot,it;return st=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",supportsSimulation:!0,type:coinbaseWallet.type,async connect({chainId:at}={}){try{const ct=await this.getProvider(),lt=(await ct.request({method:"eth_requestAccounts"})).map(ht=>getAddress(ht));nt||(nt=this.onAccountsChanged.bind(this),ct.on("accountsChanged",nt)),ot||(ot=this.onChainChanged.bind(this),ct.on("chainChanged",ot)),it||(it=this.onDisconnect.bind(this),ct.on("disconnect",it));let dt=await this.getChainId();if(at&&dt!==at){const ht=await this.switchChain({chainId:at}).catch(mt=>{if(mt.code===UserRejectedRequestError.code)throw mt;return{id:dt}});dt=(ht==null?void 0:ht.id)??dt}return{accounts:lt,chainId:dt}}catch(ct){throw/(user closed modal|accounts received is empty|user denied account)/i.test(ct.message)?new UserRejectedRequestError(ct):ct}},async disconnect(){const at=await this.getProvider();nt&&(at.removeListener("accountsChanged",nt),nt=void 0),ot&&(at.removeListener("chainChanged",ot),ot=void 0),it&&(at.removeListener("disconnect",it),it=void 0),at.disconnect(),at.close()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(ct=>getAddress(ct))},async getChainId(){const ct=await(await this.getProvider()).request({method:"eth_chainId"});return Number(ct)},async getProvider(){var at;if(!rt){const ct=await(async()=>{const{default:ft}=await __vitePreload(async()=>{const{default:pt}=await import("./index-CT_b5y6n.js").then(yt=>yt.i);return{default:pt}},__vite__mapDeps([4,3,1,2]));return typeof ft!="function"&&typeof ft.default=="function"?ft.default:ft})();tt=new ct({...et,reloadOnDisconnect:!1});const lt=(at=tt.walletExtension)==null?void 0:at.getChainId(),dt=st.chains.find(ft=>et.chainId?ft.id===et.chainId:ft.id===lt)||st.chains[0],ht=et.chainId||(dt==null?void 0:dt.id),mt=et.jsonRpcUrl||(dt==null?void 0:dt.rpcUrls.default.http[0]);rt=tt.makeWeb3Provider(mt,ht)}return rt},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:at,chainId:ct}){var ht,mt,ft,pt;const lt=st.chains.find(yt=>yt.id===ct);if(!lt)throw new SwitchChainError(new ChainNotConfiguredError);const dt=await this.getProvider();try{return await dt.request({method:"wallet_switchEthereumChain",params:[{chainId:numberToHex(lt.id)}]}),lt}catch(yt){if(yt.code===4902)try{let gt;at!=null&&at.blockExplorerUrls?gt=at.blockExplorerUrls:gt=(ht=lt.blockExplorers)!=null&&ht.default.url?[(mt=lt.blockExplorers)==null?void 0:mt.default.url]:[];let bt;(ft=at==null?void 0:at.rpcUrls)!=null&&ft.length?bt=at.rpcUrls:bt=[((pt=lt.rpcUrls.default)==null?void 0:pt.http[0])??""];const xt={blockExplorerUrls:gt,chainId:numberToHex(ct),chainName:(at==null?void 0:at.chainName)??lt.name,iconUrls:at==null?void 0:at.iconUrls,nativeCurrency:(at==null?void 0:at.nativeCurrency)??lt.nativeCurrency,rpcUrls:bt};return await dt.request({method:"wallet_addEthereumChain",params:[xt]}),lt}catch(gt){throw new UserRejectedRequestError(gt)}throw new SwitchChainError(yt)}},onAccountsChanged(at){at.length===0?this.onDisconnect():st.emitter.emit("change",{accounts:at.map(ct=>getAddress(ct))})},onChainChanged(at){const ct=Number(at);st.emitter.emit("change",{chainId:ct})},async onDisconnect(at){st.emitter.emit("disconnect");const ct=await this.getProvider();nt&&(ct.removeListener("accountsChanged",nt),nt=void 0),ot&&(ct.removeListener("chainChanged",ot),ot=void 0),it&&(ct.removeListener("disconnect",it),it=void 0)}})}safe.type="safe";function safe(et={}){const{shimDisconnect:o=!1}=et;let tt,rt;return nt=>({id:"safe",name:"Safe",type:safe.type,async connect(){var at;const ot=await this.getProvider();if(!ot)throw new ProviderNotFoundError;const it=await this.getAccounts(),st=await this.getChainId();return rt||(rt=this.onDisconnect.bind(this),ot.on("disconnect",rt)),o&&await((at=nt.storage)==null?void 0:at.removeItem("safe.disconnected")),{accounts:it,chainId:st}},async disconnect(){var it;const ot=await this.getProvider();if(!ot)throw new ProviderNotFoundError;rt&&(ot.removeListener("disconnect",rt),rt=void 0),o&&await((it=nt.storage)==null?void 0:it.setItem("safe.disconnected",!0))},async getAccounts(){const ot=await this.getProvider();if(!ot)throw new ProviderNotFoundError;return(await ot.request({method:"eth_accounts"})).map(getAddress)},async getProvider(){if(typeof window<"u"&&(window==null?void 0:window.parent)!==window){if(!tt){const{default:it}=await __vitePreload(async()=>{const{default:lt}=await import("./index-DbFRd9te.js");return{default:lt}},[]),st=new it(et),at=await withTimeout(()=>st.safe.getInfo(),{timeout:et.unstable_getInfoTimeout??10});if(!at)throw new Error("Could not load Safe information");const{SafeAppProvider:ct}=await __vitePreload(async()=>{const{SafeAppProvider:lt}=await import("./index-DY_rTz6S.js").then(dt=>dt.i);return{SafeAppProvider:lt}},__vite__mapDeps([5,2]));tt=new ct(at,st)}return tt}},async getChainId(){const ot=await this.getProvider();if(!ot)throw new ProviderNotFoundError;return Number(ot.chainId)},async isAuthorized(){var ot;try{return o&&await((ot=nt.storage)==null?void 0:ot.getItem("safe.disconnected"))?!1:!!(await this.getAccounts()).length}catch{return!1}},onAccountsChanged(){},onChainChanged(){},onDisconnect(){nt.emitter.emit("disconnect")}})}walletConnect.type="walletConnect";function walletConnect(et){const o=et.isNewChainsStale??!0;let tt,rt;const nt="eip155";let ot,it,st,at,ct,lt;return dt=>({id:"walletConnect",name:"WalletConnect",type:walletConnect.type,async setup(){const ht=await this.getProvider().catch(()=>null);ht&&(st||(st=this.onConnect.bind(this),ht.on("connect",st)),ct||(ct=this.onSessionDelete.bind(this),ht.on("session_delete",ct)))},async connect({chainId:ht,...mt}={}){var ft,pt;try{const yt=await this.getProvider();if(!yt)throw new ProviderNotFoundError;at||(at=this.onDisplayUri,yt.on("display_uri",at));let gt=ht;if(!gt){const Et=await((ft=dt.storage)==null?void 0:ft.getItem("state"))??{};dt.chains.some(St=>St.id===Et.chainId)?gt=Et.chainId:gt=(pt=dt.chains[0])==null?void 0:pt.id}if(!gt)throw new Error("No chains found on connector.");const bt=await this.isChainsStale();if(yt.session&&bt&&await yt.disconnect(),!yt.session||bt){const Et=dt.chains.filter(Ct=>Ct.id!==gt).map(Ct=>Ct.id);await yt.connect({optionalChains:[gt,...Et],..."pairingTopic"in mt?{pairingTopic:mt.pairingTopic}:{}}),this.setRequestedChainsIds(dt.chains.map(Ct=>Ct.id))}const xt=(await yt.enable()).map(Et=>getAddress(Et)),vt=await this.getChainId();return at&&(yt.removeListener("display_uri",at),at=void 0),st&&(yt.removeListener("connect",st),st=void 0),ot||(ot=this.onAccountsChanged.bind(this),yt.on("accountsChanged",ot)),it||(it=this.onChainChanged.bind(this),yt.on("chainChanged",it)),lt||(lt=this.onDisconnect.bind(this),yt.on("disconnect",lt)),ct||(ct=this.onSessionDelete.bind(this),yt.on("session_delete",ct)),{accounts:xt,chainId:vt}}catch(yt){throw/(user rejected|connection request reset)/i.test(yt==null?void 0:yt.message)?new UserRejectedRequestError(yt):yt}},async disconnect(){const ht=await this.getProvider();try{await(ht==null?void 0:ht.disconnect())}catch(mt){if(!/No matching key/i.test(mt.message))throw mt}finally{it&&(ht==null||ht.removeListener("chainChanged",it),it=void 0),lt&&(ht==null||ht.removeListener("disconnect",lt),lt=void 0),st||(st=this.onConnect.bind(this),ht==null||ht.on("connect",st)),ot&&(ht==null||ht.removeListener("accountsChanged",ot),ot=void 0),ct&&(ht==null||ht.removeListener("session_delete",ct),ct=void 0),this.setRequestedChainsIds([])}},async getAccounts(){return(await this.getProvider()).accounts.map(mt=>getAddress(mt))},async getProvider({chainId:ht}={}){var ft;async function mt(){const pt=dt.chains.map(gt=>gt.id);if(!pt.length)return;const{EthereumProvider:yt}=await __vitePreload(async()=>{const{EthereumProvider:gt}=await import("./index.es-Bushv2uZ.js");return{EthereumProvider:gt}},__vite__mapDeps([6,2,3]));return await yt.init({...et,disableProviderPing:!0,optionalChains:pt,projectId:et.projectId,rpcMap:Object.fromEntries(dt.chains.map(gt=>{const[bt]=extractRpcUrls({chain:gt,transports:dt.transports});return[gt.id,bt]})),showQrModal:et.showQrModal??!0})}return tt||(rt||(rt=mt()),tt=await rt,tt==null||tt.events.setMaxListeners(Number.POSITIVE_INFINITY)),ht&&await((ft=this.switchChain)==null?void 0:ft.call(this,{chainId:ht})),tt},async getChainId(){return(await this.getProvider()).chainId},async isAuthorized(){try{const[ht,mt]=await Promise.all([this.getAccounts(),this.getProvider()]);return ht.length?await this.isChainsStale()&&mt.session?(await mt.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({addEthereumChainParameter:ht,chainId:mt}){var yt,gt,bt;const ft=await this.getProvider();if(!ft)throw new ProviderNotFoundError;const pt=dt.chains.find(xt=>xt.id===mt);if(!pt)throw new SwitchChainError(new ChainNotConfiguredError);try{await Promise.all([new Promise(vt=>{const Et=({chainId:Ct})=>{Ct===mt&&(dt.emitter.off("change",Et),vt())};dt.emitter.on("change",Et)}),ft.request({method:"wallet_switchEthereumChain",params:[{chainId:numberToHex(mt)}]})]);const xt=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...xt,mt]),pt}catch(xt){const vt=xt;if(/(user rejected)/i.test(vt.message))throw new UserRejectedRequestError(vt);try{let Et;ht!=null&&ht.blockExplorerUrls?Et=ht.blockExplorerUrls:Et=(yt=pt.blockExplorers)!=null&&yt.default.url?[(gt=pt.blockExplorers)==null?void 0:gt.default.url]:[];let Ct;(bt=ht==null?void 0:ht.rpcUrls)!=null&&bt.length?Ct=ht.rpcUrls:Ct=[...pt.rpcUrls.default.http];const St={blockExplorerUrls:Et,chainId:numberToHex(mt),chainName:(ht==null?void 0:ht.chainName)??pt.name,iconUrls:ht==null?void 0:ht.iconUrls,nativeCurrency:(ht==null?void 0:ht.nativeCurrency)??pt.nativeCurrency,rpcUrls:Ct};await ft.request({method:"wallet_addEthereumChain",params:[St]});const At=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...At,mt]),pt}catch(Et){throw new UserRejectedRequestError(Et)}}},onAccountsChanged(ht){ht.length===0?this.onDisconnect():dt.emitter.emit("change",{accounts:ht.map(mt=>getAddress(mt))})},onChainChanged(ht){const mt=Number(ht);dt.emitter.emit("change",{chainId:mt})},async onConnect(ht){const mt=Number(ht.chainId),ft=await this.getAccounts();dt.emitter.emit("connect",{accounts:ft,chainId:mt})},async onDisconnect(ht){this.setRequestedChainsIds([]),dt.emitter.emit("disconnect");const mt=await this.getProvider();ot&&(mt.removeListener("accountsChanged",ot),ot=void 0),it&&(mt.removeListener("chainChanged",it),it=void 0),lt&&(mt.removeListener("disconnect",lt),lt=void 0),ct&&(mt.removeListener("session_delete",ct),ct=void 0),st||(st=this.onConnect.bind(this),mt.on("connect",st))},onDisplayUri(ht){dt.emitter.emit("message",{type:"display_uri",data:ht})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var mt,ft,pt;return tt?((pt=(ft=(mt=tt.session)==null?void 0:mt.namespaces[nt])==null?void 0:ft.accounts)==null?void 0:pt.map(yt=>Number.parseInt(yt.split(":")[1]||"")))??[]:[]},async getRequestedChainsIds(){var ht;return await((ht=dt.storage)==null?void 0:ht.getItem(this.requestedChainsStorageKey))??[]},async isChainsStale(){if(!o)return!1;const ht=dt.chains.map(pt=>pt.id),mt=this.getNamespaceChainsIds();if(mt.length&&!mt.some(pt=>ht.includes(pt)))return!1;const ft=await this.getRequestedChainsIds();return!ht.every(pt=>ft.includes(pt))},async setRequestedChainsIds(ht){var mt;await((mt=dt.storage)==null?void 0:mt.setItem(this.requestedChainsStorageKey,ht))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}var define_process_default$3={env:{NODE_ENV:'"production"',VITE_WALLETCONNECT_PROJECT_ID:'"1d93edc21291f98e3bed6ff7617ff539"'},nextTick:"setImmediate",platform:'"browser"',version:'"v16.0.0"',browser:!0},__spreadArray$1=function(et,o,tt){for(var rt=0,nt=o.length,ot;rt<nt;rt++)(ot||!(rt in o))&&(ot||(ot=Array.prototype.slice.call(o,0,rt)),ot[rt]=o[rt]);return et.concat(ot||Array.prototype.slice.call(o))},BrowserInfo=function(){function et(o,tt,rt){this.name=o,this.version=tt,this.os=rt,this.type="browser"}return et}(),NodeInfo=function(){function et(o){this.version=o,this.type="node",this.name="node",this.os=define_process_default$3.platform}return et}(),SearchBotDeviceInfo=function(){function et(o,tt,rt,nt){this.name=o,this.version=tt,this.os=rt,this.bot=nt,this.type="bot-device"}return et}(),BotInfo=function(){function et(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return et}(),ReactNativeInfo=function(){function et(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return et}(),SEARCHBOX_UA_REGEX=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,SEARCHBOT_OS_REGEX=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,REQUIRED_VERSION_PARTS=3,userAgentRules=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",SEARCHBOX_UA_REGEX]],operatingSystemRules=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function detect(et){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new ReactNativeInfo:typeof navigator<"u"?parseUserAgent(navigator.userAgent):getNodeVersion()}function matchUserAgent(et){return et!==""&&userAgentRules.reduce(function(o,tt){var rt=tt[0],nt=tt[1];if(o)return o;var ot=nt.exec(et);return!!ot&&[rt,ot]},!1)}function parseUserAgent(et){var o=matchUserAgent(et);if(!o)return null;var tt=o[0],rt=o[1];if(tt==="searchbot")return new BotInfo;var nt=rt[1]&&rt[1].split(".").join("_").split("_").slice(0,3);nt?nt.length<REQUIRED_VERSION_PARTS&&(nt=__spreadArray$1(__spreadArray$1([],nt,!0),createVersionParts(REQUIRED_VERSION_PARTS-nt.length))):nt=[];var ot=nt.join("."),it=detectOS$1(et),st=SEARCHBOT_OS_REGEX.exec(et);return st&&st[1]?new SearchBotDeviceInfo(tt,ot,it,st[1]):new BrowserInfo(tt,ot,it)}function detectOS$1(et){for(var o=0,tt=operatingSystemRules.length;o<tt;o++){var rt=operatingSystemRules[o],nt=rt[0],ot=rt[1],it=ot.exec(et);if(it)return nt}return null}function getNodeVersion(){var et=typeof define_process_default$3<"u"&&define_process_default$3.version;return et?new NodeInfo(define_process_default$3.version.slice(1)):null}function createVersionParts(et){for(var o=[],tt=0;tt<et;tt++)o.push("0");return o}var extendStatics=function(et,o){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(tt,rt){tt.__proto__=rt}||function(tt,rt){for(var nt in rt)Object.prototype.hasOwnProperty.call(rt,nt)&&(tt[nt]=rt[nt])},extendStatics(et,o)};function __extends(et,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");extendStatics(et,o);function tt(){this.constructor=et}et.prototype=o===null?Object.create(o):(tt.prototype=o.prototype,new tt)}var __assign=function(){return __assign=Object.assign||function(o){for(var tt,rt=1,nt=arguments.length;rt<nt;rt++){tt=arguments[rt];for(var ot in tt)Object.prototype.hasOwnProperty.call(tt,ot)&&(o[ot]=tt[ot])}return o},__assign.apply(this,arguments)};function __rest(et,o){var tt={};for(var rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&o.indexOf(rt)<0&&(tt[rt]=et[rt]);if(et!=null&&typeof Object.getOwnPropertySymbols=="function")for(var nt=0,rt=Object.getOwnPropertySymbols(et);nt<rt.length;nt++)o.indexOf(rt[nt])<0&&Object.prototype.propertyIsEnumerable.call(et,rt[nt])&&(tt[rt[nt]]=et[rt[nt]]);return tt}function __decorate(et,o,tt,rt){var nt=arguments.length,ot=nt<3?o:rt===null?rt=Object.getOwnPropertyDescriptor(o,tt):rt,it;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ot=Reflect.decorate(et,o,tt,rt);else for(var st=et.length-1;st>=0;st--)(it=et[st])&&(ot=(nt<3?it(ot):nt>3?it(o,tt,ot):it(o,tt))||ot);return nt>3&&ot&&Object.defineProperty(o,tt,ot),ot}function __param(et,o){return function(tt,rt){o(tt,rt,et)}}function __esDecorate(et,o,tt,rt,nt,ot){function it(gt){if(gt!==void 0&&typeof gt!="function")throw new TypeError("Function expected");return gt}for(var st=rt.kind,at=st==="getter"?"get":st==="setter"?"set":"value",ct=!o&&et?rt.static?et:et.prototype:null,lt=o||(ct?Object.getOwnPropertyDescriptor(ct,rt.name):{}),dt,ht=!1,mt=tt.length-1;mt>=0;mt--){var ft={};for(var pt in rt)ft[pt]=pt==="access"?{}:rt[pt];for(var pt in rt.access)ft.access[pt]=rt.access[pt];ft.addInitializer=function(gt){if(ht)throw new TypeError("Cannot add initializers after decoration has completed");ot.push(it(gt||null))};var yt=(0,tt[mt])(st==="accessor"?{get:lt.get,set:lt.set}:lt[at],ft);if(st==="accessor"){if(yt===void 0)continue;if(yt===null||typeof yt!="object")throw new TypeError("Object expected");(dt=it(yt.get))&&(lt.get=dt),(dt=it(yt.set))&&(lt.set=dt),(dt=it(yt.init))&&nt.unshift(dt)}else(dt=it(yt))&&(st==="field"?nt.unshift(dt):lt[at]=dt)}ct&&Object.defineProperty(ct,rt.name,lt),ht=!0}function __runInitializers(et,o,tt){for(var rt=arguments.length>2,nt=0;nt<o.length;nt++)tt=rt?o[nt].call(et,tt):o[nt].call(et);return rt?tt:void 0}function __propKey(et){return typeof et=="symbol"?et:"".concat(et)}function __setFunctionName(et,o,tt){return typeof o=="symbol"&&(o=o.description?"[".concat(o.description,"]"):""),Object.defineProperty(et,"name",{configurable:!0,value:tt?"".concat(tt," ",o):o})}function __metadata(et,o){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(et,o)}function __awaiter(et,o,tt,rt){function nt(ot){return ot instanceof tt?ot:new tt(function(it){it(ot)})}return new(tt||(tt=Promise))(function(ot,it){function st(lt){try{ct(rt.next(lt))}catch(dt){it(dt)}}function at(lt){try{ct(rt.throw(lt))}catch(dt){it(dt)}}function ct(lt){lt.done?ot(lt.value):nt(lt.value).then(st,at)}ct((rt=rt.apply(et,o||[])).next())})}function __generator(et,o){var tt={label:0,sent:function(){if(ot[0]&1)throw ot[1];return ot[1]},trys:[],ops:[]},rt,nt,ot,it=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return it.next=st(0),it.throw=st(1),it.return=st(2),typeof Symbol=="function"&&(it[Symbol.iterator]=function(){return this}),it;function st(ct){return function(lt){return at([ct,lt])}}function at(ct){if(rt)throw new TypeError("Generator is already executing.");for(;it&&(it=0,ct[0]&&(tt=0)),tt;)try{if(rt=1,nt&&(ot=ct[0]&2?nt.return:ct[0]?nt.throw||((ot=nt.return)&&ot.call(nt),0):nt.next)&&!(ot=ot.call(nt,ct[1])).done)return ot;switch(nt=0,ot&&(ct=[ct[0]&2,ot.value]),ct[0]){case 0:case 1:ot=ct;break;case 4:return tt.label++,{value:ct[1],done:!1};case 5:tt.label++,nt=ct[1],ct=[0];continue;case 7:ct=tt.ops.pop(),tt.trys.pop();continue;default:if(ot=tt.trys,!(ot=ot.length>0&&ot[ot.length-1])&&(ct[0]===6||ct[0]===2)){tt=0;continue}if(ct[0]===3&&(!ot||ct[1]>ot[0]&&ct[1]<ot[3])){tt.label=ct[1];break}if(ct[0]===6&&tt.label<ot[1]){tt.label=ot[1],ot=ct;break}if(ot&&tt.label<ot[2]){tt.label=ot[2],tt.ops.push(ct);break}ot[2]&&tt.ops.pop(),tt.trys.pop();continue}ct=o.call(et,tt)}catch(lt){ct=[6,lt],nt=0}finally{rt=ot=0}if(ct[0]&5)throw ct[1];return{value:ct[0]?ct[1]:void 0,done:!0}}}var __createBinding=Object.create?function(et,o,tt,rt){rt===void 0&&(rt=tt);var nt=Object.getOwnPropertyDescriptor(o,tt);(!nt||("get"in nt?!o.__esModule:nt.writable||nt.configurable))&&(nt={enumerable:!0,get:function(){return o[tt]}}),Object.defineProperty(et,rt,nt)}:function(et,o,tt,rt){rt===void 0&&(rt=tt),et[rt]=o[tt]};function __exportStar(et,o){for(var tt in et)tt!=="default"&&!Object.prototype.hasOwnProperty.call(o,tt)&&__createBinding(o,et,tt)}function __values(et){var o=typeof Symbol=="function"&&Symbol.iterator,tt=o&&et[o],rt=0;if(tt)return tt.call(et);if(et&&typeof et.length=="number")return{next:function(){return et&&rt>=et.length&&(et=void 0),{value:et&&et[rt++],done:!et}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(et,o){var tt=typeof Symbol=="function"&&et[Symbol.iterator];if(!tt)return et;var rt=tt.call(et),nt,ot=[],it;try{for(;(o===void 0||o-- >0)&&!(nt=rt.next()).done;)ot.push(nt.value)}catch(st){it={error:st}}finally{try{nt&&!nt.done&&(tt=rt.return)&&tt.call(rt)}finally{if(it)throw it.error}}return ot}function __spread(){for(var et=[],o=0;o<arguments.length;o++)et=et.concat(__read(arguments[o]));return et}function __spreadArrays(){for(var et=0,o=0,tt=arguments.length;o<tt;o++)et+=arguments[o].length;for(var rt=Array(et),nt=0,o=0;o<tt;o++)for(var ot=arguments[o],it=0,st=ot.length;it<st;it++,nt++)rt[nt]=ot[it];return rt}function __spreadArray(et,o,tt){if(tt||arguments.length===2)for(var rt=0,nt=o.length,ot;rt<nt;rt++)(ot||!(rt in o))&&(ot||(ot=Array.prototype.slice.call(o,0,rt)),ot[rt]=o[rt]);return et.concat(ot||Array.prototype.slice.call(o))}function __await(et){return this instanceof __await?(this.v=et,this):new __await(et)}function __asyncGenerator(et,o,tt){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var rt=tt.apply(et,o||[]),nt,ot=[];return nt=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),st("next"),st("throw"),st("return",it),nt[Symbol.asyncIterator]=function(){return this},nt;function it(mt){return function(ft){return Promise.resolve(ft).then(mt,dt)}}function st(mt,ft){rt[mt]&&(nt[mt]=function(pt){return new Promise(function(yt,gt){ot.push([mt,pt,yt,gt])>1||at(mt,pt)})},ft&&(nt[mt]=ft(nt[mt])))}function at(mt,ft){try{ct(rt[mt](ft))}catch(pt){ht(ot[0][3],pt)}}function ct(mt){mt.value instanceof __await?Promise.resolve(mt.value.v).then(lt,dt):ht(ot[0][2],mt)}function lt(mt){at("next",mt)}function dt(mt){at("throw",mt)}function ht(mt,ft){mt(ft),ot.shift(),ot.length&&at(ot[0][0],ot[0][1])}}function __asyncDelegator(et){var o,tt;return o={},rt("next"),rt("throw",function(nt){throw nt}),rt("return"),o[Symbol.iterator]=function(){return this},o;function rt(nt,ot){o[nt]=et[nt]?function(it){return(tt=!tt)?{value:__await(et[nt](it)),done:!1}:ot?ot(it):it}:ot}}function __asyncValues(et){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=et[Symbol.asyncIterator],tt;return o?o.call(et):(et=typeof __values=="function"?__values(et):et[Symbol.iterator](),tt={},rt("next"),rt("throw"),rt("return"),tt[Symbol.asyncIterator]=function(){return this},tt);function rt(ot){tt[ot]=et[ot]&&function(it){return new Promise(function(st,at){it=et[ot](it),nt(st,at,it.done,it.value)})}}function nt(ot,it,st,at){Promise.resolve(at).then(function(ct){ot({value:ct,done:st})},it)}}function __makeTemplateObject(et,o){return Object.defineProperty?Object.defineProperty(et,"raw",{value:o}):et.raw=o,et}var __setModuleDefault=Object.create?function(et,o){Object.defineProperty(et,"default",{enumerable:!0,value:o})}:function(et,o){et.default=o};function __importStar(et){if(et&&et.__esModule)return et;var o={};if(et!=null)for(var tt in et)tt!=="default"&&Object.prototype.hasOwnProperty.call(et,tt)&&__createBinding(o,et,tt);return __setModuleDefault(o,et),o}function __importDefault$1(et){return et&&et.__esModule?et:{default:et}}function __classPrivateFieldGet(et,o,tt,rt){if(tt==="a"&&!rt)throw new TypeError("Private accessor was defined without a getter");if(typeof o=="function"?et!==o||!rt:!o.has(et))throw new TypeError("Cannot read private member from an object whose class did not declare it");return tt==="m"?rt:tt==="a"?rt.call(et):rt?rt.value:o.get(et)}function __classPrivateFieldSet(et,o,tt,rt,nt){if(rt==="m")throw new TypeError("Private method is not writable");if(rt==="a"&&!nt)throw new TypeError("Private accessor was defined without a setter");if(typeof o=="function"?et!==o||!nt:!o.has(et))throw new TypeError("Cannot write private member to an object whose class did not declare it");return rt==="a"?nt.call(et,tt):nt?nt.value=tt:o.set(et,tt),tt}function __classPrivateFieldIn(et,o){if(o===null||typeof o!="object"&&typeof o!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof et=="function"?o===et:et.has(o)}function __addDisposableResource(et,o,tt){if(o!=null){if(typeof o!="object"&&typeof o!="function")throw new TypeError("Object expected.");var rt,nt;if(tt){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");rt=o[Symbol.asyncDispose]}if(rt===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");rt=o[Symbol.dispose],tt&&(nt=rt)}if(typeof rt!="function")throw new TypeError("Object not disposable.");nt&&(rt=function(){try{nt.call(this)}catch(ot){return Promise.reject(ot)}}),et.stack.push({value:o,dispose:rt,async:tt})}else tt&&et.stack.push({async:!0});return o}var _SuppressedError=typeof SuppressedError=="function"?SuppressedError:function(et,o,tt){var rt=new Error(tt);return rt.name="SuppressedError",rt.error=et,rt.suppressed=o,rt};function __disposeResources(et){function o(ot){et.error=et.hasError?new _SuppressedError(ot,et.error,"An error was suppressed during disposal."):ot,et.hasError=!0}var tt,rt=0;function nt(){for(;tt=et.stack.pop();)try{if(!tt.async&&rt===1)return rt=0,et.stack.push(tt),Promise.resolve().then(nt);if(tt.dispose){var ot=tt.dispose.call(tt.value);if(tt.async)return rt|=2,Promise.resolve(ot).then(nt,function(it){return o(it),nt()})}else rt|=1}catch(it){o(it)}if(rt===1)return et.hasError?Promise.reject(et.error):Promise.resolve();if(et.hasError)throw et.error}return nt()}function __rewriteRelativeImportExtension(et,o){return typeof et=="string"&&/^\.\.?\//.test(et)?et.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(tt,rt,nt,ot,it){return rt?o?".jsx":".js":nt&&(!ot||!it)?tt:nt+ot+"."+it.toLowerCase()+"js"}):et}const tslib_es6={__extends,__assign,__rest,__decorate,__param,__esDecorate,__runInitializers,__propKey,__setFunctionName,__metadata,__awaiter,__generator,__createBinding,__exportStar,__values,__read,__spread,__spreadArrays,__spreadArray,__await,__asyncGenerator,__asyncDelegator,__asyncValues,__makeTemplateObject,__importStar,__importDefault:__importDefault$1,__classPrivateFieldGet,__classPrivateFieldSet,__classPrivateFieldIn,__addDisposableResource,__disposeResources,__rewriteRelativeImportExtension},tslib_es6$1=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource,get __assign(){return __assign},__asyncDelegator,__asyncGenerator,__asyncValues,__await,__awaiter,__classPrivateFieldGet,__classPrivateFieldIn,__classPrivateFieldSet,__createBinding,__decorate,__disposeResources,__esDecorate,__exportStar,__extends,__generator,__importDefault:__importDefault$1,__importStar,__makeTemplateObject,__metadata,__param,__propKey,__read,__rest,__rewriteRelativeImportExtension,__runInitializers,__setFunctionName,__spread,__spreadArray,__spreadArrays,__values,default:tslib_es6},Symbol.toStringTag,{value:"Module"}));var define_process_default$2={env:{NODE_ENV:'"production"',VITE_WALLETCONNECT_PROJECT_ID:'"1d93edc21291f98e3bed6ff7617ff539"'},nextTick:"setImmediate",platform:'"browser"',version:'"v16.0.0"',browser:!0},define_process_env_default$1={},defaultEnvironment="production",env$1=typeof define_process_default$2>"u"||define_process_env_default$1===void 0?defaultEnvironment:"production",createDefinition=function(et){return{isEnabled:function(o){return et.some(function(tt){return!!o[tt]})}}},featureDefinitions={measureLayout:createDefinition(["layout","layoutId","drag"]),animation:createDefinition(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:createDefinition(["exit"]),drag:createDefinition(["drag","dragControls"]),focus:createDefinition(["whileFocus"]),hover:createDefinition(["whileHover","onHoverStart","onHoverEnd"]),tap:createDefinition(["whileTap","onTap","onTapStart","onTapCancel"]),pan:createDefinition(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:createDefinition(["whileInView","onViewportEnter","onViewportLeave"])};function loadFeatures(et){for(var o in et)et[o]!==null&&(o==="projectionNodeConstructor"?featureDefinitions.projectionNodeConstructor=et[o]:featureDefinitions[o].Component=et[o])}var invariant$1=function(){},LazyContext=reactExports.createContext({strict:!1}),featureNames=Object.keys(featureDefinitions),numFeatures=featureNames.length;function useFeatures(et,o,tt){var rt=[],nt=reactExports.useContext(LazyContext);if(!o)return null;env$1!=="production"&&tt&&nt.strict;for(var ot=0;ot<numFeatures;ot++){var it=featureNames[ot],st=featureDefinitions[it],at=st.isEnabled,ct=st.Component;at(et)&&ct&&rt.push(reactExports.createElement(ct,__assign({key:it},et,{visualElement:o})))}return rt}var MotionConfigContext=reactExports.createContext({transformPagePoint:function(et){return et},isStatic:!1,reducedMotion:"never"}),MotionContext=reactExports.createContext({});function useVisualElementContext(){return reactExports.useContext(MotionContext).visualElement}var PresenceContext=reactExports.createContext(null),isBrowser$3=typeof document<"u",useIsomorphicLayoutEffect$3=isBrowser$3?reactExports.useLayoutEffect:reactExports.useEffect,prefersReducedMotion={current:null},hasDetected=!1;function initPrefersReducedMotion(){if(hasDetected=!0,!!isBrowser$3)if(window.matchMedia){var et=window.matchMedia("(prefers-reduced-motion)"),o=function(){return prefersReducedMotion.current=et.matches};et.addListener(o),o()}else prefersReducedMotion.current=!1}function useReducedMotion(){!hasDetected&&initPrefersReducedMotion();var et=__read(reactExports.useState(prefersReducedMotion.current),1),o=et[0];return o}function useReducedMotionConfig(){var et=useReducedMotion(),o=reactExports.useContext(MotionConfigContext).reducedMotion;return o==="never"?!1:o==="always"?!0:et}function useVisualElement(et,o,tt,rt){var nt=reactExports.useContext(LazyContext),ot=useVisualElementContext(),it=reactExports.useContext(PresenceContext),st=useReducedMotionConfig(),at=reactExports.useRef(void 0);rt||(rt=nt.renderer),!at.current&&rt&&(at.current=rt(et,{visualState:o,parent:ot,props:tt,presenceId:it==null?void 0:it.id,blockInitialAnimation:(it==null?void 0:it.initial)===!1,shouldReduceMotion:st}));var ct=at.current;return useIsomorphicLayoutEffect$3(function(){ct==null||ct.syncRender()}),reactExports.useEffect(function(){var lt;(lt=ct==null?void 0:ct.animationState)===null||lt===void 0||lt.animateChanges()}),useIsomorphicLayoutEffect$3(function(){return function(){return ct==null?void 0:ct.notifyUnmount()}},[]),ct}function isRefObject(et){return typeof et=="object"&&Object.prototype.hasOwnProperty.call(et,"current")}function useMotionRef(et,o,tt){return reactExports.useCallback(function(rt){var nt;rt&&((nt=et.mount)===null||nt===void 0||nt.call(et,rt)),o&&(rt?o.mount(rt):o.unmount()),tt&&(typeof tt=="function"?tt(rt):isRefObject(tt)&&(tt.current=rt))},[o])}function isVariantLabels(et){return Array.isArray(et)}function isVariantLabel(et){return typeof et=="string"||isVariantLabels(et)}function getCurrent(et){var o={};return et.forEachValue(function(tt,rt){return o[rt]=tt.get()}),o}function getVelocity$1(et){var o={};return et.forEachValue(function(tt,rt){return o[rt]=tt.getVelocity()}),o}function resolveVariantFromProps(et,o,tt,rt,nt){var ot;return rt===void 0&&(rt={}),nt===void 0&&(nt={}),typeof o=="function"&&(o=o(tt??et.custom,rt,nt)),typeof o=="string"&&(o=(ot=et.variants)===null||ot===void 0?void 0:ot[o]),typeof o=="function"&&(o=o(tt??et.custom,rt,nt)),o}function resolveVariant(et,o,tt){var rt=et.getProps();return resolveVariantFromProps(rt,o,tt??rt.custom,getCurrent(et),getVelocity$1(et))}function checkIfControllingVariants(et){var o;return typeof((o=et.animate)===null||o===void 0?void 0:o.start)=="function"||isVariantLabel(et.initial)||isVariantLabel(et.animate)||isVariantLabel(et.whileHover)||isVariantLabel(et.whileDrag)||isVariantLabel(et.whileTap)||isVariantLabel(et.whileFocus)||isVariantLabel(et.exit)}function checkIfVariantNode(et){return!!(checkIfControllingVariants(et)||et.variants)}function getCurrentTreeVariants(et,o){if(checkIfControllingVariants(et)){var tt=et.initial,rt=et.animate;return{initial:tt===!1||isVariantLabel(tt)?tt:void 0,animate:isVariantLabel(rt)?rt:void 0}}return et.inherit!==!1?o:{}}function useCreateMotionContext(et){var o=getCurrentTreeVariants(et,reactExports.useContext(MotionContext)),tt=o.initial,rt=o.animate;return reactExports.useMemo(function(){return{initial:tt,animate:rt}},[variantLabelsAsDependency(tt),variantLabelsAsDependency(rt)])}function variantLabelsAsDependency(et){return Array.isArray(et)?et.join(" "):et}function useConstant(et){var o=reactExports.useRef(null);return o.current===null&&(o.current=et()),o.current}var globalProjectionState={hasAnimatedSinceResize:!0,hasEverUpdated:!1},id=1;function useProjectionId(){return useConstant(function(){if(globalProjectionState.hasEverUpdated)return id++})}var LayoutGroupContext=reactExports.createContext({}),SwitchLayoutGroupContext=reactExports.createContext({});function useProjection(et,o,tt,rt){var nt,ot=o.layoutId,it=o.layout,st=o.drag,at=o.dragConstraints,ct=o.layoutScroll,lt=reactExports.useContext(SwitchLayoutGroupContext);!rt||!tt||tt!=null&&tt.projection||(tt.projection=new rt(et,tt.getLatestValues(),(nt=tt.parent)===null||nt===void 0?void 0:nt.projection),tt.projection.setOptions({layoutId:ot,layout:it,alwaysMeasureLayout:!!st||at&&isRefObject(at),visualElement:tt,scheduleRender:function(){return tt.scheduleRender()},animationType:typeof it=="string"?it:"both",initialPromotionConfig:lt,layoutScroll:ct}))}var VisualElementHandler=function(et){__extends(o,et);function o(){return et!==null&&et.apply(this,arguments)||this}return o.prototype.getSnapshotBeforeUpdate=function(){return this.updateProps(),null},o.prototype.componentDidUpdate=function(){},o.prototype.updateProps=function(){var tt=this.props,rt=tt.visualElement,nt=tt.props;rt&&rt.setProps(nt)},o.prototype.render=function(){return this.props.children},o}(React.Component);function createMotionComponent(et){var o=et.preloadedFeatures,tt=et.createVisualElement,rt=et.projectionNodeConstructor,nt=et.useRender,ot=et.useVisualState,it=et.Component;o&&loadFeatures(o);function st(at,ct){var lt=useLayoutId(at);at=__assign(__assign({},at),{layoutId:lt});var dt=reactExports.useContext(MotionConfigContext),ht=null,mt=useCreateMotionContext(at),ft=dt.isStatic?void 0:useProjectionId(),pt=ot(at,dt.isStatic);return!dt.isStatic&&isBrowser$3&&(mt.visualElement=useVisualElement(it,pt,__assign(__assign({},dt),at),tt),useProjection(ft,at,mt.visualElement,rt||featureDefinitions.projectionNodeConstructor),ht=useFeatures(at,mt.visualElement,o)),reactExports.createElement(VisualElementHandler,{visualElement:mt.visualElement,props:__assign(__assign({},dt),at)},ht,reactExports.createElement(MotionContext.Provider,{value:mt},nt(it,at,ft,useMotionRef(pt,mt.visualElement,ct),pt,dt.isStatic,mt.visualElement)))}return reactExports.forwardRef(st)}function useLayoutId(et){var o,tt=et.layoutId,rt=(o=reactExports.useContext(LayoutGroupContext))===null||o===void 0?void 0:o.id;return rt&&tt!==void 0?rt+"-"+tt:tt}function createMotionProxy(et){function o(rt,nt){return nt===void 0&&(nt={}),createMotionComponent(et(rt,nt))}if(typeof Proxy>"u")return o;var tt=new Map;return new Proxy(o,{get:function(rt,nt){return tt.has(nt)||tt.set(nt,o(nt)),tt.get(nt)}})}var lowercaseSVGElements=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function isSVGComponent(et){return typeof et!="string"||et.includes("-")?!1:!!(lowercaseSVGElements.indexOf(et)>-1||/[A-Z]/.test(et))}var scaleCorrectors={};function addScaleCorrector(et){Object.assign(scaleCorrectors,et)}var transformAxes=["","X","Y","Z"],order$1=["translate","scale","rotate","skew"],transformProps=["transformPerspective","x","y","z"];order$1.forEach(function(et){return transformAxes.forEach(function(o){return transformProps.push(et+o)})});function sortTransformProps(et,o){return transformProps.indexOf(et)-transformProps.indexOf(o)}var transformPropSet=new Set(transformProps);function isTransformProp(et){return transformPropSet.has(et)}var transformOriginProps=new Set(["originX","originY","originZ"]);function isTransformOriginProp(et){return transformOriginProps.has(et)}function isForcedMotionValue(et,o){var tt=o.layout,rt=o.layoutId;return isTransformProp(et)||isTransformOriginProp(et)||(tt||rt!==void 0)&&(!!scaleCorrectors[et]||et==="opacity")}var isMotionValue=function(et){return!!(et!==null&&typeof et=="object"&&et.getVelocity)},translateAlias={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function buildTransform(et,o,tt,rt){var nt=et.transform,ot=et.transformKeys,it=o.enableHardwareAcceleration,st=it===void 0?!0:it,at=o.allowTransformNone,ct=at===void 0?!0:at,lt="";ot.sort(sortTransformProps);for(var dt=!1,ht=ot.length,mt=0;mt<ht;mt++){var ft=ot[mt];lt+="".concat(translateAlias[ft]||ft,"(").concat(nt[ft],") "),ft==="z"&&(dt=!0)}return!dt&&st?lt+="translateZ(0)":lt=lt.trim(),rt?lt=rt(nt,tt?"":lt):ct&&tt&&(lt="none"),lt}function buildTransformOrigin(et){var o=et.originX,tt=o===void 0?"50%":o,rt=et.originY,nt=rt===void 0?"50%":rt,ot=et.originZ,it=ot===void 0?0:ot;return"".concat(tt," ").concat(nt," ").concat(it)}function isCSSVariable$1(et){return et.startsWith("--")}var getValueAsType=function(et,o){return o&&typeof et=="number"?o.transform(et):et};const clamp$2=(et,o)=>tt=>Math.max(Math.min(tt,o),et),sanitize=et=>et%1?Number(et.toFixed(5)):et,floatRegex=/(-)?([\d]*\.?[\d])+/g,colorRegex=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,singleColorRegex=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function isString(et){return typeof et=="string"}const number$3={test:et=>typeof et=="number",parse:parseFloat,transform:et=>et},alpha=Object.assign(Object.assign({},number$3),{transform:clamp$2(0,1)}),scale=Object.assign(Object.assign({},number$3),{default:1}),createUnitType=et=>({test:o=>isString(o)&&o.endsWith(et)&&o.split(" ").length===1,parse:parseFloat,transform:o=>`${o}${et}`}),degrees=createUnitType("deg"),percent=createUnitType("%"),px=createUnitType("px"),vh=createUnitType("vh"),vw=createUnitType("vw"),progressPercentage=Object.assign(Object.assign({},percent),{parse:et=>percent.parse(et)/100,transform:et=>percent.transform(et*100)}),isColorString=(et,o)=>tt=>!!(isString(tt)&&singleColorRegex.test(tt)&&tt.startsWith(et)||o&&Object.prototype.hasOwnProperty.call(tt,o)),splitColor=(et,o,tt)=>rt=>{if(!isString(rt))return rt;const[nt,ot,it,st]=rt.match(floatRegex);return{[et]:parseFloat(nt),[o]:parseFloat(ot),[tt]:parseFloat(it),alpha:st!==void 0?parseFloat(st):1}},hsla={test:isColorString("hsl","hue"),parse:splitColor("hue","saturation","lightness"),transform:({hue:et,saturation:o,lightness:tt,alpha:rt=1})=>"hsla("+Math.round(et)+", "+percent.transform(sanitize(o))+", "+percent.transform(sanitize(tt))+", "+sanitize(alpha.transform(rt))+")"},clampRgbUnit=clamp$2(0,255),rgbUnit=Object.assign(Object.assign({},number$3),{transform:et=>Math.round(clampRgbUnit(et))}),rgba={test:isColorString("rgb","red"),parse:splitColor("red","green","blue"),transform:({red:et,green:o,blue:tt,alpha:rt=1})=>"rgba("+rgbUnit.transform(et)+", "+rgbUnit.transform(o)+", "+rgbUnit.transform(tt)+", "+sanitize(alpha.transform(rt))+")"};function parseHex(et){let o="",tt="",rt="",nt="";return et.length>5?(o=et.substr(1,2),tt=et.substr(3,2),rt=et.substr(5,2),nt=et.substr(7,2)):(o=et.substr(1,1),tt=et.substr(2,1),rt=et.substr(3,1),nt=et.substr(4,1),o+=o,tt+=tt,rt+=rt,nt+=nt),{red:parseInt(o,16),green:parseInt(tt,16),blue:parseInt(rt,16),alpha:nt?parseInt(nt,16)/255:1}}const hex={test:isColorString("#"),parse:parseHex,transform:rgba.transform},color$1={test:et=>rgba.test(et)||hex.test(et)||hsla.test(et),parse:et=>rgba.test(et)?rgba.parse(et):hsla.test(et)?hsla.parse(et):hex.parse(et),transform:et=>isString(et)?et:et.hasOwnProperty("red")?rgba.transform(et):hsla.transform(et)},colorToken="${c}",numberToken="${n}";function test(et){var o,tt,rt,nt;return isNaN(et)&&isString(et)&&((tt=(o=et.match(floatRegex))===null||o===void 0?void 0:o.length)!==null&&tt!==void 0?tt:0)+((nt=(rt=et.match(colorRegex))===null||rt===void 0?void 0:rt.length)!==null&&nt!==void 0?nt:0)>0}function analyse$1(et){typeof et=="number"&&(et=`${et}`);const o=[];let tt=0;const rt=et.match(colorRegex);rt&&(tt=rt.length,et=et.replace(colorRegex,colorToken),o.push(...rt.map(color$1.parse)));const nt=et.match(floatRegex);return nt&&(et=et.replace(floatRegex,numberToken),o.push(...nt.map(number$3.parse))),{values:o,numColors:tt,tokenised:et}}function parse$4(et){return analyse$1(et).values}function createTransformer(et){const{values:o,numColors:tt,tokenised:rt}=analyse$1(et),nt=o.length;return ot=>{let it=rt;for(let st=0;st<nt;st++)it=it.replace(st<tt?colorToken:numberToken,st<tt?color$1.transform(ot[st]):sanitize(ot[st]));return it}}const convertNumbersToZero=et=>typeof et=="number"?0:et;function getAnimatableNone$1(et){const o=parse$4(et);return createTransformer(et)(o.map(convertNumbersToZero))}const complex={test,parse:parse$4,createTransformer,getAnimatableNone:getAnimatableNone$1},maxDefaults=new Set(["brightness","contrast","saturate","opacity"]);function applyDefaultFilter(et){let[o,tt]=et.slice(0,-1).split("(");if(o==="drop-shadow")return et;const[rt]=tt.match(floatRegex)||[];if(!rt)return et;const nt=tt.replace(rt,"");let ot=maxDefaults.has(o)?1:0;return rt!==tt&&(ot*=100),o+"("+ot+nt+")"}const functionRegex=/([a-z-]*)\(.*?\)/g,filter$1=Object.assign(Object.assign({},complex),{getAnimatableNone:et=>{const o=et.match(functionRegex);return o?o.map(applyDefaultFilter).join(" "):et}});var int=__assign(__assign({},number$3),{transform:Math.round}),numberValueTypes={borderWidth:px,borderTopWidth:px,borderRightWidth:px,borderBottomWidth:px,borderLeftWidth:px,borderRadius:px,radius:px,borderTopLeftRadius:px,borderTopRightRadius:px,borderBottomRightRadius:px,borderBottomLeftRadius:px,width:px,maxWidth:px,height:px,maxHeight:px,size:px,top:px,right:px,bottom:px,left:px,padding:px,paddingTop:px,paddingRight:px,paddingBottom:px,paddingLeft:px,margin:px,marginTop:px,marginRight:px,marginBottom:px,marginLeft:px,rotate:degrees,rotateX:degrees,rotateY:degrees,rotateZ:degrees,scale,scaleX:scale,scaleY:scale,scaleZ:scale,skew:degrees,skewX:degrees,skewY:degrees,distance:px,translateX:px,translateY:px,translateZ:px,x:px,y:px,z:px,perspective:px,transformPerspective:px,opacity:alpha,originX:progressPercentage,originY:progressPercentage,originZ:px,zIndex:int,fillOpacity:alpha,strokeOpacity:alpha,numOctaves:int};function buildHTMLStyles(et,o,tt,rt){var nt,ot=et.style,it=et.vars,st=et.transform,at=et.transformKeys,ct=et.transformOrigin;at.length=0;var lt=!1,dt=!1,ht=!0;for(var mt in o){var ft=o[mt];if(isCSSVariable$1(mt)){it[mt]=ft;continue}var pt=numberValueTypes[mt],yt=getValueAsType(ft,pt);if(isTransformProp(mt)){if(lt=!0,st[mt]=yt,at.push(mt),!ht)continue;ft!==((nt=pt.default)!==null&&nt!==void 0?nt:0)&&(ht=!1)}else isTransformOriginProp(mt)?(ct[mt]=yt,dt=!0):ot[mt]=yt}lt?ot.transform=buildTransform(et,tt,ht,rt):rt?ot.transform=rt({},""):!o.transform&&ot.transform&&(ot.transform="none"),dt&&(ot.transformOrigin=buildTransformOrigin(ct))}var createHtmlRenderState=function(){return{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}};function copyRawValuesOnly(et,o,tt){for(var rt in o)!isMotionValue(o[rt])&&!isForcedMotionValue(rt,tt)&&(et[rt]=o[rt])}function useInitialMotionValues(et,o,tt){var rt=et.transformTemplate;return reactExports.useMemo(function(){var nt=createHtmlRenderState();buildHTMLStyles(nt,o,{enableHardwareAcceleration:!tt},rt);var ot=nt.vars,it=nt.style;return __assign(__assign({},ot),it)},[o])}function useStyle(et,o,tt){var rt=et.style||{},nt={};return copyRawValuesOnly(nt,rt,et),Object.assign(nt,useInitialMotionValues(et,o,tt)),et.transformValues&&(nt=et.transformValues(nt)),nt}function useHTMLProps(et,o,tt){var rt={},nt=useStyle(et,o,tt);return et.drag&&et.dragListener!==!1&&(rt.draggable=!1,nt.userSelect=nt.WebkitUserSelect=nt.WebkitTouchCallout="none",nt.touchAction=et.drag===!0?"none":"pan-".concat(et.drag==="x"?"y":"x")),rt.style=nt,rt}var validMotionProps=new Set(["initial","animate","exit","style","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","whileDrag","onPan","onPanStart","onPanEnd","onPanSessionStart","onTap","onTapStart","onTapCancel","onHoverStart","onHoverEnd","whileFocus","whileTap","whileHover","whileInView","onViewportEnter","onViewportLeave","viewport","layoutScroll"]);function isValidMotionProp(et){return validMotionProps.has(et)}var shouldForward=function(et){return!isValidMotionProp(et)};function loadExternalIsValidProp(et){et&&(shouldForward=function(o){return o.startsWith("on")?!isValidMotionProp(o):et(o)})}try{loadExternalIsValidProp(require("@emotion/is-prop-valid").default)}catch{}function filterProps(et,o,tt){var rt={};for(var nt in et)(shouldForward(nt)||tt===!0&&isValidMotionProp(nt)||!o&&!isValidMotionProp(nt)||et.draggable&&nt.startsWith("onDrag"))&&(rt[nt]=et[nt]);return rt}function calcOrigin$1(et,o,tt){return typeof et=="string"?et:px.transform(o+tt*et)}function calcSVGTransformOrigin(et,o,tt){var rt=calcOrigin$1(o,et.x,et.width),nt=calcOrigin$1(tt,et.y,et.height);return"".concat(rt," ").concat(nt)}var camelKeys={offset:"strokeDashoffset",array:"strokeDasharray"};function buildSVGPath(et,o,tt,rt,nt){tt===void 0&&(tt=1),rt===void 0&&(rt=0),et.pathLength=1;var ot=camelKeys;et[ot.offset]=px.transform(-rt);var it=px.transform(o),st=px.transform(tt);et[ot.array]="".concat(it," ").concat(st)}function buildSVGAttrs(et,o,tt,rt){var nt=o.attrX,ot=o.attrY,it=o.originX,st=o.originY,at=o.pathLength,ct=o.pathSpacing,lt=ct===void 0?1:ct,dt=o.pathOffset,ht=dt===void 0?0:dt,mt=__rest(o,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]);buildHTMLStyles(et,mt,tt,rt),et.attrs=et.style,et.style={};var ft=et.attrs,pt=et.style,yt=et.dimensions;ft.transform&&(yt&&(pt.transform=ft.transform),delete ft.transform),yt&&(it!==void 0||st!==void 0||pt.transform)&&(pt.transformOrigin=calcSVGTransformOrigin(yt,it!==void 0?it:.5,st!==void 0?st:.5)),nt!==void 0&&(ft.x=nt),ot!==void 0&&(ft.y=ot),at!==void 0&&buildSVGPath(ft,at,lt,ht)}var createSvgRenderState=function(){return __assign(__assign({},createHtmlRenderState()),{attrs:{}})};function useSVGProps(et,o){var tt=reactExports.useMemo(function(){var nt=createSvgRenderState();return buildSVGAttrs(nt,o,{enableHardwareAcceleration:!1},et.transformTemplate),__assign(__assign({},nt.attrs),{style:__assign({},nt.style)})},[o]);if(et.style){var rt={};copyRawValuesOnly(rt,et.style,et),tt.style=__assign(__assign({},rt),tt.style)}return tt}function createUseRender(et){et===void 0&&(et=!1);var o=function(tt,rt,nt,ot,it,st){var at=it.latestValues,ct=isSVGComponent(tt)?useSVGProps:useHTMLProps,lt=ct(rt,at,st),dt=filterProps(rt,typeof tt=="string",et),ht=__assign(__assign(__assign({},dt),lt),{ref:ot});return nt&&(ht["data-projection-id"]=nt),reactExports.createElement(tt,ht)};return o}var CAMEL_CASE_PATTERN=/([a-z])([A-Z])/g,REPLACE_TEMPLATE="$1-$2",camelToDash=function(et){return et.replace(CAMEL_CASE_PATTERN,REPLACE_TEMPLATE).toLowerCase()};function renderHTML(et,o,tt,rt){var nt=o.style,ot=o.vars;Object.assign(et.style,nt,rt&&rt.getProjectionStyles(tt));for(var it in ot)et.style.setProperty(it,ot[it])}var camelCaseAttributes=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function renderSVG(et,o,tt,rt){renderHTML(et,o,void 0,rt);for(var nt in o.attrs)et.setAttribute(camelCaseAttributes.has(nt)?nt:camelToDash(nt),o.attrs[nt])}function scrapeMotionValuesFromProps$1(et){var o=et.style,tt={};for(var rt in o)(isMotionValue(o[rt])||isForcedMotionValue(rt,et))&&(tt[rt]=o[rt]);return tt}function scrapeMotionValuesFromProps(et){var o=scrapeMotionValuesFromProps$1(et);for(var tt in et)if(isMotionValue(et[tt])){var rt=tt==="x"||tt==="y"?"attr"+tt.toUpperCase():tt;o[rt]=et[tt]}return o}function isAnimationControls(et){return typeof et=="object"&&typeof et.start=="function"}var isKeyframesTarget=function(et){return Array.isArray(et)},isCustomValue=function(et){return!!(et&&typeof et=="object"&&et.mix&&et.toValue)},resolveFinalValueInKeyframes=function(et){return isKeyframesTarget(et)?et[et.length-1]||0:et};function resolveMotionValue(et){var o=isMotionValue(et)?et.get():et;return isCustomValue(o)?o.toValue():o}function makeState(et,o,tt,rt){var nt=et.scrapeMotionValuesFromProps,ot=et.createRenderState,it=et.onMount,st={latestValues:makeLatestValues(o,tt,rt,nt),renderState:ot()};return it&&(st.mount=function(at){return it(o,at,st)}),st}var makeUseVisualState=function(et){return function(o,tt){var rt=reactExports.useContext(MotionContext),nt=reactExports.useContext(PresenceContext);return tt?makeState(et,o,rt,nt):useConstant(function(){return makeState(et,o,rt,nt)})}};function makeLatestValues(et,o,tt,rt){var nt={},ot=(tt==null?void 0:tt.initial)===!1,it=rt(et);for(var st in it)nt[st]=resolveMotionValue(it[st]);var at=et.initial,ct=et.animate,lt=checkIfControllingVariants(et),dt=checkIfVariantNode(et);o&&dt&&!lt&&et.inherit!==!1&&(at??(at=o.initial),ct??(ct=o.animate));var ht=ot||at===!1,mt=ht?ct:at;if(mt&&typeof mt!="boolean"&&!isAnimationControls(mt)){var ft=Array.isArray(mt)?mt:[mt];ft.forEach(function(pt){var yt=resolveVariantFromProps(et,pt);if(yt){var gt=yt.transitionEnd;yt.transition;var bt=__rest(yt,["transitionEnd","transition"]);for(var xt in bt){var vt=bt[xt];if(Array.isArray(vt)){var Et=ht?vt.length-1:0;vt=vt[Et]}vt!==null&&(nt[xt]=vt)}for(var xt in gt)nt[xt]=gt[xt]}})}return nt}var svgMotionConfig={useVisualState:makeUseVisualState({scrapeMotionValuesFromProps,createRenderState:createSvgRenderState,onMount:function(et,o,tt){var rt=tt.renderState,nt=tt.latestValues;try{rt.dimensions=typeof o.getBBox=="function"?o.getBBox():o.getBoundingClientRect()}catch{rt.dimensions={x:0,y:0,width:0,height:0}}buildSVGAttrs(rt,nt,{enableHardwareAcceleration:!1},et.transformTemplate),renderSVG(o,rt)}})},htmlMotionConfig={useVisualState:makeUseVisualState({scrapeMotionValuesFromProps:scrapeMotionValuesFromProps$1,createRenderState:createHtmlRenderState})};function createDomMotionConfig(et,o,tt,rt,nt){var ot=o.forwardMotionProps,it=ot===void 0?!1:ot,st=isSVGComponent(et)?svgMotionConfig:htmlMotionConfig;return __assign(__assign({},st),{preloadedFeatures:tt,useRender:createUseRender(it),createVisualElement:rt,projectionNodeConstructor:nt,Component:et})}var AnimationType;(function(et){et.Animate="animate",et.Hover="whileHover",et.Tap="whileTap",et.Drag="whileDrag",et.Focus="whileFocus",et.InView="whileInView",et.Exit="exit"})(AnimationType||(AnimationType={}));function addDomEvent(et,o,tt,rt){return rt===void 0&&(rt={passive:!0}),et.addEventListener(o,tt,rt),function(){return et.removeEventListener(o,tt)}}function useDomEvent(et,o,tt,rt){reactExports.useEffect(function(){var nt=et.current;if(tt&&nt)return addDomEvent(nt,o,tt,rt)},[et,o,tt,rt])}function useFocusGesture(et){var o=et.whileFocus,tt=et.visualElement,rt=function(){var ot;(ot=tt.animationState)===null||ot===void 0||ot.setActive(AnimationType.Focus,!0)},nt=function(){var ot;(ot=tt.animationState)===null||ot===void 0||ot.setActive(AnimationType.Focus,!1)};useDomEvent(tt,"focus",o?rt:void 0),useDomEvent(tt,"blur",o?nt:void 0)}function isMouseEvent(et){return typeof PointerEvent<"u"&&et instanceof PointerEvent?et.pointerType==="mouse":et instanceof MouseEvent}function isTouchEvent(et){var o=!!et.touches;return o}function filterPrimaryPointer(et){return function(o){var tt=o instanceof MouseEvent,rt=!tt||tt&&o.button===0;rt&&et(o)}}var defaultPagePoint={pageX:0,pageY:0};function pointFromTouch(et,o){o===void 0&&(o="page");var tt=et.touches[0]||et.changedTouches[0],rt=tt||defaultPagePoint;return{x:rt[o+"X"],y:rt[o+"Y"]}}function pointFromMouse(et,o){return o===void 0&&(o="page"),{x:et[o+"X"],y:et[o+"Y"]}}function extractEventInfo(et,o){return o===void 0&&(o="page"),{point:isTouchEvent(et)?pointFromTouch(et,o):pointFromMouse(et,o)}}var wrapHandler=function(et,o){o===void 0&&(o=!1);var tt=function(rt){return et(rt,extractEventInfo(rt))};return o?filterPrimaryPointer(tt):tt},supportsPointerEvents=function(){return isBrowser$3&&window.onpointerdown===null},supportsTouchEvents=function(){return isBrowser$3&&window.ontouchstart===null},supportsMouseEvents=function(){return isBrowser$3&&window.onmousedown===null},mouseEventNames={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},touchEventNames={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function getPointerEventName(et){return supportsPointerEvents()?et:supportsTouchEvents()?touchEventNames[et]:supportsMouseEvents()?mouseEventNames[et]:et}function addPointerEvent(et,o,tt,rt){return addDomEvent(et,getPointerEventName(o),wrapHandler(tt,o==="pointerdown"),rt)}function usePointerEvent(et,o,tt,rt){return useDomEvent(et,getPointerEventName(o),tt&&wrapHandler(tt,o==="pointerdown"),rt)}function createLock(et){var o=null;return function(){var tt=function(){o=null};return o===null?(o=et,tt):!1}}var globalHorizontalLock=createLock("dragHorizontal"),globalVerticalLock=createLock("dragVertical");function getGlobalLock(et){var o=!1;if(et==="y")o=globalVerticalLock();else if(et==="x")o=globalHorizontalLock();else{var tt=globalHorizontalLock(),rt=globalVerticalLock();tt&&rt?o=function(){tt(),rt()}:(tt&&tt(),rt&&rt())}return o}function isDragActive(){var et=getGlobalLock(!0);return et?(et(),!1):!0}function createHoverEvent(et,o,tt){return function(rt,nt){var ot;!isMouseEvent(rt)||isDragActive()||((ot=et.animationState)===null||ot===void 0||ot.setActive(AnimationType.Hover,o),tt==null||tt(rt,nt))}}function useHoverGesture(et){var o=et.onHoverStart,tt=et.onHoverEnd,rt=et.whileHover,nt=et.visualElement;usePointerEvent(nt,"pointerenter",o||rt?createHoverEvent(nt,!0,o):void 0,{passive:!o}),usePointerEvent(nt,"pointerleave",tt||rt?createHoverEvent(nt,!1,tt):void 0,{passive:!tt})}var isNodeOrChild=function(et,o){return o?et===o?!0:isNodeOrChild(et,o.parentElement):!1};function useUnmountEffect(et){return reactExports.useEffect(function(){return function(){return et()}},[])}const clamp$1=(et,o,tt)=>Math.min(Math.max(tt,et),o),safeMin=.001,minDuration=.01,maxDuration=10,minDamping=.05,maxDamping=1;function findSpring({duration:et=800,bounce:o=.25,velocity:tt=0,mass:rt=1}){let nt,ot,it=1-o;it=clamp$1(minDamping,maxDamping,it),et=clamp$1(minDuration,maxDuration,et/1e3),it<1?(nt=ct=>{const lt=ct*it,dt=lt*et,ht=lt-tt,mt=calcAngularFreq(ct,it),ft=Math.exp(-dt);return safeMin-ht/mt*ft},ot=ct=>{const dt=ct*it*et,ht=dt*tt+tt,mt=Math.pow(it,2)*Math.pow(ct,2)*et,ft=Math.exp(-dt),pt=calcAngularFreq(Math.pow(ct,2),it);return(-nt(ct)+safeMin>0?-1:1)*((ht-mt)*ft)/pt}):(nt=ct=>{const lt=Math.exp(-ct*et),dt=(ct-tt)*et+1;return-safeMin+lt*dt},ot=ct=>{const lt=Math.exp(-ct*et),dt=(tt-ct)*(et*et);return lt*dt});const st=5/et,at=approximateRoot(nt,ot,st);if(et=et*1e3,isNaN(at))return{stiffness:100,damping:10,duration:et};{const ct=Math.pow(at,2)*rt;return{stiffness:ct,damping:it*2*Math.sqrt(rt*ct),duration:et}}}const rootIterations=12;function approximateRoot(et,o,tt){let rt=tt;for(let nt=1;nt<rootIterations;nt++)rt=rt-et(rt)/o(rt);return rt}function calcAngularFreq(et,o){return et*Math.sqrt(1-o*o)}const durationKeys=["duration","bounce"],physicsKeys=["stiffness","damping","mass"];function isSpringType(et,o){return o.some(tt=>et[tt]!==void 0)}function getSpringOptions(et){let o=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},et);if(!isSpringType(et,physicsKeys)&&isSpringType(et,durationKeys)){const tt=findSpring(et);o=Object.assign(Object.assign(Object.assign({},o),tt),{velocity:0,mass:1}),o.isResolvedFromDuration=!0}return o}function spring(et){var{from:o=0,to:tt=1,restSpeed:rt=2,restDelta:nt}=et,ot=__rest(et,["from","to","restSpeed","restDelta"]);const it={done:!1,value:o};let{stiffness:st,damping:at,mass:ct,velocity:lt,duration:dt,isResolvedFromDuration:ht}=getSpringOptions(ot),mt=zero$1,ft=zero$1;function pt(){const yt=lt?-(lt/1e3):0,gt=tt-o,bt=at/(2*Math.sqrt(st*ct)),xt=Math.sqrt(st/ct)/1e3;if(nt===void 0&&(nt=Math.min(Math.abs(tt-o)/100,.4)),bt<1){const vt=calcAngularFreq(xt,bt);mt=Et=>{const Ct=Math.exp(-bt*xt*Et);return tt-Ct*((yt+bt*xt*gt)/vt*Math.sin(vt*Et)+gt*Math.cos(vt*Et))},ft=Et=>{const Ct=Math.exp(-bt*xt*Et);return bt*xt*Ct*(Math.sin(vt*Et)*(yt+bt*xt*gt)/vt+gt*Math.cos(vt*Et))-Ct*(Math.cos(vt*Et)*(yt+bt*xt*gt)-vt*gt*Math.sin(vt*Et))}}else if(bt===1)mt=vt=>tt-Math.exp(-xt*vt)*(gt+(yt+xt*gt)*vt);else{const vt=xt*Math.sqrt(bt*bt-1);mt=Et=>{const Ct=Math.exp(-bt*xt*Et),St=Math.min(vt*Et,300);return tt-Ct*((yt+bt*xt*gt)*Math.sinh(St)+vt*gt*Math.cosh(St))/vt}}}return pt(),{next:yt=>{const gt=mt(yt);if(ht)it.done=yt>=dt;else{const bt=ft(yt)*1e3,xt=Math.abs(bt)<=rt,vt=Math.abs(tt-gt)<=nt;it.done=xt&&vt}return it.value=it.done?tt:gt,it},flipTarget:()=>{lt=-lt,[o,tt]=[tt,o],pt()}}}spring.needsInterpolation=(et,o)=>typeof et=="string"||typeof o=="string";const zero$1=et=>0,progress=(et,o,tt)=>{const rt=o-et;return rt===0?1:(tt-et)/rt},mix=(et,o,tt)=>-tt*et+tt*o+et;function hueToRgb(et,o,tt){return tt<0&&(tt+=1),tt>1&&(tt-=1),tt<1/6?et+(o-et)*6*tt:tt<1/2?o:tt<2/3?et+(o-et)*(2/3-tt)*6:et}function hslaToRgba({hue:et,saturation:o,lightness:tt,alpha:rt}){et/=360,o/=100,tt/=100;let nt=0,ot=0,it=0;if(!o)nt=ot=it=tt;else{const st=tt<.5?tt*(1+o):tt+o-tt*o,at=2*tt-st;nt=hueToRgb(at,st,et+1/3),ot=hueToRgb(at,st,et),it=hueToRgb(at,st,et-1/3)}return{red:Math.round(nt*255),green:Math.round(ot*255),blue:Math.round(it*255),alpha:rt}}const mixLinearColor=(et,o,tt)=>{const rt=et*et,nt=o*o;return Math.sqrt(Math.max(0,tt*(nt-rt)+rt))},colorTypes=[hex,rgba,hsla],getColorType=et=>colorTypes.find(o=>o.test(et)),mixColor=(et,o)=>{let tt=getColorType(et),rt=getColorType(o),nt=tt.parse(et),ot=rt.parse(o);tt===hsla&&(nt=hslaToRgba(nt),tt=rgba),rt===hsla&&(ot=hslaToRgba(ot),rt=rgba);const it=Object.assign({},nt);return st=>{for(const at in it)at!=="alpha"&&(it[at]=mixLinearColor(nt[at],ot[at],st));return it.alpha=mix(nt.alpha,ot.alpha,st),tt.transform(it)}},isNum=et=>typeof et=="number",combineFunctions=(et,o)=>tt=>o(et(tt)),pipe$1=(...et)=>et.reduce(combineFunctions);function getMixer(et,o){return isNum(et)?tt=>mix(et,o,tt):color$1.test(et)?mixColor(et,o):mixComplex(et,o)}const mixArray=(et,o)=>{const tt=[...et],rt=tt.length,nt=et.map((ot,it)=>getMixer(ot,o[it]));return ot=>{for(let it=0;it<rt;it++)tt[it]=nt[it](ot);return tt}},mixObject=(et,o)=>{const tt=Object.assign(Object.assign({},et),o),rt={};for(const nt in tt)et[nt]!==void 0&&o[nt]!==void 0&&(rt[nt]=getMixer(et[nt],o[nt]));return nt=>{for(const ot in rt)tt[ot]=rt[ot](nt);return tt}};function analyse(et){const o=complex.parse(et),tt=o.length;let rt=0,nt=0,ot=0;for(let it=0;it<tt;it++)rt||typeof o[it]=="number"?rt++:o[it].hue!==void 0?ot++:nt++;return{parsed:o,numNumbers:rt,numRGB:nt,numHSL:ot}}const mixComplex=(et,o)=>{const tt=complex.createTransformer(o),rt=analyse(et),nt=analyse(o);return rt.numHSL===nt.numHSL&&rt.numRGB===nt.numRGB&&rt.numNumbers>=nt.numNumbers?pipe$1(mixArray(rt.parsed,nt.parsed),tt):it=>`${it>0?o:et}`},mixNumber=(et,o)=>tt=>mix(et,o,tt);function detectMixerFactory(et){if(typeof et=="number")return mixNumber;if(typeof et=="string")return color$1.test(et)?mixColor:mixComplex;if(Array.isArray(et))return mixArray;if(typeof et=="object")return mixObject}function createMixers(et,o,tt){const rt=[],nt=tt||detectMixerFactory(et[0]),ot=et.length-1;for(let it=0;it<ot;it++){let st=nt(et[it],et[it+1]);if(o){const at=Array.isArray(o)?o[it]:o;st=pipe$1(at,st)}rt.push(st)}return rt}function fastInterpolate([et,o],[tt]){return rt=>tt(progress(et,o,rt))}function slowInterpolate(et,o){const tt=et.length,rt=tt-1;return nt=>{let ot=0,it=!1;if(nt<=et[0]?it=!0:nt>=et[rt]&&(ot=rt-1,it=!0),!it){let at=1;for(;at<tt&&!(et[at]>nt||at===rt);at++);ot=at-1}const st=progress(et[ot],et[ot+1],nt);return o[ot](st)}}function interpolate(et,o,{clamp:tt=!0,ease:rt,mixer:nt}={}){const ot=et.length;invariant$1(ot===o.length),invariant$1(!rt||!Array.isArray(rt)||rt.length===ot-1),et[0]>et[ot-1]&&(et=[].concat(et),o=[].concat(o),et.reverse(),o.reverse());const it=createMixers(o,rt,nt),st=ot===2?fastInterpolate(et,it):slowInterpolate(et,it);return tt?at=>st(clamp$1(et[0],et[ot-1],at)):st}const reverseEasing=et=>o=>1-et(1-o),mirrorEasing=et=>o=>o<=.5?et(2*o)/2:(2-et(2*(1-o)))/2,createExpoIn=et=>o=>Math.pow(o,et),createBackIn=et=>o=>o*o*((et+1)*o-et),createAnticipate=et=>{const o=createBackIn(et);return tt=>(tt*=2)<1?.5*o(tt):.5*(2-Math.pow(2,-10*(tt-1)))},DEFAULT_OVERSHOOT_STRENGTH=1.525,BOUNCE_FIRST_THRESHOLD=4/11,BOUNCE_SECOND_THRESHOLD=8/11,BOUNCE_THIRD_THRESHOLD=9/10,linear=et=>et,easeIn=createExpoIn(2),easeOut=reverseEasing(easeIn),easeInOut=mirrorEasing(easeIn),circIn=et=>1-Math.sin(Math.acos(et)),circOut=reverseEasing(circIn),circInOut=mirrorEasing(circOut),backIn=createBackIn(DEFAULT_OVERSHOOT_STRENGTH),backOut=reverseEasing(backIn),backInOut=mirrorEasing(backIn),anticipate=createAnticipate(DEFAULT_OVERSHOOT_STRENGTH),ca=4356/361,cb=35442/1805,cc=16061/1805,bounceOut=et=>{if(et===1||et===0)return et;const o=et*et;return et<BOUNCE_FIRST_THRESHOLD?7.5625*o:et<BOUNCE_SECOND_THRESHOLD?9.075*o-9.9*et+3.4:et<BOUNCE_THIRD_THRESHOLD?ca*o-cb*et+cc:10.8*et*et-20.52*et+10.72},bounceIn=reverseEasing(bounceOut),bounceInOut=et=>et<.5?.5*(1-bounceOut(1-et*2)):.5*bounceOut(et*2-1)+.5;function defaultEasing(et,o){return et.map(()=>o||easeInOut).splice(0,et.length-1)}function defaultOffset(et){const o=et.length;return et.map((tt,rt)=>rt!==0?rt/(o-1):0)}function convertOffsetToTimes(et,o){return et.map(tt=>tt*o)}function keyframes$1({from:et=0,to:o=1,ease:tt,offset:rt,duration:nt=300}){const ot={done:!1,value:et},it=Array.isArray(o)?o:[et,o],st=convertOffsetToTimes(rt&&rt.length===it.length?rt:defaultOffset(it),nt);function at(){return interpolate(st,it,{ease:Array.isArray(tt)?tt:defaultEasing(it,tt)})}let ct=at();return{next:lt=>(ot.value=ct(lt),ot.done=lt>=nt,ot),flipTarget:()=>{it.reverse(),ct=at()}}}function decay({velocity:et=0,from:o=0,power:tt=.8,timeConstant:rt=350,restDelta:nt=.5,modifyTarget:ot}){const it={done:!1,value:o};let st=tt*et;const at=o+st,ct=ot===void 0?at:ot(at);return ct!==at&&(st=ct-o),{next:lt=>{const dt=-st*Math.exp(-lt/rt);return it.done=!(dt>nt||dt<-nt),it.value=it.done?ct:ct+dt,it},flipTarget:()=>{}}}const types$3={keyframes:keyframes$1,spring,decay};function detectAnimationFromOptions(et){if(Array.isArray(et.to))return keyframes$1;if(types$3[et.type])return types$3[et.type];const o=new Set(Object.keys(et));return o.has("ease")||o.has("duration")&&!o.has("dampingRatio")?keyframes$1:o.has("dampingRatio")||o.has("stiffness")||o.has("mass")||o.has("damping")||o.has("restSpeed")||o.has("restDelta")?spring:keyframes$1}const defaultTimestep=1/60*1e3,getCurrentTime=typeof performance<"u"?()=>performance.now():()=>Date.now(),onNextFrame=typeof window<"u"?et=>window.requestAnimationFrame(et):et=>setTimeout(()=>et(getCurrentTime()),defaultTimestep);function createRenderStep(et){let o=[],tt=[],rt=0,nt=!1,ot=!1;const it=new WeakSet,st={schedule:(at,ct=!1,lt=!1)=>{const dt=lt&&nt,ht=dt?o:tt;return ct&&it.add(at),ht.indexOf(at)===-1&&(ht.push(at),dt&&nt&&(rt=o.length)),at},cancel:at=>{const ct=tt.indexOf(at);ct!==-1&&tt.splice(ct,1),it.delete(at)},process:at=>{if(nt){ot=!0;return}if(nt=!0,[o,tt]=[tt,o],tt.length=0,rt=o.length,rt)for(let ct=0;ct<rt;ct++){const lt=o[ct];lt(at),it.has(lt)&&(st.schedule(lt),et())}nt=!1,ot&&(ot=!1,st.process(at))}};return st}const maxElapsed=40;let useDefaultElapsed=!0,runNextFrame=!1,isProcessing=!1;const frame={delta:0,timestamp:0},stepsOrder=["read","update","preRender","render","postRender"],steps=stepsOrder.reduce((et,o)=>(et[o]=createRenderStep(()=>runNextFrame=!0),et),{}),sync=stepsOrder.reduce((et,o)=>{const tt=steps[o];return et[o]=(rt,nt=!1,ot=!1)=>(runNextFrame||startLoop(),tt.schedule(rt,nt,ot)),et},{}),cancelSync=stepsOrder.reduce((et,o)=>(et[o]=steps[o].cancel,et),{}),flushSync=stepsOrder.reduce((et,o)=>(et[o]=()=>steps[o].process(frame),et),{}),processStep=et=>steps[et].process(frame),processFrame=et=>{runNextFrame=!1,frame.delta=useDefaultElapsed?defaultTimestep:Math.max(Math.min(et-frame.timestamp,maxElapsed),1),frame.timestamp=et,isProcessing=!0,stepsOrder.forEach(processStep),isProcessing=!1,runNextFrame&&(useDefaultElapsed=!1,onNextFrame(processFrame))},startLoop=()=>{runNextFrame=!0,useDefaultElapsed=!0,isProcessing||onNextFrame(processFrame)},getFrameData=()=>frame;function loopElapsed(et,o,tt=0){return et-o-tt}function reverseElapsed(et,o,tt=0,rt=!0){return rt?loopElapsed(o+-et,o,tt):o-(et-o)+tt}function hasRepeatDelayElapsed(et,o,tt,rt){return rt?et>=o+tt:et<=-tt}const framesync=et=>{const o=({delta:tt})=>et(tt);return{start:()=>sync.update(o,!0),stop:()=>cancelSync.update(o)}};function animate$1(et){var o,tt,{from:rt,autoplay:nt=!0,driver:ot=framesync,elapsed:it=0,repeat:st=0,repeatType:at="loop",repeatDelay:ct=0,onPlay:lt,onStop:dt,onComplete:ht,onRepeat:mt,onUpdate:ft}=et,pt=__rest(et,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:yt}=pt,gt,bt=0,xt=pt.duration,vt,Et=!1,Ct=!0,St;const At=detectAnimationFromOptions(pt);!((tt=(o=At).needsInterpolation)===null||tt===void 0)&&tt.call(o,rt,yt)&&(St=interpolate([0,100],[rt,yt],{clamp:!1}),rt=0,yt=100);const kt=At(Object.assign(Object.assign({},pt),{from:rt,to:yt}));function It(){bt++,at==="reverse"?(Ct=bt%2===0,it=reverseElapsed(it,xt,ct,Ct)):(it=loopElapsed(it,xt,ct),at==="mirror"&&kt.flipTarget()),Et=!1,mt&&mt()}function Nt(){gt.stop(),ht&&ht()}function Lt(zt){if(Ct||(zt=-zt),it+=zt,!Et){const Ut=kt.next(Math.max(0,it));vt=Ut.value,St&&(vt=St(vt)),Et=Ct?Ut.done:it<=0}ft==null||ft(vt),Et&&(bt===0&&(xt??(xt=it)),bt<st?hasRepeatDelayElapsed(it,xt,ct,Ct)&&It():Nt())}function Mt(){lt==null||lt(),gt=ot(Lt),gt.start()}return nt&&Mt(),{stop:()=>{dt==null||dt(),gt.stop()}}}function velocityPerSecond(et,o){return o?et*(1e3/o):0}function inertia({from:et=0,velocity:o=0,min:tt,max:rt,power:nt=.8,timeConstant:ot=750,bounceStiffness:it=500,bounceDamping:st=10,restDelta:at=1,modifyTarget:ct,driver:lt,onUpdate:dt,onComplete:ht,onStop:mt}){let ft;function pt(xt){return tt!==void 0&&xt<tt||rt!==void 0&&xt>rt}function yt(xt){return tt===void 0?rt:rt===void 0||Math.abs(tt-xt)<Math.abs(rt-xt)?tt:rt}function gt(xt){ft==null||ft.stop(),ft=animate$1(Object.assign(Object.assign({},xt),{driver:lt,onUpdate:vt=>{var Et;dt==null||dt(vt),(Et=xt.onUpdate)===null||Et===void 0||Et.call(xt,vt)},onComplete:ht,onStop:mt}))}function bt(xt){gt(Object.assign({type:"spring",stiffness:it,damping:st,restDelta:at},xt))}if(pt(et))bt({from:et,velocity:o,to:yt(et)});else{let xt=nt*o+et;typeof ct<"u"&&(xt=ct(xt));const vt=yt(xt),Et=vt===tt?-1:1;let Ct,St;const At=kt=>{Ct=St,St=kt,o=velocityPerSecond(kt-Ct,getFrameData().delta),(Et===1&&kt>vt||Et===-1&&kt<vt)&&bt({from:kt,to:vt,velocity:o})};gt({type:"decay",from:et,velocity:o,timeConstant:ot,power:nt,restDelta:at,modifyTarget:ct,onUpdate:pt(xt)?At:void 0})}return{stop:()=>ft==null?void 0:ft.stop()}}const isPoint=et=>et.hasOwnProperty("x")&&et.hasOwnProperty("y"),isPoint3D=et=>isPoint(et)&&et.hasOwnProperty("z"),distance1D=(et,o)=>Math.abs(et-o);function distance(et,o){if(isNum(et)&&isNum(o))return distance1D(et,o);if(isPoint(et)&&isPoint(o)){const tt=distance1D(et.x,o.x),rt=distance1D(et.y,o.y),nt=isPoint3D(et)&&isPoint3D(o)?distance1D(et.z,o.z):0;return Math.sqrt(Math.pow(tt,2)+Math.pow(rt,2)+Math.pow(nt,2))}}const a=(et,o)=>1-3*o+3*et,b$3=(et,o)=>3*o-6*et,c$2=et=>3*et,calcBezier=(et,o,tt)=>((a(o,tt)*et+b$3(o,tt))*et+c$2(o))*et,getSlope=(et,o,tt)=>3*a(o,tt)*et*et+2*b$3(o,tt)*et+c$2(o),subdivisionPrecision=1e-7,subdivisionMaxIterations=10;function binarySubdivide(et,o,tt,rt,nt){let ot,it,st=0;do it=o+(tt-o)/2,ot=calcBezier(it,rt,nt)-et,ot>0?tt=it:o=it;while(Math.abs(ot)>subdivisionPrecision&&++st<subdivisionMaxIterations);return it}const newtonIterations=8,newtonMinSlope=.001;function newtonRaphsonIterate(et,o,tt,rt){for(let nt=0;nt<newtonIterations;++nt){const ot=getSlope(o,tt,rt);if(ot===0)return o;const it=calcBezier(o,tt,rt)-et;o-=it/ot}return o}const kSplineTableSize=11,kSampleStepSize=1/(kSplineTableSize-1);function cubicBezier(et,o,tt,rt){if(et===o&&tt===rt)return linear;const nt=new Float32Array(kSplineTableSize);for(let it=0;it<kSplineTableSize;++it)nt[it]=calcBezier(it*kSampleStepSize,et,tt);function ot(it){let st=0,at=1;const ct=kSplineTableSize-1;for(;at!==ct&&nt[at]<=it;++at)st+=kSampleStepSize;--at;const lt=(it-nt[at])/(nt[at+1]-nt[at]),dt=st+lt*kSampleStepSize,ht=getSlope(dt,et,tt);return ht>=newtonMinSlope?newtonRaphsonIterate(it,dt,et,tt):ht===0?dt:binarySubdivide(it,st,st+kSampleStepSize,et,tt)}return it=>it===0||it===1?it:calcBezier(ot(it),o,rt)}function useTapGesture(et){var o=et.onTap,tt=et.onTapStart,rt=et.onTapCancel,nt=et.whileTap,ot=et.visualElement,it=o||tt||rt||nt,st=reactExports.useRef(!1),at=reactExports.useRef(null),ct={passive:!(tt||o||rt||ft)};function lt(){var pt;(pt=at.current)===null||pt===void 0||pt.call(at),at.current=null}function dt(){var pt;return lt(),st.current=!1,(pt=ot.animationState)===null||pt===void 0||pt.setActive(AnimationType.Tap,!1),!isDragActive()}function ht(pt,yt){dt()&&(isNodeOrChild(ot.getInstance(),pt.target)?o==null||o(pt,yt):rt==null||rt(pt,yt))}function mt(pt,yt){dt()&&(rt==null||rt(pt,yt))}function ft(pt,yt){var gt;lt(),!st.current&&(st.current=!0,at.current=pipe$1(addPointerEvent(window,"pointerup",ht,ct),addPointerEvent(window,"pointercancel",mt,ct)),(gt=ot.animationState)===null||gt===void 0||gt.setActive(AnimationType.Tap,!0),tt==null||tt(pt,yt))}usePointerEvent(ot,"pointerdown",it?ft:void 0,ct),useUnmountEffect(lt)}var warned=new Set;function warnOnce(et,o,tt){warned.has(o)||(console.warn(o),warned.add(o))}var observerCallbacks=new WeakMap,observers$1=new WeakMap,fireObserverCallback=function(et){var o;(o=observerCallbacks.get(et.target))===null||o===void 0||o(et)},fireAllObserverCallbacks=function(et){et.forEach(fireObserverCallback)};function initIntersectionObserver(et){var o=et.root,tt=__rest(et,["root"]),rt=o||document;observers$1.has(rt)||observers$1.set(rt,{});var nt=observers$1.get(rt),ot=JSON.stringify(tt);return nt[ot]||(nt[ot]=new IntersectionObserver(fireAllObserverCallbacks,__assign({root:o},tt))),nt[ot]}function observeIntersection(et,o,tt){var rt=initIntersectionObserver(o);return observerCallbacks.set(et,tt),rt.observe(et),function(){observerCallbacks.delete(et),rt.unobserve(et)}}function useViewport(et){var o=et.visualElement,tt=et.whileInView,rt=et.onViewportEnter,nt=et.onViewportLeave,ot=et.viewport,it=ot===void 0?{}:ot,st=reactExports.useRef({hasEnteredView:!1,isInView:!1}),at=!!(tt||rt||nt);it.once&&st.current.hasEnteredView&&(at=!1);var ct=typeof IntersectionObserver>"u"?useMissingIntersectionObserver:useIntersectionObserver;ct(at,st.current,o,it)}var thresholdNames={some:0,all:1};function useIntersectionObserver(et,o,tt,rt){var nt=rt.root,ot=rt.margin,it=rt.amount,st=it===void 0?"some":it,at=rt.once;reactExports.useEffect(function(){if(et){var ct={root:nt==null?void 0:nt.current,rootMargin:ot,threshold:typeof st=="number"?st:thresholdNames[st]},lt=function(dt){var ht,mt=dt.isIntersecting;if(o.isInView!==mt&&(o.isInView=mt,!(at&&!mt&&o.hasEnteredView))){mt&&(o.hasEnteredView=!0),(ht=tt.animationState)===null||ht===void 0||ht.setActive(AnimationType.InView,mt);var ft=tt.getProps(),pt=mt?ft.onViewportEnter:ft.onViewportLeave;pt==null||pt(dt)}};return observeIntersection(tt.getInstance(),ct,lt)}},[et,nt,ot,st])}function useMissingIntersectionObserver(et,o,tt,rt){var nt=rt.fallback,ot=nt===void 0?!0:nt;reactExports.useEffect(function(){!et||!ot||(env$1!=="production"&&warnOnce(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(function(){var it;o.hasEnteredView=!0;var st=tt.getProps().onViewportEnter;st==null||st(null),(it=tt.animationState)===null||it===void 0||it.setActive(AnimationType.InView,!0)}))},[et])}var makeRenderlessComponent=function(et){return function(o){return et(o),null}},gestureAnimations={inView:makeRenderlessComponent(useViewport),tap:makeRenderlessComponent(useTapGesture),focus:makeRenderlessComponent(useFocusGesture),hover:makeRenderlessComponent(useHoverGesture)},counter=0,incrementId=function(){return counter++},useId$1=function(){return useConstant(incrementId)};function usePresence$1(){var et=reactExports.useContext(PresenceContext);if(et===null)return[!0,null];var o=et.isPresent,tt=et.onExitComplete,rt=et.register,nt=useId$1();reactExports.useEffect(function(){return rt(nt)},[]);var ot=function(){return tt==null?void 0:tt(nt)};return!o&&tt?[!1,ot]:[!0]}function shallowCompare(et,o){if(!Array.isArray(o))return!1;var tt=o.length;if(tt!==et.length)return!1;for(var rt=0;rt<tt;rt++)if(o[rt]!==et[rt])return!1;return!0}var secondsToMilliseconds=function(et){return et*1e3},easingLookup={linear,easeIn,easeInOut,easeOut,circIn,circInOut,circOut,backIn,backInOut,backOut,anticipate,bounceIn,bounceInOut,bounceOut},easingDefinitionToFunction=function(et){if(Array.isArray(et)){invariant$1(et.length===4);var o=__read(et,4),tt=o[0],rt=o[1],nt=o[2],ot=o[3];return cubicBezier(tt,rt,nt,ot)}else if(typeof et=="string")return invariant$1(easingLookup[et]!==void 0),easingLookup[et];return et},isEasingArray=function(et){return Array.isArray(et)&&typeof et[0]!="number"},isAnimatable=function(et,o){return et==="zIndex"?!1:!!(typeof o=="number"||Array.isArray(o)||typeof o=="string"&&complex.test(o)&&!o.startsWith("url("))},underDampedSpring=function(){return{type:"spring",stiffness:500,damping:25,restSpeed:10}},criticallyDampedSpring=function(et){return{type:"spring",stiffness:550,damping:et===0?2*Math.sqrt(550):30,restSpeed:10}},linearTween=function(){return{type:"keyframes",ease:"linear",duration:.3}},keyframes=function(et){return{type:"keyframes",duration:.8,values:et}},defaultTransitions={x:underDampedSpring,y:underDampedSpring,z:underDampedSpring,rotate:underDampedSpring,rotateX:underDampedSpring,rotateY:underDampedSpring,rotateZ:underDampedSpring,scaleX:criticallyDampedSpring,scaleY:criticallyDampedSpring,scale:criticallyDampedSpring,opacity:linearTween,backgroundColor:linearTween,color:linearTween,default:criticallyDampedSpring},getDefaultTransition=function(et,o){var tt;return isKeyframesTarget(o)?tt=keyframes:tt=defaultTransitions[et]||defaultTransitions.default,__assign({to:o},tt(o))},defaultValueTypes=__assign(__assign({},numberValueTypes),{color:color$1,backgroundColor:color$1,outlineColor:color$1,fill:color$1,stroke:color$1,borderColor:color$1,borderTopColor:color$1,borderRightColor:color$1,borderBottomColor:color$1,borderLeftColor:color$1,filter:filter$1,WebkitFilter:filter$1}),getDefaultValueType=function(et){return defaultValueTypes[et]};function getAnimatableNone(et,o){var tt,rt=getDefaultValueType(et);return rt!==filter$1&&(rt=complex),(tt=rt.getAnimatableNone)===null||tt===void 0?void 0:tt.call(rt,o)}function isTransitionDefined(et){et.when,et.delay,et.delayChildren,et.staggerChildren,et.staggerDirection,et.repeat,et.repeatType,et.repeatDelay,et.from;var o=__rest(et,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from"]);return!!Object.keys(o).length}function convertTransitionToAnimationOptions(et){var o=et.ease,tt=et.times,rt=et.yoyo,nt=et.flip,ot=et.loop,it=__rest(et,["ease","times","yoyo","flip","loop"]),st=__assign({},it);return tt&&(st.offset=tt),it.duration&&(st.duration=secondsToMilliseconds(it.duration)),it.repeatDelay&&(st.repeatDelay=secondsToMilliseconds(it.repeatDelay)),o&&(st.ease=isEasingArray(o)?o.map(easingDefinitionToFunction):easingDefinitionToFunction(o)),it.type==="tween"&&(st.type="keyframes"),(rt||ot||nt)&&(rt?st.repeatType="reverse":ot?st.repeatType="loop":nt&&(st.repeatType="mirror"),st.repeat=ot||rt||nt||it.repeat),it.type!=="spring"&&(st.type="keyframes"),st}function getDelayFromTransition(et,o){var tt,rt,nt=getValueTransition(et,o)||{};return(rt=(tt=nt.delay)!==null&&tt!==void 0?tt:et.delay)!==null&&rt!==void 0?rt:0}function hydrateKeyframes(et){return Array.isArray(et.to)&&et.to[0]===null&&(et.to=__spreadArray([],__read(et.to),!1),et.to[0]=et.from),et}function getPopmotionAnimationOptions(et,o,tt){var rt;return Array.isArray(o.to)&&((rt=et.duration)!==null&&rt!==void 0||(et.duration=.8)),hydrateKeyframes(o),isTransitionDefined(et)||(et=__assign(__assign({},et),getDefaultTransition(tt,o.to))),__assign(__assign({},o),convertTransitionToAnimationOptions(et))}function getAnimation(et,o,tt,rt,nt){var ot,it=getValueTransition(rt,et),st=(ot=it.from)!==null&&ot!==void 0?ot:o.get(),at=isAnimatable(et,tt);st==="none"&&at&&typeof tt=="string"?st=getAnimatableNone(et,tt):isZero(st)&&typeof tt=="string"?st=getZeroUnit(tt):!Array.isArray(tt)&&isZero(tt)&&typeof st=="string"&&(tt=getZeroUnit(st));var ct=isAnimatable(et,st);function lt(){var ht={from:st,to:tt,velocity:o.getVelocity(),onComplete:nt,onUpdate:function(mt){return o.set(mt)}};return it.type==="inertia"||it.type==="decay"?inertia(__assign(__assign({},ht),it)):animate$1(__assign(__assign({},getPopmotionAnimationOptions(it,ht,et)),{onUpdate:function(mt){var ft;ht.onUpdate(mt),(ft=it.onUpdate)===null||ft===void 0||ft.call(it,mt)},onComplete:function(){var mt;ht.onComplete(),(mt=it.onComplete)===null||mt===void 0||mt.call(it)}}))}function dt(){var ht,mt,ft=resolveFinalValueInKeyframes(tt);return o.set(ft),nt(),(ht=it==null?void 0:it.onUpdate)===null||ht===void 0||ht.call(it,ft),(mt=it==null?void 0:it.onComplete)===null||mt===void 0||mt.call(it),{stop:function(){}}}return!ct||!at||it.type===!1?dt:lt}function isZero(et){return et===0||typeof et=="string"&&parseFloat(et)===0&&et.indexOf(" ")===-1}function getZeroUnit(et){return typeof et=="number"?0:getAnimatableNone("",et)}function getValueTransition(et,o){return et[o]||et.default||et}function startAnimation(et,o,tt,rt){return rt===void 0&&(rt={}),o.start(function(nt){var ot,it,st=getAnimation(et,o,tt,rt,nt),at=getDelayFromTransition(rt,et),ct=function(){return it=st()};return at?ot=window.setTimeout(ct,secondsToMilliseconds(at)):ct(),function(){clearTimeout(ot),it==null||it.stop()}})}var isNumericalString=function(et){return/^\-?\d*\.?\d+$/.test(et)},isZeroValueString=function(et){return/^0[^.\s]+$/.test(et)};function addUniqueItem(et,o){et.indexOf(o)===-1&&et.push(o)}function removeItem(et,o){var tt=et.indexOf(o);tt>-1&&et.splice(tt,1)}var SubscriptionManager$1=function(){function et(){this.subscriptions=[]}return et.prototype.add=function(o){var tt=this;return addUniqueItem(this.subscriptions,o),function(){return removeItem(tt.subscriptions,o)}},et.prototype.notify=function(o,tt,rt){var nt=this.subscriptions.length;if(nt)if(nt===1)this.subscriptions[0](o,tt,rt);else for(var ot=0;ot<nt;ot++){var it=this.subscriptions[ot];it&&it(o,tt,rt)}},et.prototype.getSize=function(){return this.subscriptions.length},et.prototype.clear=function(){this.subscriptions.length=0},et}(),isFloat=function(et){return!isNaN(parseFloat(et))},MotionValue=function(){function et(o){var tt=this;this.version="6.5.1",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new SubscriptionManager$1,this.velocityUpdateSubscribers=new SubscriptionManager$1,this.renderSubscribers=new SubscriptionManager$1,this.canTrackVelocity=!1,this.updateAndNotify=function(rt,nt){nt===void 0&&(nt=!0),tt.prev=tt.current,tt.current=rt;var ot=getFrameData(),it=ot.delta,st=ot.timestamp;tt.lastUpdated!==st&&(tt.timeDelta=it,tt.lastUpdated=st,sync.postRender(tt.scheduleVelocityCheck)),tt.prev!==tt.current&&tt.updateSubscribers.notify(tt.current),tt.velocityUpdateSubscribers.getSize()&&tt.velocityUpdateSubscribers.notify(tt.getVelocity()),nt&&tt.renderSubscribers.notify(tt.current)},this.scheduleVelocityCheck=function(){return sync.postRender(tt.velocityCheck)},this.velocityCheck=function(rt){var nt=rt.timestamp;nt!==tt.lastUpdated&&(tt.prev=tt.current,tt.velocityUpdateSubscribers.notify(tt.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=o,this.canTrackVelocity=isFloat(this.current)}return et.prototype.onChange=function(o){return this.updateSubscribers.add(o)},et.prototype.clearListeners=function(){this.updateSubscribers.clear()},et.prototype.onRenderRequest=function(o){return o(this.get()),this.renderSubscribers.add(o)},et.prototype.attach=function(o){this.passiveEffect=o},et.prototype.set=function(o,tt){tt===void 0&&(tt=!0),!tt||!this.passiveEffect?this.updateAndNotify(o,tt):this.passiveEffect(o,this.updateAndNotify)},et.prototype.get=function(){return this.current},et.prototype.getPrevious=function(){return this.prev},et.prototype.getVelocity=function(){return this.canTrackVelocity?velocityPerSecond(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0},et.prototype.start=function(o){var tt=this;return this.stop(),new Promise(function(rt){tt.hasAnimated=!0,tt.stopAnimation=o(rt)}).then(function(){return tt.clearAnimation()})},et.prototype.stop=function(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()},et.prototype.isAnimating=function(){return!!this.stopAnimation},et.prototype.clearAnimation=function(){this.stopAnimation=null},et.prototype.destroy=function(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()},et}();function motionValue(et){return new MotionValue(et)}var testValueType=function(et){return function(o){return o.test(et)}},auto={test:function(et){return et==="auto"},parse:function(et){return et}},dimensionValueTypes=[number$3,px,percent,degrees,vw,vh,auto],findDimensionValueType=function(et){return dimensionValueTypes.find(testValueType(et))},valueTypes=__spreadArray(__spreadArray([],__read(dimensionValueTypes),!1),[color$1,complex],!1),findValueType=function(et){return valueTypes.find(testValueType(et))};function setMotionValue(et,o,tt){et.hasValue(o)?et.getValue(o).set(tt):et.addValue(o,motionValue(tt))}function setTarget(et,o){var tt=resolveVariant(et,o),rt=tt?et.makeTargetAnimatable(tt,!1):{},nt=rt.transitionEnd,ot=nt===void 0?{}:nt;rt.transition;var it=__rest(rt,["transitionEnd","transition"]);it=__assign(__assign({},it),ot);for(var st in it){var at=resolveFinalValueInKeyframes(it[st]);setMotionValue(et,st,at)}}function checkTargetForNewValues(et,o,tt){var rt,nt,ot,it,st=Object.keys(o).filter(function(mt){return!et.hasValue(mt)}),at=st.length;if(at)for(var ct=0;ct<at;ct++){var lt=st[ct],dt=o[lt],ht=null;Array.isArray(dt)&&(ht=dt[0]),ht===null&&(ht=(nt=(rt=tt[lt])!==null&&rt!==void 0?rt:et.readValue(lt))!==null&&nt!==void 0?nt:o[lt]),ht!=null&&(typeof ht=="string"&&(isNumericalString(ht)||isZeroValueString(ht))?ht=parseFloat(ht):!findValueType(ht)&&complex.test(dt)&&(ht=getAnimatableNone(lt,dt)),et.addValue(lt,motionValue(ht)),(ot=(it=tt)[lt])!==null&&ot!==void 0||(it[lt]=ht),et.setBaseTarget(lt,ht))}}function getOriginFromTransition(et,o){if(o){var tt=o[et]||o.default||o;return tt.from}}function getOrigin(et,o,tt){var rt,nt,ot={};for(var it in et)ot[it]=(rt=getOriginFromTransition(it,o))!==null&&rt!==void 0?rt:(nt=tt.getValue(it))===null||nt===void 0?void 0:nt.get();return ot}function animateVisualElement(et,o,tt){tt===void 0&&(tt={}),et.notifyAnimationStart(o);var rt;if(Array.isArray(o)){var nt=o.map(function(it){return animateVariant(et,it,tt)});rt=Promise.all(nt)}else if(typeof o=="string")rt=animateVariant(et,o,tt);else{var ot=typeof o=="function"?resolveVariant(et,o,tt.custom):o;rt=animateTarget(et,ot,tt)}return rt.then(function(){return et.notifyAnimationComplete(o)})}function animateVariant(et,o,tt){var rt;tt===void 0&&(tt={});var nt=resolveVariant(et,o,tt.custom),ot=(nt||{}).transition,it=ot===void 0?et.getDefaultTransition()||{}:ot;tt.transitionOverride&&(it=tt.transitionOverride);var st=nt?function(){return animateTarget(et,nt,tt)}:function(){return Promise.resolve()},at=!((rt=et.variantChildren)===null||rt===void 0)&&rt.size?function(mt){mt===void 0&&(mt=0);var ft=it.delayChildren,pt=ft===void 0?0:ft,yt=it.staggerChildren,gt=it.staggerDirection;return animateChildren(et,o,pt+mt,yt,gt,tt)}:function(){return Promise.resolve()},ct=it.when;if(ct){var lt=__read(ct==="beforeChildren"?[st,at]:[at,st],2),dt=lt[0],ht=lt[1];return dt().then(ht)}else return Promise.all([st(),at(tt.delay)])}function animateTarget(et,o,tt){var rt,nt=tt===void 0?{}:tt,ot=nt.delay,it=ot===void 0?0:ot,st=nt.transitionOverride,at=nt.type,ct=et.makeTargetAnimatable(o),lt=ct.transition,dt=lt===void 0?et.getDefaultTransition():lt,ht=ct.transitionEnd,mt=__rest(ct,["transition","transitionEnd"]);st&&(dt=st);var ft=[],pt=at&&((rt=et.animationState)===null||rt===void 0?void 0:rt.getState()[at]);for(var yt in mt){var gt=et.getValue(yt),bt=mt[yt];if(!(!gt||bt===void 0||pt&&shouldBlockAnimation(pt,yt))){var xt=__assign({delay:it},dt);et.shouldReduceMotion&&isTransformProp(yt)&&(xt=__assign(__assign({},xt),{type:!1,delay:0}));var vt=startAnimation(yt,gt,bt,xt);ft.push(vt)}}return Promise.all(ft).then(function(){ht&&setTarget(et,ht)})}function animateChildren(et,o,tt,rt,nt,ot){tt===void 0&&(tt=0),rt===void 0&&(rt=0),nt===void 0&&(nt=1);var it=[],st=(et.variantChildren.size-1)*rt,at=nt===1?function(ct){return ct===void 0&&(ct=0),ct*rt}:function(ct){return ct===void 0&&(ct=0),st-ct*rt};return Array.from(et.variantChildren).sort(sortByTreeOrder).forEach(function(ct,lt){it.push(animateVariant(ct,o,__assign(__assign({},ot),{delay:tt+at(lt)})).then(function(){return ct.notifyAnimationComplete(o)}))}),Promise.all(it)}function sortByTreeOrder(et,o){return et.sortNodePosition(o)}function shouldBlockAnimation(et,o){var tt=et.protectedKeys,rt=et.needsAnimating,nt=tt.hasOwnProperty(o)&&rt[o]!==!0;return rt[o]=!1,nt}var variantPriorityOrder=[AnimationType.Animate,AnimationType.InView,AnimationType.Focus,AnimationType.Hover,AnimationType.Tap,AnimationType.Drag,AnimationType.Exit],reversePriorityOrder=__spreadArray([],__read(variantPriorityOrder),!1).reverse(),numAnimationTypes=variantPriorityOrder.length;function animateList(et){return function(o){return Promise.all(o.map(function(tt){var rt=tt.animation,nt=tt.options;return animateVisualElement(et,rt,nt)}))}}function createAnimationState(et){var o=animateList(et),tt=createState$1(),rt={},nt=!0,ot=function(lt,dt){var ht=resolveVariant(et,dt);if(ht){ht.transition;var mt=ht.transitionEnd,ft=__rest(ht,["transition","transitionEnd"]);lt=__assign(__assign(__assign({},lt),ft),mt)}return lt};function it(lt){return rt[lt]!==void 0}function st(lt){o=lt(et)}function at(lt,dt){for(var ht,mt=et.getProps(),ft=et.getVariantContext(!0)||{},pt=[],yt=new Set,gt={},bt=1/0,xt=function(St){var At=reversePriorityOrder[St],kt=tt[At],It=(ht=mt[At])!==null&&ht!==void 0?ht:ft[At],Nt=isVariantLabel(It),Lt=At===dt?kt.isActive:null;Lt===!1&&(bt=St);var Mt=It===ft[At]&&It!==mt[At]&&Nt;if(Mt&&nt&&et.manuallyAnimateOnMount&&(Mt=!1),kt.protectedKeys=__assign({},gt),!kt.isActive&&Lt===null||!It&&!kt.prevProp||isAnimationControls(It)||typeof It=="boolean")return"continue";var zt=checkVariantsDidChange(kt.prevProp,It),Ut=zt||At===dt&&kt.isActive&&!Mt&&Nt||St>bt&&Nt,Xt=Array.isArray(It)?It:[It],Wt=Xt.reduce(ot,{});Lt===!1&&(Wt={});var Ft=kt.prevResolvedValues,qt=Ft===void 0?{}:Ft,Pt=__assign(__assign({},qt),Wt),Yt=function(rr){Ut=!0,yt.delete(rr),kt.needsAnimating[rr]=!0};for(var Qt in Pt){var jt=Wt[Qt],Gt=qt[Qt];gt.hasOwnProperty(Qt)||(jt!==Gt?isKeyframesTarget(jt)&&isKeyframesTarget(Gt)?!shallowCompare(jt,Gt)||zt?Yt(Qt):kt.protectedKeys[Qt]=!0:jt!==void 0?Yt(Qt):yt.add(Qt):jt!==void 0&&yt.has(Qt)?Yt(Qt):kt.protectedKeys[Qt]=!0)}kt.prevProp=It,kt.prevResolvedValues=Wt,kt.isActive&&(gt=__assign(__assign({},gt),Wt)),nt&&et.blockInitialAnimation&&(Ut=!1),Ut&&!Mt&&pt.push.apply(pt,__spreadArray([],__read(Xt.map(function(rr){return{animation:rr,options:__assign({type:At},lt)}})),!1))},vt=0;vt<numAnimationTypes;vt++)xt(vt);if(rt=__assign({},gt),yt.size){var Et={};yt.forEach(function(St){var At=et.getBaseTarget(St);At!==void 0&&(Et[St]=At)}),pt.push({animation:Et})}var Ct=!!pt.length;return nt&&mt.initial===!1&&!et.manuallyAnimateOnMount&&(Ct=!1),nt=!1,Ct?o(pt):Promise.resolve()}function ct(lt,dt,ht){var mt;if(tt[lt].isActive===dt)return Promise.resolve();(mt=et.variantChildren)===null||mt===void 0||mt.forEach(function(yt){var gt;return(gt=yt.animationState)===null||gt===void 0?void 0:gt.setActive(lt,dt)}),tt[lt].isActive=dt;var ft=at(ht,lt);for(var pt in tt)tt[pt].protectedKeys={};return ft}return{isAnimated:it,animateChanges:at,setActive:ct,setAnimateFunction:st,getState:function(){return tt}}}function checkVariantsDidChange(et,o){return typeof o=="string"?o!==et:isVariantLabels(o)?!shallowCompare(o,et):!1}function createTypeState(et){return et===void 0&&(et=!1),{isActive:et,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function createState$1(){var et;return et={},et[AnimationType.Animate]=createTypeState(!0),et[AnimationType.InView]=createTypeState(),et[AnimationType.Hover]=createTypeState(),et[AnimationType.Tap]=createTypeState(),et[AnimationType.Drag]=createTypeState(),et[AnimationType.Focus]=createTypeState(),et[AnimationType.Exit]=createTypeState(),et}var animations={animation:makeRenderlessComponent(function(et){var o=et.visualElement,tt=et.animate;o.animationState||(o.animationState=createAnimationState(o)),isAnimationControls(tt)&&reactExports.useEffect(function(){return tt.subscribe(o)},[tt])}),exit:makeRenderlessComponent(function(et){var o=et.custom,tt=et.visualElement,rt=__read(usePresence$1(),2),nt=rt[0],ot=rt[1],it=reactExports.useContext(PresenceContext);reactExports.useEffect(function(){var st,at;tt.isPresent=nt;var ct=(st=tt.animationState)===null||st===void 0?void 0:st.setActive(AnimationType.Exit,!nt,{custom:(at=it==null?void 0:it.custom)!==null&&at!==void 0?at:o});!nt&&(ct==null||ct.then(ot))},[nt])})},PanSession=function(){function et(o,tt,rt){var nt=this,ot=rt===void 0?{}:rt,it=ot.transformPagePoint;if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=function(){if(nt.lastMoveEvent&&nt.lastMoveEventInfo){var ht=getPanInfo(nt.lastMoveEventInfo,nt.history),mt=nt.startEvent!==null,ft=distance(ht.offset,{x:0,y:0})>=3;if(!(!mt&&!ft)){var pt=ht.point,yt=getFrameData().timestamp;nt.history.push(__assign(__assign({},pt),{timestamp:yt}));var gt=nt.handlers,bt=gt.onStart,xt=gt.onMove;mt||(bt&&bt(nt.lastMoveEvent,ht),nt.startEvent=nt.lastMoveEvent),xt&&xt(nt.lastMoveEvent,ht)}}},this.handlePointerMove=function(ht,mt){if(nt.lastMoveEvent=ht,nt.lastMoveEventInfo=transformPoint(mt,nt.transformPagePoint),isMouseEvent(ht)&&ht.buttons===0){nt.handlePointerUp(ht,mt);return}sync.update(nt.updatePoint,!0)},this.handlePointerUp=function(ht,mt){nt.end();var ft=nt.handlers,pt=ft.onEnd,yt=ft.onSessionEnd,gt=getPanInfo(transformPoint(mt,nt.transformPagePoint),nt.history);nt.startEvent&&pt&&pt(ht,gt),yt&&yt(ht,gt)},!(isTouchEvent(o)&&o.touches.length>1)){this.handlers=tt,this.transformPagePoint=it;var st=extractEventInfo(o),at=transformPoint(st,this.transformPagePoint),ct=at.point,lt=getFrameData().timestamp;this.history=[__assign(__assign({},ct),{timestamp:lt})];var dt=tt.onSessionStart;dt&&dt(o,getPanInfo(at,this.history)),this.removeListeners=pipe$1(addPointerEvent(window,"pointermove",this.handlePointerMove),addPointerEvent(window,"pointerup",this.handlePointerUp),addPointerEvent(window,"pointercancel",this.handlePointerUp))}}return et.prototype.updateHandlers=function(o){this.handlers=o},et.prototype.end=function(){this.removeListeners&&this.removeListeners(),cancelSync.update(this.updatePoint)},et}();function transformPoint(et,o){return o?{point:o(et.point)}:et}function subtractPoint(et,o){return{x:et.x-o.x,y:et.y-o.y}}function getPanInfo(et,o){var tt=et.point;return{point:tt,delta:subtractPoint(tt,lastDevicePoint(o)),offset:subtractPoint(tt,startDevicePoint(o)),velocity:getVelocity(o,.1)}}function startDevicePoint(et){return et[0]}function lastDevicePoint(et){return et[et.length-1]}function getVelocity(et,o){if(et.length<2)return{x:0,y:0};for(var tt=et.length-1,rt=null,nt=lastDevicePoint(et);tt>=0&&(rt=et[tt],!(nt.timestamp-rt.timestamp>secondsToMilliseconds(o)));)tt--;if(!rt)return{x:0,y:0};var ot=(nt.timestamp-rt.timestamp)/1e3;if(ot===0)return{x:0,y:0};var it={x:(nt.x-rt.x)/ot,y:(nt.y-rt.y)/ot};return it.x===1/0&&(it.x=0),it.y===1/0&&(it.y=0),it}function calcLength(et){return et.max-et.min}function isNear(et,o,tt){return o===void 0&&(o=0),tt===void 0&&(tt=.01),distance(et,o)<tt}function calcAxisDelta(et,o,tt,rt){rt===void 0&&(rt=.5),et.origin=rt,et.originPoint=mix(o.min,o.max,et.origin),et.scale=calcLength(tt)/calcLength(o),(isNear(et.scale,1,1e-4)||isNaN(et.scale))&&(et.scale=1),et.translate=mix(tt.min,tt.max,et.origin)-et.originPoint,(isNear(et.translate)||isNaN(et.translate))&&(et.translate=0)}function calcBoxDelta(et,o,tt,rt){calcAxisDelta(et.x,o.x,tt.x,rt==null?void 0:rt.originX),calcAxisDelta(et.y,o.y,tt.y,rt==null?void 0:rt.originY)}function calcRelativeAxis(et,o,tt){et.min=tt.min+o.min,et.max=et.min+calcLength(o)}function calcRelativeBox(et,o,tt){calcRelativeAxis(et.x,o.x,tt.x),calcRelativeAxis(et.y,o.y,tt.y)}function calcRelativeAxisPosition(et,o,tt){et.min=o.min-tt.min,et.max=et.min+calcLength(o)}function calcRelativePosition(et,o,tt){calcRelativeAxisPosition(et.x,o.x,tt.x),calcRelativeAxisPosition(et.y,o.y,tt.y)}function applyConstraints(et,o,tt){var rt=o.min,nt=o.max;return rt!==void 0&&et<rt?et=tt?mix(rt,et,tt.min):Math.max(et,rt):nt!==void 0&&et>nt&&(et=tt?mix(nt,et,tt.max):Math.min(et,nt)),et}function calcRelativeAxisConstraints(et,o,tt){return{min:o!==void 0?et.min+o:void 0,max:tt!==void 0?et.max+tt-(et.max-et.min):void 0}}function calcRelativeConstraints(et,o){var tt=o.top,rt=o.left,nt=o.bottom,ot=o.right;return{x:calcRelativeAxisConstraints(et.x,rt,ot),y:calcRelativeAxisConstraints(et.y,tt,nt)}}function calcViewportAxisConstraints(et,o){var tt,rt=o.min-et.min,nt=o.max-et.max;return o.max-o.min<et.max-et.min&&(tt=__read([nt,rt],2),rt=tt[0],nt=tt[1]),{min:rt,max:nt}}function calcViewportConstraints(et,o){return{x:calcViewportAxisConstraints(et.x,o.x),y:calcViewportAxisConstraints(et.y,o.y)}}function calcOrigin(et,o){var tt=.5,rt=calcLength(et),nt=calcLength(o);return nt>rt?tt=progress(o.min,o.max-rt,et.min):rt>nt&&(tt=progress(et.min,et.max-nt,o.min)),clamp$1(0,1,tt)}function rebaseAxisConstraints(et,o){var tt={};return o.min!==void 0&&(tt.min=o.min-et.min),o.max!==void 0&&(tt.max=o.max-et.min),tt}var defaultElastic=.35;function resolveDragElastic(et){return et===void 0&&(et=defaultElastic),et===!1?et=0:et===!0&&(et=defaultElastic),{x:resolveAxisElastic(et,"left","right"),y:resolveAxisElastic(et,"top","bottom")}}function resolveAxisElastic(et,o,tt){return{min:resolvePointElastic(et,o),max:resolvePointElastic(et,tt)}}function resolvePointElastic(et,o){var tt;return typeof et=="number"?et:(tt=et[o])!==null&&tt!==void 0?tt:0}var createAxisDelta=function(){return{translate:0,scale:1,origin:0,originPoint:0}},createDelta=function(){return{x:createAxisDelta(),y:createAxisDelta()}},createAxis=function(){return{min:0,max:0}},createBox=function(){return{x:createAxis(),y:createAxis()}};function eachAxis(et){return[et("x"),et("y")]}function convertBoundingBoxToBox(et){var o=et.top,tt=et.left,rt=et.right,nt=et.bottom;return{x:{min:tt,max:rt},y:{min:o,max:nt}}}function convertBoxToBoundingBox(et){var o=et.x,tt=et.y;return{top:tt.min,right:o.max,bottom:tt.max,left:o.min}}function transformBoxPoints(et,o){if(!o)return et;var tt=o({x:et.left,y:et.top}),rt=o({x:et.right,y:et.bottom});return{top:tt.y,left:tt.x,bottom:rt.y,right:rt.x}}function isIdentityScale(et){return et===void 0||et===1}function hasScale(et){var o=et.scale,tt=et.scaleX,rt=et.scaleY;return!isIdentityScale(o)||!isIdentityScale(tt)||!isIdentityScale(rt)}function hasTransform(et){return hasScale(et)||hasTranslate(et.x)||hasTranslate(et.y)||et.z||et.rotate||et.rotateX||et.rotateY}function hasTranslate(et){return et&&et!=="0%"}function scalePoint(et,o,tt){var rt=et-tt,nt=o*rt;return tt+nt}function applyPointDelta(et,o,tt,rt,nt){return nt!==void 0&&(et=scalePoint(et,nt,rt)),scalePoint(et,tt,rt)+o}function applyAxisDelta(et,o,tt,rt,nt){o===void 0&&(o=0),tt===void 0&&(tt=1),et.min=applyPointDelta(et.min,o,tt,rt,nt),et.max=applyPointDelta(et.max,o,tt,rt,nt)}function applyBoxDelta(et,o){var tt=o.x,rt=o.y;applyAxisDelta(et.x,tt.translate,tt.scale,tt.originPoint),applyAxisDelta(et.y,rt.translate,rt.scale,rt.originPoint)}function applyTreeDeltas(et,o,tt,rt){var nt,ot;rt===void 0&&(rt=!1);var it=tt.length;if(it){o.x=o.y=1;for(var st,at,ct=0;ct<it;ct++)st=tt[ct],at=st.projectionDelta,((ot=(nt=st.instance)===null||nt===void 0?void 0:nt.style)===null||ot===void 0?void 0:ot.display)!=="contents"&&(rt&&st.options.layoutScroll&&st.scroll&&st!==st.root&&transformBox(et,{x:-st.scroll.x,y:-st.scroll.y}),at&&(o.x*=at.x.scale,o.y*=at.y.scale,applyBoxDelta(et,at)),rt&&hasTransform(st.latestValues)&&transformBox(et,st.latestValues))}}function translateAxis(et,o){et.min=et.min+o,et.max=et.max+o}function transformAxis(et,o,tt){var rt=__read(tt,3),nt=rt[0],ot=rt[1],it=rt[2],st=o[it]!==void 0?o[it]:.5,at=mix(et.min,et.max,st);applyAxisDelta(et,o[nt],o[ot],at,o.scale)}var xKeys$1=["x","scaleX","originX"],yKeys$1=["y","scaleY","originY"];function transformBox(et,o){transformAxis(et.x,o,xKeys$1),transformAxis(et.y,o,yKeys$1)}function measureViewportBox(et,o){return convertBoundingBoxToBox(transformBoxPoints(et.getBoundingClientRect(),o))}function measurePageBox(et,o,tt){var rt=measureViewportBox(et,tt),nt=o.scroll;return nt&&(translateAxis(rt.x,nt.x),translateAxis(rt.y,nt.y)),rt}var elementDragControls=new WeakMap,VisualElementDragControls=function(){function et(o){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=createBox(),this.visualElement=o}return et.prototype.start=function(o,tt){var rt=this,nt=tt===void 0?{}:tt,ot=nt.snapToCursor,it=ot===void 0?!1:ot;if(this.visualElement.isPresent!==!1){var st=function(dt){rt.stopAnimation(),it&&rt.snapToCursor(extractEventInfo(dt,"page").point)},at=function(dt,ht){var mt,ft=rt.getProps(),pt=ft.drag,yt=ft.dragPropagation,gt=ft.onDragStart;pt&&!yt&&(rt.openGlobalLock&&rt.openGlobalLock(),rt.openGlobalLock=getGlobalLock(pt),!rt.openGlobalLock)||(rt.isDragging=!0,rt.currentDirection=null,rt.resolveConstraints(),rt.visualElement.projection&&(rt.visualElement.projection.isAnimationBlocked=!0,rt.visualElement.projection.target=void 0),eachAxis(function(bt){var xt,vt,Et=rt.getAxisMotionValue(bt).get()||0;if(percent.test(Et)){var Ct=(vt=(xt=rt.visualElement.projection)===null||xt===void 0?void 0:xt.layout)===null||vt===void 0?void 0:vt.actual[bt];if(Ct){var St=calcLength(Ct);Et=St*(parseFloat(Et)/100)}}rt.originPoint[bt]=Et}),gt==null||gt(dt,ht),(mt=rt.visualElement.animationState)===null||mt===void 0||mt.setActive(AnimationType.Drag,!0))},ct=function(dt,ht){var mt=rt.getProps(),ft=mt.dragPropagation,pt=mt.dragDirectionLock,yt=mt.onDirectionLock,gt=mt.onDrag;if(!(!ft&&!rt.openGlobalLock)){var bt=ht.offset;if(pt&&rt.currentDirection===null){rt.currentDirection=getCurrentDirection(bt),rt.currentDirection!==null&&(yt==null||yt(rt.currentDirection));return}rt.updateAxis("x",ht.point,bt),rt.updateAxis("y",ht.point,bt),rt.visualElement.syncRender(),gt==null||gt(dt,ht)}},lt=function(dt,ht){return rt.stop(dt,ht)};this.panSession=new PanSession(o,{onSessionStart:st,onStart:at,onMove:ct,onSessionEnd:lt},{transformPagePoint:this.visualElement.getTransformPagePoint()})}},et.prototype.stop=function(o,tt){var rt=this.isDragging;if(this.cancel(),!!rt){var nt=tt.velocity;this.startAnimation(nt);var ot=this.getProps().onDragEnd;ot==null||ot(o,tt)}},et.prototype.cancel=function(){var o,tt;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),(o=this.panSession)===null||o===void 0||o.end(),this.panSession=void 0;var rt=this.getProps().dragPropagation;!rt&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),(tt=this.visualElement.animationState)===null||tt===void 0||tt.setActive(AnimationType.Drag,!1)},et.prototype.updateAxis=function(o,tt,rt){var nt=this.getProps().drag;if(!(!rt||!shouldDrag(o,nt,this.currentDirection))){var ot=this.getAxisMotionValue(o),it=this.originPoint[o]+rt[o];this.constraints&&this.constraints[o]&&(it=applyConstraints(it,this.constraints[o],this.elastic[o])),ot.set(it)}},et.prototype.resolveConstraints=function(){var o=this,tt=this.getProps(),rt=tt.dragConstraints,nt=tt.dragElastic,ot=(this.visualElement.projection||{}).layout,it=this.constraints;rt&&isRefObject(rt)?this.constraints||(this.constraints=this.resolveRefConstraints()):rt&&ot?this.constraints=calcRelativeConstraints(ot.actual,rt):this.constraints=!1,this.elastic=resolveDragElastic(nt),it!==this.constraints&&ot&&this.constraints&&!this.hasMutatedConstraints&&eachAxis(function(st){o.getAxisMotionValue(st)&&(o.constraints[st]=rebaseAxisConstraints(ot.actual[st],o.constraints[st]))})},et.prototype.resolveRefConstraints=function(){var o=this.getProps(),tt=o.dragConstraints,rt=o.onMeasureDragConstraints;if(!tt||!isRefObject(tt))return!1;var nt=tt.current,ot=this.visualElement.projection;if(!ot||!ot.layout)return!1;var it=measurePageBox(nt,ot.root,this.visualElement.getTransformPagePoint()),st=calcViewportConstraints(ot.layout.actual,it);if(rt){var at=rt(convertBoxToBoundingBox(st));this.hasMutatedConstraints=!!at,at&&(st=convertBoundingBoxToBox(at))}return st},et.prototype.startAnimation=function(o){var tt=this,rt=this.getProps(),nt=rt.drag,ot=rt.dragMomentum,it=rt.dragElastic,st=rt.dragTransition,at=rt.dragSnapToOrigin,ct=rt.onDragTransitionEnd,lt=this.constraints||{},dt=eachAxis(function(ht){var mt;if(shouldDrag(ht,nt,tt.currentDirection)){var ft=(mt=lt==null?void 0:lt[ht])!==null&&mt!==void 0?mt:{};at&&(ft={min:0,max:0});var pt=it?200:1e6,yt=it?40:1e7,gt=__assign(__assign({type:"inertia",velocity:ot?o[ht]:0,bounceStiffness:pt,bounceDamping:yt,timeConstant:750,restDelta:1,restSpeed:10},st),ft);return tt.startAxisValueAnimation(ht,gt)}});return Promise.all(dt).then(ct)},et.prototype.startAxisValueAnimation=function(o,tt){var rt=this.getAxisMotionValue(o);return startAnimation(o,rt,0,tt)},et.prototype.stopAnimation=function(){var o=this;eachAxis(function(tt){return o.getAxisMotionValue(tt).stop()})},et.prototype.getAxisMotionValue=function(o){var tt,rt,nt="_drag"+o.toUpperCase(),ot=this.visualElement.getProps()[nt];return ot||this.visualElement.getValue(o,(rt=(tt=this.visualElement.getProps().initial)===null||tt===void 0?void 0:tt[o])!==null&&rt!==void 0?rt:0)},et.prototype.snapToCursor=function(o){var tt=this;eachAxis(function(rt){var nt=tt.getProps().drag;if(shouldDrag(rt,nt,tt.currentDirection)){var ot=tt.visualElement.projection,it=tt.getAxisMotionValue(rt);if(ot&&ot.layout){var st=ot.layout.actual[rt],at=st.min,ct=st.max;it.set(o[rt]-mix(at,ct,.5))}}})},et.prototype.scalePositionWithinConstraints=function(){var o=this,tt,rt=this.getProps(),nt=rt.drag,ot=rt.dragConstraints,it=this.visualElement.projection;if(!(!isRefObject(ot)||!it||!this.constraints)){this.stopAnimation();var st={x:0,y:0};eachAxis(function(ct){var lt=o.getAxisMotionValue(ct);if(lt){var dt=lt.get();st[ct]=calcOrigin({min:dt,max:dt},o.constraints[ct])}});var at=this.visualElement.getProps().transformTemplate;this.visualElement.getInstance().style.transform=at?at({},""):"none",(tt=it.root)===null||tt===void 0||tt.updateScroll(),it.updateLayout(),this.resolveConstraints(),eachAxis(function(ct){if(shouldDrag(ct,nt,null)){var lt=o.getAxisMotionValue(ct),dt=o.constraints[ct],ht=dt.min,mt=dt.max;lt.set(mix(ht,mt,st[ct]))}})}},et.prototype.addListeners=function(){var o=this,tt;elementDragControls.set(this.visualElement,this);var rt=this.visualElement.getInstance(),nt=addPointerEvent(rt,"pointerdown",function(ct){var lt=o.getProps(),dt=lt.drag,ht=lt.dragListener,mt=ht===void 0?!0:ht;dt&&mt&&o.start(ct)}),ot=function(){var ct=o.getProps().dragConstraints;isRefObject(ct)&&(o.constraints=o.resolveRefConstraints())},it=this.visualElement.projection,st=it.addEventListener("measure",ot);it&&!it.layout&&((tt=it.root)===null||tt===void 0||tt.updateScroll(),it.updateLayout()),ot();var at=addDomEvent(window,"resize",function(){return o.scalePositionWithinConstraints()});return it.addEventListener("didUpdate",function(ct){var lt=ct.delta,dt=ct.hasLayoutChanged;o.isDragging&&dt&&(eachAxis(function(ht){var mt=o.getAxisMotionValue(ht);mt&&(o.originPoint[ht]+=lt[ht].translate,mt.set(mt.get()+lt[ht].translate))}),o.visualElement.syncRender())}),function(){at(),nt(),st()}},et.prototype.getProps=function(){var o=this.visualElement.getProps(),tt=o.drag,rt=tt===void 0?!1:tt,nt=o.dragDirectionLock,ot=nt===void 0?!1:nt,it=o.dragPropagation,st=it===void 0?!1:it,at=o.dragConstraints,ct=at===void 0?!1:at,lt=o.dragElastic,dt=lt===void 0?defaultElastic:lt,ht=o.dragMomentum,mt=ht===void 0?!0:ht;return __assign(__assign({},o),{drag:rt,dragDirectionLock:ot,dragPropagation:st,dragConstraints:ct,dragElastic:dt,dragMomentum:mt})},et}();function shouldDrag(et,o,tt){return(o===!0||o===et)&&(tt===null||tt===et)}function getCurrentDirection(et,o){o===void 0&&(o=10);var tt=null;return Math.abs(et.y)>o?tt="y":Math.abs(et.x)>o&&(tt="x"),tt}function useDrag(et){var o=et.dragControls,tt=et.visualElement,rt=useConstant(function(){return new VisualElementDragControls(tt)});reactExports.useEffect(function(){return o&&o.subscribe(rt)},[rt,o]),reactExports.useEffect(function(){return rt.addListeners()},[rt])}function usePanGesture(et){var o=et.onPan,tt=et.onPanStart,rt=et.onPanEnd,nt=et.onPanSessionStart,ot=et.visualElement,it=o||tt||rt||nt,st=reactExports.useRef(null),at=reactExports.useContext(MotionConfigContext).transformPagePoint,ct={onSessionStart:nt,onStart:tt,onMove:o,onEnd:function(dt,ht){st.current=null,rt&&rt(dt,ht)}};reactExports.useEffect(function(){st.current!==null&&st.current.updateHandlers(ct)});function lt(dt){st.current=new PanSession(dt,ct,{transformPagePoint:at})}usePointerEvent(ot,"pointerdown",it&&lt),useUnmountEffect(function(){return st.current&&st.current.end()})}var drag={pan:makeRenderlessComponent(usePanGesture),drag:makeRenderlessComponent(useDrag)},names$1=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","LayoutAnimationStart","SetAxisTarget","Unmount"];function createLifecycles(){var et=names$1.map(function(){return new SubscriptionManager$1}),o={},tt={clearAllListeners:function(){return et.forEach(function(rt){return rt.clear()})},updatePropListeners:function(rt){names$1.forEach(function(nt){var ot,it="on"+nt,st=rt[it];(ot=o[nt])===null||ot===void 0||ot.call(o),st&&(o[nt]=tt[it](st))})}};return et.forEach(function(rt,nt){tt["on"+names$1[nt]]=function(ot){return rt.add(ot)},tt["notify"+names$1[nt]]=function(){for(var ot=[],it=0;it<arguments.length;it++)ot[it]=arguments[it];return rt.notify.apply(rt,__spreadArray([],__read(ot),!1))}}),tt}function updateMotionValuesFromProps(et,o,tt){var rt;for(var nt in o){var ot=o[nt],it=tt[nt];if(isMotionValue(ot))et.addValue(nt,ot);else if(isMotionValue(it))et.addValue(nt,motionValue(ot));else if(it!==ot)if(et.hasValue(nt)){var st=et.getValue(nt);!st.hasAnimated&&st.set(ot)}else et.addValue(nt,motionValue((rt=et.getStaticValue(nt))!==null&&rt!==void 0?rt:ot))}for(var nt in tt)o[nt]===void 0&&et.removeValue(nt);return o}var visualElement=function(et){var o=et.treeType,tt=o===void 0?"":o,rt=et.build,nt=et.getBaseTarget,ot=et.makeTargetAnimatable,it=et.measureViewportBox,st=et.render,at=et.readValueFromInstance,ct=et.removeValueFromRenderState,lt=et.sortNodePosition,dt=et.scrapeMotionValuesFromProps;return function(ht,mt){var ft=ht.parent,pt=ht.props,yt=ht.presenceId,gt=ht.blockInitialAnimation,bt=ht.visualState,xt=ht.shouldReduceMotion;mt===void 0&&(mt={});var vt=!1,Et=bt.latestValues,Ct=bt.renderState,St,At=createLifecycles(),kt=new Map,It=new Map,Nt={},Lt=__assign({},Et),Mt;function zt(){!St||!vt||(Ut(),st(St,Ct,pt.style,jt.projection))}function Ut(){rt(jt,Ct,Et,mt,pt)}function Xt(){At.notifyUpdate(Et)}function Wt(Gt,rr){var Ht=rr.onChange(function(Zt){Et[Gt]=Zt,pt.onUpdate&&sync.update(Xt,!1,!0)}),dr=rr.onRenderRequest(jt.scheduleRender);It.set(Gt,function(){Ht(),dr()})}var Ft=dt(pt);for(var qt in Ft){var Pt=Ft[qt];Et[qt]!==void 0&&isMotionValue(Pt)&&Pt.set(Et[qt],!1)}var Yt=checkIfControllingVariants(pt),Qt=checkIfVariantNode(pt),jt=__assign(__assign({treeType:tt,current:null,depth:ft?ft.depth+1:0,parent:ft,children:new Set,presenceId:yt,shouldReduceMotion:xt,variantChildren:Qt?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:!!(ft!=null&&ft.isMounted()),blockInitialAnimation:gt,isMounted:function(){return!!St},mount:function(Gt){vt=!0,St=jt.current=Gt,jt.projection&&jt.projection.mount(Gt),Qt&&ft&&!Yt&&(Mt=ft==null?void 0:ft.addVariantChild(jt)),kt.forEach(function(rr,Ht){return Wt(Ht,rr)}),ft==null||ft.children.add(jt),jt.setProps(pt)},unmount:function(){var Gt;(Gt=jt.projection)===null||Gt===void 0||Gt.unmount(),cancelSync.update(Xt),cancelSync.render(zt),It.forEach(function(rr){return rr()}),Mt==null||Mt(),ft==null||ft.children.delete(jt),At.clearAllListeners(),St=void 0,vt=!1},addVariantChild:function(Gt){var rr,Ht=jt.getClosestVariantNode();if(Ht)return(rr=Ht.variantChildren)===null||rr===void 0||rr.add(Gt),function(){return Ht.variantChildren.delete(Gt)}},sortNodePosition:function(Gt){return!lt||tt!==Gt.treeType?0:lt(jt.getInstance(),Gt.getInstance())},getClosestVariantNode:function(){return Qt?jt:ft==null?void 0:ft.getClosestVariantNode()},getLayoutId:function(){return pt.layoutId},getInstance:function(){return St},getStaticValue:function(Gt){return Et[Gt]},setStaticValue:function(Gt,rr){return Et[Gt]=rr},getLatestValues:function(){return Et},setVisibility:function(Gt){jt.isVisible!==Gt&&(jt.isVisible=Gt,jt.scheduleRender())},makeTargetAnimatable:function(Gt,rr){return rr===void 0&&(rr=!0),ot(jt,Gt,pt,rr)},measureViewportBox:function(){return it(St,pt)},addValue:function(Gt,rr){jt.hasValue(Gt)&&jt.removeValue(Gt),kt.set(Gt,rr),Et[Gt]=rr.get(),Wt(Gt,rr)},removeValue:function(Gt){var rr;kt.delete(Gt),(rr=It.get(Gt))===null||rr===void 0||rr(),It.delete(Gt),delete Et[Gt],ct(Gt,Ct)},hasValue:function(Gt){return kt.has(Gt)},getValue:function(Gt,rr){var Ht=kt.get(Gt);return Ht===void 0&&rr!==void 0&&(Ht=motionValue(rr),jt.addValue(Gt,Ht)),Ht},forEachValue:function(Gt){return kt.forEach(Gt)},readValue:function(Gt){var rr;return(rr=Et[Gt])!==null&&rr!==void 0?rr:at(St,Gt,mt)},setBaseTarget:function(Gt,rr){Lt[Gt]=rr},getBaseTarget:function(Gt){if(nt){var rr=nt(pt,Gt);if(rr!==void 0&&!isMotionValue(rr))return rr}return Lt[Gt]}},At),{build:function(){return Ut(),Ct},scheduleRender:function(){sync.render(zt,!1,!0)},syncRender:zt,setProps:function(Gt){(Gt.transformTemplate||pt.transformTemplate)&&jt.scheduleRender(),pt=Gt,At.updatePropListeners(Gt),Nt=updateMotionValuesFromProps(jt,dt(pt),Nt)},getProps:function(){return pt},getVariant:function(Gt){var rr;return(rr=pt.variants)===null||rr===void 0?void 0:rr[Gt]},getDefaultTransition:function(){return pt.transition},getTransformPagePoint:function(){return pt.transformPagePoint},getVariantContext:function(Gt){if(Gt===void 0&&(Gt=!1),Gt)return ft==null?void 0:ft.getVariantContext();if(!Yt){var rr=(ft==null?void 0:ft.getVariantContext())||{};return pt.initial!==void 0&&(rr.initial=pt.initial),rr}for(var Ht={},dr=0;dr<numVariantProps;dr++){var Zt=variantProps[dr],Jt=pt[Zt];(isVariantLabel(Jt)||Jt===!1)&&(Ht[Zt]=Jt)}return Ht}});return jt}},variantProps=__spreadArray(["initial"],__read(variantPriorityOrder),!1),numVariantProps=variantProps.length;function isCSSVariable(et){return typeof et=="string"&&et.startsWith("var(--")}var cssVariableRegex=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function parseCSSVariable(et){var o=cssVariableRegex.exec(et);if(!o)return[,];var tt=__read(o,3),rt=tt[1],nt=tt[2];return[rt,nt]}function getVariableValue(et,o,tt){var rt=__read(parseCSSVariable(et),2),nt=rt[0],ot=rt[1];if(nt){var it=window.getComputedStyle(o).getPropertyValue(nt);return it?it.trim():isCSSVariable(ot)?getVariableValue(ot,o):ot}}function resolveCSSVariables(et,o,tt){var rt,nt=__rest(o,[]),ot=et.getInstance();if(!(ot instanceof Element))return{target:nt,transitionEnd:tt};tt&&(tt=__assign({},tt)),et.forEachValue(function(ct){var lt=ct.get();if(isCSSVariable(lt)){var dt=getVariableValue(lt,ot);dt&&ct.set(dt)}});for(var it in nt){var st=nt[it];if(isCSSVariable(st)){var at=getVariableValue(st,ot);at&&(nt[it]=at,tt&&((rt=tt[it])!==null&&rt!==void 0||(tt[it]=st)))}}return{target:nt,transitionEnd:tt}}var positionalKeys=new Set(["width","height","top","left","right","bottom","x","y"]),isPositionalKey=function(et){return positionalKeys.has(et)},hasPositionalKey=function(et){return Object.keys(et).some(isPositionalKey)},setAndResetVelocity=function(et,o){et.set(o,!1),et.set(o)},isNumOrPxType=function(et){return et===number$3||et===px},BoundingBoxDimension;(function(et){et.width="width",et.height="height",et.left="left",et.right="right",et.top="top",et.bottom="bottom"})(BoundingBoxDimension||(BoundingBoxDimension={}));var getPosFromMatrix=function(et,o){return parseFloat(et.split(", ")[o])},getTranslateFromMatrix=function(et,o){return function(tt,rt){var nt=rt.transform;if(nt==="none"||!nt)return 0;var ot=nt.match(/^matrix3d\((.+)\)$/);if(ot)return getPosFromMatrix(ot[1],o);var it=nt.match(/^matrix\((.+)\)$/);return it?getPosFromMatrix(it[1],et):0}},transformKeys=new Set(["x","y","z"]),nonTranslationalTransformKeys=transformProps.filter(function(et){return!transformKeys.has(et)});function removeNonTranslationalTransform(et){var o=[];return nonTranslationalTransformKeys.forEach(function(tt){var rt=et.getValue(tt);rt!==void 0&&(o.push([tt,rt.get()]),rt.set(tt.startsWith("scale")?1:0))}),o.length&&et.syncRender(),o}var positionalValues={width:function(et,o){var tt=et.x,rt=o.paddingLeft,nt=rt===void 0?"0":rt,ot=o.paddingRight,it=ot===void 0?"0":ot;return tt.max-tt.min-parseFloat(nt)-parseFloat(it)},height:function(et,o){var tt=et.y,rt=o.paddingTop,nt=rt===void 0?"0":rt,ot=o.paddingBottom,it=ot===void 0?"0":ot;return tt.max-tt.min-parseFloat(nt)-parseFloat(it)},top:function(et,o){var tt=o.top;return parseFloat(tt)},left:function(et,o){var tt=o.left;return parseFloat(tt)},bottom:function(et,o){var tt=et.y,rt=o.top;return parseFloat(rt)+(tt.max-tt.min)},right:function(et,o){var tt=et.x,rt=o.left;return parseFloat(rt)+(tt.max-tt.min)},x:getTranslateFromMatrix(4,13),y:getTranslateFromMatrix(5,14)},convertChangedValueTypes=function(et,o,tt){var rt=o.measureViewportBox(),nt=o.getInstance(),ot=getComputedStyle(nt),it=ot.display,st={};it==="none"&&o.setStaticValue("display",et.display||"block"),tt.forEach(function(ct){st[ct]=positionalValues[ct](rt,ot)}),o.syncRender();var at=o.measureViewportBox();return tt.forEach(function(ct){var lt=o.getValue(ct);setAndResetVelocity(lt,st[ct]),et[ct]=positionalValues[ct](at,ot)}),et},checkAndConvertChangedValueTypes=function(et,o,tt,rt){tt===void 0&&(tt={}),rt===void 0&&(rt={}),o=__assign({},o),rt=__assign({},rt);var nt=Object.keys(o).filter(isPositionalKey),ot=[],it=!1,st=[];if(nt.forEach(function(lt){var dt=et.getValue(lt);if(et.hasValue(lt)){var ht=tt[lt],mt=findDimensionValueType(ht),ft=o[lt],pt;if(isKeyframesTarget(ft)){var yt=ft.length,gt=ft[0]===null?1:0;ht=ft[gt],mt=findDimensionValueType(ht);for(var bt=gt;bt<yt;bt++)pt?invariant$1(findDimensionValueType(ft[bt])===pt):pt=findDimensionValueType(ft[bt])}else pt=findDimensionValueType(ft);if(mt!==pt)if(isNumOrPxType(mt)&&isNumOrPxType(pt)){var xt=dt.get();typeof xt=="string"&&dt.set(parseFloat(xt)),typeof ft=="string"?o[lt]=parseFloat(ft):Array.isArray(ft)&&pt===px&&(o[lt]=ft.map(parseFloat))}else mt!=null&&mt.transform&&(pt!=null&&pt.transform)&&(ht===0||ft===0)?ht===0?dt.set(pt.transform(ht)):o[lt]=mt.transform(ft):(it||(ot=removeNonTranslationalTransform(et),it=!0),st.push(lt),rt[lt]=rt[lt]!==void 0?rt[lt]:o[lt],setAndResetVelocity(dt,ft))}}),st.length){var at=st.indexOf("height")>=0?window.pageYOffset:null,ct=convertChangedValueTypes(o,et,st);return ot.length&&ot.forEach(function(lt){var dt=__read(lt,2),ht=dt[0],mt=dt[1];et.getValue(ht).set(mt)}),et.syncRender(),at!==null&&window.scrollTo({top:at}),{target:ct,transitionEnd:rt}}else return{target:o,transitionEnd:rt}};function unitConversion(et,o,tt,rt){return hasPositionalKey(o)?checkAndConvertChangedValueTypes(et,o,tt,rt):{target:o,transitionEnd:rt}}var parseDomVariant=function(et,o,tt,rt){var nt=resolveCSSVariables(et,o,rt);return o=nt.target,rt=nt.transitionEnd,unitConversion(et,o,tt,rt)};function getComputedStyle$1(et){return window.getComputedStyle(et)}var htmlConfig={treeType:"dom",readValueFromInstance:function(et,o){if(isTransformProp(o)){var tt=getDefaultValueType(o);return tt&&tt.default||0}else{var rt=getComputedStyle$1(et);return(isCSSVariable$1(o)?rt.getPropertyValue(o):rt[o])||0}},sortNodePosition:function(et,o){return et.compareDocumentPosition(o)&2?1:-1},getBaseTarget:function(et,o){var tt;return(tt=et.style)===null||tt===void 0?void 0:tt[o]},measureViewportBox:function(et,o){var tt=o.transformPagePoint;return measureViewportBox(et,tt)},resetTransform:function(et,o,tt){var rt=tt.transformTemplate;o.style.transform=rt?rt({},""):"none",et.scheduleRender()},restoreTransform:function(et,o){et.style.transform=o.style.transform},removeValueFromRenderState:function(et,o){var tt=o.vars,rt=o.style;delete tt[et],delete rt[et]},makeTargetAnimatable:function(et,o,tt,rt){var nt=tt.transformValues;rt===void 0&&(rt=!0);var ot=o.transition,it=o.transitionEnd,st=__rest(o,["transition","transitionEnd"]),at=getOrigin(st,ot||{},et);if(nt&&(it&&(it=nt(it)),st&&(st=nt(st)),at&&(at=nt(at))),rt){checkTargetForNewValues(et,st,at);var ct=parseDomVariant(et,st,at,it);it=ct.transitionEnd,st=ct.target}return __assign({transition:ot,transitionEnd:it},st)},scrapeMotionValuesFromProps:scrapeMotionValuesFromProps$1,build:function(et,o,tt,rt,nt){et.isVisible!==void 0&&(o.style.visibility=et.isVisible?"visible":"hidden"),buildHTMLStyles(o,tt,rt,nt.transformTemplate)},render:renderHTML},htmlVisualElement=visualElement(htmlConfig),svgVisualElement=visualElement(__assign(__assign({},htmlConfig),{getBaseTarget:function(et,o){return et[o]},readValueFromInstance:function(et,o){var tt;return isTransformProp(o)?((tt=getDefaultValueType(o))===null||tt===void 0?void 0:tt.default)||0:(o=camelCaseAttributes.has(o)?o:camelToDash(o),et.getAttribute(o))},scrapeMotionValuesFromProps,build:function(et,o,tt,rt,nt){buildSVGAttrs(o,tt,rt,nt.transformTemplate)},render:renderSVG})),createDomVisualElement=function(et,o){return isSVGComponent(et)?svgVisualElement(o,{enableHardwareAcceleration:!1}):htmlVisualElement(o,{enableHardwareAcceleration:!0})};function pixelsToPercent(et,o){return o.max===o.min?0:et/(o.max-o.min)*100}var correctBorderRadius={correct:function(et,o){if(!o.target)return et;if(typeof et=="string")if(px.test(et))et=parseFloat(et);else return et;var tt=pixelsToPercent(et,o.target.x),rt=pixelsToPercent(et,o.target.y);return"".concat(tt,"% ").concat(rt,"%")}},varToken="_$css",correctBoxShadow={correct:function(et,o){var tt=o.treeScale,rt=o.projectionDelta,nt=et,ot=et.includes("var("),it=[];ot&&(et=et.replace(cssVariableRegex,function(pt){return it.push(pt),varToken}));var st=complex.parse(et);if(st.length>5)return nt;var at=complex.createTransformer(et),ct=typeof st[0]!="number"?1:0,lt=rt.x.scale*tt.x,dt=rt.y.scale*tt.y;st[0+ct]/=lt,st[1+ct]/=dt;var ht=mix(lt,dt,.5);typeof st[2+ct]=="number"&&(st[2+ct]/=ht),typeof st[3+ct]=="number"&&(st[3+ct]/=ht);var mt=at(st);if(ot){var ft=0;mt=mt.replace(varToken,function(){var pt=it[ft];return ft++,pt})}return mt}},MeasureLayoutWithContext=function(et){__extends(o,et);function o(){return et!==null&&et.apply(this,arguments)||this}return o.prototype.componentDidMount=function(){var tt=this,rt=this.props,nt=rt.visualElement,ot=rt.layoutGroup,it=rt.switchLayoutGroup,st=rt.layoutId,at=nt.projection;addScaleCorrector(defaultScaleCorrectors),at&&(ot!=null&&ot.group&&ot.group.add(at),it!=null&&it.register&&st&&it.register(at),at.root.didUpdate(),at.addEventListener("animationComplete",function(){tt.safeToRemove()}),at.setOptions(__assign(__assign({},at.options),{onExitComplete:function(){return tt.safeToRemove()}}))),globalProjectionState.hasEverUpdated=!0},o.prototype.getSnapshotBeforeUpdate=function(tt){var rt=this,nt=this.props,ot=nt.layoutDependency,it=nt.visualElement,st=nt.drag,at=nt.isPresent,ct=it.projection;return ct&&(ct.isPresent=at,st||tt.layoutDependency!==ot||ot===void 0?ct.willUpdate():this.safeToRemove(),tt.isPresent!==at&&(at?ct.promote():ct.relegate()||sync.postRender(function(){var lt;!((lt=ct.getStack())===null||lt===void 0)&&lt.members.length||rt.safeToRemove()}))),null},o.prototype.componentDidUpdate=function(){var tt=this.props.visualElement.projection;tt&&(tt.root.didUpdate(),!tt.currentAnimation&&tt.isLead()&&this.safeToRemove())},o.prototype.componentWillUnmount=function(){var tt=this.props,rt=tt.visualElement,nt=tt.layoutGroup,ot=tt.switchLayoutGroup,it=rt.projection;it&&(it.scheduleCheckAfterUnmount(),nt!=null&&nt.group&&nt.group.remove(it),ot!=null&&ot.deregister&&ot.deregister(it))},o.prototype.safeToRemove=function(){var tt=this.props.safeToRemove;tt==null||tt()},o.prototype.render=function(){return null},o}(React.Component);function MeasureLayout(et){var o=__read(usePresence$1(),2),tt=o[0],rt=o[1],nt=reactExports.useContext(LayoutGroupContext);return React.createElement(MeasureLayoutWithContext,__assign({},et,{layoutGroup:nt,switchLayoutGroup:reactExports.useContext(SwitchLayoutGroupContext),isPresent:tt,safeToRemove:rt}))}var defaultScaleCorrectors={borderRadius:__assign(__assign({},correctBorderRadius),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:correctBorderRadius,borderTopRightRadius:correctBorderRadius,borderBottomLeftRadius:correctBorderRadius,borderBottomRightRadius:correctBorderRadius,boxShadow:correctBoxShadow},layoutFeatures={measureLayout:MeasureLayout};function animate(et,o,tt){tt===void 0&&(tt={});var rt=isMotionValue(et)?et:motionValue(et);return startAnimation("",rt,o,tt),{stop:function(){return rt.stop()},isAnimating:function(){return rt.isAnimating()}}}var borders=["TopLeft","TopRight","BottomLeft","BottomRight"],numBorders=borders.length,asNumber=function(et){return typeof et=="string"?parseFloat(et):et},isPx=function(et){return typeof et=="number"||px.test(et)};function mixValues(et,o,tt,rt,nt,ot){var it,st,at,ct;nt?(et.opacity=mix(0,(it=tt.opacity)!==null&&it!==void 0?it:1,easeCrossfadeIn(rt)),et.opacityExit=mix((st=o.opacity)!==null&&st!==void 0?st:1,0,easeCrossfadeOut(rt))):ot&&(et.opacity=mix((at=o.opacity)!==null&&at!==void 0?at:1,(ct=tt.opacity)!==null&&ct!==void 0?ct:1,rt));for(var lt=0;lt<numBorders;lt++){var dt="border".concat(borders[lt],"Radius"),ht=getRadius(o,dt),mt=getRadius(tt,dt);if(!(ht===void 0&&mt===void 0)){ht||(ht=0),mt||(mt=0);var ft=ht===0||mt===0||isPx(ht)===isPx(mt);ft?(et[dt]=Math.max(mix(asNumber(ht),asNumber(mt),rt),0),(percent.test(mt)||percent.test(ht))&&(et[dt]+="%")):et[dt]=mt}}(o.rotate||tt.rotate)&&(et.rotate=mix(o.rotate||0,tt.rotate||0,rt))}function getRadius(et,o){var tt;return(tt=et[o])!==null&&tt!==void 0?tt:et.borderRadius}var easeCrossfadeIn=compress(0,.5,circOut),easeCrossfadeOut=compress(.5,.95,linear);function compress(et,o,tt){return function(rt){return rt<et?0:rt>o?1:tt(progress(et,o,rt))}}function copyAxisInto(et,o){et.min=o.min,et.max=o.max}function copyBoxInto(et,o){copyAxisInto(et.x,o.x),copyAxisInto(et.y,o.y)}function removePointDelta(et,o,tt,rt,nt){return et-=o,et=scalePoint(et,1/tt,rt),nt!==void 0&&(et=scalePoint(et,1/nt,rt)),et}function removeAxisDelta(et,o,tt,rt,nt,ot,it){if(o===void 0&&(o=0),tt===void 0&&(tt=1),rt===void 0&&(rt=.5),ot===void 0&&(ot=et),it===void 0&&(it=et),percent.test(o)){o=parseFloat(o);var st=mix(it.min,it.max,o/100);o=st-it.min}if(typeof o=="number"){var at=mix(ot.min,ot.max,rt);et===ot&&(at-=o),et.min=removePointDelta(et.min,o,tt,at,nt),et.max=removePointDelta(et.max,o,tt,at,nt)}}function removeAxisTransforms(et,o,tt,rt,nt){var ot=__read(tt,3),it=ot[0],st=ot[1],at=ot[2];removeAxisDelta(et,o[it],o[st],o[at],o.scale,rt,nt)}var xKeys=["x","scaleX","originX"],yKeys=["y","scaleY","originY"];function removeBoxTransforms(et,o,tt,rt){removeAxisTransforms(et.x,o,xKeys,tt==null?void 0:tt.x,rt==null?void 0:rt.x),removeAxisTransforms(et.y,o,yKeys,tt==null?void 0:tt.y,rt==null?void 0:rt.y)}function isAxisDeltaZero(et){return et.translate===0&&et.scale===1}function isDeltaZero(et){return isAxisDeltaZero(et.x)&&isAxisDeltaZero(et.y)}function boxEquals(et,o){return et.x.min===o.x.min&&et.x.max===o.x.max&&et.y.min===o.y.min&&et.y.max===o.y.max}var NodeStack=function(){function et(){this.members=[]}return et.prototype.add=function(o){addUniqueItem(this.members,o),o.scheduleRender()},et.prototype.remove=function(o){if(removeItem(this.members,o),o===this.prevLead&&(this.prevLead=void 0),o===this.lead){var tt=this.members[this.members.length-1];tt&&this.promote(tt)}},et.prototype.relegate=function(o){var tt=this.members.findIndex(function(it){return o===it});if(tt===0)return!1;for(var rt,nt=tt;nt>=0;nt--){var ot=this.members[nt];if(ot.isPresent!==!1){rt=ot;break}}return rt?(this.promote(rt),!0):!1},et.prototype.promote=function(o,tt){var rt,nt=this.lead;if(o!==nt&&(this.prevLead=nt,this.lead=o,o.show(),nt)){nt.instance&&nt.scheduleRender(),o.scheduleRender(),o.resumeFrom=nt,tt&&(o.resumeFrom.preserveOpacity=!0),nt.snapshot&&(o.snapshot=nt.snapshot,o.snapshot.latestValues=nt.animationValues||nt.latestValues,o.snapshot.isShared=!0),!((rt=o.root)===null||rt===void 0)&&rt.isUpdating&&(o.isLayoutDirty=!0);var ot=o.options.crossfade;ot===!1&&nt.hide()}},et.prototype.exitAnimationComplete=function(){this.members.forEach(function(o){var tt,rt,nt,ot,it;(rt=(tt=o.options).onExitComplete)===null||rt===void 0||rt.call(tt),(it=(nt=o.resumingFrom)===null||nt===void 0?void 0:(ot=nt.options).onExitComplete)===null||it===void 0||it.call(ot)})},et.prototype.scheduleRender=function(){this.members.forEach(function(o){o.instance&&o.scheduleRender(!1)})},et.prototype.removeLeadSnapshot=function(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)},et}(),identityProjection="translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)";function buildProjectionTransform(et,o,tt){var rt=et.x.translate/o.x,nt=et.y.translate/o.y,ot="translate3d(".concat(rt,"px, ").concat(nt,"px, 0) ");if(ot+="scale(".concat(1/o.x,", ").concat(1/o.y,") "),tt){var it=tt.rotate,st=tt.rotateX,at=tt.rotateY;it&&(ot+="rotate(".concat(it,"deg) ")),st&&(ot+="rotateX(".concat(st,"deg) ")),at&&(ot+="rotateY(".concat(at,"deg) "))}var ct=et.x.scale*o.x,lt=et.y.scale*o.y;return ot+="scale(".concat(ct,", ").concat(lt,")"),ot===identityProjection?"none":ot}var compareByDepth=function(et,o){return et.depth-o.depth},FlatTree=function(){function et(){this.children=[],this.isDirty=!1}return et.prototype.add=function(o){addUniqueItem(this.children,o),this.isDirty=!0},et.prototype.remove=function(o){removeItem(this.children,o),this.isDirty=!0},et.prototype.forEach=function(o){this.isDirty&&this.children.sort(compareByDepth),this.isDirty=!1,this.children.forEach(o)},et}(),animationTarget=1e3;function createProjectionNode(et){var o=et.attachResizeListener,tt=et.defaultParent,rt=et.measureScroll,nt=et.checkIsScrollRoot,ot=et.resetTransform;return function(){function it(st,at,ct){var lt=this;at===void 0&&(at={}),ct===void 0&&(ct=tt==null?void 0:tt()),this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=function(){lt.isUpdating&&(lt.isUpdating=!1,lt.clearAllSnapshots())},this.updateProjection=function(){lt.nodes.forEach(resolveTargetDelta),lt.nodes.forEach(calcProjection)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.id=st,this.latestValues=at,this.root=ct?ct.root||ct:this,this.path=ct?__spreadArray(__spreadArray([],__read(ct.path),!1),[ct],!1):[],this.parent=ct,this.depth=ct?ct.depth+1:0,st&&this.root.registerPotentialNode(st,this);for(var dt=0;dt<this.path.length;dt++)this.path[dt].shouldResetTransform=!0;this.root===this&&(this.nodes=new FlatTree)}return it.prototype.addEventListener=function(st,at){return this.eventHandlers.has(st)||this.eventHandlers.set(st,new SubscriptionManager$1),this.eventHandlers.get(st).add(at)},it.prototype.notifyListeners=function(st){for(var at=[],ct=1;ct<arguments.length;ct++)at[ct-1]=arguments[ct];var lt=this.eventHandlers.get(st);lt==null||lt.notify.apply(lt,__spreadArray([],__read(at),!1))},it.prototype.hasListeners=function(st){return this.eventHandlers.has(st)},it.prototype.registerPotentialNode=function(st,at){this.potentialNodes.set(st,at)},it.prototype.mount=function(st,at){var ct=this,lt;if(at===void 0&&(at=!1),!this.instance){this.isSVG=st instanceof SVGElement&&st.tagName!=="svg",this.instance=st;var dt=this.options,ht=dt.layoutId,mt=dt.layout,ft=dt.visualElement;if(ft&&!ft.getInstance()&&ft.mount(st),this.root.nodes.add(this),(lt=this.parent)===null||lt===void 0||lt.children.add(this),this.id&&this.root.potentialNodes.delete(this.id),at&&(mt||ht)&&(this.isLayoutDirty=!0),o){var pt,yt=function(){return ct.root.updateBlockedByResize=!1};o(st,function(){ct.root.updateBlockedByResize=!0,clearTimeout(pt),pt=window.setTimeout(yt,250),globalProjectionState.hasAnimatedSinceResize&&(globalProjectionState.hasAnimatedSinceResize=!1,ct.nodes.forEach(finishAnimation))})}ht&&this.root.registerSharedNode(ht,this),this.options.animate!==!1&&ft&&(ht||mt)&&this.addEventListener("didUpdate",function(gt){var bt,xt,vt,Et,Ct,St=gt.delta,At=gt.hasLayoutChanged,kt=gt.hasRelativeTargetChanged,It=gt.layout;if(ct.isTreeAnimationBlocked()){ct.target=void 0,ct.relativeTarget=void 0;return}var Nt=(xt=(bt=ct.options.transition)!==null&&bt!==void 0?bt:ft.getDefaultTransition())!==null&&xt!==void 0?xt:defaultLayoutTransition,Lt=ft.getProps(),Mt=Lt.onLayoutAnimationStart,zt=Lt.onLayoutAnimationComplete,Ut=!ct.targetLayout||!boxEquals(ct.targetLayout,It)||kt,Xt=!At&&kt;if(!((vt=ct.resumeFrom)===null||vt===void 0)&&vt.instance||Xt||At&&(Ut||!ct.currentAnimation)){ct.resumeFrom&&(ct.resumingFrom=ct.resumeFrom,ct.resumingFrom.resumingFrom=void 0),ct.setAnimationOrigin(St,Xt);var Wt=__assign(__assign({},getValueTransition(Nt,"layout")),{onPlay:Mt,onComplete:zt});ft.shouldReduceMotion&&(Wt.delay=0,Wt.type=!1),ct.startAnimation(Wt)}else!At&&ct.animationProgress===0&&ct.finishAnimation(),ct.isLead()&&((Ct=(Et=ct.options).onExitComplete)===null||Ct===void 0||Ct.call(Et));ct.targetLayout=It})}},it.prototype.unmount=function(){var st,at;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),(st=this.getStack())===null||st===void 0||st.remove(this),(at=this.parent)===null||at===void 0||at.children.delete(this),this.instance=void 0,cancelSync.preRender(this.updateProjection)},it.prototype.blockUpdate=function(){this.updateManuallyBlocked=!0},it.prototype.unblockUpdate=function(){this.updateManuallyBlocked=!1},it.prototype.isUpdateBlocked=function(){return this.updateManuallyBlocked||this.updateBlockedByResize},it.prototype.isTreeAnimationBlocked=function(){var st;return this.isAnimationBlocked||((st=this.parent)===null||st===void 0?void 0:st.isTreeAnimationBlocked())||!1},it.prototype.startUpdate=function(){var st;this.isUpdateBlocked()||(this.isUpdating=!0,(st=this.nodes)===null||st===void 0||st.forEach(resetRotation))},it.prototype.willUpdate=function(st){var at,ct,lt;if(st===void 0&&(st=!0),this.root.isUpdateBlocked()){(ct=(at=this.options).onExitComplete)===null||ct===void 0||ct.call(at);return}if(!this.root.isUpdating&&this.root.startUpdate(),!this.isLayoutDirty){this.isLayoutDirty=!0;for(var dt=0;dt<this.path.length;dt++){var ht=this.path[dt];ht.shouldResetTransform=!0,ht.updateScroll()}var mt=this.options,ft=mt.layoutId,pt=mt.layout;if(!(ft===void 0&&!pt)){var yt=(lt=this.options.visualElement)===null||lt===void 0?void 0:lt.getProps().transformTemplate;this.prevTransformTemplateValue=yt==null?void 0:yt(this.latestValues,""),this.updateSnapshot(),st&&this.notifyListeners("willUpdate")}}},it.prototype.didUpdate=function(){var st=this.isUpdateBlocked();if(st){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(clearMeasurements);return}this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(mountNodeEarly),this.potentialNodes.clear()),this.nodes.forEach(resetTransformStyle),this.nodes.forEach(updateLayout),this.nodes.forEach(notifyLayoutUpdate),this.clearAllSnapshots(),flushSync.update(),flushSync.preRender(),flushSync.render())},it.prototype.clearAllSnapshots=function(){this.nodes.forEach(clearSnapshot),this.sharedNodes.forEach(removeLeadSnapshots)},it.prototype.scheduleUpdateProjection=function(){sync.preRender(this.updateProjection,!1,!0)},it.prototype.scheduleCheckAfterUnmount=function(){var st=this;sync.postRender(function(){st.isLayoutDirty?st.root.didUpdate():st.root.checkUpdateFailed()})},it.prototype.updateSnapshot=function(){if(!(this.snapshot||!this.instance)){var st=this.measure(),at=this.removeTransform(this.removeElementScroll(st));roundBox(at),this.snapshot={measured:st,layout:at,latestValues:{}}}},it.prototype.updateLayout=function(){var st;if(this.instance&&(this.updateScroll(),!(!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))){if(this.resumeFrom&&!this.resumeFrom.instance)for(var at=0;at<this.path.length;at++){var ct=this.path[at];ct.updateScroll()}var lt=this.measure();roundBox(lt);var dt=this.layout;this.layout={measured:lt,actual:this.removeElementScroll(lt)},this.layoutCorrected=createBox(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.actual),(st=this.options.visualElement)===null||st===void 0||st.notifyLayoutMeasure(this.layout.actual,dt==null?void 0:dt.actual)}},it.prototype.updateScroll=function(){this.options.layoutScroll&&this.instance&&(this.isScrollRoot=nt(this.instance),this.scroll=rt(this.instance))},it.prototype.resetTransform=function(){var st;if(ot){var at=this.isLayoutDirty||this.shouldResetTransform,ct=this.projectionDelta&&!isDeltaZero(this.projectionDelta),lt=(st=this.options.visualElement)===null||st===void 0?void 0:st.getProps().transformTemplate,dt=lt==null?void 0:lt(this.latestValues,""),ht=dt!==this.prevTransformTemplateValue;at&&(ct||hasTransform(this.latestValues)||ht)&&(ot(this.instance,dt),this.shouldResetTransform=!1,this.scheduleRender())}},it.prototype.measure=function(){var st=this.options.visualElement;if(!st)return createBox();var at=st.measureViewportBox(),ct=this.root.scroll;return ct&&(translateAxis(at.x,ct.x),translateAxis(at.y,ct.y)),at},it.prototype.removeElementScroll=function(st){var at=createBox();copyBoxInto(at,st);for(var ct=0;ct<this.path.length;ct++){var lt=this.path[ct],dt=lt.scroll,ht=lt.options,mt=lt.isScrollRoot;if(lt!==this.root&&dt&&ht.layoutScroll){if(mt){copyBoxInto(at,st);var ft=this.root.scroll;ft&&(translateAxis(at.x,-ft.x),translateAxis(at.y,-ft.y))}translateAxis(at.x,dt.x),translateAxis(at.y,dt.y)}}return at},it.prototype.applyTransform=function(st,at){at===void 0&&(at=!1);var ct=createBox();copyBoxInto(ct,st);for(var lt=0;lt<this.path.length;lt++){var dt=this.path[lt];!at&&dt.options.layoutScroll&&dt.scroll&&dt!==dt.root&&transformBox(ct,{x:-dt.scroll.x,y:-dt.scroll.y}),hasTransform(dt.latestValues)&&transformBox(ct,dt.latestValues)}return hasTransform(this.latestValues)&&transformBox(ct,this.latestValues),ct},it.prototype.removeTransform=function(st){var at,ct=createBox();copyBoxInto(ct,st);for(var lt=0;lt<this.path.length;lt++){var dt=this.path[lt];if(dt.instance&&hasTransform(dt.latestValues)){hasScale(dt.latestValues)&&dt.updateSnapshot();var ht=createBox(),mt=dt.measure();copyBoxInto(ht,mt),removeBoxTransforms(ct,dt.latestValues,(at=dt.snapshot)===null||at===void 0?void 0:at.layout,ht)}}return hasTransform(this.latestValues)&&removeBoxTransforms(ct,this.latestValues),ct},it.prototype.setTargetDelta=function(st){this.targetDelta=st,this.root.scheduleUpdateProjection()},it.prototype.setOptions=function(st){var at;this.options=__assign(__assign(__assign({},this.options),st),{crossfade:(at=st.crossfade)!==null&&at!==void 0?at:!0})},it.prototype.clearMeasurements=function(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1},it.prototype.resolveTargetDelta=function(){var st,at=this.options,ct=at.layout,lt=at.layoutId;!this.layout||!(ct||lt)||(!this.targetDelta&&!this.relativeTarget&&(this.relativeParent=this.getClosestProjectingParent(),this.relativeParent&&this.relativeParent.layout&&(this.relativeTarget=createBox(),this.relativeTargetOrigin=createBox(),calcRelativePosition(this.relativeTargetOrigin,this.layout.actual,this.relativeParent.layout.actual),copyBoxInto(this.relativeTarget,this.relativeTargetOrigin))),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=createBox(),this.targetWithTransforms=createBox()),this.relativeTarget&&this.relativeTargetOrigin&&(!((st=this.relativeParent)===null||st===void 0)&&st.target)?calcRelativeBox(this.target,this.relativeTarget,this.relativeParent.target):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.actual):copyBoxInto(this.target,this.layout.actual),applyBoxDelta(this.target,this.targetDelta)):copyBoxInto(this.target,this.layout.actual),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.relativeParent=this.getClosestProjectingParent(),this.relativeParent&&!!this.relativeParent.resumingFrom==!!this.resumingFrom&&!this.relativeParent.options.layoutScroll&&this.relativeParent.target&&(this.relativeTarget=createBox(),this.relativeTargetOrigin=createBox(),calcRelativePosition(this.relativeTargetOrigin,this.target,this.relativeParent.target),copyBoxInto(this.relativeTarget,this.relativeTargetOrigin)))))},it.prototype.getClosestProjectingParent=function(){if(!(!this.parent||hasTransform(this.parent.latestValues)))return(this.parent.relativeTarget||this.parent.targetDelta)&&this.parent.layout?this.parent:this.parent.getClosestProjectingParent()},it.prototype.calcProjection=function(){var st,at=this.options,ct=at.layout,lt=at.layoutId;if(this.isTreeAnimating=!!(!((st=this.parent)===null||st===void 0)&&st.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!(!this.layout||!(ct||lt))){var dt=this.getLead();copyBoxInto(this.layoutCorrected,this.layout.actual),applyTreeDeltas(this.layoutCorrected,this.treeScale,this.path,!!this.resumingFrom||this!==dt);var ht=dt.target;if(ht){this.projectionDelta||(this.projectionDelta=createDelta(),this.projectionDeltaWithTransform=createDelta());var mt=this.treeScale.x,ft=this.treeScale.y,pt=this.projectionTransform;calcBoxDelta(this.projectionDelta,this.layoutCorrected,ht,this.latestValues),this.projectionTransform=buildProjectionTransform(this.projectionDelta,this.treeScale),(this.projectionTransform!==pt||this.treeScale.x!==mt||this.treeScale.y!==ft)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",ht))}}},it.prototype.hide=function(){this.isVisible=!1},it.prototype.show=function(){this.isVisible=!0},it.prototype.scheduleRender=function(st){var at,ct,lt;st===void 0&&(st=!0),(ct=(at=this.options).scheduleRender)===null||ct===void 0||ct.call(at),st&&((lt=this.getStack())===null||lt===void 0||lt.scheduleRender()),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)},it.prototype.setAnimationOrigin=function(st,at){var ct=this,lt;at===void 0&&(at=!1);var dt=this.snapshot,ht=(dt==null?void 0:dt.latestValues)||{},mt=__assign({},this.latestValues),ft=createDelta();this.relativeTarget=this.relativeTargetOrigin=void 0,this.attemptToResolveRelativeTarget=!at;var pt=createBox(),yt=dt==null?void 0:dt.isShared,gt=(((lt=this.getStack())===null||lt===void 0?void 0:lt.members.length)||0)<=1,bt=!!(yt&&!gt&&this.options.crossfade===!0&&!this.path.some(hasOpacityCrossfade));this.animationProgress=0,this.mixTargetDelta=function(xt){var vt,Et=xt/1e3;mixAxisDelta(ft.x,st.x,Et),mixAxisDelta(ft.y,st.y,Et),ct.setTargetDelta(ft),ct.relativeTarget&&ct.relativeTargetOrigin&&ct.layout&&(!((vt=ct.relativeParent)===null||vt===void 0)&&vt.layout)&&(calcRelativePosition(pt,ct.layout.actual,ct.relativeParent.layout.actual),mixBox(ct.relativeTarget,ct.relativeTargetOrigin,pt,Et)),yt&&(ct.animationValues=mt,mixValues(mt,ht,ct.latestValues,Et,bt,gt)),ct.root.scheduleUpdateProjection(),ct.scheduleRender(),ct.animationProgress=Et},this.mixTargetDelta(0)},it.prototype.startAnimation=function(st){var at=this,ct,lt;this.notifyListeners("animationStart"),(ct=this.currentAnimation)===null||ct===void 0||ct.stop(),this.resumingFrom&&((lt=this.resumingFrom.currentAnimation)===null||lt===void 0||lt.stop()),this.pendingAnimation&&(cancelSync.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=sync.update(function(){globalProjectionState.hasAnimatedSinceResize=!0,at.currentAnimation=animate(0,animationTarget,__assign(__assign({},st),{onUpdate:function(dt){var ht;at.mixTargetDelta(dt),(ht=st.onUpdate)===null||ht===void 0||ht.call(st,dt)},onComplete:function(){var dt;(dt=st.onComplete)===null||dt===void 0||dt.call(st),at.completeAnimation()}})),at.resumingFrom&&(at.resumingFrom.currentAnimation=at.currentAnimation),at.pendingAnimation=void 0})},it.prototype.completeAnimation=function(){var st;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),(st=this.getStack())===null||st===void 0||st.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")},it.prototype.finishAnimation=function(){var st;this.currentAnimation&&((st=this.mixTargetDelta)===null||st===void 0||st.call(this,animationTarget),this.currentAnimation.stop()),this.completeAnimation()},it.prototype.applyTransformsToTarget=function(){var st=this.getLead(),at=st.targetWithTransforms,ct=st.target,lt=st.layout,dt=st.latestValues;!at||!ct||!lt||(copyBoxInto(at,ct),transformBox(at,dt),calcBoxDelta(this.projectionDeltaWithTransform,this.layoutCorrected,at,dt))},it.prototype.registerSharedNode=function(st,at){var ct,lt,dt;this.sharedNodes.has(st)||this.sharedNodes.set(st,new NodeStack);var ht=this.sharedNodes.get(st);ht.add(at),at.promote({transition:(ct=at.options.initialPromotionConfig)===null||ct===void 0?void 0:ct.transition,preserveFollowOpacity:(dt=(lt=at.options.initialPromotionConfig)===null||lt===void 0?void 0:lt.shouldPreserveFollowOpacity)===null||dt===void 0?void 0:dt.call(lt,at)})},it.prototype.isLead=function(){var st=this.getStack();return st?st.lead===this:!0},it.prototype.getLead=function(){var st,at=this.options.layoutId;return at?((st=this.getStack())===null||st===void 0?void 0:st.lead)||this:this},it.prototype.getPrevLead=function(){var st,at=this.options.layoutId;return at?(st=this.getStack())===null||st===void 0?void 0:st.prevLead:void 0},it.prototype.getStack=function(){var st=this.options.layoutId;if(st)return this.root.sharedNodes.get(st)},it.prototype.promote=function(st){var at=st===void 0?{}:st,ct=at.needsReset,lt=at.transition,dt=at.preserveFollowOpacity,ht=this.getStack();ht&&ht.promote(this,dt),ct&&(this.projectionDelta=void 0,this.needsReset=!0),lt&&this.setOptions({transition:lt})},it.prototype.relegate=function(){var st=this.getStack();return st?st.relegate(this):!1},it.prototype.resetRotation=function(){var st=this.options.visualElement;if(st){for(var at=!1,ct={},lt=0;lt<transformAxes.length;lt++){var dt=transformAxes[lt],ht="rotate"+dt;st.getStaticValue(ht)&&(at=!0,ct[ht]=st.getStaticValue(ht),st.setStaticValue(ht,0))}if(at){st==null||st.syncRender();for(var ht in ct)st.setStaticValue(ht,ct[ht]);st.scheduleRender()}}},it.prototype.getProjectionStyles=function(st){var at,ct,lt,dt,ht,mt;st===void 0&&(st={});var ft={};if(!this.instance||this.isSVG)return ft;if(this.isVisible)ft.visibility="";else return{visibility:"hidden"};var pt=(at=this.options.visualElement)===null||at===void 0?void 0:at.getProps().transformTemplate;if(this.needsReset)return this.needsReset=!1,ft.opacity="",ft.pointerEvents=resolveMotionValue(st.pointerEvents)||"",ft.transform=pt?pt(this.latestValues,""):"none",ft;var yt=this.getLead();if(!this.projectionDelta||!this.layout||!yt.target){var gt={};return this.options.layoutId&&(gt.opacity=(ct=this.latestValues.opacity)!==null&&ct!==void 0?ct:1,gt.pointerEvents=resolveMotionValue(st.pointerEvents)||""),this.hasProjected&&!hasTransform(this.latestValues)&&(gt.transform=pt?pt({},""):"none",this.hasProjected=!1),gt}var bt=yt.animationValues||yt.latestValues;this.applyTransformsToTarget(),ft.transform=buildProjectionTransform(this.projectionDeltaWithTransform,this.treeScale,bt),pt&&(ft.transform=pt(bt,ft.transform));var xt=this.projectionDelta,vt=xt.x,Et=xt.y;ft.transformOrigin="".concat(vt.origin*100,"% ").concat(Et.origin*100,"% 0"),yt.animationValues?ft.opacity=yt===this?(dt=(lt=bt.opacity)!==null&&lt!==void 0?lt:this.latestValues.opacity)!==null&&dt!==void 0?dt:1:this.preserveOpacity?this.latestValues.opacity:bt.opacityExit:ft.opacity=yt===this?(ht=bt.opacity)!==null&&ht!==void 0?ht:"":(mt=bt.opacityExit)!==null&&mt!==void 0?mt:0;for(var Ct in scaleCorrectors)if(bt[Ct]!==void 0){var St=scaleCorrectors[Ct],At=St.correct,kt=St.applyTo,It=At(bt[Ct],yt);if(kt)for(var Nt=kt.length,Lt=0;Lt<Nt;Lt++)ft[kt[Lt]]=It;else ft[Ct]=It}return this.options.layoutId&&(ft.pointerEvents=yt===this?resolveMotionValue(st.pointerEvents)||"":"none"),ft},it.prototype.clearSnapshot=function(){this.resumeFrom=this.snapshot=void 0},it.prototype.resetTree=function(){this.root.nodes.forEach(function(st){var at;return(at=st.currentAnimation)===null||at===void 0?void 0:at.stop()}),this.root.nodes.forEach(clearMeasurements),this.root.sharedNodes.clear()},it}()}function updateLayout(et){et.updateLayout()}function notifyLayoutUpdate(et){var o,tt,rt,nt,ot=(tt=(o=et.resumeFrom)===null||o===void 0?void 0:o.snapshot)!==null&&tt!==void 0?tt:et.snapshot;if(et.isLead()&&et.layout&&ot&&et.hasListeners("didUpdate")){var it=et.layout,st=it.actual,at=it.measured;et.options.animationType==="size"?eachAxis(function(bt){var xt=ot.isShared?ot.measured[bt]:ot.layout[bt],vt=calcLength(xt);xt.min=st[bt].min,xt.max=xt.min+vt}):et.options.animationType==="position"&&eachAxis(function(bt){var xt=ot.isShared?ot.measured[bt]:ot.layout[bt],vt=calcLength(st[bt]);xt.max=xt.min+vt});var ct=createDelta();calcBoxDelta(ct,st,ot.layout);var lt=createDelta();ot.isShared?calcBoxDelta(lt,et.applyTransform(at,!0),ot.measured):calcBoxDelta(lt,st,ot.layout);var dt=!isDeltaZero(ct),ht=!1;if(!et.resumeFrom&&(et.relativeParent=et.getClosestProjectingParent(),et.relativeParent&&!et.relativeParent.resumeFrom)){var mt=et.relativeParent,ft=mt.snapshot,pt=mt.layout;if(ft&&pt){var yt=createBox();calcRelativePosition(yt,ot.layout,ft.layout);var gt=createBox();calcRelativePosition(gt,st,pt.actual),boxEquals(yt,gt)||(ht=!0)}}et.notifyListeners("didUpdate",{layout:st,snapshot:ot,delta:lt,layoutDelta:ct,hasLayoutChanged:dt,hasRelativeTargetChanged:ht})}else et.isLead()&&((nt=(rt=et.options).onExitComplete)===null||nt===void 0||nt.call(rt));et.options.transition=void 0}function clearSnapshot(et){et.clearSnapshot()}function clearMeasurements(et){et.clearMeasurements()}function resetTransformStyle(et){var o=et.options.visualElement;o!=null&&o.getProps().onBeforeLayoutMeasure&&o.notifyBeforeLayoutMeasure(),et.resetTransform()}function finishAnimation(et){et.finishAnimation(),et.targetDelta=et.relativeTarget=et.target=void 0}function resolveTargetDelta(et){et.resolveTargetDelta()}function calcProjection(et){et.calcProjection()}function resetRotation(et){et.resetRotation()}function removeLeadSnapshots(et){et.removeLeadSnapshot()}function mixAxisDelta(et,o,tt){et.translate=mix(o.translate,0,tt),et.scale=mix(o.scale,1,tt),et.origin=o.origin,et.originPoint=o.originPoint}function mixAxis(et,o,tt,rt){et.min=mix(o.min,tt.min,rt),et.max=mix(o.max,tt.max,rt)}function mixBox(et,o,tt,rt){mixAxis(et.x,o.x,tt.x,rt),mixAxis(et.y,o.y,tt.y,rt)}function hasOpacityCrossfade(et){return et.animationValues&&et.animationValues.opacityExit!==void 0}var defaultLayoutTransition={duration:.45,ease:[.4,0,.1,1]};function mountNodeEarly(et,o){for(var tt=et.root,rt=et.path.length-1;rt>=0;rt--)if(et.path[rt].instance){tt=et.path[rt];break}var nt=tt&&tt!==et.root?tt.instance:document,ot=nt.querySelector('[data-projection-id="'.concat(o,'"]'));ot&&et.mount(ot,!0)}function roundAxis(et){et.min=Math.round(et.min),et.max=Math.round(et.max)}function roundBox(et){roundAxis(et.x),roundAxis(et.y)}var DocumentProjectionNode=createProjectionNode({attachResizeListener:function(et,o){return addDomEvent(et,"resize",o)},measureScroll:function(){return{x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}},checkIsScrollRoot:function(){return!0}}),rootProjectionNode={current:void 0},HTMLProjectionNode=createProjectionNode({measureScroll:function(et){return{x:et.scrollLeft,y:et.scrollTop}},defaultParent:function(){if(!rootProjectionNode.current){var et=new DocumentProjectionNode(0,{});et.mount(window),et.setOptions({layoutScroll:!0}),rootProjectionNode.current=et}return rootProjectionNode.current},resetTransform:function(et,o){et.style.transform=o??"none"},checkIsScrollRoot:function(et){return window.getComputedStyle(et).position==="fixed"}}),featureBundle=__assign(__assign(__assign(__assign({},animations),gestureAnimations),drag),layoutFeatures),motion=createMotionProxy(function(et,o){return createDomMotionConfig(et,o,featureBundle,createDomVisualElement,HTMLProjectionNode)});function useIsMounted$1(){var et=reactExports.useRef(!1);return useIsomorphicLayoutEffect$3(function(){return et.current=!0,function(){et.current=!1}},[]),et}function useForceUpdate(){var et=useIsMounted$1(),o=__read(reactExports.useState(0),2),tt=o[0],rt=o[1],nt=reactExports.useCallback(function(){et.current&&rt(tt+1)},[tt]),ot=reactExports.useCallback(function(){return sync.postRender(nt)},[nt]);return[ot,tt]}var PresenceChild=function(et){var o=et.children,tt=et.initial,rt=et.isPresent,nt=et.onExitComplete,ot=et.custom,it=et.presenceAffectsLayout,st=useConstant(newChildrenMap),at=useId$1(),ct=reactExports.useMemo(function(){return{id:at,initial:tt,isPresent:rt,custom:ot,onExitComplete:function(lt){var dt,ht;st.set(lt,!0);try{for(var mt=__values(st.values()),ft=mt.next();!ft.done;ft=mt.next()){var pt=ft.value;if(!pt)return}}catch(yt){dt={error:yt}}finally{try{ft&&!ft.done&&(ht=mt.return)&&ht.call(mt)}finally{if(dt)throw dt.error}}nt==null||nt()},register:function(lt){return st.set(lt,!1),function(){return st.delete(lt)}}}},it?void 0:[rt]);return reactExports.useMemo(function(){st.forEach(function(lt,dt){return st.set(dt,!1)})},[rt]),reactExports.useEffect(function(){!rt&&!st.size&&(nt==null||nt())},[rt]),reactExports.createElement(PresenceContext.Provider,{value:ct},o)};function newChildrenMap(){return new Map}var getChildKey=function(et){return et.key||""};function updateChildLookup(et,o){et.forEach(function(tt){var rt=getChildKey(tt);o.set(rt,tt)})}function onlyElements(et){var o=[];return reactExports.Children.forEach(et,function(tt){reactExports.isValidElement(tt)&&o.push(tt)}),o}var AnimatePresence=function(et){var o=et.children,tt=et.custom,rt=et.initial,nt=rt===void 0?!0:rt,ot=et.onExitComplete,it=et.exitBeforeEnter,st=et.presenceAffectsLayout,at=st===void 0?!0:st,ct=__read(useForceUpdate(),1),lt=ct[0],dt=reactExports.useContext(LayoutGroupContext).forceRender;dt&&(lt=dt);var ht=useIsMounted$1(),mt=onlyElements(o),ft=mt,pt=new Set,yt=reactExports.useRef(ft),gt=reactExports.useRef(new Map).current,bt=reactExports.useRef(!0);if(useIsomorphicLayoutEffect$3(function(){bt.current=!1,updateChildLookup(mt,gt),yt.current=ft}),useUnmountEffect(function(){bt.current=!0,gt.clear(),pt.clear()}),bt.current)return reactExports.createElement(reactExports.Fragment,null,ft.map(function(At){return reactExports.createElement(PresenceChild,{key:getChildKey(At),isPresent:!0,initial:nt?void 0:!1,presenceAffectsLayout:at},At)}));ft=__spreadArray([],__read(ft),!1);for(var xt=yt.current.map(getChildKey),vt=mt.map(getChildKey),Et=xt.length,Ct=0;Ct<Et;Ct++){var St=xt[Ct];vt.indexOf(St)===-1&&pt.add(St)}return it&&pt.size&&(ft=[]),pt.forEach(function(At){if(vt.indexOf(At)===-1){var kt=gt.get(At);if(kt){var It=xt.indexOf(At),Nt=function(){gt.delete(At),pt.delete(At);var Lt=yt.current.findIndex(function(Mt){return Mt.key===At});if(yt.current.splice(Lt,1),!pt.size){if(yt.current=mt,ht.current===!1)return;lt(),ot&&ot()}};ft.splice(It,0,reactExports.createElement(PresenceChild,{key:getChildKey(kt),isPresent:!1,onExitComplete:Nt,custom:tt,presenceAffectsLayout:at},kt))}}}),ft=ft.map(function(At){var kt=At.key;return pt.has(kt)?At:reactExports.createElement(PresenceChild,{key:getChildKey(At),isPresent:!0,presenceAffectsLayout:at},At)}),env$1!=="production"&&it&&ft.length>1&&console.warn("You're attempting to animate multiple children within AnimatePresence, but its exitBeforeEnter prop is set to true. This will lead to odd visual behaviour."),reactExports.createElement(reactExports.Fragment,null,pt.size?ft:ft.map(function(At){return reactExports.cloneElement(At)}))};function MotionConfig(et){var o=et.children,tt=et.isValidProp,rt=__rest(et,["children","isValidProp"]);tt&&loadExternalIsValidProp(tt),rt=__assign(__assign({},reactExports.useContext(MotionConfigContext)),rt),rt.isStatic=useConstant(function(){return rt.isStatic});var nt=reactExports.useMemo(function(){return rt},[JSON.stringify(rt.transition),rt.transformPagePoint,rt.reducedMotion]);return reactExports.createElement(MotionConfigContext.Provider,{value:nt},o)}var reactIs$2={exports:{}},reactIs_production_min$1={};/**
* @license React
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var b$2=Symbol.for("react.element"),c$1=Symbol.for("react.portal"),d$2=Symbol.for("react.fragment"),e$1=Symbol.for("react.strict_mode"),f$1=Symbol.for("react.profiler"),g$2=Symbol.for("react.provider"),h$2=Symbol.for("react.context"),k$2=Symbol.for("react.server_context"),l$1=Symbol.for("react.forward_ref"),m$3=Symbol.for("react.suspense"),n$1=Symbol.for("react.suspense_list"),p$1=Symbol.for("react.memo"),q$2=Symbol.for("react.lazy"),t$1=Symbol.for("react.offscreen"),u;u=Symbol.for("react.module.reference");function v$2(et){if(typeof et=="object"&&et!==null){var o=et.$$typeof;switch(o){case b$2:switch(et=et.type,et){case d$2:case f$1:case e$1:case m$3:case n$1:return et;default:switch(et=et&&et.$$typeof,et){case k$2:case h$2:case l$1:case q$2:case p$1:case g$2:return et;default:return o}}case c$1:return o}}}reactIs_production_min$1.ContextConsumer=h$2;reactIs_production_min$1.ContextProvider=g$2;reactIs_production_min$1.Element=b$2;reactIs_production_min$1.ForwardRef=l$1;reactIs_production_min$1.Fragment=d$2;reactIs_production_min$1.Lazy=q$2;reactIs_production_min$1.Memo=p$1;reactIs_production_min$1.Portal=c$1;reactIs_production_min$1.Profiler=f$1;reactIs_production_min$1.StrictMode=e$1;reactIs_production_min$1.Suspense=m$3;reactIs_production_min$1.SuspenseList=n$1;reactIs_production_min$1.isAsyncMode=function(){return!1};reactIs_production_min$1.isConcurrentMode=function(){return!1};reactIs_production_min$1.isContextConsumer=function(et){return v$2(et)===h$2};reactIs_production_min$1.isContextProvider=function(et){return v$2(et)===g$2};reactIs_production_min$1.isElement=function(et){return typeof et=="object"&&et!==null&&et.$$typeof===b$2};reactIs_production_min$1.isForwardRef=function(et){return v$2(et)===l$1};reactIs_production_min$1.isFragment=function(et){return v$2(et)===d$2};reactIs_production_min$1.isLazy=function(et){return v$2(et)===q$2};reactIs_production_min$1.isMemo=function(et){return v$2(et)===p$1};reactIs_production_min$1.isPortal=function(et){return v$2(et)===c$1};reactIs_production_min$1.isProfiler=function(et){return v$2(et)===f$1};reactIs_production_min$1.isStrictMode=function(et){return v$2(et)===e$1};reactIs_production_min$1.isSuspense=function(et){return v$2(et)===m$3};reactIs_production_min$1.isSuspenseList=function(et){return v$2(et)===n$1};reactIs_production_min$1.isValidElementType=function(et){return typeof et=="string"||typeof et=="function"||et===d$2||et===f$1||et===e$1||et===m$3||et===n$1||et===t$1||typeof et=="object"&&et!==null&&(et.$$typeof===q$2||et.$$typeof===p$1||et.$$typeof===g$2||et.$$typeof===h$2||et.$$typeof===l$1||et.$$typeof===u||et.getModuleId!==void 0)};reactIs_production_min$1.typeOf=v$2;reactIs$2.exports=reactIs_production_min$1;var reactIsExports$1=reactIs$2.exports;function stylis_min(et){function o(Qt,jt,Gt,rr,Ht){for(var dr=0,Zt=0,Jt=0,tr=0,_t,Bt,Vt=0,er=0,ar,ur=ar=_t=0,cr=0,hr=0,Sr=0,pr=0,wr=Gt.length,_r=wr-1,Tr,gr="",vr="",ir="",Tt="",$t;cr<wr;){if(Bt=Gt.charCodeAt(cr),cr===_r&&Zt+tr+Jt+dr!==0&&(Zt!==0&&(Bt=Zt===47?10:47),tr=Jt=dr=0,wr++,_r++),Zt+tr+Jt+dr===0){if(cr===_r&&(0<hr&&(gr=gr.replace(ht,"")),0<gr.trim().length)){switch(Bt){case 32:case 9:case 59:case 13:case 10:break;default:gr+=Gt.charAt(cr)}Bt=59}switch(Bt){case 123:for(gr=gr.trim(),_t=gr.charCodeAt(0),ar=1,pr=++cr;cr<wr;){switch(Bt=Gt.charCodeAt(cr)){case 123:ar++;break;case 125:ar--;break;case 47:switch(Bt=Gt.charCodeAt(cr+1)){case 42:case 47:e:{for(ur=cr+1;ur<_r;++ur)switch(Gt.charCodeAt(ur)){case 47:if(Bt===42&&Gt.charCodeAt(ur-1)===42&&cr+2!==ur){cr=ur+1;break e}break;case 10:if(Bt===47){cr=ur+1;break e}}cr=ur}}break;case 91:Bt++;case 40:Bt++;case 34:case 39:for(;cr++<_r&&Gt.charCodeAt(cr)!==Bt;);}if(ar===0)break;cr++}switch(ar=Gt.substring(pr,cr),_t===0&&(_t=(gr=gr.replace(dt,"").trim()).charCodeAt(0)),_t){case 64:switch(0<hr&&(gr=gr.replace(ht,"")),Bt=gr.charCodeAt(1),Bt){case 100:case 109:case 115:case 45:hr=jt;break;default:hr=Xt}if(ar=o(jt,hr,ar,Bt,Ht+1),pr=ar.length,0<Ft&&(hr=tt(Xt,gr,Sr),$t=st(3,ar,hr,jt,Mt,Lt,pr,Bt,Ht,rr),gr=hr.join(""),$t!==void 0&&(pr=(ar=$t.trim()).length)===0&&(Bt=0,ar="")),0<pr)switch(Bt){case 115:gr=gr.replace(Ct,it);case 100:case 109:case 45:ar=gr+"{"+ar+"}";break;case 107:gr=gr.replace(bt,"$1 $2"),ar=gr+"{"+ar+"}",ar=Ut===1||Ut===2&&ot("@"+ar,3)?"@-webkit-"+ar+"@"+ar:"@"+ar;break;default:ar=gr+ar,rr===112&&(ar=(vr+=ar,""))}else ar="";break;default:ar=o(jt,tt(jt,gr,Sr),ar,rr,Ht+1)}ir+=ar,ar=Sr=hr=ur=_t=0,gr="",Bt=Gt.charCodeAt(++cr);break;case 125:case 59:if(gr=(0<hr?gr.replace(ht,""):gr).trim(),1<(pr=gr.length))switch(ur===0&&(_t=gr.charCodeAt(0),_t===45||96<_t&&123>_t)&&(pr=(gr=gr.replace(" ",":")).length),0<Ft&&($t=st(1,gr,jt,Qt,Mt,Lt,vr.length,rr,Ht,rr))!==void 0&&(pr=(gr=$t.trim()).length)===0&&(gr="\0\0"),_t=gr.charCodeAt(0),Bt=gr.charCodeAt(1),_t){case 0:break;case 64:if(Bt===105||Bt===99){Tt+=gr+Gt.charAt(cr);break}default:gr.charCodeAt(pr-1)!==58&&(vr+=nt(gr,_t,Bt,gr.charCodeAt(2)))}Sr=hr=ur=_t=0,gr="",Bt=Gt.charCodeAt(++cr)}}switch(Bt){case 13:case 10:Zt===47?Zt=0:1+_t===0&&rr!==107&&0<gr.length&&(hr=1,gr+="\0"),0<Ft*Pt&&st(0,gr,jt,Qt,Mt,Lt,vr.length,rr,Ht,rr),Lt=1,Mt++;break;case 59:case 125:if(Zt+tr+Jt+dr===0){Lt++;break}default:switch(Lt++,Tr=Gt.charAt(cr),Bt){case 9:case 32:if(tr+dr+Zt===0)switch(Vt){case 44:case 58:case 9:case 32:Tr="";break;default:Bt!==32&&(Tr=" ")}break;case 0:Tr="\\0";break;case 12:Tr="\\f";break;case 11:Tr="\\v";break;case 38:tr+Zt+dr===0&&(hr=Sr=1,Tr="\f"+Tr);break;case 108:if(tr+Zt+dr+zt===0&&0<ur)switch(cr-ur){case 2:Vt===112&&Gt.charCodeAt(cr-3)===58&&(zt=Vt);case 8:er===111&&(zt=er)}break;case 58:tr+Zt+dr===0&&(ur=cr);break;case 44:Zt+Jt+tr+dr===0&&(hr=1,Tr+="\r");break;case 34:case 39:Zt===0&&(tr=tr===Bt?0:tr===0?Bt:tr);break;case 91:tr+Zt+Jt===0&&dr++;break;case 93:tr+Zt+Jt===0&&dr--;break;case 41:tr+Zt+dr===0&&Jt--;break;case 40:if(tr+Zt+dr===0){if(_t===0)switch(2*Vt+3*er){case 533:break;default:_t=1}Jt++}break;case 64:Zt+Jt+tr+dr+ur+ar===0&&(ar=1);break;case 42:case 47:if(!(0<tr+dr+Jt))switch(Zt){case 0:switch(2*Bt+3*Gt.charCodeAt(cr+1)){case 235:Zt=47;break;case 220:pr=cr,Zt=42}break;case 42:Bt===47&&Vt===42&&pr+2!==cr&&(Gt.charCodeAt(pr+2)===33&&(vr+=Gt.substring(pr,cr+1)),Tr="",Zt=0)}}Zt===0&&(gr+=Tr)}er=Vt,Vt=Bt,cr++}if(pr=vr.length,0<pr){if(hr=jt,0<Ft&&($t=st(2,vr,hr,Qt,Mt,Lt,pr,rr,Ht,rr),$t!==void 0&&(vr=$t).length===0))return Tt+vr+ir;if(vr=hr.join(",")+"{"+vr+"}",Ut*zt!==0){switch(Ut!==2||ot(vr,2)||(zt=0),zt){case 111:vr=vr.replace(vt,":-moz-$1")+vr;break;case 112:vr=vr.replace(xt,"::-webkit-input-$1")+vr.replace(xt,"::-moz-$1")+vr.replace(xt,":-ms-input-$1")+vr}zt=0}}return Tt+vr+ir}function tt(Qt,jt,Gt){var rr=jt.trim().split(yt);jt=rr;var Ht=rr.length,dr=Qt.length;switch(dr){case 0:case 1:var Zt=0;for(Qt=dr===0?"":Qt[0]+" ";Zt<Ht;++Zt)jt[Zt]=rt(Qt,jt[Zt],Gt).trim();break;default:var Jt=Zt=0;for(jt=[];Zt<Ht;++Zt)for(var tr=0;tr<dr;++tr)jt[Jt++]=rt(Qt[tr]+" ",rr[Zt],Gt).trim()}return jt}function rt(Qt,jt,Gt){var rr=jt.charCodeAt(0);switch(33>rr&&(rr=(jt=jt.trim()).charCodeAt(0)),rr){case 38:return jt.replace(gt,"$1"+Qt.trim());case 58:return Qt.trim()+jt.replace(gt,"$1"+Qt.trim());default:if(0<1*Gt&&0<jt.indexOf("\f"))return jt.replace(gt,(Qt.charCodeAt(0)===58?"":"$1")+Qt.trim())}return Qt+jt}function nt(Qt,jt,Gt,rr){var Ht=Qt+";",dr=2*jt+3*Gt+4*rr;if(dr===944){Qt=Ht.indexOf(":",9)+1;var Zt=Ht.substring(Qt,Ht.length-1).trim();return Zt=Ht.substring(0,Qt).trim()+Zt+";",Ut===1||Ut===2&&ot(Zt,1)?"-webkit-"+Zt+Zt:Zt}if(Ut===0||Ut===2&&!ot(Ht,1))return Ht;switch(dr){case 1015:return Ht.charCodeAt(10)===97?"-webkit-"+Ht+Ht:Ht;case 951:return Ht.charCodeAt(3)===116?"-webkit-"+Ht+Ht:Ht;case 963:return Ht.charCodeAt(5)===110?"-webkit-"+Ht+Ht:Ht;case 1009:if(Ht.charCodeAt(4)!==100)break;case 969:case 942:return"-webkit-"+Ht+Ht;case 978:return"-webkit-"+Ht+"-moz-"+Ht+Ht;case 1019:case 983:return"-webkit-"+Ht+"-moz-"+Ht+"-ms-"+Ht+Ht;case 883:if(Ht.charCodeAt(8)===45)return"-webkit-"+Ht+Ht;if(0<Ht.indexOf("image-set(",11))return Ht.replace(Nt,"$1-webkit-$2")+Ht;break;case 932:if(Ht.charCodeAt(4)===45)switch(Ht.charCodeAt(5)){case 103:return"-webkit-box-"+Ht.replace("-grow","")+"-webkit-"+Ht+"-ms-"+Ht.replace("grow","positive")+Ht;case 115:return"-webkit-"+Ht+"-ms-"+Ht.replace("shrink","negative")+Ht;case 98:return"-webkit-"+Ht+"-ms-"+Ht.replace("basis","preferred-size")+Ht}return"-webkit-"+Ht+"-ms-"+Ht+Ht;case 964:return"-webkit-"+Ht+"-ms-flex-"+Ht+Ht;case 1023:if(Ht.charCodeAt(8)!==99)break;return Zt=Ht.substring(Ht.indexOf(":",15)).replace("flex-","").replace("space-between","justify"),"-webkit-box-pack"+Zt+"-webkit-"+Ht+"-ms-flex-pack"+Zt+Ht;case 1005:return ft.test(Ht)?Ht.replace(mt,":-webkit-")+Ht.replace(mt,":-moz-")+Ht:Ht;case 1e3:switch(Zt=Ht.substring(13).trim(),jt=Zt.indexOf("-")+1,Zt.charCodeAt(0)+Zt.charCodeAt(jt)){case 226:Zt=Ht.replace(Et,"tb");break;case 232:Zt=Ht.replace(Et,"tb-rl");break;case 220:Zt=Ht.replace(Et,"lr");break;default:return Ht}return"-webkit-"+Ht+"-ms-"+Zt+Ht;case 1017:if(Ht.indexOf("sticky",9)===-1)break;case 975:switch(jt=(Ht=Qt).length-10,Zt=(Ht.charCodeAt(jt)===33?Ht.substring(0,jt):Ht).substring(Qt.indexOf(":",7)+1).trim(),dr=Zt.charCodeAt(0)+(Zt.charCodeAt(7)|0)){case 203:if(111>Zt.charCodeAt(8))break;case 115:Ht=Ht.replace(Zt,"-webkit-"+Zt)+";"+Ht;break;case 207:case 102:Ht=Ht.replace(Zt,"-webkit-"+(102<dr?"inline-":"")+"box")+";"+Ht.replace(Zt,"-webkit-"+Zt)+";"+Ht.replace(Zt,"-ms-"+Zt+"box")+";"+Ht}return Ht+";";case 938:if(Ht.charCodeAt(5)===45)switch(Ht.charCodeAt(6)){case 105:return Zt=Ht.replace("-items",""),"-webkit-"+Ht+"-webkit-box-"+Zt+"-ms-flex-"+Zt+Ht;case 115:return"-webkit-"+Ht+"-ms-flex-item-"+Ht.replace(At,"")+Ht;default:return"-webkit-"+Ht+"-ms-flex-line-pack"+Ht.replace("align-content","").replace(At,"")+Ht}break;case 973:case 989:if(Ht.charCodeAt(3)!==45||Ht.charCodeAt(4)===122)break;case 931:case 953:if(It.test(Qt)===!0)return(Zt=Qt.substring(Qt.indexOf(":")+1)).charCodeAt(0)===115?nt(Qt.replace("stretch","fill-available"),jt,Gt,rr).replace(":fill-available",":stretch"):Ht.replace(Zt,"-webkit-"+Zt)+Ht.replace(Zt,"-moz-"+Zt.replace("fill-",""))+Ht;break;case 962:if(Ht="-webkit-"+Ht+(Ht.charCodeAt(5)===102?"-ms-"+Ht:"")+Ht,Gt+rr===211&&Ht.charCodeAt(13)===105&&0<Ht.indexOf("transform",10))return Ht.substring(0,Ht.indexOf(";",27)+1).replace(pt,"$1-webkit-$2")+Ht}return Ht}function ot(Qt,jt){var Gt=Qt.indexOf(jt===1?":":"{"),rr=Qt.substring(0,jt!==3?Gt:10);return Gt=Qt.substring(Gt+1,Qt.length-1),qt(jt!==2?rr:rr.replace(kt,"$1"),Gt,jt)}function it(Qt,jt){var Gt=nt(jt,jt.charCodeAt(0),jt.charCodeAt(1),jt.charCodeAt(2));return Gt!==jt+";"?Gt.replace(St," or ($1)").substring(4):"("+jt+")"}function st(Qt,jt,Gt,rr,Ht,dr,Zt,Jt,tr,_t){for(var Bt=0,Vt=jt,er;Bt<Ft;++Bt)switch(er=Wt[Bt].call(lt,Qt,Vt,Gt,rr,Ht,dr,Zt,Jt,tr,_t)){case void 0:case!1:case!0:case null:break;default:Vt=er}if(Vt!==jt)return Vt}function at(Qt){switch(Qt){case void 0:case null:Ft=Wt.length=0;break;default:if(typeof Qt=="function")Wt[Ft++]=Qt;else if(typeof Qt=="object")for(var jt=0,Gt=Qt.length;jt<Gt;++jt)at(Qt[jt]);else Pt=!!Qt|0}return at}function ct(Qt){return Qt=Qt.prefix,Qt!==void 0&&(qt=null,Qt?typeof Qt!="function"?Ut=1:(Ut=2,qt=Qt):Ut=0),ct}function lt(Qt,jt){var Gt=Qt;if(33>Gt.charCodeAt(0)&&(Gt=Gt.trim()),Yt=Gt,Gt=[Yt],0<Ft){var rr=st(-1,jt,Gt,Gt,Mt,Lt,0,0,0,0);rr!==void 0&&typeof rr=="string"&&(jt=rr)}var Ht=o(Xt,Gt,jt,0,0);return 0<Ft&&(rr=st(-2,Ht,Gt,Gt,Mt,Lt,Ht.length,0,0,0),rr!==void 0&&(Ht=rr)),Yt="",zt=0,Lt=Mt=1,Ht}var dt=/^\0+/g,ht=/[\0\r\f]/g,mt=/: */g,ft=/zoo|gra/,pt=/([,: ])(transform)/g,yt=/,\r+?/g,gt=/([\t\r\n ])*\f?&/g,bt=/@(k\w+)\s*(\S*)\s*/,xt=/::(place)/g,vt=/:(read-only)/g,Et=/[svh]\w+-[tblr]{2}/,Ct=/\(\s*(.*)\s*\)/g,St=/([\s\S]*?);/g,At=/-self|flex-/g,kt=/[^]*?(:[rp][el]a[\w-]+)[^]*/,It=/stretch|:\s*\w+\-(?:conte|avail)/,Nt=/([^-])(image-set\()/,Lt=1,Mt=1,zt=0,Ut=1,Xt=[],Wt=[],Ft=0,qt=null,Pt=0,Yt="";return lt.use=at,lt.set=ct,et!==void 0&&ct(et),lt}var unitlessKeys={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function memoize(et){var o=Object.create(null);return function(tt){return o[tt]===void 0&&(o[tt]=et(tt)),o[tt]}}var reactPropsRegex=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,isPropValid=memoize(function(et){return reactPropsRegex.test(et)||et.charCodeAt(0)===111&&et.charCodeAt(1)===110&&et.charCodeAt(2)<91}),reactIs$1={exports:{}},reactIs_production_min={};/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var b$1=typeof Symbol=="function"&&Symbol.for,c=b$1?Symbol.for("react.element"):60103,d$1=b$1?Symbol.for("react.portal"):60106,e=b$1?Symbol.for("react.fragment"):60107,f=b$1?Symbol.for("react.strict_mode"):60108,g$1=b$1?Symbol.for("react.profiler"):60114,h$1=b$1?Symbol.for("react.provider"):60109,k$1=b$1?Symbol.for("react.context"):60110,l=b$1?Symbol.for("react.async_mode"):60111,m$2=b$1?Symbol.for("react.concurrent_mode"):60111,n=b$1?Symbol.for("react.forward_ref"):60112,p=b$1?Symbol.for("react.suspense"):60113,q$1=b$1?Symbol.for("react.suspense_list"):60120,r$2=b$1?Symbol.for("react.memo"):60115,t=b$1?Symbol.for("react.lazy"):60116,v$1=b$1?Symbol.for("react.block"):60121,w$2=b$1?Symbol.for("react.fundamental"):60117,x$1=b$1?Symbol.for("react.responder"):60118,y$2=b$1?Symbol.for("react.scope"):60119;function z$1(et){if(typeof et=="object"&&et!==null){var o=et.$$typeof;switch(o){case c:switch(et=et.type,et){case l:case m$2:case e:case g$1:case f:case p:return et;default:switch(et=et&&et.$$typeof,et){case k$1:case n:case t:case r$2:case h$1:return et;default:return o}}case d$1:return o}}}function A(et){return z$1(et)===m$2}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m$2;reactIs_production_min.ContextConsumer=k$1;reactIs_production_min.ContextProvider=h$1;reactIs_production_min.Element=c;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r$2;reactIs_production_min.Portal=d$1;reactIs_production_min.Profiler=g$1;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(et){return A(et)||z$1(et)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(et){return z$1(et)===k$1};reactIs_production_min.isContextProvider=function(et){return z$1(et)===h$1};reactIs_production_min.isElement=function(et){return typeof et=="object"&&et!==null&&et.$$typeof===c};reactIs_production_min.isForwardRef=function(et){return z$1(et)===n};reactIs_production_min.isFragment=function(et){return z$1(et)===e};reactIs_production_min.isLazy=function(et){return z$1(et)===t};reactIs_production_min.isMemo=function(et){return z$1(et)===r$2};reactIs_production_min.isPortal=function(et){return z$1(et)===d$1};reactIs_production_min.isProfiler=function(et){return z$1(et)===g$1};reactIs_production_min.isStrictMode=function(et){return z$1(et)===f};reactIs_production_min.isSuspense=function(et){return z$1(et)===p};reactIs_production_min.isValidElementType=function(et){return typeof et=="string"||typeof et=="function"||et===e||et===m$2||et===g$1||et===f||et===p||et===q$1||typeof et=="object"&&et!==null&&(et.$$typeof===t||et.$$typeof===r$2||et.$$typeof===h$1||et.$$typeof===k$1||et.$$typeof===n||et.$$typeof===w$2||et.$$typeof===x$1||et.$$typeof===y$2||et.$$typeof===v$1)};reactIs_production_min.typeOf=z$1;reactIs$1.exports=reactIs_production_min;var reactIsExports=reactIs$1.exports,reactIs=reactIsExports,REACT_STATICS={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},KNOWN_STATICS={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},FORWARD_REF_STATICS={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},MEMO_STATICS={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},TYPE_STATICS={};TYPE_STATICS[reactIs.ForwardRef]=FORWARD_REF_STATICS;TYPE_STATICS[reactIs.Memo]=MEMO_STATICS;function getStatics(et){return reactIs.isMemo(et)?MEMO_STATICS:TYPE_STATICS[et.$$typeof]||REACT_STATICS}var defineProperty$2=Object.defineProperty,getOwnPropertyNames=Object.getOwnPropertyNames,getOwnPropertySymbols=Object.getOwnPropertySymbols,getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,getPrototypeOf=Object.getPrototypeOf,objectPrototype=Object.prototype;function hoistNonReactStatics(et,o,tt){if(typeof o!="string"){if(objectPrototype){var rt=getPrototypeOf(o);rt&&rt!==objectPrototype&&hoistNonReactStatics(et,rt,tt)}var nt=getOwnPropertyNames(o);getOwnPropertySymbols&&(nt=nt.concat(getOwnPropertySymbols(o)));for(var ot=getStatics(et),it=getStatics(o),st=0;st<nt.length;++st){var at=nt[st];if(!KNOWN_STATICS[at]&&!(tt&&tt[at])&&!(it&&it[at])&&!(ot&&ot[at])){var ct=getOwnPropertyDescriptor(o,at);try{defineProperty$2(et,at,ct)}catch{}}}}return et}var hoistNonReactStatics_cjs=hoistNonReactStatics;const m$1=getDefaultExportFromCjs(hoistNonReactStatics_cjs);var define_process_default$1={env:{NODE_ENV:'"production"',VITE_WALLETCONNECT_PROJECT_ID:'"1d93edc21291f98e3bed6ff7617ff539"'},nextTick:"setImmediate",platform:'"browser"',version:'"v16.0.0"',browser:!0},define_process_env_default={};function y$1(){return(y$1=Object.assign||function(et){for(var o=1;o<arguments.length;o++){var tt=arguments[o];for(var rt in tt)Object.prototype.hasOwnProperty.call(tt,rt)&&(et[rt]=tt[rt])}return et}).apply(this,arguments)}var v=function(et,o){for(var tt=[et[0]],rt=0,nt=o.length;rt<nt;rt+=1)tt.push(o[rt],et[rt+1]);return tt},g=function(et){return et!==null&&typeof et=="object"&&(et.toString?et.toString():Object.prototype.toString.call(et))==="[object Object]"&&!reactIsExports$1.typeOf(et)},S=Object.freeze([]),w$1=Object.freeze({});function E(et){return typeof et=="function"}function b(et){return et.displayName||et.name||"Component"}function _(et){return et&&typeof et.styledComponentId=="string"}var N=typeof define_process_default$1<"u"&&define_process_env_default!==void 0&&(define_process_env_default.REACT_APP_SC_ATTR||define_process_env_default.SC_ATTR)||"data-styled",C=typeof window<"u"&&"HTMLElement"in window,I=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof define_process_default$1<"u"&&define_process_env_default!==void 0&&(define_process_env_default.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&define_process_env_default.REACT_APP_SC_DISABLE_SPEEDY!==""?define_process_env_default.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&define_process_env_default.REACT_APP_SC_DISABLE_SPEEDY:define_process_env_default.SC_DISABLE_SPEEDY!==void 0&&define_process_env_default.SC_DISABLE_SPEEDY!==""&&define_process_env_default.SC_DISABLE_SPEEDY!=="false"&&define_process_env_default.SC_DISABLE_SPEEDY));function D(et){for(var o=arguments.length,tt=new Array(o>1?o-1:0),rt=1;rt<o;rt++)tt[rt-1]=arguments[rt];throw new Error("An error occurred. See https://git.io/JUIaE#"+et+" for more information."+(tt.length>0?" Args: "+tt.join(", "):""))}var j=function(){function et(tt){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=tt}var o=et.prototype;return o.indexOfGroup=function(tt){for(var rt=0,nt=0;nt<tt;nt++)rt+=this.groupSizes[nt];return rt},o.insertRules=function(tt,rt){if(tt>=this.groupSizes.length){for(var nt=this.groupSizes,ot=nt.length,it=ot;tt>=it;)(it<<=1)<0&&D(16,""+tt);this.groupSizes=new Uint32Array(it),this.groupSizes.set(nt),this.length=it;for(var st=ot;st<it;st++)this.groupSizes[st]=0}for(var at=this.indexOfGroup(tt+1),ct=0,lt=rt.length;ct<lt;ct++)this.tag.insertRule(at,rt[ct])&&(this.groupSizes[tt]++,at++)},o.clearGroup=function(tt){if(tt<this.length){var rt=this.groupSizes[tt],nt=this.indexOfGroup(tt),ot=nt+rt;this.groupSizes[tt]=0;for(var it=nt;it<ot;it++)this.tag.deleteRule(nt)}},o.getGroup=function(tt){var rt="";if(tt>=this.length||this.groupSizes[tt]===0)return rt;for(var nt=this.groupSizes[tt],ot=this.indexOfGroup(tt),it=ot+nt,st=ot;st<it;st++)rt+=this.tag.getRule(st)+`/*!sc*/
`;return rt},et}(),T=new Map,x=new Map,k=1,V$1=function(et){if(T.has(et))return T.get(et);for(;x.has(k);)k++;var o=k++;return T.set(et,o),x.set(o,et),o},B=function(et){return x.get(et)},z=function(et,o){o>=k&&(k=o+1),T.set(et,o),x.set(o,et)},M="style["+N+'][data-styled-version="5.3.11"]',G=new RegExp("^"+N+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),L=function(et,o,tt){for(var rt,nt=tt.split(","),ot=0,it=nt.length;ot<it;ot++)(rt=nt[ot])&&et.registerName(o,rt)},F=function(et,o){for(var tt=(o.textContent||"").split(`/*!sc*/
`),rt=[],nt=0,ot=tt.length;nt<ot;nt++){var it=tt[nt].trim();if(it){var st=it.match(G);if(st){var at=0|parseInt(st[1],10),ct=st[2];at!==0&&(z(ct,at),L(et,ct,st[3]),et.getTag().insertRules(at,rt)),rt.length=0}else rt.push(it)}}},Y=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null},q=function(et){var o=document.head,tt=et||o,rt=document.createElement("style"),nt=function(st){for(var at=st.childNodes,ct=at.length;ct>=0;ct--){var lt=at[ct];if(lt&&lt.nodeType===1&&lt.hasAttribute(N))return lt}}(tt),ot=nt!==void 0?nt.nextSibling:null;rt.setAttribute(N,"active"),rt.setAttribute("data-styled-version","5.3.11");var it=Y();return it&&rt.setAttribute("nonce",it),tt.insertBefore(rt,ot),rt},H=function(){function et(tt){var rt=this.element=q(tt);rt.appendChild(document.createTextNode("")),this.sheet=function(nt){if(nt.sheet)return nt.sheet;for(var ot=document.styleSheets,it=0,st=ot.length;it<st;it++){var at=ot[it];if(at.ownerNode===nt)return at}D(17)}(rt),this.length=0}var o=et.prototype;return o.insertRule=function(tt,rt){try{return this.sheet.insertRule(rt,tt),this.length++,!0}catch{return!1}},o.deleteRule=function(tt){this.sheet.deleteRule(tt),this.length--},o.getRule=function(tt){var rt=this.sheet.cssRules[tt];return rt!==void 0&&typeof rt.cssText=="string"?rt.cssText:""},et}(),$=function(){function et(tt){var rt=this.element=q(tt);this.nodes=rt.childNodes,this.length=0}var o=et.prototype;return o.insertRule=function(tt,rt){if(tt<=this.length&&tt>=0){var nt=document.createTextNode(rt),ot=this.nodes[tt];return this.element.insertBefore(nt,ot||null),this.length++,!0}return!1},o.deleteRule=function(tt){this.element.removeChild(this.nodes[tt]),this.length--},o.getRule=function(tt){return tt<this.length?this.nodes[tt].textContent:""},et}(),W=function(){function et(tt){this.rules=[],this.length=0}var o=et.prototype;return o.insertRule=function(tt,rt){return tt<=this.length&&(this.rules.splice(tt,0,rt),this.length++,!0)},o.deleteRule=function(tt){this.rules.splice(tt,1),this.length--},o.getRule=function(tt){return tt<this.length?this.rules[tt]:""},et}(),U=C,J={isServer:!C,useCSSOMInjection:!I},X=function(){function et(tt,rt,nt){tt===void 0&&(tt=w$1),rt===void 0&&(rt={}),this.options=y$1({},J,{},tt),this.gs=rt,this.names=new Map(nt),this.server=!!tt.isServer,!this.server&&C&&U&&(U=!1,function(ot){for(var it=document.querySelectorAll(M),st=0,at=it.length;st<at;st++){var ct=it[st];ct&&ct.getAttribute(N)!=="active"&&(F(ot,ct),ct.parentNode&&ct.parentNode.removeChild(ct))}}(this))}et.registerId=function(tt){return V$1(tt)};var o=et.prototype;return o.reconstructWithOptions=function(tt,rt){return rt===void 0&&(rt=!0),new et(y$1({},this.options,{},tt),this.gs,rt&&this.names||void 0)},o.allocateGSInstance=function(tt){return this.gs[tt]=(this.gs[tt]||0)+1},o.getTag=function(){return this.tag||(this.tag=(nt=(rt=this.options).isServer,ot=rt.useCSSOMInjection,it=rt.target,tt=nt?new W(it):ot?new H(it):new $(it),new j(tt)));var tt,rt,nt,ot,it},o.hasNameForId=function(tt,rt){return this.names.has(tt)&&this.names.get(tt).has(rt)},o.registerName=function(tt,rt){if(V$1(tt),this.names.has(tt))this.names.get(tt).add(rt);else{var nt=new Set;nt.add(rt),this.names.set(tt,nt)}},o.insertRules=function(tt,rt,nt){this.registerName(tt,rt),this.getTag().insertRules(V$1(tt),nt)},o.clearNames=function(tt){this.names.has(tt)&&this.names.get(tt).clear()},o.clearRules=function(tt){this.getTag().clearGroup(V$1(tt)),this.clearNames(tt)},o.clearTag=function(){this.tag=void 0},o.toString=function(){return function(tt){for(var rt=tt.getTag(),nt=rt.length,ot="",it=0;it<nt;it++){var st=B(it);if(st!==void 0){var at=tt.names.get(st),ct=rt.getGroup(it);if(at&&ct&&at.size){var lt=N+".g"+it+'[id="'+st+'"]',dt="";at!==void 0&&at.forEach(function(ht){ht.length>0&&(dt+=ht+",")}),ot+=""+ct+lt+'{content:"'+dt+`"}/*!sc*/
`}}}return ot}(this)},et}(),Z=/(a)(d)/gi,K=function(et){return String.fromCharCode(et+(et>25?39:97))};function Q(et){var o,tt="";for(o=Math.abs(et);o>52;o=o/52|0)tt=K(o%52)+tt;return(K(o%52)+tt).replace(Z,"$1-$2")}var ee=function(et,o){for(var tt=o.length;tt;)et=33*et^o.charCodeAt(--tt);return et},te=function(et){return ee(5381,et)};function ne(et){for(var o=0;o<et.length;o+=1){var tt=et[o];if(E(tt)&&!_(tt))return!1}return!0}var re$1=te("5.3.11"),oe=function(){function et(o,tt,rt){this.rules=o,this.staticRulesId="",this.isStatic=(rt===void 0||rt.isStatic)&&ne(o),this.componentId=tt,this.baseHash=ee(re$1,tt),this.baseStyle=rt,X.registerId(tt)}return et.prototype.generateAndInjectStyles=function(o,tt,rt){var nt=this.componentId,ot=[];if(this.baseStyle&&ot.push(this.baseStyle.generateAndInjectStyles(o,tt,rt)),this.isStatic&&!rt.hash)if(this.staticRulesId&&tt.hasNameForId(nt,this.staticRulesId))ot.push(this.staticRulesId);else{var it=_e(this.rules,o,tt,rt).join(""),st=Q(ee(this.baseHash,it)>>>0);if(!tt.hasNameForId(nt,st)){var at=rt(it,"."+st,void 0,nt);tt.insertRules(nt,st,at)}ot.push(st),this.staticRulesId=st}else{for(var ct=this.rules.length,lt=ee(this.baseHash,rt.hash),dt="",ht=0;ht<ct;ht++){var mt=this.rules[ht];if(typeof mt=="string")dt+=mt;else if(mt){var ft=_e(mt,o,tt,rt),pt=Array.isArray(ft)?ft.join(""):ft;lt=ee(lt,pt+ht),dt+=pt}}if(dt){var yt=Q(lt>>>0);if(!tt.hasNameForId(nt,yt)){var gt=rt(dt,"."+yt,void 0,nt);tt.insertRules(nt,yt,gt)}ot.push(yt)}}return ot.join(" ")},et}(),se=/^\s*\/\/.*$/gm,ie=[":","[",".","#"];function ae(et){var o,tt,rt,nt,ot=w$1,it=ot.options,st=it===void 0?w$1:it,at=ot.plugins,ct=at===void 0?S:at,lt=new stylis_min(st),dt=[],ht=function(pt){function yt(gt){if(gt)try{pt(gt+"}")}catch{}}return function(gt,bt,xt,vt,Et,Ct,St,At,kt,It){switch(gt){case 1:if(kt===0&&bt.charCodeAt(0)===64)return pt(bt+";"),"";break;case 2:if(At===0)return bt+"/*|*/";break;case 3:switch(At){case 102:case 112:return pt(xt[0]+bt),"";default:return bt+(It===0?"/*|*/":"")}case-2:bt.split("/*|*/}").forEach(yt)}}}(function(pt){dt.push(pt)}),mt=function(pt,yt,gt){return yt===0&&ie.indexOf(gt[tt.length])!==-1||gt.match(nt)?pt:"."+o};function ft(pt,yt,gt,bt){bt===void 0&&(bt="&");var xt=pt.replace(se,""),vt=yt&&gt?gt+" "+yt+" { "+xt+" }":xt;return o=bt,tt=yt,rt=new RegExp("\\"+tt+"\\b","g"),nt=new RegExp("(\\"+tt+"\\b){2,}"),lt(gt||!yt?"":yt,vt)}return lt.use([].concat(ct,[function(pt,yt,gt){pt===2&&gt.length&&gt[0].lastIndexOf(tt)>0&&(gt[0]=gt[0].replace(rt,mt))},ht,function(pt){if(pt===-2){var yt=dt;return dt=[],yt}}])),ft.hash=ct.length?ct.reduce(function(pt,yt){return yt.name||D(15),ee(pt,yt.name)},5381).toString():"",ft}var ce=React.createContext();ce.Consumer;var le=React.createContext(),de=(le.Consumer,new X),he=ae();function pe(){return reactExports.useContext(ce)||de}function fe(){return reactExports.useContext(le)||he}var ye=function(){function et(o,tt){var rt=this;this.inject=function(nt,ot){ot===void 0&&(ot=he);var it=rt.name+ot.hash;nt.hasNameForId(rt.id,it)||nt.insertRules(rt.id,it,ot(rt.rules,it,"@keyframes"))},this.toString=function(){return D(12,String(rt.name))},this.name=o,this.id="sc-keyframes-"+o,this.rules=tt}return et.prototype.getName=function(o){return o===void 0&&(o=he),this.name+o.hash},et}(),ve=/([A-Z])/,ge=/([A-Z])/g,Se=/^ms-/,we=function(et){return"-"+et.toLowerCase()};function Ee(et){return ve.test(et)?et.replace(ge,we).replace(Se,"-ms-"):et}var be=function(et){return et==null||et===!1||et===""};function _e(et,o,tt,rt){if(Array.isArray(et)){for(var nt,ot=[],it=0,st=et.length;it<st;it+=1)(nt=_e(et[it],o,tt,rt))!==""&&(Array.isArray(nt)?ot.push.apply(ot,nt):ot.push(nt));return ot}if(be(et))return"";if(_(et))return"."+et.styledComponentId;if(E(et)){if(typeof(ct=et)!="function"||ct.prototype&&ct.prototype.isReactComponent||!o)return et;var at=et(o);return _e(at,o,tt,rt)}var ct;return et instanceof ye?tt?(et.inject(tt,rt),et.getName(rt)):et:g(et)?function lt(dt,ht){var mt,ft,pt=[];for(var yt in dt)dt.hasOwnProperty(yt)&&!be(dt[yt])&&(Array.isArray(dt[yt])&&dt[yt].isCss||E(dt[yt])?pt.push(Ee(yt)+":",dt[yt],";"):g(dt[yt])?pt.push.apply(pt,lt(dt[yt],yt)):pt.push(Ee(yt)+": "+(mt=yt,(ft=dt[yt])==null||typeof ft=="boolean"||ft===""?"":typeof ft!="number"||ft===0||mt in unitlessKeys||mt.startsWith("--")?String(ft).trim():ft+"px")+";"));return ht?[ht+" {"].concat(pt,["}"]):pt}(et):et.toString()}var Ne=function(et){return Array.isArray(et)&&(et.isCss=!0),et};function Ae(et){for(var o=arguments.length,tt=new Array(o>1?o-1:0),rt=1;rt<o;rt++)tt[rt-1]=arguments[rt];return E(et)||g(et)?Ne(_e(v(S,[et].concat(tt)))):tt.length===0&&et.length===1&&typeof et[0]=="string"?et:Ne(_e(v(et,tt)))}var Oe=function(et,o,tt){return tt===void 0&&(tt=w$1),et.theme!==tt.theme&&et.theme||o||tt.theme},Re=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,De=/(^-|-$)/g;function je(et){return et.replace(Re,"-").replace(De,"")}var Te=function(et){return Q(te(et)>>>0)};function xe(et){return typeof et=="string"&&!0}var ke=function(et){return typeof et=="function"||typeof et=="object"&&et!==null&&!Array.isArray(et)},Ve=function(et){return et!=="__proto__"&&et!=="constructor"&&et!=="prototype"};function Be(et,o,tt){var rt=et[tt];ke(o)&&ke(rt)?ze(rt,o):et[tt]=o}function ze(et){for(var o=arguments.length,tt=new Array(o>1?o-1:0),rt=1;rt<o;rt++)tt[rt-1]=arguments[rt];for(var nt=0,ot=tt;nt<ot.length;nt++){var it=ot[nt];if(ke(it))for(var st in it)Ve(st)&&Be(et,it[st],st)}return et}var Me=React.createContext();Me.Consumer;function Le(et){var o=reactExports.useContext(Me),tt=reactExports.useMemo(function(){return function(rt,nt){if(!rt)return D(14);if(E(rt)){var ot=rt(nt);return ot}return Array.isArray(rt)||typeof rt!="object"?D(8):nt?y$1({},nt,{},rt):rt}(et.theme,o)},[et.theme,o]);return et.children?React.createElement(Me.Provider,{value:tt},et.children):null}var Fe={};function Ye(et,o,tt){var rt=_(et),nt=!xe(et),ot=o.attrs,it=ot===void 0?S:ot,st=o.componentId,at=st===void 0?function(bt,xt){var vt=typeof bt!="string"?"sc":je(bt);Fe[vt]=(Fe[vt]||0)+1;var Et=vt+"-"+Te("5.3.11"+vt+Fe[vt]);return xt?xt+"-"+Et:Et}(o.displayName,o.parentComponentId):st,ct=o.displayName,lt=ct===void 0?function(bt){return xe(bt)?"styled."+bt:"Styled("+b(bt)+")"}(et):ct,dt=o.displayName&&o.componentId?je(o.displayName)+"-"+o.componentId:o.componentId||at,ht=rt&&et.attrs?Array.prototype.concat(et.attrs,it).filter(Boolean):it,mt=o.shouldForwardProp;rt&&et.shouldForwardProp&&(mt=o.shouldForwardProp?function(bt,xt,vt){return et.shouldForwardProp(bt,xt,vt)&&o.shouldForwardProp(bt,xt,vt)}:et.shouldForwardProp);var ft,pt=new oe(tt,dt,rt?et.componentStyle:void 0),yt=pt.isStatic&&it.length===0,gt=function(bt,xt){return function(vt,Et,Ct,St){var At=vt.attrs,kt=vt.componentStyle,It=vt.defaultProps,Nt=vt.foldedComponentIds,Lt=vt.shouldForwardProp,Mt=vt.styledComponentId,zt=vt.target,Ut=function(rr,Ht,dr){rr===void 0&&(rr=w$1);var Zt=y$1({},Ht,{theme:rr}),Jt={};return dr.forEach(function(tr){var _t,Bt,Vt,er=tr;for(_t in E(er)&&(er=er(Zt)),er)Zt[_t]=Jt[_t]=_t==="className"?(Bt=Jt[_t],Vt=er[_t],Bt&&Vt?Bt+" "+Vt:Bt||Vt):er[_t]}),[Zt,Jt]}(Oe(Et,reactExports.useContext(Me),It)||w$1,Et,At),Xt=Ut[0],Wt=Ut[1],Ft=function(rr,Ht,dr,Zt){var Jt=pe(),tr=fe(),_t=Ht?rr.generateAndInjectStyles(w$1,Jt,tr):rr.generateAndInjectStyles(dr,Jt,tr);return _t}(kt,St,Xt),qt=Ct,Pt=Wt.$as||Et.$as||Wt.as||Et.as||zt,Yt=xe(Pt),Qt=Wt!==Et?y$1({},Et,{},Wt):Et,jt={};for(var Gt in Qt)Gt[0]!=="$"&&Gt!=="as"&&(Gt==="forwardedAs"?jt.as=Qt[Gt]:(Lt?Lt(Gt,isPropValid,Pt):!Yt||isPropValid(Gt))&&(jt[Gt]=Qt[Gt]));return Et.style&&Wt.style!==Et.style&&(jt.style=y$1({},Et.style,{},Wt.style)),jt.className=Array.prototype.concat(Nt,Mt,Ft!==Mt?Ft:null,Et.className,Wt.className).filter(Boolean).join(" "),jt.ref=qt,reactExports.createElement(Pt,jt)}(ft,bt,xt,yt)};return gt.displayName=lt,(ft=React.forwardRef(gt)).attrs=ht,ft.componentStyle=pt,ft.displayName=lt,ft.shouldForwardProp=mt,ft.foldedComponentIds=rt?Array.prototype.concat(et.foldedComponentIds,et.styledComponentId):S,ft.styledComponentId=dt,ft.target=rt?et.target:et,ft.withComponent=function(bt){var xt=o.componentId,vt=function(Ct,St){if(Ct==null)return{};var At,kt,It={},Nt=Object.keys(Ct);for(kt=0;kt<Nt.length;kt++)At=Nt[kt],St.indexOf(At)>=0||(It[At]=Ct[At]);return It}(o,["componentId"]),Et=xt&&xt+"-"+(xe(bt)?bt:je(b(bt)));return Ye(bt,y$1({},vt,{attrs:ht,componentId:Et}),tt)},Object.defineProperty(ft,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(bt){this._foldedDefaultProps=rt?ze({},et.defaultProps,bt):bt}}),Object.defineProperty(ft,"toString",{value:function(){return"."+ft.styledComponentId}}),nt&&m$1(ft,et,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),ft}var qe=function(et){return function o(tt,rt,nt){if(nt===void 0&&(nt=w$1),!reactIsExports$1.isValidElementType(rt))return D(1,String(rt));var ot=function(){return tt(rt,nt,Ae.apply(void 0,arguments))};return ot.withConfig=function(it){return o(tt,rt,y$1({},nt,{},it))},ot.attrs=function(it){return o(tt,rt,y$1({},nt,{attrs:Array.prototype.concat(nt.attrs,it).filter(Boolean)}))},ot}(Ye,et)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(et){qe[et]=qe(et)});function We(et){for(var o=arguments.length,tt=new Array(o>1?o-1:0),rt=1;rt<o;rt++)tt[rt-1]=arguments[rt];var nt=Ae.apply(void 0,[et].concat(tt)).join(""),ot=Te(nt);return new ye(ot,nt)}var COMPRESSED$1="AEkU4AngDVgB0QKRAQYBOwDqATEAnwDbAIUApABsAOAAbwCRAEYAiQBPAHYAPgA+ACsANwAlAGMAHwAvACsAJQAWAC8AGwAiACIALwAUACsAEQAiAAsAGwARABcAGAA6ACkALAAsADUAFgAsABEAHQAhAA8AGwAdABUAFgAZAA0ADQAXABAAGQAUABIEqgYJAR4UFjfDBdMAsQCuPwFnAKUBA10jAK5/Ly8vLwE/pwUJ6/0HPwbkMQVXBVgAPSs5APa2EQbIwQuUCkEDyJ4zAsUKLwKOoQKG2D+Ob4kCxcsCg/IBH98JAPKtAUECLY0KP48A4wDiChUAF9S5yAwLPZ0EG3cA/QI5GL0P6wkGKekFBIFnDRsHLQCrAGmR76WcfwBbBpMjBukAGwA7DJMAWxVbqfu75wzbIM8IuykDsRQ7APcta6MAoX0YABcEJdcWAR0AuRnNBPoJIEw3CZcJiB4bVllM44NCABMADAAVAA5rVAAhAA4AR+4V2D3zOVjKleYuChAdX01YPewAEwAMABUADmsgXECXAMPrABsAOQzFABsVW6n7Adq4HB0FWwXiAtCfAsSwCkwcpGUUcxptTPUAuw1nAuEACy00iRfJkQKBewETGwC9DWcC4QALLQFIUCWRTAoDLfsFMgnXaRetAddDAEkrEncCMRYhAusnuTdrADnhAfUlAMcOy7UBG2OBALEFAAUAitNJBRvDHwcXAKgn0QGhKy0DmwBnAQoZPu03dAQYFwCqAccCIQDTKxJzOvNQsAWQOncnNUgF+icFWQVYr7gFaTtdQhI6WEGXe5NmX6H4CxMDxQcl8XcjBKNLAlNTAnUbqycBj6OlNVsDRRcEg2EJANEGqz8vIwcpAjldAGsBYR9xAIMdGQCVAUm3ACdpFwGvxQM3LSFDUwFvWQZlAmUA8UkXAykBBQBJQQCrAF0AcwArtQYH8+8ZjX8ACSEAKQCzG0cB0QHbBwsxl3iB6AAKABEANAA9ADgzd3nTwBBfEFwBTQlMbDoVCwKsD6YL5REVDNEqy9PYADSpB+sDUwfrA1MDUwfrB+sDUwfrA1MDUwNTA1McCvAa08AQXw9IBG0FjgWLBNYIgyZJEYEHKAjSVA10HhxHA0UA/CMlSRw7kzMLJUJMDE0DB/w2QmynfTgDRzGrVPWQogPLMk85bAEecRKgACoPcxw1tU5+ekdxoApLT661f0liTmcCvjqoP/gKIQmTb7t3TgY9EBcnoRDzDC8BsQE3DelL1ATtBjcExR95GRUPyZWYCKEt2QzpJt8unYBWI/EqfwXpS/A82QtJUWQPVQthCd86X4FKAx0BCSKHCtkNNQhpEO8KxWcN4RFBBzUD0UmWAKEG/QsNHTEVsSYMYqgLBTlzBvca8guLJqsTJXr4Bc8aHQZJASUa+wDLLuOFrFotXBhPWwX/CyEjwxSkUBwNIUCzeEQaFwcRJaUCjUNsSoNRMh6PIfI8OQ1iLg9ReAfxPAEZSwt9PJpGp0UKEc4+iT1EIkVMKAQxeywrJ4cJyw+BDLV8bgFVCR0JrQxtEy0REzfBCDUHFSmXICcRCB1GkWCWBPObA+8TzQMHBTsJPQcPA7EcKRMqFSUFCYEg0wLvNtEurwKLVnwBEwXHDyEf2xBMR9wO5QiXAmEDfyXnACkVHQATIpcIP18AW4/UUwEuxwjDamgjcANjFONdEW8HjQ5TB6McLxW7HN1wxF4HhgQon6sJVwFxCZUBWwTfCAU1V4ycID1nT4tUGJcgXUE7XfgCLQxhFZtEuYd0AocPZxIXATEBbwc1DP0CcxHpEWcQkQjnhgA1sTP0OiEESyF/IA0KIwNLbMoLIyb1DPRlAZ8SXgMINDl36menYLIgF/kHFTLBQVwh7QuOT8kMmBq9GD5UKhngB7sD7xrvJ+ZBUwX7A58POkkz6gS5C2UIhwk7AEUOnxMH0xhmCm2MzAEthwGzlQNTjX8Ca4sGMwcHAGMHgwV14QAZAqMInwABAMsDUwA1AqkHmQAVAIE9ATkDIysBHeECiwOPCC3HAZErAe8lBBe/DBEA8zNuRgLDrQKAZmaeBdlUAooCRTEBSSEEAUpDTQOrbd0A1wBHBg/bQwERp0bHFt8/AdtrJwDDAPcAATEHAT0ByQHvaQCzAVsLLQmer7EBSeUlAH8AEWcB0wKFANkAMQB77QFPAEkFVfUFzwJLRQENLRQnU10BtwMbAS8BCQB1BseJocUDGwRpB88CEBcV3QLvKgexAyLbE8lCwQK92lEAMhIKNAq1CrQfX/NcLwItbj1MAAofpD7DP0oFTTtPO1Q7TztUO087VDtPO1Q7TztUA5O73rveCmhfQWHnDKIN0ETEOkUT12BNYC4TxC2zFL0VyiVSGTkauCcBJeBVBQ8ALc9mLAgoNHEXuAA7KWSDPWOCHiwKRxzjU41U9C0XAK1LnjOrDagbEUQ8BUN16WImFgoKHgJkfQJiPldJq1c3HAKh8wJolAJmBQKfgDgXBwJmNwJmIgRqBHsDfw8Dfo45AjlzEzl+Oh8fAmwZAjIyOAYCbcMCbarrhi9jQScBYwDaAN0ARgEHlAyJAPoHvgAJsQJ3KwJ2njsCeUc/Ani2GVjXRapG0wJ8OwJ6xAJ9BQJ87AVVBRxH/Eh5XyAAJxFJVEpXERNKyALQ/QLQyEsjA4hLA4fiRMGRLgLynVz/AwOqS8pMKSHLTUhNqwKLOwKK1L0XAxk/YwGzAo4zAo5YPJN9Ao7VAo5YdFGwUzEGUtBUgQKT9wKTCADlABhVGlWrVcwCLBcpkYIy3XhiRTc1ApebAu+uWB2kAFUhApaLApZ4mAClWahaBX1JADcClrEClkpcQFzNApnHAplgXMZdAxUCnJc5vjqZApwSAp+XAp60hgAZCy0mCwKd7QKejgCxOWEwYesCns8CoGoBpQKemxsCnkqhY8RkIyEnAierAiZ6AqD3AqBIAqLZAqHAAqYrAqXKAqf7AHkCp+5oeGit/0VqGGrNAqzfAqyqAq1jAqz+AlcZAlXYArHd0wMfSmyTArK5CQKy5BNs3G1fbURbAyXJArZYNztujAMpQQK4WgK5QxECuSZzcDJw3QK9FQK71nCSAzINAr6Ecf4DM20CvhZzHnNLAsPHAsMAc350RzFBdNwDPKMDPJYDPbsCxXgCxkMCxgyFAshlTQLIQALJSwLJKgJkmQLdznh1XXiqeSFLzAMYn2b+AmHwGe+VIHsHXo5etw0Cz2cCz2grR0/O7w+bAMKpAs9vASXmA04OfkcBAtwjAtuGAtJLA1JYA1NbAP0DVYiAhTvHEulcQYIYgs+CyoOJAtrDAtnahAyERac4A4ahACsDZAqGbVX1AFEC32EC3rRvcwLiK+0QAfMsIwH0lwHyzoMC6+8C6Wx1Aur1AurgAPVDAbUC7oUC65iWppb/Au47A4XcmHVw3HGdAvL/AGUDjhKZjwL3DwORagOSgwL3lAL51QL4YpoYmqe3M5saA51/Av72ARcANZ8Yn68DBYkDpmYDptUAzcEDBmahhKIBBQMMRQELARsHaQZdtWMBALcEZ7sNhx6vCQATcTUAHwMvEkkDhXsBXyMdAIzrAB0A5p8Dm40IswYbn8EApwURu+kdPT4WeAVoNz5AK0IhQrRfcRFfvACWxQUyAJBMGZu5OyZgMhG6zw4vGMYYicn2BVcFWAVXBVgFYwVYBVcFWAVXBVgFVwVYBVcFWEYVCNeFZwICAgpkXukrBMkDsQYvu7sAuwSnuwDnQCkWsgVGPmk+cEI/QrZfdTdf6ABYETOrAIz+zGvL/KbnRno9JiMEKxYnNjV+bd9qwfEZwixpAWvXbjAXBV8FasnBybgIz0lbAAAACnxefYu+ADM/gQADFtEG5a0jBQCMwwsDAQ0A5WUdPSQfSkKxQrxBOCNfJ2A2JzgjCcE9CkQ/Qz54PoE+cD5xAolCvElCO1/LTk9qTQosa1QvagtuH1/gMzobCWebCmIjKzwdJkKrQrwrzAHL/F/JDh8uCQgJIn6d32o6LUoXyavJrAllwcvMCmBBXw/lEKMRAJONHUVCJRupbTnOOAozP0M+cEI/HAcKHUxHbFssLVrhvBIKfe0dK0I/HF0ISgkOM1RDQjcEO0OcLAqBGy1CPxv1CFMiIxgwMQAFj2HwXgpxZMlgC2AtI25DYBk5AhseYLMGAmsQZU5gTREBZOdgFWCVYH1gs2BLYJFoFhcGtQ7cVam8WgtDFqsBuyvNwQIfFQAcAx4BeQJsLzCVUoABigq4RxoA5CN0jgrKDaZN6gGbAoecTwVAXwD39wkANBZXDAulDCQfuq9HAE8MNAAVE58rggh6AtILS2URGwDYTgZ1BAoeWgAxALa4AZonCxZvqyQ4nxkBWwGGCfwD2e0PBqoGSga5AB3LValaCbthE4kLLT8OuwG7ASICR1ooKCggHh8hLBImBiEMjQBUAm5XkEmVAW4fD3FHAdN1D85RIBmpsE3qBxEFTF8A9/cKAHoGJGwKKwulODAtx69WDQsAX7wLAGNAlQh6AOpN7yIbvwAxALa4AZonLTsOzgKQGHtQu1jIdHKO16WbDvWZFT0b7AEpEFwSBg8bAccJOhCTBRArDDYLABEAs84BAgCkAOEAmIIABWtXLwAUAFsbxi5sdioNwRACOyQz0+EcHgsbfQJ7Ls6hHATBCqrxbAA3OS0Opge7CQAQOi7OERkAfavaHA+7GkcczaF3HgE9Kl8cAuugCAHCAULz5B9lAb4Jtwz6CDwKPgAFwAs9AksNuwi8DTwKvC7OoSoJPA67BZgBG2sKD4sa4QHDARELuxY7AKALOxC7BBige9wAO2sMPAACpgm8BRvQ9QUBvgH6bsoGewAHuwG7D00RErwBAQDqAQAAdBVbBhbLFPxvF7sYOwAuuwLrDlaouwAeuwJVICp/AAG7AALjAAg7FTwVuwAbuwG9KOClWw6/xAD0AGj7L7ZtvgNIo7vIqDsDAbuVJ0sAAlsACrsEAOfdGbsIGnsIoQUK/3AA37unuxjbGruji3lyBvupm4MAErsGGwsBvAAAhgBtuwYAC7unOwEaO7oIoZzKAbsL7QfAqTsA4XsBvwAA5QAVuwAG+wAJuwBpiwAauwAOuwIYu45pFfsAAVsADmsALkseAAa7ABe7CCEADUoBwgC3ryYBwAAAtAAOmwG+J+QAsloAHBsBv/7hCqEABcYLFRXbAAebAEK7AQIAabsAC3sAHbsACLsJoQAFygBunxnVAJEIIQAFygABOwAH2wAdmwghAAaaAAl7ABsrAG0bAOa7gAAIWwAUuwkhAAbKAOOLAAk7C6EOxPtfAAc7AG6cQEgARwADOwAJrQM3AAcbABl7Abv/Aab7AAobAAo7AAn7p+sGuwAJGwADCwAQOwAAFDsAEWsAD4sADesADbsAGQsGFhsAFTsAbpsWswG7ALoAEzsDAGkrCgDhSwACOwAEUgAXewUbAAbQABi7AAv7AF+7AGv7AOSLAbsAF3YBvAABcguhAAVKHgF7KFIAOUUA/gcNDHIAKCpwAaQFCF4BvF4jDAkHb0tsXyqJHzwUYi02A6EKtAHYABYC0QNuAXZyR1IUIQNPAhU+ASwGA3NGvHtSekAAKQAxAfsAUwrbAHuQLAErAHblDREyRgFKAFcFAAFQAQeKzAB4OwQgpQBaANYVAJVoNx+LAM1rsQDP1BYIwnVzGxhWHQnRAYiQqyJTU01IEjzCifkAfxw3QCkr4BGXTwByASksMClCGQ8DMFUE98XuAEtl3ABqAnECPxF6Osd4LjXVBgUAEBsdCggMKgQfHSlOU04IuboAChLNACYAARoAhgCJAI41AO4AtADgAJ08ALsAqwCmAKEA8gCfANMAnADrAQwBBwDAAHkAWgDLAM0BBwDXAOsAiACiATUA4wDYANUDAQcqM9TU1NS2wNzN0M5DMhcBTQFXL0cBVQFkAWMBVgFHS0NFaA0BThUHCAMyNgwHACINJCYpLDg6Oj09PT4/DkAeUVFRUVNTUlMpVFVXVlYcXWFhYGJhI2ZocG9ycnJycnJ0dHR0dHR0dHR0dHZ2d3Z1WwBA7ABFAJYAdAAuAGLyAIoAUwBTADMCc+kAh//y8gBgAI/sAJsASwBeAGD5+aoAgQCBAGUAUgCtAB4AsgB/AjwCPwD4AOMA+gD6AOQA+wDlAOUA5ADiACkCdwFNATwBOgFQAToBOgE6ATUBNAE0ATQBGAFUDwArCAAATRcKFgMVFg4AigCSAKIASwBkGAItAHAAaQCRAxIDJCoDHkE+RykAiwJLAMMCUwKgALoCkgKSApICkgKSApIChwKSApICkgKSApICkgKRApEClAKcApMCkgKSApACkAKQApACjgKRAnEB0AKTApsCkgKSApEWeQsA+gUDpwJdAjYXAVAQNQLeEQorEwFKNxNNkQF3pDwBZVkA/wM9RwEAAJMpHhiPagApYABpAC4AiQOUzIvwroRaBborDsIRAZ3VdCoLBCMxbAEzWmwBsgDdfoB/foB+gYKCfoOGhH6FiIaAh4KIgol+in6LfoyKjX6Ofo+CkH6RfpJ+k36Ug5WIloKXftoC2WzhAtdsAIJsJGygAINsbARCBD8EQQREBEIESARFBEAERgRIBEcEQwRFBEgAlmZsAKMDh2wAtGYBBWwAyVFsbADPbAIMbAD2WmwA9gEZAPYA9AD0APUA9AN8XmzUhCNlvwD2APQA9AD1APQcbGwAiVpsAPYAiQEZAPYAiQLsAPYAiQN8XmzUhCNlvxxsAPdabAEZAPYA9gD0APQA9QD0APcA9AD0APUA9AN8XmzUhCNlvxxsbACJWmwBGQD2AIkA9gCJAuwA9gCJA3xebNSEI2W/HGwCQwE2bAJKATlsAkvBbGwCV2xsA54C7AOeA54DnwOfA58DnwN8XmzUhCNlvxxsbACJWmwBGQOeAIkDngCJAuwDngCJA3xebNSEI2W/HGwEN2wAiQQ4AIkGjTFtIC9s1m4DJmwA/QDGWgJsbABVWv4UMgJsbACJAmwAVAEAuV5sAmxebGwAiV5sAmxebD3YAEls1gJsbEZFNiJ9FGVAe8xvEZKvxVfKZszAVTBzYBH2d1iyUXEHH7twNw7eZF5JJRHI5EgaRr5D20/3dfONrFLSq5qSrrgd2CEUq722WBQ/LzpA+bx1oREI5xy4BDSZNun0ZWORUJqInZSyMaioyvfSI0l5uFDzbWaQ28/zdB0hwR4OQZ0/jn9ALSLNikjFYGfqR389qtFlhD3a6KdIh97rhZYpywuLc7o8ql5/X8KCbPU3L/QlmCowhRXhsGDvg6wUNprA9bM/49uxlAj7ZVy3ouEY/BgFXBNyK0TLrSjZWeJm/T4nz6QGLT3cJNtWRZVZTvIdtaxMMJRHgig9+S11LjBh7Inr06ykoch1U097Rw0hvgmOrydQyaWcEQDg0RavuMuT0zYabUZl1e33HNSK1oNUCS03eh+9C2EvF3fq9h+XBaAMFuoWeZf+mfZgL4HzyiKDIUtfNU4oFu0aE9qt3VA3U4D3fOSrAcYVnjG3cSkp1vhXZnp3JQm4JknKdBitO2NVnGCYQwU3YMWHWB87NEd+4AHuOKI8BSIH92reW0pfs+kWCTJxDCbRjFv8Cfc4/DSBYJScJYTeAEgg9wTEvcwd/QuHRHqGzAQ4fXf5FUI1lPrO+fvEcPl4JInM1z9AtBT2bL4QYEREe7KiSnnxTwtmAFjn8lqT3mND8qTktX2F16Ae9cakqJ6/pEQsHURqyqWlRMCzKXRKfCHT7sYHWx9/T/ugYTFY6iVN3Btm58ATJR5alYZybKMWojwOw3HbFn23NFyeLl7+Er82RchyYuBoGQ3j7SAWNxiYvp5U+Fq/DEzB9cG5DlJWsqkosRze92OVlCtQEYo1S1lF72Z8xWc4ld/+fFcfTEDTFb9d8tJGQ75dpJEvcWyGmGBiTbiWDdGOcw93Dmxq5ISUrmasygONfHLvhgo83HQZenbdBtSzBkvYrCEQ/xEDMhMZsN6gqplx5jGG9mSQLhM81UEdEeJ59sdNJDAFy/gPyJoKlwPZgB/MkC/kICLiCB8va+nCdO2ry4aDfkmPFpF/H/SGQ3LJ6aAv9dtJ8DniHtLOckZix0BVb0iR5V3LAp521LBSIi6AtV7r2ZB/hQEvAw54EFNOQcFnl1xGUIc67tqK1INNwD2n/RbwgzO9h45LM6VMuN8V1ZNIQ6t+Xy3lTqyVCD5kqLy/t3/b8MLbgDg8JIWDkSZ+LrGhhr+gYpH+pr1TnCUnZPjpUdw6bSL6MWVXoDDciQDWECwU2e6VEpfrcOBbrSOijqGkEIoJPbpmeJLkcwbvA0yWIixQVjo0HnYh7fji+Dfdq1mtV1lG2Zz9R7eFMHS+FK7nybutu2fwzDpFldO2pZBshsHJWaltn3PWOoGJpCT2jE8EHOuC6FkejNWcfsWCqNqMLP9xTwcWArj2EiiI7D+EaDi7/2cqHL1gPiF6C/J7aUo7RQqogPZ11WqbyP97nsoMxPOC78wZMF7B1Y0g7JNXJV/nN1m4xx8hbqWz07KSaqr5hE4icB326DMR/vUKX9LoNjle/ZWtbUhrTAcsdgrLlG5Ne8aiR0bS/2ZhpNOVVxavWIZsEM/rd68EB4vjbbD13NkMK1qvMk74vGbSkL7ULO0sZ9R6APSCo6KH+Xn98wEdw1bCPAnDTaBsD6sidAGN58uiH4a3ovG1KyZAu2XtyGgF/vgWKGxw9R1lfAVcfuYE71DHuxtTzfGZnHaDpDGWmfEq0N4GawE7yIkaoz8jcmVmzJe1ydM8q0p08YIxFcY1YcqQc1djWBEoNETDFcgk5waRftEJasPREkrV++N/TOKkERF1fCLrXS8DFGYGRBeECMQRNEs0ES3FzUtXCcNxpYEM3Uei6XodZruXUIRnn+UXf2b/r7n1vQutoi6WoIbW7svDNWBbUWcDUc7F9SJK3bvSy9KIqhgyJHoW2Kpvv0J4ob14HFXGWWVsYXJzjwxS+SADShTgCRjhoDgjAYRGxwJ1Vonw+cpnCKhz8NQPrb0SFxHIRbmG95Q2hlC4mDxvPBRbkFa60cvWakd7f0kVBxxktzZ9agPJEWyA63RSHYVqt8cPrs2uFJ3rS3k9ETGKn5+A6F9IOrdZHfT1biEyUJKEvwzuscwshGCBJvd16TrefW03xVnJf4xvs72PdxrMidjJO8EiWyN/VWyB3fv9kc34YIuZTFtXGo9DuG3H1Uka5FgBMwDPEvRcSabi3WakNQkXFecJlFk6buLVk5YHpuKWTw6oF632FPPSVIVl5hgUAeHhj0t/sw/PEEvThLQDDFE34eCg/rLOyXT3r+L98oRKrlTO0MdALYQ3rRQqC7d822dJPGxF1K4J2TtfPSMFaCAg0n0NGk9yiaKKOJD1v2aBX9HUOIawjjfvwCmjHZJTR62R9c9x33JnBjWrN4QYEOmehy0oZMP9XM9Zyi6TYoe07PaLceRXcCWZiY/imRUWW6+mci7+wMxSdwMdbXckXtvhJH8sc4iQcTwm7yp+3f7CaesTTQB2qkgeXh+wFiSMXfMlH7Yil0OoZ2QTtRLTip2O0cLZ4SstqWHZ6H+8A2kZXhpm0kPbL9dUanTOvziqIUh6Ambwa3WrCb2eWbuCN3L1hgWUmjRC3JoL3dBhR3imSQI8xuCMfsszlji7cSShNSYdqCXPxEVwbqO9i5B6hf93YI7aeyI8jxgcVXK0I/klbvhSXjkjOIwZgPdVwmsFW7HGPLUAvDRuKm+itybRg7c8+Yqqjg824Qf+/NxsBSUNAK9KCoJpauFqK0XQULrWYj4FnxeKDuvr54iokpi+D57e6Y1zxRJJdsHnDR3JyraCUufHBRTKODWBVzthjm4k3/Hv+Q990XDVR+KW+TcJX045LW86EKhz/97aqj89A8ZvTk1//tczosU90loIPVaHuWegJU3wP//7XHcO7c0yQM2jM/IhQKrf8hiObHWiWDZManF8Uf/HzbmDfC2wT//aiZ4hGTv/xzgKwdb1sD6cGEkceow0s3b89/zg+3plyRm0HlZi886j5wUwFhdHiDTaBidZRo5cx/tMeLyguOATbzq17ydhzbrpxunuHx6lbFGiO97gsd4dk//7iCIo+Ew+hG2so5kvv+ITG4c1fzHPtu1Xn5QfUnqY3/uByVmB7gmnE/E+5zdm+6nDmoews5fr+NzThdSHzK4bBQOL9c4O8OI0xLSqjJ4lbniLJg1aFpQRLwaSMZmpkC9e/j6FOVrTQ6a/a4alGgfrl2ZL1sbHUQ3DOI7ntq9diHFfm3t1mul3rdJEJCHnlW/hlQntipMrpeMs7fUr6wK370D7VbXH0DUHzdYfRg/6Z11Ult1sffJS+heHbco15Sxy3+rDnPesqH1lajk0yu02hPUvEUqvcUXWXL7Ad0wNGMx5gOle4XJxq/r/YY0xdco2wRSEGwcT7YADlBrHc9ZbvzOL0QwyWCWWChB9Obg800v7tyBWaNvdwz+fL7Ph9i2irEeJkRgOzeEDw+JiD/V93vH9FgMEoFIJMoIuogmicZohf94SBuPn6hXaV9jP4VVVA/bu+Wg8S88GLtmEPSNRLdtlXx2XL/nuM8nKkhnlnjaropiKKLIH94pLIASci0pDBfj9Hi5BfaTSXQg5+PMjQX91Ktk4MOqK1K99l4BRPv5+vNovGZ3IxQv8ICvjV4/diThpoaM8uvd3D9d/DE477w3yAbW3IDm2i73pZ9aEj38JqS6h/s8/xgmUIVcuq2JTgefAyuoafzQxAuRASeg3NtG3ach/JEkyuX+JDt2PnDZTShUhyHHG3ttBg/6lhAchGjLJBtopj4e01MlCp2yqQRTr4sBBXru+lKaoanwYX8y2aWCJiR3KnhCOkYVFSvsO0oDRujUFOEptiNDTYrJoUbvOyvl4AhC9h3wORiTXK1MrpMfnvdnndnR/HRVSusMBgIxwrLdn3vq1VcncPiD0SquTx/kNmxeFyCT4uXVUd9AL+rSGmuq7OOCzDKeVPjiNWVaoP5KOFqYq5Xcuf/xW9S+u9eIq9GAtZWtQlgkRecjRtvG1NR4WXXpn+pwsTBTIy079Ikg8rSef1aVapIFcXCd6C2wHVjLXR+N0tw4Taw6x6H90BFRgNrtlq2up6hHKuV3inM5RJaQWZHd84e6RsKkk9po3dk9by54tpPw7cBkFas/G+GbHwuG+AwP55BZyXILTHCIVrPpXHEaUPYfL6nphJP1Rc10xG4UaCeY4IHCwuur8xmSQDgY4aVwhzWhjbtSHG8JO6P2i2nC9/0Bfx0zk6dYQq3aw7k5vIObD7SEKrxhz0fQ0+YTOfHW23CBNeZci1qNsUDhoeqmfyP6PvjoEjHk8QbrFyQVZPHVWijnb8YCM65iYNoEbvnchStZ/9cKg5Vd45j8KnB6UjzXl/bkyZx7VoD47ocUUi117WwgySSb4rXgLJ52Mv5XJbp3I+uBP81BUvOjy4Cacgi+GWWlC/8dwgqwiojjUBDnEOxyRyowwLQfytFra1OZS4XvRYr4uoamAfG3I/p2bA7G90yqKThH8Ke00Tqd+3l3dmJpaCZelBMYjGqNLVa3SM4+LQeL56gY6Bymy2LQPVOxjWfj5tq4o74swcxhyGJPynkS5xAjOXZP1/FAYcBT3u6qLoIkEfErwo4gozmyI1YCvM0oyI3ghjGPQSsof2sKUhq91WsKy9cYWN+4A2v4pG/Mxpdc6w6kI/HX7Xb0TuihmsiOy2wQIsrZbUmr3OBSUo6oDJNgQp+YqYkgTgYcWZDgawJw3DFfdzT//PhVUidgB2qa8uw/j9ToHBAS33iT8YLhhAfyXG0bQUFp7QmH7oQ3i6Flf4OTZLvJdh8pfuflmWu2ohm5pTiSg1pl3vq9uluTJwqXfh1hqy8e2iHoD+Y35gCIViTo6VOtK5dD8HYClucJucXASzwe2kPj4S4eYQtmkYHagXhAzp/F541xE8YFYqSPszDuz3soWzHy0p3E2jwZNQaIcGU9FNQwQxeDw0ZlK9dxXrj9IUHGUPTOyib8CqXmbZ7Ex54bn1rLx3qqAavu/gh6XjV0GmN1p+yyMK9HN5uYEvxgbAk43tsheREhyI+Q5WLIneKTGPmYiM/lxOp8fvqHy8YgXK0TlMiX0tliLI2JtfmWZP8eVV732sdYm+pcWzDzEmKLJZyeelyaZKkjPnnUO9keDwtgiLnmd5+t+Sr5y8brRnlvxcWEWfCqIALQYHvaXx6jTg4dAlye469uGwwOZVZCILLfGjaMg4LUCNMTtMSp1aC2y/3wR2t1v3w/iNBRQ+bNbtDqL2NAr7K4rUcyqbSpNrXZgAWXvjxBBtfYLK1uRYt3q2pfXJOAL0HtWcEwJLddOSJKV1SwvcvEuzg/4MPnA8MIUJOLqm3qI6wFyN99Ck6zYaV/zGSAzF/PGsaNa4vPLe5QnyuqVUnVQ6xELA6gbe53aGgeke+R/ycb2LJVyc7BhuzI90zA+c6wUDTb7NH//gdDSl2u/aW7lRJm8m1fLtPxcNuEM5JbkOCZKPM88HUsLRoC1pmKKlvWyeAXuxILbu0snpSxf8N+RgtLUSe5n2gdjOjoSTaN7mMZ7bF+cWk/MS8mFD4pcyl5UN7CbpFZH2a+Pm1VAnUTVfbw8qrmz1G9m5aKmRzY1SMhhPrlCn2t4uNUXNA3IFe6NOjSC1DEaAFZAfDlEkQCsbNhsZPj6NQPDSB3tLiTo0ZYoEbIeEIaKtU3Wk60rEszawTFuyHVd365LA/c/uarABN5M5rGq/dqTG3Ilye/5EKiYisisuzqNaZjmWv0z9TORc0CKbaTea214oNM9u2sXUZub/eqM3Pi/PjRSyQiOSwPWif2asTgu6hS6fb5UGosCWxdedMqdViIUUSSdIJx+qQ4KShfTT39VAWZbi+mB+iKICNwpt6cflY57Rcbs6d1kA26Iru73cuxYVlSvuJdcR5VfDYZRk8X0AXePROyw3Le6LaUdmTLzYsoNhhgQpd67xVNiHgk3pakmndeIAtTC4DCXy9oS6eU4CWxDdVmY53pKNbdAKmQsP37lrJZC6iDXMELGKcHjNuuZgcDyY8W/yv6ha3DX7OWm/35fpvhw55oitf4V+GULlcPWYyGGuVBdro19c8u0RDddDun40W7G5cSIzHLh/qZxb59R+EPY+wZ2XerkUim92hhXpKyW6WtAh6zQS97DrPyjCvKi3pCw96LeKynOpyjtsMQc2RmI/20zFOZcSa2AK++PoRcT6zeJyxlBZ7kk5mhqXGkLlM2hFKc+/T544xXP0Ua38Q6xdPTLTeG1PHnLMaOvksUQMrEFTB/lizCirmFQL8zYVU+OTeYQEFaITsBSMMYexS9HkajO2gGIf2micvntCZJsZQEwIH3/4JGJQGflBuH5rNXmnRRYXDQs3ZoEQoMtYDr1kFKUS/siiQSUxcTH9XYeBZiKDDFQoExREO9dddKQLO3BwMHvymCSTFyY+vxn3D27NDx6OlU092D5EDUwilttqVHpjJQDUceJYCLsK2swfXeNUVrBJT/w/sk+7si8rPtiMFis+oxvGdGQxirMBID700T39mULuNHzOyN+xBfcFACZcyngF1aSpv0JPkNUrAZTqfplv509cGXFUiEEm5dZb+OsP/blizqdK45/dSsIrufYTrCPY2lgJD6k6QljTfXVlHfYKSq+MsagyUcaMintyr95bD8kdTAeYNLNsMmo/Wdd8a2nStBP49ARIjqqpUHWY4q4mvO5Cq/CgCP+4/B+5zutGwX5pssgVLr1+fIM7WWLfiUQDk4c6ZdHZOWv5hG3g2dgQ5NXnpIY+BWwJpaouf25bXnjDzbHnQNofH/c6m+dEAS9Gs2h7pFRPKOBDnqswZ8KZjhId1ytHUTs533KwBoSiImoxKQUgZ7z6pA9QB3sZ8Cq0vwutJTTkfbX8AzCpm2cFXx/P22niUMHauU8IGc+78R6TsutoonoqFuoNA3l80t387YHMoL5KGAT1JO4zmx+vJ0LbLHlicHraSVYvJjnO9p++qnWgKw9OwFVVUagvZuf9qfiuum+hIicxP1q4zDnzkHsCNriLxBpxY9N+UOmqzdY1MunLMDgkMyi3uvnN3UBXJeZ8YLs5xr8QrOhimYoKuGBebZHAiBIkViv3DG8k2oNpp5OIgX6ulqaRN8V62QUPjn5tl1kPXhT9bcd8qIm8gi4or/FGbvQ6pgGSHmnayrugmf5E0upGxPRf/3xOtitGMaHLKJVm5zhglmVfI91o0yxhJZVS/5wQ8zfxK8Ylw0WmHXoGfRkoBRx9Hsnl/6sgTjAVwpmNuSeZtBwlX4qB8Bh8lxjqBDIuFGJ4I1wxN0XRlAAslzqMKwQfyA7OkuivCXfv+i+3XmhcBFM2n4jdT+NyUmBnQJPV3F2sZfKvJhUlXzSosFR4VevVVcOkFnnjdiRWc0TeSYxj41sJGYMbZTeLI3GvyZ8/gAAudQ1+4oFX+enX5V49MczGCYVBuoC4kHjp7ZVxj+clBwPr9k+v05SsezQK3enxLs1Nt/N7c7AImVUysjGou4iOohHo83Zs9/MI/OWB+OyXzOBD93NbApGHXrv8CVRHp2bwH+xB55cfNrdqFD35HSMx4iVmtzYAmSCIV8kXsHoq3DIb93riTWbubnjxbBW5zConVtbxLRStXHkIyAByaozME952Gc9aAdAbBpZSVCH88Uwb/4bPTVOVl+WoMYD7JIvK8VcMrJ8zHV4bbG0Dg7Kx17A4ej/ZcZ2Z5pVuVLUH1E/AccUTKm81SE+LQ6STTUDscUk0x2OWIbEORhg69tdoTGNkA1RfkGIRZHr5mCXOpLC55WWzCZoGPFUVtZRHwh0nq039CDdjEPo+JyaxSQAvDgR6Iqvxy0frrtEG1A385N81l05SSzN+IDm9bypF9m92EUqblnauZ5sjc37wRykOdl7w4o8WMgQsjii3EE/aJYDfHs1cH6DNBEujjcCc8qAefYFyIAURDcDnzun5UmkbBQsU4eu/W8I9nBE0qJKTdg2hwjq0+XV7a3TJ7R+alvJZCRia9lJ+grNB9dbrOmWEvUotMjvDhq4wV/kq4fvIBkzUGpDeYH74rne8uU3dgoNZdR9pUL6q9YDNRfOiF6Dyk+SYXQIghTjm9qR4tBHh0gnmF/9q3Qv22EzaLhSvDlDOxMrrCNRmLCl1jApzLrBCPn2mjn5zqK7OYK7VxOfQ5GfBfoPdyQwqFEgCVHkJ9oTnagRM3R0+rsuN5jQv9icCav/p1WqiEXSzCdLd/WEA6z6dDP7tPqPbeDYKAkVcz1lLGbFOC9b7cBd3MV0Ve8dZ89oR7OnxGS7uVpSry8banVZwpJg+nkH1jRBYa2BvBMY2xITH9ERXCjHzdZxs+ipdXP2DY7X+eWiBhtT2L0RRGTLPeazn5tpl4tu8iE2rWig731iuJDRbCHHy+g/Mb9+miAyVqfIpXT/iZeOxOxODO0hEpLM78I1+G2Z45yi3lS1K3m4WMQ559Lp4UML5vZUjYGJuxl+OPpUH5klpyBujkjprhei0TmUik10gjvNUp8mDkWlNKikmYspaVTqewbnOzJrmz8FLIpsT67EJLHIIfeDcWEfiP+DJrZ1jfxpoAb2abeMqLx+9RuZGzQoYtYVGgAWwEM9Kek2vPIeBNAKD6ao7nw6sgvfeLZPoXkbYO/tStHJdKzk+WFSFEU2NcALJAEP6S8pcnqqBBt57dwTrzQNCIdk2SocK4dLRbD/pu/VryKnm65ZYXiJCfHJk3mx9MRSl+nSK6OqEBSoGjz0/LADddwF/HqcfK3K3O+6YUGQcmj8pZL4PhZ6KrGkb8B38FmDvvLd3XQXbvS/FQmrXFTvJNkaN/FGo83KuS43BK1UfVnIqigGkCoP5fBda2MwAGTGNKX9K9t4Bx83pMFc5KSORmWKv+8VoVggWxoaBz3/9IBh6RwLd1tebwy89xvE5z6EEpXpDfrXWfRsMs6+ekUHH6idVosno55+xQ8Zqzelh0bxtJTgCcH3Z3/Cxlx9eNIS4JIFKOAVrDqbrXRszmY55a5+niJGHtkO3b6mnIDxLa1WXc7BAe33mt2KyM4Fbc3R6/WVTQN8QhlqAtave2WsQTqzWeSlKuGUVIJRqtObpv294rS0kDN1RKzdstZTXJebR2HlzsQ4P3NbMHUqFZMZw+/IKXnh4t+lY8qocp/B1oMszR03EFs3bPeND8QkItMvllObeCz3SZAjqZrobmLcrpFyQV7mwBjg3C3C8/bc5goQhv8j/IXMLGnt4mF7tybRDG5G0polxoUScQkPvmnga2/K+aapKeqSL0BTmo1Cm5g+booNOtdyKva2KoefRURaBk7113QKo3y+WTuFKtgETIK8HRluYS9DvlcciCDvnG8UaJRfZE2siZsiTHvRmN80xkUIInHeRZl5Re/+ATL6VhKFi8CZ/n/jbFV6T5pZ+Uoppvsi3qjacVFOJgWWfdlwVHKPW/TJO3na9hRM9bS2yo2rEsC6IBzRReVO6IesJU7PItzOamr+ROFfwGZmZ7ue8HNxAgLJKb7P3p8dMqk6Be5PJaT/5Rdc1deYVihWH9cjVKc9uz5EnfHqxLUkOO8iJUENBNVf5LyNy8zjLu/78k5WNTywiPfYeX3CPk7yc6CI3lum/CEZwfUaNpcI3KsPqfn2lmz3kd/acQjKA1ebkJaiuLD+epQ/Fc1llHXXMzofWzz/Kd29SNmOhcjMWw1jq1g3YfrXZ9rzXDYW4ZttfgfMi6oCUtBs0PkMVuxmq5lxEoCaSXPSqCJJ7MlKdRDidVt0AFlxk5cTdX++sBF2+E35mjwfm8ERVxH0FvuAQtsfA4V2G0TKTUxeyRGVjd/u6F1SvuAiU2/WaQjcNCU4Ep7VunXCYSbZj3U3wzu/LWM5MPlYuyQ3FOOCD/zt7K295hY2JhwF+ODDIZ676vGQFKveEQYkWj7lkK7rVmD7MhU0Y/tF8EcTTpo4/yqOufbd/zWIpMajnbDuWK2vn6OPPtz2rc9MIBNlPd8tt+yf+7SC4wqEPbozKMCwY5Bygx4JmoIEDsixWRDcdHd6S3/dZMHXOJAAv7+NIstl00crgSqHZKAEe4g3G4dzIV51EeZB01r7p8GNlfUnG/GjZgNGsqXZdYMBVtAtFNv3hJWPve4GvqZ2XxuiNkHTz5kxWgr0PjQdJlVywJ9Zf2ZvqeeTbolKtvK54re2Lq5BoyzfsRtvDfyao3kmyFzDQ88nM+qx83w74RDlkngtYiArI05Epre3GgBeSlMig0pE6RGQaFznKkGeb0SozLCyiOtxh7hgwZlbKbClzUUfC8ntMiHUOZE375RhTy9c4DA+oMLkUDkztSybZbdmP1xpaIbjUpPAHBq3cIq+CBFzbMlMMCCkUQ6d9LGV6GYCsYiEWZIy3nBnuxOYXeU4YTGDSin9e4/pCjPtQSHlg5LMEvIlF0ElthqrF129iK2RPBEWd3XWOl3SWV5uz5VUyZYp5kEFmz7QfP/B1W1BBzQ2iTGbSVT79lUHzcGXz3PJceSgz4uknETUwo0xffpr2KUvZF0i/r2sL3IFIClYx8CbIZE6Qt7MDJbOPB3xMScwaOcWG66IJfCnDkb0D2Mb+PHzX+oiCbxeTIogtyN+s2NJirNACk/OACSOTtV6vscwbzW4M168xqaI+RzR47S1nlV/rOoZnid87n/Ima2XYa3un3BuGAisNjb8eLMT9OnMtazQROFCuO1HiZXaOc0oUDbNC4eKLToOx8DzVhMgGA8XIAQ2x3b6I0uEyLssQjJX3QphcUMx4KsMgJ+72km4N2aqkBF2coKmUEt1eqIMGn+5txMT4kYVGd3ALO+y9Z4PP3d3l48JQK8s9ZZ/Qx/+NBKgBEJFlQ32psoJiihGO7FSYM5L81q72kaAYcilEFMG+ZK1BcMqELkflyCV7v8JEXLO4Rf/oZYNZHZVjJhfL6fnpP9Tio3Euue5uS7FMkfGOeRCTrBZ06Caev7tgufeTrX34Ur/Vvc+b8ksiIShNJtuF9WmYxOZ4xg8y6zTdy3KAB2y5kYkcRnXsptWwAFyKZ2I/QGySNeoQLkINUMloC+5L3WuMMx297Q1xUYLKqZ9XHavaobo6QQv4auMm+i84IhxRpPt9nUmcav9NcjCcP+TcMmxsQZ/F3mgeoA0fQgwvTsyXuuTaM3Sqtv2jaaajmaFQpK9W6uIbeqwvSDo34ZrY6elDUHwSCjHRRmlwmyy+eOra64Ssq0XSXYljMHtKY+FShcMkHsEUY/4Bw63dJ6KpwDaxmthlDdbdE+TvYF3v33cGSKqO+1H1pKYhJMvZD5ckQcHyNF8zrtiR5b0ko6NPGoRexUZTYP6VbUdn3zzxGBOi8Z0OqHjGqYxRXwN3mYi0GYEEZYq+Q3QvdKcEHILLLj8S+VFepSfErtmfZCdvxbfIifFSpEzKi+7VJsLMT+zEFeyp1OdwRC1VZrfTLIyR7xTPUcZFYPD9qI7D70uTb4hdpqPXsJIRNYbZtNwch1OI3trh3u2ScoQyM9POnInsUa+OovcwkUP1UfIzPb95n4BaF2ev57NHAej0+BVMF9/Cj9663HN2/JN3SQgslL914bKfiTTDFAz9PlQEL/dSv1H8xl3mtWxh1McFO9EJXlRDaKQDsyKO4vOJW90NFE6yw2tjbc2GeF95sbs0I9enAa6QwQVf/kJQhAD2BzUDKggOyjy1TEhED6sfk+418lQy3c/uj8aw8UEzZ6hIMCd8RohAkumMtIj9m73l2yPWoGHVTPaywkC7Yj9tBM1NxMgcrDwRtk4RO2WHT7Ql5kQCKdJj6kNuOTeyEBYBjLMhGz+O5/YGa84HEiTYEpZ6fFzy26GG2hWtTyteuYrhSyG56BjsT/wQeLRytpTY3D7sIMqZnJ9z1FDrfyjFlGl2TNw9BQysbaxOuwYYZs/7I6BANgkqCknWZC7/BBXvaeKwAmC959I+G39BUE9bExkNlbRoFRyEtNzv+NJ91FuisG3JCS6uYBeRnfv8AkAfKTeg9EYamqnsGfAV7d0f9DghHEQ5IsPGDIUhgoSj7obM4Bu5uhQ3/CYEDTHc92AsFvDK4XGrwUeGBWBHPlS+f4x+CxmmHz2sAGmSFNt65kwZC64mnaoWlu2310laYn8r62AqsR5dfjyK18MEdurdagldzfJtjFXlZs7St4QhdPiye6TPh2/ZAQLU/Fip5s7TDEM16KtRWrK9hmxnQ7bmfa/+7pa10Z8WDPK3NuJ+NN/RAbQ5vHx2uX0Lm7/w7cAEH/hvZA+mt7J7zGw7YtQYwnNN6dpgwkGjjrS3yQoeoYt1EnczmtmJfQZWzUlP3Hlg9Wzlr9IH23q3thGth+QNEANFettxKfskkGOlLk8AqoKJwDqOxAa6UzAx07plSSyNBJSGco9zjnC5gGbDoKvsMDuBR6bGRlGzJ+hFsGa/Izt78aI+WZ6dJlZKp4pGISuv9rV0sAS0MWEwCmfauO7oQZMiakHU35LBxiyJoOMddhUWgcZuC8r4Ksvn75TTcQXLJ7kWtYhGuGqPd9dZuFjBWQHNwosXY5snbHFQq72CvHXhIg+shQxycuLOuWYErwCLZeF24b7F78pO7xw4X6lIAR02hUOf5087Rl0nOaeb6CK4i/KA/EZv76ftOWZtjwxslNr0E/u8rWUmnf3amfg6UZmBAluuoj3Dd7UV+9IAJ6iYcDfSJlgmIImohjfIUMJ27z+opj50Ak9af2LCNrWrBJvMovA1OeNO+MF/MwZvnaCxTgG7Cw4QfSPF6AYCGFt21M8PySZFeV3t2Rqqs5JMzMYzGRgq4o+UaKRgBf9GHi/9X9HXA3wxkCsd/UhnHSh2zUVDiraio/6nP4y3XJqs8ABfALAtCYU7DHPMPRjgcM6Ad/HiSXDAbOdSMkvGZPAkHs8wuQTy6X2Ov/JFvcPuKfV3/r9Q28";const FENCED=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),NSM_MAX=4;function decode_arithmetic(et){let o=0;function tt(){return et[o++]<<8|et[o++]}let rt=tt(),nt=1,ot=[0,1];for(let Et=1;Et<rt;Et++)ot.push(nt+=tt());let it=tt(),st=o;o+=it;let at=0,ct=0;function lt(){return at==0&&(ct=ct<<8|et[o++],at=8),ct>>--at&1}const dt=31,ht=2**dt,mt=ht>>>1,ft=mt>>1,pt=ht-1;let yt=0;for(let Et=0;Et<dt;Et++)yt=yt<<1|lt();let gt=[],bt=0,xt=ht;for(;;){let Et=Math.floor(((yt-bt+1)*nt-1)/xt),Ct=0,St=rt;for(;St-Ct>1;){let It=Ct+St>>>1;Et<ot[It]?St=It:Ct=It}if(Ct==0)break;gt.push(Ct);let At=bt+Math.floor(xt*ot[Ct]/nt),kt=bt+Math.floor(xt*ot[Ct+1]/nt)-1;for(;!((At^kt)&mt);)yt=yt<<1&pt|lt(),At=At<<1&pt,kt=kt<<1&pt|1;for(;At&~kt&ft;)yt=yt&mt|yt<<1&pt>>>1|lt(),At=At<<1^mt,kt=(kt^mt)<<1|mt|1;bt=At,xt=1+kt-At}let vt=rt-4;return gt.map(Et=>{switch(Et-vt){case 3:return vt+65792+(et[st++]<<16|et[st++]<<8|et[st++]);case 2:return vt+256+(et[st++]<<8|et[st++]);case 1:return vt+et[st++];default:return Et-1}})}function read_payload(et){let o=0;return()=>et[o++]}function read_compressed_payload(et){return read_payload(decode_arithmetic(unsafe_atob(et)))}function unsafe_atob(et){let o=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((nt,ot)=>o[nt.charCodeAt(0)]=ot);let tt=et.length,rt=new Uint8Array(6*tt>>3);for(let nt=0,ot=0,it=0,st=0;nt<tt;nt++)st=st<<6|o[et.charCodeAt(nt)],it+=6,it>=8&&(rt[ot++]=st>>(it-=8));return rt}function signed(et){return et&1?~et>>1:et>>1}function read_deltas(et,o){let tt=Array(et);for(let rt=0,nt=0;rt<et;rt++)tt[rt]=nt+=signed(o());return tt}function read_sorted(et,o=0){let tt=[];for(;;){let rt=et(),nt=et();if(!nt)break;o+=rt;for(let ot=0;ot<nt;ot++)tt.push(o+ot);o+=nt+1}return tt}function read_sorted_arrays(et){return read_array_while(()=>{let o=read_sorted(et);if(o.length)return o})}function read_mapped(et){let o=[];for(;;){let tt=et();if(tt==0)break;o.push(read_linear_table(tt,et))}for(;;){let tt=et()-1;if(tt<0)break;o.push(read_replacement_table(tt,et))}return o.flat()}function read_array_while(et){let o=[];for(;;){let tt=et(o.length);if(!tt)break;o.push(tt)}return o}function read_transposed(et,o,tt){let rt=Array(et).fill().map(()=>[]);for(let nt=0;nt<o;nt++)read_deltas(et,tt).forEach((ot,it)=>rt[it].push(ot));return rt}function read_linear_table(et,o){let tt=1+o(),rt=o(),nt=read_array_while(o);return read_transposed(nt.length,1+et,o).flatMap((it,st)=>{let[at,...ct]=it;return Array(nt[st]).fill().map((lt,dt)=>{let ht=dt*rt;return[at+dt*tt,ct.map(mt=>mt+ht)]})})}function read_replacement_table(et,o){let tt=1+o();return read_transposed(tt,1+et,o).map(nt=>[nt[0],nt.slice(1)])}function read_trie(et){let o=[],tt=read_sorted(et);return nt(rt([]),[]),o;function rt(ot){let it=et(),st=read_array_while(()=>{let at=read_sorted(et).map(ct=>tt[ct]);if(at.length)return rt(at)});return{S:it,B:st,Q:ot}}function nt({S:ot,B:it},st,at){if(!(ot&4&&at===st[st.length-1])){ot&2&&(at=st[st.length-1]),ot&1&&o.push(st);for(let ct of it)for(let lt of ct.Q)nt(ct,[...st,lt],at)}}}function hex_cp(et){return et.toString(16).toUpperCase().padStart(2,"0")}function quote_cp(et){return`{${hex_cp(et)}}`}function explode_cp(et){let o=[];for(let tt=0,rt=et.length;tt<rt;){let nt=et.codePointAt(tt);tt+=nt<65536?1:2,o.push(nt)}return o}function str_from_cps(et){let tt=et.length;if(tt<4096)return String.fromCodePoint(...et);let rt=[];for(let nt=0;nt<tt;)rt.push(String.fromCodePoint(...et.slice(nt,nt+=4096)));return rt.join("")}function compare_arrays(et,o){let tt=et.length,rt=tt-o.length;for(let nt=0;rt==0&&nt<tt;nt++)rt=et[nt]-o[nt];return rt}var COMPRESSED="AEUDVgHLCGMATwDUADIAdAAhADQAFAAtABQAIQAPACcADQASAAoAGAAJABIACQARAAUACwAFAAwABQAQAAMABwAEAAoABQAJAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACwANAA0AAwAKAAkABAAdAAYAZwDTAeYDMwCxCl8B8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgPi89uj00MsvBXxEPAGPCDwBnQKoEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiC+AZ4EWRJJFbEu7QDQLARtEbgECxDwAb/RyAk1AV4nD2cEQQKTAzsAGpobWgAahAGPCrysdy0OAKwAfFIcBAQFUmoA/PtZADkBIadVj2UMUgx5Il4ANQC9vAITAdQZWxDzALN9AhsZVwIcGSkCBAgXOhG7AqMZ4M7+1M0UAPDNAWsC+mcJDe8AAQA99zkEXLICyQozAo6lAobcP5JvjQLFzwKD9gU/OD8FEQCtEQL6bW+nAKUEvzjDHsuRyUvOFHcacUz5AqIFRSE2kzsBEQCuaQL5DQTlcgO6twSpTiUgCwIFCAUXBHQEqQV6swAVxUlmTmsCwjqsP/wKJQmXb793UgZBEBsnpRD3DDMBtQE7De1L2ATxBjsEyR99GRkPzZWcCKUt3QztJuMuoYBaI/UqgwXtS/Q83QtNUWgPWQtlCeM6Y4FOAyEBDSKLCt0NOQhtEPMKyWsN5RFFBzkD1UmaAKUHAQsRHTUVtSYQYqwLCTl3Bvsa9guPJq8TKXr8BdMaIQZNASka/wDPLueFsFoxXBxPXwYDCyUjxxSoUCANJUC3eEgaGwcVJakCkUNwSodRNh6TIfY8PQ1mLhNRfAf1PAUZTwuBPJ5Gq0UOEdI+jT1IIklMLAQ1fywvJ4sJzw+FDLl8cgFZCSEJsQxxEzERFzfFCDkHGS2XJCcVCCFGlWCaBPefA/MT0QMLBT8JQQcTA7UcLRMuFSkFDYEk1wLzNtUuswKPVoABFwXLDyUf3xBQR+AO6QibAmUDgyXrAC0VIQAXIpsIQ2MAX4/YUwUuywjHamwjdANnFOdhEXMHkQ5XB6ccMxW/HOFwyF4Lhggoo68JWwF1CZkBXwTjCAk1W4ygIEFnU4tYGJsgYUE/XfwCMQxlFZ9EvYd4AosPaxIbATUBcwc5DQECdxHtEWsQlQjrhgQ1tTP4OiUETyGDIBEKJwNPbM4LJyb5DPhpAaMSYgMMND137merYLYkF/0HGTLFQWAh8QuST80MnBrBGEJULhnkB78D8xrzJ+pBVwX/A6MDEzpNM+4EvQtpCIsJPwBJDqMXB9cYagpxjNABMYsBt5kDV5GDAm+PBjcHCwBnC4cFeeUAHQKnCKMABQDPA1cAOQKtB50AGQCFQQE9AycvASHlAo8DkwgxywGVLwHzKQQbwwwVAPc3bkoCw7ECgGpmogXdWAKOAkk1AU0lBAVOR1EDr3HhANsASwYT30cBFatKyxrjQwHfbysAxwD7AAU1BwVBAc0B820AtwFfCzEJorO1AU3pKQCDABVrAdcCiQDdADUAf/EBUwBNBVn5BdMCT0kBETEYK1dhAbsDHwEzAQ0AeQbLjaXJBx8EbQfTAhAbFeEC7y4HtQEDIt8TzULFAr3eVaFgAmSBAmJCW02vWzcgAqH3AmiYAmYJAp+EOBsLAmY7AmYmBG4EfwN/EwN+kjkGOXcXOYI6IyMCbB0CMjY4CgJtxwJtru+KM2dFKwFnAN4A4QBKBQeYDI0A/gvCAA21AncvAnaiPwJ5S0MCeLodXNtFrkbXAnw/AnrIAn0JAnzwBVkFIEgASH1jJAKBbQKAAAKABQJ/rklYSlsVF0rMAtEBAtDMSycDiE8Dh+ZExZEyAvKhXQMDA65LzkwtJQPPTUxNrwKLPwKK2MEbBx1DZwW3Ao43Ao5cQJeBAo7ZAo5ceFG0UzUKUtRUhQKT+wKTDADpABxVHlWvVdAGLBsplYYy4XhmRTs5ApefAu+yWCGoAFklApaPApZ8nACpWaxaCYFNADsClrUClk5cRFzRApnLAplkXMpdBxkCnJs5wjqdApwWAp+bAp64igAdDzEqDwKd8QKekgC1PWE0Ye8CntMCoG4BqQKenx8Cnk6lY8hkJyUrAievAiZ+AqD7AqBMAqLdAqHEAqYvAqXOAqf/AH0Cp/JofGixAANJahxq0QKs4wKsrgKtZwKtAgJXHQJV3AKx4dcDH05slwKyvQ0CsugXbOBtY21IXwMlzQK2XDs/bpADKUUCuF4CuUcVArkqd3A2cOECvRkCu9pwlgMyEQK+iHICAzNxAr4acyJzTwLDywLDBHOCdEs1RXTgAzynAzyaAz2/AsV8AsZHAsYQiQLIaVECyEQCyU8CyS4CZJ0C3dJ4eWF4rnklS9ADGKNnAgJh9BnzlSR7C16SXrsRAs9rAs9sL0tT0vMTnwDGrQLPcwEp6gNOEn5LBQLcJwLbigLSTwNSXANTXwEBA1WMgIk/AMsW7WBFghyC04LOg40C2scC2d6EEIRJpzwDhqUALwNkDoZxWfkAVQLfZQLeuHN3AuIv7RQB8zAnAfSbAfLShwLr8wLpcHkC6vkC6uQA+UcBuQLuiQLrnJaqlwMC7j8DheCYeXDgcaEC8wMAaQOOFpmTAvcTA5FuA5KHAveYAvnZAvhmmhyaq7s3mx4DnYMC/voBGwA5nxyfswMFjQOmagOm2QDRxQMGaqGIogUJAwxJAtQAPwMA4UEXUwER8wNrB5dnBQCTLSu3r73bAYmZFH8RBDkB+ykFIQ6dCZ8Akv0TtRQrxQL3LScApQC3BbmOkRc/xqdtQS4UJo0uAUMBgPwBtSYAdQMOBG0ALAIWDKEAAAoCPQJqA90DfgSRASBFBSF8CgAFAEQAEwA2EgJ3AQAF1QNr7wrFAgD3Cp8nv7G35QGRIUFCAekUfxE0wIkABAAbAFoCRQKEiwAGOlM6lI1tALg6jzrQAI04wTrcAKUA6ADLATqBOjs5/Dn5O3aJOls7nok6bzkYAVYBMwFsBS81XTWeNa01ZjV1NbY1xTWCNZE10jXhNZ41rTXuNf01sjXBNgI2ETXGNdU2FjYnNd417TYuNj02LjUtITY6Nj02PDbJNwgEkDxXNjg23TcgNw82yiA3iTcwCgSwPGc2JDcZN2w6jTchQtRDB0LgQwscDw8JmyhtKFFVBgDpfwDpsAD+mxQ91wLpNSMArQC9BbeOkRdLxptzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgELgEaJZkC7aMAoQCjBcGOmxdNxrsBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUHqSvAj5Gqwr7YrMUACT9AN3rlr3JG9m8w9lIAXltp/v8kfWaIaaR9OwpAES/I3ZVamDXSgB/UsOgAG6D0tq+5CIqE15FiAhV3yA2VhCQ7tj+m6xXaF53FIfGi/IAZIskMGAi2MU7MDVJNCbMzERyHZi+osdPtnFVbvq653O8rwaCy4IAf9OOok65AqJUtUriUfYsGPPVbe6jm0s9lbKlPCUKjdkHsFsEhvX4kT39ZCtAAbwQdn/h4TpO5hTByWAmr5n+Wuwhdegv6bmvX4LyOes3z2+cuHv2JFYwVMNuq2gzn8YHTjlUQd39osyWei4NKl3LAdfxlO876hh5ENp/cOvpuI9bF55guEthLLPOXjD4dktTH04P5TvZrWTM0e4+BHJxj7MLApXIFOs0sWKhNkG8iwuM5wR83my6V3wW06abhDzTXYfOr/ZpFXgXzmv4d12FFyP00/dPGbIVGV5ao8UufGzUwp/IHx6v/wDWJr9iaoCulhWwlZ7A8q/NMoD12+mBdNRgJYnThRLtMx1Bgwttn8/4Qn2CDfOSup9GVXEvA21ILgp0owHYxNOkpwLWz0G7K+WREIDjIzUzSn8I99CuJSmSpPyH0Ke6/NERYiNx+3dncSebPnOUnnWD61AhJ1n/tSLZmU5wYO5GfgzyAYJm6VL91LxZ8hL1lfximQxIDMRhIecQZBmeE5R0XlrpvwplVrJwpa8BBCdp93GPP9lyBeZ2zkRr920CR3cYbKpKHfogvm0nV7XdDz6EbjzlxADCMjSLXuXpIpyuizy39yY+I+H9rmpoIF3YwEjlH9MgGgWcCNTjHEWMqAbprn2Ox7rOHupaVE3lNyg3nt5XaZID6Y+uml5Ja+aOPu+BI+DZbiJVfaspUadakWUX6TA4dETkIqdJJHYnU4Z4yKpt5y8rVIahoMUf8A8kWtAQNCTbjp71gx3/zVdqNz1Sutkw0gFIMVm2BF4Xdv/0olw+NaDIR9Bb3DPweZA2K/cw+/b+AwyWl9ZOP67A9nexmeTNjfdzPGf9J6E6BMPKa5lJh+qNsdUz3HBUevU71eQFCqOcxiIYhacAhh/8PX0J5DdSViZ6WazDDx7cukJNpMfEkYLJ5Ao4vLoVd3d25Pg4qaVa2p2D2L3WvYPJ5Yf/A/MSxptjlgXL/KJtP2U0cRv2I09ATAiWCJYuRwiapeKFsqmi18yMMulDp3HdcIldq+7jkwsJUOHLHCzzzBw5XFvL0CAmo1ub456z7zb7shk3KPGCLZzr47oT1k/j06XNnJvG3Udv6XrP+wsqTBlZ5MaNPt9FOs/4Bt/ja/vbVhTNpBFl9Gq7MqINvGlWKOAwQzwOZy+EzSdjAqKJVV2YcskTuM94aIK+kc/AZaXiZLPREUDpkXIV947IFfj+85TrqPqLfkGcxgboMQjosf+az+odLNXdyp1mDNGsqSdK/pJ2Ca04mt/4d6s1X+lncOEYaGBBeW4pApGcjf7/XJCFbj3N3mFb+BtlIcw8ZiDKoClFX9Rf0bxCqtLpicObKJzBVVHr/6u4siH2hK75RNv7w9GfTbhJOQBYiFUZAByY4rn37tZBHT//kqKsNi3ryL9AqXJRzqiMIJMhILjoi/i8LVEsbu+Ih9bsyW16sgQqjYLO0qda6KaCPKj3DQcu6CfV5lKtjS3ZCdqLAZkOey9MR+QutJBGiz/r15GVD6rCVwJR4UUKC4GNJkfDf00OMW8aQtLSAGLXV8MIi9mbbl/qQEpxCm2L5hutFX4ekeLH4QgBWUFKs/2VVMKy46WtFE6AbwgmYm/Z0yHk5veDIrcl2HpVqb/rSE0PC9EbDzJEWqeaPhh7vF369Umq2kSiB3s5rBI6c/7N9bkRu4h2n+/h5nSwy+7n+/I+6oXQVANo2Jb5zDwtiBPf1ySCzHdT6yJShMzqSRZfnykX49CaFaxhoVF4PBhEuECJ1PrFYSpmHuyYsl14DTAV9ZxRms1XiR/kBrjhZjidOt0UNe+GSml7XNgpVw8YsUTmZXLTK+6iYnyW/wYR1W4UXwOi14xpFROHb6HcZzksgF5DbL2AFXzKNwHU2adjdAY+KCyM/cwRTBkkq/a227NI0q6DR2MkMCRu620t79bGcYUmACtqN3mk/0uNwd3JSXHqE1kzf6Yyj0W2083JNDRnIXDlgBxJ6uf58NN1f6FQiRCWB4egF8QDx74AixV8oTyw7PluIjr3/rj/WzgwPSq4xPojaF7V0xqG2u5ti2L1h6yYHv73Isrukr0kURDIEjClBsBx7kdcXUxaYMS0syT3ymLzDzslNDWQOT1Tao1YNmJHARUenhCkmV9tqCPGI5GqZaRpkiPxyjoncWjyOHYGqvbvRX+Bn1pn7EhRNXa1lqJPmoeN5VqdqIDPhEVhFsyG0d4iQEIYX0wZUbY2XbZWYlpZ/l66IrDDY0q1C1YzBDpHC4h05YqHQLqS9anyl22JQ6lEvjvdBwMHfE7z0luCXD34/rFeDa2TmSeEAykSpYO5j1G/nsgpR3qn0qaQEmLjnnLfcz+veoYqPnRqmRGwCJ6FJ3Gm/Z1/aVX5PSb03MMnjAf41ww54sD5k8FrkfBP+K0b1MrYpapWjtpZfve2HVf4ickX3LKSOhu7qI1Vd4c1kNrn2ajy1t4y93JhV4fnWCKq7OmFpcr7FjdJCXPTql0Drr14Ho3Z87+GPQ4Z/DcTiGqtvZxlRYi8cNuhXABveZIwNl/BX1huhVLaFax5OqypUrQRyb9OE3SSkPlDdy5uo5XGg2EIGEjLY1MO5cr1ibfiFWV7zspcTgkBKkwo5jPyAin04LqizZXb2tDRgwKJjGx4cVk3ngAQixwcxjYAg2Q7vmUR/hpwInMdw7OhC2qyf41vTPkudQAORS0DdLtOGQxb4fH2VYGsvJCkeWPeUwtf1/tuIhzXEThoCZzzSJqqjUtbaPI3ntHm3T5uf849hGUA0zU8ni5W+EEn3/0Y6oUhQFw9z0aGjkljBbAlFXc0y82G2wkd7VdgWa5KTgJJNjNwZMfmdnUIUn1JU5LiWX5UZEZbVlKSN76mlmjUR2ku+fucTNlO4IAAahnLjBhlvQNR9pe9swGBgq0YR7P3VCyI/seYwQ4QBzy9X+HPePgoF8WfKaJ4MBOhLCGHae6Z8xkNXwni9QAKvTNtVA56x8YJflZ/VvONRSlsSLmiSyNMnTjTaE1ko81zkzGEnVwEhjCzlwIqpxmpDAqwsEmtpdr3xpc7i/ZX3f2TzT3M0FdxIEQvO1jgmmiN+D1YpMduAzEhBtj2OBkMN/rv6p7Th4pSH6f5aH3aTvwFTl7EOSgGASI7ttyMehzpm4AVyK+bFEaFg9gnZsSUPpsbAe/0RFhrH+EXZ12Z7thf4dzN1+Sn+G8QrDA1VKaN4IFxD1rQz9Xq9Coii9S9/hPbTGjyBwFH3H1UdQuz5KsgPDEHua4/kPg2Gp/IIItsaLWBqiT9XH45MiQxSosGJ56H/0F2cjcCFd72l1665RNHURdC3lspI77esfJsl+rXXabkAy7vxDXG/XGGcKpwiKDPFfvMEgjkAHil4Za1F36RnyxxvdIAzvgfH8knukYDck07tc++DP4TdWeI7HXuq5Yl6VVFrUQtf64/dkXewlKZSHQo6YvCSpREB0GDrz+Ys2GfO8nw2SwrYwaf88AifzlPvP17bf1mI3AuccJvAjZIpBmqvharKFAebEjVKfGAwpQjWoXlm9LROsq9bCk1UeQ3CJxJqprzssS/Q04JeS1ReCCubL3J7sx86spkP4eNpp95UF+8K748icIs8vdILFklk9skQqi1So6cx3X906pvy1vz+KipTJ8fiVJxsV5MmT0XwA";const S0=44032,L0=4352,V0=4449,T0=4519,L_COUNT=19,V_COUNT=21,T_COUNT=28,N_COUNT=V_COUNT*T_COUNT,S_COUNT=L_COUNT*N_COUNT,S1=S0+S_COUNT,L1=L0+L_COUNT,V1=V0+V_COUNT,T1=T0+T_COUNT;function unpack_cc(et){return et>>24&255}function unpack_cp(et){return et&16777215}let SHIFTED_RANK,EXCLUSIONS,DECOMP,RECOMP;function init$1(){let et=read_compressed_payload(COMPRESSED);SHIFTED_RANK=new Map(read_sorted_arrays(et).flatMap((o,tt)=>o.map(rt=>[rt,tt+1<<24]))),EXCLUSIONS=new Set(read_sorted(et)),DECOMP=new Map,RECOMP=new Map;for(let[o,tt]of read_mapped(et)){if(!EXCLUSIONS.has(o)&&tt.length==2){let[rt,nt]=tt,ot=RECOMP.get(rt);ot||(ot=new Map,RECOMP.set(rt,ot)),ot.set(nt,o)}DECOMP.set(o,tt.reverse())}}function is_hangul(et){return et>=S0&&et<S1}function compose_pair(et,o){if(et>=L0&&et<L1&&o>=V0&&o<V1)return S0+(et-L0)*N_COUNT+(o-V0)*T_COUNT;if(is_hangul(et)&&o>T0&&o<T1&&(et-S0)%T_COUNT==0)return et+(o-T0);{let tt=RECOMP.get(et);return tt&&(tt=tt.get(o),tt)?tt:-1}}function decomposed(et){SHIFTED_RANK||init$1();let o=[],tt=[],rt=!1;function nt(ot){let it=SHIFTED_RANK.get(ot);it&&(rt=!0,ot|=it),o.push(ot)}for(let ot of et)for(;;){if(ot<128)o.push(ot);else if(is_hangul(ot)){let it=ot-S0,st=it/N_COUNT|0,at=it%N_COUNT/T_COUNT|0,ct=it%T_COUNT;nt(L0+st),nt(V0+at),ct>0&&nt(T0+ct)}else{let it=DECOMP.get(ot);it?tt.push(...it):nt(ot)}if(!tt.length)break;ot=tt.pop()}if(rt&&o.length>1){let ot=unpack_cc(o[0]);for(let it=1;it<o.length;it++){let st=unpack_cc(o[it]);if(st==0||ot<=st){ot=st;continue}let at=it-1;for(;;){let ct=o[at+1];if(o[at+1]=o[at],o[at]=ct,!at||(ot=unpack_cc(o[--at]),ot<=st))break}ot=unpack_cc(o[it])}}return o}function composed_from_decomposed(et){let o=[],tt=[],rt=-1,nt=0;for(let ot of et){let it=unpack_cc(ot),st=unpack_cp(ot);if(rt==-1)it==0?rt=st:o.push(st);else if(nt>0&&nt>=it)it==0?(o.push(rt,...tt),tt.length=0,rt=st):tt.push(st),nt=it;else{let at=compose_pair(rt,st);at>=0?rt=at:nt==0&&it==0?(o.push(rt),rt=st):(tt.push(st),nt=it)}}return rt>=0&&o.push(rt,...tt),o}function nfd(et){return decomposed(et).map(unpack_cp)}function nfc(et){return composed_from_decomposed(decomposed(et))}const HYPHEN=45,STOP_CH=".",FE0F=65039,UNIQUE_PH=1,Array_from=et=>Array.from(et);function group_has_cp(et,o){return et.P.has(o)||et.Q.has(o)}class Emoji extends Array{get is_emoji(){return!0}}let MAPPED,IGNORED,CM,NSM,ESCAPE,GROUPS,WHOLE_VALID,WHOLE_MAP,VALID,EMOJI_LIST,EMOJI_ROOT;function init(){if(MAPPED)return;let et=read_compressed_payload(COMPRESSED$1);const o=()=>read_sorted(et),tt=()=>new Set(o()),rt=(lt,dt)=>dt.forEach(ht=>lt.add(ht));MAPPED=new Map(read_mapped(et)),IGNORED=tt(),CM=o(),NSM=new Set(o().map(lt=>CM[lt])),CM=new Set(CM),ESCAPE=tt(),tt();let nt=read_sorted_arrays(et),ot=et();const it=()=>{let lt=new Set;return o().forEach(dt=>rt(lt,nt[dt])),rt(lt,o()),lt};GROUPS=read_array_while(lt=>{let dt=read_array_while(et).map(ht=>ht+96);if(dt.length){let ht=lt>=ot;dt[0]-=32,dt=str_from_cps(dt),ht&&(dt=`Restricted[${dt}]`);let mt=it(),ft=it(),pt=!et();return{N:dt,P:mt,Q:ft,M:pt,R:ht}}}),WHOLE_VALID=tt(),WHOLE_MAP=new Map;let st=o().concat(Array_from(WHOLE_VALID)).sort((lt,dt)=>lt-dt);st.forEach((lt,dt)=>{let ht=et(),mt=st[dt]=ht?st[dt-ht]:{V:[],M:new Map};mt.V.push(lt),WHOLE_VALID.has(lt)||WHOLE_MAP.set(lt,mt)});for(let{V:lt,M:dt}of new Set(WHOLE_MAP.values())){let ht=[];for(let ft of lt){let pt=GROUPS.filter(gt=>group_has_cp(gt,ft)),yt=ht.find(({G:gt})=>pt.some(bt=>gt.has(bt)));yt||(yt={G:new Set,V:[]},ht.push(yt)),yt.V.push(ft),rt(yt.G,pt)}let mt=ht.flatMap(ft=>Array_from(ft.G));for(let{G:ft,V:pt}of ht){let yt=new Set(mt.filter(gt=>!ft.has(gt)));for(let gt of pt)dt.set(gt,yt)}}VALID=new Set;let at=new Set;const ct=lt=>VALID.has(lt)?at.add(lt):VALID.add(lt);for(let lt of GROUPS){for(let dt of lt.P)ct(dt);for(let dt of lt.Q)ct(dt)}for(let lt of VALID)!WHOLE_MAP.has(lt)&&!at.has(lt)&&WHOLE_MAP.set(lt,UNIQUE_PH);rt(VALID,nfd(VALID)),EMOJI_LIST=read_trie(et).map(lt=>Emoji.from(lt)).sort(compare_arrays),EMOJI_ROOT=new Map;for(let lt of EMOJI_LIST){let dt=[EMOJI_ROOT];for(let ht of lt){let mt=dt.map(ft=>{let pt=ft.get(ht);return pt||(pt=new Map,ft.set(ht,pt)),pt});ht===FE0F?dt.push(...mt):dt=mt}for(let ht of dt)ht.V=lt}}function quoted_cp(et){return(should_escape(et)?"":`${bidi_qq(safe_str_from_cps([et]))} `)+quote_cp(et)}function bidi_qq(et){return`"${et}"`}function check_label_extension(et){if(et.length>=4&&et[2]==HYPHEN&&et[3]==HYPHEN)throw new Error(`invalid label extension: "${str_from_cps(et.slice(0,4))}"`)}function check_leading_underscore(et){for(let tt=et.lastIndexOf(95);tt>0;)if(et[--tt]!==95)throw new Error("underscore allowed only at start")}function check_fenced(et){let o=et[0],tt=FENCED.get(o);if(tt)throw error_placement(`leading ${tt}`);let rt=et.length,nt=-1;for(let ot=1;ot<rt;ot++){o=et[ot];let it=FENCED.get(o);if(it){if(nt==ot)throw error_placement(`${tt} + ${it}`);nt=ot+1,tt=it}}if(nt==rt)throw error_placement(`trailing ${tt}`)}function safe_str_from_cps(et,o=1/0,tt=quote_cp){let rt=[];is_combining_mark(et[0])&&rt.push("◌"),et.length>o&&(o>>=1,et=[...et.slice(0,o),8230,...et.slice(-o)]);let nt=0,ot=et.length;for(let it=0;it<ot;it++){let st=et[it];should_escape(st)&&(rt.push(str_from_cps(et.slice(nt,it))),rt.push(tt(st)),nt=it+1)}return rt.push(str_from_cps(et.slice(nt,ot))),rt.join("")}function is_combining_mark(et,o){return init(),CM.has(et)}function should_escape(et){return init(),ESCAPE.has(et)}function ens_normalize(et){return flatten$1(split(et,nfc,filter_fe0f))}function split(et,o,tt){if(!et)return[];init();let rt=0;return et.split(STOP_CH).map(nt=>{let ot=explode_cp(nt),it={input:ot,offset:rt};rt+=ot.length+1;try{let st=it.tokens=tokens_from_str(ot,o,tt),at=st.length,ct;if(!at)throw new Error("empty label");let lt=it.output=st.flat();if(check_leading_underscore(lt),!(it.emoji=at>1||st[0].is_emoji)&&lt.every(ht=>ht<128))check_label_extension(lt),ct="ASCII";else{let ht=st.flatMap(mt=>mt.is_emoji?[]:mt);if(!ht.length)ct="Emoji";else{if(CM.has(lt[0]))throw error_placement("leading combining mark");for(let pt=1;pt<at;pt++){let yt=st[pt];if(!yt.is_emoji&&CM.has(yt[0]))throw error_placement(`emoji + combining mark: "${str_from_cps(st[pt-1])} + ${safe_str_from_cps([yt[0]])}"`)}check_fenced(lt);let mt=Array_from(new Set(ht)),[ft]=determine_group(mt);check_group(ft,ht),check_whole(ft,mt),ct=ft.N}}it.type=ct}catch(st){it.error=st}return it})}function check_whole(et,o){let tt,rt=[];for(let nt of o){let ot=WHOLE_MAP.get(nt);if(ot===UNIQUE_PH)return;if(ot){let it=ot.M.get(nt);if(tt=tt?tt.filter(st=>it.has(st)):Array_from(it),!tt.length)return}else rt.push(nt)}if(tt){for(let nt of tt)if(rt.every(ot=>group_has_cp(nt,ot)))throw new Error(`whole-script confusable: ${et.N}/${nt.N}`)}}function determine_group(et){let o=GROUPS;for(let tt of et){let rt=o.filter(nt=>group_has_cp(nt,tt));if(!rt.length)throw GROUPS.some(nt=>group_has_cp(nt,tt))?error_group_member(o[0],tt):error_disallowed(tt);if(o=rt,rt.length==1)break}return o}function flatten$1(et){return et.map(({input:o,error:tt,output:rt})=>{if(tt){let nt=tt.message;throw new Error(et.length==1?nt:`Invalid label ${bidi_qq(safe_str_from_cps(o,63))}: ${nt}`)}return str_from_cps(rt)}).join(STOP_CH)}function error_disallowed(et){return new Error(`disallowed character: ${quoted_cp(et)}`)}function error_group_member(et,o){let tt=quoted_cp(o),rt=GROUPS.find(nt=>nt.P.has(o));return rt&&(tt=`${rt.N} ${tt}`),new Error(`illegal mixture: ${et.N} + ${tt}`)}function error_placement(et){return new Error(`illegal placement: ${et}`)}function check_group(et,o){for(let tt of o)if(!group_has_cp(et,tt))throw error_group_member(et,tt);if(et.M){let tt=nfd(o);for(let rt=1,nt=tt.length;rt<nt;rt++)if(NSM.has(tt[rt])){let ot=rt+1;for(let it;ot<nt&&NSM.has(it=tt[ot]);ot++)for(let st=rt;st<ot;st++)if(tt[st]==it)throw new Error(`duplicate non-spacing marks: ${quoted_cp(it)}`);if(ot-rt>NSM_MAX)throw new Error(`excessive non-spacing marks: ${bidi_qq(safe_str_from_cps(tt.slice(rt-1,ot)))} (${ot-rt}/${NSM_MAX})`);rt=ot}}}function tokens_from_str(et,o,tt){let rt=[],nt=[];for(et=et.slice().reverse();et.length;){let ot=consume_emoji_reversed(et);if(ot)nt.length&&(rt.push(o(nt)),nt=[]),rt.push(tt(ot));else{let it=et.pop();if(VALID.has(it))nt.push(it);else{let st=MAPPED.get(it);if(st)nt.push(...st);else if(!IGNORED.has(it))throw error_disallowed(it)}}}return nt.length&&rt.push(o(nt)),rt}function filter_fe0f(et){return et.filter(o=>o!=FE0F)}function consume_emoji_reversed(et,o){let tt=EMOJI_ROOT,rt,nt=et.length;for(;nt&&(tt=tt.get(et[--nt]),!!tt);){let{V:ot}=tt;ot&&(rt=ot,et.length=nt)}return rt}function normalize$2(et){return ens_normalize(et)}function debounce$1(et,o,tt){var rt,nt,ot,it,st;o==null&&(o=100);function at(){var lt=Date.now()-it;lt<o&&lt>=0?rt=setTimeout(at,o-lt):(rt=null,tt||(st=et.apply(ot,nt),ot=nt=null))}var ct=function(){ot=this,nt=arguments,it=Date.now();var lt=tt&&!rt;return rt||(rt=setTimeout(at,o)),lt&&(st=et.apply(ot,nt),ot=nt=null),st};return ct.clear=function(){rt&&(clearTimeout(rt),rt=null)},ct.flush=function(){rt&&(st=et.apply(ot,nt),ot=nt=null,clearTimeout(rt),rt=null)},ct}debounce$1.debounce=debounce$1;var debounce_1=debounce$1;const createDebounce=getDefaultExportFromCjs(debounce_1);function useMeasure(et){let{debounce:o,scroll:tt,polyfill:rt,offsetSize:nt}=et===void 0?{debounce:0,scroll:!1,offsetSize:!1}:et;const ot=rt||(typeof window>"u"?class{}:window.ResizeObserver);if(!ot)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[it,st]=reactExports.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),at=reactExports.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:it}),ct=o?typeof o=="number"?o:o.scroll:null,lt=o?typeof o=="number"?o:o.resize:null,dt=reactExports.useRef(!1);reactExports.useEffect(()=>(dt.current=!0,()=>void(dt.current=!1)));const[ht,mt,ft]=reactExports.useMemo(()=>{const bt=()=>{if(!at.current.element)return;const{left:xt,top:vt,width:Et,height:Ct,bottom:St,right:At,x:kt,y:It}=at.current.element.getBoundingClientRect(),Nt={left:xt,top:vt,width:Et,height:Ct,bottom:St,right:At,x:kt,y:It};at.current.element instanceof HTMLElement&&nt&&(Nt.height=at.current.element.offsetHeight,Nt.width=at.current.element.offsetWidth),Object.freeze(Nt),dt.current&&!areBoundsEqual(at.current.lastBounds,Nt)&&st(at.current.lastBounds=Nt)};return[bt,lt?createDebounce(bt,lt):bt,ct?createDebounce(bt,ct):bt]},[st,nt,ct,lt]);function pt(){at.current.scrollContainers&&(at.current.scrollContainers.forEach(bt=>bt.removeEventListener("scroll",ft,!0)),at.current.scrollContainers=null),at.current.resizeObserver&&(at.current.resizeObserver.disconnect(),at.current.resizeObserver=null)}function yt(){at.current.element&&(at.current.resizeObserver=new ot(ft),at.current.resizeObserver.observe(at.current.element),tt&&at.current.scrollContainers&&at.current.scrollContainers.forEach(bt=>bt.addEventListener("scroll",ft,{capture:!0,passive:!0})))}const gt=bt=>{!bt||bt===at.current.element||(pt(),at.current.element=bt,at.current.scrollContainers=findScrollContainers(bt),yt())};return useOnWindowScroll(ft,!!tt),useOnWindowResize(mt),reactExports.useEffect(()=>{pt(),yt()},[tt,ft,mt]),reactExports.useEffect(()=>pt,[]),[gt,it,ht]}function useOnWindowResize(et){reactExports.useEffect(()=>{const o=et;return window.addEventListener("resize",o),()=>void window.removeEventListener("resize",o)},[et])}function useOnWindowScroll(et,o){reactExports.useEffect(()=>{if(o){const tt=et;return window.addEventListener("scroll",tt,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",tt,!0)}},[et,o])}function findScrollContainers(et){const o=[];if(!et||et===document.body)return o;const{overflow:tt,overflowX:rt,overflowY:nt}=window.getComputedStyle(et);return[tt,rt,nt].some(ot=>ot==="auto"||ot==="scroll")&&o.push(et),[...o,...findScrollContainers(et.parentElement)]}const keys$1=["x","y","top","bottom","left","right","width","height"],areBoundsEqual=(et,o)=>keys$1.every(tt=>et[tt]===o[tt]);var MapShim=function(){if(typeof Map<"u")return Map;function et(o,tt){var rt=-1;return o.some(function(nt,ot){return nt[0]===tt?(rt=ot,!0):!1}),rt}return function(){function o(){this.__entries__=[]}return Object.defineProperty(o.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),o.prototype.get=function(tt){var rt=et(this.__entries__,tt),nt=this.__entries__[rt];return nt&&nt[1]},o.prototype.set=function(tt,rt){var nt=et(this.__entries__,tt);~nt?this.__entries__[nt][1]=rt:this.__entries__.push([tt,rt])},o.prototype.delete=function(tt){var rt=this.__entries__,nt=et(rt,tt);~nt&&rt.splice(nt,1)},o.prototype.has=function(tt){return!!~et(this.__entries__,tt)},o.prototype.clear=function(){this.__entries__.splice(0)},o.prototype.forEach=function(tt,rt){rt===void 0&&(rt=null);for(var nt=0,ot=this.__entries__;nt<ot.length;nt++){var it=ot[nt];tt.call(rt,it[1],it[0])}},o}()}(),isBrowser$2=typeof window<"u"&&typeof document<"u"&&window.document===document,global$1=function(){return typeof globalThis<"u"&&globalThis.Math===Math?globalThis:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),requestAnimationFrame$1=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(global$1):function(et){return setTimeout(function(){return et(Date.now())},1e3/60)}}(),trailingTimeout=2;function throttle(et,o){var tt=!1,rt=!1,nt=0;function ot(){tt&&(tt=!1,et()),rt&&st()}function it(){requestAnimationFrame$1(ot)}function st(){var at=Date.now();if(tt){if(at-nt<trailingTimeout)return;rt=!0}else tt=!0,rt=!1,setTimeout(it,o);nt=at}return st}var REFRESH_DELAY=20,transitionKeys=["top","right","bottom","left","width","height","size","weight"],mutationObserverSupported=typeof MutationObserver<"u",ResizeObserverController=function(){function et(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=throttle(this.refresh.bind(this),REFRESH_DELAY)}return et.prototype.addObserver=function(o){~this.observers_.indexOf(o)||this.observers_.push(o),this.connected_||this.connect_()},et.prototype.removeObserver=function(o){var tt=this.observers_,rt=tt.indexOf(o);~rt&&tt.splice(rt,1),!tt.length&&this.connected_&&this.disconnect_()},et.prototype.refresh=function(){var o=this.updateObservers_();o&&this.refresh()},et.prototype.updateObservers_=function(){var o=this.observers_.filter(function(tt){return tt.gatherActive(),tt.hasActive()});return o.forEach(function(tt){return tt.broadcastActive()}),o.length>0},et.prototype.connect_=function(){!isBrowser$2||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),mutationObserverSupported?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},et.prototype.disconnect_=function(){!isBrowser$2||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},et.prototype.onTransitionEnd_=function(o){var tt=o.propertyName,rt=tt===void 0?"":tt,nt=transitionKeys.some(function(ot){return!!~rt.indexOf(ot)});nt&&this.refresh()},et.getInstance=function(){return this.instance_||(this.instance_=new et),this.instance_},et.instance_=null,et}(),defineConfigurable=function(et,o){for(var tt=0,rt=Object.keys(o);tt<rt.length;tt++){var nt=rt[tt];Object.defineProperty(et,nt,{value:o[nt],enumerable:!1,writable:!1,configurable:!0})}return et},getWindowOf=function(et){var o=et&&et.ownerDocument&&et.ownerDocument.defaultView;return o||global$1},emptyRect=createRectInit(0,0,0,0);function toFloat(et){return parseFloat(et)||0}function getBordersSize(et){for(var o=[],tt=1;tt<arguments.length;tt++)o[tt-1]=arguments[tt];return o.reduce(function(rt,nt){var ot=et["border-"+nt+"-width"];return rt+toFloat(ot)},0)}function getPaddings(et){for(var o=["top","right","bottom","left"],tt={},rt=0,nt=o;rt<nt.length;rt++){var ot=nt[rt],it=et["padding-"+ot];tt[ot]=toFloat(it)}return tt}function getSVGContentRect(et){var o=et.getBBox();return createRectInit(0,0,o.width,o.height)}function getHTMLElementContentRect(et){var o=et.clientWidth,tt=et.clientHeight;if(!o&&!tt)return emptyRect;var rt=getWindowOf(et).getComputedStyle(et),nt=getPaddings(rt),ot=nt.left+nt.right,it=nt.top+nt.bottom,st=toFloat(rt.width),at=toFloat(rt.height);if(rt.boxSizing==="border-box"&&(Math.round(st+ot)!==o&&(st-=getBordersSize(rt,"left","right")+ot),Math.round(at+it)!==tt&&(at-=getBordersSize(rt,"top","bottom")+it)),!isDocumentElement(et)){var ct=Math.round(st+ot)-o,lt=Math.round(at+it)-tt;Math.abs(ct)!==1&&(st-=ct),Math.abs(lt)!==1&&(at-=lt)}return createRectInit(nt.left,nt.top,st,at)}var isSVGGraphicsElement=function(){return typeof SVGGraphicsElement<"u"?function(et){return et instanceof getWindowOf(et).SVGGraphicsElement}:function(et){return et instanceof getWindowOf(et).SVGElement&&typeof et.getBBox=="function"}}();function isDocumentElement(et){return et===getWindowOf(et).document.documentElement}function getContentRect(et){return isBrowser$2?isSVGGraphicsElement(et)?getSVGContentRect(et):getHTMLElementContentRect(et):emptyRect}function createReadOnlyRect(et){var o=et.x,tt=et.y,rt=et.width,nt=et.height,ot=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,it=Object.create(ot.prototype);return defineConfigurable(it,{x:o,y:tt,width:rt,height:nt,top:tt,right:o+rt,bottom:nt+tt,left:o}),it}function createRectInit(et,o,tt,rt){return{x:et,y:o,width:tt,height:rt}}var ResizeObservation=function(){function et(o){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=createRectInit(0,0,0,0),this.target=o}return et.prototype.isActive=function(){var o=getContentRect(this.target);return this.contentRect_=o,o.width!==this.broadcastWidth||o.height!==this.broadcastHeight},et.prototype.broadcastRect=function(){var o=this.contentRect_;return this.broadcastWidth=o.width,this.broadcastHeight=o.height,o},et}(),ResizeObserverEntry=function(){function et(o,tt){var rt=createReadOnlyRect(tt);defineConfigurable(this,{target:o,contentRect:rt})}return et}(),ResizeObserverSPI=function(){function et(o,tt,rt){if(this.activeObservations_=[],this.observations_=new MapShim,typeof o!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=o,this.controller_=tt,this.callbackCtx_=rt}return et.prototype.observe=function(o){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(o instanceof getWindowOf(o).Element))throw new TypeError('parameter 1 is not of type "Element".');var tt=this.observations_;tt.has(o)||(tt.set(o,new ResizeObservation(o)),this.controller_.addObserver(this),this.controller_.refresh())}},et.prototype.unobserve=function(o){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(o instanceof getWindowOf(o).Element))throw new TypeError('parameter 1 is not of type "Element".');var tt=this.observations_;tt.has(o)&&(tt.delete(o),tt.size||this.controller_.removeObserver(this))}},et.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},et.prototype.gatherActive=function(){var o=this;this.clearActive(),this.observations_.forEach(function(tt){tt.isActive()&&o.activeObservations_.push(tt)})},et.prototype.broadcastActive=function(){if(this.hasActive()){var o=this.callbackCtx_,tt=this.activeObservations_.map(function(rt){return new ResizeObserverEntry(rt.target,rt.broadcastRect())});this.callback_.call(o,tt,o),this.clearActive()}},et.prototype.clearActive=function(){this.activeObservations_.splice(0)},et.prototype.hasActive=function(){return this.activeObservations_.length>0},et}(),observers=typeof WeakMap<"u"?new WeakMap:new MapShim,ResizeObserver$1=function(){function et(o){if(!(this instanceof et))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var tt=ResizeObserverController.getInstance(),rt=new ResizeObserverSPI(o,tt,this);observers.set(this,rt)}return et}();["observe","unobserve","disconnect"].forEach(function(et){ResizeObserver$1.prototype[et]=function(){var o;return(o=observers.get(this))[et].apply(o,arguments)}});var index$1=function(){return typeof global$1.ResizeObserver<"u"?global$1.ResizeObserver:ResizeObserver$1}(),browser$1={},canPromise$1=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},qrcode={},utils$2={};let toSJISFunction;const CODEWORDS_COUNT=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];utils$2.getSymbolSize=function(o){if(!o)throw new Error('"version" cannot be null or undefined');if(o<1||o>40)throw new Error('"version" should be in range from 1 to 40');return o*4+17};utils$2.getSymbolTotalCodewords=function(o){return CODEWORDS_COUNT[o]};utils$2.getBCHDigit=function(et){let o=0;for(;et!==0;)o++,et>>>=1;return o};utils$2.setToSJISFunction=function(o){if(typeof o!="function")throw new Error('"toSJISFunc" is not a valid function.');toSJISFunction=o};utils$2.isKanjiModeEnabled=function(){return typeof toSJISFunction<"u"};utils$2.toSJIS=function(o){return toSJISFunction(o)};var errorCorrectionLevel={};(function(et){et.L={bit:1},et.M={bit:0},et.Q={bit:3},et.H={bit:2};function o(tt){if(typeof tt!="string")throw new Error("Param is not a string");switch(tt.toLowerCase()){case"l":case"low":return et.L;case"m":case"medium":return et.M;case"q":case"quartile":return et.Q;case"h":case"high":return et.H;default:throw new Error("Unknown EC Level: "+tt)}}et.isValid=function(rt){return rt&&typeof rt.bit<"u"&&rt.bit>=0&&rt.bit<4},et.from=function(rt,nt){if(et.isValid(rt))return rt;try{return o(rt)}catch{return nt}}})(errorCorrectionLevel);function BitBuffer$1(){this.buffer=[],this.length=0}BitBuffer$1.prototype={get:function(et){const o=Math.floor(et/8);return(this.buffer[o]>>>7-et%8&1)===1},put:function(et,o){for(let tt=0;tt<o;tt++)this.putBit((et>>>o-tt-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(et){const o=Math.floor(this.length/8);this.buffer.length<=o&&this.buffer.push(0),et&&(this.buffer[o]|=128>>>this.length%8),this.length++}};var bitBuffer=BitBuffer$1;function BitMatrix$1(et){if(!et||et<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=et,this.data=new Uint8Array(et*et),this.reservedBit=new Uint8Array(et*et)}BitMatrix$1.prototype.set=function(et,o,tt,rt){const nt=et*this.size+o;this.data[nt]=tt,rt&&(this.reservedBit[nt]=!0)};BitMatrix$1.prototype.get=function(et,o){return this.data[et*this.size+o]};BitMatrix$1.prototype.xor=function(et,o,tt){this.data[et*this.size+o]^=tt};BitMatrix$1.prototype.isReserved=function(et,o){return this.reservedBit[et*this.size+o]};var bitMatrix=BitMatrix$1,alignmentPattern={};(function(et){const o=utils$2.getSymbolSize;et.getRowColCoords=function(rt){if(rt===1)return[];const nt=Math.floor(rt/7)+2,ot=o(rt),it=ot===145?26:Math.ceil((ot-13)/(2*nt-2))*2,st=[ot-7];for(let at=1;at<nt-1;at++)st[at]=st[at-1]-it;return st.push(6),st.reverse()},et.getPositions=function(rt){const nt=[],ot=et.getRowColCoords(rt),it=ot.length;for(let st=0;st<it;st++)for(let at=0;at<it;at++)st===0&&at===0||st===0&&at===it-1||st===it-1&&at===0||nt.push([ot[st],ot[at]]);return nt}})(alignmentPattern);var finderPattern={};const getSymbolSize=utils$2.getSymbolSize,FINDER_PATTERN_SIZE=7;finderPattern.getPositions=function(o){const tt=getSymbolSize(o);return[[0,0],[tt-FINDER_PATTERN_SIZE,0],[0,tt-FINDER_PATTERN_SIZE]]};var maskPattern={};(function(et){et.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const o={N1:3,N2:3,N3:40,N4:10};et.isValid=function(nt){return nt!=null&&nt!==""&&!isNaN(nt)&&nt>=0&&nt<=7},et.from=function(nt){return et.isValid(nt)?parseInt(nt,10):void 0},et.getPenaltyN1=function(nt){const ot=nt.size;let it=0,st=0,at=0,ct=null,lt=null;for(let dt=0;dt<ot;dt++){st=at=0,ct=lt=null;for(let ht=0;ht<ot;ht++){let mt=nt.get(dt,ht);mt===ct?st++:(st>=5&&(it+=o.N1+(st-5)),ct=mt,st=1),mt=nt.get(ht,dt),mt===lt?at++:(at>=5&&(it+=o.N1+(at-5)),lt=mt,at=1)}st>=5&&(it+=o.N1+(st-5)),at>=5&&(it+=o.N1+(at-5))}return it},et.getPenaltyN2=function(nt){const ot=nt.size;let it=0;for(let st=0;st<ot-1;st++)for(let at=0;at<ot-1;at++){const ct=nt.get(st,at)+nt.get(st,at+1)+nt.get(st+1,at)+nt.get(st+1,at+1);(ct===4||ct===0)&&it++}return it*o.N2},et.getPenaltyN3=function(nt){const ot=nt.size;let it=0,st=0,at=0;for(let ct=0;ct<ot;ct++){st=at=0;for(let lt=0;lt<ot;lt++)st=st<<1&2047|nt.get(ct,lt),lt>=10&&(st===1488||st===93)&&it++,at=at<<1&2047|nt.get(lt,ct),lt>=10&&(at===1488||at===93)&&it++}return it*o.N3},et.getPenaltyN4=function(nt){let ot=0;const it=nt.data.length;for(let at=0;at<it;at++)ot+=nt.data[at];return Math.abs(Math.ceil(ot*100/it/5)-10)*o.N4};function tt(rt,nt,ot){switch(rt){case et.Patterns.PATTERN000:return(nt+ot)%2===0;case et.Patterns.PATTERN001:return nt%2===0;case et.Patterns.PATTERN010:return ot%3===0;case et.Patterns.PATTERN011:return(nt+ot)%3===0;case et.Patterns.PATTERN100:return(Math.floor(nt/2)+Math.floor(ot/3))%2===0;case et.Patterns.PATTERN101:return nt*ot%2+nt*ot%3===0;case et.Patterns.PATTERN110:return(nt*ot%2+nt*ot%3)%2===0;case et.Patterns.PATTERN111:return(nt*ot%3+(nt+ot)%2)%2===0;default:throw new Error("bad maskPattern:"+rt)}}et.applyMask=function(nt,ot){const it=ot.size;for(let st=0;st<it;st++)for(let at=0;at<it;at++)ot.isReserved(at,st)||ot.xor(at,st,tt(nt,at,st))},et.getBestMask=function(nt,ot){const it=Object.keys(et.Patterns).length;let st=0,at=1/0;for(let ct=0;ct<it;ct++){ot(ct),et.applyMask(ct,nt);const lt=et.getPenaltyN1(nt)+et.getPenaltyN2(nt)+et.getPenaltyN3(nt)+et.getPenaltyN4(nt);et.applyMask(ct,nt),lt<at&&(at=lt,st=ct)}return st}})(maskPattern);var errorCorrectionCode={};const ECLevel$1=errorCorrectionLevel,EC_BLOCKS_TABLE=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],EC_CODEWORDS_TABLE=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];errorCorrectionCode.getBlocksCount=function(o,tt){switch(tt){case ECLevel$1.L:return EC_BLOCKS_TABLE[(o-1)*4+0];case ECLevel$1.M:return EC_BLOCKS_TABLE[(o-1)*4+1];case ECLevel$1.Q:return EC_BLOCKS_TABLE[(o-1)*4+2];case ECLevel$1.H:return EC_BLOCKS_TABLE[(o-1)*4+3];default:return}};errorCorrectionCode.getTotalCodewordsCount=function(o,tt){switch(tt){case ECLevel$1.L:return EC_CODEWORDS_TABLE[(o-1)*4+0];case ECLevel$1.M:return EC_CODEWORDS_TABLE[(o-1)*4+1];case ECLevel$1.Q:return EC_CODEWORDS_TABLE[(o-1)*4+2];case ECLevel$1.H:return EC_CODEWORDS_TABLE[(o-1)*4+3];default:return}};var polynomial={},galoisField={};const EXP_TABLE=new Uint8Array(512),LOG_TABLE=new Uint8Array(256);(function(){let o=1;for(let tt=0;tt<255;tt++)EXP_TABLE[tt]=o,LOG_TABLE[o]=tt,o<<=1,o&256&&(o^=285);for(let tt=255;tt<512;tt++)EXP_TABLE[tt]=EXP_TABLE[tt-255]})();galoisField.log=function(o){if(o<1)throw new Error("log("+o+")");return LOG_TABLE[o]};galoisField.exp=function(o){return EXP_TABLE[o]};galoisField.mul=function(o,tt){return o===0||tt===0?0:EXP_TABLE[LOG_TABLE[o]+LOG_TABLE[tt]]};(function(et){const o=galoisField;et.mul=function(rt,nt){const ot=new Uint8Array(rt.length+nt.length-1);for(let it=0;it<rt.length;it++)for(let st=0;st<nt.length;st++)ot[it+st]^=o.mul(rt[it],nt[st]);return ot},et.mod=function(rt,nt){let ot=new Uint8Array(rt);for(;ot.length-nt.length>=0;){const it=ot[0];for(let at=0;at<nt.length;at++)ot[at]^=o.mul(nt[at],it);let st=0;for(;st<ot.length&&ot[st]===0;)st++;ot=ot.slice(st)}return ot},et.generateECPolynomial=function(rt){let nt=new Uint8Array([1]);for(let ot=0;ot<rt;ot++)nt=et.mul(nt,new Uint8Array([1,o.exp(ot)]));return nt}})(polynomial);const Polynomial=polynomial;function ReedSolomonEncoder$1(et){this.genPoly=void 0,this.degree=et,this.degree&&this.initialize(this.degree)}ReedSolomonEncoder$1.prototype.initialize=function(o){this.degree=o,this.genPoly=Polynomial.generateECPolynomial(this.degree)};ReedSolomonEncoder$1.prototype.encode=function(o){if(!this.genPoly)throw new Error("Encoder not initialized");const tt=new Uint8Array(o.length+this.degree);tt.set(o);const rt=Polynomial.mod(tt,this.genPoly),nt=this.degree-rt.length;if(nt>0){const ot=new Uint8Array(this.degree);return ot.set(rt,nt),ot}return rt};var reedSolomonEncoder=ReedSolomonEncoder$1,version$4={},mode$1={},versionCheck={};versionCheck.isValid=function(o){return!isNaN(o)&&o>=1&&o<=40};var regex={};const numeric="[0-9]+",alphanumeric="[A-Z $%*+\\-./:]+";let kanji="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";kanji=kanji.replace(/u/g,"\\u");const byte="(?:(?![A-Z0-9 $%*+\\-./:]|"+kanji+`)(?:.|[\r
]))+`;regex.KANJI=new RegExp(kanji,"g");regex.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");regex.BYTE=new RegExp(byte,"g");regex.NUMERIC=new RegExp(numeric,"g");regex.ALPHANUMERIC=new RegExp(alphanumeric,"g");const TEST_KANJI=new RegExp("^"+kanji+"$"),TEST_NUMERIC=new RegExp("^"+numeric+"$"),TEST_ALPHANUMERIC=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");regex.testKanji=function(o){return TEST_KANJI.test(o)};regex.testNumeric=function(o){return TEST_NUMERIC.test(o)};regex.testAlphanumeric=function(o){return TEST_ALPHANUMERIC.test(o)};(function(et){const o=versionCheck,tt=regex;et.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},et.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},et.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},et.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},et.MIXED={bit:-1},et.getCharCountIndicator=function(ot,it){if(!ot.ccBits)throw new Error("Invalid mode: "+ot);if(!o.isValid(it))throw new Error("Invalid version: "+it);return it>=1&&it<10?ot.ccBits[0]:it<27?ot.ccBits[1]:ot.ccBits[2]},et.getBestModeForData=function(ot){return tt.testNumeric(ot)?et.NUMERIC:tt.testAlphanumeric(ot)?et.ALPHANUMERIC:tt.testKanji(ot)?et.KANJI:et.BYTE},et.toString=function(ot){if(ot&&ot.id)return ot.id;throw new Error("Invalid mode")},et.isValid=function(ot){return ot&&ot.bit&&ot.ccBits};function rt(nt){if(typeof nt!="string")throw new Error("Param is not a string");switch(nt.toLowerCase()){case"numeric":return et.NUMERIC;case"alphanumeric":return et.ALPHANUMERIC;case"kanji":return et.KANJI;case"byte":return et.BYTE;default:throw new Error("Unknown mode: "+nt)}}et.from=function(ot,it){if(et.isValid(ot))return ot;try{return rt(ot)}catch{return it}}})(mode$1);(function(et){const o=utils$2,tt=errorCorrectionCode,rt=errorCorrectionLevel,nt=mode$1,ot=versionCheck,it=7973,st=o.getBCHDigit(it);function at(ht,mt,ft){for(let pt=1;pt<=40;pt++)if(mt<=et.getCapacity(pt,ft,ht))return pt}function ct(ht,mt){return nt.getCharCountIndicator(ht,mt)+4}function lt(ht,mt){let ft=0;return ht.forEach(function(pt){const yt=ct(pt.mode,mt);ft+=yt+pt.getBitsLength()}),ft}function dt(ht,mt){for(let ft=1;ft<=40;ft++)if(lt(ht,ft)<=et.getCapacity(ft,mt,nt.MIXED))return ft}et.from=function(mt,ft){return ot.isValid(mt)?parseInt(mt,10):ft},et.getCapacity=function(mt,ft,pt){if(!ot.isValid(mt))throw new Error("Invalid QR Code version");typeof pt>"u"&&(pt=nt.BYTE);const yt=o.getSymbolTotalCodewords(mt),gt=tt.getTotalCodewordsCount(mt,ft),bt=(yt-gt)*8;if(pt===nt.MIXED)return bt;const xt=bt-ct(pt,mt);switch(pt){case nt.NUMERIC:return Math.floor(xt/10*3);case nt.ALPHANUMERIC:return Math.floor(xt/11*2);case nt.KANJI:return Math.floor(xt/13);case nt.BYTE:default:return Math.floor(xt/8)}},et.getBestVersionForData=function(mt,ft){let pt;const yt=rt.from(ft,rt.M);if(Array.isArray(mt)){if(mt.length>1)return dt(mt,yt);if(mt.length===0)return 1;pt=mt[0]}else pt=mt;return at(pt.mode,pt.getLength(),yt)},et.getEncodedBits=function(mt){if(!ot.isValid(mt)||mt<7)throw new Error("Invalid QR Code version");let ft=mt<<12;for(;o.getBCHDigit(ft)-st>=0;)ft^=it<<o.getBCHDigit(ft)-st;return mt<<12|ft}})(version$4);var formatInfo={};const Utils$3=utils$2,G15=1335,G15_MASK=21522,G15_BCH=Utils$3.getBCHDigit(G15);formatInfo.getEncodedBits=function(o,tt){const rt=o.bit<<3|tt;let nt=rt<<10;for(;Utils$3.getBCHDigit(nt)-G15_BCH>=0;)nt^=G15<<Utils$3.getBCHDigit(nt)-G15_BCH;return(rt<<10|nt)^G15_MASK};var segments={};const Mode$4=mode$1;function NumericData(et){this.mode=Mode$4.NUMERIC,this.data=et.toString()}NumericData.getBitsLength=function(o){return 10*Math.floor(o/3)+(o%3?o%3*3+1:0)};NumericData.prototype.getLength=function(){return this.data.length};NumericData.prototype.getBitsLength=function(){return NumericData.getBitsLength(this.data.length)};NumericData.prototype.write=function(o){let tt,rt,nt;for(tt=0;tt+3<=this.data.length;tt+=3)rt=this.data.substr(tt,3),nt=parseInt(rt,10),o.put(nt,10);const ot=this.data.length-tt;ot>0&&(rt=this.data.substr(tt),nt=parseInt(rt,10),o.put(nt,ot*3+1))};var numericData=NumericData;const Mode$3=mode$1,ALPHA_NUM_CHARS=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function AlphanumericData(et){this.mode=Mode$3.ALPHANUMERIC,this.data=et}AlphanumericData.getBitsLength=function(o){return 11*Math.floor(o/2)+6*(o%2)};AlphanumericData.prototype.getLength=function(){return this.data.length};AlphanumericData.prototype.getBitsLength=function(){return AlphanumericData.getBitsLength(this.data.length)};AlphanumericData.prototype.write=function(o){let tt;for(tt=0;tt+2<=this.data.length;tt+=2){let rt=ALPHA_NUM_CHARS.indexOf(this.data[tt])*45;rt+=ALPHA_NUM_CHARS.indexOf(this.data[tt+1]),o.put(rt,11)}this.data.length%2&&o.put(ALPHA_NUM_CHARS.indexOf(this.data[tt]),6)};var alphanumericData=AlphanumericData;const Mode$2=mode$1;function ByteData(et){this.mode=Mode$2.BYTE,typeof et=="string"?this.data=new TextEncoder().encode(et):this.data=new Uint8Array(et)}ByteData.getBitsLength=function(o){return o*8};ByteData.prototype.getLength=function(){return this.data.length};ByteData.prototype.getBitsLength=function(){return ByteData.getBitsLength(this.data.length)};ByteData.prototype.write=function(et){for(let o=0,tt=this.data.length;o<tt;o++)et.put(this.data[o],8)};var byteData=ByteData;const Mode$1=mode$1,Utils$2=utils$2;function KanjiData(et){this.mode=Mode$1.KANJI,this.data=et}KanjiData.getBitsLength=function(o){return o*13};KanjiData.prototype.getLength=function(){return this.data.length};KanjiData.prototype.getBitsLength=function(){return KanjiData.getBitsLength(this.data.length)};KanjiData.prototype.write=function(et){let o;for(o=0;o<this.data.length;o++){let tt=Utils$2.toSJIS(this.data[o]);if(tt>=33088&&tt<=40956)tt-=33088;else if(tt>=57408&&tt<=60351)tt-=49472;else throw new Error("Invalid SJIS character: "+this.data[o]+`
Make sure your charset is UTF-8`);tt=(tt>>>8&255)*192+(tt&255),et.put(tt,13)}};var kanjiData=KanjiData,dijkstra={exports:{}};(function(et){var o={single_source_shortest_paths:function(tt,rt,nt){var ot={},it={};it[rt]=0;var st=o.PriorityQueue.make();st.push(rt,0);for(var at,ct,lt,dt,ht,mt,ft,pt,yt;!st.empty();){at=st.pop(),ct=at.value,dt=at.cost,ht=tt[ct]||{};for(lt in ht)ht.hasOwnProperty(lt)&&(mt=ht[lt],ft=dt+mt,pt=it[lt],yt=typeof it[lt]>"u",(yt||pt>ft)&&(it[lt]=ft,st.push(lt,ft),ot[lt]=ct))}if(typeof nt<"u"&&typeof it[nt]>"u"){var gt=["Could not find a path from ",rt," to ",nt,"."].join("");throw new Error(gt)}return ot},extract_shortest_path_from_predecessor_list:function(tt,rt){for(var nt=[],ot=rt;ot;)nt.push(ot),tt[ot],ot=tt[ot];return nt.reverse(),nt},find_path:function(tt,rt,nt){var ot=o.single_source_shortest_paths(tt,rt,nt);return o.extract_shortest_path_from_predecessor_list(ot,nt)},PriorityQueue:{make:function(tt){var rt=o.PriorityQueue,nt={},ot;tt=tt||{};for(ot in rt)rt.hasOwnProperty(ot)&&(nt[ot]=rt[ot]);return nt.queue=[],nt.sorter=tt.sorter||rt.default_sorter,nt},default_sorter:function(tt,rt){return tt.cost-rt.cost},push:function(tt,rt){var nt={value:tt,cost:rt};this.queue.push(nt),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};et.exports=o})(dijkstra);var dijkstraExports=dijkstra.exports;(function(et){const o=mode$1,tt=numericData,rt=alphanumericData,nt=byteData,ot=kanjiData,it=regex,st=utils$2,at=dijkstraExports;function ct(gt){return unescape(encodeURIComponent(gt)).length}function lt(gt,bt,xt){const vt=[];let Et;for(;(Et=gt.exec(xt))!==null;)vt.push({data:Et[0],index:Et.index,mode:bt,length:Et[0].length});return vt}function dt(gt){const bt=lt(it.NUMERIC,o.NUMERIC,gt),xt=lt(it.ALPHANUMERIC,o.ALPHANUMERIC,gt);let vt,Et;return st.isKanjiModeEnabled()?(vt=lt(it.BYTE,o.BYTE,gt),Et=lt(it.KANJI,o.KANJI,gt)):(vt=lt(it.BYTE_KANJI,o.BYTE,gt),Et=[]),bt.concat(xt,vt,Et).sort(function(St,At){return St.index-At.index}).map(function(St){return{data:St.data,mode:St.mode,length:St.length}})}function ht(gt,bt){switch(bt){case o.NUMERIC:return tt.getBitsLength(gt);case o.ALPHANUMERIC:return rt.getBitsLength(gt);case o.KANJI:return ot.getBitsLength(gt);case o.BYTE:return nt.getBitsLength(gt)}}function mt(gt){return gt.reduce(function(bt,xt){const vt=bt.length-1>=0?bt[bt.length-1]:null;return vt&&vt.mode===xt.mode?(bt[bt.length-1].data+=xt.data,bt):(bt.push(xt),bt)},[])}function ft(gt){const bt=[];for(let xt=0;xt<gt.length;xt++){const vt=gt[xt];switch(vt.mode){case o.NUMERIC:bt.push([vt,{data:vt.data,mode:o.ALPHANUMERIC,length:vt.length},{data:vt.data,mode:o.BYTE,length:vt.length}]);break;case o.ALPHANUMERIC:bt.push([vt,{data:vt.data,mode:o.BYTE,length:vt.length}]);break;case o.KANJI:bt.push([vt,{data:vt.data,mode:o.BYTE,length:ct(vt.data)}]);break;case o.BYTE:bt.push([{data:vt.data,mode:o.BYTE,length:ct(vt.data)}])}}return bt}function pt(gt,bt){const xt={},vt={start:{}};let Et=["start"];for(let Ct=0;Ct<gt.length;Ct++){const St=gt[Ct],At=[];for(let kt=0;kt<St.length;kt++){const It=St[kt],Nt=""+Ct+kt;At.push(Nt),xt[Nt]={node:It,lastCount:0},vt[Nt]={};for(let Lt=0;Lt<Et.length;Lt++){const Mt=Et[Lt];xt[Mt]&&xt[Mt].node.mode===It.mode?(vt[Mt][Nt]=ht(xt[Mt].lastCount+It.length,It.mode)-ht(xt[Mt].lastCount,It.mode),xt[Mt].lastCount+=It.length):(xt[Mt]&&(xt[Mt].lastCount=It.length),vt[Mt][Nt]=ht(It.length,It.mode)+4+o.getCharCountIndicator(It.mode,bt))}}Et=At}for(let Ct=0;Ct<Et.length;Ct++)vt[Et[Ct]].end=0;return{map:vt,table:xt}}function yt(gt,bt){let xt;const vt=o.getBestModeForData(gt);if(xt=o.from(bt,vt),xt!==o.BYTE&&xt.bit<vt.bit)throw new Error('"'+gt+'" cannot be encoded with mode '+o.toString(xt)+`.
Suggested mode is: `+o.toString(vt));switch(xt===o.KANJI&&!st.isKanjiModeEnabled()&&(xt=o.BYTE),xt){case o.NUMERIC:return new tt(gt);case o.ALPHANUMERIC:return new rt(gt);case o.KANJI:return new ot(gt);case o.BYTE:return new nt(gt)}}et.fromArray=function(bt){return bt.reduce(function(xt,vt){return typeof vt=="string"?xt.push(yt(vt,null)):vt.data&&xt.push(yt(vt.data,vt.mode)),xt},[])},et.fromString=function(bt,xt){const vt=dt(bt,st.isKanjiModeEnabled()),Et=ft(vt),Ct=pt(Et,xt),St=at.find_path(Ct.map,"start","end"),At=[];for(let kt=1;kt<St.length-1;kt++)At.push(Ct.table[St[kt]].node);return et.fromArray(mt(At))},et.rawSplit=function(bt){return et.fromArray(dt(bt,st.isKanjiModeEnabled()))}})(segments);const Utils$1=utils$2,ECLevel=errorCorrectionLevel,BitBuffer=bitBuffer,BitMatrix=bitMatrix,AlignmentPattern=alignmentPattern,FinderPattern=finderPattern,MaskPattern=maskPattern,ECCode=errorCorrectionCode,ReedSolomonEncoder=reedSolomonEncoder,Version$1=version$4,FormatInfo=formatInfo,Mode=mode$1,Segments=segments;function setupFinderPattern(et,o){const tt=et.size,rt=FinderPattern.getPositions(o);for(let nt=0;nt<rt.length;nt++){const ot=rt[nt][0],it=rt[nt][1];for(let st=-1;st<=7;st++)if(!(ot+st<=-1||tt<=ot+st))for(let at=-1;at<=7;at++)it+at<=-1||tt<=it+at||(st>=0&&st<=6&&(at===0||at===6)||at>=0&&at<=6&&(st===0||st===6)||st>=2&&st<=4&&at>=2&&at<=4?et.set(ot+st,it+at,!0,!0):et.set(ot+st,it+at,!1,!0))}}function setupTimingPattern(et){const o=et.size;for(let tt=8;tt<o-8;tt++){const rt=tt%2===0;et.set(tt,6,rt,!0),et.set(6,tt,rt,!0)}}function setupAlignmentPattern(et,o){const tt=AlignmentPattern.getPositions(o);for(let rt=0;rt<tt.length;rt++){const nt=tt[rt][0],ot=tt[rt][1];for(let it=-2;it<=2;it++)for(let st=-2;st<=2;st++)it===-2||it===2||st===-2||st===2||it===0&&st===0?et.set(nt+it,ot+st,!0,!0):et.set(nt+it,ot+st,!1,!0)}}function setupVersionInfo(et,o){const tt=et.size,rt=Version$1.getEncodedBits(o);let nt,ot,it;for(let st=0;st<18;st++)nt=Math.floor(st/3),ot=st%3+tt-8-3,it=(rt>>st&1)===1,et.set(nt,ot,it,!0),et.set(ot,nt,it,!0)}function setupFormatInfo(et,o,tt){const rt=et.size,nt=FormatInfo.getEncodedBits(o,tt);let ot,it;for(ot=0;ot<15;ot++)it=(nt>>ot&1)===1,ot<6?et.set(ot,8,it,!0):ot<8?et.set(ot+1,8,it,!0):et.set(rt-15+ot,8,it,!0),ot<8?et.set(8,rt-ot-1,it,!0):ot<9?et.set(8,15-ot-1+1,it,!0):et.set(8,15-ot-1,it,!0);et.set(rt-8,8,1,!0)}function setupData(et,o){const tt=et.size;let rt=-1,nt=tt-1,ot=7,it=0;for(let st=tt-1;st>0;st-=2)for(st===6&&st--;;){for(let at=0;at<2;at++)if(!et.isReserved(nt,st-at)){let ct=!1;it<o.length&&(ct=(o[it]>>>ot&1)===1),et.set(nt,st-at,ct),ot--,ot===-1&&(it++,ot=7)}if(nt+=rt,nt<0||tt<=nt){nt-=rt,rt=-rt;break}}}function createData(et,o,tt){const rt=new BitBuffer;tt.forEach(function(at){rt.put(at.mode.bit,4),rt.put(at.getLength(),Mode.getCharCountIndicator(at.mode,et)),at.write(rt)});const nt=Utils$1.getSymbolTotalCodewords(et),ot=ECCode.getTotalCodewordsCount(et,o),it=(nt-ot)*8;for(rt.getLengthInBits()+4<=it&&rt.put(0,4);rt.getLengthInBits()%8!==0;)rt.putBit(0);const st=(it-rt.getLengthInBits())/8;for(let at=0;at<st;at++)rt.put(at%2?17:236,8);return createCodewords(rt,et,o)}function createCodewords(et,o,tt){const rt=Utils$1.getSymbolTotalCodewords(o),nt=ECCode.getTotalCodewordsCount(o,tt),ot=rt-nt,it=ECCode.getBlocksCount(o,tt),st=rt%it,at=it-st,ct=Math.floor(rt/it),lt=Math.floor(ot/it),dt=lt+1,ht=ct-lt,mt=new ReedSolomonEncoder(ht);let ft=0;const pt=new Array(it),yt=new Array(it);let gt=0;const bt=new Uint8Array(et.buffer);for(let St=0;St<it;St++){const At=St<at?lt:dt;pt[St]=bt.slice(ft,ft+At),yt[St]=mt.encode(pt[St]),ft+=At,gt=Math.max(gt,At)}const xt=new Uint8Array(rt);let vt=0,Et,Ct;for(Et=0;Et<gt;Et++)for(Ct=0;Ct<it;Ct++)Et<pt[Ct].length&&(xt[vt++]=pt[Ct][Et]);for(Et=0;Et<ht;Et++)for(Ct=0;Ct<it;Ct++)xt[vt++]=yt[Ct][Et];return xt}function createSymbol(et,o,tt,rt){let nt;if(Array.isArray(et))nt=Segments.fromArray(et);else if(typeof et=="string"){let ct=o;if(!ct){const lt=Segments.rawSplit(et);ct=Version$1.getBestVersionForData(lt,tt)}nt=Segments.fromString(et,ct||40)}else throw new Error("Invalid data");const ot=Version$1.getBestVersionForData(nt,tt);if(!ot)throw new Error("The amount of data is too big to be stored in a QR Code");if(!o)o=ot;else if(o<ot)throw new Error(`
The chosen QR Code version cannot contain this amount of data.
Minimum version required to store current data is: `+ot+`.
`);const it=createData(o,tt,nt),st=Utils$1.getSymbolSize(o),at=new BitMatrix(st);return setupFinderPattern(at,o),setupTimingPattern(at),setupAlignmentPattern(at,o),setupFormatInfo(at,tt,0),o>=7&&setupVersionInfo(at,o),setupData(at,it),isNaN(rt)&&(rt=MaskPattern.getBestMask(at,setupFormatInfo.bind(null,at,tt))),MaskPattern.applyMask(rt,at),setupFormatInfo(at,tt,rt),{modules:at,version:o,errorCorrectionLevel:tt,maskPattern:rt,segments:nt}}qrcode.create=function(o,tt){if(typeof o>"u"||o==="")throw new Error("No input text");let rt=ECLevel.M,nt,ot;return typeof tt<"u"&&(rt=ECLevel.from(tt.errorCorrectionLevel,ECLevel.M),nt=Version$1.from(tt.version),ot=MaskPattern.from(tt.maskPattern),tt.toSJISFunc&&Utils$1.setToSJISFunction(tt.toSJISFunc)),createSymbol(o,nt,rt,ot)};var canvas={},utils$1={};(function(et){function o(tt){if(typeof tt=="number"&&(tt=tt.toString()),typeof tt!="string")throw new Error("Color should be defined as hex string");let rt=tt.slice().replace("#","").split("");if(rt.length<3||rt.length===5||rt.length>8)throw new Error("Invalid hex color: "+tt);(rt.length===3||rt.length===4)&&(rt=Array.prototype.concat.apply([],rt.map(function(ot){return[ot,ot]}))),rt.length===6&&rt.push("F","F");const nt=parseInt(rt.join(""),16);return{r:nt>>24&255,g:nt>>16&255,b:nt>>8&255,a:nt&255,hex:"#"+rt.slice(0,6).join("")}}et.getOptions=function(rt){rt||(rt={}),rt.color||(rt.color={});const nt=typeof rt.margin>"u"||rt.margin===null||rt.margin<0?4:rt.margin,ot=rt.width&&rt.width>=21?rt.width:void 0,it=rt.scale||4;return{width:ot,scale:ot?4:it,margin:nt,color:{dark:o(rt.color.dark||"#000000ff"),light:o(rt.color.light||"#ffffffff")},type:rt.type,rendererOpts:rt.rendererOpts||{}}},et.getScale=function(rt,nt){return nt.width&&nt.width>=rt+nt.margin*2?nt.width/(rt+nt.margin*2):nt.scale},et.getImageWidth=function(rt,nt){const ot=et.getScale(rt,nt);return Math.floor((rt+nt.margin*2)*ot)},et.qrToImageData=function(rt,nt,ot){const it=nt.modules.size,st=nt.modules.data,at=et.getScale(it,ot),ct=Math.floor((it+ot.margin*2)*at),lt=ot.margin*at,dt=[ot.color.light,ot.color.dark];for(let ht=0;ht<ct;ht++)for(let mt=0;mt<ct;mt++){let ft=(ht*ct+mt)*4,pt=ot.color.light;if(ht>=lt&&mt>=lt&&ht<ct-lt&&mt<ct-lt){const yt=Math.floor((ht-lt)/at),gt=Math.floor((mt-lt)/at);pt=dt[st[yt*it+gt]?1:0]}rt[ft++]=pt.r,rt[ft++]=pt.g,rt[ft++]=pt.b,rt[ft]=pt.a}}})(utils$1);(function(et){const o=utils$1;function tt(nt,ot,it){nt.clearRect(0,0,ot.width,ot.height),ot.style||(ot.style={}),ot.height=it,ot.width=it,ot.style.height=it+"px",ot.style.width=it+"px"}function rt(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}et.render=function(ot,it,st){let at=st,ct=it;typeof at>"u"&&(!it||!it.getContext)&&(at=it,it=void 0),it||(ct=rt()),at=o.getOptions(at);const lt=o.getImageWidth(ot.modules.size,at),dt=ct.getContext("2d"),ht=dt.createImageData(lt,lt);return o.qrToImageData(ht.data,ot,at),tt(dt,ct,lt),dt.putImageData(ht,0,0),ct},et.renderToDataURL=function(ot,it,st){let at=st;typeof at>"u"&&(!it||!it.getContext)&&(at=it,it=void 0),at||(at={});const ct=et.render(ot,it,at),lt=at.type||"image/png",dt=at.rendererOpts||{};return ct.toDataURL(lt,dt.quality)}})(canvas);var svgTag={};const Utils=utils$1;function getColorAttrib(et,o){const tt=et.a/255,rt=o+'="'+et.hex+'"';return tt<1?rt+" "+o+'-opacity="'+tt.toFixed(2).slice(1)+'"':rt}function svgCmd(et,o,tt){let rt=et+o;return typeof tt<"u"&&(rt+=" "+tt),rt}function qrToPath(et,o,tt){let rt="",nt=0,ot=!1,it=0;for(let st=0;st<et.length;st++){const at=Math.floor(st%o),ct=Math.floor(st/o);!at&&!ot&&(ot=!0),et[st]?(it++,st>0&&at>0&&et[st-1]||(rt+=ot?svgCmd("M",at+tt,.5+ct+tt):svgCmd("m",nt,0),nt=0,ot=!1),at+1<o&&et[st+1]||(rt+=svgCmd("h",it),it=0)):nt++}return rt}svgTag.render=function(o,tt,rt){const nt=Utils.getOptions(tt),ot=o.modules.size,it=o.modules.data,st=ot+nt.margin*2,at=nt.color.light.a?"<path "+getColorAttrib(nt.color.light,"fill")+' d="M0 0h'+st+"v"+st+'H0z"/>':"",ct="<path "+getColorAttrib(nt.color.dark,"stroke")+' d="'+qrToPath(it,ot,nt.margin)+'"/>',lt='viewBox="0 0 '+st+" "+st+'"',ht='<svg xmlns="http://www.w3.org/2000/svg" '+(nt.width?'width="'+nt.width+'" height="'+nt.width+'" ':"")+lt+' shape-rendering="crispEdges">'+at+ct+`</svg>
`;return typeof rt=="function"&&rt(null,ht),ht};const canPromise=canPromise$1,QRCode$2=qrcode,CanvasRenderer=canvas,SvgRenderer=svgTag;function renderCanvas(et,o,tt,rt,nt){const ot=[].slice.call(arguments,1),it=ot.length,st=typeof ot[it-1]=="function";if(!st&&!canPromise())throw new Error("Callback required as last argument");if(st){if(it<2)throw new Error("Too few arguments provided");it===2?(nt=tt,tt=o,o=rt=void 0):it===3&&(o.getContext&&typeof nt>"u"?(nt=rt,rt=void 0):(nt=rt,rt=tt,tt=o,o=void 0))}else{if(it<1)throw new Error("Too few arguments provided");return it===1?(tt=o,o=rt=void 0):it===2&&!o.getContext&&(rt=tt,tt=o,o=void 0),new Promise(function(at,ct){try{const lt=QRCode$2.create(tt,rt);at(et(lt,o,rt))}catch(lt){ct(lt)}})}try{const at=QRCode$2.create(tt,rt);nt(null,et(at,o,rt))}catch(at){nt(at)}}browser$1.create=QRCode$2.create;browser$1.toCanvas=renderCanvas.bind(null,CanvasRenderer.render);browser$1.toDataURL=renderCanvas.bind(null,CanvasRenderer.renderToDataURL);browser$1.toString=renderCanvas.bind(null,function(et,o,tt){return SvgRenderer.render(et,tt)});var PRE_ENTER=0,ENTERING=1,ENTERED=2,PRE_EXIT=3,EXITING=4,EXITED=5,UNMOUNTED=6,STATES=["preEnter","entering","entered","preExit","exiting","exited","unmounted"],startOrEnd=function(o){return o?UNMOUNTED:EXITED},updateState=function(o,tt,rt,nt,ot){clearTimeout(nt.current),tt(o),rt.current=o,ot&&ot({state:STATES[o]})},useTransition=function(o){var tt=o===void 0?{}:o,rt=tt.enter,nt=rt===void 0?!0:rt,ot=tt.exit,it=ot===void 0?!0:ot,st=tt.preEnter,at=tt.preExit,ct=tt.timeout,lt=tt.initialEntered,dt=tt.mountOnEnter,ht=tt.unmountOnExit,mt=tt.onChange,ft=reactExports.useState(lt?ENTERED:startOrEnd(dt)),pt=ft[0],yt=ft[1],gt=reactExports.useRef(pt),bt=reactExports.useRef(),xt,vt;typeof ct=="object"?(xt=ct.enter,vt=ct.exit):xt=vt=ct;var Et=reactExports.useCallback(function(){var St;switch(gt.current){case ENTERING:case PRE_ENTER:St=ENTERED;break;case EXITING:case PRE_EXIT:St=startOrEnd(ht);break}St!==void 0&&updateState(St,yt,gt,bt,mt)},[mt,ht]),Ct=reactExports.useCallback(function(St){var At=function It(Nt){switch(updateState(Nt,yt,gt,bt,mt),Nt){case ENTERING:xt>=0&&(bt.current=setTimeout(Et,xt));break;case EXITING:vt>=0&&(bt.current=setTimeout(Et,vt));break;case PRE_ENTER:case PRE_EXIT:bt.current=setTimeout(function(){return It(Nt+1)},0);break}},kt=gt.current<=ENTERED;typeof St!="boolean"&&(St=!kt),St?kt||At(nt?st?PRE_ENTER:ENTERING:ENTERED):kt&&At(it?at?PRE_EXIT:EXITING:startOrEnd(ht))},[Et,mt,nt,it,st,at,xt,vt,ht]);return reactExports.useEffect(function(){return function(){return clearTimeout(bt.current)}},[]),[STATES[pt],Ct,Et]};const defaultConnectors=({app:et,walletConnectProjectId:o,coinbaseWalletPreference:tt})=>{const rt=et.name&&et.icon&&et.description&&et.url,nt=!(typeof window>"u")&&(window==null?void 0:window.parent)!==window,ot=[];return nt&&ot.push(safe({allowedDomains:[/gnosis-safe.io$/,/app.safe.global$/]})),ot.push(injected({target:"metaMask"}),coinbaseWallet({appName:et.name,appLogoUrl:et.icon,overrideIsMetaMask:!1,preference:tt})),o&&ot.push(walletConnect({showQrModal:!1,projectId:o,metadata:rt?{name:et.name,description:et.description,url:et.url,icons:[et.icon]}:void 0})),ot};let globalAppName,globalAppIcon;const getAppName=()=>globalAppName,getAppIcon=()=>globalAppIcon,defaultConfig=({appName:et="ConnectKit",appIcon:o,appDescription:tt,appUrl:rt,walletConnectProjectId:nt,coinbaseWalletPreference:ot,chains:it=[mainnet,polygon,optimism,arbitrum],client:st,...at})=>{var ct,lt;globalAppName=et,o&&(globalAppIcon=o);const dt=(ct=at==null?void 0:at.transports)!==null&&ct!==void 0?ct:Object.fromEntries(it.map(ft=>[ft.id,http()])),ht=(lt=at==null?void 0:at.connectors)!==null&&lt!==void 0?lt:defaultConnectors({app:{name:et,icon:o,description:tt,url:rt},walletConnectProjectId:nt,coinbaseWalletPreference:ot});return{...at,chains:it,connectors:ht,transports:dt}},isWalletInstalled=et=>{if(typeof window>"u")return!1;const{ethereum:o}=window;return!!(o!=null&&o[`is${et}`]||o!=null&&o.providers&&(o!=null&&o.providers.find(tt=>tt==null?void 0:tt[`is${et}`])))},isFamily=()=>isWalletInstalled("Family"),isRainbow=()=>isWalletInstalled("Rainbow"),isZerion=()=>isWalletInstalled("Zerion"),Mock=({...et})=>jsxRuntimeExports.jsxs("svg",{...et,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)"},children:[jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.5611 8.12948C21.0082 7.90729 21.5007 7.79167 22 7.79167C22.4993 7.79167 22.9919 7.90729 23.439 8.12948L23.4408 8.1304L33.0387 12.9293C33.577 13.197 34.031 13.61 34.3478 14.121C34.6649 14.6323 34.833 15.2218 34.8333 15.8234V27.2595C34.833 27.8611 34.6649 28.4511 34.3478 28.9624C34.031 29.4733 33.578 29.8858 33.0398 30.1535L23.4411 34.9528C22.9919 35.1775 22.4963 35.2947 21.994 35.2947C21.4918 35.2947 20.9964 35.1777 20.5472 34.9529L10.9475 30.1531L10.9452 30.1519C10.4071 29.8808 9.95535 29.4646 9.6411 28.9504C9.32739 28.437 9.16312 27.8464 9.16673 27.2448L9.16675 27.2417L10.0004 27.2475H9.16673V27.2448V15.8239C9.16705 15.2223 9.33518 14.6322 9.65222 14.121C9.96906 13.61 10.4221 13.1976 10.9604 12.9298L20.5592 8.1304L20.5611 8.12948ZM21.3031 9.62267L11.8706 14.3389L22 19.4036L32.1294 14.3389L22.697 9.62267C22.4806 9.51531 22.2416 9.45905 22 9.45905C21.7585 9.45905 21.5194 9.51534 21.3031 9.62267ZM10.8341 15.8241C10.8341 15.7785 10.8362 15.733 10.8401 15.6878L21.1663 20.8509V33.3983L11.6955 28.6629C11.4352 28.5315 11.2159 28.3297 11.0638 28.0809C10.9116 27.8318 10.8321 27.5452 10.8341 27.2533L10.8341 27.2475V15.8241ZM22.8337 33.3923L32.2967 28.6608C32.5576 28.5312 32.7772 28.3313 32.9308 28.0836C33.0844 27.836 33.1658 27.5504 33.166 27.259V15.8243C33.1659 15.7786 33.1639 15.7331 33.1599 15.6878L22.8337 20.8509V33.3923Z",fill:"url(#paint0_linear_3546_7073)"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.8341 15.8241C10.8341 15.7785 10.8362 15.733 10.8401 15.6878L21.1663 20.8509V33.3983L11.6955 28.6629C11.4352 28.5315 11.2159 28.3297 11.0638 28.0809C10.9116 27.8318 10.8321 27.5452 10.8341 27.2533L10.8341 27.2475V15.8241Z",fill:"url(#paint1_linear_3546_7073)",fillOpacity:"0.3"}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_3546_7073",x1:"22",y1:"7.79167",x2:"22",y2:"35.2947",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"white"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"white",stopOpacity:"0.7"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint1_linear_3546_7073",x1:"22",y1:"7.79167",x2:"22",y2:"35.2947",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"white"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"white",stopOpacity:"0.7"})]})]})]}),Injected=({...et})=>jsxRuntimeExports.jsx("svg",{...et,width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.6505 3.64041C15.6501 3.64062 15.6497 3.64083 15.6493 3.64103L6.05165 8.43985L16.2501 13.5391L26.4484 8.43987L16.8508 3.64103C16.8504 3.64083 16.85 3.64063 16.8496 3.64043C16.6632 3.54806 16.458 3.5 16.25 3.5C16.042 3.5 15.8369 3.54806 15.6505 3.64041ZM28 10.4592L17.5001 15.7091L17.5 28.5205L27.248 23.6465L27.2508 23.6452C27.4757 23.5334 27.665 23.3611 27.7973 23.1477C27.9297 22.9342 27.9999 22.6881 28 22.4369V10.4592ZM15 28.527L15.0001 15.7091L4.50006 10.4591V22.4333C4.49831 22.6849 4.56687 22.9319 4.69807 23.1466C4.82896 23.3608 5.01696 23.5342 5.24095 23.6475C5.24148 23.6477 5.242 23.648 5.24253 23.6483L15 28.527ZM14.5207 31.0824L4.12104 25.8826L4.11759 25.8809C3.47681 25.558 2.93902 25.0625 2.56486 24.4502C2.19154 23.8394 1.99597 23.1365 2.00006 22.4207V10.0486C2.00044 9.33234 2.20062 8.62972 2.5781 8.021C2.95529 7.41274 3.49457 6.92167 4.13537 6.60291C4.13585 6.60267 4.13633 6.60243 4.13681 6.60219L14.534 1.40359L14.5368 1.40221C15.0692 1.13767 15.6556 1 16.25 1C16.8445 1 17.4309 1.13767 17.9633 1.40221L17.966 1.40358L28.3633 6.60219C28.3638 6.60245 28.3643 6.6027 28.3648 6.60295C29.0055 6.92171 29.5448 7.41276 29.922 8.021C30.2994 8.62973 30.4996 9.33168 30.5 10.0479V22.4376C30.4996 23.1538 30.2994 23.8565 29.922 24.4652C29.5448 25.0734 29.0056 25.5644 28.365 25.8831C28.3644 25.8834 28.3638 25.8837 28.3633 25.884L17.9664 31.0824C17.9663 31.0825 17.9665 31.0824 17.9664 31.0824C17.4316 31.3499 16.8415 31.4894 16.2435 31.4894C15.6455 31.4894 15.0554 31.3499 14.5207 31.0824C14.5205 31.0824 14.5208 31.0825 14.5207 31.0824Z",fill:"#CCCCCC"})}),WalletConnect=({background:et=!1,...o})=>jsxRuntimeExports.jsx("svg",{...o,width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:et?{background:"var(--ck-brand-walletConnect)"}:void 0,children:jsxRuntimeExports.jsx("path",{d:"M9.58818 11.8556C13.1293 8.31442 18.8706 8.31442 22.4117 11.8556L22.8379 12.2818C23.015 12.4588 23.015 12.7459 22.8379 12.9229L21.3801 14.3808C21.2915 14.4693 21.148 14.4693 21.0595 14.3808L20.473 13.7943C18.0026 11.3239 13.9973 11.3239 11.5269 13.7943L10.8989 14.4223C10.8104 14.5109 10.6668 14.5109 10.5783 14.4223L9.12041 12.9645C8.94336 12.7875 8.94336 12.5004 9.12041 12.3234L9.58818 11.8556ZM25.4268 14.8706L26.7243 16.1682C26.9013 16.3452 26.9013 16.6323 26.7243 16.8093L20.8737 22.6599C20.6966 22.8371 20.4096 22.8371 20.2325 22.6599L16.0802 18.5076C16.0359 18.4634 15.9641 18.4634 15.9199 18.5076L11.7675 22.6599C11.5905 22.8371 11.3034 22.8371 11.1264 22.66C11.1264 22.66 11.1264 22.6599 11.1264 22.6599L5.27561 16.8092C5.09856 16.6322 5.09856 16.3451 5.27561 16.168L6.57313 14.8706C6.75019 14.6934 7.03726 14.6934 7.21431 14.8706L11.3668 19.023C11.411 19.0672 11.4828 19.0672 11.5271 19.023L15.6793 14.8706C15.8563 14.6934 16.1434 14.6934 16.3205 14.8706L20.473 19.023C20.5172 19.0672 20.589 19.0672 20.6332 19.023L24.7856 14.8706C24.9627 14.6935 25.2498 14.6935 25.4268 14.8706Z",fill:et?"white":"var(--ck-brand-walletConnect)"})}),MetaMask=({background:et=!1,...o})=>jsxRuntimeExports.jsxs("svg",{...o,style:et?{background:"linear-gradient(0deg, var(--ck-brand-metamask-12), var(--ck-brand-metamask-11))",borderRadius:"27.5%"}:void 0,width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{d:"M27.2684 4.03027L17.5018 11.2841L19.3079 7.00442L27.2684 4.03027Z",fill:"var(--ck-brand-metamask-02)",stroke:"var(--ck-brand-metamask-02)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M4.7218 4.03027L14.4099 11.3528L12.6921 7.00442L4.7218 4.03027Z",fill:"var(--ck-brand-metamask-08)",stroke:"var(--ck-brand-metamask-08)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M23.7544 20.8438L21.1532 24.8289L26.7187 26.3602L28.3187 20.9321L23.7544 20.8438Z",fill:"var(--ck-brand-metamask-08)",stroke:"var(--ck-brand-metamask-08)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M3.69104 20.9321L5.28117 26.3602L10.8467 24.8289L8.24551 20.8438L3.69104 20.9321Z",fill:"var(--ck-brand-metamask-08)",stroke:"var(--ck-brand-metamask-08)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M10.5327 14.1108L8.98181 16.4568L14.5081 16.7022L14.3117 10.7637L10.5327 14.1108Z",fill:"var(--ck-brand-metamask-08)",stroke:"var(--ck-brand-metamask-08)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M21.4576 14.1111L17.6295 10.6953L17.5018 16.7025L23.0182 16.4571L21.4576 14.1111Z",fill:"var(--ck-brand-metamask-08)",stroke:"var(--ck-brand-metamask-08)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M10.8469 24.8292L14.1647 23.2096L11.2984 20.9717L10.8469 24.8292Z",fill:"var(--ck-brand-metamask-08)",stroke:"var(--ck-brand-metamask-08)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M17.8257 23.2096L21.1531 24.8292L20.6918 20.9717L17.8257 23.2096Z",fill:"var(--ck-brand-metamask-08)",stroke:"var(--ck-brand-metamask-08)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M21.1531 24.8296L17.8257 23.21L18.0906 25.3793L18.0612 26.2921L21.1531 24.8296Z",fill:"var(--ck-brand-metamask-06)",stroke:"var(--ck-brand-metamask-06)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M10.8469 24.8296L13.9388 26.2921L13.9192 25.3793L14.1647 23.21L10.8469 24.8296Z",fill:"var(--ck-brand-metamask-06)",stroke:"var(--ck-brand-metamask-06)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M13.9877 19.5389L11.2196 18.7242L13.1729 17.8311L13.9877 19.5389Z",fill:"var(--ck-brand-metamask-09)",stroke:"var(--ck-brand-metamask-09)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M18.0023 19.5389L18.8171 17.8311L20.7802 18.7242L18.0023 19.5389Z",fill:"var(--ck-brand-metamask-09)",stroke:"var(--ck-brand-metamask-09)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M10.8468 24.8289L11.3179 20.8438L8.24561 20.9321L10.8468 24.8289Z",fill:"var(--ck-brand-metamask-03)",stroke:"var(--ck-brand-metamask-03)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M20.6821 20.8438L21.1532 24.8289L23.7544 20.9321L20.6821 20.8438Z",fill:"var(--ck-brand-metamask-03)",stroke:"var(--ck-brand-metamask-03)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M23.0182 16.4565L17.5018 16.7019L18.0122 19.5387L18.827 17.8308L20.7902 18.7239L23.0182 16.4565Z",fill:"var(--ck-brand-metamask-03)",stroke:"var(--ck-brand-metamask-03)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M11.2198 18.7239L13.1829 17.8308L13.9878 19.5387L14.5081 16.7019L8.98181 16.4565L11.2198 18.7239Z",fill:"var(--ck-brand-metamask-03)",stroke:"var(--ck-brand-metamask-03)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M8.98181 16.4565L11.2983 20.9718L11.2198 18.7239L8.98181 16.4565Z",fill:"var(--ck-brand-metamask-10)",stroke:"var(--ck-brand-metamask-10)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M20.7901 18.7239L20.6919 20.9718L23.0181 16.4565L20.7901 18.7239Z",fill:"var(--ck-brand-metamask-10)",stroke:"var(--ck-brand-metamask-10)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M14.508 16.7021L13.9878 19.5389L14.6356 22.886L14.7828 18.4788L14.508 16.7021Z",fill:"var(--ck-brand-metamask-10)",stroke:"var(--ck-brand-metamask-10)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M17.5017 16.7021L17.2367 18.4689L17.3545 22.886L18.0121 19.5389L17.5017 16.7021Z",fill:"var(--ck-brand-metamask-10)",stroke:"var(--ck-brand-metamask-10)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M18.0121 19.5388L17.3545 22.886L17.8257 23.2099L20.6918 20.972L20.79 18.7241L18.0121 19.5388Z",fill:"var(--ck-brand-metamask-01)",stroke:"var(--ck-brand-metamask-01)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M11.2196 18.7241L11.2981 20.972L14.1644 23.2099L14.6355 22.886L13.9877 19.5388L11.2196 18.7241Z",fill:"var(--ck-brand-metamask-01)",stroke:"var(--ck-brand-metamask-01)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M18.0615 26.2917L18.0908 25.3788L17.8455 25.1628H14.145L13.9192 25.3788L13.9388 26.2917L10.8469 24.8291L11.9267 25.7126L14.1155 27.234H17.875L20.0736 25.7126L21.1533 24.8291L18.0615 26.2917Z",fill:"var(--ck-brand-metamask-07)",stroke:"var(--ck-brand-metamask-07)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M17.8258 23.2096L17.3546 22.8857H14.6357L14.1646 23.2096L13.9191 25.379L14.1449 25.163H17.8454L18.0907 25.379L17.8258 23.2096Z",fill:"var(--ck-brand-metamask-04)",stroke:"var(--ck-brand-metamask-04)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M27.6806 11.7552L28.5149 7.75041L27.2683 4.03027L17.8257 11.0387L21.4575 14.1109L26.591 15.6128L27.7296 14.2876L27.2389 13.9342L28.0241 13.2178L27.4156 12.7465L28.2007 12.1478L27.6806 11.7552Z",fill:"var(--ck-brand-metamask-05)",stroke:"var(--ck-brand-metamask-05)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M3.48486 7.75041L4.3192 11.7552L3.78916 12.1478L4.57441 12.7465L3.97566 13.2178L4.7609 13.9342L4.27012 14.2876L5.39892 15.6128L10.5325 14.1109L14.1644 11.0387L4.72164 4.03027L3.48486 7.75041Z",fill:"var(--ck-brand-metamask-05)",stroke:"var(--ck-brand-metamask-05)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M26.591 15.6122L21.4575 14.1104L23.0181 16.4564L20.6919 20.9716L23.7544 20.9323H28.3186L26.591 15.6122Z",fill:"var(--ck-brand-metamask-01)",stroke:"var(--ck-brand-metamask-01)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M10.5326 14.1104L5.39897 15.6122L3.69104 20.9323H8.24551L11.2982 20.9716L8.98168 16.4564L10.5326 14.1104Z",fill:"var(--ck-brand-metamask-01)",stroke:"var(--ck-brand-metamask-01)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M17.5018 16.7018L17.8258 11.0381L19.3177 7.00391H12.6921L14.1645 11.0381L14.5081 16.7018L14.6258 18.4883L14.6356 22.8856H17.3546L17.3742 18.4883L17.5018 16.7018Z",fill:"var(--ck-brand-metamask-01)",stroke:"var(--ck-brand-metamask-01)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"})]}),Coinbase=({background:et=!1,...o})=>jsxRuntimeExports.jsxs("svg",{...o,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("circle",{cx:"10",cy:"10",r:"10",fill:"var(--ck-brand-coinbaseWallet)"}),et&&jsxRuntimeExports.jsx("rect",{rx:"27%",width:"20",height:"20",fill:"var(--ck-brand-coinbaseWallet)"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0001 17C13.8661 17 17.0001 13.866 17.0001 10C17.0001 6.13401 13.8661 3 10.0001 3C6.13413 3 3.00012 6.13401 3.00012 10C3.00012 13.866 6.13413 17 10.0001 17ZM8.25012 7.71429C7.95427 7.71429 7.71441 7.95414 7.71441 8.25V11.75C7.71441 12.0459 7.95427 12.2857 8.25012 12.2857H11.7501C12.046 12.2857 12.2858 12.0459 12.2858 11.75V8.25C12.2858 7.95414 12.046 7.71429 11.7501 7.71429H8.25012Z",fill:"white"})]}),Family=({...et})=>jsxRuntimeExports.jsx("svg",{...et,width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{backgroundSize:"100% 100%",backgroundImage:'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAYAAAA9zQYyAAABQGlDQ1BzUDNDAAB4nGNgYHyQk5xbzKLAwJCbV1IU5O6kEBEZpcD+iIGZQYSBk4GPQTYxubjAN9gthAEIihPLi5NLinIYUMC3awyMIPqybkZiXopc+xz3pvOzD4rlWyascy2VY8APuFJSi5OB9B8gVkkuKCphYGAEuoZBqbykAMR2AbJFkjMSU4DsCCBbpwjoQCC7BSSeDmHPALGTIOw1IHZRSJAzkH0AyFZIR2InIbFzc0qToW4AuZ4nNS80GEhzALEMQzFDAIMxgzMONWxgNc5AaMCgCAov9HAoTjM2gujicWJgYL33//9nVQYG9skMDH8n/P//e+H////8GBiYZzEwHBBB6G++z8Bgux/EQoh5AfkbzYHBtBUhpmHBwCDIxcBwoqIgsSgRLMQMxExpmQwMn5YzMPBGMjAIXwDqiQYAOQZcLsEClb4AAGmfSURBVHgB1b0J1G3HVR6497n3/98o6Q0anubBludJeAiTbYwd2gGC6UACBFZY7gVNB3CaJEB3VhbQhNW9OtDQkAYSIOkEGhJCGJrEBGzJkrEsT7Jky5JszXrSexqf3qw3/v891TXsvWvvferce/8nyabrvfPfc+rUqdq166u9d+06pwrP+/CHA3AI8RQRmqFxbyRliVdpcSQ9jj27IASwdAVHVxi7l65hcZAn6NlFdOOce4vCgB5Fc5iXdiN1abSFP1/2PrRoUtiYR/Oy9C9Tr7EwNVc4pwojTDFxC0CMI2nH8hwlhX4D5ZOvWwzy9cHlS8FlzhfwZNlyDN2pPlSXwT0VAtd7yTL8+SDuHOvCzzKdyOButIeuj6HfpTXtu8Ew3WD6NpjnALnFuI1IPB9GK0n5ZiCM9H4GyTJhLqAX1GHZMoJK70Etp0tK4nlhLqBfQF08CFnAgPrN8SHMz0N1YmjluYGwNKDnSeV5DEOnttHnpZ7fKBDyuWJWUHnKqWLUsgyaJ4WbjT2nDv56TCWL6gaw0vklrAv/vpD2mNcWrTpAI00+H9G0G5XWU/1gs8fBSCM1gMq/Y/d9BzD3WiqUpS4zQakyBkDQ6k7HQ5uZi4CgQepphJE66DiuC9PM57lcpsU1auA6Ul1Q1S399o6mF1qXFDq5NbyHqi7QoBmZ5wp8wdn+3G6o6qifRV0vQ3QtbxGwPUbT+RSXeEj/NiUyqQwP5BaIOw8Gl94HAwTKS0viXkk1fejeru02k2+jrNb1gE7d4GA7YwtEYYEtHyhN0HWh6/Q7AQV4bmidPwzDaF00rbpdGnHQqI+vh26LoPjNdQCi3XeAlL7zcaA6g5PYCDBqMup70xahvpK2DkMACmjVvc4904EFApL08dJgAAxVUX3OTEIlFcYYigooPi9fZ0nPtCj6fKPr+2MSD+fUARzNDBCJ0yBR9ZT6qjKC8jRImcxfvuf4b84pLXBdsG1bG94pLSL00i0taHpdP4rv6XnoOiut1aDSaCyYI3AV7aM29KAyc1QwNqSyZ5gHdEcM7kbyaAXfmOYg5vaF2MrQxCzFGFZ3Oj9dH98xPc263t0YQKAdPCA0CHxn1CDo+Z4ysSQvrovTPjkksHCdoLYDtOpCaY3AAZgvYBjABFShWdGfjs7VKcepugSiS3dK/6vt80HHUnVfalA4b2CHDROCG1uDmM87dd4Cgy5HiG1I2OB6uwEC9VhOhxosytZrSSAg2nU9dZ2wRT+MaB+mXwdtd7pD6qJA3ENtQCOxAYZ2d6M+Y3w2dQEL9rntQXXSAGOaO2f+zcACGZVwMRJZ5QtULxE+/OvKHAvTFhMs7bZx5XyOVNZg7kAxT0nkTkmNVNFunoRz6rZXKi4xxvR2YhoDm5ntJRxxroJhBMQtIHe+vj6e8muBTMwKJgFqg/eUV0/8aNWnWRfn/QBV/gDUrh2w0Un9PZMv063axEtfXxehn/JhgdNzHRoDQM2fWiU12Hb3OMyV0K3KeDAbadUA8AQsIDqVRqS1VndOOoCuWCBmIavgdE0MI/D2JCl61eAi7RSYWVWO1Rddp9QN7evQAnk5tJyRUgemknQ6rgMfyozyoNHqfTDo1PWAtkQWuhttxveB6lDqpWtQz7XG0HTqw8fNFF3mOWU+5eKcRNYSG6AN6qk2wNHZKWJPkgqQHstSFZxUpvOJZhTlNaHryQig828AwBFzoFQ0MQ8ziDOYMTGhJ6akhq+gnjGoYWjD8YBEQK0GFbrjAYyD2AAhd6KSFQNZQBCcOMDaTj1wfahjgjU5pB7U2B1UbcPqfCDJuC6qzYxWTPGR3xPTBqm9dD1R6gLAHdO2SSDaU6MJX/u+CA3XMWdES0edk6UzUr14nNDxs/QrfnPlANBSnmkKCsNTQ6gGk+r1A3uR47ykggrmibrWcRbQLOGGErEVqkRT6jjm2qtG5/MJAXwGwajApunhB0QODFrTtECd03VWwmk+1QqEobnBEjrTXkDOkjkBYUIgSHGmkyIaST/wCuCQnk4ETW2TBOSBSei1UkMDcJlFkBBPu0mhnwA6I3BO0nlMs574SrydoRt7Qe0A2VRRYDbjKIVRI6kpvpgcaJWjrkCnC8Wh50I3rkhhdT1RQJ5AZaIBNjZUdqOHDtSub2xEB+5YTpSQM2ApUk0PaA0wEF3Du/qBBcBE1Vnbn1wXAKtxuNzg6qCBrTtlp0FO5Zl0YMHMdeBfDUoteSe+ftxhVVov3TWPQNOv24bbIZ33SaOU81mU4h1pmBkdPEBE6rg6yLgIQAb1fvAbPF0UN5hY0b3GxI+AWYOXwTzRYCYglHN7TzPQgDoUM0QTUCUrSzEl4bCaGTOodhoDPEvr9Gwo5kp+tsOB71ZLpPpb6DYN7+qLyBpJaRwYDqiCrouugx8HxLqzNJ5BBbnutMYT4iUoCYNkBhWTCJrmoBU0heaJ/Or2BlUbMjWAgdww9aCAWOoQUnukMgjY8VgHEBM3g5qvCcAz6vxsZg0EkBIOmsfW5OCEKpGW2PMkM/fwdD51gJ4OAA71GfRmS2oAa9MOJxpIMkOpeJZiufGKqVFUNWSmiS2HKObKhJiuxw8AUMtnerDS5U2nOh6gdMD1YL5hFZYChfpbxwDa/scMBLYnRf1C6aCdgF55CAhMpmWx2vBm4Ad2LMNAnrTa1LW/RkVQvz0SqEmbzLDSOyOAI4E4CyqlTGYAYusz9tiG7uhX28/efQsNoFsJ7aTVIjNDwAkV2CsUxyCepgEIn9MzU8VII6mBTZxu0Mm4LxZgFk9HH9hOLoydEUNnGeCJjpAlQxo4zrB6C/TslkhodLYmWM1R60qgRjAdskq5CuiuYkB0pAZzoQVIqiHVAXPdZoE7axBg8AAraFDTL41ATVsyLRMPaAJz4k+HOJDURZr7+tiKsJZhM7AnwTIjzZN+14nvqdz19BsHjetprBH6iq0krWO8ES5OUouzAut7MQxs78qbagaAIV7hSR2+FwuDSBJPiTHTzsalgqY0us73FSgK07vCQG0OKsIDeQuyT0M1fC82clFjEwZ1aphQ8u9j3myKGFCr+gFJBRiRVtV0AiPhJtToDPTKJwvu5KGRupBUyx0T2EYO1VSCamumDjkDZUqxlA7VG1AHuEPtqr0YRiKHInSqhq0dtQ7WM+VO42DtlCylCdgzoT+QidFl4dLFmGw/0zQ3BvqNQM64i/HrDNqgXsrCOkcR9GA4uPc7FKiH73JQZtq3DNBQXQrMGsgGxJHQBOQVD/RScJVwWCUgWEEjhBYGBlHB1b5ij0Yqm+w1sTeBwIDk4bAN4AdTnZNqbFMycLWZNAUwEk1AQLDNT5PNL1PtSH+oSPbozUgDyYAqJliPfzU41sksYcnNklGm+509WQFNNjSoekDxykwRlLSm9KFAll18bIYBtbuRNsjjGDVucQIl//ZdHiCugRWWeZzUB4lc122OzMnqj0elVVEBHxRd1YbGxswSWneOPrRknjgJzQBeSQXEXlriC4jzgWAGi2xf8UBjU6zohaurcPnmzXDhpk2wfTrN6VJYiww4urYGz545HY8z8FQ8nl9fJ3VTGmad6ElgTnlP2FOAIICBUAEFaAFQzQ0w9r4e3IrXgyVYKEp4c6J902a4YssW2BXrcIGifT0mObJ2Fg6ePQvPpuP0aTg163MjBCqnF7o7GkwFMg0YLKTaMZCEZ5+8FUwMYgxBBniTGDPpap0Sz/PAkbr6aqR9T+T3ZYnvkfYdK6uwQoPztShNj6yvwcHI70OR/wfi71oocnKSNVDRmKklspuuLzRnV12H1L4I1P0K3mKesZoQLRAxwQCgvl0Itl49COKNIBLhBM5tJ+2Lbb+z9zUXScUgJRBHBqxgjVtByEcBeKxsVwBfGFmBsDsy7y07dsDrLjgfrti61fiijXoBG1Lc/pOn4LaDB+ELR4/CExHoE6h2bx6ksInCg8v0r3MAgDqZoDutsZs7HhBSJ8y9IsDO1RV4285d8MZI+1WRdmjQPhYeO3kSPnv4MNx97Dg8d/ZMAW/uOB3Z0oX2DBJkSVht7p5MFxYG0oaBtARWLcJ1wcD+4BA73Ap89a6d8NadO+G6bduk8y0KqaxHnj8Bdx45DPcePw6HI8iZ71nDTAqPOnLfFewEKLosZDv6LCIBtmfXjwCbQd0pHgplJJmDaT9Kt+MjHwk8KzaQ0NAYAPJvNicSgK1kLkeXpfCKiqu2NKu3ItleFpn4zgsvhOu3b4ctkwm8kHB6NovgOJLB/cCJE1k6BG50UDNxoQ5okMSz7rzae6HtzokAuaS7LoL37ZH2V5+3HbZON/w1mwlnorS668hR+EwE94PPP0/mRPWArIdgBl3F2xGMXz6HUA2PjqU0qAF3KGB/VaT5a3ftjkDeAdsi7QHOPSS+fz7Sfnuk/eHIdx6j5MkUoj0da3Tocx233vO9XsxGGUuE6n/n+vo3FLOpvDMCWrtl6mDASWMA671g4HYKzPE+S+gVksgrnQI0VKYmc+JvXroHXhGBPO06eDFDqmgCx588+SQ8dupUUUuIakDGDAABM1uKqEAsPmg2LWg0tCNKte+96kp4RQRFt6REWzakBrvv+PPwB/v3Z9Ok0A7i1eBJojqrCKJ1St1BNA2bUEDSOMTEF0VT4u9ccTm8MWrDTS8y35O34gtHj8EHn34q0r5WXHohmYAgIE6/ZxuA1qBOgF4nQK+HOljWM6UMaDZD+Bp33Xxz0CaHnhmc52NOYNbSeVWBd8VdywCQ7Ll3XXQRvOfii7JkaIWNSosxSCVb+2PPHYQ/fvIJksQo7wME9aAfQ0xATUJAsTETs1L811+4G755z55RbfJi0v6JSPtHDhwgW5VnRosZUj02QTSOJyKra3LzrcZn3x35/k2XXAI7VlfgpaT9yNnE9+ci7c/KmCWZSwLoBFqwYD4bO0MaNM76XtLMwIGaB8TpnREqS795mTvurltuCaJuQzBvvlW7y87wMWjT+aoyMzKQs6nRxQFGBfOUpNv2CIIkHb4q2msvBkOXZfDnjhyB33p0b2Za1j7Kfg5gvTnFi6EnWbJ+jwDu4G9dfjm8ddcu+HLSfmek/T/t2x8HjzOlaQqoxdMR9Dsiyk/bFzAngfM9V14B74yA/nLRnvL89KFD8B8j7Wtk+qUB4zowgIskzucB5HyNJHO6z+aKMT+CMrNC48MHA2iwgz8D6K4TG9hIZgEzCLg3sX0NNOqMBe6Oqu6HrrsWLo+j/40GPSgcY+BY4LTPxFH5P7/vfng+AmNKkpols6TDAuKJPFsAcX40MX7k5S+Di6IHwOcbXkKaOSTT41cfeih6SNbFF6xfudQ0VDdnAcN5UYj841dcD5cpvnvazoXmscGuj9sXTb5/8eBDcCJ1yA5zR0yS+GwC9qzPQD4DUCV1qCA+21vTQ3zxLVDT0XkwyygZ3bsWQC4eBOuLJjuT/bJTSsv2cpIS26YT+B8jIOaBOcw5ACzzwxLpfdqLIxj/yateCTsjLezDLrOWoUz6xCN1wNUcTxM+8cGdEcwfePnLDZiXpWEjNM9Lm9x/P3jttdF2n+aIRHv2HvFv5j/Vg/hfbP0p/Nj1L4dLI99btL0QmmHJuOS+/PFXviK6AKcZC0lIVCFZvDlm4goAzNt/+gDCKGITsymY2Vk5x6HbLoOYZv8Q0cyUsSuLz6eB3paKPWwaH/yxCIjdDhAA4yB8oWEsz+TT/tFIy7YotbJ/FoqfXA9icx1K14etUdP8wHXXRdpXR8v5ctCdQgLlD0RQbyVbMQsNHnhD0pQdTV4V03FTbKvUEa9wbkRd1osdxvJMwuSHIh+3RH5mUCczKJDQwzp/IJNYIRiBarCovEwcPE6rVG4k4BlCfmlHu4D8Sy/sh8xqi1Tf9111VXTUb5HWCvqAL++RQmrg74r2JKT3B/o+D/hEYkDxj2fAxOM7or1/6ZbN0lhfrqMfof2yrVvgu6++Kr8TAQQMkWpQ/L1pliIB5TuvuCLWdcuXnfYW3SlcRXzPcQqU5lVWsO/PdAp7nZPMgxluCnV4pG1JgIGETrf1K5R62rcQRUzNPE1+xB7ee8nF0c+5SzLVFQwNTmuwvxghjFy/OQ7s3hcHeOkLizRb1ZG0Tu8cYF80y7suvhjeSIPXVj4vEomjYYz2115wAXxDpC3RWKamifaYgGl/T/RkfG30j4/l81LS7vPX52+LfH9XpCthIwuTAFkay3Q8VN8/v5ZbDmhaDC1wdwMgq0FhzdD2EHnHFqDOygHbL2UgtXtlJYOCy9Ijz6B+5RysGmkBeyMNEUae4eu3RffbxXGKOvFWXm/MXoEeLki077lk8Py5gOFcaB4rj8+/Mfrvz4/2cT8rHbC8OlDAvCvOuL7z4osG+W2E9hdCcyten39LpP3S1U3lDUEynXhsVj+WAPNujFgIjEXKK3umDCaR3zdBaAE7hQ6UkR7Um1dQ3+LStk5ShcmX+LejykvA4AoxOMNYhdGCXqQ6Abtn6Q3LHbAgPvnA33fl5TCLo+9AhfDvt0Xa03sNPh9Ysuxl6Fg2bav8RNu3RA2TrvI3lUR3mtj45ssugy1q5u/FouNc+Qzu/LyIif82mnKJ1uyfCEraOiBrSZzGb4IxJZH1dQG2KlQjXq7pqvYO/Uph8QTwb5J2aaYnzf69Kc5E+RoGOg/+gJGggM00eft7meAZy9evjur7+jjb10dQJ2CvR4l37bbtMf78QVqfz5crjJX/hl074cpol84izcl0Sr9Xb9sGN+zeJWm/krTPK+/1ke/plYdEM7/fzC9KCZC1V0OeVBIZrEbnIINCbTvbN++GtrQBNhFUZqSi37CfwTuiAz+5YzJTcQnGkgTmY9DjvfSmZzY6uHRF5uPN0aY7G8GcfaKR9q+O6ppnE33ar/QB7vyrI5+TPbq2Pst1+Np43QLyV5pWH59ej/jr0aRLUrr40QO9C88vMhG20L71yVhMQeNUBzOZrxN7/Egvol+2oXMhGVTllcH0rsCbd9XB1DKAA1eWGRx6JKrE6MySdm+hNCPlJkm3ParB9HLQjmjbXRslNkC7cb5SoQWQFF5NLxYl2tNk1us03+ErS/uA38Eerzv/fNgZ+Z60S5bSYSg8BWuUZwuT4OI6j3C9iqjpHfyk8QNW8Zu+8k3S+YZoamzuJpaZDqCtwd4ouAFGvR+BEjMjFqVtSY80A/raHTvh9NpaNjW2OvtT/4LLw9/zYUEfW5i2Va4+ki39mgt2RNrX4U27d2fJt0g6Amyc5jAvrQYqzOlMzgmQbOmviTRnKd0HSay/jClvWllvhuDVu+1kzDdyQ//1lCGpB21upJ6WiHt7GmEzfaqiwgBo91h9T38q5cOoaYJDcoNKp6vg6bkhejwSU18f7U//OuY8UMwDzyIwLpMWRtLo+K+6KJlM6/CGSPsi8J4rzfk6WN7XT9nASqAlAueb3HjrNAaQdesIECZbusWYRBwvrJgcPBhEhwh1qW1oLUoLcPpsbqR3Oa7Zus2+orlMMOIYqKcOogwdfHPgs2ZzREVpid2i6Yrt2+DKaGpcFgcqPixdh69QuChO/FwaeZ7q4MMLpd0IHGXmedNg9Hn368PLIs83T8qSDcnlmIM1ksupLgRdMu2hQ2wsY8CJWnlnFcCfvDCxxXZOg5Mr4/RsNufnSEU5H6slMasPrmyowPb0ttKaHsGnrYehfLz7/a98BWyaTJqS8K9K8OSn8+Si++HXvUZo1/LmnGhXHb8lCJfOM7QvjQ0cC0gfdtx19BgNxIORXg0cm3P5rhBqvQfvcmAjgzCH2rKEVcgumEs2bR6kNwM2fQ5O/XFd+grQfA9hYBer7IRWbUMbApwo8WYIh0u3DT+d+qsEZg7ebEjh4q1bBvc3Srsx/RAA8RyedXlou9nPMbBQ27N5c563KFI6qDqotwiDbetyUgnUpE45A6uiw8iKlvy5ePksP3+wG4BeVezzSygepIqmltC00tql5xNDiQNry+LQeQ7UFXeKAYeGQUu8ZVTruaSFBenH6FgE2IV0NDr9WN4BRm4w/9Hauj5/LZUlPQmqHXFwuN6XGc8cJ5KvpA668jqP0OZANTmCRwC6HqJBXpbVKgPR4ktMZsfO6LIbY0aABpBhhOkuk7JiZTud1BXbWTSqpeq0iJBmXxsN55J2o+mXSQtz0hqgIcylKbQyGbFpwlhGMJBBtU2gzNjmla7y6wdxcIjsqXEfwQawcxojKqR+A4X606QqDyxYaPlXypzX880zVfHgT96NdG5wtRJllmVogkrw5/Ix74gEIddKEyXWQqg2dtBV9OmXCBtI+pKl3UhoDZxxUVqvQkbas4X3VnwrTQrJbzyjl9nSnbqVSC2B1zSEUZpraVO9ZpgRYnrWAvVqOQRqqMtQycIuDTUwhmvd+42QNBfjjGlpHNTPeomsymxJa/ldwgTxfWHs2WUat5UNwNDEOJfgeYwNXrQGS0IDQ2OJCmi54mmw5myNSD/5S3bCDkthvY43Y80WhgYAemZX1uXwRJjtD/ggiSrrytFUJS9Ntdb3g3zsicqfajSo7AgnWjakUV9OOiMo6Y3OjgtOKyiEaknuA7rGsDcd6apcHwZAddoE5jy7LMq9jdx8BNtpuYFawqiBfwFmq6eH8WLzvfTuD+Mnf4zc1wWBAjWG4C/Ubwh9EEB7kMivNkEALLAlU6xfIMfrQ2fOwrygwWKkMcVBsCCE0KDNSxmVN5Fd74V2A+j7Uvw825oBho1ygorXtGObJtN/VL76PuCweB1QlTsgtQHkwQCYCup7MJqMXzBbpKX0SQAYdGauc3BpMAyzPr6+Jt9FzqROdUGg1rs9GZshGHwyn6ZjBGu+lAWoSwHF7KjL2aaIQIXuP3lCAGEc8uAq54HrCmaws1aQ4FoX1X2fDUtIkZbqIS2dg6s8qvOA7lmwwJdrBa65aVs0jKQfpNW9YSRt0M+4zqo7aRPgUPntaWNBpNtM918tBExnVcW0tG+i8eDpM/myeMxC9p7NNNbQdSLXiX2Y2loHVwt+URTM7J9soQCgtkwL8PCxYzZ3lrrQICLYiqP8aUgc5rCTKMF3UXAA1M/qcnF4v2VqoEqLwdanNXtViXb5jkk8Fy9pcTytpFEAb3ouNPhCOy8BH47w3AHID/SDa191a3BtOmX9gX0nnidMlQ8VeACY41AJR6jxY9u7pTynLL7NGryZWDRiP73SVwqoawLnRbiB4xAeTUtYETe0lOW6hFYtVY8HJ0m1JNeSkxvJ8XyYt6LBgEpJHANULdl0owebdlAejv9ii8hGPSUtzEkHVnJL3Rp5SRZhPEsxl9x90xah/SxHDPgPDUHUCEWDB7jr0GGpOO/XUsZpYCS0frfHrO+dC6x77ph3OXSFmkcI5uWU+hJRaeWT6zP40tGjlWBVcZM5MyOoHti6Vs9YOmqcgF3HaSkL4xJSD/JETTcaEjXQwdWlBdRBy4/ELUqLjfLcuQGzT9voOIYVaNvItEGjOAN0V2xwYNHtxGj05Dx8/Hgcd52Bmiw4XLmX0EKbxRrYHYQxTquKgj3MwuEApJbLikS3PP1UW2L6YlABERxjW+USsz1t6PI22l9JNX101H99fOvFG7nm3wD23V2+9s/jgrRjecNIOWP0wkjeisd8H4iPqPjX7Bz+NrWFFgAtkOnnTMBKiw4f3L+/rBFNpq3BWAB5+V+RaPvpYGYo1Hc5Br0xhCaIZcX5YFe+LEtsdfCnjz1e1mv2EgOlzLoCaF/j+De4Hu4ldx+cNACwkhpUgxIgOK2Ol3vQAAo4oIzdw0baMPIcNs7DAqAvQ4dLq4OPF0VsUNEGS4ARgOs2ChbUrUOeDWDGYQkjH3v6aUCqgDYtZgrIjDcWnB6bPgxXS5TBoAO3KhChuurqCv8F1M+cOg23PPkUfOtVV7KWg3pSOaMlMmgm4zDeMFeBeHRgFm8eiAPUX/uvN8Itd98Ljzz9bHmJnAYdQHUCfW5Y0GKVC75OX4GAjgGI6pdGl3yetNLVl1wE3/yWr4L3//V3wJ6dO5qg5mphcKBs1FU/Y9pUxfPGR3oskU4/8sST0YlwHLZu2SQTI7LhKNTtLVodRM65/VT81NOq24l3nLITLOU9Dl54G4mxefPytIfKpIM/2/84vPuyS2HTpLG6KDa4xyBtiASHU0D9S8/pdk2ndzyyF3783/4ePPzMgbL1wuoq1YfBqlbsDB7AwXSa5cKLhWzceCqsMSztUF3n866k2H/4KPzGh2+Gm+66B37m7/4teMdrXmUpZyk6B+iDENrxnkYvqz74+OMZK2kfFiD8yC6yAAN7uXo6lM0DNk0Kxm3H6omEtAUwsi8aRUqXtdgrqvKn5t0EbjvwLHzi2WfhGy+9rPoudal8GhYzh/2ixdNimSRpCPgp7dNHjsBP/s5/gMfi6HnTls3QTTrgr9eFKUEDur3Y4cbDQMYtkR4b58uHgmVU1ygS0KwBR+Ixz8LF2ZS9Bw/Bz/z7P4Y/+MkPwIXnn2coCiOdOYTlu62ZA9BgJto+9tRTcMfBg9CtTq0NjTwwrGt56y9jqmljcaf5YTYNkiZBNhXQVLIAuSxAy4tts0rJ2wuThJ5EUP/SPXfDDbt25w9PTd6qsAANldaQ0uLvbIlrVaf08zt/eVtssCOwGsE8XZlGQE/iDVkCR9nwQWyxcnPcLvurGgyUFS9kKwoAMMsApO/30nINa2uwL0rrf/Whm+Gn/vb7hnVWPAdoyqMBDUGZE14ia1v+udOn4dfv/SL0Xfr6e5K1esDi/O1J89e9cJwLD6qQLQJMVZqk8HSebPAyJEAFcJbUNKuTpTP9TiKAJtMJPB5nDX/v4YfgR1/zWjOy1p0GWtKAJQHdN+mGnXLA2Q994V6YblqBlc2bIh0rmR7eT4VHzWIfkqQmWQ3a1Pr/Q/DbaeQ4GvnJFhRpu7wcn+od22wWB+y5k5+FW+970OQnPGAB4u61QmgkYsmsaWP6/t9H98IXo2t38+bV3DbscgoaxIRP3oexVtjZlp4W0CaH2BlhUEGZfqSK9iSlda8pNkiXiVxJ77hGSfDvHnwQrty2Hb7tqqsNogNn7mgzQlqBGHUicNJApU/k7z9yDFY2rWa7eZpWbsoSgF5L5IKdk1zAremDNsMcKXNDeInSChFOl5PlXPmFtF5cR1I7DeLTNlhpQ6J4/vjhozUrJYb1Ng/6RGNA32e6/edP3u34l3Eg+Cv33AMrqyswjeOrpM2hKwLH+J8DezawmhoIRuhUPljMmlFbq8FEMoeqzvI0JZQtEpAkXsZzUh1RVCdCp2m9iPUz8M/uvANu2L0brti2XTJHpdKQKiGMUi1rOr+Xzq4XiPaJHapLpkZaS3lazA1WU9zri7M+iATQqkyX5XnDHaf1vgNAm4e1OkPI6mLQp9WFjKBd6hwqoHl5NqzGdH5c9u7uijadRFCtr88smMGaFyw4vAbVNDNtehZVDgXmJ54/AT/56U+RwEuAnkRaJlmjyN7lAOKA6D0tMAR0K24KDZ7lc2r0uksnmvqwlObBGm+VkBmWiY5Xqz2cOXMWvufmm+DfvvNdcP35F9AmkZYo6fTEiWDfQm2/3O2AzDSD9Ppim+XdmEKdgSrbKBd7LZUle3SEYkblvLyNpKSSLns0YCsNbjytL9NlgQElNQOnjHOwbBQPdQHxkjDfibwJNOZB40vWRQlQwljZNVp2/3XWAS/X9cSJk/C9N90EZ2K61diRVnhsk9sIaG9G/R50FTS8G5h8Fui0g6Y5hc7c1IMk0lu5PtTVOHPvpzbraEQik6E/nRbTI1XgWLTb/v7Hb4UHjx6pPVcfjpONCaAB4b5Ckm9Z4zcDOm+yQwxjpuV9s9PCuVi2HS4b8WBNg/W8z3sFduZ+jW/FdYP82mnxHNI6OmIdNK25LnIfch3T/bQ7a+nENW1S8XkgNumsKefaQeJY7atGD475DH7pXJTggcOH4e/d9JG8WedqBHI6knTuJp3gSBcZNB3KzNCf/8EgroYpqFGwF0b1RR0U/SNTkYhkhvB+00XChdz5yzYDsBIonwDPnj0N33fLzfBPb/gq+JtXX2PVujNDRFqHBoCVamtpZt2oxT/Oe/uhbFzJEkBLAlMO+g7TkK7YkKI6rWHkBtKCq5BPjzpLvbBmbT9eLVb+kOTgvbtzW3WlA4ArqmVe6JccXbOZKqA7v3HfPvi5z34Wjsfx1OYo2FbjuCZJ5zJQ74rggerVYJdw0fb1qyiRcoxB3wkVhqfMS6cxABrXtQdVYHPv7aUiJbfiwpvStG5B5um1s/Czd3wWnj55Er7r5dfDedGW0iZIAMs548NWNKBOr86RmUEHsIQOxcyozvsuL2ySpTiZF1rFNqXPWMAN3NtI2kacviQuS4fmMb0AHRU/gDs6zR1QR2cV7sHMJsigo3s6sJobYi/H4+jZM/DnceLkf7/jzuzx2kxATho7gVkPTGWvcuqsUi7jF2AgtT1PNG3NhWYM0whY+VyjP5SlDMoItPai6oHA7P7tphORGskaOLO2Dr9y793wx48+Aj/+hhvgXXmd48qcAahYuIVKQ3A0GymtGhDZrMh7pPO0Kt3vOqG9NCC9P0CACE1mgJK6MB40gWGDaeflrdIiEYNQec03i2sVqRN38tyMUicu9L6OVDc2LTy4USdDa1boLD7zzDPwC5+7Ex46djSCeKVI5vg7mRavBsrYpjzBZoN0Iqz1GJC3iJfQeJdDp8fGRVCMqB8nltlEFv/lHY+ySHXeeWVSV2fn7eGeOnUK/sFtH4M3X3gRfHeU1u+4LC0yPjHdrSWB5VqBWDc0qywg27MyivbHBm1ysJkSiO7CgaDz9CDrGvdAXaOLgzlpfZqxMJJ3BXX1bBThwa634oPONjPUmThklU6SmkVgUHQEHQfz+1paV+NjTz4Bf/rww3BrnAVcjUJsS5TKCcjpSJIZp8WrUex3EiAde6CoDEQZ2LIlUDRkQ8DAkK0pND/B4i/BRb2PqMNSKGWJaGbeOJ8M7OzIR7OBZ1p+ay322LsOH4Q7Pvks7Nq0Cb7lqmuixL4Krt+xE7bweyCKaiEFhxI7aNpp8ANYJDX7oYsqq1+r16lV8lMj2spR+lbdze+8+EVpF8VBlYrlHBWJhSPsnWHPQpXQJR3PFmY3a+Jbj9U+cNXrnYT2gQVJAvEjcYLkxsf2ws37H4f90S2XgLs1zgGsxl82MVaS63SiwUzg7IY7+labWZXnGTF2j8LiHde70rih2TDV7uGepCdoGHCFoR1lR5t2pj3Bk786VnatW4Nj62vwOw98CX73/i/Ba3buhn90w1vgDbsvqiNrxUwPbFR08UieX/EKaNcRoW+L6QWroDoGCkAss+iLHlAdRvcwGArPSh89q0yKuWkBqixqgUp5BWyfIdrJHu0oF9GgCNVTRav29B2aF314QoNp4l8Wavprnk8+9QT89r33wL0HD8GZfj0DN5sWUwZx8WQkTxeqyZMwUDGoOiWohgzDSoYhL8zkBJ2bdzncyGIYjLejlCIOfCWpAar3gPPN7xbQQjRp0iNJ6TWoWy3vXtkEb9+zB959xVVw+bbzYOvU7ketgc2VNUKVkYEgHpcisrC6nGQQRINazZScB6qBUjD15iv28zINoOJ1lNYYAezNABbYtmrtvJstQhJX92jdgUHbp2xeUHygjh+g0q5DaERw3F+79DJ444UXw31Ru378ySfh9gPPwoEzp2ETSeTslovnub3JfVqkcjUltMYx5xCknaB5rhpd45TOp55BzaCYY0ZlWlwEqC48oJdlggKNPE47amUvCMCrdu2CvxHt57dGBq120/rJTbDMNLadizNMR6RBBw9AFHjp+WK/seYJkl0gaVwYr9A3KKZVeDv5RtLOS18lGLi6IzC1JZq0ZrruCuDZwigdPNW9LLnVXGc5VPzojqabPGmArdE2fsvFe+Ctl+yBY2tn4IuHDsGH9u+HLx47UvaLx/IFk3QiZRoZ/57vwFxRb+uKhaBxOORgc1CIMGSp//5uUJBIarAtpVpCppbjvws3b4YfuO56+Gu7L8r3+c0q8I/6iwaILT1l4oBGSQPnuwGG0Kt8mxnwCAohoKU1UqfR/dkIEh8C2nuhLRPqPTRpAXU60g3iuAikPVhSS2yFeadJwWreZN50ltRgAayBDfqaeMUvqp2/ugm+bs+l8DUR3HceOgD/5oEH4bkIcp223XnRMQGbKVuxHmqcxvih7RMoX4KjtAC9DxCKqYE4LE5G3iqa7dfEsbQo33dffS18xxVX5+18jUTW57XWVkUH27HBVaA0ElKjkfM+qA7lXtDGvN1mLSuHLpjy0XGnIdeqUBkJvt04Lc5J65WgScPI5tC18iquVQSe8QVaSCYR0NkJCmJN0/8cwChvXo+QvSkyEI0Rb4ua9g07d8EfRz/0H+57nFZUqsANHQg2mnWngpDOMVRXKig8tviSzo0fuiWZwT3APbxcl0LQi3+XSa5U/HNe9Fz85KtfBW+Jg76UfBbA+D39wSG430ERWrqWjRXJBYRgjewuI0kkMNh69I1M2xgdioA5WG4+Pf+uLdvWm7UcKhMABCXycr1ko1qVToPSXgbAI4JEYYmAVuLLuiwwCJtjO3/ftdfB1du3wa8/9CAcm/W84WWdETb2L/+xqo5BDXpQDvP5JyYHKoNbZ8T3cCQbrBlAVYzCk/IhQBxa74l+yZ97zevg2q3bq2sogJHQ5hdqJtzJW0HUpLRbJ35osaeNnletzVIJQEkr1zkVHca8Gr0HTg8uEN1G1CxoLq4o6t+guF7Kqnv1odDGg+L8YlJP2qthjgXNE1ASWl3Ly0hhKGR6dfH2iy6BK7Zug5+OHpEDZ8/mWWQ2c7Rg5NP0spVwQN8DaJsc4kWisQ+03HZa2rLNxSYGQEOKq/cJlE0UmNXx2Uuib/J/ffUb4OqtWwXM/QiY5V3cMGS0x1MLQ0H21sU8wma3ox4to3JXFcb1ogvZzRbAlaFB6wE8L8zrjc30uDBv3dSIxUmHZD4hMUrkS1fbMGutbC90xQ5HrPxXgsT4oYPjf2WjlMPP8cJDoO6njUx//g1vhH941+fhUHTN5o29lamErYqhh7Adh4jJYdxc5bmpj5BfY0JY6YagdpNlVQcsjOoL88npeX5k3v/5ujfl7SqCA7Ps5qWYKcwYntbrUM+Hn2WhSCdWbahsONMiHM8vOoogx0Wy8q9EQP4rAGBxE2rHEMFdUvNsXK5zN7/niI8elHRW9yQdHR1Ld/plMi7dvAV+IYL6A5//HDyfHOFsCmqLAEBwlalDmnFW5UubaPeyEr4pzH2XgxM2l8BqPUeABQJzGgD+WJzW3hPB3Dsga6kMYNWbzm8ecaH1y7NRWkJDxbKWLEkqB6xAyA6+vkqA+XyBNuJH9eNI/EbyCPayaht1M3tVwlDFSGU64g00KyhtElyxaCV15k8Q2ZGD2NRKg/KA8cotW+GHr3sZ/MJDD2QTlN/HblW9OFpxXvVH443JYfdVrg/o32GoAxEkRCbpnDYRev+VV8G74qh3RvyVjx6DVW0M5EWgboGMn5FBEBKQlaRm+rVG4YmXOmaszn+v4kYDLhGvicZzzMPFockbQcxBJYmLAGqMfZBMDuyabjvdETS4fZPoTkpkiCFhNn2C2jbfFN16Xzp+DP746afyhBroBQO5h5hCQMZvdWIsGHb4ybHpUjzGsXviECKi6POmWRkEfssll8rdwYaNAYy7bOA6WzJ47PCAkO3o8oEsyzOa9JFrkPNiawcY2GV/BUMFNO+HbU3A6glRTwhgqKPzx6lKW0q2MJwTGITgzBBqQ7HulPmhxeh/d821cMtzB+Bw3xfes7YIunbBncHgeuzeYFs3YRS0TArbOwYVTPZzP4vM6OEfvex62B0d7t7UGAAbykyWH1mbQzEPYHhuAzUUSSFtS/M1H2VNiI4kujs6d+jnx9K37p1zWlycdkA/A6Q8i4Zm7uz10zTWUF4ocOgd7+e1j1l2IKhz/RuP7ZMV+J+vfxX0eQfZWRlrkVoWM4qaUVNWh3fYanH5nXrjXJ4USVWnseug0Kk9ILdJktDRvnjz+RfAW3fstBUMbXNDshgisxmkh/ruyT/80g37rrCtU8oFWXjKLBHN5gtONh+oPj3kay2LPAtBO283nFY3Zn15B3X7gDSRekYzQ8kxPRWKlS8esADtpgijF8N0rOwkwvHzzXHi5TXbt8M9J54v73uI6w0sr5qmQgAzsYI4tKFReTcqb9BkI7OFRtgr1RbKyjzrsxm8N/ofJzQL6D9Pp6SGgWBya7d/UCUX26kt1QXELK2okYMbrVRgFy8I22KoO3cj4AbMkRczLbbSq9E+irnU0W8gs4C4xun5fWQ2O8AKFD43g/URAHuQ61WuUnHyNT/3XSjaOEpR+PZLL4e77v9iERSqg5VHEDS6ZfYwODMDcWCC1IkVIcy95Ic1XoM5AMggsDCgz+bGZdF2/oY4EBQprA5tZoxJZ31vDNj6XkuSAgNUg5pEmbz8wxKM/LPS4AttaNUxXtKgy7Fl6rZiQAfVGUVrsqKiNmKbuZoxEzCZqnWcA6g5AU0WtinlW/4LfcEB1inzBOqv3r0bLlxZhYNRAOYPQeT9GX7jztY7SAGqrEZbdbBsUGq5UkvgTqYGSee377oQtqaPIIP+LB2Mm24emD0zlr2WjpDaU+xFqIMOusZO2dHs1tMLRstX41jvdapzmOdHDnTn89Jj49rRhnw+llbFo7qHavwQlLEs0hnB2MEBqubTkhX8NcC4hg1Drcn5azxcsLIC3xy9HrM05upDNbnE1aILC0uLkMUv+EOVxmikcwDRDInYtHliNPT/mz17bCXCEMQtZkAjDnWcEqymyugliGtoMTPUr5zSm2qctndpPTGtc4ChzD7XtO5ap0V3L5/yC0n0joShHVUm5rrUtX7eVJONfZQMYSg8WjS2Qu8S6OWY33HRRfBvHtsLOOlLpx18V1d/gzIFw5zy7KZBriba3PDACvKbattnQG+NRL32vAvs5Ik2ORxj5klnVRTRB1Vz+oQaBB3NGKRGS+9Dd0oJyeCKPkmCMnUcnA0HG7B9XfHzQ9hY1rggr/rKXnnpCrlRsIKgY3OEHhETjNfm8HlqQamiF5LiyAoj0lyPn14dsXJB1ObHI3Y6Ze4FJbwG5bNpOBKmJoE/x0Ym6CrN3o1I1FVxNihIPAzUmSbOMyHYrEcFjA4BGpJf1KlSxYoZuQzj1cAqybsRCb1IDPm0sGR6nXaZMlxDy/MdGmbkAS91Ho378kxXPUHs6XBFDMqcd3+cTPMrOLCkwuuiR+y2o4dpJ1l6E3IseHzqXwplYqUlnRq1rMCriM5xaZnWKH6v2LRlkFayCENmhJFffW56Png6hs9l6sh2lKqoypeGxkGvL14P+hpPNXTpAG06TJpavPyMpZVztGXk5yhikNbRUYuiiSKPA9brA8mgvt6RASSozgADb9QYqNHdGhM62toRgUeRaUq8P3woC0R24dVdrtCqaHFV4qBcvh68D+0TDRpGIbMuHl4k9OVbNksluIB+RDpr4C8bWkJs8LwaELHZUdIRc9jNhUoasBpOL3KEKqnH+AKN61Zj4pxrXPD8vLRyHqrJkZtYOX+T1yC9KoryDVa5F7ind50BO7fJAMwAoxLcn7faJwV245mBJ52nwWGfPWRBFv0Z9GgYCscxwSFbUjCDEGqeY8xmKc1M6DMxPVyc3qijAoNmDljmhEa+LWAjjEvqUQZifTFJv/OLyn6uJgY/UtaHkI/vEIcEtK49sQDj4mtR5TaSFlx6+hAY5X4BhJga7JqmRkWZfOqaoIQl4lokzrsXGkcK50+nWRim9+YnQZfB4MGBK9CU5ezp5tt23r2XgRPql9wazGn5liyho4djhQcZyPdcviPXY20ZYAhkfz54hiUzYm04ig+6p2p9T/H5o1pwlQdoistip4Zx0Zry7lRaiVwi30Vp+TrU2V3UqMlx/N5KAQfS8g252syjFhe57VqdGRptRTxsC5eaxC+DwaRO0xp7PUvoOEwPk6pNQGEPsfqdEcwYQYfhV9+ukUKw0XI7aNWhP3+d36vDkBeD66YEp5tjQK51ACijfiA7ml1UoZohQNKqq2BnCnLDIwgUhm6JWgM0XgJHNbq0tefAIh1l0/K9IR0y1ymDXPvqKPtyzFOsobImAwGjBnGohGgrpkFpO4L6mrkGbW6ox4omD7Q8c5AbgiHU7WMLEY0bKgF2j5VQGhCDpdB/5lIWlOmFKHaMn+2HKzxocI+B2l+3znXP9irMlJdmvzITOkA9oWDcc7TgjEiNrvCFyK+DDt0qWHsVYKPkF5LW10yn82AucXnhHiGYOhaPAVDlxy8pM3o6GnSxJ4iYyLf1uzatxWf8uadUSg42Xg8INajX88tsALw9CHIOiA47wfGMsBhq2hRGJlawimNNpDpnYiszAhw4c8YkEGKCajMVWsxyVLTvIaiJhMqknBetDT1w2ynJVDJQkhTppKP3GNEDiIjttN5EW1EESxB1pJKKJXkD2NyKUmZXy0NVvhaX4r7p1HVQC3CoorraYbIZxhMrPDBcFEYb4dyCl7VHzq4De8sEzgFk3ZQCZWw8PcRoCnZQOC8IKIPKS1aLzoBK65uNVUKDG7AthwZFamwFlxiH9Jm2V9PdbC+iXo6KXXUpiQyqUibO5FDpLSEAyki2BIrbTzcTQlMkqLSoOWI6VWjGiVyiupTlFwIYkwP7KsgJ1IHfhR5r9OB+/fmisKDNdLGHzpxWu1yR10xWuwrVtSht28hEheZOsnriodanfjdYrtU9Sv+lo0dMVnodZzHtGrgQ6a3vIQw6pCETxqQ3DwRbElmBAt15Dp27bnFtDAXYiBnrdSNpTc92PdSnTzT2TmLnx6r6KnzH+h2UpMX6bjQzUh1sGnAeVZiBUVgGqBqwpDElmvujA3U69j7/PN1U5QGBG5mkOsAFw6Kg+Ffip/OaDsTBbXnt6CfN2MGjJ07YfCihMRPVvSwV6X6v2xOHNAVdOLTpzUlY+nTki+bGk7fu6Gl97Xs9joEWYOAC8gTMedTcHEsrrYbDDu4DWwyo0BBoYRleST4zF0zd9Bp3TSqDJUeK16BDm2asKuZAe53CHYcO5gUdDVhHtLjGoKePabSbBhGAsfGQDhrg+suHE7N1uOfIEXj1BTtECxtCAYxTnEEN/p76Ne6eMKTDS+rgpHIYvHlGQ/tOZcrJ6btCSUu3tAsLtaoOtaEZ52bGT2hScWj7hC5Hp9Vli6Zr8AD1M4VAZegkBvblDbwAMksK4qeHJhINPz24AgxNFVS0oQK/l3ooJObzew4fhsNnz8KmrZuBNWt5rBpgGi8BxgMX01x9NP/wZwdYkwfu/RDcrCpmoKRnbnrqCXgNAZrHKkiNItovDCnBFsGacfNqY55RElmtcWdEBADZ01Dqgwi23+iPZw0LJI3vqeKCd5qESGqmnZt3GD47SKsBBLXs/NupXsCjcn43lDulAnrvf0EJiwDW5Ajgx2IVzKF2QvMsBzXs+C/7HiNw86KanJXqlNJulqGhD4M4lX2lqV7YIU2NDiY9q3mkrZH/095H4ejaWT0e81ga/Dqa7L0W4+YF5eEQWxoa3+Pxd/z6+73WN4PdyDH2zaD/1m/ed4MbyXtuWqx1oLoGXy64Dx8kfn4QLUhAbbE/KNCKpFYdUoSbki0n19fhpiefzPtKopiHXusODYzABSr6NHC6eRXRBXCGrDL11g98JFto/+mTcOszT1WhCCPA5huuUF7rwRhG0Eg7Qi9wBVlKo3rfOfub6yc/SGDgOJQ0uLGjewFxG8nTHVy3vGKS1EXFq06Kgii0nX6kzduMBSudhwJSNLKAVwnS3K2IhA8/sR/2nnietmmuryWIpA6s+RXQCUDBla1De0sKHYEAowYl1M+XMO9PWDYj/92HH4L3XnZlZig6LonPODgGhhEilJrT9yWJZm4AA+QUiV1tSLZ/6/d7WnzoOo/3ngF/5oSXKq0OIhz0tWJa8YagVHXoARqRumCBGwKMaktUJWozE8DKFv54KE1x/+lje8uGUoQdmfhqcMJYCsr90vrca6nN6wcdklWPTCWhmB2JyNsPHoBPH3g2rxfM9rNIaEUTzFFVnhCDaWyrQjZ/RGNojsoBYNUE1MkHwTlaOhSfscUwn5ZPfdpRhqq0rV+X1uSlz/vWbWI+zRnJjc4C2vCzYqZkyd8aNuqi95fMbFM0yJyWO2575hm47dmnodu8iSQ0vaNNhRQPFZg6t+RaK4jJYfg1gvD6fmopzXx7lmzo1OOmUwiTKfzE7Z+EE2trw3EZDPHVbDgP7jGafLwTCbwCaVZVtF5FGIC8cZAnwHzLR6bAeNpuGN+65vRj9xalbeVtxGCNs68AKPOLhJBrYBh0QNUuGGyctB3/hNq+HbTJOnDqJPzs7Z/JGOmmK1kAajpaUleEk2nnNiQkK1NhegI9UMBKSRRgM4PSlrfRcbIyhSdOn4JfufcusZs6B2JU+TAjhIeoDo4Plr/eQtGVr7OBZD8SEbxoIxoQdEbtobI/669dtEXHDY+WPe7Tdy9aWvYu1WsHXKyTKKCAzfaoB4n8jhyadYM4Hr9ilQUTdaTrP3r0Edh76gR0ar9v+QwuI0pnVvFl5R2aejJm01/jtsMBeOuLSkGii+7S343l4vKHmph73GQ2hX5lFX4v2tJvu/ASeM/lVxq1xhNXKBnTj1J180JL60s+Ipn1OtGd6kUMZLAMFB2KhgeguFPobaQdBGKw7f0ATZni00JFy2ASpzZcHXgQHUGLTRDzA5VNwO7VIDbrkNdGcKibTQsoVHKR6sCSmf1I+vjQY4/Br3/x3gjm1bKpUPZwdCJsRKhKmSisq6apIxrrgBLAezkaDVSXX2UGQ2OmiRidXXeTDOrUA0/F6J/49Cfg8RPHW9pwKLFR52aZGRo3jJRGVQctIsTe6ZR/uhPpXJct6KoYaal4oz+7kYq8GGlV2XPpoLQTdHXRYpK0ledHp+IavOSIlsWH/ly1H4N5oorg86dPPg8/dfunIyYCdKvTMiCcVI9T0BkCmEkfng6pn9LBaOhcHUYuGDRob6OKZ/EfiUxmx2Ql2kfxOBxm8Hdu/At4MlZIqx7+1W0EXB+0jJMylQQPY3Tq4XSngQE0cKV7WHdq4nhxebmGx5EDGgduIP2yaXFeeqRBlJEWYNLXDtM4Wk3ueBoabOZ26kCKGxxT+n306BH4rg9/CA716xkXk2Q7J9OUJbRkCCQwa+sHVRY06Bs0v7s2NrLEMZPSuZ9w6RQSsdiiidBJlNCT1Uh8VC9PnTkD33PTX8ADRw4bKe3bwHTAxZ1R6OXReaGHpVpn3/vN0SVeJJh0xG5wjs5nbQ1F1YFR27rdaFpYKm3XTAsL6bA0DydcbBsBS22aWGHzQgRGsKaHP/ghxpluvwmBin8fPHwI3v+RG+GJU6cyFiarqxkbWUJrDcT0UaMHwhpAo0NhbXsfOhgBSTNoCY1Qu49Bo5bSkfhNqzDdvAqPxQr93QjqG/ftNSqJe3h+NNjyvStJ3Ejuvr7WYBYA53g1KGJpTGqbvR9GbWu1bI5W3Fj6jabFJdP6vMlkEoaWZwIOTZb6+ijV3fFRL//FfGfvRnDto9stS2k6WBN//Mn98L0f/gvYf+Y0TDYXLGTNnSSz0Aa1XRAHps4A7GBp8KEbfbCRUQUMqQP5pY8tOyWBaDfRrGJSr9y0CZ6brcP/8LFb4Ne+8Hk4G8/FAwJOUsOQeSKFg13ERjO6dLBOJFzQnc1LbLpn1sDDZQ5YMl1JixtIu3y+7WPgmlMdeCipARaqPxeUAJUsuO20kEpt+y9jG//AzTfCkX4WBdommCYMrK5kTGAyNzplP3tBKQV6c8QR3cCo9XIggneBYagP1BdPyug7u8LVtkeBE2WTFYtbhhFHjF6P5sc/v+sO+I8P3g8/+7avha+77AroqGdWVUOg1nWDOZpDh86ty6HB5cAMUD69yq3gRs7NkSnfaxHCBBpCUf1dIm2rks20dN2P01FeUIK6vFlHz6e6zpQrb0HAxq/xXiggJwR8dN9j8HOf+VR+BWKyGoG8aSUem/J4aiKejfoWpOSM5aW4YsLWOQ5U9ytGHJCVN8h89R0aFZFzLDM5qKa+q1slqNnxOmLNg5KQPB6g7K0C7Mejn/oHPvpheMeey+F7rn813HDRHtgeGSBVRD26tcQNANJqhdzhnBRj0KBqZE5jnsd2nq3zVhos3JlLqUeKxDeeW3qTG2jYA1TvvHmMykd3Wq0Ng9WGuh8PqkTnZ9bX4RNPPA6/f/+X4PY4A7geTc4E4mxukmROE27JA8ZChds56GxVG/G7JxnHlD40qleJK2G6kEdoMxGzQ14thboXAYRqKrD663jbsSlotdrHnjo7uwY3P/0k3BR79cvPuwDefeXV8O6rXgYv27ELNiW1BNbkgAXnOSgpHJRak0EQn2dSOjvBYEAwYMNyGkLS15dsFvVAk3fAdiO00vYqQlqcwMvCINU12WhZCyW7OQBPJmVtZmy6eqp/TTXo5MTZs7Dv2BH4yGOPwI3xeOLkiTj7F8dOEbwrEcRddgqsFqkcvRri0UD13jNrfmTgwiivREjC/GA3DZITBPvmfbkZ2Mxwb3MHrqn+4lg5+vOCgdk/XRo6/eu7AvY+MmEWzx+Obr2H4szib3/xbrjhwovh+197A3zd5VfDhgMDtkPTgXiWMDhJXc0SVVVss83HLsIqAixuAZ1WnczLW+LJYrB9oHzRXn4Lv+sH4gG8vc0dQX+VrUNo0Hd3lML/4vbb4AsHnoX1DsskSQTylFy1xWU7zWDOQJ6wZGZzIYCxjzletw2otmkxZKSNllpOV2cU5BoHta9fW2C1a/QX0HmwqOhR7qjLz9sE33jJ5fDeK6+BV+68EFYi+oMzM4x6GqW1SmLjV9amBzOqQ/uc/CyHQhyLDHMeWFLM40bSpj9iR6ajr5n02ZAmEzTxJdS6Iw68HABK0IfBcCCH1128B371ve+D+w8diJ6MffDnUcMenK1VIOf3NJyfGSwPeE2QodStLbwRjcjB7LEy/AwBbLycC3KJokBblWC9nVxCZdM/Mt0C8FfX2CO9btrD11xyKXzbZVfCe/ZcASsR7bNQN5rx1VwUcppOgVkDubMvJaEGt3CW69nBUDb5EUZonNM1wsj91j0Yzwtxflpt6HLaPCDsgPe8yRvk9sSLvD8gVp88DYbFdlb28wDkQVEY/yST8IaLL4W3xPb7wJveDB9/5in4w8cfgTuPxrmGSXm/pJPBH4A2NcoMZeE5GlSXOkg6biO91MPgdQAbP1w5qRVK9zbnvKwWybXKb/TdOkjanjiVlOE1286Dn3j5q+DtaR/DvgBY9jNUDB0DdvAHdyQjkbvqjyXah+48MqMKp3NupYrooIgiO4LUDdTdSldJg4oDnq817xeWlmhGereG+V2NDRnz8DYPdrJo6OUII7+ozBJjosRjJZqT74neqvdefgV8/MAz8MsP3RfnHU4W5QCVd0QARTZ+0X16pXgglPjnJEm5njZvclwYkYvcTSEM5IecZYEXKpMTE/JK6D384wjkb4/ejQumq4PdZf1Os5l/oTYoV00kCJEpzB645kDZyQTgfG1n30QikEEq/VMGEIqXUtdQCcAKtIIdFzfCRsKZZtsG0iJotMueNyqS6ShNljpzqLzocCAg+BwaUhpIe7KXk/dM4SPt9Z02rH/Lrt3wh08+Dr+59xE4lRJNwCjCIZi5HIc3w3AcxjfCYLHGEQib3o6NpQ3Mjp6uQxWA9rAj2lX/5JWvgW+95LKs/WYklc0Os6HSMSotGnGmsomU5kQJVIYydjWDU2C7us6lU77BcUP9emnirwchuLS+Zv63kRYdkynfMGhN3TtJCqIaFFKy4A+wgqRXxfAneEyxFNMVUG+N5sj7r7oO9mzaAv9blNbHs9dlonSLpxABYBykLBs8R1ph2krQAngrs0DgZmmuP60qpwhld6weLp6swK+//k3w6u3nZxNDwByUuaHALYAOlo4x2iSQe66+OwwCYuOX5tyQGQq2dTqcwxVY4t5G0uPwXFwX6l4mrZEWgpIlLKor+upileX5Ym3UOrbmZ3QI6sSbHTOlHWbBPvM3on39qvPPgx+9+/PwRHTzsWjX4GTpjKrTDYVUW6gN6IM6tWAOL4sQYKBua9paQ/SFJWamrSo2bYbfueGtAzDro2+B2REcWoeW6MGWbSkFhxtqhczNAGbRlnlYNJxZNpxD2mX6COLwRnNixj9cz/0rBgOtDwp8dF/zno8kmVvteu2W7fCrr78BLkoLmye1TFPLlhrukFWGLzo8jXw05z4HvJxjsyDX0quSUNb73Rzjf/N1b4IrN2+pYO7L0fcwvmWyVn3QALWTBmJzEyDlKwZsdEiSyhKvegO6f8OY8TsvVdp5sRr/ui9WBw4qa0vlxgNk02YDPMt173ivN1RddyBed8e1W7fBb0dPyBagtaB94wEqqylsrP+DqjDwywz+0IlEPyB4VW2lYFCMKVtUhNkMfj7azFdu3poBvM5gdpI5gxvqN7cayPPUod9mOf121FA4QLEmHWGABu6aGMwnYKDOFx0vVdrR9GDrxSc8bezrzQffTrzywqS5lTUdJr6haVP7roXazuuUJv1etmkr/PT1r8wCToN6gF0vPNER3sKnGmS2306ZI5HtbIdlWrlVtkhOYP5AHBi8e/fFUjEBtTv0xucMYgE4wGAHWi+5tdS4dss2KHYYGrFleRHUOJElFplMga6VoMCRAxZc4waePae8pV+GKoFd29kxMXVaSp037HG8Np2l0YFyeyAd6lltcmTJDOVYU3HfEv3W358+x5uVcVXGClHklbwZ3Noq1Yo1wuLXrRoZFdwSBUEbBMVESlskvyqqme+Mg4Je+ZhbPV8kQG+vPWKD+pUSdT5E0jt27C43mvyocAiidSiepjnrErX+2QYrFlzDBp49p7xFyhH9pUe6p+jJUCU9R31TFDYiSPQBVUiYNoDKd/DtF6yEZxD3wQqx74mAvnrTpgzoIJMMWDMUTJ1baAPaZ4g1PkiN1G8oPSrQILCLhP5InMK+cLqpAlnZzTPFjL53IFUMazKTy1MdQXeOH7z0Srgu2ut17epGPQjwQYMXB4leYNhoo5xLIypa1Xsdhluo40udE2+u2bwZvvviy9rjGA9saJsecg8aZkivzA5lelwQvV3/8NqXw2w2K4PEXm0wDgCGD9KrYNgsI6BfOChEWCClGOBU2z5K59dt2w7v2nWRVJQrpE0LPb3N6o7pbOBZ953BoRti12QVfvaKl0cpsBlkyznJQzMrEB898AMMnbLncsBLnD6AbnypR4BBXYJOE5l01epm+PHLrxWBMwsLvEtt7EBotQmDnto15w9qvBSPr9mxC752x84ipUN1OdbC69ziMkFjdKojszkRQrNSOgbliTrNyv7mZDt/Z5w4SSKhNdhoTW97Bo2FIKWWIPtGh+oDTRL7TVvPh//76lfBfzj8LNx04hjsWz9b3u7Ls2MBZEbFuQXqYBEWE8IsWCaElzAtAAE5WAQy4Gn/m0k8rooA/przt8P7d10KO+Lkx3oYd5kOMDZGQgDxG3DQryuke6mMVKX8Bkc8X8UJfOtFe+AThw/n5eOwo0y4QxIOB+MBqPc8G6QZr/zc54Khbiwl9yRmlJIU6R2NZOj3a+tw9XQFfv+Nb4Wt3VTUTFY7oLwZWiipopbqlGgHRfqrCfP5fGfvySCqYRsvwo+wgXnOeVTz1CUcVsV3xrFyWhdhIWGNfILVYPyrJSW3j0jSoDxNUCXuouB5qj+p4+8Lk+Rc6cpMXvo906/D++74FDwXZuo7w5RJZ8c22mMl5gcOC6fQ3tZtNDiZGhTz8vbIM3jHzj2wXfX+BGRjZsBiMGsKsEWCAk2vHkg/HVeqr9O1MgseKrCNlFV5oqNBbrtxCzSJs7QMgmOvATnXqdETmnkpAseEQQvQRlsqU3AWbHuMgVnzReKUlEZVJn9bkLUoS+oE8FCmx7/9kj3wm0/ui2OuXjZ6KjPPAIOGyVEIi4Te+PvQwVLcYnQVA8U266O58b7o2WBm8K+RyP1iMAdXDEtkRY6pL4M6v/mbpA5JZ1ZzvDa2dHpfgKOhiXdsly8NqYGH86VqcHUz5PT1HsC8hGCcA2G8OBEi+lcG51B/Nfh9xwOY3y6jpgfWNpAxFYH6XdHL8hv79kKYTgkYtOmm+WKBrkE34niY/4I/jkVaSBbDvoft0R56RRwQ9r2VBMbPOXi6hnmN0orLL3sqUAeSCtnzgUpCsHRmvsASQQM2OECrziQrbbFBD3Pq1ei4SBfVC1HycvJETK1BXvPAHCyvjaTW5wADIeTzHGsDqQO0EwTVBjKvEEr7vHr7edGWn8Dx7MIjW7qR2+CrtDmFjgO6qU6D+Q2kQ9ldl97ZSB/RejDLyDfUAYNm9Fw1PacOjCEtLVhjZQYqUwOUyTFWPak6g1gBTfZHYWIoE2PChXHpls/RpjP14/yDep46CpepAb3MABpcegYT09gSMqZdXB4Lg2okLXD0hlB6MmYSmfem83bAx44fIQnd1Rfecl4NaQIwt/GW+wSLM/FiRzhTAH11nOI2zApgZv9aDGMA9rA4GFCH2nNR1T+Fju7rdanB9fJWXKtAb37kaIMspWoV6JlWkbzBdQamP9g00ik4bbD1NnnoOLD5mijX0Xr1nO+AXGed91weUcCRa22embKo8Ku3xDmDo4cgKCeDBTAuTwRoQOveYIxUzlSLEBCq2NzI/s0tWw2TmPktuwwABlJkmdACtcRRRjMGOsWZX9daZsDM0b5RqQDhSHDEBKspWCoNaO+H4OOj19KbeaeaQOc94JeOYI0UhvwN7tx3njAn26WDaiCNIoMLrFJ618pqeVUiqK2RWw1l7A4vnapEGF1ON5DI45f5pXrefqSMEqgvXl09J6ZslHEe1PnHixWwDNUiTpsdxmsBMBRPrV/uREoG1AxV52U54B7XhLEnRkwxnT6UTmBkSytoHjQawJM/qFIYz/6cQO2e58O/sZeO5BHLApEJocDv2QudWN8S1PSa5or3pjhCxXyzxc7uBPJyrKrF/7Q0mFvbcwweh9yJmdZBIwZlZzfuWZ0+LKw18NZb1Q1wpKTUoDyv6MCaXKIRejVJ0UKj7jDObhupxvBeWKqvzA1Olw9IDa5T9aqtpjxRQgdrU+ZvS4OKFmpgdLENHdwTvSabDupd2HhUKhLmM/lcwqCXslSkc98pQ+MZnJPvWJwHRl+LFm1g0rPkZomu81BSHdTzHNcaW7SUSIvoMHLOEWO832ibeDDjgnTmmhHu7o7lsSi0AY3zSQmtk/j/bD9rpB420jyh84IDc3TOWKIFiEWNEFS+Bgyq4wiY6ab3agwGfT5/cB1jhLCxDjdicQyfUXTASF6Lgi5Paz7vixYJje2815K5YXo4M9S3nrseabDFEpoNdG1jtDgXw4H03Rice+861zAA7ghKrb1VG0LuKZu49y0W6jNmyarQaDDNrgatetCk+ajBF8bqBjC0+VWn4nGBLr8fo2MD8YvShpEbWpjla1eZo2trdqKLnsqbHcHGQ3sZA+/t0Ht1NVqLXxx//OTz0AxBnhyZcXzhodnwPl4B0WNiEHDeTRATysgSVRizbzApADAwL4LuFOpmcOmXeXndegpgYOJwXPNZeHFDZrcXKmhZe/DMaStZ+I5vUNSN5+6rVza6QYlS1EhmY8THNPcdP9rOQUmkpY6wgbTqWDRRwA0pC3QjyAtLT508XgYbxPBOV1uZMNLowXaUfM+lL8sKQ/2MyjEGNV0ufw8uDVIGCh97jx2SF7DkRSx+bn6zgarOSxsUb5nuFPaePAGAOK6FdMVb9+W6ZLrxL1YG+aLs9bH35EkzA6zbFlzcgkzPOXhADDp+UGCAAoDT62vwU7feCCfXzgy3yZhTzkCdAhg/awZyB+Ir77GCmz9h8p2Ega3rwLQbIEPpdGcj7b92+62wlhaQx9oRDajn0B/ghYPZ8ELFGbrdM3x95+GDwMtL4AtoeH6y8xH+nK+1NMJB4gLq07MZ3HX4kH3DDU2yHIQBYdigoxKW1TLMl8IAI+q1IcH4uP/wAbj38LPw2LGjAzBji3bXQoYOBOvShBYT7XOeZgQHCFQNRuf8WuYjRw7C3QefhYcjMMxWH1jrr/mnJ7n80W/wCHMOUOVKBR1f7z16GI6tr6sNmywP2sbDfNB3vicbZvq8JK1ycgt6u7wA40effdqCYQTUfC70BYB5HVR7DFoEekmsJzs8OBnY6Z3pvBfIU/vyB50373vEbJFhwI2OfvrtB4UrglogpjgvffVvUHXQr7wybXonsdueeAzOhBnc/PhDeaOeCdo3DXGMPGyTvGzABfn5cvnddW0q/dmTT+S94dHZIsVERpMPjuXr7rU/wZL80c6CNbzcslsTrff8n5/cF3vd2YpzsKAGaDBzpCcNJK0CA0uZQXq0z0rHAQUKtRfPegTDBx9/OK9r/JEnH8/7gzDQtQoXm9rTzWVjI16VG3D00VJ1tI0tDYm1ofSmPGlG7EQ0kW6NnTEtKP6XTz2e66K3zht83ADDjq95tdEwT8Nwh2Sa0V2fipL5o88+WRbEz4viE44oB6HTjyLVKTZoqoPCUVGO4FBd+w6DGQuY01cHaW+NTx08INKtpeI1R7TP1khhPtVpggWtJtnYs3T4vqhpYgmdAHHo7Jm8nvEzZ07BbU/vL4DohuobdB1QsUafa3taHbpqZnbP5cv30cWL1ugK3QnQ9xx6FvadeD7TfuDMGfjoE3ulM2pQG23uCYPaDmGePeeO0MjDXxvtAlbz3fLMk/BYHBAWCd3ROtKVIShMrlxo2tjGBOBBoQY16tZxD+pfUzhmwhKg03Zuv/3og1Fa9Haf584x2BXjpzmFIegOxSgNfKQ8AG0dfZnc0FNq+D945AHaT3ElRk7gDx59ANIaHQO6u6G0KwXU8oNli6mLodPfV52iU3XWHUoDuWweG+BPEu0rtNNYPP7r44/k+1NVP94vUH8W5VsQG829TPDmpD40r/QncumYRWz80eN7C16mE6h7lcMAoCBqDsCqe0c0nXeLKWZydbzKHMBK6UjgZw8fhk8ceNbaoyo76bnpYTWAMJILQQZY5gA7AOMgj9JJLrdTQAb1fRv9fjRK589GKVf2AynA+Pyh5+DmaHrkNJ0FtedfRx0MGuuj67FBa5UjbwJ4a85rEk37Sjw+9fST8JkDz5TOmGmfwO3x+rZYp6kCvv7WUuMBHQIzL5VdE9y9sCCNViWylU2ngKzOb33mqYiRg2WV/7RVCdvRhhEOc9Bo7EYYWTlp/AEDcAXsBOZJ2rh+WnYJ/cUv3Q1HkirvhpIGPXMBmpLLd0gtfX16VCdMYl6DEWGw/Vhi7snZGvzS3Z+j7cZou960oGC8+fN33Zk/4vS2aBMcmpOuIoM06K7pOW0nC5hBgRpq2Qmsa5G2n7/r9kxrJ7SXHVp/8Qt3wrGzpwX8GtiirbpGh/L8bPEch+0DFgbVvFC8zr9Q6DgUafs/vvSFrA0TXspq/938Rm0V7KJ0M7haUHBq0qJQIqXGbAfljesjqO8/cQx+66H7TQ9t2XVjzNJBC785nXNIIsLAK8DH7z98P+w9cTyrvdQJ80HnT0Vb+l/fd4+R5gLmDoZmEMAArEYC6mvFtk5dexOpc+VqcP72/V+CJ6LPP29sSkJkQttR74t26Z/sfUjS+kN3Ri/0/CBca00+b74Oy3UAMB4Wz7e0PevvP/IQ7Dt1qmw0lPZi6SZ1E07B05BAnNfoKtTldEe7HxLDVeaoDHSyfdjLUTeuX4V/F23pv4heD89QM2iBBjhgSAo6svw9n0fnmUkdKn1C/2f7HoV/dd+9tO902egmdcQJb0UWj9+4/4vRJNkvdqsxQbBhRvE5qVyhFRtp6DrofEKVnppfbGLw70eeeBx+6767YbJphWznKe3YOy3aJpog/9e9d8EHH3ukLBvAtndXXXrieXD0MG+D8x0HjXZ0fAcwGiXzvquSeaqOD0Us/OsoSDK/eb/vSfFwaKnG66Ogxp2AvB2Ylo6XVA30LqrYwwDGrgl8nW3CCnIGNw8MJxMyPSLBSSX+7BfugPuPHxEpzcAYmCKKud0yAFdpWGoaNY1qMIWlQdPx8LEj8M8+91k4neIJEJM8mJ3IICXFpy+R/6fPfBIeOHJ4KOXAaprW3uVeeosUVucizdSzvizmVwLzQ0ePwM/dcXve4zGbSStTorsjTVNAjvH3FyLfvxTt1Ck9K/ynQ0tQGTAC2MEjtoFrTCN18GCUtcNKVzvjo8ePwk9/7jMZE4nG6YRox44GhYwnICHJjKo49HjTeGWCO/CR0kVrJtJrOK3qRbr1qvuu7vF9pO/h73/qY/DUqeeNlOPKD4DtQO1tuGYcOHBpqaSkUwLzf3/bR+F4nA6ZrGySBU462ksvg2JSpF3aATVtpfBDH/8oPBif0w017WwjzgOzsSvBSmNtVmg7mQ8GQzqePPk8/Eik/XC0n7u8sWWL9kmW0NN4HItt+IGYfv/zxwywWl4Q7QnhJs3XwQK8C/Y+P5eWJBC6QbUvnT8daX//rTfDmSTwWCtOaTBoGlrkp+BPRFhLOjfi8Jq777ZmqTeSsMTJJzLKuDIfNvI6ZbQc2PraOqyfPQuzeKydOg07I/H/z9e/G1523gV1ERq1ao9fxXKMFEt9Za6W7hpszOj90V7+7ls+BIfixEnatndKG0VOaC89pDLSAoJ9JGx97Wykfy3vTb5ndTP8+298D1y6bbssnCOL6GClmd/h0DSHEdqZnZn+INURAE2hStEnjh+Dv3fLTXAg0lRoX420k4RTtCfez/pZoZtov2LTFvj1r3sXXHXe+WZpW1lkJkBzNasgRDqWV9w1B9zaPEudKAmDf/DJKNDiZFvexD7SzzvNdnkTe16irQ5OMsidLc2Se8BMB+rJjh/+4f8F5gXUDzHruDx1DaxeiSiAahvFcDLODP3Row/BVdu2wSsuuADqrBAMTQgYSl4ttb1fU2zkzrrlsrqNx3+JNvMPfvwWeD7Fpf2naQ/qTjZT76qGEW3TSWHHYqf8k0cehiu2b4NX7txR6Waed65DUaWEXufZYfWuTZiJphlrPT6yfx/8yMf/Eg5HbZGBvKlIuMmAdiKEAA4EiuRp+qM4lnlZBPT1519glKqx7xVfEYbnk86acVrbshZc0b8x/qZo7//EZ2+DgyxEEqBXqqmU7WfXuIXvAjBiXrUUKtBUI8wF9NiDgzgEh2eTRNs6DP61KEFujJWcxd/E3G3J3tNMhSG4NXM7BQ593emBlDIzjsXG/K0Hvgi/GAdJZ7ATIBdATCoglC9LQN0RE2mvw1NR69y0b1/+oPOa886D80Zo9+aQNkUMQBqAnlJ8+j0ZJdov3fU5+OV774aTKT7SvbKpRXsnTKu0E7CJiLUofv/8sUdz21x7/vmwPdEOli5PoxEg6toM7qE9eH0+8v1f3veFyPfPw6mYMG9kT6ZQcZFW2mUDUGIceheYs6PngTlHDUyOFEbeAA+ik/oq+vvyxXf169BC1oEWcEzmx/paND3Ws/nBZsjVm7fAT7z+q+Cdey6PDOkG664xGU1KcAh+bYOeiRLhtmefjgOjO2FvtN+K5yKZGKt5AiK7ubqJME73fl7ZMn9aH9X3bD3RT+bTWqrHGlweaf+ZN78Fvv7Sy/KAzK8IZNQ22DpgY9aQ9yzqch49fPqZZ+CffvqTcSr+tKO9uOk6nioeoT0RMiPaZ5n2tczzRPsroqT+4de8Hr7h0itz6WZrEGi76wy9CmsT/qXzNAP4mQNPwy/f8zl44Pnj0RNDAmS1emTy/t9KIxpTg8EdQIHcSWeDg3mA1jf79rIvZhlT/rDR2NIAvKQBr4Bd1rxbz4ydra1npiZw9BEcIca9bfdF8J3XvBzefdmVsGU6ta84wpCxqOpiJEk8PxE7zs3RNfSf47Tqrc8+lScdpnkWjcAgdudEADEaAtAq831enDuDOY0Loh3bn020z+CrL74Y3nfttfBNV12Vpd5gSVq0tOuLTL+yoY9Ge/fWOPv3+w8+CHcefC6q47Qh/JRUdOmIxW/bKdpHVKTQXkGd6M/AjnXoYn1eu2MnfMe1L4f3XH41bIt80qtc8a8Onu9a2xyPPLk9Avl3H7ov0n6gDFizRF6VafmJTHNP8kNDMAOYUT8BGnXB8r1hI9B9vPaeeyrt/EAIlVXaCB8MDivajJSmDhFohfZAA60C7JlIugRqZvY1ccD1jXuugG+/5jp4ZWR2KrQlJTSDS90C3HP4UDZl/mTvI/DM6VNlKpt8s8zQjtR0deRzvii4EJ4BrUUSaBFKBsdaAkcBxSw2YqpLH+m/aus2eOell8L7XnYdvCl2UNmPRPjW6JBQAH3Xc8/Bjfsehz999FF4+vQpmiyZin9cBq5Tol1UNEiDq2ar3CJQ8+ZNBdhr0jHT0sepPa7del7eb/19174MXnXBTuClxlvaUWMuCbG7Dz0Ht0Zf/QejAHni9IncCQvPiwDp2MRIbsWueGOA5ityfmn/9XTSVds5l58L6gSnAuKgpAEUya35mqHKgJYIboMgzW1upLWg7ar9UJpfJHZGcr6OrAQkSd0rEySBOAFhRkdibmJ4ktipEc6PDfrmCy+Ga7afBxdG9X5+sh+JgLWYz/FoXx6MnpO9cTbyzgiIw2tnyjsBNEvJEw1ZKrB7iyRbp2xOgkRFXf6rUVjq03OnTEeiN0vsdalHn4AdwZHqd0Es780XXQTXRFt195bNcEGincpKtuzRqJ0OnY60R8/F5yPtB8+cNTOs2Q+eNEukP7vjplUqi5mhGzV3HKwLs7DJpMxD9twk/s4GtJf6JNp3Rtpft+vC7InavXlzHCes5vXnUogp8uD4udjpHovmxF1RixyJnRrFB86TJVM5Ty5QZD851lFlBm1nB4DJdg7GxKjnDDcWQlxngKGSzYCGVhizo/meA3WGtTJDyAdW05NbLzO2nxWJvb4uUruAYpalSU8bsvRkk4vIMHqvU7OTXQX0ZCqDJlZx7O+UKVbdc1HLzGDrzp0V2Kb2wE6dcVb2CyHaWRsF3gXJ85JUbWrUTDcN7jKQJ9OqSQztRL+g2dPebjutZRI9zPvAZghpzcT7zHfZnaov30XrsZIMygotQhdpDn6Hp+NOyG0y6Spw2dRA6/bRAG4OBFth5N507gMNR7CVZ6yuS/dJdMoH4lyBQFvzpsqnDYUmHc009qUh+8QIZuiMVCRtbxF6JWmG6gZI4qK8utoViUHqLcejArLoTPVrEUKVq4BG6qBZgmA5WFp2swn00zhJQ2BIC75nLUQ7pga/vpfy+Ajtk05evUUBwRzaofFrQgC2eVghs/RLwOr7JB2TCRP5nrXKtPB9VjsrjPGdaJeX8h3txa9M8ZjukX0iLjkE4xoCBWapTwPMWgCN1ruEja0+ajLkxkKoi9xpUEvXjrf7AuJU2QQOJID0XWZiVqWRKazaZTMZ9qAAGCM0k9LV/bxRqWQUkNMLUwbAlXFo6qUrF4oECUGtA106dx7ERTDk1wQS7dRJQ+pM3AFZktPoVvY/UdKg0K20hjmQ7HwE80qlp320UQvRTdonpNozj0t5YdIX2jXfaYJM+J6Obg7tJIUHmlAdAzCjm53WUrpVJTkfB3MK87ek8NcmKS/oSAAQBhCoZRVwECAH0AwuwM62VPo0ui9xxUwJ4vrLwHKjKv0yS/W9FjUIZI8NmCXPcSbYZpjaQAXVaMvQnssk2vtUZho4VrNKz6AuTTv7wVu0E78r7Ypo075YtaVI6hbtSUqHzHfueL3srxdqHTiPIu6HtJP/3ggWJzw8sOvzmnjbHrgAtPPCdID4RZlpTwjSICr34I7AX6RRYQOafJH91KoiWVqTfZx/J50CBVTGUnrJ34AUrY2pQbsIzD54aZCL6/NC7kHVveTYZ6lXBiwh84D3Aay0g6IfLO2IDiScxA1ccQHtWvAgOl5pkms65HwTnV2QjhkE1OD4DoYW4bumXUtZHSevH+pnoKaFeo4D3jfqOicsb3IMCiJQA3diRQ1J7jwY6INdEQgnWU2D8BZFMiCbLZSH2WAueJsDrOo1IKZ8jIRGWwd5RpUpZCqpyvqWO1w2RZj4yQjtQeUFA1ygq8eARlyedqx2jOOXTT+gXQ1YBdx0rbvfwFyaR7t0QAAZ+Ml9UJ1X5aE6wQsFcwpTjbVmUBWVtHwyCupQJFpKlE0KxewQSJqTVOPGR8pUhFooDGBJgR1UicP54RDQAIBO5QV9XzO2PmJPVQ+sp1ReNjPSNfnaNY8g1A1FSL1L5waiGX2h2KAdXN0U0M11bYpyqfilaWfNwlqS8hCNw3wXcwWE/wGHgsTSrujmarBEVmlqvQCqr/nFBXMKZuNNqxhrvj5/c88wiWznTHxhEtLgShqXMFyaVzFZSYKgGbsMHU6CMYil8QXElZm2fjpXMqW4oQgkgW1+BmgyL6h+tSOivDq3iOZKru2QfM31CqoDapkRTI4cF1Q+NTGbbTJ2z0IGlKSu6ZaiGSzfmc+8KLmhnUAr5ikDGXGw4ZW0G8LAyGydt/hsTI5Bp9C/oma5cCApCwLKoOINgVoqAJJkhjpBg1WKo86EH2MbW2qAhglYiTRSgJlHlqq6Jyn0IxIbGBcQNANMvVnDBKKd0RKU1gJdd8VHLY1atNdzpElBHKWdfwLUzgdEOypeMFSlGZE1iGpXqhwaLWlpr+RZMGvaUfO9EV/4AnYFWBU/aBPEAZDBXfPvtJVoNKAd+fsGQGJCYG5nSwHNLKKuYHBbSxUQ8iruOOyGo3S5E7TMMw/XnmB/VTkCwlDjURAkibI2MqzO/3WdYJB3m3aFTAI5eoDDCO0WiyBodPtTiMQOoaLJPSwQDUMyxWxxJGnazMcgDhtSjsqjVNcxhdvNlbcURmN66+XwROtrf48yKPdUkRrY8uYUWN3AmBB7SW9xQYl0e4wCQV0oqSESQz/fArDPSC/sAa7uwRPD0ockMxfm9iscFINQeRkqregb3nQAtHVo0WzOcQjaUhFgyVnpINoNwGEIalO+ohNgfudjfqqOizAHS63rFib9L92bbjhTbLSWAU8thIWCrHOlgco2HD2jwQ1BD+Ra4qIWjIY2dUuBxdI9TKvlgDEQdJ1QgxqgaigCJPuv2YaeR7uyK5envUkwKAMGzFggKBAx7SLRg8qXaCeAByZg0Mw4LLFFO0e0OiBWSBth2IBUE2emTBymyxL6XAMDV65BEVh7jICaEykholV6uV0NKA2yprRoE1V/Rhg693F/Txfd6pRMuxoUV6nlM2gV0Cj9y017TqsEi87pXPhO+bQ6oBE+nP9GwLxEOHdAc8HB1boBbNR+WZYaGvgi/eYxcsT+QEePv4HtpMsyzXhwwNPuAMIheDJeGO3nQrce0M2lXZMHG6AdWvSPgNikASvUBnmeO5hTeGGA1gRsANg5WtMtEgSy0h/uOei7MsK4SoTlgTAmIXS80zZMrpSQcNGhnVkz9L8ItGs6WjT6eJ++QTt7c2paR7sZM+j7uDHacUFHWJTWPRZgfpiWdzKU/5Ey1e9D13rj0FdJUjo4aT2UDjZvW+nyE9QFC4eQB5RolEGllU3DlqhRNOtn1L3RJW7RyyVUQABomloZpx1REXj8pX0HjmbK19RaiAaemBnQ7Mod3ENFM+eNdWyQ2cltizUH7o+opLmlGW2nMGmpDYxbF4c0W9IVzTgfdy6PeWmnzDh9Ax0T6qyXTQtgO4GvVKD0qK8BqQJg03K5YGuueA4amrVMUPR48FJa3Umw0iVxaqTcphkkt1J2nbVUpKoGwDbNFG/GMTDkfYnoVL1KJ9kQzahyD5UHmndgylQ059lcrM/pduBidVr0g/OC9ADu+RbNiJYOVQ+NBXR8ZozKfcp78HJSMxNNqAuDwrWKtuLINYh6CtXzXnqbwlpVtfc4b1XVQXLfKXW95tLMZ452uRPCKF0wXqsB7fYe/yyg2WQ3ntaoJcUaQ3urvceq0alpbj3YxAU0y8ts87NvhWYayvuF29Cjpere2mroxjPB3RiIrbFnwOqnpbiyGGBNurmMFg2A42lg7Bl4cWmXPM+R9nk81+rPP78M7Yjzr1+E8P8B0szv+tLrxRwAAAAASUVORK5CYII=")'}}),Trust=({theme:et="light",...o})=>jsxRuntimeExports.jsxs("svg",{...o,width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("rect",{width:"44",height:"44",fill:et==="light"?"var(--ck-brand-trust-02)":"var(--ck-brand-trust-02b)"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M33.0246 11.8662C33.4096 11.8662 33.774 12.0243 34.0421 12.2925C34.3102 12.5675 34.4615 12.9387 34.4546 13.3168C34.3859 17.4143 34.2277 20.5493 33.9321 23.0312C33.6433 25.5131 33.2102 27.3556 32.5571 28.8475C32.1171 29.8443 31.574 30.6693 30.9346 31.3706C30.0752 32.2987 29.0921 32.9725 28.0196 33.6119C27.561 33.8861 27.0843 34.1568 26.5842 34.4408C25.5172 35.0468 24.3441 35.713 23.0146 36.6025C22.5333 36.9256 21.9077 36.9256 21.4265 36.6025C20.0766 35.7026 18.8879 35.0281 17.8112 34.4173C17.5718 34.2815 17.3379 34.1488 17.109 34.0175C15.8509 33.2887 14.7165 32.5943 13.7265 31.5906C13.0665 30.9306 12.4959 30.1262 12.0421 29.1706C11.4234 27.8918 11.004 26.345 10.6946 24.3443C10.2821 21.67 10.0759 18.1706 10.0002 13.3168C9.99336 12.9387 10.1377 12.5675 10.4059 12.2925C10.674 12.0243 11.0452 11.8662 11.4302 11.8662H12.0215C13.8433 11.8731 17.8652 11.6943 21.344 8.98559C21.8596 8.58683 22.5815 8.58683 23.0971 8.98559C26.5759 11.6943 30.5977 11.8731 32.4265 11.8662H33.0246ZM29.8277 27.9331C30.2746 27.0118 30.6459 25.74 30.9277 23.9112C31.2646 21.725 31.4709 18.755 31.5671 14.7125C29.4221 14.6506 25.7371 14.2381 22.224 11.8731C18.7109 14.2312 15.0259 14.6437 12.8877 14.7125C12.9633 18.0537 13.1146 20.6525 13.3552 22.6943C13.6302 25.0181 14.0221 26.5925 14.5102 27.6993C14.8333 28.435 15.1909 28.9643 15.6171 29.4318C16.1877 30.0575 16.9096 30.5731 17.8927 31.1643C18.3005 31.409 18.7502 31.6635 19.2396 31.9406C20.1116 32.4341 21.1099 32.9991 22.224 33.7081C23.3175 33.0107 24.3014 32.4515 25.1633 31.9616C25.4231 31.8139 25.6717 31.6725 25.909 31.5356C27.119 30.8412 28.0127 30.2637 28.6796 29.59C29.1265 29.1293 29.4909 28.6275 29.8277 27.9331Z",fill:et==="light"?"var(--ck-brand-trust-01)":"var(--ck-brand-trust-01b)"})]}),Argent=({...et})=>jsxRuntimeExports.jsxs("svg",{...et,width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("rect",{width:"32",height:"32",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M18.3242 7.63647H13.6516C13.4955 7.63647 13.3704 7.76611 13.367 7.92726C13.2726 12.4568 10.9768 16.7559 7.02532 19.8009C6.89986 19.8976 6.87128 20.0792 6.963 20.21L9.69685 24.112C9.78986 24.2448 9.97107 24.2747 10.0986 24.1772C12.5694 22.2856 14.5567 20.0038 15.9879 17.4746C17.4191 20.0038 19.4065 22.2856 21.8773 24.1772C22.0047 24.2747 22.186 24.2448 22.2791 24.112L25.013 20.21C25.1045 20.0792 25.0759 19.8976 24.9506 19.8009C20.999 16.7559 18.7033 12.4568 18.609 7.92726C18.6056 7.76611 18.4803 7.63647 18.3242 7.63647Z",fill:"var(--ck-brand-argent)"})]}),ImToken=({...et})=>jsxRuntimeExports.jsx("svg",{...et,width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:`linear-gradient(
180deg,
var(--ck-brand-imtoken-01) 0%,
var(--ck-brand-imtoken-02) 100%
)`},children:jsxRuntimeExports.jsx("path",{d:"M26.8543 9.96509C27.5498 19.3857 21.4942 23.8384 16.0655 24.3132C11.0184 24.7546 6.26765 21.6534 5.85087 16.8885C5.50707 12.952 7.94004 11.2761 9.8516 11.109C11.8177 10.9367 13.4698 12.2925 13.6132 13.9342C13.7512 15.5125 12.7664 16.2308 12.0815 16.2906C11.5398 16.3381 10.8584 16.0093 10.7968 15.3032C10.7441 14.6965 10.9744 14.6138 10.9182 13.9693C10.8179 12.8219 9.81731 12.6882 9.26951 12.7357C8.60654 12.7937 7.40368 13.5675 7.5725 15.4949C7.7422 17.439 9.60628 18.9751 12.0498 18.7614C14.6868 18.531 16.5227 16.4779 16.6608 13.5983C16.6595 13.4458 16.6916 13.2948 16.7548 13.156L16.7557 13.1525C16.7841 13.0922 16.8174 13.0342 16.8551 12.9793C16.9113 12.8949 16.9835 12.8016 17.0767 12.6997C17.0775 12.697 17.0775 12.697 17.0793 12.697C17.147 12.6205 17.2288 12.5379 17.3211 12.4491C18.473 11.3623 22.6214 8.79916 26.5448 9.61074C26.6277 9.62851 26.7026 9.67262 26.7584 9.73649C26.8142 9.80035 26.8478 9.88054 26.8543 9.96509",fill:"white"})}),Frame=({...et})=>jsxRuntimeExports.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("rect",{width:"32",height:"32",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M24.9055 15.8824V8.30065C24.9055 7.63399 24.3583 7.08497 23.6938 7.08497H16.1238C16.0456 7.08497 15.9805 7.05882 15.9153 7.00654L15.0033 6.0915C14.9511 6.03922 14.873 6 14.7948 6H7.21173C6.54723 6 6 6.53595 6 7.21569V14.7974C6 14.8758 6.02606 14.9412 6.07818 15.0065L6.99023 15.9216C7.04235 15.9739 7.08143 16.0523 7.08143 16.1307V23.7124C7.08143 24.3791 7.62866 24.9281 8.29316 24.9281H15.8762C15.9544 24.9281 16.0195 24.9542 16.0847 25.0065L16.9967 25.9216C17.0489 25.9739 17.127 26 17.2052 26H24.7883C25.4528 26 26 25.4641 26 24.7843V17.2026C26 17.1242 25.9739 17.0588 25.9218 16.9935L25.0098 16.0784C24.9446 16.0261 24.9055 15.9608 24.9055 15.8824ZM19.759 19.9346H12.241C12.1498 19.9346 12.0717 19.8562 12.0717 19.7647V12.2353C12.0717 12.1438 12.1498 12.0654 12.241 12.0654H19.759C19.8502 12.0654 19.9283 12.1438 19.9283 12.2353V19.7647C19.9414 19.8562 19.8632 19.9346 19.759 19.9346Z",fill:"#00D2BE"})]}),Rainbow=({round:et=!1,...o})=>jsxRuntimeExports.jsx("svg",{...o,width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{backgroundSize:"100% 100%",backgroundImage:`url("${et?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwIiBoZWlnaHQ9IjEyMCIgdmlld0JveD0iMCAwIDEyMCAxMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMF84XzU1NCkiPgo8bWFzayBpZD0ibWFzazBfOF81NTQiIHN0eWxlPSJtYXNrLXR5cGU6YWxwaGEiIG1hc2tVbml0cz0idXNlclNwYWNlT25Vc2UiIHg9IjAiIHk9IjAiIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIj4KPGNpcmNsZSBjeD0iNjAiIGN5PSI2MCIgcj0iNjAiIGZpbGw9IiNEOUQ5RDkiLz4KPC9tYXNrPgo8ZyBtYXNrPSJ1cmwoI21hc2swXzhfNTU0KSI+CjxyZWN0IHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiBmaWxsPSJ1cmwoI3BhaW50MF9saW5lYXJfOF81NTQpIi8+CjwvZz4KPHBhdGggZD0iTTI2LjY2NjcgNDEuNjY2N0gzMS42NjY3QzU3LjQ0IDQxLjY2NjcgNzguMzMzMyA2Mi41NiA3OC4zMzMzIDg4LjMzMzNWOTMuMzMzM0g4OC4zMzMzQzkxLjA5NDggOTMuMzMzMyA5My4zMzMzIDkxLjA5NDcgOTMuMzMzMyA4OC4zMzMzQzkzLjMzMzMgNTQuMjc1OCA2NS43MjQyIDI2LjY2NjcgMzEuNjY2NyAyNi42NjY3QzI4LjkwNTIgMjYuNjY2NyAyNi42NjY3IDI4LjkwNTIgMjYuNjY2NyAzMS42NjY3VjQxLjY2NjdaIiBmaWxsPSJ1cmwoI3BhaW50MV9yYWRpYWxfOF81NTQpIi8+CjxwYXRoIGQ9Ik04MCA4OC4zMzMzSDkzLjMzMzNDOTMuMzMzMyA5MS4wOTQ4IDkxLjA5NDcgOTMuMzMzMyA4OC4zMzMzIDkzLjMzMzNIODBWODguMzMzM1oiIGZpbGw9InVybCgjcGFpbnQyX2xpbmVhcl84XzU1NCkiLz4KPHBhdGggZD0iTTMxLjY2NjcgMjYuNjY2N0wzMS42NjY3IDQwSDI2LjY2NjdMMjYuNjY2NyAzMS42NjY3QzI2LjY2NjcgMjguOTA1MiAyOC45MDUyIDI2LjY2NjcgMzEuNjY2NyAyNi42NjY3WiIgZmlsbD0idXJsKCNwYWludDNfbGluZWFyXzhfNTU0KSIvPgo8cGF0aCBkPSJNMjYuNjY2NiA0MEgzMS42NjY2QzU4LjM2MDQgNDAgODAgNjEuNjM5NiA4MCA4OC4zMzMzVjkzLjMzMzNINjVWODguMzMzM0M2NSA2OS45MjM4IDUwLjA3NjEgNTUgMzEuNjY2NiA1NUgyNi42NjY2VjQwWiIgZmlsbD0idXJsKCNwYWludDRfcmFkaWFsXzhfNTU0KSIvPgo8cGF0aCBkPSJNNjYuNjY2NiA4OC4zMzMzSDgwVjkzLjMzMzNINjYuNjY2NlY4OC4zMzMzWiIgZmlsbD0idXJsKCNwYWludDVfbGluZWFyXzhfNTU0KSIvPgo8cGF0aCBkPSJNMjYuNjY2NiA1My4zMzMzTDI2LjY2NjYgNDBMMzEuNjY2NiA0MEwzMS42NjY2IDUzLjMzMzNIMjYuNjY2NloiIGZpbGw9InVybCgjcGFpbnQ2X2xpbmVhcl84XzU1NCkiLz4KPHBhdGggZD0iTTI2LjY2NjYgNjEuNjY2N0MyNi42NjY2IDY0LjQyODEgMjguOTA1MiA2Ni42NjY3IDMxLjY2NjYgNjYuNjY2N0M0My42MzI4IDY2LjY2NjcgNTMuMzMzMyA3Ni4zNjcyIDUzLjMzMzMgODguMzMzM0M1My4zMzMzIDkxLjA5NDcgNTUuNTcxOSA5My4zMzMzIDU4LjMzMzMgOTMuMzMzM0g2Ni42NjY2Vjg4LjMzMzNDNjYuNjY2NiA2OS4wMDM0IDUwLjk5NjYgNTMuMzMzMyAzMS42NjY2IDUzLjMzMzNIMjYuNjY2NlY2MS42NjY3WiIgZmlsbD0idXJsKCNwYWludDdfcmFkaWFsXzhfNTU0KSIvPgo8cGF0aCBkPSJNNTMuMzMzMyA4OC4zMzMzSDY2LjY2NjZWOTMuMzMzM0g1OC4zMzMzQzU1LjU3MTkgOTMuMzMzMyA1My4zMzMzIDkxLjA5NDggNTMuMzMzMyA4OC4zMzMzWiIgZmlsbD0idXJsKCNwYWludDhfcmFkaWFsXzhfNTU0KSIvPgo8cGF0aCBkPSJNMzEuNjY2NiA2Ni42NjY3QzI4LjkwNTIgNjYuNjY2NyAyNi42NjY2IDY0LjQyODEgMjYuNjY2NiA2MS42NjY3TDI2LjY2NjYgNTMuMzMzM0wzMS42NjY2IDUzLjMzMzNMMzEuNjY2NiA2Ni42NjY3WiIgZmlsbD0idXJsKCNwYWludDlfcmFkaWFsXzhfNTU0KSIvPgo8L2c+CjxkZWZzPgo8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50MF9saW5lYXJfOF81NTQiIHgxPSI2MCIgeTE9IjAiIHgyPSI2MCIgeTI9IjEyMCIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSIjMTc0Mjk5Ii8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzAwMUU1OSIvPgo8L2xpbmVhckdyYWRpZW50Pgo8cmFkaWFsR3JhZGllbnQgaWQ9InBhaW50MV9yYWRpYWxfOF81NTQiIGN4PSIwIiBjeT0iMCIgcj0iMSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGdyYWRpZW50VHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzEuNjY2NyA4OC4zMzMzKSByb3RhdGUoLTkwKSBzY2FsZSg2MS42NjY3KSI+CjxzdG9wIG9mZnNldD0iMC43NzAyNzciIHN0b3AtY29sb3I9IiNGRjQwMDAiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjODc1NEM5Ii8+CjwvcmFkaWFsR3JhZGllbnQ+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQyX2xpbmVhcl84XzU1NCIgeDE9Ijc5LjE2NjYiIHkxPSI5MC44MzMzIiB4Mj0iOTMuMzMzMyIgeTI9IjkwLjgzMzMiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHN0b3Agc3RvcC1jb2xvcj0iI0ZGNDAwMCIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiM4NzU0QzkiLz4KPC9saW5lYXJHcmFkaWVudD4KPGxpbmVhckdyYWRpZW50IGlkPSJwYWludDNfbGluZWFyXzhfNTU0IiB4MT0iMjkuMTY2NyIgeTE9IjI2LjY2NjciIHgyPSIyOS4xNjY3IiB5Mj0iNDAuODMzMyIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSIjODc1NEM5Ii8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI0ZGNDAwMCIvPgo8L2xpbmVhckdyYWRpZW50Pgo8cmFkaWFsR3JhZGllbnQgaWQ9InBhaW50NF9yYWRpYWxfOF81NTQiIGN4PSIwIiBjeT0iMCIgcj0iMSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGdyYWRpZW50VHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzEuNjY2NiA4OC4zMzMzKSByb3RhdGUoLTkwKSBzY2FsZSg0OC4zMzMzKSI+CjxzdG9wIG9mZnNldD0iMC43MjM5MjkiIHN0b3AtY29sb3I9IiNGRkY3MDAiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRkY5OTAxIi8+CjwvcmFkaWFsR3JhZGllbnQ+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQ1X2xpbmVhcl84XzU1NCIgeDE9IjY2LjY2NjYiIHkxPSI5MC44MzMzIiB4Mj0iODAiIHkyPSI5MC44MzMzIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CjxzdG9wIHN0b3AtY29sb3I9IiNGRkY3MDAiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRkY5OTAxIi8+CjwvbGluZWFyR3JhZGllbnQ+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQ2X2xpbmVhcl84XzU1NCIgeDE9IjI5LjE2NjYiIHkxPSI1My4zMzMzIiB4Mj0iMjkuMTY2NiIgeTI9IjQwIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CjxzdG9wIHN0b3AtY29sb3I9IiNGRkY3MDAiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRkY5OTAxIi8+CjwvbGluZWFyR3JhZGllbnQ+CjxyYWRpYWxHcmFkaWVudCBpZD0icGFpbnQ3X3JhZGlhbF84XzU1NCIgY3g9IjAiIGN5PSIwIiByPSIxIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgZ3JhZGllbnRUcmFuc2Zvcm09InRyYW5zbGF0ZSgzMS42NjY2IDg4LjMzMzMpIHJvdGF0ZSgtOTApIHNjYWxlKDM1KSI+CjxzdG9wIG9mZnNldD0iMC41OTUxMyIgc3RvcC1jb2xvcj0iIzAwQUFGRiIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiMwMURBNDAiLz4KPC9yYWRpYWxHcmFkaWVudD4KPHJhZGlhbEdyYWRpZW50IGlkPSJwYWludDhfcmFkaWFsXzhfNTU0IiBjeD0iMCIgY3k9IjAiIHI9IjEiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiBncmFkaWVudFRyYW5zZm9ybT0idHJhbnNsYXRlKDUyLjUgOTAuODMzMykgc2NhbGUoMTQuMTY2NyAzNy43Nzc4KSI+CjxzdG9wIHN0b3AtY29sb3I9IiMwMEFBRkYiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjMDFEQTQwIi8+CjwvcmFkaWFsR3JhZGllbnQ+CjxyYWRpYWxHcmFkaWVudCBpZD0icGFpbnQ5X3JhZGlhbF84XzU1NCIgY3g9IjAiIGN5PSIwIiByPSIxIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgZ3JhZGllbnRUcmFuc2Zvcm09InRyYW5zbGF0ZSgyOS4xNjY2IDY3LjUpIHJvdGF0ZSgtOTApIHNjYWxlKDE0LjE2NjcgMjY4LjY0MikiPgo8c3RvcCBzdG9wLWNvbG9yPSIjMDBBQUZGIi8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzAxREE0MCIvPgo8L3JhZGlhbEdyYWRpZW50Pgo8Y2xpcFBhdGggaWQ9ImNsaXAwXzhfNTU0Ij4KPHJlY3Qgd2lkdGg9IjEyMCIgaGVpZ2h0PSIxMjAiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg==":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwIiBoZWlnaHQ9IjEyMCIgdmlld0JveD0iMCAwIDEyMCAxMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiBmaWxsPSJ1cmwoI3BhaW50MF9saW5lYXJfNjJfMzI5KSIvPgo8cGF0aCBkPSJNMjAgMzhIMjZDNTYuOTI3OSAzOCA4MiA2My4wNzIxIDgyIDk0VjEwMEg5NEM5Ny4zMTM3IDEwMCAxMDAgOTcuMzEzNyAxMDAgOTRDMTAwIDUzLjEzMDkgNjYuODY5MSAyMCAyNiAyMEMyMi42ODYzIDIwIDIwIDIyLjY4NjMgMjAgMjZWMzhaIiBmaWxsPSJ1cmwoI3BhaW50MV9yYWRpYWxfNjJfMzI5KSIvPgo8cGF0aCBkPSJNODQgOTRIMTAwQzEwMCA5Ny4zMTM3IDk3LjMxMzcgMTAwIDk0IDEwMEg4NFY5NFoiIGZpbGw9InVybCgjcGFpbnQyX2xpbmVhcl82Ml8zMjkpIi8+CjxwYXRoIGQ9Ik0yNiAyMEwyNiAzNkgyMEwyMCAyNkMyMCAyMi42ODYzIDIyLjY4NjMgMjAgMjYgMjBaIiBmaWxsPSJ1cmwoI3BhaW50M19saW5lYXJfNjJfMzI5KSIvPgo8cGF0aCBkPSJNMjAgMzZIMjZDNTguMDMyNSAzNiA4NCA2MS45Njc1IDg0IDk0VjEwMEg2NlY5NEM2NiA3MS45MDg2IDQ4LjA5MTQgNTQgMjYgNTRIMjBWMzZaIiBmaWxsPSJ1cmwoI3BhaW50NF9yYWRpYWxfNjJfMzI5KSIvPgo8cGF0aCBkPSJNNjggOTRIODRWMTAwSDY4Vjk0WiIgZmlsbD0idXJsKCNwYWludDVfbGluZWFyXzYyXzMyOSkiLz4KPHBhdGggZD0iTTIwIDUyTDIwIDM2TDI2IDM2TDI2IDUySDIwWiIgZmlsbD0idXJsKCNwYWludDZfbGluZWFyXzYyXzMyOSkiLz4KPHBhdGggZD0iTTIwIDYyQzIwIDY1LjMxMzcgMjIuNjg2MyA2OCAyNiA2OEM0MC4zNTk0IDY4IDUyIDc5LjY0MDYgNTIgOTRDNTIgOTcuMzEzNyA1NC42ODYzIDEwMCA1OCAxMDBINjhWOTRDNjggNzAuODA0IDQ5LjE5NiA1MiAyNiA1MkgyMFY2MloiIGZpbGw9InVybCgjcGFpbnQ3X3JhZGlhbF82Ml8zMjkpIi8+CjxwYXRoIGQ9Ik01MiA5NEg2OFYxMDBINThDNTQuNjg2MyAxMDAgNTIgOTcuMzEzNyA1MiA5NFoiIGZpbGw9InVybCgjcGFpbnQ4X3JhZGlhbF82Ml8zMjkpIi8+CjxwYXRoIGQ9Ik0yNiA2OEMyMi42ODYzIDY4IDIwIDY1LjMxMzcgMjAgNjJMMjAgNTJMMjYgNTJMMjYgNjhaIiBmaWxsPSJ1cmwoI3BhaW50OV9yYWRpYWxfNjJfMzI5KSIvPgo8ZGVmcz4KPGxpbmVhckdyYWRpZW50IGlkPSJwYWludDBfbGluZWFyXzYyXzMyOSIgeDE9IjYwIiB5MT0iMCIgeDI9IjYwIiB5Mj0iMTIwIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CjxzdG9wIHN0b3AtY29sb3I9IiMxNzQyOTkiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjMDAxRTU5Ii8+CjwvbGluZWFyR3JhZGllbnQ+CjxyYWRpYWxHcmFkaWVudCBpZD0icGFpbnQxX3JhZGlhbF82Ml8zMjkiIGN4PSIwIiBjeT0iMCIgcj0iMSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGdyYWRpZW50VHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjYgOTQpIHJvdGF0ZSgtOTApIHNjYWxlKDc0KSI+CjxzdG9wIG9mZnNldD0iMC43NzAyNzciIHN0b3AtY29sb3I9IiNGRjQwMDAiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjODc1NEM5Ii8+CjwvcmFkaWFsR3JhZGllbnQ+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQyX2xpbmVhcl82Ml8zMjkiIHgxPSI4MyIgeTE9Ijk3IiB4Mj0iMTAwIiB5Mj0iOTciIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHN0b3Agc3RvcC1jb2xvcj0iI0ZGNDAwMCIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiM4NzU0QzkiLz4KPC9saW5lYXJHcmFkaWVudD4KPGxpbmVhckdyYWRpZW50IGlkPSJwYWludDNfbGluZWFyXzYyXzMyOSIgeDE9IjIzIiB5MT0iMjAiIHgyPSIyMyIgeTI9IjM3IiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CjxzdG9wIHN0b3AtY29sb3I9IiM4NzU0QzkiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRkY0MDAwIi8+CjwvbGluZWFyR3JhZGllbnQ+CjxyYWRpYWxHcmFkaWVudCBpZD0icGFpbnQ0X3JhZGlhbF82Ml8zMjkiIGN4PSIwIiBjeT0iMCIgcj0iMSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGdyYWRpZW50VHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjYgOTQpIHJvdGF0ZSgtOTApIHNjYWxlKDU4KSI+CjxzdG9wIG9mZnNldD0iMC43MjM5MjkiIHN0b3AtY29sb3I9IiNGRkY3MDAiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRkY5OTAxIi8+CjwvcmFkaWFsR3JhZGllbnQ+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQ1X2xpbmVhcl82Ml8zMjkiIHgxPSI2OCIgeTE9Ijk3IiB4Mj0iODQiIHkyPSI5NyIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSIjRkZGNzAwIi8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI0ZGOTkwMSIvPgo8L2xpbmVhckdyYWRpZW50Pgo8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50Nl9saW5lYXJfNjJfMzI5IiB4MT0iMjMiIHkxPSI1MiIgeDI9IjIzIiB5Mj0iMzYiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHN0b3Agc3RvcC1jb2xvcj0iI0ZGRjcwMCIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNGRjk5MDEiLz4KPC9saW5lYXJHcmFkaWVudD4KPHJhZGlhbEdyYWRpZW50IGlkPSJwYWludDdfcmFkaWFsXzYyXzMyOSIgY3g9IjAiIGN5PSIwIiByPSIxIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgZ3JhZGllbnRUcmFuc2Zvcm09InRyYW5zbGF0ZSgyNiA5NCkgcm90YXRlKC05MCkgc2NhbGUoNDIpIj4KPHN0b3Agb2Zmc2V0PSIwLjU5NTEzIiBzdG9wLWNvbG9yPSIjMDBBQUZGIi8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzAxREE0MCIvPgo8L3JhZGlhbEdyYWRpZW50Pgo8cmFkaWFsR3JhZGllbnQgaWQ9InBhaW50OF9yYWRpYWxfNjJfMzI5IiBjeD0iMCIgY3k9IjAiIHI9IjEiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiBncmFkaWVudFRyYW5zZm9ybT0idHJhbnNsYXRlKDUxIDk3KSBzY2FsZSgxNyA0NS4zMzMzKSI+CjxzdG9wIHN0b3AtY29sb3I9IiMwMEFBRkYiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjMDFEQTQwIi8+CjwvcmFkaWFsR3JhZGllbnQ+CjxyYWRpYWxHcmFkaWVudCBpZD0icGFpbnQ5X3JhZGlhbF82Ml8zMjkiIGN4PSIwIiBjeT0iMCIgcj0iMSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGdyYWRpZW50VHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjMgNjkpIHJvdGF0ZSgtOTApIHNjYWxlKDE3IDMyMi4zNykiPgo8c3RvcCBzdG9wLWNvbG9yPSIjMDBBQUZGIi8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzAxREE0MCIvPgo8L3JhZGlhbEdyYWRpZW50Pgo8L2RlZnM+Cjwvc3ZnPgo="}")`}}),Brave$1=({...et})=>jsxRuntimeExports.jsxs("svg",{...et,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("rect",{rx:"27%",width:"88",height:"88",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M69.0892 28.2123L70.5781 24.5643L66.3594 20.1967C64.0763 17.9136 59.2123 19.2537 59.2123 19.2537L53.7031 13H34.2721L28.7381 19.2785C28.7381 19.2785 23.8741 17.9632 21.591 20.1967L17.3722 24.5395L18.8612 28.1875L17 33.5974L23.204 57.2472C24.4945 62.3097 25.3631 64.2702 29.011 66.8511L40.352 74.5441C41.4439 75.2142 42.784 76.3805 44 76.3805C45.216 76.3805 46.5561 75.2142 47.648 74.5441L58.989 66.8511C62.6369 64.2702 63.5055 62.3097 64.796 57.2472L71 33.5974L69.0892 28.2123Z",fill:"url(#paint0_linear_2183_5890)"}),jsxRuntimeExports.jsx("path",{d:"M57.6737 23.2739C57.6737 23.2739 64.796 31.8851 64.796 33.6967C64.796 35.5579 63.9026 36.0294 63.0092 36.9972L57.6737 42.705C57.1774 43.2013 56.1103 44.045 56.7307 45.5092C57.3511 46.9982 58.2197 48.8346 57.227 50.7206C56.2344 52.6314 54.4972 53.8971 53.3805 53.6985C51.7195 53.1594 50.1348 52.4088 48.6654 51.4651C47.7224 50.8447 44.6949 48.3382 44.6949 47.3704C44.6949 46.4026 47.8217 44.6406 48.4173 44.2932C48.9881 43.8961 51.6434 42.3575 51.693 41.7619C51.7427 41.1664 51.7427 41.0175 50.9485 39.5285C50.1544 38.0395 48.7647 36.0542 48.9632 34.7638C49.2114 33.4733 51.4449 32.7785 53.1075 32.1581L58.2445 30.2224C58.6415 30.0239 58.5423 29.8502 57.3511 29.7261C56.1599 29.6268 52.8097 29.1801 51.296 29.602C49.7822 30.0239 47.2509 30.6691 47.0028 31.0165C46.8042 31.364 46.6057 31.364 46.829 32.5551L48.2684 40.3722C48.3677 41.3649 48.5662 42.0349 47.5239 42.2831C46.432 42.5313 44.6204 42.9531 44 42.9531C43.3796 42.9531 41.5432 42.5313 40.4761 42.2831C39.409 42.0349 39.6075 41.3649 39.7316 40.3722C39.8309 39.3796 40.9228 33.7215 41.1461 32.5551C41.3943 31.364 41.171 31.364 40.9724 31.0165C40.7243 30.6691 38.1682 30.0239 36.6544 29.602C35.1654 29.1801 31.7904 29.6268 30.5993 29.7509C29.4081 29.8502 29.3088 29.9991 29.7059 30.2472L34.8428 32.1581C36.4807 32.7785 38.7638 33.4733 38.9871 34.7638C39.2353 36.079 37.8208 38.0395 37.0018 39.5285C36.1829 41.0175 36.2077 41.1664 36.2574 41.7619C36.307 42.3575 38.9871 43.8961 39.5331 44.2932C40.1287 44.6654 43.2555 46.4026 43.2555 47.3704C43.2555 48.3382 40.3024 50.8447 39.3097 51.4651C37.8404 52.4088 36.2557 53.1594 34.5947 53.6985C33.4779 53.8971 31.7408 52.6314 30.7233 50.7206C29.7307 48.8346 30.6241 46.9982 31.2197 45.5092C31.8401 44.0202 30.7978 43.2261 30.2767 42.705L24.9412 36.9972C24.0726 36.079 23.1792 35.5827 23.1792 33.7463C23.1792 31.9099 30.3015 23.3235 30.3015 23.3235L37.0763 24.4154C37.8704 24.4154 39.6324 23.7454 41.2454 23.1746C42.8585 22.6783 43.9752 22.6287 43.9752 22.6287C43.9752 22.6287 45.0671 22.6287 46.705 23.1746C48.3428 23.7206 50.08 24.4154 50.8741 24.4154C51.693 24.4154 57.6985 23.2491 57.6985 23.2491L57.6737 23.2739ZM52.3382 56.2298C52.7849 56.4779 52.512 57.0239 52.0901 57.3217L45.7868 62.2353C45.2904 62.7316 44.4963 63.4761 43.9752 63.4761C43.454 63.4761 42.6847 62.7316 42.1636 62.2353C40.0743 60.5717 37.9648 58.9337 35.8355 57.3217C35.4384 57.0239 35.1654 56.5028 35.5873 56.2298L39.3097 54.2445C40.7894 53.4618 42.3551 52.8539 43.9752 52.4329C44.3474 52.4329 46.705 53.2767 48.6158 54.2445L52.3382 56.2298Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M59.262 19.2785L53.7032 13H34.2721L28.7381 19.2785C28.7381 19.2785 23.8741 17.9632 21.591 20.1967C21.591 20.1967 28.0432 19.6259 30.2767 23.2491L37.126 24.4154C37.9201 24.4154 39.682 23.7454 41.2951 23.1746C42.9081 22.6783 44.0249 22.6287 44.0249 22.6287C44.0249 22.6287 45.1168 22.6287 46.7546 23.1746C48.3925 23.7206 50.1296 24.4154 50.9238 24.4154C51.7427 24.4154 57.7482 23.2491 57.7482 23.2491C59.9817 19.6259 66.4339 20.1967 66.4339 20.1967C64.1508 17.9136 59.2868 19.2537 59.2868 19.2537",fill:"url(#paint1_linear_2183_5890)"}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_2183_5890",x1:"17",y1:"45.3241",x2:"71",y2:"45.3241",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{offset:"0.4",stopColor:"#FF5500"}),jsxRuntimeExports.jsx("stop",{offset:"0.6",stopColor:"#FF2000"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint1_linear_2183_5890",x1:"22.4879",y1:"18.8219",x2:"66.4339",y2:"18.8219",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#FF452A"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"#FF2000"})]})]})]}),Crypto=({...et})=>jsxRuntimeExports.jsxs("svg",{...et,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"white"},children:[jsxRuntimeExports.jsx("mask",{id:"mask0_2091_4394",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"13",y:"9",width:"62",height:"71",children:jsxRuntimeExports.jsx("path",{d:"M44 9L13 26.75V62.25L44 80L75 62.25V26.75L44 9ZM31.7577 24.3492H56.1513L59.0935 36.684H28.9307L31.7577 24.3492ZM41.5613 61.2993L36.2955 66.161H31.8427L20.6924 46.9369L28.8701 40.9079L36.0953 45.4627V53.6578L41.5552 58.8504V61.2993H41.5613ZM37.9759 53.1584L38.7888 45.4326L36.1256 38.5432H51.9229L49.3204 45.4326L50.0787 53.1283L44 53.1584H37.9759ZM56.2059 66.1069H51.8076L46.5419 61.2993V58.8564L52.0018 53.6638V45.4627L59.1421 40.8537L67.2955 46.9369L56.2059 66.1069Z",fill:"#002D74"})}),jsxRuntimeExports.jsxs("g",{mask:"url(#mask0_2091_4394)",children:[jsxRuntimeExports.jsx("rect",{y:"8",width:"44",height:"72",fill:"url(#paint0_linear_2091_4394)"}),jsxRuntimeExports.jsx("rect",{x:"88",y:"80",width:"44",height:"72",transform:"rotate(-180 88 80)",fill:"url(#paint1_linear_2091_4394)"})]}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_2091_4394",x1:"22",y1:"8",x2:"22",y2:"80",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#010935"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"#142C70"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint1_linear_2091_4394",x1:"110",y1:"80",x2:"110",y2:"152",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#010935"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"#142C70"})]})]})]}),Ledger=({...et})=>jsxRuntimeExports.jsx("svg",{...et,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"black"},children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.2106 16H16V29.4577H19.2182V19.2182L37.2106 19.1011V16ZM37.3568 33.4073V54.6179H50.8146V51.3997H40.575L40.458 33.4073H37.3568ZM16 72.1714H37.2106V69.0703L19.2182 68.9533V58.7137H16V72.1714ZM50.9609 16H72.1714V29.4577H68.9533V19.2182L50.9609 19.1011V16ZM72.1714 72.1714H50.9609V69.0703L68.9533 68.9533V58.7137H72.1714V72.1714Z",fill:"white"})}),Steak=({...et})=>jsxRuntimeExports.jsxs("svg",{...et,width:"600",height:"600",viewBox:"0 0 600 600",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"black"},children:[jsxRuntimeExports.jsx("path",{d:"M470.747 209.191C462.305 192.354 448.646 178.695 431.808 170.253C413.337 161 389.233 161 341.006 161C331.236 161 307.916 161 300 161C292.084 161 268.728 161 258.994 161C210.856 161 186.662 161 168.191 170.253C151.354 178.69 137.7 192.35 129.27 209.191C119.999 227.662 120 251.767 120 299.976C120 348.185 119.999 372.308 129.27 390.778C137.7 407.619 151.354 421.279 168.191 429.716C186.662 438.97 210.784 438.97 258.994 438.97C268.764 438.97 292.084 438.97 300 438.97C307.916 438.97 331.272 438.97 341.006 438.97C389.144 438.97 413.337 438.97 431.808 429.716C448.646 421.274 462.305 407.616 470.747 390.778C480 372.308 480 348.203 480 299.976C480 251.749 480 227.662 470.747 209.191Z",fill:"#FFCEAA"}),jsxRuntimeExports.jsx("path",{d:"M218.557 350.342C216.323 345.957 212.922 342.274 208.729 339.698C204.536 337.121 199.713 335.752 194.791 335.741H166.747C163.876 335.755 161.041 336.37 158.422 337.548C155.804 338.725 153.462 340.439 151.547 342.577C149.632 344.716 148.186 347.232 147.303 349.964C146.42 352.696 146.12 355.582 146.422 358.437C147.385 367.476 148.954 374.34 151.575 379.564C157.629 391.573 167.378 401.323 179.388 407.377C188.195 411.798 201.674 413.26 222.444 413.742C225.415 413.812 228.353 413.109 230.97 411.702C233.587 410.295 235.793 408.232 237.373 405.715C238.953 403.199 239.852 400.315 239.982 397.346C240.113 394.378 239.47 391.427 238.116 388.781L218.557 350.342Z",fill:"#FF3B9A"}),jsxRuntimeExports.jsx("path",{d:"M180.618 312.563C189.852 312.562 198.95 310.335 207.14 306.071C215.33 301.806 222.371 295.63 227.668 288.066L254.856 249.253C259.761 242.25 262.839 234.134 263.81 225.64C264.782 217.146 263.616 208.545 260.419 200.616V200.384C258.913 196.555 256.409 193.2 253.167 190.666C249.925 188.133 246.064 186.514 241.985 185.978C209.732 186.085 190.726 186.887 179.405 192.575C167.37 198.586 157.611 208.339 151.592 220.37C146.725 230.247 145.227 258.007 144.87 280.507C144.797 284.698 145.56 288.862 147.114 292.754C148.668 296.647 150.983 300.191 153.923 303.179C156.863 306.167 160.369 308.539 164.236 310.156C168.103 311.774 172.254 312.604 176.445 312.599L180.618 312.563Z",fill:"#FF3B9A"}),jsxRuntimeExports.jsx("path",{d:"M449.702 220.356C443.655 208.365 433.909 198.639 421.906 192.614C409.89 186.588 389.262 186.053 353.337 186C304.664 186 289.528 242 279.134 256.834L248.556 300.497C243.645 307.51 240.729 315.725 240.12 324.266C239.511 332.806 241.231 341.352 245.098 348.991L267.758 393.813C270.842 399.931 275.578 405.063 281.43 408.627C287.282 412.191 294.016 414.045 300.867 413.978H301.49C309.495 413.978 334.171 413.978 342.283 413.978C385.072 413.978 408.713 413.977 421.906 407.381C433.914 401.331 443.66 391.58 449.702 379.568C456.317 366.374 456.316 342.787 456.316 299.944C456.316 257.101 456.317 233.621 449.702 220.356Z",fill:"#FF3B9A"})]}),Unstoppable=({...et})=>jsxRuntimeExports.jsx("svg",{...et,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"linear-gradient(180deg, #FED812 0%, #FFAF00 100%)"},children:jsxRuntimeExports.jsx("path",{d:"M47.4 43.7163C47.4 45.6251 45.8781 47.1714 44.0001 47.1714C42.1219 47.1714 40.6 45.6251 40.6 43.7163L40.6 -7H27L27 43.7163C27 53.2612 34.6106 61 44.0001 61C53.3882 61 61 53.2612 61 43.7163V-7H47.4V43.7163Z",fill:"#1F2129"})}),ONTO=({...et})=>jsxRuntimeExports.jsx("svg",{...et,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"white"},children:jsxRuntimeExports.jsx("path",{d:"M20 16L28.675 24.677C32.1885 21.8644 36.4154 20.0873 40.8816 19.545C45.348 19.0026 49.8769 19.7164 53.9604 21.6063C58.0438 23.4963 61.5207 26.4876 64.0005 30.2447C66.4804 34.0019 67.8653 38.3763 68 42.8772V43.5854V72L59.3367 63.3231C55.8263 66.1389 51.6014 67.9196 47.1361 68.4655C42.6708 69.0112 38.1419 68.3007 34.0577 66.4135C29.9734 64.5262 26.4956 61.537 24.0144 57.7813C21.5333 54.0255 20.1472 49.6521 20.0115 45.1515V44.4433L20 16ZM25.931 30.3311V44.4146C25.9323 47.7294 26.8335 50.9817 28.5384 53.8236C30.2432 56.6655 32.6875 58.9902 35.6101 60.5497C38.5328 62.1089 41.8238 62.8439 45.1313 62.6764C48.439 62.5087 51.639 61.4445 54.3894 59.5978L54.8611 59.2754L27.0873 31.4884L25.931 30.3311ZM33.6223 28.4022L33.1505 28.7304L60.9186 56.5117L62.069 57.6632V43.5854C62.0683 40.2717 61.1679 37.0204 59.464 34.179C57.7603 31.3377 55.3171 29.0132 52.3957 27.4539C49.4742 25.8946 46.1844 25.1592 42.8777 25.3262C39.5712 25.4933 36.372 26.5565 33.6223 28.4022Z",fill:"#23262F"})}),Slope=({...et})=>jsxRuntimeExports.jsxs("svg",{...et,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"#6C67F1"},children:[jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.6667 24.3696L34.8872 40.1864L24.0001 37.7402L37.3334 24.3696L48.4438 13.3798C49.268 12.5646 50.6667 13.1484 50.6667 14.3077V24.3696ZM37.3339 51.0358L50.6672 37.74V24.3694L35.2001 39.8737L37.3339 51.0358Z",fill:"url(#paint0_linear_2593_6077)"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.3337 64.2947V50.9617L50.667 37.6284L55.7849 45.8435L55.9822 45.6463L64 50.9616L39.5582 75.2343C38.7347 76.0521 37.3336 75.4687 37.3336 74.3082V64.2949L37.3337 64.2947Z",fill:"url(#paint1_linear_2593_6077)"}),jsxRuntimeExports.jsx("path",{d:"M24 37.7405H32.573C35.202 37.7405 37.3333 39.8718 37.3333 42.5009V51.0359H28.7602C26.1313 51.0359 24 48.9046 24 46.2757V37.7405Z",fill:"#F1F0FF"}),jsxRuntimeExports.jsx("path",{d:"M50.6667 37.7405H59.2398C61.8688 37.7405 64 39.8718 64 42.5009V51.0359H55.4271C52.798 51.0359 50.6667 48.9046 50.6667 46.2757V37.7405Z",fill:"#F1F0FF"}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_2593_6077",x1:"37.3336",y1:"13",x2:"37.3336",y2:"51.0358",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#A8ADFF"}),jsxRuntimeExports.jsx("stop",{offset:"0.648556",stopColor:"white"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint1_linear_2593_6077",x1:"50.6668",y1:"37.6284",x2:"50.6668",y2:"75.616",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{offset:"0.260784",stopColor:"#B6BAFF"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"#E4E2FF"})]})]})]}),Safe=({...et})=>jsxRuntimeExports.jsxs("svg",{...et,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"var(--ck-brand-safe)"},children:[jsxRuntimeExports.jsx("path",{d:"M68.7186 44H62.6472C60.8339 44 59.3646 45.4686 59.3646 47.281V56.0888C59.3646 57.9012 57.8952 59.3697 56.0819 59.3697H31.9278C30.1145 59.3697 28.6452 60.8383 28.6452 62.6507V68.719C28.6452 70.5314 30.1145 72 31.9278 72H57.48C59.2933 72 60.7417 70.5314 60.7417 68.719V63.8504C60.7417 62.038 62.2111 60.7524 64.0244 60.7524H68.7174C70.5307 60.7524 72 59.2838 72 57.4714V47.2429C72 45.4305 70.5307 44 68.7174 44H68.7186Z",fill:"#121312"}),jsxRuntimeExports.jsx("path",{d:"M28.6406 31.9308C28.6406 30.1162 30.1104 28.6458 31.9243 28.6458H56.0712C57.8851 28.6458 59.3548 27.1754 59.3548 25.3608V19.285C59.3548 17.4704 57.8851 16 56.0712 16H30.5245C28.7107 16 27.2409 17.4704 27.2409 19.285V23.9666C27.2409 25.7813 25.7711 27.2516 23.9572 27.2516H19.2837C17.4698 27.2516 16 28.722 16 30.5366V40.7888C16 42.6034 17.4759 44 19.2898 44H25.3631C27.177 44 28.6468 42.5296 28.6468 40.715L28.6406 31.932V31.9308Z",fill:"#121312"}),jsxRuntimeExports.jsx("path",{d:"M41.1004 37.6774H46.8995C48.7894 37.6774 50.3226 39.2117 50.3226 41.1004V46.8995C50.3226 48.7894 48.7882 50.3225 46.8995 50.3225H41.1004C39.2106 50.3225 37.6774 48.7882 37.6774 46.8995V41.1004C37.6774 39.2105 39.2118 37.6774 41.1004 37.6774V37.6774Z",fill:"#121312"})]}),Frontier=({...et})=>jsxRuntimeExports.jsx("svg",{...et,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"#CC703C"},children:jsxRuntimeExports.jsx("path",{d:"M63.6429 20L63.3645 20.7254L62.4521 23.0445L61.8461 24.5395C57.2427 35.7491 53.6629 41.0688 49.8557 41.0688C48.8938 41.0936 47.9371 40.9212 47.0465 40.5625C46.156 40.2038 45.3512 39.6667 44.6834 38.9852L44.1979 38.5518C42.9885 37.4538 42.4799 37.1831 41.3154 37.1832C40.7094 37.1832 39.6238 37.9435 38.2521 39.7303C36.4147 42.2912 34.8522 45.0327 33.59 47.9106L33.4353 48.2482L49.7645 48.2483L47.7312 52.4075H32.4845L32.4843 69.44L28 69.44L28.0001 20L63.6429 20ZM57.2889 24.1518L32.4843 24.1518L32.4843 40.6262C35.4564 35.5545 38.2816 33.0086 41.32 33.0086C42.3421 32.9765 43.3595 33.1534 44.3082 33.5284C45.2569 33.9034 46.1159 34.468 46.8311 35.1865L47.3323 35.6335C48.4611 36.6585 48.8956 36.8941 49.8604 36.8941C50.9211 36.8957 53.7433 32.4855 57.2889 24.1518Z",fill:"white"})}),Zerion=({...et})=>jsxRuntimeExports.jsxs("svg",{...et,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"linear-gradient(120.22deg, #2962EF 0%, #255CE5 100%)"},children:[jsxRuntimeExports.jsx("path",{d:"M19.0864 22C17.5783 22 16.9973 23.8648 18.2628 24.6438L49.9199 43.732C50.709 44.2178 51.7614 44.0258 52.3048 43.2969L66.2236 25.024C67.17 23.7545 66.2138 22 64.5757 22H19.0864Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M68.8425 66C70.3503 66 70.9466 64.1252 69.6814 63.3464L38.015 44.2605C37.2259 43.7748 36.1989 43.991 35.6558 44.7198L21.7099 62.9891C20.7639 64.2582 21.7499 66 23.3877 66H68.8425Z",fill:"white"})]}),Phantom=({background:et=!1,...o})=>jsxRuntimeExports.jsx("svg",{...o,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:et?{background:"#AB9FF2"}:void 0,children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.7425 57.0705C34.1942 62.3362 28.2483 69 20.3366 69C16.5965 69 13.0001 67.5093 13 61.0322C12.9997 44.5362 36.2555 19.0003 57.8334 19C70.1084 18.9998 75 27.2474 75 36.6136C75 48.6357 66.9442 62.3824 58.9368 62.3824C56.3955 62.3824 55.1487 61.031 55.1487 58.888C55.1487 58.3288 55.2442 57.7228 55.4365 57.0705C52.7029 61.5902 47.4285 65.7849 42.4896 65.7849C38.8933 65.7849 37.0713 63.5944 37.0713 60.5187C37.0713 59.4003 37.311 58.2357 37.7425 57.0705ZM53.7586 31.6834C51.8054 31.6868 50.4738 33.2938 50.478 35.5864C50.4822 37.879 51.8198 39.5273 53.7729 39.5241C55.6789 39.5208 57.0099 37.8679 57.0058 35.5752C57.0016 33.2827 55.6646 31.6802 53.7586 31.6834ZM64.1193 31.6725C62.1661 31.6759 60.8345 33.2829 60.8387 35.5755C60.8429 37.868 62.1798 39.5164 64.1336 39.5131C66.0396 39.5099 67.3706 37.8569 67.3664 35.5643C67.3622 33.2718 66.0253 31.6693 64.1193 31.6725Z",fill:et?"#ffffff":"currentColor"})}),PlaceHolder=()=>jsxRuntimeExports.jsx("div",{style:{width:80,height:80,background:"#555"}}),Dawn=({...et})=>jsxRuntimeExports.jsxs("svg",{...et,width:"88px",height:"88px",viewBox:"0 0 192 192",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"linearGradient-1",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#151515",offset:"0%"}),jsxRuntimeExports.jsx("stop",{stopColor:"#232323",offset:"100%"})]}),jsxRuntimeExports.jsx("rect",{rx:"27%",id:"path-2",x:"0",y:"0",width:"192",height:"192"}),jsxRuntimeExports.jsxs("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"99.7051532%",id:"linearGradient-3",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#F3DC83",offset:"0%"}),jsxRuntimeExports.jsx("stop",{stopColor:"#F9EEC8",offset:"100%"})]})]}),jsxRuntimeExports.jsx("g",{id:"Icons---Pixel-Fitted",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:jsxRuntimeExports.jsxs("g",{id:"Group",children:[jsxRuntimeExports.jsxs("g",{id:"Rectangle",children:[jsxRuntimeExports.jsx("use",{fill:"#232323",xlinkHref:"#path-2"}),jsxRuntimeExports.jsx("use",{fill:"url(#linearGradient-1)",xlinkHref:"#path-2"})]}),jsxRuntimeExports.jsx("path",{d:"M123.748399,157.001808 C115.293464,160.853955 105.89735,163 96,163 C86.1026503,163 76.7065363,160.853955 68.2516012,157.001808 Z M146.526595,140.002206 C144.677242,142.123986 142.696426,144.128189 140.59684,146.002121 L51.4031598,146.002121 C49.3035743,144.128189 47.3227581,142.123986 45.4734054,140.002206 Z M157.337411,122.999613 C155.955969,126.133404 154.34141,129.141319 152.515704,132.001388 L39.484296,132.001388 C37.6585895,129.141319 36.0440306,126.133404 34.662589,122.999613 Z M96,29 C133.003078,29 163,58.9969218 163,96 C163,103.706309 161.69895,111.108742 159.304524,117.999626 L32.6954763,117.999626 C30.3010496,111.108742 29,103.706309 29,96 C29,58.9969218 58.9969218,29 96,29 Z",id:"Combined-Shape",fill:"url(#linearGradient-3)"})]})})]}),InfinityWallet=({...et})=>jsxRuntimeExports.jsxs("svg",{...et,version:"1.1",id:"e551690a-81c0-4880-9b93-334a37ce6796",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 1025 1025",children:[jsxRuntimeExports.jsx("style",{type:"text/css",children:`
.infinityWallet-st0{fill:url(#ID_InfinityWallet_1);}
.infinityWallet-st1{fill:url(#ID_InfinityWallet_2);}
.infinityWallet-st2{opacity:0.49;fill:url(#ID_InfinityWallet_3);enable-background:new;}
.infinityWallet-st3{opacity:0.49;fill:url(#ID_InfinityWallet_4);enable-background:new;}
.infinityWallet-st4{opacity:0.49;fill:url(#ID_InfinityWallet_5);enable-background:new;}
.infinityWallet-st5{fill:url(#ID_InfinityWallet_6);}
.infinityWallet-st6{opacity:0.49;fill:url(#ID_InfinityWallet_7);enable-background:new;}
.infinityWallet-st7{opacity:0.49;fill:url(#ID_InfinityWallet_8);enable-background:new;}
.infinityWallet-st8{opacity:0.49;fill:url(#ID_InfinityWallet_9);enable-background:new;}
`}),jsxRuntimeExports.jsxs("linearGradient",{id:"ID_InfinityWallet_1",gradientUnits:"userSpaceOnUse",x1:"512.5",y1:"1056.1801",x2:"512.5",y2:"317.03",gradientTransform:"matrix(1 0 0 -1 0 1260)",children:[jsxRuntimeExports.jsx("stop",{offset:"0",style:{stopColor:"#1D2643"}}),jsxRuntimeExports.jsx("stop",{offset:"1",style:{stopColor:"#12142C"}})]}),jsxRuntimeExports.jsx("path",{className:"infinityWallet-st0",d:`M130,0H895c71.8,0,130,58.2,130,130V895c0,71.8-58.2,130-130,130H130C58.2,1025,0,966.8,0,895V130
C0,58.2,58.2,0,130,0z`}),jsxRuntimeExports.jsxs("g",{children:[jsxRuntimeExports.jsxs("g",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"ID_InfinityWallet_2",gradientUnits:"userSpaceOnUse",x1:"326.0557",y1:"-1280.3162",x2:"326.0557",y2:"-296.3967",gradientTransform:"matrix(1 0 0 1 0 1474)",children:[jsxRuntimeExports.jsx("stop",{offset:"1.000000e-02",style:{stopColor:"#00BFE1"}}),jsxRuntimeExports.jsx("stop",{offset:"0.97",style:{stopColor:"#2738AB"}})]}),jsxRuntimeExports.jsx("path",{className:"infinityWallet-st1",d:`M550.9,380.8c-0.7-2-2.4-3.4-4.4-3.9c-2.3-0.6-4.7,0-6.4,1.7l-13.4,13.4l-2.2,2.2L418.3,288.5
c-40.2-40-105.2-40-145.4,0L121.7,439.9c-40,40.5-40,105.6,0,146.1l151.4,150.5c40.2,40,105.1,40,145.3,0l34.4-34.4
c4.5-4.5,9.9-10.7,12.9-18.7c4.7-13.1,2.8-27.7-5.2-39.1c-1.5-2.2-3.2-4.2-5.1-6c-16.9-16.5-43.9-16.3-60.7,0.3l-37.2,37.1
c-2.2,2.3-5,3.8-8.1,4.5c-2.9,0.7-6,0.5-8.8-0.6c-2.9-1-5.5-2.7-7.7-5L182.6,524.2c-2.3-2.3-3.9-5.2-4.6-8.4
c-0.8-4-0.1-8.2,2.1-11.8l0.8-0.9L334,350.3c2.4-2.4,5.4-4,8.7-4.6c1-0.2,2.1-0.3,3.1-0.3c4.4-0.1,8.7,1.7,11.7,5l105.8,105.2
l-5.3,5.3l-10.4,10.6c-1.7,1.7-2.3,4.1-1.7,6.4c0.5,2,2,3.7,3.9,4.4l95.7,11.7c8.2-0.1,14.8-6.7,15-15L550.9,380.8z`}),jsxRuntimeExports.jsxs("linearGradient",{id:"ID_InfinityWallet_3",gradientUnits:"userSpaceOnUse",x1:"137.7126",y1:"-935.1906",x2:"201.098",y2:"-882.1746",gradientTransform:"matrix(1 0 0 1 -0.94 1473.3899)",children:[jsxRuntimeExports.jsx("stop",{offset:"3.000000e-02",style:{stopColor:"#1B1464"}}),jsxRuntimeExports.jsx("stop",{offset:"1",style:{stopColor:"#1B1464",stopOpacity:0}})]}),jsxRuntimeExports.jsx("path",{className:"infinityWallet-st2",d:"M181.4,522.9c-4.3-4.9-5.1-13.3-1.3-19c0,0-49.7,54.3-25.8,114.4l31.5,31.3l45.8-76.2L181.4,522.9z"}),jsxRuntimeExports.jsxs("linearGradient",{id:"ID_InfinityWallet_4",gradientUnits:"userSpaceOnUse",x1:"4132.3252",y1:"1674.2513",x2:"4102.1333",y2:"1717.0756",gradientTransform:"matrix(-1 0 0 -1 4515 2382.0898)",children:[jsxRuntimeExports.jsx("stop",{offset:"3.000000e-02",style:{stopColor:"#1B1464"}}),jsxRuntimeExports.jsx("stop",{offset:"1",style:{stopColor:"#1B1464",stopOpacity:0}})]}),jsxRuntimeExports.jsx("path",{className:"infinityWallet-st3",d:`M336.4,677.7c56.1,51.6,117.9,22.9,117.9,22.9s8.1-7.5,11.4-17.4c-8.3-4-68.6-47.2-68.6-47.2l-35.6,35.6
C348.6,687.1,336.4,677.7,336.4,677.7z`}),jsxRuntimeExports.jsxs("linearGradient",{id:"ID_InfinityWallet_5",gradientUnits:"userSpaceOnUse",x1:"4217.4238",y1:"2067.1885",x2:"4240.0796",y2:"2011.1337",gradientTransform:"matrix(-1 0 0 -1 4515 2382.0898)",children:[jsxRuntimeExports.jsx("stop",{offset:"3.000000e-02",style:{stopColor:"#1B1464"}}),jsxRuntimeExports.jsx("stop",{offset:"1",style:{stopColor:"#1B1464",stopOpacity:0}})]}),jsxRuntimeExports.jsx("path",{className:"infinityWallet-st4",d:"M299.4,385c0,0,35.9-36.2,36-36c0,0,9.6-7.7,19.7-0.7c0,0-59.7-49.2-123.6-18.3l-18.6,18.7L299.4,385z"})]}),jsxRuntimeExports.jsxs("g",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"ID_InfinityWallet_6",gradientUnits:"userSpaceOnUse",x1:"698.9443",y1:"-1280.3162",x2:"698.9443",y2:"-296.3967",gradientTransform:"matrix(1 0 0 1 0 1474)",children:[jsxRuntimeExports.jsx("stop",{offset:"1.000000e-02",style:{stopColor:"#00BFE1"}}),jsxRuntimeExports.jsx("stop",{offset:"0.97",style:{stopColor:"#2738AB"}})]}),jsxRuntimeExports.jsx("path",{className:"infinityWallet-st5",d:`M474.1,644.3c0.7,2,2.4,3.4,4.4,3.9c2.3,0.6,4.7,0,6.4-1.7l13.4-13.4l2.2-2.2l106.2,105.6
c40.2,40,105.2,40,145.4,0l151.2-151.4c40-40.5,40-105.6,0-146.1L751.9,288.5c-40.2-40-105.1-40-145.3,0l-34.4,34.4
c-4.5,4.5-9.9,10.7-12.9,18.7c-4.7,13.1-2.8,27.7,5.2,39.1c1.5,2.2,3.2,4.2,5.1,6c16.9,16.5,43.9,16.3,60.7-0.3l37.2-37.1
c2.2-2.3,5-3.8,8.1-4.5c2.9-0.7,6-0.5,8.8,0.6c2.9,1,5.5,2.7,7.7,5l150.3,150.3c2.3,2.3,3.9,5.2,4.6,8.4c0.8,4,0.1,8.2-2.1,11.8
l-0.8,0.9L691,674.5c-2.4,2.4-5.4,4-8.7,4.6c-1,0.2-2.1,0.3-3.1,0.3c-4.4,0.1-8.7-1.7-11.7-5L561.6,569.7l5.3-5.3l10.4-10.6
c1.7-1.7,2.3-4.1,1.7-6.4c-0.5-2-2-3.7-3.9-4.4l-95.6-11.7c-8.2,0.1-14.8,6.7-15,15L474.1,644.3z`}),jsxRuntimeExports.jsxs("linearGradient",{id:"ID_InfinityWallet_7",gradientUnits:"userSpaceOnUse",x1:"3824.9182",y1:"1469.7789",x2:"3888.3037",y2:"1522.7949",gradientTransform:"matrix(-1 0 0 -1 4713.1299 1956.6599)",children:[jsxRuntimeExports.jsx("stop",{offset:"3.000000e-02",style:{stopColor:"#1B1464"}}),jsxRuntimeExports.jsx("stop",{offset:"1",style:{stopColor:"#1B1464",stopOpacity:0}})]}),jsxRuntimeExports.jsx("path",{className:"infinityWallet-st6",d:"M843.6,502.2c4.3,4.9,5.1,13.3,1.3,19c0,0,49.7-54.3,25.8-114.4l-31.5-31.3l-45.8,76.2L843.6,502.2z"}),jsxRuntimeExports.jsxs("linearGradient",{id:"ID_InfinityWallet_8",gradientUnits:"userSpaceOnUse",x1:"445.1279",y1:"-730.6945",x2:"414.9359",y2:"-687.8702",gradientTransform:"matrix(1 0 0 1 197.19 1047.96)",children:[jsxRuntimeExports.jsx("stop",{offset:"3.000000e-02",style:{stopColor:"#1B1464"}}),jsxRuntimeExports.jsx("stop",{offset:"1",style:{stopColor:"#1B1464",stopOpacity:0}})]}),jsxRuntimeExports.jsx("path",{className:"infinityWallet-st7",d:`M688.6,347.4c-56.1-51.6-117.9-22.9-117.9-22.9s-8.1,7.5-11.4,17.4c8.3,4,68.6,47.2,68.6,47.2l35.6-35.6
C676.4,338,688.6,347.4,688.6,347.4z`}),jsxRuntimeExports.jsxs("linearGradient",{id:"ID_InfinityWallet_9",gradientUnits:"userSpaceOnUse",x1:"530.1512",y1:"-337.7953",x2:"552.8069",y2:"-393.8502",gradientTransform:"matrix(1 0 0 1 197.19 1047.96)",children:[jsxRuntimeExports.jsx("stop",{offset:"3.000000e-02",style:{stopColor:"#1B1464"}}),jsxRuntimeExports.jsx("stop",{offset:"1",style:{stopColor:"#1B1464",stopOpacity:0}})]}),jsxRuntimeExports.jsx("path",{className:"infinityWallet-st8",d:"M725.5,640.1c0,0-35.9,36.2-36,36c0,0-9.6,7.7-19.7,0.7c0,0,59.7,49.2,123.6,18.3l18.6-18.7L725.5,640.1z"})]})]})]}),Rabby=({...et})=>jsxRuntimeExports.jsxs("svg",{...et,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"#8697FF"},children:[jsxRuntimeExports.jsx("path",{d:"M76.2062 48.0657C78.7621 42.356 66.1267 26.404 54.0555 19.7581C46.4467 14.6095 38.5183 15.3169 36.9125 17.5775C33.3886 22.5385 48.5814 26.7423 58.742 31.6478C56.5579 32.5964 54.4996 34.2987 53.2893 36.4758C49.5013 32.3404 41.1872 28.7791 31.4315 31.6478C24.8574 33.5809 19.3937 38.1382 17.2821 45.0216C16.7689 44.7936 16.2009 44.6669 15.6032 44.6669C13.3176 44.6669 11.4648 46.5197 11.4648 48.8052C11.4648 51.0908 13.3176 52.9435 15.6032 52.9435C16.0268 52.9435 17.3514 52.6594 17.3514 52.6594L38.5183 52.8128C30.0532 66.2418 23.3634 68.2049 23.3634 70.5314C23.3634 72.8579 29.7643 72.2274 32.1678 71.3602C43.6732 67.2088 56.0306 54.2706 58.1511 50.5462C67.056 51.6572 74.5397 51.7886 76.2062 48.0657Z",fill:"url(#paint0_linear_60607_36577)"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M58.65 31.6053C58.682 31.6193 58.7139 31.6332 58.7458 31.6471C59.2168 31.4616 59.1406 30.766 59.0113 30.2198C58.714 28.9643 53.5856 23.9001 48.7696 21.6318C42.1984 18.5367 37.3618 18.7007 36.6582 20.1307C37.9975 22.8695 44.1927 25.441 50.663 28.1266C53.3909 29.2589 56.1676 30.4114 58.65 31.6053Z",fill:"url(#paint1_linear_60607_36577)"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.4154 59.2247C49.0895 58.7182 47.592 58.2536 45.8898 57.8319C47.707 54.5801 48.0884 49.7663 46.3721 46.7226C43.9635 42.4512 40.9399 40.1777 33.9139 40.1777C30.0495 40.1777 19.6451 41.4794 19.4603 50.1648C19.441 51.0763 19.4599 51.9118 19.5259 52.68L38.5175 52.8176C35.9568 56.8798 33.5586 59.8928 31.4589 62.1841C33.9831 62.8309 36.0657 63.3738 37.9775 63.8722C39.7885 64.3443 41.4462 64.7764 43.1809 65.2191C45.8007 63.3102 48.2635 61.2288 50.4154 59.2247Z",fill:"url(#paint2_linear_60607_36577)"}),jsxRuntimeExports.jsx("path",{d:"M17.0296 51.7821C17.8058 58.38 21.5555 60.9657 29.2177 61.7309C36.8799 62.4961 41.2751 61.9828 47.1265 62.5151C52.0136 62.9598 56.3772 65.4502 57.996 64.5895C59.4529 63.815 58.6378 61.0167 56.6884 59.2214C54.1614 56.8943 50.6641 55.2763 44.5104 54.7021C45.7368 51.3443 45.3931 46.6362 43.4885 44.0748C40.7345 40.3711 35.6513 38.6967 29.2177 39.4282C22.4962 40.1926 16.0556 43.5018 17.0296 51.7821Z",fill:"url(#paint3_linear_60607_36577)"}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_60607_36577",x1:"30.666",y1:"43.0094",x2:"75.6558",y2:"55.7677",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"white"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"white"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint1_linear_60607_36577",x1:"68.0842",y1:"42.1521",x2:"35.6221",y2:"9.60636",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#7258DC"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"#797DEA",stopOpacity:"0"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint2_linear_60607_36577",x1:"51.3184",y1:"60.3591",x2:"20.1383",y2:"42.4347",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#7461EA"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"#BFC2FF",stopOpacity:"0"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint3_linear_60607_36577",x1:"33.3531",y1:"42.6732",x2:"54.4308",y2:"69.4547",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"white"}),jsxRuntimeExports.jsx("stop",{offset:"0.983895",stopColor:"#D5CEFF"})]})]})]}),TokenPocket=({...et})=>jsxRuntimeExports.jsxs("svg",{...et,width:"88px",height:"88px",viewBox:"0 0 88 88",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsxs("linearGradient",{x1:"107.511425%",y1:"50.0147427%",x2:"0.0459570557%",y2:"50.0147427%",id:"linearGradient-1",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#FFFFFF",offset:"0%"}),jsxRuntimeExports.jsx("stop",{stopColor:"#FFFFFF",stopOpacity:"0.3233",offset:"96.67%"}),jsxRuntimeExports.jsx("stop",{stopColor:"#FFFFFF",stopOpacity:"0.3",offset:"100%"})]})}),jsxRuntimeExports.jsx("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:jsxRuntimeExports.jsxs("g",{id:"tokenpocket",fillRule:"nonzero",children:[jsxRuntimeExports.jsx("polygon",{fill:"#2980FE",points:"87.9604864 0 0 0 0 88 87.9604864 88"}),jsxRuntimeExports.jsxs("g",{transform:"translate(16.052385, 23.804688)",children:[jsxRuntimeExports.jsx("path",{d:"M19.6653508,13.8911953 L19.6784508,13.8911953 C19.6653508,13.8236484 19.6653508,13.7448437 19.6653508,13.6772969 L19.6653508,13.8911953 Z",fill:"#29AEFF"}),jsxRuntimeExports.jsx("path",{d:"M41.1271993,16.0301797 L29.2440711,16.0301797 L29.2440711,38.4205938 C29.2440711,39.4787422 30.0635659,40.3343359 31.0771712,40.3343359 L39.2940168,40.3343359 C40.3077044,40.3343359 41.1271993,39.4787422 41.1271993,38.4205938 L41.1271993,16.0301797 Z",fill:"#FFFFFF"}),jsxRuntimeExports.jsx("path",{d:"M23.5075248,0 L23.1085201,0 L1.83318241,0 C0.819494855,0 0,0.855507812 0,1.91374219 L0,9.68111719 C0,10.7393516 0.819494855,11.5948594 1.83318241,11.5948594 L6.82580355,11.5948594 L8.80996071,11.5948594 L8.80996071,13.8912813 L8.80996071,38.4768828 C8.80996071,39.5351172 9.62945557,40.390625 10.6430608,40.390625 L18.4502002,40.390625 C19.4638054,40.390625 20.2833003,39.5351172 20.2833003,38.4768828 L20.2833003,13.8912813 L20.2833003,13.6774688 L20.2833003,11.5948594 L22.2674574,11.5948594 L23.0761684,11.5948594 L23.4751731,11.5948594 C26.5376389,11.5948594 29.0285575,8.99447656 29.0285575,5.79742969 C29.0609093,2.60038281 26.5699906,0 23.5075248,0 Z",fill:"#FFFFFF"}),jsxRuntimeExports.jsx("path",{d:"M41.1381478,16.0301797 L41.1381478,31.6550781 C41.5479364,31.7563984 41.9684266,31.8352031 42.399783,31.90275 C43.0036819,31.9928125 43.6290664,32.0491016 44.2545332,32.0603594 C44.2868849,32.0603594 44.3192367,32.0603594 44.3623723,32.0603594 L44.3623723,19.6324219 C42.5615416,19.5085859 41.1381478,17.9438359 41.1381478,16.0301797 Z",fill:"url(#linearGradient-1)"}),jsxRuntimeExports.jsx("path",{d:"M44.5993714,0 C36.1237942,0 29.2440711,7.18205469 29.2440711,16.0301797 C29.2440711,23.6400312 34.3229635,30.0115234 41.1379832,31.6550781 L41.1379832,16.0301797 C41.1379832,14.0376328 42.6907839,12.4165937 44.5993714,12.4165937 C46.5080412,12.4165937 48.0608419,14.0376328 48.0608419,16.0301797 C48.0608419,17.7075078 46.9717493,19.1146484 45.483652,19.5198437 C45.2032703,19.5986484 44.9013209,19.6436797 44.5993714,19.6436797 L44.5993714,32.0603594 C44.9013209,32.0603594 45.1924864,32.0491016 45.483652,32.0378438 C53.5495229,31.5537578 59.9547666,24.5743438 59.9547666,16.0301797 C59.9655379,7.18205469 53.0858148,0 44.5993714,0 Z",fill:"#FFFFFF"}),jsxRuntimeExports.jsx("path",{d:"M44.5992891,32.0603594 L44.5992891,19.6436797 C44.5131001,19.6436797 44.4376127,19.6436797 44.3513414,19.6324219 L44.3513414,32.0603594 C44.4376127,32.0603594 44.523884,32.0603594 44.5992891,32.0603594 Z",fill:"#FFFFFF"})]})]})})]}),Talisman=({...et})=>jsxRuntimeExports.jsxs("svg",{...et,width:"82",height:"82",viewBox:"0 0 82 82",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("rect",{width:"82",height:"82",rx:"12",fill:"#D5FF5C"}),jsxRuntimeExports.jsx("path",{d:"M35.04 55C35.04 58.2905 37.6887 60.9623 40.9703 60.9996C44.2519 60.9623 46.9006 58.2905 46.9006 55C46.9006 51.7096 44.2519 49.0377 40.9703 49.0004C37.6887 49.0377 35.04 51.7096 35.04 55Z",fill:"#FD4848"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22.8544 44.6623C22.2462 45.9868 20.4553 46.4546 19.4248 45.4241L17.5356 43.5349C15.583 41.5823 12.4171 41.5823 10.4645 43.5349C8.51184 45.4875 8.51184 48.6534 10.4645 50.606L25.7391 65.8807C29.3942 70.2176 34.8595 72.9788 40.9703 72.9994C47.0811 72.9788 52.5464 70.2176 56.2014 65.8807L71.4761 50.606C73.4287 48.6534 73.4287 45.4875 71.4761 43.5349C69.5234 41.5823 66.3576 41.5823 64.4049 43.5349L62.5158 45.4241C61.4852 46.4546 59.6943 45.9868 59.0861 44.6623C58.9663 44.4013 58.901 44.1213 58.901 43.8341L58.901 20.9995C58.901 18.2381 56.6624 15.9995 53.901 15.9995C51.1396 15.9995 48.901 18.2381 48.901 20.9995L48.901 32.5568C48.901 33.5506 47.8829 34.2252 46.9353 33.9257C46.3356 33.7361 45.9023 33.1901 45.9023 32.5611L45.9023 13.9996C45.9023 11.2608 43.7004 9.03637 40.9703 9C38.2402 9.03637 36.0382 11.2608 36.0382 13.9996L36.0382 32.5611C36.0382 33.1901 35.605 33.7361 35.0052 33.9257C34.0576 34.2252 33.0395 33.5506 33.0395 32.5568L33.0396 20.9995C33.0396 18.2381 30.801 15.9995 28.0395 15.9995C25.2781 15.9995 23.0395 18.2381 23.0395 20.9995L23.0395 43.8341C23.0395 44.1213 22.9743 44.4013 22.8544 44.6623ZM40.9703 44.9999C32.1659 45.0525 25.0403 54.9997 25.0403 54.9997C25.0403 54.9997 32.1659 64.9469 40.9703 64.9995C49.7746 64.9469 56.9002 54.9997 56.9002 54.9997C56.9002 54.9997 49.7746 45.0525 40.9703 44.9999Z",fill:"#FD4848"})]}),OtherWallets=({...et})=>{const o={position:"relative",display:"flex",flexDirection:"column",gap:2},tt={position:"relative",display:"flex",gap:2},rt={width:"50%",overflow:"hidden",borderRadius:"27.5%"};return jsxRuntimeExports.jsxs("div",{style:o,...et,children:[jsxRuntimeExports.jsxs("div",{style:tt,children:[jsxRuntimeExports.jsx("div",{style:rt,children:jsxRuntimeExports.jsx(WalletConnect,{background:!0})}),jsxRuntimeExports.jsx("div",{style:rt,children:isZerion()?jsxRuntimeExports.jsx(Phantom,{}):jsxRuntimeExports.jsx(Zerion,{})})]}),jsxRuntimeExports.jsxs("div",{style:tt,children:[jsxRuntimeExports.jsx("div",{style:rt,children:isFamily()?jsxRuntimeExports.jsx(ImToken,{}):jsxRuntimeExports.jsx(Family,{})}),jsxRuntimeExports.jsx("div",{style:rt,children:isRainbow()?jsxRuntimeExports.jsx(Trust,{}):jsxRuntimeExports.jsx(Rainbow,{})})]})]})},Fordefi=({...et})=>jsxRuntimeExports.jsxs("svg",{...et,width:"88",height:"88",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsxs("g",{clipPath:"url(#clip0_14298_75627)",children:[jsxRuntimeExports.jsx("path",{d:"M43.5075 62.5508H6V73.5954C6 79.2046 10.5379 83.7515 16.1357 83.7515H32.9997L43.5075 62.5508Z",fill:"#7994FF"}),jsxRuntimeExports.jsx("path",{d:"M6.00098 39.1016H76.2075L68.0567 55.4841H6.00098V39.1016Z",fill:"#486DFF"}),jsxRuntimeExports.jsx("path",{d:"M30.6398 12H6.09766V32.0282H89.8447V12H65.3025V26.9577H60.2423V12H35.7001V26.9577H30.6398V12Z",fill:"#5CD1FA"})]}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"clip0_14298_75627",children:jsxRuntimeExports.jsx("rect",{width:"84",height:"72",fill:"white",transform:"translate(6 12)"})})})]});var Logos={Mock,Injected,OtherWallets,WalletConnect,MetaMask,Coinbase,Family,Trust,Argent,ImToken,Rainbow,Crypto,Ledger,Brave:Brave$1,Steak,Unstoppable,ONTO,Slope,Safe,Frontier,Zerion,Phantom,PlaceHolder,Frame,Dawn,InfinityWallet,Rabby,Fordefi,TokenPocket,Talisman};const truncateRegex=/^(0x[a-zA-Z0-9]{4})[a-zA-Z0-9]+([a-zA-Z0-9]{4})$/,truncateEthAddress=(et,o="••••")=>{if(!et)return"";const tt=et.match(truncateRegex);return tt?`${tt[1]}${o}${tt[2]}`:et},truncateENSAddress=(et,o)=>et.length>o?et.replace(".eth","").slice(0,o)+"...":et,nFormatter=(et,o=2)=>{if(et<1e4)return et.toFixed(2);const tt=[{value:1,symbol:""},{value:1e3,symbol:"k"},{value:1e6,symbol:"m"},{value:1e9,symbol:"g"},{value:1e12,symbol:"t"},{value:1e15,symbol:"p"},{value:1e18,symbol:"e"}],rt=/\.0+$|(\.[0-9]*[1-9])0+$/;var nt=tt.slice().reverse().find(function(ot){return et>=ot.value});return nt?(et/nt.value).toFixed(o).replace(rt,"$1")+nt.symbol:"0"},detectBrowser=()=>{var et;const o=detect();return(et=o==null?void 0:o.name)!==null&&et!==void 0?et:""},detectOS=()=>{var et;const o=detect();return(et=o==null?void 0:o.os)!==null&&et!==void 0?et:""},isIOS=()=>detectOS().toLowerCase().includes("ios"),isAndroid=()=>detectOS().toLowerCase().includes("android"),isMobile=()=>isAndroid()||isIOS();function flattenChildren(et){return React.Children.toArray(et).reduce((tt,rt)=>rt.type===React.Fragment?tt.concat(flattenChildren(rt.props.children)):(tt.push(rt),tt),[])}const isWalletConnectConnector=et=>et==="walletConnect",isCoinbaseWalletConnector=et=>et==="coinbaseWalletSDK",isSafeConnector=et=>et==="safe",isInjectedConnector=et=>et==="injected",walletConfigs={mock:{icon:jsxRuntimeExports.jsx(Logos.Mock,{})},argent:{name:"Argent",icon:jsxRuntimeExports.jsx(Logos.Argent,{}),downloadUrls:{download:"https://connect.family.co/v0/download/argent",android:"https://play.google.com/store/apps/details?id=im.argent.contractwalletclient",ios:"https://apps.apple.com/app/argent/id1358741926"},getWalletConnectDeeplink:et=>isAndroid()?et:`https://argent.link/app/wc?uri=${encodeURIComponent(et)}`},"coinbaseWallet, coinbaseWalletSDK":{name:"Coinbase Wallet",shortName:"Coinbase",icon:jsxRuntimeExports.jsx(Logos.Coinbase,{background:!0}),iconShape:"squircle",downloadUrls:{download:"https://connect.family.co/v0/download/coinbasewallet",website:"https://www.coinbase.com/wallet/getting-started-extension",android:"https://play.google.com/store/apps/details?id=org.toshi",ios:"https://apps.apple.com/app/coinbase-wallet-store-crypto/id1278383455",chrome:"https://chrome.google.com/webstore/detail/coinbase-wallet-extension/hnfanknocfeofbddgcijnmhnfnkdnaad"},getWalletConnectDeeplink:et=>`https://go.cb-w.com/wc?uri=${encodeURIComponent(et)}`},"com.coinbase.wallet":{name:"Coinbase Wallet",shortName:"Coinbase",icon:jsxRuntimeExports.jsx(Logos.Coinbase,{background:!0}),iconShape:"circle",downloadUrls:{download:"https://connect.family.co/v0/download/coinbasewallet",website:"https://www.coinbase.com/wallet/getting-started-extension",android:"https://play.google.com/store/apps/details?id=org.toshi",ios:"https://apps.apple.com/app/coinbase-wallet-store-crypto/id1278383455",chrome:"https://chrome.google.com/webstore/detail/coinbase-wallet-extension/hnfanknocfeofbddgcijnmhnfnkdnaad"},getWalletConnectDeeplink:et=>`https://go.cb-w.com/wc?uri=${encodeURIComponent(et)}`},"com.crypto.wallet":{name:"Crypto.com",shortName:"Crypto"},dawn:{name:"Dawn Wallet",shortName:"Dawn",downloadUrls:{download:"https://apps.apple.com/us/app/dawn-ethereum-wallet/id1673143782",website:"https://www.dawnwallet.xyz/",ios:"https://apps.apple.com/us/app/dawn-ethereum-wallet/id1673143782"}},"co.family.wallet":{name:"Family",shortName:"Family",icon:jsxRuntimeExports.jsx(Logos.Family,{}),iconShape:"squircle",downloadUrls:{download:"https://connect.family.co/v0/download/family",website:"https://family.co",ios:"https://family.co/download"},getWalletConnectDeeplink:et=>isAndroid()?et:`familywallet://wc?uri=${encodeURIComponent(et)}`},frame:{name:"Frame",icon:jsxRuntimeExports.jsx(Logos.Frame,{}),iconShouldShrink:!0,downloadUrls:{download:"https://connect.family.co/v0/download/frame",website:"https://frame.sh",chrome:"https://chrome.google.com/webstore/detail/frame-companion/ldcoohedfbjoobcadoglnnmmfbdlmmhf",firefox:"https://addons.mozilla.org/en-US/firefox/addon/frame-extension",brave:"https://chrome.google.com/webstore/detail/frame-companion/ldcoohedfbjoobcadoglnnmmfbdlmmhf"},getWalletConnectDeeplink:et=>et},frontier:{name:"Frontier Wallet",shortName:"Frontier",icon:jsxRuntimeExports.jsx(Logos.Frontier,{}),downloadUrls:{download:"https://connect.family.co/v0/download/frontier",ios:"https://apps.apple.com/app/frontier-crypto-defi-wallet/id1482380988",android:"https://play.google.com/store/apps/details?id=com.frontierwallet",website:"https://frontier.xyz/",chrome:"https://chrome.google.com/webstore/detail/frontier-wallet/kppfdiipphfccemcignhifpjkapfbihd"},getWalletConnectDeeplink:et=>isAndroid()?et:`frontier://wc?uri=${encodeURIComponent(et)}`},injected:{name:"Browser Wallet",shortName:"Browser",icon:jsxRuntimeExports.jsx(Logos.Injected,{})},"metaMask, metaMask-io, io.metamask, io.metamask.mobile, metaMaskSDK":{name:"MetaMask",icon:jsxRuntimeExports.jsx(Logos.MetaMask,{}),iconConnector:jsxRuntimeExports.jsx(Logos.MetaMask,{}),iconShouldShrink:!0,downloadUrls:{download:"https://connect.family.co/v0/download/metamask",website:"https://metamask.io/download/",android:"https://play.google.com/store/apps/details?id=io.metamask",ios:"https://apps.apple.com/app/metamask/id1438144202",chrome:"https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn",firefox:"https://addons.mozilla.org/firefox/addon/ether-metamask/",brave:"https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn",edge:"https://microsoftedge.microsoft.com/addons/detail/metamask/ejbalbakoplchlghecdalmeeeajnimhm"},getWalletConnectDeeplink:et=>isAndroid()?et:`https://metamask.app.link/wc?uri=${encodeURIComponent(et)}`},"app.phantom":{name:"Phantom",iconShape:"squircle"},"me.rainbow":{name:"Rainbow Wallet",shortName:"Rainbow",icon:jsxRuntimeExports.jsx(Logos.Rainbow,{}),iconShape:"squircle",downloadUrls:{download:"https://connect.family.co/v0/download/rainbow",website:"https://rainbow.me/?utm_source=connectkit",android:"https://play.google.com/store/apps/details?id=me.rainbow&referrer=utm_source%3Dconnectkit&utm_source=connectkit",ios:"https://apps.apple.com/app/rainbow-ethereum-wallet/id1457119021?pt=119997837&ct=connectkit&mt=8",chrome:"https://rainbow.me/extension?utm_source=connectkit",edge:"https://rainbow.me/extension?utm_source=connectkit",brave:"https://rainbow.me/extension?utm_source=connectkit"},getWalletConnectDeeplink:et=>isAndroid()?et:`https://rnbwapp.com/wc?uri=${encodeURIComponent(et)}&connector=connectkit`},"io.rabby":{name:"Rabby Wallet",shortName:"Rabby",downloadUrls:{website:"https://rabby.io",chrome:"https://chrome.google.com/webstore/detail/rabby-wallet/acmacodkjbdgmoleebolmdjonilkdbch"}},safe:{name:"Safe",icon:jsxRuntimeExports.jsx(Logos.Safe,{}),downloadUrls:{download:"https://connect.family.co/v0/download/safe",website:"https://safe.global/",ios:"https://apps.apple.com/app/id1515759131",android:"https://play.google.com/store/apps/details?id=io.gnosis.safe"},getWalletConnectDeeplink:et=>isAndroid()?et:`https://gnosis-safe.io/wc?uri=${encodeURIComponent(et)}`},"xyz.talisman":{name:"Talisman",shortName:"Talisman",iconShape:"squircle",downloadUrls:{download:"https://talisman.xyz/download",website:"https://talisman.xyz",chrome:"https://chrome.google.com/webstore/detail/talisman-polkadot-wallet/fijngjgcjhjmmpcmkeiomlglpeiijkld",firefox:"https://addons.mozilla.org/en-US/firefox/addon/talisman-wallet-extension/"}},"com.trustwallet.app":{name:"Trust Wallet",shortName:"Trust",icon:jsxRuntimeExports.jsx(Logos.Trust,{}),iconShouldShrink:!0,downloadUrls:{download:"https://connect.family.co/v0/download/trust",android:"https://play.google.com/store/apps/details?id=com.wallet.crypto.trustapp",ios:"https://apps.apple.com/app/trust-crypto-bitcoin-wallet/id1288339409"},getWalletConnectDeeplink(et){return isAndroid()?et:`https://link.trustwallet.com/wc?uri=${encodeURIComponent(et)}`}},infinityWallet:{name:"Infinity Wallet",icon:jsxRuntimeExports.jsx(Logos.InfinityWallet,{}),downloadUrls:{download:"https://connect.family.co/v0/download/infinityWallet",website:"https://infinitywallet.io/download",chrome:"https://infinitywallet.io/download",firefox:"https://infinitywallet.io/download",brave:"https://infinitywallet.io/download",edge:"https://infinitywallet.io/download"}},imToken:{name:"imToken",icon:jsxRuntimeExports.jsx(Logos.ImToken,{}),downloadUrls:{download:"https://connect.family.co/v0/download/imToken",android:"https://play.google.com/store/apps/details?id=im.token.app",ios:"https://itunes.apple.com/us/app/imtoken2/id1384798940"},getWalletConnectDeeplink:et=>`imtokenv2://wc?uri=${encodeURIComponent(et)}`},unstoppable:{name:"Unstoppable",icon:jsxRuntimeExports.jsx(Logos.Unstoppable,{}),downloadUrls:{download:"https://connect.family.co/v0/download/unstoppable",ios:"https://apps.apple.com/app/bank-bitcoin-wallet/id1447619907",android:"https://play.google.com/store/apps/details?id=io.horizontalsystems.bankwallet"},getWalletConnectDeeplink:et=>isAndroid()?et:`https://unstoppable.money/wc?uri=${encodeURIComponent(et)}`},onto:{name:"ONTO",icon:jsxRuntimeExports.jsx(Logos.ONTO,{}),downloadUrls:{download:"https://connect.family.co/v0/download/onto",ios:"https://apps.apple.com/app/onto-an-ontology-dapp/id1436009823",android:"https://play.google.com/store/apps/details?id=com.github.ontio.onto",website:"https://onto.app/en/download/"},getWalletConnectDeeplink:et=>isAndroid()?et:`https://onto.app/wc?uri=${encodeURIComponent(et)}`},steak:{name:"Steak",icon:jsxRuntimeExports.jsx(Logos.Steak,{}),downloadUrls:{download:"https://connect.family.co/v0/download/steak",android:"https://play.google.com/store/apps/details?id=fi.steakwallet.app",ios:"https://apps.apple.com/app/steakwallet/id1569375204",website:"https://steakwallet.fi/download"},getWalletConnectDeeplink:et=>isAndroid()?et:`https://links.steakwallet.fi/wc?uri=${encodeURIComponent(et)}`},ledger:{name:"Ledger Live",shortName:"Ledger",icon:jsxRuntimeExports.jsx(Logos.Ledger,{}),downloadUrls:{download:"https://connect.family.co/v0/download/ledger",website:"https://www.ledger.com/ledger-live/download#download-device-2",android:"https://play.google.com/store/apps/details?id=com.ledger.live",ios:"https://apps.apple.com/app/ledger-live-web3-wallet/id1361671700"},getWalletConnectDeeplink:et=>isAndroid()?et:`ledgerlive://wc?uri=${encodeURIComponent(et)}`,shouldDeeplinkDesktop:!0},zerion:{name:"Zerion",icon:jsxRuntimeExports.jsx(Logos.Zerion,{}),downloadUrls:{download:"https://connect.family.co/v0/download/zerion",ios:"https://apps.apple.com/app/apple-store/id1456732565",android:"https://play.google.com/store/apps/details?id=io.zerion.android",website:"https://zerion.io/"},getWalletConnectDeeplink:et=>isAndroid()?et:`https://app.zerion.io/wc?uri=${encodeURIComponent(et)}`},slope:{name:"Slope",icon:jsxRuntimeExports.jsx(Logos.Slope,{}),downloadUrls:{download:"https://connect.family.co/v0/download/slope",ios:"https://apps.apple.com/app/slope-wallet/id1574624530",android:"https://play.google.com/store/apps/details?id=com.wd.wallet",chrome:"https://chrome.google.com/webstore/detail/slope-wallet/pocmplpaccanhmnllbbkpgfliimjljgo",website:"https://slope.finance/"},getWalletConnectDeeplink:et=>isAndroid()?et:`https://slope.finance/app/wc?uri=${encodeURIComponent(et)}`},tokenPocket:{name:"TokenPocket Wallet",icon:jsxRuntimeExports.jsx(Logos.TokenPocket,{}),downloadUrls:{website:"https://www.tokenpocket.pro/en/download/app",download:"https://www.tokenpocket.pro/en/download/app",android:"https://play.google.com/store/apps/details?id=vip.mytokenpocket",ios:"https://apps.apple.com/us/app/tp-global-wallet/id6444625622",chrome:"https://chrome.google.com/webstore/detail/tokenpocket/mfgccjchihfkkindfppnaooecgfneiii"}},talisman:{name:"Talisman",icon:jsxRuntimeExports.jsx(Logos.Talisman,{}),downloadUrls:{download:"https://talisman.xyz/download",website:"https://talisman.xyz",chrome:"https://chrome.google.com/webstore/detail/talisman-polkadot-wallet/fijngjgcjhjmmpcmkeiomlglpeiijkld",firefox:"https://addons.mozilla.org/en-US/firefox/addon/talisman-wallet-extension/"}},walletConnect:{name:"Other Wallets",shortName:"Other",icon:jsxRuntimeExports.jsx(Logos.WalletConnect,{background:!0}),iconConnector:jsxRuntimeExports.jsx(Logos.OtherWallets,{}),iconShape:"square",getWalletConnectDeeplink:et=>et}};Object.keys(walletConfigs).reduce((et,o)=>{var tt,rt,nt,ot,it,st;const at=walletConfigs[o];if(!(at!=null&&at.getWalletConnectDeeplink))return et;const ct=o.split(",")[0].trim(),lt=(rt=(tt=at.name)===null||tt===void 0?void 0:tt.replace("Wallet","").replace(" ",""))!==null&&rt!==void 0?rt:ct[0].toUpperCase()+ct.slice(1),dt=injected({target:{id:ct,name:(ot=(nt=at.name)!==null&&nt!==void 0?nt:at.shortName)!==null&&ot!==void 0?ot:o,provider:mt=>{var ft;return(ft=mt==null?void 0:mt.ethereum)===null||ft===void 0?void 0:ft[`is${lt}`]}}}),ht=((st=(it=at.name)!==null&&it!==void 0?it:at.shortName)!==null&&st!==void 0?st:o).toLowerCase().replace(/(?:^|\s)\S/g,mt=>mt.toUpperCase()).replace(/\s/g,"").replace(/(?:^|\s)\S/g,mt=>mt.toLowerCase());return et[ht]=dt,et},{});const defaultLightTheme={font:{family:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, 'Apple Color Emoji', Arial, sans-serif, 'Segoe UI Emoji'"},text:{primary:{color:"#373737"},secondary:{color:"#999999",hover:{color:"#111111"}},error:"#FC6464",valid:"#32D74B"},buttons:{primary:{borderRadius:16,color:"#000373737000",background:"#FFFFFF",border:"#F0F0F0",hover:{color:"#000000",border:"#1A88F8"}},secondary:{borderRadius:16,background:"#F6F7F9",color:"#000000"}},navigation:{color:"#999999"},modal:{background:"#ffffff",divider:"#f7f6f8"},tooltips:{color:"#999999",background:"#ffffff",hover:{background:"#f6f7f9"}},overlay:{background:"rgba(0, 0, 0, 0.06)"},qrCode:{accentColor:"#F7F6F8"}},parseTheme=et=>et,userPrefersDarkMode=()=>typeof window>"u"?!1:window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;userPrefersDarkMode();const defaultTheme$1={connectKit:{options:{iconStyle:"light"},theme:{preferred:"dark",light:parseTheme(defaultLightTheme),dark:parseTheme(defaultLightTheme)}}};var styled=typeof qe.div=="function"?qe:qe.default;const hexToP3=et=>{const o=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(et);if(o==null)return et;const tt={r:parseInt(o[1],16),g:parseInt(o[2],16),b:parseInt(o[3],16)};return`color(display-p3 ${tt.r/255} ${tt.g/255} ${tt.b/255})`};var base$m={light:{"--ck-connectbutton-font-size":"15px","--ck-connectbutton-color":"#373737","--ck-connectbutton-background":"#F6F7F9","--ck-connectbutton-background-secondary":"#FFFFFF","--ck-connectbutton-hover-color":"#373737","--ck-connectbutton-hover-background":"#F0F2F5","--ck-connectbutton-active-color":"#373737","--ck-connectbutton-active-background":"#EAECF1","--ck-connectbutton-balance-color":"#373737","--ck-connectbutton-balance-background":"#fff","--ck-connectbutton-balance-box-shadow":"inset 0 0 0 1px var(--ck-connectbutton-background)","--ck-connectbutton-balance-hover-background":"#F6F7F9","--ck-connectbutton-balance-hover-box-shadow":"inset 0 0 0 1px var(--ck-connectbutton-hover-background)","--ck-connectbutton-balance-active-background":"#F0F2F5","--ck-connectbutton-balance-active-box-shadow":"inset 0 0 0 1px var(--ck-connectbutton-active-background)","--ck-primary-button-border-radius":"16px","--ck-primary-button-color":"#373737","--ck-primary-button-background":"#F6F7F9","--ck-primary-button-font-weight":"600","--ck-primary-button-hover-color":"#373737","--ck-primary-button-hover-background":"#F0F2F5","--ck-secondary-button-border-radius":"16px","--ck-secondary-button-color":"#373737","--ck-secondary-button-background":"#F6F7F9","--ck-tertiary-button-background":"#FFFFFF","--ck-secondary-button-hover-background":"#e0e4eb","--ck-modal-box-shadow":"0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-overlay-background":"rgba(71, 88, 107, 0.24)","--ck-body-color":"#373737","--ck-body-color-muted":"#999999","--ck-body-color-muted-hover":"#111111","--ck-body-background":"#ffffff","--ck-body-background-transparent":"rgba(255,255,255,0)","--ck-body-background-secondary":"#f6f7f9","--ck-body-background-secondary-hover-background":"#e0e4eb","--ck-body-background-secondary-hover-outline":"#4282FF","--ck-body-background-tertiary":"#F3F4F7","--ck-body-action-color":"#999999","--ck-body-divider":"#f7f6f8","--ck-body-divider-secondary":"rgba(0, 0, 0, 0.06)","--ck-body-color-danger":"#FF4E4E","--ck-body-color-valid":"#32D74B","--ck-siwe-border":"#F0F0F0","--ck-body-disclaimer-color":"#AAAAAB","--ck-body-disclaimer-link-color":"#838485","--ck-body-disclaimer-link-hover-color":"#000000","--ck-tooltip-background":"#ffffff","--ck-tooltip-background-secondary":"#ffffff","--ck-tooltip-color":"#999999","--ck-tooltip-shadow":"0px 2px 10px rgba(0, 0, 0, 0.08)","--ck-dropdown-button-color":"#999999","--ck-dropdown-button-box-shadow":"0 0 0 1px rgba(0,0,0,0.01), 0px 0px 7px rgba(0, 0, 0, 0.05)","--ck-dropdown-button-background":"#fff","--ck-dropdown-button-hover-color":"#8B8B8B","--ck-dropdown-button-hover-background":"#F5F7F9","--ck-qr-dot-color":"#000000","--ck-qr-border-color":"#f7f6f8","--ck-focus-color":"#1A88F8","--ck-spinner-color":"var(--ck-focus-color)","--ck-copytoclipboard-stroke":"#CCCCCC"},dark:{"--ck-connectbutton-font-size":"15px","--ck-connectbutton-color":"#ffffff","--ck-connectbutton-background":"#383838","--ck-connectbutton-background-secondary":"#282828","--ck-connectbutton-hover-background":"#404040","--ck-connectbutton-active-background":"#4D4D4D","--ck-connectbutton-balance-color":"#fff","--ck-connectbutton-balance-background":"#282828","--ck-connectbutton-balance-box-shadow":"inset 0 0 0 1px var(--ck-connectbutton-background)","--ck-connectbutton-balance-hover-background":"#383838","--ck-connectbutton-balance-hover-box-shadow":"inset 0 0 0 1px var(--ck-connectbutton-hover-background)","--ck-connectbutton-balance-active-background":"#404040","--ck-connectbutton-balance-active-box-shadow":"inset 0 0 0 1px var(--ck-connectbutton-active-background)","--ck-primary-button-color":"#ffffff","--ck-primary-button-background":"#383838","--ck-primary-button-border-radius":"16px","--ck-primary-button-font-weight":"600","--ck-primary-button-hover-background":"#404040","--ck-primary-button-active-border-radius":"16px","--ck-secondary-button-color":"#ffffff","--ck-secondary-button-background":"#333333","--ck-secondary-button-hover-background":"#4D4D4D","--ck-tertiary-button-background":"#424242","--ck-focus-color":"#1A88F8","--ck-overlay-background":"rgba(0,0,0,0.4)","--ck-body-color":"#ffffff","--ck-body-color-muted":"rgba(255, 255, 255, 0.4)","--ck-body-color-muted-hover":"rgba(255, 255, 255, 0.8)","--ck-body-background":"#2B2B2B","--ck-body-background-transparent":"rgba(0,0,0,0)","--ck-body-background-secondary":"#333333","--ck-body-background-secondary-hover-background":"#4D4D4D","--ck-body-background-secondary-hover-outline":"#ffffff","--ck-body-background-tertiary":"#333333","--ck-body-action-color":"#808080","--ck-body-divider":"#383838","--ck-body-color-danger":"#FF4E4E","--ck-body-disclaimer-color":"#858585","--ck-body-disclaimer-link-color":"#ADADAD","--ck-body-disclaimer-link-hover-color":"#FFFFFF","--ck-modal-box-shadow":"0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-copytoclipboard-stroke":"#555555","--ck-tooltip-background":"#2B2B2B","--ck-tooltip-background-secondary":"#333333","--ck-tooltip-color":"#999999","--ck-tooltip-shadow":"0px 2px 10px rgba(0, 0, 0, 0.08)","--ck-dropdown-button-color":"#6C7381","--ck-spinner-color":"var(--ck-focus-color)","--ck-qr-dot-color":"#ffffff","--ck-qr-border-color":"#3d3d3d"}},web95={"--ck-font-family":"Lato","--ck-border-radius":"0px","--ck-connectbutton-color":"#373737","--ck-connectbutton-background":"linear-gradient(180deg, #F0F0EA 0%, #FFFFFF 50%, #F0F0EA 100%) 100% 100% / 200% 200%, #F5F5F1","--ck-connectbutton-box-shadow":" 0 0 0 1px #003C74, 2px 2px 0px rgba(255, 255, 255, 0.75), -2px -2px 0px rgba(0, 0, 0, 0.05), inset 0px 0px 0px 0px #97B9EC, inset -1px -2px 2px rgba(0, 0, 0, 0.2)","--ck-connectbutton-border-radius":"4.5px","--ck-connectbutton-hover-color":"#373737","--ck-connectbutton-hover-background":"linear-gradient(180deg, #F0F0EA 0%, #FFFFFF 50%, #F0F0EA 100%) 100% 0% / 200% 200%, #F5F5F1","--ck-connectbutton-active-background":"linear-gradient(180deg, #F0F0EA 0%, #FFFFFF 50%, #F0F0EA 100%) 100% 100% / 200% 200%, #F5F5F1","--ck-connectbutton-balance-color":"#373737","--ck-connectbutton-balance-background":"#fff","--ck-connectbutton-balance-box-shadow":"0 0 0 1px #E4E7E7","--ck-connectbutton-balance-hover-box-shadow":"0 0 0 1px #d7dbdb","--ck-connectbutton-balance-active-box-shadow":"0 0 0 1px #bbc0c0","--ck-focus-color":"#1A88F8","--ck-overlay-background":"rgba(0, 127, 128, 0.8)","--ck-body-color":"#373737","--ck-body-color-muted":"#808080","--ck-body-color-muted-hover":"#111111","--ck-body-background":"#F0EDE2","--ck-body-background-transparent":"rgba(255,255,255,0)","--ck-body-background-secondary-hover-background":"#FAFAFA","--ck-body-background-secondary-hover-outline":"#4282FF","--ck-body-action-color":"#373737","--ck-body-color-danger":"#FC6464","--ck-body-color-valid":"#32D74B","--ck-body-divider":"#919B9C","--ck-body-divider-box-shadow":"0px 1px 0px #FBFBF8","--ck-primary-button-background":"linear-gradient(180deg, #FFFFFF 0%, #F0F0EA 100%), #F5F5F1","--ck-primary-button-box-shadow":"inset 0 0 0 1px #003C74, 1px 1px 0px rgba(255, 255, 255, 0.75), -1px -1px 0px rgba(0, 0, 0, 0.05), inset 0px 0px 0px 0px #97B9EC, inset -1px -2px 2px rgba(0, 0, 0, 0.2)","--ck-primary-button-border-radius":"6px","--ck-primary-button-hover-box-shadow":"inset 0 0 0 1px #003C74, 1px 1px 0px rgba(255, 255, 255, 0.75), -1px -1px 0px rgba(0, 0, 0, 0.05), inset 0px 0px 0px 5px #97B9EC, inset -1px -2px 2px rgba(0, 0, 0, 0.2)","--ck-primary-button-hover-border-radius":"6px","--ck-modal-heading-font-weight":400,"--ck-modal-box-shadow":`
inset 0px -3px 0px #0F37A9,
inset -2px 0px 0px #0F37A9,
inset 0px -4px 0px #0D5DDF,
inset -4px 0px 0px #0D5DDF,
inset 2px 0px 0px #0453DD,
inset 0px 2px 0px #044FD1,
inset 4px 0px 0px #4283EB,
inset 0px 4px 0px #4283EB
`,"--ck-modal-h1-font-weight":400,"--ck-secondary-button-color":"#373737","--ck-secondary-button-border-radius":"6px","--ck-secondary-button-box-shadow":"inset 0 0 0 1px #003C74, 1px 1px 0px rgba(255, 255, 255, 0.75), -1px -1px 0px rgba(0, 0, 0, 0.05), inset 0px 0px 0px 0px #97B9EC, inset -1px -2px 2px rgba(0, 0, 0, 0.2)","--ck-secondary-button-background":"linear-gradient(180deg, #FFFFFF 0%, #F0F0EA 100%), #F5F5F1","--ck-secondary-button-hover-box-shadow":"inset 0 0 0 1px #003C74, 1px 1px 0px rgba(255, 255, 255, 0.75), -1px -1px 0px rgba(0, 0, 0, 0.05), inset 0px 0px 0px 4px #97B9EC, inset -1px -2px 2px rgba(0, 0, 0, 0.2)","--ck-body-background-secondary":"rgba(0, 0, 0, 0.1)","--ck-body-background-tertiary":"linear-gradient(180deg, #FBFBFB 0%, #EFEFEE 100%)","--ck-tertiary-border-radius":"0px","--ck-tertiary-box-shadow":"inset 0 0 0 1px #919B9C, 1px 1px 2px rgba(0, 0, 0, 0.15), inset -2px -2px 0px #FFFFFF","--ck-body-button-text-align":"left","--ck-body-button-box-shadow":"0 2px 4px rgba(0, 0, 0, 0.05 )","--ck-body-disclaimer-background":"linear-gradient(180deg, #FBFBFB 0%, #EFEFEE 100%)","--ck-body-disclaimer-box-shadow":`
inset 0px -3px 0px #0F37A9,
inset -2px 0px 0px #0F37A9,
inset 0px -4px 0px #0D5DDF,
inset -4px 0px 0px #0D5DDF,
inset 2px 0px 0px #0453DD,
inset 4px 0px 0px #4283EB,
inset 0 1px 0 0 #919B9C`,"--ck-body-disclaimer-font-size":"14px","--ck-body-disclaimer-color":"#959594","--ck-body-disclaimer-link-color":"#626262","--ck-body-disclaimer-link-hover-color":"#000000","--ck-qr-dot-color":"#000000","--ck-qr-border-color":"#919B9C","--ck-qr-border-radius":"0","--ck-qr-background":"#FFFFFF","--ck-copytoclipboard-stroke":"rgba(55, 55, 55, 0.4)","--ck-tooltip-background":"linear-gradient(270deg, #F7F3E6 7.69%, #F5F7DA 100%)","--ck-tooltip-background-secondary":"#f6f7f9","--ck-tooltip-color":"#000000","--ck-tooltip-shadow":" 0 0 0 1.5px #2b2622, 0px 2px 10px rgba(0, 0, 0, 0.08)","--ck-spinner-color":"var(--ck-focus-color)","--ck-dropdown-button-color":"#999999","--ck-dropdown-button-box-shadow":"0 0 0 1px #A0A0A0, 1px 1px 0px rgba(255, 255, 255, 0.75), -1px -1px 0px rgba(0, 0, 0, 0.05), inset -1px -2px 2px rgba(0, 0, 0, 0.2)","--ck-dropdown-button-background":"linear-gradient(180deg, #FFFFFF 0%, #F0F0EA 100%), #F5F5F1","--ck-dropdown-button-hover-background":"linear-gradient(0deg, #FFFFFF 0%, #F0F0EA 100%), #F5F5F1","--ck-dropdown-pending-color":"#ACA899","--ck-dropdown-active-color":"#FFFFFF","--ck-dropdown-active-static-color":"#ACA899","--ck-dropdown-active-background":"#3F69BF","--ck-dropdown-active-border-radius":"0","--ck-dropdown-active-inset":"-12px","--ck-dropdown-color":"#ACA899","--ck-dropdown-background":"#FFFFFF","--ck-dropdown-box-shadow":"inset 0 0 0 1px #ACA899, 2px 2px 7px rgba(0, 0, 0, 0.15)","--ck-dropdown-border-radius":"0","--ck-alert-color":"#ACA899","--ck-alert-background":"linear-gradient(180deg, #FBFBFB 0%, #EFEFEE 100%)","--ck-alert-box-shadow":"inset 0 0 0 1px #919B9C, 1px 1px 2px rgba(0, 0, 0, 0.15), inset -2px -2px 0px #FFFFFF","--ck-alert-border-radius":"0","--ck-recent-badge-border-radius":"32px","--ck-recent-badge-top-offset":"0px","--ck-graphic-primary-color":"#333333","--ck-graphic-primary-background":"#FFFFFF","--ck-graphic-compass-background":"#FFFFFF","--ck-siwe-border":"#919B9C"},retro={"--ck-font-family":'"SF Pro Rounded",ui-rounded,"Nunito",-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,"Apple Color Emoji",Arial,sans-serif,"Segoe UI Emoji","Segoe UI Symbol"',"--ck-border-radius":"8px","--ck-connectbutton-font-size":"17px","--ck-connectbutton-color":"#000000","--ck-connectbutton-background":"#ffffff","--ck-connectbutton-box-shadow":"-4px 4px 0px #000000, inset 0 0 0 2px #000000","--ck-connectbutton-border-radius":"8px","--ck-connectbutton-hover-background":"#F3EDE8","--ck-connectbutton-active-box-shadow":"0 0 0 0 #000000, inset 0 0 0 2px #000000","--ck-connectbutton-balance-color":"#000000","--ck-connectbutton-balance-background":"#F3EDE8","--ck-connectbutton-balance-box-shadow":"-4px 4px 0px #000000, inset 0 0 0 2px #000000","--ck-connectbutton-balance-hover-background":"#eee5dd","--ck-connectbutton-balance-connectbutton-box-shadow":"-4px 8px 0px -4px #000000, inset 0 0 0 2px #000000","--ck-connectbutton-balance-connectbutton-border-radius":"0px 8px 8px 0","--ck-primary-button-color":"#373737","--ck-primary-button-background":"#ffffff","--ck-primary-button-box-shadow":"inset 0 0 0 2px #000000, -4px 4px 0 0 #000000","--ck-primary-button-border-radius":"8px","--ck-primary-button-hover-background":"#F3EDE8","--ck-primary-button-hover-box-shadow":"inset 0 0 0 2px #000000, -0px 0px 0 0 #000000","--ck-secondary-button-border-radius":"8px","--ck-secondary-button-color":"#373737","--ck-secondary-button-background":"#ffffff","--ck-secondary-button-box-shadow":"-4px 4px 0 0 #000000, inset 0 0 0 2px #000000","--ck-secondary-button-hover-background":"#F3EDE8","--ck-secondary-button-hover-box-shadow":"0 0 0 0 #000000, inset 0 0 0 2px #000000","--ck-focus-color":"#3B99FC","--ck-overlay-background":"rgba(133, 120, 122, 0.8)","--ck-body-color":"#373737","--ck-body-color-muted":"rgba(0, 0, 0, 0.5)","--ck-body-color-muted-hover":"#000000","--ck-body-background":"#EBE1D8","--ck-body-background-transparent":"rgba(255,255,255,0)","--ck-body-background-secondary":"rgba(0,0,0,0.1)","--ck-body-background-secondary-hover-background":"#4D4D4D","--ck-body-background-secondary-hover-outline":"#373737","--ck-body-background-tertiary":"#ffffff","--ck-tertiary-border-radius":"8px","--ck-tertiary-box-shadow":"-4px 4px 0 0 #000000, inset 0 0 0 2px #000000","--ck-body-action-color":"#373737","--ck-body-divider":"#373737","--ck-body-color-danger":"#FF4E4E","--ck-body-disclaimer-background":"#E3D6C9","--ck-body-disclaimer-box-shadow":"-4px 4px 0 0 #000000, inset 2px 0 0 0 #000000, inset -2px 0 0 0 #000000, inset 0 -2px 0 0 #000000","--ck-body-disclaimer-font-weight":"500","--ck-body-disclaimer-color":"#888079","--ck-body-disclaimer-link-color":"#5B5650","--ck-body-disclaimer-link-hover-color":"#000000","--ck-modal-box-shadow":"-10px 10px 0px #000000, inset 0 0 0 2px #000000","--ck-copytoclipboard-stroke":"#555555","--ck-tooltip-border-radius":"8px","--ck-tooltip-color":"#373737","--ck-tooltip-background":"#ffffff","--ck-tooltip-background-secondary":"#EBE1D8","--ck-tooltip-shadow":"-6px 6px 0 0 #000000, 0 0 0 2px #000000","--ck-spinner-color":"#1A88F8","--ck-dropdown-button-color":"#000","--ck-dropdown-button-box-shadow":"-2px 2px 0 2px #000000, 0 0 0 2px #000000","--ck-dropdown-button-background":"#ffffff","--ck-dropdown-button-hover-background":"#F3EDE8","--ck-dropdown-button-hover-box-shadow":"-2px 2px 0 0 #000000, 0 0 0 2px #000000","--ck-dropdown-pending-color":"rgba(0, 0, 0, 0.5)","--ck-dropdown-active-color":"#FFFFFF","--ck-dropdown-active-static-color":"rgba(0, 0, 0, 0.5)","--ck-dropdown-active-background":"#3B99FC","--ck-dropdown-active-box-shadow":"inset 0 0 0 2px #000000","--ck-dropdown-active-border-radius":"8px","--ck-dropdown-color":"rgba(0, 0, 0, 0.5)","--ck-dropdown-background":"#FFFFFF","--ck-dropdown-box-shadow":"-4px 4px 0 0 #000000, inset 0 0 0 2px #000000","--ck-dropdown-border-radius":"8px","--ck-alert-color":"rgba(0, 0, 0, 0.5)","--ck-alert-background":" #F5F5F5","--ck-alert-border-radius":"8px","--ck-qr-border-radius":"8px","--ck-qr-dot-color":"#000000","--ck-qr-border-color":"#000000","--ck-qr-background":"#ffffff","--ck-recent-badge-border-radius":"32px","--ck-recent-badge-box-shadow":"inset 0 0 0 2px currentColor","--ck-graphic-primary-color":"#000000","--ck-graphic-primary-background":"#ffffff","--ck-graphic-compass-background":"#FFFFFF","--ck-siwe-border":"#8E8985"},soft={"--ck-border-radius":"12px","--ck-connectbutton-font-size":"17px","--ck-connectbutton-border-radius":"12px","--ck-connectbutton-color":"#414451","--ck-connectbutton-background":"#ffffff","--ck-connectbutton-box-shadow":"inset 0 0 0 1px #E9EAEC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-connectbutton-hover-background":"#F6F7F9","--ck-connectbutton-hover-box-shadow":"inset 0 0 0 1px #E9EAEC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-connectbutton-balance-color":"#373737","--ck-connectbutton-balance-background":"#F6F7F9","--ck-connectbutton-balance-box-shadow":"none","--ck-connectbutton-balance-hover-background":"#f1f1f3","--ck-primary-button-border-radius":"12px","--ck-primary-button-color":"#414451","--ck-primary-button-background":"#ffffff","--ck-primary-button-box-shadow":"0 0 0 1px #E9EAEC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-primary-button-hover-background":"#F6F7F9","--ck-primary-button-hover-box-shadow":"0 0 0 1px #D9DBDD, 0px 0 0 rgba(0, 0, 0, 0.02)","--ck-secondary-button-border-radius":"12px","--ck-secondary-button-color":"#414451","--ck-secondary-button-background":"#ffffff","--ck-secondary-button-box-shadow":"0 0 0 1px #E9EAEC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-secondary-button-hover-background":"#F6F7F9","--ck-secondary-button-hover-box-shadow":"0 0 0 1px #D9DBDD, 0px 0 0 rgba(0, 0, 0, 0.02)","--ck-focus-color":"#1A88F8","--ck-modal-box-shadow":"0px 3px 16px rgba(0, 0, 0, 0.08)","--ck-body-color":"#414451","--ck-body-color-muted":"#9196A1","--ck-body-color-muted-hover":"#000000","--ck-body-background":"#ffffff","--ck-body-background-transparent":"rgba(255,255,255,0)","--ck-body-background-secondary":"#f6f7f9","--ck-body-background-secondary-hover-background":"#e0e4eb","--ck-body-background-secondary-hover-outline":"#4282FF","--ck-body-background-tertiary":"#F6F8FA","--ck-tertiary-border-radius":"13px","--ck-tertiary-box-shadow":"inset 0 0 0 1px rgba(0, 0, 0, 0.04)","--ck-body-action-color":"#999999","--ck-body-divider":"#f7f6f8","--ck-body-color-danger":"#FF4E4E","--ck-body-color-valid":"#32D74B","--ck-body-disclaimer-background":"#F9FAFA","--ck-body-disclaimer-color":"#AFB1B6","--ck-body-disclaimer-link-color":"#787B84","--ck-body-disclaimer-link-hover-color":"#000000","--ck-copytoclipboard-stroke":"#CCCCCC","--ck-tooltip-background":"#ffffff","--ck-tooltip-background-secondary":"#ffffff","--ck-tooltip-color":"#999999","--ck-tooltip-shadow":"0px 2px 10px rgba(0, 0, 0, 0.08)","--ck-spinner-color":"var(--ck-focus-color)","--ck-dropdown-button-color":"#999999","--ck-dropdown-button-box-shadow":"0 0 0 1px rgba(0, 0, 0, 0.01), 0px 0px 7px rgba(0, 0, 0, 0.05)","--ck-dropdown-button-background":"#fff","--ck-dropdown-button-hover-color":"#8B8B8B","--ck-dropdown-button-hover-background":"#E7E7E7","--ck-dropdown-color":"rgba(55, 55, 55, 0.4)","--ck-dropdown-box-shadow":"0px 2px 15px rgba(0, 0, 0, 0.15)","--ck-alert-color":"#9196A1","--ck-alert-background":"#F6F8FA","--ck-alert-box-shadow":"inset 0 0 0 1px rgba(0, 0, 0, 0.04)","--ck-alert-border-radius":"8px","--ck-qr-border-radius":"12px","--ck-qr-dot-color":"#2E3138","--ck-qr-border-color":"#E9EAEC","--ck-siwe-border":"#EAEBED"},midnight={"--ck-font-family":'"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,"Apple Color Emoji",Arial,sans-serif,"Segoe UI Emoji","Segoe UI Symbol"',"--ck-border-radius":"10px","--ck-connectbutton-font-size":"17px","--ck-connectbutton-border-radius":"8px","--ck-connectbutton-color":"#ffffff","--ck-connectbutton-background":"#313235","--ck-connectbutton-box-shadow":"inset 0 0 0 1px rgba(255, 255, 255, 0.05)","--ck-connectbutton-hover-background":"#414144","--ck-connectbutton-active-background":"#4C4D4F","--ck-connectbutton-balance-color":"#ffffff","--ck-connectbutton-balance-background":"#1F2023","--ck-connectbutton-balance-box-shadow":"inset 0 0 0 1px #313235","--ck-connectbutton-balance-hover-background":"#313235","--ck-connectbutton-balance-active-background":"#414144","--ck-primary-button-border-radius":"8px","--ck-primary-button-color":"#ffffff","--ck-primary-button-background":"rgba(255, 255, 255, 0.08)","--ck-primary-button-box-shadow":"inset 0 0 0 1px rgba(255, 255, 255, 0.05)","--ck-primary-button-hover-background":"rgba(255, 255, 255, 0.2)","--ck-secondary-button-border-radius":"8px","--ck-secondary-button-color":"#ffffff","--ck-secondary-button-background":"#363638","--ck-secondary-button-box-shadow":"inset 0 0 0 1px rgba(255, 255, 255, 0.05)","--ck-secondary-button-hover-background":"#3c3c3e","--ck-overlay-background":"rgba(0,0,0,0.4)","--ck-modal-box-shadow":"inset 0 0 0 1px #38393C, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-focus-color":"#1A88F8","--ck-body-color":"#ffffff","--ck-body-color-muted":"#8B8F97","--ck-body-color-muted-hover":"#ffffff","--ck-body-background":"#1F2023","--ck-body-background-transparent":"rgba(31, 32, 35, 0)","--ck-body-background-secondary":"#313235","--ck-body-background-secondary-hover-background":"#e0e4eb","--ck-body-background-secondary-hover-outline":"rgba(255, 255, 255, 0.02)","--ck-body-background-tertiary":"#313235","--ck-tertiary-border-radius":"12px","--ck-tertiary-box-shadow":"inset 0 0 0 1px rgba(255, 255, 255, 0.02)","--ck-body-action-color":"#8B8F97","--ck-body-divider":"rgba(255,255,255,0.1)","--ck-body-color-danger":"#FF4E4E","--ck-body-color-valid":"#32D74B","--ck-body-disclaimer-background":"#2B2D31","--ck-body-disclaimer-box-shadow":"none","--ck-body-disclaimer-color":"#808183","--ck-body-disclaimer-link-color":"#AAABAD","--ck-body-disclaimer-link-hover-color":"#ffffff","--ck-copytoclipboard-stroke":"#CCCCCC","--ck-tooltip-background":"#1F2023","--ck-tooltip-background-secondary":"#1F2023","--ck-tooltip-color":"#ffffff","--ck-tooltip-shadow":" 0 0 0 1px rgba(255, 255, 255, 0.1), 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-spinner-color":"var(--ck-focus-color)","--ck-dropdown-button-color":"#6C7381","--ck-dropdown-button-box-shadow":"inset 0 0 0 1px rgba(255, 255, 255, 0.05)","--ck-dropdown-button-background":"#313235","--ck-dropdown-pending-color":"#8B8F97","--ck-dropdown-active-color":"#FFF","--ck-dropdown-active-static-color":"#FFF","--ck-dropdown-active-background":"rgba(255, 255, 255, 0.07)","--ck-dropdown-color":"#8B8F97","--ck-dropdown-background":"#313235","--ck-dropdown-box-shadow":"inset 0 0 0 1px rgba(255, 255, 255, 0.03)","--ck-dropdown-border-radius":"8px","--ck-alert-color":"#8B8F97","--ck-alert-background":"#404145","--ck-alert-box-shadow":"inset 0 0 0 1px rgba(255, 255, 255, 0.02)","--ck-qr-border-radius":"12px","--ck-qr-dot-color":"#ffffff","--ck-qr-border-color":"rgba(255,255,255,0.1)","--ck-recent-badge-border-radius":"32px"},minimal$1={"--ck-font-family":'"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,"Apple Color Emoji",Arial,sans-serif,"Segoe UI Emoji","Segoe UI Symbol"',"--ck-border-radius":"0px","--ck-connectbutton-font-size":"17px","--ck-connectbutton-border-radius":"0px","--ck-connectbutton-color":"#414451","--ck-connectbutton-background":"#ffffff","--ck-connectbutton-box-shadow":"inset 0 0 0 1px #EBEBEB","--ck-connectbutton-hover-color":"#111","--ck-connectbutton-hover-box-shadow":"inset 0 0 0 1px #111","--ck-connectbutton-balance-color":"#111111","--ck-connectbutton-balance-background":"#F7F7F7","--ck-connectbutton-balance-box-shadow":"inset 0 0 0 1px #F7F7F7","--ck-connectbutton-balance-hover-background":"#f1f1f3","--ck-connectbutton-balance-hover-box-shadow":"inset 0 0 0 1px #111","--ck-primary-button-border-radius":"0px","--ck-primary-button-color":"#111111","--ck-primary-button-background":"#ffffff","--ck-primary-button-box-shadow":"inset 0 0 0 1px #EBEBEB","--ck-primary-button-hover-box-shadow":"inset 0 0 0 1px #111111","--ck-secondary-button-border-radius":"0px","--ck-secondary-button-color":"#111111","--ck-secondary-button-background":"#ffffff","--ck-secondary-button-box-shadow":"inset 0 0 0 1px #EBEBEB","--ck-secondary-button-hover-box-shadow":"inset 0 0 0 1px #111111","--ck-dropdown-button-color":"#999999","--ck-dropdown-button-box-shadow":"0 0 0 1px rgba(0, 0, 0, 0.01), 0px 0px 7px rgba(0, 0, 0, 0.05)","--ck-dropdown-button-background":"#fff","--ck-dropdown-button-hover-color":"#8B8B8B","--ck-dropdown-button-hover-background":"#E7E7E7","--ck-focus-color":"#1A88F8","--ck-modal-box-shadow":"0px 3px 16px rgba(0, 0, 0, 0.08)","--ck-body-color":"#111111","--ck-body-color-muted":"#A0A0A0","--ck-body-color-muted-hover":"#000000","--ck-body-background":"#ffffff","--ck-body-background-transparent":"rgba(255,255,255,0)","--ck-body-background-secondary":"#f6f7f9","--ck-body-background-secondary-hover-background":"#e0e4eb","--ck-body-background-secondary-hover-outline":"#4282FF","--ck-body-background-tertiary":"#ffffff","--ck-tertiary-border-radius":"0px","--ck-tertiary-box-shadow":"inset 0 0 0 1px rgba(0, 0, 0, 0.04)","--ck-body-action-color":"#A0A0A0","--ck-body-divider":"#EBEBEB","--ck-body-color-danger":"#FF4E4E","--ck-body-color-valid":"#32D74B","--ck-body-disclaimer-background":"#FAFAFA","--ck-body-disclaimer-box-shadow":"inset 0 1px 0 0 #ECECEC","--ck-body-disclaimer-color":"#9D9D9D","--ck-body-disclaimer-link-color":"#6E6E6E","--ck-body-disclaimer-link-hover-color":"#000000","--ck-copytoclipboard-stroke":"#CCCCCC","--ck-tooltip-border-radius":"0px","--ck-tooltip-background":"#ffffff","--ck-tooltip-background-secondary":"#ffffff","--ck-tooltip-color":"#999999","--ck-tooltip-shadow":"0px 2px 10px rgba(0, 0, 0, 0.08)","--ck-spinner-color":"var(--ck-focus-color)","--ck-dropdown-active-border-radius":"0","--ck-dropdown-box-shadow":"0px 2px 15px rgba(0, 0, 0, 0.15)","--ck-dropdown-border-radius":"0","--ck-alert-color":"rgba(17, 17, 17, 0.4)","--ck-alert-background":"#fff","--ck-alert-box-shadow":"inset 0 0 0 1px #EBEBEB","--ck-alert-border-radius":"0","--ck-qr-border-radius":"0px","--ck-qr-dot-color":"#111111","--ck-qr-border-color":"#EBEBEB","--ck-modal-h1-font-weight":"400","--ck-modal-heading-font-weight":"400","--ck-primary-button-font-weight":"400","--ck-recent-badge-top-offset":"0px","--ck-siwe-border":"#EBEBEB"},rounded={"--ck-font-family":'"Nunito",ui-rounded,-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,"Apple Color Emoji",Arial,sans-serif,"Segoe UI Emoji","Segoe UI Symbol"',"--ck-border-radius":"24px","--ck-connectbutton-font-size":"17px","--ck-connectbutton-font-weight":"700","--ck-connectbutton-border-radius":"14px","--ck-connectbutton-color":"#000000","--ck-connectbutton-background":"#ffffff","--ck-connectbutton-box-shadow":"inset 0 0 0 2px #DFE4EC, 0 2px 0 0 #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-connectbutton-hover-background":"#F9FAFB","--ck-connectbutton-balance-color":"#414451","--ck-connectbutton-balance-background":"#F9FAFB","--ck-connectbutton-balance-box-shadow":"0 2px 0 0 #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-connectbutton-balance-hover-background":"#F5F7F9","--ck-connectbutton-balance-hover-box-shadow":"0 2px 0 0 #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-connectbutton-balance-active-box-shadow":"0 0 0 0 #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-connectbutton-active-background":"#F5F7F9","--ck-connectbutton-active-box-shadow":"inset 0 0 0 2px #CFD7E2, 0 0px 0 0 #CFD7E2, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-primary-button-border-radius":"18px","--ck-primary-button-color":"#000000","--ck-primary-button-background":"#ffffff","--ck-primary-button-box-shadow":"inset 0 0 0 2px #DFE4EC, inset 0 -4px 0 0 #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-primary-button-hover-background":"#F5F7F9","--ck-primary-button-hover-box-shadow":"inset 0 0 0 2px #DFE4EC, inset 0 -2px 0 0 #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-secondary-button-border-radius":"16px","--ck-secondary-button-color":"#000000","--ck-secondary-button-background":"#ffffff","--ck-secondary-button-box-shadow":"inset 0 0 0 2px #DFE4EC, inset 0 -4px 0 0 #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-secondary-button-hover-background":"#F5F7F9","--ck-secondary-button-hover-box-shadow":"inset 0 0 0 2px #DFE4EC, inset 0 -2px 0 0 #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-focus-color":"#1A88F8","--ck-modal-box-shadow":"0px 3px 16px rgba(0, 0, 0, 0.08)","--ck-body-color":"#000000","--ck-body-color-muted":"#93989F","--ck-body-color-muted-hover":"#000000","--ck-body-background":"#ffffff","--ck-body-background-transparent":"rgba(255,255,255,0)","--ck-body-background-secondary":"#f6f7f9","--ck-body-background-secondary-hover-background":"#e0e4eb","--ck-body-background-secondary-hover-outline":"#4282FF","--ck-body-background-tertiary":"#ffffff","--ck-tertiary-border-radius":"22px","--ck-tertiary-box-shadow":"inset 0 0 0 2px #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-body-action-color":"#93989F","--ck-body-divider":"#DFE4EC","--ck-body-color-danger":"#FF4E4E","--ck-body-color-valid":"#32D74B","--ck-body-disclaimer-background":"#F9FAFB","--ck-body-disclaimer-font-size":"14px","--ck-body-disclaimer-font-weight":"700","--ck-body-disclaimer-color":"#959697","--ck-body-disclaimer-link-color":"#646464","--ck-body-disclaimer-link-hover-color":"#000000","--ck-copytoclipboard-stroke":"#CCCCCC","--ck-tooltip-background":"#ffffff","--ck-tooltip-background-secondary":"#ffffff","--ck-tooltip-color":"#999999","--ck-tooltip-shadow":" 0 0 0 2px #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-spinner-color":"var(--ck-focus-color)","--ck-dropdown-button-color":"#999999","--ck-dropdown-button-box-shadow":"0 0 0 2px #DFE4EC, 0 2px 0 2px #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-dropdown-button-background":"#fff","--ck-dropdown-button-hover-color":"#8B8B8B","--ck-dropdown-button-hover-background":"#F5F7F9","--ck-dropdown-pending-color":"#848D9A","--ck-dropdown-active-color":"#000000","--ck-dropdown-active-static-color":"#848D9A","--ck-dropdown-active-background":"#F5F7F9","--ck-dropdown-color":"#848D9A","--ck-dropdown-background":"#FFFFFF","--ck-dropdown-box-shadow":"0px 2px 15px rgba(0, 0, 0, 0.15)","--ck-dropdown-border-radius":"16px","--ck-alert-color":"#848D9A","--ck-alert-background":"#F5F7F9","--ck-qr-border-radius":"24px","--ck-qr-dot-color":"#111111","--ck-qr-border-color":"#DFE4EC","--ck-modal-h1-font-weight":"700","--ck-modal-heading-font-weight":"700","--ck-primary-button-font-weight":"700","--ck-recent-badge-box-shadow":"inset 0 0 0 2px currentColor","--ck-recent-badge-top-offset":"0px","--ck-siwe-border":"#DFE4EC"},nouns={"--ck-font-family":'"PT Root UI",ui-rounded,"Nunito",-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,"Apple Color Emoji",Arial,sans-serif,"Segoe UI Emoji","Segoe UI Symbol"',"--ck-border-radius":"24px","--ck-connectbutton-font-size":"16px","--ck-connectbutton-font-weight":"700","--ck-connectbutton-border-radius":"10px","--ck-connectbutton-color":"#151C3B","--ck-connectbutton-background":"#ffffff","--ck-connectbutton-box-shadow":"inset 0 0 0 1px #D6D8E1","--ck-connectbutton-hover-background":"#E9EBF3","--ck-connectbutton-hover-box-shadow":"inset 0 0 0 1px #D4D8E8","--ck-connectbutton-active-background":"#D4D8E8","--ck-connectbutton-active-box-shadow":"inset 0 0 0 1px #D4D8E8","--ck-connectbutton-balance-color":"#373737","--ck-connectbutton-balance-background":"#F6F7F9","--ck-connectbutton-balance-box-shadow":"none","--ck-connectbutton-balance-hover-background":"#f1f1f3","--ck-primary-button-border-radius":"16px","--ck-primary-button-color":"#151C3B","--ck-primary-button-background":"#ffffff","--ck-primary-button-font-weight":"700","--ck-primary-button-hover-background":"#DEE1ED","--ck-secondary-button-border-radius":"16px","--ck-secondary-button-color":"#151C3B","--ck-secondary-button-background":"#ffffff","--ck-secondary-button-font-weight":"700","--ck-secondary-button-hover-background":"#DEE1ED","--ck-focus-color":"#1A88F8","--ck-modal-box-shadow":"0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-overlay-background":"rgba(213, 215, 225, 0.8)","--ck-overlay-backdrop-filter":"blur(6px)","--ck-body-color":"#151C3B","--ck-body-color-muted":"#757A8E","--ck-body-color-muted-hover":"#000000","--ck-body-background":"#F4F4F8","--ck-body-background-transparent":"rgba(255,255,255,0)","--ck-body-background-secondary":"#E9E9F1","--ck-body-background-secondary-hover-background":"#e0e4eb","--ck-body-background-tertiary":"#E9E9F1","--ck-tertiary-border-radius":"24px","--ck-body-action-color":"#79809C","--ck-body-divider":"#D9DBE3","--ck-body-color-danger":"#FF4E4E","--ck-body-color-valid":"#32D74B","--ck-body-disclaimer-background":"#F9FAFA","--ck-body-disclaimer-color":"#AFB1B6","--ck-body-disclaimer-link-color":"#787B84","--ck-body-disclaimer-link-hover-color":"#000000","--ck-copytoclipboard-stroke":"#79809C","--ck-tooltip-background":"#ffffff","--ck-tooltip-background-secondary":"#ffffff","--ck-tooltip-color":"#999999","--ck-tooltip-shadow":"0px 2px 10px rgba(0, 0, 0, 0.08)","--ck-spinner-color":"var(--ck-focus-color)","--ck-dropdown-button-color":"#999999","--ck-dropdown-button-box-shadow":"0 0 0 1px rgba(0, 0, 0, 0.01), 0px 0px 7px rgba(0, 0, 0, 0.05)","--ck-dropdown-button-background":"#fff","--ck-dropdown-button-hover-color":"#8B8B8B","--ck-dropdown-button-hover-background":"#DEE1ED","--ck-dropdown-button-hover-box-shadow":"0px 0px 7px rgba(0, 0, 0, 0.05)","--ck-dropdown-color":"#757A8E","--ck-dropdown-box-shadow":"0 0 0 1px rgba(0, 0, 0, 0.01), 0px 0px 7px rgba(0, 0, 0, 0.05)","--ck-alert-color":"#9196A1","--ck-alert-background":"#F6F8FA","--ck-alert-box-shadow":"inset 0 0 0 1px rgba(0, 0, 0, 0.04)","--ck-alert-border-radius":"8px","--ck-qr-border-radius":"24px","--ck-qr-dot-color":"#000000","--ck-qr-background":"#ffffff","--ck-recent-badge-color":"#79809C","--ck-recent-badge-background":"#F4F4F8","--ck-recent-badge-box-shadow":"none","--ck-siwe-border":"#DFE4EC","--ck-graphic-primary-background":"#fff","--ck-graphic-compass-background":"#fff","--ck-graphic-primary-box-shadow":"0px 2.94737px 14.7368px rgba(0, 0, 0, 0.1)","--ck-graphic-compass-box-shadow":"0px 2px 9px rgba(0, 0, 0, 0.15)"},predefinedThemes={base:base$m,web95,retro,soft,midnight,minimal:minimal$1,rounded,nouns};const themeGlobals={default:{"--ck-font-family":`-apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica,
'Apple Color Emoji', Arial, sans-serif, 'Segoe UI Emoji',
'Segoe UI Symbol'`,"--ck-border-radius":"20px","--ck-secondary-button-border-radius":"16px"},graphics:{light:{"--ck-graphic-wave-stop-01":"#E8F17D","--ck-graphic-wave-stop-02":"#A8ECDE","--ck-graphic-wave-stop-03":"#7AA1F2","--ck-graphic-wave-stop-04":"#DEA1E8","--ck-graphic-wave-stop-05":"#F46D98","--ck-graphic-scaniconwithlogos-01":"#4E4E4E","--ck-graphic-scaniconwithlogos-02":"#272727","--ck-graphic-scaniconwithlogos-03":"#F8D74A","--ck-graphic-scaniconwithlogos-04":"#F6F7F9","--ck-chain-ethereum-01":"#25292E","--ck-chain-ethereum-02":"#fff","--ck-chain-ethereum-03":"#DFE0E0"},dark:{"--ck-graphic-wave-stop-01":"#E8F17D","--ck-graphic-wave-stop-02":"#A8ECDE","--ck-graphic-wave-stop-03":"#7AA1F2","--ck-graphic-wave-stop-04":"#DEA1E8","--ck-graphic-wave-stop-05":"#F46D98","--ck-graphic-scaniconwithlogos-01":"#AFAFAF","--ck-graphic-scaniconwithlogos-02":"#696969","--ck-graphic-scaniconwithlogos-03":"#F8D74A","--ck-graphic-scaniconwithlogos-04":"#3D3D3D"}},ens:{light:{"--ck-ens-01-start":"#FF3B30","--ck-ens-01-stop":"#FF9500","--ck-ens-02-start":"#FF9500","--ck-ens-02-stop":"#FFCC00","--ck-ens-03-start":"#FFCC00","--ck-ens-03-stop":"#34C759","--ck-ens-04-start":"#5856D6","--ck-ens-04-stop":"#AF52DE","--ck-ens-05-start":"#5AC8FA","--ck-ens-05-stop":"#007AFF","--ck-ens-06-start":"#007AFF","--ck-ens-06-stop":"#5856D6","--ck-ens-07-start":"#5856D6","--ck-ens-07-stop":"#AF52DE","--ck-ens-08-start":"#AF52DE","--ck-ens-08-stop":"#FF2D55"},dark:{"--ck-ens-01-start":"#FF453A","--ck-ens-01-stop":"#FF9F0A","--ck-ens-02-start":"#FF9F0A","--ck-ens-02-stop":"#FFD60A","--ck-ens-03-start":"#FFD60A","--ck-ens-03-stop":"#32D74B","--ck-ens-04-start":"#32D74B","--ck-ens-04-stop":"#64D2FF","--ck-ens-05-start":"#64D2FF","--ck-ens-05-stop":"#0A84FF","--ck-ens-06-start":"#0A84FF","--ck-ens-06-stop":"#5E5CE6","--ck-ens-07-start":"#5E5CE6","--ck-ens-07-stop":"#BF5AF2","--ck-ens-08-start":"#BF5AF2","--ck-ens-08-stop":"#FF2D55"}},brand:{"--ck-family-brand":"#1A88F8","--ck-brand-walletConnect":"#3B99FC","--ck-brand-coinbaseWallet":"#0052FF","--ck-brand-metamask":"#f6851b","--ck-brand-metamask-01":"#F6851B","--ck-brand-metamask-02":"#E2761B","--ck-brand-metamask-03":"#CD6116","--ck-brand-metamask-04":"#161616","--ck-brand-metamask-05":"#763D16","--ck-brand-metamask-06":"#D7C1B3","--ck-brand-metamask-07":"#C0AD9E","--ck-brand-metamask-08":"#E4761B","--ck-brand-metamask-09":"#233447","--ck-brand-metamask-10":"#E4751F","--ck-brand-metamask-11":"#FEF5E7","--ck-brand-metamask-12":"#E3C8AB","--ck-brand-trust-01":"#3375BB","--ck-brand-trust-02":"#ffffff","--ck-brand-trust-01b":"#ffffff","--ck-brand-trust-02b":"#3375BB","--ck-brand-argent":"#f36a3d","--ck-brand-imtoken-01":"#11C4D1","--ck-brand-imtoken-02":"#0062AD","--ck-brand-safe":"#12FF80","--ck-brand-dawn":"#000000"}},themeColors={light:predefinedThemes.base.light,dark:predefinedThemes.base.dark,web95:predefinedThemes.web95,retro:predefinedThemes.retro,soft:predefinedThemes.soft,midnight:predefinedThemes.midnight,minimal:predefinedThemes.minimal,rounded:predefinedThemes.rounded,nouns:predefinedThemes.nouns},createCssVars=(et,o)=>Ae`
${Object.keys(et).map(tt=>{const rt=et[tt];return rt&&`${tt}:${rt};`})}
`,createCssColors=(et,o)=>{const tt=o?" !important":"";return Ae`
${Object.keys(et).map(rt=>{const nt=et[rt];return nt&&`${rt}:${nt}${tt};`})}
@supports (color: color(display-p3 1 1 1)) {
${Object.keys(et).map(rt=>{const nt=et[rt];return`${rt}:${hexToP3(nt)}${tt};`})}
}
`},themes={default:createCssVars(themeGlobals.default),light:createCssColors(themeColors.light),dark:createCssColors(themeColors.dark),web95:createCssColors(themeColors.web95),retro:createCssColors(themeColors.retro),soft:createCssColors(themeColors.soft),midnight:createCssColors(themeColors.midnight),minimal:createCssColors(themeColors.minimal),rounded:createCssColors(themeColors.rounded),nouns:createCssColors(themeColors.nouns)},globals={brand:createCssVars(themeGlobals.brand),ensLight:createCssVars(themeGlobals.ens.light),ensDark:createCssVars(themeGlobals.ens.dark),graphicsLight:createCssVars(themeGlobals.graphics.light),graphicsDark:createCssVars(themeGlobals.graphics.dark)},globalsLight=Ae`
${globals.brand}
${globals.ensLight}
${globals.graphicsLight}
`,globalsDark=Ae`
${globals.brand}
${globals.ensDark}
${globals.graphicsDark}
`;let mode="auto";const ResetContainer=styled(motion.div)`
${themes.default}
${et=>{switch(et.$useTheme){case"web95":return mode="light",themes.web95;case"retro":return mode="light",themes.retro;case"soft":return mode="light",themes.soft;case"midnight":return mode="dark",themes.midnight;case"minimal":return mode="light",themes.minimal;case"rounded":return mode="light",themes.rounded;case"nouns":return mode="light",themes.nouns;default:return et.$useMode==="light"?(mode="light",themes.light):et.$useMode==="dark"?(mode="dark",themes.dark):Ae`
@media (prefers-color-scheme: light) {
${themes.light}
}
@media (prefers-color-scheme: dark) {
${themes.dark}
}
`}}}
${et=>{switch(mode){case"light":return globalsLight;case"dark":return globalsDark;default:return Ae`
${globalsLight}
@media (prefers-color-scheme: dark) {
${globalsDark}
}
`}}}
${et=>{var o;if(et.$customTheme&&et.$customTheme["--ck-accent-color"]&&["light","dark","auto","",void 0].includes(et.$useTheme)){const tt=et.$customTheme["--ck-accent-color"],rt=(o=et.$customTheme["--ck-accent-text-color"])!==null&&o!==void 0?o:"#ffffff";return{"--ck-accent-color":tt,"--ck-accent-text-color":rt,"--ck-secondary-button-background":tt,"--ck-secondary-button-hover-background":tt,"--ck-secondary-button-color":rt,"--ck-button-primary-color":rt,"--ck-focus-color":tt}}if(et.$customTheme)return createCssColors(et.$customTheme,!0)}}
all: initial;
text-align: left;
text-direction: ltr;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-text-stroke: 0.001px transparent;
text-size-adjust: none;
font-size: 16px;
button {
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-text-stroke: 0.001px transparent;
}
&,
* {
font-family: var(--ck-font-family);
box-sizing: border-box;
outline: none;
border: none;
}
/*
@media (prefers-reduced-motion) {
* {
animation-duration: 60ms !important;
transition-duration: 60ms !important;
}
}
*/
img,
svg {
max-width: 100%;
}
strong {
font-weight: 600;
}
a:focus-visible,
button:focus-visible {
outline: 2px solid var(--ck-focus-color);
}
`,Portal=et=>{et={selector:"__CONNECTKIT__",...et};const{selector:o,children:tt}=et,rt=reactExports.useRef(null),[nt,ot]=reactExports.useState(!1);return reactExports.useEffect(()=>{const it="#"+o.replace(/^#/,"");if(rt.current=document.querySelector(it),!rt.current){const st=document.createElement("div");st.setAttribute("id",o),st.setAttribute("data-connectkit",`${CONNECTKIT_VERSION}`),document.body.appendChild(st),rt.current=st}ot(!0)},[o]),rt.current&&nt?reactDomExports.createPortal(tt,rt.current):null};var defaultTheme={mobileWidth:560};const ErrorMessage=styled(motion.div)`
z-index: -1;
pointer-events: auto;
position: absolute;
left: 50%;
transform: translateX(-50%);
width: var(--width);
top: 64px;
color: #fff;
font-size: 14px;
line-height: 20px;
font-weight: 500;
background: var(--ck-body-color-danger);
border-radius: 20px;
padding: 24px 46px 82px 24px;
transition: width var(--duration) var(--ease);
a {
font-weight: 700;
text-decoration: underline;
}
code {
font-size: 0.9em;
display: inline-block;
font-family: monospace;
margin: 1px;
padding: 0 4px;
border-radius: 8px;
font-weight: bold;
background: rgba(255, 255, 255, 0.1);
}
`,FadeIn=We`
from { opacity: 0; }
to { opacity: 1; }
`,FadeInScaleUp=We`
from { opacity: 0; transform: scale(0.85); }
to { opacity: 1; transform: scale(1); }
`,FadeInScaleDown=We`
from { opacity: 0; transform: scale(1.1); }
to { opacity: 1; transform: scale(1); }
`,FadeOut=We`
from { opacity: 1; }
to { opacity: 0; }
`,FadeOutScaleUp=We`
from { opacity: 1; transform: scale(1); }
to { opacity: 0; transform: scale(1.1); }
`,FadeOutScaleDown=We`
from { opacity: 1; transform: scale(1); }
to { opacity: 0; transform: scale(0.85); }
`,PageContent=styled(motion.div)`
max-width: 100%;
width: 295px;
padding-top: 48px;
`,TextWithHr=styled(motion.div)`
user-select: none;
position: relative;
display: block;
text-align: center;
color: var(--ck-body-color-muted);
font-size: 15px;
font-weight: 400;
line-height: 21px;
span {
z-index: 2;
position: relative;
display: inline-block;
user-select: none;
pointer-events: none;
padding: 0 14px;
background: var(--ck-body-background);
transition: background-color 200ms ease;
}
&:before {
z-index: 2;
content: '';
position: absolute;
top: 50%;
left: 0;
right: 0;
height: 1px;
transform: translateY(-1px);
background: var(--ck-body-divider);
box-shadow: var(--ck-body-divider-box-shadow);
}
`,ModalHeading=styled(motion.div)`
z-index: 3;
pointer-events: none;
user-select: none;
position: absolute;
top: 25px;
left: 50%;
display: flex;
align-items: center;
justify-content: center;
height: 26px;
transform: translateX(-50%);
width: var(--width);
text-align: center;
font-size: 17px;
line-height: 20px;
font-weight: var(--ck-modal-heading-font-weight, 600);
color: var(--ck-body-color);
span {
display: inline-block;
}
`,ModalContentContainer=styled(motion.div)`
position: relative;
padding: 0;
`,ModalContent=styled(motion.div)`
left: 0;
right: 0;
text-align: center;
display: flex;
flex-direction: column;
gap: 12px;
padding: 0 0 16px;
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
display: block;
}
`,ModalH1=styled(motion.h1)`
margin: 0;
padding: 0;
line-height: ${et=>et.$small?20:22}px;
font-size: ${et=>et.$small?17:19}px;
font-weight: var(--ck-modal-h1-font-weight, 600);
color: ${et=>et.$error?"var(--ck-body-color-danger)":et.$valid?"var(--ck-body-color-valid)":"var(--ck-body-color)"};
> svg {
position: relative;
top: -2px;
display: inline-block;
vertical-align: middle;
margin-right: 6px;
}
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
margin-bottom: 6px;
font-size: 17px;
}
`,ModalBody=styled.div`
font-size: 16px;
font-weight: 400;
line-height: 21px;
color: var(--ck-body-color-muted);
strong {
font-weight: 500;
color: var(--ck-body-color);
}
`;styled.div`
padding: 0 12px;
font-size: 13px;
font-weight: 400;
line-height: 16px;
color: var(--ck-body-color-muted);
strong {
font-weight: 500;
color: var(--ck-body-color);
}
`;const BackgroundOverlay=styled(motion.div)`
z-index: 1;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: var(--ck-overlay-background, rgba(71, 88, 107, 0.24));
backdrop-filter: ${et=>et.$blur?`blur(${et.$blur}px)`:"var(--ck-overlay-backdrop-filter, none)"};
opacity: 0;
animation: ${et=>et.$active?FadeIn:FadeOut} 150ms ease-out
both;
`,BoxIn=We`
from{ opacity: 0; transform: scale(0.97); }
to{ opacity: 1; transform: scale(1); }
`,BoxOut=We`
from{ opacity: 1; transform: scale(1); }
to{ opacity: 0; transform: scale(0.97); }
`,MobileBoxIn=We`
from { transform: translate3d(0, 100%, 0); }
to { transform: translate3d(0, 0%, 0); }
`,MobileBoxOut=We`
from { opacity: 1; }
to { opacity: 0; }
`,BoxContainer=styled(motion.div)`
z-index: 2;
position: relative;
color: var(--ck-body-color);
animation: 150ms ease both;
animation-name: ${BoxOut};
&.active {
animation-name: ${BoxIn};
}
&:before {
content: '';
position: absolute;
top: 0;
bottom: 0;
left: 50%;
width: var(--width);
height: var(--height);
transform: translateX(-50%);
backface-visibility: hidden;
transition: all 200ms ease;
border-radius: var(--ck-border-radius, 20px);
background: var(--ck-body-background);
box-shadow: var(--ck-modal-box-shadow);
}
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
animation-name: ${MobileBoxOut};
animation-duration: 130ms;
animation-timing-function: ease;
&.active {
animation-name: ${MobileBoxIn};
animation-duration: 300ms;
animation-delay: 32ms;
animation-timing-function: cubic-bezier(0.15, 1.15, 0.6, 1);
}
&:before {
width: 100%;
transition: 0ms height cubic-bezier(0.15, 1.15, 0.6, 1);
will-change: height;
}
}
`,ControllerContainer=styled(motion.div)`
z-index: 3;
position: absolute;
top: 0;
left: 50%;
height: 64px;
transform: translateX(-50%);
backface-visibility: hidden;
width: var(--width);
transition: 0.2s ease width;
pointer-events: auto;
//border-bottom: 1px solid var(--ck-body-divider);
`,InnerContainer$1=styled(motion.div)`
position: relative;
overflow: hidden;
height: var(--height);
transition: 0.2s ease height;
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
transition: 0ms height cubic-bezier(0.15, 1.15, 0.6, 1);
/* animation-delay: 34ms; */
}
`,PageContainer=styled(motion.div)`
z-index: 2;
position: relative;
top: 0;
left: 50%;
margin-left: calc(var(--width) / -2);
width: var(--width);
/* left: 0; */
/* width: 100%; */
display: flex;
justify-content: center;
align-items: center;
transform-origin: center center;
animation: 200ms ease both;
&.active {
animation-name: ${FadeInScaleDown};
}
&.active-scale-up {
animation-name: ${FadeInScaleUp};
}
&.exit-scale-down {
z-index: 1;
pointer-events: none;
position: absolute;
/* top: 0; */
/* left: 0; */
animation-name: ${FadeOutScaleDown};
}
&.exit {
z-index: 1;
pointer-events: none;
position: absolute;
/* top: 0; */
/* left: 0; */
/* left: 50%; */
/* transform: translateX(-50%); */
animation-name: ${FadeOutScaleUp};
animation-delay: 16.6667ms;
}
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
/* animation: 0ms ease both; */
/* animation-delay: 35ms; */
animation: 0ms cubic-bezier(0.15, 1.15, 0.6, 1) both;
&.active {
animation-name: ${FadeIn};
}
&.active-scale-up {
animation-name: ${FadeIn};
}
&.exit-scale-down {
z-index: 3;
animation-name: ${FadeOut};
}
&.exit {
z-index: 3;
animation-name: ${FadeOut};
animation-delay: 0ms;
}
}
`,PageContents=styled(motion.div)`
margin: 0 auto;
width: fit-content;
padding: 29px 24px 24px;
backface-visibility: hidden;
`,ModalContainer=styled.div`
z-index: 2147483646; // z-index set one below max (2147483647) for if we wish to layer things ontop of the modal in a seperate Portal
position: fixed;
inset: 0;
`,CloseButton=styled(motion.button)`
z-index: 3;
cursor: pointer;
position: absolute;
top: 22px;
right: 17px;
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 16px;
padding: 0;
margin: 0;
color: var(--ck-body-action-color);
background: var(--ck-body-background);
transition: background-color 200ms ease, transform 100ms ease;
/* will-change: transform; */
svg {
display: block;
}
&:hover {
background: var(--ck-body-background-secondary);
}
&:active {
transform: scale(0.9);
}
`,SiweButton=styled(motion.button)`
z-index: 3;
position: absolute;
inset: 0;
width: 100%; // FireFox fix
display: flex;
align-items: center;
justify-content: center;
border-radius: 16px;
padding: 0;
margin: 0;
color: var(--ck-body-action-color);
background: var(--ck-body-background);
transition: background-color 200ms ease, transform 100ms ease;
/* will-change: transform; */
svg {
display: block;
position: relative;
}
&:enabled {
cursor: pointer;
&:hover {
background: var(--ck-body-background-secondary);
}
&:active {
transform: scale(0.9);
}
}
`,BackButton=styled(motion.button)`
z-index: 3;
position: absolute;
inset: 0;
width: 100%; // FireFox fix
display: flex;
align-items: center;
justify-content: center;
border-radius: 16px;
padding: 0;
margin: 0;
color: var(--ck-body-action-color);
background: var(--ck-body-background);
transition: background-color 200ms ease, transform 100ms ease;
/* will-change: transform; */
svg {
display: block;
position: relative;
left: -1px;
}
&:enabled {
cursor: pointer;
&:hover {
background: var(--ck-body-background-secondary);
}
&:active {
transform: scale(0.9);
}
}
`,InfoButton=styled(motion.button)`
z-index: 3;
position: absolute;
inset: 0;
width: 100%; // FireFox fix
transform: translateX(-1px);
display: flex;
align-items: center;
justify-content: center;
border-radius: 16px;
padding: 0;
margin: 0;
color: var(--ck-body-action-color);
background: var(--ck-body-background);
transition: background-color 200ms ease, transform 100ms ease;
/* will-change: transform; */
svg {
display: block;
position: relative;
}
&:enabled {
cursor: pointer;
&:hover {
background: var(--ck-body-background-secondary);
}
&:active {
transform: scale(0.9);
}
}
`,Container$7=styled(motion.div)`
--ease: cubic-bezier(0.25, 0.1, 0.25, 1);
--duration: 200ms;
--transition: height var(--duration) var(--ease),
width var(--duration) var(--ease);
z-index: 3;
display: block;
pointer-events: none;
position: absolute;
left: 50%;
top: 50%;
width: 100%;
transform: translate3d(-50%, -50%, 0);
backface-visibility: hidden;
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
pointer-events: auto;
left: 0;
top: auto;
bottom: -5px;
transform: none;
${BoxContainer} {
max-width: 448px;
margin: 0 auto;
&:before {
width: 100%;
border-radius: var(--ck-border-radius, 30px)
var(--ck-border-radius, 30px) 0 0;
}
}
${PageContainer} {
left: 0;
right: 0;
margin: 0 auto;
width: auto;
}
${PageContent} {
margin: 0 auto;
width: 100% !important;
}
${ModalHeading} {
top: 29px;
}
${ModalContent} {
gap: 12px;
}
${ModalBody} {
margin: 0 auto;
max-width: 295px;
}
${PageContents} {
width: 100%;
padding: 31px 24px;
}
${ControllerContainer} {
width: 100%;
top: 4px;
border-bottom: 0;
}
${CloseButton} {
right: 22px;
}
${BackButton} {
top: -1px;
left: -3px;
}
${InfoButton} {
top: -1px;
left: -3px;
svg {
width: 65%;
height: auto;
}
}
${CloseButton},
${BackButton},
${InfoButton} {
// Quick hack for bigger tappable area on mobile
transform: scale(1.4) !important;
background: transparent !important;
svg {
transform: scale(0.8) !important;
}
}
}
`,Disclaimer=styled(motion.div)`
display: flex;
align-items: center;
justify-content: center;
margin: 16px -24px -24px -24px;
padding: 15px 40px 18px;
font-size: var(--ck-body-disclaimer-font-size, 13px);
font-weight: var(--ck-body-disclaimer-font-weight, 400);
text-align: center;
line-height: 19px;
color: var(--ck-body-disclaimer-color, var(--ck-body-color-muted, inherit));
& a {
color: var(--ck-body-disclaimer-link-color, inherit);
font-weight: var(--ck-body-disclaimer-font-weight, 400);
text-decoration: none;
transition: color 200ms ease;
&:hover {
color: var(--ck-body-disclaimer-link-hover-color, inherit);
}
}
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
margin: 24px -24px -26px -24px;
padding: 20px 42px 22px 42px;
}
`,DisclaimerBackground=styled(motion.div)`
pointer-events: all;
z-index: 9;
position: absolute;
bottom: 0;
left: 50%;
width: var(--width);
backface-visibility: hidden;
transform: translateX(-50%);
transform-origin: bottom center;
border-radius: var(--ck-border-radius, 30px);
border-top-left-radius: 0;
border-top-right-radius: 0;
transition: width 200ms ease;
background: var(
--ck-body-disclaimer-background,
var(--ck-body-background-secondary)
);
box-shadow: var(--ck-body-disclaimer-box-shadow);
${Disclaimer} {
margin: 0 !important;
/* visibility: hidden; */
}
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
border-radius: 0;
}
`,SignInTooltip=styled(motion.div)`
z-index: 2;
position: absolute;
top: 100%;
white-space: nowrap;
padding: 8px 16px;
color: #fff;
font-size: 13px;
line-height: 1.5;
background: #1a88f8;
border-radius: calc(var(--ck-border-radius) * 0.75);
transform: translateY(8px) translateX(-48px);
box-shadow: var(--ck-modal-box-shadow);
&:before {
content: '';
position: absolute;
box-shadow: var(--shadow);
width: 18px;
height: 18px;
transform: translate(215%, -75%) rotate(45deg);
background: inherit;
border-radius: 3px 0 0 0;
}
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
transform: translateY(8px) translateX(-16px);
&:before {
transform: translate(40%, -75%) rotate(45deg);
}
}
`,useIsomorphicLayoutEffect$2=typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect;function useLockBodyScroll(et){const[o,tt]=reactExports.useState(et),rt=useContext();return useIsomorphicLayoutEffect$2(()=>{var nt;if(!o)return;const ot={overflow:document.body.style.overflow,position:document.body.style.position,touchAction:document.body.style.touchAction,paddingRight:document.body.style.paddingRight},it=getComputedStyle(document.body),st=parseInt(it.marginRight)+parseInt(it.paddingRight)+parseInt(it.borderRight)+parseInt(it.marginLeft)+parseInt(it.paddingLeft)+parseInt(it.borderLeft),at=window.innerWidth-document.body.offsetWidth-st;return document.documentElement.style.setProperty("--ck-scrollbar-width",`${at}px`),document.body.style.overflow="hidden",document.body.style.position="relative",document.body.style.touchAction="none",!((nt=rt.options)===null||nt===void 0)&&nt.avoidLayoutShift&&(document.body.style.paddingRight=`${at}px`),()=>{var ct;document.documentElement.style.removeProperty("--ck-scrollbar-width"),document.body.style.overflow=ot.overflow,document.body.style.position=ot.position,document.body.style.touchAction=ot.touchAction,!((ct=rt.options)===null||ct===void 0)&&ct.avoidLayoutShift&&(document.body.style.paddingRight=ot.paddingRight)}},[o]),reactExports.useEffect(()=>{o!==et&&tt(et)},[et]),[o,tt]}const KEYCODE_TAB=9;function useFocusTrap(){const et=reactExports.useRef(null);function o(tt){if(et.current){var rt=et.current.querySelectorAll(`
a[href]:not(:disabled),
button:not(:disabled),
textarea:not(:disabled),
input[type="text"]:not(:disabled),
input[type="radio"]:not(:disabled),
input[type="checkbox"]:not(:disabled),
select:not(:disabled)
`),nt=rt[0],ot=rt[rt.length-1],it=tt.key==="Tab"||tt.keyCode===KEYCODE_TAB;it&&(tt.shiftKey?document.activeElement===nt&&(ot.focus(),tt.preventDefault()):document.activeElement===ot&&(nt.focus(),tt.preventDefault()))}}return reactExports.useEffect(()=>(et.current&&(et.current.addEventListener("keydown",o),et.current.focus({preventScroll:!0})),()=>{et.current&&et.current.removeEventListener("keydown",o)}),[]),et}function FocusTrap(et){const o=useFocusTrap();return reactExports.useEffect(()=>{o.current&&o.current.focus({preventScroll:!0})},[]),jsxRuntimeExports.jsx("div",{ref:o,tabIndex:0,children:et.children})}function usePrevious(et,o){const tt=reactExports.useRef({target:et,previous:o});return tt.current.target!==et&&(tt.current.previous=tt.current.target,tt.current.target=et),tt.current.previous}const Context$1=reactExports.createContext(null),ConnectKitThemeProvider=({children:et,theme:o="auto",mode:tt="auto",customTheme:rt})=>{const nt={theme:o,mode:tt,customTheme:rt};return reactExports.createElement(Context$1.Provider,{value:nt},jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:et}))},useThemeContext=()=>{const et=React.useContext(Context$1);if(!et)throw Error("ConnectKitThemeProvider must be inside a Provider.");return et},ExternalLinkIcon=({...et})=>jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{left:0,top:0},...et,children:[jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 4C2.89543 4 2 4.89543 2 6V12C2 13.1046 2.89543 14 4 14H10C11.1046 14 12 13.1046 12 12V9.66667C12 9.11438 12.4477 8.66667 13 8.66667C13.5523 8.66667 14 9.11438 14 9.66667V12C14 14.2091 12.2091 16 10 16H4C1.79086 16 0 14.2091 0 12V6C0 3.79086 1.79086 2 4 2H6.33333C6.88562 2 7.33333 2.44772 7.33333 3C7.33333 3.55228 6.88562 4 6.33333 4H4Z",fill:"currentColor",fillOpacity:.3}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.5 1C9.5 0.447715 9.94772 0 10.5 0H15C15.5523 0 16 0.447715 16 1V5.5C16 6.05228 15.5523 6.5 15 6.5C14.4477 6.5 14 6.05228 14 5.5V3.41421L8.70711 8.70711C8.31658 9.09763 7.68342 9.09763 7.29289 8.70711C6.90237 8.31658 6.90237 7.68342 7.29289 7.29289L12.5858 2H10.5C9.94772 2 9.5 1.55228 9.5 1Z",fill:"currentColor",fillOpacity:.3})]}),AlertIcon=({...et})=>jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"19",height:"18",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...et,children:[jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.81753 1.60122C7.39283 0.530035 8.46953 0 9.50409 0C10.5507 0 11.6022 0.539558 12.1805 1.59767L18.6047 13.3334C18.882 13.8283 19 14.3568 19 14.8622C19 16.5296 17.7949 18 15.9149 18H3.08514C1.20508 18 0 16.5296 0 14.8622C0 14.3454 0.131445 13.8172 0.405555 13.3379L6.81753 1.60122ZM9.50409 2C9.13355 2 8.77256 2.18675 8.57866 2.54907L8.57458 2.5567L2.14992 14.3166L2.144 14.3268C2.04638 14.4959 2 14.6817 2 14.8622C2 15.5497 2.43032 16 3.08514 16H15.9149C16.5697 16 17 15.5497 17 14.8622C17 14.6681 16.9554 14.4805 16.8588 14.309L16.8529 14.2986L10.4259 2.55741C10.2191 2.1792 9.86395 2 9.50409 2Z",fill:"currentColor"}),jsxRuntimeExports.jsx("path",{d:"M9.5 11.2297C9.01639 11.2297 8.7459 10.9419 8.72951 10.4186L8.60656 6.4157C8.59016 5.88372 8.95902 5.5 9.4918 5.5C10.0164 5.5 10.4016 5.89244 10.3852 6.42442L10.2623 10.4099C10.2377 10.9419 9.96721 11.2297 9.5 11.2297ZM9.5 14.5C8.95082 14.5 8.5 14.0901 8.5 13.5058C8.5 12.9215 8.95082 12.5116 9.5 12.5116C10.0492 12.5116 10.5 12.9128 10.5 13.5058C10.5 14.0988 10.041 14.5 9.5 14.5Z",fill:"currentColor"})]}),DisconnectIcon=({...et})=>jsxRuntimeExports.jsx("svg",{"aria-hidden":"true",width:"15",height:"14",viewBox:"0 0 15 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{left:0,top:0},...et,children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 0C1.79086 0 0 1.79086 0 4V10C0 12.2091 1.79086 14 4 14H6C6.55228 14 7 13.5523 7 13C7 12.4477 6.55228 12 6 12H4C2.89543 12 2 11.1046 2 10V4C2 2.89543 2.89543 2 4 2H6C6.55228 2 7 1.55228 7 1C7 0.447715 6.55228 0 6 0H4ZM11.7071 3.29289C11.3166 2.90237 10.6834 2.90237 10.2929 3.29289C9.90237 3.68342 9.90237 4.31658 10.2929 4.70711L11.5858 6H9.5H6C5.44772 6 5 6.44772 5 7C5 7.55228 5.44772 8 6 8H9.5H11.5858L10.2929 9.29289C9.90237 9.68342 9.90237 10.3166 10.2929 10.7071C10.6834 11.0976 11.3166 11.0976 11.7071 10.7071L14.7071 7.70711C15.0976 7.31658 15.0976 6.68342 14.7071 6.29289L11.7071 3.29289Z",fill:"currentColor",fillOpacity:"0.4"})}),TickIcon=({...et})=>jsxRuntimeExports.jsx("svg",{"aria-hidden":"true",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...et,children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 18C13.9706 18 18 13.9706 18 9C18 4.02944 13.9706 0 9 0C4.02944 0 0 4.02944 0 9C0 13.9706 4.02944 18 9 18ZM13.274 7.13324C13.6237 6.70579 13.5607 6.07577 13.1332 5.72604C12.7058 5.37632 12.0758 5.43932 11.726 5.86676L7.92576 10.5115L6.20711 8.79289C5.81658 8.40237 5.18342 8.40237 4.79289 8.79289C4.40237 9.18342 4.40237 9.81658 4.79289 10.2071L7.29289 12.7071C7.49267 12.9069 7.76764 13.0128 8.04981 12.9988C8.33199 12.9847 8.59505 12.8519 8.77396 12.6332L13.274 7.13324Z",fill:"currentColor"})}),RetryIconCircle=({...et})=>jsxRuntimeExports.jsx("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...et,children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M32 16C32 24.8366 24.8366 32 16 32C7.16344 32 0 24.8366 0 16C0 7.16344 7.16344 0 16 0C24.8366 0 32 7.16344 32 16ZM24.5001 8.74263C25.0834 8.74263 25.5563 9.21551 25.5563 9.79883V14.5997C25.5563 15.183 25.0834 15.6559 24.5001 15.6559H19.6992C19.1159 15.6559 18.643 15.183 18.643 14.5997C18.643 14.0164 19.1159 13.5435 19.6992 13.5435H21.8378L20.071 11.8798C20.0632 11.8724 20.0555 11.865 20.048 11.8574C19.1061 10.915 17.8835 10.3042 16.5643 10.1171C15.2452 9.92999 13.9009 10.1767 12.7341 10.82C11.5674 11.4634 10.6413 12.4685 10.0955 13.684C9.54968 14.8994 9.41368 16.2593 9.70801 17.5588C10.0023 18.8583 10.711 20.0269 11.7273 20.8885C12.7436 21.7502 14.0124 22.2582 15.3425 22.336C16.6726 22.4138 17.9919 22.0572 19.1017 21.3199C19.5088 21.0495 19.8795 20.7333 20.2078 20.3793C20.6043 19.9515 21.2726 19.9262 21.7004 20.3228C22.1282 20.7194 22.1534 21.3876 21.7569 21.8154C21.3158 22.2912 20.8176 22.7161 20.2706 23.0795C18.7793 24.0702 17.0064 24.5493 15.2191 24.4448C13.4318 24.3402 11.7268 23.6576 10.3612 22.4998C8.9956 21.3419 8.0433 19.7716 7.6478 18.0254C7.2523 16.2793 7.43504 14.4519 8.16848 12.8186C8.90192 11.1854 10.1463 9.83471 11.7142 8.97021C13.282 8.10572 15.0884 7.77421 16.861 8.02565C18.6282 8.27631 20.2664 9.09278 21.5304 10.3525L23.4439 12.1544V9.79883C23.4439 9.21551 23.9168 8.74263 24.5001 8.74263Z",fill:"currentColor"})}),RetryIcon=({...et})=>jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"16",height:"14",viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...et,children:[jsxRuntimeExports.jsx("path",{d:"M14.5 2V6H10.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M14 5.66537L10.9899 2.75871C10.0931 1.83853 8.92897 1.24216 7.6729 1.05947C6.41683 0.876774 5.13688 1.11765 4.02592 1.7458C2.91497 2.37395 2.0332 3.35534 1.5135 4.54208C0.993792 5.72883 0.864305 7.05663 1.14455 8.3254C1.42479 9.59418 2.09958 10.7352 3.06724 11.5765C4.03489 12.4178 5.24298 12.9138 6.50946 12.9898C7.77594 13.0657 9.03219 12.7176 10.0889 11.9977C10.4765 11.7337 10.8295 11.4249 11.142 11.0792",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),CopyToClipboardIcon$1=({...et})=>jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...et,children:[jsxRuntimeExports.jsx("path",{d:"M14 9.5V7C14 5.89543 13.1046 5 12 5H7C5.89543 5 5 5.89543 5 7V12C5 13.1046 5.89543 14 7 14H9.5",stroke:"var(--ck-body-color-muted)",strokeWidth:"2"}),jsxRuntimeExports.jsx("rect",{x:"10",y:"10",width:"9",height:"9",rx:"2",stroke:"var(--ck-body-color-muted)",strokeWidth:"2"}),jsxRuntimeExports.jsx("path",{d:"M1 3L3 5L7 1",stroke:"var(--ck-body-color)",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})]}),AuthIcon=({...et})=>jsxRuntimeExports.jsx("div",{...et,style:{zIndex:2,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",bottom:0,right:0,background:"#34C759",borderRadius:10,boxShadow:"0 0 0 1.5px var(--background)",width:10,height:10,...et==null?void 0:et.style},children:jsxRuntimeExports.jsx("svg",{"aria-hidden":"true",width:"6",height:"6",viewBox:"0 0 6 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M0.75 3L2.25 4.5L5.25 1.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})});var StatusState;(function(et){et.READY="ready",et.LOADING="loading",et.SUCCESS="success",et.REJECTED="rejected",et.ERROR="error"})(StatusState||(StatusState={}));const SIWEContext=reactExports.createContext(null),useSIWE=({onSignIn:et,onSignOut:o}={})=>{const tt=reactExports.useContext(SIWEContext);if(!tt)return{isSignedIn:!1,data:void 0,status:StatusState.ERROR,error:new Error("useSIWE hook must be inside a SIWEProvider."),isRejected:!1,isError:!0,isLoading:!1,isSuccess:!1,isReady:!1,reset:()=>{},signIn:()=>Promise.reject(),signOut:()=>Promise.reject()};const{session:rt,nonce:nt,status:ot,signOut:it,signIn:st,resetStatus:at}=tt,{address:ct,chainId:lt}=rt.data||{},dt=ct?StatusState.SUCCESS:rt.isLoading||nt.isLoading?StatusState.LOADING:ot,ht=dt===StatusState.LOADING,mt=dt===StatusState.SUCCESS,ft=dt===StatusState.REJECTED,pt=dt===StatusState.ERROR,yt=!ct||nt.isFetching||ht||mt,gt=()=>at(),bt=!!ct;return{isSignedIn:bt,data:bt?{address:ct,chainId:lt}:void 0,status:dt,error:rt.error||nt.error,isRejected:ft,isError:pt,isLoading:ht,isSuccess:mt,isReady:yt,signIn:async()=>{if(!bt){const xt=await st();xt&&(et==null||et(xt))}},signOut:async()=>{bt&&(await it(),o==null||o())},reset:gt}},arAE={connectWallet:"الاتصال بالمحفظة",disconnect:"قطع الاتصال",connected:"متصل",wrongNetwork:"شبكة خاطئة",switchNetworks:"تغيير الشبكات",chainNetwork:"شبكة {{ CHAIN }}",copyToClipboard:"نسخ إلى الحافظة",copyCode:"نسخ الكود",moreInformation:"مزيد من المعلومات",back:"عودة",close:"إغلاق",or:"أو",more:"المزيد",tryAgain:"حاول مجددًا",tryAgainQuestion:"هل نحاول مرة أخرى؟",dontHaveTheApp:"ليس لديك التطبيق؟",scanTheQRCode:"مسح رمز الاستجابة السريعة",useWalletConnectModal:"استخدم نموذج ولِيت‌كنيكت",useModal:"استخدم النموذج",installTheExtension:"تثبيت الإضافة",getWalletName:"الحصول على {{ CONNECTORNAME }}",otherWallets:"محافظ أخرى",learnMore:"تعرف على المزيد",getWallet:"الحصول على محفظة",approveInWallet:"الموافقة في المحفظة",confirmInWallet:"تأكيد في المحفظة",awaitingConfirmation:"بانتظار التأكيد",signIn:"تسجيل الدخول",signOut:"تسجيل الخروج",signedIn:"تم تسجيل الدخول",signedOut:"تم تسجيل الخروج",walletNotConnected:"المحفظة غير متصلة",warnings_walletSwitchingUnsupported:"عذرًا، لا تدعم محفظتك تغيير الشبكات من هذا التطبيق.",warnings_walletSwitchingUnsupportedResolve:"حاول تغيير الشبكات من داخل محفظتك بدلاً من ذلك.",warnings_chainUnsupported:"هذا التطبيق غير متوافق مع الشبكة المتصلة حاليًا.",warnings_chainUnsupportedResolve:"للمتابعة، قم بتغيير الشبكة أو قطع الاتصال.",onboardingScreen_heading:"الحصول على محفظة",onboardingScreen_h1:"ابدأ استكشاف الويب3",onboardingScreen_p:"تعتبر محفظتك بوابتك إلى عوالم إيثريوم، التكنولوجيا السحرية التي تمكن استكشاف الويب3.",onboardingScreen_ctaText:"اختر محفظتك الأولى",onboardingScreen_ctaUrl:"https://ethereum.org/ar/wallets/find-wallet/",aboutScreen_heading:"حول المحافظ",aboutScreen_a_h1:"حافظ على أصولك الرقمية",aboutScreen_a_p:"تمكنك المحافظ من إرسال واستقبال وتخزين والتفاعل مع الأصول الرقمية مثل NFTs ورموز إيثريوم الأخرى.",aboutScreen_b_h1:"وسيلة أفضل لتسجيل الدخول",aboutScreen_b_p:"في تطبيقات العصر الحديث، يمكن استخدام محفظتك كوسيلة سهلة لتسجيل الدخول بدلاً من الحاجة إلى تذكر كلمة مرور.",aboutScreen_c_h1:"استكشاف عالم الويب3",aboutScreen_c_p:"تعتبر محفظتك أداة أساسية تمكنك من استكشاف والمشاركة في عالم الويب3 الذي يتطور بسرعة.",aboutScreen_ctaText:"استزيد من المعرفة",aboutScreen_ctaUrl:"https://ethereum.org/ar/wallets/",connectorsScreen_heading:"الاتصال بالمحفظة",connectorsScreen_newcomer:"ليس لدي محفظة",connectorsScreen_h1:"ما هي المحافظ؟",connectorsScreen_p:"تُستخدم المحافظ لإرسال واستقبال وتخزين الأصول الرقمية. يمكنك الاتصال بمحفظة للتفاعل مع التطبيقات.",mobileConnectorsScreen_heading:"اختر محفظة",scanScreen_heading:"مسح باستخدام الهاتف",scanScreen_heading_withConnector:"مسح باستخدام {{ CONNECTORNAME }}",scanScreen_tooltip_walletConnect:`افتح محفظة تدعم ولِيت‌كنيكت
لبدء المسح.`,scanScreen_tooltip_default:"افتح {{ CONNECTORNAME }} على هاتفك للمسح",downloadAppScreen_heading:"الحصول على {{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:`استخدم كاميرا هاتفك للمسح وتنزيله على نظامي iOS أو Android
.`,downloadAppScreen_ios:"استخدم كاميرا هاتفك للمسح وتنزيله على نظام iOS.",downloadAppScreen_android:"استخدم كاميرا هاتفك للمسح وتنزيله على نظام Android.",injectionScreen_unavailable_h1:"المتصفح غير مدعوم",injectionScreen_unavailable_p:"لتوصيل محفظتك {{ CONNECTORSHORTNAME }}، قم بتثبيت الإضافة على متصفح {{ SUGGESTEDEXTENSIONBROWSER }}.",injectionScreen_install_h1:"تثبيت {{ CONNECTORNAME }}",injectionScreen_install_p:"لتوصيل محفظتك {{ CONNECTORSHORTNAME }}، قم بتثبيت الإضافة على المتصفح.",injectionScreen_connecting_h1:"طلب الاتصال",injectionScreen_connecting_p:"افتح إضافة المتصفح {{ CONNECTORSHORTNAME }} لتوصيل محفظتك.",injectionScreen_connecting_injected_h1:"طلب الاتصال",injectionScreen_connecting_injected_p:"قبل الطلب من خلال محفظتك للاتصال بتطبيقنا.",injectionScreen_connected_h1:"الاتصال بالفعل",injectionScreen_connected_p:"من الآمن الآن إغلاق هذه النافذة المنبثقة.",injectionScreen_rejected_h1:"تم رفض الطلب",injectionScreen_rejected_p:"لقد قمت برفض الطلب. انقر أعلى للمحاولة مرة أخرى.",injectionScreen_failed_h1:"فشل الاتصال",injectionScreen_failed_p:"عذرًا، حدث خطأ ما. يُرجى المحاولة مرة أخرى للاتصال.",injectionScreen_notconnected_h1:"تسجيل الدخول إلى {{ CONNECTORNAME }}",injectionScreen_notconnected_p:"للمتابعة، يُرجى تسجيل الدخول إلى إضافة {{ CONNECTORNAME }}.",profileScreen_heading:"متصل",switchNetworkScreen_heading:"تبديل الشبكات",signInWithEthereumScreen_tooltip:`أنت غير مسجل الدخول حاليًا إلى هذا التطبيق.
**سجل الدخول باستخدام إثيريوم** للمتابعة.`,signInWithEthereumScreen_signedOut_heading:"سجل الدخول باستخدام إثيريوم",signInWithEthereumScreen_signedOut_h1:`يود هذا التطبيق التحقق منك
كصاحب لهذه المحفظة.`,signInWithEthereumScreen_signedOut_p:"يرجى تأكيد طلب الرسالة في محفظتك للمتابعة.",signInWithEthereumScreen_signedOut_button:"سجل الدخول",signInWithEthereumScreen_signedIn_heading:"تم تسجيل الدخول باستخدام إثيريوم",signInWithEthereumScreen_signedIn_h1:"لقد قمت بتأكيد نفسك كصاحب لهذه المحفظة بنجاح.",signInWithEthereumScreen_signedIn_p:"سيتطلب تسجيل الخروج منك إعادة المصادقة مرة أخرى في المستقبل.",signInWithEthereumScreen_signedIn_button:"تسجيل الخروج"},enUS={connectWallet:"Connect Wallet",disconnect:"Disconnect",connected:"Connected",wrongNetwork:"Wrong Network",switchNetworks:"Switch Networks",chainNetwork:"{{ CHAIN }} Network",copyToClipboard:"Copy to Clipboard",copyCode:"Copy Code",moreInformation:"More Information",back:"Back",close:"Close",or:"or",more:"More",tryAgain:"Try Again",tryAgainQuestion:"Try Again?",dontHaveTheApp:"Don't have the app?",scanTheQRCode:"Scan the QR code",useWalletConnectModal:"Use WalletConnect Modal",useModal:"Use Modal",installTheExtension:"Install the Extension",getWalletName:"Get {{ CONNECTORNAME }}",otherWallets:"Other Wallets",learnMore:"Learn More",getWallet:"Get a Wallet",approveInWallet:"Approve in Wallet",confirmInWallet:"Confirm in Wallet",awaitingConfirmation:"Awaiting Confirmation",signIn:"Sign In",signOut:"Sign Out",signedIn:"Signed In",signedOut:"Signed Out",walletNotConnected:"Wallet Not Connected",warnings_walletSwitchingUnsupported:"Your wallet does not support switching networks from this app.",warnings_walletSwitchingUnsupportedResolve:"Try switching networks from within your wallet instead.",warnings_chainUnsupported:"This app does not support the current connected network.",warnings_chainUnsupportedResolve:"Switch or disconnect to continue.",onboardingScreen_heading:"Get a Wallet",onboardingScreen_h1:"Start Exploring Web3",onboardingScreen_p:"Your wallet is the gateway to all things Ethereum, the magical technology that makes it possible to explore web3.",onboardingScreen_ctaText:"Choose Your First Wallet",onboardingScreen_ctaUrl:"https://ethereum.org/en/wallets/find-wallet/",aboutScreen_heading:"About Wallets",aboutScreen_a_h1:"For your digital assets",aboutScreen_a_p:"Wallets let you send, receive, store, and interact with digital assets like NFTs and other Ethereum tokens.",aboutScreen_b_h1:"A better way to login",aboutScreen_b_p:"With modern apps, your wallet can be used as an easy way to login, instead of having to remember a password.",aboutScreen_c_h1:"Explore the world of web3",aboutScreen_c_p:"Your wallet is an essential utility that lets you explore and participate in the fast evolving world of web3.",aboutScreen_ctaText:"Learn More",aboutScreen_ctaUrl:"https://ethereum.org/en/wallets/",connectorsScreen_heading:"Connect Wallet",connectorsScreen_newcomer:"I dont have a wallet",connectorsScreen_h1:"What is a wallet?",connectorsScreen_p:"Wallets are used to send, receive, and store digital assets. Connecting a wallet lets you interact with apps.",mobileConnectorsScreen_heading:"Choose Wallet",scanScreen_heading:"Scan with Phone",scanScreen_heading_withConnector:"Scan with {{ CONNECTORNAME }}",scanScreen_tooltip_walletConnect:`Open a [WALLETCONNECTLOGO] WalletConnect
supported wallet to scan`,scanScreen_tooltip_default:`Open {{ CONNECTORNAME }} on
your mobile phone to scan`,downloadAppScreen_heading:"Get {{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:"Scan with your phone camera to download on iOS or Android.",downloadAppScreen_ios:"Scan with your phone camera to download on iOS.",downloadAppScreen_android:"Scan with your phone camera to download Android.",injectionScreen_unavailable_h1:"Unsupported Browser",injectionScreen_unavailable_p:`To connect your {{ CONNECTORSHORTNAME }} wallet,
install the extension on {{ SUGGESTEDEXTENSIONBROWSER }}.`,injectionScreen_install_h1:"Install {{ CONNECTORNAME }}",injectionScreen_install_p:`To connect your {{ CONNECTORSHORTNAME }} wallet,
install the browser extension.`,injectionScreen_connecting_h1:"Requesting Connection",injectionScreen_connecting_p:`Open the {{ CONNECTORSHORTNAME }} browser
extension to connect your wallet.`,injectionScreen_connecting_injected_h1:"Requesting Connection",injectionScreen_connecting_injected_p:"Accept the request through your wallet to connect to this app.",injectionScreen_connected_h1:"Already Connected",injectionScreen_connected_p:"It is now okay to close this popup",injectionScreen_rejected_h1:"Request Cancelled",injectionScreen_rejected_p:`You cancelled the request.
Click above to try again.`,injectionScreen_failed_h1:"Connection Failed",injectionScreen_failed_p:`Sorry, something went wrong.
Please try connecting again.`,injectionScreen_notconnected_h1:"Login to {{ CONNECTORNAME }}",injectionScreen_notconnected_p:"To continue, please login to your {{ CONNECTORNAME }} extension.",profileScreen_heading:"Connected",switchNetworkScreen_heading:"Switch Networks",signInWithEthereumScreen_tooltip:`Youre not signed in to this app.
**Sign In With Ethereum** to continue.`,signInWithEthereumScreen_signedOut_heading:"Sign In With Ethereum",signInWithEthereumScreen_signedOut_h1:`This app would like to verify you
as the owner of this wallet.`,signInWithEthereumScreen_signedOut_p:`Please sign the message request
in your wallet to continue.`,signInWithEthereumScreen_signedOut_button:"Sign In",signInWithEthereumScreen_signedIn_heading:"Signed In With Ethereum",signInWithEthereumScreen_signedIn_h1:`You successfully verified yourself
as the owner of this wallet.`,signInWithEthereumScreen_signedIn_p:`Signing out will require you to
authenticate again in the future.`,signInWithEthereumScreen_signedIn_button:"Sign Out"},eeEE={connectWallet:"Ühenda rahakott",disconnect:"Katkesta ühendus",connected:"Ühendatud",wrongNetwork:"Vale võrk",switchNetworks:"Vaheta võrke",chainNetwork:"{{ CHAIN }} Võrk",copyToClipboard:"Kopeeri lõikelauale",copyCode:"Kopeeri koodi",moreInformation:"Rohkem infot",back:"Tagasi",close:"Pane kinni",or:"või",more:"Rohkem",tryAgain:"Proovi uuesti",tryAgainQuestion:"Proovi uuesti?",dontHaveTheApp:"Kas teil pole rakendust?",scanTheQRCode:"Skaneeri QR-kood",useWalletConnectModal:"Kasuta WalletConnecti modalit",useModal:"Kasuta Modalit",installTheExtension:"Installi laiendust",getWalletName:"Hanki {{ CONNECTORNAME }}",otherWallets:"Teised rahakotid",learnMore:"Avasta rohkem",getWallet:"Lae alla rahakott",approveInWallet:"Kiita heaks rahakotis",confirmInWallet:"Kinnita rahakotis",awaitingConfirmation:"Kinnituse ootel",signIn:"Logi sisse",signOut:"Logi välja",signedIn:"Sisse logitud",signedOut:"Välja logitud",walletNotConnected:"Raakott pole ühendatud",warnings_walletSwitchingUnsupported:"Teie rahakott ei toeta võrgu vahetamist sellest rakendusest.",warnings_walletSwitchingUnsupportedResolve:"Proovige võrgu vahetamist teha oma rahakoti seest.",warnings_chainUnsupported:"See rakendus ei toeta praegu ühendatud võrku.",warnings_chainUnsupportedResolve:"Jätkamiseks vahetage või ühendage lahti.",onboardingScreen_heading:"Hankige rahakott",onboardingScreen_h1:"Alustage Web3 uurimist",onboardingScreen_p:"Teie rahakott on värav kõigele, mis puudutab Ethereumit, maagilist tehnoloogiat, mis võimaldab uurida Web3.",onboardingScreen_ctaText:"Valige oma esimene rahakott",onboardingScreen_ctaUrl:"https://ethereum.org/en/wallets/find-wallet/",aboutScreen_heading:"Rahakottidest",aboutScreen_a_h1:"Teie digitaalsetele varadele",aboutScreen_a_p:"Rahakotid võimaldavad teil saata, vastu võtta, salvestada ja suhelda digitaalsete varadega nagu NFT-d ja teised Ethereumi tokenid.",aboutScreen_b_h1:"Parem viis sisse logimiseks",aboutScreen_b_p:"Kaasaegsete rakendustega saab teie rahakotti kasutada lihtsa sisselogimisviisina, ilma et peaksite meeles pidama parooli.",aboutScreen_c_h1:"Uurige Web3 maailma",aboutScreen_c_p:"Teie rahakott on oluline tööriist, mis võimaldab teil uurida ja osaleda kiiresti arenevas Web3 maailmas.",aboutScreen_ctaText:"Lisateavet saamiseks",aboutScreen_ctaUrl:"https://ethereum.org/en/wallets/",connectorsScreen_heading:"Ühendage rahakott",connectorsScreen_newcomer:"Mul pole rahakotti",connectorsScreen_h1:"Mis on rahakott?",connectorsScreen_p:"Rahakotte kasutatakse digitaalsete varade saatmiseks, vastuvõtmiseks ja salvestamiseks. Rahakoti ühendamine võimaldab teil rakendustega suhelda.",mobileConnectorsScreen_heading:"Valige rahakott",scanScreen_heading:"Skaneerige telefoni abil",scanScreen_heading_withConnector:"Skaneerige koos {{ CONNECTORNAME }}-ga",scanScreen_tooltip_walletConnect:`Ava [WALLETCONNECTLOGO] WalletConnect
toetatud rahakott skaneerimiseks`,scanScreen_tooltip_default:`Ava {{ CONNECTORNAME }} oma
mobiiltelefonil skaneerimiseks`,downloadAppScreen_heading:"Hankige {{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:"Skaneerige oma telefoni kaameraga allalaadimiseks iOS-i või Androidi jaoks.",downloadAppScreen_ios:"Skaneerige oma telefoni kaameraga allalaadimiseks iOS-i jaoks.",downloadAppScreen_android:"Skaneerige oma telefoni kaameraga Androidi allalaadimiseks.",injectionScreen_unavailable_h1:"Toetuseta brauser",injectionScreen_unavailable_p:`Teie {{ CONNECTORSHORTNAME }} rahakoti ühendamiseks
installige laiendus {{ SUGGESTEDEXTENSIONBROWSER }}-le.`,injectionScreen_install_h1:"Installige {{ CONNECTORNAME }}",injectionScreen_install_p:`Teie {{ CONNECTORSHORTNAME }} rahakoti ühendamiseks
installige brauseri laiendus.`,injectionScreen_connecting_h1:"Ühenduse taotlemine",injectionScreen_connecting_p:`Ava {{ CONNECTORSHORTNAME }} brauseri
laiendus rahakoti ühendamiseks.`,injectionScreen_connecting_injected_h1:"Ühenduse taotlemine",injectionScreen_connecting_injected_p:"Nõustuge rakendusega ühendamiseks oma rahakotis.",injectionScreen_connected_h1:"Juba ühendatud",injectionScreen_connected_p:"Selle popup-i saab nüüd sulgeda",injectionScreen_rejected_h1:"Taotlus tühistatud",injectionScreen_rejected_p:`Tühistasite taotluse.
Klõpsake ülal, et uuesti proovida.`,injectionScreen_failed_h1:"Ühenduse loomine ebaõnnestus",injectionScreen_failed_p:`Vabandame, midagi läks valesti.
Proovige ühendust uuesti luua.`,injectionScreen_notconnected_h1:"Logige sisse {{ CONNECTORNAME }}-ga",injectionScreen_notconnected_p:"Jätkamiseks logige sisse oma {{ CONNECTORNAME }} laiendisse.",profileScreen_heading:"Ühendatud",switchNetworkScreen_heading:"Võrkude vahetamine",signInWithEthereumScreen_tooltip:`Te pole selle rakendusse sisse logitud.
**Logi sisse Ethereumiga** jätkamiseks.`,signInWithEthereumScreen_signedOut_heading:"Logi sisse Ethereumiga",signInWithEthereumScreen_signedOut_h1:`See rakendus soovib teid autentida
selle rahakoti omanikuna.`,signInWithEthereumScreen_signedOut_p:`Jätkamiseks allkirjastage sõnumipäring
oma rahakotis.`,signInWithEthereumScreen_signedOut_button:"Logi sisse",signInWithEthereumScreen_signedIn_heading:"Logi välja",signInWithEthereumScreen_signedIn_h1:`Olete edukalt autentinud end
selle rahakoti omanikuna.`,signInWithEthereumScreen_signedIn_p:`Välja logimine nõuab tulevikus
uuesti autentimist.`,signInWithEthereumScreen_signedIn_button:"Logi välja"},esES={connectWallet:"Conecta una cartera",disconnect:"Desconectar",connected:"Conectado",wrongNetwork:"Red incorrecta",switchNetworks:"Cambio de red",chainNetwork:"Red {{ CHAIN }}",copyToClipboard:"Copiar al portapapeles",copyCode:"Copiar código",moreInformation:"Más información",back:"Atrás",close:"Cerrar",or:"o",more:"Más",tryAgain:"Intentar de nuevo",tryAgainQuestion:"¿Intentar de nuevo?",dontHaveTheApp:"¿No tienes la aplicación?",scanTheQRCode:"Escanea el código QR",useWalletConnectModal:"Utilizar WalletConnect Modal",useModal:"Utilizar Modal",installTheExtension:"Instalar la extensión",getWalletName:"Obtén {{ CONNECTORNAME }}",otherWallets:"Otras carteras",learnMore:"Más información",getWallet:"Obtén una cartera",approveInWallet:"Aprobar en la cartera",confirmInWallet:"Confirmar en la cartera",awaitingConfirmation:"A la espera de confirmación",signIn:"Iniciar sesión",signOut:"Cerrar sesión",signedIn:"Sesión iniciada",signedOut:"Sesión cerrada",walletNotConnected:"Cartera no conectada",warnings_walletSwitchingUnsupported:"Tu cartera no permite cambiar de red desde esta aplicación.",warnings_walletSwitchingUnsupportedResolve:"Prueba a cambiar de red desde tu cartera.",warnings_chainUnsupported:"Esta aplicación no es compatible con la red conectada actualmente.",warnings_chainUnsupportedResolve:"Cambia o desconecta para continuar.",onboardingScreen_heading:"Obtén una cartera",onboardingScreen_h1:"Comienza a explorar la Web3",onboardingScreen_p:"Tu cartera es el portal de acceso a todo lo relacionado con Ethereum, la tecnología mágica que permite explorar la Web3.",onboardingScreen_ctaText:"Elige tu primera cartera",onboardingScreen_ctaUrl:"https://ethereum.org/es/wallets/find-wallet/",aboutScreen_heading:"Acerca de las carteras",aboutScreen_a_h1:"Para tus activos digitales",aboutScreen_a_p:"Las carteras te permiten enviar, recibir, almacenar e interactuar con activos digitales como los NFT y otros tokens de Ethereum.",aboutScreen_b_h1:"Una manera mejor de iniciar sesión",aboutScreen_b_p:"Con las aplicaciones modernas, puedes utilizar tu cartera para iniciar sesión fácilmente, en vez de tener que recordar una contraseña.",aboutScreen_c_h1:"Explora el mundo de la Web3",aboutScreen_c_p:"Tu cartera es una herramienta esencial que te permite explorar y participar en el mundo en rápida evolución de la Web3.",aboutScreen_ctaText:"Más información",aboutScreen_ctaUrl:"https://ethereum.org/es/wallets/",connectorsScreen_heading:"Conecta una cartera",connectorsScreen_newcomer:"No tengo una cartera",connectorsScreen_h1:"¿Qué es una cartera?",connectorsScreen_p:"Las carteras se utilizan para enviar, recibir y almacenar activos digitales. Si conectas una cartera, podrás interactuar con las aplicaciones.",mobileConnectorsScreen_heading:"Elige una cartera",scanScreen_heading:"Escanea con el teléfono",scanScreen_heading_withConnector:"Escanea con {{ CONNECTORNAME }}",scanScreen_tooltip_walletConnect:"Abre una cartera compatible con WalletConnect [WALLETCONNECTLOGO] para escanear",scanScreen_tooltip_default:"Abre {{ CONNECTORNAME }} en tu teléfono móvil para escanear",downloadAppScreen_heading:"Obtén {{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:"Escanea con la cámara de tu teléfono para descargarla en iOS o Android.",downloadAppScreen_ios:"Escanea con la cámara de tu teléfono para descargarla en iOS.",downloadAppScreen_android:"Escanea con la cámara de tu teléfono para descargarla en Android.",injectionScreen_unavailable_h1:"Navegador no compatible",injectionScreen_unavailable_p:"Para conectar tu cartera de {{ CONNECTORSHORTNAME }}, instala la extensión en {{ SUGGESTEDEXTENSIONBROWSER }}.",injectionScreen_install_h1:"Instala {{ CONNECTORNAME }}",injectionScreen_install_p:"Para conectar tu cartera de {{ CONNECTORSHORTNAME }}, instala la extensión del navegador.",injectionScreen_connecting_h1:"Solicitud de conexión",injectionScreen_connecting_p:"Abre la extensión del navegador de {{ CONNECTORSHORTNAME }} para conectar tu cartera.",injectionScreen_connecting_injected_h1:"Solicitud de conexión",injectionScreen_connecting_injected_p:"Acepta la solicitud a través de tu cartera para conectarte a esta aplicación.",injectionScreen_connected_h1:"Ya conectada",injectionScreen_connected_p:"Ya puedes cerrar esta ventana emergente",injectionScreen_rejected_h1:"Solicitud cancelada",injectionScreen_rejected_p:"Has cancelado la solicitud. Haz clic arriba para intentarlo de nuevo.",injectionScreen_failed_h1:"Error de conexión",injectionScreen_failed_p:"Lo sentimos, ha habido un problema. Intenta conectarte de nuevo.",injectionScreen_notconnected_h1:"Inicia sesión en {{ CONNECTORNAME }}",injectionScreen_notconnected_p:"Para continuar, inicia sesión en tu extensión de {{ CONNECTORNAME }}.",profileScreen_heading:"Conectado",switchNetworkScreen_heading:"Cambio de red",signInWithEthereumScreen_tooltip:`No has iniciado sesión en esta aplicación.
**Inicia sesión con Ethereum** para continuar.`,signInWithEthereumScreen_signedOut_heading:"Inicia sesión con Ethereum",signInWithEthereumScreen_signedOut_h1:"Esta aplicación desea verificar que eres el propietario de esta cartera.",signInWithEthereumScreen_signedOut_p:"Firma la solicitud de mensaje en tu cartera para continuar.",signInWithEthereumScreen_signedOut_button:"Iniciar sesión",signInWithEthereumScreen_signedIn_heading:"Sesión iniciada con Ethereum",signInWithEthereumScreen_signedIn_h1:"Te has verificado correctamente como propietario de esta cartera.",signInWithEthereumScreen_signedIn_p:"Si cierras la sesión, tendrás que volver a autenticarte más adelante.",signInWithEthereumScreen_signedIn_button:"Cerrar sesión"},faIR={connectWallet:"اتصال به کیف پول",disconnect:"قطع ارتباط",connected:"متصل شد",wrongNetwork:"شبکه نادرست",switchNetworks:"تغییر شبکه‌ها",chainNetwork:"{{ CHAIN }} شبکه",copyToClipboard:"کپی به کلیپ‌بورد",copyCode:"کپی کد",moreInformation:"اطلاعات بیشتر",back:"بازگشت",close:"بستن",or:"یا",more:"بیشتر",tryAgain:"تلاش دوباره",tryAgainQuestion:"آیا دوباره تلاش کنیم؟",dontHaveTheApp:"اپلیکیشن را ندارید؟",scanTheQRCode:"اسکن کیو‌آر کد",useWalletConnectModal:"استفاده از مودال والت‌‌کانکت",useModal:"استفاده از مودال",installTheExtension:"نصب افزونه",getWalletName:"دریافت {{ CONNECTORNAME }}",otherWallets:"کیف پول‌های دیگر",learnMore:"بیشتر بدانید",getWallet:"یک کیف پول دریافت کنید",approveInWallet:"در کیف پول تأیید کنید",confirmInWallet:"در کیف پول تأیید کنید",awaitingConfirmation:"در انتظار تأیید",signIn:"ورود",signOut:"خروج",signedIn:"وارد شده",signedOut:"خارج شده",walletNotConnected:"کیف پول متصل نیست",warnings_walletSwitchingUnsupported:"متاسفانه، کیف پول شما از تغییر شبکه در این برنامه پشتیبانی نمی‌کند.",warnings_walletSwitchingUnsupportedResolve:"بهتر است از داخل کیف پول خود تغییر شبکه دهید.",warnings_chainUnsupported:"این برنامه با شبکه‌ای که در حال حاضر متصل است، سازگاری ندارد.",warnings_chainUnsupportedResolve:"برای ادامه، شبکه را تغییر دهید یا اتصال را قطع کنید.",onboardingScreen_heading:"دریافت کیف پول",onboardingScreen_h1:"آغاز کاوش در وب3",onboardingScreen_p:"کیف پول شما دروازه‌ای است به دنیای اتریوم، فناوری جادویی که ممکن می‌سازد تا وب3 را کاوش کنید.",onboardingScreen_ctaText:"کیف پول نخست خود را انتخاب کنید",onboardingScreen_ctaUrl:"https://ethereum.org/fa/wallets/find-wallet/",aboutScreen_heading:"درباره کیف پول‌ها",aboutScreen_a_h1:"نگهبان دارایی‌های دیجیتالی شما",aboutScreen_a_p:"کیف پول‌ها به شما اجازه می‌دهند دارایی‌های دیجیتالی مانند ان‌اف‌تی و توکن‌های اتریومی دیگر را ارسال، دریافت، ذخیره و تعامل دهید.",aboutScreen_b_h1:"یک روش بهتر برای ورود",aboutScreen_b_p:"در برنامه‌های مدرن، کیف پول شما می‌تواند به عنوان یک راه ورود آسان به جای به یادآوری یک رمز عبور مورد استفاده قرار گیرد.",aboutScreen_c_h1:"جهان وب3 را کاوش کنید",aboutScreen_c_p:"کیف پول شما یک ابزار ضروری است که به شما اجازه می‌دهد جهان در حال تغییر سریع وب3 را کاوش و در آن شرکت کنید.",aboutScreen_ctaText:"دانش بیشتری بیافزایید",aboutScreen_ctaUrl:"https://ethereum.org/fa/wallets/",connectorsScreen_heading:"برقراری ارتباط با کیف پول",connectorsScreen_newcomer:"کیف پول ندارم",connectorsScreen_h1:"چیستی رمزگذاری کیف پول؟",connectorsScreen_p:"کیف پول‌ها برای ارسال، دریافت و نگهداری دارایی‌های دیجیتال استفاده می‌شوند. برقراری ارتباط با یک کیف پول به شما امکان تعامل با برنامه‌ها را می‌دهد.",mobileConnectorsScreen_heading:"انتخاب کیف پول",scanScreen_heading:"اسکن با گوشی",scanScreen_heading_withConnector:"اسکن با {{ CONNECTORNAME }}",scanScreen_tooltip_walletConnect:"یک کیف پول با پشتیبانی از والت‌‌کانکت را باز کنید تا اسکن را آغاز کنید",scanScreen_tooltip_default:"{{ CONNECTORNAME }} را روی گوشی خود باز کنید تا اسکن شود",downloadAppScreen_heading:"دریافت {{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:"از دوربین گوشی خود برای اسکن و دریافت نسخه iOS یا Android استفاده کنید.",downloadAppScreen_ios:"از دوربین گوشی خود برای دریافت نسخه iOS استفاده کنید.",downloadAppScreen_android:"از دوربین گوشی خود برای دریافت نسخه Android استفاده کنید.",injectionScreen_unavailable_h1:"مرورگر پشتیبانی نمی‌شود",injectionScreen_unavailable_p:"برای برقراری ارتباط با کیف پول {{ CONNECTORSHORTNAME }}، افزونه مرورگر را در {{ SUGGESTEDEXTENSIONBROWSER }} نصب کنید.",injectionScreen_install_h1:"نصب {{ CONNECTORNAME }}",injectionScreen_install_p:"برای برقراری ارتباط با کیف پول {{ CONNECTORSHORTNAME }}، افزونه مرورگر را نصب کنید.",injectionScreen_connecting_h1:"درخواست اتصال",injectionScreen_connecting_p:"افزونه مرورگر {{ CONNECTORSHORTNAME }} را باز کنید تا ارتباط با کیف پول ایجاد شود.",injectionScreen_connecting_injected_h1:"درخواست اتصال",injectionScreen_connecting_injected_p:"درخواست را از طریق کیف پول خود بپذیرید تا به این برنامه متصل شوید.",injectionScreen_connected_h1:"اتصال از قبل برقرار است",injectionScreen_connected_p:"اکنون می‌توانید این پنجره‌ی بازشو را ببندید.",injectionScreen_rejected_h1:"درخواست لغو شد",injectionScreen_rejected_p:"شما درخواست را لغو کرده‌اید. برای تلاش مجدد، بالا کلیک کنید.",injectionScreen_failed_h1:"ارتباط ناموفق",injectionScreen_failed_p:"متاسفانه، مشکلی بوجود آمد. لطفاً مجدداً اتصال برقرار کنید.",injectionScreen_notconnected_h1:"با ورود به {{ CONNECTORNAME }} وارد شوید",injectionScreen_notconnected_p:"برای ادامه، لطفاً وارد افزونه {{ CONNECTORNAME }} خود شوید.",profileScreen_heading:"اتصال‌ها",switchNetworkScreen_heading:"تغییر شبکه‌ها",signInWithEthereumScreen_tooltip:`شما در حال حاضر به این برنامه وارد نشده‌اید.
**با اتریوم وارد شوید** تا ادامه دهید.`,signInWithEthereumScreen_signedOut_heading:"با اتریوم وارد شوید",signInWithEthereumScreen_signedOut_h1:`این برنامه می‌خواهد هویت شما
به عنوان صاحب این کیف پول را تأیید کند.`,signInWithEthereumScreen_signedOut_p:"لطفاً درخواست پیام را در کیف پول خود تأیید کنید تا ادامه دهید.",signInWithEthereumScreen_signedOut_button:"با اتریوم وارد شوید",signInWithEthereumScreen_signedIn_heading:"با اتریوم وارد شده‌اید",signInWithEthereumScreen_signedIn_h1:"شما به عنوان صاحب این کیف پول هویت خود را با موفقیت تأیید کرده‌اید.",signInWithEthereumScreen_signedIn_p:"خروج از حساب کاربری شما در آینده نیاز به تأیید دوباره دارد.",signInWithEthereumScreen_signedIn_button:"خروج"},frFR={connectWallet:"Connecter le portefeuille",disconnect:"Déconnecter",connected:"Connecté",wrongNetwork:"Réseau incorrect",switchNetworks:"Changer de réseau",chainNetwork:"Réseau {{ CHAIN }}",copyToClipboard:"Copier dans le presse-papiers",copyCode:"Copier le code",moreInformation:"Plus dinformations",back:"Retour",close:"Fermer",or:"ou",more:"Plus",tryAgain:"Réessayer",tryAgainQuestion:"Réessayer ?",dontHaveTheApp:"Vous navez pas lapplication ?",scanTheQRCode:"Scannez le code QR",useWalletConnectModal:"Utiliser la modale WalletConnect",useModal:"Utiliser la modale",installTheExtension:"Installer lextension",getWalletName:"Obtenez {{ CONNECTORNAME }}",otherWallets:"Autres portefeuilles",learnMore:"En savoir plus",getWallet:"Obtenir un portefeuille",approveInWallet:"Approuver dans le portefeuille",confirmInWallet:"Confirmer dans le portefeuille",awaitingConfirmation:"En attente de confirmation",signIn:"Se connecter",signOut:"Se déconnecter",signedIn:"Connecté",signedOut:"Déconnecté",walletNotConnected:"Portefeuille non connecté",warnings_walletSwitchingUnsupported:"Votre portefeuille ne prend pas en charge le changement de réseau à partir de cette application.",warnings_walletSwitchingUnsupportedResolve:"Essayez plutôt de changer de réseau à partir de votre portefeuille.",warnings_chainUnsupported:"Cette application ne prend pas en charge le réseau connecté actuel.",warnings_chainUnsupportedResolve:"Changez ou déconnectez-vous pour continuer.",onboardingScreen_heading:"Obtenez un portefeuille",onboardingScreen_h1:"Commencez à explorer le Web3",onboardingScreen_p:"Votre portefeuille est la porte d'entrée vers tout ce qui concerne l'Ethereum, la technologie magique qui permet d'explorer le Web3.",onboardingScreen_ctaText:"Choisissez votre premier portefeuille",onboardingScreen_ctaUrl:"https://ethereum.org/fr/wallets/find-wallet/",aboutScreen_heading:"À propos des portefeuilles",aboutScreen_a_h1:"Pour vos actifs numériques",aboutScreen_a_p:"Les portefeuilles vous permettent d'envoyer, de recevoir, de stocker et d'interagir avec des actifs numériques tels que des NFT et d'autres jetons Ethereum.",aboutScreen_b_h1:"Une meilleure façon de se connecter",aboutScreen_b_p:"Avec les applications modernes, votre portefeuille peut s'utiliser pour vous connecter facilement, au lieu d'avoir à mémoriser un mot de passe.",aboutScreen_c_h1:"Explorez le monde du Web3",aboutScreen_c_p:"Votre portefeuille est un utilitaire essentiel qui vous permet d'explorer et de participer au monde en évolution rapide du Web3.",aboutScreen_ctaText:"En savoir plus",aboutScreen_ctaUrl:"https://ethereum.org/fr/wallets/",connectorsScreen_heading:"Connectez le portefeuille",connectorsScreen_newcomer:"Je nai pas de portefeuille",connectorsScreen_h1:"Quest-ce quun portefeuille ?",connectorsScreen_p:"Les portefeuilles s'utilisent pour envoyer, recevoir et stocker des actifs numériques. La connexion d'un portefeuille vous permet d'interagir avec les applications.",mobileConnectorsScreen_heading:"Choisissez le portefeuille",scanScreen_heading:"Scannez avec le téléphone",scanScreen_heading_withConnector:"Scannez avec {{ CONNECTORNAME }}",scanScreen_tooltip_walletConnect:"Ouvrez un portefeuille pris en charge par WalletConnect [WALLETCONNECTLOGO] pour scanner",scanScreen_tooltip_default:"Ouvrez {{ CONNECTORNAME }} sur votre téléphone mobile pour scanner",downloadAppScreen_heading:"Obtenez {{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:"Scannez avec l'appareil photo de votre téléphone pour le télécharger sur iOS ou Android.",downloadAppScreen_ios:"Scannez avec l'appareil photo de votre téléphone pour le télécharger sur iOS.",downloadAppScreen_android:"Scannez avec l'appareil photo de votre téléphone pour le télécharger sur Android.",injectionScreen_unavailable_h1:"Navigateur non pris en charge",injectionScreen_unavailable_p:"Pour connecter votre portefeuille {{ CONNECTORSHORTNAME }}, installez lextension sur {{ SUGGESTEDEXTENSIONBROWSER }}.",injectionScreen_install_h1:"Installez {{ CONNECTORNAME }}",injectionScreen_install_p:"Pour connecter votre portefeuille {{ CONNECTORSHORTNAME }}, installez lextension de navigateur.",injectionScreen_connecting_h1:"Demande de connexion",injectionScreen_connecting_p:"Ouvrez lextension de navigateur {{ CONNECTORSHORTNAME }} pour connecter votre portefeuille.",injectionScreen_connecting_injected_h1:"Demande de connexion",injectionScreen_connecting_injected_p:"Acceptez la demande via votre portefeuille pour vous connecter à cette application.",injectionScreen_connected_h1:"Déjà connecté",injectionScreen_connected_p:"Vous pouvez maintenant fermer ce pop-up",injectionScreen_rejected_h1:"Demande annulée",injectionScreen_rejected_p:"Vous avez annulé la demande. Cliquez ci-dessus pour réessayer.",injectionScreen_failed_h1:"Échec de la connexion",injectionScreen_failed_p:"Malheureusement, un problème est survenu. Veuillez réessayer de vous connecter.",injectionScreen_notconnected_h1:"Connectez-vous à {{ CONNECTORNAME }}",injectionScreen_notconnected_p:"Pour continuer, veuillez vous connecter à votre extension {{ CONNECTORNAME }} .",profileScreen_heading:"Connecté",switchNetworkScreen_heading:"Changer de réseau",signInWithEthereumScreen_tooltip:`Vous nêtes pas connecté à cette application.
**Connectez-vous avec Ethereum** pour continuer.`,signInWithEthereumScreen_signedOut_heading:"Connectez-vous avec Ethereum",signInWithEthereumScreen_signedOut_h1:"Cette application souhaite vérifier que vous êtes bien le propriétaire de ce portefeuille.",signInWithEthereumScreen_signedOut_p:"Veuillez signer la demande de message dans votre portefeuille pour continuer.",signInWithEthereumScreen_signedOut_button:"Se connecter",signInWithEthereumScreen_signedIn_heading:"Connecté avec Ethereum",signInWithEthereumScreen_signedIn_h1:"Vous avez réussi à vous identifier en tant que propriétaire de ce portefeuille.",signInWithEthereumScreen_signedIn_p:"La déconnexion vous obligera à vous authentifier à nouveau à l'avenir.",signInWithEthereumScreen_signedIn_button:"Se déconnecter"};var jaJP={connectWallet:"ウォレットの接続",disconnect:"切断",connected:"接続されました",wrongNetwork:"間違ったネットワーク",switchNetworks:"ネットワークの切り替え",chainNetwork:"{{ CHAIN }} ネットワーク",copyToClipboard:"クリップボードにコピー",copyCode:"コードをコピー",moreInformation:"詳細情報",back:"戻る",close:"閉じる",or:"または",more:"その他",tryAgain:"再試行",tryAgainQuestion:"もう一度試しますか?",dontHaveTheApp:"アプリをお持ちではありませんか?",scanTheQRCode:"QR コードをスキャン",useWalletConnectModal:"WalletConnect モーダルを使用",useModal:"モーダルを使用",installTheExtension:"拡張機能をインストール",getWalletName:"{{ CONNECTORNAME }} を取得",otherWallets:"その他のウォレット",learnMore:"詳細情報",getWallet:"ウォレットを入手",approveInWallet:"ウォレットで承認",confirmInWallet:"ウォレットで確認",awaitingConfirmation:"確認を待っています",signIn:"サインイン",signOut:"サインアウト",signedIn:"サインインしました",signedOut:"サインアウトしました",walletNotConnected:"ウォレットが接続されていません",warnings_walletSwitchingUnsupported:"お使いのウォレットは、このアプリからのネットワークの切り替えをサポートしていません。",warnings_walletSwitchingUnsupportedResolve:"代わりにウォレット内からネットワークを切り替えてみてください。",warnings_chainUnsupported:"このアプリは、現在接続されているネットワークをサポートしていません。",warnings_chainUnsupportedResolve:"切り替えるか切断して続行します。",onboardingScreen_heading:"ウォレットを入手",onboardingScreen_h1:"Web3 の探索を開始",onboardingScreen_p:"ウォレットは、web3 の探索を可能にする魔法のテクノロジーであるイーサリアムのすべてへのゲートウェイです。",onboardingScreen_ctaText:"最初のウォレットを選択してください",onboardingScreen_ctaUrl:"https://ethereum.org/ja/wallets/find-wallet/",aboutScreen_heading:"ウォレットについて",aboutScreen_a_h1:"デジタル資産用",aboutScreen_a_p:"ウォレットを使用すると、NFT やその他のイーサリアム トークンなどのデジタル資産を送信、受信、保存、および操作できます。",aboutScreen_b_h1:"より良いログイン方法",aboutScreen_b_p:"最新のアプリでは、パスワードを覚える必要がなく、ウォレットを簡単なログイン方法として使用できます。",aboutScreen_c_h1:"web3 の世界を探索",aboutScreen_c_p:"ウォレットは、急速に進化する web3 の世界を探索し、参加するために不可欠なユーティリティです。",aboutScreen_ctaText:"詳細情報",aboutScreen_ctaUrl:"https://ethereum.org/ja/wallets/",connectorsScreen_heading:"ウォレットの接続",connectorsScreen_newcomer:"ウォレットを持っていません",connectorsScreen_h1:"ウォレットとは何ですか?",connectorsScreen_p:"ウォレットは、デジタル資産の送信、受信、および保存に使用されます。 ウォレットを接続すると、アプリとやり取りできます。",mobileConnectorsScreen_heading:"ウォレットを選択",scanScreen_heading:"電話でスキャンする",scanScreen_heading_withConnector:"{{ CONNECTORNAME }}でスキャンする",scanScreen_tooltip_walletConnect:"[WALLETCONNECTLOGO] WalletConnect 対応の ウォレットを開いてスキャンします",scanScreen_tooltip_default:"携帯電話で {{ CONNECTORNAME }} を 開いてスキャンします",downloadAppScreen_heading:"{{ CONNECTORNAME }} を取得",downloadAppScreen_iosAndroid:"携帯電話のカメラでスキャンして、iOS または Android にダウンロードします。",downloadAppScreen_ios:"携帯電話のカメラでスキャンして、iOS にダウンロードします。",downloadAppScreen_android:"携帯電話のカメラでスキャンして、Android にダウンロードします。",injectionScreen_unavailable_h1:"サポートされていないブラウザ",injectionScreen_unavailable_p:"{{ CONNECTORSHORTNAME }} ウォレットを接続するには、{{ SUGGESTEDEXTENSIONBROWSER }} に拡張機能をインストールします。",injectionScreen_install_h1:"{{ CONNECTORNAME }} をインストール",injectionScreen_install_p:"{{ CONNECTORSHORTNAME }} ウォレットを接続するには、ブラウザ拡張機能をインストールします。",injectionScreen_connecting_h1:"接続を要求",injectionScreen_connecting_p:"{{ CONNECTORSHORTNAME }} ブラウザ拡張機能を 開いて、ウォレットを接続します。",injectionScreen_connecting_injected_h1:"接続を要求",injectionScreen_connecting_injected_p:"このアプリに接続するには、ウォレットを介して要求を受け入れます。",injectionScreen_connected_h1:"すでに接続済み",injectionScreen_connected_p:"このポップアップを閉じてもかまいません",injectionScreen_rejected_h1:"要求がキャンセルされました",injectionScreen_rejected_p:"要求をキャンセルしました。上をクリックしてもう一度お試しください。",injectionScreen_failed_h1:"接続に失敗しました",injectionScreen_failed_p:"申し訳ありませんが、問題が発生しました。もう一度接続してみてください。",injectionScreen_notconnected_h1:"{{ CONNECTORNAME }} にログイン",injectionScreen_notconnected_p:"続行するには、 {{ CONNECTORNAME }} 拡張機能にログインしてください。",profileScreen_heading:"接続されました",switchNetworkScreen_heading:"ネットワークの切り替え",signInWithEthereumScreen_tooltip:`このアプリにサインインしていません。
続行するには、**イーサリアムでサインイン**してください。`,signInWithEthereumScreen_signedOut_heading:"イーサリアムでサインイン",signInWithEthereumScreen_signedOut_h1:"このアプリは、あなたがこのウォレットの 所有者であることを確認しようとしています。",signInWithEthereumScreen_signedOut_p:"続行するには、ウォレットで メッセージ リクエストに署名してください。",signInWithEthereumScreen_signedOut_button:"サインイン",signInWithEthereumScreen_signedIn_heading:"イーサリアムでサインインしました",signInWithEthereumScreen_signedIn_h1:"このウォレットの所有者であることが 正常に確認されました。",signInWithEthereumScreen_signedIn_p:"サインアウトすると、今後 再度認証する必要があります。",signInWithEthereumScreen_signedIn_button:"サインアウト"};const ptBR={connectWallet:"Conectar carteira",disconnect:"Desconectar",connected:"Conectado",wrongNetwork:"Rede incorreta",switchNetworks:"Alternar rede",chainNetwork:"Rede {{ CHAIN }}",copyToClipboard:"Copiar para a área de transferência",copyCode:"Copiar código",moreInformation:"Mais informações",back:"Voltar",close:"Fechar",or:"ou",more:"Mais",tryAgain:"Tentar novamente",tryAgainQuestion:"Tentar novamente?",dontHaveTheApp:"Não tem o aplicativo?",scanTheQRCode:"Escaneie o código QR",useWalletConnectModal:"Use o modal do WalletConnect",useModal:"Usar modal",installTheExtension:"Instale a extensão",getWalletName:"Obter {{ CONNECTORNAME }}",otherWallets:"Outras carteiras",learnMore:"Saiba mais",getWallet:"Obtenha uma carteira",approveInWallet:"Aprovar na carteira",confirmInWallet:"Confirmar na carteira",awaitingConfirmation:"Aguardando confirmação",signIn:"Entrar",signOut:"Sair",signedIn:"Conectado",signedOut:"Desconectado",walletNotConnected:"Carteira não conectada",warnings_walletSwitchingUnsupported:"A sua carteira não permite a troca de rede a partir deste aplicativo.",warnings_walletSwitchingUnsupportedResolve:"Tente trocar de rede de dentro da sua carteira.",warnings_chainUnsupported:"Este aplicativo não é compatível com a rede conectada.",warnings_chainUnsupportedResolve:"Altere a rede ou desconecte para continuar.",onboardingScreen_heading:"Obtenha uma carteira",onboardingScreen_h1:"Comece a explorar a Web3",onboardingScreen_p:"Sua carteira é a porta de entrada para todas as coisas Ethereum, a tecnologia mágica que torna possível explorar a web3.",onboardingScreen_ctaText:"Escolha sua primeira carteira",onboardingScreen_ctaUrl:"https://ethereum.org/pt-br/wallets/find-wallet/",aboutScreen_heading:"Sobre as carteiras",aboutScreen_a_h1:"Para seus ativos digitais",aboutScreen_a_p:"As carteiras permitem que você envie, receba, armazene e interaja com ativos digitais como NFTs e outros tokens Ethereum.",aboutScreen_b_h1:"Uma maneira melhor de fazer login",aboutScreen_b_p:"Com aplicativos modernos, sua carteira pode ser usada como uma maneira fácil de fazer login, em vez de ter que lembrar uma senha.",aboutScreen_c_h1:"Explore o mundo da Web3",aboutScreen_c_p:"Sua carteira é uma utilidade essencial que permite explorar e participar do mundo em rápida evolução da Web3.",aboutScreen_ctaText:"Saiba mais",aboutScreen_ctaUrl:"https://ethereum.org/pt-br/wallets/",connectorsScreen_heading:"Conectar carteira",connectorsScreen_newcomer:"Eu não tenho uma carteira",connectorsScreen_h1:"O que é uma carteira?",connectorsScreen_p:"As carteiras são usadas para enviar, receber e armazenar ativos digitais. A conexão de uma carteira permite que você interaja com aplicativos.",mobileConnectorsScreen_heading:"Escolha uma carteira",scanScreen_heading:"Escanear com o celular",scanScreen_heading_withConnector:"Escanear com o {{ CONNECTORNAME }}",scanScreen_tooltip_walletConnect:`Abra uma carteira compatível
com o WalletConnect [WALLETCONNECTLOGO] para escanear`,scanScreen_tooltip_default:`Abra o {{ CONNECTORNAME }} no
seu celular para escanear`,downloadAppScreen_heading:"Obter {{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:"Escaneie com a câmera do seu celular para baixar no iOS ou Android.",downloadAppScreen_ios:"Escaneie com a câmera do seu celular para baixar no iOS.",downloadAppScreen_android:"Escaneie com a câmera do seu celular para baixar no Android.",injectionScreen_unavailable_h1:"Navegador não compatível",injectionScreen_unavailable_p:`Para conectar sua carteira {{ CONNECTORSHORTNAME }},
instale a extensão no {{ SUGGESTEDEXTENSIONBROWSER }}.`,injectionScreen_install_h1:"Instalar {{ CONNECTORNAME }}",injectionScreen_install_p:`Para conectar sua carteira {{ CONNECTORSHORTNAME }},
instale a extensão do navegador`,injectionScreen_connecting_h1:"Solicitando conexão",injectionScreen_connecting_p:`Abra a extensão do navegador do {{ CONNECTORSHORTNAME }}
para conectar a sua carteira.`,injectionScreen_connecting_injected_h1:"Solicitando conexão",injectionScreen_connecting_injected_p:"Aceite a solicitação por meio de sua carteira para se conectar a este aplicativo.",injectionScreen_connected_h1:"Já conectado",injectionScreen_connected_p:"Agora você já pode fechar esta janela",injectionScreen_rejected_h1:"Solicitação cancelada",injectionScreen_rejected_p:`Você cancelou a solicitação.
Clique acima para tentar novamente.`,injectionScreen_failed_h1:"A conexão falhou",injectionScreen_failed_p:`Desculpe, ocorreu um erro.
Por favor, tente conectar novamente.`,injectionScreen_notconnected_h1:"Faça login no {{ CONNECTORNAME }}",injectionScreen_notconnected_p:"Para continuar, faça login na sua extensão do {{ CONNECTORNAME }}.",profileScreen_heading:"Conectado",switchNetworkScreen_heading:"Alternar rede",signInWithEthereumScreen_tooltip:`Você não está conectado a este aplicativo.
**Entre com Ethereum** para continuar.`,signInWithEthereumScreen_signedOut_heading:"Entrar com Ethereum",signInWithEthereumScreen_signedOut_h1:`Este aplicativo gostaria de verificar você
como o proprietário desta carteira.`,signInWithEthereumScreen_signedOut_p:`Por favor, assine o pedido de mensagem
em sua carteira para continuar.`,signInWithEthereumScreen_signedOut_button:"Entrar",signInWithEthereumScreen_signedIn_heading:"Conectado com Ethereum",signInWithEthereumScreen_signedIn_h1:`Você se verificou com sucesso
como o proprietário desta carteira`,signInWithEthereumScreen_signedIn_p:`Se sair, será necessário que você
autentique novamente no futuro.`,signInWithEthereumScreen_signedIn_button:"Sair"},ruRU={connectWallet:"Подключить кошелек",disconnect:"Отключить",connected:"Подключена",wrongNetwork:"Неверная сеть",switchNetworks:"Переключение сети",chainNetwork:"Сеть {{ CHAIN }}",copyToClipboard:"Скопировать в буфер обмена",copyCode:"Скопировать код",moreInformation:"Больше информации",back:"Назад",close:"Закрыть",or:"или",more:"Еще",tryAgain:"Попробовать снова",tryAgainQuestion:"Попробовать снова?",dontHaveTheApp:"У вас нет приложения?",scanTheQRCode:"Отсканируйте QR-код",useWalletConnectModal:"Использовать окно WalletConnect",useModal:"Использовать модальное окно",installTheExtension:"Установить расширение",getWalletName:"Скачать {{ CONNECTORNAME }}",otherWallets:"Другие кошельки",learnMore:"Узнать больше",getWallet:"Завести кошелек",approveInWallet:"Подтвердите",confirmInWallet:"Подтвердите",awaitingConfirmation:"Ожидаем подтверждение",signIn:"Войти",signOut:"Выйти",signedIn:"Вошли",signedOut:"Вышли",walletNotConnected:"Кошелек не подключен",warnings_walletSwitchingUnsupported:"Ваш кошелек не поддерживает переключение сетей из этого приложения.",warnings_walletSwitchingUnsupportedResolve:"Попробуйте переключиться на другую сеть прямо в вашем кошельке.",warnings_chainUnsupported:"Это приложение не поддерживает текущую подключенную сеть.",warnings_chainUnsupportedResolve:"Для продолжения переключите сеть или отключите кошелек.",onboardingScreen_heading:"Завести кошелек",onboardingScreen_h1:"Начните исследовать веб3",onboardingScreen_p:"Ваш кошелек — это врата в мир Ethereum, волшебной технологии, которая позволяет исследовать веб3.",onboardingScreen_ctaText:"Выбрать свой первый кошелек",onboardingScreen_ctaUrl:"https://ethereum.org/en/wallets/find-wallet/",aboutScreen_heading:"О кошельках",aboutScreen_a_h1:"Для ваших цифровых активов",aboutScreen_a_p:"Кошельки позволяют вам отправлять, получать, хранить и взаимодействовать с цифровыми активами, такими как NFT и другие токены Ethereum.",aboutScreen_b_h1:"Лучший способ входа",aboutScreen_b_p:"В современных приложениях ваш кошелек можно использовать как удобный способ входа без необходимости помнить пароль.",aboutScreen_c_h1:"Исследуйте мир веб3",aboutScreen_c_p:"Ваш кошелек - это неотъемлемый инструмент, который позволяет вам исследовать и участвовать в быстро развивающемся мире веб3.",aboutScreen_ctaText:"Узнать больше",aboutScreen_ctaUrl:"https://ethereum.org/en/wallets/",connectorsScreen_heading:"Подключение кошелька",connectorsScreen_newcomer:"У меня нет кошелька",connectorsScreen_h1:"Что такое кошелек?",connectorsScreen_p:"Кошельки используются для отправки, получения и хранения цифровых активов. Подключение кошелька позволяет вам взаимодействовать с приложениями.",mobileConnectorsScreen_heading:"Выберите кошелек",scanScreen_heading:"Сканирование с телефона",scanScreen_heading_withConnector:"Сканирование с помощью {{ CONNECTORNAME }}",scanScreen_tooltip_walletConnect:"Откройте [WALLETCONNECTLOGO] поддерживаемый WalletConnect кошелек для сканирования",scanScreen_tooltip_default:"Откройте {{ CONNECTORNAME }} на вашем мобильном телефоне для сканирования",downloadAppScreen_heading:"Скачивание {{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:"Отсканируйте камерой телефона для загрузки приложения на iOS или Android.",downloadAppScreen_ios:"Отсканируйте камерой телефона для загрузки приложения на iOS.",downloadAppScreen_android:"Сканируйте камерой телефона для загрузки приложения на Android.",injectionScreen_unavailable_h1:"Неподдерживаемый браузер",injectionScreen_unavailable_p:"Для подключения вашего кошелька {{ CONNECTORSHORTNAME }}, установите расширение для браузера {{ SUGGESTEDEXTENSIONBROWSER }}.",injectionScreen_install_h1:"Установите {{ CONNECTORNAME }}",injectionScreen_install_p:"Для подключения вашего кошелька {{ CONNECTORSHORTNAME }}, установите расширение для браузера.",injectionScreen_connecting_h1:"Запрос на подключение",injectionScreen_connecting_p:"Откройте расширение для браузера {{ CONNECTORSHORTNAME }} для подключения вашего кошелька.",injectionScreen_connecting_injected_h1:"Запрос на подключение",injectionScreen_connecting_injected_p:"Примите запрос в вашем кошельке, чтобы подключиться к приложению.",injectionScreen_connected_h1:"Уже подключен",injectionScreen_connected_p:"Можно закрыть это окно",injectionScreen_rejected_h1:"Запрос отменен",injectionScreen_rejected_p:`Вы отменили запрос.
Нажмите выше, чтобы попробовать снова.`,injectionScreen_failed_h1:"Сбой подключения",injectionScreen_failed_p:`Извините, что-то пошло не так.
Пожалуйста, попробуйте подключиться снова.`,injectionScreen_notconnected_h1:"Войдите в {{ CONNECTORNAME }}",injectionScreen_notconnected_p:"Для продолжения войдите в расширение {{ CONNECTORNAME }}.",profileScreen_heading:"Кошелек подключен",switchNetworkScreen_heading:"Переключение сетей",signInWithEthereumScreen_tooltip:`Вы не вошли в это приложение.
**Войдите с помощью Ethereum**, чтобы продолжить.`,signInWithEthereumScreen_signedOut_heading:"Войти с помощью Ethereum",signInWithEthereumScreen_signedOut_h1:`Это приложение хочет подтвердить вас
в качестве владельца этого кошелька.`,signInWithEthereumScreen_signedOut_p:`Пожалуйста, подпишите запрос на сообщение
в своем кошельке, чтобы продолжить.`,signInWithEthereumScreen_signedOut_button:"Войти",signInWithEthereumScreen_signedIn_heading:"Вошли с помощью Ethereum",signInWithEthereumScreen_signedIn_h1:`Вы успешно подтвердили себя
в качестве владельца этого кошелька.`,signInWithEthereumScreen_signedIn_p:`Выйти потребуется
повторная аутентификация в будущем.`,signInWithEthereumScreen_signedIn_button:"Выйти"},zhCN={connectWallet:"绑定钱包",disconnect:"解除绑定",connected:"已绑定",wrongNetwork:"错误网络",switchNetworks:"切换网络",chainNetwork:"{{ CHAIN }}网络",copyToClipboard:"复制到剪贴板",copyCode:"复制代码",moreInformation:"更多信息",back:"返回",close:"关闭",or:"或",more:"更多",tryAgain:"重试",tryAgainQuestion:"重试?",dontHaveTheApp:"没有该应用?",scanTheQRCode:"扫描二维码",useWalletConnectModal:"使用 WalletConnect 模态窗",useModal:"使用模态窗",installTheExtension:"安装扩展程序",getWalletName:"获取{{ CONNECTORNAME }}",otherWallets:"其他钱包",learnMore:"了解更多",getWallet:"获取钱包",approveInWallet:"在钱包中批准",confirmInWallet:"在钱包中确认",awaitingConfirmation:"等待确认",signIn:"登录",signOut:"登出",signedIn:"已登录",signedOut:"已登出",walletNotConnected:"钱包未绑定",warnings_walletSwitchingUnsupported:"您的钱包不支持从此应用切换网络。",warnings_walletSwitchingUnsupportedResolve:"请尝试从钱包中切换网络。",warnings_chainUnsupported:"此应用不支持当前连接的网络。",warnings_chainUnsupportedResolve:"请切换网络或断开连接以继续。",onboardingScreen_heading:"获取钱包",onboardingScreen_h1:"开始探索 Web3",onboardingScreen_p:"您的钱包是通往以太坊的一扇大门,而以太坊是探索 Web3 的一项神奇技术。",onboardingScreen_ctaText:"选择您的第一钱包",onboardingScreen_ctaUrl:"https://ethereum.org/zh/wallets/find-wallet/",aboutScreen_heading:"关于钱包",aboutScreen_a_h1:"对于您的数字资产",aboutScreen_a_p:"有了钱包,您可以发送、接收、存储数字资产及使用数字资产进行交互,例如 NFT 和其他以太坊通证等。",aboutScreen_b_h1:"更好的登录方式",aboutScreen_b_p:"使用现代应用,您的钱包可以用作简便的登录方法,而不必记住密码。",aboutScreen_c_h1:"探索 Web3 世界",aboutScreen_c_p:"您的钱包是一个重要的工具,可以让您探索并参与到快速发展的 Web3 世界。",aboutScreen_ctaText:"了解更多",aboutScreen_ctaUrl:"https://ethereum.org/zh/wallets/",connectorsScreen_heading:"绑定钱包",connectorsScreen_newcomer:"我没有钱包",connectorsScreen_h1:"什么是钱包?",connectorsScreen_p:"钱包可用于发送、接收和存储数字资产。通过绑定钱包,您可以与应用进行交互。",mobileConnectorsScreen_heading:"选择钱包",scanScreen_heading:"手机扫描",scanScreen_heading_withConnector:"手机扫描{{ CONNECTORNAME }}",scanScreen_tooltip_walletConnect:"打开 [WALLETCONNECTLOGO] WalletConnect 支持的钱包进行扫描",scanScreen_tooltip_default:"打开您手机上的{{ CONNECTORNAME }} 进行扫描",downloadAppScreen_heading:"获取{{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:"使用手机相机扫描以下载 iOS 或 Android 应用。",downloadAppScreen_ios:"使用手机相机扫描以下载 iOS 应用。",downloadAppScreen_android:"使用手机相机扫描以下载 Android 应用。",injectionScreen_unavailable_h1:"不支持的浏览器",injectionScreen_unavailable_p:"要绑定您的{{ CONNECTORSHORTNAME }}钱包,请在{{ SUGGESTEDEXTENSIONBROWSER }}上安装此扩展程序。",injectionScreen_install_h1:"安装{{ CONNECTORNAME }}",injectionScreen_install_p:"要绑定您的{{ CONNECTORSHORTNAME }}钱包,请安装此浏览器扩展程序。",injectionScreen_connecting_h1:"请求绑定",injectionScreen_connecting_p:"打开{{ CONNECTORSHORTNAME }}浏览器 扩展程序以绑定您的钱包。",injectionScreen_connecting_injected_h1:"请求绑定",injectionScreen_connecting_injected_p:"通过您的钱包接受请求,以绑定到此应用。",injectionScreen_connected_h1:"已绑定",injectionScreen_connected_p:"现在可以关闭此弹窗",injectionScreen_rejected_h1:"请求已取消",injectionScreen_rejected_p:"您已取消请求。点击上面可重试。",injectionScreen_failed_h1:"绑定失败",injectionScreen_failed_p:"抱歉,发生错误。请尝试重新绑定。",injectionScreen_notconnected_h1:"登录{{ CONNECTORNAME }}",injectionScreen_notconnected_p:"要继续,请登录到您的{{ CONNECTORNAME }}扩展程序。",profileScreen_heading:"已绑定",switchNetworkScreen_heading:"切换网络",signInWithEthereumScreen_tooltip:`您尚未登录到此应用。
请选择**使用以太坊登录**以继续。`,signInWithEthereumScreen_signedOut_heading:"使用以太坊登录",signInWithEthereumScreen_signedOut_h1:"此应用希望验证您是 此钱包的所有者。",signInWithEthereumScreen_signedOut_p:"请签署钱包中的消息请求 以继续。",signInWithEthereumScreen_signedOut_button:"登录",signInWithEthereumScreen_signedIn_heading:"已使用以太坊登录",signInWithEthereumScreen_signedIn_h1:"您已成功验证自己 是此钱包的所有者。",signInWithEthereumScreen_signedIn_p:"登出后,将来您还需要 再次进行身份验证。",signInWithEthereumScreen_signedIn_button:"登出"},caAD={connectWallet:"Connecta la cartera",disconnect:"Desconnectar",connected:"Connectat",wrongNetwork:"Xarxa incorrecta",switchNetworks:"Canvi de xarxa",chainNetwork:"Xarxa {{ CHAIN }}",copyToClipboard:"Copia al portapapers",copyCode:"Copia codi",moreInformation:"Més informació",back:"Enrere",close:"Tanca",or:"o",more:"Més",tryAgain:"Torna-ho a intentar",tryAgainQuestion:"Tornar a intentar-ho?",dontHaveTheApp:"No tens l'aplicació?",scanTheQRCode:"Escaneja el codi QR",useWalletConnectModal:"Utilitza WalletConnect Modal",useModal:"Utilitza Modal",installTheExtension:"Instal·la l'extensió",getWalletName:"Obté {{ CONNECTORNAME }}",otherWallets:"Altres carteres",learnMore:"Més informació",getWallet:"Obté una cartera",approveInWallet:"Aprova a la cartera",confirmInWallet:"Confirma a la cartera",awaitingConfirmation:"Esperant confirmació",signIn:"Inicia sessió",signOut:"Tanca sessió",signedIn:"Sessió iniciada",signedOut:"Sessió tancada",walletNotConnected:"Cartera no connectada",warnings_walletSwitchingUnsupported:"La teva cartera no permet canviar de xarxa des d'aquesta aplicació.",warnings_walletSwitchingUnsupportedResolve:"Prova a canviar de xarxa des de la teva cartera.",warnings_chainUnsupported:"Aquesta aplicació no és compatible amb la xarxa connectada actualment.",warnings_chainUnsupportedResolve:"Canvia o desconnecta per continuar.",onboardingScreen_heading:"Obté una cartera",onboardingScreen_h1:"Comença a explorar la Web3",onboardingScreen_p:"La teva cartera és el portal d'accés a tot el relacionat amb Ethereum, la tecnologia màgica que permet explorar la Web3.",onboardingScreen_ctaText:"Tria la teva primera cartera",onboardingScreen_ctaUrl:"https://ethereum.org/es/wallets/find-wallet/",aboutScreen_heading:"Sobre les carteres",aboutScreen_a_h1:"Per als teus actius digitals",aboutScreen_a_p:"Les carteres et permeten enviar, rebre, emmagatzemar i interactuar amb actius digitals com els NFT i altres tokens d'Ethereum.",aboutScreen_b_h1:"Una manera millor d'iniciar sessió",aboutScreen_b_p:"Amb les aplicacions modernes, pots utilitzar la teva cartera per iniciar sessió fàcilment, en lloc de haver de recordar una contrasenya.",aboutScreen_c_h1:"Explora el món de la Web3",aboutScreen_c_p:"La teva cartera és una eina essencial que et permet explorar i participar en el món en ràpida evolució de la Web3.",aboutScreen_ctaText:"Més informació",aboutScreen_ctaUrl:"https://ethereum.org/es/wallets/",connectorsScreen_heading:"Connecta una cartera",connectorsScreen_newcomer:"No tinc una cartera",connectorsScreen_h1:"Què és una cartera?",connectorsScreen_p:"Les carteres s'utilitzen per enviar, rebre i emmagatzemar actius digitals. Si connectes una cartera, podràs interactuar amb les aplicacions.",mobileConnectorsScreen_heading:"Tria una cartera",scanScreen_heading:"Escaneja amb el telèfon",scanScreen_heading_withConnector:"Escaneja amb {{ CONNECTORNAME }}",scanScreen_tooltip_walletConnect:"Obre una cartera compatible amb WalletConnect [WALLETCONNECTLOGO] per escanejar",scanScreen_tooltip_default:"Obre {{ CONNECTORNAME }} en el teu telèfon mòbil per escanejar",downloadAppScreen_heading:"Obté {{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:"Escaneja amb la càmera del teu telèfon per descarregar-la en iOS o Android.",downloadAppScreen_ios:"Escaneja amb la càmera del teu telèfon per descarregar-la en iOS.",downloadAppScreen_android:"Escaneja amb la càmera del teu telèfon per descarregar-la en Android.",injectionScreen_unavailable_h1:"Navegador no compatible",injectionScreen_unavailable_p:"Per connectar la teva cartera de {{ CONNECTORSHORTNAME }}, instal·la l'extensió en {{ SUGGESTEDEXTENSIONBROWSER }}.",injectionScreen_install_h1:"Instal·la {{ CONNECTORNAME }}",injectionScreen_install_p:"Per connectar la teva cartera de {{ CONNECTORSHORTNAME }}, instal·la l'extensió del navegador.",injectionScreen_connecting_h1:"Sol·licitud de connexió",injectionScreen_connecting_p:"Obre l'extensió del navegador de {{ CONNECTORSHORTNAME }} per connectar la teva cartera.",injectionScreen_connecting_injected_h1:"Sol·licitud de connexió",injectionScreen_connecting_injected_p:"Accepta la sol·licitud a través de la teva cartera per connectar-te a aquesta aplicació.",injectionScreen_connected_h1:"Ja connectada",injectionScreen_connected_p:"Ja pots tancar aquesta finestra emergent",injectionScreen_rejected_h1:"Sol·licitud cancel·lada",injectionScreen_rejected_p:"Has cancel·lat la sol·licitud. Fes clic a dalt per tornar-ho a intentar.",injectionScreen_failed_h1:"Error de connexió",injectionScreen_failed_p:"Ho sentim, hi ha hagut un problema. Intenta connectar-te de nou.",injectionScreen_notconnected_h1:"Inicia sessió en {{ CONNECTORNAME }}",injectionScreen_notconnected_p:"Per continuar, inicia sessió en la teva extensió de {{ CONNECTORNAME }}.",profileScreen_heading:"Connectat",switchNetworkScreen_heading:"Canvi de xarxa",signInWithEthereumScreen_tooltip:`No has iniciat sessió en aquesta aplicació.
**Inicia sessió amb Ethereum** per continuar.`,signInWithEthereumScreen_signedOut_heading:"Inicia sessió amb Ethereum",signInWithEthereumScreen_signedOut_h1:"Aquesta aplicació vol verificar que ets el propietari d'aquesta cartera.",signInWithEthereumScreen_signedOut_p:"Signa la sol·licitud de missatge en la teva cartera per continuar.",signInWithEthereumScreen_signedOut_button:"Inicia sessió",signInWithEthereumScreen_signedIn_heading:"Sessió iniciada amb Ethereum",signInWithEthereumScreen_signedIn_h1:"T'has verificat correctament com a propietari d'aquesta cartera.",signInWithEthereumScreen_signedIn_p:"Si tanques la sessió, hauràs de tornar a autenticar-te més endavant.",signInWithEthereumScreen_signedIn_button:"Tanca sessió"},trTR={connectWallet:"Cüzdan Bağla",disconnect:"Bağlantıyı Kes",connected:"Bağlandı",wrongNetwork:"Yanlış Ağ",switchNetworks:"Ağ Değiştir",chainNetwork:"{{ CHAIN }} Ağı",copyToClipboard:"Panoya Kopyala",copyCode:"Kodu Kopyala",moreInformation:"Daha Fazla Bilgi",back:"Geri",close:"Kapat",or:"veya",more:"Daha Fazla",tryAgain:"Tekrar Dene",tryAgainQuestion:"Tekrar Dene?",dontHaveTheApp:"Uygulaman yok mu?",scanTheQRCode:"Karekodu tarat",useWalletConnectModal:"WalletConnect Modalini Kullan ",useModal:"Modal Kullan",installTheExtension:"Eklentiyi İndir",getWalletName:"{{ CONNECTORNAME }} Alın",otherWallets:"Diğer Cüzdanlar",learnMore:"Daha Fazlasını Öğren",getWallet:"Cüzdan Al",approveInWallet:"Cüzdanda Yetki Ver",confirmInWallet:"Cüzdanda Onayla",awaitingConfirmation:"Doğrulama Bekleniyor",signIn:"Giriş Yap",signOut:"Çıkış Yap",signedIn:"Giriş Yapıldı",signedOut:"Çıkış Yapıldı",walletNotConnected:"Cüzdan Bağlı Değil",warnings_walletSwitchingUnsupported:"Bu uygulamada ağ değiştirmeyi cüzdanın desteklemiyor.",warnings_walletSwitchingUnsupportedResolve:"Bunun yerine cüzdanınızdan ağları değiştirmeyi deneyin.",warnings_chainUnsupported:"Bu uygulama kullanmış olduğunuz ağı desteklemiyor.",warnings_chainUnsupportedResolve:"Devam etmek için ağ değiştir veya bağlantıyı kes.",onboardingScreen_heading:"Cüzdan Al",onboardingScreen_h1:"Web3'ü keşfetmeye başla",onboardingScreen_p:"Cüzdanınız, Web3'ü keşfetmeyi mümkün kılan sihirli teknoloji olan Ethereum'a açılan kapıdır.",onboardingScreen_ctaText:"İlk Cüzdanını Seç",onboardingScreen_ctaUrl:"https://ethereum.org/tr/wallets/find-wallet/",aboutScreen_heading:"Cüzdanlar Hakkında",aboutScreen_a_h1:"Dijital varlıkların için",aboutScreen_a_p:"Cüzdanlar, NFT'ler ve diğer Ethereum varlıkları gibi dijital varlıklar göndermenize, almanıza, saklamanıza ve bunlarla etkileşim kurmanıza olanak tanır.",aboutScreen_b_h1:"Giriş yapmanın daha iyi bir yolu",aboutScreen_b_p:"Modern uygulamalar ile parola hatırlamak yerine cüzdanınız ile kolayca giriş yapabilirsiniz.",aboutScreen_c_h1:"Web3 dünyasını keşfet",aboutScreen_c_p:"Cüzdanınız, hızla gelişen Web3 dünyasını keşfetmenizi ve bu dünyaya katılmanızı sağlayan temel bir yardımcı programdır.",aboutScreen_ctaText:"Daha Fazlasını Öğren",aboutScreen_ctaUrl:"https://ethereum.org/tr/wallets/",connectorsScreen_heading:"Cüzdan Bağla",connectorsScreen_newcomer:"Cüzdanım Yok",connectorsScreen_h1:"Cüzdan nedir?",connectorsScreen_p:"Cüzdanlar, dijital varlıkları göndermek, almak ve depolamak için kullanılır. Bir cüzdanı bağlamak, uygulamalarla etkileşime geçmenizi sağlar.",mobileConnectorsScreen_heading:"Cüzdan Seç",scanScreen_heading:"Telefon ile Tarat",scanScreen_heading_withConnector:"{{ CONNECTORNAME }} ile tarat",scanScreen_tooltip_walletConnect:`Desteklenen bir cüzdan taramak için
[WALLETCONNECTLOGO] WalletConnect uygulamasını aç`,scanScreen_tooltip_default:`Taramak için telefonunda
{{ CONNECTORNAME }} uygulamasını aç`,downloadAppScreen_heading:"{{ CONNECTORNAME }} İndir",downloadAppScreen_iosAndroid:"iOS ve Android'e indirmek için telefon kameran ile tarat.",downloadAppScreen_ios:"iOS'a indirmek için telefon kameran ile tarat.",downloadAppScreen_android:"Android'e indirmek için telefon kameran ile tarat.",injectionScreen_unavailable_h1:"Desteklenmeyen Tarayıcı",injectionScreen_unavailable_p:`{{ CONNECTORSHORTNAME }} cüzdanına bağlanmak için
{{ SUGGESTEDEXTENSIONBROWSER }} üzerinde indirmen gerekiyor.`,injectionScreen_install_h1:"{{ CONNECTORNAME }} İndir",injectionScreen_install_p:`{{ CONNECTORSHORTNAME }} cüzdanına bağlanmak için,
tarayıcı eklentisini indir.`,injectionScreen_connecting_h1:"Bağlantı İsteniyor.",injectionScreen_connecting_p:`Cüzdanını bağlamak için
tarayıcıdan {{ CONNECTORSHORTNAME }} uzantısınıın.`,injectionScreen_connecting_injected_h1:"Bağlantı İsteniyor.",injectionScreen_connecting_injected_p:"Bu uygulamaya bağlanmak için cüzdanına gelen isteği kabul et.",injectionScreen_connected_h1:"Zaten Bağlanmış",injectionScreen_connected_p:"Bu açılır pencereyi artık kapatabilirsin",injectionScreen_rejected_h1:"İstek iptal edildi.",injectionScreen_rejected_p:`İsteği iptal ettin.
Tekrar denemek için yukarıyı tıklayın.`,injectionScreen_failed_h1:"Bağlantı Başarısız",injectionScreen_failed_p:`Üzgünüz, bir şeyler ters gitti.
Lütfen daha sonra tekrar deneyin.`,injectionScreen_notconnected_h1:"{{ CONNECTORNAME }} ile giriş yap",injectionScreen_notconnected_p:"Devam etmek için, {{ CONNECTORNAME }} eklentisine giriş yapın.",profileScreen_heading:"Bağlandı",switchNetworkScreen_heading:"Ağ Değiştir",signInWithEthereumScreen_tooltip:`Bu uygulamada oturum açmadınız.
Devam etmek için **Ethereum İle Giriş Yap**.`,signInWithEthereumScreen_signedOut_heading:"Ethereum İle Giriş Yap",signInWithEthereumScreen_signedOut_h1:`Bu uygulama seni
bu cüzdanın sahibi olarak doğrulamak istiyor.`,signInWithEthereumScreen_signedOut_p:`Devam etmek için
cüzdanınızdaki isteği onaylayın.`,signInWithEthereumScreen_signedOut_button:"Giriş Yap",signInWithEthereumScreen_signedIn_heading:"Ethereum İle Giriş Yapıldı",signInWithEthereumScreen_signedIn_h1:`Bu cüzdanın sahibi olduğunu
başarıyla onayladın.`,signInWithEthereumScreen_signedIn_p:`Çıkış yaparsan ileride
tekrar giriş yapman gerekecek. `,signInWithEthereumScreen_signedIn_button:"Çıkış Yap"},viVN={connectWallet:"Kết nối ví",disconnect:"Ngắt kết nối",connected:"Đã kết nối",wrongNetwork:"Mạng không hỗ trợ",switchNetworks:"Đổi mạng",chainNetwork:"Mạng {{ CHAIN }}",copyToClipboard:"Sao chép",copyCode:"Sao chép mã",moreInformation:"Thêm thông tin",back:"Quay lại",close:"Đóng",or:"hoặc",more:"Thêm",tryAgain:"Thử lại",tryAgainQuestion:"Thử lại?",dontHaveTheApp:"Không có app?",scanTheQRCode:"Quét mã QR",useWalletConnectModal:"Dùng WalletConnect Modal",useModal:"Dùng Modal",installTheExtension:"Cài tiện ích",getWalletName:"Lấy {{ CONNECTORNAME }}",otherWallets:"Các ví khác",learnMore:"Xem thêm",getWallet:"Tạo một ví",approveInWallet:"Cấp quyền trong ví",confirmInWallet:"Xác nhận trong ví",awaitingConfirmation:"Đang chờ xác nhận",signIn:"Đăng nhập",signOut:"Đăng xuất",signedIn:"Đã đăng nhập",signedOut:"Đã đăng xuất",walletNotConnected:"Chưa kết nối ví",warnings_walletSwitchingUnsupported:"Ví của bạn không hỗ trợ đổi mạng từ ứng dụng.",warnings_walletSwitchingUnsupportedResolve:"Hãy thử đổi mạng từ phía ví của bạn.",warnings_chainUnsupported:"Ứng dụng này không hỗ trợ mạng hiện tại.",warnings_chainUnsupportedResolve:"Đổi hoặc ngắt kết nối để tiếp tục.",onboardingScreen_heading:"Tạo một ví",onboardingScreen_h1:"Bắt đầu khám khá Web3",onboardingScreen_p:"Ví của bạn là cổng giao tiếp mọi thứ trên Ethereum, công nghệ tuyệt vời giúp khám phá Web3.",onboardingScreen_ctaText:"Chọn ví đầu tiên của bạn",onboardingScreen_ctaUrl:"https://ethereum.org/en/wallets/find-wallet/",aboutScreen_heading:"Giới thiệu các ví",aboutScreen_a_h1:"Cho tài sản số của bạn",aboutScreen_a_p:"Các ví để bạn gửi, nhận, lưu trữ, và tương tác với các tài sản điện tử như NFTs và các loại tiền Ethereum khác.",aboutScreen_b_h1:"Một cách tốt hơn để đăng nhập",aboutScreen_b_p:"Với các ứng dụng hiện đại, ví của bạn có thể dùng để đăng nhập dễ dàng thay vì phải nhớ tài khoản và mật khẩu.",aboutScreen_c_h1:"Khám phá thế giới Web3",aboutScreen_c_p:"Ví của bạn là một tiện ích thiết yếu cho phép bạn khám phá và tham gia vào thế giới web3 đang phát triển nhanh chóng.",aboutScreen_ctaText:"Tìm hiểu thêm",aboutScreen_ctaUrl:"https://ethereum.org/en/wallets/",connectorsScreen_heading:"Kết nối Ví",connectorsScreen_newcomer:"Tôi chưa có ví",connectorsScreen_h1:"Ví là gì?",connectorsScreen_p:"Ví dùng để gửi, nhận, và lưu trữ các tài sản điện tử. Kết nối với một ví giúp bạn tương tác với các ứng dụng.",mobileConnectorsScreen_heading:"Chọn ví",scanScreen_heading:"Scan bằng điện thoại",scanScreen_heading_withConnector:"Quét với {{ CONNECTORNAME }}",scanScreen_tooltip_walletConnect:`Mở một [WALLETCONNECTLOGO] mà WalletConnect
hỗ trợ để quét`,scanScreen_tooltip_default:`Mở {{ CONNECTORNAME }} trong
điện thoại của bạn để quét`,downloadAppScreen_heading:"Lấy {{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:"Quét bằng camera trên điện thoại của bạn để tải về cho iOS hoặc Android.",downloadAppScreen_ios:"Quét bằng camera trên điện thoại ủa bạn để tải về cho iOS.",downloadAppScreen_android:"Quét bằng camera trên điện thoại ủa bạn để tải về cho Android.",injectionScreen_unavailable_h1:"Trình duyệt không được hỗ trợ",injectionScreen_unavailable_p:`Để kết nối ví {{ CONNECTORSHORTNAME }} của bạn,
cài đặt tiện ích trên {{ SUGGESTEDEXTENSIONBROWSER }}.`,injectionScreen_install_h1:"Cài {{ CONNECTORNAME }}",injectionScreen_install_p:`Để kết nối ví {{ CONNECTORSHORTNAME }},
cài đặt tiện ích trên trình duyệt.`,injectionScreen_connecting_h1:"Đang yêu cầu kết nối",injectionScreen_connecting_p:`Mở tiện ích {{ CONNECTORSHORTNAME }}
trên trình duyệt để kết nối.`,injectionScreen_connecting_injected_h1:"Đang yêu cầu kết nối",injectionScreen_connecting_injected_p:"Đồng ý yêu cầu từ phía ví của bạn để kết nối ứng dụng này.",injectionScreen_connected_h1:"Đã kết nối",injectionScreen_connected_p:"Đã có thể đóng popup",injectionScreen_rejected_h1:"Đã hủy yêu cầu",injectionScreen_rejected_p:`Bạn vừa hủy yêu cầu.
Nhấn phía trên để thử lại.`,injectionScreen_failed_h1:"Kết nối không thành công",injectionScreen_failed_p:`Xin lỗi, có gì đó không đúng.
Vui lòng thử lại.`,injectionScreen_notconnected_h1:"Đăng nhập vào {{ CONNECTORNAME }}",injectionScreen_notconnected_p:"Để tiếp tục, vui lòng đăng nhập bằng tiện ích {{ CONNECTORNAME }}.",profileScreen_heading:"Đã kết nối",switchNetworkScreen_heading:"Đổi mạng",signInWithEthereumScreen_tooltip:`Bạn chưa đăng nhập vào ứng dụng.
**Đăng nhập qua Ethereum** để tiếp tục.`,signInWithEthereumScreen_signedOut_heading:"Đăng nhập qua Ethereum",signInWithEthereumScreen_signedOut_h1:`Ứng dụng này muốn xác nhận bạn
là chủ sở hữu của ví.`,signInWithEthereumScreen_signedOut_p:`Vui lòng ký tin nhắn yêu cầu
trên ví của bạn để tiếp tục.`,signInWithEthereumScreen_signedOut_button:"Đăng nhập",signInWithEthereumScreen_signedIn_heading:"Đăng nhập qua Ethereum",signInWithEthereumScreen_signedIn_h1:"Bạn đã xác nhận thành công.",signInWithEthereumScreen_signedIn_p:`Sau khi Đăng xuất bạn sẽ cần
xác nhận lại trong làn tiếp theo.`,signInWithEthereumScreen_signedIn_button:"Đăng xuất"},getLocale=et=>{switch(et){case"ee-EE":return eeEE;case"ar-AE":return arAE;case"es-ES":return esES;case"fa-IR":return faIR;case"fr-FR":return frFR;case"ja-JP":return jaJP;case"pt-BR":return ptBR;case"ru-RU":return ruRU;case"zh-CN":return zhCN;case"ca-AD":return caAD;case"tr-TR":return trTR;case"vi-VN":return viVN;default:return enUS}};function useLocales(et){var o,tt;const nt=(tt=(o=useContext().options)===null||o===void 0?void 0:o.language)!==null&&tt!==void 0?tt:"en-US",ot=reactExports.useMemo(()=>getLocale(nt),[nt]);if(!ot)return console.error(`Missing translations for: ${nt}`),`Missing translations for: ${nt}`;const it={};return Object.keys(ot).map(st=>{const at=ot[st];return it[st]=localize(at,et)}),it}const localize=(et,o)=>{let tt=et;return o&&Object.keys(o).forEach(rt=>{tt=tt.replace(new RegExp(`({{ ${rt} }})`,"g"),o[rt])}),replaceMarkdown(tt)},replaceMarkdown=et=>{let o=et;return o=o.split(`
`),o=o.map((tt,rt)=>jsxRuntimeExports.jsxs(React.Fragment,{children:[wrapTags(tt),rt<o.length-1&&jsxRuntimeExports.jsx("br",{})]},rt)),o},wrapTags=et=>et.split(/(\*\*[^\*]*\*\*)/g).map((rt,nt)=>/(\*\*.*\*\*)/g.test(rt)?jsxRuntimeExports.jsx("strong",{children:rt.replace(/\*\*/g,"")},nt):`${rt}`).map(rt=>typeof rt=="string"?rt.split(/(\[WALLETCONNECTLOGO\])/g).map(nt=>nt==="[WALLETCONNECTLOGO]"?jsxRuntimeExports.jsx("span",{className:"ck-tt-logo",children:jsxRuntimeExports.jsx(Logos.WalletConnect,{})},nt):nt):rt),LOG_LEVEL={debug:10,info:20,warn:30,error:40,none:100},useIsoLayoutEffect=typeof window<"u"&&window.document&&window.document.createElement!==void 0?reactExports.useLayoutEffect:reactExports.useEffect,useFitText=({logLevel:et="info",maxFontSize:o=100,minFontSize:tt=20,onFinish:rt,onStart:nt,resolution:ot=5}={})=>{const it=LOG_LEVEL[et],st=reactExports.useCallback(()=>({calcKey:0,fontSize:o,fontSizePrev:tt,fontSizeMax:o,fontSizeMin:tt}),[o,tt]),at=reactExports.useRef(null),ct=reactExports.useRef(),lt=reactExports.useRef(!1),[dt,ht]=reactExports.useState(st),{calcKey:mt,fontSize:ft,fontSizeMax:pt,fontSizeMin:yt,fontSizePrev:gt}=dt;let bt=null;const[xt]=reactExports.useState(()=>new index$1(()=>{bt=window.requestAnimationFrame(()=>{lt.current||(nt&&nt(),lt.current=!0,ht({...st(),calcKey:mt+1}))})}));reactExports.useEffect(()=>(at.current&&xt.observe(at.current),()=>{bt&&window.cancelAnimationFrame(bt),xt.disconnect()}),[bt,xt]);const vt=at.current&&at.current.innerHTML;return reactExports.useEffect(()=>{mt===0||lt.current||(vt!==ct.current&&(nt&&nt(),ht({...st(),calcKey:mt+1})),ct.current=vt)},[mt,st,vt,nt]),useIsoLayoutEffect(()=>{if(mt===0)return;const Et=Math.abs(ft-gt)<=ot,Ct=!!at.current&&(at.current.scrollHeight>at.current.offsetHeight||at.current.scrollWidth>at.current.offsetWidth),St=Ct&&ft===gt,At=ft>gt;if(Et){St?(lt.current=!1,it<=LOG_LEVEL.info&&console.info(`[use-fit-text] reached \`minFontSize = ${tt}\` without fitting text`)):Ct?ht({fontSize:At?gt:yt,fontSizeMax:pt,fontSizeMin:yt,fontSizePrev:gt,calcKey:mt}):(lt.current=!1,rt&&rt(ft));return}let kt,It=pt,Nt=yt;Ct?(kt=At?gt-ft:yt-ft,It=Math.min(pt,ft)):(kt=At?pt-ft:gt-ft,Nt=Math.max(yt,ft)),ht({calcKey:mt,fontSize:ft+kt/2,fontSizeMax:It,fontSizeMin:Nt,fontSizePrev:ft})},[mt,ft,pt,yt,gt,rt,at,ot]),{fontSize:ft,ref:at}},FitText=({children:et})=>{const[o,tt]=React.useState(!1),{fontSize:rt,ref:nt}=useFitText({logLevel:"none",maxFontSize:100,minFontSize:70,onStart:()=>tt(!0),onFinish:()=>tt(!0)});return jsxRuntimeExports.jsx("div",{ref:nt,style:{visibility:o?"visible":"hidden",fontSize:`${rt}%`,maxHeight:"100%",maxWidth:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:et})};FitText.displayName="FitText";function useConnectors(){const et=useConnectors$1();return et??[]}function useConnector(et,o){const tt=useConnectors();return et==="injected"&&o?tt.find(rt=>rt.id===et&&rt.name===o):et==="injected"?tt.find(rt=>rt.id===et&&rt.name.includes("Injected")):tt.find(rt=>rt.id===et)}function useWalletConnectConnector(){return useConnector("walletConnect")}const useWallet=et=>{const tt=useWallets().find(rt=>rt.id===et);return tt||null},useWallets=()=>{const et=useConnectors(),o=useContext();return et.map(rt=>{var nt,ot;const it=Object.keys(walletConfigs).find(at=>at.split(",").map(ct=>ct.trim()).indexOf(rt.id)!==-1),st={id:rt.id,name:(ot=(nt=rt.name)!==null&&nt!==void 0?nt:rt.id)!==null&&ot!==void 0?ot:rt.type,icon:jsxRuntimeExports.jsx("img",{src:rt.icon,alt:rt.name,width:"100%",height:"100%"}),connector:rt,iconShape:"squircle",isInstalled:rt.type==="mock"||rt.type==="injected"&&rt.id!=="metaMask"||isCoinbaseWalletConnector(rt.id)};if(it){const at=walletConfigs[it];return{...st,iconConnector:rt.icon?jsxRuntimeExports.jsx("img",{src:rt.icon,alt:rt.name,width:"100%",height:"100%"}):void 0,...at}}return st}).filter((rt,nt,ot)=>ot.findIndex(it=>it.id===rt.id)===nt).map(rt=>{var nt,ot;return rt.id==="walletConnect"?{...rt,name:((nt=o.options)===null||nt===void 0?void 0:nt.walletConnectName)||rt.name,shortName:((ot=o.options)===null||ot===void 0?void 0:ot.walletConnectName)||rt.shortName}:rt}).filter((rt,nt,ot)=>!(rt.id==="coinbaseWalletSDK"&&ot.find(it=>it.id==="com.coinbase.wallet"))).filter((rt,nt,ot)=>!((rt.id==="metaMaskSDK"||rt.id==="metaMask")&&ot.find(it=>it.id==="io.metamask"||it.id==="io.metamask.mobile"))).sort((rt,nt)=>{const ot=rt.isInstalled&&isInjectedConnector(rt.connector.type),it=nt.isInstalled&&isInjectedConnector(nt.connector.type);return ot&&!it?-1:!ot&&it?1:0}).sort((rt,nt)=>rt.id==="walletConnect"?1:nt.id==="walletConnect"?-1:0)},ProfileIcon=({isSignedIn:et})=>jsxRuntimeExports.jsxs("div",{style:{position:"relative"},children:[et?jsxRuntimeExports.jsx(AuthIcon,{style:{bottom:-1,right:-1}}):jsxRuntimeExports.jsx("div",{style:{zIndex:2,position:"absolute",top:-2,right:-2,background:"#1A88F8",borderRadius:8,boxShadow:"0 0 0 2px var(--ck-body-background)",width:8,height:8}}),jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{overflow:"visible"},children:[jsxRuntimeExports.jsx("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"2"}),jsxRuntimeExports.jsx("path",{d:"M16.5 16.775C14.8618 15.0649 12.5552 14 10 14C7.44477 14 5.13825 15.0649 3.5 16.775",stroke:"currentColor",strokeWidth:"2"}),jsxRuntimeExports.jsx("circle",{cx:"10",cy:"8",r:"3",stroke:"currentColor",strokeWidth:"2"})]})]}),InfoIcon=({...et})=>jsxRuntimeExports.jsx("svg",{"aria-hidden":"true",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",...et,children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 11C20 15.9706 15.9706 20 11 20C6.02944 20 2 15.9706 2 11C2 6.02944 6.02944 2 11 2C15.9706 2 20 6.02944 20 11ZM22 11C22 17.0751 17.0751 22 11 22C4.92487 22 0 17.0751 0 11C0 4.92487 4.92487 0 11 0C17.0751 0 22 4.92487 22 11ZM11.6445 12.7051C11.6445 13.1348 11.3223 13.4678 10.7744 13.4678C10.2266 13.4678 9.92578 13.1885 9.92578 12.6191V12.4795C9.92578 11.4268 10.4951 10.8574 11.2686 10.3203C12.2031 9.67578 12.665 9.32129 12.665 8.59082C12.665 7.76367 12.0205 7.21582 11.043 7.21582C10.3232 7.21582 9.80762 7.57031 9.45312 8.16113C9.38282 8.24242 9.32286 8.32101 9.2667 8.39461C9.04826 8.68087 8.88747 8.8916 8.40039 8.8916C8.0459 8.8916 7.66992 8.62305 7.66992 8.15039C7.66992 7.96777 7.70215 7.7959 7.75586 7.61328C8.05664 6.625 9.27051 5.75488 11.1182 5.75488C12.9336 5.75488 14.5234 6.71094 14.5234 8.50488C14.5234 9.7832 13.7822 10.417 12.7402 11.1045C11.999 11.5986 11.6445 11.9746 11.6445 12.5762V12.7051ZM11.9131 15.5625C11.9131 16.1855 11.376 16.6797 10.7529 16.6797C10.1299 16.6797 9.59277 16.1748 9.59277 15.5625C9.59277 14.9395 10.1191 14.4453 10.7529 14.4453C11.3867 14.4453 11.9131 14.9287 11.9131 15.5625Z",fill:"currentColor"})}),CloseIcon=({...et})=>jsxRuntimeExports.jsx(motion.svg,{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...et,children:jsxRuntimeExports.jsx("path",{d:"M1 13L13 1M1 1L13 13",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})}),BackIcon=({...et})=>jsxRuntimeExports.jsx(motion.svg,{width:9,height:16,viewBox:"0 0 9 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...et,children:jsxRuntimeExports.jsx("path",{d:"M8 1L1 8L8 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),contentTransitionDuration=.22,contentVariants$2={initial:{zIndex:2,opacity:0},animate:{opacity:1,scale:1,transition:{duration:contentTransitionDuration*.75,delay:contentTransitionDuration*.25,ease:[.26,.08,.25,1]}},exit:{zIndex:1,opacity:0,pointerEvents:"none",position:"absolute",left:["50%","50%"],x:["-50%","-50%"],transition:{duration:contentTransitionDuration,ease:[.26,.08,.25,1]}}},Modal=({open:et,pages:o,pageId:tt,positionInside:rt,inline:nt,demo:ot,onClose:it,onBack:st,onInfo:at})=>{var ct,lt,dt,ht,mt,ft,pt,yt,gt,bt,xt,vt;const Et=useContext(),Ct=useThemeContext(),St=isMobile(),{isSignedIn:At,reset:kt}=useSIWE(),It=useWallet((ct=Et.connector)===null||ct===void 0?void 0:ct.id),Nt={name:It==null?void 0:It.name,shortName:(lt=It==null?void 0:It.shortName)!==null&&lt!==void 0?lt:It==null?void 0:It.name,icon:(dt=It==null?void 0:It.iconConnector)!==null&&dt!==void 0?dt:It==null?void 0:It.icon,iconShape:(ht=It==null?void 0:It.iconShape)!==null&&ht!==void 0?ht:"circle",iconShouldShrink:It==null?void 0:It.iconShouldShrink},Lt=useLocales({CONNECTORNAME:Nt==null?void 0:Nt.name}),[Mt,zt]=useTransition({timeout:160,preEnter:!0,mountOnEnter:!0,unmountOnExit:!0}),Ut=!(Mt==="exited"||Mt==="unmounted"),Xt=Mt==="preEnter"||Mt!=="exiting",Wt=Et.route===routes.CONNECTORS?0:Et.route===routes.DOWNLOAD?2:1,Ft=usePrevious(Wt,Wt);rt||useLockBodyScroll(Ut),usePrevious(tt,tt),reactExports.useEffect(()=>{zt(et),et&&Qt(void 0)},[et]);const[qt,Pt]=reactExports.useState({width:void 0,height:void 0}),[Yt,Qt]=reactExports.useState(void 0),jt=Vt=>{const er={width:Vt==null?void 0:Vt.offsetWidth,height:Vt==null?void 0:Vt.offsetHeight};Pt({width:`${er==null?void 0:er.width}px`,height:`${er==null?void 0:er.height}px`})};let Gt;const rr=reactExports.useCallback(Vt=>{Vt&&(Zt.current=Vt,Qt(Yt!==void 0),clearTimeout(Gt),Gt=setTimeout(()=>Qt(!1),360),jt(Vt))},[et,Yt]),{chain:Ht}=useAccount(),{switchChain:dr}=useSwitchChain(),Zt=reactExports.useRef(null);reactExports.useEffect(()=>{Zt.current&&jt(Zt.current)},[Ht,dr,St,At,Et.options,Et.resize]),reactExports.useEffect(()=>{if(!Ut){Pt({width:void 0,height:void 0});return}const Vt=er=>{er.key==="Escape"&&it&&it()};return document.addEventListener("keydown",Vt),()=>{document.removeEventListener("keydown",Vt)}},[Ut,it]);const Jt={"--height":qt.height,"--width":qt.width};function tr(){return It?!(!It.getWalletConnectDeeplink||It.isInstalled):!1}function _t(){var Vt;switch(Et.route){case routes.ABOUT:return Lt.aboutScreen_heading;case routes.CONNECT:return tr()?isWalletConnectConnector((Vt=It==null?void 0:It.connector)===null||Vt===void 0?void 0:Vt.id)?Lt.scanScreen_heading:Lt.scanScreen_heading_withConnector:Nt==null?void 0:Nt.name;case routes.CONNECTORS:return Lt.connectorsScreen_heading;case routes.MOBILECONNECTORS:return Lt.mobileConnectorsScreen_heading;case routes.DOWNLOAD:return Lt.downloadAppScreen_heading;case routes.ONBOARDING:return Lt.onboardingScreen_heading;case routes.PROFILE:return Lt.profileScreen_heading;case routes.SWITCHNETWORKS:return Lt.switchNetworkScreen_heading;case routes.SIGNINWITHETHEREUM:return At?Lt.signInWithEthereumScreen_signedIn_heading:Lt.signInWithEthereumScreen_signedOut_heading;default:return""}}const Bt=jsxRuntimeExports.jsx(ResetContainer,{$useTheme:(mt=ot==null?void 0:ot.theme)!==null&&mt!==void 0?mt:Ct.theme,$useMode:(ft=ot==null?void 0:ot.mode)!==null&&ft!==void 0?ft:Ct.mode,$customTheme:(pt=ot==null?void 0:ot.customTheme)!==null&&pt!==void 0?pt:Ct.customTheme,children:jsxRuntimeExports.jsxs(ModalContainer,{role:"dialog",style:{pointerEvents:Xt?"auto":"none",position:rt?"absolute":void 0},children:[!nt&&jsxRuntimeExports.jsx(BackgroundOverlay,{$active:Xt,onClick:it,$blur:(yt=Et.options)===null||yt===void 0?void 0:yt.overlayBlur}),jsxRuntimeExports.jsxs(Container$7,{style:Jt,initial:!1,children:[jsxRuntimeExports.jsx("div",{style:{pointerEvents:Yt?"all":"none",position:"absolute",top:0,bottom:0,left:"50%",transform:"translateX(-50%)",width:"var(--width)",zIndex:9,transition:"width 200ms ease"}}),jsxRuntimeExports.jsxs(BoxContainer,{className:`${Xt&&"active"}`,children:[jsxRuntimeExports.jsx(AnimatePresence,{initial:!1,children:((gt=Et.options)===null||gt===void 0?void 0:gt.disclaimer)&&Et.route===routes.CONNECTORS&&jsxRuntimeExports.jsx(DisclaimerBackground,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{delay:0,duration:.2,ease:[.25,.1,.25,1]},children:jsxRuntimeExports.jsx(Disclaimer,{children:jsxRuntimeExports.jsx("div",{children:(bt=Et.options)===null||bt===void 0?void 0:bt.disclaimer})})})}),jsxRuntimeExports.jsx(AnimatePresence,{initial:!1,children:Et.errorMessage&&jsxRuntimeExports.jsxs(ErrorMessage,{initial:{y:"10%",x:"-50%"},animate:{y:"-100%"},exit:{y:"100%"},transition:{duration:.2,ease:"easeInOut"},children:[jsxRuntimeExports.jsx("span",{children:Et.errorMessage}),jsxRuntimeExports.jsx("div",{onClick:()=>Et.displayError(null),style:{position:"absolute",right:24,top:24,cursor:"pointer"},children:jsxRuntimeExports.jsx(CloseIcon,{})})]})}),jsxRuntimeExports.jsxs(ControllerContainer,{children:[it&&jsxRuntimeExports.jsx(CloseButton,{"aria-label":flattenChildren(Lt.close).toString(),onClick:it,children:jsxRuntimeExports.jsx(CloseIcon,{})}),jsxRuntimeExports.jsx("div",{style:{position:"absolute",top:23,left:20,width:32,height:32},children:jsxRuntimeExports.jsx(AnimatePresence,{children:st?jsxRuntimeExports.jsx(BackButton,{disabled:Yt,"aria-label":flattenChildren(Lt.back).toString(),onClick:st,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:St?0:.1,delay:St?.01:0},children:jsxRuntimeExports.jsx(BackIcon,{})},"backButton"):Et.route===routes.PROFILE&&Et.signInWithEthereum?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[!At&&!(!((xt=Et.options)===null||xt===void 0)&&xt.hideTooltips)&&jsxRuntimeExports.jsx(motion.div,{style:{position:"absolute",inset:0,pointerEvents:"none"},initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1,transition:{delay:.5,duration:.2}},exit:{opacity:0,scale:.6,transition:{delay:0,duration:St?0:.1}},children:jsxRuntimeExports.jsx(SignInTooltip,{children:Lt.signInWithEthereumScreen_tooltip})}),jsxRuntimeExports.jsx(SiweButton,{disabled:Yt,"aria-label":Lt.signInWithEthereumScreen_signedOut_heading,onClick:()=>{kt(),Et.setRoute(routes.SIGNINWITHETHEREUM)},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:St?0:.1,delay:St?.01:0},children:jsxRuntimeExports.jsx(ProfileIcon,{isSignedIn:At})},"siweButton")]}):at&&!(!((vt=Et.options)===null||vt===void 0)&&vt.hideQuestionMarkCTA)&&jsxRuntimeExports.jsx(InfoButton,{disabled:Yt,"aria-label":flattenChildren(Lt.moreInformation).toString(),onClick:at,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:St?0:.1,delay:St?.01:0},children:jsxRuntimeExports.jsx(InfoIcon,{})},"infoButton")})})]}),jsxRuntimeExports.jsx(ModalHeading,{children:jsxRuntimeExports.jsx(AnimatePresence,{children:jsxRuntimeExports.jsx(motion.div,{style:{position:"absolute",top:0,bottom:0,left:52,right:52,display:"flex",justifyContent:"center"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:St?0:.17,delay:St?.01:0},children:jsxRuntimeExports.jsx(FitText,{children:_t()})},`${Et.route}-${At?"signedIn":""}`)})}),jsxRuntimeExports.jsx(InnerContainer$1,{children:Object.keys(o).map(Vt=>{const er=o[Vt];return jsxRuntimeExports.jsx(Page,{open:Vt===tt,initial:!rt&&Mt!=="entered",enterAnim:Vt===tt?Wt>Ft?"active-scale-up":"active":"",exitAnim:Vt!==tt?Wt<Ft?"exit-scale-down":"exit":"",children:jsxRuntimeExports.jsx(PageContents,{ref:rr,style:{pointerEvents:Vt===tt&&Xt?"auto":"none"},children:er},`inner-${Vt}`)},Vt)})})]})]})]})});return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:Ut&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:rt?Bt:jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Portal,{children:jsxRuntimeExports.jsx(FocusTrap,{children:Bt})})})})})},Page=({children:et,open:o,initial:tt,prevDepth:rt,currentDepth:nt,enterAnim:ot,exitAnim:it})=>{const[st,at]=useTransition({timeout:400,preEnter:!0,initialEntered:o,mountOnEnter:!0,unmountOnExit:!0}),ct=!(st==="exited"||st==="unmounted"),lt=st==="preEnter"||st!=="exiting";return reactExports.useEffect(()=>{at(o)},[o]),ct?jsxRuntimeExports.jsx(PageContainer,{className:`${lt?ot:it}`,style:{animationDuration:tt?"0ms":void 0,animationDelay:tt?"0ms":void 0},children:et}):null},OrDivider=({children:et})=>{const o=useLocales();return jsxRuntimeExports.jsx(TextWithHr,{children:jsxRuntimeExports.jsx("span",{children:et??o.or})})},Graphic=styled(motion.div)`
position: relative;
margin: 16px auto 20px;
height: 190px;
max-width: 295px;
pointer-events: none;
user-select: none;
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
height: 200px;
max-width: 100%;
margin-bottom: 32px;
}
`,LogoGroup=styled(motion.div)`
position: absolute;
inset: 0;
z-index: 2;
`,graphicIn=We`
0%{
opacity:0;
transform:scale(0.9);
}
100%{
opacity:1;
transform:none;
}
`,GraphicBackground=styled(motion.div)`
z-index: 1;
position: absolute;
inset: 0;
top: -2px;
overflow: hidden;
&:before {
content: '';
position: absolute;
inset: 0;
background: var(--ck-body-background);
background: radial-gradient(
closest-side,
var(--ck-body-background-transparent, transparent) 18.75%,
var(--ck-body-background) 100%
);
background-size: 100%;
}
svg {
display: block;
width: 100%;
height: auto;
}
animation: ${graphicIn} 1000ms 100ms ease both;
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
animation: none;
}
`,logoIn=We`
0%{
opacity:0;
transform:scale(0) translateY(40%);
}
100%{
opacity:1;
transform:none;
}
`,LogoPosition=styled(motion.div)`
position: absolute;
inset: 0;
animation: cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite both;
animation-delay: inherit;
`,LogoInner=styled(motion.div)`
position: absolute;
`,LogoGraphic=styled(motion.div)`
position: relative;
overflow: hidden;
height: 58px;
width: 58px;
border-radius: 13.84px;
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 2px 20px 0 rgba(0, 0, 0, 0.03);
svg {
display: block;
width: 100%;
height: 100%;
}
`,float$1=We`
0%,100%{ transform:none; }
50%{ transform: translateY(-10%) }
`,FloatWrapper=styled(motion.div)`
position: relative;
animation: cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite both;
animation-name: ${float$1};
animation-duration: 3600ms;
`,rotate=We`
0%,100%{ transform:rotate(-3deg); }
50%{ transform:rotate(3deg); }
`,RotateWrapper=styled(motion.div)`
position: relative;
animation: cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite both;
animation-name: ${rotate};
animation-duration: 3200ms;
`,Logo$2=styled(motion.div)`
position: absolute;
inset: 0;
animation: ${logoIn} 750ms cubic-bezier(0.19, 1, 0.22, 1) both;
&:nth-child(1){ z-index:2; animation-delay:0ms; }
&:nth-child(2){ z-index:1; animation-delay:60ms; }
&:nth-child(3){ z-index:1; animation-delay:30ms; }
&:nth-child(4){ z-index:1; animation-delay:90ms; }
&:nth-child(5){ z-index:1; animation-delay:120ms;}
&:nth-child(1){ ${RotateWrapper}{ animation-delay:0ms; } }
&:nth-child(2){ ${RotateWrapper}{ animation-delay:-600ms; } }
&:nth-child(3){ ${RotateWrapper}{ animation-delay:-1200ms; } }
&:nth-child(4){ ${RotateWrapper}{ animation-delay:-1800ms; } }
&:nth-child(5){ ${RotateWrapper}{ animation-delay:-2400ms; } }
&:nth-child(1){ ${FloatWrapper}{ animation-delay:-200ms; } }
&:nth-child(2){ ${FloatWrapper}{ animation-delay:-600ms; } }
&:nth-child(3){ ${FloatWrapper}{ animation-delay:-800ms; } }
&:nth-child(4){ ${FloatWrapper}{ animation-delay:-300ms; } }
&:nth-child(5){ ${FloatWrapper}{ animation-delay:-3200ms; } }
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
animation: none !important;
${RotateWrapper},${FloatWrapper} {
animation: none !important;
}
}
${LogoInner} {
transform: translate(-50%, -50%);
}
&:nth-child(1) ${LogoPosition} {
transform: translate(50%, 50%);
${LogoGraphic} {
border-radius: 17.2px;
width: 72px;
height: 72px;
}
}
&:nth-child(2) ${LogoPosition} {
transform: translate(21%, 21.5%);
}
&:nth-child(3) ${LogoPosition} {
transform: translate(78%, 14%);
}
&:nth-child(4) ${LogoPosition} {
transform: translate(22.5%, 76%);
}
&:nth-child(5) ${LogoPosition} {
transform: translate(76%, 80%);
}
`;var wave=jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"298",height:"188",viewBox:"0 0 298 188",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{d:"M1 55.2757L21.6438 46.0285C55.5896 30.8228 94.4104 30.8228 128.356 46.0286L169.644 64.5229C203.59 79.7287 242.41 79.7286 276.356 64.5229L297 55.2757M1 44.2118L21.6438 34.9646C55.5896 19.7589 94.4104 19.7589 128.356 34.9646L169.644 53.459C203.59 68.6647 242.41 68.6647 276.356 53.459L297 44.2118M1 33.1477L21.6438 23.9005C55.5896 8.69479 94.4104 8.69479 128.356 23.9005L169.644 42.3949C203.59 57.6006 242.41 57.6006 276.356 42.3949L297 33.1477M1 22.1477L21.6438 12.9005C55.5896 -2.30521 94.4104 -2.30521 128.356 12.9005L169.644 31.3949C203.59 46.6006 242.41 46.6006 276.356 31.3949L297 22.1477M1 66.3398L21.6438 57.0926C55.5896 41.8869 94.4104 41.8869 128.356 57.0926L169.644 75.587C203.59 90.7927 242.41 90.7927 276.356 75.587L297 66.3398M1 77.404L21.6438 68.1568C55.5896 52.9511 94.4104 52.9511 128.356 68.1569L169.644 86.6512C203.59 101.857 242.41 101.857 276.356 86.6512L297 77.404M1 88.4681L21.6438 79.2209C55.5896 64.0152 94.4104 64.0152 128.356 79.2209L169.644 97.7153C203.59 112.921 242.41 112.921 276.356 97.7153L297 88.4681M1 121.66L21.6438 112.413C55.5896 97.2075 94.4104 97.2075 128.356 112.413L169.644 130.908C203.59 146.113 242.41 146.113 276.356 130.908L297 121.66M1 110.596L21.6438 101.349C55.5896 86.1433 94.4104 86.1433 128.356 101.349L169.644 119.843C203.59 135.049 242.41 135.049 276.356 119.843L297 110.596M1 99.5321L21.6438 90.2849C55.5896 75.0792 94.4104 75.0792 128.356 90.2849L169.644 108.779C203.59 123.985 242.41 123.985 276.356 108.779L297 99.5321M1 132.724L21.6438 123.477C55.5896 108.271 94.4104 108.271 128.356 123.477L169.644 141.971C203.59 157.177 242.41 157.177 276.356 141.971L297 132.724M1 143.788L21.6438 134.541C55.5896 119.336 94.4104 119.336 128.356 134.541L169.644 153.036C203.59 168.241 242.41 168.241 276.356 153.036L297 143.788M1 154.853L21.6438 145.605C55.5896 130.4 94.4104 130.4 128.356 145.605L169.644 164.1C203.59 179.305 242.41 179.305 276.356 164.1L297 154.853M1 165.853L21.6438 156.605C55.5896 141.4 94.4104 141.4 128.356 156.605L169.644 175.1C203.59 190.305 242.41 190.305 276.356 175.1L297 165.853",stroke:"url(#paint0_linear_1094_2077)",strokeOpacity:"0.9",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_1094_2077",x1:"1",y1:"112.587",x2:"297.034",y2:"79.6111",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-wave-stop-01)"}),jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-wave-stop-02)",offset:"0.239583"}),jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-wave-stop-03)",offset:"0.515625"}),jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-wave-stop-04)",offset:"0.739583"}),jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-wave-stop-05)",offset:"1"})]})})]});const SpinnerContainer$3=styled(motion.div)`
position: absolute;
right: 16px;
top: 0;
bottom: 0;
display: flex;
align-items: center;
justify-content: center;
`,Arrow=styled.svg`
--x: -3px;
--stroke-width: 2;
position: relative;
top: 1px;
left: -0.5px;
display: inline-block;
vertical-align: middle;
margin-left: 9px;
margin-right: 1px;
transition: all 100ms ease;
transform: translateX(var(--x, -3px));
color: currentColor;
opacity: 0.4;
`,ArrowChevron=styled.path``,ArrowLine=styled.line`
transition: inherit;
transition-property: transform;
transform-origin: 90% 50%;
transform: scaleX(0.1);
`,DownloadArrow=styled.div`
display: inline-block;
vertical-align: middle;
position: relative;
margin-right: 6px;
color: currentColor;
`,DownloadArrowInner=styled.div`
transform: rotate(90deg);
${Arrow} {
margin: 0 auto;
}
`,ButtonContainerInner=styled(motion.div)`
display: flex;
align-items: center;
justify-content: center;
inset: 0;
height: 100%;
`,ButtonContainer$1=styled.button`
${({disabled:et})=>et&&Ae`
cursor: not-allowed;
pointer-events: none;
${InnerContainer} {
opacity: 0.4;
}
`}
${({$variant:et})=>{if(et==="primary")return Ae`
--color: var(--ck-primary-button-color, var(--ck-body-color));
--background: var(
--ck-primary-button-background,
var(--ck-body-background-primary)
);
--box-shadow: var(--ck-primary-button-box-shadow);
--border-radius: var(--ck-primary-button-border-radius);
--font-weight: var(--ck-primary-button-font-weight, 500);
--hover-color: var(--ck-button-primary-hover-color, var(--color));
--hover-background: var(
--ck-primary-button-hover-background,
var(--background)
);
--hover-box-shadow: var(
--ck-primary-button-hover-box-shadow,
var(--box-shadow)
);
--hover-border-radius: var(
--ck-primary-button-hover-border-radius,
var(--border-radius)
);
--hover-font-weight: var(
--ck-primary-button-font-weight,
var(--font-weight)
);
`;if(et==="secondary")return Ae`
--color: var(--ck-secondary-button-color, var(--ck-body-color));
--background: var(
--ck-secondary-button-background,
var(--ck-body-background-secondary)
);
--box-shadow: var(--ck-secondary-button-box-shadow);
--border-radius: var(--ck-secondary-button-border-radius);
--font-weight: var(--ck-secondary-button-font-weight, 500);
--hover-color: var(--ck-secondary-button-hover-color, var(--color));
--hover-background: var(
--ck-secondary-button-hover-background,
var(--background)
);
--hover-box-shadow: var(
--ck-secondary-button-hover-box-shadow,
var(--box-shadow)
);
--hover-border-radius: var(
--ck-secondary-button-hover-border-radius,
var(--border-radius)
);
--hover-font-weight: var(
--ck-secondary-button-font-weight,
var(--font-weight)
);
`;if(et==="tertiary")return Ae`
--color: var(
--ck-tertiary-button-color,
var(--ck-secondary-button-color)
);
--background: var(
--ck-tertiary-button-background,
var(--ck-secondary-button-background)
);
--box-shadow: var(
--ck-tertiary-button-box-shadow,
var(--ck-secondary-button-box-shadow)
);
--border-radius: var(
--ck-tertiary-button-border-radius,
var(--ck-secondary-button-border-radius)
);
--font-weight: var(
--ck-tertiary-button-font-weight,
var(--ck-secondary-button-font-weight)
);
--hover-color: var(
--button-tertiary-hover-color,
var(--ck-tertiary-button-color)
);
--hover-background: var(
--ck-tertiary-button-hover-background,
var(--ck-tertiary-button-background)
);
--hover-box-shadow: var(
--ck-tertiary-button-hover-box-shadow,
var(--ck-tertiary-button-box-shadow)
);
--hover-border-radius: var(
--ck-tertiary-button-hover-border-radius,
var(--ck-tertiary-button-border-radius, var(--border-radius))
);
--hover-font-weight: var(
--ck-tertiary-button-font-weight,
var(--ck-secondary-button-font-weight)
);
`}}
appearance: none;
cursor: pointer;
user-select: none;
min-width: fit-content;
width: 100%;
display:block;
text-align: center;
height: 48px;
margin: 12px 0 0;
line-height: 48px;
padding: 0 4px;
font-size: 16px;
font-weight: var(--font-weight,500);
text-decoration: none;
white-space: nowrap;
transition: 100ms ease;
transition-property: box-shadow, background-color;
color: var(--color);
background: var(--background);
border-radius: var(--border-radius);
box-shadow: var(--box-shadow);
will-change: transform, box-shadow, background-color, color;
${DownloadArrow} {
${Arrow} {
transform: translateX(0);
${ArrowLine} {
transform: none;
}
${ArrowChevron} {
}
}
}
}
@media only screen and (min-width: ${defaultTheme.mobileWidth+1}px) {
&:hover,
&:focus-visible {
color: var(--ck-accent-text-color, var(--hover-color));
background: var(--ck-accent-color, var(--hover-background));
border-radius: var(--hover-border-radius);
box-shadow: var(--hover-box-shadow);
${Arrow} {
transform: translateX(0);
${ArrowLine} {
transform: none;
}
${ArrowChevron} {
}
}
${DownloadArrow} {
${Arrow} {
transform: translateX(var(--x));
${ArrowLine} {
transform: scaleX(0.1);
}
${ArrowChevron} {
}
}
}
}
&:active {
box-shadow: var(--ck-secondary-button-active-box-shadow, var(--hover-box-shadow));
}
}
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
transition: transform 100ms ease;
transform: scale(1);
font-size: 17px;
&:active {
}
}
`,InnerContainer=styled.div`
transform: translateZ(0); // Shifting fix
position: relative;
display: inline-block;
vertical-align: middle;
max-width: calc(100% - 42px);
transition: opacity 300ms ease;
/*
overflow: hidden;
text-overflow: ellipsis;
*/
`,IconContainer$4=styled(motion.div)`
position: relative;
display: inline-block;
vertical-align: middle;
max-width: 20px;
max-height: 20px;
margin: 0 10px;
&:first-child {
margin-left: 0;
}
&:last-child {
margin-right: 0;
}
${et=>et.$rounded&&Ae`
overflow: hidden;
border-radius: 5px;
`}
svg {
display: block;
position: relative;
max-width: 100%;
height: auto;
}
`,Spin$1=We`
0%{ transform: rotate(0deg); }
100%{ transform: rotate(360deg); }
`,SpinnerContainer$2=styled(motion.div)`
display: flex;
align-items: center;
justify-content: center;
animation: ${Spin$1} 1s linear infinite;
svg {
display: block;
position: relative;
animation: ${Spin$1} 1s ease-in-out infinite;
}
`,transition$2={duration:.4,ease:[.175,.885,.32,.98]},Spinner$4=()=>jsxRuntimeExports.jsx(SpinnerContainer$2,{initial:{opacity:0,rotate:180},animate:{opacity:1,rotate:0},exit:{position:"absolute",opacity:0,rotate:-180,transition:{...transition$2}},transition:{...transition$2,delay:.2},children:jsxRuntimeExports.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("circle",{cx:"9",cy:"9",r:"7",stroke:"currentColor",strokeOpacity:"0.1",strokeWidth:"2.5"}),jsxRuntimeExports.jsx("path",{d:"M16 9C16 5.13401 12.866 2 9 2",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})]})}),transition$1={duration:.4,ease:[.175,.885,.32,.98]},Button$1=({children:et,variant:o="secondary",disabled:tt,icon:rt,iconPosition:nt="left",roundedIcon:ot,waiting:it,arrow:st,download:at,href:ct,style:lt,onClick:dt})=>{const ht=typeof et=="string"?et:flattenChildren(et).join(""),mt=typeof ct=="string"?ct:flattenChildren(ct).join("");return jsxRuntimeExports.jsx(ButtonContainer$1,{as:ct?"a":void 0,onClick:ft=>{!tt&&dt&&dt(ft)},href:mt,target:ct&&"_blank",rel:ct&&"noopener noreferrer",disabled:tt,$variant:o,style:lt,children:jsxRuntimeExports.jsxs(AnimatePresence,{initial:!1,children:[jsxRuntimeExports.jsxs(ButtonContainerInner,{initial:{opacity:0,y:-10},animate:{opacity:1,y:-1},exit:{position:"absolute",opacity:0,y:10,transition:{...transition$1}},transition:{...transition$1,delay:.2},children:[rt&&nt==="left"&&jsxRuntimeExports.jsx(IconContainer$4,{$rounded:ot,children:rt}),at&&jsxRuntimeExports.jsx(DownloadArrow,{children:jsxRuntimeExports.jsx(DownloadArrowInner,{children:jsxRuntimeExports.jsxs(Arrow,{width:"13",height:"12",viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx(ArrowLine,{stroke:"currentColor",x1:"1",y1:"6",x2:"12",y2:"6",strokeWidth:"var(--stroke-width)",strokeLinecap:"round"}),jsxRuntimeExports.jsx(ArrowChevron,{stroke:"currentColor",d:"M7.51431 1.5L11.757 5.74264M7.5 10.4858L11.7426 6.24314",strokeWidth:"var(--stroke-width)",strokeLinecap:"round"})]})})}),jsxRuntimeExports.jsx(InnerContainer,{style:{paddingLeft:st?6:0},children:jsxRuntimeExports.jsx(FitText,{children:et})}),rt&&nt==="right"&&jsxRuntimeExports.jsx(IconContainer$4,{$rounded:ot,children:rt}),st&&jsxRuntimeExports.jsxs(Arrow,{width:"13",height:"12",viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx(ArrowLine,{stroke:"currentColor",x1:"1",y1:"6",x2:"12",y2:"6",strokeWidth:"2",strokeLinecap:"round"}),jsxRuntimeExports.jsx(ArrowChevron,{stroke:"currentColor",d:"M7.51431 1.5L11.757 5.74264M7.5 10.4858L11.7426 6.24314",strokeWidth:"2",strokeLinecap:"round"})]})]},ht),it&&jsxRuntimeExports.jsx(SpinnerContainer$3,{children:jsxRuntimeExports.jsx(Spinner$4,{})})]})})},Introduction=()=>{var et,o;const tt=useContext(),rt=useLocales({}),nt=(o=(et=tt.options)===null||et===void 0?void 0:et.walletOnboardingUrl)!==null&&o!==void 0?o:rt.onboardingScreen_ctaUrl;return jsxRuntimeExports.jsxs(PageContent,{children:[jsxRuntimeExports.jsxs(Graphic,{children:[jsxRuntimeExports.jsxs(LogoGroup,{children:[jsxRuntimeExports.jsx(Logo$2,{children:jsxRuntimeExports.jsx(LogoPosition,{children:jsxRuntimeExports.jsx(LogoInner,{children:jsxRuntimeExports.jsx(FloatWrapper,{children:jsxRuntimeExports.jsx(RotateWrapper,{children:jsxRuntimeExports.jsx(LogoGraphic,{children:jsxRuntimeExports.jsx(Logos.Coinbase,{background:!0})})})})})})}),jsxRuntimeExports.jsx(Logo$2,{children:jsxRuntimeExports.jsx(LogoPosition,{children:jsxRuntimeExports.jsx(LogoInner,{children:jsxRuntimeExports.jsx(FloatWrapper,{children:jsxRuntimeExports.jsx(RotateWrapper,{children:jsxRuntimeExports.jsx(LogoGraphic,{children:jsxRuntimeExports.jsx(Logos.MetaMask,{background:!0})})})})})})}),jsxRuntimeExports.jsx(Logo$2,{children:jsxRuntimeExports.jsx(LogoPosition,{children:jsxRuntimeExports.jsx(LogoInner,{children:jsxRuntimeExports.jsx(FloatWrapper,{children:jsxRuntimeExports.jsx(RotateWrapper,{children:jsxRuntimeExports.jsx(LogoGraphic,{children:jsxRuntimeExports.jsx(Logos.Trust,{})})})})})})}),jsxRuntimeExports.jsx(Logo$2,{children:jsxRuntimeExports.jsx(LogoPosition,{children:jsxRuntimeExports.jsx(LogoInner,{children:jsxRuntimeExports.jsx(FloatWrapper,{children:jsxRuntimeExports.jsx(RotateWrapper,{children:jsxRuntimeExports.jsx(LogoGraphic,{children:jsxRuntimeExports.jsx(Logos.Argent,{})})})})})})}),jsxRuntimeExports.jsx(Logo$2,{children:jsxRuntimeExports.jsx(LogoPosition,{children:jsxRuntimeExports.jsx(LogoInner,{children:jsxRuntimeExports.jsx(FloatWrapper,{children:jsxRuntimeExports.jsx(RotateWrapper,{children:jsxRuntimeExports.jsx(LogoGraphic,{children:jsxRuntimeExports.jsx(Logos.ImToken,{})})})})})})})]}),jsxRuntimeExports.jsx(GraphicBackground,{children:wave})]}),jsxRuntimeExports.jsxs(ModalContent,{style:{paddingBottom:18},children:[jsxRuntimeExports.jsx(ModalH1,{$small:!0,children:rt.onboardingScreen_h1}),jsxRuntimeExports.jsx(ModalBody,{children:rt.onboardingScreen_p})]}),jsxRuntimeExports.jsx(Button$1,{href:nt,arrow:!0,children:rt.onboardingScreen_ctaText})]})},imageHeight=208,ImageContainer$1=styled.div`
pointer-events: none;
user-select: none;
height: ${imageHeight}px;
padding: 0 0 12px;
display: flex;
align-items: center;
justify-content: center;
svg {
display: block;
}
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
display: none;
}
`,ImageContainerInner=styled(motion.div)``,MobileImageContainer=styled.div`
pointer-events: none;
user-select: none;
height: ${imageHeight}px;
padding: 0 0 12px;
display: none;
align-items: center;
justify-content: center;
svg {
display: block;
}
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
display: flex;
}
`,Slides=styled.div`
position: relative;
`,Slide=styled(motion.div)`
scroll-snap-type: x mandatory;
position: relative;
bottom: 0;
left: 0;
right: 0;
width: 100%;
padding: 0 4px 8px;
/* will-change: transform, opacity; */
transition: 400ms 50ms cubic-bezier(0.16, 1, 0.3, 1);
transition-property: transform, opacity;
${et=>!et.$active&&Ae`
pointer-events: none;
position: absolute;
opacity: 0;
transform: scale(0.95);
transition-duration: 300ms;
transition-delay: 0ms;
`}
`,Slider=styled.div`
--background: var(--ck-body-background-secondary);
--background-transparent: var(--ck-body-background-transparent, transparent);
position: relative;
padding: 0 0 4px;
border-radius: 16px;
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
margin: 0 -24px;
${Slides} {
position: relative;
z-index: 3;
display: flex;
overflow: auto;
scroll-behavior: smooth;
scroll-snap-type: x mandatory;
margin-top: -${imageHeight}px;
padding-top: ${imageHeight}px;
-ms-overflow-style: none; /* Internet Explorer 10+ */
scrollbar-width: none; /* Firefox */
&::-webkit-scrollbar {
display: none; /* Safari and Chrome */
}
}
${Slide} {
position: relative;
opacity: 1;
transform: none;
flex-shrink: 0;
scroll-snap-align: start;
}
}
`,Dots=styled.div`
position: relative;
top: -1px;
display: flex;
justify-content: center;
pointer-events: auto;
`,Dot=styled.button`
display: flex;
align-items: center;
height: 28px;
padding: 2px;
background: none;
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
padding: 4px;
&:before {
transform: none !important;
}
}
&:before {
content: '';
display: block;
width: 16px;
height: 3px;
opacity: 0.12;
border-radius: 4px;
background: var(--ck-accent-color, var(--ck-body-color));
transition: transform 200ms ease, opacity 180ms ease;
}
${et=>et.$active?Ae`
cursor: default;
&:before {
opacity: 1;
}
`:!et.disabled&&Ae`
cursor: pointer;
&:hover:before {
transform: scaleY(3.5);
}
&:active:before {
}
`}
`,pulseAnim={scale:[.9,1.25,1.6],opacity:[0,.11,0]},pulseTransition={ease:"linear",duration:2,repeat:1/0},Center=styled.div`
position: absolute;
left: 50%;
top: 50%;
transform: translateY(-50%) translateX(-50%);
`,spin=We`
from{ transform: rotate(0deg); }
to{ transform: rotate(360deg); }
`,SpinContainer=styled(motion.div)`
z-index: -1;
position: absolute;
inset: 0;
overflow: hidden;
border-radius: 100%;
animation: ${spin} 16s linear infinite;
`,BgLighten=styled(motion.div)`
overflow: hidden;
border-radius: inherit;
z-index: 0;
position: absolute;
inset: 0;
background: rgba(255, 255, 255, 0.1);
`,MainCircle=styled(motion.div)`
z-index: 2;
position: relative;
border-radius: 50%;
background: var(--ck-body-background);
`,MainCircleInner=styled(motion.div)`
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
`,Compass=jsxRuntimeExports.jsxs("svg",{width:"34",height:"34",viewBox:"0 0 34 34",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{d:"M17 34C26.3 34 34 26.2833 34 17C34 7.7 26.2833 0 16.9833 0C7.7 0 0 7.7 0 17C0 26.2833 7.71667 34 17 34ZM9.83333 25.6833C8.68333 26.2333 7.8 25.3333 8.33333 24.2L13.1667 14.3333C13.45 13.75 13.8167 13.3833 14.35 13.1333L24.1833 8.33333C25.4 7.75 26.25 8.65 25.6833 9.81667L20.8833 19.6667C20.6167 20.2 20.2333 20.6 19.6833 20.85L9.83333 25.6833ZM17.0167 19.1333C18.1833 19.1333 19.1333 18.1833 19.1333 17.0167C19.1333 15.85 18.1833 14.9167 17.0167 14.9167C15.8667 14.9167 14.9167 15.85 14.9167 17.0167C14.9167 18.1833 15.8667 19.1333 17.0167 19.1333Z",fill:"var(--ck-graphic-compass-color, var(--ck-body-color))"}),jsxRuntimeExports.jsx("path",{d:"M17 34C26.3 34 34 26.2833 34 17C34 7.7 26.2833 0 16.9833 0C7.7 0 0 7.7 0 17C0 26.2833 7.71667 34 17 34ZM9.83333 25.6833C8.68333 26.2333 7.8 25.3333 8.33333 24.2L13.1667 14.3333C13.45 13.75 13.8167 13.3833 14.35 13.1333L24.1833 8.33333C25.4 7.75 26.25 8.65 25.6833 9.81667L20.8833 19.6667C20.6167 20.2 20.2333 20.6 19.6833 20.85L9.83333 25.6833ZM17.0167 19.1333C18.1833 19.1333 19.1333 18.1833 19.1333 17.0167C19.1333 15.85 18.1833 14.9167 17.0167 14.9167C15.8667 14.9167 14.9167 15.85 14.9167 17.0167C14.9167 18.1833 15.8667 19.1333 17.0167 19.1333Z",fill:"url(#ck-compass-gradient)"}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsxs("linearGradient",{id:"ck-compass-gradient",x1:"17",y1:"0",x2:"17",y2:"34",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"rgba(0,0,0,0)"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"rgba(0,0,0,0.05)"})]})})]}),Wallet=({inverted:et=!1})=>jsxRuntimeExports.jsxs("svg",{width:"58",height:"50",viewBox:"0 0 58 50",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.9332 20.3335V42.1113C57.9332 46.4069 54.451 49.8891 50.1555 49.8891H8.15546C3.85991 49.8891 0.377686 46.4069 0.377686 42.1113V25.0002V7.8891C0.377686 3.59355 3.85991 0.111328 8.15546 0.111328H47.0444C48.7626 0.111328 50.1555 1.50422 50.1555 3.22244C50.1555 4.94066 48.7626 6.33355 47.0443 6.33355H9.71102C7.9928 6.33355 6.59991 7.72644 6.59991 9.44466C6.59991 11.1629 7.9928 12.5558 9.71102 12.5558H50.1555C54.451 12.5558 57.9332 16.038 57.9332 20.3335ZM46.2667 34.3337C48.4145 34.3337 50.1556 32.5926 50.1556 30.4448C50.1556 28.297 48.4145 26.5559 46.2667 26.5559C44.1189 26.5559 42.3778 28.297 42.3778 30.4448C42.3778 32.5926 44.1189 34.3337 46.2667 34.3337Z",fill:et?"var(--ck-graphic-primary-color, var(--ck-body-background))":"var(--ck-graphic-primary-color, var(--ck-body-color))"}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_2501_7732",x1:"29.1555",y1:"0.111328",x2:"29.1555",y2:"49.8891",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:et?"var(--ck-body-color-muted)":"var(--ck-body-background-transparent, transparent)"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:et?"var(--ck-body-color)":"var(--ck-body-background)"})]})})]}),Send=jsxRuntimeExports.jsx("svg",{width:"41",height:"41",viewBox:"0 0 41 41",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M35.4446 0.839914L2.14484 10.7065C0.0395033 11.3303 -0.632966 13.9786 0.919705 15.5313L7.9624 22.574C9.47585 24.0874 11.8661 24.273 13.5951 23.0114L25.2866 14.4797C25.5558 14.2832 25.9281 14.3121 26.1638 14.5478C26.3998 14.7838 26.4285 15.1567 26.2313 15.426L17.6874 27.0937C16.4213 28.8228 16.6052 31.2168 18.1206 32.7322L25.1811 39.7926C26.7337 41.3453 29.382 40.6728 30.0058 38.5675L39.8724 5.2677C40.6753 2.55794 38.1544 0.037024 35.4446 0.839914Z",fill:"var(--ck-graphic-secondary-color, white)"})}),Receive=jsxRuntimeExports.jsx("svg",{width:"38",height:"44",viewBox:"0 0 38 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19 0.875C21.4853 0.875 23.5 2.88972 23.5 5.375V27.761L30.068 21.193C31.8254 19.4357 34.6746 19.4357 36.432 21.193C38.1893 22.9504 38.1893 25.7996 36.432 27.557L22.182 41.807C20.4246 43.5643 17.5754 43.5643 15.818 41.807L1.56802 27.557C-0.18934 25.7996 -0.18934 22.9504 1.56802 21.193C3.32538 19.4357 6.17462 19.4357 7.93198 21.193L14.5 27.761V5.375C14.5 2.88972 16.5147 0.875 19 0.875Z",fill:"var(--ck-graphic-secondary-color, white)"})}),Key$1=({...et})=>{var o;const tt=(o=et==null?void 0:et.id)!==null&&o!==void 0?o:"";return jsxRuntimeExports.jsxs("svg",{...et,width:"81",height:"81",viewBox:"0 0 81 81",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M81 27C81 41.9117 68.9117 54 54 54C51.2722 54 48.6389 53.5955 46.1568 52.8432L36 63H27V72H18V81H4.5C2.01472 81 0 78.9853 0 76.5V64.864C0 63.6705 0.474103 62.5259 1.31802 61.682L28.1568 34.8432C27.4045 32.3611 27 29.7278 27 27C27 12.0883 39.0883 0 54 0C68.9117 0 81 12.0883 81 27ZM60.75 25.875C63.8566 25.875 66.375 23.3566 66.375 20.25C66.375 17.1434 63.8566 14.625 60.75 14.625C57.6434 14.625 55.125 17.1434 55.125 20.25C55.125 23.3566 57.6434 25.875 60.75 25.875Z",fill:`url(#${tt}paint0_linear_2509_6177)`}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M81 27C81 41.9117 68.9117 54 54 54C51.2722 54 48.6389 53.5955 46.1568 52.8432L36 63H27V72H18V81H4.5C2.01472 81 0 78.9853 0 76.5V64.864C0 63.6705 0.474103 62.5259 1.31802 61.682L28.1568 34.8432C27.4045 32.3611 27 29.7278 27 27C27 12.0883 39.0883 0 54 0C68.9117 0 81 12.0883 81 27ZM60.75 25.875C63.8566 25.875 66.375 23.3566 66.375 20.25C66.375 17.1434 63.8566 14.625 60.75 14.625C57.6434 14.625 55.125 17.1434 55.125 20.25C55.125 23.3566 57.6434 25.875 60.75 25.875Z",fill:`url(#${tt}paint1_radial_2509_6177)`,fillOpacity:"0.2"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M44.5658 51.2522C45.1527 50.6653 46.0151 50.4492 46.8095 50.6899C49.0823 51.3788 51.4958 51.75 54 51.75C67.6691 51.75 78.75 40.669 78.75 27C78.75 13.331 67.6691 2.25 54 2.25C40.331 2.25 29.25 13.331 29.25 27C29.25 29.5042 29.6212 31.9177 30.3101 34.1905C30.5508 34.9849 30.3347 35.8473 29.7478 36.4342L2.90901 63.273C2.48705 63.6949 2.25 64.2672 2.25 64.864V76.5C2.25 77.7426 3.25736 78.75 4.5 78.75H15.75V72C15.75 70.7574 16.7574 69.75 18 69.75H24.75V63C24.75 61.7574 25.7574 60.75 27 60.75H35.068L44.5658 51.2522ZM36 63H27V72H18V81H4.5C2.01472 81 0 78.9853 0 76.5V64.864C0 63.6705 0.474103 62.5259 1.31802 61.682L28.1568 34.8432C27.4045 32.3611 27 29.7278 27 27C27 12.0883 39.0883 0 54 0C68.9117 0 81 12.0883 81 27C81 41.9117 68.9117 54 54 54C51.2722 54 48.6389 53.5955 46.1568 52.8432L36 63ZM68.625 20.25C68.625 24.5992 65.0992 28.125 60.75 28.125C56.4008 28.125 52.875 24.5992 52.875 20.25C52.875 15.9008 56.4008 12.375 60.75 12.375C65.0992 12.375 68.625 15.9008 68.625 20.25ZM66.375 20.25C66.375 23.3566 63.8566 25.875 60.75 25.875C57.6434 25.875 55.125 23.3566 55.125 20.25C55.125 17.1434 57.6434 14.625 60.75 14.625C63.8566 14.625 66.375 17.1434 66.375 20.25Z",fill:"black",fillOpacity:"0.1"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M33.4205 47.5795C33.8598 48.0188 33.8598 48.7312 33.4205 49.1705L3.0455 79.5455C2.60616 79.9848 1.89384 79.9848 1.4545 79.5455C1.01517 79.1062 1.01517 78.3938 1.4545 77.9545L31.8295 47.5795C32.2688 47.1402 32.9812 47.1402 33.4205 47.5795Z",fill:"#A5A9AD"}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:`${tt}paint0_linear_2509_6177`,x1:"72",y1:"5.625",x2:"2.25",y2:"78.75",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#D4DFE6"}),jsxRuntimeExports.jsx("stop",{offset:"0.0967282",stopColor:"#C6CACD"}),jsxRuntimeExports.jsx("stop",{offset:"0.526645",stopColor:"#BDBAC4"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"#939CA1"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:`${tt}paint1_radial_2509_6177`,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(52.875 12.375) rotate(93.2705) scale(39.4392)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"white"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"white"})]})]})]})},VitalikAddress=jsxRuntimeExports.jsxs("svg",{width:"131",height:"14",viewBox:"0 0 131 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{d:"M5.74805 13.2549C8.86816 13.2549 10.7227 10.6973 10.7227 6.63672C10.7227 2.57617 8.85059 0.0625 5.74805 0.0625C2.63672 0.0625 0.755859 2.59375 0.755859 6.64551C0.755859 10.7148 2.61914 13.2549 5.74805 13.2549ZM5.74805 11.4004C4.02539 11.4004 3.04102 9.64258 3.04102 6.63672C3.04102 3.68359 4.04297 1.91699 5.74805 1.91699C7.44434 1.91699 8.4375 3.6748 8.4375 6.64551C8.4375 9.65137 7.46191 11.4004 5.74805 11.4004Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M13.0869 13.1758C13.4561 13.1758 13.6934 13.0439 13.9658 12.6221L15.9697 9.66016H16.0137L18.0264 12.6572C18.2549 13.0088 18.4922 13.1758 18.8965 13.1758C19.4854 13.1758 19.9424 12.7891 19.9424 12.209C19.9424 11.9805 19.8633 11.7695 19.7051 11.541L17.376 8.28906L19.6963 5.16016C19.8896 4.90527 19.9688 4.68555 19.9688 4.43066C19.9688 3.88574 19.5381 3.49902 18.9229 3.49902C18.5361 3.49902 18.2988 3.6748 18.0176 4.10547L16.1191 6.95312H16.0752L14.1328 4.08789C13.8516 3.64844 13.6318 3.49902 13.2012 3.49902C12.6035 3.49902 12.1465 3.91211 12.1465 4.44824C12.1465 4.70312 12.2256 4.92285 12.3838 5.13379L14.7129 8.35059L12.3486 11.5498C12.1641 11.8135 12.0762 12.0156 12.0762 12.2705C12.0762 12.7979 12.498 13.1758 13.0869 13.1758Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M26.2441 13.2549C29.1445 13.2549 31.1924 11.7432 31.1924 9.57227C31.1924 7.9375 30.0146 6.68066 28.3184 6.3291V6.27637C29.7773 5.87207 30.7178 4.7998 30.7178 3.45508C30.7178 1.48633 28.8633 0.0625 26.2441 0.0625C23.625 0.0625 21.7617 1.49512 21.7617 3.44629C21.7617 4.80859 22.7109 5.88965 24.1699 6.27637V6.3291C22.4736 6.67188 21.3047 7.92871 21.3047 9.57227C21.3047 11.7344 23.335 13.2549 26.2441 13.2549ZM26.2441 5.55566C24.9258 5.55566 24.0029 4.78223 24.0029 3.6748C24.0029 2.55859 24.9258 1.77637 26.2441 1.77637C27.5537 1.77637 28.4854 2.5498 28.4854 3.6748C28.4854 4.78223 27.5537 5.55566 26.2441 5.55566ZM26.2441 11.5234C24.7236 11.5234 23.6514 10.6357 23.6514 9.40527C23.6514 8.1748 24.7236 7.28711 26.2441 7.28711C27.7646 7.28711 28.8369 8.16602 28.8369 9.40527C28.8369 10.6357 27.7646 11.5234 26.2441 11.5234Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M36.3164 13.1494C37.7578 13.1494 38.7598 12.4199 39.208 11.3477H39.252V12.0771C39.252 12.7891 39.7266 13.1758 40.3594 13.1758C40.9922 13.1758 41.4404 12.7803 41.4404 12.0771V1.29297C41.4404 0.554688 40.9834 0.141602 40.3418 0.141602C39.7002 0.141602 39.252 0.554688 39.252 1.29297V5.24805H39.1992C38.707 4.21973 37.6523 3.52539 36.3164 3.52539C33.9697 3.52539 32.4492 5.38867 32.4492 8.33301C32.4492 11.2949 33.9697 13.1494 36.3164 13.1494ZM36.9756 11.3564C35.5605 11.3564 34.6904 10.1963 34.6904 8.3418C34.6904 6.49609 35.5693 5.32715 36.9756 5.32715C38.3555 5.32715 39.2607 6.51367 39.2607 8.3418C39.2607 10.1875 38.3555 11.3564 36.9756 11.3564Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M44.0508 13.1494C44.6396 13.1494 44.9736 12.8594 45.1846 12.1738L46.0195 9.76562H50.7568L51.5918 12.1914C51.7939 12.8682 52.1367 13.1494 52.752 13.1494C53.4111 13.1494 53.8857 12.7188 53.8857 12.1035C53.8857 11.9014 53.8418 11.6992 53.7363 11.4092L50.0449 1.38965C49.7285 0.537109 49.2188 0.167969 48.3838 0.167969C47.5576 0.167969 47.0479 0.554688 46.7402 1.39844L43.0576 11.4092C42.9521 11.6816 42.9082 11.9277 42.9082 12.1035C42.9082 12.7451 43.3564 13.1494 44.0508 13.1494ZM46.5557 7.97266L48.3398 2.55859H48.4014L50.2031 7.97266H46.5557Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M60.1172 13.2549C62.8594 13.2549 64.8545 11.4004 64.8545 8.8252C64.8545 6.42578 63.1406 4.66797 60.6973 4.66797C58.9746 4.66797 57.709 5.54688 57.208 6.71582H57.1641V6.58398C57.208 3.66602 58.2275 1.89941 60.1436 1.89941C61.084 1.89941 61.7607 2.26855 62.3496 3.07715C62.7012 3.52539 62.9824 3.73633 63.4307 3.73633C64.0283 3.73633 64.3975 3.34082 64.3975 2.82227C64.3975 2.57617 64.3359 2.35645 64.1953 2.10156C63.5625 0.897461 62.0859 0.0537109 60.1523 0.0537109C56.9268 0.0537109 54.9932 2.57617 54.9932 6.80371C54.9932 8.24512 55.2305 9.45801 55.6963 10.4336C56.5752 12.2881 58.1396 13.2549 60.1172 13.2549ZM60.082 11.4092C58.667 11.4092 57.5508 10.293 57.5508 8.86914C57.5508 7.4541 58.6494 6.41699 60.1084 6.41699C61.5674 6.41699 62.6309 7.4541 62.6221 8.91309C62.6221 10.3018 61.4971 11.4092 60.082 11.4092Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M68.1328 8.83398C68.8447 8.83398 69.416 8.27148 69.416 7.55078C69.416 6.83008 68.8447 6.25879 68.1328 6.25879C67.4121 6.25879 66.8408 6.83008 66.8408 7.55078C66.8408 8.27148 67.4121 8.83398 68.1328 8.83398Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M73.3359 8.83398C74.0479 8.83398 74.6191 8.27148 74.6191 7.55078C74.6191 6.83008 74.0479 6.25879 73.3359 6.25879C72.6152 6.25879 72.0439 6.83008 72.0439 7.55078C72.0439 8.27148 72.6152 8.83398 73.3359 8.83398Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M78.5391 8.83398C79.251 8.83398 79.8223 8.27148 79.8223 7.55078C79.8223 6.83008 79.251 6.25879 78.5391 6.25879C77.8184 6.25879 77.2471 6.83008 77.2471 7.55078C77.2471 8.27148 77.8184 8.83398 78.5391 8.83398Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M83.7422 8.83398C84.4541 8.83398 85.0254 8.27148 85.0254 7.55078C85.0254 6.83008 84.4541 6.25879 83.7422 6.25879C83.0215 6.25879 82.4502 6.83008 82.4502 7.55078C82.4502 8.27148 83.0215 8.83398 83.7422 8.83398Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M92.2148 13.2549C94.957 13.2549 96.9521 11.4004 96.9521 8.8252C96.9521 6.42578 95.2383 4.66797 92.7949 4.66797C91.0723 4.66797 89.8066 5.54688 89.3057 6.71582H89.2617V6.58398C89.3057 3.66602 90.3252 1.89941 92.2412 1.89941C93.1816 1.89941 93.8584 2.26855 94.4473 3.07715C94.7988 3.52539 95.0801 3.73633 95.5283 3.73633C96.126 3.73633 96.4951 3.34082 96.4951 2.82227C96.4951 2.57617 96.4336 2.35645 96.293 2.10156C95.6602 0.897461 94.1836 0.0537109 92.25 0.0537109C89.0244 0.0537109 87.0908 2.57617 87.0908 6.80371C87.0908 8.24512 87.3281 9.45801 87.7939 10.4336C88.6729 12.2881 90.2373 13.2549 92.2148 13.2549ZM92.1797 11.4092C90.7646 11.4092 89.6484 10.293 89.6484 8.86914C89.6484 7.4541 90.7471 6.41699 92.2061 6.41699C93.665 6.41699 94.7285 7.4541 94.7197 8.91309C94.7197 10.3018 93.5947 11.4092 92.1797 11.4092Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M103.377 13.2549C106.497 13.2549 108.352 10.6973 108.352 6.63672C108.352 2.57617 106.479 0.0625 103.377 0.0625C100.266 0.0625 98.3848 2.59375 98.3848 6.64551C98.3848 10.7148 100.248 13.2549 103.377 13.2549ZM103.377 11.4004C101.654 11.4004 100.67 9.64258 100.67 6.63672C100.67 3.68359 101.672 1.91699 103.377 1.91699C105.073 1.91699 106.066 3.6748 106.066 6.64551C106.066 9.65137 105.091 11.4004 103.377 11.4004Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M117.167 13.1758C117.8 13.1758 118.248 12.7715 118.248 12.0596V10.5654H119.127C119.733 10.5654 120.094 10.1875 120.094 9.63379C120.094 9.08887 119.733 8.70215 119.136 8.70215H118.248V1.81152C118.248 0.756836 117.554 0.141602 116.385 0.141602C115.453 0.141602 114.899 0.52832 114.073 1.75879C112.553 3.99121 111.111 6.16211 110.224 7.75293C109.872 8.38574 109.731 8.79883 109.731 9.29102C109.731 10.0469 110.268 10.5654 111.085 10.5654H116.086V12.0596C116.086 12.7715 116.543 13.1758 117.167 13.1758ZM116.121 8.75488H111.788V8.69336C112.816 6.82129 114.073 4.92285 116.086 2.04004H116.121V8.75488Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M126.105 13.2549C128.918 13.2549 130.869 11.4355 130.869 8.78125C130.869 6.35547 129.138 4.6416 126.712 4.6416C125.438 4.6416 124.392 5.13379 123.855 5.9248H123.812L124.146 2.17188H129.27C129.85 2.17188 130.228 1.80273 130.228 1.24023C130.228 0.686523 129.85 0.317383 129.27 0.317383H123.803C122.81 0.317383 122.3 0.72168 122.221 1.72363L121.816 6.51367C121.808 6.56641 121.808 6.60156 121.808 6.6543C121.79 7.26953 122.15 7.78809 122.88 7.78809C123.398 7.78809 123.618 7.67383 124.146 7.14648C124.629 6.67188 125.323 6.34668 126.123 6.34668C127.617 6.34668 128.681 7.38379 128.681 8.84277C128.681 10.3457 127.617 11.4092 126.114 11.4092C124.893 11.4092 124.049 10.8027 123.618 9.77441C123.381 9.30859 123.091 9.12402 122.616 9.12402C122.019 9.12402 121.641 9.49316 121.641 10.082C121.641 10.4072 121.72 10.6709 121.843 10.9434C122.467 12.3232 124.154 13.2549 126.105 13.2549Z",fill:"var(--ck-body-color)"})]}),SlideOne=({layoutId:et})=>jsxRuntimeExports.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[jsxRuntimeExports.jsx(motion.div,{initial:{rotate:90,scale:.2,x:"100%"},animate:{rotate:0,scale:1,x:0},exit:{rotate:40,scale:.1,x:"70%"},style:{zIndex:4,position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:76,height:76,background:"var(--ck-graphic-secondary-background, #6366F1)",borderRadius:"50%",boxShadow:"var(--ck-graphic-secondary-box-shadow, 0px 2px 10px rgba(99, 102, 241, 0.3))"},children:Receive}),jsxRuntimeExports.jsx(MainCircle,{layoutId:et,style:{position:"relative",zIndex:10,margin:"0 -8px",width:112,height:112},children:jsxRuntimeExports.jsxs(MainCircleInner,{style:{background:"var(--ck-graphic-primary-background, var(--ck-body-background))",boxShadow:"var(--ck-graphic-primary-box-shadow, 0px 3px 15px rgba(0, 0, 0, 0.1))"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:[jsxRuntimeExports.jsx(BgLighten,{}),jsxRuntimeExports.jsx(motion.div,{style:{zIndex:2,position:"relative"},children:jsxRuntimeExports.jsx(Wallet,{})})]},"SlideOneInner")},et),jsxRuntimeExports.jsx(motion.div,{initial:{rotate:-90,scale:.2,x:"-100%"},animate:{rotate:0,scale:1,x:0},exit:{rotate:-40,scale:.1,x:"-70%"},style:{zIndex:4,position:"relative",width:76,height:76,background:"var(--ck-graphic-secondary-background, #3897FB)",borderRadius:"50%",boxShadow:"var(--ck-graphic-secondary-box-shadow, 0px 2px 10px rgba(56, 151, 251, 0.3))"},children:jsxRuntimeExports.jsx(Center,{children:jsxRuntimeExports.jsx("div",{style:{position:"relative",left:-2,top:3},children:Send})})})]}),SlideTwo=({layoutId:et})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{style:{position:"relative",left:-14},children:[jsxRuntimeExports.jsx(MainCircle,{layoutId:et,style:{zIndex:10,position:"absolute",left:15,top:12,width:32,height:32},children:jsxRuntimeExports.jsx(MainCircleInner,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},style:{background:"var(--ck-graphic-primary-background, var(--ck-body-background))",boxShadow:"var(--ck-graphic-primary-box-shadow, 0px 2px 5px rgba(37, 41, 46, 0.16))"},children:jsxRuntimeExports.jsx(Center,{children:jsxRuntimeExports.jsx(Wallet,{})})},"SlideTwoInner")},et),jsxRuntimeExports.jsxs(motion.div,{initial:{scale:.2},animate:{scale:1},exit:{scale:.2},style:{zIndex:7,position:"relative",display:"flex",alignItems:"center",padding:"21px 56px",paddingRight:52,background:"var(--ck-graphic-primary-background, var(--ck-body-background))",boxShadow:"var(--ck-graphic-primary-box-shadow, 0px 2px 9px rgba(0, 0, 0, 0.07))",borderRadius:"var(--ck-border-radius, 16px)"},children:[jsxRuntimeExports.jsx(BgLighten,{}),jsxRuntimeExports.jsx("div",{style:{position:"relative",zIndex:2,top:1,left:1},children:VitalikAddress})]}),jsxRuntimeExports.jsx(motion.div,{style:{zIndex:8,position:"absolute",top:-16,right:-28},initial:{rotate:90,x:-70,scale:.4},animate:{rotate:0,x:0,scale:1},exit:{rotate:0,x:-70,scale:.4},children:jsxRuntimeExports.jsx(Key$1,{id:et})})]})}),SlideThree=({layoutId:et})=>{const o=Math.random();return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(motion.div,{style:{position:"relative"},children:[jsxRuntimeExports.jsxs(MainCircle,{layoutId:et,initial:{rotate:80},style:{zIndex:10,position:"relative",width:128,height:128},children:[jsxRuntimeExports.jsx(MainCircleInner,{initial:{opacity:0,rotate:100},animate:{opacity:1},exit:{opacity:0},style:{overflow:"hidden",background:`var(--ck-graphic-globe-background, radial-gradient(
82.42% 82.42% at 50% 86.72%,
rgba(255, 255, 255, 0.2) 0%,
rgba(0, 0, 0, 0) 100%
),
linear-gradient(180deg, #3897FB 0%, #5004F1 100%))`,boxShadow:"var(--ck-graphic-globe-box-shadow, 0px -6px 20px rgba(56, 151, 251, 0.23))"},children:jsxRuntimeExports.jsx(SpinContainer,{style:et?void 0:{animationPlayState:"paused"},children:jsxRuntimeExports.jsxs("svg",{width:"128",height:"128",viewBox:"0 0 128 128",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsxs("g",{children:[jsxRuntimeExports.jsx("circle",{cx:"30",cy:"141",r:"64",stroke:`url(#networkRadialA-${o})`,strokeWidth:"3"}),jsxRuntimeExports.jsx("circle",{cx:"78.8515",cy:"131.123",r:"54.1005",transform:"rotate(-37.4016 78.8515 131.123)",stroke:`url(#networkRadialB-${o})`,strokeWidth:"3"}),jsxRuntimeExports.jsx("circle",{cx:"63.6053",cy:"2.12794",r:"50.8338",transform:"rotate(134.702 63.6053 2.12794)",stroke:`url(#networkRadialC-${o})`,strokeWidth:"3"}),jsxRuntimeExports.jsx("circle",{cx:"126.658",cy:"56.6577",r:"50.3433",transform:"rotate(-105 126.658 56.6577)",stroke:`url(#networkRadialD-${o})`,strokeWidth:"3"}),jsxRuntimeExports.jsx("circle",{cx:"13.6619",cy:"18.9603",r:"46.0247",transform:"rotate(107.362 13.6619 18.9603)",stroke:`url(#networkRadialE-${o})`,strokeWidth:"3"})]}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("radialGradient",{id:`networkRadialA-${o}`,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(60.5 84) rotate(104.668) scale(77.0097)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-globe-lines, white)"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"var(--ck-graphic-globe-lines, white)",stopOpacity:"0"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:`networkRadialB-${o}`,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(96.1805 81.6717) rotate(97.125) scale(64.7443)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-globe-lines, white)"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"var(--ck-graphic-globe-lines, white)",stopOpacity:"0"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:`networkRadialC-${o}`,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(96.3816 -36.4455) rotate(114.614) scale(57.7177)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-globe-lines, white)"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"var(--ck-graphic-globe-lines, white)",stopOpacity:"0"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:`networkRadialD-${o}`,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(137.86 7.73234) rotate(92.3288) scale(62.743)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-globe-lines, white)"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"var(--ck-graphic-globe-lines, white)",stopOpacity:"0"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:`networkRadialE-${o}`,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(35.3203 -21.566) rotate(104.513) scale(54.8617)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-globe-lines, white)"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"var(--ck-graphic-globe-lines, white)",stopOpacity:"0"})]})]})]})})},"SlideThreeInner"),jsxRuntimeExports.jsxs(motion.div,{exit:{opacity:0},children:[jsxRuntimeExports.jsx(motion.div,{initial:et?void 0:{scale:1.1},animate:et?pulseAnim:void 0,transition:{...pulseTransition},style:{position:"absolute",inset:0,borderRadius:"50%",boxShadow:"0 0 0 2px var(--ck-graphic-globe-lines, rgba(126, 112, 243, 1))"}},"pulseA"),jsxRuntimeExports.jsx(motion.div,{initial:et?void 0:{scale:1.2,opacity:.25},animate:et?pulseAnim:void 0,transition:{...pulseTransition,delay:.5},style:{position:"absolute",inset:0,borderRadius:"50%",boxShadow:"0 0 0 2px var(--ck-graphic-globe-lines, rgba(126, 112, 243, 1))"}},"pulseB")]})]},et),jsxRuntimeExports.jsxs(motion.div,{initial:{rotate:-20,scale:.1,y:-10,x:-10},animate:{rotate:0,scale:1,y:0,x:0},exit:{zIndex:3,scale:.2,y:-25,x:15},style:{zIndex:12,borderRadius:"50%",position:"absolute",bottom:-4,right:-4,width:54,height:54,display:"flex",alignItems:"center",justifyContent:"center",padding:13,background:"var(--ck-graphic-compass-background, var(--ck-body-background))",boxShadow:"var(--ck-graphic-compass-box-shadow, 0px 2px 9px rgba(0, 0, 0, 0.15))"},children:[jsxRuntimeExports.jsx(BgLighten,{}),jsxRuntimeExports.jsx(motion.div,{style:{zIndex:2,position:"absolute"},initial:{rotate:-170},animate:{rotate:0},exit:{rotate:-180,transition:{duration:0}},transition:{type:"spring",stiffness:6,damping:.9,mass:.2},children:Compass})]})]},"SlideThree")})},About=()=>{var et,o;const tt=useLocales({}),rt=useContext(),nt=(o=(et=rt.options)===null||et===void 0?void 0:et.ethereumOnboardingUrl)!==null&&o!==void 0?o:tt.aboutScreen_ctaUrl,[ot,it]=reactExports.useState(!0),[st,at]=reactExports.useState(0),ct=reactExports.useRef(!1),lt=reactExports.useRef(0),dt=[.16,1,.3,1],ht=600;let mt;reactExports.useEffect(()=>()=>clearInterval(mt),[]);const ft=()=>{if(Et.current){const{overflow:It}=getComputedStyle(Et.current);return It!=="visible"}return!1},pt=It=>{it(!1),ft()?yt(It):at(It)},yt=It=>{if(Et.current){const{offsetWidth:Nt}=Et.current;Et.current.scrollLeft=Nt*It,setTimeout(()=>at(It),100)}},gt=()=>{if(!Et.current)return;const{offsetWidth:It,scrollLeft:Nt}=Et.current,Lt=lt.current;lt.current=Nt;const Mt=4;if(Lt-Nt>-Mt&&Lt-Nt<Mt){const zt=Math.round(Nt/It);at(zt)}},bt=()=>{vt()},xt=()=>{const{offsetWidth:It,scrollLeft:Nt}=Et.current,Lt=Math.round(Nt/It);at(Lt)},vt=()=>{ct.current=!0,clearTimeout(mt)},Et=reactExports.useRef(null);reactExports.useEffect(()=>{if(Et.current)return Et.current.addEventListener("scroll",gt),Et.current.addEventListener("touchmove",bt),Et.current.addEventListener("touchend",xt),()=>{Et.current&&(Et.current.removeEventListener("scroll",gt),Et.current.removeEventListener("touchmove",bt),Et.current.removeEventListener("touchend",xt))}},[Et]);const Ct=[jsxRuntimeExports.jsx(SlideOne,{layoutId:"graphicCircle",duration:ht,ease:dt}),jsxRuntimeExports.jsx(SlideTwo,{layoutId:"graphicCircle",duration:ht,ease:dt}),jsxRuntimeExports.jsx(SlideThree,{layoutId:"graphicCircle",duration:ht,ease:dt})],St=[jsxRuntimeExports.jsx(SlideOne,{duration:ht,ease:dt}),jsxRuntimeExports.jsx(SlideTwo,{duration:ht,ease:dt}),jsxRuntimeExports.jsx(SlideThree,{duration:ht,ease:dt})],At=(()=>{var It;switch((It=rt.options)===null||It===void 0?void 0:It.language){case"en-US":case"zh-CN":return 64;default:return 84}})(),kt=[jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ModalH1,{style:{height:24},$small:!0,children:jsxRuntimeExports.jsx(FitText,{children:tt.aboutScreen_a_h1})}),jsxRuntimeExports.jsx(ModalBody,{style:{height:At},children:jsxRuntimeExports.jsx(FitText,{children:tt.aboutScreen_a_p})})]}),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ModalH1,{style:{height:24},$small:!0,children:jsxRuntimeExports.jsx(FitText,{children:tt.aboutScreen_b_h1})}),jsxRuntimeExports.jsx(ModalBody,{style:{height:At},children:jsxRuntimeExports.jsx(FitText,{children:tt.aboutScreen_b_p})})]}),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ModalH1,{style:{height:24},$small:!0,children:jsxRuntimeExports.jsx(FitText,{children:tt.aboutScreen_c_h1})}),jsxRuntimeExports.jsx(ModalBody,{style:{height:At},children:jsxRuntimeExports.jsx(FitText,{children:tt.aboutScreen_c_p})})]})];return jsxRuntimeExports.jsxs(PageContent,{children:[jsxRuntimeExports.jsxs(Slider,{children:[jsxRuntimeExports.jsx(ImageContainer$1,{children:jsxRuntimeExports.jsx(MotionConfig,{transition:{duration:ht/1e3,ease:dt},children:jsxRuntimeExports.jsx(AnimatePresence,{initial:!1,onExitComplete:()=>it(!0),children:Ct.map((It,Nt)=>st===Nt&&jsxRuntimeExports.jsx(ImageContainerInner,{style:{position:"absolute"},children:It},Nt))})})}),jsxRuntimeExports.jsx(Slides,{ref:Et,children:jsxRuntimeExports.jsx(AnimatePresence,{children:kt.map((It,Nt)=>jsxRuntimeExports.jsxs(Slide,{$active:st===Nt,children:[jsxRuntimeExports.jsx(MobileImageContainer,{children:jsxRuntimeExports.jsx(MotionConfig,{transition:{duration:0},children:jsxRuntimeExports.jsx(ImageContainerInner,{children:St[Nt]})})}),jsxRuntimeExports.jsx(ModalContent,{style:{gap:8,paddingBottom:0},children:It})]},Nt))})})]}),jsxRuntimeExports.jsx(OrDivider,{children:jsxRuntimeExports.jsx(Dots,{children:kt.map((It,Nt)=>jsxRuntimeExports.jsx(Dot,{$active:st===Nt,onClick:()=>{vt(),pt(Nt)}},Nt))})}),jsxRuntimeExports.jsx(Button$1,{href:nt,arrow:!0,children:tt.aboutScreen_ctaText})]})},Shimmer$1=We`
0%{ transform: translate(-100%) rotate(-45deg); }
100%{ transform: translate(100%) rotate(-80deg); }
`,InfoBox=styled.div`
padding: 24px 24px 28px;
border-radius: var(--ck-tertiary-border-radius, 24px);
box-shadow: var(--ck-tertiary-box-shadow, none);
background: var(--ck-body-background-tertiary);
${ModalBody} {
max-width: none;
}
`,InfoBoxButtons=styled.div`
display: grid;
grid-template-columns: 1fr 1fr;
gap: 16px;
margin: 5px -8px -12px;
button {
}
`,LearnMoreContainer=styled(motion.div)`
text-align: center;
margin-top: 16px;
margin-bottom: -6px;
`,LearnMoreButton=styled(motion.button)`
appearance: none;
user-select: none;
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 10px;
height: 42px;
padding: 0 16px;
border-radius: 6px;
background: none;
color: var(--ck-body-color-muted);
font-size: 15px;
line-height: 18px;
font-weight: 500;
/* will-change: transform; */
transition: color 200ms ease, transform 100ms ease;
svg {
transition: all 100ms ease-out;
display: block;
position: relative;
top: 2px;
left: 2px;
transform: translateZ(0px);
path,
circle {
transition: all 100ms ease-out;
}
path:last-of-type {
transform-origin: 0 0;
transform: scaleX(1.3) skewY(-12deg);
opacity: 0;
}
circle {
transform: translate(20%, -15%);
}
}
&:hover {
color: var(--ck-body-color-muted-hover);
svg {
path,
circle {
opacity: 1;
transform: none;
}
}
}
&:active {
transform: scale(0.96);
}
`;styled(motion.div)`
display: flex;
flex-direction: column;
gap: 12px;
padding: 0 0 16px;
overflow-y: scroll;
max-height: 20rem;
&::-webkit-scrollbar {
display: none;
}
`;styled(motion.button)`
cursor: pointer;
user-select: none;
position: relative;
display: flex;
align-items: center;
padding: 0 20px;
width: 100%;
height: 64px;
font-size: 17px;
font-weight: var(--ck-primary-button-font-weight, 500);
line-height: 20px;
text-align: var(--ck-body-button-text-align, left);
transition: 180ms ease;
transition-property: background, color, box-shadow, transform, opacity;
will-change: transform, box-shadow, background-color, color, opacity;
--fallback-color: var(--ck-primary-button-color);
--fallback-background: var(--ck-primary-button-background);
--fallback-box-shadow: var(--ck-primary-button-box-shadow);
--fallback-border-radius: var(--ck-primary-button-border-radius);
--color: var(--ck-primary-button-color, var(--fallback-color));
--background: var(--ck-primary-button-background, var(--fallback-background));
--box-shadow: var(--ck-primary-button-box-shadow, var(--fallback-box-shadow));
--border-radius: var(
--ck-primary-button-border-radius,
var(--fallback-border-radius)
);
--hover-color: var(--ck-primary-button-hover-color, var(--color));
--hover-background: var(
--ck-primary-button-hover-background,
var(--background)
);
--hover-box-shadow: var(
--ck-primary-button-hover-box-shadow,
var(--box-shadow)
);
--hover-border-radius: var(
--ck-primary-button-hover-border-radius,
var(--border-radius)
);
--active-color: var(--ck-primary-button-active-color, var(--hover-color));
--active-background: var(
--ck-primary-button-active-background,
var(--hover-background)
);
--active-box-shadow: var(
--ck-primary-button-active-box-shadow,
var(--hover-box-shadow)
);
--active-border-radius: var(
--ck-primary-button-active-border-radius,
var(--hover-border-radius)
);
color: var(--color);
background: var(--background);
box-shadow: var(--box-shadow);
border-radius: var(--border-radius);
&:disabled {
transition: 180ms ease;
opacity: 0.4;
}
--bg: var(--background);
&:not(:disabled) {
&:hover {
color: var(--hover-color);
background: var(--hover-background);
box-shadow: var(--hover-box-shadow);
border-radius: var(--hover-border-radius);
--bg: var(--hover-background, var(--background));
}
&:focus-visible {
transition-duration: 100ms;
color: var(--hover-color);
background: var(--hover-background);
box-shadow: var(--hover-box-shadow);
border-radius: var(--hover-border-radius);
--bg: var(--hover-background, var(--background));
}
&:active {
color: var(--active-color);
background: var(--active-background);
box-shadow: var(--active-box-shadow);
border-radius: var(--active-border-radius);
--bg: var(--active-background, var(--background));
}
}
`;styled(motion.span)`
position: relative;
top: var(--ck-recent-badge-top-offset, 0.5px);
display: inline-block;
padding: 10px 7px;
line-height: 0;
font-size: 13px;
font-weight: 400;
border-radius: var(--ck-recent-badge-border-radius, var(--border-radius));
color: var(
--ck-recent-badge-color,
var(--ck-accent-color, var(--ck-body-color-muted, currentColor))
);
background: var(--ck-recent-badge-background, transparent);
overflow: hidden;
span {
display: inline-block;
position: relative;
}
&:before {
z-index: 1;
content: '';
position: absolute;
inset: 0;
opacity: 0.4;
box-shadow: var(--ck-recent-badge-box-shadow, inset 0 0 0 1px currentColor);
border-radius: inherit;
}
&:after {
z-index: 2;
content: '';
position: absolute;
inset: -10%;
top: -110%;
aspect-ratio: 1/1;
opacity: 0.7;
background: linear-gradient(
170deg,
transparent 10%,
var(--ck-recent-badge-background, var(--bg)) 50%,
transparent 90%
);
animation: ${Shimmer$1} 2s linear infinite;
}
`;styled(motion.span)`
display: flex;
align-items: center;
gap: 9px;
width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
padding: 2px 0;
padding-right: 38px;
`;styled(motion.div)`
position: absolute;
right: 20px;
width: 32px;
height: 32px;
overflow: hidden;
svg,
img {
display: block;
position: relative;
pointer-events: none;
overflow: hidden;
border-radius: 27.5%;
width: 100%;
height: 100%;
}
`;var WalletIcon$1=({...et})=>jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"20",height:"19",viewBox:"0 0 20 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",...et,children:[jsxRuntimeExports.jsx("path",{d:"M1.57568 4.60616C1.57568 2.69827 3.12234 1.15161 5.03023 1.15161H15.3939C17.3018 1.15161 18.8484 2.69826 18.8484 4.60616V10.3637C18.8484 12.2716 17.3018 13.8183 15.3939 13.8183H5.03023C3.12234 13.8183 1.57568 12.2716 1.57568 10.3637V4.60616Z",stroke:"currentColor",strokeWidth:"2"}),jsxRuntimeExports.jsx("path",{d:"M1 4.79293C1 2.435 3.31004 0.770014 5.54697 1.51566L12.4561 3.81869C13.8667 4.2889 14.8182 5.60901 14.8182 7.09596V13.6313C14.8182 15.9892 12.5081 17.6542 10.2712 16.9086L3.36212 14.6056C1.95149 14.1353 1 12.8152 1 11.3283V4.79293Z",fill:"var(--ck-body-background)",stroke:"currentColor",strokeWidth:"2"}),jsxRuntimeExports.jsx("circle",{cx:"10.3863",cy:"10.1894",r:"1.32574",fill:"currentColor"})]});const Shimmer=We`
0%{ transform: translate(-100%) rotate(-45deg); }
100%{ transform: translate(100%) rotate(-80deg); }
`,ConnectorButton=styled(motion.button)`
display: block;
text-decoration: none;
`,ConnectorLabel=styled(motion.span)``,ConnectorIcon=styled(motion.div)``,styles={desktop:{ConnectorButton:Ae`
cursor: pointer;
user-select: none;
position: relative;
display: flex;
align-items: center;
padding: 0 20px;
width: 100%;
height: 64px;
font-size: 17px;
font-weight: var(--ck-primary-button-font-weight, 500);
line-height: 20px;
text-align: var(--ck-body-button-text-align, left);
transition: 180ms ease;
transition-property: background, color, box-shadow, transform, opacity;
will-change: transform, box-shadow, background-color, color, opacity;
--fallback-color: var(--ck-primary-button-color);
--fallback-background: var(--ck-primary-button-background);
--fallback-box-shadow: var(--ck-primary-button-box-shadow);
--fallback-border-radius: var(--ck-primary-button-border-radius);
--color: var(--ck-primary-button-color, var(--fallback-color));
--background: var(
--ck-primary-button-background,
var(--fallback-background)
);
--box-shadow: var(
--ck-primary-button-box-shadow,
var(--fallback-box-shadow)
);
--border-radius: var(
--ck-primary-button-border-radius,
var(--fallback-border-radius)
);
--hover-color: var(--ck-primary-button-hover-color, var(--color));
--hover-background: var(
--ck-primary-button-hover-background,
var(--background)
);
--hover-box-shadow: var(
--ck-primary-button-hover-box-shadow,
var(--box-shadow)
);
--hover-border-radius: var(
--ck-primary-button-hover-border-radius,
var(--border-radius)
);
--active-color: var(--ck-primary-button-active-color, var(--hover-color));
--active-background: var(
--ck-primary-button-active-background,
var(--hover-background)
);
--active-box-shadow: var(
--ck-primary-button-active-box-shadow,
var(--hover-box-shadow)
);
--active-border-radius: var(
--ck-primary-button-active-border-radius,
var(--hover-border-radius)
);
color: var(--color);
background: var(--background);
box-shadow: var(--box-shadow);
border-radius: var(--border-radius);
&:disabled {
transition: 180ms ease;
opacity: 0.4;
}
--bg: var(--background);
&:not(:disabled) {
&:hover {
color: var(--hover-color);
background: var(--hover-background);
box-shadow: var(--hover-box-shadow);
border-radius: var(--hover-border-radius);
--bg: var(--hover-background, var(--background));
}
&:focus-visible {
transition-duration: 100ms;
color: var(--hover-color);
background: var(--hover-background);
box-shadow: var(--hover-box-shadow);
border-radius: var(--hover-border-radius);
--bg: var(--hover-background, var(--background));
}
&:active {
color: var(--active-color);
background: var(--active-background);
box-shadow: var(--active-box-shadow);
border-radius: var(--active-border-radius);
--bg: var(--active-background, var(--background));
}
}
`,ConnectorLabel:Ae`
display: flex;
align-items: center;
gap: 9px;
width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
padding: 2px 0;
padding-right: 38px;
`,ConnectorIcon:Ae`
position: absolute;
right: 20px;
width: 32px;
height: 32px;
overflow: hidden;
svg,
img {
display: block;
position: relative;
pointer-events: none;
overflow: hidden;
width: 100%;
height: 100%;
}
&[data-shape='squircle'] {
border-radius: 22.5%;
}
&[data-shape='circle'] {
border-radius: 100%;
}
&[data-shape='square'] {
border-radius: 0;
}
`},mobile:{ConnectorButton:Ae`
text-align: center;
background: none;
max-width: 100%;
overflow: hidden;
`,ConnectorLabel:Ae`
display: block;
text-overflow: ellipsis;
max-width: 100%;
overflow: hidden;
padding: 10px 0 0;
color: var(--ck-body-color);
font-size: 13px;
line-height: 15px;
font-weight: 500;
opacity: 0.75;
`,ConnectorIcon:Ae`
position: relative;
margin: 0 auto;
width: 60px;
height: 60px;
overflow: hidden;
svg,
img {
display: block;
position: relative;
width: 100%;
height: auto;
}
&[data-small='true'] {
svg,
img {
transform: scale(0.8);
}
}
&[data-shape='squircle'] {
border-radius: 22.5%;
&:before {
content: '';
z-index: -1;
position: absolute;
inset: 0;
border-radius: inherit;
box-shadow: inset 0 0 0 1px var(--ck-body-background-tertiary);
}
}
&[data-shape='circle'] {
border-radius: 100%;
}
&[data-shape='square'] {
border-radius: 0;
}
`}},RecentlyUsedTag=styled(motion.span)`
position: relative;
top: var(--ck-recent-badge-top-offset, 0.5px);
display: inline-block;
padding: 10px 7px;
line-height: 0;
font-size: 13px;
font-weight: 400;
border-radius: var(--ck-recent-badge-border-radius, var(--border-radius));
color: var(
--ck-recent-badge-color,
var(--ck-accent-color, var(--ck-body-color-muted, currentColor))
);
background: var(--ck-recent-badge-background, transparent);
overflow: hidden;
span {
display: inline-block;
position: relative;
}
&:before {
z-index: 1;
content: '';
position: absolute;
inset: 0;
opacity: 0.4;
box-shadow: var(--ck-recent-badge-box-shadow, inset 0 0 0 1px currentColor);
border-radius: inherit;
}
&:after {
z-index: 2;
content: '';
position: absolute;
inset: -10%;
top: -110%;
aspect-ratio: 1/1;
opacity: 0.7;
background: linear-gradient(
170deg,
transparent 10%,
var(--ck-recent-badge-background, var(--bg)) 50%,
transparent 90%
);
animation: ${Shimmer} 2s linear infinite;
}
`,ConnectorsContainer=styled.div`
transition: opacity 300ms ease;
min-width: fit-content;
${et=>et.$disabled&&Ae`
pointer-events: none;
opacity: 0.4;
`}
${et=>et.$mobile?Ae`
display: flex;
align-items: flex-start;
justify-content: space-around;
gap: 22px 6px;
//margin: 0px -10px -20px;
padding: 14px 0px 28px;
${ConnectorButton} {
flex-shrink: 0;
width: 80px;
${styles.mobile.ConnectorButton}
${ConnectorLabel} {
${styles.mobile.ConnectorLabel}
${RecentlyUsedTag} {
display: none;
width: fit-content;
margin: 0 auto;
}
}
${ConnectorIcon} {
${styles.mobile.ConnectorIcon}
}
}
`:Ae`
display: flex;
flex-direction: column;
gap: 12px;
${ConnectorButton} {
${styles.desktop.ConnectorButton}
${ConnectorLabel} {
${styles.desktop.ConnectorLabel}
}
${ConnectorIcon} {
${styles.desktop.ConnectorIcon}
}
}
`}
`;function useChains(){var et;const o=useConfig();return((et=o==null?void 0:o.chains)!==null&&et!==void 0?et:[]).map(rt=>rt)}function useConnect({...et}={}){const o=useContext(),{connect:tt,connectAsync:rt,connectors:nt,...ot}=useConnect$1({...et,mutation:{...et.mutation,onError(it){it.message?it.message!=="User rejected request"&&o.log(it.message,it):o.log("Could not connect.",it)}}});return{connect:({connector:it,chainId:st,mutation:at})=>{var ct;return tt({connector:it,chainId:st??((ct=o.options)===null||ct===void 0?void 0:ct.initialChainId)},at)},connectAsync:async({connector:it,chainId:st,mutation:at})=>{var ct;return rt({connector:it,chainId:st??((ct=o.options)===null||ct===void 0?void 0:ct.initialChainId)},at)},connectors:nt,...ot}}function useWalletConnectUri({enabled:et}={enabled:!0}){const{log:o}=useContext(),[tt,rt]=reactExports.useState(void 0),nt=useWalletConnectConnector(),{isConnected:ot}=useAccount(),{connectAsync:it}=useConnect();return reactExports.useEffect(()=>{if(!et)return;async function st(dt){const{type:ht,data:mt}=dt;o("WC Message",ht,mt),ht==="display_uri"&&rt(mt)}async function at(){o("WC Disconnect"),nt&&ct(nt)}async function ct(dt){const ht=await it({connector:dt});return ht||!1}async function lt(dt){try{await ct(dt)}catch(ht){if(o("catch error"),o(ht),ht.code)switch(ht.code){case 4001:o("error.code - User rejected"),lt(dt);break;default:o("error.code - Unknown Error");break}else o("WalletConnect cannot connect.",ht)}}if(ot)rt(void 0);else{if(!nt||tt)return;if(nt&&!ot)return lt(nt),o("add wc listeners"),nt.emitter.on("message",st),nt.emitter.on("disconnect",at),()=>{o("remove wc listeners"),nt.emitter.off("message",st),nt.emitter.off("disconnect",at)}}},[et,nt,ot]),{uri:tt}}function useChainIsSupported(et){const{chains:o}=useConfig();return et?o.some(tt=>tt.id===et):!1}const Web3Context=React.createContext({connect:{getUri:()=>""},dapp:{chains:[]},account:void 0}),Web3ContextProvider=({enabled:et,children:o})=>{const{uri:tt}=useWalletConnectUri({enabled:et}),{address:rt,chain:nt}=useAccount(),ot=useChainIsSupported(nt==null?void 0:nt.id),it=useChains(),st={connect:{getUri:at=>tt},dapp:{chains:it},account:rt?{chain:nt,chainIsSupported:ot,address:rt}:void 0};return jsxRuntimeExports.jsx(Web3Context.Provider,{value:st,children:o})},useWeb3=()=>React.useContext(Web3Context);function useIsMobile(){const[et,o]=reactExports.useState(isMobile());return reactExports.useEffect(()=>{const tt=()=>{o(isMobile())};return window.addEventListener("resize",tt),()=>window.removeEventListener("resize",tt)},[]),et}const ScrollContainer=styled.div`
position: relative;
`,fadeIn=We`
0%{ opacity:0; }
100%{ opacity:1; }
`,MoreIndicator=styled.div`
z-index: 9;
position: absolute;
left: 0;
right: 0;
bottom: 0.75rem;
display: flex;
justify-content: center;
transition: opacity 300ms ease;
span {
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.25rem;
padding: 0.3075rem 0.9375rem 0.375rem;
border-radius: 6rem;
background: var(--ck-tooltip-background);
color: var(--ck-tooltip-color);
font-weight: 500;
font-size: 0.8125rem;
letter-spacing: -0.01rem;
box-shadow: var(--ck-tooltip-shadow);
animation: ${fadeIn} 300ms ease 1000ms both;
transition: transform 100ms ease;
&:hover {
transform: scale(1.02);
}
&:active {
transform: scale(0.98);
}
svg {
display: block;
transform: translateX(-0.1875rem);
}
}
&.hide {
opacity: 0;
pointer-events: none;
}
`,ScrollAreaContainer=styled.div`
--bg: ${({$backgroundColor:et})=>et||"var(--ck-body-background)"};
--fade-height: 1px;
position: relative;
z-index: 1;
${({$mobile:et,$height:o,$mobileDirection:tt})=>et&&tt==="horizontal"?Ae`
overflow-x: scroll;
margin: 0 -24px;
padding: 0 24px;
&:before,
&:after {
pointer-events: none;
z-index: 10;
content: '';
display: block;
position: sticky;
top: 0;
bottom: 0;
width: var(--fade-height);
background: var(
--ck-body-divider-secondary,
var(--ck-body-divider)
);
box-shadow: var(--ck-body-divider-box-shadow);
transition: opacity 300ms ease;
}
&:before {
left: 0;
}
&:after {
right: 0;
}
&.scroll-start {
&:before {
opacity: 0;
}
}
&.scroll-end {
&:after {
opacity: 0;
}
}
`:Ae`
max-height: ${o?`${o}px`:"310px"};
overflow-y: scroll;
padding: 0 10px;
margin: calc(var(--fade-height) * -1) -16px 0 -10px;
&:before,
&:after {
pointer-events: none;
z-index: 10;
content: '';
display: block;
position: sticky;
left: 0;
right: 0;
height: var(--fade-height);
background: var(
--ck-body-divider-secondary,
var(--ck-body-divider)
);
box-shadow: var(--ck-body-divider-box-shadow);
transition: opacity 300ms ease;
}
&:before {
top: 0;
}
&:after {
bottom: 0;
}
&.scroll-start {
&:before {
opacity: 0;
}
}
&.scroll-end {
&:after {
opacity: 0;
}
}
`}
&::-webkit-scrollbar {
width: 6px;
height: 6px;
}
&::-webkit-scrollbar-track {
background: transparent;
}
&::-webkit-scrollbar-thumb {
background: rgba(0, 0, 0, 0);
border-radius: 100px;
}
&:hover::-webkit-scrollbar-thumb {
background: var(--ck-body-color-muted);
}
&::-webkit-scrollbar-thumb:hover {
background: var(--ck-body-color-muted-hover);
}
`,ArrowDown=()=>jsxRuntimeExports.jsx("svg",{width:"11",height:"12",viewBox:"0 0 11 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M5.49438 1L5.49438 11M5.49438 11L9.5 7M5.49438 11L1.5 7",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})}),ScrollArea$2=({children:et,height:o,backgroundColor:tt,mobileDirection:rt})=>{const nt=reactExports.useRef(null),ot=reactExports.useRef(null),it=useIsMobile();return reactExports.useEffect(()=>{const st=nt.current;if(!st)return;st.scrollHeight>st.clientHeight&&ot.current&&ot.current.classList.remove("hide");const at=ct=>{const{scrollTop:lt,scrollHeight:dt,clientHeight:ht,scrollLeft:mt,scrollWidth:ft,clientWidth:pt}=ct.target;ot.current&&lt>0&&ot.current.classList.add("hide"),lt===0&&mt===0?st.classList.add("scroll-start"):st.classList.remove("scroll-start"),dt-lt===ht&&ft-mt===pt?st.classList.add("scroll-end"):st.classList.remove("scroll-end")};return st.addEventListener("scroll",at),at({target:st}),()=>{st.removeEventListener("scroll",at)}},[nt.current]),jsxRuntimeExports.jsxs(ScrollContainer,{children:[jsxRuntimeExports.jsx(ScrollAreaContainer,{ref:nt,$mobile:it,$height:o,$backgroundColor:tt,$mobileDirection:rt,children:et}),jsxRuntimeExports.jsx(MoreIndicator,{ref:ot,className:"hide",onClick:()=>{nt.current&&nt.current.scrollTo({top:nt.current.scrollHeight,behavior:"smooth"})},children:jsxRuntimeExports.jsxs("span",{children:[jsxRuntimeExports.jsx(ArrowDown,{})," More Available"]})})]})},AlertContainer=styled(motion.div)`
display: flex;
gap: 8px;
position: relative;
border-radius: 9px;
margin: 0 auto;
padding: 10px;
text-align: left;
font-size: 14px;
line-height: 17px;
font-weight: 400;
max-width: 260px;
min-width: 100%;
border-radius: var(--ck-alert-border-radius, 12px);
color: var(--ck-alert-color, var(--ck-body-color-muted));
background: var(--ck-alert-background, var(--ck-body-background-secondary));
box-shadow: var(--ck-alert-box-shadow, var(--ck-body-box-shadow));
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
padding: 16px;
font-size: 16px;
line-height: 21px;
border-radius: 24px;
text-align: center;
}
${et=>{if(et)return Ae`
color: #fff;
background: var(--ck-body-color-danger, red);
`}}
`,IconContainer$3=styled(motion.div)`
width: 24px;
height: 24px;
display: flex;
align-items: center;
justify-content: center;
svg {
display: block;
width: 100%;
height: auto;
}
`,Alert=({children:et,error:o,icon:tt})=>jsxRuntimeExports.jsxs(AlertContainer,{$error:o,children:[tt&&jsxRuntimeExports.jsx(IconContainer$3,{children:tt}),jsxRuntimeExports.jsx("div",{children:et})]});Alert.displayName="Alert";const useLastConnector=()=>{const{storage:et}=useConfig(),[o,tt]=reactExports.useState(null);return reactExports.useEffect(()=>{(async()=>{const ot=await(et==null?void 0:et.getItem("recentConnectorId"));tt(ot??"")})()},[]),{lastConnectorId:o,updateLastConnectorId:nt=>{et==null||et.setItem("recentConnectorId",nt)}}},ConnectorList=()=>{var et;const o=useContext(),tt=useIsMobile(),rt=useWallets(),{lastConnectorId:nt}=useLastConnector(),ot=!((et=o.options)===null||et===void 0)&&et.hideRecentBadge||nt==="walletConnect"?rt:[...rt.filter(it=>nt===it.connector.id),...rt.filter(it=>nt!==it.connector.id)];return jsxRuntimeExports.jsxs(ScrollArea$2,{mobileDirection:"horizontal",children:[ot.length===0&&jsxRuntimeExports.jsx(Alert,{error:!0,children:"No connectors found in ConnectKit config."}),ot.length>0&&jsxRuntimeExports.jsx(ConnectorsContainer,{$mobile:tt,$totalResults:ot.length,children:ot.map(it=>jsxRuntimeExports.jsx(ConnectorItem,{wallet:it,isRecent:it.id===nt},it.id))})]})},ConnectorItem=({wallet:et,isRecent:o})=>{var tt,rt,nt,ot;const{connect:{getUri:it}}=useWeb3(),st=it(),at=useIsMobile(),ct=useContext(),{connect:lt}=useConnect();let dt=!et.isInstalled&&at||et.shouldDeeplinkDesktop&&!at?(tt=et.getWalletConnectDeeplink)===null||tt===void 0?void 0:tt.call(et,st??""):void 0;const ht=at&&isWalletConnectConnector(et.id),mt=(detectBrowser()==="safari"||detectBrowser()==="ios")&&isCoinbaseWalletConnector(et.connector.id);return(ht||mt)&&(dt=void 0),jsxRuntimeExports.jsxs(ConnectorButton,{type:"button",as:dt?"a":void 0,href:dt||void 0,disabled:ct.route!==routes.CONNECTORS,onClick:dt?void 0:()=>{ht?ct.setRoute(routes.MOBILECONNECTORS):(mt&&lt({connector:et==null?void 0:et.connector}),ct.setRoute(routes.CONNECT),ct.setConnector({id:et.id}))},children:[jsxRuntimeExports.jsx(ConnectorIcon,{"data-small":et.iconShouldShrink,"data-shape":et.iconShape,children:(rt=et.iconConnector)!==null&&rt!==void 0?rt:et.icon}),jsxRuntimeExports.jsxs(ConnectorLabel,{children:[at&&(nt=et.shortName)!==null&&nt!==void 0?nt:et.name,!(!((ot=ct.options)===null||ot===void 0)&&ot.hideRecentBadge)&&o&&jsxRuntimeExports.jsx(RecentlyUsedTag,{children:jsxRuntimeExports.jsx("span",{children:"Recent"})})]})]})},Wallets=()=>{var et,o,tt,rt,nt;const ot=useContext(),it=useLocales({}),st=useIsMobile();return jsxRuntimeExports.jsxs(PageContent,{style:{width:312},children:[jsxRuntimeExports.jsx(ConnectorList,{}),st?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(InfoBox,{children:[jsxRuntimeExports.jsxs(ModalContent,{style:{padding:0,textAlign:"left"},children:[jsxRuntimeExports.jsx(ModalH1,{$small:!0,children:it.connectorsScreen_h1}),jsxRuntimeExports.jsx(ModalBody,{children:it.connectorsScreen_p})]}),jsxRuntimeExports.jsxs(InfoBoxButtons,{children:[!(!((et=ot.options)===null||et===void 0)&&et.hideQuestionMarkCTA)&&jsxRuntimeExports.jsx(Button$1,{variant:"tertiary",onClick:()=>ot.setRoute(routes.ABOUT),children:it.learnMore}),!(!((o=ot.options)===null||o===void 0)&&o.hideNoWalletCTA)&&jsxRuntimeExports.jsx(Button$1,{variant:"tertiary",onClick:()=>ot.setRoute(routes.ONBOARDING),children:it.getWallet})]})]})}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!(!((tt=ot.options)===null||tt===void 0)&&tt.hideNoWalletCTA)&&jsxRuntimeExports.jsx(LearnMoreContainer,{children:jsxRuntimeExports.jsxs(LearnMoreButton,{onClick:()=>ot.setRoute(routes.ONBOARDING),children:[jsxRuntimeExports.jsx(WalletIcon$1,{})," ",it.connectorsScreen_newcomer]})})}),((rt=ot.options)===null||rt===void 0?void 0:rt.disclaimer)&&jsxRuntimeExports.jsx(Disclaimer,{style:{visibility:"hidden",pointerEvents:"none"},children:jsxRuntimeExports.jsx("div",{children:(nt=ot.options)===null||nt===void 0?void 0:nt.disclaimer})})]})},WalletItem=styled.div`
text-align: center;
transition: opacity 100ms ease;
opacity: ${et=>et.$waiting?.4:1};
`,WalletIcon=styled.div`
z-index: 9;
position: relative;
margin: 0 auto 10px;
border-radius: 16px;
width: 60px;
height: 60px;
overflow: hidden;
background: rgba(0, 0, 0, 0.04);
${et=>et.$outline&&`
&:before {
content: '';
z-index: 2;
position: absolute;
inset: 0;
border-radius: inherit;
box-shadow: inset 0 0 0 1px var(--ck-body-background-tertiary);
}`}
svg {
display: block;
position: relative;
width: 100%;
height: auto;
}
`,WalletLabel=styled.div`
color: var(--ck-body-color);
font-size: 13px;
line-height: 15px;
font-weight: 500;
opacity: 0.75;
`,PulseKeyframes=We`
0%,100% { opacity:1; }
50% { opacity:0.5; }
`,WalletList=styled.div`
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 22px 8px;
margin: 0 -10px;
padding: 4px 0 0;
transition: opacity 300ms ease;
${et=>et.$disabled&&Ae`
pointer-events: none;
opacity: 0.4;
${WalletItem} {
animation: ${PulseKeyframes} 1s infinite ease-in-out;
}
`}
`,Container$6=styled.div``;function useWalletConnectModal(){const{log:et}=useContext(),{connectAsync:o,connectors:tt}=useConnect(),[rt,nt]=reactExports.useState(!1);return{isOpen:rt,open:async()=>{const ot=document.createElement("style");ot.innerHTML="w3m-modal, wcm-modal{ --wcm-z-index: 2147483647; --w3m-z-index:2147483647; }",document.head.appendChild(ot);const it=tt.find(st=>isWalletConnectConnector(st.id));if(it)try{const at=(await it.getProvider()).rpc.projectId,ct=walletConnect({projectId:at,showQrModal:!0});nt(!0);try{await o({connector:ct})}catch(lt){et("WalletConnect",lt)}nt(!1),document.head.removeChild(ot)}catch(st){et("Could not get WalletConnect provider",st)}else et("No WalletConnect connector available")}}}const IconContainer$2=styled(motion.div)`
transition: all 220ms cubic-bezier(0.175, 0.885, 0.32, 1.1);
display: flex;
align-items: center;
justify-content: center;
width: 16px;
svg {
display: block;
}
svg,
svg path,
svg rect {
transition: inherit;
}
svg path:first-child {
transform-origin: 50% 50%;
fill: var(--bg);
stroke: var(--color);
}
svg rect {
transform-origin: 53% 63%;
fill: var(--bg);
stroke: var(--color);
}
svg path:last-child {
opacity: 0;
stroke: var(--bg);
transform: translate(11.75px, 10px) rotate(90deg) scale(0.6);
}
${et=>et.$clipboard?Ae`
--color: var(--ck-focus-color) !important;
--bg: var(--ck-body-background);
svg {
transition-delay: 0ms;
path:first-child {
opacity: 0;
transform: rotate(-90deg) scale(0.2);
}
rect {
rx: 10px;
fill: var(--color);
transform: rotate(-90deg) scale(1.45);
}
path:last-child {
transition-delay: 100ms;
opacity: 1;
transform: translate(7.75px, 9.5px);
}
}
`:Ae`
&:hover {
}
&:hover:active {
}
`}
`,CopyToClipboardIcon=({copied:et,small:o})=>jsxRuntimeExports.jsx(IconContainer$2,{$clipboard:et,children:jsxRuntimeExports.jsx(CopyToClipboardIcon$1,{style:{transform:o?"scale(1)":"translateX(3px) scale(1.5)",opacity:o||et?1:.3}})}),Container$5=styled.div`
--color: var(--ck-copytoclipboard-stroke);
--bg: var(--ck-body-background);
transition: all 220ms cubic-bezier(0.175, 0.885, 0.32, 1.1);
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
${et=>et.$disabled?Ae`
cursor: not-allowed;
opacity: 0.4;
`:Ae`
&:hover {
--color: var(--ck-body-color-muted);
}
`}
`,OffsetContainer=styled.div`
display: block;
position: relative;
transition: inherit;
svg {
position: absolute;
left: 100%;
display: block;
top: -1px;
margin: 0;
margin-left: 4px;
}
`,CopyToClipboard=({string:et,children:o,variant:tt})=>{const[rt,nt]=reactExports.useState(!1);let ot;const it=()=>{if(!et)return;const st=et.trim();navigator.clipboard&&navigator.clipboard.writeText(st),nt(!0),clearTimeout(ot),ot=setTimeout(()=>nt(!1),1e3)};return tt==="button"?jsxRuntimeExports.jsx(Button$1,{disabled:!et,onClick:it,icon:jsxRuntimeExports.jsx(CopyToClipboardIcon,{copied:rt}),children:o}):jsxRuntimeExports.jsx(Container$5,{onClick:it,$disabled:!et,children:jsxRuntimeExports.jsxs(OffsetContainer,{children:[o,jsxRuntimeExports.jsx(CopyToClipboardIcon,{copied:rt,small:!0})]})})},MoreIcon=jsxRuntimeExports.jsx("svg",{width:"60",height:"60",viewBox:"0 0 60 60",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M30 42V19M19 30.5H42",stroke:"var(--ck-body-color-muted)",strokeWidth:"3",strokeLinecap:"round"})}),MobileConnectors=()=>{var et,o;const tt=useContext(),rt=useLocales(),{connect:{getUri:nt}}=useWeb3(),ot=nt(),{open:it,isOpen:st}=useWalletConnectModal(),at=useWallets(),ct=(et=Object.keys(walletConfigs).filter(dt=>{const ht=walletConfigs[dt];return!(at.find(mt=>mt.connector.id===dt)||!ht.getWalletConnectDeeplink)}))!==null&&et!==void 0?et:[],lt=dt=>{var ht;const mt=(ht=dt.getWalletConnectDeeplink)===null||ht===void 0?void 0:ht.call(dt,ot);mt&&(window.location.href=mt)};return jsxRuntimeExports.jsx(PageContent,{style:{width:312},children:jsxRuntimeExports.jsxs(Container$6,{children:[jsxRuntimeExports.jsx(ModalContent,{style:{paddingBottom:0},children:jsxRuntimeExports.jsx(ScrollArea$2,{height:340,children:jsxRuntimeExports.jsxs(WalletList,{$disabled:!ot,children:[ct.sort((dt,ht)=>{var mt,ft,pt,yt;const gt=walletConfigs[dt],bt=walletConfigs[ht],xt=(ft=(mt=gt.name)!==null&&mt!==void 0?mt:gt.shortName)!==null&&ft!==void 0?ft:dt,vt=(yt=(pt=bt.name)!==null&&pt!==void 0?pt:bt.shortName)!==null&&yt!==void 0?yt:ht;return xt.localeCompare(vt)}).filter(dt=>!(dt==="coinbaseWallet"||dt==="com.coinbase.wallet")).map((dt,ht)=>{const mt=walletConfigs[dt],{name:ft,shortName:pt,iconConnector:yt,icon:gt}=mt;return jsxRuntimeExports.jsxs(WalletItem,{onClick:()=>lt(mt),style:{animationDelay:`${ht*50}ms`},children:[jsxRuntimeExports.jsx(WalletIcon,{$outline:!0,children:yt??gt}),jsxRuntimeExports.jsx(WalletLabel,{children:pt??ft})]},ht)}),jsxRuntimeExports.jsxs(WalletItem,{onClick:it,$waiting:st,children:[jsxRuntimeExports.jsx(WalletIcon,{style:{background:"var(--ck-body-background-secondary)"},children:st?jsxRuntimeExports.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntimeExports.jsx("div",{style:{width:"50%"},children:jsxRuntimeExports.jsx(Spinner$4,{})})}):MoreIcon}),jsxRuntimeExports.jsx(WalletLabel,{children:rt.more})]})]})})}),((o=tt.options)===null||o===void 0?void 0:o.walletConnectCTA)!=="modal"&&jsxRuntimeExports.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:14,paddingTop:8},children:jsxRuntimeExports.jsx(CopyToClipboard,{variant:"button",string:ot,children:rt.copyToClipboard})})]})})},Content$1=styled(motion.div)`
display: flex;
flex-direction: column;
gap: 6px;
position: relative;
left: 0;
right: 0;
${ModalContent} {
padding: 0 8px 32px;
gap: 12px;
}
`,dist$1=2,shakeKeyframes=We`
0%{ transform:none; }
25%{ transform:translateX(${dist$1}px); }
50%{ transform:translateX(-${dist$1}px); }
75%{ transform:translateX(${dist$1}px); }
100%{ transform:none; }
`,outlineKeyframes=We`
0%{ opacity:1; }
100%{ opacity:0; }
`,Container$4=styled(motion.div)`
/*
background: var(
--ck-body-background
); // To stop the overlay issue during transition for the squircle spinner
*/
`,ConnectingContainer=styled(motion.div)`
display: flex;
align-items: center;
justify-content: center;
margin: 10px auto 16px;
height: 120px;
//transform: scale(1.001); // fixes shifting issue between states
`,ConnectingAnimation=styled(motion.div)`
user-select: none;
position: relative;
--spinner-error-opacity: 0;
&:before {
content: '';
position: absolute;
inset: 1px;
opacity: 0;
background: var(--ck-body-color-danger);
${et=>et.$circle&&Ae`
inset: -5px;
border-radius: 50%;
background: none;
box-shadow: inset 0 0 0 3.5px var(--ck-body-color-danger);
`}
}
${et=>et.$shake&&Ae`
animation: ${shakeKeyframes} 220ms ease-out both;
&:before {
animation: ${outlineKeyframes} 220ms ease-out 750ms both;
}
`}
`,RetryButton=styled(motion.button)`
z-index: 5;
appearance: none;
position: absolute;
right: 2px;
bottom: 2px;
padding: 0;
display: flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
border-radius: 16px;
cursor: pointer;
overflow: hidden;
background: none;
color: var(--ck-body-background);
transition: color 200ms ease;
box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.15);
&:before {
z-index: 3;
content: '';
position: absolute;
inset: 0;
opacity: 0;
transition: opacity 200ms ease;
background: var(--ck-body-color);
}
&:hover:before {
opacity: 0.1;
}
`,RetryIconContainer=styled(motion.div)`
position: absolute;
inset: 0;
&:before {
z-index: 1;
content: '';
position: absolute;
inset: 3px;
border-radius: 16px;
background: conic-gradient(
from 90deg,
currentColor 10%,
var(--ck-body-color) 80%
);
}
svg {
z-index: 2;
display: block;
position: relative;
width: 100%;
height: 100%;
}
`,TooltipWindow=styled(motion.div)`
z-index: 2147483647;
position: fixed;
inset: 0;
pointer-events: none;
`,TooltipContainer=styled(motion.div)`
--shadow: var(--ck-tooltip-shadow);
z-index: 2147483647;
position: absolute;
top: 0;
left: 0;
display: flex;
gap: 8px;
width: fit-content;
align-items: center;
justify-content: center;
border-radius: var(
--ck-tooltip-border-radius,
${et=>et.$size==="small"?11:14}px
);
border-radius: ;
padding: 10px 16px 10px 12px;
font-size: 14px;
line-height: 19px;
font-weight: 500;
letter-spacing: -0.1px;
color: var(--ck-tooltip-color);
background: var(--ck-tooltip-background);
box-shadow: var(--shadow);
> span {
z-index: 3;
position: relative;
}
> div {
margin: -4px 0; // offset for icon
}
strong {
color: var(--ck-spinner-color);
}
.ck-tt-logo {
display: inline-block;
vertical-align: text-bottom;
height: 1em;
width: 1.25em;
svg {
display: block;
height: 100%;
transform: translate(0.5px, -1px) scale(1.75);
}
}
`,TooltipTail=styled(motion.div)`
z-index: 2;
position: absolute;
display: flex;
align-items: center;
justify-content: center;
width: ${et=>et.$size==="small"?14:18}px;
right: 100%;
top: 0;
bottom: 0;
overflow: hidden;
&:before {
content: '';
position: absolute;
box-shadow: var(--shadow);
width: ${et=>et.$size==="small"?14:18}px;
height: ${et=>et.$size==="small"?14:18}px;
transform: translate(75%, 0) rotate(45deg);
background: var(--ck-tooltip-background);
border-radius: ${et=>et.$size==="small"?2:3}px 0 0 0;
}
`,Tooltip=({children:et,message:o,open:tt,xOffset:rt=0,yOffset:nt=0,delay:ot})=>{var it;const st=useContext(),at=useThemeContext();if(!((it=st.options)===null||it===void 0)&&it.hideTooltips)return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:et});const[ct,lt]=reactExports.useState(!1),[dt,ht]=reactExports.useState(!1),[mt,ft]=reactExports.useState("small"),[pt,yt]=reactExports.useState(!1),[gt]=reactExports.useState(st.route),bt=reactExports.useRef(null),[xt,vt]=useMeasure({debounce:pt?0:220,offsetSize:!0,scroll:!0}),Et=()=>{let At=!1;const kt=rt+vt.left+vt.width,It=nt+vt.top+vt.height*.5;return(kt>window.innerWidth||kt<0||It>window.innerHeight||It<0)&&(At=!0),At};return(typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect)(()=>{if(!bt.current||vt.top+vt.bottom+vt.left+vt.right+vt.height+vt.width===0)return;const At=rt+vt.left+vt.width,kt=nt+vt.top+vt.height*.5;!pt&&At!==0&&kt!==0&&yt(!0),bt.current.style.left=`${At}px`,bt.current.style.top=`${kt}px`,ft(bt.current.offsetHeight<=40?"small":"large"),ht(Et())},[vt,tt,ct]),reactExports.useEffect(()=>{st.open||lt(!1)},[st.open]),reactExports.useEffect(()=>{lt(!!tt)},[tt]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(motion.div,{ref:xt,style:tt===void 0?{cursor:"help"}:{},onHoverStart:()=>lt(!0),onHoverEnd:()=>lt(!1),onClick:()=>lt(!1),children:et}),jsxRuntimeExports.jsx(Portal,{children:jsxRuntimeExports.jsx(AnimatePresence,{children:gt===st.route&&!dt&&ct&&jsxRuntimeExports.jsx(ResetContainer,{$useTheme:at.theme,$useMode:at.mode,$customTheme:at.customTheme,children:jsxRuntimeExports.jsx(TooltipWindow,{children:jsxRuntimeExports.jsxs(TooltipContainer,{role:"tooltip",$size:mt,ref:bt,initial:"collapsed",animate:pt?"open":{},exit:"collapsed",variants:{collapsed:{transformOrigin:"20px 50%",opacity:0,scale:.9,z:.01,y:"-50%",x:20,transition:{duration:.1}},open:{willChange:"opacity,transform",opacity:1,scale:1,z:.01,y:"-50%",x:20,transition:{ease:[.76,0,.24,1],duration:.15,delay:ot||.5}}},children:[o,jsxRuntimeExports.jsx(TooltipTail,{$size:mt})]})})})})})]})},LogoContainer$4=styled(motion.div)`
z-index: 4;
position: relative;
overflow: hidden;
svg {
z-index: 3;
position: relative;
display: block;
}
`,Logo$1=styled(motion.div)`
z-index: 2;
position: absolute;
overflow: hidden;
inset: 6px;
border-radius: 24px;
background: var(--ck-body-background);
svg,
img {
pointer-events: none;
display: block;
width: 100%;
height: 100%;
}
`,SpinnerContainer$1=styled(motion.div)`
position: absolute;
inset: 1px;
overflow: hidden;
`,Spinner$3=styled(motion.div)`
pointer-events: none;
user-select: none;
z-index: 1;
position: absolute;
inset: -25%;
&:before {
content: '';
position: absolute;
inset: 0;
background: conic-gradient(
from -90deg,
transparent,
transparent,
transparent,
transparent,
transparent,
var(--ck-spinner-color)
);
animation: rotateSpinner 1200ms linear infinite;
}
@keyframes rotateSpinner {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
`,SquircleSpinner=({logo:et,connecting:o=!0})=>jsxRuntimeExports.jsxs(LogoContainer$4,{transition:{duration:.5,ease:[.175,.885,.32,.98]},children:[jsxRuntimeExports.jsx(Logo$1,{children:et}),jsxRuntimeExports.jsx(SpinnerContainer$1,{children:jsxRuntimeExports.jsx(AnimatePresence,{children:o&&jsxRuntimeExports.jsx(Spinner$3,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:0}}},"Spinner")})}),jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"102",height:"102",viewBox:"0 0 102 102",fill:"none",children:[jsxRuntimeExports.jsx("rect",{x:"7.57895",y:"7.57895",width:"86.8421",height:"86.8421",rx:"19.2211",stroke:"black",strokeOpacity:"0.02",strokeWidth:"1.15789"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H102V102H0V0ZM7 38.284C7 27.5684 7 22.2106 9.01905 18.0892C10.9522 14.1431 14.1431 10.9522 18.0892 9.01905C22.2106 7 27.5684 7 38.284 7H63.716C74.4316 7 79.7894 7 83.9108 9.01905C87.8569 10.9522 91.0478 14.1431 92.9809 18.0892C95 22.2106 95 27.5684 95 38.284V63.716C95 74.4316 95 79.7894 92.9809 83.9108C91.0478 87.8569 87.8569 91.0478 83.9108 92.9809C79.7894 95 74.4316 95 63.716 95H38.284C27.5684 95 22.2106 95 18.0892 92.9809C14.1431 91.0478 10.9522 87.8569 9.01905 83.9108C7 79.7894 7 74.4316 7 63.716V38.284ZM41.5 0.5H41.4325C34.7246 0.499996 29.6023 0.499994 25.5104 0.823325C21.388 1.14906 18.1839 1.80986 15.3416 3.20227C10.0602 5.78959 5.78959 10.0602 3.20227 15.3416C1.80986 18.1839 1.14906 21.388 0.823325 25.5104C0.499994 29.6023 0.499996 34.7246 0.5 41.4325V41.5V55.5938C0.5 55.6808 0.507407 55.766 0.521624 55.849C0.507407 55.9319 0.5 56.0172 0.5 56.1042V60.5V60.5675C0.499996 67.2754 0.499994 72.3977 0.823325 76.4896C1.14906 80.612 1.80986 83.8161 3.20227 86.6584C5.78959 91.9398 10.0602 96.2104 15.3416 98.7977C18.1839 100.19 21.388 100.851 25.5104 101.177C29.6022 101.5 34.7244 101.5 41.432 101.5H41.4324H41.5H43.4227H60.5H60.5675H60.568C67.2756 101.5 72.3977 101.5 76.4896 101.177C80.612 100.851 83.8161 100.19 86.6584 98.7977C91.9398 96.2104 96.2104 91.9398 98.7977 86.6584C100.19 83.8161 100.851 80.612 101.177 76.4896C101.5 72.3978 101.5 67.2756 101.5 60.568V60.5676V60.5V41.5V41.4324V41.432C101.5 34.7244 101.5 29.6022 101.177 25.5104C100.851 21.388 100.19 18.1839 98.7977 15.3416C96.2104 10.0602 91.9398 5.78959 86.6584 3.20227C83.8161 1.80986 80.612 1.14906 76.4896 0.823325C72.3977 0.499994 67.2754 0.499996 60.5675 0.5H60.5H41.5ZM3.5 56.1042C3.5 56.0172 3.49259 55.9319 3.47838 55.849C3.49259 55.766 3.5 55.6808 3.5 55.5938V41.5C3.5 34.7112 3.50109 29.7068 3.814 25.7467C4.1256 21.8032 4.73946 19.0229 5.89635 16.6614C8.19077 11.9779 11.9779 8.19077 16.6614 5.89635C19.0229 4.73946 21.8032 4.1256 25.7467 3.814C29.7068 3.50109 34.7112 3.5 41.5 3.5H60.5C67.2888 3.5 72.2932 3.50109 76.2533 3.814C80.1968 4.1256 82.977 4.73946 85.3386 5.89635C90.022 8.19077 93.8092 11.9779 96.1036 16.6614C97.2605 19.0229 97.8744 21.8032 98.186 25.7467C98.4989 29.7068 98.5 34.7112 98.5 41.5V60.5C98.5 67.2888 98.4989 72.2932 98.186 76.2533C97.8744 80.1968 97.2605 82.9771 96.1036 85.3386C93.8092 90.022 90.022 93.8092 85.3386 96.1036C82.977 97.2605 80.1968 97.8744 76.2533 98.186C72.2932 98.4989 67.2888 98.5 60.5 98.5H43.4227H41.5C34.7112 98.5 29.7068 98.4989 25.7467 98.186C21.8032 97.8744 19.0229 97.2605 16.6614 96.1036C11.9779 93.8092 8.19077 90.022 5.89635 85.3386C4.73946 82.9771 4.1256 80.1968 3.814 76.2533C3.50109 72.2932 3.5 67.2888 3.5 60.5V56.1042Z",fill:"var(--ck-body-background)"})]})]}),BrowserIconContainer=styled(motion.div)`
display: flex;
align-items: center;
justify-content: center;
max-width: 32px;
max-height: 32px;
width: 100%;
height: 100%;
svg {
display: block;
width: 100%;
height: 100%;
}
`,Chrome=jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("g",{filter:"url(#filter0_ii_927_5781)",children:jsxRuntimeExports.jsxs("g",{clipPath:"url(#clip0_927_5781)",children:[jsxRuntimeExports.jsx("path",{d:"M1.58771 0V12.2727H6.06498L10.0002 5.45455H20.0002V0H1.58771Z",fill:"#DB4437"}),jsxRuntimeExports.jsx("path",{d:"M1.58771 0V12.2727H6.06498L10.0002 5.45455H20.0002V0H1.58771Z",fill:"url(#paint0_linear_927_5781)"}),jsxRuntimeExports.jsx("path",{d:"M6.17038 12.2272L1.64538 4.46582L1.57947 4.57946L6.07265 12.284L6.17038 12.2272Z",fill:"black",fillOpacity:"0.15"}),jsxRuntimeExports.jsx("path",{d:"M0 20.0003H9.51932L13.9375 15.5821V12.273H6.0625L0 1.87305V20.0003Z",fill:"#0F9D58"}),jsxRuntimeExports.jsx("path",{d:"M0 20.0003H9.51932L13.9375 15.5821V12.273H6.0625L0 1.87305V20.0003Z",fill:"url(#paint1_linear_927_5781)"}),jsxRuntimeExports.jsx("path",{d:"M13.8412 12.4208L13.7469 12.3662L9.38324 19.9969H9.51392L13.8435 12.4242L13.8412 12.4208Z",fill:"#263238",fillOpacity:"0.15"}),jsxRuntimeExports.jsx("path",{d:"M10.0006 5.45459L13.9381 12.2728L9.51996 20H20.0006V5.45459H10.0006Z",fill:"#FFCD40"}),jsxRuntimeExports.jsx("path",{d:"M10.0006 5.45459L13.9381 12.2728L9.51996 20H20.0006V5.45459H10.0006Z",fill:"url(#paint2_linear_927_5781)"}),jsxRuntimeExports.jsx("path",{d:"M9.9996 5.45459L13.9371 12.2728L9.51892 20H19.9996V5.45459H9.9996Z",fill:"#FFCD40"}),jsxRuntimeExports.jsx("path",{d:"M9.9996 5.45459L13.9371 12.2728L9.51892 20H19.9996V5.45459H9.9996Z",fill:"url(#paint3_linear_927_5781)"}),jsxRuntimeExports.jsx("path",{d:"M1.58691 0V12.2727H6.06419L9.99941 5.45455H19.9994V0H1.58691Z",fill:"#DB4437"}),jsxRuntimeExports.jsx("path",{d:"M1.58691 0V12.2727H6.06419L9.99941 5.45455H19.9994V0H1.58691Z",fill:"url(#paint4_linear_927_5781)"}),jsxRuntimeExports.jsx("path",{d:"M10 5.45459V7.83527L18.9091 5.45459H10Z",fill:"url(#paint5_radial_927_5781)"}),jsxRuntimeExports.jsx("path",{d:"M0 19.9998H9.51932L11.9318 15.9089L13.9375 12.2726H6.0625L0 1.87256V19.9998Z",fill:"#0F9D58"}),jsxRuntimeExports.jsx("path",{d:"M0 19.9998H9.51932L12.1023 15.5112L13.9375 12.2726H6.0625L0 1.87256V19.9998Z",fill:"url(#paint6_linear_927_5781)"}),jsxRuntimeExports.jsx("path",{d:"M1.58771 4.59668L8.09339 11.1012L6.06384 12.2728L1.58771 4.59668Z",fill:"url(#paint7_radial_927_5781)"}),jsxRuntimeExports.jsx("path",{d:"M9.52661 19.9884L11.9084 11.1021L13.938 12.2725L9.52661 19.9884Z",fill:"url(#paint8_radial_927_5781)"}),jsxRuntimeExports.jsx("path",{d:"M10.0003 14.5455C12.5107 14.5455 14.5458 12.5104 14.5458 10C14.5458 7.48966 12.5107 5.45459 10.0003 5.45459C7.48996 5.45459 5.4549 7.48966 5.4549 10C5.4549 12.5104 7.48996 14.5455 10.0003 14.5455Z",fill:"#F1F1F1"}),jsxRuntimeExports.jsx("path",{d:"M9.99995 13.6365C12.0083 13.6365 13.6363 12.0084 13.6363 10.0001C13.6363 7.99183 12.0083 6.36377 9.99995 6.36377C7.99164 6.36377 6.36359 7.99183 6.36359 10.0001C6.36359 12.0084 7.99164 13.6365 9.99995 13.6365Z",fill:"#4285F4"}),jsxRuntimeExports.jsx("path",{d:"M10.0003 5.34082C7.48899 5.34082 5.4549 7.37491 5.4549 9.88628V9.99991C5.4549 7.48855 7.48899 5.45446 10.0003 5.45446H20.0003V5.34082H10.0003Z",fill:"black",fillOpacity:"0.2"}),jsxRuntimeExports.jsx("path",{d:"M13.9318 12.273C13.1455 13.6299 11.6818 14.5458 10 14.5458C8.31818 14.5458 6.85227 13.6299 6.06818 12.273H6.06364L0 1.87305V1.98668L6.06818 12.3867C6.85455 13.7435 8.31818 14.6594 10 14.6594C11.6818 14.6594 13.1455 13.7446 13.9318 12.3867H13.9375V12.273H13.9307H13.9318Z",fill:"white",fillOpacity:"0.1"}),jsxRuntimeExports.jsx("path",{opacity:"0.1",d:"M10.1133 5.45459C10.094 5.45459 10.0758 5.45686 10.0565 5.458C12.5406 5.48868 14.5452 7.50913 14.5452 10C14.5452 12.491 12.5406 14.5114 10.0565 14.5421C10.0758 14.5421 10.094 14.5455 10.1133 14.5455C12.6247 14.5455 14.6588 12.5114 14.6588 10C14.6588 7.48868 12.6247 5.45459 10.1133 5.45459Z",fill:"black"}),jsxRuntimeExports.jsx("path",{d:"M13.9769 12.4204C14.3632 11.7522 14.5871 10.9795 14.5871 10.1522C14.5874 9.68602 14.5157 9.22262 14.3746 8.77832C14.4826 9.16696 14.5451 9.57377 14.5451 9.99764C14.5451 10.8249 14.3212 11.5976 13.9348 12.2658L13.9371 12.2704L9.51892 19.9976H9.65074L13.9769 12.4204Z",fill:"white",fillOpacity:"0.2"}),jsxRuntimeExports.jsx("path",{d:"M10 0.113636C15.5034 0.113636 19.9682 4.56023 20 10.0568C20 10.0375 20.0011 10.0193 20.0011 10C20.0011 4.47727 15.5239 0 10.0011 0C4.47841 0 0 4.47727 0 10C0 10.0193 0.00113639 10.0375 0.00113639 10.0568C0.0318182 4.56023 4.49659 0.113636 10 0.113636Z",fill:"white",fillOpacity:"0.2"}),jsxRuntimeExports.jsx("path",{d:"M10 19.8865C15.5034 19.8865 19.9682 15.4399 20 9.94336C20 9.96268 20.0011 9.98086 20.0011 10.0002C20.0011 15.5229 15.5239 20.0002 10.0011 20.0002C4.47841 20.0002 0 15.5229 0 10.0002C0 9.98086 0.00113639 9.96268 0.00113639 9.94336C0.0318182 15.4399 4.49659 19.8865 10.0011 19.8865H10Z",fill:"black",fillOpacity:"0.15"})]})}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("filter",{id:"filter0_ii_927_5781",x:0,y:"-0.235294",width:20,height:"20.4706",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[jsxRuntimeExports.jsx("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),jsxRuntimeExports.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),jsxRuntimeExports.jsx("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),jsxRuntimeExports.jsx("feOffset",{dy:"0.235294"}),jsxRuntimeExports.jsx("feGaussianBlur",{stdDeviation:"0.235294"}),jsxRuntimeExports.jsx("feComposite",{in2:"hardAlpha",operator:"arithmetic",k2:-1,k3:1}),jsxRuntimeExports.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.25 0"}),jsxRuntimeExports.jsx("feBlend",{mode:"normal",in2:"shape",result:"effect1_innerShadow_927_5781"}),jsxRuntimeExports.jsx("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),jsxRuntimeExports.jsx("feOffset",{dy:"-0.235294"}),jsxRuntimeExports.jsx("feGaussianBlur",{stdDeviation:"0.235294"}),jsxRuntimeExports.jsx("feComposite",{in2:"hardAlpha",operator:"arithmetic",k2:-1,k3:1}),jsxRuntimeExports.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.12 0"}),jsxRuntimeExports.jsx("feBlend",{mode:"normal",in2:"effect1_innerShadow_927_5781",result:"effect2_innerShadow_927_5781"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_927_5781",x1:"2.42521",y1:"7.61591",x2:"8.39112",y2:"4.13068",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#A52714",stopOpacity:"0.6"}),jsxRuntimeExports.jsx("stop",{offset:"0.66",stopColor:"#A52714",stopOpacity:0})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint1_linear_927_5781",x1:"11.6932",y1:"17.7844",x2:"5.06136",y2:"13.8981",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#055524",stopOpacity:"0.4"}),jsxRuntimeExports.jsx("stop",{offset:"0.33",stopColor:"#055524",stopOpacity:0})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint2_linear_927_5781",x1:"12.9438",y1:"4.75004",x2:"14.6143",y2:"12.0569",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#EA6100",stopOpacity:"0.3"}),jsxRuntimeExports.jsx("stop",{offset:"0.66",stopColor:"#EA6100",stopOpacity:0})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint3_linear_927_5781",x1:"12.9428",y1:"4.75004",x2:"14.6132",y2:"12.0569",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#EA6100",stopOpacity:"0.3"}),jsxRuntimeExports.jsx("stop",{offset:"0.66",stopColor:"#EA6100",stopOpacity:0})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint4_linear_927_5781",x1:"2.42441",y1:"7.61591",x2:"8.39032",y2:"4.13068",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#A52714",stopOpacity:"0.6"}),jsxRuntimeExports.jsx("stop",{offset:"0.66",stopColor:"#A52714",stopOpacity:0})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint5_radial_927_5781",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(9.56818 5.44891) scale(9.55455)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#3E2723",stopOpacity:"0.2"}),jsxRuntimeExports.jsx("stop",{offset:1,stopColor:"#3E2723",stopOpacity:0})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint6_linear_927_5781",x1:"11.6932",y1:"17.7839",x2:"5.06136",y2:"13.8976",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#055524",stopOpacity:"0.4"}),jsxRuntimeExports.jsx("stop",{offset:"0.33",stopColor:"#055524",stopOpacity:0})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint7_radial_927_5781",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(1.57975 4.60463) scale(8.86818)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#3E2723",stopOpacity:"0.2"}),jsxRuntimeExports.jsx("stop",{offset:1,stopColor:"#3E2723",stopOpacity:0})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint8_radial_927_5781",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(9.97775 10.0157) scale(9.98523)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#263238",stopOpacity:"0.2"}),jsxRuntimeExports.jsx("stop",{offset:1,stopColor:"#263238",stopOpacity:0})]}),jsxRuntimeExports.jsx("clipPath",{id:"clip0_927_5781",children:jsxRuntimeExports.jsx("rect",{width:20,height:20,rx:10,fill:"white"})})]})]}),FireFox=jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsxs("g",{clipPath:"url(#clip0_927_5847)",children:[jsxRuntimeExports.jsx("path",{d:"M19.011 6.71023C18.5898 5.69685 17.7355 4.60269 17.0665 4.25681C17.5436 5.18063 17.8747 6.17276 18.0481 7.19792L18.0499 7.21417C16.954 4.48315 15.0963 3.38023 13.5782 0.981835C13.5014 0.860539 13.4246 0.738994 13.3498 0.610696C13.3071 0.537418 13.2728 0.471393 13.2431 0.410621C13.1801 0.288713 13.1316 0.159878 13.0985 0.0267267C13.0985 0.0205825 13.0963 0.0146369 13.0923 0.0100242C13.0882 0.00541151 13.0826 0.00245454 13.0765 0.00171737C13.0705 7.85858e-05 13.0642 7.85858e-05 13.0582 0.00171737C13.057 0.00171737 13.055 0.00396821 13.0535 0.0044684C13.052 0.00496859 13.0487 0.00721943 13.0465 0.00821981L13.0502 0.00171737C10.6156 1.42725 9.78901 4.06574 9.71399 5.38624C8.74136 5.45292 7.81141 5.81121 7.04549 6.41437C6.96561 6.34671 6.88212 6.28343 6.79539 6.2248C6.57456 5.45174 6.56514 4.6336 6.76813 3.85566C5.87401 4.28877 5.07954 4.90279 4.43501 5.65884H4.43051C4.04636 5.17191 4.07337 3.5663 4.09538 3.23093C3.98174 3.2766 3.87326 3.33419 3.77176 3.40274C3.43264 3.64477 3.11562 3.91635 2.8244 4.2143C2.49255 4.55075 2.18946 4.91441 1.91831 5.30146V5.30296V5.3012C1.29521 6.18444 0.853213 7.18234 0.617826 8.23731L0.604821 8.30133C0.586564 8.38661 0.52079 8.81377 0.509535 8.90656C0.509535 8.91381 0.508035 8.92056 0.507285 8.92781C0.42244 9.36882 0.369864 9.81542 0.349976 10.2641V10.3141C0.354259 12.7396 1.26772 15.0754 2.91002 16.8604C4.55233 18.6454 6.80415 19.7498 9.22094 19.9556C11.6377 20.1615 14.0439 19.4538 15.9644 17.9723C17.8849 16.4908 19.1803 14.3431 19.5947 11.9532C19.6109 11.8282 19.6242 11.7044 19.6387 11.5781C19.8384 9.92791 19.6222 8.25404 19.01 6.70873L19.011 6.71023ZM7.83928 14.2981C7.88455 14.3198 7.92707 14.3433 7.97358 14.3641L7.98034 14.3684C7.93332 14.3458 7.8863 14.3224 7.83928 14.2981ZM18.0501 7.21692V7.20767L18.0519 7.21792L18.0501 7.21692Z",fill:"url(#paint0_linear_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M19.0109 6.71026C18.5898 5.69688 17.7354 4.60272 17.0664 4.25684C17.5435 5.18066 17.8746 6.17278 18.0481 7.19794V7.20719L18.0498 7.21745C18.797 9.35551 18.689 11.6997 17.7482 13.7599C16.6373 16.1435 13.9493 18.5867 9.7402 18.4667C5.19349 18.3379 1.18699 14.9629 0.439211 10.5437C0.30291 9.84668 0.439211 9.4933 0.507737 8.92684C0.414265 9.36685 0.362102 9.81463 0.351929 10.2643V10.3144C0.356212 12.7399 1.26967 15.0757 2.91198 16.8607C4.55429 18.6456 6.8061 19.7501 9.2229 19.9559C11.6397 20.1617 14.0458 19.4541 15.9664 17.9725C17.8869 16.491 19.1822 14.3434 19.5966 11.9535C19.6129 11.8284 19.6262 11.7046 19.6407 11.5783C19.8403 9.92819 19.6242 8.25431 19.0119 6.70901L19.0109 6.71026Z",fill:"url(#paint1_radial_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M19.0109 6.71026C18.5898 5.69688 17.7354 4.60272 17.0664 4.25684C17.5435 5.18066 17.8746 6.17278 18.0481 7.19794V7.20719L18.0498 7.21745C18.797 9.35551 18.689 11.6997 17.7482 13.7599C16.6373 16.1435 13.9493 18.5867 9.7402 18.4667C5.19349 18.3379 1.18699 14.9629 0.439211 10.5437C0.30291 9.84668 0.439211 9.4933 0.507737 8.92684C0.414265 9.36685 0.362102 9.81463 0.351929 10.2643V10.3144C0.356212 12.7399 1.26967 15.0757 2.91198 16.8607C4.55429 18.6456 6.8061 19.7501 9.2229 19.9559C11.6397 20.1617 14.0458 19.4541 15.9664 17.9725C17.8869 16.491 19.1822 14.3434 19.5966 11.9535C19.6129 11.8284 19.6262 11.7046 19.6407 11.5783C19.8403 9.92819 19.6242 8.25431 19.0119 6.70901L19.0109 6.71026Z",fill:"url(#paint2_radial_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M14.2993 7.84794C14.3203 7.8627 14.3398 7.87745 14.3595 7.89221C14.1161 7.46047 13.813 7.06519 13.4592 6.71802C10.4456 3.70439 12.6696 0.18557 13.0445 0.00550206L13.0483 0C10.6136 1.42553 9.78706 4.06402 9.71204 5.38452C9.82508 5.37677 9.93712 5.36726 10.0527 5.36726C10.9164 5.36893 11.7644 5.59929 12.5103 6.03492C13.2562 6.47055 13.8734 7.09592 14.2993 7.84744V7.84794Z",fill:"url(#paint3_radial_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M10.0577 8.45061C10.0417 8.6917 9.18992 9.52326 8.89206 9.52326C6.13602 9.52326 5.68835 11.1906 5.68835 11.1906C5.8104 12.5947 6.78877 13.7516 7.97146 14.3618C8.02548 14.3898 8.08025 14.4151 8.13502 14.4399C8.22989 14.4819 8.32476 14.5207 8.41963 14.5564C8.82553 14.7 9.25065 14.7821 9.68085 14.7997C14.5127 15.0263 15.448 9.02257 11.9615 7.27942C12.7839 7.1724 13.6168 7.37463 14.2986 7.84688C13.8727 7.09536 13.2555 6.46999 12.5096 6.03436C11.7637 5.59873 10.9158 5.36837 10.052 5.3667C9.93695 5.3667 9.82441 5.3762 9.71136 5.38396C8.73874 5.45064 7.80879 5.80893 7.04286 6.41209C7.19067 6.53714 7.35748 6.7042 7.70886 7.05058C8.36661 7.69857 10.0535 8.36983 10.0572 8.44861L10.0577 8.45061Z",fill:"url(#paint4_radial_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M10.0577 8.45061C10.0417 8.6917 9.18992 9.52326 8.89206 9.52326C6.13602 9.52326 5.68835 11.1906 5.68835 11.1906C5.8104 12.5947 6.78877 13.7516 7.97146 14.3618C8.02548 14.3898 8.08025 14.4151 8.13502 14.4399C8.22989 14.4819 8.32476 14.5207 8.41963 14.5564C8.82553 14.7 9.25065 14.7821 9.68085 14.7997C14.5127 15.0263 15.448 9.02257 11.9615 7.27942C12.7839 7.1724 13.6168 7.37463 14.2986 7.84688C13.8727 7.09536 13.2555 6.46999 12.5096 6.03436C11.7637 5.59873 10.9158 5.36837 10.052 5.3667C9.93695 5.3667 9.82441 5.3762 9.71136 5.38396C8.73874 5.45064 7.80879 5.80893 7.04286 6.41209C7.19067 6.53714 7.35748 6.7042 7.70886 7.05058C8.36661 7.69857 10.0535 8.36983 10.0572 8.44861L10.0577 8.45061Z",fill:"url(#paint5_radial_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M6.59134 6.0923C6.66987 6.14231 6.73464 6.18583 6.79141 6.2251C6.57058 5.45204 6.56117 4.63389 6.76415 3.85596C5.87003 4.28907 5.07556 4.90308 4.43103 5.65913C4.4783 5.65788 5.88432 5.63262 6.59134 6.0923Z",fill:"url(#paint6_radial_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M0.437567 10.5439C1.1856 14.963 5.19185 18.3393 9.73855 18.4668C13.9476 18.5859 16.6361 16.1425 17.7466 13.7601C18.6873 11.6998 18.7954 9.35569 18.0482 7.21762V7.20837C18.0482 7.20111 18.0467 7.19686 18.0482 7.19911L18.0499 7.21537C18.3938 9.46046 17.2519 11.6345 15.4665 13.1076L15.4609 13.1201C11.9821 15.9536 8.6534 14.8292 7.98064 14.3706C7.93363 14.348 7.88661 14.3246 7.83959 14.3003C5.81158 13.3309 4.97352 11.4842 5.15358 9.89862C4.67218 9.90573 4.19905 9.77307 3.79151 9.51672C3.38397 9.26038 3.05952 8.89134 2.85747 8.45433C3.38987 8.1282 3.99692 7.94382 4.62077 7.91878C5.24461 7.89374 5.86448 8.02887 6.42131 8.31128C7.56906 8.83225 8.87507 8.8836 10.0602 8.45433C10.0564 8.37555 8.36954 7.70405 7.71179 7.05631C7.36041 6.70993 7.1936 6.54312 7.04579 6.41782C6.96591 6.35016 6.88243 6.28688 6.7957 6.22825C6.73818 6.18898 6.6734 6.14647 6.59562 6.09545C5.88861 5.63578 4.48258 5.66104 4.43607 5.66229H4.43156C4.04742 5.17535 4.07443 3.56975 4.09644 3.23438C3.9828 3.28005 3.87431 3.33764 3.77282 3.40619C3.4337 3.64822 3.11667 3.91979 2.82546 4.21774C2.49242 4.55325 2.18808 4.91607 1.91562 5.3024V5.3039V5.30215C1.29252 6.18539 0.850521 7.18329 0.615133 8.23825C0.610381 8.25801 0.266002 9.76357 0.435816 10.5444L0.437567 10.5439Z",fill:"url(#paint7_radial_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M13.459 6.71761C13.8128 7.06516 14.1159 7.46087 14.3593 7.89305C14.4126 7.93331 14.4624 7.97333 14.5046 8.01209C16.7022 10.0378 15.5508 12.9014 15.465 13.104C17.2502 11.6332 18.3911 9.45763 18.0485 7.21179C16.952 4.47826 15.0923 3.37535 13.5768 0.976952C13.5 0.855657 13.4232 0.734111 13.3484 0.605813C13.3057 0.532535 13.2714 0.466511 13.2417 0.405738C13.1787 0.283831 13.1302 0.154995 13.0971 0.0218439C13.0971 0.0156997 13.0949 0.0097541 13.0909 0.0051414C13.0868 0.000528701 13.0812 -0.00242828 13.0751 -0.00316545C13.0691 -0.00480423 13.0628 -0.00480423 13.0568 -0.00316545C13.0556 -0.00316545 13.0536 -0.000914601 13.0521 -0.000414413C13.0506 8.57743e-05 13.0473 0.00233662 13.0451 0.00333699C12.6702 0.181154 10.4466 3.70222 13.4602 6.71335L13.459 6.71761Z",fill:"url(#paint8_radial_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M14.5043 8.01315C14.462 7.97439 14.4122 7.93437 14.359 7.8941C14.3392 7.87935 14.3197 7.86459 14.2987 7.84984C13.6169 7.37759 12.784 7.17536 11.9616 7.28238C15.4479 9.02553 14.5125 15.0278 9.68095 14.8027C9.25075 14.785 8.82562 14.703 8.41973 14.5594C8.32486 14.5238 8.22999 14.485 8.13512 14.4428C8.08035 14.4178 8.02558 14.3928 7.97156 14.3648L7.97831 14.369C8.65206 14.829 11.9798 15.9526 15.4586 13.1186L15.4641 13.1061C15.5509 12.9035 16.7023 10.0399 14.5038 8.01415L14.5043 8.01315Z",fill:"url(#paint9_radial_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M5.68842 11.1892C5.68842 11.1892 6.13583 9.52179 8.89212 9.52179C9.18998 9.52179 10.0425 8.69023 10.0578 8.44914C8.8727 8.8784 7.56669 8.82706 6.41894 8.30608C5.86211 8.02367 5.24224 7.88855 4.61839 7.91359C3.99455 7.93863 3.3875 8.123 2.8551 8.44914C3.05715 8.88615 3.3816 9.25518 3.78914 9.51153C4.19668 9.76787 4.66981 9.90053 5.15121 9.89343C4.97165 11.4783 5.80946 13.3247 7.83722 14.2951C7.88249 14.3168 7.925 14.3403 7.97152 14.3611C6.78783 13.7496 5.81046 12.5932 5.68842 11.1899V11.1892Z",fill:"url(#paint10_radial_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M19.0112 6.71023C18.59 5.69685 17.7357 4.60269 17.0667 4.25681C17.5438 5.18063 17.8749 6.17276 18.0483 7.19792L18.0501 7.21417C16.9542 4.48315 15.0965 3.38023 13.5784 0.981835C13.5016 0.860539 13.4249 0.738994 13.3501 0.610696C13.3073 0.537418 13.2731 0.471393 13.2433 0.410621C13.1803 0.288713 13.1318 0.159878 13.0987 0.0267267C13.0988 0.0205825 13.0966 0.0146369 13.0925 0.0100242C13.0884 0.00541151 13.0828 0.00245454 13.0767 0.00171737C13.0708 7.85859e-05 13.0644 7.85859e-05 13.0585 0.00171737C13.0572 0.00171737 13.0552 0.00396821 13.0537 0.0044684C13.0522 0.00496859 13.049 0.00721943 13.0467 0.00821981L13.0505 0.00171737C10.6158 1.42725 9.78925 4.06574 9.71422 5.38624C9.82726 5.37848 9.9393 5.36898 10.0548 5.36898C10.9186 5.37065 11.7666 5.60101 12.5125 6.03664C13.2584 6.47227 13.8756 7.09764 14.3014 7.84916C13.6196 7.37691 12.7868 7.17468 11.9643 7.2817C15.4506 9.02485 14.5153 15.0271 9.68371 14.802C9.25351 14.7843 8.82838 14.7023 8.42248 14.5587C8.32761 14.5232 8.23275 14.4843 8.13788 14.4421C8.08311 14.4171 8.02834 14.3921 7.97432 14.3641L7.98107 14.3684C7.93405 14.3458 7.88703 14.3224 7.84002 14.2981C7.88528 14.3198 7.9278 14.3433 7.97432 14.3641C6.79062 13.7524 5.81326 12.5959 5.69121 11.1929C5.69121 11.1929 6.13863 9.52554 8.89491 9.52554C9.19277 9.52554 10.0453 8.69398 10.0606 8.45289C10.0568 8.37411 8.36996 7.7026 7.71222 7.05486C7.36084 6.70848 7.19402 6.54167 7.04622 6.41637C6.96634 6.34871 6.88285 6.28543 6.79612 6.2268C6.57529 5.45374 6.56588 4.6356 6.76886 3.85766C5.87474 4.29077 5.08027 4.90479 4.43574 5.66084H4.43124C4.04709 5.17391 4.0741 3.5683 4.09611 3.23293C3.98247 3.2786 3.87399 3.33619 3.77249 3.40474C3.43337 3.64677 3.11635 3.91835 2.82514 4.2163C2.49328 4.55275 2.19019 4.91641 1.91905 5.30345V5.30496V5.30321C1.29595 6.18644 0.853946 7.18434 0.618558 8.23931L0.605554 8.30333C0.587297 8.38861 0.505516 8.82177 0.493762 8.91481C0.418959 9.36194 0.371188 9.81318 0.350708 10.2661V10.3161C0.354992 12.7416 1.26845 15.0774 2.91076 16.8624C4.55307 18.6474 6.80488 19.7518 9.22168 19.9576C11.6385 20.1635 14.0446 19.4558 15.9652 17.9743C17.8857 16.4928 19.181 14.3451 19.5954 11.9552C19.6117 11.8302 19.6249 11.7064 19.6394 11.5801C19.8391 9.92991 19.623 8.25604 19.0107 6.71073L19.0112 6.71023ZM18.0496 7.20817L18.0513 7.21842L18.0496 7.20817Z",fill:"url(#paint11_linear_927_5847)"})]}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_927_5847",x1:"17.728",y1:"3.09786",x2:"1.63621",y2:"18.6237",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{offset:"0.048",stopColor:"#FFF44F"}),jsxRuntimeExports.jsx("stop",{offset:"0.111",stopColor:"#FFE847"}),jsxRuntimeExports.jsx("stop",{offset:"0.225",stopColor:"#FFC830"}),jsxRuntimeExports.jsx("stop",{offset:"0.368",stopColor:"#FF980E"}),jsxRuntimeExports.jsx("stop",{offset:"0.401",stopColor:"#FF8B16"}),jsxRuntimeExports.jsx("stop",{offset:"0.462",stopColor:"#FF672A"}),jsxRuntimeExports.jsx("stop",{offset:"0.534",stopColor:"#FF3647"}),jsxRuntimeExports.jsx("stop",{offset:"0.705",stopColor:"#E31587"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint1_radial_927_5847",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(17.1052 2.25108) scale(20.2076)",children:[jsxRuntimeExports.jsx("stop",{offset:"0.129",stopColor:"#FFBD4F"}),jsxRuntimeExports.jsx("stop",{offset:"0.186",stopColor:"#FFAC31"}),jsxRuntimeExports.jsx("stop",{offset:"0.247",stopColor:"#FF9D17"}),jsxRuntimeExports.jsx("stop",{offset:"0.283",stopColor:"#FF980E"}),jsxRuntimeExports.jsx("stop",{offset:"0.403",stopColor:"#FF563B"}),jsxRuntimeExports.jsx("stop",{offset:"0.467",stopColor:"#FF3750"}),jsxRuntimeExports.jsx("stop",{offset:"0.71",stopColor:"#F5156C"}),jsxRuntimeExports.jsx("stop",{offset:"0.782",stopColor:"#EB0878"}),jsxRuntimeExports.jsx("stop",{offset:"0.86",stopColor:"#E50080"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint2_radial_927_5847",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(9.6024 10.5042) scale(20.2076)",children:[jsxRuntimeExports.jsx("stop",{offset:"0.3",stopColor:"#960E18"}),jsxRuntimeExports.jsx("stop",{offset:"0.351",stopColor:"#B11927",stopOpacity:"0.74"}),jsxRuntimeExports.jsx("stop",{offset:"0.435",stopColor:"#DB293D",stopOpacity:"0.343"}),jsxRuntimeExports.jsx("stop",{offset:"0.497",stopColor:"#F5334B",stopOpacity:"0.094"}),jsxRuntimeExports.jsx("stop",{offset:"0.53",stopColor:"#FF3750",stopOpacity:0})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint3_radial_927_5847",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(12.1034 -2.25084) scale(14.638)",children:[jsxRuntimeExports.jsx("stop",{offset:"0.132",stopColor:"#FFF44F"}),jsxRuntimeExports.jsx("stop",{offset:"0.252",stopColor:"#FFDC3E"}),jsxRuntimeExports.jsx("stop",{offset:"0.506",stopColor:"#FF9D12"}),jsxRuntimeExports.jsx("stop",{offset:"0.526",stopColor:"#FF980E"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint4_radial_927_5847",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(7.35173 15.7558) scale(9.62111)",children:[jsxRuntimeExports.jsx("stop",{offset:"0.353",stopColor:"#3A8EE6"}),jsxRuntimeExports.jsx("stop",{offset:"0.472",stopColor:"#5C79F0"}),jsxRuntimeExports.jsx("stop",{offset:"0.669",stopColor:"#9059FF"}),jsxRuntimeExports.jsx("stop",{offset:1,stopColor:"#C139E6"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint5_radial_927_5847",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(10.5799 8.76923) rotate(-13.5916) scale(5.10194 5.97309)",children:[jsxRuntimeExports.jsx("stop",{offset:"0.206",stopColor:"#9059FF",stopOpacity:0}),jsxRuntimeExports.jsx("stop",{offset:"0.278",stopColor:"#8C4FF3",stopOpacity:"0.064"}),jsxRuntimeExports.jsx("stop",{offset:"0.747",stopColor:"#7716A8",stopOpacity:"0.45"}),jsxRuntimeExports.jsx("stop",{offset:"0.975",stopColor:"#6E008B",stopOpacity:"0.6"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint6_radial_927_5847",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(9.35238 1.50057) scale(6.9226)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#FFE226"}),jsxRuntimeExports.jsx("stop",{offset:"0.121",stopColor:"#FFDB27"}),jsxRuntimeExports.jsx("stop",{offset:"0.295",stopColor:"#FFC82A"}),jsxRuntimeExports.jsx("stop",{offset:"0.502",stopColor:"#FFA930"}),jsxRuntimeExports.jsx("stop",{offset:"0.732",stopColor:"#FF7E37"}),jsxRuntimeExports.jsx("stop",{offset:"0.792",stopColor:"#FF7139"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint7_radial_927_5847",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(14.8545 -3.00121) scale(29.5361)",children:[jsxRuntimeExports.jsx("stop",{offset:"0.113",stopColor:"#FFF44F"}),jsxRuntimeExports.jsx("stop",{offset:"0.456",stopColor:"#FF980E"}),jsxRuntimeExports.jsx("stop",{offset:"0.622",stopColor:"#FF5634"}),jsxRuntimeExports.jsx("stop",{offset:"0.716",stopColor:"#FF3647"}),jsxRuntimeExports.jsx("stop",{offset:"0.904",stopColor:"#E31587"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint8_radial_927_5847",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(12.3996 -1.36343) rotate(83.976) scale(21.6445 14.2051)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#FFF44F"}),jsxRuntimeExports.jsx("stop",{offset:"0.06",stopColor:"#FFE847"}),jsxRuntimeExports.jsx("stop",{offset:"0.168",stopColor:"#FFC830"}),jsxRuntimeExports.jsx("stop",{offset:"0.304",stopColor:"#FF980E"}),jsxRuntimeExports.jsx("stop",{offset:"0.356",stopColor:"#FF8B16"}),jsxRuntimeExports.jsx("stop",{offset:"0.455",stopColor:"#FF672A"}),jsxRuntimeExports.jsx("stop",{offset:"0.57",stopColor:"#FF3647"}),jsxRuntimeExports.jsx("stop",{offset:"0.737",stopColor:"#E31587"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint9_radial_927_5847",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(9.35233 4.00165) scale(18.4369)",children:[jsxRuntimeExports.jsx("stop",{offset:"0.137",stopColor:"#FFF44F"}),jsxRuntimeExports.jsx("stop",{offset:"0.48",stopColor:"#FF980E"}),jsxRuntimeExports.jsx("stop",{offset:"0.592",stopColor:"#FF5634"}),jsxRuntimeExports.jsx("stop",{offset:"0.655",stopColor:"#FF3647"}),jsxRuntimeExports.jsx("stop",{offset:"0.904",stopColor:"#E31587"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint10_radial_927_5847",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(14.1041 5.00184) scale(20.1801)",children:[jsxRuntimeExports.jsx("stop",{offset:"0.094",stopColor:"#FFF44F"}),jsxRuntimeExports.jsx("stop",{offset:"0.231",stopColor:"#FFE141"}),jsxRuntimeExports.jsx("stop",{offset:"0.509",stopColor:"#FFAF1E"}),jsxRuntimeExports.jsx("stop",{offset:"0.626",stopColor:"#FF980E"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint11_linear_927_5847",x1:"17.5331",y1:"3.01533",x2:"3.84302",y2:"16.708",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{offset:"0.167",stopColor:"#FFF44F",stopOpacity:"0.8"}),jsxRuntimeExports.jsx("stop",{offset:"0.266",stopColor:"#FFF44F",stopOpacity:"0.634"}),jsxRuntimeExports.jsx("stop",{offset:"0.489",stopColor:"#FFF44F",stopOpacity:"0.217"}),jsxRuntimeExports.jsx("stop",{offset:"0.6",stopColor:"#FFF44F",stopOpacity:0})]}),jsxRuntimeExports.jsx("clipPath",{id:"clip0_927_5847",children:jsxRuntimeExports.jsx("rect",{width:20,height:20,fill:"white"})})]})]}),Brave=jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{d:"M17.2924 5.22043L17.7256 4.15905L16.4982 2.8883C15.8339 2.22404 14.4187 2.61393 14.4187 2.61393L12.8158 0.794434H7.16242L5.55231 2.62115C5.55231 2.62115 4.13715 2.23848 3.47289 2.8883L2.24545 4.15183L2.67866 5.21321L2.13715 6.78721L3.9422 13.6681C4.31765 15.141 4.57036 15.7114 5.63173 16.4623L8.93137 18.7006C9.24906 18.8955 9.63895 19.2349 9.99274 19.2349C10.3465 19.2349 10.7364 18.8955 11.0541 18.7006L14.3538 16.4623C15.4151 15.7114 15.6678 15.141 16.0433 13.6681L17.8483 6.78721L17.2924 5.22043Z",fill:"url(#paint0_linear_927_5861)"}),jsxRuntimeExports.jsx("path",{d:"M13.9711 3.78343C13.9711 3.78343 16.0433 6.28884 16.0433 6.81592C16.0433 7.35744 15.7834 7.49462 15.5234 7.77621L13.9711 9.43686C13.8267 9.58126 13.5162 9.82675 13.6967 10.2527C13.8772 10.686 14.1299 11.2203 13.8411 11.769C13.5523 12.3249 13.0469 12.6932 12.722 12.6354C12.2387 12.4786 11.7777 12.2602 11.3502 11.9856C11.0758 11.8051 10.1949 11.0758 10.1949 10.7943C10.1949 10.5127 11.1047 10 11.278 9.89895C11.444 9.78343 12.2166 9.33577 12.231 9.16249C12.2455 8.9892 12.2455 8.94588 12.0144 8.51267C11.7834 8.07946 11.379 7.50184 11.4368 7.12639C11.509 6.75094 12.1588 6.54877 12.6426 6.36827L14.1372 5.80509C14.2527 5.74733 14.2238 5.69679 13.8772 5.66068C13.5307 5.6318 12.5559 5.50184 12.1155 5.62458C11.6751 5.74733 10.9386 5.93505 10.8664 6.03614C10.8086 6.13722 10.7509 6.13722 10.8159 6.48379L11.2346 8.75816C11.2635 9.04697 11.3213 9.24191 11.018 9.31411C10.7003 9.38632 10.1733 9.50906 9.99276 9.50906C9.81225 9.50906 9.27796 9.38632 8.96749 9.31411C8.65702 9.24191 8.71478 9.04697 8.75088 8.75816C8.77976 8.46935 9.09745 6.82314 9.16243 6.48379C9.23464 6.13722 9.16965 6.13722 9.11189 6.03614C9.03969 5.93505 8.29601 5.74733 7.85558 5.62458C7.42236 5.50184 6.44041 5.6318 6.09384 5.66791C5.74727 5.69679 5.71839 5.74011 5.83391 5.81231L7.3285 6.36827C7.80503 6.54877 8.46929 6.75094 8.53428 7.12639C8.60648 7.50906 8.19493 8.07946 7.95666 8.51267C7.71839 8.94588 7.72561 8.9892 7.74005 9.16249C7.75449 9.33577 8.53428 9.78343 8.69312 9.89895C8.86641 10.0073 9.77615 10.5127 9.77615 10.7943C9.77615 11.0758 8.91695 11.8051 8.62814 11.9856C8.20063 12.2602 7.73957 12.4786 7.2563 12.6354C6.93139 12.6932 6.42597 12.3249 6.12994 11.769C5.84113 11.2203 6.10106 10.686 6.27435 10.2527C6.45485 9.81953 6.1516 9.58848 5.99998 9.43686L4.44763 7.77621C4.19493 7.50906 3.935 7.36466 3.935 6.83036C3.935 6.29606 6.0072 3.79787 6.0072 3.79787L7.97832 4.11556C8.20937 4.11556 8.722 3.92061 9.19132 3.75455C9.66063 3.61014 9.98554 3.5957 9.98554 3.5957C9.98554 3.5957 10.3032 3.5957 10.7798 3.75455C11.2563 3.91339 11.7617 4.11556 11.9928 4.11556C12.231 4.11556 13.9783 3.77621 13.9783 3.77621L13.9711 3.78343ZM12.4188 13.3719C12.5487 13.4441 12.4693 13.6029 12.3465 13.6896L10.5126 15.1192C10.3682 15.2636 10.1372 15.4802 9.98554 15.4802C9.83391 15.4802 9.61009 15.2636 9.45846 15.1192C8.8506 14.6351 8.23683 14.1586 7.61731 13.6896C7.50178 13.6029 7.42236 13.4513 7.54511 13.3719L8.62814 12.7943C9.05864 12.5665 9.51417 12.3897 9.98554 12.2672C10.0938 12.2672 10.7798 12.5127 11.3357 12.7943L12.4188 13.3719Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M14.4332 2.62115L12.8159 0.794434H7.16243L5.55232 2.62115C5.55232 2.62115 4.13716 2.23848 3.4729 2.8883C3.4729 2.8883 5.35016 2.72223 5.99998 3.77638L7.99276 4.11573C8.2238 4.11573 8.73644 3.92079 9.20575 3.75472C9.67507 3.61032 9.99998 3.59588 9.99998 3.59588C9.99998 3.59588 10.3177 3.59588 10.7942 3.75472C11.2707 3.91357 11.7761 4.11573 12.0072 4.11573C12.2455 4.11573 13.9928 3.77638 13.9928 3.77638C14.6426 2.72223 16.5198 2.8883 16.5198 2.8883C15.8556 2.22404 14.4404 2.61393 14.4404 2.61393",fill:"url(#paint1_linear_927_5861)"}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_927_5861",x1:"2.13715",y1:"10.1991",x2:"17.8483",y2:"10.1991",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{offset:"0.4",stopColor:"#FF5500"}),jsxRuntimeExports.jsx("stop",{offset:"0.6",stopColor:"#FF2000"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint1_linear_927_5861",x1:"3.73384",y1:"2.4883",x2:"16.5198",y2:"2.4883",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#FF452A"}),jsxRuntimeExports.jsx("stop",{offset:1,stopColor:"#FF2000"})]})]})]}),Edge=jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsxs("g",{clipPath:"url(#clip0_927_5865)",children:[jsxRuntimeExports.jsx("path",{d:"M18.0547 14.8828C17.7865 15.0222 17.5099 15.1448 17.2266 15.25C16.3293 15.584 15.3792 15.7533 14.4219 15.75C10.7266 15.75 7.50781 13.2109 7.50781 9.94531C7.51262 9.50803 7.63385 9.07993 7.85905 8.70506C8.08424 8.33019 8.40526 8.0221 8.78906 7.8125C5.44531 7.95312 4.58594 11.4375 4.58594 13.4766C4.58594 19.2578 9.90625 19.8359 11.0547 19.8359C11.6719 19.8359 12.6016 19.6562 13.1641 19.4766L13.2656 19.4453C15.4183 18.7014 17.2534 17.2465 18.4688 15.3203C18.5041 15.2618 18.5192 15.1933 18.5119 15.1253C18.5046 15.0574 18.4752 14.9937 18.4282 14.944C18.3812 14.8944 18.3192 14.8615 18.2518 14.8505C18.1843 14.8394 18.1151 14.8508 18.0547 14.8828Z",fill:"url(#paint0_linear_927_5865)"}),jsxRuntimeExports.jsx("path",{opacity:"0.35",d:"M18.0547 14.8828C17.7865 15.0222 17.5099 15.1448 17.2266 15.25C16.3293 15.584 15.3792 15.7533 14.4219 15.75C10.7266 15.75 7.50781 13.2109 7.50781 9.94531C7.51262 9.50803 7.63385 9.07993 7.85905 8.70506C8.08424 8.33019 8.40526 8.0221 8.78906 7.8125C5.44531 7.95312 4.58594 11.4375 4.58594 13.4766C4.58594 19.2578 9.90625 19.8359 11.0547 19.8359C11.6719 19.8359 12.6016 19.6562 13.1641 19.4766L13.2656 19.4453C15.4183 18.7014 17.2534 17.2465 18.4688 15.3203C18.5041 15.2618 18.5192 15.1933 18.5119 15.1253C18.5046 15.0574 18.4752 14.9937 18.4282 14.944C18.3812 14.8944 18.3192 14.8615 18.2518 14.8505C18.1843 14.8394 18.1151 14.8508 18.0547 14.8828Z",fill:"url(#paint1_radial_927_5865)"}),jsxRuntimeExports.jsx("path",{d:"M8.2578 18.8516C7.56239 18.4196 6.95961 17.854 6.48436 17.1875C5.94166 16.4447 5.56809 15.5921 5.38987 14.6896C5.21165 13.787 5.23311 12.8565 5.45272 11.9631C5.67234 11.0697 6.08479 10.2353 6.66115 9.51826C7.23751 8.80123 7.96379 8.21903 8.78905 7.8125C9.03905 7.69531 9.45311 7.49219 10.0078 7.5C10.3981 7.50302 10.7824 7.59627 11.1308 7.77245C11.4791 7.94864 11.7819 8.20299 12.0156 8.51562C12.3299 8.93835 12.5023 9.4498 12.5078 9.97656C12.5078 9.96094 14.4219 3.75781 6.2578 3.75781C2.82811 3.75781 0.00780015 7.00781 0.00780015 9.86719C-0.00584162 11.3776 0.317079 12.8721 0.953112 14.2422C1.99473 16.4602 3.81447 18.2185 6.06689 19.1834C8.3193 20.1483 10.8476 20.2526 13.1719 19.4766C12.3576 19.7337 11.4972 19.811 10.6501 19.7031C9.80297 19.5952 8.98941 19.3047 8.26561 18.8516H8.2578Z",fill:"url(#paint2_linear_927_5865)"}),jsxRuntimeExports.jsx("path",{opacity:"0.41",d:"M8.2578 18.8516C7.56239 18.4196 6.95961 17.854 6.48436 17.1875C5.94166 16.4447 5.56809 15.5921 5.38987 14.6896C5.21165 13.787 5.23311 12.8565 5.45272 11.9631C5.67234 11.0697 6.08479 10.2353 6.66115 9.51826C7.23751 8.80123 7.96379 8.21903 8.78905 7.8125C9.03905 7.69531 9.45311 7.49219 10.0078 7.5C10.3981 7.50302 10.7824 7.59627 11.1308 7.77245C11.4791 7.94864 11.7819 8.20299 12.0156 8.51562C12.3299 8.93835 12.5023 9.4498 12.5078 9.97656C12.5078 9.96094 14.4219 3.75781 6.2578 3.75781C2.82811 3.75781 0.00780015 7.00781 0.00780015 9.86719C-0.00584162 11.3776 0.317079 12.8721 0.953112 14.2422C1.99473 16.4602 3.81447 18.2185 6.06689 19.1834C8.3193 20.1483 10.8476 20.2526 13.1719 19.4766C12.3576 19.7337 11.4972 19.811 10.6501 19.7031C9.80297 19.5952 8.98941 19.3047 8.26561 18.8516H8.2578Z",fill:"url(#paint3_radial_927_5865)"}),jsxRuntimeExports.jsx("path",{d:"M11.9062 11.625C11.8359 11.7031 11.6406 11.8203 11.6406 12.0625C11.6406 12.2656 11.7734 12.4688 12.0156 12.6328C13.1328 13.4141 15.25 13.3047 15.2578 13.3047C16.0907 13.3041 16.9081 13.0802 17.625 12.6562C18.3467 12.2341 18.9456 11.6307 19.3622 10.9057C19.7788 10.1808 19.9986 9.35955 20 8.52344C20.0234 6.77344 19.375 5.60937 19.1172 5.09375C17.4531 1.85937 13.8828 4.89564e-08 10 4.89564e-08C7.37202 -0.00025981 4.84956 1.03398 2.97819 2.87904C1.10682 4.7241 0.0369559 7.23166 0 9.85938C0.0390625 7.00781 2.875 4.70312 6.25 4.70312C6.52344 4.70312 8.08594 4.72656 9.53125 5.48438C10.5466 5.98895 11.3875 6.78627 11.9453 7.77344C12.4219 8.60156 12.5078 9.65625 12.5078 10.0781C12.5078 10.5 12.2969 11.1172 11.8984 11.6328L11.9062 11.625Z",fill:"url(#paint4_radial_927_5865)"}),jsxRuntimeExports.jsx("path",{d:"M11.9062 11.625C11.8359 11.7031 11.6406 11.8203 11.6406 12.0625C11.6406 12.2656 11.7734 12.4688 12.0156 12.6328C13.1328 13.4141 15.25 13.3047 15.2578 13.3047C16.0907 13.3041 16.9081 13.0802 17.625 12.6562C18.3467 12.2341 18.9456 11.6307 19.3622 10.9057C19.7788 10.1808 19.9986 9.35955 20 8.52344C20.0234 6.77344 19.375 5.60937 19.1172 5.09375C17.4531 1.85937 13.8828 4.89564e-08 10 4.89564e-08C7.37202 -0.00025981 4.84956 1.03398 2.97819 2.87904C1.10682 4.7241 0.0369559 7.23166 0 9.85938C0.0390625 7.00781 2.875 4.70312 6.25 4.70312C6.52344 4.70312 8.08594 4.72656 9.53125 5.48438C10.5466 5.98895 11.3875 6.78627 11.9453 7.77344C12.4219 8.60156 12.5078 9.65625 12.5078 10.0781C12.5078 10.5 12.2969 11.1172 11.8984 11.6328L11.9062 11.625Z",fill:"url(#paint5_radial_927_5865)"})]}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_927_5865",x1:"4.58594",y1:"13.8281",x2:"18.5234",y2:"13.8281",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#0C59A4"}),jsxRuntimeExports.jsx("stop",{offset:1,stopColor:"#114A8B"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint1_radial_927_5865",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(12.2813 13.9332) scale(7.45313 7.08047)",children:[jsxRuntimeExports.jsx("stop",{offset:"0.7",stopOpacity:0}),jsxRuntimeExports.jsx("stop",{offset:"0.9",stopOpacity:"0.5"}),jsxRuntimeExports.jsx("stop",{offset:1})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint2_linear_927_5865",x1:"11.9297",y1:"7.78125",x2:"3.23436",y2:"17.2578",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#1B9DE2"}),jsxRuntimeExports.jsx("stop",{offset:"0.2",stopColor:"#1595DF"}),jsxRuntimeExports.jsx("stop",{offset:"0.7",stopColor:"#0680D7"}),jsxRuntimeExports.jsx("stop",{offset:1,stopColor:"#0078D4"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint3_radial_927_5865",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(5.51209 15.5419) rotate(-81.3844) scale(11.202 9.05011)",children:[jsxRuntimeExports.jsx("stop",{offset:"0.8",stopOpacity:0}),jsxRuntimeExports.jsx("stop",{offset:"0.9",stopOpacity:"0.5"}),jsxRuntimeExports.jsx("stop",{offset:1})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint4_radial_927_5865",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(2.02266 3.69656) rotate(92.2906) scale(15.8251 33.7043)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#35C1F1"}),jsxRuntimeExports.jsx("stop",{offset:"0.1",stopColor:"#34C1ED"}),jsxRuntimeExports.jsx("stop",{offset:"0.2",stopColor:"#2FC2DF"}),jsxRuntimeExports.jsx("stop",{offset:"0.3",stopColor:"#2BC3D2"}),jsxRuntimeExports.jsx("stop",{offset:"0.7",stopColor:"#36C752"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint5_radial_927_5865",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(18.7547 6.03906) rotate(73.7398) scale(7.60156 6.18159)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#66EB6E"}),jsxRuntimeExports.jsx("stop",{offset:1,stopColor:"#66EB6E",stopOpacity:0})]}),jsxRuntimeExports.jsx("clipPath",{id:"clip0_927_5865",children:jsxRuntimeExports.jsx("rect",{width:20,height:20,fill:"white"})})]})]});var browsers={Chrome,FireFox,Brave,Edge};const BrowserIcon=React.forwardRef(({browser:et},o)=>{const tt=et??detectBrowser();let rt;switch(tt){case"chrome":rt=browsers.Chrome;break;case"firefox":rt=browsers.FireFox;break;case"edge":rt=browsers.Edge;break}return rt?jsxRuntimeExports.jsx(BrowserIconContainer,{children:rt}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})});BrowserIcon.displayName="BrowserIcon";const LogoContainer$3=styled(motion.div)`
z-index: 4;
position: relative;
width: 100px;
height: 100px;
svg {
z-index: 3;
position: relative;
display: block;
}
`,Logo=styled(motion.div)`
z-index: 2;
position: absolute;
overflow: hidden;
inset: 6px;
border-radius: 50px;
background: var(--ck-body-background);
display: flex;
align-items: center;
justify-content: center;
svg,
img {
pointer-events: none;
display: block;
margin: 0 auto;
width: 100%;
height: 100%;
${et=>et.$small&&Ae`
width: 85%;
height: 85%;
`}
}
`,SpinnerContainer=styled(motion.div)`
position: absolute;
inset: -5px;
`,ExpiringSpinner=styled(motion.div)`
pointer-events: none;
user-select: none;
z-index: 1;
position: absolute;
inset: -25%;
background: var(--ck-body-background);
div:first-child {
position: absolute;
left: 50%;
right: 0;
top: 0;
bottom: 0;
overflow: hidden;
&:before {
position: absolute;
content: '';
inset: 0;
background: var(--ck-spinner-color);
transform-origin: 0% 50%;
animation: rotateExpiringSpinner 5000ms ease-in both;
}
}
div:last-child {
position: absolute;
left: 0;
right: 50%;
top: 0;
bottom: 0;
overflow: hidden;
&:before {
position: absolute;
content: '';
inset: 0;
background: var(--ck-spinner-color);
transform-origin: 100% 50%;
animation: rotateExpiringSpinner 5000ms ease-out 5000ms both;
}
}
@keyframes rotateExpiringSpinner {
0% {
transform: rotate(-180deg);
}
100% {
transform: rotate(0deg);
}
}
`,Spinner$2=styled(motion.div)`
pointer-events: none;
user-select: none;
z-index: 1;
position: absolute;
inset: 0;
svg {
display: block;
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
animation: rotateSpinner 1200ms linear infinite;
}
@keyframes rotateSpinner {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
`,CircleSpinner=({logo:et,smallLogo:o,connecting:tt=!0,unavailable:rt=!1,countdown:nt=!1})=>jsxRuntimeExports.jsxs(LogoContainer$3,{transition:{duration:.5,ease:[.175,.885,.32,.98]},children:[jsxRuntimeExports.jsx(Logo,{$small:!rt&&o,style:rt?{borderRadius:0}:void 0,children:et}),jsxRuntimeExports.jsx(SpinnerContainer,{children:jsxRuntimeExports.jsxs(AnimatePresence,{children:[tt&&jsxRuntimeExports.jsx(Spinner$2,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:nt?1:0}},children:jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"102",height:"102",viewBox:"0 0 102 102",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{d:"M52 100C24.3858 100 2 77.6142 2 50",stroke:"url(#paint0_linear_1943_4139)",strokeWidth:"3.5",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_1943_4139",x1:"2",y1:"48.5",x2:"53",y2:"100",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-spinner-color)"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"var(--ck-spinner-color)",stopOpacity:"0"})]})})]})},"Spinner"),nt&&jsxRuntimeExports.jsxs(ExpiringSpinner,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:[jsxRuntimeExports.jsx("div",{}),jsxRuntimeExports.jsx("div",{})]},"ExpiringSpinner")]})})]}),states$1={CONNECTED:"connected",CONNECTING:"connecting",EXPIRING:"expiring",FAILED:"failed",REJECTED:"rejected",NOTCONNECTED:"notconnected",UNAVAILABLE:"unavailable"},contentVariants$1={initial:{willChange:"transform,opacity",position:"relative",opacity:0,scale:.95},animate:{position:"relative",opacity:1,scale:1,transition:{ease:[.16,1,.3,1],duration:.4,delay:.05,position:{delay:0}}},exit:{position:"absolute",opacity:0,scale:.95,transition:{ease:[.16,1,.3,1],duration:.3}}},ConnectWithInjector=({switchConnectMethod:et,forceState:o})=>{var tt,rt,nt,ot,it,st,at,ct;const{connect:lt}=useConnect({mutation:{onMutate:Nt=>{Nt.connector?St(states$1.CONNECTING):St(states$1.UNAVAILABLE)},onError(Nt){console.error(Nt)},onSettled(Nt,Lt){if(Lt){if(gt(!0),setTimeout(()=>gt(!1),3500),Lt.code)switch(Lt.code){case-32002:St(states$1.NOTCONNECTED);break;case 4001:St(states$1.REJECTED);break;default:St(states$1.FAILED);break}else if(Lt.message)switch(Lt.message){case"User rejected request":St(states$1.REJECTED);break;default:St(states$1.FAILED);break}}setTimeout(dt,100)}}}),{triggerResize:dt,connector:ht}=useContext(),mt=ht.id,ft=useWallet(mt),pt={name:ft==null?void 0:ft.name,shortName:(tt=ft==null?void 0:ft.shortName)!==null&&tt!==void 0?tt:ft==null?void 0:ft.name,icon:(rt=ft==null?void 0:ft.iconConnector)!==null&&rt!==void 0?rt:ft==null?void 0:ft.icon,iconShape:(nt=ft==null?void 0:ft.iconShape)!==null&&nt!==void 0?nt:"circle",iconShouldShrink:ft==null?void 0:ft.iconShouldShrink},[yt,gt]=reactExports.useState(!1);reactExports.useState(9);const xt=detectBrowser(),vt=(ot=ft==null?void 0:ft.downloadUrls)===null||ot===void 0?void 0:ot[xt],Et=ft!=null&&ft.downloadUrls?{name:Object.keys(ft==null?void 0:ft.downloadUrls)[0],label:((it=Object.keys(ft==null?void 0:ft.downloadUrls)[0])===null||it===void 0?void 0:it.charAt(0).toUpperCase())+((st=Object.keys(ft==null?void 0:ft.downloadUrls)[0])===null||st===void 0?void 0:st.slice(1)),url:ft==null?void 0:ft.downloadUrls[Object.keys(ft==null?void 0:ft.downloadUrls)[0]]}:void 0,[Ct,St]=reactExports.useState(o||(ft!=null&&ft.isInstalled?states$1.CONNECTING:states$1.UNAVAILABLE)),At=useLocales({CONNECTORNAME:pt.name,CONNECTORSHORTNAME:(at=pt.shortName)!==null&&at!==void 0?at:pt.name,SUGGESTEDEXTENSIONBROWSER:(ct=Et==null?void 0:Et.label)!==null&&ct!==void 0?ct:"your browser"}),kt=async()=>{ft!=null&&ft.isInstalled&&(ft!=null&&ft.connector)?lt({connector:ft==null?void 0:ft.connector}):St(states$1.UNAVAILABLE)};let It;return reactExports.useEffect(()=>{if(Ct!==states$1.UNAVAILABLE)return It=setTimeout(kt,600),()=>{clearTimeout(It)}},[]),ft?isWalletConnectConnector(ft==null?void 0:ft.connector.id)?jsxRuntimeExports.jsx(PageContent,{children:jsxRuntimeExports.jsxs(Container$4,{children:[jsxRuntimeExports.jsx(ModalHeading,{children:"Invalid State"}),jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsx(Alert,{children:"WalletConnect does not have an injection flow. This state should never happen."})})]})}):jsxRuntimeExports.jsx(PageContent,{children:jsxRuntimeExports.jsxs(Container$4,{children:[jsxRuntimeExports.jsx(ConnectingContainer,{children:jsxRuntimeExports.jsxs(ConnectingAnimation,{$shake:Ct===states$1.FAILED||Ct===states$1.REJECTED,$circle:pt.iconShape==="circle",children:[jsxRuntimeExports.jsx(AnimatePresence,{children:(Ct===states$1.FAILED||Ct===states$1.REJECTED)&&jsxRuntimeExports.jsx(RetryButton,{"aria-label":"Retry",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},whileTap:{scale:.9},transition:{duration:.1},onClick:kt,children:jsxRuntimeExports.jsx(RetryIconContainer,{children:jsxRuntimeExports.jsx(Tooltip,{open:yt&&(Ct===states$1.FAILED||Ct===states$1.REJECTED),message:At.tryAgainQuestion,xOffset:-6,children:jsxRuntimeExports.jsx(RetryIconCircle,{})})})})}),pt.iconShape==="circle"?jsxRuntimeExports.jsx(CircleSpinner,{logo:Ct===states$1.UNAVAILABLE?jsxRuntimeExports.jsx("div",{style:{transform:"scale(1.14)",position:"relative",width:"100%"},children:pt.icon}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:pt.icon}),smallLogo:pt.iconShouldShrink,connecting:Ct===states$1.CONNECTING,unavailable:Ct===states$1.UNAVAILABLE}):jsxRuntimeExports.jsx(SquircleSpinner,{logo:Ct===states$1.UNAVAILABLE?jsxRuntimeExports.jsx("div",{style:{transform:"scale(1.14)",position:"relative",width:"100%"},children:pt.icon}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:pt.icon}),connecting:Ct===states$1.CONNECTING})]})}),jsxRuntimeExports.jsx(ModalContentContainer,{children:jsxRuntimeExports.jsxs(AnimatePresence,{initial:!1,children:[Ct===states$1.FAILED&&jsxRuntimeExports.jsx(Content$1,{initial:"initial",animate:"animate",exit:"exit",variants:contentVariants$1,children:jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsxs(ModalH1,{$error:!0,children:[jsxRuntimeExports.jsx(AlertIcon,{}),At.injectionScreen_failed_h1]}),jsxRuntimeExports.jsx(ModalBody,{children:At.injectionScreen_failed_p})]})},states$1.FAILED),Ct===states$1.REJECTED&&jsxRuntimeExports.jsx(Content$1,{initial:"initial",animate:"animate",exit:"exit",variants:contentVariants$1,children:jsxRuntimeExports.jsxs(ModalContent,{style:{paddingBottom:28},children:[jsxRuntimeExports.jsx(ModalH1,{children:At.injectionScreen_rejected_h1}),jsxRuntimeExports.jsx(ModalBody,{children:At.injectionScreen_rejected_p})]})},states$1.REJECTED),(Ct===states$1.CONNECTING||Ct===states$1.EXPIRING)&&jsxRuntimeExports.jsx(Content$1,{initial:"initial",animate:"animate",exit:"exit",variants:contentVariants$1,children:jsxRuntimeExports.jsxs(ModalContent,{style:{paddingBottom:28},children:[jsxRuntimeExports.jsx(ModalH1,{children:ft.connector.id==="injected"?At.injectionScreen_connecting_injected_h1:At.injectionScreen_connecting_h1}),jsxRuntimeExports.jsx(ModalBody,{children:ft.connector.id==="injected"?At.injectionScreen_connecting_injected_p:At.injectionScreen_connecting_p})]})},states$1.CONNECTING),Ct===states$1.CONNECTED&&jsxRuntimeExports.jsx(Content$1,{initial:"initial",animate:"animate",exit:"exit",variants:contentVariants$1,children:jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsxs(ModalH1,{$valid:!0,children:[jsxRuntimeExports.jsx(TickIcon,{})," ",At.injectionScreen_connected_h1]}),jsxRuntimeExports.jsx(ModalBody,{children:At.injectionScreen_connected_p})]})},states$1.CONNECTED),Ct===states$1.NOTCONNECTED&&jsxRuntimeExports.jsx(Content$1,{initial:"initial",animate:"animate",exit:"exit",variants:contentVariants$1,children:jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsx(ModalH1,{children:At.injectionScreen_notconnected_h1}),jsxRuntimeExports.jsx(ModalBody,{children:At.injectionScreen_notconnected_p})]})},states$1.NOTCONNECTED),Ct===states$1.UNAVAILABLE&&jsxRuntimeExports.jsx(Content$1,{initial:"initial",animate:"animate",exit:"exit",variants:contentVariants$1,children:vt?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(ModalContent,{style:{paddingBottom:18},children:[jsxRuntimeExports.jsx(ModalH1,{children:At.injectionScreen_install_h1}),jsxRuntimeExports.jsx(ModalBody,{children:At.injectionScreen_install_p})]}),!ft.isInstalled&&vt&&jsxRuntimeExports.jsx(Button$1,{href:vt,icon:jsxRuntimeExports.jsx(BrowserIcon,{}),children:At.installTheExtension})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(ModalContent,{style:{paddingBottom:12},children:[jsxRuntimeExports.jsx(ModalH1,{children:At.injectionScreen_unavailable_h1}),jsxRuntimeExports.jsx(ModalBody,{children:At.injectionScreen_unavailable_p})]}),!ft.isInstalled&&Et&&jsxRuntimeExports.jsxs(Button$1,{href:Et==null?void 0:Et.url,icon:jsxRuntimeExports.jsx(BrowserIcon,{browser:Et==null?void 0:Et.name}),children:["Install on ",Et==null?void 0:Et.label]})]})},states$1.UNAVAILABLE)]})})]})}):jsxRuntimeExports.jsx(PageContent,{children:jsxRuntimeExports.jsxs(Container$4,{children:[jsxRuntimeExports.jsx(ModalHeading,{children:"Invalid State"}),jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsx(Alert,{children:"No connectors match the id given. This state should never happen."})})]})})},QRCodeContainer=styled(motion.div)`
z-index: 3;
position: relative;
overflow: hidden;
height: 0;
padding-bottom: 100% !important;
display: flex;
align-items: center;
justify-content: center;
margin: 1px 0 2px;
border-radius: var(--ck-qr-border-radius, 24px);
background: var(--ck-qr-background, transparent);
box-shadow: 0 0 0 1px var(--ck-qr-border-color);
backface-visibility: hidden;
svg {
display: block;
max-width: 100%;
width: 100%;
height: auto;
}
`,QRCodeContent=styled(motion.div)`
position: absolute;
inset: 13px;
svg {
width: 100% !important;
height: auto !important;
}
`,PlaceholderKeyframes$2=We`
0%{ background-position: 100% 0; }
100%{ background-position: -100% 0; }
`,QRPlaceholder=styled(motion.div)`
--color: var(--ck-qr-dot-color);
--bg: var(--ck-qr-background, var(--ck-body-background));
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
> div {
z-index: 4;
position: relative;
width: 28%;
height: 28%;
border-radius: 20px;
background: var(--bg);
box-shadow: 0 0 0 7px var(--bg);
}
> span {
z-index: 4;
position: absolute;
background: var(--color);
border-radius: 12px;
width: 13.25%;
height: 13.25%;
box-shadow: 0 0 0 4px var(--bg);
&:before {
content: '';
position: absolute;
inset: 9px;
border-radius: 3px;
box-shadow: 0 0 0 4px var(--bg);
}
&:nth-child(1) {
top: 0;
left: 0;
}
&:nth-child(2) {
top: 0;
right: 0;
}
&:nth-child(3) {
bottom: 0;
left: 0;
}
}
&:before {
z-index: 3;
content: '';
position: absolute;
inset: 0;
background: repeat;
background-size: 1.888% 1.888%;
background-image: radial-gradient(var(--color) 41%, transparent 41%);
}
&:after {
z-index: 5;
content: '';
position: absolute;
inset: 0;
transform: scale(1.5) rotate(45deg);
background-image: linear-gradient(
90deg,
rgba(255, 255, 255, 0) 50%,
rgba(255, 255, 255, 1),
rgba(255, 255, 255, 0)
);
background-size: 200% 100%;
animation: ${PlaceholderKeyframes$2} 1000ms linear infinite both;
}
`,LogoContainer$2=styled(motion.div)`
z-index: 6;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
transform: translateY(50%) scale(0.9999); // Shifting fix
`,LogoIcon=styled(motion.div)`
z-index: 6;
position: absolute;
left: 50%;
overflow: hidden;
transform: translate(-50%, -50%) scale(0.9999); // Shifting fix
svg {
display: block;
position: relative;
width: 100%;
height: 100%;
}
${et=>et.$wcLogo?Ae`
width: 29%;
height: 20.5%;
`:Ae`
width: 28%;
height: 28%;
border-radius: 17px;
&:before {
pointer-events: none;
z-index: 2;
content: '';
position: absolute;
inset: 0;
border-radius: inherit;
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.02);
}
`}
`,generateMatrix=(et,o)=>{const tt=Array.prototype.slice.call(browser$1.create(et,{errorCorrectionLevel:o}).modules.data,0),rt=Math.sqrt(tt.length);return tt.reduce((nt,ot,it)=>(it%rt===0?nt.push([ot]):nt[nt.length-1].push(ot))&&nt,[])};function QRCode$1({ecl:et="M",size:o=200,uri:tt,clearArea:rt=!1,image:nt,imageBackground:ot="transparent"}){const it=rt?76:0,st=o-10*2,at=reactExports.useMemo(()=>{const ct=[],lt=generateMatrix(tt,et),dt=st/lt.length;if([{x:0,y:0},{x:1,y:0},{x:0,y:1}].forEach(({x:yt,y:gt})=>{const bt=(lt.length-7)*dt*yt,xt=(lt.length-7)*dt*gt;for(let vt=0;vt<3;vt++)ct.push(jsxRuntimeExports.jsx("rect",{fill:vt%2!==0?"var(--ck-qr-background, var(--ck-body-background))":"var(--ck-qr-dot-color)",rx:(vt-2)*-5+(vt===0?2:3),ry:(vt-2)*-5+(vt===0?2:3),width:dt*(7-vt*2),height:dt*(7-vt*2),x:bt+dt*vt,y:xt+dt*vt},`${vt}-${yt}-${gt}`))}),nt){const yt=(lt.length-7)*dt*1,gt=(lt.length-7)*dt*1;ct.push(jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("rect",{fill:ot,rx:-2*-5+2,ry:-2*-5+2,width:dt*(7-0*2),height:dt*(7-0*2),x:yt+dt*0,y:gt+dt*0}),jsxRuntimeExports.jsx("foreignObject",{width:dt*(7-0*2),height:dt*(7-0*2),x:yt+dt*0,y:gt+dt*0,children:jsxRuntimeExports.jsx("div",{style:{borderRadius:-2*-5+2,overflow:"hidden"},children:nt})})]}))}const mt=Math.floor((it+25)/dt),ft=lt.length/2-mt/2,pt=lt.length/2+mt/2-1;return lt.forEach((yt,gt)=>{yt.forEach((bt,xt)=>{lt[gt][xt]&&(gt<7&&xt<7||gt>lt.length-8&&xt<7||gt<7&&xt>lt.length-8||(nt||!(gt>ft&&gt<pt&&xt>ft&&xt<pt))&&ct.push(jsxRuntimeExports.jsx("circle",{cx:gt*dt+dt/2,cy:xt*dt+dt/2,fill:"var(--ck-qr-dot-color)",r:dt/3},`circle-${gt}-${xt}`)))})}),ct},[et,st,tt]);return jsxRuntimeExports.jsxs("svg",{height:st,width:st,viewBox:`0 0 ${st} ${st}`,style:{width:st,height:st},children:[jsxRuntimeExports.jsx("rect",{fill:"transparent",height:st,width:st}),at]})}function useWindowSize(){const[et,o]=reactExports.useState({width:0,height:0});return reactExports.useEffect(()=>{function tt(){o({width:window.innerWidth,height:window.innerHeight})}return window.addEventListener("resize",tt),tt(),()=>window.removeEventListener("resize",tt)},[]),et}function CustomQRCode({value:et,image:o,imageBackground:tt,imagePosition:rt="center",tooltipMessage:nt}){const it=useWindowSize().width>920&&nt?jsxRuntimeExports.jsx(Tooltip,{xOffset:139,yOffset:5,delay:.1,message:nt,children:o}):o;return jsxRuntimeExports.jsx(QRCodeContainer,{children:jsxRuntimeExports.jsxs(QRCodeContent,{children:[o&&jsxRuntimeExports.jsx(LogoContainer$2,{children:jsxRuntimeExports.jsx(LogoIcon,{$wcLogo:rt!=="center",style:{background:rt==="center"?tt:void 0},children:it})}),jsxRuntimeExports.jsx(AnimatePresence,{initial:!1,children:et?jsxRuntimeExports.jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,position:"absolute",inset:[0,0]},transition:{duration:.2},children:jsxRuntimeExports.jsx(QRCode$1,{uri:et,size:288,ecl:"M",clearArea:!!(rt==="center"&&o)})},et):jsxRuntimeExports.jsxs(QRPlaceholder,{initial:{opacity:.1},animate:{opacity:.1},exit:{opacity:0,position:"absolute",inset:[0,0]},transition:{duration:.2},children:[jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("div",{})]})})]})})}CustomQRCode.displayName="CustomQRCode";const IconContainer$1=styled(motion.div)`
position: relative;
display: flex;
align-items: center;
justify-content: center;
width: 47px;
height: 52px;
min-width: 47px;
min-height: 52px;
svg {
display: block;
max-width: 100%;
height: auto;
}
`,ScanIconWithLogos=({logo:et})=>{const o=[jsxRuntimeExports.jsx(Logos.MetaMask,{background:!0}),jsxRuntimeExports.jsx(Logos.Coinbase,{background:!0}),jsxRuntimeExports.jsx(Logos.Crypto,{}),jsxRuntimeExports.jsx(Logos.ImToken,{}),jsxRuntimeExports.jsx(Logos.Argent,{}),jsxRuntimeExports.jsx(Logos.Trust,{})];return jsxRuntimeExports.jsx(IconContainer$1,{children:jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"47",height:"52",viewBox:"0 0 47 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsxs("g",{mask:"url(#gradient-mask)",children:[jsxRuntimeExports.jsx("path",{d:"M7 14.5C7 11.4624 9.46243 9 12.5 9H31.5C34.5376 9 37 11.4624 37 14.5V47H7V14.5Z",fill:"var(--ck-graphic-scaniconwithlogos-04)"}),et?jsxRuntimeExports.jsx("foreignObject",{x:"13",y:"21",width:"18",height:"18",rx:"5",children:jsxRuntimeExports.jsx("div",{style:{overflow:"hidden",borderRadius:5},children:et})}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("foreignObject",{x:"12",y:"15",width:"9",height:"9",rx:"2.5",children:jsxRuntimeExports.jsx("div",{style:{overflow:"hidden",borderRadius:2.5},children:o[0]})}),jsxRuntimeExports.jsx("foreignObject",{x:"23",y:"15",width:"9",height:"9",rx:"2.5",children:jsxRuntimeExports.jsx("div",{style:{overflow:"hidden",borderRadius:2.5},children:o[1]})}),jsxRuntimeExports.jsx("foreignObject",{x:"12",y:"26",width:"9",height:"9",rx:"2.5",children:jsxRuntimeExports.jsx("div",{style:{overflow:"hidden",borderRadius:2.5},children:jsxRuntimeExports.jsx("div",{style:{overflow:"hidden",borderRadius:2.5},children:o[2]})})}),jsxRuntimeExports.jsx("foreignObject",{x:"23",y:"26",width:"9",height:"9",rx:"2.5",children:jsxRuntimeExports.jsx("div",{style:{overflow:"hidden",borderRadius:2.5},children:o[3]})}),jsxRuntimeExports.jsx("foreignObject",{x:"12",y:"37",width:"9",height:"9",rx:"2.5",children:jsxRuntimeExports.jsx("div",{style:{overflow:"hidden",borderRadius:2.5},children:o[4]})}),jsxRuntimeExports.jsx("foreignObject",{x:"23",y:"37",width:"9",height:"9",rx:"2.5",children:jsxRuntimeExports.jsx("div",{style:{overflow:"hidden",borderRadius:2.5},children:o[5]})})]}),jsxRuntimeExports.jsx("path",{d:"M36 47V13.7143C36 11.1107 33.8893 9 31.2857 9H12.7143C10.1107 9 8 11.1107 8 13.7143V47",stroke:"url(#paint0_linear_924_12568)",strokeWidth:"2"}),jsxRuntimeExports.jsx("path",{d:"M15 10H29C29 11.1046 28.1046 12 27 12H17C15.8954 12 15 11.1046 15 10Z",fill:"var(--ck-graphic-scaniconwithlogos-01)"}),jsxRuntimeExports.jsx("rect",{x:"1",y:"47",width:"43",height:"5",fill:"var(--ck-tooltip-background)"}),jsxRuntimeExports.jsx("rect",{x:"22",y:"1",width:"24",height:"24",rx:"12",fill:"var(--ck-graphic-scaniconwithlogos-03)",stroke:"var(--ck-tooltip-background)",strokeWidth:"2"}),jsxRuntimeExports.jsx("rect",{x:"34.5",y:"10",width:"2.5",height:"2.5",rx:"0.75",fill:"#373737"}),jsxRuntimeExports.jsx("rect",{x:"31",y:"10",width:"2.5",height:"2.5",rx:"0.75",fill:"#373737"}),jsxRuntimeExports.jsx("rect",{x:"31",y:"13.5",width:"2.5",height:"2.5",rx:"0.75",fill:"#373737"}),jsxRuntimeExports.jsx("rect",{x:"34.5",y:"13.5",width:"2.5",height:"2.5",rx:"0.75",fill:"#373737"}),jsxRuntimeExports.jsx("path",{d:"M28.5 10.5V9C28.5 8.17157 29.1716 7.5 30 7.5H31.5",stroke:"#373737",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M36.5 7.5L38 7.5C38.8284 7.5 39.5 8.17157 39.5 9L39.5 10.5",stroke:"#373737",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M39.5 15.5L39.5 17C39.5 17.8284 38.8284 18.5 38 18.5L36.5 18.5",stroke:"#373737",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M31.5 18.5L30 18.5C29.1716 18.5 28.5 17.8284 28.5 17L28.5 15.5",stroke:"#373737",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_924_12568",x1:"22",y1:"8.2549",x2:"22",y2:"47",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-scaniconwithlogos-01)"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"var(--ck-graphic-scaniconwithlogos-02)"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"linear-gradient-mask",x1:"47",y1:"42",x2:"47",y2:"47",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"white"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"black",stopOpacity:"0"})]}),jsxRuntimeExports.jsx("mask",{id:"gradient-mask",children:jsxRuntimeExports.jsx("rect",{x:"0",y:"0",width:"47",height:"52",fill:"url(#linear-gradient-mask)"})})]})]})})},ConnectWithQRCode=({switchConnectMethod:et})=>{var o,tt,rt,nt,ot,it,st,at;const ct=useContext(),lt=ct.connector.id,dt=useWallet(ct.connector.id),{open:ht,isOpen:mt}=useWalletConnectModal(),{connect:{getUri:ft}}=useWeb3(),pt=ft(lt),yt=pt?(tt=(o=dt==null?void 0:dt.getWalletConnectDeeplink)===null||o===void 0?void 0:o.call(dt,pt))!==null&&tt!==void 0?tt:pt:void 0,gt=useLocales({CONNECTORNAME:dt==null?void 0:dt.name});if(!dt)return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["Wallet not found ",ct.connector.id]});const bt=dt==null?void 0:dt.downloadUrls,xt={chrome:bt==null?void 0:bt.chrome,firefox:bt==null?void 0:bt.firefox,brave:bt==null?void 0:bt.brave,edge:bt==null?void 0:bt.edge,safari:bt==null?void 0:bt.safari};detectBrowser();const vt=bt&&Object.keys(bt).length!==0;xt&&(Object.keys(xt)[0],((rt=Object.keys(xt)[0])===null||rt===void 0?void 0:rt.charAt(0).toUpperCase())+((nt=Object.keys(xt)[0])===null||nt===void 0?void 0:nt.slice(1)),xt[Object.keys(xt)[0]]);const Et=isWalletConnectConnector(lt);return jsxRuntimeExports.jsxs(PageContent,{children:[jsxRuntimeExports.jsxs(ModalContent,{style:{paddingBottom:8,gap:14},children:[jsxRuntimeExports.jsx(CustomQRCode,{value:yt,image:dt==null?void 0:dt.icon,tooltipMessage:isWalletConnectConnector(lt)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ScanIconWithLogos,{}),jsxRuntimeExports.jsx("span",{children:gt.scanScreen_tooltip_walletConnect})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ScanIconWithLogos,{logo:dt==null?void 0:dt.icon}),jsxRuntimeExports.jsx("span",{children:gt.scanScreen_tooltip_default})]})}),Et?jsxRuntimeExports.jsx(OrDivider,{}):vt&&jsxRuntimeExports.jsx(OrDivider,{children:gt.dontHaveTheApp})]}),Et&&jsxRuntimeExports.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:14},children:[((ot=ct.options)===null||ot===void 0?void 0:ot.walletConnectCTA)!=="modal"&&jsxRuntimeExports.jsx(CopyToClipboard,{variant:"button",string:yt,children:((it=ct.options)===null||it===void 0?void 0:it.walletConnectCTA)==="link"?gt.copyToClipboard:gt.copyCode}),((st=ct.options)===null||st===void 0?void 0:st.walletConnectCTA)!=="link"&&jsxRuntimeExports.jsx(Button$1,{icon:jsxRuntimeExports.jsx(ExternalLinkIcon,{}),onClick:ht,disabled:mt,waiting:mt,children:((at=ct.options)===null||at===void 0?void 0:at.walletConnectCTA)==="modal"?gt.useWalletConnectModal:gt.useModal})]}),vt&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Button$1,{onClick:()=>{ct.setRoute(routes.DOWNLOAD)},download:!0,children:gt.getWalletName})})]})},states={QRCODE:"qrcode",INJECTOR:"injector"},ConnectUsing=()=>{const et=useContext(),o=useWallet(et.connector.id),tt=!(o!=null&&o.isInstalled)&&(o==null?void 0:o.getWalletConnectDeeplink),[rt,nt]=reactExports.useState(tt?states.QRCODE:states.INJECTOR);return reactExports.useEffect(()=>{const ot=async()=>{await(o==null?void 0:o.connector.getProvider())||(nt(states.QRCODE),setTimeout(et.triggerResize,10))};rt===states.INJECTOR&&ot()},[]),o?jsxRuntimeExports.jsxs(AnimatePresence,{children:[rt===states.QRCODE&&jsxRuntimeExports.jsx(motion.div,{initial:"initial",animate:"animate",exit:"exit",variants:contentVariants$2,children:jsxRuntimeExports.jsx(ConnectWithQRCode,{switchConnectMethod:ot=>{nt(states.INJECTOR)}})},states.QRCODE),rt===states.INJECTOR&&jsxRuntimeExports.jsx(motion.div,{initial:"initial",animate:"animate",exit:"exit",variants:contentVariants$2,children:jsxRuntimeExports.jsx(ConnectWithInjector,{switchConnectMethod:ot=>{nt(states.QRCODE)}})},states.INJECTOR)]}):jsxRuntimeExports.jsxs(Alert,{children:["Connector not found ",et.connector.id]})},DownloadApp=()=>{var et,o,tt;const rt=useContext(),nt=useWallet(rt.connector.id),ot=useLocales({CONNECTORNAME:nt==null?void 0:nt.name});if(!nt)return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:"Wallet not found"});const it={ios:(et=nt.downloadUrls)===null||et===void 0?void 0:et.ios,android:(o=nt.downloadUrls)===null||o===void 0?void 0:o.android,redirect:(tt=nt.downloadUrls)===null||tt===void 0?void 0:tt.download},st=it.ios&&it.android?ot.downloadAppScreen_iosAndroid:it.ios?ot.downloadAppScreen_ios:ot.downloadAppScreen_android;return jsxRuntimeExports.jsx(PageContent,{children:jsxRuntimeExports.jsxs(ModalContent,{style:{paddingBottom:4,gap:14},children:[it.redirect&&jsxRuntimeExports.jsx(CustomQRCode,{value:it.redirect}),!it.redirect&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:"No download link available"}),jsxRuntimeExports.jsx(ModalBody,{style:{fontSize:15,lineHeight:"20px",padding:"0 12px"},children:st})]})})},AvatarContainer=styled(motion.div)`
padding: 18px 0 20px;
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
padding: 16px 0 20px;
}
`,AvatarInner=styled(motion.div)`
position: relative;
display: inline-block;
`,ChainSelectorContainer=styled(motion.div)`
z-index: 3;
position: absolute;
bottom: 0px;
right: -16px;
`,BalanceContainer=styled(motion.div)`
position: relative;
`,Balance$1=styled(motion.div)`
position: relative;
`,PlaceholderKeyframes$1=We`
0%{ background-position: 100% 0; }
100%{ background-position: -100% 0; }
`,LoadingBalance=styled(motion.div)`
width: 25%;
margin: 0 auto;
position: relative;
overflow: hidden;
border-radius: 10px;
background: var(--ck-body-background-secondary);
inset: 0;
&:before {
z-index: 4;
content: '';
position: absolute;
inset: 0;
background-image: linear-gradient(
90deg,
var(--ck-body-background-transparent) 50%,
var(--ck-body-background),
var(--ck-body-background-transparent)
);
opacity: 0.75;
background-size: 200% 100%;
animation: ${PlaceholderKeyframes$1} 1000ms linear infinite both;
}
`;function addressToNumber(et){return et.split("").map(o=>o.charCodeAt(0)).reduce((o,tt)=>o+tt)%100/100}const EnsAvatar=styled(motion.div)`
will-change: transform; // Needed for Safari
pointer-events: none;
user-select: none;
position: relative;
overflow: hidden;
margin: 0;
border-radius: ${et=>`${et.$radius}px`};
width: ${et=>`${et.$size}px`};
height: ${et=>`${et.$size}px`};
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
&:before {
content: '';
z-index: 1;
position: absolute;
inset: 0;
border-radius: inherit;
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.02);
}
${et=>{if(et.$seed){const o=Math.ceil(addressToNumber(et.$seed)*8),tt=`0${o===0?1:o}`;return Ae`
background: var(--ck-ens-${tt}-start);
background: linear-gradient(
180deg,
var(--ck-ens-${tt}-start) 0%,
var(--ck-ens-${tt}-stop) 100%
);
`}}}
`,ImageContainer=styled(motion.img)`
display: block;
position: relative;
width: 100%;
height: 100%;
opacity: ${et=>et.$loaded?1:0};
will-change: opacity; // Needed for Safari
transition: opacity 500ms ease;
transform: scale(1.01); // fixes background color bleeding
`;function useIsMounted(){const[et,o]=reactExports.useState(!1);return reactExports.useEffect(()=>o(!0),[]),et}const ensFallbackConfig=createConfig({chains:[mainnet],transports:{[mainnet.id]:http()}});function useEnsFallbackConfig(){return useChainIsSupported(1)?void 0:ensFallbackConfig}const Avatar=({address:et,name:o,size:tt=96,radius:rt=96})=>{var nt,ot,it;const st=useIsMounted(),at=useContext(),ct=reactExports.useRef(null),[lt,dt]=reactExports.useState(!0),ht=useEnsFallbackConfig(),{data:mt}=useEnsAddress({chainId:1,name:o,config:ht}),{data:ft}=useEnsName({chainId:1,address:(nt=et??mt)!==null&&nt!==void 0?nt:void 0,config:ht}),{data:pt}=useEnsAvatar({chainId:1,name:normalize$2(ft??""),config:ht}),yt={address:mt??et,name:ft??o,avatar:pt??void 0};return reactExports.useEffect(()=>{ct.current&&ct.current.complete&&ct.current.naturalHeight!==0||dt(!1)},[pt]),st?!((ot=at.options)===null||ot===void 0)&&ot.customAvatar?jsxRuntimeExports.jsx("div",{style:{width:tt,height:tt,borderRadius:rt,overflow:"hidden"},children:(it=at.options)===null||it===void 0?void 0:it.customAvatar({address:et??(yt==null?void 0:yt.address),ensName:o??(yt==null?void 0:yt.name),ensImage:yt==null?void 0:yt.avatar,size:tt,radius:rt})}):!yt.name||!yt.avatar?jsxRuntimeExports.jsx(ResetContainer,{style:{pointerEvents:"none"},children:jsxRuntimeExports.jsx(EnsAvatar,{$size:tt,$seed:yt.address,$radius:rt})}):jsxRuntimeExports.jsx(ResetContainer,{style:{pointerEvents:"none"},children:jsxRuntimeExports.jsx(EnsAvatar,{$size:tt,$seed:yt.address,$radius:rt,children:jsxRuntimeExports.jsx(ImageContainer,{ref:ct,src:yt.avatar,alt:yt.name,onLoad:()=>dt(!0),$loaded:lt})})}):jsxRuntimeExports.jsx("div",{style:{width:tt,height:tt,borderRadius:rt}})},KnownChain=({testnet:et,...o})=>jsxRuntimeExports.jsxs("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:et?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"black"},children:[jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.5611 8.12948C21.0082 7.90729 21.5007 7.79167 22 7.79167C22.4993 7.79167 22.9919 7.90729 23.439 8.12948L23.4408 8.1304L33.0387 12.9293C33.577 13.197 34.031 13.61 34.3478 14.121C34.6649 14.6323 34.833 15.2218 34.8333 15.8234V27.2595C34.833 27.8611 34.6649 28.4511 34.3478 28.9624C34.031 29.4733 33.578 29.8858 33.0398 30.1535L23.4411 34.9528C22.9919 35.1775 22.4963 35.2947 21.994 35.2947C21.4918 35.2947 20.9964 35.1777 20.5472 34.9529L10.9475 30.1531L10.9452 30.1519C10.4071 29.8808 9.95535 29.4646 9.6411 28.9504C9.32739 28.437 9.16312 27.8464 9.16673 27.2448L9.16675 27.2417L10.0004 27.2475H9.16673V27.2448V15.8239C9.16705 15.2223 9.33518 14.6322 9.65222 14.121C9.96906 13.61 10.4221 13.1976 10.9604 12.9298L20.5592 8.1304L20.5611 8.12948ZM21.3031 9.62267L11.8706 14.3389L22 19.4036L32.1294 14.3389L22.697 9.62267C22.4806 9.51531 22.2416 9.45905 22 9.45905C21.7585 9.45905 21.5194 9.51534 21.3031 9.62267ZM10.8341 15.8241C10.8341 15.7785 10.8362 15.733 10.8401 15.6878L21.1663 20.8509V33.3983L11.6955 28.6629C11.4352 28.5315 11.2159 28.3297 11.0638 28.0809C10.9116 27.8318 10.8321 27.5452 10.8341 27.2533L10.8341 27.2475V15.8241ZM22.8337 33.3923L32.2967 28.6608C32.5576 28.5312 32.7772 28.3313 32.9308 28.0836C33.0844 27.836 33.1658 27.5504 33.166 27.259V15.8243C33.1659 15.7786 33.1639 15.7331 33.1599 15.6878L22.8337 20.8509V33.3923Z",fill:"url(#paint0_linear_3546_7073)"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.8341 15.8241C10.8341 15.7785 10.8362 15.733 10.8401 15.6878L21.1663 20.8509V33.3983L11.6955 28.6629C11.4352 28.5315 11.2159 28.3297 11.0638 28.0809C10.9116 27.8318 10.8321 27.5452 10.8341 27.2533L10.8341 27.2475V15.8241Z",fill:"url(#paint1_linear_3546_7073)",fillOpacity:"0.3"}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_3546_7073",x1:"22",y1:"7.79167",x2:"22",y2:"35.2947",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"white"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"white",stopOpacity:"0.7"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint1_linear_3546_7073",x1:"22",y1:"7.79167",x2:"22",y2:"35.2947",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"white"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"white",stopOpacity:"0.7"})]})]})]}),UnknownChain=({testnet:et,...o})=>jsxRuntimeExports.jsx(KnownChain,{testnet:!0,...o}),Ethereum=({testnet:et,...o})=>{let tt="var(--ck-chain-ethereum-01, #25292E)",rt="var(--ck-chain-ethereum-02, #ffffff)";return et&&(tt="linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)",rt="#fff"),jsxRuntimeExports.jsxs("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:tt},children:[jsxRuntimeExports.jsx("path",{d:"M21.9967 6.99621L21.7955 7.67987V27.5163L21.9967 27.7171L31.2044 22.2744L21.9967 6.99621Z",fill:rt}),jsxRuntimeExports.jsx("path",{d:"M21.9957 6.99621L12.7878 22.2744L21.9957 27.7171V18.0891V6.99621Z",fill:rt}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21.9959 36.9996L21.9959 36.9997V36.9995L31.2091 24.0243L21.9959 29.4642L12.788 24.0243L21.9957 36.9993L21.9958 36.9997L21.9959 36.9996Z",fill:rt}),jsxRuntimeExports.jsx("path",{d:"M21.996 27.7181L31.2037 22.2753L21.996 18.09V27.7181Z",fill:rt}),jsxRuntimeExports.jsx("path",{d:"M12.7878 22.2753L21.9957 27.7181V18.09L12.7878 22.2753Z",fill:rt})]})},Polygon=({testnet:et,...o})=>jsxRuntimeExports.jsx("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:et?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#6F41D8"},children:jsxRuntimeExports.jsx("path",{d:"M29.0015 17.4529C28.4941 17.1572 27.8355 17.1572 27.2773 17.4529L23.3186 19.7271L20.6305 21.2094L16.6719 23.4822C16.1645 23.7792 15.5059 23.7792 14.9476 23.4822L11.8016 21.703C11.2943 21.4074 10.9395 20.8642 10.9395 20.2702V16.7612C10.9395 16.1686 11.2434 15.6255 11.8016 15.3285L14.8954 13.5988C15.4041 13.3018 16.0641 13.3018 16.6224 13.5988L19.7161 15.3285C20.2249 15.6255 20.5796 16.1686 20.5796 16.7612V19.0355L23.2678 17.5024V15.2295C23.2707 14.9343 23.1917 14.6441 23.0395 14.3911C22.8873 14.1381 22.6679 13.9324 22.4056 13.7968L16.6719 10.5353C16.1645 10.2382 15.5059 10.2382 14.9476 10.5353L9.11214 13.7968C8.84992 13.9324 8.63049 14.1381 8.47828 14.3911C8.32607 14.6441 8.24705 14.9343 8.25002 15.2295V21.802C8.25002 22.396 8.55389 22.9391 9.11214 23.2361L14.9476 26.4976C15.455 26.7932 16.115 26.7932 16.6719 26.4976L20.6305 24.2729L23.3186 22.7411L27.2773 20.5177C27.7846 20.2207 28.4433 20.2207 29.0015 20.5177L32.0966 22.2475C32.6054 22.5431 32.9588 23.0863 32.9588 23.6803V27.1893C32.9588 27.7819 32.6563 28.325 32.0966 28.622L29.0029 30.4013C28.4941 30.6983 27.8341 30.6983 27.2773 30.4013L24.1821 28.6715C23.6734 28.3745 23.3186 27.8314 23.3186 27.2387V24.9645L20.6305 26.4976V28.7705C20.6305 29.3631 20.9344 29.9076 21.4926 30.2032L27.3281 33.4647C27.8355 33.7617 28.4941 33.7617 29.0524 33.4647L34.8879 30.2032C35.3953 29.9076 35.75 29.3645 35.75 28.7705V22.198C35.753 21.9028 35.674 21.6126 35.5218 21.3596C35.3695 21.1066 35.1501 20.9009 34.8879 20.7653L29.0029 17.4529H29.0015Z",fill:"white"})}),Optimism=({testnet:et,...o})=>jsxRuntimeExports.jsxs("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:et?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#FF0420"},children:[jsxRuntimeExports.jsx("path",{d:"M15.5877 27.8473C14.2777 27.8473 13.2045 27.539 12.3679 26.9226C11.5422 26.2952 11.1294 25.4035 11.1294 24.2477C11.1294 24.0055 11.157 23.7082 11.212 23.356C11.3552 22.5634 11.5588 21.6112 11.823 20.4994C12.5715 17.4722 14.5034 15.9586 17.6187 15.9586C18.4664 15.9586 19.2259 16.1017 19.8974 16.3879C20.5689 16.663 21.0973 17.0814 21.4826 17.6428C21.8678 18.1932 22.0605 18.8537 22.0605 19.6242C22.0605 19.8554 22.033 20.1471 21.9779 20.4994C21.8128 21.4791 21.6146 22.4313 21.3835 23.356C20.9982 24.8641 20.3322 25.9924 19.3855 26.741C18.4388 27.4785 17.1729 27.8473 15.5877 27.8473ZM15.8189 25.4695C16.4354 25.4695 16.9582 25.2879 17.3876 24.9247C17.8279 24.5614 18.1416 24.0055 18.3287 23.257C18.5819 22.2222 18.7746 21.3195 18.9067 20.5489C18.9507 20.3178 18.9727 20.0811 18.9727 19.8389C18.9727 18.8372 18.4498 18.3363 17.4041 18.3363C16.7876 18.3363 16.2592 18.5179 15.8189 18.8812C15.3896 19.2445 15.0813 19.8004 14.8943 20.5489C14.6961 21.2865 14.4979 22.1892 14.2998 23.257C14.2557 23.477 14.2337 23.7082 14.2337 23.9504C14.2337 24.9632 14.7622 25.4695 15.8189 25.4695Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M22.8188 27.6815C22.6977 27.6815 22.6041 27.6429 22.5381 27.5659C22.483 27.4778 22.4665 27.3788 22.4885 27.2687L24.7672 16.5358C24.7892 16.4147 24.8498 16.3156 24.9489 16.2385C25.0479 16.1615 25.1525 16.1229 25.2626 16.1229H29.6548C30.8767 16.1229 31.8564 16.3761 32.5939 16.8825C33.3426 17.3889 33.7168 18.1209 33.7168 19.0786C33.7168 19.3538 33.6838 19.64 33.6177 19.9372C33.3426 21.2032 32.7867 22.1389 31.95 22.7443C31.1244 23.3498 29.9905 23.6525 28.5485 23.6525H26.3194L25.5598 27.2687C25.5377 27.3898 25.4772 27.4888 25.3782 27.5659C25.2791 27.6429 25.1745 27.6815 25.0645 27.6815H22.8188ZM28.6641 21.3738C29.1264 21.3738 29.5282 21.2472 29.8695 20.994C30.2217 20.7408 30.4529 20.3776 30.563 19.9042C30.596 19.717 30.6125 19.552 30.6125 19.4089C30.6125 19.0896 30.519 18.8474 30.3318 18.6823C30.1446 18.5062 29.8255 18.4182 29.3741 18.4182H27.3926L26.7652 21.3738H28.6641Z",fill:"white"})]}),Arbitrum=({testnet:et,...o})=>{const tt=et?"#ffffff":"#28A0F0",rt=et?"#ffffff":"#96BEDC";return jsxRuntimeExports.jsxs("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:et?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#2C364F"},children:[!et&&jsxRuntimeExports.jsx("path",{d:"M25.7948 20.5826L28.2683 16.3854L34.9355 26.7696L34.9386 28.7625L34.9168 15.0491C34.9011 14.7137 34.7231 14.407 34.4391 14.2261L22.4357 7.32182C22.1551 7.1838 21.7989 7.18546 21.5187 7.32618C21.4807 7.34524 21.4453 7.36576 21.4113 7.38835L21.3694 7.41467L9.71816 14.1664L9.67298 14.1871C9.61474 14.2137 9.55609 14.2479 9.50076 14.2872C9.27983 14.4456 9.1331 14.68 9.08564 14.9425C9.07859 14.9823 9.0732 15.023 9.07092 15.064L9.08916 26.239L15.2994 16.6138C16.0811 15.3376 17.7847 14.9262 19.3662 14.9488L21.2221 14.9977L10.2862 32.5356L11.5753 33.2778L22.6422 15.0155L27.5338 14.9977L16.4956 33.7209L21.0955 36.3668L21.6451 36.6827C21.8776 36.7772 22.1516 36.7819 22.386 36.6972L34.5581 29.6433L32.2309 30.9918L25.7948 20.5826ZM26.7384 34.175L22.0925 26.8829L24.9287 22.0702L31.0303 31.6876L26.7384 34.175Z",fill:"#2D374B"}),jsxRuntimeExports.jsx("path",{d:"M22.0924 26.8832L26.7385 34.1751L31.0302 31.6879L24.9286 22.0705L22.0924 26.8832Z",fill:tt}),jsxRuntimeExports.jsx("path",{d:"M34.9387 28.7627L34.9356 26.7698L28.2684 16.3856L25.7949 20.5828L32.2312 30.992L34.5584 29.6435C34.7866 29.4582 34.9248 29.1861 34.9393 28.8926L34.9387 28.7627Z",fill:tt}),jsxRuntimeExports.jsx("path",{d:"M7 30.642L10.2863 32.5356L21.2222 14.9976L19.3663 14.9487C17.785 14.9263 16.0814 15.3375 15.2995 16.6137L9.08927 26.239L7 29.449V30.642V30.642Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M27.534 14.9977L22.6423 15.0155L11.5754 33.2778L15.4437 35.5049L16.4955 33.7209L27.534 14.9977Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M37 14.9723C36.9592 13.9493 36.4052 13.013 35.5377 12.4677L23.377 5.47434C22.5187 5.04223 21.4466 5.04161 20.5868 5.47414C20.4852 5.52533 8.76078 12.3251 8.76078 12.3251C8.5985 12.4029 8.44224 12.4955 8.2953 12.6008C7.52081 13.156 7.0487 14.0186 7 14.9661V29.4492L9.08927 26.2392L9.07103 15.0639C9.07352 15.0231 9.0787 14.9827 9.08575 14.9431C9.133 14.6801 9.27994 14.4457 9.50086 14.2872C9.5562 14.2478 21.4806 7.34517 21.5186 7.32611C21.799 7.18538 22.155 7.18373 22.4356 7.32175L34.439 14.226C34.723 14.4069 34.901 14.7137 34.9167 15.049V28.8921C34.9022 29.1856 34.7862 29.4577 34.558 29.643L32.2308 30.9916L31.03 31.6875L26.7383 34.1747L22.3859 36.6969C22.1515 36.7817 21.8773 36.7769 21.645 36.6824L16.4955 33.7206L15.4435 35.5046L20.0713 38.169C20.2243 38.256 20.3607 38.3331 20.4726 38.3961C20.6458 38.4933 20.764 38.5582 20.8056 38.5785C21.1345 38.7383 21.6077 38.8311 22.0342 38.8311C22.4251 38.8311 22.8064 38.7594 23.1672 38.6181L35.8092 31.2971C36.5347 30.7348 36.9617 29.8869 37 28.9686V14.9723Z",fill:rt})]})},Telos=({testnet:et,...o})=>jsxRuntimeExports.jsx("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:et?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#571AFF"},children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M26.1834 8.14754C25.6606 8.23504 25.3644 8.50235 24.9216 9.28591C24.5651 9.91722 24.4762 10.0244 24.2024 10.1592L23.9832 10.2668L19.2967 10.286L14.6097 10.3057L14.3875 10.3902C13.7059 10.6492 13.6192 10.7135 11.6291 12.4407C9.72243 14.0953 9.64893 14.1723 9.59249 14.5836C9.54437 14.9362 9.78981 15.6327 10.5191 17.2143C11.2847 18.8737 11.2839 18.8641 10.7444 19.5256C10.2645 20.1136 10.2269 20.2588 10.2041 21.5915C10.1717 23.502 10.2487 27.6023 10.3222 27.8591C10.3572 27.9816 10.7908 29.204 11.2861 30.5755C11.7813 31.9471 12.4192 33.715 12.704 34.5038C13.4281 36.5107 13.4814 36.5986 14.0392 36.7237C14.3066 36.7837 14.3206 36.781 18.9677 35.7258C24.4395 34.4837 23.7264 34.709 25.0739 33.7968C29.8732 30.5475 29.7337 30.66 29.8969 29.9083C30.0583 29.1642 30.1082 29.1379 31.8267 28.8999C34.6122 28.5145 34.6328 28.5083 34.8831 28.0109C35.0182 27.7423 35.7786 23.3406 35.8136 22.6209C35.8504 21.8828 36.042 22.221 33.3816 18.3395C30.022 13.4382 30.2381 13.7777 30.2399 13.4041C30.2407 13.1735 30.3366 12.9736 31.3236 11.1418C31.8236 10.2134 32.2742 9.35241 32.3254 9.22904C32.5236 8.74691 32.4204 8.3921 32.0301 8.21622L31.8267 8.12391L29.1102 8.11822C27.6048 8.11516 26.2997 8.12829 26.1834 8.14754ZM30.0474 9.4876C30.5623 9.72297 30.5382 9.82447 29.5119 11.7398C28.4317 13.7558 28.3157 13.2711 30.7154 16.7707C31.639 18.1173 32.8076 19.8218 33.3124 20.5581C34.6844 22.5592 34.6048 22.1799 34.1831 24.6903C33.7858 27.0602 33.7792 27.0817 33.3759 27.282C33.1506 27.394 33.2276 27.3813 30.8493 27.7117C28.9147 27.9803 28.8543 28.017 28.6719 29.0338C28.5778 29.557 28.4606 29.8169 28.2243 30.0247C28.0808 30.1512 24.8682 32.368 23.9451 32.9778C23.2587 33.4311 23.6861 33.3152 17.7471 34.6574C17.1997 34.7812 16.4079 34.9632 15.987 35.0617C14.4588 35.4195 14.4299 35.4033 13.8804 33.8948C12.9188 31.2528 11.6811 27.7957 11.6194 27.5787C11.5534 27.3463 11.549 27.1202 11.549 24.059V20.7878L11.6501 20.5966C11.7056 20.4912 11.8671 20.2759 12.0088 20.118C12.8418 19.19 12.8383 19.1183 11.8601 16.9907C10.7663 14.612 10.6797 14.9992 12.697 13.2501C14.2418 11.91 14.3048 11.8593 14.5905 11.7237L14.8394 11.6055L19.6983 11.5854C23.5417 11.5692 24.5891 11.5543 24.7103 11.515C25.1465 11.3728 25.4086 11.1094 25.7975 10.4203C26.3851 9.38041 26.3111 9.40797 28.4597 9.41891C29.6996 9.42547 29.9332 9.43554 30.0474 9.4876Z",fill:"#F7F5FC"})}),Aurora=({testnet:et,...o})=>jsxRuntimeExports.jsx("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:et?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#6CD544"},children:jsxRuntimeExports.jsx("path",{d:"M22.0006 7.292C22.6198 7.29004 23.2271 7.46144 23.754 7.7868C24.2808 8.11216 24.706 8.57848 24.9816 9.133L34.3566 27.883C34.611 28.3912 34.7312 28.956 34.7058 29.5238C34.6805 30.0915 34.5103 30.6433 34.2116 31.1268C33.9129 31.6103 33.4956 32.0094 32.9992 32.2861C32.5028 32.5629 31.9439 32.7081 31.3756 32.708H12.6256C12.0573 32.7079 11.4985 32.5626 11.0023 32.2858C10.506 32.009 10.0888 31.6099 9.79022 31.1264C9.49163 30.6429 9.3216 30.0912 9.29628 29.5235C9.27096 28.9558 9.39119 28.3911 9.64556 27.883L19.0196 9.133C19.2951 8.57848 19.7203 8.11216 20.2472 7.7868C20.774 7.46144 21.3814 7.29004 22.0006 7.292ZM22.0006 5C20.9561 4.9999 19.9322 5.29059 19.0437 5.83952C18.1551 6.38846 17.4369 7.17394 16.9696 8.108L7.59456 26.858C7.16544 27.7156 6.96271 28.6687 7.00564 29.6268C7.04856 30.5848 7.33572 31.516 7.83982 32.3318C8.34392 33.1476 9.04823 33.821 9.88584 34.288C10.7235 34.755 11.6666 35.0001 12.6256 35H31.3756C32.3345 34.9999 33.2775 34.7547 34.1149 34.2876C34.9524 33.8206 35.6566 33.1472 36.1606 32.3314C36.6645 31.5156 36.9516 30.5845 36.9945 29.6265C37.0374 28.6686 36.8346 27.7156 36.4056 26.858L27.0316 8.108C26.5642 7.17394 25.846 6.38846 24.9574 5.83952C24.0689 5.29059 23.045 4.9999 22.0006 5Z",fill:"white"})}),Avalanche=({testnet:et,...o})=>jsxRuntimeExports.jsxs("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:et?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#E84142"},children:[jsxRuntimeExports.jsx("path",{d:"M11.0188 32.1528H15.4825C16.5334 32.1528 17.0589 32.1528 17.5278 32.023C18.042 31.8701 18.511 31.5991 18.9009 31.2261C19.2589 30.885 19.5173 30.4328 20.0269 29.5409L20.0272 29.5404L20.0422 29.5142L25.8314 19.2804C26.3456 18.3821 26.5999 17.93 26.7129 17.4554C26.8372 16.9412 26.8372 16.3988 26.7129 15.8847C26.6007 15.4136 26.3439 14.9648 25.8373 14.0798L25.8258 14.0597L23.56 10.1045C23.0911 9.27958 22.8538 8.86711 22.5543 8.71456C22.2323 8.55071 21.848 8.55071 21.526 8.71456C21.2265 8.86711 20.9892 9.27958 20.5202 10.1045L9.49892 29.5311C9.03561 30.3447 8.80392 30.7517 8.82089 31.0849C8.84349 31.4466 9.02994 31.7743 9.33507 31.9721C9.61756 32.1528 10.0809 32.1528 11.0188 32.1528Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M33.1506 32.1528H26.7547C25.8111 32.1528 25.3365 32.1528 25.0596 31.9721C24.7545 31.7743 24.5681 31.4411 24.5455 31.0794C24.5286 30.7486 24.7621 30.3456 25.2294 29.539L25.2295 29.5388L25.2404 29.5199L28.4328 24.0392C28.9018 23.2313 29.1391 22.8301 29.4329 22.6776C29.7548 22.5137 30.1336 22.5137 30.4555 22.6776C30.7472 22.8261 30.9744 23.2102 31.4241 23.9708L31.4248 23.9719L31.4613 24.0336L34.665 29.5143C34.6806 29.5413 34.696 29.5678 34.7113 29.5939L34.7113 29.594C35.1554 30.3603 35.382 30.7514 35.3657 31.0739C35.3486 31.4353 35.1566 31.7688 34.8515 31.9666C34.5689 32.1528 34.0942 32.1528 33.1506 32.1528Z",fill:"white"})]}),Celo=({testnet:et,...o})=>jsxRuntimeExports.jsx("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:et?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#FCFE72"},children:jsxRuntimeExports.jsx("path",{d:"M9 9H34.5183V18.112H30.3564C28.896 14.7687 25.6102 12.4171 21.777 12.4171C16.593 12.4171 12.3948 16.6422 12.3948 21.823C12.3948 27.0039 16.593 31.2654 21.777 31.2654C25.5373 31.2654 28.8231 28.9876 30.2829 25.7172H34.5178V34.682H9V9Z",fill:et?"#ffffff":"black"})}),Gnosis=({testnet:et,...o})=>jsxRuntimeExports.jsx("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:et?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#009CB4"},children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.3439 11.8664C17.9374 6.53462 26.7953 6.74397 32.1271 12.3374C32.4738 12.7038 32.8075 13.0832 33.1084 13.4823L22 24.5972L10.8916 13.4823C11.1991 13.0832 11.5262 12.7038 11.8729 12.3374C12.0234 12.1804 12.1804 12.0234 12.3439 11.8664ZM30.6094 13.3972C28.3196 11.0944 25.271 9.83182 22 9.83182C18.729 9.83182 15.6804 11.0944 13.3907 13.3972L22 22.0066L30.6094 13.3972ZM33.9785 14.7446L31.7215 17.0016C33.5402 19.1801 33.2523 22.425 31.0738 24.2437C29.1636 25.84 26.3897 25.84 24.4794 24.2437L22 26.7231L19.5271 24.2502C17.3486 26.0689 14.1037 25.7811 12.285 23.6026C10.6888 21.6923 10.6888 18.9185 12.285 17.0082L11.1271 15.8502L10.028 14.7446C8.7 16.9297 8 19.4418 8 21.9998C8 29.7325 14.2673 35.9998 22 35.9998C29.7327 35.9998 36 29.7325 36 21.9998C36.0065 19.4418 35.3 16.9297 33.9785 14.7446ZM30.6486 18.0747C31.1392 18.7093 31.4075 19.4943 31.4075 20.299C31.4075 21.1037 31.1392 21.8887 30.6486 22.5233C29.4187 24.113 27.1355 24.4074 25.5458 23.1775L30.6486 18.0747ZM18.4542 23.1839C17.8196 23.6745 17.0346 23.9427 16.2299 23.9427C15.4252 23.9427 14.6467 23.6745 14.0056 23.1904C12.4159 21.9605 12.1215 19.6708 13.3514 18.0811L18.4542 23.1839Z",fill:"white"})}),Evmos=({testnet:et,...o})=>jsxRuntimeExports.jsx("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:et?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#2D2A25"},children:jsxRuntimeExports.jsx("path",{d:"M18.4916 12.6668C12.9416 14.806 12.4332 20.2846 10.8418 22.8432C9.23155 25.4322 5.54251 26.8607 6.04698 28.1801C6.55143 29.4994 10.2449 28.0824 13.1669 28.9242C16.0543 29.7561 20.0831 33.4862 25.633 31.3469C28.4603 30.2573 30.5076 28.0143 31.449 25.3574C31.5502 25.0723 31.361 24.7673 31.0606 24.7391C30.874 24.7215 30.6948 24.8196 30.6106 24.9877C29.759 26.6908 28.2981 28.0934 26.3864 28.8301C23.2303 30.0465 19.777 29.0915 17.6562 26.6961C17.1746 26.1522 16.7626 25.533 16.4374 24.8487C16.348 24.6603 16.2629 24.4689 16.1875 24.2708C16.1117 24.0728 16.0473 23.8735 15.9881 23.6732C17.6562 22.8925 19.5812 22.0656 21.7635 21.2246C23.903 20.3999 25.8505 19.731 27.5841 19.1958C28.7571 18.8341 29.8322 18.5331 30.8029 18.2871C30.8732 18.2695 30.9423 18.2519 31.0112 18.2347C31.158 18.1982 31.3088 18.2769 31.363 18.4186L31.364 18.4213C31.396 18.5053 31.4236 18.5898 31.4535 18.6743C31.6453 19.2196 31.7892 19.7706 31.8841 20.3229C31.9258 20.5645 32.1888 20.6961 32.4044 20.5799C33.2014 20.1504 33.9302 19.7314 34.5814 19.3283C37.0083 17.8276 38.3538 16.5549 38.0776 15.8336C37.802 15.1119 35.9541 15.0705 33.1503 15.5854C32.2593 15.7491 31.2716 15.9691 30.207 16.2416C30.0229 16.2886 29.8365 16.3375 29.6481 16.3877C28.7522 16.6262 27.8073 16.8995 26.8234 17.2053C24.9936 17.7744 23.0305 18.4561 21.0038 19.2372C19.1078 19.9682 17.3109 20.726 15.6629 21.4812C15.6428 18.2761 17.5725 15.2461 20.7286 14.0297C22.6399 13.293 24.6605 13.3533 26.4285 14.0473C26.6029 14.116 26.8015 14.0684 26.9291 13.9298C27.1331 13.7076 27.0706 13.3537 26.8053 13.2094C24.3353 11.8685 21.319 11.5771 18.4916 12.6668Z",fill:"#FAF1E4"})}),BinanceSmartChain=({testnet:et,...o})=>jsxRuntimeExports.jsxs("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:et?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#16181A"},children:[jsxRuntimeExports.jsx("path",{d:"M16.0445 19.6063L21.8705 13.7805L27.6996 19.6093L31.0896 16.2193L21.8705 7L12.6545 16.2163L16.0445 19.6063Z",fill:et?"#fff":"#F3BA2F"}),jsxRuntimeExports.jsx("path",{d:"M13.6505 21.9995L10.2606 18.6096L6.87046 21.9997L10.2604 25.3896L13.6505 21.9995Z",fill:et?"#fff":"#F3BA2F"}),jsxRuntimeExports.jsx("path",{d:"M16.0445 24.3937L21.8705 30.2195L27.6994 24.3909L31.0913 27.779L31.0896 27.7809L21.8705 37L12.6542 27.7839L12.6495 27.7792L16.0445 24.3937Z",fill:et?"#fff":"#F3BA2F"}),jsxRuntimeExports.jsx("path",{d:"M33.4808 25.3911L36.8709 22.001L33.481 18.6111L30.0909 22.0012L33.4808 25.3911Z",fill:et?"#fff":"#F3BA2F"}),jsxRuntimeExports.jsx("path",{d:"M25.3091 21.9982H25.3105L21.8705 18.5582L19.3283 21.1004H19.3281L19.0362 21.3926L18.4336 21.9951L18.4289 21.9999L18.4336 22.0048L21.8705 25.4418L25.3105 22.0018L25.3122 21.9999L25.3091 21.9982Z",fill:et?"#fff":"#F3BA2F"})]}),Canto=({testnet:et,...o})=>jsxRuntimeExports.jsx("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:et?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"white"},children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M35 8V36H9L13.875 35.9998V31.0586H9V12.9412H13.875V8H35ZM17.9373 12.9414H30.1247V17.8826H17.9373V12.9414ZM30.1247 26.9414H17.9373V17.8826L13.0623 17.8828V26.9416L17.9373 26.9414V31.8826H30.1247V26.9414Z",fill:"#06FC99"})}),Fantom=({testnet:et,...o})=>jsxRuntimeExports.jsx("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:et?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#0911EF"},children:jsxRuntimeExports.jsx("path",{d:"M20.92 9.25864C21.5933 8.91379 22.6178 8.91379 23.2911 9.25864L30.1616 12.7775C30.5671 12.9852 30.7898 13.2947 30.8297 13.6142H30.8363V31.302C30.8274 31.6504 30.6025 31.9966 30.1616 32.2225L23.2911 35.7413C22.6178 36.0862 21.5933 36.0862 20.92 35.7413L14.0495 32.2225C13.6104 31.9976 13.3997 31.6489 13.3893 31.302C13.3883 31.2678 13.3881 31.2393 13.3891 31.2157L13.3891 13.7278C13.3884 13.7086 13.3883 13.6895 13.3889 13.6705L13.3893 13.6142L13.3924 13.6142C13.4229 13.2912 13.6355 12.9896 14.0495 12.7775L20.92 9.25864ZM29.7547 23.4821L23.2911 26.7926C22.6178 27.1374 21.5933 27.1374 20.92 26.7926L14.4706 23.4895V31.2669L20.92 34.5527C21.2842 34.7415 21.6622 34.9254 22.0318 34.9488L22.1056 34.9512C22.4907 34.9524 22.8646 34.7628 23.2438 34.5833L29.7547 31.2387V23.4821ZM11.3214 31.8437C11.3214 32.5212 11.4026 32.9667 11.5639 33.2806C11.6976 33.5407 11.8981 33.7394 12.2643 33.9813L12.2852 33.9951C12.3656 34.0476 12.4541 34.1026 12.5619 34.1672L12.689 34.2427L13.0792 34.4711L12.5195 35.3685L12.0827 35.1126L12.0093 35.0689C11.883 34.9932 11.7783 34.9284 11.6807 34.8645C10.637 34.1822 10.2478 33.4384 10.2401 31.8907L10.24 31.8437H11.3214ZM21.5647 18.7412C21.5147 18.7579 21.4678 18.7772 21.4251 18.7991L14.5546 22.318C14.5474 22.3216 14.5405 22.3253 14.534 22.3289L14.5281 22.3322L14.5389 22.3382L14.5546 22.3464L21.4251 25.8653C21.4678 25.8872 21.5147 25.9065 21.5647 25.9231V18.7412ZM22.6465 18.7412V25.9231C22.6965 25.9065 22.7433 25.8872 22.7861 25.8653L29.6566 22.3464C29.6638 22.3427 29.6707 22.3391 29.6772 22.3355L29.683 22.3322L29.6722 22.3262L29.6566 22.318L22.7861 18.7991C22.7433 18.7772 22.6965 18.7579 22.6465 18.7412ZM29.7547 14.8689L23.5915 18.0256L29.7547 21.1822V14.8689ZM14.4706 14.8763V21.1749L20.6195 18.0256L14.4706 14.8763ZM22.7861 10.1859C22.4288 10.0029 21.7824 10.0029 21.4251 10.1859L14.5546 13.7048C14.5474 13.7085 14.5405 13.7122 14.534 13.7158L14.5281 13.719L14.5389 13.725L14.5546 13.7333L21.4251 17.2522C21.7824 17.4352 22.4288 17.4352 22.7861 17.2522L29.6566 13.7333C29.6638 13.7296 29.6707 13.7259 29.6772 13.7223L29.683 13.719L29.6722 13.7131L29.6566 13.7048L22.7861 10.1859ZM31.7205 9.64552L32.1573 9.90132L32.2307 9.94503C32.357 10.0206 32.4616 10.0856 32.5593 10.1494C33.603 10.8317 33.9922 11.5756 33.9998 13.1231L34 13.1703H32.9186C32.9186 12.4926 32.8373 12.0472 32.6761 11.7334C32.5424 11.4733 32.3419 11.2745 31.9757 11.0327L31.9547 11.0189C31.8744 10.9664 31.7858 10.9113 31.6781 10.8466L31.551 10.7712L31.1608 10.5428L31.7205 9.64552Z",fill:"white"})}),Filecoin=({testnet:et,...o})=>jsxRuntimeExports.jsx("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:et?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#0090FF"},children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23.75 19.3069L23.15 22.5069L28.85 23.3069L28.45 24.8069L22.85 24.0069C22.45 25.3069 22.25 26.7069 21.75 27.9069C21.25 29.3069 20.75 30.7069 20.15 32.0069C19.35 33.7069 17.95 34.9069 16.05 35.2069C14.95 35.4069 13.75 35.3069 12.85 34.6069C12.55 34.4069 12.25 34.0069 12.25 33.7069C12.25 33.3069 12.45 32.8069 12.75 32.6069C12.95 32.5069 13.45 32.6069 13.75 32.7069C14.05 33.0069 14.35 33.4069 14.55 33.8069C15.15 34.6069 15.95 34.7069 16.75 34.1069C17.65 33.3069 18.15 32.2069 18.45 31.1069C19.05 28.7069 19.65 26.4069 20.15 24.0069V23.6069L14.85 22.8069L15.05 21.3069L20.55 22.1069L21.25 19.0069L15.55 18.1069L15.75 16.5069L21.65 17.3069C21.85 16.7069 21.95 16.2069 22.15 15.7069C22.65 13.9069 23.15 12.1069 24.35 10.5069C25.55 8.90687 26.95 7.90687 29.05 8.00687C29.95 8.00687 30.85 8.30687 31.45 9.00687C31.55 9.10687 31.75 9.30687 31.75 9.50687C31.75 9.90687 31.75 10.4069 31.45 10.7069C31.05 11.0069 30.55 10.9069 30.15 10.5069C29.85 10.2069 29.65 9.90687 29.35 9.60687C28.75 8.80687 27.85 8.70687 27.15 9.40687C26.65 9.90687 26.15 10.6069 25.85 11.3069C25.15 13.4069 24.65 15.6069 23.95 17.8069L29.45 18.6069L29.05 20.1069L23.75 19.3069Z",fill:"white"})}),IoTeX=({testnet:et,...o})=>jsxRuntimeExports.jsxs("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:et?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#00D4D5"},children:[jsxRuntimeExports.jsx("path",{d:"M23.7136 6.875V14.3784L30.2284 10.6315L23.7136 6.875Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.9",d:"M30.2284 10.6316V18.135L36.7418 14.3785L30.2284 10.6316Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.8",d:"M23.7136 14.3784V21.8818L30.2284 18.1349L23.7136 14.3784ZM30.2284 18.1349V25.6383L36.7417 21.8818L30.2284 18.1349Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.8",d:"M23.7136 21.8817V29.385L30.2284 25.6382L23.7136 21.8817Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M30.2284 25.6382V33.1416L36.7418 29.3851L30.2284 25.6382Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.4",d:"M6.87537 14.1253V21.6287L13.3901 17.8722L6.87537 14.1253Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.2",d:"M15.0938 16.9153V24.4186L21.5975 20.6718L15.0938 16.9153Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.3",d:"M10.2648 21.6604V29.1638L16.7781 25.4073L10.2648 21.6604Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.9",d:"M14.5575 27.3226V34.826L21.0612 31.0695L14.5575 27.3226Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.7",d:"M23.66 30.5525V38.0572L30.1637 34.2993L23.66 30.5525Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.9",d:"M16.1786 13.2097V20.7145L22.6824 16.9676L16.1786 13.2097Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.8",d:"M23.7136 6.875V14.3784L17.1989 10.6315L23.7136 6.875Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.6",d:"M16.1786 10.0649V17.5669L9.66248 13.8104L16.1786 10.0649Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.6",d:"M22.6934 13.7775V21.2823L16.1786 17.5244L22.6934 13.7775Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.95",d:"M15.0635 16.9153V24.4186L8.54877 20.6718L15.0635 16.9153Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.6",d:"M23.7136 21.8817V29.385L17.2099 25.6382L23.7136 21.8817Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.55",d:"M10.2648 23.6295V31.1328L3.75 27.375L10.2648 23.6295Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M36.7418 14.3784V21.8818L30.2284 18.1349L36.7418 14.3784Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.95",d:"M30.2284 18.1362V25.6382L23.7136 21.8817L30.2284 18.1362Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.9",d:"M36.7418 21.8817V29.385L30.2284 25.6382L36.7418 21.8817Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.7",d:"M30.2284 25.6382V33.1416L23.7136 29.3851L30.2284 25.6382Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.4",d:"M22.2712 28.7651V36.2684L15.7579 32.5216L22.2712 28.7651Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M30.2284 10.6316V18.135L23.7136 14.3785L30.2284 10.6316Z",fill:"white"})]}),Metis=({testnet:et,...o})=>jsxRuntimeExports.jsx("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:et?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#2F3140"},children:jsxRuntimeExports.jsx("path",{d:"M37.5175 22.0531C37.4579 19.2923 36.6563 16.5985 35.1968 14.2542C33.7374 11.91 31.674 10.0017 29.223 8.72965C26.772 7.45759 24.0238 6.86863 21.2668 7.02455C18.5098 7.18047 15.8456 8.07553 13.5537 9.61582C11.2617 11.1561 9.42659 13.2849 8.24079 15.7787C7.05498 18.2725 6.56222 21.0396 6.81419 23.7895C7.06617 26.5394 8.05359 29.1708 9.67288 31.4076C11.2922 33.6444 13.4836 35.4042 16.0173 36.5023C16.7657 35.3775 17.3385 34.1453 17.716 32.848C18.0245 32.0632 18.3595 31.2913 18.7067 30.5446C19.5444 30.7955 20.4345 30.8143 21.282 30.5989C22.1295 30.3835 22.9026 29.942 23.5188 29.3215L23.5704 29.2699C22.8136 28.9884 21.9979 28.9032 21.1993 29.022C20.4006 29.1408 19.6451 29.4598 19.0029 29.9494C19.4276 29.0613 19.891 28.1997 20.3667 27.3632C21.189 27.6541 22.075 27.7156 22.9296 27.541C23.7842 27.3665 24.5751 26.9626 25.2175 26.3726L25.2692 26.3209C24.538 26.0116 23.7416 25.8885 22.9513 25.9626C22.1609 26.0368 21.4013 26.3058 20.7404 26.7456C21.216 25.9608 21.7053 25.1889 22.2203 24.468C23.0713 24.6915 23.9672 24.6777 24.811 24.4282C25.6547 24.1787 26.414 23.703 27.0066 23.0526L27.0453 23.001C26.3425 22.7718 25.5958 22.7106 24.8651 22.8224C24.1344 22.9341 23.4401 23.2157 22.838 23.6444C22.8767 23.5928 22.9283 23.5289 22.9664 23.4773C23.2749 23.0784 23.5969 22.6796 23.9177 22.2936C24.8969 21.9731 25.7703 21.3916 26.4436 20.6117C27.117 19.8318 27.5649 18.883 27.7391 17.8674L27.752 17.79H27.7391C26.7194 18.0552 25.7944 18.6007 25.0689 19.3648C24.3434 20.1288 23.8464 21.0808 23.6343 22.1129C23.3258 22.4859 23.0167 22.8603 22.7211 23.2449C22.9706 22.5925 23.0724 21.893 23.0191 21.1966C22.9657 20.5002 22.7586 19.8243 22.4126 19.2176L22.3739 19.2692C21.8489 19.9862 21.5326 20.8345 21.4599 21.7201C21.3873 22.6058 21.5611 23.4942 21.9621 24.2872C21.4729 24.9823 20.9972 25.6897 20.5467 26.4357C20.6918 25.6858 20.6542 24.9118 20.4369 24.1795C20.2196 23.4471 19.8291 22.7779 19.2985 22.2284L19.2727 22.2929C18.9445 23.1107 18.8477 24.0031 18.9929 24.8723C19.1382 25.7415 19.5199 26.5539 20.0962 27.2205C19.6457 28.0054 19.2211 28.816 18.8093 29.6524C18.9344 28.8712 18.8712 28.0715 18.6251 27.3196C18.3789 26.5677 17.9568 25.8855 17.3939 25.3295L17.3681 25.3941C17.0745 26.2514 17.0201 27.1724 17.2105 28.0583C17.401 28.9442 17.8292 29.7614 18.4492 30.4223C18.1774 31.0012 17.9219 31.5774 17.6773 32.1849C17.61 32.1231 17.5313 32.0751 17.4456 32.0435C17.0066 31.916 16.5867 31.7299 16.1974 31.4904C15.8754 31.2994 15.5337 31.144 15.1781 31.027C13.7886 30.5765 13.9945 29.9079 13.2756 28.5564C13.0416 28.2781 12.7931 28.0125 12.5309 27.7607C12.2876 27.603 12.0884 27.386 11.9519 27.1302C11.7934 26.8107 11.6931 26.4656 11.6557 26.1109C11.6514 25.9148 11.5858 25.7249 11.4681 25.5679C11.3504 25.4109 11.1864 25.2948 10.9993 25.2358C8.95338 24.5284 9.86728 21.8778 9.94406 21.5299C9.91262 21.08 9.81271 20.6375 9.64781 20.2178C9.63057 20.1632 9.61763 20.1073 9.60908 20.0506C9.55449 19.776 9.56444 19.4924 9.63813 19.2223C9.71183 18.9521 9.84726 18.7028 10.0338 18.4939C10.2784 18.2493 11.1277 17.8505 11.3078 17.6188C11.4879 17.387 11.6163 17.1295 11.797 16.9114C12.3687 16.3412 13.0291 15.8675 13.7526 15.509C14.3444 15.1876 14.4477 14.364 14.6787 14.1065C15.0647 13.6689 15.6565 13.6689 16.0941 13.283C16.3129 13.09 16.6377 12.9867 16.8415 12.7815C17.8692 11.8403 19.1644 11.2423 20.5474 11.0706C21.5064 10.9924 22.4717 11.0795 23.4012 11.3281C23.5358 11.3507 23.669 11.3809 23.8001 11.4185C25.9228 11.4959 28.4709 11.9328 29.397 12.8338C29.8555 13.2744 30.1961 13.8229 30.3877 14.4293C30.5382 14.8988 30.7456 15.3481 31.0054 15.7672L31.5714 16.6933C31.932 17.2773 32.0475 17.9801 31.8928 18.6489C31.7885 18.974 31.7795 19.3223 31.8669 19.6525C32.1655 20.1031 32.5152 20.5177 32.9093 20.8878C33.0658 21.0427 33.2382 21.1807 33.4236 21.2995C33.8592 21.5594 34.2802 21.8429 34.6848 22.1489C34.698 22.2729 34.6775 22.3982 34.6254 22.5115C34.5732 22.6247 34.4914 22.7218 34.3885 22.7924C34.0284 23.1137 33.3333 23.6159 33.3333 23.6159C33.3584 23.758 33.4016 23.8964 33.4617 24.0276C33.5643 24.2077 33.796 24.4911 33.7192 24.735C33.6424 24.9789 33.1403 25.1855 33.2816 25.4552C33.423 25.7386 33.7831 25.8154 33.6805 26.0729C33.5779 26.3175 33.0757 26.7524 33.1274 26.9352C33.179 27.1179 33.5908 28.8377 32.6382 29.1353C31.4592 29.3685 30.2627 29.5019 29.0614 29.5342C28.8675 29.5454 28.6797 29.6055 28.5155 29.709C28.3513 29.8125 28.216 29.956 28.1223 30.126C27.9399 30.4661 27.8222 30.837 27.7751 31.22C27.4275 32.5896 26.9671 33.928 26.3985 35.2215C26.3985 35.2215 26.3597 35.2989 26.3081 35.4144C26.1833 35.6687 26.1048 35.9432 26.0764 36.2251C26.1573 36.4321 26.2799 36.6204 26.4365 36.7782C26.519 36.8726 26.6271 36.9411 26.7477 36.9753C26.8683 37.0096 26.9962 37.0081 27.116 36.9711C30.1997 35.8965 32.8655 33.8757 34.7332 31.197C36.601 28.5182 37.5754 25.3182 37.5175 22.0531Z",fill:et?"#ffffff":"#00DACC"})});var Chains={UnknownChain,Ethereum,Polygon,Optimism,Arbitrum,Aurora,Avalanche,Celo,Telos,Gnosis,Evmos,BinanceSmartChain,Foundry:KnownChain,Sepolia:KnownChain,Taraxa:KnownChain,zkSync:KnownChain,Flare:KnownChain,Canto,Fantom,Filecoin,Metis,IoTeX};const chainConfigs=[{id:1,name:"Ethereum",logo:jsxRuntimeExports.jsx(Chains.Ethereum,{}),rpcUrls:{alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]}}},{id:3,name:"Rinkeby",logo:jsxRuntimeExports.jsx(Chains.Ethereum,{testnet:!0}),rpcUrls:{}},{id:4,name:"Ropsten",logo:jsxRuntimeExports.jsx(Chains.Ethereum,{testnet:!0})},{id:5,name:"Görli",logo:jsxRuntimeExports.jsx(Chains.Ethereum,{testnet:!0})},{id:42,name:"Kovan",logo:jsxRuntimeExports.jsx(Chains.Ethereum,{testnet:!0})},{id:10,name:"Optimism",logo:jsxRuntimeExports.jsx(Chains.Optimism,{})},{id:69,name:"Optimism Kovan",logo:jsxRuntimeExports.jsx(Chains.Optimism,{testnet:!0})},{id:420,name:"Optimism Goerli",logo:jsxRuntimeExports.jsx(Chains.Optimism,{testnet:!0})},{id:137,name:"Polygon",logo:jsxRuntimeExports.jsx(Chains.Polygon,{})},{id:80001,name:"Polygon Mumbai",logo:jsxRuntimeExports.jsx(Chains.Polygon,{testnet:!0})},{id:31337,name:"Hardhat",logo:jsxRuntimeExports.jsx(Chains.Ethereum,{testnet:!0})},{id:1337,name:"Localhost",logo:jsxRuntimeExports.jsx(Chains.Ethereum,{testnet:!0})},{id:42161,name:"Arbitrum",logo:jsxRuntimeExports.jsx(Chains.Arbitrum,{}),rpcUrls:{alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]}}},{id:421611,name:"Arbitrum Rinkeby",logo:jsxRuntimeExports.jsx(Chains.Arbitrum,{testnet:!0})},{id:421613,name:"Arbitrum Goerli",logo:jsxRuntimeExports.jsx(Chains.Arbitrum,{testnet:!0}),rpcUrls:{alchemy:{http:["https://arb-goerli.g.alchemy.com/v2"],webSocket:["wss://arb-goerli.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-goerli.infura.io/v3"],webSocket:["wss://arbitrum-goerli.infura.io/ws/v3"]}}},{id:40,name:"Telos",logo:jsxRuntimeExports.jsx(Chains.Telos,{})},{id:41,name:"Telos Testnet",logo:jsxRuntimeExports.jsx(Chains.Telos,{testnet:!0})},{id:1313161554,name:"Aurora",logo:jsxRuntimeExports.jsx(Chains.Aurora,{})},{id:1313161555,name:"Aurora Testnet",logo:jsxRuntimeExports.jsx(Chains.Aurora,{testnet:!0})},{id:43114,name:"Avalanche",logo:jsxRuntimeExports.jsx(Chains.Avalanche,{})},{id:43113,name:"Avalanche Fuji",logo:jsxRuntimeExports.jsx(Chains.Avalanche,{testnet:!0})},{id:31337,name:"Foundry",logo:jsxRuntimeExports.jsx(Chains.Foundry,{testnet:!0})},{id:100,name:"Gnosis",logo:jsxRuntimeExports.jsx(Chains.Gnosis,{})},{id:9001,name:"Evmos",logo:jsxRuntimeExports.jsx(Chains.Evmos,{})},{id:9e3,name:"Evmos Testnet",logo:jsxRuntimeExports.jsx(Chains.Evmos,{testnet:!0})},{id:56,name:"BNB Smart Chain",logo:jsxRuntimeExports.jsx(Chains.BinanceSmartChain,{})},{id:97,name:"Binance Smart Chain Testnet",logo:jsxRuntimeExports.jsx(Chains.BinanceSmartChain,{testnet:!0})},{id:11155111,name:"Sepolia",logo:jsxRuntimeExports.jsx(Chains.Sepolia,{})},{id:841,name:"Taraxa",logo:jsxRuntimeExports.jsx(Chains.Taraxa,{})},{id:842,name:"Taraxa Testnet",logo:jsxRuntimeExports.jsx(Chains.Taraxa,{testnet:!0})},{id:324,name:"zkSync",logo:jsxRuntimeExports.jsx(Chains.zkSync,{})},{id:280,name:"zkSync Testnet",logo:jsxRuntimeExports.jsx(Chains.zkSync,{testnet:!0})},{id:42220,name:"Celo",logo:jsxRuntimeExports.jsx(Chains.Celo,{})},{id:44787,name:"Celo Alfajores",logo:jsxRuntimeExports.jsx(Chains.Celo,{testnet:!0})},{id:7700,name:"Canto",logo:jsxRuntimeExports.jsx(Chains.Canto,{})},{id:250,name:"Fantom",logo:jsxRuntimeExports.jsx(Chains.Fantom,{})},{id:4002,name:"Fantom Testnet",logo:jsxRuntimeExports.jsx(Chains.Fantom,{testnet:!0})},{id:14,name:"Flare",logo:jsxRuntimeExports.jsx(Chains.Flare,{})},{id:114,name:"Coston2",logo:jsxRuntimeExports.jsx(Chains.Flare,{})},{id:314,name:"Filecoin",logo:jsxRuntimeExports.jsx(Chains.Filecoin,{})},{id:3141,name:"Filecoin Hyperspace",logo:jsxRuntimeExports.jsx(Chains.Filecoin,{testnet:!0})},{id:314159,name:"Filecoin Calibration",logo:jsxRuntimeExports.jsx(Chains.Filecoin,{testnet:!0})},{id:1088,name:"Metis",logo:jsxRuntimeExports.jsx(Chains.Metis,{})},{id:599,name:"Metis Goerli",logo:jsxRuntimeExports.jsx(Chains.Metis,{testnet:!0})},{id:4689,name:"IoTeX",logo:jsxRuntimeExports.jsx(Chains.IoTeX,{})},{id:4690,name:"IoTeX Testnet",logo:jsxRuntimeExports.jsx(Chains.IoTeX,{testnet:!0})}],SwitchNetworksContainer=styled.div`
display: flex;
flex-direction: column;
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
flex-direction: column-reverse;
}
`,ChainIcon=styled(motion.div)`
display: block;
position: relative;
border-radius: 12px;
overflow: hidden;
width: 24px;
height: 24px;
min-width: 24px;
min-height: 24px;
background: var(--ck-body-background);
svg {
border-radius: inherit;
display: block;
position: relative;
transform: translate3d(0, 0, 0);
width: 100%;
height: auto;
}
${et=>et.$empty&&Ae`
display: flex;
align-items: center;
justify-content: center;
&:before {
content: '?';
color: var(--ck-body-color-muted);
font-weight: bold;
font-family: var(--ck-font-family);
}
`}
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
border-radius: 16px;
width: 32px;
height: 32px;
}
`,ChainLogoContainer=styled(motion.div)`
position: relative;
`,ChainLogoSpinner=styled(motion.div)`
position: absolute;
inset: -6px;
animation: rotateSpinner 1200ms linear infinite;
pointer-events: none;
svg {
display: block;
position: relative;
transform: translate3d(0, 0, 0);
width: 100%;
height: auto;
}
@keyframes rotateSpinner {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
`,ChainButtonContainer=styled.div`
position: relative;
margin: -8px -8px;
&:after {
border-radius: var(--border-radius, 0);
z-index: 2;
content: '';
pointer-events: none;
position: absolute;
inset: 0 2px;
box-shadow: inset 0 16px 8px -12px var(--background, var(--ck-body-background)),
inset 0 -16px 8px -12px var(--background, var(--ck-body-background));
}
`,ChainButtons=styled(motion.div)`
padding: 8px;
overflow-x: hidden;
overflow-y: auto;
max-height: 242px;
-ms-overflow-style: none; /* Internet Explorer 10+ */
scrollbar-width: none; /* Firefox */
&::-webkit-scrollbar {
display: none; /* Safari and Chrome */
}
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
padding: 8px 14px;
margin: 2px -2px 0;
max-height: 60vh;
}
`,ChainButton=styled(motion.button)`
appearance: none;
cursor: pointer;
user-select: none;
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
border-radius: 11px;
margin: 0 0 1px;
padding: 8px 0;
padding-right: 154px;
font-size: 15px;
line-height: 18px;
font-weight: 500;
text-decoration: none;
color: var(--ck-body-color);
background: none;
white-space: nowrap;
transition: transform 100ms ease, background-color 100ms ease;
transform: translateZ(0px);
&:before {
content: '';
background: currentColor;
position: absolute;
z-index: -1;
inset: 0 var(--ck-dropdown-active-inset, -8px);
border-radius: var(--ck-dropdown-active-border-radius, 12px);
opacity: 0;
transition: opacity 180ms ease;
}
&:after {
content: '';
position: absolute;
z-index: -1;
inset: 0 var(--ck-dropdown-active-inset, -8px);
border-radius: 12px;
opacity: 0;
transition: opacity 180ms ease;
outline: 2px solid var(--ck-focus-color);
}
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
font-size: 17px;
padding: 8px 0;
}
@media only screen and (min-width: ${defaultTheme.mobileWidth}px) {
&:hover {
&:before {
transition-duration: 80ms;
opacity: 0.05;
}
}
}
&:active {
transform: scale(0.99) translateZ(0px);
}
&:disabled {
//opacity: 0.4;
pointer-events: none;
}
&:focus-visible {
outline: none !important;
&:after {
opacity: 1;
}
}
${et=>et.$variant==="secondary"&&Ae`
padding: 12px 4px;
margin: 0 0 8px;
&:last-child {
margin-bottom: 0;
}
&:before {
opacity: 0.05;
}
&:hover:before {
opacity: 0.1;
}
`}
`,ChainButtonStatus=styled(motion.div)`
position: absolute;
top: 0;
bottom: 0;
right: 0;
display: flex;
align-items: center;
justify-content: center;
color: var(--ck-body-color-muted);
font-size: 15px;
line-height: 18px;
font-weight: 500;
padding-right: 4px;
span {
display: block;
position: relative;
}
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
font-size: 17px;
padding: 0;
}
`,ChainButtonBg=styled(motion.div)`
position: absolute;
z-index: -1;
inset: 0 var(--ck-dropdown-active-inset, -8px);
background: var(--ck-dropdown-active-background, rgba(26, 136, 248, 0.1));
box-shadow var(--ck-dropdown-active-box-shadow);
border-radius: var(--ck-dropdown-active-border-radius, 12px);
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
inset: 0 var(--ck-dropdown-active-inset, -8px);
}
`,Spinner$1=jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 16.75C2.69036 16.75 3.25 17.3096 3.25 18V19C3.25 26.5939 9.40609 32.75 17 32.75V35.25C8.02537 35.25 0.75 27.9746 0.75 19V18C0.75 17.3096 1.30964 16.75 2 16.75Z",fill:"url(#paint0_linear_1288_18701)"}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_1288_18701",x1:"2",y1:"19.4884",x2:"16.8752",y2:"33.7485",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-spinner-color)"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"var(--ck-spinner-color)",stopOpacity:"0"})]})})]}),ChainSelectList=({variant:et})=>{const{connector:o,chain:tt}=useAccount(),{chains:rt,isPending:nt,switchChain:ot,error:it}=useSwitchChain(),[st,at]=reactExports.useState(void 0),ct=useLocales({}),lt=isMobile(),dt=(it==null?void 0:it.code)===4902,ht=dt||!ot,mt=pt=>{ot&&(at(pt),ot({chainId:pt}))},{triggerResize:ft}=useContext();return jsxRuntimeExports.jsxs(SwitchNetworksContainer,{style:{marginBottom:ot!==void 0?-8:0},children:[jsxRuntimeExports.jsx(ChainButtonContainer,{children:jsxRuntimeExports.jsx(ChainButtons,{children:rt.map(pt=>{var yt;const bt={...chainConfigs.find(xt=>xt.id===pt.id),...pt};return jsxRuntimeExports.jsxs(ChainButton,{$variant:et,disabled:ht||bt.id===(tt==null?void 0:tt.id)||nt&&st===bt.id,onClick:()=>mt==null?void 0:mt(bt.id),style:{opacity:ht&&bt.id!==(tt==null?void 0:tt.id)?.4:void 0},children:[jsxRuntimeExports.jsxs("span",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:12,color:bt.id===(tt==null?void 0:tt.id)?"var(--ck-dropdown-active-color, inherit)":"inherit"},children:[jsxRuntimeExports.jsxs(ChainLogoContainer,{children:[jsxRuntimeExports.jsx(ChainLogoSpinner,{initial:{opacity:0},animate:{opacity:nt&&st===bt.id?1:0},transition:{ease:[.76,0,.24,1],duration:.15,delay:.1},children:jsxRuntimeExports.jsx(motion.div,{animate:lt&&isCoinbaseWalletConnector(o==null?void 0:o.id)&&nt&&st===bt.id?{opacity:[1,0],transition:{delay:4,duration:3}}:{opacity:1},children:Spinner$1},`${bt==null?void 0:bt.id}-${bt==null?void 0:bt.name}`)}),jsxRuntimeExports.jsx(ChainIcon,{children:(yt=bt.logo)!==null&&yt!==void 0?yt:jsxRuntimeExports.jsx(Chains.UnknownChain,{})})]}),bt.name]}),et!=="secondary"&&jsxRuntimeExports.jsx(ChainButtonStatus,{children:jsxRuntimeExports.jsxs(AnimatePresence,{initial:!1,exitBeforeEnter:!0,children:[bt.id===(tt==null?void 0:tt.id)&&jsxRuntimeExports.jsx(motion.span,{style:{color:"var(--ck-dropdown-active-color, var(--ck-focus-color))",display:"block",position:"relative"},initial:{opacity:0,x:-4},animate:{opacity:1,x:0},exit:{opacity:0,x:4,transition:{duration:.1,delay:0}},transition:{ease:[.76,0,.24,1],duration:.3,delay:.2},children:ct.connected},"connectedText"),nt&&st===bt.id&&jsxRuntimeExports.jsx(motion.span,{style:{color:"var(--ck-dropdown-pending-color, inherit)",display:"block",position:"relative"},initial:{opacity:0,x:-4},animate:{opacity:1,x:0},exit:{opacity:0,x:4},transition:{ease:[.76,0,.24,1],duration:.3,delay:.1},children:jsxRuntimeExports.jsx(motion.span,{animate:lt&&isCoinbaseWalletConnector(o==null?void 0:o.id)&&{opacity:[1,0],transition:{delay:4,duration:4}},children:ct.approveInWallet})},"approveText")]})}),et==="secondary"?jsxRuntimeExports.jsx(ChainButtonBg,{initial:!1,animate:{opacity:bt.id===(tt==null?void 0:tt.id)?1:0},transition:{duration:.3,ease:"easeOut"}}):bt.id===(tt==null?void 0:tt.id)&&jsxRuntimeExports.jsx(ChainButtonBg,{layoutId:"activeChain",layout:"position",transition:{duration:.3,ease:"easeOut"}})]},`${bt==null?void 0:bt.id}-${bt==null?void 0:bt.name}`)})})}),jsxRuntimeExports.jsx(AnimatePresence,{children:dt&&jsxRuntimeExports.jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{ease:[.76,0,.24,1],duration:.3},onAnimationStart:ft,onAnimationComplete:ft,children:jsxRuntimeExports.jsx("div",{style:{paddingTop:10,paddingBottom:8},children:jsxRuntimeExports.jsxs(Alert,{children:[ct.warnings_walletSwitchingUnsupported," ",ct.warnings_walletSwitchingUnsupportedResolve]})})})})]})},DropdownWindow=styled(motion.div)`
z-index: 2147483647;
position: fixed;
inset: 0;
`,DropdownOverlay=styled(motion.div)`
position: absolute;
inset: 0;
`,DropdownContainer=styled(motion.div)`
--shadow: 0px 2px 15px rgba(0, 0, 0, 0.15);
--background: var(--ck-dropdown-background, var(--ck-tooltip-background));
--border-radius: var(
--ck-dropdown-border-radius,
var(--ck-tooltip-border-radius, 12px)
);
pointer-events: auto;
z-index: 2147483647;
position: absolute;
top: 0;
left: 0;
width: 100%;
max-width: fit-content;
padding: 14px 16px 16px;
color: var(--ck-dropdown-color, var(--ck-tooltip-color));
background: var(--background);
box-shadow: var(
--ck-dropdown-box-shadow,
var(--ck-tooltip-shadow, var(--shadow))
);
border-radius: var(--border-radius);
`,DropdownHeading=styled(motion.div)`
padding: 0 0 6px;
font-size: 14px;
line-height: 20px;
font-weight: 400;
user-select: none;
color: var(--ck-dropdown-color, var(--ck-tooltip-color));
`,ChainSelectDropdown=({children:et,open:o,onClose:tt,offsetX:rt=0,offsetY:nt=8})=>{var ot,it,st;const at=useContext(),ct=useThemeContext(),lt=useLocales(),[dt,ht]=reactExports.useState({x:0,y:0});useLockBodyScroll(o);const mt=reactExports.useRef(null);reactExports.useEffect(()=>{const Ct=St=>{var At,kt,It;if(o&&(St.key==="Escape"&&tt(),St.key==="ArrowDown"||St.key==="ArrowUp")){if(!mt.current)return;St.preventDefault();const Nt=(At=mt.current)===null||At===void 0?void 0:At.querySelectorAll(`
a[href]:not(:disabled),
button:not(:disabled),
textarea:not(:disabled),
input[type="text"]:not(:disabled),
input[type="radio"]:not(:disabled),
input[type="checkbox"]:not(:disabled),
select:not(:disabled)
`),Lt=Nt[0],Mt=Nt[Nt.length-1];if(St.key==="ArrowUp")if(document.activeElement===Lt)Mt.focus();else{let zt=(kt=document==null?void 0:document.activeElement)===null||kt===void 0?void 0:kt.previousSibling;for(zt||(zt=Mt);zt.disabled;)zt=zt.previousSibling;zt.focus()}else if(document.activeElement===Mt)Lt.focus();else{let zt=(It=document==null?void 0:document.activeElement)===null||It===void 0?void 0:It.nextSibling;for(zt||(zt=Lt);zt.disabled;)zt=zt.nextSibling;zt.focus()}}};return document.addEventListener("keydown",Ct),()=>{document.removeEventListener("keydown",Ct)}},[o]);const ft=reactExports.useRef(null),pt=reactExports.useCallback(Ct=>{Ct&&(ft.current=Ct,bt())},[o]),[yt,gt]=useMeasure({debounce:120,offsetSize:!0,scroll:!0}),bt=()=>{if(!ft.current||gt.top+gt.bottom+gt.left+gt.right+gt.height+gt.width===0)return;let Ct=gt.left+rt,St=gt.top+gt.height+nt;ft.current.style.left=`${Ct}px`,ft.current.style.top=`${St}px`};(typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect)(bt,[ft.current,gt,o]),reactExports.useEffect(bt,[o,ft.current]);const vt=tt,Et=tt;return reactExports.useEffect(()=>(bt(),window.addEventListener("scroll",vt),window.addEventListener("resize",Et),()=>{window.removeEventListener("scroll",vt),window.removeEventListener("resize",Et)}),[]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{ref:yt,children:et}),jsxRuntimeExports.jsx(AnimatePresence,{children:o&&jsxRuntimeExports.jsx(Portal,{children:jsxRuntimeExports.jsx(ResetContainer,{$useTheme:(ot=ct.theme)!==null&&ot!==void 0?ot:at.theme,$useMode:(it=ct.mode)!==null&&it!==void 0?it:at.mode,$customTheme:(st=ct.customTheme)!==null&&st!==void 0?st:at.customTheme,children:jsxRuntimeExports.jsx(FocusTrap,{children:jsxRuntimeExports.jsxs(DropdownWindow,{ref:mt,children:[jsxRuntimeExports.jsx(DropdownOverlay,{onClick:tt}),jsxRuntimeExports.jsxs(DropdownContainer,{ref:pt,style:{left:dt.x,top:dt.y},initial:"collapsed",animate:"open",exit:"collapsed",variants:{collapsed:{transformOrigin:"0 0",opacity:0,scale:.96,z:.01,y:-4,x:0,transition:{duration:.1}},open:{transformOrigin:"0 0",willChange:"opacity,transform",opacity:1,scale:1,z:.01,y:0,x:0,transition:{ease:[.76,0,.24,1],duration:.15}}},children:[jsxRuntimeExports.jsx(DropdownHeading,{children:lt.switchNetworks}),jsxRuntimeExports.jsx(ChainSelectList,{})]})]})})})})})]})},ChainContainer=styled.div`
--bg: transparent;
--color: #333;
${et=>typeof et.size=="string"?Ae`
--width: ${et.size};
--height: ${et.size};
`:Ae`
--width: ${et.size>=0?`${et.size}px`:"24px"};
--height: ${et.size>=0?`${et.size}px`:"24px"};
`};
${et=>typeof et.radius=="string"?Ae`
--radius: ${et.radius};
`:Ae`
--radius: ${et.radius>=0?`${et.radius}px`:"24px"};
`};
display: block;
position: relative;
width: var(--width);
height: var(--height);
min-width: var(--width);
min-height: var(--height);
border-radius: var(--radius);
background: var(--ck-body-background-secondary);
pointer-events: none;
user-select: none;
svg {
display: block;
width: 100%;
height: auto;
}
> div {
display: flex;
align-items: center;
justify-content: center;
}
`,LogoContainer$1=styled(motion.div)`
display: block;
position: absolute;
inset: 0;
overflow: hidden;
border-radius: inherit;
user-select: none;
display: flex;
align-items: center;
justify-content: center;
svg {
display: block;
width: 100%;
height: auto;
}
`,Spin=We`
0%{ transform: rotate(0deg); }
100%{ transform: rotate(360deg); }
`,LoadingContainer=styled(motion.div)`
position: absolute;
inset: 0;
animation: ${Spin} 1s linear infinite;
svg {
display: block;
position: absolute;
inset: 0;
}
`,Unsupported=styled(motion.div)`
z-index: 2;
position: absolute;
top: 0;
right: 0;
width: 40%;
height: 40%;
min-width: 13px;
min-height: 13px;
color: var(--ck-body-color-danger, red);
svg {
display: block;
position: relative;
top: -30%;
right: -30%;
}
`,Spinner=jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.3592 30.1654C10.0472 29.4491 8.85718 28.524 7.83713 27.424C6.81708 26.324 5.98425 25.0677 5.36889 23.7054C5.20157 23.335 5.05033 22.9567 4.91578 22.5717C4.51465 21.4237 4.26735 20.2308 4.17794 19.0239C4.16599 18.8626 4.13894 18.7041 4.09809 18.5507C3.85023 17.6197 3.09399 16.8738 2.11531 16.7999C0.975331 16.7138 -0.0310983 17.5702 0.0141657 18.7125C0.0223289 18.9185 0.0340286 19.1243 0.049253 19.3298C0.165374 20.8971 0.486545 22.4464 1.00749 23.9373C1.10424 24.2142 1.20764 24.4884 1.31755 24.7596C2.13617 26.7799 3.31595 28.6371 4.80146 30.239C6.28696 31.841 8.04998 33.1573 10.0029 34.1258C10.2651 34.2558 10.5307 34.3796 10.7995 34.4969C12.247 35.1287 13.7676 35.5656 15.3217 35.7995C15.5255 35.8301 15.7298 35.8573 15.9346 35.881C17.0703 36.0122 18.0001 35.0731 18.0001 33.9299C18.0001 32.9484 17.3133 32.1381 16.4036 31.8208C16.2537 31.7685 16.0977 31.7296 15.9377 31.7056C14.7411 31.5255 13.5702 31.1891 12.4556 30.7026C12.0818 30.5394 11.716 30.3601 11.3592 30.1654Z",fill:"url(#paint0_linear_1288_1870)"}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_1288_1870",x1:"2",y1:"19.4884",x2:"16.8752",y2:"33.7485",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-connectbutton-balance-color,currentColor)",stopOpacity:"0.7"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"var(--ck-connectbutton-balance-color,currentColor)",stopOpacity:"0"})]})})]}),Chain=({id:et,unsupported:o,radius:tt="50%",size:rt=24})=>{var nt;const ot=useChainIsSupported(et),it=o??!ot,st=chainConfigs.find(ct=>ct.id===et);return useIsMounted()?jsxRuntimeExports.jsx(ChainContainer,{size:rt,radius:tt,children:jsxRuntimeExports.jsxs(AnimatePresence,{initial:!1,children:[it&&jsxRuntimeExports.jsx(Unsupported,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsxRuntimeExports.jsxs("svg",{width:"13",height:"12",viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{d:"M2.61317 11.2501H9.46246C10.6009 11.2501 11.3256 10.3506 11.3256 9.3549C11.3256 9.05145 11.255 8.73244 11.0881 8.43303L7.65903 2.14708C7.659 2.14702 7.65897 2.14696 7.65893 2.1469C7.65889 2.14682 7.65884 2.14673 7.65879 2.14664C7.31045 1.50746 6.6741 1.17871 6.04 1.17871C5.41478 1.17871 4.763 1.50043 4.41518 2.14968L0.993416 8.43476C0.828865 8.72426 0.75 9.04297 0.75 9.3549C0.75 10.3506 1.47471 11.2501 2.61317 11.2501Z",fill:"currentColor",stroke:"var(--ck-body-background, #fff)",strokeWidth:"1.5"}),jsxRuntimeExports.jsx("path",{d:"M6.03258 7.43916C5.77502 7.43916 5.63096 7.29153 5.62223 7.02311L5.55675 4.96973C5.54802 4.69684 5.74446 4.5 6.02821 4.5C6.3076 4.5 6.51277 4.70131 6.50404 4.9742L6.43856 7.01864C6.42546 7.29153 6.2814 7.43916 6.03258 7.43916ZM6.03258 9.11676C5.7401 9.11676 5.5 8.9065 5.5 8.60677C5.5 8.30704 5.7401 8.09678 6.03258 8.09678C6.32506 8.09678 6.56515 8.30256 6.56515 8.60677C6.56515 8.91097 6.32069 9.11676 6.03258 9.11676Z",fill:"white"})]})}),et?jsxRuntimeExports.jsx(LogoContainer$1,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},children:(nt=st==null?void 0:st.logo)!==null&&nt!==void 0?nt:jsxRuntimeExports.jsx(Chains.UnknownChain,{})},`${st==null?void 0:st.id}-${st==null?void 0:st.name}-${et}`):jsxRuntimeExports.jsx(LoadingContainer,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},children:Spinner},"loading")]})}):jsxRuntimeExports.jsx("div",{style:{width:rt,height:rt}})},Container$3=styled(motion.div)``,SwitchChainButton=styled(motion.button)`
--color: var(
--ck-dropdown-button-color,
var(--ck-button-primary-color, var(--ck-body-color))
);
--background: var(
--ck-dropdown-button-background,
var(--ck-secondary-button-background, var(--ck-body-background-secondary))
);
--box-shadow: var(
--ck-dropdown-button-box-shadow,
var(
--ck-secondary-button-box-shadow,
var(--ck-button-primary-box-shadow),
none
)
);
--hover-color: var(--ck-dropdown-button-hover-color, var(--color));
--hover-background: var(
--ck-dropdown-button-hover-background,
var(--background)
);
--hover-box-shadow: var(
--ck-dropdown-button-hover-box-shadow,
var(--box-shadow)
);
--active-color: var(--ck-dropdown-button-active-color, var(--hover-color));
--active-background: var(
--ck-dropdown-button-active-background,
var(--hover-background)
);
--active-box-shadow: var(
--ck-dropdown-button-active-box-shadow,
var(--hover-box-shadow)
);
appearance: none;
user-select: none;
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
border-radius: 15px;
width: 52px;
height: 30px;
padding: 2px 6px 2px 3px;
font-size: 16px;
line-height: 19px;
font-weight: 500;
text-decoration: none;
white-space: nowrap;
transform: translateZ(0px);
transition: 100ms ease;
transition-property: transform, background-color, box-shadow, color;
color: var(--color);
background: var(--background);
box-shadow: var(--box-shadow);
svg {
position: relative;
display: block;
}
${et=>et.disabled?Ae`
width: auto;
padding: 3px;
position: relative;
left: -22px;
`:Ae`
cursor: pointer;
@media only screen and (min-width: ${defaultTheme.mobileWidth+1}px) {
&:hover,
&:focus-visible {
color: var(--hover-color);
background: var(--hover-background);
box-shadow: var(--hover-box-shadow);
}
&:active {
color: var(--active-color);
background: var(--active-background);
box-shadow: var(--active-box-shadow);
}
}
`}
`,ChevronDown=({...et})=>jsxRuntimeExports.jsx("svg",{"aria-hidden":"true",width:"11",height:"6",viewBox:"0 0 11 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",...et,children:jsxRuntimeExports.jsx("path",{d:"M1.5 1L5.5 5L9.5 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),ChainSelector=()=>{const et=useContext(),[o,tt]=reactExports.useState(!1),{chain:rt}=useAccount(),{chains:nt}=useSwitchChain(),ot=useLocales({CHAIN:rt==null?void 0:rt.name}),it=isMobile()||(window==null?void 0:window.innerWidth)<defaultTheme.mobileWidth;reactExports.useEffect(()=>{et.open||tt(!1)},[et.open]);const st=nt.length<=1;return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Container$3,{children:jsxRuntimeExports.jsx(ChainSelectDropdown,{offsetX:-12,open:!it&&o,onClose:()=>tt(!1),children:jsxRuntimeExports.jsxs(SwitchChainButton,{"aria-label":flattenChildren(ot.switchNetworks).toString(),disabled:st,onClick:()=>{it?et.setRoute(routes.SWITCHNETWORKS):tt(!o)},children:[st?jsxRuntimeExports.jsx(Tooltip,{message:ot.chainNetwork,xOffset:-6,delay:.01,children:jsxRuntimeExports.jsx(Chain,{id:rt==null?void 0:rt.id})}):jsxRuntimeExports.jsx(Chain,{id:rt==null?void 0:rt.id}),!st&&jsxRuntimeExports.jsx(ChevronDown,{style:{top:1,left:-3}})]})})})})},Profile=({closeModal:et})=>{var o,tt,rt;const nt=useContext(),ot=useThemeContext(),it=useLocales(),{reset:st}=useConnect$1(),{disconnect:at}=useDisconnect(),{address:ct,isConnected:lt,connector:dt,chain:ht}=useAccount(),mt=useEnsFallbackConfig(),{data:ft}=useEnsName({chainId:1,address:ct,config:mt}),{data:pt}=useBalance({address:ct}),[yt,gt]=reactExports.useState(!1);reactExports.useEffect(()=>{lt||nt.setOpen(!1)},[lt]),reactExports.useEffect(()=>{if(yt)return et?et():nt.setOpen(!1),()=>{at(),st()}},[yt,at,st]);const bt=["web95","rounded","minimal"].includes((tt=(o=ot.theme)!==null&&o!==void 0?o:nt.theme)!==null&&tt!==void 0?tt:"")?"....":void 0;return jsxRuntimeExports.jsxs(PageContent,{children:[jsxRuntimeExports.jsxs(ModalContent,{style:{paddingBottom:22,gap:6},children:[jsxRuntimeExports.jsx(AvatarContainer,{children:jsxRuntimeExports.jsxs(AvatarInner,{children:[jsxRuntimeExports.jsx(ChainSelectorContainer,{children:jsxRuntimeExports.jsx(ChainSelector,{})}),jsxRuntimeExports.jsx(Avatar,{address:ct})]})}),jsxRuntimeExports.jsx(ModalH1,{children:jsxRuntimeExports.jsx(CopyToClipboard,{string:ct,children:ft??truncateEthAddress(ct,bt)})}),!((rt=nt==null?void 0:nt.options)===null||rt===void 0)&&rt.hideBalance?null:jsxRuntimeExports.jsx(ModalBody,{children:jsxRuntimeExports.jsx(BalanceContainer,{children:jsxRuntimeExports.jsxs(AnimatePresence,{exitBeforeEnter:!0,initial:!1,children:[pt&&jsxRuntimeExports.jsxs(Balance$1,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:[nFormatter(Number(pt==null?void 0:pt.formatted))," ",pt==null?void 0:pt.symbol]},`chain-${ht==null?void 0:ht.id}`),!pt&&jsxRuntimeExports.jsx(LoadingBalance,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:" "})]})})})]}),!isSafeConnector(dt==null?void 0:dt.id)&&jsxRuntimeExports.jsx(Button$1,{onClick:()=>gt(!0),icon:jsxRuntimeExports.jsx(DisconnectIcon,{}),children:it.disconnect})]})},SwitchNetworks=()=>{const{reset:et}=useConnect$1(),{disconnect:o}=useDisconnect(),{connector:tt,chain:rt}=useAccount(),nt=useChainIsSupported(rt==null?void 0:rt.id),ot=useLocales({}),it=()=>{o(),et()};return jsxRuntimeExports.jsx(PageContent,{style:{width:278},children:jsxRuntimeExports.jsxs(ModalContent,{style:{padding:0,marginTop:-10},children:[!nt&&jsxRuntimeExports.jsxs(ModalBody,{children:[ot.warnings_chainUnsupported," ",ot.warnings_chainUnsupportedResolve]}),jsxRuntimeExports.jsx("div",{style:{padding:"6px 8px"},children:jsxRuntimeExports.jsx(ChainSelectList,{variant:"secondary"})}),!nt&&!isSafeConnector(tt==null?void 0:tt.id)&&jsxRuntimeExports.jsxs("div",{style:{paddingTop:12},children:[jsxRuntimeExports.jsx(OrDivider,{}),jsxRuntimeExports.jsx(Button$1,{icon:jsxRuntimeExports.jsx(DisconnectIcon,{}),variant:"secondary",onClick:it,children:ot.disconnect})]})]})})},spinKeyframes=We`
from{ transform: rotate(0deg); }
to{ transform: rotate(360deg); }
`,lineKeyframes=We`
from{ background-position: 0 0; }
to{ background-position: 100% 0; }
`,ContentContainer=styled.div`
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
margin: 5px auto 24px;
padding: 16px 16px;
border-radius: var(--ck-tertiary-border-radius, 24px);
box-shadow: var(--ck-tertiary-box-shadow, none);
background: var(--ck-body-background-tertiary);
}
`,LogoContainer=styled(motion.div)`
z-index: 2;
overflow: hidden;
position: relative;
display: flex;
align-items: center;
justify-content: center;
width: 52px;
height: 52px;
border-radius: 100%;
transition: inherit;
background: var(--ck-body-background-secondary);
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
svg,
img {
display: block;
width: 100%;
height: 100%;
}
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
width: 64px;
height: 64px;
}
`,StatusIcon=styled(motion.div)`
z-index: 2;
position: relative;
display: flex;
align-items: center;
justify-content: center;
width: 52px;
height: 52px;
color: currentColor;
border-radius: 100%;
transition: inherit;
svg {
z-index: 3;
position: relative;
transform: scale(0.89);
transition: inherit;
opacity: 0.5;
}
&:before {
z-index: 1;
content: '';
position: absolute;
inset: 10px;
border-radius: inherit;
border: 1px dashed var(--border-color);
background: var(--ck-body-background);
transition: inherit;
animation: ${spinKeyframes} 10s linear infinite;
}
&:after {
z-index: 2;
content: '';
position: absolute;
inset: 0;
border-radius: inherit;
background: #34c759;
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
transform: scale(0);
transition: inherit;
}
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
width: 64px;
height: 64px;
svg {
transform: scale(1.1);
}
}
`,StatusGraphicBgSvg=styled(motion.svg)`
display: block;
position: relative;
margin: 0 auto;
transition: inherit;
overflow: visible;
rect {
stroke: var(--border-color);
rx: var(--ck-border-radius);
}
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
display: none;
}
`,StatusGraphic=styled(motion.div)`
--border-color: var(--ck-siwe-border, var(--ck-body-divider));
--border-size: 0;
--border-style: dashed;
user-select: none;
pointer-events: none;
position: relative;
display: flex;
align-items: center;
justify-content: center;
gap: 14px;
width: 100%;
margin: 12px auto;
padding: 42px 32px;
transition: all 320ms cubic-bezier(0.175, 0.885, 0.32, 1.1);
border: var(--border-size) var(--border-style) var(--border-color);
border-radius: var(--ck-border-radius);
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
--border-size: 1px;
margin: 0 auto 20px;
padding: 38px 0;
gap: 18px;
+ div {
// easier than wrapping in another styled component
padding-bottom: 10px;
}
}
> div {
z-index: 2;
position: relative;
transition: inherit;
}
&:before,
&:after {
z-index: 1;
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 120px;
height: 1px;
margin-left: -60px;
transition: inherit;
animation: ${lineKeyframes} 10s linear infinite;
background: linear-gradient(
90deg,
var(--border-color),
var(--border-color) 50%,
transparent 50%,
transparent 100%
);
background-size: 6px 1px;
}
&:after {
background: var(--border-color);
transform: scaleX(0);
}
${({$connected:et})=>et&&Ae`
&:before {
opacity: 0;
}
&:after {
transform: none;
}
${StatusGraphicBgSvg} {
rect {
stroke-dasharray: 0 0;
}
}
${LogoContainer} {
transform: scale(0.62);
}
${StatusIcon} {
svg {
transform: scale(1.5);
opacity: 1;
color: #fff;
}
&:before {
transform: scale(0);
}
&:after {
transform: scale(1);
}
}
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
--border-size: 1px;
--border-style: solid;
${StatusIcon} {
svg {
transform: scale(1.75);
}
}
}
`};
`,SIWEButton=({showSignOutButton:et,onSignIn:o,onSignOut:tt})=>{const rt=useIsMounted(),nt=useLocales(),{setOpen:ot}=useModal(),{isSignedIn:it,isReady:st,isLoading:at,isRejected:ct,isSuccess:lt,isError:dt,signIn:ht,signOut:mt,error:ft}=useSIWE({onSignIn:gt=>o==null?void 0:o(gt),onSignOut:()=>tt==null?void 0:tt()}),{address:pt}=useAccount();function yt(){return lt?nt.signedIn:ct?nt.tryAgain:at?nt.awaitingConfirmation:dt?ft??"Unknown Error":nt.signIn}return rt?et&&it?jsxRuntimeExports.jsx(Button$1,{style:{margin:0},onClick:mt,icon:jsxRuntimeExports.jsx(DisconnectIcon,{}),children:nt.signOut},"button"):pt?jsxRuntimeExports.jsx(Button$1,{style:{margin:0},arrow:it?!1:!at&&!ct,onClick:!at&&!lt?ht:void 0,disabled:at,waiting:at,icon:ct&&jsxRuntimeExports.jsx(motion.div,{initial:{rotate:-270},animate:{rotate:0},transition:{duration:1,ease:[.175,.885,.32,.98]},children:jsxRuntimeExports.jsx(RetryIcon,{style:{opacity:.4}})}),children:yt()},"button"):jsxRuntimeExports.jsx(Button$1,{style:{margin:0},onClick:()=>ot(!0),arrow:!0,children:nt.walletNotConnected},"button"):jsxRuntimeExports.jsx(Button$1,{style:{margin:0},disabled:!0},"loading")},LazyImage=({src:et,alt:o,width:tt,height:rt})=>{const nt=reactExports.useRef(null),[ot,it]=reactExports.useState(!0);return reactExports.useEffect(()=>{nt.current&&nt.current.complete&&nt.current.naturalHeight!==0||it(!1)},[et]),jsxRuntimeExports.jsx("div",{style:{width:tt,height:rt,background:"rgba(0,0,0,0.02)",boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.02)"},children:jsxRuntimeExports.jsx("img",{ref:nt,src:et,alt:o,width:tt,height:rt,onLoad:()=>it(!0),style:{transition:"opacity 0.2s ease",opacity:ot?1:0}})})},transition={duration:.2,ease:[.26,.08,.25,1]},copyTransition={duration:.16,ease:[.26,.08,.25,1]},SignInWithEthereum=()=>{var et,o;const tt=useContext(),{isSignedIn:rt,reset:nt}=useSIWE(),ot=isMobile(),[it,st]=reactExports.useState(rt?"signedIn":"signedOut"),at=useLocales({}),ct=it==="signedIn"?{heading:at.signInWithEthereumScreen_signedIn_heading,h1:at.signInWithEthereumScreen_signedIn_h1,p:at.signInWithEthereumScreen_signedIn_p,button:at.signInWithEthereumScreen_signedIn_button}:{heading:at.signInWithEthereumScreen_signedOut_heading,h1:at.signInWithEthereumScreen_signedOut_h1,p:at.signInWithEthereumScreen_signedOut_p,button:at.signInWithEthereumScreen_signedOut_button};reactExports.useEffect(()=>{rt&&st("signedIn")},[]),reactExports.useEffect(()=>{rt||st("signedOut")},[rt]);const{address:lt}=useAccount(),ht=(()=>{const ft={svg:null,default:null},pt=document.getElementsByTagName("link");return Array.from(pt).forEach(yt=>{(yt.getAttribute("rel")==="icon"||yt.getAttribute("rel")==="shortcut icon")&&yt.getAttribute("href")&&(yt.getAttribute("type")==="image/svg+xml"?ft.svg=yt.getAttribute("href"):ft.default=yt.getAttribute("href"))}),ft})(),mt=(o=(et=getAppIcon())!==null&&et!==void 0?et:ht.svg)!==null&&o!==void 0?o:ht.default;return jsxRuntimeExports.jsx(PageContent,{style:{width:278},children:jsxRuntimeExports.jsxs(ModalContent,{style:{padding:0,marginTop:-10},children:[jsxRuntimeExports.jsx(ContentContainer,{children:jsxRuntimeExports.jsx(AnimatePresence,{exitBeforeEnter:!0,children:jsxRuntimeExports.jsx(motion.div,{initial:ot?!1:{opacity:0,scale:.94},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.94},transition:copyTransition,children:jsxRuntimeExports.jsx(ModalBody,{style:{height:42},children:jsxRuntimeExports.jsx(FitText,{children:ct.h1})})},flattenChildren(ct.h1).toString())})}),jsxRuntimeExports.jsxs(StatusGraphic,{$connected:rt,children:[jsxRuntimeExports.jsx("div",{style:{position:"absolute",inset:0},children:jsxRuntimeExports.jsx(StatusGraphicBgSvg,{width:"262",height:"134",viewBox:"0 0 262 134",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx(motion.rect,{x:"0",y:"0",rx:"12",width:"262",height:"134",strokeDasharray:"3 3",animate:{strokeDashoffset:[0,-6]},transition:{duration:.4,ease:"linear",repeat:1/0}})})}),jsxRuntimeExports.jsx(motion.div,{initial:ot?!1:{opacity:0,x:50,scale:.8},animate:{opacity:1,x:0,scale:1},transition,children:jsxRuntimeExports.jsx(LogoContainer,{children:jsxRuntimeExports.jsx(Avatar,{address:lt,size:64})})},"avatarImage"),jsxRuntimeExports.jsx(motion.div,{initial:ot?!1:{scale:.6},animate:{scale:1},transition:{...transition},children:jsxRuntimeExports.jsx(StatusIcon,{children:jsxRuntimeExports.jsx(TickIcon,{})})},"tickIcon"),jsxRuntimeExports.jsx(motion.div,{initial:ot?!1:{opacity:0,x:-40,scale:.8},animate:{opacity:1,x:0,scale:1},transition:{...transition},children:jsxRuntimeExports.jsx(LogoContainer,{children:mt?jsxRuntimeExports.jsx(LazyImage,{src:mt,alt:"app"}):jsxRuntimeExports.jsx(Chains.UnknownChain,{})})},"appLogo")]},"status"),jsxRuntimeExports.jsx(AnimatePresence,{exitBeforeEnter:!0,children:jsxRuntimeExports.jsx(motion.div,{style:{paddingBottom:ot?24:12},initial:ot?!1:{opacity:0,scale:.94},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.94},transition:copyTransition,children:jsxRuntimeExports.jsx(ModalBody,{style:{height:42,marginTop:-1,marginBottom:-3},children:jsxRuntimeExports.jsx(FitText,{children:ct.p})})},flattenChildren(ct.p).toString())}),jsxRuntimeExports.jsx(SIWEButton,{showSignOutButton:it==="signedIn",onSignIn:()=>{setTimeout(()=>{tt.setOpen(!1)},1e3)}})]})})},customThemeDefault$1={},ConnectModal$1=({mode:et="auto",theme:o="auto",customTheme:tt=customThemeDefault$1,lang:rt="en-US"})=>{var nt;const ot=useContext(),{isConnected:it,chain:st}=useAccount(),at=useChainIsSupported(st==null?void 0:st.id),ct=!(!((nt=ot.options)===null||nt===void 0)&&nt.enforceSupportedChains&&it&&!at),lt=ct&&ot.route!==routes.CONNECTORS&&ot.route!==routes.PROFILE,dt=ct&&ot.route!==routes.PROFILE,ht=()=>{ot.route===routes.SIGNINWITHETHEREUM||ot.route===routes.SWITCHNETWORKS?ot.setRoute(routes.PROFILE):ot.route===routes.DOWNLOAD?ot.setRoute(routes.CONNECT):ot.setRoute(routes.CONNECTORS)},mt={onboarding:jsxRuntimeExports.jsx(Introduction,{}),about:jsxRuntimeExports.jsx(About,{}),download:jsxRuntimeExports.jsx(DownloadApp,{}),connectors:jsxRuntimeExports.jsx(Wallets,{}),mobileConnectors:jsxRuntimeExports.jsx(MobileConnectors,{}),connect:jsxRuntimeExports.jsx(ConnectUsing,{}),profile:jsxRuntimeExports.jsx(Profile,{}),switchNetworks:jsxRuntimeExports.jsx(SwitchNetworks,{}),signInWithEthereum:jsxRuntimeExports.jsx(SignInWithEthereum,{})};function ft(){ot.setOpen(!1)}return reactExports.useEffect(()=>{var pt;it?(ot.route!==routes.PROFILE||ot.route!==routes.SIGNINWITHETHEREUM)&&(ot.signInWithEthereum&&!(!((pt=ot.options)===null||pt===void 0)&&pt.disableSiweRedirect)?ot.setRoute(routes.SIGNINWITHETHEREUM):ft()):ft()},[it]),reactExports.useEffect(()=>ot.setMode(et),[et]),reactExports.useEffect(()=>ot.setTheme(o),[o]),reactExports.useEffect(()=>ot.setCustomTheme(tt),[tt]),reactExports.useEffect(()=>ot.setLang(rt),[rt]),reactExports.useEffect(()=>{const pt=getAppName();if(!pt||!ot.open)return;const yt=document.createElement("meta");return yt.setAttribute("property","og:title"),yt.setAttribute("content",pt),document.head.prepend(yt),()=>{document.head.removeChild(yt)}},[ot.open]),jsxRuntimeExports.jsx(ConnectKitThemeProvider,{theme:o,customTheme:tt,mode:et,children:jsxRuntimeExports.jsx(Modal,{open:ot.open,pages:mt,pageId:ot.route,onClose:ct?ft:void 0,onInfo:dt?()=>ot.setRoute(routes.ABOUT):void 0,onBack:lt?ht:void 0})})};function useGoogleFont(et){reactExports.useEffect(()=>{if(!et)return;et=et.replace(/ /g,"+");const o=document.createElement("link");o.href="https://fonts.googleapis.com",o.rel="preconnect";const tt=document.createElement("link");tt.href="https://fonts.gstatic.com",tt.rel="preconnect",tt.crossOrigin="true";const rt=document.createElement("link");return rt.href=`https://fonts.googleapis.com/css2?family=${et}:wght@400;500;600&display=swap`,rt.rel="stylesheet",document.head.appendChild(o),document.head.appendChild(tt),document.head.appendChild(rt),()=>{document.head.removeChild(o),document.head.removeChild(tt),document.head.removeChild(rt)}},[et])}function useThemeFont(et){var o;const rt=(o={web95:"Lato",retro:"Nunito",midnight:"Inter",minimal:"Inter",rounded:"Nunito"}[et])!==null&&o!==void 0?o:null;useGoogleFont(rt??"")}const useConnectCallback=({onConnect:et,onDisconnect:o})=>{useAccountEffect({onConnect:({address:tt,connector:rt,isReconnected:nt})=>{nt||et==null||et({address:tt,connectorId:rt==null?void 0:rt.id})},onDisconnect:()=>o==null?void 0:o()})},routes={ONBOARDING:"onboarding",ABOUT:"about",CONNECTORS:"connectors",MOBILECONNECTORS:"mobileConnectors",CONNECT:"connect",DOWNLOAD:"download",PROFILE:"profile",SWITCHNETWORKS:"switchNetworks",SIGNINWITHETHEREUM:"signInWithEthereum"},Context=reactExports.createContext(null),ConnectKitProvider=({children:et,theme:o="auto",mode:tt="auto",customTheme:rt,options:nt,onConnect:ot,onDisconnect:it,debugMode:st=!1})=>{var at,ct,lt,dt;if(!React.useContext(WagmiContext))throw Error("ConnectKitProvider must be within a WagmiProvider");if(React.useContext(Context))throw new Error("Multiple, nested usages of ConnectKitProvider detected. Please use only one.");useConnectCallback({onConnect:ot,onDisconnect:it});const ht=useChains(),mt=useConnector("injected"),ft={language:"en-US",hideBalance:!1,hideTooltips:!1,hideQuestionMarkCTA:!1,hideNoWalletCTA:!1,walletConnectCTA:"link",hideRecentBadge:!1,avoidLayoutShift:!0,embedGoogleFonts:!1,truncateLongENSAddress:!0,walletConnectName:void 0,reducedMotion:!1,disclaimer:null,bufferPolyfill:!0,customAvatar:void 0,initialChainId:(at=ht==null?void 0:ht[0])===null||at===void 0?void 0:at.id,enforceSupportedChains:!1,ethereumOnboardingUrl:void 0,walletOnboardingUrl:void 0,disableSiweRedirect:!1},pt=Object.assign({},ft,nt);typeof window<"u"&&pt.bufferPolyfill&&(window.Buffer=(ct=window.Buffer)!==null&&ct!==void 0?ct:buffer$2.Buffer);const[yt,gt]=reactExports.useState(o),[bt,xt]=reactExports.useState(tt),[vt,Et]=reactExports.useState(rt??{}),[Ct,St]=reactExports.useState("en-US"),[At,kt]=reactExports.useState(!1),[It,Nt]=reactExports.useState({id:""}),[Lt,Mt]=reactExports.useState(routes.CONNECTORS),[zt,Ut]=reactExports.useState(""),[Xt,Wt]=reactExports.useState(0);pt.embedGoogleFonts&&useThemeFont(o),reactExports.useEffect(()=>gt(o),[o]),reactExports.useEffect(()=>St(pt.language||"en-US"),[pt.language]),reactExports.useEffect(()=>Ut(null),[Lt,At]);const{chain:Ft,isConnected:qt}=useAccount(),Pt=useChainIsSupported(Ft==null?void 0:Ft.id);reactExports.useEffect(()=>{qt&&pt.enforceSupportedChains&&!Pt&&(kt(!0),Mt(routes.SWITCHNETWORKS))},[qt,Pt,Ft,Lt,At]),reactExports.useEffect(()=>{isFamily()&&(mt==null||mt.connect())},[mt]);const Yt=st?console.log:()=>{},Qt={theme:yt,setTheme:gt,mode:bt,setMode:xt,customTheme:rt,setCustomTheme:Et,lang:Ct,setLang:St,open:At,setOpen:kt,route:Lt,setRoute:Mt,connector:It,setConnector:Nt,signInWithEthereum:(dt=(lt=React.useContext(SIWEContext))===null||lt===void 0?void 0:lt.enabled)!==null&&dt!==void 0?dt:!1,onConnect:ot,options:pt,errorMessage:zt,debugMode:st,log:Yt,displayError:(jt,Gt)=>{Ut(jt),console.log("---------CONNECTKIT DEBUG---------"),console.log(jt),Gt&&console.table(Gt),console.log("---------/CONNECTKIT DEBUG---------")},resize:Xt,triggerResize:()=>Wt(jt=>jt+1)};return reactExports.createElement(Context.Provider,{value:Qt},jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Web3ContextProvider,{enabled:At,children:jsxRuntimeExports.jsxs(Le,{theme:defaultTheme$1,children:[et,jsxRuntimeExports.jsx(ConnectModal$1,{lang:Ct,theme:yt,mode:tt,customTheme:vt})]})})}))},useContext=()=>{const et=React.useContext(Context);if(!et)throw Error("ConnectKit Hook must be inside a Provider.");return et},safeRoutes={disconnected:[routes.CONNECTORS,routes.ABOUT,routes.ONBOARDING,routes.MOBILECONNECTORS,routes.ONBOARDING],connected:[routes.PROFILE,routes.SWITCHNETWORKS,routes.SIGNINWITHETHEREUM]},allRoutes=[...safeRoutes.connected,...safeRoutes.disconnected],useModal=({onConnect:et,onDisconnect:o}={})=>{const tt=useContext();useConnectCallback({onConnect:et,onDisconnect:o});const{isConnected:rt}=useAccount(),{signIn:nt}=useSIWE(),ot=()=>{tt.setOpen(!1)},it=()=>{tt.setOpen(!0)},st=at=>{let ct=at;allRoutes.includes(at)?rt?safeRoutes.connected.includes(at)||(ct=routes.PROFILE,tt.log(`Route ${at} is not a valid route when connected, navigating to ${ct} instead.`)):safeRoutes.disconnected.includes(at)||(ct=routes.CONNECTORS,tt.log(`Route ${at} is not a valid route when disconnected, navigating to ${ct} instead.`)):(ct=rt?routes.PROFILE:routes.CONNECTORS,tt.log(`Route ${at} is not a valid route, navigating to ${ct} instead.`)),tt.setRoute(ct),it()};return{open:tt.open,setOpen:at=>{at?st(rt?routes.PROFILE:routes.CONNECTORS):ot()},openAbout:()=>st(routes.ABOUT),openOnboarding:()=>st(routes.ONBOARDING),openProfile:()=>st(routes.PROFILE),openSwitchNetworks:()=>st(routes.SWITCHNETWORKS),openSIWE:at=>{st(routes.SIGNINWITHETHEREUM),at&&nt()}}},TextContainer=styled(motion.div)`
top: 0;
bottom: 0;
left: 0;
display: inline-flex;
align-items: center;
justify-content: center;
white-space: nowrap;
`;styled(motion.div)`
position: relative;
width: 24px;
height: 24px;
border-radius: 12px;
overflow: hidden;
svg {
display: block;
}
`;const IconContainer=styled(motion.div)`
pointer-events: none;
user-select: none;
position: relative;
width: 24px;
height: 24px;
margin-right: 8px;
`,UnsupportedNetworkContainer=styled(motion.div)`
z-index: 1;
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
border-radius: 100%;
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.02);
background: var(--ck-body-color-danger, red);
color: #fff;
svg {
display: block;
position: relative;
top: -1px;
}
`,Container$2=styled(motion.div)`
display: flex;
align-items: center;
justify-content: flex-start;
position: relative;
height: 40px;
padding: 0;
line-height: 0;
letter-spacing: -0.2px;
font-size: var(--ck-connectbutton-font-size, 16px);
font-weight: var(--ck-connectbutton-font-weight, 500);
text-align: center;
transition: 100ms ease;
transition-property: color, background, box-shadow, border-radius;
color: var(--color);
background: var(--background);
box-shadow: var(--box-shadow);
border-radius: var(--border-radius);
&.primary {
--color: var(--ck-connectbutton-color);
--background: var(--ck-connectbutton-background);
--box-shadow: var(--ck-connectbutton-box-shadow);
--border-radius: var(--ck-connectbutton-border-radius, 12px);
--hover-color: var(--ck-connectbutton-hover-color, var(--color));
--hover-background: var(
--ck-connectbutton-hover-background,
var(--background)
);
--hover-box-shadow: var(
--ck-connectbutton-hover-box-shadow,
var(--box-shadow)
);
--hover-border-radius: var(
--ck-connectbutton-hover-border-radius,
var(--border-radius)
);
--active-color: var(--ck-connectbutton-active-color, var(--hover-color));
--active-background: var(
--ck-connectbutton-active-background,
var(--hover-background)
);
--active-box-shadow: var(
--ck-connectbutton-active-box-shadow,
var(--hover-box-shadow)
);
--active-border-radius: var(
--ck-connectbutton-active-border-radius,
var(--hover-border-radius)
);
}
&.secondary {
--color: var(--ck-connectbutton-balance-color);
--background: var(--ck-connectbutton-balance-background);
--box-shadow: var(--ck-connectbutton-balance-box-shadow);
--border-radius: var(
--ck-connectbutton-balance-border-radius,
var(--ck-connectbutton-border-radius, 12px)
);
--hover-color: var(--ck-connectbutton-balance-hover-color, var(--color));
--hover-background: var(
--ck-connectbutton-balance-hover-background,
var(--background)
);
--hover-box-shadow: var(
--ck-connectbutton-balance-hover-box-shadow,
var(--box-shadow)
);
--hover-border-radius: var(
--ck-connectbutton-balance-hover-border-radius,
var(--border-radius)
);
--active-color: var(
--ck-connectbutton-balance-active-color,
var(--hover-color)
);
--active-background: var(
--ck-connectbutton-balance-active-background,
var(--hover-background)
);
--active-box-shadow: var(
--ck-connectbutton-balance-active-box-shadow,
var(--hover-box-shadow)
);
--active-border-radius: var(
--ck-connectbutton-balance-active-border-radius,
var(--hover-border-radius)
);
}
`,ThemeContainer=styled.button`
all: initial;
appearance: none;
user-select: none;
position: relative;
padding: 0;
margin: 0;
background: none;
border-radius: var(--ck-border-radius);
&:disabled {
pointer-events: none;
opacity: 0.3;
}
display: flex;
flex-wrap: nowrap;
background: none;
cursor: pointer;
* {
cursor: pointer;
}
&:hover {
${Container$2} {
color: var(--hover-color, var(--color));
background: var(--hover-background, var(--background));
box-shadow: var(--hover-box-shadow, var(--box-shadow));
border-radius: var(--hover-border-radius, var(--border-radius));
}
}
&:active {
${Container$2} {
color: var(--active-color, var(--hover-color, var(--color)));
background: var(
--active-background,
var(--hover-background, var(--background))
);
box-shadow: var(
--active-box-shadow,
var(--hover-box-shadow, var(--box-shadow))
);
border-radius: var(
--active-border-radius,
var(--hover-border-radius, var(--border-radius))
);
}
}
&:focus-visible {
outline: 2px solid var(--ck-family-brand);
}
`,ThemedButton=({children:et,variant:o="primary",autoSize:tt=!0,duration:rt=.3,style:nt})=>{const[ot,it]=useMeasure();return jsxRuntimeExports.jsx(Container$2,{className:o,initial:!1,animate:tt?{width:it.width>10?it.width:"auto"}:void 0,transition:{duration:rt,ease:[.25,1,.5,1],delay:.01},style:nt,children:jsxRuntimeExports.jsx("div",{ref:ot,style:{whiteSpace:"nowrap",width:"fit-content",position:"relative",padding:"0 12px"},children:et})})},Container$1=styled(motion.div)`
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
`,PlaceholderKeyframes=We`
0%,100%{ opacity: 0.1; transform: scale(0.75); }
50%{ opacity: 0.75; transform: scale(1.2) }
`,PulseContainer=styled.div`
pointer-events: none;
user-select: none;
padding: 0 5px;
span {
display: inline-block;
vertical-align: middle;
margin: 0 2px;
width: 3px;
height: 3px;
border-radius: 4px;
background: currentColor;
animation: ${PlaceholderKeyframes} 1000ms ease infinite both;
}
`,Balance=({hideIcon:et,hideSymbol:o})=>{const tt=useIsMounted(),[rt,nt]=reactExports.useState(!0),{address:ot,chain:it}=useAccount();useChains();const st=useChainIsSupported(it==null?void 0:it.id),at=useQueryClient(),{data:ct}=useBlockNumber({watch:!0}),{data:lt,queryKey:dt}=useBalance({address:ot,chainId:it==null?void 0:it.id});reactExports.useEffect(()=>{(ct??0%5===0)&&at.invalidateQueries({queryKey:dt})},[ct,dt]);const ht=chainConfigs.find(ft=>ft.id===(it==null?void 0:it.id)),mt=`${!tt||(lt==null?void 0:lt.formatted)===void 0?"balance-loading":`balance-${ht==null?void 0:ht.id}-${lt==null?void 0:lt.formatted}`}`;return reactExports.useEffect(()=>{nt(!1)},[]),jsxRuntimeExports.jsx("div",{style:{position:"relative"},children:jsxRuntimeExports.jsx(AnimatePresence,{initial:!1,children:jsxRuntimeExports.jsx(motion.div,{initial:(lt==null?void 0:lt.formatted)!==void 0&&rt?{opacity:1}:{opacity:0,position:"absolute",top:0,left:0,bottom:0},animate:{opacity:1,position:"relative"},exit:{opacity:0,position:"absolute",top:0,left:0,bottom:0},transition:{duration:.4,ease:[.25,1,.5,1],delay:.4},children:!ot||!tt||(lt==null?void 0:lt.formatted)===void 0?jsxRuntimeExports.jsxs(Container$1,{children:[!et&&jsxRuntimeExports.jsx(Chain,{id:it==null?void 0:it.id}),jsxRuntimeExports.jsx("span",{style:{minWidth:32},children:jsxRuntimeExports.jsxs(PulseContainer,{children:[jsxRuntimeExports.jsx("span",{style:{animationDelay:"0ms"}}),jsxRuntimeExports.jsx("span",{style:{animationDelay:"50ms"}}),jsxRuntimeExports.jsx("span",{style:{animationDelay:"100ms"}})]})})]}):st?jsxRuntimeExports.jsxs(Container$1,{children:[!et&&jsxRuntimeExports.jsx(Chain,{id:it==null?void 0:it.id}),jsxRuntimeExports.jsx("span",{style:{minWidth:32},children:nFormatter(Number(lt==null?void 0:lt.formatted))}),!o&&` ${lt==null?void 0:lt.symbol}`]}):jsxRuntimeExports.jsxs(Container$1,{children:[!et&&jsxRuntimeExports.jsx(Chain,{id:it==null?void 0:it.id}),jsxRuntimeExports.jsx("span",{style:{minWidth:32},children:"???"})]})},mt)})})},contentVariants={initial:{zIndex:2,opacity:0,x:"-100%"},animate:{opacity:1,x:.1,transition:{duration:.4,ease:[.25,1,.5,1]}},exit:{zIndex:1,opacity:0,x:"-100%",pointerEvents:"none",position:"absolute",transition:{duration:.4,ease:[.25,1,.5,1]}}},addressVariants={initial:{zIndex:2,opacity:0,x:"100%"},animate:{x:.2,opacity:1,transition:{duration:.4,ease:[.25,1,.5,1]}},exit:{zIndex:1,x:"100%",opacity:0,pointerEvents:"none",position:"absolute",transition:{duration:.4,ease:[.25,1,.5,1]}}},textVariants={initial:{opacity:0},animate:{opacity:1,transition:{duration:.3,ease:[.25,1,.5,1]}},exit:{position:"absolute",opacity:0,transition:{duration:.3,ease:[.25,1,.5,1]}}},ConnectButtonRenderer=({children:et})=>{const o=useIsMounted(),tt=useContext(),{open:rt,setOpen:nt}=useModal(),{address:ot,isConnected:it,chain:st}=useAccount(),at=useChainIsSupported(st==null?void 0:st.id),ct=useEnsFallbackConfig(),{data:lt}=useEnsName({chainId:1,address:ot,config:ct});function dt(){nt(!1)}function ht(){nt(!0),tt.setRoute(it?routes.PROFILE:routes.CONNECTORS)}return!et||!o?null:jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:et({show:ht,hide:dt,chain:st,unsupported:!at,isConnected:!!ot,isConnecting:rt,address:ot,truncatedAddress:ot?truncateEthAddress(ot):void 0,ensName:lt==null?void 0:lt.toString()})})};ConnectButtonRenderer.displayName="ConnectKitButton.Custom";function ConnectKitButtonInner({label:et,showAvatar:o,separator:tt}){var rt;const nt=useLocales({}),ot=useContext(),{isSignedIn:it}=useSIWE(),{address:st,chain:at}=useAccount(),ct=useChainIsSupported(at==null?void 0:at.id),lt=useEnsFallbackConfig(),{data:dt}=useEnsName({chainId:1,address:st,config:lt}),ht=nt.connectWallet;return jsxRuntimeExports.jsx(AnimatePresence,{initial:!1,children:st?jsxRuntimeExports.jsxs(TextContainer,{initial:"initial",animate:"animate",exit:"exit",variants:addressVariants,style:{height:40},children:[o&&jsxRuntimeExports.jsxs(IconContainer,{children:[jsxRuntimeExports.jsxs(AnimatePresence,{initial:!1,children:[it&&jsxRuntimeExports.jsx(motion.div,{style:{zIndex:2,position:"absolute",bottom:0,right:0},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsxRuntimeExports.jsx(AuthIcon,{})}),!ct&&jsxRuntimeExports.jsx(UnsupportedNetworkContainer,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsxRuntimeExports.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M1.68831 13.5H12.0764C13.1026 13.5 13.7647 12.7197 13.7647 11.763C13.7647 11.4781 13.6985 11.1863 13.5462 10.9149L8.34225 1.37526C8.02445 0.791754 7.45505 0.5 6.88566 0.5C6.31627 0.5 5.73364 0.791754 5.42246 1.37526L0.225108 10.9217C0.0728291 11.1863 0 11.4781 0 11.763C0 12.7197 0.662083 13.5 1.68831 13.5ZM6.88566 8.8048C6.49503 8.8048 6.27655 8.5809 6.26331 8.1738L6.16399 5.0595C6.15075 4.64562 6.44869 4.34708 6.87904 4.34708C7.30278 4.34708 7.61396 4.6524 7.60071 5.06628L7.5014 8.16701C7.48154 8.5809 7.26305 8.8048 6.88566 8.8048ZM6.88566 11.3492C6.44207 11.3492 6.07792 11.0303 6.07792 10.5757C6.07792 10.1211 6.44207 9.80219 6.88566 9.80219C7.32926 9.80219 7.69341 10.1143 7.69341 10.5757C7.69341 11.0371 7.32264 11.3492 6.88566 11.3492Z",fill:"currentColor"})})})]}),jsxRuntimeExports.jsx(Avatar,{size:24,address:st})]}),jsxRuntimeExports.jsx("div",{style:{position:"relative",paddingRight:o?1:0},children:jsxRuntimeExports.jsx(AnimatePresence,{initial:!1,children:dt?jsxRuntimeExports.jsx(TextContainer,{initial:"initial",animate:"animate",exit:"exit",variants:textVariants,style:{position:dt?"relative":"absolute"},children:!((rt=ot.options)===null||rt===void 0)&&rt.truncateLongENSAddress?truncateENSAddress(dt,20):dt},"ckEnsName"):jsxRuntimeExports.jsxs(TextContainer,{initial:"initial",animate:"animate",exit:"exit",variants:textVariants,style:{position:dt?"absolute":"relative"},children:[truncateEthAddress(st,tt)," "]},"ckTruncatedAddress")})})]},"connectedText"):jsxRuntimeExports.jsx(TextContainer,{initial:"initial",animate:"animate",exit:"exit",variants:contentVariants,style:{height:40},children:et||ht},"connectWalletText")})}function ConnectKitButton({label:et,showBalance:o=!1,showAvatar:tt=!0,theme:rt,mode:nt,customTheme:ot,onClick:it}){var st;const at=useIsMounted(),ct=useContext(),{isConnected:lt,address:dt,chain:ht}=useAccount(),mt=useChainIsSupported(ht==null?void 0:ht.id);function ft(){ct.setOpen(!0),ct.setRoute(lt?routes.PROFILE:routes.CONNECTORS)}const pt=["web95","rounded","minimal"].includes((st=rt??ct.theme)!==null&&st!==void 0?st:"")?"....":void 0;if(!at)return null;const yt=o&&mt,gt=dt&&yt;return jsxRuntimeExports.jsx(ResetContainer,{$useTheme:rt??ct.theme,$useMode:nt??ct.mode,$customTheme:ot??ct.customTheme,children:jsxRuntimeExports.jsxs(ThemeContainer,{onClick:()=>{it?it(ft):ft()},children:[yt&&jsxRuntimeExports.jsx(AnimatePresence,{initial:!1,children:gt&&jsxRuntimeExports.jsx(motion.div,{initial:{opacity:0,x:"100%",width:0,marginRight:0},animate:{opacity:1,x:0,width:"auto",marginRight:-24,transition:{duration:.4,ease:[.25,1,.5,1]}},exit:{opacity:0,x:"100%",width:0,marginRight:0,transition:{duration:.4,ease:[.25,1,.5,1]}},children:jsxRuntimeExports.jsx(ThemedButton,{variant:"secondary",theme:rt??ct.theme,mode:nt??ct.mode,customTheme:ot??ct.customTheme,style:{overflow:"hidden"},children:jsxRuntimeExports.jsx(motion.div,{style:{paddingRight:24},children:jsxRuntimeExports.jsx(Balance,{hideSymbol:!0})})})},"balance")}),jsxRuntimeExports.jsx(ThemedButton,{theme:rt??ct.theme,mode:nt??ct.mode,customTheme:ot??ct.customTheme,style:yt&&o&&dt&&(rt==="retro"||ct.theme==="retro")?{boxShadow:"var(--ck-connectbutton-balance-connectbutton-box-shadow)",borderRadius:"var(--ck-connectbutton-balance-connectbutton-border-radius)",overflow:"hidden"}:{overflow:"hidden"},children:jsxRuntimeExports.jsx(ConnectKitButtonInner,{separator:pt,showAvatar:tt,label:et})})]})})}ConnectKitButton.Custom=ConnectButtonRenderer;const dist=8,shake=We`
0%{ transform:none; }
25%{ transform:translateX(${dist}px); }
50%{ transform:translateX(-${dist}px); }
75%{ transform:translateX(${dist}px); }
100%{ transform:none; }
`,cursorIn=We`
0%{ transform:translate(500%,100%); opacity:0; }
60%{ transform:translate(25%,-20%); opacity:1; }
70%{ transform:translate(25%,-20%); }
85%{ transform:translate(25%,-20%) scale(0.9); }
100%{ transform:translate(25%,-20%) scale(1); opacity:1; }
`;styled.div`
z-index: 2;
position: absolute;
top: 50%;
left: 50%;
width: 32px;
height: 32px;
border-radius: 50%;
background: rgba(0, 0, 0, 0.5);
box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4), 0 4px 6px rgba(0, 0, 0, 0.1);
opacity: 0;
&.play {
animation: ${cursorIn} 1300ms 200ms cubic-bezier(0.16, 1, 0.6, 1) both;
}
`;styled.div`
z-index: 1;
position: absolute;
inset: 0;
&.shake {
animation: ${shake} 300ms 100ms cubic-bezier(0.16, 1, 0.6, 1) both;
}
`;styled.div`
z-index: 1;
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
&:before {
z-index: 9;
content: '';
position: absolute;
inset: 0;
}
`;const CONNECTKIT_VERSION="1.8.2";/**
* @remix-run/router v1.20.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function _extends$2(){return _extends$2=Object.assign?Object.assign.bind():function(et){for(var o=1;o<arguments.length;o++){var tt=arguments[o];for(var rt in tt)Object.prototype.hasOwnProperty.call(tt,rt)&&(et[rt]=tt[rt])}return et},_extends$2.apply(this,arguments)}var Action;(function(et){et.Pop="POP",et.Push="PUSH",et.Replace="REPLACE"})(Action||(Action={}));const PopStateEventType="popstate";function createBrowserHistory(et){et===void 0&&(et={});function o(rt,nt){let{pathname:ot,search:it,hash:st}=rt.location;return createLocation("",{pathname:ot,search:it,hash:st},nt.state&&nt.state.usr||null,nt.state&&nt.state.key||"default")}function tt(rt,nt){return typeof nt=="string"?nt:createPath(nt)}return getUrlBasedHistory(o,tt,null,et)}function invariant(et,o){if(et===!1||et===null||typeof et>"u")throw new Error(o)}function warning(et,o){if(!et){typeof console<"u"&&console.warn(o);try{throw new Error(o)}catch{}}}function createKey(){return Math.random().toString(36).substr(2,8)}function getHistoryState(et,o){return{usr:et.state,key:et.key,idx:o}}function createLocation(et,o,tt,rt){return tt===void 0&&(tt=null),_extends$2({pathname:typeof et=="string"?et:et.pathname,search:"",hash:""},typeof o=="string"?parsePath(o):o,{state:tt,key:o&&o.key||rt||createKey()})}function createPath(et){let{pathname:o="/",search:tt="",hash:rt=""}=et;return tt&&tt!=="?"&&(o+=tt.charAt(0)==="?"?tt:"?"+tt),rt&&rt!=="#"&&(o+=rt.charAt(0)==="#"?rt:"#"+rt),o}function parsePath(et){let o={};if(et){let tt=et.indexOf("#");tt>=0&&(o.hash=et.substr(tt),et=et.substr(0,tt));let rt=et.indexOf("?");rt>=0&&(o.search=et.substr(rt),et=et.substr(0,rt)),et&&(o.pathname=et)}return o}function getUrlBasedHistory(et,o,tt,rt){rt===void 0&&(rt={});let{window:nt=document.defaultView,v5Compat:ot=!1}=rt,it=nt.history,st=Action.Pop,at=null,ct=lt();ct==null&&(ct=0,it.replaceState(_extends$2({},it.state,{idx:ct}),""));function lt(){return(it.state||{idx:null}).idx}function dt(){st=Action.Pop;let yt=lt(),gt=yt==null?null:yt-ct;ct=yt,at&&at({action:st,location:pt.location,delta:gt})}function ht(yt,gt){st=Action.Push;let bt=createLocation(pt.location,yt,gt);ct=lt()+1;let xt=getHistoryState(bt,ct),vt=pt.createHref(bt);try{it.pushState(xt,"",vt)}catch(Et){if(Et instanceof DOMException&&Et.name==="DataCloneError")throw Et;nt.location.assign(vt)}ot&&at&&at({action:st,location:pt.location,delta:1})}function mt(yt,gt){st=Action.Replace;let bt=createLocation(pt.location,yt,gt);ct=lt();let xt=getHistoryState(bt,ct),vt=pt.createHref(bt);it.replaceState(xt,"",vt),ot&&at&&at({action:st,location:pt.location,delta:0})}function ft(yt){let gt=nt.location.origin!=="null"?nt.location.origin:nt.location.href,bt=typeof yt=="string"?yt:createPath(yt);return bt=bt.replace(/ $/,"%20"),invariant(gt,"No window.location.(origin|href) available to create URL for href: "+bt),new URL(bt,gt)}let pt={get action(){return st},get location(){return et(nt,it)},listen(yt){if(at)throw new Error("A history only accepts one active listener");return nt.addEventListener(PopStateEventType,dt),at=yt,()=>{nt.removeEventListener(PopStateEventType,dt),at=null}},createHref(yt){return o(nt,yt)},createURL:ft,encodeLocation(yt){let gt=ft(yt);return{pathname:gt.pathname,search:gt.search,hash:gt.hash}},push:ht,replace:mt,go(yt){return it.go(yt)}};return pt}var ResultType;(function(et){et.data="data",et.deferred="deferred",et.redirect="redirect",et.error="error"})(ResultType||(ResultType={}));function matchRoutes(et,o,tt){return tt===void 0&&(tt="/"),matchRoutesImpl(et,o,tt,!1)}function matchRoutesImpl(et,o,tt,rt){let nt=typeof o=="string"?parsePath(o):o,ot=stripBasename(nt.pathname||"/",tt);if(ot==null)return null;let it=flattenRoutes(et);rankRouteBranches(it);let st=null;for(let at=0;st==null&&at<it.length;++at){let ct=decodePath(ot);st=matchRouteBranch(it[at],ct,rt)}return st}function flattenRoutes(et,o,tt,rt){o===void 0&&(o=[]),tt===void 0&&(tt=[]),rt===void 0&&(rt="");let nt=(ot,it,st)=>{let at={relativePath:st===void 0?ot.path||"":st,caseSensitive:ot.caseSensitive===!0,childrenIndex:it,route:ot};at.relativePath.startsWith("/")&&(invariant(at.relativePath.startsWith(rt),'Absolute route path "'+at.relativePath+'" nested under path '+('"'+rt+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),at.relativePath=at.relativePath.slice(rt.length));let ct=joinPaths([rt,at.relativePath]),lt=tt.concat(at);ot.children&&ot.children.length>0&&(invariant(ot.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+ct+'".')),flattenRoutes(ot.children,o,lt,ct)),!(ot.path==null&&!ot.index)&&o.push({path:ct,score:computeScore(ct,ot.index),routesMeta:lt})};return et.forEach((ot,it)=>{var st;if(ot.path===""||!((st=ot.path)!=null&&st.includes("?")))nt(ot,it);else for(let at of explodeOptionalSegments(ot.path))nt(ot,it,at)}),o}function explodeOptionalSegments(et){let o=et.split("/");if(o.length===0)return[];let[tt,...rt]=o,nt=tt.endsWith("?"),ot=tt.replace(/\?$/,"");if(rt.length===0)return nt?[ot,""]:[ot];let it=explodeOptionalSegments(rt.join("/")),st=[];return st.push(...it.map(at=>at===""?ot:[ot,at].join("/"))),nt&&st.push(...it),st.map(at=>et.startsWith("/")&&at===""?"/":at)}function rankRouteBranches(et){et.sort((o,tt)=>o.score!==tt.score?tt.score-o.score:compareIndexes(o.routesMeta.map(rt=>rt.childrenIndex),tt.routesMeta.map(rt=>rt.childrenIndex)))}const paramRe=/^:[\w-]+$/,dynamicSegmentValue=3,indexRouteValue=2,emptySegmentValue=1,staticSegmentValue=10,splatPenalty=-2,isSplat=et=>et==="*";function computeScore(et,o){let tt=et.split("/"),rt=tt.length;return tt.some(isSplat)&&(rt+=splatPenalty),o&&(rt+=indexRouteValue),tt.filter(nt=>!isSplat(nt)).reduce((nt,ot)=>nt+(paramRe.test(ot)?dynamicSegmentValue:ot===""?emptySegmentValue:staticSegmentValue),rt)}function compareIndexes(et,o){return et.length===o.length&&et.slice(0,-1).every((rt,nt)=>rt===o[nt])?et[et.length-1]-o[o.length-1]:0}function matchRouteBranch(et,o,tt){let{routesMeta:rt}=et,nt={},ot="/",it=[];for(let st=0;st<rt.length;++st){let at=rt[st],ct=st===rt.length-1,lt=ot==="/"?o:o.slice(ot.length)||"/",dt=matchPath({path:at.relativePath,caseSensitive:at.caseSensitive,end:ct},lt),ht=at.route;if(!dt&&ct&&tt&&!rt[rt.length-1].route.index&&(dt=matchPath({path:at.relativePath,caseSensitive:at.caseSensitive,end:!1},lt)),!dt)return null;Object.assign(nt,dt.params),it.push({params:nt,pathname:joinPaths([ot,dt.pathname]),pathnameBase:normalizePathname(joinPaths([ot,dt.pathnameBase])),route:ht}),dt.pathnameBase!=="/"&&(ot=joinPaths([ot,dt.pathnameBase]))}return it}function matchPath(et,o){typeof et=="string"&&(et={path:et,caseSensitive:!1,end:!0});let[tt,rt]=compilePath(et.path,et.caseSensitive,et.end),nt=o.match(tt);if(!nt)return null;let ot=nt[0],it=ot.replace(/(.)\/+$/,"$1"),st=nt.slice(1);return{params:rt.reduce((ct,lt,dt)=>{let{paramName:ht,isOptional:mt}=lt;if(ht==="*"){let pt=st[dt]||"";it=ot.slice(0,ot.length-pt.length).replace(/(.)\/+$/,"$1")}const ft=st[dt];return mt&&!ft?ct[ht]=void 0:ct[ht]=(ft||"").replace(/%2F/g,"/"),ct},{}),pathname:ot,pathnameBase:it,pattern:et}}function compilePath(et,o,tt){o===void 0&&(o=!1),tt===void 0&&(tt=!0),warning(et==="*"||!et.endsWith("*")||et.endsWith("/*"),'Route path "'+et+'" will be treated as if it were '+('"'+et.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+et.replace(/\*$/,"/*")+'".'));let rt=[],nt="^"+et.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(it,st,at)=>(rt.push({paramName:st,isOptional:at!=null}),at?"/?([^\\/]+)?":"/([^\\/]+)"));return et.endsWith("*")?(rt.push({paramName:"*"}),nt+=et==="*"||et==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):tt?nt+="\\/*$":et!==""&&et!=="/"&&(nt+="(?:(?=\\/|$))"),[new RegExp(nt,o?void 0:"i"),rt]}function decodePath(et){try{return et.split("/").map(o=>decodeURIComponent(o).replace(/\//g,"%2F")).join("/")}catch(o){return warning(!1,'The URL path "'+et+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+o+").")),et}}function stripBasename(et,o){if(o==="/")return et;if(!et.toLowerCase().startsWith(o.toLowerCase()))return null;let tt=o.endsWith("/")?o.length-1:o.length,rt=et.charAt(tt);return rt&&rt!=="/"?null:et.slice(tt)||"/"}function resolvePath(et,o){o===void 0&&(o="/");let{pathname:tt,search:rt="",hash:nt=""}=typeof et=="string"?parsePath(et):et;return{pathname:tt?tt.startsWith("/")?tt:resolvePathname(tt,o):o,search:normalizeSearch(rt),hash:normalizeHash(nt)}}function resolvePathname(et,o){let tt=o.replace(/\/+$/,"").split("/");return et.split("/").forEach(nt=>{nt===".."?tt.length>1&&tt.pop():nt!=="."&&tt.push(nt)}),tt.length>1?tt.join("/"):"/"}function getInvalidPathError(et,o,tt,rt){return"Cannot include a '"+et+"' character in a manually specified "+("`to."+o+"` field ["+JSON.stringify(rt)+"]. Please separate it out to the ")+("`to."+tt+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function getPathContributingMatches(et){return et.filter((o,tt)=>tt===0||o.route.path&&o.route.path.length>0)}function getResolveToMatches(et,o){let tt=getPathContributingMatches(et);return o?tt.map((rt,nt)=>nt===tt.length-1?rt.pathname:rt.pathnameBase):tt.map(rt=>rt.pathnameBase)}function resolveTo(et,o,tt,rt){rt===void 0&&(rt=!1);let nt;typeof et=="string"?nt=parsePath(et):(nt=_extends$2({},et),invariant(!nt.pathname||!nt.pathname.includes("?"),getInvalidPathError("?","pathname","search",nt)),invariant(!nt.pathname||!nt.pathname.includes("#"),getInvalidPathError("#","pathname","hash",nt)),invariant(!nt.search||!nt.search.includes("#"),getInvalidPathError("#","search","hash",nt)));let ot=et===""||nt.pathname==="",it=ot?"/":nt.pathname,st;if(it==null)st=tt;else{let dt=o.length-1;if(!rt&&it.startsWith("..")){let ht=it.split("/");for(;ht[0]==="..";)ht.shift(),dt-=1;nt.pathname=ht.join("/")}st=dt>=0?o[dt]:"/"}let at=resolvePath(nt,st),ct=it&&it!=="/"&&it.endsWith("/"),lt=(ot||it===".")&&tt.endsWith("/");return!at.pathname.endsWith("/")&&(ct||lt)&&(at.pathname+="/"),at}const joinPaths=et=>et.join("/").replace(/\/\/+/g,"/"),normalizePathname=et=>et.replace(/\/+$/,"").replace(/^\/*/,"/"),normalizeSearch=et=>!et||et==="?"?"":et.startsWith("?")?et:"?"+et,normalizeHash=et=>!et||et==="#"?"":et.startsWith("#")?et:"#"+et;function isRouteErrorResponse(et){return et!=null&&typeof et.status=="number"&&typeof et.statusText=="string"&&typeof et.internal=="boolean"&&"data"in et}const validMutationMethodsArr=["post","put","patch","delete"];new Set(validMutationMethodsArr);const validRequestMethodsArr=["get",...validMutationMethodsArr];new Set(validRequestMethodsArr);/**
* React Router v6.27.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function _extends$1(){return _extends$1=Object.assign?Object.assign.bind():function(et){for(var o=1;o<arguments.length;o++){var tt=arguments[o];for(var rt in tt)Object.prototype.hasOwnProperty.call(tt,rt)&&(et[rt]=tt[rt])}return et},_extends$1.apply(this,arguments)}const DataRouterContext=reactExports.createContext(null),DataRouterStateContext=reactExports.createContext(null),NavigationContext=reactExports.createContext(null),LocationContext=reactExports.createContext(null),RouteContext=reactExports.createContext({outlet:null,matches:[],isDataRoute:!1}),RouteErrorContext=reactExports.createContext(null);function useHref(et,o){let{relative:tt}=o===void 0?{}:o;useInRouterContext()||invariant(!1);let{basename:rt,navigator:nt}=reactExports.useContext(NavigationContext),{hash:ot,pathname:it,search:st}=useResolvedPath(et,{relative:tt}),at=it;return rt!=="/"&&(at=it==="/"?rt:joinPaths([rt,it])),nt.createHref({pathname:at,search:st,hash:ot})}function useInRouterContext(){return reactExports.useContext(LocationContext)!=null}function useLocation(){return useInRouterContext()||invariant(!1),reactExports.useContext(LocationContext).location}function useIsomorphicLayoutEffect$1(et){reactExports.useContext(NavigationContext).static||reactExports.useLayoutEffect(et)}function useNavigate(){let{isDataRoute:et}=reactExports.useContext(RouteContext);return et?useNavigateStable():useNavigateUnstable()}function useNavigateUnstable(){useInRouterContext()||invariant(!1);let et=reactExports.useContext(DataRouterContext),{basename:o,future:tt,navigator:rt}=reactExports.useContext(NavigationContext),{matches:nt}=reactExports.useContext(RouteContext),{pathname:ot}=useLocation(),it=JSON.stringify(getResolveToMatches(nt,tt.v7_relativeSplatPath)),st=reactExports.useRef(!1);return useIsomorphicLayoutEffect$1(()=>{st.current=!0}),reactExports.useCallback(function(ct,lt){if(lt===void 0&&(lt={}),!st.current)return;if(typeof ct=="number"){rt.go(ct);return}let dt=resolveTo(ct,JSON.parse(it),ot,lt.relative==="path");et==null&&o!=="/"&&(dt.pathname=dt.pathname==="/"?o:joinPaths([o,dt.pathname])),(lt.replace?rt.replace:rt.push)(dt,lt.state,lt)},[o,rt,it,ot,et])}function useParams(){let{matches:et}=reactExports.useContext(RouteContext),o=et[et.length-1];return o?o.params:{}}function useResolvedPath(et,o){let{relative:tt}=o===void 0?{}:o,{future:rt}=reactExports.useContext(NavigationContext),{matches:nt}=reactExports.useContext(RouteContext),{pathname:ot}=useLocation(),it=JSON.stringify(getResolveToMatches(nt,rt.v7_relativeSplatPath));return reactExports.useMemo(()=>resolveTo(et,JSON.parse(it),ot,tt==="path"),[et,it,ot,tt])}function useRoutes(et,o){return useRoutesImpl(et,o)}function useRoutesImpl(et,o,tt,rt){useInRouterContext()||invariant(!1);let{navigator:nt}=reactExports.useContext(NavigationContext),{matches:ot}=reactExports.useContext(RouteContext),it=ot[ot.length-1],st=it?it.params:{};it&&it.pathname;let at=it?it.pathnameBase:"/";it&&it.route;let ct=useLocation(),lt;if(o){var dt;let yt=typeof o=="string"?parsePath(o):o;at==="/"||(dt=yt.pathname)!=null&&dt.startsWith(at)||invariant(!1),lt=yt}else lt=ct;let ht=lt.pathname||"/",mt=ht;if(at!=="/"){let yt=at.replace(/^\//,"").split("/");mt="/"+ht.replace(/^\//,"").split("/").slice(yt.length).join("/")}let ft=matchRoutes(et,{pathname:mt}),pt=_renderMatches(ft&&ft.map(yt=>Object.assign({},yt,{params:Object.assign({},st,yt.params),pathname:joinPaths([at,nt.encodeLocation?nt.encodeLocation(yt.pathname).pathname:yt.pathname]),pathnameBase:yt.pathnameBase==="/"?at:joinPaths([at,nt.encodeLocation?nt.encodeLocation(yt.pathnameBase).pathname:yt.pathnameBase])})),ot,tt,rt);return o&&pt?reactExports.createElement(LocationContext.Provider,{value:{location:_extends$1({pathname:"/",search:"",hash:"",state:null,key:"default"},lt),navigationType:Action.Pop}},pt):pt}function DefaultErrorComponent(){let et=useRouteError(),o=isRouteErrorResponse(et)?et.status+" "+et.statusText:et instanceof Error?et.message:JSON.stringify(et),tt=et instanceof Error?et.stack:null,nt={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return reactExports.createElement(reactExports.Fragment,null,reactExports.createElement("h2",null,"Unexpected Application Error!"),reactExports.createElement("h3",{style:{fontStyle:"italic"}},o),tt?reactExports.createElement("pre",{style:nt},tt):null,null)}const defaultErrorElement=reactExports.createElement(DefaultErrorComponent,null);class RenderErrorBoundary extends reactExports.Component{constructor(o){super(o),this.state={location:o.location,revalidation:o.revalidation,error:o.error}}static getDerivedStateFromError(o){return{error:o}}static getDerivedStateFromProps(o,tt){return tt.location!==o.location||tt.revalidation!=="idle"&&o.revalidation==="idle"?{error:o.error,location:o.location,revalidation:o.revalidation}:{error:o.error!==void 0?o.error:tt.error,location:tt.location,revalidation:o.revalidation||tt.revalidation}}componentDidCatch(o,tt){console.error("React Router caught the following error during render",o,tt)}render(){return this.state.error!==void 0?reactExports.createElement(RouteContext.Provider,{value:this.props.routeContext},reactExports.createElement(RouteErrorContext.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function RenderedRoute(et){let{routeContext:o,match:tt,children:rt}=et,nt=reactExports.useContext(DataRouterContext);return nt&&nt.static&&nt.staticContext&&(tt.route.errorElement||tt.route.ErrorBoundary)&&(nt.staticContext._deepestRenderedBoundaryId=tt.route.id),reactExports.createElement(RouteContext.Provider,{value:o},rt)}function _renderMatches(et,o,tt,rt){var nt;if(o===void 0&&(o=[]),tt===void 0&&(tt=null),rt===void 0&&(rt=null),et==null){var ot;if(!tt)return null;if(tt.errors)et=tt.matches;else if((ot=rt)!=null&&ot.v7_partialHydration&&o.length===0&&!tt.initialized&&tt.matches.length>0)et=tt.matches;else return null}let it=et,st=(nt=tt)==null?void 0:nt.errors;if(st!=null){let lt=it.findIndex(dt=>dt.route.id&&(st==null?void 0:st[dt.route.id])!==void 0);lt>=0||invariant(!1),it=it.slice(0,Math.min(it.length,lt+1))}let at=!1,ct=-1;if(tt&&rt&&rt.v7_partialHydration)for(let lt=0;lt<it.length;lt++){let dt=it[lt];if((dt.route.HydrateFallback||dt.route.hydrateFallbackElement)&&(ct=lt),dt.route.id){let{loaderData:ht,errors:mt}=tt,ft=dt.route.loader&&ht[dt.route.id]===void 0&&(!mt||mt[dt.route.id]===void 0);if(dt.route.lazy||ft){at=!0,ct>=0?it=it.slice(0,ct+1):it=[it[0]];break}}}return it.reduceRight((lt,dt,ht)=>{let mt,ft=!1,pt=null,yt=null;tt&&(mt=st&&dt.route.id?st[dt.route.id]:void 0,pt=dt.route.errorElement||defaultErrorElement,at&&(ct<0&&ht===0?(ft=!0,yt=null):ct===ht&&(ft=!0,yt=dt.route.hydrateFallbackElement||null)));let gt=o.concat(it.slice(0,ht+1)),bt=()=>{let xt;return mt?xt=pt:ft?xt=yt:dt.route.Component?xt=reactExports.createElement(dt.route.Component,null):dt.route.element?xt=dt.route.element:xt=lt,reactExports.createElement(RenderedRoute,{match:dt,routeContext:{outlet:lt,matches:gt,isDataRoute:tt!=null},children:xt})};return tt&&(dt.route.ErrorBoundary||dt.route.errorElement||ht===0)?reactExports.createElement(RenderErrorBoundary,{location:tt.location,revalidation:tt.revalidation,component:pt,error:mt,children:bt(),routeContext:{outlet:null,matches:gt,isDataRoute:!0}}):bt()},null)}var DataRouterHook$1=function(et){return et.UseBlocker="useBlocker",et.UseRevalidator="useRevalidator",et.UseNavigateStable="useNavigate",et}(DataRouterHook$1||{}),DataRouterStateHook$1=function(et){return et.UseBlocker="useBlocker",et.UseLoaderData="useLoaderData",et.UseActionData="useActionData",et.UseRouteError="useRouteError",et.UseNavigation="useNavigation",et.UseRouteLoaderData="useRouteLoaderData",et.UseMatches="useMatches",et.UseRevalidator="useRevalidator",et.UseNavigateStable="useNavigate",et.UseRouteId="useRouteId",et}(DataRouterStateHook$1||{});function useDataRouterContext(et){let o=reactExports.useContext(DataRouterContext);return o||invariant(!1),o}function useDataRouterState(et){let o=reactExports.useContext(DataRouterStateContext);return o||invariant(!1),o}function useRouteContext(et){let o=reactExports.useContext(RouteContext);return o||invariant(!1),o}function useCurrentRouteId(et){let o=useRouteContext(),tt=o.matches[o.matches.length-1];return tt.route.id||invariant(!1),tt.route.id}function useRouteError(){var et;let o=reactExports.useContext(RouteErrorContext),tt=useDataRouterState(DataRouterStateHook$1.UseRouteError),rt=useCurrentRouteId(DataRouterStateHook$1.UseRouteError);return o!==void 0?o:(et=tt.errors)==null?void 0:et[rt]}function useNavigateStable(){let{router:et}=useDataRouterContext(DataRouterHook$1.UseNavigateStable),o=useCurrentRouteId(DataRouterStateHook$1.UseNavigateStable),tt=reactExports.useRef(!1);return useIsomorphicLayoutEffect$1(()=>{tt.current=!0}),reactExports.useCallback(function(nt,ot){ot===void 0&&(ot={}),tt.current&&(typeof nt=="number"?et.navigate(nt):et.navigate(nt,_extends$1({fromRouteId:o},ot)))},[et,o])}function Navigate(et){let{to:o,replace:tt,state:rt,relative:nt}=et;useInRouterContext()||invariant(!1);let{future:ot,static:it}=reactExports.useContext(NavigationContext),{matches:st}=reactExports.useContext(RouteContext),{pathname:at}=useLocation(),ct=useNavigate(),lt=resolveTo(o,getResolveToMatches(st,ot.v7_relativeSplatPath),at,nt==="path"),dt=JSON.stringify(lt);return reactExports.useEffect(()=>ct(JSON.parse(dt),{replace:tt,state:rt,relative:nt}),[ct,dt,nt,tt,rt]),null}function Route(et){invariant(!1)}function Router(et){let{basename:o="/",children:tt=null,location:rt,navigationType:nt=Action.Pop,navigator:ot,static:it=!1,future:st}=et;useInRouterContext()&&invariant(!1);let at=o.replace(/^\/*/,"/"),ct=reactExports.useMemo(()=>({basename:at,navigator:ot,static:it,future:_extends$1({v7_relativeSplatPath:!1},st)}),[at,st,ot,it]);typeof rt=="string"&&(rt=parsePath(rt));let{pathname:lt="/",search:dt="",hash:ht="",state:mt=null,key:ft="default"}=rt,pt=reactExports.useMemo(()=>{let yt=stripBasename(lt,at);return yt==null?null:{location:{pathname:yt,search:dt,hash:ht,state:mt,key:ft},navigationType:nt}},[at,lt,dt,ht,mt,ft,nt]);return pt==null?null:reactExports.createElement(NavigationContext.Provider,{value:ct},reactExports.createElement(LocationContext.Provider,{children:tt,value:pt}))}function Routes(et){let{children:o,location:tt}=et;return useRoutes(createRoutesFromChildren(o),tt)}new Promise(()=>{});function createRoutesFromChildren(et,o){o===void 0&&(o=[]);let tt=[];return reactExports.Children.forEach(et,(rt,nt)=>{if(!reactExports.isValidElement(rt))return;let ot=[...o,nt];if(rt.type===reactExports.Fragment){tt.push.apply(tt,createRoutesFromChildren(rt.props.children,ot));return}rt.type!==Route&&invariant(!1),!rt.props.index||!rt.props.children||invariant(!1);let it={id:rt.props.id||ot.join("-"),caseSensitive:rt.props.caseSensitive,element:rt.props.element,Component:rt.props.Component,index:rt.props.index,path:rt.props.path,loader:rt.props.loader,action:rt.props.action,errorElement:rt.props.errorElement,ErrorBoundary:rt.props.ErrorBoundary,hasErrorBoundary:rt.props.ErrorBoundary!=null||rt.props.errorElement!=null,shouldRevalidate:rt.props.shouldRevalidate,handle:rt.props.handle,lazy:rt.props.lazy};rt.props.children&&(it.children=createRoutesFromChildren(rt.props.children,ot)),tt.push(it)}),tt}/**
* React Router DOM v6.27.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function _extends(){return _extends=Object.assign?Object.assign.bind():function(et){for(var o=1;o<arguments.length;o++){var tt=arguments[o];for(var rt in tt)Object.prototype.hasOwnProperty.call(tt,rt)&&(et[rt]=tt[rt])}return et},_extends.apply(this,arguments)}function _objectWithoutPropertiesLoose(et,o){if(et==null)return{};var tt={},rt=Object.keys(et),nt,ot;for(ot=0;ot<rt.length;ot++)nt=rt[ot],!(o.indexOf(nt)>=0)&&(tt[nt]=et[nt]);return tt}function isModifiedEvent(et){return!!(et.metaKey||et.altKey||et.ctrlKey||et.shiftKey)}function shouldProcessLinkClick(et,o){return et.button===0&&(!o||o==="_self")&&!isModifiedEvent(et)}const _excluded=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],REACT_ROUTER_VERSION="6";try{window.__reactRouterVersion=REACT_ROUTER_VERSION}catch{}const START_TRANSITION="startTransition",startTransitionImpl=React$1[START_TRANSITION];function BrowserRouter(et){let{basename:o,children:tt,future:rt,window:nt}=et,ot=reactExports.useRef();ot.current==null&&(ot.current=createBrowserHistory({window:nt,v5Compat:!0}));let it=ot.current,[st,at]=reactExports.useState({action:it.action,location:it.location}),{v7_startTransition:ct}=rt||{},lt=reactExports.useCallback(dt=>{ct&&startTransitionImpl?startTransitionImpl(()=>at(dt)):at(dt)},[at,ct]);return reactExports.useLayoutEffect(()=>it.listen(lt),[it,lt]),reactExports.createElement(Router,{basename:o,children:tt,location:st.location,navigationType:st.action,navigator:it,future:rt})}const isBrowser$1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ABSOLUTE_URL_REGEX=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Link=reactExports.forwardRef(function(o,tt){let{onClick:rt,relative:nt,reloadDocument:ot,replace:it,state:st,target:at,to:ct,preventScrollReset:lt,viewTransition:dt}=o,ht=_objectWithoutPropertiesLoose(o,_excluded),{basename:mt}=reactExports.useContext(NavigationContext),ft,pt=!1;if(typeof ct=="string"&&ABSOLUTE_URL_REGEX.test(ct)&&(ft=ct,isBrowser$1))try{let xt=new URL(window.location.href),vt=ct.startsWith("//")?new URL(xt.protocol+ct):new URL(ct),Et=stripBasename(vt.pathname,mt);vt.origin===xt.origin&&Et!=null?ct=Et+vt.search+vt.hash:pt=!0}catch{}let yt=useHref(ct,{relative:nt}),gt=useLinkClickHandler(ct,{replace:it,state:st,target:at,preventScrollReset:lt,relative:nt,viewTransition:dt});function bt(xt){rt&&rt(xt),xt.defaultPrevented||gt(xt)}return reactExports.createElement("a",_extends({},ht,{href:ft||yt,onClick:pt||ot?rt:bt,ref:tt,target:at}))});var DataRouterHook;(function(et){et.UseScrollRestoration="useScrollRestoration",et.UseSubmit="useSubmit",et.UseSubmitFetcher="useSubmitFetcher",et.UseFetcher="useFetcher",et.useViewTransitionState="useViewTransitionState"})(DataRouterHook||(DataRouterHook={}));var DataRouterStateHook;(function(et){et.UseFetcher="useFetcher",et.UseFetchers="useFetchers",et.UseScrollRestoration="useScrollRestoration"})(DataRouterStateHook||(DataRouterStateHook={}));function useLinkClickHandler(et,o){let{target:tt,replace:rt,state:nt,preventScrollReset:ot,relative:it,viewTransition:st}=o===void 0?{}:o,at=useNavigate(),ct=useLocation(),lt=useResolvedPath(et,{relative:it});return reactExports.useCallback(dt=>{if(shouldProcessLinkClick(dt,tt)){dt.preventDefault();let ht=rt!==void 0?rt:createPath(ct)===createPath(lt);at(et,{replace:ht,state:nt,preventScrollReset:ot,relative:it,viewTransition:st})}},[ct,at,lt,rt,nt,tt,et,ot,it,st])}function setRef(et,o){typeof et=="function"?et(o):et!=null&&(et.current=o)}function composeRefs(...et){return o=>et.forEach(tt=>setRef(tt,o))}function useComposedRefs(...et){return reactExports.useCallback(composeRefs(...et),et)}var Slot=reactExports.forwardRef((et,o)=>{const{children:tt,...rt}=et,nt=reactExports.Children.toArray(tt),ot=nt.find(isSlottable);if(ot){const it=ot.props.children,st=nt.map(at=>at===ot?reactExports.Children.count(it)>1?reactExports.Children.only(null):reactExports.isValidElement(it)?it.props.children:null:at);return jsxRuntimeExports.jsx(SlotClone,{...rt,ref:o,children:reactExports.isValidElement(it)?reactExports.cloneElement(it,void 0,st):null})}return jsxRuntimeExports.jsx(SlotClone,{...rt,ref:o,children:tt})});Slot.displayName="Slot";var SlotClone=reactExports.forwardRef((et,o)=>{const{children:tt,...rt}=et;if(reactExports.isValidElement(tt)){const nt=getElementRef$1(tt);return reactExports.cloneElement(tt,{...mergeProps(rt,tt.props),ref:o?composeRefs(o,nt):nt})}return reactExports.Children.count(tt)>1?reactExports.Children.only(null):null});SlotClone.displayName="SlotClone";var Slottable=({children:et})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:et});function isSlottable(et){return reactExports.isValidElement(et)&&et.type===Slottable}function mergeProps(et,o){const tt={...o};for(const rt in o){const nt=et[rt],ot=o[rt];/^on[A-Z]/.test(rt)?nt&&ot?tt[rt]=(...st)=>{ot(...st),nt(...st)}:nt&&(tt[rt]=nt):rt==="style"?tt[rt]={...nt,...ot}:rt==="className"&&(tt[rt]=[nt,ot].filter(Boolean).join(" "))}return{...et,...tt}}function getElementRef$1(et){var rt,nt;let o=(rt=Object.getOwnPropertyDescriptor(et.props,"ref"))==null?void 0:rt.get,tt=o&&"isReactWarning"in o&&o.isReactWarning;return tt?et.ref:(o=(nt=Object.getOwnPropertyDescriptor(et,"ref"))==null?void 0:nt.get,tt=o&&"isReactWarning"in o&&o.isReactWarning,tt?et.props.ref:et.props.ref||et.ref)}function r$1(et){var o,tt,rt="";if(typeof et=="string"||typeof et=="number")rt+=et;else if(typeof et=="object")if(Array.isArray(et))for(o=0;o<et.length;o++)et[o]&&(tt=r$1(et[o]))&&(rt&&(rt+=" "),rt+=tt);else for(o in et)et[o]&&(rt&&(rt+=" "),rt+=o);return rt}function clsx$1(){for(var et,o,tt=0,rt="";tt<arguments.length;)(et=arguments[tt++])&&(o=r$1(et))&&(rt&&(rt+=" "),rt+=o);return rt}const falsyToString=et=>typeof et=="boolean"?"".concat(et):et===0?"0":et,cx=clsx$1,cva=(et,o)=>tt=>{var rt;if((o==null?void 0:o.variants)==null)return cx(et,tt==null?void 0:tt.class,tt==null?void 0:tt.className);const{variants:nt,defaultVariants:ot}=o,it=Object.keys(nt).map(ct=>{const lt=tt==null?void 0:tt[ct],dt=ot==null?void 0:ot[ct];if(lt===null)return null;const ht=falsyToString(lt)||falsyToString(dt);return nt[ct][ht]}),st=tt&&Object.entries(tt).reduce((ct,lt)=>{let[dt,ht]=lt;return ht===void 0||(ct[dt]=ht),ct},{}),at=o==null||(rt=o.compoundVariants)===null||rt===void 0?void 0:rt.reduce((ct,lt)=>{let{class:dt,className:ht,...mt}=lt;return Object.entries(mt).every(ft=>{let[pt,yt]=ft;return Array.isArray(yt)?yt.includes({...ot,...st}[pt]):{...ot,...st}[pt]===yt})?[...ct,dt,ht]:ct},[]);return cx(et,it,at,tt==null?void 0:tt.class,tt==null?void 0:tt.className)};function r(et){var o,tt,rt="";if(typeof et=="string"||typeof et=="number")rt+=et;else if(typeof et=="object")if(Array.isArray(et)){var nt=et.length;for(o=0;o<nt;o++)et[o]&&(tt=r(et[o]))&&(rt&&(rt+=" "),rt+=tt)}else for(tt in et)et[tt]&&(rt&&(rt+=" "),rt+=tt);return rt}function clsx(){for(var et,o,tt=0,rt="",nt=arguments.length;tt<nt;tt++)(et=arguments[tt])&&(o=r(et))&&(rt&&(rt+=" "),rt+=o);return rt}const CLASS_PART_SEPARATOR="-",createClassGroupUtils=et=>{const o=createClassMap(et),{conflictingClassGroups:tt,conflictingClassGroupModifiers:rt}=et;return{getClassGroupId:it=>{const st=it.split(CLASS_PART_SEPARATOR);return st[0]===""&&st.length!==1&&st.shift(),getGroupRecursive(st,o)||getGroupIdForArbitraryProperty(it)},getConflictingClassGroupIds:(it,st)=>{const at=tt[it]||[];return st&&rt[it]?[...at,...rt[it]]:at}}},getGroupRecursive=(et,o)=>{var it;if(et.length===0)return o.classGroupId;const tt=et[0],rt=o.nextPart.get(tt),nt=rt?getGroupRecursive(et.slice(1),rt):void 0;if(nt)return nt;if(o.validators.length===0)return;const ot=et.join(CLASS_PART_SEPARATOR);return(it=o.validators.find(({validator:st})=>st(ot)))==null?void 0:it.classGroupId},arbitraryPropertyRegex=/^\[(.+)\]$/,getGroupIdForArbitraryProperty=et=>{if(arbitraryPropertyRegex.test(et)){const o=arbitraryPropertyRegex.exec(et)[1],tt=o==null?void 0:o.substring(0,o.indexOf(":"));if(tt)return"arbitrary.."+tt}},createClassMap=et=>{const{theme:o,prefix:tt}=et,rt={nextPart:new Map,validators:[]};return getPrefixedClassGroupEntries(Object.entries(et.classGroups),tt).forEach(([ot,it])=>{processClassesRecursively(it,rt,ot,o)}),rt},processClassesRecursively=(et,o,tt,rt)=>{et.forEach(nt=>{if(typeof nt=="string"){const ot=nt===""?o:getPart(o,nt);ot.classGroupId=tt;return}if(typeof nt=="function"){if(isThemeGetter(nt)){processClassesRecursively(nt(rt),o,tt,rt);return}o.validators.push({validator:nt,classGroupId:tt});return}Object.entries(nt).forEach(([ot,it])=>{processClassesRecursively(it,getPart(o,ot),tt,rt)})})},getPart=(et,o)=>{let tt=et;return o.split(CLASS_PART_SEPARATOR).forEach(rt=>{tt.nextPart.has(rt)||tt.nextPart.set(rt,{nextPart:new Map,validators:[]}),tt=tt.nextPart.get(rt)}),tt},isThemeGetter=et=>et.isThemeGetter,getPrefixedClassGroupEntries=(et,o)=>o?et.map(([tt,rt])=>{const nt=rt.map(ot=>typeof ot=="string"?o+ot:typeof ot=="object"?Object.fromEntries(Object.entries(ot).map(([it,st])=>[o+it,st])):ot);return[tt,nt]}):et,createLruCache=et=>{if(et<1)return{get:()=>{},set:()=>{}};let o=0,tt=new Map,rt=new Map;const nt=(ot,it)=>{tt.set(ot,it),o++,o>et&&(o=0,rt=tt,tt=new Map)};return{get(ot){let it=tt.get(ot);if(it!==void 0)return it;if((it=rt.get(ot))!==void 0)return nt(ot,it),it},set(ot,it){tt.has(ot)?tt.set(ot,it):nt(ot,it)}}},IMPORTANT_MODIFIER="!",createParseClassName=et=>{const{separator:o,experimentalParseClassName:tt}=et,rt=o.length===1,nt=o[0],ot=o.length,it=st=>{const at=[];let ct=0,lt=0,dt;for(let yt=0;yt<st.length;yt++){let gt=st[yt];if(ct===0){if(gt===nt&&(rt||st.slice(yt,yt+ot)===o)){at.push(st.slice(lt,yt)),lt=yt+ot;continue}if(gt==="/"){dt=yt;continue}}gt==="["?ct++:gt==="]"&&ct--}const ht=at.length===0?st:st.substring(lt),mt=ht.startsWith(IMPORTANT_MODIFIER),ft=mt?ht.substring(1):ht,pt=dt&&dt>lt?dt-lt:void 0;return{modifiers:at,hasImportantModifier:mt,baseClassName:ft,maybePostfixModifierPosition:pt}};return tt?st=>tt({className:st,parseClassName:it}):it},sortModifiers=et=>{if(et.length<=1)return et;const o=[];let tt=[];return et.forEach(rt=>{rt[0]==="["?(o.push(...tt.sort(),rt),tt=[]):tt.push(rt)}),o.push(...tt.sort()),o},createConfigUtils=et=>({cache:createLruCache(et.cacheSize),parseClassName:createParseClassName(et),...createClassGroupUtils(et)}),SPLIT_CLASSES_REGEX=/\s+/,mergeClassList=(et,o)=>{const{parseClassName:tt,getClassGroupId:rt,getConflictingClassGroupIds:nt}=o,ot=[],it=et.trim().split(SPLIT_CLASSES_REGEX);let st="";for(let at=it.length-1;at>=0;at-=1){const ct=it[at],{modifiers:lt,hasImportantModifier:dt,baseClassName:ht,maybePostfixModifierPosition:mt}=tt(ct);let ft=!!mt,pt=rt(ft?ht.substring(0,mt):ht);if(!pt){if(!ft){st=ct+(st.length>0?" "+st:st);continue}if(pt=rt(ht),!pt){st=ct+(st.length>0?" "+st:st);continue}ft=!1}const yt=sortModifiers(lt).join(":"),gt=dt?yt+IMPORTANT_MODIFIER:yt,bt=gt+pt;if(ot.includes(bt))continue;ot.push(bt);const xt=nt(pt,ft);for(let vt=0;vt<xt.length;++vt){const Et=xt[vt];ot.push(gt+Et)}st=ct+(st.length>0?" "+st:st)}return st};function twJoin(){let et=0,o,tt,rt="";for(;et<arguments.length;)(o=arguments[et++])&&(tt=toValue(o))&&(rt&&(rt+=" "),rt+=tt);return rt}const toValue=et=>{if(typeof et=="string")return et;let o,tt="";for(let rt=0;rt<et.length;rt++)et[rt]&&(o=toValue(et[rt]))&&(tt&&(tt+=" "),tt+=o);return tt};function createTailwindMerge(et,...o){let tt,rt,nt,ot=it;function it(at){const ct=o.reduce((lt,dt)=>dt(lt),et());return tt=createConfigUtils(ct),rt=tt.cache.get,nt=tt.cache.set,ot=st,st(at)}function st(at){const ct=rt(at);if(ct)return ct;const lt=mergeClassList(at,tt);return nt(at,lt),lt}return function(){return ot(twJoin.apply(null,arguments))}}const fromTheme=et=>{const o=tt=>tt[et]||[];return o.isThemeGetter=!0,o},arbitraryValueRegex=/^\[(?:([a-z-]+):)?(.+)\]$/i,fractionRegex=/^\d+\/\d+$/,stringLengths=new Set(["px","full","screen"]),tshirtUnitRegex=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lengthUnitRegex=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,colorFunctionRegex=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,shadowRegex=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,imageRegex=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,isLength=et=>isNumber(et)||stringLengths.has(et)||fractionRegex.test(et),isArbitraryLength=et=>getIsArbitraryValue(et,"length",isLengthOnly),isNumber=et=>!!et&&!Number.isNaN(Number(et)),isArbitraryNumber=et=>getIsArbitraryValue(et,"number",isNumber),isInteger$1=et=>!!et&&Number.isInteger(Number(et)),isPercent=et=>et.endsWith("%")&&isNumber(et.slice(0,-1)),isArbitraryValue=et=>arbitraryValueRegex.test(et),isTshirtSize=et=>tshirtUnitRegex.test(et),sizeLabels=new Set(["length","size","percentage"]),isArbitrarySize=et=>getIsArbitraryValue(et,sizeLabels,isNever),isArbitraryPosition=et=>getIsArbitraryValue(et,"position",isNever),imageLabels=new Set(["image","url"]),isArbitraryImage=et=>getIsArbitraryValue(et,imageLabels,isImage),isArbitraryShadow=et=>getIsArbitraryValue(et,"",isShadow),isAny=()=>!0,getIsArbitraryValue=(et,o,tt)=>{const rt=arbitraryValueRegex.exec(et);return rt?rt[1]?typeof o=="string"?rt[1]===o:o.has(rt[1]):tt(rt[2]):!1},isLengthOnly=et=>lengthUnitRegex.test(et)&&!colorFunctionRegex.test(et),isNever=()=>!1,isShadow=et=>shadowRegex.test(et),isImage=et=>imageRegex.test(et),getDefaultConfig=()=>{const et=fromTheme("colors"),o=fromTheme("spacing"),tt=fromTheme("blur"),rt=fromTheme("brightness"),nt=fromTheme("borderColor"),ot=fromTheme("borderRadius"),it=fromTheme("borderSpacing"),st=fromTheme("borderWidth"),at=fromTheme("contrast"),ct=fromTheme("grayscale"),lt=fromTheme("hueRotate"),dt=fromTheme("invert"),ht=fromTheme("gap"),mt=fromTheme("gradientColorStops"),ft=fromTheme("gradientColorStopPositions"),pt=fromTheme("inset"),yt=fromTheme("margin"),gt=fromTheme("opacity"),bt=fromTheme("padding"),xt=fromTheme("saturate"),vt=fromTheme("scale"),Et=fromTheme("sepia"),Ct=fromTheme("skew"),St=fromTheme("space"),At=fromTheme("translate"),kt=()=>["auto","contain","none"],It=()=>["auto","hidden","clip","visible","scroll"],Nt=()=>["auto",isArbitraryValue,o],Lt=()=>[isArbitraryValue,o],Mt=()=>["",isLength,isArbitraryLength],zt=()=>["auto",isNumber,isArbitraryValue],Ut=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Xt=()=>["solid","dashed","dotted","double","none"],Wt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ft=()=>["start","end","center","between","around","evenly","stretch"],qt=()=>["","0",isArbitraryValue],Pt=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Yt=()=>[isNumber,isArbitraryValue];return{cacheSize:500,separator:":",theme:{colors:[isAny],spacing:[isLength,isArbitraryLength],blur:["none","",isTshirtSize,isArbitraryValue],brightness:Yt(),borderColor:[et],borderRadius:["none","","full",isTshirtSize,isArbitraryValue],borderSpacing:Lt(),borderWidth:Mt(),contrast:Yt(),grayscale:qt(),hueRotate:Yt(),invert:qt(),gap:Lt(),gradientColorStops:[et],gradientColorStopPositions:[isPercent,isArbitraryLength],inset:Nt(),margin:Nt(),opacity:Yt(),padding:Lt(),saturate:Yt(),scale:Yt(),sepia:qt(),skew:Yt(),space:Lt(),translate:Lt()},classGroups:{aspect:[{aspect:["auto","square","video",isArbitraryValue]}],container:["container"],columns:[{columns:[isTshirtSize]}],"break-after":[{"break-after":Pt()}],"break-before":[{"break-before":Pt()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Ut(),isArbitraryValue]}],overflow:[{overflow:It()}],"overflow-x":[{"overflow-x":It()}],"overflow-y":[{"overflow-y":It()}],overscroll:[{overscroll:kt()}],"overscroll-x":[{"overscroll-x":kt()}],"overscroll-y":[{"overscroll-y":kt()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[pt]}],"inset-x":[{"inset-x":[pt]}],"inset-y":[{"inset-y":[pt]}],start:[{start:[pt]}],end:[{end:[pt]}],top:[{top:[pt]}],right:[{right:[pt]}],bottom:[{bottom:[pt]}],left:[{left:[pt]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",isInteger$1,isArbitraryValue]}],basis:[{basis:Nt()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",isArbitraryValue]}],grow:[{grow:qt()}],shrink:[{shrink:qt()}],order:[{order:["first","last","none",isInteger$1,isArbitraryValue]}],"grid-cols":[{"grid-cols":[isAny]}],"col-start-end":[{col:["auto",{span:["full",isInteger$1,isArbitraryValue]},isArbitraryValue]}],"col-start":[{"col-start":zt()}],"col-end":[{"col-end":zt()}],"grid-rows":[{"grid-rows":[isAny]}],"row-start-end":[{row:["auto",{span:[isInteger$1,isArbitraryValue]},isArbitraryValue]}],"row-start":[{"row-start":zt()}],"row-end":[{"row-end":zt()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",isArbitraryValue]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",isArbitraryValue]}],gap:[{gap:[ht]}],"gap-x":[{"gap-x":[ht]}],"gap-y":[{"gap-y":[ht]}],"justify-content":[{justify:["normal",...Ft()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Ft(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Ft(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[bt]}],px:[{px:[bt]}],py:[{py:[bt]}],ps:[{ps:[bt]}],pe:[{pe:[bt]}],pt:[{pt:[bt]}],pr:[{pr:[bt]}],pb:[{pb:[bt]}],pl:[{pl:[bt]}],m:[{m:[yt]}],mx:[{mx:[yt]}],my:[{my:[yt]}],ms:[{ms:[yt]}],me:[{me:[yt]}],mt:[{mt:[yt]}],mr:[{mr:[yt]}],mb:[{mb:[yt]}],ml:[{ml:[yt]}],"space-x":[{"space-x":[St]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[St]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",isArbitraryValue,o]}],"min-w":[{"min-w":[isArbitraryValue,o,"min","max","fit"]}],"max-w":[{"max-w":[isArbitraryValue,o,"none","full","min","max","fit","prose",{screen:[isTshirtSize]},isTshirtSize]}],h:[{h:[isArbitraryValue,o,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[isArbitraryValue,o,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[isArbitraryValue,o,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[isArbitraryValue,o,"auto","min","max","fit"]}],"font-size":[{text:["base",isTshirtSize,isArbitraryLength]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",isArbitraryNumber]}],"font-family":[{font:[isAny]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",isArbitraryValue]}],"line-clamp":[{"line-clamp":["none",isNumber,isArbitraryNumber]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",isLength,isArbitraryValue]}],"list-image":[{"list-image":["none",isArbitraryValue]}],"list-style-type":[{list:["none","disc","decimal",isArbitraryValue]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[et]}],"placeholder-opacity":[{"placeholder-opacity":[gt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[et]}],"text-opacity":[{"text-opacity":[gt]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Xt(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",isLength,isArbitraryLength]}],"underline-offset":[{"underline-offset":["auto",isLength,isArbitraryValue]}],"text-decoration-color":[{decoration:[et]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Lt()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",isArbitraryValue]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",isArbitraryValue]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[gt]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Ut(),isArbitraryPosition]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",isArbitrarySize]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},isArbitraryImage]}],"bg-color":[{bg:[et]}],"gradient-from-pos":[{from:[ft]}],"gradient-via-pos":[{via:[ft]}],"gradient-to-pos":[{to:[ft]}],"gradient-from":[{from:[mt]}],"gradient-via":[{via:[mt]}],"gradient-to":[{to:[mt]}],rounded:[{rounded:[ot]}],"rounded-s":[{"rounded-s":[ot]}],"rounded-e":[{"rounded-e":[ot]}],"rounded-t":[{"rounded-t":[ot]}],"rounded-r":[{"rounded-r":[ot]}],"rounded-b":[{"rounded-b":[ot]}],"rounded-l":[{"rounded-l":[ot]}],"rounded-ss":[{"rounded-ss":[ot]}],"rounded-se":[{"rounded-se":[ot]}],"rounded-ee":[{"rounded-ee":[ot]}],"rounded-es":[{"rounded-es":[ot]}],"rounded-tl":[{"rounded-tl":[ot]}],"rounded-tr":[{"rounded-tr":[ot]}],"rounded-br":[{"rounded-br":[ot]}],"rounded-bl":[{"rounded-bl":[ot]}],"border-w":[{border:[st]}],"border-w-x":[{"border-x":[st]}],"border-w-y":[{"border-y":[st]}],"border-w-s":[{"border-s":[st]}],"border-w-e":[{"border-e":[st]}],"border-w-t":[{"border-t":[st]}],"border-w-r":[{"border-r":[st]}],"border-w-b":[{"border-b":[st]}],"border-w-l":[{"border-l":[st]}],"border-opacity":[{"border-opacity":[gt]}],"border-style":[{border:[...Xt(),"hidden"]}],"divide-x":[{"divide-x":[st]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[st]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[gt]}],"divide-style":[{divide:Xt()}],"border-color":[{border:[nt]}],"border-color-x":[{"border-x":[nt]}],"border-color-y":[{"border-y":[nt]}],"border-color-s":[{"border-s":[nt]}],"border-color-e":[{"border-e":[nt]}],"border-color-t":[{"border-t":[nt]}],"border-color-r":[{"border-r":[nt]}],"border-color-b":[{"border-b":[nt]}],"border-color-l":[{"border-l":[nt]}],"divide-color":[{divide:[nt]}],"outline-style":[{outline:["",...Xt()]}],"outline-offset":[{"outline-offset":[isLength,isArbitraryValue]}],"outline-w":[{outline:[isLength,isArbitraryLength]}],"outline-color":[{outline:[et]}],"ring-w":[{ring:Mt()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[et]}],"ring-opacity":[{"ring-opacity":[gt]}],"ring-offset-w":[{"ring-offset":[isLength,isArbitraryLength]}],"ring-offset-color":[{"ring-offset":[et]}],shadow:[{shadow:["","inner","none",isTshirtSize,isArbitraryShadow]}],"shadow-color":[{shadow:[isAny]}],opacity:[{opacity:[gt]}],"mix-blend":[{"mix-blend":[...Wt(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Wt()}],filter:[{filter:["","none"]}],blur:[{blur:[tt]}],brightness:[{brightness:[rt]}],contrast:[{contrast:[at]}],"drop-shadow":[{"drop-shadow":["","none",isTshirtSize,isArbitraryValue]}],grayscale:[{grayscale:[ct]}],"hue-rotate":[{"hue-rotate":[lt]}],invert:[{invert:[dt]}],saturate:[{saturate:[xt]}],sepia:[{sepia:[Et]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[tt]}],"backdrop-brightness":[{"backdrop-brightness":[rt]}],"backdrop-contrast":[{"backdrop-contrast":[at]}],"backdrop-grayscale":[{"backdrop-grayscale":[ct]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[lt]}],"backdrop-invert":[{"backdrop-invert":[dt]}],"backdrop-opacity":[{"backdrop-opacity":[gt]}],"backdrop-saturate":[{"backdrop-saturate":[xt]}],"backdrop-sepia":[{"backdrop-sepia":[Et]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[it]}],"border-spacing-x":[{"border-spacing-x":[it]}],"border-spacing-y":[{"border-spacing-y":[it]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",isArbitraryValue]}],duration:[{duration:Yt()}],ease:[{ease:["linear","in","out","in-out",isArbitraryValue]}],delay:[{delay:Yt()}],animate:[{animate:["none","spin","ping","pulse","bounce",isArbitraryValue]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[vt]}],"scale-x":[{"scale-x":[vt]}],"scale-y":[{"scale-y":[vt]}],rotate:[{rotate:[isInteger$1,isArbitraryValue]}],"translate-x":[{"translate-x":[At]}],"translate-y":[{"translate-y":[At]}],"skew-x":[{"skew-x":[Ct]}],"skew-y":[{"skew-y":[Ct]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",isArbitraryValue]}],accent:[{accent:["auto",et]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",isArbitraryValue]}],"caret-color":[{caret:[et]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":Lt()}],"scroll-mx":[{"scroll-mx":Lt()}],"scroll-my":[{"scroll-my":Lt()}],"scroll-ms":[{"scroll-ms":Lt()}],"scroll-me":[{"scroll-me":Lt()}],"scroll-mt":[{"scroll-mt":Lt()}],"scroll-mr":[{"scroll-mr":Lt()}],"scroll-mb":[{"scroll-mb":Lt()}],"scroll-ml":[{"scroll-ml":Lt()}],"scroll-p":[{"scroll-p":Lt()}],"scroll-px":[{"scroll-px":Lt()}],"scroll-py":[{"scroll-py":Lt()}],"scroll-ps":[{"scroll-ps":Lt()}],"scroll-pe":[{"scroll-pe":Lt()}],"scroll-pt":[{"scroll-pt":Lt()}],"scroll-pr":[{"scroll-pr":Lt()}],"scroll-pb":[{"scroll-pb":Lt()}],"scroll-pl":[{"scroll-pl":Lt()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",isArbitraryValue]}],fill:[{fill:[et,"none"]}],"stroke-w":[{stroke:[isLength,isArbitraryLength,isArbitraryNumber]}],stroke:[{stroke:[et,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},twMerge=createTailwindMerge(getDefaultConfig);function cn(...et){return twMerge(clsx(et))}const buttonVariants=cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Button=reactExports.forwardRef(({className:et,variant:o,size:tt,asChild:rt=!1,...nt},ot)=>{const it=rt?Slot:"button";return jsxRuntimeExports.jsx(it,{className:cn("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50","min-h-[44px] px-4 py-2 md:min-h-[36px] md:px-3 md:py-1.5",buttonVariants({variant:o,size:tt,className:et})),ref:ot,...nt})});Button.displayName="Button";function allocUnsafe$j(et=0){return new Uint8Array(et)}const N1$6=Math.pow(2,7),N2$6=Math.pow(2,14),N3$6=Math.pow(2,21),N4$6=Math.pow(2,28),N5$6=Math.pow(2,35),N6$6=Math.pow(2,42),N7$6=Math.pow(2,49),MSB$8=128,REST$8=127;function encodingLength$6(et){if(et<N1$6)return 1;if(et<N2$6)return 2;if(et<N3$6)return 3;if(et<N4$6)return 4;if(et<N5$6)return 5;if(et<N6$6)return 6;if(et<N7$6)return 7;if(Number.MAX_SAFE_INTEGER!=null&&et>Number.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function encodeUint8Array(et,o,tt=0){switch(encodingLength$6(et)){case 8:o[tt++]=et&255|MSB$8,et/=128;case 7:o[tt++]=et&255|MSB$8,et/=128;case 6:o[tt++]=et&255|MSB$8,et/=128;case 5:o[tt++]=et&255|MSB$8,et/=128;case 4:o[tt++]=et&255|MSB$8,et>>>=7;case 3:o[tt++]=et&255|MSB$8,et>>>=7;case 2:o[tt++]=et&255|MSB$8,et>>>=7;case 1:{o[tt++]=et&255,et>>>=7;break}default:throw new Error("unreachable")}return o}function encodeUint8ArrayList(et,o,tt=0){switch(encodingLength$6(et)){case 8:o.set(tt++,et&255|MSB$8),et/=128;case 7:o.set(tt++,et&255|MSB$8),et/=128;case 6:o.set(tt++,et&255|MSB$8),et/=128;case 5:o.set(tt++,et&255|MSB$8),et/=128;case 4:o.set(tt++,et&255|MSB$8),et>>>=7;case 3:o.set(tt++,et&255|MSB$8),et>>>=7;case 2:o.set(tt++,et&255|MSB$8),et>>>=7;case 1:{o.set(tt++,et&255),et>>>=7;break}default:throw new Error("unreachable")}return o}function decodeUint8Array(et,o){let tt=et[o],rt=0;if(rt+=tt&REST$8,tt<MSB$8||(tt=et[o+1],rt+=(tt&REST$8)<<7,tt<MSB$8)||(tt=et[o+2],rt+=(tt&REST$8)<<14,tt<MSB$8)||(tt=et[o+3],rt+=(tt&REST$8)<<21,tt<MSB$8)||(tt=et[o+4],rt+=(tt&REST$8)*N4$6,tt<MSB$8)||(tt=et[o+5],rt+=(tt&REST$8)*N5$6,tt<MSB$8)||(tt=et[o+6],rt+=(tt&REST$8)*N6$6,tt<MSB$8)||(tt=et[o+7],rt+=(tt&REST$8)*N7$6,tt<MSB$8))return rt;throw new RangeError("Could not decode varint")}function decodeUint8ArrayList(et,o){let tt=et.get(o),rt=0;if(rt+=tt&REST$8,tt<MSB$8||(tt=et.get(o+1),rt+=(tt&REST$8)<<7,tt<MSB$8)||(tt=et.get(o+2),rt+=(tt&REST$8)<<14,tt<MSB$8)||(tt=et.get(o+3),rt+=(tt&REST$8)<<21,tt<MSB$8)||(tt=et.get(o+4),rt+=(tt&REST$8)*N4$6,tt<MSB$8)||(tt=et.get(o+5),rt+=(tt&REST$8)*N5$6,tt<MSB$8)||(tt=et.get(o+6),rt+=(tt&REST$8)*N6$6,tt<MSB$8)||(tt=et.get(o+7),rt+=(tt&REST$8)*N7$6,tt<MSB$8))return rt;throw new RangeError("Could not decode varint")}function encode$P(et,o,tt=0){return o==null&&(o=allocUnsafe$j(encodingLength$6(et))),o instanceof Uint8Array?encodeUint8Array(et,o,tt):encodeUint8ArrayList(et,o,tt)}function decode$Z(et,o=0){return et instanceof Uint8Array?decodeUint8Array(et,o):decodeUint8ArrayList(et,o)}const f32=new Float32Array([-0]),f8b=new Uint8Array(f32.buffer);function writeFloatLE(et,o,tt){f32[0]=et,o[tt]=f8b[0],o[tt+1]=f8b[1],o[tt+2]=f8b[2],o[tt+3]=f8b[3]}function readFloatLE(et,o){return f8b[0]=et[o],f8b[1]=et[o+1],f8b[2]=et[o+2],f8b[3]=et[o+3],f32[0]}const f64=new Float64Array([-0]),d8b=new Uint8Array(f64.buffer);function writeDoubleLE(et,o,tt){f64[0]=et,o[tt]=d8b[0],o[tt+1]=d8b[1],o[tt+2]=d8b[2],o[tt+3]=d8b[3],o[tt+4]=d8b[4],o[tt+5]=d8b[5],o[tt+6]=d8b[6],o[tt+7]=d8b[7]}function readDoubleLE(et,o){return d8b[0]=et[o],d8b[1]=et[o+1],d8b[2]=et[o+2],d8b[3]=et[o+3],d8b[4]=et[o+4],d8b[5]=et[o+5],d8b[6]=et[o+6],d8b[7]=et[o+7],f64[0]}const MAX_SAFE_NUMBER_INTEGER=BigInt(Number.MAX_SAFE_INTEGER),MIN_SAFE_NUMBER_INTEGER=BigInt(Number.MIN_SAFE_INTEGER);let LongBits$2=class Sn{constructor(o,tt){wt(this,"lo");wt(this,"hi");this.lo=o|0,this.hi=tt|0}toNumber(o=!1){if(!o&&this.hi>>>31>0){const tt=~this.lo+1>>>0;let rt=~this.hi>>>0;return tt===0&&(rt=rt+1>>>0),-(tt+rt*4294967296)}return this.lo+this.hi*4294967296}toBigInt(o=!1){if(o)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){const tt=~this.lo+1>>>0;let rt=~this.hi>>>0;return tt===0&&(rt=rt+1>>>0),-(BigInt(tt)+(BigInt(rt)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(o=!1){return this.toBigInt(o).toString()}zzEncode(){const o=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^o)>>>0,this.lo=(this.lo<<1^o)>>>0,this}zzDecode(){const o=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^o)>>>0,this.hi=(this.hi>>>1^o)>>>0,this}length(){const o=this.lo,tt=(this.lo>>>28|this.hi<<4)>>>0,rt=this.hi>>>24;return rt===0?tt===0?o<16384?o<128?1:2:o<2097152?3:4:tt<16384?tt<128?5:6:tt<2097152?7:8:rt<128?9:10}static fromBigInt(o){if(o===0n)return zero;if(o<MAX_SAFE_NUMBER_INTEGER&&o>MIN_SAFE_NUMBER_INTEGER)return this.fromNumber(Number(o));const tt=o<0n;tt&&(o=-o);let rt=o>>32n,nt=o-(rt<<32n);return tt&&(rt=~rt|0n,nt=~nt|0n,++nt>TWO_32&&(nt=0n,++rt>TWO_32&&(rt=0n))),new Sn(Number(nt),Number(rt))}static fromNumber(o){if(o===0)return zero;const tt=o<0;tt&&(o=-o);let rt=o>>>0,nt=(o-rt)/4294967296>>>0;return tt&&(nt=~nt>>>0,rt=~rt>>>0,++rt>4294967295&&(rt=0,++nt>4294967295&&(nt=0))),new Sn(rt,nt)}static from(o){return typeof o=="number"?Sn.fromNumber(o):typeof o=="bigint"?Sn.fromBigInt(o):typeof o=="string"?Sn.fromBigInt(BigInt(o)):o.low!=null||o.high!=null?new Sn(o.low>>>0,o.high>>>0):zero}};const zero=new LongBits$2(0,0);zero.toBigInt=function(){return 0n};zero.zzEncode=zero.zzDecode=function(){return this};zero.length=function(){return 1};const TWO_32=4294967296n;function length$6(et){let o=0,tt=0;for(let rt=0;rt<et.length;++rt)tt=et.charCodeAt(rt),tt<128?o+=1:tt<2048?o+=2:(tt&64512)===55296&&(et.charCodeAt(rt+1)&64512)===56320?(++rt,o+=4):o+=3;return o}function read$7(et,o,tt){if(tt-o<1)return"";let nt;const ot=[];let it=0,st;for(;o<tt;)st=et[o++],st<128?ot[it++]=st:st>191&&st<224?ot[it++]=(st&31)<<6|et[o++]&63:st>239&&st<365?(st=((st&7)<<18|(et[o++]&63)<<12|(et[o++]&63)<<6|et[o++]&63)-65536,ot[it++]=55296+(st>>10),ot[it++]=56320+(st&1023)):ot[it++]=(st&15)<<12|(et[o++]&63)<<6|et[o++]&63,it>8191&&((nt??(nt=[])).push(String.fromCharCode.apply(String,ot)),it=0);return nt!=null?(it>0&&nt.push(String.fromCharCode.apply(String,ot.slice(0,it))),nt.join("")):String.fromCharCode.apply(String,ot.slice(0,it))}function write$2(et,o,tt){const rt=tt;let nt,ot;for(let it=0;it<et.length;++it)nt=et.charCodeAt(it),nt<128?o[tt++]=nt:nt<2048?(o[tt++]=nt>>6|192,o[tt++]=nt&63|128):(nt&64512)===55296&&((ot=et.charCodeAt(it+1))&64512)===56320?(nt=65536+((nt&1023)<<10)+(ot&1023),++it,o[tt++]=nt>>18|240,o[tt++]=nt>>12&63|128,o[tt++]=nt>>6&63|128,o[tt++]=nt&63|128):(o[tt++]=nt>>12|224,o[tt++]=nt>>6&63|128,o[tt++]=nt&63|128);return tt-rt}function indexOutOfRange$1(et,o){return RangeError(`index out of range: ${et.pos} + ${o??1} > ${et.len}`)}function readFixed32End(et,o){return(et[o-4]|et[o-3]<<8|et[o-2]<<16|et[o-1]<<24)>>>0}class Uint8ArrayReader{constructor(o){wt(this,"buf");wt(this,"pos");wt(this,"len");wt(this,"_slice",Uint8Array.prototype.subarray);this.buf=o,this.pos=0,this.len=o.length}uint32(){let o=4294967295;if(o=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(o=(o|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(o=(o|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(o=(o|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(o=(o|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return o;if((this.pos+=5)>this.len)throw this.pos=this.len,indexOutOfRange$1(this,10);return o}int32(){return this.uint32()|0}sint32(){const o=this.uint32();return o>>>1^-(o&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw indexOutOfRange$1(this,4);return readFixed32End(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw indexOutOfRange$1(this,4);return readFixed32End(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw indexOutOfRange$1(this,4);const o=readFloatLE(this.buf,this.pos);return this.pos+=4,o}double(){if(this.pos+8>this.len)throw indexOutOfRange$1(this,4);const o=readDoubleLE(this.buf,this.pos);return this.pos+=8,o}bytes(){const o=this.uint32(),tt=this.pos,rt=this.pos+o;if(rt>this.len)throw indexOutOfRange$1(this,o);return this.pos+=o,tt===rt?new Uint8Array(0):this.buf.subarray(tt,rt)}string(){const o=this.bytes();return read$7(o,0,o.length)}skip(o){if(typeof o=="number"){if(this.pos+o>this.len)throw indexOutOfRange$1(this,o);this.pos+=o}else do if(this.pos>=this.len)throw indexOutOfRange$1(this);while(this.buf[this.pos++]&128);return this}skipType(o){switch(o){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(o=this.uint32()&7)!==4;)this.skipType(o);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type ${o} at offset ${this.pos}`)}return this}readLongVarint(){const o=new LongBits$2(0,0);let tt=0;if(this.len-this.pos>4){for(;tt<4;++tt)if(o.lo=(o.lo|(this.buf[this.pos]&127)<<tt*7)>>>0,this.buf[this.pos++]<128)return o;if(o.lo=(o.lo|(this.buf[this.pos]&127)<<28)>>>0,o.hi=(o.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return o;tt=0}else{for(;tt<3;++tt){if(this.pos>=this.len)throw indexOutOfRange$1(this);if(o.lo=(o.lo|(this.buf[this.pos]&127)<<tt*7)>>>0,this.buf[this.pos++]<128)return o}return o.lo=(o.lo|(this.buf[this.pos++]&127)<<tt*7)>>>0,o}if(this.len-this.pos>4){for(;tt<5;++tt)if(o.hi=(o.hi|(this.buf[this.pos]&127)<<tt*7+3)>>>0,this.buf[this.pos++]<128)return o}else for(;tt<5;++tt){if(this.pos>=this.len)throw indexOutOfRange$1(this);if(o.hi=(o.hi|(this.buf[this.pos]&127)<<tt*7+3)>>>0,this.buf[this.pos++]<128)return o}throw Error("invalid varint encoding")}readFixed64(){if(this.pos+8>this.len)throw indexOutOfRange$1(this,8);const o=readFixed32End(this.buf,this.pos+=4),tt=readFixed32End(this.buf,this.pos+=4);return new LongBits$2(o,tt)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){const o=decodeUint8Array(this.buf,this.pos);return this.pos+=encodingLength$6(o),o}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}}function createReader(et){return new Uint8ArrayReader(et instanceof Uint8Array?et:et.subarray())}function decodeMessage(et,o,tt){const rt=createReader(et);return o.decode(rt,void 0,tt)}function allocUnsafe$i(et=0){return new Uint8Array(et)}function coerce$k(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function fromString$w(et){return new TextEncoder().encode(et)}function toString$x(et){return new TextDecoder().decode(et)}function base$l(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt<tt.length;rt++)tt[rt]=255;for(var nt=0;nt<et.length;nt++){var ot=et.charAt(nt),it=ot.charCodeAt(0);if(tt[it]!==255)throw new TypeError(ot+" is ambiguous");tt[it]=nt}var st=et.length,at=et.charAt(0),ct=Math.log(st)/Math.log(256),lt=Math.log(256)/Math.log(st);function dt(ft){if(ft instanceof Uint8Array||(ArrayBuffer.isView(ft)?ft=new Uint8Array(ft.buffer,ft.byteOffset,ft.byteLength):Array.isArray(ft)&&(ft=Uint8Array.from(ft))),!(ft instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(ft.length===0)return"";for(var pt=0,yt=0,gt=0,bt=ft.length;gt!==bt&&ft[gt]===0;)gt++,pt++;for(var xt=(bt-gt)*lt+1>>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct<yt)&&St!==-1;St--,Ct++)Et+=256*vt[St]>>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At<xt;++At)kt+=et.charAt(vt[At]);return kt}function ht(ft){if(typeof ft!="string")throw new TypeError("Expected String");if(ft.length===0)return new Uint8Array;var pt=0;if(ft[pt]!==" "){for(var yt=0,gt=0;ft[pt]===at;)yt++,pt++;for(var bt=(ft.length-pt)*ct+1>>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et<gt)&&Ct!==-1;Ct--,Et++)vt+=st*xt[Ct]>>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$l=base$l,_brrp__multiformats_scope_baseX$k=src$l;let Encoder$m=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$m=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$m(this,o)}},ComposedDecoder$k=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$m(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$m(et,o){return new ComposedDecoder$k({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$k=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$m(o,tt,rt),this.decoder=new Decoder$m(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$n({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$k(et,o,tt,rt)}function baseX$k({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$k(tt,et);return from$n({prefix:o,name:et,encode:rt,decode:ot=>coerce$k(nt(ot))})}function decode$Y(et,o,tt,rt){const nt={};for(let lt=0;lt<o.length;++lt)nt[o[lt]]=lt;let ot=et.length;for(;et[ot-1]==="=";)--ot;const it=new Uint8Array(ot*tt/8|0);let st=0,at=0,ct=0;for(let lt=0;lt<ot;++lt){const dt=nt[et[lt]];if(dt===void 0)throw new SyntaxError(`Non-${rt} character`);at=at<<tt|dt,st+=tt,st>=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$O(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<<tt)-1;let ot="",it=0,st=0;for(let at=0;at<et.length;++at)for(st=st<<8|et[at],it+=8;it>tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<<tt-it]),rt)for(;ot.length*tt&7;)ot+="=";return ot}function rfc4648$j({name:et,prefix:o,bitsPerChar:tt,alphabet:rt}){return from$n({prefix:o,name:et,encode(nt){return encode$O(nt,rt,tt)},decode(nt){return decode$Y(nt,rt,tt,et)}})}const base10$w=baseX$k({prefix:"9",name:"base10",alphabet:"0123456789"}),base10$x=Object.freeze(Object.defineProperty({__proto__:null,base10:base10$w},Symbol.toStringTag,{value:"Module"})),base16$w=rfc4648$j({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper$g=rfc4648$j({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),base16$x=Object.freeze(Object.defineProperty({__proto__:null,base16:base16$w,base16upper:base16upper$g},Symbol.toStringTag,{value:"Module"})),base2$w=rfc4648$j({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),base2$x=Object.freeze(Object.defineProperty({__proto__:null,base2:base2$w},Symbol.toStringTag,{value:"Module"})),alphabet$g=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),alphabetBytesToChars$g=alphabet$g.reduce((et,o,tt)=>(et[tt]=o,et),[]),alphabetCharsToBytes$g=alphabet$g.reduce((et,o,tt)=>{const rt=o.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${o}`);return et[rt]=tt,et},[]);function encode$N(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars$g[tt],o),"")}function decode$X(et){const o=[];for(const tt of et){const rt=tt.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${tt}`);const nt=alphabetCharsToBytes$g[rt];if(nt==null)throw new Error(`Non-base256emoji character: ${tt}`);o.push(nt)}return new Uint8Array(o)}const base256emoji$w=from$n({prefix:"🚀",name:"base256emoji",encode:encode$N,decode:decode$X}),base256emoji$x=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:base256emoji$w},Symbol.toStringTag,{value:"Module"})),base32$A=rfc4648$j({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper$g=rfc4648$j({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad$g=rfc4648$j({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper$g=rfc4648$j({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex$g=rfc4648$j({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper$g=rfc4648$j({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad$g=rfc4648$j({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper$g=rfc4648$j({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z$g=rfc4648$j({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$B=Object.freeze(Object.defineProperty({__proto__:null,base32:base32$A,base32hex:base32hex$g,base32hexpad:base32hexpad$g,base32hexpadupper:base32hexpadupper$g,base32hexupper:base32hexupper$g,base32pad:base32pad$g,base32padupper:base32padupper$g,base32upper:base32upper$g,base32z:base32z$g},Symbol.toStringTag,{value:"Module"})),base36$x=baseX$k({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper$g=baseX$k({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$y=Object.freeze(Object.defineProperty({__proto__:null,base36:base36$x,base36upper:base36upper$g},Symbol.toStringTag,{value:"Module"})),base58btc$k=baseX$k({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr$g=baseX$k({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58$g=Object.freeze(Object.defineProperty({__proto__:null,base58btc:base58btc$k,base58flickr:base58flickr$g},Symbol.toStringTag,{value:"Module"})),base64$z=rfc4648$j({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad$g=rfc4648$j({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url$h=rfc4648$j({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad$g=rfc4648$j({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$A=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$z,base64pad:base64pad$g,base64url:base64url$h,base64urlpad:base64urlpad$g},Symbol.toStringTag,{value:"Module"})),base8$w=rfc4648$j({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$x=Object.freeze(Object.defineProperty({__proto__:null,base8:base8$w},Symbol.toStringTag,{value:"Module"})),identity$i=from$n({prefix:"\0",name:"identity",encode:et=>toString$x(et),decode:et=>fromString$w(et)}),identityBase$g=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$i},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const bases$g={...identityBase$g,...base2$x,...base8$x,...base10$x,...base16$x,...base32$B,...base36$y,...base58$g,...base64$A,...base256emoji$x};function createCodec$h(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$k=createCodec$h("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii$g=createCodec$h("ascii","a",et=>{let o="a";for(let tt=0;tt<et.length;tt++)o+=String.fromCharCode(et[tt]);return o},et=>{et=et.substring(1);const o=allocUnsafe$i(et.length);for(let tt=0;tt<et.length;tt++)o[tt]=et.charCodeAt(tt);return o}),BASES$g={utf8:string$k,"utf-8":string$k,hex:bases$g.base16,latin1:ascii$g,ascii:ascii$g,binary:ascii$g,...bases$g};function fromString$v(et,o="utf8"){const tt=BASES$g[o];if(tt==null)throw new Error(`Unsupported encoding "${o}"`);return tt.decoder.decode(`${tt.prefix}${et}`)}function pool$1(et){let rt,nt=8192;return function(it){if(it<1||it>4096)return allocUnsafe$i(it);nt+it>8192&&(rt=allocUnsafe$i(8192),nt=0);const st=rt.subarray(nt,nt+=it);return nt&7&&(nt=(nt|7)+1),st}}let Op$1=class{constructor(o,tt,rt){wt(this,"fn");wt(this,"len");wt(this,"next");wt(this,"val");this.fn=o,this.len=tt,this.next=void 0,this.val=rt}};function noop$2(){}let State$1=class{constructor(o){wt(this,"head");wt(this,"tail");wt(this,"len");wt(this,"next");this.head=o.head,this.tail=o.tail,this.len=o.len,this.next=o.states}};const bufferPool=pool$1();function alloc$7(et){return globalThis.Buffer!=null?allocUnsafe$i(et):bufferPool(et)}class Uint8ArrayWriter{constructor(){wt(this,"len");wt(this,"head");wt(this,"tail");wt(this,"states");this.len=0,this.head=new Op$1(noop$2,0,0),this.tail=this.head,this.states=null}_push(o,tt,rt){return this.tail=this.tail.next=new Op$1(o,tt,rt),this.len+=tt,this}uint32(o){return this.len+=(this.tail=this.tail.next=new VarintOp$1((o=o>>>0)<128?1:o<16384?2:o<2097152?3:o<268435456?4:5,o)).len,this}int32(o){return o<0?this._push(writeVarint64$1,10,LongBits$2.fromNumber(o)):this.uint32(o)}sint32(o){return this.uint32((o<<1^o>>31)>>>0)}uint64(o){const tt=LongBits$2.fromBigInt(o);return this._push(writeVarint64$1,tt.length(),tt)}uint64Number(o){return this._push(encodeUint8Array,encodingLength$6(o),o)}uint64String(o){return this.uint64(BigInt(o))}int64(o){return this.uint64(o)}int64Number(o){return this.uint64Number(o)}int64String(o){return this.uint64String(o)}sint64(o){const tt=LongBits$2.fromBigInt(o).zzEncode();return this._push(writeVarint64$1,tt.length(),tt)}sint64Number(o){const tt=LongBits$2.fromNumber(o).zzEncode();return this._push(writeVarint64$1,tt.length(),tt)}sint64String(o){return this.sint64(BigInt(o))}bool(o){return this._push(writeByte$1,1,o?1:0)}fixed32(o){return this._push(writeFixed32$1,4,o>>>0)}sfixed32(o){return this.fixed32(o)}fixed64(o){const tt=LongBits$2.fromBigInt(o);return this._push(writeFixed32$1,4,tt.lo)._push(writeFixed32$1,4,tt.hi)}fixed64Number(o){const tt=LongBits$2.fromNumber(o);return this._push(writeFixed32$1,4,tt.lo)._push(writeFixed32$1,4,tt.hi)}fixed64String(o){return this.fixed64(BigInt(o))}sfixed64(o){return this.fixed64(o)}sfixed64Number(o){return this.fixed64Number(o)}sfixed64String(o){return this.fixed64String(o)}float(o){return this._push(writeFloatLE,4,o)}double(o){return this._push(writeDoubleLE,8,o)}bytes(o){const tt=o.length>>>0;return tt===0?this._push(writeByte$1,1,0):this.uint32(tt)._push(writeBytes$1,tt,o)}string(o){const tt=length$6(o);return tt!==0?this.uint32(tt)._push(write$2,tt,o):this._push(writeByte$1,1,0)}fork(){return this.states=new State$1(this),this.head=this.tail=new Op$1(noop$2,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Op$1(noop$2,0,0),this.len=0),this}ldelim(){const o=this.head,tt=this.tail,rt=this.len;return this.reset().uint32(rt),rt!==0&&(this.tail.next=o.next,this.tail=tt,this.len+=rt),this}finish(){let o=this.head.next;const tt=alloc$7(this.len);let rt=0;for(;o!=null;)o.fn(o.val,tt,rt),rt+=o.len,o=o.next;return tt}}function writeByte$1(et,o,tt){o[tt]=et&255}function writeVarint32$1(et,o,tt){for(;et>127;)o[tt++]=et&127|128,et>>>=7;o[tt]=et}let VarintOp$1=class extends Op$1{constructor(tt,rt){super(writeVarint32$1,tt,rt);wt(this,"next");this.next=void 0}};function writeVarint64$1(et,o,tt){for(;et.hi!==0;)o[tt++]=et.lo&127|128,et.lo=(et.lo>>>7|et.hi<<25)>>>0,et.hi>>>=7;for(;et.lo>127;)o[tt++]=et.lo&127|128,et.lo=et.lo>>>7;o[tt++]=et.lo}function writeFixed32$1(et,o,tt){o[tt]=et&255,o[tt+1]=et>>>8&255,o[tt+2]=et>>>16&255,o[tt+3]=et>>>24}function writeBytes$1(et,o,tt){o.set(et,tt)}globalThis.Buffer!=null&&(Uint8ArrayWriter.prototype.bytes=function(et){const o=et.length>>>0;return this.uint32(o),o>0&&this._push(writeBytesBuffer,o,et),this},Uint8ArrayWriter.prototype.string=function(et){const o=globalThis.Buffer.byteLength(et);return this.uint32(o),o>0&&this._push(writeStringBuffer$1,o,et),this});function writeBytesBuffer(et,o,tt){o.set(et,tt)}function writeStringBuffer$1(et,o,tt){et.length<40?write$2(et,o,tt):o.utf8Write!=null?o.utf8Write(et,tt):o.set(fromString$v(et),tt)}function createWriter(){return new Uint8ArrayWriter}function encodeMessage(et,o){const tt=createWriter();return o.encode(et,tt,{lengthDelimited:!1}),tt.finish()}var CODEC_TYPES;(function(et){et[et.VARINT=0]="VARINT",et[et.BIT64=1]="BIT64",et[et.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",et[et.START_GROUP=3]="START_GROUP",et[et.END_GROUP=4]="END_GROUP",et[et.BIT32=5]="BIT32"})(CODEC_TYPES||(CODEC_TYPES={}));function createCodec$g(et,o,tt,rt){return{name:et,type:o,encode:tt,decode:rt}}function enumeration(et){function o(nt){if(et[nt.toString()]==null)throw new Error("Invalid enum value");return et[nt]}const tt=function(ot,it){const st=o(ot);it.int32(st)},rt=function(ot){const it=ot.int32();return o(it)};return createCodec$g("enum",CODEC_TYPES.VARINT,tt,rt)}function message$1(et,o){return createCodec$g("message",CODEC_TYPES.LENGTH_DELIMITED,et,o)}class MaxLengthError extends Error{constructor(){super(...arguments);wt(this,"code","ERR_MAX_LENGTH");wt(this,"name","MaxLengthError")}}class MaxSizeError extends Error{constructor(){super(...arguments);wt(this,"code","ERR_MAX_SIZE");wt(this,"name","MaxSizeError")}}function alloc$6(et=0){return globalThis.Buffer!=null&&globalThis.Buffer.alloc!=null?globalThis.Buffer.alloc(et):new Uint8Array(et)}function allocUnsafe$h(et=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(et):new Uint8Array(et)}var RateLimitProof$4;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.proof!=null&&tt.proof.byteLength>0&&(rt.uint32(10),rt.bytes(tt.proof)),tt.merkleRoot!=null&&tt.merkleRoot.byteLength>0&&(rt.uint32(18),rt.bytes(tt.merkleRoot)),tt.epoch!=null&&tt.epoch.byteLength>0&&(rt.uint32(26),rt.bytes(tt.epoch)),tt.shareX!=null&&tt.shareX.byteLength>0&&(rt.uint32(34),rt.bytes(tt.shareX)),tt.shareY!=null&&tt.shareY.byteLength>0&&(rt.uint32(42),rt.bytes(tt.shareY)),tt.nullifier!=null&&tt.nullifier.byteLength>0&&(rt.uint32(50),rt.bytes(tt.nullifier)),tt.rlnIdentifier!=null&&tt.rlnIdentifier.byteLength>0&&(rt.uint32(58),rt.bytes(tt.rlnIdentifier)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{const ot={proof:alloc$6(0),merkleRoot:alloc$6(0),epoch:alloc$6(0),shareX:alloc$6(0),shareY:alloc$6(0),nullifier:alloc$6(0),rlnIdentifier:alloc$6(0)},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const st=tt.uint32();switch(st>>>3){case 1:{ot.proof=tt.bytes();break}case 2:{ot.merkleRoot=tt.bytes();break}case 3:{ot.epoch=tt.bytes();break}case 4:{ot.shareX=tt.bytes();break}case 5:{ot.shareY=tt.bytes();break}case 6:{ot.nullifier=tt.bytes();break}case 7:{ot.rlnIdentifier=tt.bytes();break}default:{tt.skipType(st&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(RateLimitProof$4||(RateLimitProof$4={}));var WakuMessage$4;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.payload!=null&&tt.payload.byteLength>0&&(rt.uint32(10),rt.bytes(tt.payload)),tt.contentTopic!=null&&tt.contentTopic!==""&&(rt.uint32(18),rt.string(tt.contentTopic)),tt.version!=null&&(rt.uint32(24),rt.uint32(tt.version)),tt.timestamp!=null&&(rt.uint32(80),rt.sint64(tt.timestamp)),tt.meta!=null&&(rt.uint32(90),rt.bytes(tt.meta)),tt.rateLimitProof!=null&&(rt.uint32(170),RateLimitProof$4.codec().encode(tt.rateLimitProof,rt)),tt.ephemeral!=null&&(rt.uint32(248),rt.bool(tt.ephemeral)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st;const ot={payload:alloc$6(0),contentTopic:""},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const at=tt.uint32();switch(at>>>3){case 1:{ot.payload=tt.bytes();break}case 2:{ot.contentTopic=tt.string();break}case 3:{ot.version=tt.uint32();break}case 10:{ot.timestamp=tt.sint64();break}case 11:{ot.meta=tt.bytes();break}case 21:{ot.rateLimitProof=RateLimitProof$4.codec().decode(tt,tt.uint32(),{limits:(st=nt.limits)==null?void 0:st.rateLimitProof});break}case 31:{ot.ephemeral=tt.bool();break}default:{tt.skipType(at&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(WakuMessage$4||(WakuMessage$4={}));var FilterRequest;(function(et){(function(tt){let rt;tt.codec=()=>(rt==null&&(rt=message$1((nt,ot,it={})=>{it.lengthDelimited!==!1&&ot.fork(),nt.contentTopic!=null&&nt.contentTopic!==""&&(ot.uint32(10),ot.string(nt.contentTopic)),it.lengthDelimited!==!1&&ot.ldelim()},(nt,ot,it={})=>{const st={contentTopic:""},at=ot==null?nt.len:nt.pos+ot;for(;nt.pos<at;){const ct=nt.uint32();switch(ct>>>3){case 1:{st.contentTopic=nt.string();break}default:{nt.skipType(ct&7);break}}}return st})),rt),tt.encode=nt=>encodeMessage(nt,tt.codec()),tt.decode=(nt,ot)=>decodeMessage(nt,tt.codec(),ot)})(et.ContentFilter||(et.ContentFilter={}));let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{if(nt.lengthDelimited!==!1&&rt.fork(),tt.subscribe!=null&&tt.subscribe!==!1&&(rt.uint32(8),rt.bool(tt.subscribe)),tt.topic!=null&&tt.topic!==""&&(rt.uint32(18),rt.string(tt.topic)),tt.contentFilters!=null)for(const ot of tt.contentFilters)rt.uint32(26),et.ContentFilter.codec().encode(ot,rt);nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st,at;const ot={subscribe:!1,topic:"",contentFilters:[]},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const ct=tt.uint32();switch(ct>>>3){case 1:{ot.subscribe=tt.bool();break}case 2:{ot.topic=tt.string();break}case 3:{if(((st=nt.limits)==null?void 0:st.contentFilters)!=null&&ot.contentFilters.length===nt.limits.contentFilters)throw new MaxLengthError('Decode error - map field "contentFilters" had too many elements');ot.contentFilters.push(et.ContentFilter.codec().decode(tt,tt.uint32(),{limits:(at=nt.limits)==null?void 0:at.contentFilters$}));break}default:{tt.skipType(ct&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(FilterRequest||(FilterRequest={}));var MessagePush$1;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{if(nt.lengthDelimited!==!1&&rt.fork(),tt.messages!=null)for(const ot of tt.messages)rt.uint32(10),WakuMessage$3.codec().encode(ot,rt);nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st,at;const ot={messages:[]},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const ct=tt.uint32();switch(ct>>>3){case 1:{if(((st=nt.limits)==null?void 0:st.messages)!=null&&ot.messages.length===nt.limits.messages)throw new MaxLengthError('Decode error - map field "messages" had too many elements');ot.messages.push(WakuMessage$3.codec().decode(tt,tt.uint32(),{limits:(at=nt.limits)==null?void 0:at.messages$}));break}default:{tt.skipType(ct&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(MessagePush$1||(MessagePush$1={}));var FilterRpc;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.requestId!=null&&tt.requestId!==""&&(rt.uint32(10),rt.string(tt.requestId)),tt.request!=null&&(rt.uint32(18),FilterRequest.codec().encode(tt.request,rt)),tt.push!=null&&(rt.uint32(26),MessagePush$1.codec().encode(tt.push,rt)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st,at;const ot={requestId:""},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const ct=tt.uint32();switch(ct>>>3){case 1:{ot.requestId=tt.string();break}case 2:{ot.request=FilterRequest.codec().decode(tt,tt.uint32(),{limits:(st=nt.limits)==null?void 0:st.request});break}case 3:{ot.push=MessagePush$1.codec().decode(tt,tt.uint32(),{limits:(at=nt.limits)==null?void 0:at.push});break}default:{tt.skipType(ct&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(FilterRpc||(FilterRpc={}));var RateLimitProof$3;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.proof!=null&&tt.proof.byteLength>0&&(rt.uint32(10),rt.bytes(tt.proof)),tt.merkleRoot!=null&&tt.merkleRoot.byteLength>0&&(rt.uint32(18),rt.bytes(tt.merkleRoot)),tt.epoch!=null&&tt.epoch.byteLength>0&&(rt.uint32(26),rt.bytes(tt.epoch)),tt.shareX!=null&&tt.shareX.byteLength>0&&(rt.uint32(34),rt.bytes(tt.shareX)),tt.shareY!=null&&tt.shareY.byteLength>0&&(rt.uint32(42),rt.bytes(tt.shareY)),tt.nullifier!=null&&tt.nullifier.byteLength>0&&(rt.uint32(50),rt.bytes(tt.nullifier)),tt.rlnIdentifier!=null&&tt.rlnIdentifier.byteLength>0&&(rt.uint32(58),rt.bytes(tt.rlnIdentifier)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{const ot={proof:alloc$6(0),merkleRoot:alloc$6(0),epoch:alloc$6(0),shareX:alloc$6(0),shareY:alloc$6(0),nullifier:alloc$6(0),rlnIdentifier:alloc$6(0)},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const st=tt.uint32();switch(st>>>3){case 1:{ot.proof=tt.bytes();break}case 2:{ot.merkleRoot=tt.bytes();break}case 3:{ot.epoch=tt.bytes();break}case 4:{ot.shareX=tt.bytes();break}case 5:{ot.shareY=tt.bytes();break}case 6:{ot.nullifier=tt.bytes();break}case 7:{ot.rlnIdentifier=tt.bytes();break}default:{tt.skipType(st&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(RateLimitProof$3||(RateLimitProof$3={}));var WakuMessage$3;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.payload!=null&&tt.payload.byteLength>0&&(rt.uint32(10),rt.bytes(tt.payload)),tt.contentTopic!=null&&tt.contentTopic!==""&&(rt.uint32(18),rt.string(tt.contentTopic)),tt.version!=null&&(rt.uint32(24),rt.uint32(tt.version)),tt.timestamp!=null&&(rt.uint32(80),rt.sint64(tt.timestamp)),tt.meta!=null&&(rt.uint32(90),rt.bytes(tt.meta)),tt.rateLimitProof!=null&&(rt.uint32(170),RateLimitProof$3.codec().encode(tt.rateLimitProof,rt)),tt.ephemeral!=null&&(rt.uint32(248),rt.bool(tt.ephemeral)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st;const ot={payload:alloc$6(0),contentTopic:""},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const at=tt.uint32();switch(at>>>3){case 1:{ot.payload=tt.bytes();break}case 2:{ot.contentTopic=tt.string();break}case 3:{ot.version=tt.uint32();break}case 10:{ot.timestamp=tt.sint64();break}case 11:{ot.meta=tt.bytes();break}case 21:{ot.rateLimitProof=RateLimitProof$3.codec().decode(tt,tt.uint32(),{limits:(st=nt.limits)==null?void 0:st.rateLimitProof});break}case 31:{ot.ephemeral=tt.bool();break}default:{tt.skipType(at&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(WakuMessage$3||(WakuMessage$3={}));var TopicOnlyMessage;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.contentTopic!=null&&tt.contentTopic!==""&&(rt.uint32(18),rt.string(tt.contentTopic)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{const ot={contentTopic:""},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const st=tt.uint32();switch(st>>>3){case 2:{ot.contentTopic=tt.string();break}default:{tt.skipType(st&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(TopicOnlyMessage||(TopicOnlyMessage={}));var FilterSubscribeRequest;(function(et){let o;(function(nt){nt.SUBSCRIBER_PING="SUBSCRIBER_PING",nt.SUBSCRIBE="SUBSCRIBE",nt.UNSUBSCRIBE="UNSUBSCRIBE",nt.UNSUBSCRIBE_ALL="UNSUBSCRIBE_ALL"})(o=et.FilterSubscribeType||(et.FilterSubscribeType={}));let tt;(function(nt){nt[nt.SUBSCRIBER_PING=0]="SUBSCRIBER_PING",nt[nt.SUBSCRIBE=1]="SUBSCRIBE",nt[nt.UNSUBSCRIBE=2]="UNSUBSCRIBE",nt[nt.UNSUBSCRIBE_ALL=3]="UNSUBSCRIBE_ALL"})(tt||(tt={})),function(nt){nt.codec=()=>enumeration(tt)}(o=et.FilterSubscribeType||(et.FilterSubscribeType={}));let rt;et.codec=()=>(rt==null&&(rt=message$1((nt,ot,it={})=>{if(it.lengthDelimited!==!1&&ot.fork(),nt.requestId!=null&&nt.requestId!==""&&(ot.uint32(10),ot.string(nt.requestId)),nt.filterSubscribeType!=null&&tt[nt.filterSubscribeType]!==0&&(ot.uint32(16),et.FilterSubscribeType.codec().encode(nt.filterSubscribeType,ot)),nt.pubsubTopic!=null&&(ot.uint32(82),ot.string(nt.pubsubTopic)),nt.contentTopics!=null)for(const st of nt.contentTopics)ot.uint32(90),ot.string(st);it.lengthDelimited!==!1&&ot.ldelim()},(nt,ot,it={})=>{var ct;const st={requestId:"",filterSubscribeType:o.SUBSCRIBER_PING,contentTopics:[]},at=ot==null?nt.len:nt.pos+ot;for(;nt.pos<at;){const lt=nt.uint32();switch(lt>>>3){case 1:{st.requestId=nt.string();break}case 2:{st.filterSubscribeType=et.FilterSubscribeType.codec().decode(nt);break}case 10:{st.pubsubTopic=nt.string();break}case 11:{if(((ct=it.limits)==null?void 0:ct.contentTopics)!=null&&st.contentTopics.length===it.limits.contentTopics)throw new MaxLengthError('Decode error - map field "contentTopics" had too many elements');st.contentTopics.push(nt.string());break}default:{nt.skipType(lt&7);break}}}return st})),rt),et.encode=nt=>encodeMessage(nt,et.codec()),et.decode=(nt,ot)=>decodeMessage(nt,et.codec(),ot)})(FilterSubscribeRequest||(FilterSubscribeRequest={}));var FilterSubscribeResponse$1;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.requestId!=null&&tt.requestId!==""&&(rt.uint32(10),rt.string(tt.requestId)),tt.statusCode!=null&&tt.statusCode!==0&&(rt.uint32(80),rt.uint32(tt.statusCode)),tt.statusDesc!=null&&(rt.uint32(90),rt.string(tt.statusDesc)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{const ot={requestId:"",statusCode:0},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const st=tt.uint32();switch(st>>>3){case 1:{ot.requestId=tt.string();break}case 10:{ot.statusCode=tt.uint32();break}case 11:{ot.statusDesc=tt.string();break}default:{tt.skipType(st&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(FilterSubscribeResponse$1||(FilterSubscribeResponse$1={}));var MessagePush;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.wakuMessage!=null&&(rt.uint32(10),WakuMessage$2.codec().encode(tt.wakuMessage,rt)),tt.pubsubTopic!=null&&(rt.uint32(18),rt.string(tt.pubsubTopic)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st;const ot={},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const at=tt.uint32();switch(at>>>3){case 1:{ot.wakuMessage=WakuMessage$2.codec().decode(tt,tt.uint32(),{limits:(st=nt.limits)==null?void 0:st.wakuMessage});break}case 2:{ot.pubsubTopic=tt.string();break}default:{tt.skipType(at&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(MessagePush||(MessagePush={}));var RateLimitProof$2;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.proof!=null&&tt.proof.byteLength>0&&(rt.uint32(10),rt.bytes(tt.proof)),tt.merkleRoot!=null&&tt.merkleRoot.byteLength>0&&(rt.uint32(18),rt.bytes(tt.merkleRoot)),tt.epoch!=null&&tt.epoch.byteLength>0&&(rt.uint32(26),rt.bytes(tt.epoch)),tt.shareX!=null&&tt.shareX.byteLength>0&&(rt.uint32(34),rt.bytes(tt.shareX)),tt.shareY!=null&&tt.shareY.byteLength>0&&(rt.uint32(42),rt.bytes(tt.shareY)),tt.nullifier!=null&&tt.nullifier.byteLength>0&&(rt.uint32(50),rt.bytes(tt.nullifier)),tt.rlnIdentifier!=null&&tt.rlnIdentifier.byteLength>0&&(rt.uint32(58),rt.bytes(tt.rlnIdentifier)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{const ot={proof:alloc$6(0),merkleRoot:alloc$6(0),epoch:alloc$6(0),shareX:alloc$6(0),shareY:alloc$6(0),nullifier:alloc$6(0),rlnIdentifier:alloc$6(0)},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const st=tt.uint32();switch(st>>>3){case 1:{ot.proof=tt.bytes();break}case 2:{ot.merkleRoot=tt.bytes();break}case 3:{ot.epoch=tt.bytes();break}case 4:{ot.shareX=tt.bytes();break}case 5:{ot.shareY=tt.bytes();break}case 6:{ot.nullifier=tt.bytes();break}case 7:{ot.rlnIdentifier=tt.bytes();break}default:{tt.skipType(st&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(RateLimitProof$2||(RateLimitProof$2={}));var WakuMessage$2;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.payload!=null&&tt.payload.byteLength>0&&(rt.uint32(10),rt.bytes(tt.payload)),tt.contentTopic!=null&&tt.contentTopic!==""&&(rt.uint32(18),rt.string(tt.contentTopic)),tt.version!=null&&(rt.uint32(24),rt.uint32(tt.version)),tt.timestamp!=null&&(rt.uint32(80),rt.sint64(tt.timestamp)),tt.meta!=null&&(rt.uint32(90),rt.bytes(tt.meta)),tt.rateLimitProof!=null&&(rt.uint32(170),RateLimitProof$2.codec().encode(tt.rateLimitProof,rt)),tt.ephemeral!=null&&(rt.uint32(248),rt.bool(tt.ephemeral)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st;const ot={payload:alloc$6(0),contentTopic:""},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const at=tt.uint32();switch(at>>>3){case 1:{ot.payload=tt.bytes();break}case 2:{ot.contentTopic=tt.string();break}case 3:{ot.version=tt.uint32();break}case 10:{ot.timestamp=tt.sint64();break}case 11:{ot.meta=tt.bytes();break}case 21:{ot.rateLimitProof=RateLimitProof$2.codec().decode(tt,tt.uint32(),{limits:(st=nt.limits)==null?void 0:st.rateLimitProof});break}case 31:{ot.ephemeral=tt.bool();break}default:{tt.skipType(at&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(WakuMessage$2||(WakuMessage$2={}));var PushRequest;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.pubsubTopic!=null&&tt.pubsubTopic!==""&&(rt.uint32(10),rt.string(tt.pubsubTopic)),tt.message!=null&&(rt.uint32(18),WakuMessage$1.codec().encode(tt.message,rt)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st;const ot={pubsubTopic:""},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const at=tt.uint32();switch(at>>>3){case 1:{ot.pubsubTopic=tt.string();break}case 2:{ot.message=WakuMessage$1.codec().decode(tt,tt.uint32(),{limits:(st=nt.limits)==null?void 0:st.message});break}default:{tt.skipType(at&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(PushRequest||(PushRequest={}));var PushResponse;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.isSuccess!=null&&tt.isSuccess!==!1&&(rt.uint32(8),rt.bool(tt.isSuccess)),tt.info!=null&&(rt.uint32(18),rt.string(tt.info)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{const ot={isSuccess:!1},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const st=tt.uint32();switch(st>>>3){case 1:{ot.isSuccess=tt.bool();break}case 2:{ot.info=tt.string();break}default:{tt.skipType(st&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(PushResponse||(PushResponse={}));var PushRpc$1;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.requestId!=null&&tt.requestId!==""&&(rt.uint32(10),rt.string(tt.requestId)),tt.request!=null&&(rt.uint32(18),PushRequest.codec().encode(tt.request,rt)),tt.response!=null&&(rt.uint32(26),PushResponse.codec().encode(tt.response,rt)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st,at;const ot={requestId:""},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const ct=tt.uint32();switch(ct>>>3){case 1:{ot.requestId=tt.string();break}case 2:{ot.request=PushRequest.codec().decode(tt,tt.uint32(),{limits:(st=nt.limits)==null?void 0:st.request});break}case 3:{ot.response=PushResponse.codec().decode(tt,tt.uint32(),{limits:(at=nt.limits)==null?void 0:at.response});break}default:{tt.skipType(ct&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(PushRpc$1||(PushRpc$1={}));var RateLimitProof$1;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.proof!=null&&tt.proof.byteLength>0&&(rt.uint32(10),rt.bytes(tt.proof)),tt.merkleRoot!=null&&tt.merkleRoot.byteLength>0&&(rt.uint32(18),rt.bytes(tt.merkleRoot)),tt.epoch!=null&&tt.epoch.byteLength>0&&(rt.uint32(26),rt.bytes(tt.epoch)),tt.shareX!=null&&tt.shareX.byteLength>0&&(rt.uint32(34),rt.bytes(tt.shareX)),tt.shareY!=null&&tt.shareY.byteLength>0&&(rt.uint32(42),rt.bytes(tt.shareY)),tt.nullifier!=null&&tt.nullifier.byteLength>0&&(rt.uint32(50),rt.bytes(tt.nullifier)),tt.rlnIdentifier!=null&&tt.rlnIdentifier.byteLength>0&&(rt.uint32(58),rt.bytes(tt.rlnIdentifier)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{const ot={proof:alloc$6(0),merkleRoot:alloc$6(0),epoch:alloc$6(0),shareX:alloc$6(0),shareY:alloc$6(0),nullifier:alloc$6(0),rlnIdentifier:alloc$6(0)},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const st=tt.uint32();switch(st>>>3){case 1:{ot.proof=tt.bytes();break}case 2:{ot.merkleRoot=tt.bytes();break}case 3:{ot.epoch=tt.bytes();break}case 4:{ot.shareX=tt.bytes();break}case 5:{ot.shareY=tt.bytes();break}case 6:{ot.nullifier=tt.bytes();break}case 7:{ot.rlnIdentifier=tt.bytes();break}default:{tt.skipType(st&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(RateLimitProof$1||(RateLimitProof$1={}));var WakuMessage$1;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.payload!=null&&tt.payload.byteLength>0&&(rt.uint32(10),rt.bytes(tt.payload)),tt.contentTopic!=null&&tt.contentTopic!==""&&(rt.uint32(18),rt.string(tt.contentTopic)),tt.version!=null&&(rt.uint32(24),rt.uint32(tt.version)),tt.timestamp!=null&&(rt.uint32(80),rt.sint64(tt.timestamp)),tt.meta!=null&&(rt.uint32(90),rt.bytes(tt.meta)),tt.rateLimitProof!=null&&(rt.uint32(170),RateLimitProof$1.codec().encode(tt.rateLimitProof,rt)),tt.ephemeral!=null&&(rt.uint32(248),rt.bool(tt.ephemeral)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st;const ot={payload:alloc$6(0),contentTopic:""},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const at=tt.uint32();switch(at>>>3){case 1:{ot.payload=tt.bytes();break}case 2:{ot.contentTopic=tt.string();break}case 3:{ot.version=tt.uint32();break}case 10:{ot.timestamp=tt.sint64();break}case 11:{ot.meta=tt.bytes();break}case 21:{ot.rateLimitProof=RateLimitProof$1.codec().decode(tt,tt.uint32(),{limits:(st=nt.limits)==null?void 0:st.rateLimitProof});break}case 31:{ot.ephemeral=tt.bool();break}default:{tt.skipType(at&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(WakuMessage$1||(WakuMessage$1={}));var WakuMessageKeyValue;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.messageHash!=null&&(rt.uint32(10),rt.bytes(tt.messageHash)),tt.message!=null&&(rt.uint32(18),WakuMessage.codec().encode(tt.message,rt)),tt.pubsubTopic!=null&&(rt.uint32(26),rt.string(tt.pubsubTopic)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st;const ot={},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const at=tt.uint32();switch(at>>>3){case 1:{ot.messageHash=tt.bytes();break}case 2:{ot.message=WakuMessage.codec().decode(tt,tt.uint32(),{limits:(st=nt.limits)==null?void 0:st.message});break}case 3:{ot.pubsubTopic=tt.string();break}default:{tt.skipType(at&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(WakuMessageKeyValue||(WakuMessageKeyValue={}));var StoreQueryRequest$1;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{if(nt.lengthDelimited!==!1&&rt.fork(),tt.requestId!=null&&tt.requestId!==""&&(rt.uint32(10),rt.string(tt.requestId)),tt.includeData!=null&&tt.includeData!==!1&&(rt.uint32(16),rt.bool(tt.includeData)),tt.pubsubTopic!=null&&(rt.uint32(82),rt.string(tt.pubsubTopic)),tt.contentTopics!=null)for(const ot of tt.contentTopics)rt.uint32(90),rt.string(ot);if(tt.timeStart!=null&&(rt.uint32(96),rt.sint64(tt.timeStart)),tt.timeEnd!=null&&(rt.uint32(104),rt.sint64(tt.timeEnd)),tt.messageHashes!=null)for(const ot of tt.messageHashes)rt.uint32(162),rt.bytes(ot);tt.paginationCursor!=null&&(rt.uint32(410),rt.bytes(tt.paginationCursor)),tt.paginationForward!=null&&tt.paginationForward!==!1&&(rt.uint32(416),rt.bool(tt.paginationForward)),tt.paginationLimit!=null&&(rt.uint32(424),rt.uint64(tt.paginationLimit)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st,at;const ot={requestId:"",includeData:!1,contentTopics:[],messageHashes:[],paginationForward:!1},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const ct=tt.uint32();switch(ct>>>3){case 1:{ot.requestId=tt.string();break}case 2:{ot.includeData=tt.bool();break}case 10:{ot.pubsubTopic=tt.string();break}case 11:{if(((st=nt.limits)==null?void 0:st.contentTopics)!=null&&ot.contentTopics.length===nt.limits.contentTopics)throw new MaxLengthError('Decode error - map field "contentTopics" had too many elements');ot.contentTopics.push(tt.string());break}case 12:{ot.timeStart=tt.sint64();break}case 13:{ot.timeEnd=tt.sint64();break}case 20:{if(((at=nt.limits)==null?void 0:at.messageHashes)!=null&&ot.messageHashes.length===nt.limits.messageHashes)throw new MaxLengthError('Decode error - map field "messageHashes" had too many elements');ot.messageHashes.push(tt.bytes());break}case 51:{ot.paginationCursor=tt.bytes();break}case 52:{ot.paginationForward=tt.bool();break}case 53:{ot.paginationLimit=tt.uint64();break}default:{tt.skipType(ct&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(StoreQueryRequest$1||(StoreQueryRequest$1={}));var StoreQueryResponse$1;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{if(nt.lengthDelimited!==!1&&rt.fork(),tt.requestId!=null&&tt.requestId!==""&&(rt.uint32(10),rt.string(tt.requestId)),tt.statusCode!=null&&(rt.uint32(80),rt.uint32(tt.statusCode)),tt.statusDesc!=null&&(rt.uint32(90),rt.string(tt.statusDesc)),tt.messages!=null)for(const ot of tt.messages)rt.uint32(162),WakuMessageKeyValue.codec().encode(ot,rt);tt.paginationCursor!=null&&(rt.uint32(410),rt.bytes(tt.paginationCursor)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st,at;const ot={requestId:"",messages:[]},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const ct=tt.uint32();switch(ct>>>3){case 1:{ot.requestId=tt.string();break}case 10:{ot.statusCode=tt.uint32();break}case 11:{ot.statusDesc=tt.string();break}case 20:{if(((st=nt.limits)==null?void 0:st.messages)!=null&&ot.messages.length===nt.limits.messages)throw new MaxLengthError('Decode error - map field "messages" had too many elements');ot.messages.push(WakuMessageKeyValue.codec().decode(tt,tt.uint32(),{limits:(at=nt.limits)==null?void 0:at.messages$}));break}case 51:{ot.paginationCursor=tt.bytes();break}default:{tt.skipType(ct&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(StoreQueryResponse$1||(StoreQueryResponse$1={}));var RateLimitProof;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.proof!=null&&tt.proof.byteLength>0&&(rt.uint32(10),rt.bytes(tt.proof)),tt.merkleRoot!=null&&tt.merkleRoot.byteLength>0&&(rt.uint32(18),rt.bytes(tt.merkleRoot)),tt.epoch!=null&&tt.epoch.byteLength>0&&(rt.uint32(26),rt.bytes(tt.epoch)),tt.shareX!=null&&tt.shareX.byteLength>0&&(rt.uint32(34),rt.bytes(tt.shareX)),tt.shareY!=null&&tt.shareY.byteLength>0&&(rt.uint32(42),rt.bytes(tt.shareY)),tt.nullifier!=null&&tt.nullifier.byteLength>0&&(rt.uint32(50),rt.bytes(tt.nullifier)),tt.rlnIdentifier!=null&&tt.rlnIdentifier.byteLength>0&&(rt.uint32(58),rt.bytes(tt.rlnIdentifier)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{const ot={proof:alloc$6(0),merkleRoot:alloc$6(0),epoch:alloc$6(0),shareX:alloc$6(0),shareY:alloc$6(0),nullifier:alloc$6(0),rlnIdentifier:alloc$6(0)},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const st=tt.uint32();switch(st>>>3){case 1:{ot.proof=tt.bytes();break}case 2:{ot.merkleRoot=tt.bytes();break}case 3:{ot.epoch=tt.bytes();break}case 4:{ot.shareX=tt.bytes();break}case 5:{ot.shareY=tt.bytes();break}case 6:{ot.nullifier=tt.bytes();break}case 7:{ot.rlnIdentifier=tt.bytes();break}default:{tt.skipType(st&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(RateLimitProof||(RateLimitProof={}));var WakuMessage;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.payload!=null&&tt.payload.byteLength>0&&(rt.uint32(10),rt.bytes(tt.payload)),tt.contentTopic!=null&&tt.contentTopic!==""&&(rt.uint32(18),rt.string(tt.contentTopic)),tt.version!=null&&(rt.uint32(24),rt.uint32(tt.version)),tt.timestamp!=null&&(rt.uint32(80),rt.sint64(tt.timestamp)),tt.meta!=null&&(rt.uint32(90),rt.bytes(tt.meta)),tt.rateLimitProof!=null&&(rt.uint32(170),RateLimitProof.codec().encode(tt.rateLimitProof,rt)),tt.ephemeral!=null&&(rt.uint32(248),rt.bool(tt.ephemeral)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st;const ot={payload:alloc$6(0),contentTopic:""},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const at=tt.uint32();switch(at>>>3){case 1:{ot.payload=tt.bytes();break}case 2:{ot.contentTopic=tt.string();break}case 3:{ot.version=tt.uint32();break}case 10:{ot.timestamp=tt.sint64();break}case 11:{ot.meta=tt.bytes();break}case 21:{ot.rateLimitProof=RateLimitProof.codec().decode(tt,tt.uint32(),{limits:(st=nt.limits)==null?void 0:st.rateLimitProof});break}case 31:{ot.ephemeral=tt.bool();break}default:{tt.skipType(at&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(WakuMessage||(WakuMessage={}));var PeerInfo;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.enr!=null&&(rt.uint32(10),rt.bytes(tt.enr)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{const ot={},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const st=tt.uint32();switch(st>>>3){case 1:{ot.enr=tt.bytes();break}default:{tt.skipType(st&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(PeerInfo||(PeerInfo={}));var PeerExchangeQuery;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.numPeers!=null&&(rt.uint32(8),rt.uint64(tt.numPeers)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{const ot={},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const st=tt.uint32();switch(st>>>3){case 1:{ot.numPeers=tt.uint64();break}default:{tt.skipType(st&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(PeerExchangeQuery||(PeerExchangeQuery={}));var PeerExchangeResponse;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{if(nt.lengthDelimited!==!1&&rt.fork(),tt.peerInfos!=null)for(const ot of tt.peerInfos)rt.uint32(10),PeerInfo.codec().encode(ot,rt);nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st,at;const ot={peerInfos:[]},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const ct=tt.uint32();switch(ct>>>3){case 1:{if(((st=nt.limits)==null?void 0:st.peerInfos)!=null&&ot.peerInfos.length===nt.limits.peerInfos)throw new MaxLengthError('Decode error - map field "peerInfos" had too many elements');ot.peerInfos.push(PeerInfo.codec().decode(tt,tt.uint32(),{limits:(at=nt.limits)==null?void 0:at.peerInfos$}));break}default:{tt.skipType(ct&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(PeerExchangeResponse||(PeerExchangeResponse={}));var PeerExchangeRPC$1;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.query!=null&&(rt.uint32(10),PeerExchangeQuery.codec().encode(tt.query,rt)),tt.response!=null&&(rt.uint32(18),PeerExchangeResponse.codec().encode(tt.response,rt)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st,at;const ot={},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const ct=tt.uint32();switch(ct>>>3){case 1:{ot.query=PeerExchangeQuery.codec().decode(tt,tt.uint32(),{limits:(st=nt.limits)==null?void 0:st.query});break}case 2:{ot.response=PeerExchangeResponse.codec().decode(tt,tt.uint32(),{limits:(at=nt.limits)==null?void 0:at.response});break}default:{tt.skipType(ct&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(PeerExchangeRPC$1||(PeerExchangeRPC$1={}));var WakuMetadataRequest;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{if(nt.lengthDelimited!==!1&&rt.fork(),tt.clusterId!=null&&(rt.uint32(8),rt.uint32(tt.clusterId)),tt.shards!=null)for(const ot of tt.shards)rt.uint32(16),rt.uint32(ot);nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st;const ot={shards:[]},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const at=tt.uint32();switch(at>>>3){case 1:{ot.clusterId=tt.uint32();break}case 2:{if(((st=nt.limits)==null?void 0:st.shards)!=null&&ot.shards.length===nt.limits.shards)throw new MaxLengthError('Decode error - map field "shards" had too many elements');ot.shards.push(tt.uint32());break}default:{tt.skipType(at&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(WakuMetadataRequest||(WakuMetadataRequest={}));var WakuMetadataResponse;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{if(nt.lengthDelimited!==!1&&rt.fork(),tt.clusterId!=null&&(rt.uint32(8),rt.uint32(tt.clusterId)),tt.shards!=null)for(const ot of tt.shards)rt.uint32(16),rt.uint32(ot);nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st;const ot={shards:[]},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const at=tt.uint32();switch(at>>>3){case 1:{ot.clusterId=tt.uint32();break}case 2:{if(((st=nt.limits)==null?void 0:st.shards)!=null&&ot.shards.length===nt.limits.shards)throw new MaxLengthError('Decode error - map field "shards" had too many elements');ot.shards.push(tt.uint32());break}default:{tt.skipType(at&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(WakuMetadataResponse||(WakuMetadataResponse={}));function isDefined(et){return!!et}function groupByContentTopic(et){const o=new Map;return et.forEach(tt=>{let rt=o.get(tt.contentTopic);rt||(o.set(tt.contentTopic,[]),rt=o.get(tt.contentTopic)),rt.push(tt)}),o}const FRAME_RATE=60;async function toAsyncIterator(et,o,tt){const rt=FRAME_RATE,nt=[];let ot;ot=await et.subscribeWithUnsubscribe(o,lt=>{nt.push(lt)});const it=Number.isInteger(tt==null?void 0:tt.timeoutMs),st=0,at=Date.now();async function*ct(){for(;;){if(it&&Date.now()-at>=st)return;await wait(rt);const lt=nt.shift();if(!ot&&nt.length===0)return lt;!lt&&ot||(yield lt)}}return{iterator:ct(),async stop(){ot&&(await ot(),ot=void 0)}}}function wait(et){return new Promise(o=>{setTimeout(o,et)})}const MB=1024**2,SIZE_CAP_IN_MB=1;async function isMessageSizeUnderCap(et,o){const tt=await et.toWire(o);return tt?isWireSizeUnderCap(tt):!1}const isWireSizeUnderCap=et=>et.length/MB<=SIZE_CAP_IN_MB;var Protocols;(function(et){et.Relay="relay",et.Store="store",et.LightPush="lightpush",et.Filter="filter"})(Protocols||(Protocols={}));var ProtocolError$1;(function(et){et.GENERIC_FAIL="Generic error",et.ENCODE_FAILED="Failed to encode",et.DECODE_FAILED="Failed to decode",et.EMPTY_PAYLOAD="Payload is empty",et.SIZE_TOO_BIG="Size is too big",et.TOPIC_NOT_CONFIGURED="Topic not configured",et.TOPIC_DECODER_MISMATCH="Topic decoder mismatch",et.INVALID_DECODER_TOPICS="Invalid decoder topics",et.NO_PEER_AVAILABLE="No peer available",et.NO_STREAM_AVAILABLE="No stream available",et.NO_RESPONSE="No response received",et.REMOTE_PEER_REJECTED="Remote peer rejected",et.REQUEST_TIMEOUT="Request timeout",et.RLN_IDENTITY_MISSING="Identity credentials are not set",et.RLN_MEMBERSHIP_INDEX="Membership index is not set",et.RLN_LIMIT_MISSING="User message limit is not set",et.RLN_PROOF_GENERATION="Proof generation failed"})(ProtocolError$1||(ProtocolError$1={}));var Tags;(function(et){et.BOOTSTRAP="bootstrap",et.PEER_EXCHANGE="peer-exchange",et.LOCAL="local-peer-cache"})(Tags||(Tags={}));var EPeersByDiscoveryEvents;(function(et){et.PEER_DISCOVERY_BOOTSTRAP="peer:discovery:bootstrap",et.PEER_DISCOVERY_PEER_EXCHANGE="peer:discovery:peer-exchange",et.PEER_CONNECT_BOOTSTRAP="peer:connected:bootstrap",et.PEER_CONNECT_PEER_EXCHANGE="peer:connected:peer-exchange"})(EPeersByDiscoveryEvents||(EPeersByDiscoveryEvents={}));var EConnectionStateEvents;(function(et){et.CONNECTION_STATUS="waku:connection"})(EConnectionStateEvents||(EConnectionStateEvents={}));const DNS_DISCOVERY_TAG="@waku/bootstrap",DEFAULT_CLUSTER_ID=1,DefaultShardInfo={clusterId:DEFAULT_CLUSTER_ID,shards:[0,1,2,3,4,5,6,7,8]},DefaultNetworkConfig=DefaultShardInfo;var HealthStatus;(function(et){et.Unhealthy="Unhealthy",et.MinimallyHealthy="MinimallyHealthy",et.SufficientlyHealthy="SufficientlyHealthy"})(HealthStatus||(HealthStatus={}));function coerce$j(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function fromString$u(et){return new TextEncoder().encode(et)}function toString$w(et){return new TextDecoder().decode(et)}function base$k(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt<tt.length;rt++)tt[rt]=255;for(var nt=0;nt<et.length;nt++){var ot=et.charAt(nt),it=ot.charCodeAt(0);if(tt[it]!==255)throw new TypeError(ot+" is ambiguous");tt[it]=nt}var st=et.length,at=et.charAt(0),ct=Math.log(st)/Math.log(256),lt=Math.log(256)/Math.log(st);function dt(ft){if(ft instanceof Uint8Array||(ArrayBuffer.isView(ft)?ft=new Uint8Array(ft.buffer,ft.byteOffset,ft.byteLength):Array.isArray(ft)&&(ft=Uint8Array.from(ft))),!(ft instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(ft.length===0)return"";for(var pt=0,yt=0,gt=0,bt=ft.length;gt!==bt&&ft[gt]===0;)gt++,pt++;for(var xt=(bt-gt)*lt+1>>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct<yt)&&St!==-1;St--,Ct++)Et+=256*vt[St]>>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At<xt;++At)kt+=et.charAt(vt[At]);return kt}function ht(ft){if(typeof ft!="string")throw new TypeError("Expected String");if(ft.length===0)return new Uint8Array;var pt=0;if(ft[pt]!==" "){for(var yt=0,gt=0;ft[pt]===at;)yt++,pt++;for(var bt=(ft.length-pt)*ct+1>>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et<gt)&&Ct!==-1;Ct--,Et++)vt+=st*xt[Ct]>>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$k=base$k,_brrp__multiformats_scope_baseX$j=src$k;let Encoder$l=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$l=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$l(this,o)}},ComposedDecoder$j=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$l(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$l(et,o){return new ComposedDecoder$j({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$j=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$l(o,tt,rt),this.decoder=new Decoder$l(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$m({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$j(et,o,tt,rt)}function baseX$j({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$j(tt,et);return from$m({prefix:o,name:et,encode:rt,decode:ot=>coerce$j(nt(ot))})}function decode$W(et,o,tt,rt){const nt={};for(let lt=0;lt<o.length;++lt)nt[o[lt]]=lt;let ot=et.length;for(;et[ot-1]==="=";)--ot;const it=new Uint8Array(ot*tt/8|0);let st=0,at=0,ct=0;for(let lt=0;lt<ot;++lt){const dt=nt[et[lt]];if(dt===void 0)throw new SyntaxError(`Non-${rt} character`);at=at<<tt|dt,st+=tt,st>=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$M(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<<tt)-1;let ot="",it=0,st=0;for(let at=0;at<et.length;++at)for(st=st<<8|et[at],it+=8;it>tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<<tt-it]),rt)for(;ot.length*tt&7;)ot+="=";return ot}function rfc4648$i({name:et,prefix:o,bitsPerChar:tt,alphabet:rt}){return from$m({prefix:o,name:et,encode(nt){return encode$M(nt,rt,tt)},decode(nt){return decode$W(nt,rt,tt,et)}})}const base10$u=baseX$j({prefix:"9",name:"base10",alphabet:"0123456789"}),base10$v=Object.freeze(Object.defineProperty({__proto__:null,base10:base10$u},Symbol.toStringTag,{value:"Module"})),base16$u=rfc4648$i({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper$f=rfc4648$i({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),base16$v=Object.freeze(Object.defineProperty({__proto__:null,base16:base16$u,base16upper:base16upper$f},Symbol.toStringTag,{value:"Module"})),base2$u=rfc4648$i({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),base2$v=Object.freeze(Object.defineProperty({__proto__:null,base2:base2$u},Symbol.toStringTag,{value:"Module"})),alphabet$f=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),alphabetBytesToChars$f=alphabet$f.reduce((et,o,tt)=>(et[tt]=o,et),[]),alphabetCharsToBytes$f=alphabet$f.reduce((et,o,tt)=>{const rt=o.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${o}`);return et[rt]=tt,et},[]);function encode$L(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars$f[tt],o),"")}function decode$V(et){const o=[];for(const tt of et){const rt=tt.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${tt}`);const nt=alphabetCharsToBytes$f[rt];if(nt==null)throw new Error(`Non-base256emoji character: ${tt}`);o.push(nt)}return new Uint8Array(o)}const base256emoji$u=from$m({prefix:"🚀",name:"base256emoji",encode:encode$L,decode:decode$V}),base256emoji$v=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:base256emoji$u},Symbol.toStringTag,{value:"Module"})),base32$y=rfc4648$i({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper$f=rfc4648$i({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad$f=rfc4648$i({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper$f=rfc4648$i({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex$f=rfc4648$i({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper$f=rfc4648$i({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad$f=rfc4648$i({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper$f=rfc4648$i({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z$f=rfc4648$i({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$z=Object.freeze(Object.defineProperty({__proto__:null,base32:base32$y,base32hex:base32hex$f,base32hexpad:base32hexpad$f,base32hexpadupper:base32hexpadupper$f,base32hexupper:base32hexupper$f,base32pad:base32pad$f,base32padupper:base32padupper$f,base32upper:base32upper$f,base32z:base32z$f},Symbol.toStringTag,{value:"Module"})),base36$v=baseX$j({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper$f=baseX$j({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$w=Object.freeze(Object.defineProperty({__proto__:null,base36:base36$v,base36upper:base36upper$f},Symbol.toStringTag,{value:"Module"})),base58btc$j=baseX$j({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr$f=baseX$j({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58$f=Object.freeze(Object.defineProperty({__proto__:null,base58btc:base58btc$j,base58flickr:base58flickr$f},Symbol.toStringTag,{value:"Module"})),base64$x=rfc4648$i({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad$f=rfc4648$i({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url$g=rfc4648$i({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad$f=rfc4648$i({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$y=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$x,base64pad:base64pad$f,base64url:base64url$g,base64urlpad:base64urlpad$f},Symbol.toStringTag,{value:"Module"})),base8$u=rfc4648$i({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$v=Object.freeze(Object.defineProperty({__proto__:null,base8:base8$u},Symbol.toStringTag,{value:"Module"})),identity$h=from$m({prefix:"\0",name:"identity",encode:et=>toString$w(et),decode:et=>fromString$u(et)}),identityBase$f=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$h},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const bases$f={...identityBase$f,...base2$v,...base8$v,...base10$v,...base16$v,...base32$z,...base36$w,...base58$f,...base64$y,...base256emoji$v};function allocUnsafe$g(et=0){return new Uint8Array(et)}function createCodec$f(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$j=createCodec$f("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii$f=createCodec$f("ascii","a",et=>{let o="a";for(let tt=0;tt<et.length;tt++)o+=String.fromCharCode(et[tt]);return o},et=>{et=et.substring(1);const o=allocUnsafe$g(et.length);for(let tt=0;tt<et.length;tt++)o[tt]=et.charCodeAt(tt);return o}),BASES$f={utf8:string$j,"utf-8":string$j,hex:bases$f.base16,latin1:ascii$f,ascii:ascii$f,binary:ascii$f,...bases$f};function fromString$t(et,o="utf8"){const tt=BASES$f[o];if(tt==null)throw new Error(`Unsupported encoding "${o}"`);return tt.decoder.decode(`${tt.prefix}${et}`)}function toString$v(et,o="utf8"){const tt=BASES$f[o];if(tt==null)throw new Error(`Unsupported encoding "${o}"`);return tt.encoder.encode(et).substring(1)}function hexToBytes$1(et){if(typeof et=="string"){const o=et.replace(/^0x/i,"");return fromString$t(o.toLowerCase(),"base16")}return et}function numberToBytes(et){const o=new ArrayBuffer(8),tt=new DataView(o);return typeof et=="number"?tt.setFloat64(0,et,!1):tt.setBigInt64(0,et,!1),new Uint8Array(o)}const bytesToHex$1=et=>toString$v(et,"base16"),bytesToUtf8=et=>toString$v(et,"utf8"),utf8ToBytes$1=et=>fromString$t(et,"utf8");function concat$5(et,o){const tt=et.reduce((ot,it)=>ot+it.length,0),rt=new Uint8Array(tt);let nt=0;for(const ot of et)rt.set(ot,nt),nt+=ot.length;return rt}function isStaticSharding(et){return"clusterId"in et&&"shards"in et&&!("contentTopics"in et)}function isAutoSharding(et){return"contentTopics"in et}function derivePubsubTopicsFromNetworkConfig(et){if(isStaticSharding(et)){if(et.shards.length===0)throw new Error("Invalid shards configuration: please provide at least one shard");return shardInfoToPubsubTopics(et)}else if(isAutoSharding(et)){if(et.contentTopics.length===0)throw new Error("Invalid content topics configuration: please provide at least one content topic");return et.contentTopics.map(o=>contentTopicToPubsubTopic(o,et.clusterId))}else throw new Error("Unknown shard config. Please use ShardInfo or ContentTopicInfo")}const singleShardInfoToPubsubTopic=et=>{if(et.shard===void 0)throw new Error("Invalid shard");return`/waku/2/rs/${et.clusterId??DEFAULT_CLUSTER_ID}/${et.shard}`},shardInfoToPubsubTopics=et=>{if("contentTopics"in et&&et.contentTopics)return Array.from(new Set(et.contentTopics.map(o=>contentTopicToPubsubTopic(o,et.clusterId))));if("shards"in et){if(et.shards===void 0)throw new Error("Invalid shard");return Array.from(new Set(et.shards.map(o=>`/waku/2/rs/${et.clusterId??DEFAULT_CLUSTER_ID}/${o}`)))}else{if("application"in et&&"version"in et)return[contentTopicToPubsubTopic(`/${et.application}/${et.version}/default/default`,et.clusterId)];throw new Error("Missing required configuration in shard parameters")}},pubsubTopicToSingleShardInfo=et=>{const o=et.split("/");if(o.length!=6||o[1]!=="waku"||o[2]!=="2"||o[3]!=="rs")throw new Error("Invalid pubsub topic");const tt=parseInt(o[4]),rt=parseInt(o[5]);if(isNaN(tt)||isNaN(rt))throw new Error("Invalid clusterId or shard");return{clusterId:tt,shard:rt}},pubsubTopicsToShardInfo=et=>{const o=new Set,tt=new Set;for(const ot of et){const{clusterId:it,shard:st}=pubsubTopicToSingleShardInfo(ot);o.add(`${it}:${st}`),tt.add(it)}if(o.size===0)throw new Error("No valid pubsub topics provided");if(tt.size>1)throw new Error("Pubsub topics from multiple cluster IDs are not supported");const rt=tt.values().next().value,nt=Array.from(o).map(ot=>parseInt(ot.split(":")[1]));return{clusterId:rt,shards:nt}};function ensurePubsubTopicIsConfigured(et,o){if(!o.includes(et))throw new Error(`Pubsub topic ${et} has not been configured on this instance. Configured topics are: ${o}. Please update your configuration by passing in the topic during Waku node instantiation.`)}function ensureValidContentTopic(et){const o=et.split("/");if(o.length<5||o.length>6)throw Error("Content topic format is invalid");let tt=0;if(o.length==6){if(tt=parseInt(o[1]),isNaN(tt))throw new Error("Invalid generation field in content topic");if(tt>0)throw new Error("Generation greater than 0 is not supported")}const rt=o.splice(-4);if(rt[0].length==0)throw new Error("Application field cannot be empty");if(rt[1].length==0)throw new Error("Version field cannot be empty");if(rt[2].length==0)throw new Error("Topic name field cannot be empty");if(rt[3].length==0)throw new Error("Encoding field cannot be empty");return{generation:tt,application:rt[0],version:rt[1],topicName:rt[2],encoding:rt[3]}}function contentTopicToShardIndex(et,o=8){const{application:tt,version:rt}=ensureValidContentTopic(et),nt=sha256$3(concat$5([utf8ToBytes$1(tt),utf8ToBytes$1(rt)])),ot=new DataView(nt.buffer.slice(-8));return Number(ot.getBigUint64(0,!1)%BigInt(o))}function contentTopicToPubsubTopic(et,o=DEFAULT_CLUSTER_ID,tt=8){if(!et)throw Error("Content topic must be specified");const rt=contentTopicToShardIndex(et,tt);return`/waku/2/rs/${o}/${rt}`}function determinePubsubTopic(et,o){return typeof o=="string"?o:(o==null?void 0:o.shard)!==void 0?singleShardInfoToPubsubTopic(o):contentTopicToPubsubTopic(et,(o==null?void 0:o.clusterId)??DEFAULT_CLUSTER_ID)}const decodeRelayShard=et=>{if(et=new Uint8Array(et),et.length<3)throw new Error("Insufficient data");const o=new DataView(et.buffer),tt=o.getUint16(0),rt=[];if(et.length===130)for(let nt=0;nt<1024;nt++){const ot=Math.floor(nt/8)+2,it=7-nt%8;o.getUint8(ot)&1<<it&&rt.push(nt)}else{const nt=o.getUint8(2);for(let ot=0,it=3;ot<nt;ot++,it+=2){if(it+1>=et.length)throw new Error("Unexpected end of data");rt.push(o.getUint16(it))}}return{clusterId:tt,shards:rt}},encodeRelayShard=et=>{const{clusterId:o,shards:tt}=et,rt=tt.length>=64?130:3+2*tt.length,nt=new ArrayBuffer(rt),ot=new DataView(nt);if(ot.setUint16(0,o),tt.length>=64)for(const it of tt){const st=Math.floor(it/8)+2,at=7-it%8;ot.setUint8(st,ot.getUint8(st)|1<<at)}else{ot.setUint8(2,tt.length);for(let it=0,st=3;it<tt.length;it++,st+=2)ot.setUint16(st,tt[it])}return new Uint8Array(nt)};function getWsMultiaddrFromMultiaddrs(et){const o=et.find(tt=>tt.toString().includes("ws")||tt.toString().includes("wss"));if(!o)throw new Error("No ws multiaddr found in the given addresses");return o}var browser={exports:{}},ms$1,hasRequiredMs;function requireMs(){if(hasRequiredMs)return ms$1;hasRequiredMs=1;var et=1e3,o=et*60,tt=o*60,rt=tt*24,nt=rt*7,ot=rt*365.25;ms$1=function(lt,dt){dt=dt||{};var ht=typeof lt;if(ht==="string"&&lt.length>0)return it(lt);if(ht==="number"&&isFinite(lt))return dt.long?at(lt):st(lt);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(lt))};function it(lt){if(lt=String(lt),!(lt.length>100)){var dt=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(lt);if(dt){var ht=parseFloat(dt[1]),mt=(dt[2]||"ms").toLowerCase();switch(mt){case"years":case"year":case"yrs":case"yr":case"y":return ht*ot;case"weeks":case"week":case"w":return ht*nt;case"days":case"day":case"d":return ht*rt;case"hours":case"hour":case"hrs":case"hr":case"h":return ht*tt;case"minutes":case"minute":case"mins":case"min":case"m":return ht*o;case"seconds":case"second":case"secs":case"sec":case"s":return ht*et;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return ht;default:return}}}}function st(lt){var dt=Math.abs(lt);return dt>=rt?Math.round(lt/rt)+"d":dt>=tt?Math.round(lt/tt)+"h":dt>=o?Math.round(lt/o)+"m":dt>=et?Math.round(lt/et)+"s":lt+"ms"}function at(lt){var dt=Math.abs(lt);return dt>=rt?ct(lt,dt,rt,"day"):dt>=tt?ct(lt,dt,tt,"hour"):dt>=o?ct(lt,dt,o,"minute"):dt>=et?ct(lt,dt,et,"second"):lt+" ms"}function ct(lt,dt,ht,mt){var ft=dt>=ht*1.5;return Math.round(lt/ht)+" "+mt+(ft?"s":"")}return ms$1}function setup$1(et){tt.debug=tt,tt.default=tt,tt.coerce=at,tt.disable=ot,tt.enable=nt,tt.enabled=it,tt.humanize=requireMs(),tt.destroy=ct,Object.keys(et).forEach(lt=>{tt[lt]=et[lt]}),tt.names=[],tt.skips=[],tt.formatters={};function o(lt){let dt=0;for(let ht=0;ht<lt.length;ht++)dt=(dt<<5)-dt+lt.charCodeAt(ht),dt|=0;return tt.colors[Math.abs(dt)%tt.colors.length]}tt.selectColor=o;function tt(lt){let dt,ht=null,mt,ft;function pt(...yt){if(!pt.enabled)return;const gt=pt,bt=Number(new Date),xt=bt-(dt||bt);gt.diff=xt,gt.prev=dt,gt.curr=bt,dt=bt,yt[0]=tt.coerce(yt[0]),typeof yt[0]!="string"&&yt.unshift("%O");let vt=0;yt[0]=yt[0].replace(/%([a-zA-Z%])/g,(Ct,St)=>{if(Ct==="%%")return"%";vt++;const At=tt.formatters[St];if(typeof At=="function"){const kt=yt[vt];Ct=At.call(gt,kt),yt.splice(vt,1),vt--}return Ct}),tt.formatArgs.call(gt,yt),(gt.log||tt.log).apply(gt,yt)}return pt.namespace=lt,pt.useColors=tt.useColors(),pt.color=tt.selectColor(lt),pt.extend=rt,pt.destroy=tt.destroy,Object.defineProperty(pt,"enabled",{enumerable:!0,configurable:!1,get:()=>ht!==null?ht:(mt!==tt.namespaces&&(mt=tt.namespaces,ft=tt.enabled(lt)),ft),set:yt=>{ht=yt}}),typeof tt.init=="function"&&tt.init(pt),pt}function rt(lt,dt){const ht=tt(this.namespace+(typeof dt>"u"?":":dt)+lt);return ht.log=this.log,ht}function nt(lt){tt.save(lt),tt.namespaces=lt,tt.names=[],tt.skips=[];let dt;const ht=(typeof lt=="string"?lt:"").split(/[\s,]+/),mt=ht.length;for(dt=0;dt<mt;dt++)ht[dt]&&(lt=ht[dt].replace(/\*/g,".*?"),lt[0]==="-"?tt.skips.push(new RegExp("^"+lt.slice(1)+"$")):tt.names.push(new RegExp("^"+lt+"$")))}function ot(){const lt=[...tt.names.map(st),...tt.skips.map(st).map(dt=>"-"+dt)].join(",");return tt.enable(""),lt}function it(lt){if(lt[lt.length-1]==="*")return!0;let dt,ht;for(dt=0,ht=tt.skips.length;dt<ht;dt++)if(tt.skips[dt].test(lt))return!1;for(dt=0,ht=tt.names.length;dt<ht;dt++)if(tt.names[dt].test(lt))return!0;return!1}function st(lt){return lt.toString().substring(2,lt.toString().length-2).replace(/\.\*\?$/,"*")}function at(lt){return lt instanceof Error?lt.stack||lt.message:lt}function ct(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return tt.enable(tt.load()),tt}var common$1=setup$1;(function(et,o){var tt={env:{NODE_ENV:'"production"',VITE_WALLETCONNECT_PROJECT_ID:'"1d93edc21291f98e3bed6ff7617ff539"'},nextTick:"setImmediate",platform:'"browser"',version:'"v16.0.0"',browser:!0},rt={};o.formatArgs=ot,o.save=it,o.load=st,o.useColors=nt,o.storage=at(),o.destroy=(()=>{let lt=!1;return()=>{lt||(lt=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),o.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function nt(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let lt;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(lt=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(lt[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function ot(lt){if(lt[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+lt[0]+(this.useColors?"%c ":" ")+"+"+et.exports.humanize(this.diff),!this.useColors)return;const dt="color: "+this.color;lt.splice(1,0,dt,"color: inherit");let ht=0,mt=0;lt[0].replace(/%[a-zA-Z%]/g,ft=>{ft!=="%%"&&(ht++,ft==="%c"&&(mt=ht))}),lt.splice(mt,0,dt)}o.log=console.debug||console.log||(()=>{});function it(lt){try{lt?o.storage.setItem("debug",lt):o.storage.removeItem("debug")}catch{}}function st(){let lt;try{lt=o.storage.getItem("debug")}catch{}return!lt&&typeof tt<"u"&&"env"in tt&&(lt=rt.DEBUG),lt}function at(){try{return localStorage}catch{}}et.exports=common$1(o);const{formatters:ct}=et.exports;ct.j=function(lt){try{return JSON.stringify(lt)}catch(dt){return"[UnexpectedJSONParseError]: "+dt.message}}})(browser,browser.exports);var browserExports=browser.exports;const debug=getDefaultExportFromCjs(browserExports),APP_NAME="waku";let Logger$1=class _i{constructor(o){wt(this,"_info");wt(this,"_warn");wt(this,"_error");this._info=debug(_i.createDebugNamespace("info",o)),this._warn=debug(_i.createDebugNamespace("warn",o)),this._error=debug(_i.createDebugNamespace("error",o))}static createDebugNamespace(o,tt){return tt?`${APP_NAME}:${o}:${tt}`:`${APP_NAME}:${o}`}get info(){return this._info}get warn(){return this._warn}get error(){return this._error}log(o,...tt){const rt=this[o];rt(...tt)}};const log$o=new Logger$1("message:version-0"),OneMillion=BigInt(1e6),Version=0;class DecodedMessage{constructor(o,tt){wt(this,"pubsubTopic");wt(this,"proto");this.pubsubTopic=o,this.proto=tt}get ephemeral(){return!!this.proto.ephemeral}get payload(){return this.proto.payload}get contentTopic(){return this.proto.contentTopic}get _rawTimestamp(){return this.proto.timestamp}get timestamp(){try{if(this.proto.timestamp){const o=this.proto.timestamp/OneMillion;return new Date(Number(o))}return}catch{return}}get meta(){return this.proto.meta}get version(){return this.proto.version??0}get rateLimitProof(){return this.proto.rateLimitProof}}let Encoder$k=class{constructor(o,tt=!1,rt,nt){wt(this,"contentTopic");wt(this,"ephemeral");wt(this,"pubsubTopic");wt(this,"metaSetter");if(this.contentTopic=o,this.ephemeral=tt,this.pubsubTopic=rt,this.metaSetter=nt,!o||o==="")throw new Error("Content topic must be specified")}async toWire(o){return WakuMessage$4.encode(await this.toProtoObj(o))}async toProtoObj(o){const tt=o.timestamp??new Date,rt={payload:o.payload,version:Version,contentTopic:this.contentTopic,timestamp:BigInt(tt.valueOf())*OneMillion,meta:void 0,rateLimitProof:o.rateLimitProof,ephemeral:this.ephemeral};if(this.metaSetter){const nt=this.metaSetter(rt);return{...rt,meta:nt}}return rt}};function createEncoder({pubsubTopic:et,pubsubTopicShardInfo:o,contentTopic:tt,ephemeral:rt,metaSetter:nt}){return new Encoder$k(tt,rt,determinePubsubTopic(tt,et??o),nt)}let Decoder$k=class{constructor(o,tt){wt(this,"pubsubTopic");wt(this,"contentTopic");if(this.pubsubTopic=o,this.contentTopic=tt,!tt||tt==="")throw new Error("Content topic must be specified")}fromWireToProtoObj(o){const tt=WakuMessage$4.decode(o);return Promise.resolve({payload:tt.payload,contentTopic:tt.contentTopic,version:tt.version??void 0,timestamp:tt.timestamp??void 0,meta:tt.meta??void 0,rateLimitProof:tt.rateLimitProof??void 0,ephemeral:tt.ephemeral??!1})}async fromProtoObj(o,tt){return tt.version??Version!==0?(log$o.error("Failed to decode due to incorrect version, expected:",Version,", actual:",tt.version),Promise.resolve(void 0)):new DecodedMessage(o,tt)}};function createDecoder(et,o){return new Decoder$k(determinePubsubTopic(et,o),et)}function isAsyncIterable$8(et){return et[Symbol.asyncIterator]!=null}function all$2(et){if(isAsyncIterable$8(et))return(async()=>{const tt=[];for await(const rt of et)tt.push(rt);return tt})();const o=[];for(const tt of et)o.push(tt);return o}function alloc$5(et=0){return new Uint8Array(et)}function allocUnsafe$f(et=0){return new Uint8Array(et)}function asUint8Array$3(et){return et}function concat$4(et,o){o==null&&(o=et.reduce((nt,ot)=>nt+ot.length,0));const tt=allocUnsafe$f(o);let rt=0;for(const nt of et)tt.set(nt,rt),rt+=nt.length;return tt}function equals$f(et,o){if(et===o)return!0;if(et.byteLength!==o.byteLength)return!1;for(let tt=0;tt<et.byteLength;tt++)if(et[tt]!==o[tt])return!1;return!0}const symbol$1=Symbol.for("@achingbrain/uint8arraylist");function findBufAndOffset(et,o){if(o==null||o<0)throw new RangeError("index is out of bounds");let tt=0;for(const rt of et){const nt=tt+rt.byteLength;if(o<nt)return{buf:rt,index:o-tt};tt=nt}throw new RangeError("index is out of bounds")}function isUint8ArrayList(et){return!!(et!=null&&et[symbol$1])}var Zs;class Uint8ArrayList{constructor(...o){wt(this,"bufs");wt(this,"length");wt(this,Zs,!0);this.bufs=[],this.length=0,o.length>0&&this.appendAll(o)}*[(Zs=symbol$1,Symbol.iterator)](){yield*this.bufs}get byteLength(){return this.length}append(...o){this.appendAll(o)}appendAll(o){let tt=0;for(const rt of o)if(rt instanceof Uint8Array)tt+=rt.byteLength,this.bufs.push(rt);else if(isUint8ArrayList(rt))tt+=rt.byteLength,this.bufs.push(...rt.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=tt}prepend(...o){this.prependAll(o)}prependAll(o){let tt=0;for(const rt of o.reverse())if(rt instanceof Uint8Array)tt+=rt.byteLength,this.bufs.unshift(rt);else if(isUint8ArrayList(rt))tt+=rt.byteLength,this.bufs.unshift(...rt.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=tt}get(o){const tt=findBufAndOffset(this.bufs,o);return tt.buf[tt.index]}set(o,tt){const rt=findBufAndOffset(this.bufs,o);rt.buf[rt.index]=tt}write(o,tt=0){if(o instanceof Uint8Array)for(let rt=0;rt<o.length;rt++)this.set(tt+rt,o[rt]);else if(isUint8ArrayList(o))for(let rt=0;rt<o.length;rt++)this.set(tt+rt,o.get(rt));else throw new Error("Could not write value, must be an Uint8Array or a Uint8ArrayList")}consume(o){if(o=Math.trunc(o),!(Number.isNaN(o)||o<=0)){if(o===this.byteLength){this.bufs=[],this.length=0;return}for(;this.bufs.length>0;)if(o>=this.bufs[0].byteLength)o-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(o),this.length-=o;break}}}slice(o,tt){const{bufs:rt,length:nt}=this._subList(o,tt);return concat$4(rt,nt)}subarray(o,tt){const{bufs:rt,length:nt}=this._subList(o,tt);return rt.length===1?rt[0]:concat$4(rt,nt)}sublist(o,tt){const{bufs:rt,length:nt}=this._subList(o,tt),ot=new Uint8ArrayList;return ot.length=nt,ot.bufs=[...rt],ot}_subList(o,tt){if(o=o??0,tt=tt??this.length,o<0&&(o=this.length+o),tt<0&&(tt=this.length+tt),o<0||tt>this.length)throw new RangeError("index is out of bounds");if(o===tt)return{bufs:[],length:0};if(o===0&&tt===this.length)return{bufs:this.bufs,length:this.length};const rt=[];let nt=0;for(let ot=0;ot<this.bufs.length;ot++){const it=this.bufs[ot],st=nt,at=st+it.byteLength;if(nt=at,o>=at)continue;const ct=o>=st&&o<at,lt=tt>st&&tt<=at;if(ct&&lt){if(o===st&&tt===at){rt.push(it);break}const dt=o-st;rt.push(it.subarray(dt,dt+(tt-o)));break}if(ct){if(o===0){rt.push(it);continue}rt.push(it.subarray(o-st));continue}if(lt){if(tt===at){rt.push(it);break}rt.push(it.subarray(0,tt-st));break}rt.push(it)}return{bufs:rt,length:tt-o}}indexOf(o,tt=0){if(!isUint8ArrayList(o)&&!(o instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');const rt=o instanceof Uint8Array?o:o.subarray();if(tt=Number(tt??0),isNaN(tt)&&(tt=0),tt<0&&(tt=this.length+tt),tt<0&&(tt=0),o.length===0)return tt>this.length?this.length:tt;const nt=rt.byteLength;if(nt===0)throw new TypeError("search must be at least 1 byte long");const ot=256,it=new Int32Array(ot);for(let dt=0;dt<ot;dt++)it[dt]=-1;for(let dt=0;dt<nt;dt++)it[rt[dt]]=dt;const st=it,at=this.byteLength-rt.byteLength,ct=rt.byteLength-1;let lt;for(let dt=tt;dt<=at;dt+=lt){lt=0;for(let ht=ct;ht>=0;ht--){const mt=this.get(dt+ht);if(rt[ht]!==mt){lt=Math.max(1,ht-st[mt]);break}}if(lt===0)return dt}return-1}getInt8(o){const tt=this.subarray(o,o+1);return new DataView(tt.buffer,tt.byteOffset,tt.byteLength).getInt8(0)}setInt8(o,tt){const rt=allocUnsafe$f(1);new DataView(rt.buffer,rt.byteOffset,rt.byteLength).setInt8(0,tt),this.write(rt,o)}getInt16(o,tt){const rt=this.subarray(o,o+2);return new DataView(rt.buffer,rt.byteOffset,rt.byteLength).getInt16(0,tt)}setInt16(o,tt,rt){const nt=alloc$5(2);new DataView(nt.buffer,nt.byteOffset,nt.byteLength).setInt16(0,tt,rt),this.write(nt,o)}getInt32(o,tt){const rt=this.subarray(o,o+4);return new DataView(rt.buffer,rt.byteOffset,rt.byteLength).getInt32(0,tt)}setInt32(o,tt,rt){const nt=alloc$5(4);new DataView(nt.buffer,nt.byteOffset,nt.byteLength).setInt32(0,tt,rt),this.write(nt,o)}getBigInt64(o,tt){const rt=this.subarray(o,o+8);return new DataView(rt.buffer,rt.byteOffset,rt.byteLength).getBigInt64(0,tt)}setBigInt64(o,tt,rt){const nt=alloc$5(8);new DataView(nt.buffer,nt.byteOffset,nt.byteLength).setBigInt64(0,tt,rt),this.write(nt,o)}getUint8(o){const tt=this.subarray(o,o+1);return new DataView(tt.buffer,tt.byteOffset,tt.byteLength).getUint8(0)}setUint8(o,tt){const rt=allocUnsafe$f(1);new DataView(rt.buffer,rt.byteOffset,rt.byteLength).setUint8(0,tt),this.write(rt,o)}getUint16(o,tt){const rt=this.subarray(o,o+2);return new DataView(rt.buffer,rt.byteOffset,rt.byteLength).getUint16(0,tt)}setUint16(o,tt,rt){const nt=alloc$5(2);new DataView(nt.buffer,nt.byteOffset,nt.byteLength).setUint16(0,tt,rt),this.write(nt,o)}getUint32(o,tt){const rt=this.subarray(o,o+4);return new DataView(rt.buffer,rt.byteOffset,rt.byteLength).getUint32(0,tt)}setUint32(o,tt,rt){const nt=alloc$5(4);new DataView(nt.buffer,nt.byteOffset,nt.byteLength).setUint32(0,tt,rt),this.write(nt,o)}getBigUint64(o,tt){const rt=this.subarray(o,o+8);return new DataView(rt.buffer,rt.byteOffset,rt.byteLength).getBigUint64(0,tt)}setBigUint64(o,tt,rt){const nt=alloc$5(8);new DataView(nt.buffer,nt.byteOffset,nt.byteLength).setBigUint64(0,tt,rt),this.write(nt,o)}getFloat32(o,tt){const rt=this.subarray(o,o+4);return new DataView(rt.buffer,rt.byteOffset,rt.byteLength).getFloat32(0,tt)}setFloat32(o,tt,rt){const nt=alloc$5(4);new DataView(nt.buffer,nt.byteOffset,nt.byteLength).setFloat32(0,tt,rt),this.write(nt,o)}getFloat64(o,tt){const rt=this.subarray(o,o+8);return new DataView(rt.buffer,rt.byteOffset,rt.byteLength).getFloat64(0,tt)}setFloat64(o,tt,rt){const nt=alloc$5(8);new DataView(nt.buffer,nt.byteOffset,nt.byteLength).setFloat64(0,tt,rt),this.write(nt,o)}equals(o){if(o==null||!(o instanceof Uint8ArrayList)||o.bufs.length!==this.bufs.length)return!1;for(let tt=0;tt<this.bufs.length;tt++)if(!equals$f(this.bufs[tt],o.bufs[tt]))return!1;return!0}static fromUint8Arrays(o,tt){const rt=new Uint8ArrayList;return rt.bufs=o,tt==null&&(tt=o.reduce((nt,ot)=>nt+ot.byteLength,0)),rt.length=tt,rt}}function allocUnsafe$e(et=0){return new Uint8Array(et)}function isAsyncIterable$7(et){return et[Symbol.asyncIterator]!=null}const defaultEncoder=et=>{const o=encodingLength$6(et),tt=allocUnsafe$e(o);return encode$P(et,tt),defaultEncoder.bytes=o,tt};defaultEncoder.bytes=0;function encode$K(et,o){o=o??{};const tt=o.lengthEncoder??defaultEncoder;function*rt(nt){const ot=tt(nt.byteLength);ot instanceof Uint8Array?yield ot:yield*ot,nt instanceof Uint8Array?yield nt:yield*nt}return isAsyncIterable$7(et)?async function*(){for await(const nt of et)yield*rt(nt)}():function*(){for(const nt of et)yield*rt(nt)}()}encode$K.single=(et,o)=>{o=o??{};const tt=o.lengthEncoder??defaultEncoder;return new Uint8ArrayList(tt(et.byteLength),et)};let InvalidMessageLengthError$1=class extends Error{constructor(){super(...arguments);wt(this,"name","InvalidMessageLengthError");wt(this,"code","ERR_INVALID_MSG_LENGTH")}},InvalidDataLengthError$1=class extends Error{constructor(){super(...arguments);wt(this,"name","InvalidDataLengthError");wt(this,"code","ERR_MSG_DATA_TOO_LONG")}},InvalidDataLengthLengthError$1=class extends Error{constructor(){super(...arguments);wt(this,"name","InvalidDataLengthLengthError");wt(this,"code","ERR_MSG_LENGTH_TOO_LONG")}},UnexpectedEOFError$1=class extends Error{constructor(){super(...arguments);wt(this,"name","UnexpectedEOFError");wt(this,"code","ERR_UNEXPECTED_EOF")}};const MAX_LENGTH_LENGTH=8,MAX_DATA_LENGTH=1024*1024*4;var ReadMode;(function(et){et[et.LENGTH=0]="LENGTH",et[et.DATA=1]="DATA"})(ReadMode||(ReadMode={}));const defaultDecoder=et=>{const o=decode$Z(et);return defaultDecoder.bytes=encodingLength$6(o),o};defaultDecoder.bytes=0;function decode$U(et,o){const tt=new Uint8ArrayList;let rt=ReadMode.LENGTH,nt=-1;const ot=(o==null?void 0:o.lengthDecoder)??defaultDecoder,it=(o==null?void 0:o.maxLengthLength)??MAX_LENGTH_LENGTH,st=(o==null?void 0:o.maxDataLength)??MAX_DATA_LENGTH;function*at(){for(;tt.byteLength>0;){if(rt===ReadMode.LENGTH)try{if(nt=ot(tt),nt<0)throw new InvalidMessageLengthError$1("Invalid message length");if(nt>st)throw new InvalidDataLengthError$1("Message length too long");const ct=ot.bytes;tt.consume(ct),(o==null?void 0:o.onLength)!=null&&o.onLength(nt),rt=ReadMode.DATA}catch(ct){if(ct instanceof RangeError){if(tt.byteLength>it)throw new InvalidDataLengthLengthError$1("Message length length too long");break}throw ct}if(rt===ReadMode.DATA){if(tt.byteLength<nt)break;const ct=tt.sublist(0,nt);tt.consume(nt),(o==null?void 0:o.onData)!=null&&o.onData(ct),yield ct,rt=ReadMode.LENGTH}}}return isAsyncIterable$7(et)?async function*(){for await(const ct of et)tt.append(ct),yield*at();if(tt.byteLength>0)throw new UnexpectedEOFError$1("Unexpected end of input")}():function*(){for(const ct of et)tt.append(ct),yield*at();if(tt.byteLength>0)throw new UnexpectedEOFError$1("Unexpected end of input")}()}decode$U.fromReader=(et,o)=>{let tt=1;const rt=async function*(){for(;;)try{const{done:ot,value:it}=await et.next(tt);if(ot===!0)return;it!=null&&(yield it)}catch(ot){if(ot.code==="ERR_UNDER_READ")return{done:!0,value:null};throw ot}finally{tt=1}}();return decode$U(rt,{...o??{},onLength:ot=>{tt=ot}})};function pDefer(){const et={};return et.promise=new Promise((o,tt)=>{et.resolve=o,et.reject=tt}),et}class FixedFIFO{constructor(o){wt(this,"buffer");wt(this,"mask");wt(this,"top");wt(this,"btm");wt(this,"next");if(!(o>0)||o-1&o)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(o),this.mask=o-1,this.top=0,this.btm=0,this.next=null}push(o){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=o,this.top=this.top+1&this.mask,!0)}shift(){const o=this.buffer[this.btm];if(o!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,o}isEmpty(){return this.buffer[this.btm]===void 0}}class FIFO{constructor(o={}){wt(this,"size");wt(this,"hwm");wt(this,"head");wt(this,"tail");this.hwm=o.splitLimit??16,this.head=new FixedFIFO(this.hwm),this.tail=this.head,this.size=0}calculateSize(o){return(o==null?void 0:o.byteLength)!=null?o.byteLength:1}push(o){if((o==null?void 0:o.value)!=null&&(this.size+=this.calculateSize(o.value)),!this.head.push(o)){const tt=this.head;this.head=tt.next=new FixedFIFO(2*this.head.buffer.length),this.head.push(o)}}shift(){let o=this.tail.shift();if(o===void 0&&this.tail.next!=null){const tt=this.tail.next;this.tail.next=null,this.tail=tt,o=this.tail.shift()}return(o==null?void 0:o.value)!=null&&(this.size-=this.calculateSize(o.value)),o}isEmpty(){return this.head.isEmpty()}}let AbortError$a=class extends Error{constructor(tt,rt){super(tt??"The operation was aborted");wt(this,"type");wt(this,"code");this.type="aborted",this.code=rt??"ABORT_ERR"}};function pushable(et={}){return _pushable(tt=>{const rt=tt.shift();if(rt==null)return{done:!0};if(rt.error!=null)throw rt.error;return{done:rt.done===!0,value:rt.value}},et)}function _pushable(et,o){o=o??{};let tt=o.onEnd,rt=new FIFO,nt,ot,it,st=pDefer();const at=async()=>{try{return rt.isEmpty()?it?{done:!0}:await new Promise((yt,gt)=>{ot=bt=>{ot=null,rt.push(bt);try{yt(et(rt))}catch(xt){gt(xt)}return nt}}):et(rt)}finally{rt.isEmpty()&&queueMicrotask(()=>{st.resolve(),st=pDefer()})}},ct=yt=>ot!=null?ot(yt):(rt.push(yt),nt),lt=yt=>(rt=new FIFO,ot!=null?ot({error:yt}):(rt.push({error:yt}),nt)),dt=yt=>{if(it)return nt;if((o==null?void 0:o.objectMode)!==!0&&(yt==null?void 0:yt.byteLength)==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return ct({done:!1,value:yt})},ht=yt=>it?nt:(it=!0,yt!=null?lt(yt):ct({done:!0})),mt=()=>(rt=new FIFO,ht(),{done:!0}),ft=yt=>(ht(yt),{done:!0});if(nt={[Symbol.asyncIterator](){return this},next:at,return:mt,throw:ft,push:dt,end:ht,get readableLength(){return rt.size},onEmpty:async yt=>{const gt=yt==null?void 0:yt.signal;if(gt==null||gt.throwIfAborted(),rt.isEmpty())return;let bt,xt;gt!=null&&(bt=new Promise((vt,Et)=>{xt=()=>{Et(new AbortError$a)},gt.addEventListener("abort",xt)}));try{await Promise.race([st.promise,bt])}finally{xt!=null&&gt!=null&&(gt==null||gt.removeEventListener("abort",xt))}}},tt==null)return nt;const pt=nt;return nt={[Symbol.asyncIterator](){return this},next(){return pt.next()},throw(yt){return pt.throw(yt),tt!=null&&(tt(yt),tt=void 0),{done:!0}},return(){return pt.return(),tt!=null&&(tt(),tt=void 0),{done:!0}},push:dt,end(yt){return pt.end(yt),tt!=null&&(tt(yt),tt=void 0),nt},get readableLength(){return pt.readableLength},onEmpty:yt=>pt.onEmpty(yt)},nt}function isAsyncIterable$6(et){return et[Symbol.asyncIterator]!=null}function merge$2(...et){const o=[];for(const tt of et)isAsyncIterable$6(tt)||o.push(tt);return o.length===et.length?function*(){for(const tt of o)yield*tt}():async function*(){const tt=pushable({objectMode:!0});Promise.resolve().then(async()=>{try{await Promise.all(et.map(async rt=>{for await(const nt of rt)tt.push(nt)})),tt.end()}catch(rt){tt.end(rt)}}),yield*tt}()}function pipe(et,...o){if(et==null)throw new Error("Empty pipeline");if(isDuplex(et)){const rt=et;et=()=>rt.source}else if(isIterable(et)||isAsyncIterable$5(et)){const rt=et;et=()=>rt}const tt=[et,...o];if(tt.length>1&&isDuplex(tt[tt.length-1])&&(tt[tt.length-1]=tt[tt.length-1].sink),tt.length>2)for(let rt=1;rt<tt.length-1;rt++)isDuplex(tt[rt])&&(tt[rt]=duplexPipelineFn(tt[rt]));return rawPipe(...tt)}const rawPipe=(...et)=>{let o;for(;et.length>0;)o=et.shift()(o);return o},isAsyncIterable$5=et=>(et==null?void 0:et[Symbol.asyncIterator])!=null,isIterable=et=>(et==null?void 0:et[Symbol.iterator])!=null,isDuplex=et=>et==null?!1:et.sink!=null&&et.source!=null,duplexPipelineFn=et=>o=>{const tt=et.sink(o);if((tt==null?void 0:tt.then)!=null){const rt=pushable({objectMode:!0});tt.then(()=>{rt.end()},it=>{rt.end(it)});let nt;const ot=et.source;if(isAsyncIterable$5(ot))nt=async function*(){yield*ot,rt.end()};else if(isIterable(ot))nt=function*(){yield*ot,rt.end()};else throw new Error("Unknown duplex source type - must be Iterable or AsyncIterable");return merge$2(rt,nt())}return et.source};async function sortPeersByLatency(et,o){return o.length===0?[]:(await Promise.all(o.map(async nt=>{try{const ot=(await et.get(nt.id)).metadata.get("ping");if(!ot)return{peer:nt,ping:1/0};const it=Number(bytesToUtf8(ot));return{peer:nt,ping:it}}catch{return{peer:nt,ping:1/0}}}))).filter(nt=>nt!==null).sort((nt,ot)=>nt.ping-ot.ping).map(nt=>nt.peer)}async function getPeersForProtocol(et,o){const tt=[];return await et.forEach(rt=>{for(let nt=0;nt<o.length;nt++)if(rt.protocols.includes(o[nt])){tt.push(rt);break}}),tt}function filterPeersByDiscovery(et,o,tt){let rt=et.filter(it=>it.tags.has(Tags.BOOTSTRAP)).slice(0,tt);o>0&&o<rt.length&&(rt=rt.slice(0,o));const nt=et.filter(it=>!it.tags.has(Tags.BOOTSTRAP));if(o===0)return[...rt,...nt];const ot=[...rt];for(;ot.length<o&&nt.length>0;){const it=Math.floor(Math.random()*nt.length),st=nt.splice(it,1)[0];ot.push(st)}return ot}function selectOpenConnection(et){return et.filter(o=>o.status==="open").sort((o,tt)=>tt.timeline.open-o.timeline.open).at(0)}const STREAM_LOCK_KEY="consumed";class StreamManager{constructor(o,tt,rt){wt(this,"multicodec");wt(this,"getConnections");wt(this,"addEventListener");wt(this,"log");wt(this,"ongoingCreation",new Set);wt(this,"streamPool",new Map);wt(this,"handlePeerUpdateStreamPool",o=>{const{peer:tt}=o.detail;!tt.protocols.includes(this.multicodec)||this.getOpenStreamForCodec(tt.id)||this.scheduleNewStream(tt)});this.multicodec=o,this.getConnections=tt,this.addEventListener=rt,this.log=new Logger$1(`stream-manager:${o}`),this.addEventListener("peer:update",this.handlePeerUpdateStreamPool)}async getStream(o){const tt=o.id.toString(),rt=this.streamPool.get(tt);rt&&(this.streamPool.delete(tt),await rt);let nt=this.getOpenStreamForCodec(o.id);return nt?(this.log.info(`Found existing stream peerId=${o.id.toString()} multicodec=${this.multicodec}`),this.lockStream(o.id.toString(),nt),nt):(nt=await this.createStream(o),this.lockStream(o.id.toString(),nt),nt)}async createStream(o,tt=0){const rt=this.getConnections(o.id),nt=selectOpenConnection(rt);if(!nt)throw new Error(`Failed to get a connection to the peer peerId=${o.id.toString()} multicodec=${this.multicodec}`);let ot,it;for(let st=0;st<tt+1;st++)try{this.log.info(`Attempting to create a stream for peerId=${o.id.toString()} multicodec=${this.multicodec}`),it=await nt.newStream(this.multicodec),this.log.info(`Created stream for peerId=${o.id.toString()} multicodec=${this.multicodec}`);break}catch(at){ot=at}if(!it)throw new Error(`Failed to create a new stream for ${o.id.toString()} -- `+ot);return it}async createStreamWithLock(o){const tt=o.id.toString();if(this.ongoingCreation.has(tt)){this.log.info(`Skipping creation of a stream due to lock for peerId=${tt} multicodec=${this.multicodec}`);return}try{this.ongoingCreation.add(tt),await this.createStream(o)}catch(rt){this.log.error("Failed to createStreamWithLock:",rt)}finally{this.ongoingCreation.delete(tt)}}scheduleNewStream(o){this.log.info(`Scheduling creation of a stream for peerId=${o.id.toString()} multicodec=${this.multicodec}`),this.streamPool.has(o.id.toString())&&this.streamPool.delete(o.id.toString()),this.streamPool.set(o.id.toString(),this.createStreamWithLock(o))}getOpenStreamForCodec(o){const tt=this.getConnections(o),rt=selectOpenConnection(tt);if(!rt)return;const nt=rt.streams.find(it=>it.protocol===this.multicodec);if(!(!nt||["done","closed","closing"].includes(nt.writeStatus||"")||this.isStreamLocked(nt)))return nt}lockStream(o,tt){this.log.info(`Locking stream for peerId:${o} streamId:${tt.id}`),tt.metadata[STREAM_LOCK_KEY]=!0}isStreamLocked(o){return!!o.metadata[STREAM_LOCK_KEY]}}class BaseProtocol{constructor(o,tt,rt,nt){wt(this,"multicodec");wt(this,"components");wt(this,"log");wt(this,"pubsubTopics");wt(this,"addLibp2pEventListener");wt(this,"removeLibp2pEventListener");wt(this,"streamManager");this.multicodec=o,this.components=tt,this.log=rt,this.pubsubTopics=nt,this.addLibp2pEventListener=tt.events.addEventListener.bind(tt.events),this.removeLibp2pEventListener=tt.events.removeEventListener.bind(tt.events),this.streamManager=new StreamManager(o,tt.connectionManager.getConnections.bind(tt.connectionManager),this.addLibp2pEventListener)}async getStream(o){return this.streamManager.getStream(o)}async allPeers(){return getPeersForProtocol(this.components.peerStore,[this.multicodec])}async connectedPeers(){return(await this.allPeers()).filter(tt=>this.components.connectionManager.getConnections(tt.id).length>0)}async getPeers({numPeers:o,maxBootstrapPeers:tt,peerIdStr:rt}={maxBootstrapPeers:0,numPeers:0}){if(rt){const st=(await this.connectedPeers()).find(at=>at.id.toString()===rt);return st?[st]:(this.log.warn(`Passed node to use for ${this.multicodec} not found: ${rt}. Attempting to use random peers.`),this.getPeers({numPeers:o,maxBootstrapPeers:tt}))}const nt=await this.connectedPeers(),ot=filterPeersByDiscovery(nt,o,tt),it=await sortPeersByLatency(this.components.peerStore,ot);return it.length===0&&this.log.warn("No peers found. Ensure you have a connection to the network."),it.length<o&&this.log.warn(`Only ${it.length} peers found. Requested ${o}.`),it}}let getRandomValues$1;const rnds8$1=new Uint8Array(16);function rng$1(){if(!getRandomValues$1&&(getRandomValues$1=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!getRandomValues$1))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return getRandomValues$1(rnds8$1)}const byteToHex$1=[];for(let et=0;et<256;++et)byteToHex$1.push((et+256).toString(16).slice(1));function unsafeStringify$1(et,o=0){return byteToHex$1[et[o+0]]+byteToHex$1[et[o+1]]+byteToHex$1[et[o+2]]+byteToHex$1[et[o+3]]+"-"+byteToHex$1[et[o+4]]+byteToHex$1[et[o+5]]+"-"+byteToHex$1[et[o+6]]+byteToHex$1[et[o+7]]+"-"+byteToHex$1[et[o+8]]+byteToHex$1[et[o+9]]+"-"+byteToHex$1[et[o+10]]+byteToHex$1[et[o+11]]+byteToHex$1[et[o+12]]+byteToHex$1[et[o+13]]+byteToHex$1[et[o+14]]+byteToHex$1[et[o+15]]}const randomUUID$1=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),native$1={randomUUID:randomUUID$1};function v4$2(et,o,tt){if(native$1.randomUUID&&!o&&!et)return native$1.randomUUID();et=et||{};const rt=et.random||(et.rng||rng$1)();return rt[6]=rt[6]&15|64,rt[8]=rt[8]&63|128,unsafeStringify$1(rt)}class FilterPushRpc{constructor(o){wt(this,"proto");this.proto=o}static decode(o){const tt=MessagePush.decode(o);return new FilterPushRpc(tt)}encode(){return MessagePush.encode(this.proto)}get wakuMessage(){return this.proto.wakuMessage}get pubsubTopic(){return this.proto.pubsubTopic}}class FilterSubscribeRpc{constructor(o){wt(this,"proto");this.proto=o}static createSubscribeRequest(o,tt){return new FilterSubscribeRpc({requestId:v4$2(),filterSubscribeType:FilterSubscribeRequest.FilterSubscribeType.SUBSCRIBE,pubsubTopic:o,contentTopics:tt})}static createUnsubscribeRequest(o,tt){return new FilterSubscribeRpc({requestId:v4$2(),filterSubscribeType:FilterSubscribeRequest.FilterSubscribeType.UNSUBSCRIBE,pubsubTopic:o,contentTopics:tt})}static createUnsubscribeAllRequest(o){return new FilterSubscribeRpc({requestId:v4$2(),filterSubscribeType:FilterSubscribeRequest.FilterSubscribeType.UNSUBSCRIBE_ALL,pubsubTopic:o,contentTopics:[]})}static createSubscriberPingRequest(){return new FilterSubscribeRpc({requestId:v4$2(),filterSubscribeType:FilterSubscribeRequest.FilterSubscribeType.SUBSCRIBER_PING,pubsubTopic:"",contentTopics:[]})}static decode(o){const tt=FilterSubscribeRequest.decode(o);return new FilterSubscribeRpc(tt)}encode(){return FilterSubscribeRequest.encode(this.proto)}get filterSubscribeType(){return this.proto.filterSubscribeType}get requestId(){return this.proto.requestId}get pubsubTopic(){return this.proto.pubsubTopic}get contentTopics(){return this.proto.contentTopics}}class FilterSubscribeResponse{constructor(o){wt(this,"proto");this.proto=o}static decode(o){const tt=FilterSubscribeResponse$1.decode(o);return new FilterSubscribeResponse(tt)}encode(){return FilterSubscribeResponse$1.encode(this.proto)}get statusCode(){return this.proto.statusCode}get statusDesc(){return this.proto.statusDesc}get requestId(){return this.proto.requestId}}const log$n=new Logger$1("filter:v2"),FilterCodecs={SUBSCRIBE:"/vac/waku/filter-subscribe/2.0.0-beta1",PUSH:"/vac/waku/filter-push/2.0.0-beta1"};class FilterCore extends BaseProtocol{constructor(tt,rt,nt){super(FilterCodecs.SUBSCRIBE,nt.components,log$n,rt);wt(this,"handleIncomingMessage");wt(this,"pubsubTopics");this.handleIncomingMessage=tt,this.pubsubTopics=rt,nt.handle(FilterCodecs.PUSH,this.onRequest.bind(this),{maxInboundStreams:100}).catch(ot=>{log$n.error("Failed to register ",FilterCodecs.PUSH,ot)})}async subscribe(tt,rt,nt){const ot=await this.getStream(rt),it=FilterSubscribeRpc.createSubscribeRequest(tt,nt);let st;try{st=await pipe([it.encode()],encode$K,ot,decode$U,async dt=>await all$2(dt))}catch(dt){return log$n.error("Failed to send subscribe request",dt),{success:null,failure:{error:ProtocolError$1.GENERIC_FAIL,peerId:rt.id}}}const{statusCode:at,requestId:ct,statusDesc:lt}=FilterSubscribeResponse.decode(st[0].slice());return at<200||at>=300?(log$n.error(`Filter subscribe request ${ct} failed with status code ${at}: ${lt}`),{failure:{error:ProtocolError$1.REMOTE_PEER_REJECTED,peerId:rt.id},success:null}):{failure:null,success:rt.id}}async unsubscribe(tt,rt,nt){let ot;try{ot=await this.getStream(rt)}catch(st){return log$n.error(`Failed to get a stream for remote peer${rt.id.toString()}`,st),{success:null,failure:{error:ProtocolError$1.NO_STREAM_AVAILABLE,peerId:rt.id}}}const it=FilterSubscribeRpc.createUnsubscribeRequest(tt,nt);try{await pipe([it.encode()],encode$K,ot.sink)}catch(st){return log$n.error("Failed to send unsubscribe request",st),{success:null,failure:{error:ProtocolError$1.GENERIC_FAIL,peerId:rt.id}}}return{success:rt.id,failure:null}}async unsubscribeAll(tt,rt){const nt=await this.getStream(rt),ot=FilterSubscribeRpc.createUnsubscribeAllRequest(tt),it=await pipe([ot.encode()],encode$K,nt,decode$U,async lt=>await all$2(lt));if(!it||!it.length)return{failure:{error:ProtocolError$1.NO_RESPONSE,peerId:rt.id},success:null};const{statusCode:st,requestId:at,statusDesc:ct}=FilterSubscribeResponse.decode(it[0].slice());return st<200||st>=300?(log$n.error(`Filter unsubscribe all request ${at} failed with status code ${st}: ${ct}`),{failure:{error:ProtocolError$1.REMOTE_PEER_REJECTED,peerId:rt.id},success:null}):{failure:null,success:rt.id}}async ping(tt){let rt;try{rt=await this.getStream(tt)}catch(ct){return log$n.error(`Failed to get a stream for remote peer${tt.id.toString()}`,ct),{success:null,failure:{error:ProtocolError$1.NO_STREAM_AVAILABLE,peerId:tt.id}}}const nt=FilterSubscribeRpc.createSubscriberPingRequest();let ot;try{ot=await pipe([nt.encode()],encode$K,rt,decode$U,async ct=>await all$2(ct))}catch(ct){return log$n.error("Failed to send ping request",ct),{success:null,failure:{error:ProtocolError$1.GENERIC_FAIL,peerId:tt.id}}}if(!ot||!ot.length)return{success:null,failure:{error:ProtocolError$1.NO_RESPONSE,peerId:tt.id}};const{statusCode:it,requestId:st,statusDesc:at}=FilterSubscribeResponse.decode(ot[0].slice());return it<200||it>=300?(log$n.error(`Filter ping request ${st} failed with status code ${it}: ${at}`),{success:null,failure:{error:ProtocolError$1.REMOTE_PEER_REJECTED,peerId:tt.id}}):{success:tt.id,failure:null}}onRequest(tt){const{connection:rt,stream:nt}=tt,{remotePeer:ot}=rt;log$n.info(`Received message from ${ot.toString()}`);try{pipe(nt,decode$U,async it=>{for await(const st of it){const at=FilterPushRpc.decode(st.slice()),{pubsubTopic:ct,wakuMessage:lt}=at;if(!lt){log$n.error("Received empty message");return}if(!ct){log$n.error("Pubsub topic missing from push message");return}await this.handleIncomingMessage(ct,lt,rt.remotePeer.toString())}}).then(()=>{log$n.info("Receiving pipe closed.")},async it=>{log$n.error(`Error with receiving pipe on peer:${rt.remotePeer.toString()} -- stream:${nt.id} -- protocol:${nt.protocol}: `,it)})}catch(it){log$n.error("Error decoding message",it)}}}class PushRpc{constructor(o){wt(this,"proto");this.proto=o}static createRequest(o,tt){return new PushRpc({requestId:v4$2(),request:{message:o,pubsubTopic:tt},response:void 0})}static decode(o){const tt=PushRpc$1.decode(o);return new PushRpc(tt)}encode(){return PushRpc$1.encode(this.proto)}get query(){return this.proto.request}get response(){return this.proto.response}}const RLN_GENERATION_PREFIX_ERROR="could not generate rln-v2 proof",isRLNResponseError=et=>et?et.includes(RLN_GENERATION_PREFIX_ERROR):!1,matchRLNErrorMessage=et=>{const o={[ProtocolError$1.RLN_IDENTITY_MISSING]:ProtocolError$1.RLN_IDENTITY_MISSING,[ProtocolError$1.RLN_MEMBERSHIP_INDEX]:ProtocolError$1.RLN_MEMBERSHIP_INDEX,[ProtocolError$1.RLN_LIMIT_MISSING]:ProtocolError$1.RLN_LIMIT_MISSING},tt=et.toLowerCase();for(const rt in o)if(tt.includes(rt.toLowerCase()))return o[rt];return ProtocolError$1.RLN_PROOF_GENERATION},log$m=new Logger$1("light-push"),LightPushCodec="/vac/waku/lightpush/2.0.0-beta1";class LightPushCore extends BaseProtocol{constructor(tt,rt){super(LightPushCodec,rt.components,log$m,tt);wt(this,"pubsubTopics");this.pubsubTopics=tt}async preparePushMessage(tt,rt){try{if(!rt.payload||rt.payload.length===0)return log$m.error("Failed to send waku light push: payload is empty"),{query:null,error:ProtocolError$1.EMPTY_PAYLOAD};if(!await isMessageSizeUnderCap(tt,rt))return log$m.error("Failed to send waku light push: message is bigger than 1MB"),{query:null,error:ProtocolError$1.SIZE_TOO_BIG};const nt=await tt.toProtoObj(rt);return nt?{query:PushRpc.createRequest(nt,tt.pubsubTopic),error:null}:(log$m.error("Failed to encode to protoMessage, aborting push"),{query:null,error:ProtocolError$1.ENCODE_FAILED})}catch(nt){return log$m.error("Failed to prepare push message",nt),{query:null,error:ProtocolError$1.GENERIC_FAIL}}}async send(tt,rt,nt){const{query:ot,error:it}=await this.preparePushMessage(tt,rt);if(it||!ot)return{success:null,failure:{error:it,peerId:nt.id}};let st;try{st=await this.getStream(nt)}catch(dt){return log$m.error("Failed to get stream",dt),{success:null,failure:{error:ProtocolError$1.NO_STREAM_AVAILABLE,peerId:nt.id}}}let at;try{at=await pipe([ot.encode()],encode$K,st,decode$U,async dt=>await all$2(dt))}catch(dt){return log$m.error("Failed to send waku light push request",dt),{success:null,failure:{error:ProtocolError$1.GENERIC_FAIL,peerId:nt.id}}}const ct=new Uint8ArrayList;at.forEach(dt=>{ct.append(dt)});let lt;try{lt=PushRpc.decode(ct).response}catch(dt){return log$m.error("Failed to decode push reply",dt),{success:null,failure:{error:ProtocolError$1.DECODE_FAILED,peerId:nt.id}}}if(!lt)return log$m.error("Remote peer fault: No response in PushRPC"),{success:null,failure:{error:ProtocolError$1.NO_RESPONSE,peerId:nt.id}};if(isRLNResponseError(lt.info)){const dt=matchRLNErrorMessage(lt.info);return log$m.error("Remote peer rejected the message: ",dt),{success:null,failure:{error:dt,peerId:nt.id}}}return lt.isSuccess?{success:nt.id,failure:null}:(log$m.error("Remote peer rejected the message: ",lt.info),{success:null,failure:{error:ProtocolError$1.REMOTE_PEER_REJECTED,peerId:nt.id}})}}const EmptyMessage={payload:new Uint8Array,contentTopic:"",version:void 0,timestamp:void 0,meta:void 0,rateLimitProof:void 0,ephemeral:void 0};function toProtoMessage(et){return{...EmptyMessage,...et}}const DEFAULT_PAGE_SIZE=20,MAX_PAGE_SIZE=100,ONE_MILLION=1e6;class StoreQueryRequest{constructor(o){wt(this,"proto");this.proto=o}static create(o){const tt=new StoreQueryRequest({...o,requestId:v4$2(),timeStart:o.timeStart?BigInt(o.timeStart.getTime()*ONE_MILLION):void 0,timeEnd:o.timeEnd?BigInt(o.timeEnd.getTime()*ONE_MILLION):void 0,messageHashes:o.messageHashes||[],paginationLimit:o.paginationLimit?BigInt(o.paginationLimit):void 0});if(o.pubsubTopic&&!o.contentTopics||!o.pubsubTopic&&o.contentTopics)throw new Error("Both pubsubTopic and contentTopics must be set or unset");if(o.messageHashes&&(o.pubsubTopic||o.contentTopics||o.timeStart||o.timeEnd))throw new Error("Message hash lookup queries cannot include content filter criteria");return tt}static decode(o){const tt=StoreQueryRequest$1.decode(o);return new StoreQueryRequest(tt)}encode(){return StoreQueryRequest$1.encode(this.proto)}}class StoreQueryResponse{constructor(o){wt(this,"proto");this.proto=o}static decode(o){const tt=StoreQueryResponse$1.decode(o);return new StoreQueryResponse(tt)}encode(){return StoreQueryResponse$1.encode(this.proto)}get statusCode(){return this.proto.statusCode}get statusDesc(){return this.proto.statusDesc}get messages(){return this.proto.messages}get paginationCursor(){return this.proto.paginationCursor}}const log$l=new Logger$1("store"),StoreCodec="/vac/waku/store-query/3.0.0";class StoreCore extends BaseProtocol{constructor(tt,rt){super(StoreCodec,rt.components,log$l,tt);wt(this,"pubsubTopics");this.pubsubTopics=tt}async*queryPerPage(tt,rt,nt){if(tt.contentTopics.toString()!==Array.from(rt.keys()).toString())throw new Error("Internal error, the decoders should match the query's content topics");let ot=tt.paginationCursor;for(;;){const it=StoreQueryRequest.create({...tt,paginationCursor:ot});let st;try{st=await this.getStream(nt)}catch(ht){log$l.error("Failed to get stream",ht);break}const at=await pipe([it.encode()],encode$K,st,decode$U,async ht=>await all$2(ht)),ct=new Uint8ArrayList;at.forEach(ht=>{ct.append(ht)});const lt=StoreQueryResponse.decode(ct);if(!lt.statusCode||lt.statusCode>=300){const ht=`Store query failed with status code: ${lt.statusCode}, description: ${lt.statusDesc}`;throw log$l.error(ht),new Error(ht)}if(!lt.messages||!lt.messages.length){log$l.warn("Stopping pagination due to empty messages in response");break}if(log$l.info(`${lt.messages.length} messages retrieved from store`),yield lt.messages.map(ht=>{if(!ht.message)return Promise.resolve(void 0);const mt=ht.message.contentTopic;if(mt){const ft=rt.get(mt);if(ft)return ft.fromProtoObj(ht.pubsubTopic||"",toProtoMessage(ht.message))}return Promise.resolve(void 0)}),tt.paginationForward?ot=lt.messages[lt.messages.length-1].messageHash:ot=lt.messages[0].messageHash,lt.messages.length>MAX_PAGE_SIZE&&lt.messages.length<(tt.paginationLimit||DEFAULT_PAGE_SIZE))break}}}const peerDiscoverySymbol$2=Symbol.for("@libp2p/peer-discovery"),peerIdSymbol$3=Symbol.for("@libp2p/peer-id");function isPeerId$2(et){return!!(et!=null&&et[peerIdSymbol$3])}var ls;let AbortError$9=(ls=class extends Error{constructor(o="The operation was aborted"){super(o),this.name="AbortError"}},wt(ls,"name","AbortError"),ls);class UnexpectedPeerError extends Error{constructor(o="Unexpected Peer"){super(o),this.name="UnexpectedPeerError"}}wt(UnexpectedPeerError,"name","UnexpectedPeerError");var us;let InvalidMessageError$3=(us=class extends Error{constructor(o="Invalid message"){super(o),this.name="InvalidMessageError"}},wt(us,"name","InvalidMessageError"),us);class ProtocolError extends Error{constructor(o="Protocol error"){super(o),this.name="ProtocolError"}}wt(ProtocolError,"name","ProtocolError");var ds;let TimeoutError$3=(ds=class extends Error{constructor(o="Timed out"){super(o),this.name="TimeoutError"}},wt(ds,"name","TimeoutError"),ds);function setMaxListeners$9(){}const setMaxListeners$8=(et,...o)=>{try{[...o]}catch{}};var Yr,Js;let TypedEventEmitter$3=(Js=class extends EventTarget{constructor(){super();fr(this,Yr,new Map);setMaxListeners$8(1/0,this)}listenerCount(tt){const rt=Ot(this,Yr).get(tt);return rt==null?0:rt.length}addEventListener(tt,rt,nt){super.addEventListener(tt,rt,nt);let ot=Ot(this,Yr).get(tt);ot==null&&(ot=[],Ot(this,Yr).set(tt,ot)),ot.push({callback:rt,once:(nt!==!0&&nt!==!1&&(nt==null?void 0:nt.once))??!1})}removeEventListener(tt,rt,nt){super.removeEventListener(tt.toString(),rt??null,nt);let ot=Ot(this,Yr).get(tt);ot!=null&&(ot=ot.filter(({callback:it})=>it!==rt),Ot(this,Yr).set(tt,ot))}dispatchEvent(tt){const rt=super.dispatchEvent(tt);let nt=Ot(this,Yr).get(tt.type);return nt==null||(nt=nt.filter(({once:ot})=>!ot),Ot(this,Yr).set(tt.type,nt)),rt}safeDispatchEvent(tt,rt={}){return this.dispatchEvent(new CustomEvent(tt,rt))}},Yr=new WeakMap,Js);const serviceCapabilities$5=Symbol.for("@libp2p/service-capabilities"),RelayPingContentTopic="/relay-ping/1/ping/null",log$k=new Logger$1("keep-alive");class KeepAliveManager{constructor({options:o,relay:tt,libp2p:rt}){wt(this,"relay");wt(this,"libp2p");wt(this,"options");wt(this,"pingKeepAliveTimers",new Map);wt(this,"relayKeepAliveTimers",new Map);this.options=o,this.relay=tt,this.libp2p=rt}start(o){this.stop(o);const{pingKeepAlive:tt,relayKeepAlive:rt}=this.options,nt=o.toString();if(tt!==0){const it=setInterval(()=>{(async()=>{let st;try{try{st=await this.libp2p.services.ping.ping(o),log$k.info(`Ping succeeded (${nt})`,st)}catch{log$k.error(`Ping failed for peer (${nt}).
Next ping will be attempted in ${tt} seconds.
`);return}try{await this.libp2p.peerStore.merge(o,{metadata:{ping:utf8ToBytes$1(st.toString())}})}catch(at){log$k.error("Failed to update ping",at)}}catch(at){log$k.error(`Ping failed (${nt})`,at)}})()},tt*1e3);this.pingKeepAliveTimers.set(nt,it)}const ot=this.relay;if(ot&&rt!==0){const it=this.scheduleRelayPings(ot,rt,o.toString());this.relayKeepAliveTimers.set(o,it)}}stop(o){var rt;const tt=o.toString();this.pingKeepAliveTimers.has(tt)&&(clearInterval(this.pingKeepAliveTimers.get(tt)),this.pingKeepAliveTimers.delete(tt)),this.relayKeepAliveTimers.has(o)&&((rt=this.relayKeepAliveTimers.get(o))==null||rt.map(clearInterval),this.relayKeepAliveTimers.delete(o))}stopAll(){for(const o of[...Object.values(this.pingKeepAliveTimers),...Object.values(this.relayKeepAliveTimers)])clearInterval(o);this.pingKeepAliveTimers.clear(),this.relayKeepAliveTimers.clear()}connectionsExist(){return this.pingKeepAliveTimers.size>0||this.relayKeepAliveTimers.size>0}scheduleRelayPings(o,tt,rt){const nt=[];for(const ot of o.pubsubTopics){if(!o.getMeshPeers(ot).includes(rt))continue;const st=createEncoder({pubsubTopicShardInfo:pubsubTopicToSingleShardInfo(ot),contentTopic:RelayPingContentTopic,ephemeral:!0}),at=setInterval(()=>{log$k.info("Sending Waku Relay ping message"),o.send(st,{payload:new Uint8Array([1])}).catch(ct=>log$k.error("Failed to send relay ping",ct))},tt*1e3);nt.push(at)}return nt}}const log$j=new Logger$1("connection-manager"),DEFAULT_MAX_BOOTSTRAP_PEERS_ALLOWED=1,DEFAULT_MAX_DIAL_ATTEMPTS_FOR_PEER=3,DEFAULT_MAX_PARALLEL_DIALS=3,Nn=class Nn extends TypedEventEmitter$3{constructor(tt,rt,nt,ot,it){super();wt(this,"configuredPubsubTopics");wt(this,"keepAliveManager");wt(this,"options");wt(this,"libp2p");wt(this,"dialAttemptsForPeer",new Map);wt(this,"dialErrorsForPeer",new Map);wt(this,"currentActiveParallelDialCount",0);wt(this,"pendingPeerDialQueue",[]);wt(this,"isP2PNetworkConnected",!1);wt(this,"onEventHandlers",{"peer:discovery":tt=>{(async()=>{const{id:rt}=tt.detail;await this.dispatchDiscoveryEvent(rt);try{await this.attemptDial(rt)}catch(nt){log$j.error(`Error dialing peer ${rt.toString()} : ${nt}`)}})()},"peer:connect":tt=>{(async()=>{log$j.info(`Connected to peer ${tt.detail.toString()}`);const rt=tt.detail;this.keepAliveManager.start(rt),(await this.getTagNamesForPeer(rt)).includes(Tags.BOOTSTRAP)?this.libp2p.getConnections().filter(it=>it.tags.includes(Tags.BOOTSTRAP)).length>this.options.maxBootstrapPeersAllowed?await this.dropConnection(rt):this.dispatchEvent(new CustomEvent(EPeersByDiscoveryEvents.PEER_CONNECT_BOOTSTRAP,{detail:rt})):this.dispatchEvent(new CustomEvent(EPeersByDiscoveryEvents.PEER_CONNECT_PEER_EXCHANGE,{detail:rt})),this.setP2PNetworkConnected()})()},"peer:disconnect":tt=>{(async()=>(this.keepAliveManager.stop(tt.detail),this.setP2PNetworkDisconnected()))()},"browser:network":()=>{this.dispatchWakuConnectionEvent()}});this.configuredPubsubTopics=nt,this.libp2p=tt,this.configuredPubsubTopics=nt,this.options={maxDialAttemptsForPeer:DEFAULT_MAX_DIAL_ATTEMPTS_FOR_PEER,maxBootstrapPeersAllowed:DEFAULT_MAX_BOOTSTRAP_PEERS_ALLOWED,maxParallelDials:DEFAULT_MAX_PARALLEL_DIALS,...it},this.keepAliveManager=new KeepAliveManager({relay:ot,libp2p:tt,options:rt}),this.startEventListeners().then(()=>log$j.info("Connection Manager is now running")).catch(st=>log$j.error("Unexpected error while running service",st)),this.dialPeerStorePeers().catch(st=>log$j.error("Unexpected error while dialing peer store peers",st))}isConnected(){var tt;return globalThis!=null&&globalThis.navigator&&!((tt=globalThis==null?void 0:globalThis.navigator)!=null&&tt.onLine)?!1:this.isP2PNetworkConnected}static create(tt,rt,nt,ot,it,st){let at=Nn.instances.get(tt);return at||(at=new Nn(rt,nt,ot,it,st),Nn.instances.set(tt,at)),at}stop(){this.keepAliveManager.stopAll(),this.libp2p.removeEventListener("peer:connect",this.onEventHandlers["peer:connect"]),this.libp2p.removeEventListener("peer:disconnect",this.onEventHandlers["peer:disconnect"]),this.libp2p.removeEventListener("peer:discovery",this.onEventHandlers["peer:discovery"]),this.stopNetworkStatusListener()}async dropConnection(tt){try{this.keepAliveManager.stop(tt),await this.libp2p.hangUp(tt),log$j.info(`Dropped connection with peer ${tt.toString()}`)}catch(rt){log$j.error(`Error dropping connection with peer ${tt.toString()} - ${rt}`)}}async getPeersByDiscovery(){const tt=await this.libp2p.peerStore.all(),rt=this.libp2p.getConnections().map(lt=>lt.remotePeer),nt=[],ot=[],it=[],st=[],at=[],ct=[];for(const lt of tt){const dt=await this.getTagNamesForPeer(lt.id);dt.includes(Tags.BOOTSTRAP)?nt.push(lt):dt.includes(Tags.PEER_EXCHANGE)?ot.push(lt):dt.includes(Tags.LOCAL)&&it.push(lt)}for(const lt of rt){const dt=await this.libp2p.peerStore.get(lt),ht=await this.getTagNamesForPeer(lt);ht.includes(Tags.BOOTSTRAP)?st.push(dt):ht.includes(Tags.PEER_EXCHANGE)?at.push(dt):ht.includes(Tags.LOCAL)&&ct.push(dt)}return{DISCOVERED:{[Tags.BOOTSTRAP]:nt,[Tags.PEER_EXCHANGE]:ot,[Tags.LOCAL]:it},CONNECTED:{[Tags.BOOTSTRAP]:st,[Tags.PEER_EXCHANGE]:at,[Tags.LOCAL]:ct}}}async dialPeerStorePeers(){const tt=await this.libp2p.peerStore.all(),rt=[];for(const nt of tt)this.libp2p.getConnections().find(ot=>ot.remotePeer===nt.id)||rt.push(this.attemptDial(nt.id));try{await Promise.all(rt)}catch(nt){log$j.error("Unexpected error while dialing peer store peers",nt)}}async startEventListeners(){this.startPeerDiscoveryListener(),this.startPeerConnectionListener(),this.startPeerDisconnectionListener(),this.startNetworkStatusListener()}async dialPeer(tt){this.currentActiveParallelDialCount+=1;let rt=0;for(;rt<this.options.maxDialAttemptsForPeer;)try{log$j.info(`Dialing peer ${tt.toString()} on attempt ${rt+1}`),await this.libp2p.dial(tt);const nt=await this.getTagNamesForPeer(tt);this.libp2p.getConnections(tt).forEach(ot=>{ot.tags=Array.from(new Set([...ot.tags,...nt]))}),this.dialAttemptsForPeer.set(tt.toString(),-1),this.keepAliveManager.start(tt);break}catch(nt){nt instanceof AggregateError?log$j.error(`Error dialing peer ${tt.toString()} - ${nt.errors}`):log$j.error(`Error dialing peer ${tt.toString()} - ${nt.message}`),this.dialErrorsForPeer.set(tt.toString(),nt),rt++,this.dialAttemptsForPeer.set(tt.toString(),rt)}if(this.currentActiveParallelDialCount--,this.processDialQueue(),rt===this.options.maxDialAttemptsForPeer)try{const nt=this.dialErrorsForPeer.get(tt.toString());if(nt){let ot;nt instanceof AggregateError?nt.errors?nt.errors.length===0?log$j.warn("Errors array is empty for AggregateError"):ot=JSON.stringify(nt.errors[0]):log$j.warn("No errors array found for AggregateError"):ot=nt.message,log$j.info(`Deleting undialable peer ${tt.toString()} from peer store. Reason: ${ot}`)}this.dialErrorsForPeer.delete(tt.toString()),await this.libp2p.peerStore.delete(tt),await this.attemptDnsDiscovery()}catch(nt){throw new Error(`Error deleting undialable peer ${tt.toString()} from peer store - ${nt}`)}}async attemptDnsDiscovery(){if(this.libp2p.getConnections().length>0||(await this.libp2p.peerStore.all()).length>0)return;log$j.info("Attempting to trigger DNS discovery.");const tt=Object.values(this.libp2p.components.components).find(rt=>rt&&rt.toString?rt.toString().includes(DNS_DISCOVERY_TAG):!1);tt&&await tt.findPeers()}processDialQueue(){if(this.pendingPeerDialQueue.length>0&&this.currentActiveParallelDialCount<this.options.maxParallelDials){const tt=this.pendingPeerDialQueue.shift();if(!tt)return;this.attemptDial(tt).catch(rt=>{log$j.error(rt)})}}startPeerDiscoveryListener(){this.libp2p.addEventListener("peer:discovery",this.onEventHandlers["peer:discovery"])}startPeerConnectionListener(){this.libp2p.addEventListener("peer:connect",this.onEventHandlers["peer:connect"])}startPeerDisconnectionListener(){this.libp2p.addEventListener("peer:disconnect",this.onEventHandlers["peer:disconnect"])}async attemptDial(tt){if(await this.shouldDialPeer(tt)){if(this.currentActiveParallelDialCount>=this.options.maxParallelDials){this.pendingPeerDialQueue.push(tt);return}await this.dialPeer(tt)}}async shouldDialPeer(tt){if(this.libp2p.getConnections(tt).length>0)return log$j.warn(`Already connected to peer ${tt.toString()}. Not dialing.`),!1;if(!await this.isPeerTopicConfigured(tt)){const st=await this.getPeerShardInfo(tt,this.libp2p.peerStore);return log$j.warn(`Discovered peer ${tt.toString()} with ShardInfo ${st} is not part of any of the configured pubsub topics (${this.configuredPubsubTopics}).
Not dialing.`),!1}return await this.isPeerDialableBasedOnBootstrapStatus(tt)?this.dialAttemptsForPeer.has(tt.toString())?(log$j.warn(`Peer ${tt.toString()} has already been attempted dial before, or already has a dial attempt in progress, skipping dial`),!1):!0:(log$j.warn(`Peer ${tt.toString()} is not dialable based on bootstrap status. Not dialing.`),!1)}async isPeerDialableBasedOnBootstrapStatus(tt){return(await this.getTagNamesForPeer(tt)).some(it=>it===Tags.BOOTSTRAP)?this.libp2p.getConnections().filter(it=>it.tags.find(st=>st===Tags.BOOTSTRAP)).length<this.options.maxBootstrapPeersAllowed:!0}async dispatchDiscoveryEvent(tt){const rt=(await this.getTagNamesForPeer(tt)).includes(Tags.BOOTSTRAP);this.dispatchEvent(new CustomEvent(rt?EPeersByDiscoveryEvents.PEER_DISCOVERY_BOOTSTRAP:EPeersByDiscoveryEvents.PEER_DISCOVERY_PEER_EXCHANGE,{detail:tt}))}async getTagNamesForPeer(tt){try{const rt=await this.libp2p.peerStore.get(tt);return Array.from(rt.tags.keys())}catch(rt){return log$j.error(`Failed to get peer ${tt}, error: ${rt}`),[]}}async isPeerTopicConfigured(tt){const rt=await this.getPeerShardInfo(tt,this.libp2p.peerStore);return rt?shardInfoToPubsubTopics(rt).some(it=>this.configuredPubsubTopics.includes(it)):!0}async getPeerShardInfo(tt,rt){const ot=(await rt.get(tt)).metadata.get("shardInfo");if(ot)return decodeRelayShard(ot)}startNetworkStatusListener(){try{globalThis.addEventListener("online",this.onEventHandlers["browser:network"]),globalThis.addEventListener("offline",this.onEventHandlers["browser:network"])}catch(tt){log$j.error(`Failed to start network listener: ${tt}`)}}stopNetworkStatusListener(){try{globalThis.removeEventListener("online",this.onEventHandlers["browser:network"]),globalThis.removeEventListener("offline",this.onEventHandlers["browser:network"])}catch(tt){log$j.error(`Failed to stop network listener: ${tt}`)}}setP2PNetworkConnected(){this.isP2PNetworkConnected||(this.isP2PNetworkConnected=!0,this.dispatchWakuConnectionEvent())}setP2PNetworkDisconnected(){this.isP2PNetworkConnected&&this.libp2p.getConnections().length===0&&(this.isP2PNetworkConnected=!1,this.dispatchWakuConnectionEvent())}dispatchWakuConnectionEvent(){this.dispatchEvent(new CustomEvent(EConnectionStateEvents.CONNECTION_STATUS,{detail:this.isConnected()}))}};wt(Nn,"instances",new Map);let ConnectionManager=Nn;const An=class An{constructor(){wt(this,"health");this.health={overallStatus:HealthStatus.Unhealthy,protocolStatuses:new Map}}static getInstance(){return An.instance||(An.instance=new An),An.instance}getHealthStatus(){return this.health.overallStatus}getProtocolStatus(o){return this.health.protocolStatuses.get(o)}updateProtocolHealth(o,tt){const rt=this.getNameFromMulticodec(o);let nt=HealthStatus.Unhealthy;tt==1?nt=HealthStatus.MinimallyHealthy:tt>=2&&(nt=HealthStatus.SufficientlyHealthy),this.health.protocolStatuses.set(rt,{name:rt,status:nt,lastUpdate:new Date}),this.updateOverallHealth()}getNameFromMulticodec(o){let tt;if(o.includes("filter"))tt=Protocols.Filter;else if(o.includes("lightpush"))tt=Protocols.LightPush;else if(o.includes("store"))tt=Protocols.Store;else throw new Error(`Unknown protocol: ${o}`);return tt}updateOverallHealth(){const tt=[Protocols.LightPush,Protocols.Filter].map(rt=>{var nt;return(nt=this.getProtocolStatus(rt))==null?void 0:nt.status});tt.some(rt=>rt===HealthStatus.Unhealthy)?this.health.overallStatus=HealthStatus.Unhealthy:tt.some(rt=>rt===HealthStatus.MinimallyHealthy)?this.health.overallStatus=HealthStatus.MinimallyHealthy:this.health.overallStatus=HealthStatus.SufficientlyHealthy}};wt(An,"instance");let HealthManager=An;const getHealthManager=()=>HealthManager.getInstance(),log$i=new Logger$1("metadata"),MetadataCodec="/vac/waku/metadata/1.0.0";class Metadata extends BaseProtocol{constructor(tt,rt){super(MetadataCodec,rt.components,log$i,tt);wt(this,"pubsubTopics");wt(this,"libp2pComponents");wt(this,"handshakesConfirmed",new Map);this.pubsubTopics=tt,this.libp2pComponents=rt,rt.registrar.handle(MetadataCodec,nt=>{this.onRequest(nt)})}async query(tt){const rt=WakuMetadataRequest.encode(pubsubTopicsToShardInfo(this.pubsubTopics)),nt=await this.libp2pComponents.peerStore.get(tt);if(!nt)return{shardInfo:null,error:ProtocolError$1.NO_PEER_AVAILABLE};let ot;try{ot=await this.getStream(nt)}catch(ct){return log$i.error("Failed to get stream",ct),{shardInfo:null,error:ProtocolError$1.NO_STREAM_AVAILABLE}}const it=await pipe([rt],encode$K,ot,decode$U,async ct=>await all$2(ct)),{error:st,shardInfo:at}=this.decodeMetadataResponse(it);return st?{shardInfo:null,error:st}:(await this.savePeerShardInfo(tt,at),{shardInfo:at,error:null})}async confirmOrAttemptHandshake(tt){const rt=this.handshakesConfirmed.get(tt.toString());return rt?{shardInfo:rt,error:null}:await this.query(tt)}async onRequest(tt){try{const{stream:rt,connection:nt}=tt,ot=WakuMetadataResponse.encode(pubsubTopicsToShardInfo(this.pubsubTopics)),it=await pipe([ot],encode$K,rt,decode$U,async ct=>await all$2(ct)),{error:st,shardInfo:at}=this.decodeMetadataResponse(it);if(st)return;await this.savePeerShardInfo(nt.remotePeer,at)}catch(rt){log$i.error("Error handling metadata request",rt)}}decodeMetadataResponse(tt){const rt=new Uint8ArrayList;tt.forEach(ot=>{rt.append(ot)});const nt=WakuMetadataResponse.decode(rt);return nt?{shardInfo:nt,error:null}:(log$i.error("Error decoding metadata response"),{shardInfo:null,error:ProtocolError$1.DECODE_FAILED})}async savePeerShardInfo(tt,rt){await this.libp2pComponents.peerStore.merge(tt,{metadata:{shardInfo:encodeRelayShard(rt)}}),this.handshakesConfirmed.set(tt.toString(),rt)}}function wakuMetadata(et){return o=>new Metadata(et,o)}function equals$e(et,o){if(et===o)return!0;if(et.byteLength!==o.byteLength)return!1;for(let tt=0;tt<et.byteLength;tt++)if(et[tt]!==o[tt])return!1;return!0}function coerce$i(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function fromString$s(et){return new TextEncoder().encode(et)}function toString$u(et){return new TextDecoder().decode(et)}function base$j(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt<tt.length;rt++)tt[rt]=255;for(var nt=0;nt<et.length;nt++){var ot=et.charAt(nt),it=ot.charCodeAt(0);if(tt[it]!==255)throw new TypeError(ot+" is ambiguous");tt[it]=nt}var st=et.length,at=et.charAt(0),ct=Math.log(st)/Math.log(256),lt=Math.log(256)/Math.log(st);function dt(ft){if(ft instanceof Uint8Array||(ArrayBuffer.isView(ft)?ft=new Uint8Array(ft.buffer,ft.byteOffset,ft.byteLength):Array.isArray(ft)&&(ft=Uint8Array.from(ft))),!(ft instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(ft.length===0)return"";for(var pt=0,yt=0,gt=0,bt=ft.length;gt!==bt&&ft[gt]===0;)gt++,pt++;for(var xt=(bt-gt)*lt+1>>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct<yt)&&St!==-1;St--,Ct++)Et+=256*vt[St]>>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At<xt;++At)kt+=et.charAt(vt[At]);return kt}function ht(ft){if(typeof ft!="string")throw new TypeError("Expected String");if(ft.length===0)return new Uint8Array;var pt=0;if(ft[pt]!==" "){for(var yt=0,gt=0;ft[pt]===at;)yt++,pt++;for(var bt=(ft.length-pt)*ct+1>>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et<gt)&&Ct!==-1;Ct--,Et++)vt+=st*xt[Ct]>>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$j=base$j,_brrp__multiformats_scope_baseX$i=src$j;let Encoder$j=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$j=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$k(this,o)}},ComposedDecoder$i=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$k(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$k(et,o){return new ComposedDecoder$i({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$i=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$j(o,tt,rt),this.decoder=new Decoder$j(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$l({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$i(et,o,tt,rt)}function baseX$i({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$i(tt,et);return from$l({prefix:o,name:et,encode:rt,decode:ot=>coerce$i(nt(ot))})}function decode$T(et,o,tt,rt){const nt={};for(let lt=0;lt<o.length;++lt)nt[o[lt]]=lt;let ot=et.length;for(;et[ot-1]==="=";)--ot;const it=new Uint8Array(ot*tt/8|0);let st=0,at=0,ct=0;for(let lt=0;lt<ot;++lt){const dt=nt[et[lt]];if(dt===void 0)throw new SyntaxError(`Non-${rt} character`);at=at<<tt|dt,st+=tt,st>=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$J(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<<tt)-1;let ot="",it=0,st=0;for(let at=0;at<et.length;++at)for(st=st<<8|et[at],it+=8;it>tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<<tt-it]),rt)for(;ot.length*tt&7;)ot+="=";return ot}function rfc4648$h({name:et,prefix:o,bitsPerChar:tt,alphabet:rt}){return from$l({prefix:o,name:et,encode(nt){return encode$J(nt,rt,tt)},decode(nt){return decode$T(nt,rt,tt,et)}})}const base58btc$i=baseX$i({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr$e=baseX$i({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58$e=Object.freeze(Object.defineProperty({__proto__:null,base58btc:base58btc$i,base58flickr:base58flickr$e},Symbol.toStringTag,{value:"Module"})),base32$w=rfc4648$h({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper$e=rfc4648$h({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad$e=rfc4648$h({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper$e=rfc4648$h({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex$e=rfc4648$h({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper$e=rfc4648$h({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad$e=rfc4648$h({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper$e=rfc4648$h({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z$e=rfc4648$h({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$x=Object.freeze(Object.defineProperty({__proto__:null,base32:base32$w,base32hex:base32hex$e,base32hexpad:base32hexpad$e,base32hexpadupper:base32hexpadupper$e,base32hexupper:base32hexupper$e,base32pad:base32pad$e,base32padupper:base32padupper$e,base32upper:base32upper$e,base32z:base32z$e},Symbol.toStringTag,{value:"Module"})),base36$t=baseX$i({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper$e=baseX$i({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$u=Object.freeze(Object.defineProperty({__proto__:null,base36:base36$t,base36upper:base36upper$e},Symbol.toStringTag,{value:"Module"}));var encode_1$5=encode$I,MSB$7=128,REST$7=127,MSBALL$5=~REST$7,INT$5=Math.pow(2,31);function encode$I(et,o,tt){o=o||[],tt=tt||0;for(var rt=tt;et>=INT$5;)o[tt++]=et&255|MSB$7,et/=128;for(;et&MSBALL$5;)o[tt++]=et&255|MSB$7,et>>>=7;return o[tt]=et|0,encode$I.bytes=tt-rt+1,o}var decode$S=read$6,MSB$1$5=128,REST$1$5=127;function read$6(et,rt){var tt=0,rt=rt||0,nt=0,ot=rt,it,st=et.length;do{if(ot>=st)throw read$6.bytes=0,new RangeError("Could not decode varint");it=et[ot++],tt+=nt<28?(it&REST$1$5)<<nt:(it&REST$1$5)*Math.pow(2,nt),nt+=7}while(it>=MSB$1$5);return read$6.bytes=ot-rt,tt}var N1$5=Math.pow(2,7),N2$5=Math.pow(2,14),N3$5=Math.pow(2,21),N4$5=Math.pow(2,28),N5$5=Math.pow(2,35),N6$5=Math.pow(2,42),N7$5=Math.pow(2,49),N8$5=Math.pow(2,56),N9$5=Math.pow(2,63),length$5=function(et){return et<N1$5?1:et<N2$5?2:et<N3$5?3:et<N4$5?4:et<N5$5?5:et<N6$5?6:et<N7$5?7:et<N8$5?8:et<N9$5?9:10},varint$5={encode:encode_1$5,decode:decode$S,encodingLength:length$5},_brrp_varint$5=varint$5;function decode$R(et,o=0){return[_brrp_varint$5.decode(et,o),_brrp_varint$5.decode.bytes]}function encodeTo$3(et,o,tt=0){return _brrp_varint$5.encode(et,o,tt),o}function encodingLength$5(et){return _brrp_varint$5.encodingLength(et)}function create$6(et,o){const tt=o.byteLength,rt=encodingLength$5(et),nt=rt+encodingLength$5(tt),ot=new Uint8Array(nt+tt);return encodeTo$3(et,ot,0),encodeTo$3(tt,ot,rt),ot.set(o,nt),new Digest$5(et,tt,o,ot)}function decode$Q(et){const o=coerce$i(et),[tt,rt]=decode$R(o),[nt,ot]=decode$R(o.subarray(rt)),it=o.subarray(rt+ot);if(it.byteLength!==nt)throw new Error("Incorrect length");return new Digest$5(tt,nt,it,o)}function equals$d(et,o){if(et===o)return!0;{const tt=o;return et.code===tt.code&&et.size===tt.size&&tt.bytes instanceof Uint8Array&&equals$e(et.bytes,tt.bytes)}}let Digest$5=class{constructor(o,tt,rt,nt){wt(this,"code");wt(this,"size");wt(this,"digest");wt(this,"bytes");this.code=o,this.size=tt,this.digest=rt,this.bytes=nt}};function format$3(et,o){const{bytes:tt,version:rt}=et;switch(rt){case 0:return toStringV0$3(tt,baseCache$3(et),o??base58btc$i.encoder);default:return toStringV1$3(tt,baseCache$3(et),o??base32$w.encoder)}}const cache$4=new WeakMap;function baseCache$3(et){const o=cache$4.get(et);if(o==null){const tt=new Map;return cache$4.set(et,tt),tt}return o}var na;let CID$3=class jr{constructor(o,tt,rt,nt){wt(this,"code");wt(this,"version");wt(this,"multihash");wt(this,"bytes");wt(this,"/");wt(this,na,"CID");this.code=tt,this.version=o,this.multihash=rt,this.bytes=nt,this["/"]=nt}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{const{code:o,multihash:tt}=this;if(o!==DAG_PB_CODE$3)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(tt.code!==SHA_256_CODE$3)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return jr.createV0(tt)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{const{code:o,digest:tt}=this.multihash,rt=create$6(o,tt);return jr.createV1(this.code,rt)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(o){return jr.equals(this,o)}static equals(o,tt){const rt=tt;return rt!=null&&o.code===rt.code&&o.version===rt.version&&equals$d(o.multihash,rt.multihash)}toString(o){return format$3(this,o)}toJSON(){return{"/":format$3(this)}}link(){return this}[(na=Symbol.toStringTag,Symbol.for("nodejs.util.inspect.custom"))](){return`CID(${this.toString()})`}static asCID(o){if(o==null)return null;const tt=o;if(tt instanceof jr)return tt;if(tt["/"]!=null&&tt["/"]===tt.bytes||tt.asCID===tt){const{version:rt,code:nt,multihash:ot,bytes:it}=tt;return new jr(rt,nt,ot,it??encodeCID$3(rt,nt,ot.bytes))}else if(tt[cidSymbol$3]===!0){const{version:rt,multihash:nt,code:ot}=tt,it=decode$Q(nt);return jr.create(rt,ot,it)}else return null}static create(o,tt,rt){if(typeof tt!="number")throw new Error("String codecs are no longer supported");if(!(rt.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(o){case 0:{if(tt!==DAG_PB_CODE$3)throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE$3}) block encoding`);return new jr(o,tt,rt,rt.bytes)}case 1:{const nt=encodeCID$3(o,tt,rt.bytes);return new jr(o,tt,rt,nt)}default:throw new Error("Invalid version")}}static createV0(o){return jr.create(0,DAG_PB_CODE$3,o)}static createV1(o,tt){return jr.create(1,o,tt)}static decode(o){const[tt,rt]=jr.decodeFirst(o);if(rt.length!==0)throw new Error("Incorrect length");return tt}static decodeFirst(o){const tt=jr.inspectBytes(o),rt=tt.size-tt.multihashSize,nt=coerce$i(o.subarray(rt,rt+tt.multihashSize));if(nt.byteLength!==tt.multihashSize)throw new Error("Incorrect length");const ot=nt.subarray(tt.multihashSize-tt.digestSize),it=new Digest$5(tt.multihashCode,tt.digestSize,ot,nt);return[tt.version===0?jr.createV0(it):jr.createV1(tt.codec,it),o.subarray(tt.size)]}static inspectBytes(o){let tt=0;const rt=()=>{const[dt,ht]=decode$R(o.subarray(tt));return tt+=ht,dt};let nt=rt(),ot=DAG_PB_CODE$3;if(nt===18?(nt=0,tt=0):ot=rt(),nt!==0&&nt!==1)throw new RangeError(`Invalid CID version ${nt}`);const it=tt,st=rt(),at=rt(),ct=tt+at,lt=ct-it;return{version:nt,codec:ot,multihashCode:st,digestSize:at,multihashSize:lt,size:ct}}static parse(o,tt){const[rt,nt]=parseCIDtoBytes$3(o,tt),ot=jr.decode(nt);if(ot.version===0&&o[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return baseCache$3(ot).set(rt,o),ot}};function parseCIDtoBytes$3(et,o){switch(et[0]){case"Q":{const tt=o??base58btc$i;return[base58btc$i.prefix,tt.decode(`${base58btc$i.prefix}${et}`)]}case base58btc$i.prefix:{const tt=o??base58btc$i;return[base58btc$i.prefix,tt.decode(et)]}case base32$w.prefix:{const tt=o??base32$w;return[base32$w.prefix,tt.decode(et)]}case base36$t.prefix:{const tt=o??base36$t;return[base36$t.prefix,tt.decode(et)]}default:{if(o==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[et[0],o.decode(et)]}}}function toStringV0$3(et,o,tt){const{prefix:rt}=tt;if(rt!==base58btc$i.prefix)throw Error(`Cannot string encode V0 in ${tt.name} encoding`);const nt=o.get(rt);if(nt==null){const ot=tt.encode(et).slice(1);return o.set(rt,ot),ot}else return nt}function toStringV1$3(et,o,tt){const{prefix:rt}=tt,nt=o.get(rt);if(nt==null){const ot=tt.encode(et);return o.set(rt,ot),ot}else return nt}const DAG_PB_CODE$3=112,SHA_256_CODE$3=18;function encodeCID$3(et,o,tt){const rt=encodingLength$5(et),nt=rt+encodingLength$5(o),ot=new Uint8Array(nt+tt.byteLength);return encodeTo$3(et,ot,0),encodeTo$3(o,ot,rt),ot.set(tt,nt),ot}const cidSymbol$3=Symbol.for("@ipld/js-cid/CID");function equals$c(et,o){if(et===o)return!0;if(et.byteLength!==o.byteLength)return!1;for(let tt=0;tt<et.byteLength;tt++)if(et[tt]!==o[tt])return!1;return!0}const base10$s=baseX$i({prefix:"9",name:"base10",alphabet:"0123456789"}),base10$t=Object.freeze(Object.defineProperty({__proto__:null,base10:base10$s},Symbol.toStringTag,{value:"Module"})),base16$s=rfc4648$h({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper$e=rfc4648$h({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),base16$t=Object.freeze(Object.defineProperty({__proto__:null,base16:base16$s,base16upper:base16upper$e},Symbol.toStringTag,{value:"Module"})),base2$s=rfc4648$h({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),base2$t=Object.freeze(Object.defineProperty({__proto__:null,base2:base2$s},Symbol.toStringTag,{value:"Module"})),alphabet$e=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),alphabetBytesToChars$e=alphabet$e.reduce((et,o,tt)=>(et[tt]=o,et),[]),alphabetCharsToBytes$e=alphabet$e.reduce((et,o,tt)=>{const rt=o.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${o}`);return et[rt]=tt,et},[]);function encode$H(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars$e[tt],o),"")}function decode$P(et){const o=[];for(const tt of et){const rt=tt.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${tt}`);const nt=alphabetCharsToBytes$e[rt];if(nt==null)throw new Error(`Non-base256emoji character: ${tt}`);o.push(nt)}return new Uint8Array(o)}const base256emoji$s=from$l({prefix:"🚀",name:"base256emoji",encode:encode$H,decode:decode$P}),base256emoji$t=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:base256emoji$s},Symbol.toStringTag,{value:"Module"})),base64$v=rfc4648$h({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad$e=rfc4648$h({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url$f=rfc4648$h({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad$e=rfc4648$h({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$w=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$v,base64pad:base64pad$e,base64url:base64url$f,base64urlpad:base64urlpad$e},Symbol.toStringTag,{value:"Module"})),base8$s=rfc4648$h({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$t=Object.freeze(Object.defineProperty({__proto__:null,base8:base8$s},Symbol.toStringTag,{value:"Module"})),identity$g=from$l({prefix:"\0",name:"identity",encode:et=>toString$u(et),decode:et=>fromString$s(et)}),identityBase$e=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$g},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const bases$e={...identityBase$e,...base2$t,...base8$t,...base10$t,...base16$t,...base32$x,...base36$u,...base58$e,...base64$w,...base256emoji$t};function allocUnsafe$d(et=0){return new Uint8Array(et)}function createCodec$e(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$i=createCodec$e("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii$e=createCodec$e("ascii","a",et=>{let o="a";for(let tt=0;tt<et.length;tt++)o+=String.fromCharCode(et[tt]);return o},et=>{et=et.substring(1);const o=allocUnsafe$d(et.length);for(let tt=0;tt<et.length;tt++)o[tt]=et.charCodeAt(tt);return o}),BASES$e={utf8:string$i,"utf-8":string$i,hex:bases$e.base16,latin1:ascii$e,ascii:ascii$e,binary:ascii$e,...bases$e};function toString$t(et,o="utf8"){const tt=BASES$e[o];if(tt==null)throw new Error(`Unsupported encoding "${o}"`);return tt.encoder.encode(et).substring(1)}function asUint8Array$2(et){return et}function concat$3(et,o){o==null&&(o=et.reduce((nt,ot)=>nt+ot.length,0));const tt=allocUnsafe$d(o);let rt=0;for(const nt of et)tt.set(nt,rt),rt+=nt.length;return tt}class Parser{constructor(){wt(this,"index",0);wt(this,"input","")}new(o){return this.index=0,this.input=o,this}readAtomically(o){const tt=this.index,rt=o();return rt===void 0&&(this.index=tt),rt}parseWith(o){const tt=o();if(this.index===this.input.length)return tt}peekChar(){if(!(this.index>=this.input.length))return this.input[this.index]}readChar(){if(!(this.index>=this.input.length))return this.input[this.index++]}readGivenChar(o){return this.readAtomically(()=>{const tt=this.readChar();if(tt===o)return tt})}readSeparator(o,tt,rt){return this.readAtomically(()=>{if(!(tt>0&&this.readGivenChar(o)===void 0))return rt()})}readNumber(o,tt,rt,nt){return this.readAtomically(()=>{let ot=0,it=0;const st=this.peekChar();if(st===void 0)return;const at=st==="0",ct=2**(8*nt)-1;for(;;){const lt=this.readAtomically(()=>{const dt=this.readChar();if(dt===void 0)return;const ht=Number.parseInt(dt,o);if(!Number.isNaN(ht))return ht});if(lt===void 0)break;if(ot*=o,ot+=lt,ot>ct||(it+=1,tt!==void 0&&it>tt))return}if(it!==0)return!rt&&at&&it>1?void 0:ot})}readIPv4Addr(){return this.readAtomically(()=>{const o=new Uint8Array(4);for(let tt=0;tt<o.length;tt++){const rt=this.readSeparator(".",tt,()=>this.readNumber(10,3,!1,1));if(rt===void 0)return;o[tt]=rt}return o})}readIPv6Addr(){const o=tt=>{for(let rt=0;rt<tt.length/2;rt++){const nt=rt*2;if(rt<tt.length-3){const it=this.readSeparator(":",rt,()=>this.readIPv4Addr());if(it!==void 0)return tt[nt]=it[0],tt[nt+1]=it[1],tt[nt+2]=it[2],tt[nt+3]=it[3],[nt+4,!0]}const ot=this.readSeparator(":",rt,()=>this.readNumber(16,4,!0,2));if(ot===void 0)return[nt,!1];tt[nt]=ot>>8,tt[nt+1]=ot&255}return[tt.length,!1]};return this.readAtomically(()=>{const tt=new Uint8Array(16),[rt,nt]=o(tt);if(rt===16)return tt;if(nt||this.readGivenChar(":")===void 0||this.readGivenChar(":")===void 0)return;const ot=new Uint8Array(14),it=16-(rt+2),[st]=o(ot.subarray(0,it));return tt.set(ot.subarray(0,st),16-st),tt})}readIPAddr(){return this.readIPv4Addr()??this.readIPv6Addr()}}const MAX_IPV6_LENGTH=45,MAX_IPV4_LENGTH=15,parser=new Parser;function parseIPv4(et){if(!(et.length>MAX_IPV4_LENGTH))return parser.new(et).parseWith(()=>parser.readIPv4Addr())}function parseIPv6(et){if(et.includes("%")&&(et=et.split("%")[0]),!(et.length>MAX_IPV6_LENGTH))return parser.new(et).parseWith(()=>parser.readIPv6Addr())}function parseIP(et){if(et.includes("%")&&(et=et.split("%")[0]),!(et.length>MAX_IPV6_LENGTH))return parser.new(et).parseWith(()=>parser.readIPAddr())}function fromString$r(et,o="utf8"){const tt=BASES$e[o];if(tt==null)throw new Error(`Unsupported encoding "${o}"`);return tt.decoder.decode(`${tt.prefix}${et}`)}function isIPv4(et){return!!parseIPv4(et)}function isIPv6(et){return!!parseIPv6(et)}function isIP(et){return!!parseIP(et)}const isV4=isIPv4,isV6=isIPv6,toBytes$1=function(et){let o=0;if(et=et.toString().trim(),isV4(et)){const tt=new Uint8Array(o+4);return et.split(/\./g).forEach(rt=>{tt[o++]=parseInt(rt,10)&255}),tt}if(isV6(et)){const tt=et.split(":",8);let rt;for(rt=0;rt<tt.length;rt++){const ot=isV4(tt[rt]);let it;ot&&(it=toBytes$1(tt[rt]),tt[rt]=toString$t(it.slice(0,2),"base16")),it!=null&&++rt<8&&tt.splice(rt,0,toString$t(it.slice(2,4),"base16"))}if(tt[0]==="")for(;tt.length<8;)tt.unshift("0");else if(tt[tt.length-1]==="")for(;tt.length<8;)tt.push("0");else if(tt.length<8){for(rt=0;rt<tt.length&&tt[rt]!=="";rt++);const ot=[rt,1];for(rt=9-tt.length;rt>0;rt--)ot.push("0");tt.splice.apply(tt,ot)}const nt=new Uint8Array(o+16);for(rt=0;rt<tt.length;rt++){const ot=parseInt(tt[rt],16);nt[o++]=ot>>8&255,nt[o++]=ot&255}return nt}throw new Error("invalid ip address")},toString$s=function(et,o=0,tt){o=~~o,tt=tt??et.length-o;const rt=new DataView(et.buffer);if(tt===4){const nt=[];for(let ot=0;ot<tt;ot++)nt.push(et[o+ot]);return nt.join(".")}if(tt===16){const nt=[];for(let ot=0;ot<tt;ot+=2)nt.push(rt.getUint16(o+ot).toString(16));return nt.join(":").replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}return""},V=-1,names={},codes={},table$1=[[4,32,"ip4"],[6,16,"tcp"],[33,16,"dccp"],[41,128,"ip6"],[42,V,"ip6zone"],[43,8,"ipcidr"],[53,V,"dns",!0],[54,V,"dns4",!0],[55,V,"dns6",!0],[56,V,"dnsaddr",!0],[132,16,"sctp"],[273,16,"udp"],[275,0,"p2p-webrtc-star"],[276,0,"p2p-webrtc-direct"],[277,0,"p2p-stardust"],[280,0,"webrtc-direct"],[281,0,"webrtc"],[290,0,"p2p-circuit"],[301,0,"udt"],[302,0,"utp"],[400,V,"unix",!1,!0],[421,V,"ipfs"],[421,V,"p2p"],[443,0,"https"],[444,96,"onion"],[445,296,"onion3"],[446,V,"garlic64"],[448,0,"tls"],[449,V,"sni"],[460,0,"quic"],[461,0,"quic-v1"],[465,0,"webtransport"],[466,V,"certhash"],[477,0,"ws"],[478,0,"wss"],[479,0,"p2p-websocket-star"],[480,0,"http"],[481,V,"http-path"],[777,V,"memory"]];table$1.forEach(et=>{const o=createProtocol(...et);codes[o.code]=o,names[o.name]=o});function createProtocol(et,o,tt,rt,nt){return{code:et,size:o,name:tt,resolvable:!!rt,path:!!nt}}function getProtocol(et){if(typeof et=="number"){if(codes[et]!=null)return codes[et];throw new Error(`no protocol with code: ${et}`)}else if(typeof et=="string"){if(names[et]!=null)return names[et];throw new Error(`no protocol with name: ${et}`)}throw new Error(`invalid protocol id type: ${typeof et}`)}getProtocol("ip4");getProtocol("ip6");getProtocol("ipcidr");function convertToString(et,o){switch(getProtocol(et).code){case 4:case 41:return bytes2ip(o);case 42:return bytes2str(o);case 6:case 273:case 33:case 132:return bytes2port(o).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return bytes2str(o);case 421:return bytes2mh(o);case 444:return bytes2onion(o);case 445:return bytes2onion(o);case 466:return bytes2mb(o);case 481:return globalThis.encodeURIComponent(bytes2str(o));default:return toString$t(o,"base16")}}function convertToBytes(et,o){switch(getProtocol(et).code){case 4:return ip2bytes(o);case 41:return ip2bytes(o);case 42:return str2bytes(o);case 6:case 273:case 33:case 132:return port2bytes(parseInt(o,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return str2bytes(o);case 421:return mh2bytes(o);case 444:return onion2bytes(o);case 445:return onion32bytes(o);case 466:return mb2bytes(o);case 481:return str2bytes(globalThis.decodeURIComponent(o));default:return fromString$r(o,"base16")}}const decoders=Object.values(bases$e).map(et=>et.decoder),anybaseDecoder=function(){let et=decoders[0].or(decoders[1]);return decoders.slice(2).forEach(o=>et=et.or(o)),et}();function ip2bytes(et){if(!isIP(et))throw new Error("invalid ip address");return toBytes$1(et)}function bytes2ip(et){const o=toString$s(et,0,et.length);if(o==null)throw new Error("ipBuff is required");if(!isIP(o))throw new Error("invalid ip address");return o}function port2bytes(et){const o=new ArrayBuffer(2);return new DataView(o).setUint16(0,et),new Uint8Array(o)}function bytes2port(et){return new DataView(et.buffer).getUint16(et.byteOffset)}function str2bytes(et){const o=fromString$r(et),tt=Uint8Array.from(encode$P(o.length));return concat$3([tt,o],tt.length+o.length)}function bytes2str(et){const o=decode$Z(et);if(et=et.slice(encodingLength$6(o)),et.length!==o)throw new Error("inconsistent lengths");return toString$t(et)}function mh2bytes(et){let o;et[0]==="Q"||et[0]==="1"?o=decode$Q(base58btc$i.decode(`z${et}`)).bytes:o=CID$3.parse(et).multihash.bytes;const tt=Uint8Array.from(encode$P(o.length));return concat$3([tt,o],tt.length+o.length)}function mb2bytes(et){const o=anybaseDecoder.decode(et),tt=Uint8Array.from(encode$P(o.length));return concat$3([tt,o],tt.length+o.length)}function bytes2mb(et){const o=decode$Z(et),tt=et.slice(encodingLength$6(o));if(tt.length!==o)throw new Error("inconsistent lengths");return"u"+toString$t(tt,"base64url")}function bytes2mh(et){const o=decode$Z(et),tt=et.slice(encodingLength$6(o));if(tt.length!==o)throw new Error("inconsistent lengths");return toString$t(tt,"base58btc")}function onion2bytes(et){const o=et.split(":");if(o.length!==2)throw new Error(`failed to parse onion addr: ["'${o.join('", "')}'"]' does not contain a port number`);if(o[0].length!==16)throw new Error(`failed to parse onion addr: ${o[0]} not a Tor onion address.`);const tt=base32$w.decode("b"+o[0]),rt=parseInt(o[1],10);if(rt<1||rt>65536)throw new Error("Port number is not in range(1, 65536)");const nt=port2bytes(rt);return concat$3([tt,nt],tt.length+nt.length)}function onion32bytes(et){const o=et.split(":");if(o.length!==2)throw new Error(`failed to parse onion addr: ["'${o.join('", "')}'"]' does not contain a port number`);if(o[0].length!==56)throw new Error(`failed to parse onion addr: ${o[0]} not a Tor onion3 address.`);const tt=base32$w.decode(`b${o[0]}`),rt=parseInt(o[1],10);if(rt<1||rt>65536)throw new Error("Port number is not in range(1, 65536)");const nt=port2bytes(rt);return concat$3([tt,nt],tt.length+nt.length)}function bytes2onion(et){const o=et.slice(0,et.length-2),tt=et.slice(et.length-2),rt=toString$t(o,"base32"),nt=bytes2port(tt);return`${rt}:${nt}`}function stringToMultiaddrParts(et){et=cleanPath(et);const o=[],tt=[];let rt=null;const nt=et.split("/").slice(1);if(nt.length===1&&nt[0]==="")return{bytes:new Uint8Array,string:"/",tuples:[],stringTuples:[],path:null};for(let ot=0;ot<nt.length;ot++){const it=nt[ot],st=getProtocol(it);if(st.size===0){o.push([st.code]),tt.push([st.code]);continue}if(ot++,ot>=nt.length)throw ParseError("invalid address: "+et);if(st.path===!0){rt=cleanPath(nt.slice(ot).join("/")),o.push([st.code,convertToBytes(st.code,rt)]),tt.push([st.code,rt]);break}const at=convertToBytes(st.code,nt[ot]);o.push([st.code,at]),tt.push([st.code,convertToString(st.code,at)])}return{string:stringTuplesToString(tt),bytes:tuplesToBytes(o),tuples:o,stringTuples:tt,path:rt}}function bytesToMultiaddrParts(et){const o=[],tt=[];let rt=null,nt=0;for(;nt<et.length;){const ot=decode$Z(et,nt),it=encodingLength$6(ot),st=getProtocol(ot),at=sizeForAddr(st,et.slice(nt+it));if(at===0){o.push([ot]),tt.push([ot]),nt+=it;continue}const ct=et.slice(nt+it,nt+it+at);if(nt+=at+it,nt>et.length)throw ParseError("Invalid address Uint8Array: "+toString$t(et,"base16"));o.push([ot,ct]);const lt=convertToString(ot,ct);if(tt.push([ot,lt]),st.path===!0){rt=lt;break}}return{bytes:Uint8Array.from(et),string:stringTuplesToString(tt),tuples:o,stringTuples:tt,path:rt}}function stringTuplesToString(et){const o=[];return et.map(tt=>{const rt=getProtocol(tt[0]);return o.push(rt.name),tt.length>1&&tt[1]!=null&&o.push(tt[1]),null}),cleanPath(o.join("/"))}function tuplesToBytes(et){return concat$3(et.map(o=>{const tt=getProtocol(o[0]);let rt=Uint8Array.from(encode$P(tt.code));return o.length>1&&o[1]!=null&&(rt=concat$3([rt,o[1]])),rt}))}function sizeForAddr(et,o){if(et.size>0)return et.size/8;if(et.size===0)return 0;{const tt=decode$Z(o instanceof Uint8Array?o:Uint8Array.from(o));return tt+encodingLength$6(tt)}}function cleanPath(et){return"/"+et.trim().split("/").filter(o=>o).join("/")}function ParseError(et){return new Error("Error parsing address: "+et)}const inspect$1=Symbol.for("nodejs.util.inspect.custom"),symbol=Symbol.for("@multiformats/js-multiaddr/multiaddr"),DNS_CODES=[getProtocol("dns").code,getProtocol("dns4").code,getProtocol("dns6").code,getProtocol("dnsaddr").code];class NoAvailableResolverError extends Error{constructor(o="No available resolver"){super(o),this.name="NoAvailableResolverError"}}var ga,Yn,wn,lo,uo;const Dn=class Dn{constructor(o){wt(this,"bytes");fr(this,Yn);fr(this,wn);fr(this,lo);fr(this,uo);wt(this,ga,!0);o==null&&(o="");let tt;if(o instanceof Uint8Array)tt=bytesToMultiaddrParts(o);else if(typeof o=="string"){if(o.length>0&&o.charAt(0)!=="/")throw new Error(`multiaddr "${o}" must start with a "/"`);tt=stringToMultiaddrParts(o)}else if(isMultiaddr(o))tt=bytesToMultiaddrParts(o.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr");this.bytes=tt.bytes,lr(this,Yn,tt.string),lr(this,wn,tt.tuples),lr(this,lo,tt.stringTuples),lr(this,uo,tt.path)}toString(){return Ot(this,Yn)}toJSON(){return this.toString()}toOptions(){let o,tt,rt,nt,ot="";const it=getProtocol("tcp"),st=getProtocol("udp"),at=getProtocol("ip4"),ct=getProtocol("ip6"),lt=getProtocol("dns6"),dt=getProtocol("ip6zone");for(const[mt,ft]of this.stringTuples())mt===dt.code&&(ot=`%${ft??""}`),DNS_CODES.includes(mt)&&(tt=it.name,nt=443,rt=`${ft??""}${ot}`,o=mt===lt.code?6:4),(mt===it.code||mt===st.code)&&(tt=getProtocol(mt).name,nt=parseInt(ft??"")),(mt===at.code||mt===ct.code)&&(tt=getProtocol(mt).name,rt=`${ft??""}${ot}`,o=mt===ct.code?6:4);if(o==null||tt==null||rt==null||nt==null)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');return{family:o,host:rt,transport:tt,port:nt}}protos(){return Ot(this,wn).map(([o])=>Object.assign({},getProtocol(o)))}protoCodes(){return Ot(this,wn).map(([o])=>o)}protoNames(){return Ot(this,wn).map(([o])=>getProtocol(o).name)}tuples(){return Ot(this,wn)}stringTuples(){return Ot(this,lo)}encapsulate(o){return o=new Dn(o),new Dn(this.toString()+o.toString())}decapsulate(o){const tt=o.toString(),rt=this.toString(),nt=rt.lastIndexOf(tt);if(nt<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${o.toString()}`);return new Dn(rt.slice(0,nt))}decapsulateCode(o){const tt=this.tuples();for(let rt=tt.length-1;rt>=0;rt--)if(tt[rt][0]===o)return new Dn(tuplesToBytes(tt.slice(0,rt)));return this}getPeerId(){try{let o=[];this.stringTuples().forEach(([rt,nt])=>{rt===names.p2p.code&&o.push([rt,nt]),rt===names["p2p-circuit"].code&&(o=[])});const tt=o.pop();if((tt==null?void 0:tt[1])!=null){const rt=tt[1];return rt[0]==="Q"||rt[0]==="1"?toString$t(base58btc$i.decode(`z${rt}`),"base58btc"):toString$t(CID$3.parse(rt).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){return Ot(this,uo)}equals(o){return equals$c(this.bytes,o.bytes)}async resolve(o){const tt=this.protos().find(ot=>ot.resolvable);if(tt==null)return[this];const rt=resolvers$1.get(tt.name);if(rt==null)throw new NoAvailableResolverError(`no available resolver for ${tt.name}`);return(await rt(this,o)).map(ot=>multiaddr(ot))}nodeAddress(){const o=this.toOptions();if(o.transport!=="tcp"&&o.transport!=="udp")throw new Error(`multiaddr must have a valid format - no protocol with name: "${o.transport}". Must have a valid transport protocol: "{tcp, udp}"`);return{family:o.family,address:o.host,port:o.port}}isThinWaistAddress(o){const tt=(o??this).protos();return!(tt.length!==2||tt[0].code!==4&&tt[0].code!==41||tt[1].code!==6&&tt[1].code!==273)}[(ga=symbol,inspect$1)](){return`Multiaddr(${Ot(this,Yn)})`}};Yn=new WeakMap,wn=new WeakMap,lo=new WeakMap,uo=new WeakMap;let Multiaddr=Dn;const resolvers$1=new Map;function isMultiaddr(et){return!!(et!=null&&et[symbol])}function multiaddr(et){return new Multiaddr(et)}const E_CANCELED=new Error("request for lock canceled");var __awaiter$2=function(et,o,tt,rt){function nt(ot){return ot instanceof tt?ot:new tt(function(it){it(ot)})}return new(tt||(tt=Promise))(function(ot,it){function st(lt){try{ct(rt.next(lt))}catch(dt){it(dt)}}function at(lt){try{ct(rt.throw(lt))}catch(dt){it(dt)}}function ct(lt){lt.done?ot(lt.value):nt(lt.value).then(st,at)}ct((rt=rt.apply(et,o||[])).next())})};class Semaphore{constructor(o,tt=E_CANCELED){this._value=o,this._cancelError=tt,this._queue=[],this._weightedWaiters=[]}acquire(o=1,tt=0){if(o<=0)throw new Error(`invalid weight ${o}: must be positive`);return new Promise((rt,nt)=>{const ot={resolve:rt,reject:nt,weight:o,priority:tt},it=findIndexFromEnd(this._queue,st=>tt<=st.priority);it===-1&&o<=this._value?this._dispatchItem(ot):this._queue.splice(it+1,0,ot)})}runExclusive(o){return __awaiter$2(this,arguments,void 0,function*(tt,rt=1,nt=0){const[ot,it]=yield this.acquire(rt,nt);try{return yield tt(ot)}finally{it()}})}waitForUnlock(o=1,tt=0){if(o<=0)throw new Error(`invalid weight ${o}: must be positive`);return this._couldLockImmediately(o,tt)?Promise.resolve():new Promise(rt=>{this._weightedWaiters[o-1]||(this._weightedWaiters[o-1]=[]),insertSorted(this._weightedWaiters[o-1],{resolve:rt,priority:tt})})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(o){this._value=o,this._dispatchQueue()}release(o=1){if(o<=0)throw new Error(`invalid weight ${o}: must be positive`);this._value+=o,this._dispatchQueue()}cancel(){this._queue.forEach(o=>o.reject(this._cancelError)),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(o){const tt=this._value;this._value-=o.weight,o.resolve([tt,this._newReleaser(o.weight)])}_newReleaser(o){let tt=!1;return()=>{tt||(tt=!0,this.release(o))}}_drainUnlockWaiters(){if(this._queue.length===0)for(let o=this._value;o>0;o--){const tt=this._weightedWaiters[o-1];tt&&(tt.forEach(rt=>rt.resolve()),this._weightedWaiters[o-1]=[])}else{const o=this._queue[0].priority;for(let tt=this._value;tt>0;tt--){const rt=this._weightedWaiters[tt-1];if(!rt)continue;const nt=rt.findIndex(ot=>ot.priority<=o);(nt===-1?rt:rt.splice(0,nt)).forEach(ot=>ot.resolve())}}}_couldLockImmediately(o,tt){return(this._queue.length===0||this._queue[0].priority<tt)&&o<=this._value}}function insertSorted(et,o){const tt=findIndexFromEnd(et,rt=>o.priority<=rt.priority);et.splice(tt+1,0,o)}function findIndexFromEnd(et,o){for(let tt=et.length-1;tt>=0;tt--)if(o(et[tt]))return tt;return-1}var __awaiter$1=function(et,o,tt,rt){function nt(ot){return ot instanceof tt?ot:new tt(function(it){it(ot)})}return new(tt||(tt=Promise))(function(ot,it){function st(lt){try{ct(rt.next(lt))}catch(dt){it(dt)}}function at(lt){try{ct(rt.throw(lt))}catch(dt){it(dt)}}function ct(lt){lt.done?ot(lt.value):nt(lt.value).then(st,at)}ct((rt=rt.apply(et,o||[])).next())})};class Mutex{constructor(o){this._semaphore=new Semaphore(1,o)}acquire(){return __awaiter$1(this,arguments,void 0,function*(o=0){const[,tt]=yield this._semaphore.acquire(1,o);return tt})}runExclusive(o,tt=0){return this._semaphore.runExclusive(()=>o(),1,tt)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(o=0){return this._semaphore.waitForUnlock(1,o)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}class PeerManager{constructor(o,tt,rt){wt(this,"connectionManager");wt(this,"core");wt(this,"log");wt(this,"peers",new Map);wt(this,"healthManager");wt(this,"readMutex",new Mutex);wt(this,"writeMutex",new Mutex);wt(this,"writeLockHolder",null);this.connectionManager=o,this.core=tt,this.log=rt,this.healthManager=getHealthManager(),this.healthManager.updateProtocolHealth(this.core.multicodec,0)}getWriteLockHolder(){return this.writeLockHolder}getPeers(){return Array.from(this.peers.values())}async addPeer(o){return this.writeMutex.runExclusive(async()=>{this.writeLockHolder=`addPeer: ${o.id.toString()}`,await this.connectionManager.attemptDial(o.id),this.peers.set(o.id.toString(),o),this.log.info(`Added and dialed peer: ${o.id.toString()}`),this.healthManager.updateProtocolHealth(this.core.multicodec,this.peers.size),this.writeLockHolder=null})}async removePeer(o){return this.writeMutex.runExclusive(()=>{this.writeLockHolder=`removePeer: ${o.toString()}`,this.peers.delete(o.toString()),this.log.info(`Removed peer: ${o.toString()}`),this.healthManager.updateProtocolHealth(this.core.multicodec,this.peers.size),this.writeLockHolder=null})}async getPeerCount(){return this.readMutex.runExclusive(()=>this.peers.size)}async hasPeers(){return this.readMutex.runExclusive(()=>this.peers.size>0)}async removeExcessPeers(o){this.log.info(`Removing ${o} excess peer(s)`);const tt=Array.from(this.peers.values()).slice(0,o);for(const rt of tt)await this.removePeer(rt.id)}async findAndAddPeers(o){const tt=await this.findPeers(o);return tt.length===0?(this.log.warn("No additional peers found"),[]):this.addMultiplePeers(tt)}async findPeers(o){const tt=await this.core.getPeers();return this.readMutex.runExclusive(async()=>tt.filter(nt=>!this.peers.has(nt.id.toString())).slice(0,o))}async addMultiplePeers(o){const tt=[];for(const rt of o)await this.addPeer(rt),tt.push(rt);return tt}}const DEFAULT_NUM_PEERS_TO_USE=2,DEFAULT_MAINTAIN_PEERS_INTERVAL=3e4;class BaseProtocolSDK{constructor(o,tt,rt){wt(this,"core");wt(this,"connectionManager");wt(this,"peerManager");wt(this,"numPeersToUse");wt(this,"maintainPeersIntervalId",null);wt(this,"log");this.core=o,this.connectionManager=tt,this.log=new Logger$1(`sdk:${o.multicodec}`),this.numPeersToUse=(rt==null?void 0:rt.numPeersToUse)??DEFAULT_NUM_PEERS_TO_USE;const nt=(rt==null?void 0:rt.maintainPeersInterval)??DEFAULT_MAINTAIN_PEERS_INTERVAL;this.peerManager=new PeerManager(tt,o,this.log),this.log.info(`Initializing BaseProtocolSDK with numPeersToUse: ${this.numPeersToUse}, maintainPeersInterval: ${nt}ms`),this.startMaintainPeersInterval(nt)}get connectedPeers(){return this.peerManager.getPeers().slice(0,this.numPeersToUse)}async renewPeer(o){this.log.info(`Attempting to renew peer ${o}`);const tt=await this.peerManager.findPeers(1);if(tt.length===0){this.log.error("Failed to find a new peer to replace the disconnected one");return}return await this.peerManager.removePeer(o),await this.peerManager.addPeer(tt[0]),this.log.info(`Successfully renewed peer. New peer: ${tt[0].id}`),tt[0]}stopMaintainPeersInterval(){this.maintainPeersIntervalId?(clearInterval(this.maintainPeersIntervalId),this.maintainPeersIntervalId=null,this.log.info("Maintain peers interval stopped")):this.log.info("Maintain peers interval was not running")}async hasPeers(o={}){const{forceUseAllPeers:tt=!1,maxAttempts:rt=3}=o;this.log.info(`Checking for peers. forceUseAllPeers: ${tt}, maxAttempts: ${rt}`);for(let nt=0;nt<rt;nt++){if(this.log.info(`Attempt ${nt+1}/${rt} to reach required number of peers`),await this.maintainPeers(),!tt&&this.connectedPeers.length>0)return this.log.info(`At least one peer connected (${this.connectedPeers.length}), not forcing use of all peers`),!0;if(this.connectedPeers.length>=this.numPeersToUse)return this.log.info(`Required number of peers (${this.numPeersToUse}) reached`),!0;this.log.warn(`Found only ${this.connectedPeers.length}/${this.numPeersToUse} required peers. Retrying...`)}return this.log.error(`Failed to find required number of peers (${this.numPeersToUse}) after ${rt} attempts`),!1}async startMaintainPeersInterval(o){this.log.info(`Starting maintain peers interval with ${o}ms interval`);try{this.maintainPeersIntervalId=setInterval(()=>{this.log.info("Running scheduled peer maintenance"),this.maintainPeers().catch(tt=>{this.log.error("Error during scheduled peer maintenance:",tt)})},o),this.log.info("Maintain peers interval started successfully")}catch(tt){throw this.log.error("Error starting maintain peers interval:",tt),tt}}async maintainPeers(){try{const o=await this.peerManager.getPeerCount(),tt=this.numPeersToUse-o;if(this.log.info(`Current peer count: ${o}, target: ${this.numPeersToUse}`),tt===0){this.log.info("Peer count is at target, no maintenance required");return}tt>0?(this.log.info(`Attempting to add ${tt} peer(s)`),await this.peerManager.findAndAddPeers(tt)):(this.log.info(`Attempting to remove ${Math.abs(tt)} excess peer(s)`),await this.peerManager.removeExcessPeers(Math.abs(tt)));const rt=await this.peerManager.getPeerCount();this.log.info(`Peer maintenance completed. Initial count: ${o}, Final count: ${rt}`)}catch(o){this.log.error("Error during peer maintenance",{error:o})}}}const DEFAULT_KEEP_ALIVE=6e4,DEFAULT_LIGHT_PUSH_FILTER_CHECK=!1,DEFAULT_LIGHT_PUSH_FILTER_CHECK_INTERVAL=1e4,DEFAULT_SUBSCRIBE_OPTIONS={keepAlive:DEFAULT_KEEP_ALIVE,enableLightPushFilterCheck:DEFAULT_LIGHT_PUSH_FILTER_CHECK};function messageHash(et,o){const tt=utf8ToBytes$1(et),rt=utf8ToBytes$1(o.contentTopic),nt=tryConvertTimestampToBytes(o.timestamp),ot=concat$5([tt,o.payload,rt,o.meta,nt].filter(isDefined));return sha256$3(ot)}function tryConvertTimestampToBytes(et){if(!et)return;let o;return typeof et=="bigint"?o=et:o=BigInt(et.valueOf())*1000000n,numberToBytes(o)}function messageHashStr(et,o){const tt=messageHash(et,o);return bytesToHex$1(tt)}const log$h=new Logger$1("sdk:receiver:reliability_monitor"),DEFAULT_MAX_PINGS=3,MESSAGE_VERIFICATION_DELAY=5e3;class ReceiverReliabilityMonitor{constructor(o,tt,rt,nt,ot,it,st){wt(this,"pubsubTopic");wt(this,"getPeers");wt(this,"renewPeer");wt(this,"getContentTopics");wt(this,"protocolSubscribe");wt(this,"addLibp2pEventListener");wt(this,"sendLightPushMessage");wt(this,"receivedMessagesFormPeer",new Set);wt(this,"receivedMessages",new Set);wt(this,"scheduledVerification",new Map);wt(this,"verifiedPeers",new Set);wt(this,"peerFailures",new Map);wt(this,"maxPingFailures",DEFAULT_MAX_PINGS);wt(this,"peerRenewalLocks",new Set);this.pubsubTopic=o,this.getPeers=tt,this.renewPeer=rt,this.getContentTopics=nt,this.protocolSubscribe=ot,this.addLibp2pEventListener=it,this.sendLightPushMessage=st,this.addLibp2pEventListener("peer:disconnect",at=>{const ct=at.detail;this.getPeers().some(lt=>lt.id.equals(ct))&&this.renewAndSubscribePeer(ct)})}setMaxPingFailures(o){o!==void 0&&(this.maxPingFailures=o)}async handlePingResult(o,tt){if(tt!=null&&tt.success){this.peerFailures.delete(o.toString());return}const rt=(this.peerFailures.get(o.toString())||0)+1;if(this.peerFailures.set(o.toString(),rt),rt>=this.maxPingFailures)try{log$h.info(`Attempting to renew ${o.toString()} due to ping failures.`),await this.renewAndSubscribePeer(o),this.peerFailures.delete(o.toString())}catch(nt){log$h.error(`Failed to renew peer ${o.toString()}: ${nt}.`)}}notifyMessageReceived(o,tt){const rt=this.buildMessageHash(tt);return this.verifiedPeers.add(o),this.receivedMessagesFormPeer.add(`${o}-${rt}`),log$h.info(`notifyMessage received debug: ephemeral:${tt.ephemeral} ${bytesToUtf8(tt.payload)}`),log$h.info(`notifyMessage received: peer:${o} message:${rt}`),this.receivedMessages.has(rt)?!0:(this.receivedMessages.add(rt),!1)}notifyMessageSent(o,tt){const rt=o.toString(),nt=this.buildMessageHash(tt);if(log$h.info(`notifyMessage sent debug: ${bytesToUtf8(tt.payload)}`),this.scheduledVerification.has(rt)){log$h.warn(`notifyMessage sent: attempting to schedule verification for pending peer:${rt} message:${nt}`);return}const ot=window.setTimeout(async()=>{const it=this.verifiedPeers.has(rt),st=this.receivedMessagesFormPeer.has(`${rt}-${nt}`);if(it||st){log$h.info(`notifyMessage sent setTimeout: verified that peer pushes filter messages, peer:${rt} message:${nt}`);return}log$h.warn(`notifyMessage sent setTimeout: peer didn't return probe message, attempting renewAndSubscribe, peer:${rt} message:${nt}`),this.scheduledVerification.delete(rt),await this.renewAndSubscribePeer(o)},MESSAGE_VERIFICATION_DELAY);this.scheduledVerification.set(rt,ot)}shouldVerifyPeer(o){const tt=o.toString(),rt=this.verifiedPeers.has(tt),nt=this.scheduledVerification.has(tt);return!(rt||nt)}buildMessageHash(o){return messageHashStr(this.pubsubTopic,o)}async renewAndSubscribePeer(o){const tt=o.toString();try{if(this.peerRenewalLocks.has(tt)){log$h.info(`Peer ${tt} is already being renewed.`);return}this.peerRenewalLocks.add(tt);const rt=await this.renewPeer(o);if(!rt){log$h.warn(`Failed to renew peer ${tt}: No new peer found.`);return}return await this.protocolSubscribe(this.pubsubTopic,rt,this.getContentTopics()),await this.sendLightPushMessage(rt),this.peerFailures.delete(tt),rt}catch(rt){log$h.error(`Failed to renew peer ${tt}: ${rt}.`);return}finally{this.peerRenewalLocks.delete(tt)}}}const Ln=class Ln{static createReceiverMonitor(o,tt,rt,nt,ot,it,st){if(Ln.receiverMonitors.has(o))return Ln.receiverMonitors.get(o);const at=new ReceiverReliabilityMonitor(o,tt,rt,nt,ot,it,st);return Ln.receiverMonitors.set(o,at),at}constructor(){}static stop(o){this.receiverMonitors.delete(o)}static stopAll(){for(const[o,tt]of this.receiverMonitors)tt.setMaxPingFailures(void 0),this.receiverMonitors.delete(o)}};wt(Ln,"receiverMonitors",new Map);let ReliabilityMonitorManager=Ln;const log$g=new Logger$1("sdk:filter:subscription_manager");class SubscriptionManager{constructor(o,tt,rt,nt,ot,it,st){wt(this,"pubsubTopic");wt(this,"protocol");wt(this,"connectionManager");wt(this,"getPeers");wt(this,"renewPeer");wt(this,"libp2p");wt(this,"lightPush");wt(this,"reliabilityMonitor");wt(this,"keepAliveTimeout",DEFAULT_KEEP_ALIVE);wt(this,"keepAliveInterval",null);wt(this,"enableLightPushFilterCheck",DEFAULT_LIGHT_PUSH_FILTER_CHECK);wt(this,"subscriptionCallbacks");this.pubsubTopic=o,this.protocol=tt,this.connectionManager=rt,this.getPeers=nt,this.renewPeer=ot,this.libp2p=it,this.lightPush=st,this.pubsubTopic=o,this.subscriptionCallbacks=new Map,this.reliabilityMonitor=ReliabilityMonitorManager.createReceiverMonitor(this.pubsubTopic,this.getPeers.bind(this),this.renewPeer.bind(this),()=>Array.from(this.subscriptionCallbacks.keys()),this.protocol.subscribe.bind(this.protocol),this.protocol.addLibp2pEventListener.bind(this.protocol),this.sendLightPushCheckMessage.bind(this))}async subscribe(o,tt,rt=DEFAULT_SUBSCRIBE_OPTIONS){this.reliabilityMonitor.setMaxPingFailures(rt.pingsBeforePeerRenewed),this.keepAliveTimeout=rt.keepAlive||DEFAULT_KEEP_ALIVE,this.enableLightPushFilterCheck=(rt==null?void 0:rt.enableLightPushFilterCheck)||DEFAULT_LIGHT_PUSH_FILTER_CHECK;const nt=Array.isArray(o)?o:[o];for(const lt of nt)if(lt.pubsubTopic!==this.pubsubTopic)return{failures:[{error:ProtocolError$1.TOPIC_DECODER_MISMATCH}],successes:[]};this.enableLightPushFilterCheck&&nt.push(createDecoder(this.buildLightPushContentTopic(),this.pubsubTopic));const ot=groupByContentTopic(nt),it=Array.from(ot.keys()),st=this.getPeers().map(async lt=>this.subscribeWithPeerVerification(lt,it)),at=await Promise.allSettled(st),ct=this.handleResult(at,"subscribe");return ot.forEach((lt,dt)=>{const ht={decoders:lt,callback:tt};dt!==this.buildLightPushContentTopic()&&this.subscriptionCallbacks.set(dt,ht)}),this.startSubscriptionsMaintenance(this.keepAliveTimeout),ct}async unsubscribe(o){const tt=this.getPeers().map(async ot=>{const it=await this.protocol.unsubscribe(this.pubsubTopic,ot,o);return o.forEach(st=>{this.subscriptionCallbacks.delete(st)}),it}),rt=await Promise.allSettled(tt),nt=this.handleResult(rt,"unsubscribe");return this.subscriptionCallbacks.size===0&&this.stopSubscriptionsMaintenance(),nt}async ping(o){log$g.info("Sending keep-alive ping");const rt=(o?[o]:this.getPeers().map(ot=>ot.id)).map(ot=>this.pingSpecificPeer(ot)),nt=await Promise.allSettled(rt);return this.handleResult(nt,"ping")}async unsubscribeAll(){const o=this.getPeers().map(async nt=>this.protocol.unsubscribeAll(this.pubsubTopic,nt)),tt=await Promise.allSettled(o);this.subscriptionCallbacks.clear();const rt=this.handleResult(tt,"unsubscribeAll");return this.stopSubscriptionsMaintenance(),rt}async processIncomingMessage(o,tt){if(this.reliabilityMonitor.notifyMessageReceived(tt,o)){log$g.info("Message already received, skipping");return}const{contentTopic:nt}=o,ot=this.subscriptionCallbacks.get(nt);if(!ot){log$g.error("No subscription callback available for ",nt);return}log$g.info("Processing message with content topic ",nt," on pubsub topic ",this.pubsubTopic),await pushMessage(ot,this.pubsubTopic,o)}async subscribeWithPeerVerification(o,tt){const rt=await this.protocol.subscribe(this.pubsubTopic,o,tt);return await this.sendLightPushCheckMessage(o),rt}handleResult(o,tt){const rt={failures:[],successes:[]};for(const nt of o)if(nt.status==="rejected")log$g.error(`Failed to resolve ${tt} promise successfully: `,nt.reason),rt.failures.push({error:ProtocolError$1.GENERIC_FAIL});else{const ot=nt.value;ot.failure?rt.failures.push(ot.failure):rt.successes.push(ot.success)}return rt}async pingSpecificPeer(o){var nt,ot;const tt=this.getPeers().find(it=>it.id.equals(o));if(!tt)return{success:null,failure:{peerId:o,error:ProtocolError$1.NO_PEER_AVAILABLE}};let rt;try{rt=await this.protocol.ping(tt)}catch{rt={success:null,failure:{peerId:o,error:ProtocolError$1.GENERIC_FAIL}}}return log$g.info(`Received result from filter ping peerId:${o.toString()} success:${(nt=rt.success)==null?void 0:nt.toString()} failure:${(ot=rt.failure)==null?void 0:ot.error}`),await this.reliabilityMonitor.handlePingResult(o,rt),rt}startSubscriptionsMaintenance(o){log$g.info("Starting subscriptions maintenance"),this.startKeepAlivePings(o),this.startConnectionListener()}stopSubscriptionsMaintenance(){log$g.info("Stopping subscriptions maintenance"),this.stopKeepAlivePings(),this.stopConnectionListener()}startConnectionListener(){this.connectionManager.addEventListener(EConnectionStateEvents.CONNECTION_STATUS,this.connectionListener.bind(this))}stopConnectionListener(){this.connectionManager.removeEventListener(EConnectionStateEvents.CONNECTION_STATUS,this.connectionListener.bind(this))}async connectionListener({detail:o}){if(!o){this.stopKeepAlivePings();return}try{await this.ping()}catch(tt){log$g.error(`networkStateListener failed to recover: ${tt}`)}this.startKeepAlivePings(this.keepAliveTimeout)}startKeepAlivePings(o){if(this.keepAliveInterval){log$g.info("Recurring pings already set up.");return}this.keepAliveInterval=setInterval(()=>{this.ping()},o)}stopKeepAlivePings(){if(!this.keepAliveInterval){log$g.info("Already stopped recurring pings.");return}log$g.info("Stopping recurring pings."),clearInterval(this.keepAliveInterval),this.keepAliveInterval=null}async sendLightPushCheckMessage(o){if(this.lightPush&&this.libp2p&&this.reliabilityMonitor.shouldVerifyPeer(o.id)){const tt=createEncoder({contentTopic:this.buildLightPushContentTopic(),pubsubTopic:this.pubsubTopic,ephemeral:!0}),rt={payload:new Uint8Array(1)},nt=await tt.toProtoObj(rt);setTimeout(async()=>{const ot=await this.lightPush.protocol.send(tt,rt,o);if(this.reliabilityMonitor.notifyMessageSent(o.id,nt),ot.failure){log$g.error(`failed to send lightPush ping message to peer:${o.id.toString()} ${ot.failure.error}`);return}},DEFAULT_LIGHT_PUSH_FILTER_CHECK_INTERVAL)}}buildLightPushContentTopic(){return`/js-waku-subscription-ping/1/${this.libp2p.peerId.toString()}/utf8`}}async function pushMessage(et,o,tt){const{decoders:rt,callback:nt}=et,{contentTopic:ot}=tt;if(!ot){log$g.warn("Message has no content topic, skipping");return}try{const it=rt.map(at=>at.fromProtoObj(o,tt).then(ct=>ct||Promise.reject("Decoding failed"))),st=await Promise.any(it);await nt(st)}catch(it){log$g.error("Error decoding message",it)}}const log$f=new Logger$1("sdk:filter");class Filter extends BaseProtocolSDK{constructor(tt,rt,nt,ot){super(new FilterCore(async(it,st,at)=>{const ct=this.getActiveSubscription(it);if(!ct){log$f.error(`No subscription locally registered for topic ${it}`);return}await ct.processIncomingMessage(st,at)},tt.configuredPubsubTopics,rt),tt,{numPeersToUse:ot==null?void 0:ot.numPeersToUse});wt(this,"libp2p");wt(this,"lightPush");wt(this,"protocol");wt(this,"activeSubscriptions",new Map);this.libp2p=rt,this.lightPush=nt,this.protocol=this.core,this.activeSubscriptions=new Map}async subscribe(tt,rt,nt,ot=DEFAULT_SUBSCRIBE_OPTIONS){const it=this.getUniquePubsubTopics(tt);if(it.length!==1)return{subscription:null,error:ProtocolError$1.INVALID_DECODER_TOPICS,results:null};const st=it[0],{subscription:at,error:ct}=await this.createSubscription(st,nt);if(ct)return{subscription:null,error:ct,results:null};const{failures:lt,successes:dt}=await at.subscribe(tt,rt,ot);return{subscription:at,error:null,results:{failures:lt,successes:dt}}}async createSubscription(tt,rt){var st;rt={autoRetry:!0,...rt};const nt=typeof tt=="string"?tt:(st=shardInfoToPubsubTopics(tt))==null?void 0:st[0];return ensurePubsubTopicIsConfigured(nt,this.protocol.pubsubTopics),await this.hasPeers(rt)?(log$f.info(`Creating filter subscription with ${this.connectedPeers.length} peers: `,this.connectedPeers.map(at=>at.id.toString())),{error:null,subscription:this.getActiveSubscription(nt)??this.setActiveSubscription(nt,new SubscriptionManager(nt,this.protocol,this.connectionManager,()=>this.connectedPeers,this.renewPeer.bind(this),this.libp2p,this.lightPush))}):{error:ProtocolError$1.NO_PEER_AVAILABLE,subscription:null}}async subscribeWithUnsubscribe(tt,rt,nt=DEFAULT_SUBSCRIBE_OPTIONS){const ot=this.getUniquePubsubTopics(tt);if(ot.length===0)throw Error("Failed to subscribe: no pubsubTopic found on decoders provided.");if(ot.length>1)throw Error("Failed to subscribe: all decoders should have the same pubsub topic. Use createSubscription to be more agile.");const{subscription:it,error:st}=await this.createSubscription(ot[0]);if(st)throw Error(`Failed to create subscription: ${st}`);await it.subscribe(tt,rt,nt);const at=Array.from(groupByContentTopic(Array.isArray(tt)?tt:[tt]).keys());return async()=>{await it.unsubscribe(at)}}toSubscriptionIterator(tt){return toAsyncIterator(this,tt)}getActiveSubscription(tt){return this.activeSubscriptions.get(tt)}setActiveSubscription(tt,rt){return this.activeSubscriptions.set(tt,rt),rt}getUniquePubsubTopics(tt){return Array.isArray(tt)?tt.length===0?[]:[...new Set(tt.map(nt=>nt.pubsubTopic))]:[tt.pubsubTopic]}}function wakuFilter(et,o,tt){return rt=>new Filter(et,rt,o,tt)}const log$e=new Logger$1("sdk:light-push"),DEFAULT_MAX_ATTEMPTS=3,DEFAULT_SEND_OPTIONS={autoRetry:!1,maxAttempts:DEFAULT_MAX_ATTEMPTS};class LightPush{constructor(o,tt,rt){wt(this,"libp2p");wt(this,"numPeersToUse",DEFAULT_NUM_PEERS_TO_USE);wt(this,"protocol");this.libp2p=tt,this.numPeersToUse=(rt==null?void 0:rt.numPeersToUse)??DEFAULT_NUM_PEERS_TO_USE,this.protocol=new LightPushCore(o.configuredPubsubTopics,tt)}async send(o,tt,rt=DEFAULT_SEND_OPTIONS){const nt=[],ot=[],{pubsubTopic:it}=o;try{ensurePubsubTopicIsConfigured(it,this.protocol.pubsubTopics)}catch{return log$e.error("Failed to send waku light push: pubsub topic not configured"),{successes:nt,failures:[{error:ProtocolError$1.TOPIC_NOT_CONFIGURED}]}}const st=await this.getConnectedPeers();if(st.length===0)return{successes:nt,failures:[{error:ProtocolError$1.NO_PEER_AVAILABLE}]};const at=await Promise.allSettled(st.map(ct=>this.protocol.send(o,tt,ct)));for(const ct of at){if(ct.status!=="fulfilled"){log$e.error("Failed unexpectedly while sending:",ct.reason),ot.push({error:ProtocolError$1.GENERIC_FAIL});continue}const{failure:lt,success:dt}=ct.value;if(dt){nt.push(dt);continue}lt&&(ot.push(lt),rt!=null&&rt.autoRetry&&this.attemptRetries(ht=>this.protocol.send(o,tt,ht),rt.maxAttempts))}return getHealthManager().updateProtocolHealth(this.protocol.multicodec,nt.length),{successes:nt,failures:ot}}async attemptRetries(o,tt){var nt;tt=tt||DEFAULT_MAX_ATTEMPTS;const rt=await this.getConnectedPeers();if(rt.length===0){log$e.warn("Cannot retry with no connected peers.");return}for(let ot=0;ot<tt;ot++){const it=rt[ot%rt.length],st=await o(it);if(st.success)return;log$e.info(`Attempted retry for peer:${it.id} failed with:${(nt=st==null?void 0:st.failure)==null?void 0:nt.error}`)}}async getConnectedPeers(){const o=this.libp2p.getPeers();return o.length===0?[]:(await Promise.all(o.map(async rt=>{try{return await this.libp2p.peerStore.get(rt)}catch{return null}}))).filter(rt=>!!rt).filter(rt=>rt.protocols.includes(LightPushCodec)).slice(0,this.numPeersToUse)}}function wakuLightPush(et,o={}){return tt=>new LightPush(et,tt,o)}const DEFAULT_NUM_PEERS=1,log$d=new Logger$1("waku:store:sdk");class Store extends BaseProtocolSDK{constructor(tt,rt,nt){super(new StoreCore(tt.configuredPubsubTopics,rt),tt,{numPeersToUse:DEFAULT_NUM_PEERS});wt(this,"peerIdStrToUse");wt(this,"protocol");this.peerIdStrToUse=nt,this.protocol=this.core}async*queryGenerator(tt,rt){const{pubsubTopic:nt,contentTopics:ot,decodersAsMap:it}=this.validateDecodersAndPubsubTopic(tt),st={pubsubTopic:nt,contentTopics:ot,includeData:!0,paginationForward:!0,...rt},at=(await this.protocol.getPeers({numPeers:this.numPeersToUse,maxBootstrapPeers:1,peerIdStr:this.peerIdStrToUse}))[0];if(!at)throw log$d.error("No peers available to query"),new Error("No peers available to query");log$d.info(`Querying store with options: ${JSON.stringify(rt)}`);const ct=this.protocol.queryPerPage(st,it,at);for await(const lt of ct)yield lt}async queryWithOrderedCallback(tt,rt,nt){log$d.info("Querying store with ordered callback");for await(const ot of this.queryGenerator(tt,nt))if(await this.processMessages(ot,rt))break}async queryWithPromiseCallback(tt,rt,nt){log$d.info("Querying store with promise callback");let ot=!1;for await(const it of this.queryGenerator(tt,nt)){const st=it.map(async at=>{ot||(ot=!!await rt(at))});if(await Promise.all(st),ot)break}}async processMessages(tt,rt){let nt=!1;const it=(await Promise.all(tt)).filter(isDefined);return await Promise.all(it.map(async st=>{st&&!nt&&(nt=!!await rt(st))})),nt}createCursor(tt){return messageHash(tt.pubsubTopic,tt)}validateDecodersAndPubsubTopic(tt){if(tt.length===0)throw log$d.error("No decoders provided"),new Error("No decoders provided");const rt=Array.from(new Set(tt.map(st=>st.pubsubTopic)));if(rt.length>1)throw log$d.error("API does not support querying multiple pubsub topics at once"),new Error("API does not support querying multiple pubsub topics at once");const nt=rt[0];ensurePubsubTopicIsConfigured(nt,this.protocol.pubsubTopics);const ot=new Map;tt.forEach(st=>{if(ot.has(st.contentTopic))throw log$d.error("API does not support different decoder per content topic"),new Error("API does not support different decoder per content topic");ot.set(st.contentTopic,st)});const it=tt.filter(st=>st.pubsubTopic===nt).map(st=>st.contentTopic);if(it.length===0)throw log$d.error(`No decoders found for topic ${nt}`),new Error("No decoders found for topic "+nt);return{pubsubTopic:nt,contentTopics:it,decodersAsMap:ot}}}function wakuStore(et,o){return tt=>new Store(et,tt,o)}const log$c=new Logger$1("wait-for-remote-peer");async function waitForRemotePeer(et,o,tt){o=o!=null&&o.length?o:getEnabledProtocols(et);const rt=et.libp2p.getConnections();if(!et.isStarted())throw Error("Waku node is not started");if(rt.length>0&&!o.includes(Protocols.Relay)&&await waitForMetadata(et,o))return;const nt=[];if(o.includes(Protocols.Relay)){if(!et.relay)throw Error("Cannot wait for Relay peer: protocol not mounted");nt.push(et.relay.waitForPeers())}if(o.includes(Protocols.Store)){if(!et.store)throw Error("Cannot wait for Store peer: protocol not mounted");nt.push(waitForConnectedPeer(StoreCodec,et.libp2p))}if(o.includes(Protocols.LightPush)){if(!et.lightPush)throw Error("Cannot wait for LightPush peer: protocol not mounted");nt.push(waitForConnectedPeer(LightPushCodec,et.libp2p))}if(o.includes(Protocols.Filter)){if(!et.filter)throw new Error("Cannot wait for Filter peer: protocol not mounted");nt.push(waitForConnectedPeer(FilterCodecs.SUBSCRIBE,et.libp2p))}tt?await rejectOnTimeout(Promise.all(nt),tt,"Timed out waiting for a remote peer."):await Promise.all(nt)}async function waitForConnectedPeer(et,o){log$c.info(`Waiting for ${et} peer.`),await new Promise(tt=>{const rt=async nt=>{var ot,it;if((it=(ot=nt.detail)==null?void 0:ot.protocols)!=null&&it.includes(et)){const st=o.services.metadata;if(!st){o.removeEventListener("peer:identify",rt),tt();return}try{await st.confirmOrAttemptHandshake(nt.detail.peerId),o.removeEventListener("peer:identify",rt),tt()}catch(at){at.code==="ERR_CONNECTION_BEING_CLOSED"&&log$c.error("Connection closed. Some peers can be on different shard."),log$c.error(`Error waiting for metadata: ${at}`)}}};o.addEventListener("peer:identify",rt)})}async function waitForMetadata(et,o){const tt=et.libp2p.getPeers(),rt=et.libp2p.services.metadata,nt=mapProtocolsToCodecs(o);if(!tt.length||!rt)return log$c.info(`Skipping waitForMetadata due to missing connections:${tt.length} or metadataService:${!!rt}`),!1;for(const ot of tt)try{const it=await et.libp2p.peerStore.get(ot);if(it.protocols.some(at=>nt.has(at))&&!(await rt.confirmOrAttemptHandshake(ot)).error&&(it.protocols.forEach(lt=>{nt.has(lt)&&nt.set(lt,!0)}),Array.from(nt.values()).every(lt=>lt)))return!0}catch(it){it.code==="ERR_CONNECTION_BEING_CLOSED"&&log$c.error("Connection closed. Some peers can be on different shard."),log$c.error(`Error while iterating through peers: ${it}`);continue}return!1}const awaitTimeout=(et,o)=>new Promise((tt,rt)=>setTimeout(()=>rt(Error(o)),et));async function rejectOnTimeout(et,o,tt){await Promise.race([et,awaitTimeout(o,tt)])}function getEnabledProtocols(et){const o=[];return et.relay&&o.push(Protocols.Relay),et.filter&&o.push(Protocols.Filter),et.store&&o.push(Protocols.Store),et.lightPush&&o.push(Protocols.LightPush),o}function mapProtocolsToCodecs(et){const o=new Map,tt={[Protocols.Filter]:FilterCodecs.SUBSCRIBE,[Protocols.LightPush]:LightPushCodec,[Protocols.Store]:StoreCodec};for(const rt of et)tt[rt]&&o.set(tt[rt],!1);return o}const DefaultPingKeepAliveValueSecs=5*60,DefaultRelayKeepAliveValueSecs=5*60,DefaultUserAgent="js-waku",DefaultPingMaxInboundStreams=10,log$b=new Logger$1("waku");class WakuNode{constructor(o,tt,rt,nt,ot){wt(this,"pubsubTopics");wt(this,"libp2p");wt(this,"relay");wt(this,"store");wt(this,"filter");wt(this,"lightPush");wt(this,"connectionManager");wt(this,"health");var ct;this.pubsubTopics=o,this.relay=ot,this.libp2p=rt,nt={filter:!1,lightpush:!1,store:!1,...nt};const it=tt.pingKeepAlive||DefaultPingKeepAliveValueSecs,st=this.relay?tt.relayKeepAlive||DefaultRelayKeepAliveValueSecs:0,at=this.libp2p.peerId.toString();if(this.connectionManager=ConnectionManager.create(at,rt,{pingKeepAlive:it,relayKeepAlive:st},this.pubsubTopics,this.relay),this.health=getHealthManager(),nt.store){let lt;(ct=tt.nodeToUse)!=null&&ct.store&&this.dialMultiaddr(tt.nodeToUse.store,StoreCodec).catch(ht=>{log$b.error("Failed to dial store peer",ht)});const dt=wakuStore(this.connectionManager,lt);this.store=dt(rt)}if(nt.lightpush){const lt=wakuLightPush(this.connectionManager,tt);this.lightPush=lt(rt)}if(nt.filter){const lt=wakuFilter(this.connectionManager,this.lightPush,tt);this.filter=lt(rt)}log$b.info("Waku node created",at,`relay: ${!!this.relay}, store: ${!!this.store}, light push: ${!!this.lightPush}, filter: ${!!this.filter}`)}get peerId(){return this.libp2p.peerId}get protocols(){return this.libp2p.getProtocols()}async dial(o,tt){const rt=tt??[],nt=this.mapToPeerIdOrMultiaddr(o);typeof tt>"u"&&(this.relay&&rt.push(Protocols.Relay),this.store&&rt.push(Protocols.Store),this.filter&&rt.push(Protocols.Filter),this.lightPush&&rt.push(Protocols.LightPush));const ot=[];return rt.includes(Protocols.Relay)&&(this.relay?this.relay.gossipSub.multicodecs.forEach(it=>ot.push(it)):log$b.error("Relay codec not included in dial codec: protocol not mounted locally")),rt.includes(Protocols.Store)&&(this.store?ot.push(this.store.protocol.multicodec):log$b.error("Store codec not included in dial codec: protocol not mounted locally")),rt.includes(Protocols.LightPush)&&(this.lightPush?ot.push(this.lightPush.protocol.multicodec):log$b.error("Light Push codec not included in dial codec: protocol not mounted locally")),rt.includes(Protocols.Filter)&&(this.filter?ot.push(this.filter.protocol.multicodec):log$b.error("Filter codec not included in dial codec: protocol not mounted locally")),log$b.info(`Dialing to ${nt.toString()} with protocols ${rt}`),this.libp2p.dialProtocol(nt,ot)}async start(){await this.libp2p.start()}async stop(){ReliabilityMonitorManager.stopAll(),this.connectionManager.stop(),await this.libp2p.stop()}async waitForPeers(o,tt){return waitForRemotePeer(this,o,tt)}isStarted(){return this.libp2p.status=="started"}isConnected(){return this.connectionManager.isConnected()}async dialMultiaddr(o,tt){const rt=multiaddr(o);if(!rt.getPeerId())throw new Error("Failed to dial multiaddr: missing peer ID");return await this.libp2p.dialProtocol(rt,[tt]),rt.getPeerId()}mapToPeerIdOrMultiaddr(o){return isPeerId$2(o)?o:multiaddr(o)}}var hs;let InvalidParametersError$3=(hs=class extends Error{constructor(o="Invalid parameters"){super(o),this.name="InvalidParametersError"}},wt(hs,"name","InvalidParametersError"),hs);class InvalidPublicKeyError extends Error{constructor(o="Invalid public key"){super(o),this.name="InvalidPublicKeyError"}}wt(InvalidPublicKeyError,"name","InvalidPublicKeyError");var ps;let UnsupportedKeyTypeError$1=(ps=class extends Error{constructor(o="Unsupported key type"){super(o),this.name="UnsupportedKeyTypeError"}},wt(ps,"name","UnsupportedKeyTypeError"),ps);function equals$b(et,o){if(et===o)return!0;if(et.byteLength!==o.byteLength)return!1;for(let tt=0;tt<et.byteLength;tt++)if(et[tt]!==o[tt])return!1;return!0}function coerce$h(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function fromString$q(et){return new TextEncoder().encode(et)}function toString$r(et){return new TextDecoder().decode(et)}function base$i(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt<tt.length;rt++)tt[rt]=255;for(var nt=0;nt<et.length;nt++){var ot=et.charAt(nt),it=ot.charCodeAt(0);if(tt[it]!==255)throw new TypeError(ot+" is ambiguous");tt[it]=nt}var st=et.length,at=et.charAt(0),ct=Math.log(st)/Math.log(256),lt=Math.log(256)/Math.log(st);function dt(ft){if(ft instanceof Uint8Array||(ArrayBuffer.isView(ft)?ft=new Uint8Array(ft.buffer,ft.byteOffset,ft.byteLength):Array.isArray(ft)&&(ft=Uint8Array.from(ft))),!(ft instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(ft.length===0)return"";for(var pt=0,yt=0,gt=0,bt=ft.length;gt!==bt&&ft[gt]===0;)gt++,pt++;for(var xt=(bt-gt)*lt+1>>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct<yt)&&St!==-1;St--,Ct++)Et+=256*vt[St]>>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At<xt;++At)kt+=et.charAt(vt[At]);return kt}function ht(ft){if(typeof ft!="string")throw new TypeError("Expected String");if(ft.length===0)return new Uint8Array;var pt=0;if(ft[pt]!==" "){for(var yt=0,gt=0;ft[pt]===at;)yt++,pt++;for(var bt=(ft.length-pt)*ct+1>>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et<gt)&&Ct!==-1;Ct--,Et++)vt+=st*xt[Ct]>>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$i=base$i,_brrp__multiformats_scope_baseX$h=src$i;let Encoder$i=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$i=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$j(this,o)}},ComposedDecoder$h=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$j(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$j(et,o){return new ComposedDecoder$h({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$h=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$i(o,tt,rt),this.decoder=new Decoder$i(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$k({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$h(et,o,tt,rt)}function baseX$h({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$h(tt,et);return from$k({prefix:o,name:et,encode:rt,decode:ot=>coerce$h(nt(ot))})}function decode$O(et,o,tt,rt){const nt={};for(let lt=0;lt<o.length;++lt)nt[o[lt]]=lt;let ot=et.length;for(;et[ot-1]==="=";)--ot;const it=new Uint8Array(ot*tt/8|0);let st=0,at=0,ct=0;for(let lt=0;lt<ot;++lt){const dt=nt[et[lt]];if(dt===void 0)throw new SyntaxError(`Non-${rt} character`);at=at<<tt|dt,st+=tt,st>=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$G(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<<tt)-1;let ot="",it=0,st=0;for(let at=0;at<et.length;++at)for(st=st<<8|et[at],it+=8;it>tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<<tt-it]),rt)for(;ot.length*tt&7;)ot+="=";return ot}function rfc4648$g({name:et,prefix:o,bitsPerChar:tt,alphabet:rt}){return from$k({prefix:o,name:et,encode(nt){return encode$G(nt,rt,tt)},decode(nt){return decode$O(nt,rt,tt,et)}})}const base58btc$h=baseX$h({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr$d=baseX$h({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58$d=Object.freeze(Object.defineProperty({__proto__:null,base58btc:base58btc$h,base58flickr:base58flickr$d},Symbol.toStringTag,{value:"Module"})),base32$u=rfc4648$g({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper$d=rfc4648$g({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad$d=rfc4648$g({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper$d=rfc4648$g({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex$d=rfc4648$g({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper$d=rfc4648$g({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad$d=rfc4648$g({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper$d=rfc4648$g({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z$d=rfc4648$g({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$v=Object.freeze(Object.defineProperty({__proto__:null,base32:base32$u,base32hex:base32hex$d,base32hexpad:base32hexpad$d,base32hexpadupper:base32hexpadupper$d,base32hexupper:base32hexupper$d,base32pad:base32pad$d,base32padupper:base32padupper$d,base32upper:base32upper$d,base32z:base32z$d},Symbol.toStringTag,{value:"Module"})),base36$r=baseX$h({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper$d=baseX$h({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$s=Object.freeze(Object.defineProperty({__proto__:null,base36:base36$r,base36upper:base36upper$d},Symbol.toStringTag,{value:"Module"}));var encode_1$4=encode$F,MSB$6=128,REST$6=127,MSBALL$4=~REST$6,INT$4=Math.pow(2,31);function encode$F(et,o,tt){o=o||[],tt=tt||0;for(var rt=tt;et>=INT$4;)o[tt++]=et&255|MSB$6,et/=128;for(;et&MSBALL$4;)o[tt++]=et&255|MSB$6,et>>>=7;return o[tt]=et|0,encode$F.bytes=tt-rt+1,o}var decode$N=read$5,MSB$1$4=128,REST$1$4=127;function read$5(et,rt){var tt=0,rt=rt||0,nt=0,ot=rt,it,st=et.length;do{if(ot>=st)throw read$5.bytes=0,new RangeError("Could not decode varint");it=et[ot++],tt+=nt<28?(it&REST$1$4)<<nt:(it&REST$1$4)*Math.pow(2,nt),nt+=7}while(it>=MSB$1$4);return read$5.bytes=ot-rt,tt}var N1$4=Math.pow(2,7),N2$4=Math.pow(2,14),N3$4=Math.pow(2,21),N4$4=Math.pow(2,28),N5$4=Math.pow(2,35),N6$4=Math.pow(2,42),N7$4=Math.pow(2,49),N8$4=Math.pow(2,56),N9$4=Math.pow(2,63),length$4=function(et){return et<N1$4?1:et<N2$4?2:et<N3$4?3:et<N4$4?4:et<N5$4?5:et<N6$4?6:et<N7$4?7:et<N8$4?8:et<N9$4?9:10},varint$4={encode:encode_1$4,decode:decode$N,encodingLength:length$4},_brrp_varint$4=varint$4;function decode$M(et,o=0){return[_brrp_varint$4.decode(et,o),_brrp_varint$4.decode.bytes]}function encodeTo$2(et,o,tt=0){return _brrp_varint$4.encode(et,o,tt),o}function encodingLength$4(et){return _brrp_varint$4.encodingLength(et)}function create$5(et,o){const tt=o.byteLength,rt=encodingLength$4(et),nt=rt+encodingLength$4(tt),ot=new Uint8Array(nt+tt);return encodeTo$2(et,ot,0),encodeTo$2(tt,ot,rt),ot.set(o,nt),new Digest$4(et,tt,o,ot)}function decode$L(et){const o=coerce$h(et),[tt,rt]=decode$M(o),[nt,ot]=decode$M(o.subarray(rt)),it=o.subarray(rt+ot);if(it.byteLength!==nt)throw new Error("Incorrect length");return new Digest$4(tt,nt,it,o)}function equals$a(et,o){if(et===o)return!0;{const tt=o;return et.code===tt.code&&et.size===tt.size&&tt.bytes instanceof Uint8Array&&equals$b(et.bytes,tt.bytes)}}let Digest$4=class{constructor(o,tt,rt,nt){wt(this,"code");wt(this,"size");wt(this,"digest");wt(this,"bytes");this.code=o,this.size=tt,this.digest=rt,this.bytes=nt}};function format$2(et,o){const{bytes:tt,version:rt}=et;switch(rt){case 0:return toStringV0$2(tt,baseCache$2(et),o??base58btc$h.encoder);default:return toStringV1$2(tt,baseCache$2(et),o??base32$u.encoder)}}const cache$3=new WeakMap;function baseCache$2(et){const o=cache$3.get(et);if(o==null){const tt=new Map;return cache$3.set(et,tt),tt}return o}var ba;let CID$2=class Nr{constructor(o,tt,rt,nt){wt(this,"code");wt(this,"version");wt(this,"multihash");wt(this,"bytes");wt(this,"/");wt(this,ba,"CID");this.code=tt,this.version=o,this.multihash=rt,this.bytes=nt,this["/"]=nt}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{const{code:o,multihash:tt}=this;if(o!==DAG_PB_CODE$2)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(tt.code!==SHA_256_CODE$2)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return Nr.createV0(tt)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{const{code:o,digest:tt}=this.multihash,rt=create$5(o,tt);return Nr.createV1(this.code,rt)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(o){return Nr.equals(this,o)}static equals(o,tt){const rt=tt;return rt!=null&&o.code===rt.code&&o.version===rt.version&&equals$a(o.multihash,rt.multihash)}toString(o){return format$2(this,o)}toJSON(){return{"/":format$2(this)}}link(){return this}[(ba=Symbol.toStringTag,Symbol.for("nodejs.util.inspect.custom"))](){return`CID(${this.toString()})`}static asCID(o){if(o==null)return null;const tt=o;if(tt instanceof Nr)return tt;if(tt["/"]!=null&&tt["/"]===tt.bytes||tt.asCID===tt){const{version:rt,code:nt,multihash:ot,bytes:it}=tt;return new Nr(rt,nt,ot,it??encodeCID$2(rt,nt,ot.bytes))}else if(tt[cidSymbol$2]===!0){const{version:rt,multihash:nt,code:ot}=tt,it=decode$L(nt);return Nr.create(rt,ot,it)}else return null}static create(o,tt,rt){if(typeof tt!="number")throw new Error("String codecs are no longer supported");if(!(rt.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(o){case 0:{if(tt!==DAG_PB_CODE$2)throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE$2}) block encoding`);return new Nr(o,tt,rt,rt.bytes)}case 1:{const nt=encodeCID$2(o,tt,rt.bytes);return new Nr(o,tt,rt,nt)}default:throw new Error("Invalid version")}}static createV0(o){return Nr.create(0,DAG_PB_CODE$2,o)}static createV1(o,tt){return Nr.create(1,o,tt)}static decode(o){const[tt,rt]=Nr.decodeFirst(o);if(rt.length!==0)throw new Error("Incorrect length");return tt}static decodeFirst(o){const tt=Nr.inspectBytes(o),rt=tt.size-tt.multihashSize,nt=coerce$h(o.subarray(rt,rt+tt.multihashSize));if(nt.byteLength!==tt.multihashSize)throw new Error("Incorrect length");const ot=nt.subarray(tt.multihashSize-tt.digestSize),it=new Digest$4(tt.multihashCode,tt.digestSize,ot,nt);return[tt.version===0?Nr.createV0(it):Nr.createV1(tt.codec,it),o.subarray(tt.size)]}static inspectBytes(o){let tt=0;const rt=()=>{const[dt,ht]=decode$M(o.subarray(tt));return tt+=ht,dt};let nt=rt(),ot=DAG_PB_CODE$2;if(nt===18?(nt=0,tt=0):ot=rt(),nt!==0&&nt!==1)throw new RangeError(`Invalid CID version ${nt}`);const it=tt,st=rt(),at=rt(),ct=tt+at,lt=ct-it;return{version:nt,codec:ot,multihashCode:st,digestSize:at,multihashSize:lt,size:ct}}static parse(o,tt){const[rt,nt]=parseCIDtoBytes$2(o,tt),ot=Nr.decode(nt);if(ot.version===0&&o[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return baseCache$2(ot).set(rt,o),ot}};function parseCIDtoBytes$2(et,o){switch(et[0]){case"Q":{const tt=o??base58btc$h;return[base58btc$h.prefix,tt.decode(`${base58btc$h.prefix}${et}`)]}case base58btc$h.prefix:{const tt=o??base58btc$h;return[base58btc$h.prefix,tt.decode(et)]}case base32$u.prefix:{const tt=o??base32$u;return[base32$u.prefix,tt.decode(et)]}case base36$r.prefix:{const tt=o??base36$r;return[base36$r.prefix,tt.decode(et)]}default:{if(o==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[et[0],o.decode(et)]}}}function toStringV0$2(et,o,tt){const{prefix:rt}=tt;if(rt!==base58btc$h.prefix)throw Error(`Cannot string encode V0 in ${tt.name} encoding`);const nt=o.get(rt);if(nt==null){const ot=tt.encode(et).slice(1);return o.set(rt,ot),ot}else return nt}function toStringV1$2(et,o,tt){const{prefix:rt}=tt,nt=o.get(rt);if(nt==null){const ot=tt.encode(et);return o.set(rt,ot),ot}else return nt}const DAG_PB_CODE$2=112,SHA_256_CODE$2=18;function encodeCID$2(et,o,tt){const rt=encodingLength$4(et),nt=rt+encodingLength$4(o),ot=new Uint8Array(nt+tt.byteLength);return encodeTo$2(et,ot,0),encodeTo$2(o,ot,rt),ot.set(tt,nt),ot}const cidSymbol$2=Symbol.for("@ipld/js-cid/CID"),code$2=0,name$4="identity",encode$E=coerce$h;function digest$1(et){return create$5(code$2,encode$E(et))}const identity$f={code:code$2,name:name$4,encode:encode$E,digest:digest$1};function equals$9(et,o){if(et===o)return!0;if(et.byteLength!==o.byteLength)return!1;for(let tt=0;tt<et.byteLength;tt++)if(et[tt]!==o[tt])return!1;return!0}const[SHA512_Kh,SHA512_Kl]=u64.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(et=>BigInt(et))),SHA512_W_H=new Uint32Array(80),SHA512_W_L=new Uint32Array(80);class SHA512 extends HashMD{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:o,Al:tt,Bh:rt,Bl:nt,Ch:ot,Cl:it,Dh:st,Dl:at,Eh:ct,El:lt,Fh:dt,Fl:ht,Gh:mt,Gl:ft,Hh:pt,Hl:yt}=this;return[o,tt,rt,nt,ot,it,st,at,ct,lt,dt,ht,mt,ft,pt,yt]}set(o,tt,rt,nt,ot,it,st,at,ct,lt,dt,ht,mt,ft,pt,yt){this.Ah=o|0,this.Al=tt|0,this.Bh=rt|0,this.Bl=nt|0,this.Ch=ot|0,this.Cl=it|0,this.Dh=st|0,this.Dl=at|0,this.Eh=ct|0,this.El=lt|0,this.Fh=dt|0,this.Fl=ht|0,this.Gh=mt|0,this.Gl=ft|0,this.Hh=pt|0,this.Hl=yt|0}process(o,tt){for(let xt=0;xt<16;xt++,tt+=4)SHA512_W_H[xt]=o.getUint32(tt),SHA512_W_L[xt]=o.getUint32(tt+=4);for(let xt=16;xt<80;xt++){const vt=SHA512_W_H[xt-15]|0,Et=SHA512_W_L[xt-15]|0,Ct=u64.rotrSH(vt,Et,1)^u64.rotrSH(vt,Et,8)^u64.shrSH(vt,Et,7),St=u64.rotrSL(vt,Et,1)^u64.rotrSL(vt,Et,8)^u64.shrSL(vt,Et,7),At=SHA512_W_H[xt-2]|0,kt=SHA512_W_L[xt-2]|0,It=u64.rotrSH(At,kt,19)^u64.rotrBH(At,kt,61)^u64.shrSH(At,kt,6),Nt=u64.rotrSL(At,kt,19)^u64.rotrBL(At,kt,61)^u64.shrSL(At,kt,6),Lt=u64.add4L(St,Nt,SHA512_W_L[xt-7],SHA512_W_L[xt-16]),Mt=u64.add4H(Lt,Ct,It,SHA512_W_H[xt-7],SHA512_W_H[xt-16]);SHA512_W_H[xt]=Mt|0,SHA512_W_L[xt]=Lt|0}let{Ah:rt,Al:nt,Bh:ot,Bl:it,Ch:st,Cl:at,Dh:ct,Dl:lt,Eh:dt,El:ht,Fh:mt,Fl:ft,Gh:pt,Gl:yt,Hh:gt,Hl:bt}=this;for(let xt=0;xt<80;xt++){const vt=u64.rotrSH(dt,ht,14)^u64.rotrSH(dt,ht,18)^u64.rotrBH(dt,ht,41),Et=u64.rotrSL(dt,ht,14)^u64.rotrSL(dt,ht,18)^u64.rotrBL(dt,ht,41),Ct=dt&mt^~dt&pt,St=ht&ft^~ht&yt,At=u64.add5L(bt,Et,St,SHA512_Kl[xt],SHA512_W_L[xt]),kt=u64.add5H(At,gt,vt,Ct,SHA512_Kh[xt],SHA512_W_H[xt]),It=At|0,Nt=u64.rotrSH(rt,nt,28)^u64.rotrBH(rt,nt,34)^u64.rotrBH(rt,nt,39),Lt=u64.rotrSL(rt,nt,28)^u64.rotrBL(rt,nt,34)^u64.rotrBL(rt,nt,39),Mt=rt&ot^rt&st^ot&st,zt=nt&it^nt&at^it&at;gt=pt|0,bt=yt|0,pt=mt|0,yt=ft|0,mt=dt|0,ft=ht|0,{h:dt,l:ht}=u64.add(ct|0,lt|0,kt|0,It|0),ct=st|0,lt=at|0,st=ot|0,at=it|0,ot=rt|0,it=nt|0;const Ut=u64.add3L(It,Lt,zt);rt=u64.add3H(Ut,kt,Nt,Mt),nt=Ut|0}({h:rt,l:nt}=u64.add(this.Ah|0,this.Al|0,rt|0,nt|0)),{h:ot,l:it}=u64.add(this.Bh|0,this.Bl|0,ot|0,it|0),{h:st,l:at}=u64.add(this.Ch|0,this.Cl|0,st|0,at|0),{h:ct,l:lt}=u64.add(this.Dh|0,this.Dl|0,ct|0,lt|0),{h:dt,l:ht}=u64.add(this.Eh|0,this.El|0,dt|0,ht|0),{h:mt,l:ft}=u64.add(this.Fh|0,this.Fl|0,mt|0,ft|0),{h:pt,l:yt}=u64.add(this.Gh|0,this.Gl|0,pt|0,yt|0),{h:gt,l:bt}=u64.add(this.Hh|0,this.Hl|0,gt|0,bt|0),this.set(rt,nt,ot,it,st,at,ct,lt,dt,ht,mt,ft,pt,yt,gt,bt)}roundClean(){SHA512_W_H.fill(0),SHA512_W_L.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const sha512=wrapConstructor(()=>new SHA512);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$2=BigInt(0),_1n$3=BigInt(1),_2n$2=BigInt(2),_8n$2=BigInt(8),VERIFY_DEFAULT={zip215:!0};function validateOpts$1(et){const o=validateBasic(et);return validateObject(et,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...o})}function twistedEdwards(et){const o=validateOpts$1(et),{Fp:tt,n:rt,prehash:nt,hash:ot,randomBytes:it,nByteLength:st,h:at}=o,ct=_2n$2<<BigInt(st*8)-_1n$3,lt=tt.create,dt=Field$1(o.n,o.nBitLength),ht=o.uvRatio||((Xt,Wt)=>{try{return{isValid:!0,value:tt.sqrt(Xt*tt.inv(Wt))}}catch{return{isValid:!1,value:_0n$2}}}),mt=o.adjustScalarBytes||(Xt=>Xt),ft=o.domain||((Xt,Wt,Ft)=>{if(abool("phflag",Ft),Wt.length||Ft)throw new Error("Contexts/pre-hash are not supported");return Xt});function pt(Xt,Wt){aInRange("coordinate "+Xt,Wt,_0n$2,ct)}function yt(Xt){if(!(Xt instanceof xt))throw new Error("ExtendedPoint expected")}const gt=memoized((Xt,Wt)=>{const{ex:Ft,ey:qt,ez:Pt}=Xt,Yt=Xt.is0();Wt==null&&(Wt=Yt?_8n$2:tt.inv(Pt));const Qt=lt(Ft*Wt),jt=lt(qt*Wt),Gt=lt(Pt*Wt);if(Yt)return{x:_0n$2,y:_1n$3};if(Gt!==_1n$3)throw new Error("invZ was invalid");return{x:Qt,y:jt}}),bt=memoized(Xt=>{const{a:Wt,d:Ft}=o;if(Xt.is0())throw new Error("bad point: ZERO");const{ex:qt,ey:Pt,ez:Yt,et:Qt}=Xt,jt=lt(qt*qt),Gt=lt(Pt*Pt),rr=lt(Yt*Yt),Ht=lt(rr*rr),dr=lt(jt*Wt),Zt=lt(rr*lt(dr+Gt)),Jt=lt(Ht+lt(Ft*lt(jt*Gt)));if(Zt!==Jt)throw new Error("bad point: equation left != right (1)");const tr=lt(qt*Pt),_t=lt(Yt*Qt);if(tr!==_t)throw new Error("bad point: equation left != right (2)");return!0});class xt{constructor(Wt,Ft,qt,Pt){this.ex=Wt,this.ey=Ft,this.ez=qt,this.et=Pt,pt("x",Wt),pt("y",Ft),pt("z",qt),pt("t",Pt),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(Wt){if(Wt instanceof xt)throw new Error("extended point not allowed");const{x:Ft,y:qt}=Wt||{};return pt("x",Ft),pt("y",qt),new xt(Ft,qt,_1n$3,lt(Ft*qt))}static normalizeZ(Wt){const Ft=tt.invertBatch(Wt.map(qt=>qt.ez));return Wt.map((qt,Pt)=>qt.toAffine(Ft[Pt])).map(xt.fromAffine)}static msm(Wt,Ft){return pippenger(xt,dt,Wt,Ft)}_setWindowSize(Wt){Ct.setWindowSize(this,Wt)}assertValidity(){bt(this)}equals(Wt){yt(Wt);const{ex:Ft,ey:qt,ez:Pt}=this,{ex:Yt,ey:Qt,ez:jt}=Wt,Gt=lt(Ft*jt),rr=lt(Yt*Pt),Ht=lt(qt*jt),dr=lt(Qt*Pt);return Gt===rr&&Ht===dr}is0(){return this.equals(xt.ZERO)}negate(){return new xt(lt(-this.ex),this.ey,this.ez,lt(-this.et))}double(){const{a:Wt}=o,{ex:Ft,ey:qt,ez:Pt}=this,Yt=lt(Ft*Ft),Qt=lt(qt*qt),jt=lt(_2n$2*lt(Pt*Pt)),Gt=lt(Wt*Yt),rr=Ft+qt,Ht=lt(lt(rr*rr)-Yt-Qt),dr=Gt+Qt,Zt=dr-jt,Jt=Gt-Qt,tr=lt(Ht*Zt),_t=lt(dr*Jt),Bt=lt(Ht*Jt),Vt=lt(Zt*dr);return new xt(tr,_t,Vt,Bt)}add(Wt){yt(Wt);const{a:Ft,d:qt}=o,{ex:Pt,ey:Yt,ez:Qt,et:jt}=this,{ex:Gt,ey:rr,ez:Ht,et:dr}=Wt;if(Ft===BigInt(-1)){const pr=lt((Yt-Pt)*(rr+Gt)),wr=lt((Yt+Pt)*(rr-Gt)),_r=lt(wr-pr);if(_r===_0n$2)return this.double();const Tr=lt(Qt*_2n$2*dr),gr=lt(jt*_2n$2*Ht),vr=gr+Tr,ir=wr+pr,Tt=gr-Tr,$t=lt(vr*_r),Rt=lt(ir*Tt),Dt=lt(vr*Tt),Kt=lt(_r*ir);return new xt($t,Rt,Kt,Dt)}const Zt=lt(Pt*Gt),Jt=lt(Yt*rr),tr=lt(jt*qt*dr),_t=lt(Qt*Ht),Bt=lt((Pt+Yt)*(Gt+rr)-Zt-Jt),Vt=_t-tr,er=_t+tr,ar=lt(Jt-Ft*Zt),ur=lt(Bt*Vt),cr=lt(er*ar),hr=lt(Bt*ar),Sr=lt(Vt*er);return new xt(ur,cr,Sr,hr)}subtract(Wt){return this.add(Wt.negate())}wNAF(Wt){return Ct.wNAFCached(this,Wt,xt.normalizeZ)}multiply(Wt){const Ft=Wt;aInRange("scalar",Ft,_1n$3,rt);const{p:qt,f:Pt}=this.wNAF(Ft);return xt.normalizeZ([qt,Pt])[0]}multiplyUnsafe(Wt){const Ft=Wt;return aInRange("scalar",Ft,_0n$2,rt),Ft===_0n$2?Et:this.equals(Et)||Ft===_1n$3?this:this.equals(vt)?this.wNAF(Ft).p:Ct.unsafeLadder(this,Ft)}isSmallOrder(){return this.multiplyUnsafe(at).is0()}isTorsionFree(){return Ct.unsafeLadder(this,rt).is0()}toAffine(Wt){return gt(this,Wt)}clearCofactor(){const{h:Wt}=o;return Wt===_1n$3?this:this.multiplyUnsafe(Wt)}static fromHex(Wt,Ft=!1){const{d:qt,a:Pt}=o,Yt=tt.BYTES;Wt=ensureBytes$1("pointHex",Wt,Yt),abool("zip215",Ft);const Qt=Wt.slice(),jt=Wt[Yt-1];Qt[Yt-1]=jt&-129;const Gt=bytesToNumberLE(Qt),rr=Ft?ct:tt.ORDER;aInRange("pointHex.y",Gt,_0n$2,rr);const Ht=lt(Gt*Gt),dr=lt(Ht-_1n$3),Zt=lt(qt*Ht-Pt);let{isValid:Jt,value:tr}=ht(dr,Zt);if(!Jt)throw new Error("Point.fromHex: invalid y coordinate");const _t=(tr&_1n$3)===_1n$3,Bt=(jt&128)!==0;if(!Ft&&tr===_0n$2&&Bt)throw new Error("Point.fromHex: x=0 and x_0=1");return Bt!==_t&&(tr=lt(-tr)),xt.fromAffine({x:tr,y:Gt})}static fromPrivateKey(Wt){return kt(Wt).point}toRawBytes(){const{x:Wt,y:Ft}=this.toAffine(),qt=numberToBytesLE(Ft,tt.BYTES);return qt[qt.length-1]|=Wt&_1n$3?128:0,qt}toHex(){return bytesToHex$2(this.toRawBytes())}}xt.BASE=new xt(o.Gx,o.Gy,_1n$3,lt(o.Gx*o.Gy)),xt.ZERO=new xt(_0n$2,_1n$3,_1n$3,_0n$2);const{BASE:vt,ZERO:Et}=xt,Ct=wNAF(xt,st*8);function St(Xt){return mod$1(Xt,rt)}function At(Xt){return St(bytesToNumberLE(Xt))}function kt(Xt){const Wt=st;Xt=ensureBytes$1("private key",Xt,Wt);const Ft=ensureBytes$1("hashed private key",ot(Xt),2*Wt),qt=mt(Ft.slice(0,Wt)),Pt=Ft.slice(Wt,2*Wt),Yt=At(qt),Qt=vt.multiply(Yt),jt=Qt.toRawBytes();return{head:qt,prefix:Pt,scalar:Yt,point:Qt,pointBytes:jt}}function It(Xt){return kt(Xt).pointBytes}function Nt(Xt=new Uint8Array,...Wt){const Ft=concatBytes$1(...Wt);return At(ot(ft(Ft,ensureBytes$1("context",Xt),!!nt)))}function Lt(Xt,Wt,Ft={}){Xt=ensureBytes$1("message",Xt),nt&&(Xt=nt(Xt));const{prefix:qt,scalar:Pt,pointBytes:Yt}=kt(Wt),Qt=Nt(Ft.context,qt,Xt),jt=vt.multiply(Qt).toRawBytes(),Gt=Nt(Ft.context,jt,Yt,Xt),rr=St(Qt+Gt*Pt);aInRange("signature.s",rr,_0n$2,rt);const Ht=concatBytes$1(jt,numberToBytesLE(rr,tt.BYTES));return ensureBytes$1("result",Ht,st*2)}const Mt=VERIFY_DEFAULT;function zt(Xt,Wt,Ft,qt=Mt){const{context:Pt,zip215:Yt}=qt,Qt=tt.BYTES;Xt=ensureBytes$1("signature",Xt,2*Qt),Wt=ensureBytes$1("message",Wt),Yt!==void 0&&abool("zip215",Yt),nt&&(Wt=nt(Wt));const jt=bytesToNumberLE(Xt.slice(Qt,2*Qt));let Gt,rr,Ht;try{Gt=xt.fromHex(Ft,Yt),rr=xt.fromHex(Xt.slice(0,Qt),Yt),Ht=vt.multiplyUnsafe(jt)}catch{return!1}if(!Yt&&Gt.isSmallOrder())return!1;const dr=Nt(Pt,rr.toRawBytes(),Gt.toRawBytes(),Wt);return rr.add(Gt.multiplyUnsafe(dr)).subtract(Ht).clearCofactor().equals(xt.ZERO)}return vt._setWindowSize(8),{CURVE:o,getPublicKey:It,sign:Lt,verify:zt,ExtendedPoint:xt,utils:{getExtendedPublicKey:kt,randomPrivateKey:()=>it(tt.BYTES),precompute(Xt=8,Wt=xt.BASE){return Wt._setWindowSize(Xt),Wt.multiply(BigInt(3)),Wt}}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$1=BigInt(0),_1n$2=BigInt(1);function validateOpts(et){return validateObject(et,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...et})}function montgomery(et){const o=validateOpts(et),{P:tt}=o,rt=bt=>mod$1(bt,tt),nt=o.montgomeryBits,ot=Math.ceil(nt/8),it=o.nByteLength,st=o.adjustScalarBytes||(bt=>bt),at=o.powPminus2||(bt=>pow(bt,tt-BigInt(2),tt));function ct(bt,xt,vt){const Et=rt(bt*(xt-vt));return xt=rt(xt-Et),vt=rt(vt+Et),[xt,vt]}const lt=(o.a-BigInt(2))/BigInt(4);function dt(bt,xt){aInRange("u",bt,_0n$1,tt),aInRange("scalar",xt,_0n$1,tt);const vt=xt,Et=bt;let Ct=_1n$2,St=_0n$1,At=bt,kt=_1n$2,It=_0n$1,Nt;for(let Mt=BigInt(nt-1);Mt>=_0n$1;Mt--){const zt=vt>>Mt&_1n$2;It^=zt,Nt=ct(It,Ct,At),Ct=Nt[0],At=Nt[1],Nt=ct(It,St,kt),St=Nt[0],kt=Nt[1],It=zt;const Ut=Ct+St,Xt=rt(Ut*Ut),Wt=Ct-St,Ft=rt(Wt*Wt),qt=Xt-Ft,Pt=At+kt,Yt=At-kt,Qt=rt(Yt*Ut),jt=rt(Pt*Wt),Gt=Qt+jt,rr=Qt-jt;At=rt(Gt*Gt),kt=rt(Et*rt(rr*rr)),Ct=rt(Xt*Ft),St=rt(qt*(Xt+rt(lt*qt)))}Nt=ct(It,Ct,At),Ct=Nt[0],At=Nt[1],Nt=ct(It,St,kt),St=Nt[0],kt=Nt[1];const Lt=at(St);return rt(Ct*Lt)}function ht(bt){return numberToBytesLE(rt(bt),ot)}function mt(bt){const xt=ensureBytes$1("u coordinate",bt,ot);return it===32&&(xt[31]&=127),bytesToNumberLE(xt)}function ft(bt){const xt=ensureBytes$1("scalar",bt),vt=xt.length;if(vt!==ot&&vt!==it)throw new Error(`Expected ${ot} or ${it} bytes, got ${vt}`);return bytesToNumberLE(st(xt))}function pt(bt,xt){const vt=mt(xt),Et=ft(bt),Ct=dt(vt,Et);if(Ct===_0n$1)throw new Error("Invalid private or public key received");return ht(Ct)}const yt=ht(o.Gu);function gt(bt){return pt(bt,yt)}return{scalarMult:pt,scalarMultBase:gt,getSharedSecret:(bt,xt)=>pt(bt,xt),getPublicKey:bt=>gt(bt),utils:{randomPrivateKey:()=>o.randomBytes(o.nByteLength)},GuBytes:yt}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ED25519_P=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),ED25519_SQRT_M1=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const _1n$1=BigInt(1),_2n$1=BigInt(2),_3n$1=BigInt(3),_5n=BigInt(5),_8n$1=BigInt(8);function ed25519_pow_2_252_3(et){const o=BigInt(10),tt=BigInt(20),rt=BigInt(40),nt=BigInt(80),ot=ED25519_P,st=et*et%ot*et%ot,at=pow2$1(st,_2n$1,ot)*st%ot,ct=pow2$1(at,_1n$1,ot)*et%ot,lt=pow2$1(ct,_5n,ot)*ct%ot,dt=pow2$1(lt,o,ot)*lt%ot,ht=pow2$1(dt,tt,ot)*dt%ot,mt=pow2$1(ht,rt,ot)*ht%ot,ft=pow2$1(mt,nt,ot)*mt%ot,pt=pow2$1(ft,nt,ot)*mt%ot,yt=pow2$1(pt,o,ot)*lt%ot;return{pow_p_5_8:pow2$1(yt,_2n$1,ot)*et%ot,b2:st}}function adjustScalarBytes(et){return et[0]&=248,et[31]&=127,et[31]|=64,et}function uvRatio(et,o){const tt=ED25519_P,rt=mod$1(o*o*o,tt),nt=mod$1(rt*rt*o,tt),ot=ed25519_pow_2_252_3(et*nt).pow_p_5_8;let it=mod$1(et*rt*ot,tt);const st=mod$1(o*it*it,tt),at=it,ct=mod$1(it*ED25519_SQRT_M1,tt),lt=st===et,dt=st===mod$1(-et,tt),ht=st===mod$1(-et*ED25519_SQRT_M1,tt);return lt&&(it=at),(dt||ht)&&(it=ct),isNegativeLE(it,tt)&&(it=mod$1(-it,tt)),{isValid:lt||dt,value:it}}const Fp=Field$1(ED25519_P,void 0,!0),ed25519Defaults={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:_8n$1,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:sha512,randomBytes:randomBytes$1,adjustScalarBytes,uvRatio},ed25519=twistedEdwards(ed25519Defaults),x25519=montgomery({P:ED25519_P,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:et=>{const o=ED25519_P,{pow_p_5_8:tt,b2:rt}=ed25519_pow_2_252_3(et);return mod$1(pow2$1(tt,_3n$1,o)*rt,o)},adjustScalarBytes,randomBytes:randomBytes$1}),PUBLIC_KEY_BYTE_LENGTH=32,PRIVATE_KEY_BYTE_LENGTH=64,KEYS_BYTE_LENGTH=32;function generateKey(){const et=ed25519.utils.randomPrivateKey(),o=ed25519.getPublicKey(et);return{privateKey:concatKeys(et,o),publicKey:o}}function hashAndSign(et,o){const tt=et.subarray(0,KEYS_BYTE_LENGTH);return ed25519.sign(o instanceof Uint8Array?o:o.subarray(),tt)}function hashAndVerify$2(et,o,tt){return ed25519.verify(o,tt instanceof Uint8Array?tt:tt.subarray(),et)}function concatKeys(et,o){const tt=new Uint8Array(PRIVATE_KEY_BYTE_LENGTH);for(let rt=0;rt<KEYS_BYTE_LENGTH;rt++)tt[rt]=et[rt],tt[KEYS_BYTE_LENGTH+rt]=o[rt];return tt}class Ed25519PublicKey{constructor(o){wt(this,"type","Ed25519");wt(this,"raw");this.raw=ensureEd25519Key(o,PUBLIC_KEY_BYTE_LENGTH)}toMultihash(){return identity$f.digest(publicKeyToProtobuf(this))}toCID(){return CID$2.createV1(114,this.toMultihash())}toString(){return base58btc$h.encode(this.toMultihash().bytes).substring(1)}equals(o){return o==null||!(o.raw instanceof Uint8Array)?!1:equals$9(this.raw,o.raw)}verify(o,tt){return hashAndVerify$2(this.raw,tt,o)}}class Ed25519PrivateKey{constructor(o,tt){wt(this,"type","Ed25519");wt(this,"raw");wt(this,"publicKey");this.raw=ensureEd25519Key(o,PRIVATE_KEY_BYTE_LENGTH),this.publicKey=new Ed25519PublicKey(tt)}equals(o){return o==null||!(o.raw instanceof Uint8Array)?!1:equals$9(this.raw,o.raw)}sign(o){return hashAndSign(this.raw,o)}}function unmarshalEd25519PublicKey(et){return et=ensureEd25519Key(et,PUBLIC_KEY_BYTE_LENGTH),new Ed25519PublicKey(et)}async function generateEd25519KeyPair(){const{privateKey:et,publicKey:o}=generateKey();return new Ed25519PrivateKey(et,o)}function ensureEd25519Key(et,o){if(et=Uint8Array.from(et??[]),et.length!==o)throw new InvalidParametersError$3(`Key must be a Uint8Array of length ${o}, got ${et.length}`);return et}var KeyType;(function(et){et.RSA="RSA",et.Ed25519="Ed25519",et.secp256k1="secp256k1"})(KeyType||(KeyType={}));var __KeyTypeValues;(function(et){et[et.RSA=0]="RSA",et[et.Ed25519=1]="Ed25519",et[et.secp256k1=2]="secp256k1"})(__KeyTypeValues||(__KeyTypeValues={}));(function(et){et.codec=()=>enumeration(__KeyTypeValues)})(KeyType||(KeyType={}));var PublicKey;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.Type!=null&&(rt.uint32(8),KeyType.codec().encode(tt.Type,rt)),tt.Data!=null&&(rt.uint32(18),rt.bytes(tt.Data)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{const ot={},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const st=tt.uint32();switch(st>>>3){case 1:{ot.Type=KeyType.codec().decode(tt);break}case 2:{ot.Data=tt.bytes();break}default:{tt.skipType(st&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(PublicKey||(PublicKey={}));var PrivateKey;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.Type!=null&&(rt.uint32(8),KeyType.codec().encode(tt.Type,rt)),tt.Data!=null&&(rt.uint32(18),rt.bytes(tt.Data)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{const ot={},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const st=tt.uint32();switch(st>>>3){case 1:{ot.Type=KeyType.codec().decode(tt);break}case 2:{ot.Data=tt.bytes();break}default:{tt.skipType(st&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(PrivateKey||(PrivateKey={}));/*!
* MIT License
*
* Copyright (c) 2017-2022 Peculiar Ventures, LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/const ARRAY_BUFFER_NAME="[object ArrayBuffer]";class BufferSourceConverter{static isArrayBuffer(o){return Object.prototype.toString.call(o)===ARRAY_BUFFER_NAME}static toArrayBuffer(o){return this.isArrayBuffer(o)?o:o.byteLength===o.buffer.byteLength||o.byteOffset===0&&o.byteLength===o.buffer.byteLength?o.buffer:this.toUint8Array(o.buffer).slice(o.byteOffset,o.byteOffset+o.byteLength).buffer}static toUint8Array(o){return this.toView(o,Uint8Array)}static toView(o,tt){if(o.constructor===tt)return o;if(this.isArrayBuffer(o))return new tt(o);if(this.isArrayBufferView(o))return new tt(o.buffer,o.byteOffset,o.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(o){return this.isArrayBufferView(o)||this.isArrayBuffer(o)}static isArrayBufferView(o){return ArrayBuffer.isView(o)||o&&this.isArrayBuffer(o.buffer)}static isEqual(o,tt){const rt=BufferSourceConverter.toUint8Array(o),nt=BufferSourceConverter.toUint8Array(tt);if(rt.length!==nt.byteLength)return!1;for(let ot=0;ot<rt.length;ot++)if(rt[ot]!==nt[ot])return!1;return!0}static concat(...o){let tt;Array.isArray(o[0])&&!(o[1]instanceof Function)||Array.isArray(o[0])&&o[1]instanceof Function?tt=o[0]:o[o.length-1]instanceof Function?tt=o.slice(0,o.length-1):tt=o;let rt=0;for(const it of tt)rt+=it.byteLength;const nt=new Uint8Array(rt);let ot=0;for(const it of tt){const st=this.toUint8Array(it);nt.set(st,ot),ot+=st.length}return o[o.length-1]instanceof Function?this.toView(nt,o[o.length-1]):nt.buffer}}const STRING_TYPE="string",HEX_REGEX=/^[0-9a-f]+$/i,BASE64_REGEX=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,BASE64URL_REGEX=/^[a-zA-Z0-9-_]+$/;class Utf8Converter{static fromString(o){const tt=unescape(encodeURIComponent(o)),rt=new Uint8Array(tt.length);for(let nt=0;nt<tt.length;nt++)rt[nt]=tt.charCodeAt(nt);return rt.buffer}static toString(o){const tt=BufferSourceConverter.toUint8Array(o);let rt="";for(let ot=0;ot<tt.length;ot++)rt+=String.fromCharCode(tt[ot]);return decodeURIComponent(escape(rt))}}class Utf16Converter{static toString(o,tt=!1){const rt=BufferSourceConverter.toArrayBuffer(o),nt=new DataView(rt);let ot="";for(let it=0;it<rt.byteLength;it+=2){const st=nt.getUint16(it,tt);ot+=String.fromCharCode(st)}return ot}static fromString(o,tt=!1){const rt=new ArrayBuffer(o.length*2),nt=new DataView(rt);for(let ot=0;ot<o.length;ot++)nt.setUint16(ot*2,o.charCodeAt(ot),tt);return rt}}class Convert{static isHex(o){return typeof o===STRING_TYPE&&HEX_REGEX.test(o)}static isBase64(o){return typeof o===STRING_TYPE&&BASE64_REGEX.test(o)}static isBase64Url(o){return typeof o===STRING_TYPE&&BASE64URL_REGEX.test(o)}static ToString(o,tt="utf8"){const rt=BufferSourceConverter.toUint8Array(o);switch(tt.toLowerCase()){case"utf8":return this.ToUtf8String(rt);case"binary":return this.ToBinary(rt);case"hex":return this.ToHex(rt);case"base64":return this.ToBase64(rt);case"base64url":return this.ToBase64Url(rt);case"utf16le":return Utf16Converter.toString(rt,!0);case"utf16":case"utf16be":return Utf16Converter.toString(rt);default:throw new Error(`Unknown type of encoding '${tt}'`)}}static FromString(o,tt="utf8"){if(!o)return new ArrayBuffer(0);switch(tt.toLowerCase()){case"utf8":return this.FromUtf8String(o);case"binary":return this.FromBinary(o);case"hex":return this.FromHex(o);case"base64":return this.FromBase64(o);case"base64url":return this.FromBase64Url(o);case"utf16le":return Utf16Converter.fromString(o,!0);case"utf16":case"utf16be":return Utf16Converter.fromString(o);default:throw new Error(`Unknown type of encoding '${tt}'`)}}static ToBase64(o){const tt=BufferSourceConverter.toUint8Array(o);if(typeof btoa<"u"){const rt=this.ToString(tt,"binary");return btoa(rt)}else return Buffer.from(tt).toString("base64")}static FromBase64(o){const tt=this.formatString(o);if(!tt)return new ArrayBuffer(0);if(!Convert.isBase64(tt))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(tt)):new Uint8Array(Buffer.from(tt,"base64")).buffer}static FromBase64Url(o){const tt=this.formatString(o);if(!tt)return new ArrayBuffer(0);if(!Convert.isBase64Url(tt))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(tt.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(o){return this.ToBase64(o).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(o,tt=Convert.DEFAULT_UTF8_ENCODING){switch(tt){case"ascii":return this.FromBinary(o);case"utf8":return Utf8Converter.fromString(o);case"utf16":case"utf16be":return Utf16Converter.fromString(o);case"utf16le":case"usc2":return Utf16Converter.fromString(o,!0);default:throw new Error(`Unknown type of encoding '${tt}'`)}}static ToUtf8String(o,tt=Convert.DEFAULT_UTF8_ENCODING){switch(tt){case"ascii":return this.ToBinary(o);case"utf8":return Utf8Converter.toString(o);case"utf16":case"utf16be":return Utf16Converter.toString(o);case"utf16le":case"usc2":return Utf16Converter.toString(o,!0);default:throw new Error(`Unknown type of encoding '${tt}'`)}}static FromBinary(o){const tt=o.length,rt=new Uint8Array(tt);for(let nt=0;nt<tt;nt++)rt[nt]=o.charCodeAt(nt);return rt.buffer}static ToBinary(o){const tt=BufferSourceConverter.toUint8Array(o);let rt="";for(let nt=0;nt<tt.length;nt++)rt+=String.fromCharCode(tt[nt]);return rt}static ToHex(o){const tt=BufferSourceConverter.toUint8Array(o);let rt="";const nt=tt.length;for(let ot=0;ot<nt;ot++){const it=tt[ot];it<16&&(rt+="0"),rt+=it.toString(16)}return rt}static FromHex(o){let tt=this.formatString(o);if(!tt)return new ArrayBuffer(0);if(!Convert.isHex(tt))throw new TypeError("Argument 'hexString' is not HEX encoded");tt.length%2&&(tt=`0${tt}`);const rt=new Uint8Array(tt.length/2);for(let nt=0;nt<tt.length;nt=nt+2){const ot=tt.slice(nt,nt+2);rt[nt/2]=parseInt(ot,16)}return rt.buffer}static ToUtf16String(o,tt=!1){return Utf16Converter.toString(o,tt)}static FromUtf16String(o,tt=!1){return Utf16Converter.fromString(o,tt)}static Base64Padding(o){const tt=4-o.length%4;if(tt<4)for(let rt=0;rt<tt;rt++)o+="=";return o}static formatString(o){return(o==null?void 0:o.replace(/[\n\r\t ]/g,""))||""}}Convert.DEFAULT_UTF8_ENCODING="utf8";/*!
Copyright (c) Peculiar Ventures, LLC
*/function utilFromBase(et,o){let tt=0;if(et.length===1)return et[0];for(let rt=et.length-1;rt>=0;rt--)tt+=et[et.length-1-rt]*Math.pow(2,o*rt);return tt}function utilToBase(et,o,tt=-1){const rt=tt;let nt=et,ot=0,it=Math.pow(2,o);for(let st=1;st<8;st++){if(et<it){let at;if(rt<0)at=new ArrayBuffer(st),ot=st;else{if(rt<st)return new ArrayBuffer(0);at=new ArrayBuffer(rt),ot=rt}const ct=new Uint8Array(at);for(let lt=st-1;lt>=0;lt--){const dt=Math.pow(2,lt*o);ct[ot-lt-1]=Math.floor(nt/dt),nt-=ct[ot-lt-1]*dt}return at}it*=Math.pow(2,o)}return new ArrayBuffer(0)}function utilConcatView(...et){let o=0,tt=0;for(const ot of et)o+=ot.length;const rt=new ArrayBuffer(o),nt=new Uint8Array(rt);for(const ot of et)nt.set(ot,tt),tt+=ot.length;return nt}function utilDecodeTC(){const et=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){const st=et[0]===255&&et[1]&128,at=et[0]===0&&(et[1]&128)===0;(st||at)&&this.warnings.push("Needlessly long format")}const o=new ArrayBuffer(this.valueHex.byteLength),tt=new Uint8Array(o);for(let st=0;st<this.valueHex.byteLength;st++)tt[st]=0;tt[0]=et[0]&128;const rt=utilFromBase(tt,8),nt=new ArrayBuffer(this.valueHex.byteLength),ot=new Uint8Array(nt);for(let st=0;st<this.valueHex.byteLength;st++)ot[st]=et[st];return ot[0]&=127,utilFromBase(ot,8)-rt}function utilEncodeTC(et){const o=et<0?et*-1:et;let tt=128;for(let rt=1;rt<8;rt++){if(o<=tt){if(et<0){const it=tt-o,st=utilToBase(it,8,rt),at=new Uint8Array(st);return at[0]|=128,st}let nt=utilToBase(o,8,rt),ot=new Uint8Array(nt);if(ot[0]&128){const it=nt.slice(0),st=new Uint8Array(it);nt=new ArrayBuffer(nt.byteLength+1),ot=new Uint8Array(nt);for(let at=0;at<it.byteLength;at++)ot[at+1]=st[at];ot[0]=0}return nt}tt*=Math.pow(2,8)}return new ArrayBuffer(0)}function isEqualBuffer(et,o){if(et.byteLength!==o.byteLength)return!1;const tt=new Uint8Array(et),rt=new Uint8Array(o);for(let nt=0;nt<tt.length;nt++)if(tt[nt]!==rt[nt])return!1;return!0}function padNumber(et,o){const tt=et.toString(10);if(o<tt.length)return"";const rt=o-tt.length,nt=new Array(rt);for(let it=0;it<rt;it++)nt[it]="0";return nt.join("").concat(tt)}/*!
* Copyright (c) 2014, GMO GlobalSign
* Copyright (c) 2015-2022, Peculiar Ventures
* All rights reserved.
*
* Author 2014-2019, Yury Strozhevsky
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice, this
* list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/function assertBigInt(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function concat$2(et){let o=0,tt=0;for(let nt=0;nt<et.length;nt++){const ot=et[nt];o+=ot.byteLength}const rt=new Uint8Array(o);for(let nt=0;nt<et.length;nt++){const ot=et[nt];rt.set(new Uint8Array(ot),tt),tt+=ot.byteLength}return rt.buffer}function checkBufferParams(et,o,tt,rt){return o instanceof Uint8Array?o.byteLength?tt<0?(et.error="Wrong parameter: inputOffset less than zero",!1):rt<0?(et.error="Wrong parameter: inputLength less than zero",!1):o.byteLength-tt-rt<0?(et.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(et.error="Wrong parameter: inputBuffer has zero length",!1):(et.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}class ViewWriter{constructor(){this.items=[]}write(o){this.items.push(o)}final(){return concat$2(this.items)}}const powers2=[new Uint8Array([1])],digitsString="0123456789",EMPTY_STRING$1="",EMPTY_BUFFER$1=new ArrayBuffer(0),EMPTY_VIEW=new Uint8Array(0),END_OF_CONTENT_NAME="EndOfContent",OCTET_STRING_NAME="OCTET STRING",BIT_STRING_NAME="BIT STRING";function HexBlock(et){var o;return o=class extends et{constructor(...rt){var nt;super(...rt);const ot=rt[0]||{};this.isHexOnly=(nt=ot.isHexOnly)!==null&&nt!==void 0?nt:!1,this.valueHexView=ot.valueHex?BufferSourceConverter.toUint8Array(ot.valueHex):EMPTY_VIEW}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(rt){this.valueHexView=new Uint8Array(rt)}fromBER(rt,nt,ot){const it=rt instanceof ArrayBuffer?new Uint8Array(rt):rt;if(!checkBufferParams(this,it,nt,ot))return-1;const st=nt+ot;return this.valueHexView=it.subarray(nt,st),this.valueHexView.length?(this.blockLength=ot,st):(this.warnings.push("Zero buffer length"),nt)}toBER(rt=!1){return this.isHexOnly?rt?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",EMPTY_BUFFER$1)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:Convert.ToHex(this.valueHexView)}}},o.NAME="hexBlock",o}class LocalBaseBlock{constructor({blockLength:o=0,error:tt=EMPTY_STRING$1,warnings:rt=[],valueBeforeDecode:nt=EMPTY_VIEW}={}){this.blockLength=o,this.error=tt,this.warnings=rt,this.valueBeforeDecodeView=BufferSourceConverter.toUint8Array(nt)}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(o){this.valueBeforeDecodeView=new Uint8Array(o)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:Convert.ToHex(this.valueBeforeDecodeView)}}}LocalBaseBlock.NAME="baseBlock";class ValueBlock extends LocalBaseBlock{fromBER(o,tt,rt){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(o,tt){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}}ValueBlock.NAME="valueBlock";class LocalIdentificationBlock extends HexBlock(LocalBaseBlock){constructor({idBlock:o={}}={}){var tt,rt,nt,ot;super(),o?(this.isHexOnly=(tt=o.isHexOnly)!==null&&tt!==void 0?tt:!1,this.valueHexView=o.valueHex?BufferSourceConverter.toUint8Array(o.valueHex):EMPTY_VIEW,this.tagClass=(rt=o.tagClass)!==null&&rt!==void 0?rt:-1,this.tagNumber=(nt=o.tagNumber)!==null&&nt!==void 0?nt:-1,this.isConstructed=(ot=o.isConstructed)!==null&&ot!==void 0?ot:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(o=!1){let tt=0;switch(this.tagClass){case 1:tt|=0;break;case 2:tt|=64;break;case 3:tt|=128;break;case 4:tt|=192;break;default:return this.error="Unknown tag class",EMPTY_BUFFER$1}if(this.isConstructed&&(tt|=32),this.tagNumber<31&&!this.isHexOnly){const nt=new Uint8Array(1);if(!o){let ot=this.tagNumber;ot&=31,tt|=ot,nt[0]=tt}return nt.buffer}if(!this.isHexOnly){const nt=utilToBase(this.tagNumber,7),ot=new Uint8Array(nt),it=nt.byteLength,st=new Uint8Array(it+1);if(st[0]=tt|31,!o){for(let at=0;at<it-1;at++)st[at+1]=ot[at]|128;st[it]=ot[it-1]}return st.buffer}const rt=new Uint8Array(this.valueHexView.byteLength+1);if(rt[0]=tt|31,!o){const nt=this.valueHexView;for(let ot=0;ot<nt.length-1;ot++)rt[ot+1]=nt[ot]|128;rt[this.valueHexView.byteLength]=nt[nt.length-1]}return rt.buffer}fromBER(o,tt,rt){const nt=BufferSourceConverter.toUint8Array(o);if(!checkBufferParams(this,nt,tt,rt))return-1;const ot=nt.subarray(tt,tt+rt);if(ot.length===0)return this.error="Zero buffer length",-1;switch(ot[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(ot[0]&32)===32,this.isHexOnly=!1;const st=ot[0]&31;if(st!==31)this.tagNumber=st,this.blockLength=1;else{let at=1,ct=this.valueHexView=new Uint8Array(255),lt=255;for(;ot[at]&128;){if(ct[at-1]=ot[at]&127,at++,at>=ot.length)return this.error="End of input reached before message was fully decoded",-1;if(at===lt){lt+=255;const ht=new Uint8Array(lt);for(let mt=0;mt<ct.length;mt++)ht[mt]=ct[mt];ct=this.valueHexView=new Uint8Array(lt)}}this.blockLength=at+1,ct[at-1]=ot[at]&127;const dt=new Uint8Array(at);for(let ht=0;ht<at;ht++)dt[ht]=ct[ht];ct=this.valueHexView=new Uint8Array(at),ct.set(dt),this.blockLength<=9?this.tagNumber=utilFromBase(ct,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return tt+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}}LocalIdentificationBlock.NAME="identificationBlock";class LocalLengthBlock extends LocalBaseBlock{constructor({lenBlock:o={}}={}){var tt,rt,nt;super(),this.isIndefiniteForm=(tt=o.isIndefiniteForm)!==null&&tt!==void 0?tt:!1,this.longFormUsed=(rt=o.longFormUsed)!==null&&rt!==void 0?rt:!1,this.length=(nt=o.length)!==null&&nt!==void 0?nt:0}fromBER(o,tt,rt){const nt=BufferSourceConverter.toUint8Array(o);if(!checkBufferParams(this,nt,tt,rt))return-1;const ot=nt.subarray(tt,tt+rt);if(ot.length===0)return this.error="Zero buffer length",-1;if(ot[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=ot[0]===128,this.isIndefiniteForm)return this.blockLength=1,tt+this.blockLength;if(this.longFormUsed=!!(ot[0]&128),this.longFormUsed===!1)return this.length=ot[0],this.blockLength=1,tt+this.blockLength;const it=ot[0]&127;if(it>8)return this.error="Too big integer",-1;if(it+1>ot.length)return this.error="End of input reached before message was fully decoded",-1;const st=tt+1,at=nt.subarray(st,st+it);return at[it-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=utilFromBase(at,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=it+1,tt+this.blockLength}toBER(o=!1){let tt,rt;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return tt=new ArrayBuffer(1),o===!1&&(rt=new Uint8Array(tt),rt[0]=128),tt;if(this.longFormUsed){const nt=utilToBase(this.length,8);if(nt.byteLength>127)return this.error="Too big length",EMPTY_BUFFER$1;if(tt=new ArrayBuffer(nt.byteLength+1),o)return tt;const ot=new Uint8Array(nt);rt=new Uint8Array(tt),rt[0]=nt.byteLength|128;for(let it=0;it<nt.byteLength;it++)rt[it+1]=ot[it];return tt}return tt=new ArrayBuffer(1),o===!1&&(rt=new Uint8Array(tt),rt[0]=this.length),tt}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}}LocalLengthBlock.NAME="lengthBlock";const typeStore={};class BaseBlock extends LocalBaseBlock{constructor({name:o=EMPTY_STRING$1,optional:tt=!1,primitiveSchema:rt,...nt}={},ot){super(nt),this.name=o,this.optional=tt,rt&&(this.primitiveSchema=rt),this.idBlock=new LocalIdentificationBlock(nt),this.lenBlock=new LocalLengthBlock(nt),this.valueBlock=ot?new ot(nt):new ValueBlock(nt)}fromBER(o,tt,rt){const nt=this.valueBlock.fromBER(o,tt,this.lenBlock.isIndefiniteForm?rt:this.lenBlock.length);return nt===-1?(this.error=this.valueBlock.error,nt):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),nt)}toBER(o,tt){const rt=tt||new ViewWriter;tt||prepareIndefiniteForm(this);const nt=this.idBlock.toBER(o);if(rt.write(nt),this.lenBlock.isIndefiniteForm)rt.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(o,rt),rt.write(new ArrayBuffer(2));else{const ot=this.valueBlock.toBER(o);this.lenBlock.length=ot.byteLength;const it=this.lenBlock.toBER(o);rt.write(it),rt.write(ot)}return tt?EMPTY_BUFFER$1:rt.final()}toJSON(){const o={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(o.primitiveSchema=this.primitiveSchema.toJSON()),o}toString(o="ascii"){return o==="ascii"?this.onAsciiEncoding():Convert.ToHex(this.toBER())}onAsciiEncoding(){return`${this.constructor.NAME} : ${Convert.ToHex(this.valueBlock.valueBeforeDecodeView)}`}isEqual(o){if(this===o)return!0;if(!(o instanceof this.constructor))return!1;const tt=this.toBER(),rt=o.toBER();return isEqualBuffer(tt,rt)}}BaseBlock.NAME="BaseBlock";function prepareIndefiniteForm(et){if(et instanceof typeStore.Constructed)for(const o of et.valueBlock.value)prepareIndefiniteForm(o)&&(et.lenBlock.isIndefiniteForm=!0);return!!et.lenBlock.isIndefiniteForm}class BaseStringBlock extends BaseBlock{constructor({value:o=EMPTY_STRING$1,...tt}={},rt){super(tt,rt),o&&this.fromString(o)}getValue(){return this.valueBlock.value}setValue(o){this.valueBlock.value=o}fromBER(o,tt,rt){const nt=this.valueBlock.fromBER(o,tt,this.lenBlock.isIndefiniteForm?rt:this.lenBlock.length);return nt===-1?(this.error=this.valueBlock.error,nt):(this.fromBuffer(this.valueBlock.valueHexView),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),nt)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}}BaseStringBlock.NAME="BaseStringBlock";class LocalPrimitiveValueBlock extends HexBlock(ValueBlock){constructor({isHexOnly:o=!0,...tt}={}){super(tt),this.isHexOnly=o}}LocalPrimitiveValueBlock.NAME="PrimitiveValueBlock";var _a$w;let Primitive$1=class extends BaseBlock{constructor(o={}){super(o,LocalPrimitiveValueBlock),this.idBlock.isConstructed=!1}};_a$w=Primitive$1;typeStore.Primitive=_a$w;Primitive$1.NAME="PRIMITIVE";function localChangeType(et,o){if(et instanceof o)return et;const tt=new o;return tt.idBlock=et.idBlock,tt.lenBlock=et.lenBlock,tt.warnings=et.warnings,tt.valueBeforeDecodeView=et.valueBeforeDecodeView,tt}function localFromBER(et,o=0,tt=et.length){const rt=o;let nt=new BaseBlock({},ValueBlock);const ot=new LocalBaseBlock;if(!checkBufferParams(ot,et,o,tt))return nt.error=ot.error,{offset:-1,result:nt};if(!et.subarray(o,o+tt).length)return nt.error="Zero buffer length",{offset:-1,result:nt};let st=nt.idBlock.fromBER(et,o,tt);if(nt.idBlock.warnings.length&&nt.warnings.concat(nt.idBlock.warnings),st===-1)return nt.error=nt.idBlock.error,{offset:-1,result:nt};if(o=st,tt-=nt.idBlock.blockLength,st=nt.lenBlock.fromBER(et,o,tt),nt.lenBlock.warnings.length&&nt.warnings.concat(nt.lenBlock.warnings),st===-1)return nt.error=nt.lenBlock.error,{offset:-1,result:nt};if(o=st,tt-=nt.lenBlock.blockLength,!nt.idBlock.isConstructed&&nt.lenBlock.isIndefiniteForm)return nt.error="Indefinite length form used for primitive encoding form",{offset:-1,result:nt};let at=BaseBlock;switch(nt.idBlock.tagClass){case 1:if(nt.idBlock.tagNumber>=37&&nt.idBlock.isHexOnly===!1)return nt.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:nt};switch(nt.idBlock.tagNumber){case 0:if(nt.idBlock.isConstructed&&nt.lenBlock.length>0)return nt.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:nt};at=typeStore.EndOfContent;break;case 1:at=typeStore.Boolean;break;case 2:at=typeStore.Integer;break;case 3:at=typeStore.BitString;break;case 4:at=typeStore.OctetString;break;case 5:at=typeStore.Null;break;case 6:at=typeStore.ObjectIdentifier;break;case 10:at=typeStore.Enumerated;break;case 12:at=typeStore.Utf8String;break;case 13:at=typeStore.RelativeObjectIdentifier;break;case 14:at=typeStore.TIME;break;case 15:return nt.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:nt};case 16:at=typeStore.Sequence;break;case 17:at=typeStore.Set;break;case 18:at=typeStore.NumericString;break;case 19:at=typeStore.PrintableString;break;case 20:at=typeStore.TeletexString;break;case 21:at=typeStore.VideotexString;break;case 22:at=typeStore.IA5String;break;case 23:at=typeStore.UTCTime;break;case 24:at=typeStore.GeneralizedTime;break;case 25:at=typeStore.GraphicString;break;case 26:at=typeStore.VisibleString;break;case 27:at=typeStore.GeneralString;break;case 28:at=typeStore.UniversalString;break;case 29:at=typeStore.CharacterString;break;case 30:at=typeStore.BmpString;break;case 31:at=typeStore.DATE;break;case 32:at=typeStore.TimeOfDay;break;case 33:at=typeStore.DateTime;break;case 34:at=typeStore.Duration;break;default:{const ct=nt.idBlock.isConstructed?new typeStore.Constructed:new typeStore.Primitive;ct.idBlock=nt.idBlock,ct.lenBlock=nt.lenBlock,ct.warnings=nt.warnings,nt=ct}}break;case 2:case 3:case 4:default:at=nt.idBlock.isConstructed?typeStore.Constructed:typeStore.Primitive}return nt=localChangeType(nt,at),st=nt.fromBER(et,o,nt.lenBlock.isIndefiniteForm?tt:nt.lenBlock.length),nt.valueBeforeDecodeView=et.subarray(rt,rt+nt.blockLength),{offset:st,result:nt}}function fromBER(et){if(!et.byteLength){const o=new BaseBlock({},ValueBlock);return o.error="Input buffer has zero length",{offset:-1,result:o}}return localFromBER(BufferSourceConverter.toUint8Array(et).slice(),0,et.byteLength)}function checkLen(et,o){return et?1:o}class LocalConstructedValueBlock extends ValueBlock{constructor({value:o=[],isIndefiniteForm:tt=!1,...rt}={}){super(rt),this.value=o,this.isIndefiniteForm=tt}fromBER(o,tt,rt){const nt=BufferSourceConverter.toUint8Array(o);if(!checkBufferParams(this,nt,tt,rt))return-1;if(this.valueBeforeDecodeView=nt.subarray(tt,tt+rt),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),tt;let ot=tt;for(;checkLen(this.isIndefiniteForm,rt)>0;){const it=localFromBER(nt,ot,rt);if(it.offset===-1)return this.error=it.result.error,this.warnings.concat(it.result.warnings),-1;if(ot=it.offset,this.blockLength+=it.result.blockLength,rt-=it.result.blockLength,this.value.push(it.result),this.isIndefiniteForm&&it.result.constructor.NAME===END_OF_CONTENT_NAME)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===END_OF_CONTENT_NAME?this.value.pop():this.warnings.push("No EndOfContent block encoded")),ot}toBER(o,tt){const rt=tt||new ViewWriter;for(let nt=0;nt<this.value.length;nt++)this.value[nt].toBER(o,rt);return tt?EMPTY_BUFFER$1:rt.final()}toJSON(){const o={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(const tt of this.value)o.value.push(tt.toJSON());return o}}LocalConstructedValueBlock.NAME="ConstructedValueBlock";var _a$v;class Constructed extends BaseBlock{constructor(o={}){super(o,LocalConstructedValueBlock),this.idBlock.isConstructed=!0}fromBER(o,tt,rt){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;const nt=this.valueBlock.fromBER(o,tt,this.lenBlock.isIndefiniteForm?rt:this.lenBlock.length);return nt===-1?(this.error=this.valueBlock.error,nt):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),nt)}onAsciiEncoding(){const o=[];for(const rt of this.valueBlock.value)o.push(rt.toString("ascii").split(`
`).map(nt=>` ${nt}`).join(`
`));const tt=this.idBlock.tagClass===3?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return o.length?`${tt} :
${o.join(`
`)}`:`${tt} :`}}_a$v=Constructed;typeStore.Constructed=_a$v;Constructed.NAME="CONSTRUCTED";class LocalEndOfContentValueBlock extends ValueBlock{fromBER(o,tt,rt){return tt}toBER(o){return EMPTY_BUFFER$1}}LocalEndOfContentValueBlock.override="EndOfContentValueBlock";var _a$u;class EndOfContent extends BaseBlock{constructor(o={}){super(o,LocalEndOfContentValueBlock),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}_a$u=EndOfContent;typeStore.EndOfContent=_a$u;EndOfContent.NAME=END_OF_CONTENT_NAME;var _a$t;class Null extends BaseBlock{constructor(o={}){super(o,ValueBlock),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(o,tt,rt){return this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=rt,tt+rt>o.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):tt+rt}toBER(o,tt){const rt=new ArrayBuffer(2);if(!o){const nt=new Uint8Array(rt);nt[0]=5,nt[1]=0}return tt&&tt.write(rt),rt}onAsciiEncoding(){return`${this.constructor.NAME}`}}_a$t=Null;typeStore.Null=_a$t;Null.NAME="NULL";class LocalBooleanValueBlock extends HexBlock(ValueBlock){constructor({value:o,...tt}={}){super(tt),tt.valueHex?this.valueHexView=BufferSourceConverter.toUint8Array(tt.valueHex):this.valueHexView=new Uint8Array(1),o&&(this.value=o)}get value(){for(const o of this.valueHexView)if(o>0)return!0;return!1}set value(o){this.valueHexView[0]=o?255:0}fromBER(o,tt,rt){const nt=BufferSourceConverter.toUint8Array(o);return checkBufferParams(this,nt,tt,rt)?(this.valueHexView=nt.subarray(tt,tt+rt),rt>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,utilDecodeTC.call(this),this.blockLength=rt,tt+rt):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}LocalBooleanValueBlock.NAME="BooleanValueBlock";var _a$s;let Boolean$1=class extends BaseBlock{constructor(o={}){super(o,LocalBooleanValueBlock),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}getValue(){return this.valueBlock.value}setValue(o){this.valueBlock.value=o}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};_a$s=Boolean$1;typeStore.Boolean=_a$s;Boolean$1.NAME="BOOLEAN";class LocalOctetStringValueBlock extends HexBlock(LocalConstructedValueBlock){constructor({isConstructed:o=!1,...tt}={}){super(tt),this.isConstructed=o}fromBER(o,tt,rt){let nt=0;if(this.isConstructed){if(this.isHexOnly=!1,nt=LocalConstructedValueBlock.prototype.fromBER.call(this,o,tt,rt),nt===-1)return nt;for(let ot=0;ot<this.value.length;ot++){const it=this.value[ot].constructor.NAME;if(it===END_OF_CONTENT_NAME){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(it!==OCTET_STRING_NAME)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,nt=super.fromBER(o,tt,rt),this.blockLength=rt;return nt}toBER(o,tt){return this.isConstructed?LocalConstructedValueBlock.prototype.toBER.call(this,o,tt):o?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}LocalOctetStringValueBlock.NAME="OctetStringValueBlock";var _a$r;class OctetString extends BaseBlock{constructor({idBlock:o={},lenBlock:tt={},...rt}={}){var nt,ot;(nt=rt.isConstructed)!==null&&nt!==void 0||(rt.isConstructed=!!(!((ot=rt.value)===null||ot===void 0)&&ot.length)),super({idBlock:{isConstructed:rt.isConstructed,...o},lenBlock:{...tt,isIndefiniteForm:!!rt.isIndefiniteForm},...rt},LocalOctetStringValueBlock),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(o,tt,rt){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,rt===0)return this.idBlock.error.length===0&&(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length===0&&(this.blockLength+=this.lenBlock.blockLength),tt;if(!this.valueBlock.isConstructed){const ot=(o instanceof ArrayBuffer?new Uint8Array(o):o).subarray(tt,tt+rt);try{if(ot.byteLength){const it=localFromBER(ot,0,ot.byteLength);it.offset!==-1&&it.offset===rt&&(this.valueBlock.value=[it.result])}}catch{}}return super.fromBER(o,tt,rt)}onAsciiEncoding(){return this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length?Constructed.prototype.onAsciiEncoding.call(this):`${this.constructor.NAME} : ${Convert.ToHex(this.valueBlock.valueHexView)}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;const o=[];for(const tt of this.valueBlock.value)tt instanceof OctetString&&o.push(tt.valueBlock.valueHexView);return BufferSourceConverter.concat(o)}}_a$r=OctetString;typeStore.OctetString=_a$r;OctetString.NAME=OCTET_STRING_NAME;class LocalBitStringValueBlock extends HexBlock(LocalConstructedValueBlock){constructor({unusedBits:o=0,isConstructed:tt=!1,...rt}={}){super(rt),this.unusedBits=o,this.isConstructed=tt,this.blockLength=this.valueHexView.byteLength}fromBER(o,tt,rt){if(!rt)return tt;let nt=-1;if(this.isConstructed){if(nt=LocalConstructedValueBlock.prototype.fromBER.call(this,o,tt,rt),nt===-1)return nt;for(const st of this.value){const at=st.constructor.NAME;if(at===END_OF_CONTENT_NAME){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(at!==BIT_STRING_NAME)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const ct=st.valueBlock;if(this.unusedBits>0&&ct.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=ct.unusedBits}return nt}const ot=BufferSourceConverter.toUint8Array(o);if(!checkBufferParams(this,ot,tt,rt))return-1;const it=ot.subarray(tt,tt+rt);if(this.unusedBits=it[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){const st=it.subarray(1);try{if(st.byteLength){const at=localFromBER(st,0,st.byteLength);at.offset!==-1&&at.offset===rt-1&&(this.value=[at.result])}}catch{}}return this.valueHexView=it.subarray(1),this.blockLength=it.length,tt+rt}toBER(o,tt){if(this.isConstructed)return LocalConstructedValueBlock.prototype.toBER.call(this,o,tt);if(o)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return EMPTY_BUFFER$1;const rt=new Uint8Array(this.valueHexView.length+1);return rt[0]=this.unusedBits,rt.set(this.valueHexView,1),rt.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}}LocalBitStringValueBlock.NAME="BitStringValueBlock";var _a$q;class BitString extends BaseBlock{constructor({idBlock:o={},lenBlock:tt={},...rt}={}){var nt,ot;(nt=rt.isConstructed)!==null&&nt!==void 0||(rt.isConstructed=!!(!((ot=rt.value)===null||ot===void 0)&&ot.length)),super({idBlock:{isConstructed:rt.isConstructed,...o},lenBlock:{...tt,isIndefiniteForm:!!rt.isIndefiniteForm},...rt},LocalBitStringValueBlock),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(o,tt,rt){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(o,tt,rt)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return Constructed.prototype.onAsciiEncoding.call(this);{const o=[],tt=this.valueBlock.valueHexView;for(const nt of tt)o.push(nt.toString(2).padStart(8,"0"));const rt=o.join("");return`${this.constructor.NAME} : ${rt.substring(0,rt.length-this.valueBlock.unusedBits)}`}}}_a$q=BitString;typeStore.BitString=_a$q;BitString.NAME=BIT_STRING_NAME;var _a$p;function viewAdd(et,o){const tt=new Uint8Array([0]),rt=new Uint8Array(et),nt=new Uint8Array(o);let ot=rt.slice(0);const it=ot.length-1,st=nt.slice(0),at=st.length-1;let ct=0;const lt=at<it?it:at;let dt=0;for(let ht=lt;ht>=0;ht--,dt++){switch(!0){case dt<st.length:ct=ot[it-dt]+st[at-dt]+tt[0];break;default:ct=ot[it-dt]+tt[0]}switch(tt[0]=ct/10,!0){case dt>=ot.length:ot=utilConcatView(new Uint8Array([ct%10]),ot);break;default:ot[it-dt]=ct%10}}return tt[0]>0&&(ot=utilConcatView(tt,ot)),ot}function power2(et){if(et>=powers2.length)for(let o=powers2.length;o<=et;o++){const tt=new Uint8Array([0]);let rt=powers2[o-1].slice(0);for(let nt=rt.length-1;nt>=0;nt--){const ot=new Uint8Array([(rt[nt]<<1)+tt[0]]);tt[0]=ot[0]/10,rt[nt]=ot[0]%10}tt[0]>0&&(rt=utilConcatView(tt,rt)),powers2.push(rt)}return powers2[et]}function viewSub(et,o){let tt=0;const rt=new Uint8Array(et),nt=new Uint8Array(o),ot=rt.slice(0),it=ot.length-1,st=nt.slice(0),at=st.length-1;let ct,lt=0;for(let dt=at;dt>=0;dt--,lt++)switch(ct=ot[it-lt]-st[at-lt]-tt,!0){case ct<0:tt=1,ot[it-lt]=ct+10;break;default:tt=0,ot[it-lt]=ct}if(tt>0)for(let dt=it-at+1;dt>=0;dt--,lt++)if(ct=ot[it-lt]-tt,ct<0)tt=1,ot[it-lt]=ct+10;else{tt=0,ot[it-lt]=ct;break}return ot.slice()}class LocalIntegerValueBlock extends HexBlock(ValueBlock){constructor({value:o,...tt}={}){super(tt),this._valueDec=0,tt.valueHex&&this.setValueHex(),o!==void 0&&(this.valueDec=o)}setValueHex(){this.valueHexView.length>=4?(this.warnings.push("Too big Integer for decoding, hex only"),this.isHexOnly=!0,this._valueDec=0):(this.isHexOnly=!1,this.valueHexView.length>0&&(this._valueDec=utilDecodeTC.call(this)))}set valueDec(o){this._valueDec=o,this.isHexOnly=!1,this.valueHexView=new Uint8Array(utilEncodeTC(o))}get valueDec(){return this._valueDec}fromDER(o,tt,rt,nt=0){const ot=this.fromBER(o,tt,rt);if(ot===-1)return ot;const it=this.valueHexView;return it[0]===0&&it[1]&128?this.valueHexView=it.subarray(1):nt!==0&&it.length<nt&&(nt-it.length>1&&(nt=it.length+1),this.valueHexView=it.subarray(nt-it.length)),ot}toDER(o=!1){const tt=this.valueHexView;switch(!0){case(tt[0]&128)!==0:{const rt=new Uint8Array(this.valueHexView.length+1);rt[0]=0,rt.set(tt,1),this.valueHexView=rt}break;case(tt[0]===0&&(tt[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(o)}fromBER(o,tt,rt){const nt=super.fromBER(o,tt,rt);return nt===-1||this.setValueHex(),nt}toBER(o){return o?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}toString(){const o=this.valueHexView.length*8-1;let tt=new Uint8Array(this.valueHexView.length*8/3),rt=0,nt;const ot=this.valueHexView;let it="",st=!1;for(let at=ot.byteLength-1;at>=0;at--){nt=ot[at];for(let ct=0;ct<8;ct++){if((nt&1)===1)switch(rt){case o:tt=viewSub(power2(rt),tt),it="-";break;default:tt=viewAdd(tt,power2(rt))}rt++,nt>>=1}}for(let at=0;at<tt.length;at++)tt[at]&&(st=!0),st&&(it+=digitsString.charAt(tt[at]));return st===!1&&(it+=digitsString.charAt(0)),it}}_a$p=LocalIntegerValueBlock;LocalIntegerValueBlock.NAME="IntegerValueBlock";Object.defineProperty(_a$p.prototype,"valueHex",{set:function(et){this.valueHexView=new Uint8Array(et),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var _a$o;class Integer extends BaseBlock{constructor(o={}){super(o,LocalIntegerValueBlock),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return assertBigInt(),BigInt(this.valueBlock.toString())}static fromBigInt(o){assertBigInt();const tt=BigInt(o),rt=new ViewWriter,nt=tt.toString(16).replace(/^-/,""),ot=new Uint8Array(Convert.FromHex(nt));if(tt<0){const st=new Uint8Array(ot.length+(ot[0]&128?1:0));st[0]|=128;const ct=BigInt(`0x${Convert.ToHex(st)}`)+tt,lt=BufferSourceConverter.toUint8Array(Convert.FromHex(ct.toString(16)));lt[0]|=128,rt.write(lt)}else ot[0]&128&&rt.write(new Uint8Array([0])),rt.write(ot);return new Integer({valueHex:rt.final()})}convertToDER(){const o=new Integer({valueHex:this.valueBlock.valueHexView});return o.valueBlock.toDER(),o}convertFromDER(){return new Integer({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}_a$o=Integer;typeStore.Integer=_a$o;Integer.NAME="INTEGER";var _a$n;class Enumerated extends Integer{constructor(o={}){super(o),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}_a$n=Enumerated;typeStore.Enumerated=_a$n;Enumerated.NAME="ENUMERATED";class LocalSidValueBlock extends HexBlock(ValueBlock){constructor({valueDec:o=-1,isFirstSid:tt=!1,...rt}={}){super(rt),this.valueDec=o,this.isFirstSid=tt}fromBER(o,tt,rt){if(!rt)return tt;const nt=BufferSourceConverter.toUint8Array(o);if(!checkBufferParams(this,nt,tt,rt))return-1;const ot=nt.subarray(tt,tt+rt);this.valueHexView=new Uint8Array(rt);for(let st=0;st<rt&&(this.valueHexView[st]=ot[st]&127,this.blockLength++,!!(ot[st]&128));st++);const it=new Uint8Array(this.blockLength);for(let st=0;st<this.blockLength;st++)it[st]=this.valueHexView[st];return this.valueHexView=it,ot[this.blockLength-1]&128?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=utilFromBase(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),tt+this.blockLength)}set valueBigInt(o){assertBigInt();let tt=BigInt(o).toString(2);for(;tt.length%7;)tt="0"+tt;const rt=new Uint8Array(tt.length/7);for(let nt=0;nt<rt.length;nt++)rt[nt]=parseInt(tt.slice(nt*7,nt*7+7),2)+(nt+1<rt.length?128:0);this.fromBER(rt.buffer,0,rt.length)}toBER(o){if(this.isHexOnly){if(o)return new ArrayBuffer(this.valueHexView.byteLength);const nt=this.valueHexView,ot=new Uint8Array(this.blockLength);for(let it=0;it<this.blockLength-1;it++)ot[it]=nt[it]|128;return ot[this.blockLength-1]=nt[this.blockLength-1],ot.buffer}const tt=utilToBase(this.valueDec,7);if(tt.byteLength===0)return this.error="Error during encoding SID value",EMPTY_BUFFER$1;const rt=new Uint8Array(tt.byteLength);if(!o){const nt=new Uint8Array(tt),ot=tt.byteLength-1;for(let it=0;it<ot;it++)rt[it]=nt[it]|128;rt[ot]=nt[ot]}return rt}toString(){let o="";if(this.isHexOnly)o=Convert.ToHex(this.valueHexView);else if(this.isFirstSid){let tt=this.valueDec;this.valueDec<=39?o="0.":this.valueDec<=79?(o="1.",tt-=40):(o="2.",tt-=80),o+=tt.toString()}else o=this.valueDec.toString();return o}toJSON(){return{...super.toJSON(),valueDec:this.valueDec,isFirstSid:this.isFirstSid}}}LocalSidValueBlock.NAME="sidBlock";class LocalObjectIdentifierValueBlock extends ValueBlock{constructor({value:o=EMPTY_STRING$1,...tt}={}){super(tt),this.value=[],o&&this.fromString(o)}fromBER(o,tt,rt){let nt=tt;for(;rt>0;){const ot=new LocalSidValueBlock;if(nt=ot.fromBER(o,nt,rt),nt===-1)return this.blockLength=0,this.error=ot.error,nt;this.value.length===0&&(ot.isFirstSid=!0),this.blockLength+=ot.blockLength,rt-=ot.blockLength,this.value.push(ot)}return nt}toBER(o){const tt=[];for(let rt=0;rt<this.value.length;rt++){const nt=this.value[rt].toBER(o);if(nt.byteLength===0)return this.error=this.value[rt].error,EMPTY_BUFFER$1;tt.push(nt)}return concat$2(tt)}fromString(o){this.value=[];let tt=0,rt=0,nt="",ot=!1;do if(rt=o.indexOf(".",tt),rt===-1?nt=o.substring(tt):nt=o.substring(tt,rt),tt=rt+1,ot){const it=this.value[0];let st=0;switch(it.valueDec){case 0:break;case 1:st=40;break;case 2:st=80;break;default:this.value=[];return}const at=parseInt(nt,10);if(isNaN(at))return;it.valueDec=at+st,ot=!1}else{const it=new LocalSidValueBlock;if(nt>Number.MAX_SAFE_INTEGER){assertBigInt();const st=BigInt(nt);it.valueBigInt=st}else if(it.valueDec=parseInt(nt,10),isNaN(it.valueDec))return;this.value.length||(it.isFirstSid=!0,ot=!0),this.value.push(it)}while(rt!==-1)}toString(){let o="",tt=!1;for(let rt=0;rt<this.value.length;rt++){tt=this.value[rt].isHexOnly;let nt=this.value[rt].toString();rt!==0&&(o=`${o}.`),tt?(nt=`{${nt}}`,this.value[rt].isFirstSid?o=`2.{${nt} - 80}`:o+=nt):o+=nt}return o}toJSON(){const o={...super.toJSON(),value:this.toString(),sidArray:[]};for(let tt=0;tt<this.value.length;tt++)o.sidArray.push(this.value[tt].toJSON());return o}}LocalObjectIdentifierValueBlock.NAME="ObjectIdentifierValueBlock";var _a$m;class ObjectIdentifier extends BaseBlock{constructor(o={}){super(o,LocalObjectIdentifierValueBlock),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}getValue(){return this.valueBlock.toString()}setValue(o){this.valueBlock.fromString(o)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}_a$m=ObjectIdentifier;typeStore.ObjectIdentifier=_a$m;ObjectIdentifier.NAME="OBJECT IDENTIFIER";class LocalRelativeSidValueBlock extends HexBlock(LocalBaseBlock){constructor({valueDec:o=0,...tt}={}){super(tt),this.valueDec=o}fromBER(o,tt,rt){if(rt===0)return tt;const nt=BufferSourceConverter.toUint8Array(o);if(!checkBufferParams(this,nt,tt,rt))return-1;const ot=nt.subarray(tt,tt+rt);this.valueHexView=new Uint8Array(rt);for(let st=0;st<rt&&(this.valueHexView[st]=ot[st]&127,this.blockLength++,!!(ot[st]&128));st++);const it=new Uint8Array(this.blockLength);for(let st=0;st<this.blockLength;st++)it[st]=this.valueHexView[st];return this.valueHexView=it,ot[this.blockLength-1]&128?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=utilFromBase(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),tt+this.blockLength)}toBER(o){if(this.isHexOnly){if(o)return new ArrayBuffer(this.valueHexView.byteLength);const nt=this.valueHexView,ot=new Uint8Array(this.blockLength);for(let it=0;it<this.blockLength-1;it++)ot[it]=nt[it]|128;return ot[this.blockLength-1]=nt[this.blockLength-1],ot.buffer}const tt=utilToBase(this.valueDec,7);if(tt.byteLength===0)return this.error="Error during encoding SID value",EMPTY_BUFFER$1;const rt=new Uint8Array(tt.byteLength);if(!o){const nt=new Uint8Array(tt),ot=tt.byteLength-1;for(let it=0;it<ot;it++)rt[it]=nt[it]|128;rt[ot]=nt[ot]}return rt.buffer}toString(){let o="";return this.isHexOnly?o=Convert.ToHex(this.valueHexView):o=this.valueDec.toString(),o}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}LocalRelativeSidValueBlock.NAME="relativeSidBlock";class LocalRelativeObjectIdentifierValueBlock extends ValueBlock{constructor({value:o=EMPTY_STRING$1,...tt}={}){super(tt),this.value=[],o&&this.fromString(o)}fromBER(o,tt,rt){let nt=tt;for(;rt>0;){const ot=new LocalRelativeSidValueBlock;if(nt=ot.fromBER(o,nt,rt),nt===-1)return this.blockLength=0,this.error=ot.error,nt;this.blockLength+=ot.blockLength,rt-=ot.blockLength,this.value.push(ot)}return nt}toBER(o,tt){const rt=[];for(let nt=0;nt<this.value.length;nt++){const ot=this.value[nt].toBER(o);if(ot.byteLength===0)return this.error=this.value[nt].error,EMPTY_BUFFER$1;rt.push(ot)}return concat$2(rt)}fromString(o){this.value=[];let tt=0,rt=0,nt="";do{rt=o.indexOf(".",tt),rt===-1?nt=o.substring(tt):nt=o.substring(tt,rt),tt=rt+1;const ot=new LocalRelativeSidValueBlock;if(ot.valueDec=parseInt(nt,10),isNaN(ot.valueDec))return!0;this.value.push(ot)}while(rt!==-1);return!0}toString(){let o="",tt=!1;for(let rt=0;rt<this.value.length;rt++){tt=this.value[rt].isHexOnly;let nt=this.value[rt].toString();rt!==0&&(o=`${o}.`),tt&&(nt=`{${nt}}`),o+=nt}return o}toJSON(){const o={...super.toJSON(),value:this.toString(),sidArray:[]};for(let tt=0;tt<this.value.length;tt++)o.sidArray.push(this.value[tt].toJSON());return o}}LocalRelativeObjectIdentifierValueBlock.NAME="RelativeObjectIdentifierValueBlock";var _a$l;class RelativeObjectIdentifier extends BaseBlock{constructor(o={}){super(o,LocalRelativeObjectIdentifierValueBlock),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}getValue(){return this.valueBlock.toString()}setValue(o){this.valueBlock.fromString(o)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}_a$l=RelativeObjectIdentifier;typeStore.RelativeObjectIdentifier=_a$l;RelativeObjectIdentifier.NAME="RelativeObjectIdentifier";var _a$k;class Sequence extends Constructed{constructor(o={}){super(o),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}_a$k=Sequence;typeStore.Sequence=_a$k;Sequence.NAME="SEQUENCE";var _a$j;let Set$1=class extends Constructed{constructor(o={}){super(o),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};_a$j=Set$1;typeStore.Set=_a$j;Set$1.NAME="SET";class LocalStringValueBlock extends HexBlock(ValueBlock){constructor({...o}={}){super(o),this.isHexOnly=!0,this.value=EMPTY_STRING$1}toJSON(){return{...super.toJSON(),value:this.value}}}LocalStringValueBlock.NAME="StringValueBlock";class LocalSimpleStringValueBlock extends LocalStringValueBlock{}LocalSimpleStringValueBlock.NAME="SimpleStringValueBlock";class LocalSimpleStringBlock extends BaseStringBlock{constructor({...o}={}){super(o,LocalSimpleStringValueBlock)}fromBuffer(o){this.valueBlock.value=String.fromCharCode.apply(null,BufferSourceConverter.toUint8Array(o))}fromString(o){const tt=o.length,rt=this.valueBlock.valueHexView=new Uint8Array(tt);for(let nt=0;nt<tt;nt++)rt[nt]=o.charCodeAt(nt);this.valueBlock.value=o}}LocalSimpleStringBlock.NAME="SIMPLE STRING";class LocalUtf8StringValueBlock extends LocalSimpleStringBlock{fromBuffer(o){this.valueBlock.valueHexView=BufferSourceConverter.toUint8Array(o);try{this.valueBlock.value=Convert.ToUtf8String(o)}catch(tt){this.warnings.push(`Error during "decodeURIComponent": ${tt}, using raw string`),this.valueBlock.value=Convert.ToBinary(o)}}fromString(o){this.valueBlock.valueHexView=new Uint8Array(Convert.FromUtf8String(o)),this.valueBlock.value=o}}LocalUtf8StringValueBlock.NAME="Utf8StringValueBlock";var _a$i;class Utf8String extends LocalUtf8StringValueBlock{constructor(o={}){super(o),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}_a$i=Utf8String;typeStore.Utf8String=_a$i;Utf8String.NAME="UTF8String";class LocalBmpStringValueBlock extends LocalSimpleStringBlock{fromBuffer(o){this.valueBlock.value=Convert.ToUtf16String(o),this.valueBlock.valueHexView=BufferSourceConverter.toUint8Array(o)}fromString(o){this.valueBlock.value=o,this.valueBlock.valueHexView=new Uint8Array(Convert.FromUtf16String(o))}}LocalBmpStringValueBlock.NAME="BmpStringValueBlock";var _a$h;class BmpString extends LocalBmpStringValueBlock{constructor({...o}={}){super(o),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}_a$h=BmpString;typeStore.BmpString=_a$h;BmpString.NAME="BMPString";class LocalUniversalStringValueBlock extends LocalSimpleStringBlock{fromBuffer(o){const tt=ArrayBuffer.isView(o)?o.slice().buffer:o.slice(0),rt=new Uint8Array(tt);for(let nt=0;nt<rt.length;nt+=4)rt[nt]=rt[nt+3],rt[nt+1]=rt[nt+2],rt[nt+2]=0,rt[nt+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(tt))}fromString(o){const tt=o.length,rt=this.valueBlock.valueHexView=new Uint8Array(tt*4);for(let nt=0;nt<tt;nt++){const ot=utilToBase(o.charCodeAt(nt),8),it=new Uint8Array(ot);if(it.length>4)continue;const st=4-it.length;for(let at=it.length-1;at>=0;at--)rt[nt*4+at+st]=it[at]}this.valueBlock.value=o}}LocalUniversalStringValueBlock.NAME="UniversalStringValueBlock";var _a$g;class UniversalString extends LocalUniversalStringValueBlock{constructor({...o}={}){super(o),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}_a$g=UniversalString;typeStore.UniversalString=_a$g;UniversalString.NAME="UniversalString";var _a$f;class NumericString extends LocalSimpleStringBlock{constructor(o={}){super(o),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}_a$f=NumericString;typeStore.NumericString=_a$f;NumericString.NAME="NumericString";var _a$e;class PrintableString extends LocalSimpleStringBlock{constructor(o={}){super(o),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}_a$e=PrintableString;typeStore.PrintableString=_a$e;PrintableString.NAME="PrintableString";var _a$d;class TeletexString extends LocalSimpleStringBlock{constructor(o={}){super(o),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}_a$d=TeletexString;typeStore.TeletexString=_a$d;TeletexString.NAME="TeletexString";var _a$c;class VideotexString extends LocalSimpleStringBlock{constructor(o={}){super(o),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}_a$c=VideotexString;typeStore.VideotexString=_a$c;VideotexString.NAME="VideotexString";var _a$b;class IA5String extends LocalSimpleStringBlock{constructor(o={}){super(o),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}_a$b=IA5String;typeStore.IA5String=_a$b;IA5String.NAME="IA5String";var _a$a;class GraphicString extends LocalSimpleStringBlock{constructor(o={}){super(o),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}_a$a=GraphicString;typeStore.GraphicString=_a$a;GraphicString.NAME="GraphicString";var _a$9;class VisibleString extends LocalSimpleStringBlock{constructor(o={}){super(o),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}_a$9=VisibleString;typeStore.VisibleString=_a$9;VisibleString.NAME="VisibleString";var _a$8;class GeneralString extends LocalSimpleStringBlock{constructor(o={}){super(o),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}_a$8=GeneralString;typeStore.GeneralString=_a$8;GeneralString.NAME="GeneralString";var _a$7;class CharacterString extends LocalSimpleStringBlock{constructor(o={}){super(o),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}_a$7=CharacterString;typeStore.CharacterString=_a$7;CharacterString.NAME="CharacterString";var _a$6;class UTCTime extends VisibleString{constructor({value:o,valueDate:tt,...rt}={}){if(super(rt),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,o){this.fromString(o),this.valueBlock.valueHexView=new Uint8Array(o.length);for(let nt=0;nt<o.length;nt++)this.valueBlock.valueHexView[nt]=o.charCodeAt(nt)}tt&&(this.fromDate(tt),this.valueBlock.valueHexView=new Uint8Array(this.toBuffer())),this.idBlock.tagClass=1,this.idBlock.tagNumber=23}fromBuffer(o){this.fromString(String.fromCharCode.apply(null,BufferSourceConverter.toUint8Array(o)))}toBuffer(){const o=this.toString(),tt=new ArrayBuffer(o.length),rt=new Uint8Array(tt);for(let nt=0;nt<o.length;nt++)rt[nt]=o.charCodeAt(nt);return tt}fromDate(o){this.year=o.getUTCFullYear(),this.month=o.getUTCMonth()+1,this.day=o.getUTCDate(),this.hour=o.getUTCHours(),this.minute=o.getUTCMinutes(),this.second=o.getUTCSeconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))}fromString(o){const rt=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(o);if(rt===null){this.error="Wrong input string for conversion";return}const nt=parseInt(rt[1],10);nt>=50?this.year=1900+nt:this.year=2e3+nt,this.month=parseInt(rt[2],10),this.day=parseInt(rt[3],10),this.hour=parseInt(rt[4],10),this.minute=parseInt(rt[5],10),this.second=parseInt(rt[6],10)}toString(o="iso"){if(o==="iso"){const tt=new Array(7);return tt[0]=padNumber(this.year<2e3?this.year-1900:this.year-2e3,2),tt[1]=padNumber(this.month,2),tt[2]=padNumber(this.day,2),tt[3]=padNumber(this.hour,2),tt[4]=padNumber(this.minute,2),tt[5]=padNumber(this.second,2),tt[6]="Z",tt.join("")}return super.toString(o)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return{...super.toJSON(),year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second}}}_a$6=UTCTime;typeStore.UTCTime=_a$6;UTCTime.NAME="UTCTime";var _a$5;class GeneralizedTime extends UTCTime{constructor(o={}){var tt;super(o),(tt=this.millisecond)!==null&&tt!==void 0||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(o){super.fromDate(o),this.millisecond=o.getUTCMilliseconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond))}fromString(o){let tt=!1,rt="",nt="",ot=0,it,st=0,at=0;if(o[o.length-1]==="Z")rt=o.substring(0,o.length-1),tt=!0;else{const dt=new Number(o[o.length-1]);if(isNaN(dt.valueOf()))throw new Error("Wrong input string for conversion");rt=o}if(tt){if(rt.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(rt.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let dt=1,ht=rt.indexOf("+"),mt="";if(ht===-1&&(ht=rt.indexOf("-"),dt=-1),ht!==-1){if(mt=rt.substring(ht+1),rt=rt.substring(0,ht),mt.length!==2&&mt.length!==4)throw new Error("Wrong input string for conversion");let ft=parseInt(mt.substring(0,2),10);if(isNaN(ft.valueOf()))throw new Error("Wrong input string for conversion");if(st=dt*ft,mt.length===4){if(ft=parseInt(mt.substring(2,4),10),isNaN(ft.valueOf()))throw new Error("Wrong input string for conversion");at=dt*ft}}}let ct=rt.indexOf(".");if(ct===-1&&(ct=rt.indexOf(",")),ct!==-1){const dt=new Number(`0${rt.substring(ct)}`);if(isNaN(dt.valueOf()))throw new Error("Wrong input string for conversion");ot=dt.valueOf(),nt=rt.substring(0,ct)}else nt=rt;switch(!0){case nt.length===8:if(it=/(\d{4})(\d{2})(\d{2})/ig,ct!==-1)throw new Error("Wrong input string for conversion");break;case nt.length===10:if(it=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,ct!==-1){let dt=60*ot;this.minute=Math.floor(dt),dt=60*(dt-this.minute),this.second=Math.floor(dt),dt=1e3*(dt-this.second),this.millisecond=Math.floor(dt)}break;case nt.length===12:if(it=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,ct!==-1){let dt=60*ot;this.second=Math.floor(dt),dt=1e3*(dt-this.second),this.millisecond=Math.floor(dt)}break;case nt.length===14:if(it=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,ct!==-1){const dt=1e3*ot;this.millisecond=Math.floor(dt)}break;default:throw new Error("Wrong input string for conversion")}const lt=it.exec(nt);if(lt===null)throw new Error("Wrong input string for conversion");for(let dt=1;dt<lt.length;dt++)switch(dt){case 1:this.year=parseInt(lt[dt],10);break;case 2:this.month=parseInt(lt[dt],10);break;case 3:this.day=parseInt(lt[dt],10);break;case 4:this.hour=parseInt(lt[dt],10)+st;break;case 5:this.minute=parseInt(lt[dt],10)+at;break;case 6:this.second=parseInt(lt[dt],10);break;default:throw new Error("Wrong input string for conversion")}if(tt===!1){const dt=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=dt.getUTCFullYear(),this.month=dt.getUTCMonth(),this.day=dt.getUTCDay(),this.hour=dt.getUTCHours(),this.minute=dt.getUTCMinutes(),this.second=dt.getUTCSeconds(),this.millisecond=dt.getUTCMilliseconds()}}toString(o="iso"){if(o==="iso"){const tt=[];return tt.push(padNumber(this.year,4)),tt.push(padNumber(this.month,2)),tt.push(padNumber(this.day,2)),tt.push(padNumber(this.hour,2)),tt.push(padNumber(this.minute,2)),tt.push(padNumber(this.second,2)),this.millisecond!==0&&(tt.push("."),tt.push(padNumber(this.millisecond,3))),tt.push("Z"),tt.join("")}return super.toString(o)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}_a$5=GeneralizedTime;typeStore.GeneralizedTime=_a$5;GeneralizedTime.NAME="GeneralizedTime";var _a$4;let DATE$1=class extends Utf8String{constructor(o={}){super(o),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}};_a$4=DATE$1;typeStore.DATE=_a$4;DATE$1.NAME="DATE";var _a$3;class TimeOfDay extends Utf8String{constructor(o={}){super(o),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}_a$3=TimeOfDay;typeStore.TimeOfDay=_a$3;TimeOfDay.NAME="TimeOfDay";var _a$2;class DateTime extends Utf8String{constructor(o={}){super(o),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}_a$2=DateTime;typeStore.DateTime=_a$2;DateTime.NAME="DateTime";var _a$1;class Duration extends Utf8String{constructor(o={}){super(o),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}_a$1=Duration;typeStore.Duration=_a$1;Duration.NAME="Duration";var _a;class TIME extends Utf8String{constructor(o={}){super(o),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}_a=TIME;typeStore.TIME=_a;TIME.NAME="TIME";const base10$q=baseX$h({prefix:"9",name:"base10",alphabet:"0123456789"}),base10$r=Object.freeze(Object.defineProperty({__proto__:null,base10:base10$q},Symbol.toStringTag,{value:"Module"})),base16$q=rfc4648$g({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper$d=rfc4648$g({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),base16$r=Object.freeze(Object.defineProperty({__proto__:null,base16:base16$q,base16upper:base16upper$d},Symbol.toStringTag,{value:"Module"})),base2$q=rfc4648$g({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),base2$r=Object.freeze(Object.defineProperty({__proto__:null,base2:base2$q},Symbol.toStringTag,{value:"Module"})),alphabet$d=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),alphabetBytesToChars$d=alphabet$d.reduce((et,o,tt)=>(et[tt]=o,et),[]),alphabetCharsToBytes$d=alphabet$d.reduce((et,o,tt)=>{const rt=o.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${o}`);return et[rt]=tt,et},[]);function encode$D(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars$d[tt],o),"")}function decode$K(et){const o=[];for(const tt of et){const rt=tt.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${tt}`);const nt=alphabetCharsToBytes$d[rt];if(nt==null)throw new Error(`Non-base256emoji character: ${tt}`);o.push(nt)}return new Uint8Array(o)}const base256emoji$q=from$k({prefix:"🚀",name:"base256emoji",encode:encode$D,decode:decode$K}),base256emoji$r=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:base256emoji$q},Symbol.toStringTag,{value:"Module"})),base64$t=rfc4648$g({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad$d=rfc4648$g({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url$e=rfc4648$g({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad$d=rfc4648$g({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$u=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$t,base64pad:base64pad$d,base64url:base64url$e,base64urlpad:base64urlpad$d},Symbol.toStringTag,{value:"Module"})),base8$q=rfc4648$g({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$r=Object.freeze(Object.defineProperty({__proto__:null,base8:base8$q},Symbol.toStringTag,{value:"Module"})),identity$e=from$k({prefix:"\0",name:"identity",encode:et=>toString$r(et),decode:et=>fromString$q(et)}),identityBase$d=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$e},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;function from$j({name:et,code:o,encode:tt}){return new Hasher$1(et,o,tt)}let Hasher$1=class{constructor(o,tt,rt){wt(this,"name");wt(this,"code");wt(this,"encode");this.name=o,this.code=tt,this.encode=rt}digest(o){if(o instanceof Uint8Array){const tt=this.encode(o);return tt instanceof Uint8Array?create$5(this.code,tt):tt.then(rt=>create$5(this.code,rt))}else throw Error("Unknown type, must be binary type")}};function sha$1(et){return async o=>new Uint8Array(await crypto.subtle.digest(et,o))}const sha256$1=from$j({name:"sha2-256",code:18,encode:sha$1("SHA-256")}),bases$d={...identityBase$d,...base2$r,...base8$r,...base10$r,...base16$r,...base32$v,...base36$s,...base58$d,...base64$u,...base256emoji$r};function allocUnsafe$c(et=0){return new Uint8Array(et)}function createCodec$d(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$h=createCodec$d("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii$d=createCodec$d("ascii","a",et=>{let o="a";for(let tt=0;tt<et.length;tt++)o+=String.fromCharCode(et[tt]);return o},et=>{et=et.substring(1);const o=allocUnsafe$c(et.length);for(let tt=0;tt<et.length;tt++)o[tt]=et.charCodeAt(tt);return o}),BASES$d={utf8:string$h,"utf-8":string$h,hex:bases$d.base16,latin1:ascii$d,ascii:ascii$d,binary:ascii$d,...bases$d};function fromString$p(et,o="utf8"){const tt=BASES$d[o];if(tt==null)throw new Error(`Unsupported encoding "${o}"`);return tt.decoder.decode(`${tt.prefix}${et}`)}function toString$q(et,o="utf8"){const tt=BASES$d[o];if(tt==null)throw new Error(`Unsupported encoding "${o}"`);return tt.encoder.encode(et).substring(1)}function randomBytes(et){if(isNaN(et)||et<=0)throw new InvalidParametersError$3("random bytes length must be a Number bigger than 0");return randomBytes$1(et)}class VerificationError extends Error{constructor(o="An error occurred while verifying a message"){super(o),this.name="VerificationError"}}class WebCryptoMissingError extends Error{constructor(o="Missing Web Crypto API"){super(o),this.name="WebCryptoMissingError"}}const webcrypto={get(et=globalThis){const o=et.crypto;if((o==null?void 0:o.subtle)==null)throw new WebCryptoMissingError("Missing Web Crypto API. The most likely cause of this error is that this page is being accessed from an insecure context (i.e. not HTTPS). For more information and possible resolutions see https://github.com/libp2p/js-libp2p/blob/main/packages/crypto/README.md#web-crypto-api");return o}};async function hashAndVerify$1(et,o,tt){const rt=await webcrypto.get().subtle.importKey("jwk",et,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"]);return webcrypto.get().subtle.verify({name:"RSASSA-PKCS1-v1_5"},rt,o,tt instanceof Uint8Array?tt:tt.subarray())}function rsaKeySize(et){if(et.kty!=="RSA")throw new InvalidParametersError$3("invalid key type");if(et.n==null)throw new InvalidParametersError$3("invalid key modulus");return fromString$p(et.n,"base64url").length*8}class RSAPublicKey{constructor(o,tt){wt(this,"type","RSA");wt(this,"_key");wt(this,"_raw");wt(this,"_multihash");this._key=o,this._multihash=tt}get raw(){return this._raw==null&&(this._raw=jwkToPkix(this._key)),this._raw}toMultihash(){return this._multihash}toCID(){return CID$2.createV1(114,this._multihash)}toString(){return base58btc$h.encode(this.toMultihash().bytes).substring(1)}equals(o){return o==null||!(o.raw instanceof Uint8Array)?!1:equals$9(this.raw,o.raw)}verify(o,tt){return hashAndVerify$1(this._key,tt,o)}}const MAX_RSA_KEY_SIZE=8192,SHA2_256_CODE=18;function pkixToJwk(et){const{result:o}=fromBER(et),tt=o.valueBlock.value[1].valueBlock.value[0].valueBlock.value;return{kty:"RSA",n:toString$q(bnToBuf(tt[0].toBigInt()),"base64url"),e:toString$q(bnToBuf(tt[1].toBigInt()),"base64url")}}function jwkToPkix(et){if(et.n==null||et.e==null)throw new InvalidParametersError$3("JWK was missing components");const tt=new Sequence({value:[new Sequence({value:[new ObjectIdentifier({value:"1.2.840.113549.1.1.1"}),new Null]}),new BitString({valueHex:new Sequence({value:[Integer.fromBigInt(bufToBn(fromString$p(et.n,"base64url"))),Integer.fromBigInt(bufToBn(fromString$p(et.e,"base64url")))]}).toBER()})]}).toBER();return new Uint8Array(tt,0,tt.byteLength)}function bnToBuf(et){let o=et.toString(16);o.length%2>0&&(o=`0${o}`);const tt=o.length/2,rt=new Uint8Array(tt);let nt=0,ot=0;for(;nt<tt;)rt[nt]=parseInt(o.slice(ot,ot+2),16),nt+=1,ot+=2;return rt}function bufToBn(et){const o=[];return et.forEach(function(tt){let rt=tt.toString(16);rt.length%2>0&&(rt=`0${rt}`),o.push(rt)}),BigInt("0x"+o.join(""))}function pkixToRSAPublicKey(et){const o=pkixToJwk(et);if(rsaKeySize(o)>MAX_RSA_KEY_SIZE)throw new InvalidPublicKeyError("Key size is too large");const tt=sha256$3(PublicKey.encode({Type:KeyType.RSA,Data:et})),rt=create$5(SHA2_256_CODE,tt);return new RSAPublicKey(o,rt)}function isPromise$3(et){return et==null?!1:typeof et.then=="function"&&typeof et.catch=="function"&&typeof et.finally=="function"}function hashAndVerify(et,o,tt){const rt=sha256$1.digest(tt instanceof Uint8Array?tt:tt.subarray());if(isPromise$3(rt))return rt.then(({digest:nt})=>secp256k1.verify(o,nt,et)).catch(nt=>{throw new VerificationError(String(nt))});try{return secp256k1.verify(o,rt.digest,et)}catch(nt){throw new VerificationError(String(nt))}}class Secp256k1PublicKey{constructor(o){wt(this,"type","secp256k1");wt(this,"raw");wt(this,"_key");this._key=validateSecp256k1PublicKey(o),this.raw=compressSecp256k1PublicKey(this._key)}toMultihash(){return identity$f.digest(publicKeyToProtobuf(this))}toCID(){return CID$2.createV1(114,this.toMultihash())}toString(){return base58btc$h.encode(this.toMultihash().bytes).substring(1)}equals(o){return o==null||!(o.raw instanceof Uint8Array)?!1:equals$9(this.raw,o.raw)}verify(o,tt){return hashAndVerify(this._key,tt,o)}}function unmarshalSecp256k1PublicKey(et){return new Secp256k1PublicKey(et)}function compressSecp256k1PublicKey(et){return secp256k1.ProjectivePoint.fromHex(et).toRawBytes(!0)}function validateSecp256k1PublicKey(et){try{return secp256k1.ProjectivePoint.fromHex(et),et}catch(o){throw new InvalidPublicKeyError(String(o))}}async function generateKeyPair(et,o){return generateEd25519KeyPair()}function publicKeyFromProtobuf(et){const{Type:o,Data:tt}=PublicKey.decode(et),rt=tt??new Uint8Array;switch(o){case KeyType.RSA:return pkixToRSAPublicKey(rt);case KeyType.Ed25519:return unmarshalEd25519PublicKey(rt);case KeyType.secp256k1:return unmarshalSecp256k1PublicKey(rt);default:throw new UnsupportedKeyTypeError$1}}function publicKeyFromRaw(et){return et.byteLength===32?unmarshalEd25519PublicKey(et):et.byteLength===33?unmarshalSecp256k1PublicKey(et):pkixToRSAPublicKey(et)}function publicKeyFromMultihash(et){const{Type:o,Data:tt}=PublicKey.decode(et.digest),rt=tt??new Uint8Array;switch(o){case KeyType.Ed25519:return unmarshalEd25519PublicKey(rt);case KeyType.secp256k1:return unmarshalSecp256k1PublicKey(rt);default:throw new UnsupportedKeyTypeError$1}}function publicKeyToProtobuf(et){return PublicKey.encode({Type:KeyType[et.type],Data:et.raw})}const peerIdSymbol$2=Symbol.for("@libp2p/peer-id");var gs;let InvalidParametersError$2=(gs=class extends Error{constructor(o="Invalid parameters"){super(o),this.name="InvalidParametersError"}},wt(gs,"name","InvalidParametersError"),gs);class InvalidCIDError extends Error{constructor(o="Invalid CID"){super(o),this.name="InvalidCIDError"}}wt(InvalidCIDError,"name","InvalidCIDError");class InvalidMultihashError extends Error{constructor(o="Invalid Multihash"){super(o),this.name="InvalidMultihashError"}}wt(InvalidMultihashError,"name","InvalidMultihashError");class UnsupportedKeyTypeError extends Error{constructor(o="Unsupported key type"){super(o),this.name="UnsupportedKeyTypeError"}}wt(UnsupportedKeyTypeError,"name","UnsupportedKeyTypeError");function equals$8(et,o){if(et===o)return!0;if(et.byteLength!==o.byteLength)return!1;for(let tt=0;tt<et.byteLength;tt++)if(et[tt]!==o[tt])return!1;return!0}function coerce$g(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function fromString$o(et){return new TextEncoder().encode(et)}function toString$p(et){return new TextDecoder().decode(et)}function base$h(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt<tt.length;rt++)tt[rt]=255;for(var nt=0;nt<et.length;nt++){var ot=et.charAt(nt),it=ot.charCodeAt(0);if(tt[it]!==255)throw new TypeError(ot+" is ambiguous");tt[it]=nt}var st=et.length,at=et.charAt(0),ct=Math.log(st)/Math.log(256),lt=Math.log(256)/Math.log(st);function dt(ft){if(ft instanceof Uint8Array||(ArrayBuffer.isView(ft)?ft=new Uint8Array(ft.buffer,ft.byteOffset,ft.byteLength):Array.isArray(ft)&&(ft=Uint8Array.from(ft))),!(ft instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(ft.length===0)return"";for(var pt=0,yt=0,gt=0,bt=ft.length;gt!==bt&&ft[gt]===0;)gt++,pt++;for(var xt=(bt-gt)*lt+1>>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct<yt)&&St!==-1;St--,Ct++)Et+=256*vt[St]>>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At<xt;++At)kt+=et.charAt(vt[At]);return kt}function ht(ft){if(typeof ft!="string")throw new TypeError("Expected String");if(ft.length===0)return new Uint8Array;var pt=0;if(ft[pt]!==" "){for(var yt=0,gt=0;ft[pt]===at;)yt++,pt++;for(var bt=(ft.length-pt)*ct+1>>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et<gt)&&Ct!==-1;Ct--,Et++)vt+=st*xt[Ct]>>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$h=base$h,_brrp__multiformats_scope_baseX$g=src$h;let Encoder$h=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$h=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$i(this,o)}},ComposedDecoder$g=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$i(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$i(et,o){return new ComposedDecoder$g({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$g=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$h(o,tt,rt),this.decoder=new Decoder$h(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$i({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$g(et,o,tt,rt)}function baseX$g({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$g(tt,et);return from$i({prefix:o,name:et,encode:rt,decode:ot=>coerce$g(nt(ot))})}function decode$J(et,o,tt,rt){const nt={};for(let lt=0;lt<o.length;++lt)nt[o[lt]]=lt;let ot=et.length;for(;et[ot-1]==="=";)--ot;const it=new Uint8Array(ot*tt/8|0);let st=0,at=0,ct=0;for(let lt=0;lt<ot;++lt){const dt=nt[et[lt]];if(dt===void 0)throw new SyntaxError(`Non-${rt} character`);at=at<<tt|dt,st+=tt,st>=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$C(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<<tt)-1;let ot="",it=0,st=0;for(let at=0;at<et.length;++at)for(st=st<<8|et[at],it+=8;it>tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<<tt-it]),rt)for(;ot.length*tt&7;)ot+="=";return ot}function rfc4648$f({name:et,prefix:o,bitsPerChar:tt,alphabet:rt}){return from$i({prefix:o,name:et,encode(nt){return encode$C(nt,rt,tt)},decode(nt){return decode$J(nt,rt,tt,et)}})}const base58btc$g=baseX$g({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr$c=baseX$g({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58$c=Object.freeze(Object.defineProperty({__proto__:null,base58btc:base58btc$g,base58flickr:base58flickr$c},Symbol.toStringTag,{value:"Module"})),base32$s=rfc4648$f({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper$c=rfc4648$f({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad$c=rfc4648$f({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper$c=rfc4648$f({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex$c=rfc4648$f({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper$c=rfc4648$f({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad$c=rfc4648$f({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper$c=rfc4648$f({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z$c=rfc4648$f({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$t=Object.freeze(Object.defineProperty({__proto__:null,base32:base32$s,base32hex:base32hex$c,base32hexpad:base32hexpad$c,base32hexpadupper:base32hexpadupper$c,base32hexupper:base32hexupper$c,base32pad:base32pad$c,base32padupper:base32padupper$c,base32upper:base32upper$c,base32z:base32z$c},Symbol.toStringTag,{value:"Module"})),base36$p=baseX$g({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper$c=baseX$g({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$q=Object.freeze(Object.defineProperty({__proto__:null,base36:base36$p,base36upper:base36upper$c},Symbol.toStringTag,{value:"Module"}));var encode_1$3=encode$B,MSB$5=128,REST$5=127,MSBALL$3=~REST$5,INT$3=Math.pow(2,31);function encode$B(et,o,tt){o=o||[],tt=tt||0;for(var rt=tt;et>=INT$3;)o[tt++]=et&255|MSB$5,et/=128;for(;et&MSBALL$3;)o[tt++]=et&255|MSB$5,et>>>=7;return o[tt]=et|0,encode$B.bytes=tt-rt+1,o}var decode$I=read$4,MSB$1$3=128,REST$1$3=127;function read$4(et,rt){var tt=0,rt=rt||0,nt=0,ot=rt,it,st=et.length;do{if(ot>=st)throw read$4.bytes=0,new RangeError("Could not decode varint");it=et[ot++],tt+=nt<28?(it&REST$1$3)<<nt:(it&REST$1$3)*Math.pow(2,nt),nt+=7}while(it>=MSB$1$3);return read$4.bytes=ot-rt,tt}var N1$3=Math.pow(2,7),N2$3=Math.pow(2,14),N3$3=Math.pow(2,21),N4$3=Math.pow(2,28),N5$3=Math.pow(2,35),N6$3=Math.pow(2,42),N7$3=Math.pow(2,49),N8$3=Math.pow(2,56),N9$3=Math.pow(2,63),length$3=function(et){return et<N1$3?1:et<N2$3?2:et<N3$3?3:et<N4$3?4:et<N5$3?5:et<N6$3?6:et<N7$3?7:et<N8$3?8:et<N9$3?9:10},varint$3={encode:encode_1$3,decode:decode$I,encodingLength:length$3},_brrp_varint$3=varint$3;function decode$H(et,o=0){return[_brrp_varint$3.decode(et,o),_brrp_varint$3.decode.bytes]}function encodeTo$1(et,o,tt=0){return _brrp_varint$3.encode(et,o,tt),o}function encodingLength$3(et){return _brrp_varint$3.encodingLength(et)}function create$4(et,o){const tt=o.byteLength,rt=encodingLength$3(et),nt=rt+encodingLength$3(tt),ot=new Uint8Array(nt+tt);return encodeTo$1(et,ot,0),encodeTo$1(tt,ot,rt),ot.set(o,nt),new Digest$3(et,tt,o,ot)}function decode$G(et){const o=coerce$g(et),[tt,rt]=decode$H(o),[nt,ot]=decode$H(o.subarray(rt)),it=o.subarray(rt+ot);if(it.byteLength!==nt)throw new Error("Incorrect length");return new Digest$3(tt,nt,it,o)}function equals$7(et,o){if(et===o)return!0;{const tt=o;return et.code===tt.code&&et.size===tt.size&&tt.bytes instanceof Uint8Array&&equals$8(et.bytes,tt.bytes)}}let Digest$3=class{constructor(o,tt,rt,nt){wt(this,"code");wt(this,"size");wt(this,"digest");wt(this,"bytes");this.code=o,this.size=tt,this.digest=rt,this.bytes=nt}};function format$1(et,o){const{bytes:tt,version:rt}=et;switch(rt){case 0:return toStringV0$1(tt,baseCache$1(et),o??base58btc$g.encoder);default:return toStringV1$1(tt,baseCache$1(et),o??base32$s.encoder)}}const cache$2=new WeakMap;function baseCache$1(et){const o=cache$2.get(et);if(o==null){const tt=new Map;return cache$2.set(et,tt),tt}return o}var xa;let CID$1=class Dr{constructor(o,tt,rt,nt){wt(this,"code");wt(this,"version");wt(this,"multihash");wt(this,"bytes");wt(this,"/");wt(this,xa,"CID");this.code=tt,this.version=o,this.multihash=rt,this.bytes=nt,this["/"]=nt}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{const{code:o,multihash:tt}=this;if(o!==DAG_PB_CODE$1)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(tt.code!==SHA_256_CODE$1)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return Dr.createV0(tt)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{const{code:o,digest:tt}=this.multihash,rt=create$4(o,tt);return Dr.createV1(this.code,rt)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(o){return Dr.equals(this,o)}static equals(o,tt){const rt=tt;return rt!=null&&o.code===rt.code&&o.version===rt.version&&equals$7(o.multihash,rt.multihash)}toString(o){return format$1(this,o)}toJSON(){return{"/":format$1(this)}}link(){return this}[(xa=Symbol.toStringTag,Symbol.for("nodejs.util.inspect.custom"))](){return`CID(${this.toString()})`}static asCID(o){if(o==null)return null;const tt=o;if(tt instanceof Dr)return tt;if(tt["/"]!=null&&tt["/"]===tt.bytes||tt.asCID===tt){const{version:rt,code:nt,multihash:ot,bytes:it}=tt;return new Dr(rt,nt,ot,it??encodeCID$1(rt,nt,ot.bytes))}else if(tt[cidSymbol$1]===!0){const{version:rt,multihash:nt,code:ot}=tt,it=decode$G(nt);return Dr.create(rt,ot,it)}else return null}static create(o,tt,rt){if(typeof tt!="number")throw new Error("String codecs are no longer supported");if(!(rt.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(o){case 0:{if(tt!==DAG_PB_CODE$1)throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE$1}) block encoding`);return new Dr(o,tt,rt,rt.bytes)}case 1:{const nt=encodeCID$1(o,tt,rt.bytes);return new Dr(o,tt,rt,nt)}default:throw new Error("Invalid version")}}static createV0(o){return Dr.create(0,DAG_PB_CODE$1,o)}static createV1(o,tt){return Dr.create(1,o,tt)}static decode(o){const[tt,rt]=Dr.decodeFirst(o);if(rt.length!==0)throw new Error("Incorrect length");return tt}static decodeFirst(o){const tt=Dr.inspectBytes(o),rt=tt.size-tt.multihashSize,nt=coerce$g(o.subarray(rt,rt+tt.multihashSize));if(nt.byteLength!==tt.multihashSize)throw new Error("Incorrect length");const ot=nt.subarray(tt.multihashSize-tt.digestSize),it=new Digest$3(tt.multihashCode,tt.digestSize,ot,nt);return[tt.version===0?Dr.createV0(it):Dr.createV1(tt.codec,it),o.subarray(tt.size)]}static inspectBytes(o){let tt=0;const rt=()=>{const[dt,ht]=decode$H(o.subarray(tt));return tt+=ht,dt};let nt=rt(),ot=DAG_PB_CODE$1;if(nt===18?(nt=0,tt=0):ot=rt(),nt!==0&&nt!==1)throw new RangeError(`Invalid CID version ${nt}`);const it=tt,st=rt(),at=rt(),ct=tt+at,lt=ct-it;return{version:nt,codec:ot,multihashCode:st,digestSize:at,multihashSize:lt,size:ct}}static parse(o,tt){const[rt,nt]=parseCIDtoBytes$1(o,tt),ot=Dr.decode(nt);if(ot.version===0&&o[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return baseCache$1(ot).set(rt,o),ot}};function parseCIDtoBytes$1(et,o){switch(et[0]){case"Q":{const tt=o??base58btc$g;return[base58btc$g.prefix,tt.decode(`${base58btc$g.prefix}${et}`)]}case base58btc$g.prefix:{const tt=o??base58btc$g;return[base58btc$g.prefix,tt.decode(et)]}case base32$s.prefix:{const tt=o??base32$s;return[base32$s.prefix,tt.decode(et)]}case base36$p.prefix:{const tt=o??base36$p;return[base36$p.prefix,tt.decode(et)]}default:{if(o==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[et[0],o.decode(et)]}}}function toStringV0$1(et,o,tt){const{prefix:rt}=tt;if(rt!==base58btc$g.prefix)throw Error(`Cannot string encode V0 in ${tt.name} encoding`);const nt=o.get(rt);if(nt==null){const ot=tt.encode(et).slice(1);return o.set(rt,ot),ot}else return nt}function toStringV1$1(et,o,tt){const{prefix:rt}=tt,nt=o.get(rt);if(nt==null){const ot=tt.encode(et);return o.set(rt,ot),ot}else return nt}const DAG_PB_CODE$1=112,SHA_256_CODE$1=18;function encodeCID$1(et,o,tt){const rt=encodingLength$3(et),nt=rt+encodingLength$3(o),ot=new Uint8Array(nt+tt.byteLength);return encodeTo$1(et,ot,0),encodeTo$1(o,ot,rt),ot.set(tt,nt),ot}const cidSymbol$1=Symbol.for("@ipld/js-cid/CID"),code$1=0,name$3="identity",encode$A=coerce$g;function digest(et){return create$4(code$1,encode$A(et))}const identity$d={code:code$1,name:name$3,encode:encode$A,digest};function from$h({name:et,code:o,encode:tt}){return new Hasher(et,o,tt)}class Hasher{constructor(o,tt,rt){wt(this,"name");wt(this,"code");wt(this,"encode");this.name=o,this.code=tt,this.encode=rt}digest(o){if(o instanceof Uint8Array){const tt=this.encode(o);return tt instanceof Uint8Array?create$4(this.code,tt):tt.then(rt=>create$4(this.code,rt))}else throw Error("Unknown type, must be binary type")}}function sha(et){return async o=>new Uint8Array(await crypto.subtle.digest(et,o))}const sha256=from$h({name:"sha2-256",code:18,encode:sha("SHA-256")}),base10$o=baseX$g({prefix:"9",name:"base10",alphabet:"0123456789"}),base10$p=Object.freeze(Object.defineProperty({__proto__:null,base10:base10$o},Symbol.toStringTag,{value:"Module"})),base16$o=rfc4648$f({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper$c=rfc4648$f({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),base16$p=Object.freeze(Object.defineProperty({__proto__:null,base16:base16$o,base16upper:base16upper$c},Symbol.toStringTag,{value:"Module"})),base2$o=rfc4648$f({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),base2$p=Object.freeze(Object.defineProperty({__proto__:null,base2:base2$o},Symbol.toStringTag,{value:"Module"})),alphabet$c=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),alphabetBytesToChars$c=alphabet$c.reduce((et,o,tt)=>(et[tt]=o,et),[]),alphabetCharsToBytes$c=alphabet$c.reduce((et,o,tt)=>{const rt=o.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${o}`);return et[rt]=tt,et},[]);function encode$z(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars$c[tt],o),"")}function decode$F(et){const o=[];for(const tt of et){const rt=tt.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${tt}`);const nt=alphabetCharsToBytes$c[rt];if(nt==null)throw new Error(`Non-base256emoji character: ${tt}`);o.push(nt)}return new Uint8Array(o)}const base256emoji$o=from$i({prefix:"🚀",name:"base256emoji",encode:encode$z,decode:decode$F}),base256emoji$p=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:base256emoji$o},Symbol.toStringTag,{value:"Module"})),base64$r=rfc4648$f({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad$c=rfc4648$f({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url$d=rfc4648$f({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad$c=rfc4648$f({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$s=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$r,base64pad:base64pad$c,base64url:base64url$d,base64urlpad:base64urlpad$c},Symbol.toStringTag,{value:"Module"})),base8$o=rfc4648$f({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$p=Object.freeze(Object.defineProperty({__proto__:null,base8:base8$o},Symbol.toStringTag,{value:"Module"})),identity$c=from$i({prefix:"\0",name:"identity",encode:et=>toString$p(et),decode:et=>fromString$o(et)}),identityBase$c=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$c},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const bases$c={...identityBase$c,...base2$p,...base8$p,...base10$p,...base16$p,...base32$t,...base36$q,...base58$c,...base64$s,...base256emoji$p};function allocUnsafe$b(et=0){return new Uint8Array(et)}function createCodec$c(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$g=createCodec$c("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii$c=createCodec$c("ascii","a",et=>{let o="a";for(let tt=0;tt<et.length;tt++)o+=String.fromCharCode(et[tt]);return o},et=>{et=et.substring(1);const o=allocUnsafe$b(et.length);for(let tt=0;tt<et.length;tt++)o[tt]=et.charCodeAt(tt);return o}),BASES$c={utf8:string$g,"utf-8":string$g,hex:bases$c.base16,latin1:ascii$c,ascii:ascii$c,binary:ascii$c,...bases$c};function toString$o(et,o="utf8"){const tt=BASES$c[o];if(tt==null)throw new Error(`Unsupported encoding "${o}"`);return tt.encoder.encode(et).substring(1)}function equals$6(et,o){if(et===o)return!0;if(et.byteLength!==o.byteLength)return!1;for(let tt=0;tt<et.byteLength;tt++)if(et[tt]!==o[tt])return!1;return!0}function fromString$n(et,o="utf8"){const tt=BASES$c[o];if(tt==null)throw new Error(`Unsupported encoding "${o}"`);return tt.decoder.decode(`${tt.prefix}${et}`)}const inspect=Symbol.for("nodejs.util.inspect.custom"),LIBP2P_KEY_CODE$1=114;var $a;class PeerIdImpl{constructor(o){wt(this,"type");wt(this,"multihash");wt(this,"publicKey");wt(this,"string");wt(this,$a,!0);this.type=o.type,this.multihash=o.multihash,Object.defineProperty(this,"string",{enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return`PeerId(${this.toString()})`}toString(){return this.string==null&&(this.string=base58btc$g.encode(this.multihash.bytes).slice(1)),this.string}toMultihash(){return this.multihash}toCID(){return CID$1.createV1(LIBP2P_KEY_CODE$1,this.multihash)}toJSON(){return this.toString()}equals(o){var tt;if(o==null)return!1;if(o instanceof Uint8Array)return equals$6(this.multihash.bytes,o);if(typeof o=="string")return this.toString()===o;if(((tt=o==null?void 0:o.toMultihash())==null?void 0:tt.bytes)!=null)return equals$6(this.multihash.bytes,o.toMultihash().bytes);throw new Error("not valid Id")}[($a=peerIdSymbol$2,inspect)](){return`PeerId(${this.toString()})`}}class RSAPeerId extends PeerIdImpl{constructor(tt){super({...tt,type:"RSA"});wt(this,"type","RSA");wt(this,"publicKey");this.publicKey=tt.publicKey}}class Ed25519PeerId extends PeerIdImpl{constructor(tt){super({...tt,type:"Ed25519"});wt(this,"type","Ed25519");wt(this,"publicKey");this.publicKey=tt.publicKey}}class Secp256k1PeerId extends PeerIdImpl{constructor(tt){super({...tt,type:"secp256k1"});wt(this,"type","secp256k1");wt(this,"publicKey");this.publicKey=tt.publicKey}}const TRANSPORT_IPFS_GATEWAY_HTTP_CODE$1=2336;var _c,yl;class URLPeerId{constructor(o){wt(this,"type","url");wt(this,"multihash");wt(this,"publicKey");wt(this,"url");wt(this,_c,!0);this.url=o.toString(),this.multihash=identity$d.digest(fromString$n(this.url))}[(yl=inspect,_c=peerIdSymbol$2,yl)](){return`PeerId(${this.url})`}toString(){return this.toCID().toString()}toMultihash(){return this.multihash}toCID(){return CID$1.createV1(TRANSPORT_IPFS_GATEWAY_HTTP_CODE$1,this.toMultihash())}toJSON(){return this.toString()}equals(o){return o==null?!1:(o instanceof Uint8Array&&(o=toString$o(o)),o.toString()===this.toString())}}const LIBP2P_KEY_CODE=114,TRANSPORT_IPFS_GATEWAY_HTTP_CODE=2336;function peerIdFromString$1(et,o){let tt;if(et.charAt(0)==="1"||et.charAt(0)==="Q")tt=decode$G(base58btc$g.decode(`z${et}`));else throw new InvalidParametersError$2('Please pass a multibase decoder for strings that do not start with "1" or "Q"');return peerIdFromMultihash(tt)}function peerIdFromPublicKey(et){if(et.type==="Ed25519")return new Ed25519PeerId({multihash:et.toCID().multihash,publicKey:et});if(et.type==="secp256k1")return new Secp256k1PeerId({multihash:et.toCID().multihash,publicKey:et});if(et.type==="RSA")return new RSAPeerId({multihash:et.toCID().multihash,publicKey:et});throw new UnsupportedKeyTypeError}function peerIdFromPrivateKey(et){return peerIdFromPublicKey(et.publicKey)}function peerIdFromMultihash(et){if(isSha256Multihash(et))return new RSAPeerId({multihash:et});if(isIdentityMultihash(et))try{const o=publicKeyFromMultihash(et);if(o.type==="Ed25519")return new Ed25519PeerId({multihash:et,publicKey:o});if(o.type==="secp256k1")return new Secp256k1PeerId({multihash:et,publicKey:o})}catch{const tt=toString$o(et.digest);return new URLPeerId(new URL(tt))}throw new InvalidMultihashError("Supplied PeerID Multihash is invalid")}function peerIdFromCID(et){if((et==null?void 0:et.multihash)==null||et.version==null||et.version===1&&et.code!==LIBP2P_KEY_CODE&&et.code!==TRANSPORT_IPFS_GATEWAY_HTTP_CODE)throw new InvalidCIDError("Supplied PeerID CID is invalid");if(et.code===TRANSPORT_IPFS_GATEWAY_HTTP_CODE){const o=toString$o(et.multihash.digest);return new URLPeerId(new URL(o))}return peerIdFromMultihash(et.multihash)}function isIdentityMultihash(et){return et.code===identity$d.code}function isSha256Multihash(et){return et.code===sha256.code}let AbortError$8=class extends Error{constructor(tt,rt,nt){super(tt??"The operation was aborted");wt(this,"type");wt(this,"code");this.type="aborted",this.name=nt??"AbortError",this.code=rt??"ABORT_ERR"}};async function raceSignal(et,o,tt){if(o==null)return et;if(o.aborted)return Promise.reject(new AbortError$8(tt==null?void 0:tt.errorMessage,tt==null?void 0:tt.errorCode,tt==null?void 0:tt.errorName));let rt;const nt=new AbortError$8(tt==null?void 0:tt.errorMessage,tt==null?void 0:tt.errorCode,tt==null?void 0:tt.errorName);try{return await Promise.race([et,new Promise((ot,it)=>{rt=()=>{it(nt)},o.addEventListener("abort",rt)})])}finally{rt!=null&&o.removeEventListener("abort",rt)}}class QueuelessPushable{constructor(){wt(this,"readNext");wt(this,"haveNext");wt(this,"ended");wt(this,"nextResult");this.ended=!1,this.readNext=pDefer(),this.haveNext=pDefer()}[Symbol.asyncIterator](){return this}async next(){if(this.nextResult==null&&await this.haveNext.promise,this.nextResult==null)throw new Error("HaveNext promise resolved but nextResult was undefined");const o=this.nextResult;return this.nextResult=void 0,this.readNext.resolve(),this.readNext=pDefer(),o}async throw(o){return this.ended=!0,o!=null&&(this.haveNext.promise.catch(()=>{}),this.haveNext.reject(o)),{done:!0,value:void 0}}async return(){const o={done:!0,value:void 0};return await this._push(void 0),o}async push(o,tt){await this._push(o,tt)}async end(o,tt){o!=null?await this.throw(o):await this._push(void 0,tt)}async _push(o,tt){if(o!=null&&this.ended)throw new Error("Cannot push value onto an ended pushable");for(;this.nextResult!=null;)await this.readNext.promise;o!=null?this.nextResult={done:!1,value:o}:(this.ended=!0,this.nextResult={done:!0,value:void 0}),this.haveNext.resolve(),this.haveNext=pDefer(),await raceSignal(this.readNext.promise,tt==null?void 0:tt.signal,tt)}}function queuelessPushable(){return new QueuelessPushable}class UnexpectedEOFError extends Error{constructor(){super(...arguments);wt(this,"name","UnexpectedEOFError");wt(this,"code","ERR_UNEXPECTED_EOF")}}class CodeError extends Error{constructor(tt,rt){super(tt);wt(this,"code");this.code=rt}}let AbortError$7=class extends CodeError{constructor(tt){super(tt,"ABORT_ERR");wt(this,"type");this.type="aborted",this.name="AbortError"}};function byteStream(et,o){const tt=queuelessPushable();et.sink(tt).catch(async it=>{await tt.end(it)}),et.sink=async it=>{for await(const st of it)await tt.push(st);await tt.end()};let rt=et.source;et.source[Symbol.iterator]!=null?rt=et.source[Symbol.iterator]():et.source[Symbol.asyncIterator]!=null&&(rt=et.source[Symbol.asyncIterator]());const nt=new Uint8ArrayList;return{read:async(it,st)=>{var lt,dt;(lt=st==null?void 0:st.signal)==null||lt.throwIfAborted();let at;const ct=new Promise((ht,mt)=>{var ft;at=()=>{mt(new AbortError$7("Read aborted"))},(ft=st==null?void 0:st.signal)==null||ft.addEventListener("abort",at)});try{if(it==null){const{done:mt,value:ft}=await Promise.race([rt.next(),ct]);return mt===!0?new Uint8ArrayList:ft}for(;nt.byteLength<it;){const{value:mt,done:ft}=await Promise.race([rt.next(),ct]);if(ft===!0)throw new UnexpectedEOFError("unexpected end of input");nt.append(mt)}const ht=nt.sublist(0,it);return nt.consume(it),ht}finally{at!=null&&((dt=st==null?void 0:st.signal)==null||dt.removeEventListener("abort",at))}},write:async(it,st)=>{var at;(at=st==null?void 0:st.signal)==null||at.throwIfAborted(),it instanceof Uint8Array?await tt.push(it,st):await tt.push(it.subarray(),st)},unwrap:()=>{if(nt.byteLength>0){const it=et.source;et.source=async function*(){(o==null?void 0:o.yieldBytes)===!1?yield nt:yield*nt,yield*it}()}return et}}}class InvalidMessageLengthError extends Error{constructor(){super(...arguments);wt(this,"name","InvalidMessageLengthError");wt(this,"code","ERR_INVALID_MSG_LENGTH")}}class InvalidDataLengthError extends Error{constructor(){super(...arguments);wt(this,"name","InvalidDataLengthError");wt(this,"code","ERR_MSG_DATA_TOO_LONG")}}class InvalidDataLengthLengthError extends Error{constructor(){super(...arguments);wt(this,"name","InvalidDataLengthLengthError");wt(this,"code","ERR_MSG_LENGTH_TOO_LONG")}}function lpStream(et,o={}){const tt=byteStream(et,o);o.maxDataLength!=null&&o.maxLengthLength==null&&(o.maxLengthLength=encodingLength$6(o.maxDataLength));const rt=(o==null?void 0:o.lengthDecoder)??decode$Z,nt=(o==null?void 0:o.lengthEncoder)??encode$P;return{read:async it=>{let st=-1;const at=new Uint8ArrayList;for(;;){at.append(await tt.read(1,it));try{st=rt(at)}catch(ct){if(ct instanceof RangeError)continue;throw ct}if(st<0)throw new InvalidMessageLengthError("Invalid message length");if((o==null?void 0:o.maxLengthLength)!=null&&at.byteLength>o.maxLengthLength)throw new InvalidDataLengthLengthError("message length length too long");if(st>-1)break}if((o==null?void 0:o.maxDataLength)!=null&&st>o.maxDataLength)throw new InvalidDataLengthError("message length too long");return tt.read(st,it)},write:async(it,st)=>{await tt.write(new Uint8ArrayList(nt(it.byteLength),it),st)},writeV:async(it,st)=>{const at=new Uint8ArrayList(...it.flatMap(ct=>[nt(ct.byteLength),ct]));await tt.write(at,st)},unwrap:()=>tt.unwrap()}}function pair(){const et=pDefer();let o=!1;return{sink:async tt=>{if(o)throw new Error("already piped");o=!0,et.resolve(tt)},source:async function*(){yield*await et.promise}()}}function duplexPair(){const et=pair(),o=pair();return[{source:et.source,sink:o.sink},{source:o.source,sink:et.sink}]}function alloc$4(et=0){return new Uint8Array(et)}function allocUnsafe$a(et=0){return new Uint8Array(et)}var define_globalThis_process_env_default$2={};const NOISE_MSG_MAX_LENGTH_BYTES=65535,NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG=NOISE_MSG_MAX_LENGTH_BYTES-16,DUMP_SESSION_KEYS=!!(define_globalThis_process_env_default$2!=null&&define_globalThis_process_env_default$2.DUMP_SESSION_KEYS);function number$2(et){if(!Number.isSafeInteger(et)||et<0)throw new Error(`positive integer expected, not ${et}`)}function bool(et){if(typeof et!="boolean")throw new Error(`boolean expected, not ${et}`)}function isBytes$1(et){return et instanceof Uint8Array||et!=null&&typeof et=="object"&&et.constructor.name==="Uint8Array"}function bytes(et,...o){if(!isBytes$1(et))throw new Error("Uint8Array expected");if(o.length>0&&!o.includes(et.length))throw new Error(`Uint8Array expected of length ${o}, not of length=${et.length}`)}function exists(et,o=!0){if(et.destroyed)throw new Error("Hash instance has been destroyed");if(o&&et.finished)throw new Error("Hash#digest() has already been called")}function output(et,o){bytes(et);const tt=o.outputLen;if(et.length<tt)throw new Error(`digestInto() expects output buffer of length at least ${tt}`)}/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */const u32=et=>new Uint32Array(et.buffer,et.byteOffset,Math.floor(et.byteLength/4)),createView=et=>new DataView(et.buffer,et.byteOffset,et.byteLength),isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!isLE)throw new Error("Non little-endian hardware is not supported");function utf8ToBytes(et){if(typeof et!="string")throw new Error(`string expected, got ${typeof et}`);return new Uint8Array(new TextEncoder().encode(et))}function toBytes(et){if(typeof et=="string")et=utf8ToBytes(et);else if(isBytes$1(et))et=copyBytes(et);else throw new Error(`Uint8Array expected, got ${typeof et}`);return et}function checkOpts(et,o){if(o==null||typeof o!="object")throw new Error("options must be defined");return Object.assign(et,o)}function equalBytes(et,o){if(et.length!==o.length)return!1;let tt=0;for(let rt=0;rt<et.length;rt++)tt|=et[rt]^o[rt];return tt===0}const wrapCipher=(et,o)=>(Object.assign(o,et),o);function setBigUint64(et,o,tt,rt){if(typeof et.setBigUint64=="function")return et.setBigUint64(o,tt,rt);const nt=BigInt(32),ot=BigInt(4294967295),it=Number(tt>>nt&ot),st=Number(tt&ot),at=4,ct=0;et.setUint32(o+at,it,rt),et.setUint32(o+ct,st,rt)}function copyBytes(et){return Uint8Array.from(et)}function clean(...et){for(let o=0;o<et.length;o++)et[o].fill(0)}const _utf8ToBytes=et=>Uint8Array.from(et.split("").map(o=>o.charCodeAt(0))),sigma16=_utf8ToBytes("expand 16-byte k"),sigma32=_utf8ToBytes("expand 32-byte k"),sigma16_32=u32(sigma16),sigma32_32=u32(sigma32);sigma32_32.slice();function rotl(et,o){return et<<o|et>>>32-o}function isAligned32(et){return et.byteOffset%4===0}const BLOCK_LEN=64,BLOCK_LEN32=16,MAX_COUNTER=2**32-1,U32_EMPTY=new Uint32Array;function runCipher(et,o,tt,rt,nt,ot,it,st){const at=nt.length,ct=new Uint8Array(BLOCK_LEN),lt=u32(ct),dt=isAligned32(nt)&&isAligned32(ot),ht=dt?u32(nt):U32_EMPTY,mt=dt?u32(ot):U32_EMPTY;for(let ft=0;ft<at;it++){if(et(o,tt,rt,lt,it,st),it>=MAX_COUNTER)throw new Error("arx: counter overflow");const pt=Math.min(BLOCK_LEN,at-ft);if(dt&&pt===BLOCK_LEN){const yt=ft/4;if(ft%4!==0)throw new Error("arx: invalid block position");for(let gt=0,bt;gt<BLOCK_LEN32;gt++)bt=yt+gt,mt[bt]=ht[bt]^lt[gt];ft+=BLOCK_LEN;continue}for(let yt=0,gt;yt<pt;yt++)gt=ft+yt,ot[gt]=nt[gt]^ct[yt];ft+=pt}}function createCipher(et,o){const{allowShortKeys:tt,extendNonceFn:rt,counterLength:nt,counterRight:ot,rounds:it}=checkOpts({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},o);if(typeof et!="function")throw new Error("core must be a function");return number$2(nt),number$2(it),bool(ot),bool(tt),(st,at,ct,lt,dt=0)=>{bytes(st),bytes(at),bytes(ct);const ht=ct.length;if(lt===void 0&&(lt=new Uint8Array(ht)),bytes(lt),number$2(dt),dt<0||dt>=MAX_COUNTER)throw new Error("arx: counter overflow");if(lt.length<ht)throw new Error(`arx: output (${lt.length}) is shorter than data (${ht})`);const mt=[];let ft=st.length,pt,yt;if(ft===32)mt.push(pt=copyBytes(st)),yt=sigma32_32;else if(ft===16&&tt)pt=new Uint8Array(32),pt.set(st),pt.set(st,16),yt=sigma16_32,mt.push(pt);else throw new Error(`arx: invalid 32-byte key, got length=${ft}`);isAligned32(at)||mt.push(at=copyBytes(at));const gt=u32(pt);if(rt){if(at.length!==24)throw new Error("arx: extended nonce must be 24 bytes");rt(yt,gt,u32(at.subarray(0,16)),gt),at=at.subarray(16)}const bt=16-nt;if(bt!==at.length)throw new Error(`arx: nonce must be ${bt} or 16 bytes`);if(bt!==12){const vt=new Uint8Array(12);vt.set(at,ot?0:12-at.length),at=vt,mt.push(at)}const xt=u32(at);return runCipher(et,yt,gt,xt,ct,lt,dt,it),clean(...mt),lt}}const u8to16=(et,o)=>et[o++]&255|(et[o++]&255)<<8;class Poly1305{constructor(o){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,o=toBytes(o),bytes(o,32);const tt=u8to16(o,0),rt=u8to16(o,2),nt=u8to16(o,4),ot=u8to16(o,6),it=u8to16(o,8),st=u8to16(o,10),at=u8to16(o,12),ct=u8to16(o,14);this.r[0]=tt&8191,this.r[1]=(tt>>>13|rt<<3)&8191,this.r[2]=(rt>>>10|nt<<6)&7939,this.r[3]=(nt>>>7|ot<<9)&8191,this.r[4]=(ot>>>4|it<<12)&255,this.r[5]=it>>>1&8190,this.r[6]=(it>>>14|st<<2)&8191,this.r[7]=(st>>>11|at<<5)&8065,this.r[8]=(at>>>8|ct<<8)&8191,this.r[9]=ct>>>5&127;for(let lt=0;lt<8;lt++)this.pad[lt]=u8to16(o,16+2*lt)}process(o,tt,rt=!1){const nt=rt?0:2048,{h:ot,r:it}=this,st=it[0],at=it[1],ct=it[2],lt=it[3],dt=it[4],ht=it[5],mt=it[6],ft=it[7],pt=it[8],yt=it[9],gt=u8to16(o,tt+0),bt=u8to16(o,tt+2),xt=u8to16(o,tt+4),vt=u8to16(o,tt+6),Et=u8to16(o,tt+8),Ct=u8to16(o,tt+10),St=u8to16(o,tt+12),At=u8to16(o,tt+14);let kt=ot[0]+(gt&8191),It=ot[1]+((gt>>>13|bt<<3)&8191),Nt=ot[2]+((bt>>>10|xt<<6)&8191),Lt=ot[3]+((xt>>>7|vt<<9)&8191),Mt=ot[4]+((vt>>>4|Et<<12)&8191),zt=ot[5]+(Et>>>1&8191),Ut=ot[6]+((Et>>>14|Ct<<2)&8191),Xt=ot[7]+((Ct>>>11|St<<5)&8191),Wt=ot[8]+((St>>>8|At<<8)&8191),Ft=ot[9]+(At>>>5|nt),qt=0,Pt=qt+kt*st+It*(5*yt)+Nt*(5*pt)+Lt*(5*ft)+Mt*(5*mt);qt=Pt>>>13,Pt&=8191,Pt+=zt*(5*ht)+Ut*(5*dt)+Xt*(5*lt)+Wt*(5*ct)+Ft*(5*at),qt+=Pt>>>13,Pt&=8191;let Yt=qt+kt*at+It*st+Nt*(5*yt)+Lt*(5*pt)+Mt*(5*ft);qt=Yt>>>13,Yt&=8191,Yt+=zt*(5*mt)+Ut*(5*ht)+Xt*(5*dt)+Wt*(5*lt)+Ft*(5*ct),qt+=Yt>>>13,Yt&=8191;let Qt=qt+kt*ct+It*at+Nt*st+Lt*(5*yt)+Mt*(5*pt);qt=Qt>>>13,Qt&=8191,Qt+=zt*(5*ft)+Ut*(5*mt)+Xt*(5*ht)+Wt*(5*dt)+Ft*(5*lt),qt+=Qt>>>13,Qt&=8191;let jt=qt+kt*lt+It*ct+Nt*at+Lt*st+Mt*(5*yt);qt=jt>>>13,jt&=8191,jt+=zt*(5*pt)+Ut*(5*ft)+Xt*(5*mt)+Wt*(5*ht)+Ft*(5*dt),qt+=jt>>>13,jt&=8191;let Gt=qt+kt*dt+It*lt+Nt*ct+Lt*at+Mt*st;qt=Gt>>>13,Gt&=8191,Gt+=zt*(5*yt)+Ut*(5*pt)+Xt*(5*ft)+Wt*(5*mt)+Ft*(5*ht),qt+=Gt>>>13,Gt&=8191;let rr=qt+kt*ht+It*dt+Nt*lt+Lt*ct+Mt*at;qt=rr>>>13,rr&=8191,rr+=zt*st+Ut*(5*yt)+Xt*(5*pt)+Wt*(5*ft)+Ft*(5*mt),qt+=rr>>>13,rr&=8191;let Ht=qt+kt*mt+It*ht+Nt*dt+Lt*lt+Mt*ct;qt=Ht>>>13,Ht&=8191,Ht+=zt*at+Ut*st+Xt*(5*yt)+Wt*(5*pt)+Ft*(5*ft),qt+=Ht>>>13,Ht&=8191;let dr=qt+kt*ft+It*mt+Nt*ht+Lt*dt+Mt*lt;qt=dr>>>13,dr&=8191,dr+=zt*ct+Ut*at+Xt*st+Wt*(5*yt)+Ft*(5*pt),qt+=dr>>>13,dr&=8191;let Zt=qt+kt*pt+It*ft+Nt*mt+Lt*ht+Mt*dt;qt=Zt>>>13,Zt&=8191,Zt+=zt*lt+Ut*ct+Xt*at+Wt*st+Ft*(5*yt),qt+=Zt>>>13,Zt&=8191;let Jt=qt+kt*yt+It*pt+Nt*ft+Lt*mt+Mt*ht;qt=Jt>>>13,Jt&=8191,Jt+=zt*dt+Ut*lt+Xt*ct+Wt*at+Ft*st,qt+=Jt>>>13,Jt&=8191,qt=(qt<<2)+qt|0,qt=qt+Pt|0,Pt=qt&8191,qt=qt>>>13,Yt+=qt,ot[0]=Pt,ot[1]=Yt,ot[2]=Qt,ot[3]=jt,ot[4]=Gt,ot[5]=rr,ot[6]=Ht,ot[7]=dr,ot[8]=Zt,ot[9]=Jt}finalize(){const{h:o,pad:tt}=this,rt=new Uint16Array(10);let nt=o[1]>>>13;o[1]&=8191;for(let st=2;st<10;st++)o[st]+=nt,nt=o[st]>>>13,o[st]&=8191;o[0]+=nt*5,nt=o[0]>>>13,o[0]&=8191,o[1]+=nt,nt=o[1]>>>13,o[1]&=8191,o[2]+=nt,rt[0]=o[0]+5,nt=rt[0]>>>13,rt[0]&=8191;for(let st=1;st<10;st++)rt[st]=o[st]+nt,nt=rt[st]>>>13,rt[st]&=8191;rt[9]-=8192;let ot=(nt^1)-1;for(let st=0;st<10;st++)rt[st]&=ot;ot=~ot;for(let st=0;st<10;st++)o[st]=o[st]&ot|rt[st];o[0]=(o[0]|o[1]<<13)&65535,o[1]=(o[1]>>>3|o[2]<<10)&65535,o[2]=(o[2]>>>6|o[3]<<7)&65535,o[3]=(o[3]>>>9|o[4]<<4)&65535,o[4]=(o[4]>>>12|o[5]<<1|o[6]<<14)&65535,o[5]=(o[6]>>>2|o[7]<<11)&65535,o[6]=(o[7]>>>5|o[8]<<8)&65535,o[7]=(o[8]>>>8|o[9]<<5)&65535;let it=o[0]+tt[0];o[0]=it&65535;for(let st=1;st<8;st++)it=(o[st]+tt[st]|0)+(it>>>16)|0,o[st]=it&65535;clean(rt)}update(o){exists(this);const{buffer:tt,blockLen:rt}=this;o=toBytes(o);const nt=o.length;for(let ot=0;ot<nt;){const it=Math.min(rt-this.pos,nt-ot);if(it===rt){for(;rt<=nt-ot;ot+=rt)this.process(o,ot);continue}tt.set(o.subarray(ot,ot+it),this.pos),this.pos+=it,ot+=it,this.pos===rt&&(this.process(tt,0,!1),this.pos=0)}return this}destroy(){clean(this.h,this.r,this.buffer,this.pad)}digestInto(o){exists(this),output(o,this),this.finished=!0;const{buffer:tt,h:rt}=this;let{pos:nt}=this;if(nt){for(tt[nt++]=1;nt<16;nt++)tt[nt]=0;this.process(tt,0,!0)}this.finalize();let ot=0;for(let it=0;it<8;it++)o[ot++]=rt[it]>>>0,o[ot++]=rt[it]>>>8;return o}digest(){const{buffer:o,outputLen:tt}=this;this.digestInto(o);const rt=o.slice(0,tt);return this.destroy(),rt}}function wrapConstructorWithKey(et){const o=(rt,nt)=>et(nt).update(toBytes(rt)).digest(),tt=et(new Uint8Array(32));return o.outputLen=tt.outputLen,o.blockLen=tt.blockLen,o.create=rt=>et(rt),o}const poly1305=wrapConstructorWithKey(et=>new Poly1305(et));function chachaCore(et,o,tt,rt,nt,ot=20){let it=et[0],st=et[1],at=et[2],ct=et[3],lt=o[0],dt=o[1],ht=o[2],mt=o[3],ft=o[4],pt=o[5],yt=o[6],gt=o[7],bt=nt,xt=tt[0],vt=tt[1],Et=tt[2],Ct=it,St=st,At=at,kt=ct,It=lt,Nt=dt,Lt=ht,Mt=mt,zt=ft,Ut=pt,Xt=yt,Wt=gt,Ft=bt,qt=xt,Pt=vt,Yt=Et;for(let jt=0;jt<ot;jt+=2)Ct=Ct+It|0,Ft=rotl(Ft^Ct,16),zt=zt+Ft|0,It=rotl(It^zt,12),Ct=Ct+It|0,Ft=rotl(Ft^Ct,8),zt=zt+Ft|0,It=rotl(It^zt,7),St=St+Nt|0,qt=rotl(qt^St,16),Ut=Ut+qt|0,Nt=rotl(Nt^Ut,12),St=St+Nt|0,qt=rotl(qt^St,8),Ut=Ut+qt|0,Nt=rotl(Nt^Ut,7),At=At+Lt|0,Pt=rotl(Pt^At,16),Xt=Xt+Pt|0,Lt=rotl(Lt^Xt,12),At=At+Lt|0,Pt=rotl(Pt^At,8),Xt=Xt+Pt|0,Lt=rotl(Lt^Xt,7),kt=kt+Mt|0,Yt=rotl(Yt^kt,16),Wt=Wt+Yt|0,Mt=rotl(Mt^Wt,12),kt=kt+Mt|0,Yt=rotl(Yt^kt,8),Wt=Wt+Yt|0,Mt=rotl(Mt^Wt,7),Ct=Ct+Nt|0,Yt=rotl(Yt^Ct,16),Xt=Xt+Yt|0,Nt=rotl(Nt^Xt,12),Ct=Ct+Nt|0,Yt=rotl(Yt^Ct,8),Xt=Xt+Yt|0,Nt=rotl(Nt^Xt,7),St=St+Lt|0,Ft=rotl(Ft^St,16),Wt=Wt+Ft|0,Lt=rotl(Lt^Wt,12),St=St+Lt|0,Ft=rotl(Ft^St,8),Wt=Wt+Ft|0,Lt=rotl(Lt^Wt,7),At=At+Mt|0,qt=rotl(qt^At,16),zt=zt+qt|0,Mt=rotl(Mt^zt,12),At=At+Mt|0,qt=rotl(qt^At,8),zt=zt+qt|0,Mt=rotl(Mt^zt,7),kt=kt+It|0,Pt=rotl(Pt^kt,16),Ut=Ut+Pt|0,It=rotl(It^Ut,12),kt=kt+It|0,Pt=rotl(Pt^kt,8),Ut=Ut+Pt|0,It=rotl(It^Ut,7);let Qt=0;rt[Qt++]=it+Ct|0,rt[Qt++]=st+St|0,rt[Qt++]=at+At|0,rt[Qt++]=ct+kt|0,rt[Qt++]=lt+It|0,rt[Qt++]=dt+Nt|0,rt[Qt++]=ht+Lt|0,rt[Qt++]=mt+Mt|0,rt[Qt++]=ft+zt|0,rt[Qt++]=pt+Ut|0,rt[Qt++]=yt+Xt|0,rt[Qt++]=gt+Wt|0,rt[Qt++]=bt+Ft|0,rt[Qt++]=xt+qt|0,rt[Qt++]=vt+Pt|0,rt[Qt++]=Et+Yt|0}const chacha20=createCipher(chachaCore,{counterRight:!1,counterLength:4,allowShortKeys:!1}),ZEROS16=new Uint8Array(16),updatePadded=(et,o)=>{et.update(o);const tt=o.length%16;tt&&et.update(ZEROS16.subarray(tt))},ZEROS32=new Uint8Array(32);function computeTag(et,o,tt,rt,nt){const ot=et(o,tt,ZEROS32),it=poly1305.create(ot);nt&&updatePadded(it,nt),updatePadded(it,rt);const st=new Uint8Array(16),at=createView(st);setBigUint64(at,0,BigInt(nt?nt.length:0),!0),setBigUint64(at,8,BigInt(rt.length),!0),it.update(st);const ct=it.digest();return clean(ot,st),ct}const _poly1305_aead=et=>(o,tt,rt)=>(bytes(o,32),bytes(tt),{encrypt(ot,it){const st=ot.length,at=st+16;it?bytes(it,at):it=new Uint8Array(at),et(o,tt,ot,it,1);const ct=computeTag(et,o,tt,it.subarray(0,-16),rt);return it.set(ct,st),clean(ct),it},decrypt(ot,it){const st=ot.length,at=st-16;if(st<16)throw new Error("encrypted data must be at least 16 bytes");it?bytes(it,at):it=new Uint8Array(at);const ct=ot.subarray(0,-16),lt=ot.subarray(-16),dt=computeTag(et,o,tt,ct,rt);if(!equalBytes(lt,dt))throw new Error("invalid tag");return et(o,tt,ct,it,1),clean(dt),it}}),chacha20poly1305=wrapCipher({blockSize:64,nonceLength:12,tagLength:16},_poly1305_aead(chacha20));function extract(et,o,tt){return hash$1(et),tt===void 0&&(tt=new Uint8Array(et.outputLen)),hmac(et,toBytes$2(tt),toBytes$2(o))}const HKDF_COUNTER=new Uint8Array([0]),EMPTY_BUFFER=new Uint8Array;function expand(et,o,tt,rt=32){if(hash$1(et),number$4(rt),rt>255*et.outputLen)throw new Error("Length should be <= 255*HashLen");const nt=Math.ceil(rt/et.outputLen);tt===void 0&&(tt=EMPTY_BUFFER);const ot=new Uint8Array(nt*et.outputLen),it=hmac.create(et,o),st=it._cloneInto(),at=new Uint8Array(it.outputLen);for(let ct=0;ct<nt;ct++)HKDF_COUNTER[0]=ct+1,st.update(ct===0?EMPTY_BUFFER:at).update(tt).update(HKDF_COUNTER).digestInto(at),ot.set(at,et.outputLen*ct),it._cloneInto(st);return it.destroy(),st.destroy(),at.fill(0),HKDF_COUNTER.fill(0),ot.slice(0,rt)}const pureJsCrypto={hashSHA256(et){return sha256$3(et.subarray())},getHKDF(et,o){const tt=extract(sha256$3,o,et),nt=expand(sha256$3,tt,void 0,96),ot=nt.subarray(0,32),it=nt.subarray(32,64),st=nt.subarray(64,96);return[ot,it,st]},generateX25519KeyPair(){const et=x25519.utils.randomPrivateKey();return{publicKey:x25519.getPublicKey(et),privateKey:et}},generateX25519KeyPairFromSeed(et){return{publicKey:x25519.getPublicKey(et),privateKey:et}},generateX25519SharedKey(et,o){return x25519.getSharedSecret(et.subarray(),o.subarray())},chaCha20Poly1305Encrypt(et,o,tt,rt){return chacha20poly1305(rt,o,tt).encrypt(et.subarray())},chaCha20Poly1305Decrypt(et,o,tt,rt,nt){return chacha20poly1305(rt,o,tt).decrypt(et.subarray(),nt)}},defaultCrypto=pureJsCrypto;function wrapCrypto(et){return{generateKeypair:et.generateX25519KeyPair,dh:(o,tt)=>et.generateX25519SharedKey(o.privateKey,tt).subarray(0,32),encrypt:et.chaCha20Poly1305Encrypt,decrypt:et.chaCha20Poly1305Decrypt,hash:et.hashSHA256,hkdf:et.getHKDF}}const uint16BEEncode=et=>{const o=allocUnsafe$a(2);return o[0]=et>>8,o[1]=et,o};uint16BEEncode.bytes=2;const uint16BEDecode=et=>{if(et.length<2)throw RangeError("Could not decode int16BE");if(et instanceof Uint8Array){let o=0;return o+=et[0]<<8,o+=et[1],o}return et.getUint16(0)};uint16BEDecode.bytes=2;function registerMetrics(et){return{xxHandshakeSuccesses:et.registerCounter("libp2p_noise_xxhandshake_successes_total",{help:"Total count of noise xxHandshakes successes_"}),xxHandshakeErrors:et.registerCounter("libp2p_noise_xxhandshake_error_total",{help:"Total count of noise xxHandshakes errors"}),encryptedPackets:et.registerCounter("libp2p_noise_encrypted_packets_total",{help:"Total count of noise encrypted packets successfully"}),decryptedPackets:et.registerCounter("libp2p_noise_decrypted_packets_total",{help:"Total count of noise decrypted packets"}),decryptErrors:et.registerCounter("libp2p_noise_decrypt_errors_total",{help:"Total count of noise decrypt errors"})}}function coerce$f(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function fromString$m(et){return new TextEncoder().encode(et)}function toString$n(et){return new TextDecoder().decode(et)}function base$g(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt<tt.length;rt++)tt[rt]=255;for(var nt=0;nt<et.length;nt++){var ot=et.charAt(nt),it=ot.charCodeAt(0);if(tt[it]!==255)throw new TypeError(ot+" is ambiguous");tt[it]=nt}var st=et.length,at=et.charAt(0),ct=Math.log(st)/Math.log(256),lt=Math.log(256)/Math.log(st);function dt(ft){if(ft instanceof Uint8Array||(ArrayBuffer.isView(ft)?ft=new Uint8Array(ft.buffer,ft.byteOffset,ft.byteLength):Array.isArray(ft)&&(ft=Uint8Array.from(ft))),!(ft instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(ft.length===0)return"";for(var pt=0,yt=0,gt=0,bt=ft.length;gt!==bt&&ft[gt]===0;)gt++,pt++;for(var xt=(bt-gt)*lt+1>>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct<yt)&&St!==-1;St--,Ct++)Et+=256*vt[St]>>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At<xt;++At)kt+=et.charAt(vt[At]);return kt}function ht(ft){if(typeof ft!="string")throw new TypeError("Expected String");if(ft.length===0)return new Uint8Array;var pt=0;if(ft[pt]!==" "){for(var yt=0,gt=0;ft[pt]===at;)yt++,pt++;for(var bt=(ft.length-pt)*ct+1>>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et<gt)&&Ct!==-1;Ct--,Et++)vt+=st*xt[Ct]>>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$g=base$g,_brrp__multiformats_scope_baseX$f=src$g;let Encoder$g=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$g=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$h(this,o)}},ComposedDecoder$f=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$h(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$h(et,o){return new ComposedDecoder$f({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$f=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$g(o,tt,rt),this.decoder=new Decoder$g(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$g({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$f(et,o,tt,rt)}function baseX$f({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$f(tt,et);return from$g({prefix:o,name:et,encode:rt,decode:ot=>coerce$f(nt(ot))})}function decode$E(et,o,tt,rt){const nt={};for(let lt=0;lt<o.length;++lt)nt[o[lt]]=lt;let ot=et.length;for(;et[ot-1]==="=";)--ot;const it=new Uint8Array(ot*tt/8|0);let st=0,at=0,ct=0;for(let lt=0;lt<ot;++lt){const dt=nt[et[lt]];if(dt===void 0)throw new SyntaxError(`Non-${rt} character`);at=at<<tt|dt,st+=tt,st>=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$y(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<<tt)-1;let ot="",it=0,st=0;for(let at=0;at<et.length;++at)for(st=st<<8|et[at],it+=8;it>tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<<tt-it]),rt)for(;ot.length*tt&7;)ot+="=";return ot}function rfc4648$e({name:et,prefix:o,bitsPerChar:tt,alphabet:rt}){return from$g({prefix:o,name:et,encode(nt){return encode$y(nt,rt,tt)},decode(nt){return decode$E(nt,rt,tt,et)}})}const base10$m=baseX$f({prefix:"9",name:"base10",alphabet:"0123456789"}),base10$n=Object.freeze(Object.defineProperty({__proto__:null,base10:base10$m},Symbol.toStringTag,{value:"Module"})),base16$m=rfc4648$e({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper$b=rfc4648$e({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),base16$n=Object.freeze(Object.defineProperty({__proto__:null,base16:base16$m,base16upper:base16upper$b},Symbol.toStringTag,{value:"Module"})),base2$m=rfc4648$e({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),base2$n=Object.freeze(Object.defineProperty({__proto__:null,base2:base2$m},Symbol.toStringTag,{value:"Module"})),alphabet$b=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),alphabetBytesToChars$b=alphabet$b.reduce((et,o,tt)=>(et[tt]=o,et),[]),alphabetCharsToBytes$b=alphabet$b.reduce((et,o,tt)=>{const rt=o.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${o}`);return et[rt]=tt,et},[]);function encode$x(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars$b[tt],o),"")}function decode$D(et){const o=[];for(const tt of et){const rt=tt.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${tt}`);const nt=alphabetCharsToBytes$b[rt];if(nt==null)throw new Error(`Non-base256emoji character: ${tt}`);o.push(nt)}return new Uint8Array(o)}const base256emoji$m=from$g({prefix:"🚀",name:"base256emoji",encode:encode$x,decode:decode$D}),base256emoji$n=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:base256emoji$m},Symbol.toStringTag,{value:"Module"})),base32$q=rfc4648$e({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper$b=rfc4648$e({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad$b=rfc4648$e({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper$b=rfc4648$e({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex$b=rfc4648$e({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper$b=rfc4648$e({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad$b=rfc4648$e({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper$b=rfc4648$e({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z$b=rfc4648$e({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$r=Object.freeze(Object.defineProperty({__proto__:null,base32:base32$q,base32hex:base32hex$b,base32hexpad:base32hexpad$b,base32hexpadupper:base32hexpadupper$b,base32hexupper:base32hexupper$b,base32pad:base32pad$b,base32padupper:base32padupper$b,base32upper:base32upper$b,base32z:base32z$b},Symbol.toStringTag,{value:"Module"})),base36$n=baseX$f({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper$b=baseX$f({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$o=Object.freeze(Object.defineProperty({__proto__:null,base36:base36$n,base36upper:base36upper$b},Symbol.toStringTag,{value:"Module"})),base58btc$f=baseX$f({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr$b=baseX$f({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58$b=Object.freeze(Object.defineProperty({__proto__:null,base58btc:base58btc$f,base58flickr:base58flickr$b},Symbol.toStringTag,{value:"Module"})),base64$p=rfc4648$e({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad$b=rfc4648$e({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url$c=rfc4648$e({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad$b=rfc4648$e({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$q=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$p,base64pad:base64pad$b,base64url:base64url$c,base64urlpad:base64urlpad$b},Symbol.toStringTag,{value:"Module"})),base8$m=rfc4648$e({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$n=Object.freeze(Object.defineProperty({__proto__:null,base8:base8$m},Symbol.toStringTag,{value:"Module"})),identity$b=from$g({prefix:"\0",name:"identity",encode:et=>toString$n(et),decode:et=>fromString$m(et)}),identityBase$b=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$b},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const bases$b={...identityBase$b,...base2$n,...base8$n,...base10$n,...base16$n,...base32$r,...base36$o,...base58$b,...base64$q,...base256emoji$n};function createCodec$b(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$f=createCodec$b("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii$b=createCodec$b("ascii","a",et=>{let o="a";for(let tt=0;tt<et.length;tt++)o+=String.fromCharCode(et[tt]);return o},et=>{et=et.substring(1);const o=allocUnsafe$a(et.length);for(let tt=0;tt<et.length;tt++)o[tt]=et.charCodeAt(tt);return o}),BASES$b={utf8:string$f,"utf-8":string$f,hex:bases$b.base16,latin1:ascii$b,ascii:ascii$b,binary:ascii$b,...bases$b};function toString$m(et,o="utf8"){const tt=BASES$b[o];if(tt==null)throw new Error(`Unsupported encoding "${o}"`);return tt.encoder.encode(et).substring(1)}function logLocalStaticKeys(et,o){!o.enabled||!DUMP_SESSION_KEYS||(et?(o(`LOCAL_STATIC_PUBLIC_KEY ${toString$m(et.publicKey,"hex")}`),o(`LOCAL_STATIC_PRIVATE_KEY ${toString$m(et.privateKey,"hex")}`)):o("Missing local static keys."))}function logLocalEphemeralKeys(et,o){!o.enabled||!DUMP_SESSION_KEYS||(et?(o(`LOCAL_PUBLIC_EPHEMERAL_KEY ${toString$m(et.publicKey,"hex")}`),o(`LOCAL_PRIVATE_EPHEMERAL_KEY ${toString$m(et.privateKey,"hex")}`)):o("Missing local ephemeral keys."))}function logRemoteStaticKey(et,o){!o.enabled||!DUMP_SESSION_KEYS||o(et?`REMOTE_STATIC_PUBLIC_KEY ${toString$m(et.subarray(),"hex")}`:"Missing remote static public key.")}function logRemoteEphemeralKey(et,o){!o.enabled||!DUMP_SESSION_KEYS||o(et?`REMOTE_EPHEMERAL_PUBLIC_KEY ${toString$m(et.subarray(),"hex")}`:"Missing remote ephemeral keys.")}function logCipherState(et,o,tt){!tt.enabled||!DUMP_SESSION_KEYS||(tt(`CIPHER_STATE_1 ${et.n.getUint64()} ${et.k&&toString$m(et.k,"hex")}`),tt(`CIPHER_STATE_2 ${o.n.getUint64()} ${o.k&&toString$m(o.k,"hex")}`))}function asUint8Array$1(et){return et}function concat$1(et,o){o==null&&(o=et.reduce((nt,ot)=>nt+ot.length,0));const tt=allocUnsafe$a(o);let rt=0;for(const nt of et)tt.set(nt,rt),rt+=nt.length;return tt}function fromString$l(et,o="utf8"){const tt=BASES$b[o];if(tt==null)throw new Error(`Unsupported encoding "${o}"`);return tt.decoder.decode(`${tt.prefix}${et}`)}const ss=class ss extends Error{constructor(tt="Invalid crypto exchange"){super(tt);wt(this,"code");this.code=ss.code}};wt(ss,"code","ERR_INVALID_CRYPTO_EXCHANGE");let InvalidCryptoExchangeError=ss;const MIN_NONCE=0,MAX_NONCE=4294967295,ERR_MAX_NONCE="Cipherstate has reached maximum n, a new handshake must be performed";class Nonce{constructor(o=MIN_NONCE){wt(this,"n");wt(this,"bytes");wt(this,"view");this.n=o,this.bytes=alloc$4(12),this.view=new DataView(this.bytes.buffer,this.bytes.byteOffset,this.bytes.byteLength),this.view.setUint32(4,o,!0)}increment(){this.n++,this.view.setUint32(4,this.n,!0)}getBytes(){return this.bytes}getUint64(){return this.n}assertValue(){if(this.n>MAX_NONCE)throw new Error(ERR_MAX_NONCE)}}const ZEROLEN=alloc$4(0);class CipherState{constructor(o,tt=void 0,rt=0){wt(this,"k");wt(this,"n");wt(this,"crypto");this.crypto=o,this.k=tt,this.n=new Nonce(rt)}hasKey(){return!!this.k}encryptWithAd(o,tt){if(!this.hasKey())return tt;this.n.assertValue();const rt=this.crypto.encrypt(tt,this.n.getBytes(),o,this.k);return this.n.increment(),rt}decryptWithAd(o,tt,rt){if(!this.hasKey())return tt;this.n.assertValue();const nt=this.crypto.decrypt(tt,this.n.getBytes(),o,this.k,rt);return this.n.increment(),nt}}class SymmetricState{constructor(o,tt){wt(this,"cs");wt(this,"ck");wt(this,"h");wt(this,"crypto");this.crypto=o;const rt=fromString$l(tt,"utf-8");this.h=hashProtocolName(o,rt),this.ck=this.h,this.cs=new CipherState(o)}mixKey(o){const[tt,rt]=this.crypto.hkdf(this.ck,o);this.ck=tt,this.cs=new CipherState(this.crypto,rt)}mixHash(o){this.h=this.crypto.hash(new Uint8ArrayList(this.h,o))}encryptAndHash(o){const tt=this.cs.encryptWithAd(this.h,o);return this.mixHash(tt),tt}decryptAndHash(o){const tt=this.cs.decryptWithAd(this.h,o);return this.mixHash(o),tt}split(){const[o,tt]=this.crypto.hkdf(this.ck,ZEROLEN);return[new CipherState(this.crypto,o),new CipherState(this.crypto,tt)]}}class AbstractHandshakeState{constructor(o){wt(this,"ss");wt(this,"s");wt(this,"e");wt(this,"rs");wt(this,"re");wt(this,"initiator");wt(this,"crypto");const{crypto:tt,protocolName:rt,prologue:nt,initiator:ot,s:it,e:st,rs:at,re:ct}=o;this.crypto=tt,this.ss=new SymmetricState(tt,rt),this.ss.mixHash(nt),this.initiator=ot,this.s=it,this.e=st,this.rs=at,this.re=ct}writeE(){if(this.e)throw new Error("ephemeral keypair is already set");const o=this.crypto.generateKeypair();return this.ss.mixHash(o.publicKey),this.e=o,o.publicKey}writeS(){if(!this.s)throw new Error("static keypair is not set");return this.ss.encryptAndHash(this.s.publicKey)}writeEE(){if(!this.e)throw new Error("ephemeral keypair is not set");if(!this.re)throw new Error("remote ephemeral public key is not set");this.ss.mixKey(this.crypto.dh(this.e,this.re))}writeES(){if(this.initiator){if(!this.e)throw new Error("ephemeral keypair is not set");if(!this.rs)throw new Error("remote static public key is not set");this.ss.mixKey(this.crypto.dh(this.e,this.rs))}else{if(!this.s)throw new Error("static keypair is not set");if(!this.re)throw new Error("remote ephemeral public key is not set");this.ss.mixKey(this.crypto.dh(this.s,this.re))}}writeSE(){if(this.initiator){if(!this.s)throw new Error("static keypair is not set");if(!this.re)throw new Error("remote ephemeral public key is not set");this.ss.mixKey(this.crypto.dh(this.s,this.re))}else{if(!this.e)throw new Error("ephemeral keypair is not set");if(!this.rs)throw new Error("remote static public key is not set");this.ss.mixKey(this.crypto.dh(this.e,this.rs))}}readE(o,tt=0){if(this.re)throw new Error("remote ephemeral public key is already set");if(o.byteLength<tt+32)throw new Error("message is not long enough");this.re=o.sublist(tt,tt+32),this.ss.mixHash(this.re)}readS(o,tt=0){if(this.rs)throw new Error("remote static public key is already set");const rt=32+(this.ss.cs.hasKey()?16:0);if(o.byteLength<tt+rt)throw new Error("message is not long enough");const nt=o.sublist(tt,tt+rt);return this.rs=this.ss.decryptAndHash(nt),rt}readEE(){this.writeEE()}readES(){this.writeES()}readSE(){this.writeSE()}}class XXHandshakeState extends AbstractHandshakeState{writeMessageA(o){return new Uint8ArrayList(this.writeE(),this.ss.encryptAndHash(o))}writeMessageB(o){const tt=this.writeE();this.writeEE();const rt=this.writeS();return this.writeES(),new Uint8ArrayList(tt,rt,this.ss.encryptAndHash(o))}writeMessageC(o){const tt=this.writeS();return this.writeSE(),new Uint8ArrayList(tt,this.ss.encryptAndHash(o))}readMessageA(o){try{return this.readE(o),this.ss.decryptAndHash(o.sublist(32))}catch(tt){throw new InvalidCryptoExchangeError(`handshake stage 0 validation fail: ${tt.message}`)}}readMessageB(o){try{this.readE(o),this.readEE();const tt=this.readS(o,32);return this.readES(),this.ss.decryptAndHash(o.sublist(32+tt))}catch(tt){throw new InvalidCryptoExchangeError(`handshake stage 1 validation fail: ${tt.message}`)}}readMessageC(o){try{const tt=this.readS(o);return this.readSE(),this.ss.decryptAndHash(o.sublist(tt))}catch(tt){throw new InvalidCryptoExchangeError(`handshake stage 2 validation fail: ${tt.message}`)}}}function hashProtocolName(et,o){if(o.length<=32){const tt=alloc$4(32);return tt.set(o),tt}else return et.hash(o)}var NoiseExtensions;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{if(nt.lengthDelimited!==!1&&rt.fork(),tt.webtransportCerthashes!=null)for(const ot of tt.webtransportCerthashes)rt.uint32(10),rt.bytes(ot);nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt)=>{const nt={webtransportCerthashes:[]},ot=rt==null?tt.len:tt.pos+rt;for(;tt.pos<ot;){const it=tt.uint32();switch(it>>>3){case 1:{nt.webtransportCerthashes.push(tt.bytes());break}default:{tt.skipType(it&7);break}}}return nt})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=tt=>decodeMessage(tt,et.codec())})(NoiseExtensions||(NoiseExtensions={}));var NoiseHandshakePayload;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.identityKey!=null&&tt.identityKey.byteLength>0&&(rt.uint32(10),rt.bytes(tt.identityKey)),tt.identitySig!=null&&tt.identitySig.byteLength>0&&(rt.uint32(18),rt.bytes(tt.identitySig)),tt.extensions!=null&&(rt.uint32(34),NoiseExtensions.codec().encode(tt.extensions,rt)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt)=>{const nt={identityKey:alloc$4(0),identitySig:alloc$4(0)},ot=rt==null?tt.len:tt.pos+rt;for(;tt.pos<ot;){const it=tt.uint32();switch(it>>>3){case 1:{nt.identityKey=tt.bytes();break}case 2:{nt.identitySig=tt.bytes();break}case 4:{nt.extensions=NoiseExtensions.codec().decode(tt,tt.uint32());break}default:{tt.skipType(it&7);break}}}return nt})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=tt=>decodeMessage(tt,et.codec())})(NoiseHandshakePayload||(NoiseHandshakePayload={}));async function createHandshakePayload(et,o,tt){const rt=await et.sign(getSignaturePayload(o));return NoiseHandshakePayload.encode({identityKey:publicKeyToProtobuf(et.publicKey),identitySig:rt,extensions:tt})}async function decodeHandshakePayload(et,o,tt){try{const rt=NoiseHandshakePayload.decode(et),nt=publicKeyFromProtobuf(rt.identityKey);if((tt==null?void 0:tt.equals(nt))===!1)throw new Error(`Payload identity key ${nt} does not match expected remote identity key ${tt}`);if(!o)throw new Error("Remote static does not exist");const ot=getSignaturePayload(o);if(!await nt.verify(ot,rt.identitySig))throw new Error("Invalid payload signature");return rt}catch(rt){throw new UnexpectedPeerError(rt.message)}}function getSignaturePayload(et){const o=fromString$l("noise-libp2p-static-key:");return et instanceof Uint8Array?concat$1([o,et],o.length+et.length):(et.prepend(o),et)}async function performHandshakeInitiator(et,o){const{log:tt,connection:rt,crypto:nt,privateKey:ot,prologue:it,s:st,remoteIdentityKey:at,extensions:ct}=et,lt=await createHandshakePayload(ot,st.publicKey,ct),dt=new XXHandshakeState({crypto:nt,protocolName:"Noise_XX_25519_ChaChaPoly_SHA256",initiator:!0,prologue:it,s:st});logLocalStaticKeys(dt.s,tt),tt.trace("Stage 0 - Initiator starting to send first message."),await rt.write(dt.writeMessageA(ZEROLEN),o),tt.trace("Stage 0 - Initiator finished sending first message."),logLocalEphemeralKeys(dt.e,tt),tt.trace("Stage 1 - Initiator waiting to receive first message from responder...");const ht=dt.readMessageB(await rt.read(o));tt.trace("Stage 1 - Initiator received the message."),logRemoteEphemeralKey(dt.re,tt),logRemoteStaticKey(dt.rs,tt),tt.trace("Initiator going to check remote's signature...");const mt=await decodeHandshakePayload(ht,dt.rs,at);tt.trace("All good with the signature!"),tt.trace("Stage 2 - Initiator sending third handshake message."),await rt.write(dt.writeMessageC(lt),o),tt.trace("Stage 2 - Initiator sent message with signed payload.");const[ft,pt]=dt.ss.split();return logCipherState(ft,pt,tt),{payload:mt,encrypt:yt=>ft.encryptWithAd(ZEROLEN,yt),decrypt:(yt,gt)=>pt.decryptWithAd(ZEROLEN,yt,gt)}}async function performHandshakeResponder(et,o){const{log:tt,connection:rt,crypto:nt,privateKey:ot,prologue:it,s:st,remoteIdentityKey:at,extensions:ct}=et,lt=await createHandshakePayload(ot,st.publicKey,ct),dt=new XXHandshakeState({crypto:nt,protocolName:"Noise_XX_25519_ChaChaPoly_SHA256",initiator:!1,prologue:it,s:st});logLocalStaticKeys(dt.s,tt),tt.trace("Stage 0 - Responder waiting to receive first message."),dt.readMessageA(await rt.read(o)),tt.trace("Stage 0 - Responder received first message."),logRemoteEphemeralKey(dt.re,tt),tt.trace("Stage 1 - Responder sending out first message with signed payload and static key."),await rt.write(dt.writeMessageB(lt),o),tt.trace("Stage 1 - Responder sent the second handshake message with signed payload."),logLocalEphemeralKeys(dt.e,tt),tt.trace("Stage 2 - Responder waiting for third handshake message...");const ht=dt.readMessageC(await rt.read(o));tt.trace("Stage 2 - Responder received the message, finished handshake.");const mt=await decodeHandshakePayload(ht,dt.rs,at),[ft,pt]=dt.ss.split();return logCipherState(ft,pt,tt),{payload:mt,encrypt:yt=>pt.encryptWithAd(ZEROLEN,yt),decrypt:(yt,gt)=>ft.decryptWithAd(ZEROLEN,yt,gt)}}const CHACHA_TAG_LENGTH=16;function encryptStream(et,o){return async function*(tt){for await(const rt of tt)for(let nt=0;nt<rt.length;nt+=NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG){let ot=nt+NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG;ot>rt.length&&(ot=rt.length);let it;rt instanceof Uint8Array?it=et.encrypt(rt.subarray(nt,ot)):it=et.encrypt(rt.sublist(nt,ot)),o==null||o.encryptedPackets.increment(),yield new Uint8ArrayList(uint16BEEncode(it.byteLength),it)}}}function decryptStream(et,o){return async function*(tt){for await(const rt of tt)for(let nt=0;nt<rt.length;nt+=NOISE_MSG_MAX_LENGTH_BYTES){let ot=nt+NOISE_MSG_MAX_LENGTH_BYTES;if(ot>rt.length&&(ot=rt.length),ot-CHACHA_TAG_LENGTH<nt)throw new Error("Invalid chunk");const it=rt.sublist(nt,ot),st=rt.subarray(nt,ot-CHACHA_TAG_LENGTH);try{const at=et.decrypt(it,st);o==null||o.decryptedPackets.increment(),yield at}catch(at){throw o==null||o.decryptErrors.increment(),at}}}}var xl,wl;wl=Symbol.toStringTag,xl=serviceCapabilities$5;class Noise{constructor(o,tt={}){wt(this,"protocol","/noise");wt(this,"crypto");wt(this,"prologue");wt(this,"staticKey");wt(this,"extensions");wt(this,"metrics");wt(this,"components");wt(this,wl,"@chainsafe/libp2p-noise");wt(this,xl,["@libp2p/connection-encryption","@chainsafe/libp2p-noise"]);const{staticNoiseKey:rt,extensions:nt,crypto:ot,prologueBytes:it}=tt,{metrics:st}=o;this.components=o;const at=ot??defaultCrypto;this.crypto=wrapCrypto(at),this.extensions=nt,this.metrics=st?registerMetrics(st):void 0,rt?this.staticKey=at.generateX25519KeyPairFromSeed(rt):this.staticKey=at.generateX25519KeyPair(),this.prologue=it??alloc$4(0)}async secureOutbound(o,tt){var st;const rt=lpStream(o,{lengthEncoder:uint16BEEncode,lengthDecoder:uint16BEDecode,maxDataLength:NOISE_MSG_MAX_LENGTH_BYTES}),nt=await this.performHandshakeInitiator(rt,this.components.privateKey,(st=tt==null?void 0:tt.remotePeer)==null?void 0:st.publicKey,tt),ot=await this.createSecureConnection(rt,nt);o.source=ot.source,o.sink=ot.sink;const it=publicKeyFromProtobuf(nt.payload.identityKey);return{conn:o,remoteExtensions:nt.payload.extensions,remotePeer:peerIdFromPublicKey(it)}}async secureInbound(o,tt){var st;const rt=lpStream(o,{lengthEncoder:uint16BEEncode,lengthDecoder:uint16BEDecode,maxDataLength:NOISE_MSG_MAX_LENGTH_BYTES}),nt=await this.performHandshakeResponder(rt,this.components.privateKey,(st=tt==null?void 0:tt.remotePeer)==null?void 0:st.publicKey,tt),ot=await this.createSecureConnection(rt,nt);o.source=ot.source,o.sink=ot.sink;const it=publicKeyFromProtobuf(nt.payload.identityKey);return{conn:o,remoteExtensions:nt.payload.extensions,remotePeer:peerIdFromPublicKey(it)}}async performHandshakeInitiator(o,tt,rt,nt){var it,st;let ot;try{ot=await performHandshakeInitiator({connection:o,privateKey:tt,remoteIdentityKey:rt,log:this.components.logger.forComponent("libp2p:noise:xxhandshake"),crypto:this.crypto,prologue:this.prologue,s:this.staticKey,extensions:this.extensions},nt),(it=this.metrics)==null||it.xxHandshakeSuccesses.increment()}catch(at){throw(st=this.metrics)==null||st.xxHandshakeErrors.increment(),at}return ot}async performHandshakeResponder(o,tt,rt,nt){var it,st;let ot;try{ot=await performHandshakeResponder({connection:o,privateKey:tt,remoteIdentityKey:rt,log:this.components.logger.forComponent("libp2p:noise:xxhandshake"),crypto:this.crypto,prologue:this.prologue,s:this.staticKey,extensions:this.extensions},nt),(it=this.metrics)==null||it.xxHandshakeSuccesses.increment()}catch(at){throw(st=this.metrics)==null||st.xxHandshakeErrors.increment(),at}return ot}async createSecureConnection(o,tt){const[rt,nt]=duplexPair(),ot=o.unwrap();return await pipe(rt,encryptStream(tt,this.metrics),ot,it=>decode$U(it,{lengthDecoder:uint16BEDecode}),decryptStream(tt,this.metrics),rt),nt}}function noise(et={}){return o=>new Noise(o,et)}const peerDiscoverySymbol$1=Symbol.for("@libp2p/peer-discovery");function setMaxListeners$7(){}const setMaxListeners$6=(et,...o)=>{try{[...o]}catch{}};var Zr,El;let TypedEventEmitter$2=(El=class extends EventTarget{constructor(){super();fr(this,Zr,new Map);setMaxListeners$6(1/0,this)}listenerCount(tt){const rt=Ot(this,Zr).get(tt);return rt==null?0:rt.length}addEventListener(tt,rt,nt){super.addEventListener(tt,rt,nt);let ot=Ot(this,Zr).get(tt);ot==null&&(ot=[],Ot(this,Zr).set(tt,ot)),ot.push({callback:rt,once:(nt!==!0&&nt!==!1&&(nt==null?void 0:nt.once))??!1})}removeEventListener(tt,rt,nt){super.removeEventListener(tt.toString(),rt??null,nt);let ot=Ot(this,Zr).get(tt);ot!=null&&(ot=ot.filter(({callback:it})=>it!==rt),Ot(this,Zr).set(tt,ot))}dispatchEvent(tt){const rt=super.dispatchEvent(tt);let nt=Ot(this,Zr).get(tt.type);return nt==null||(nt=nt.filter(({once:ot})=>!ot),Ot(this,Zr).set(tt.type,nt)),rt}safeDispatchEvent(tt,rt={}){return this.dispatchEvent(new CustomEvent(tt,rt))}},Zr=new WeakMap,El);const serviceCapabilities$4=Symbol.for("@libp2p/service-capabilities"),DNS4=base$f("dns4"),DNS6=base$f("dns6"),DNSADDR=base$f("dnsaddr"),DNS$1=or$g(base$f("dns"),DNSADDR,DNS4,DNS6),IP=or$g(base$f("ip4"),base$f("ip6")),TCP$1=or$g(and$1(IP,base$f("tcp")),and$1(DNS$1,base$f("tcp"))),UDP=and$1(IP,base$f("udp")),UTP=and$1(UDP,base$f("utp")),QUIC=and$1(UDP,base$f("quic")),QUICV1=and$1(UDP,base$f("quic-v1")),_WebSockets$1=or$g(and$1(TCP$1,base$f("ws")),and$1(DNS$1,base$f("ws"))),WebSockets$2=or$g(and$1(_WebSockets$1,base$f("p2p")),_WebSockets$1),_WebSocketsSecure$1=or$g(and$1(TCP$1,base$f("wss")),and$1(DNS$1,base$f("wss")),and$1(TCP$1,base$f("tls"),base$f("ws")),and$1(DNS$1,base$f("tls"),base$f("ws"))),WebSocketsSecure$1=or$g(and$1(_WebSocketsSecure$1,base$f("p2p")),_WebSocketsSecure$1),HTTP=or$g(and$1(TCP$1,base$f("http")),and$1(IP,base$f("http")),and$1(DNS$1,base$f("http"))),HTTPS=or$g(and$1(TCP$1,base$f("https")),and$1(IP,base$f("https")),and$1(DNS$1,base$f("https"))),_WebRTCDirect$1=and$1(UDP,base$f("webrtc-direct"),base$f("certhash")),WebRTCDirect$1=or$g(and$1(_WebRTCDirect$1,base$f("p2p")),_WebRTCDirect$1),_WebTransport$1=and$1(QUICV1,base$f("webtransport"),base$f("certhash"),base$f("certhash")),WebTransport$1=or$g(and$1(_WebTransport$1,base$f("p2p")),_WebTransport$1),P2PWebRTCStar=or$g(and$1(WebSockets$2,base$f("p2p-webrtc-star"),base$f("p2p")),and$1(WebSocketsSecure$1,base$f("p2p-webrtc-star"),base$f("p2p")),and$1(WebSockets$2,base$f("p2p-webrtc-star")),and$1(WebSocketsSecure$1,base$f("p2p-webrtc-star"))),P2PWebRTCDirect=or$g(and$1(HTTP,base$f("p2p-webrtc-direct"),base$f("p2p")),and$1(HTTPS,base$f("p2p-webrtc-direct"),base$f("p2p")),and$1(HTTP,base$f("p2p-webrtc-direct")),and$1(HTTPS,base$f("p2p-webrtc-direct"))),Reliable=or$g(_WebSockets$1,_WebSocketsSecure$1,HTTP,HTTPS,P2PWebRTCStar,P2PWebRTCDirect,TCP$1,UTP,QUIC,DNS$1,WebRTCDirect$1,WebTransport$1),_P2P$1=or$g(and$1(Reliable,base$f("p2p")),P2PWebRTCStar,P2PWebRTCDirect,WebRTCDirect$1,WebTransport$1,base$f("p2p")),_Circuit$1=or$g(and$1(_P2P$1,base$f("p2p-circuit"),_P2P$1),and$1(_P2P$1,base$f("p2p-circuit")),and$1(base$f("p2p-circuit"),_P2P$1),and$1(Reliable,base$f("p2p-circuit")),and$1(base$f("p2p-circuit"),Reliable),base$f("p2p-circuit")),CircuitRecursive=()=>or$g(and$1(_Circuit$1,CircuitRecursive),_Circuit$1),Circuit$1=CircuitRecursive(),P2P=or$g(and$1(Circuit$1,_P2P$1,Circuit$1),and$1(_P2P$1,Circuit$1),and$1(Circuit$1,_P2P$1),Circuit$1,_P2P$1);function makeMatchesFunction(et){function o(tt){let rt;try{rt=multiaddr(tt)}catch{return!1}const nt=et(rt.protoNames());return nt===null?!1:nt===!0||nt===!1?nt:nt.length===0}return o}function and$1(...et){function o(tt){if(tt.length<et.length)return null;let rt=tt;return et.some(nt=>(rt=typeof nt=="function"?nt().partialMatch(tt):nt.partialMatch(tt),Array.isArray(rt)&&(tt=rt),rt===null)),rt}return{toString:function(){return"{ "+et.join(" ")+" }"},input:et,matches:makeMatchesFunction(o),partialMatch:o}}function or$g(...et){function o(rt){let nt=null;return et.some(ot=>{const it=typeof ot=="function"?ot().partialMatch(rt):ot.partialMatch(rt);return it!=null?(nt=it,!0):!1}),nt}return{toString:function(){return"{ "+et.join(" ")+" }"},input:et,matches:makeMatchesFunction(o),partialMatch:o}}function base$f(et){const o=et;function tt(nt){let ot;try{ot=multiaddr(nt)}catch{return!1}const it=ot.protoNames();return it.length===1&&it[0]===o}function rt(nt){return nt.length===0?null:nt[0]===o?nt.slice(1):null}return{toString:function(){return o},matches:tt,partialMatch:rt}}const DEFAULT_BOOTSTRAP_TAG_NAME$1="bootstrap",DEFAULT_BOOTSTRAP_TAG_VALUE$1=50,DEFAULT_BOOTSTRAP_DISCOVERY_TIMEOUT=1e3;var Cl,Sl,Al,$l;class Bootstrap extends($l=TypedEventEmitter$2,Al=peerDiscoverySymbol$1,Sl=Symbol.toStringTag,Cl=serviceCapabilities$4,$l){constructor(tt,rt={list:[]}){if(rt.list==null||rt.list.length===0)throw new Error("Bootstrap requires a list of peer addresses");super();wt(this,"log");wt(this,"timer");wt(this,"list");wt(this,"timeout");wt(this,"components");wt(this,"_init");wt(this,Al,this);wt(this,Sl,"@libp2p/bootstrap");wt(this,Cl,["@libp2p/peer-discovery"]);this.components=tt,this.log=tt.logger.forComponent("libp2p:bootstrap"),this.timeout=rt.timeout??DEFAULT_BOOTSTRAP_DISCOVERY_TIMEOUT,this.list=[];for(const nt of rt.list){if(!P2P.matches(nt)){this.log.error("Invalid multiaddr");continue}const ot=multiaddr(nt),it=ot.getPeerId();if(it==null){this.log.error("Invalid bootstrap multiaddr without peer id");continue}const st={id:peerIdFromString$1(it),multiaddrs:[ot]};this.list.push(st)}this._init=rt}isStarted(){return!!this.timer}start(){this.isStarted()||(this.log("Starting bootstrap node discovery, discovering peers after %s ms",this.timeout),this.timer=setTimeout(()=>{this._discoverBootstrapPeers().catch(tt=>{this.log.error(tt)})},this.timeout))}async _discoverBootstrapPeers(){if(this.timer!=null)for(const tt of this.list){if(await this.components.peerStore.merge(tt.id,{tags:{[this._init.tagName??DEFAULT_BOOTSTRAP_TAG_NAME$1]:{value:this._init.tagValue??DEFAULT_BOOTSTRAP_TAG_VALUE$1,ttl:this._init.tagTTL}},multiaddrs:tt.multiaddrs}),this.timer==null)return;this.safeDispatchEvent("peer",{detail:tt}),this.components.connectionManager.openConnection(tt.id).catch(rt=>{this.log.error("could not dial bootstrap peer %p",tt.id,rt)})}}stop(){this.timer!=null&&clearTimeout(this.timer),this.timer=void 0}}wt(Bootstrap,"tag","bootstrap");function bootstrap(et){return o=>new Bootstrap(o,et)}var bs;let UnsupportedProtocolError$1=(bs=class extends Error{constructor(o="Unsupported protocol error"){super(o),this.name="UnsupportedProtocolError"}},wt(bs,"name","UnsupportedProtocolError"),bs);var ys;let InvalidMessageError$2=(ys=class extends Error{constructor(o="Invalid message"){super(o),this.name="InvalidMessageError"}},wt(ys,"name","InvalidMessageError"),ys);function setMaxListeners$5(){}const setMaxListeners$4=(et,...o)=>{try{[...o]}catch{}},serviceCapabilities$3=Symbol.for("@libp2p/service-capabilities");function equals$5(et,o){if(et===o)return!0;if(et.byteLength!==o.byteLength)return!1;for(let tt=0;tt<et.byteLength;tt++)if(et[tt]!==o[tt])return!1;return!0}function coerce$e(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function fromString$k(et){return new TextEncoder().encode(et)}function toString$l(et){return new TextDecoder().decode(et)}function base$e(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt<tt.length;rt++)tt[rt]=255;for(var nt=0;nt<et.length;nt++){var ot=et.charAt(nt),it=ot.charCodeAt(0);if(tt[it]!==255)throw new TypeError(ot+" is ambiguous");tt[it]=nt}var st=et.length,at=et.charAt(0),ct=Math.log(st)/Math.log(256),lt=Math.log(256)/Math.log(st);function dt(ft){if(ft instanceof Uint8Array||(ArrayBuffer.isView(ft)?ft=new Uint8Array(ft.buffer,ft.byteOffset,ft.byteLength):Array.isArray(ft)&&(ft=Uint8Array.from(ft))),!(ft instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(ft.length===0)return"";for(var pt=0,yt=0,gt=0,bt=ft.length;gt!==bt&&ft[gt]===0;)gt++,pt++;for(var xt=(bt-gt)*lt+1>>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct<yt)&&St!==-1;St--,Ct++)Et+=256*vt[St]>>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At<xt;++At)kt+=et.charAt(vt[At]);return kt}function ht(ft){if(typeof ft!="string")throw new TypeError("Expected String");if(ft.length===0)return new Uint8Array;var pt=0;if(ft[pt]!==" "){for(var yt=0,gt=0;ft[pt]===at;)yt++,pt++;for(var bt=(ft.length-pt)*ct+1>>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et<gt)&&Ct!==-1;Ct--,Et++)vt+=st*xt[Ct]>>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$f=base$e,_brrp__multiformats_scope_baseX$e=src$f;let Encoder$f=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$f=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$f(this,o)}},ComposedDecoder$e=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$f(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$f(et,o){return new ComposedDecoder$e({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$e=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$f(o,tt,rt),this.decoder=new Decoder$f(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$f({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$e(et,o,tt,rt)}function baseX$e({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$e(tt,et);return from$f({prefix:o,name:et,encode:rt,decode:ot=>coerce$e(nt(ot))})}function decode$C(et,o,tt,rt){const nt={};for(let lt=0;lt<o.length;++lt)nt[o[lt]]=lt;let ot=et.length;for(;et[ot-1]==="=";)--ot;const it=new Uint8Array(ot*tt/8|0);let st=0,at=0,ct=0;for(let lt=0;lt<ot;++lt){const dt=nt[et[lt]];if(dt===void 0)throw new SyntaxError(`Non-${rt} character`);at=at<<tt|dt,st+=tt,st>=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$w(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<<tt)-1;let ot="",it=0,st=0;for(let at=0;at<et.length;++at)for(st=st<<8|et[at],it+=8;it>tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<<tt-it]),rt)for(;ot.length*tt&7;)ot+="=";return ot}function rfc4648$d({name:et,prefix:o,bitsPerChar:tt,alphabet:rt}){return from$f({prefix:o,name:et,encode(nt){return encode$w(nt,rt,tt)},decode(nt){return decode$C(nt,rt,tt,et)}})}const base10$k=baseX$e({prefix:"9",name:"base10",alphabet:"0123456789"}),base10$l=Object.freeze(Object.defineProperty({__proto__:null,base10:base10$k},Symbol.toStringTag,{value:"Module"})),base16$k=rfc4648$d({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper$a=rfc4648$d({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),base16$l=Object.freeze(Object.defineProperty({__proto__:null,base16:base16$k,base16upper:base16upper$a},Symbol.toStringTag,{value:"Module"})),base2$k=rfc4648$d({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),base2$l=Object.freeze(Object.defineProperty({__proto__:null,base2:base2$k},Symbol.toStringTag,{value:"Module"})),alphabet$a=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),alphabetBytesToChars$a=alphabet$a.reduce((et,o,tt)=>(et[tt]=o,et),[]),alphabetCharsToBytes$a=alphabet$a.reduce((et,o,tt)=>{const rt=o.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${o}`);return et[rt]=tt,et},[]);function encode$v(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars$a[tt],o),"")}function decode$B(et){const o=[];for(const tt of et){const rt=tt.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${tt}`);const nt=alphabetCharsToBytes$a[rt];if(nt==null)throw new Error(`Non-base256emoji character: ${tt}`);o.push(nt)}return new Uint8Array(o)}const base256emoji$k=from$f({prefix:"🚀",name:"base256emoji",encode:encode$v,decode:decode$B}),base256emoji$l=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:base256emoji$k},Symbol.toStringTag,{value:"Module"})),base32$o=rfc4648$d({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper$a=rfc4648$d({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad$a=rfc4648$d({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper$a=rfc4648$d({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex$a=rfc4648$d({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper$a=rfc4648$d({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad$a=rfc4648$d({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper$a=rfc4648$d({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z$a=rfc4648$d({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$p=Object.freeze(Object.defineProperty({__proto__:null,base32:base32$o,base32hex:base32hex$a,base32hexpad:base32hexpad$a,base32hexpadupper:base32hexpadupper$a,base32hexupper:base32hexupper$a,base32pad:base32pad$a,base32padupper:base32padupper$a,base32upper:base32upper$a,base32z:base32z$a},Symbol.toStringTag,{value:"Module"})),base36$l=baseX$e({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper$a=baseX$e({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$m=Object.freeze(Object.defineProperty({__proto__:null,base36:base36$l,base36upper:base36upper$a},Symbol.toStringTag,{value:"Module"})),base58btc$e=baseX$e({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr$a=baseX$e({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58$a=Object.freeze(Object.defineProperty({__proto__:null,base58btc:base58btc$e,base58flickr:base58flickr$a},Symbol.toStringTag,{value:"Module"})),base64$n=rfc4648$d({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad$a=rfc4648$d({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url$b=rfc4648$d({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad$a=rfc4648$d({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$o=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$n,base64pad:base64pad$a,base64url:base64url$b,base64urlpad:base64urlpad$a},Symbol.toStringTag,{value:"Module"})),base8$k=rfc4648$d({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$l=Object.freeze(Object.defineProperty({__proto__:null,base8:base8$k},Symbol.toStringTag,{value:"Module"})),identity$a=from$f({prefix:"\0",name:"identity",encode:et=>toString$l(et),decode:et=>fromString$k(et)}),identityBase$a=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$a},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;var encode_1$2=encode$u,MSB$4=128,REST$4=127,MSBALL$2=~REST$4,INT$2=Math.pow(2,31);function encode$u(et,o,tt){o=o||[],tt=tt||0;for(var rt=tt;et>=INT$2;)o[tt++]=et&255|MSB$4,et/=128;for(;et&MSBALL$2;)o[tt++]=et&255|MSB$4,et>>>=7;return o[tt]=et|0,encode$u.bytes=tt-rt+1,o}var decode$A=read$3,MSB$1$2=128,REST$1$2=127;function read$3(et,rt){var tt=0,rt=rt||0,nt=0,ot=rt,it,st=et.length;do{if(ot>=st)throw read$3.bytes=0,new RangeError("Could not decode varint");it=et[ot++],tt+=nt<28?(it&REST$1$2)<<nt:(it&REST$1$2)*Math.pow(2,nt),nt+=7}while(it>=MSB$1$2);return read$3.bytes=ot-rt,tt}var N1$2=Math.pow(2,7),N2$2=Math.pow(2,14),N3$2=Math.pow(2,21),N4$2=Math.pow(2,28),N5$2=Math.pow(2,35),N6$2=Math.pow(2,42),N7$2=Math.pow(2,49),N8$2=Math.pow(2,56),N9$2=Math.pow(2,63),length$2=function(et){return et<N1$2?1:et<N2$2?2:et<N3$2?3:et<N4$2?4:et<N5$2?5:et<N6$2?6:et<N7$2?7:et<N8$2?8:et<N9$2?9:10},varint$2={encode:encode_1$2,decode:decode$A,encodingLength:length$2},_brrp_varint$2=varint$2;function decode$z(et,o=0){return[_brrp_varint$2.decode(et,o),_brrp_varint$2.decode.bytes]}function decode$y(et){const o=coerce$e(et),[tt,rt]=decode$z(o),[nt,ot]=decode$z(o.subarray(rt)),it=o.subarray(rt+ot);if(it.byteLength!==nt)throw new Error("Incorrect length");return new Digest$2(tt,nt,it,o)}let Digest$2=class{constructor(o,tt,rt,nt){wt(this,"code");wt(this,"size");wt(this,"digest");wt(this,"bytes");this.code=o,this.size=tt,this.digest=rt,this.bytes=nt}};const bases$a={...identityBase$a,...base2$l,...base8$l,...base10$l,...base16$l,...base32$p,...base36$m,...base58$a,...base64$o,...base256emoji$l};function alloc$3(et=0){return new Uint8Array(et)}function allocUnsafe$9(et=0){return new Uint8Array(et)}function createCodec$a(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$e=createCodec$a("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii$a=createCodec$a("ascii","a",et=>{let o="a";for(let tt=0;tt<et.length;tt++)o+=String.fromCharCode(et[tt]);return o},et=>{et=et.substring(1);const o=allocUnsafe$9(et.length);for(let tt=0;tt<et.length;tt++)o[tt]=et.charCodeAt(tt);return o}),BASES$a={utf8:string$e,"utf-8":string$e,hex:bases$a.base16,latin1:ascii$a,ascii:ascii$a,binary:ascii$a,...bases$a};function fromString$j(et,o="utf8"){const tt=BASES$a[o];if(tt==null)throw new Error(`Unsupported encoding "${o}"`);return tt.decoder.decode(`${tt.prefix}${et}`)}var Envelope;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.publicKey!=null&&tt.publicKey.byteLength>0&&(rt.uint32(10),rt.bytes(tt.publicKey)),tt.payloadType!=null&&tt.payloadType.byteLength>0&&(rt.uint32(18),rt.bytes(tt.payloadType)),tt.payload!=null&&tt.payload.byteLength>0&&(rt.uint32(26),rt.bytes(tt.payload)),tt.signature!=null&&tt.signature.byteLength>0&&(rt.uint32(42),rt.bytes(tt.signature)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{const ot={publicKey:alloc$3(0),payloadType:alloc$3(0),payload:alloc$3(0),signature:alloc$3(0)},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const st=tt.uint32();switch(st>>>3){case 1:{ot.publicKey=tt.bytes();break}case 2:{ot.payloadType=tt.bytes();break}case 3:{ot.payload=tt.bytes();break}case 5:{ot.signature=tt.bytes();break}default:{tt.skipType(st&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(Envelope||(Envelope={}));class InvalidSignatureError extends Error{constructor(o="Invalid signature"){super(o),this.name="InvalidSignatureError"}}const dn=class dn{constructor(o){wt(this,"publicKey");wt(this,"payloadType");wt(this,"payload");wt(this,"signature");wt(this,"marshaled");const{publicKey:tt,payloadType:rt,payload:nt,signature:ot}=o;this.publicKey=tt,this.payloadType=rt,this.payload=nt,this.signature=ot}marshal(){return this.marshaled==null&&(this.marshaled=Envelope.encode({publicKey:publicKeyToProtobuf(this.publicKey),payloadType:this.payloadType,payload:this.payload.subarray(),signature:this.signature})),this.marshaled}equals(o){return equals$5(this.marshal(),o.marshal())}async validate(o){const tt=formatSignaturePayload(o,this.payloadType,this.payload);return this.publicKey.verify(tt.subarray(),this.signature)}};wt(dn,"createFromProtobuf",async o=>{const tt=Envelope.decode(o),rt=publicKeyFromProtobuf(tt.publicKey);return new dn({publicKey:rt,payloadType:tt.payloadType,payload:tt.payload,signature:tt.signature})}),wt(dn,"seal",async(o,tt)=>{if(tt==null)throw new Error("Missing private key");const rt=o.domain,nt=o.codec,ot=o.marshal(),it=formatSignaturePayload(rt,nt,ot),st=await tt.sign(it.subarray());return new dn({publicKey:tt.publicKey,payloadType:nt,payload:ot,signature:st})}),wt(dn,"openAndCertify",async(o,tt)=>{const rt=await dn.createFromProtobuf(o);if(!await rt.validate(tt))throw new InvalidSignatureError("Envelope signature is not valid for the given domain");return rt});let RecordEnvelope=dn;const formatSignaturePayload=(et,o,tt)=>{const rt=fromString$j(et),nt=encode$P(rt.byteLength),ot=encode$P(o.length),it=encode$P(tt.length);return new Uint8ArrayList(nt,rt,ot,o,it,tt)};function arrayEquals(et,o){const tt=(rt,nt)=>rt.toString().localeCompare(nt.toString());return et.length!==o.length?!1:(o.sort(tt),et.sort(tt).every((rt,nt)=>o[nt].equals(rt)))}const ENVELOPE_DOMAIN_PEER_RECORD="libp2p-peer-record",ENVELOPE_PAYLOAD_TYPE_PEER_RECORD=Uint8Array.from([3,1]);var PeerRecord$1;(function(et){(function(tt){let rt;tt.codec=()=>(rt==null&&(rt=message$1((nt,ot,it={})=>{it.lengthDelimited!==!1&&ot.fork(),nt.multiaddr!=null&&nt.multiaddr.byteLength>0&&(ot.uint32(10),ot.bytes(nt.multiaddr)),it.lengthDelimited!==!1&&ot.ldelim()},(nt,ot,it={})=>{const st={multiaddr:alloc$3(0)},at=ot==null?nt.len:nt.pos+ot;for(;nt.pos<at;){const ct=nt.uint32();switch(ct>>>3){case 1:{st.multiaddr=nt.bytes();break}default:{nt.skipType(ct&7);break}}}return st})),rt),tt.encode=nt=>encodeMessage(nt,tt.codec()),tt.decode=(nt,ot)=>decodeMessage(nt,tt.codec(),ot)})(et.AddressInfo||(et.AddressInfo={}));let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{if(nt.lengthDelimited!==!1&&rt.fork(),tt.peerId!=null&&tt.peerId.byteLength>0&&(rt.uint32(10),rt.bytes(tt.peerId)),tt.seq!=null&&tt.seq!==0n&&(rt.uint32(16),rt.uint64(tt.seq)),tt.addresses!=null)for(const ot of tt.addresses)rt.uint32(26),et.AddressInfo.codec().encode(ot,rt);nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st,at;const ot={peerId:alloc$3(0),seq:0n,addresses:[]},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const ct=tt.uint32();switch(ct>>>3){case 1:{ot.peerId=tt.bytes();break}case 2:{ot.seq=tt.uint64();break}case 3:{if(((st=nt.limits)==null?void 0:st.addresses)!=null&&ot.addresses.length===nt.limits.addresses)throw new MaxLengthError('Decode error - map field "addresses" had too many elements');ot.addresses.push(et.AddressInfo.codec().decode(tt,tt.uint32(),{limits:(at=nt.limits)==null?void 0:at.addresses$}));break}default:{tt.skipType(ct&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(PeerRecord$1||(PeerRecord$1={}));const on=class on{constructor(o){wt(this,"peerId");wt(this,"multiaddrs");wt(this,"seqNumber");wt(this,"domain",on.DOMAIN);wt(this,"codec",on.CODEC);wt(this,"marshaled");const{peerId:tt,multiaddrs:rt,seqNumber:nt}=o;this.peerId=tt,this.multiaddrs=rt??[],this.seqNumber=nt??BigInt(Date.now())}marshal(){return this.marshaled==null&&(this.marshaled=PeerRecord$1.encode({peerId:this.peerId.toMultihash().bytes,seq:BigInt(this.seqNumber),addresses:this.multiaddrs.map(o=>({multiaddr:o.bytes}))})),this.marshaled}equals(o){return!(!(o instanceof on)||!this.peerId.equals(o.peerId)||this.seqNumber!==o.seqNumber||!arrayEquals(this.multiaddrs,o.multiaddrs))}};wt(on,"createFromProtobuf",o=>{const tt=PeerRecord$1.decode(o),rt=peerIdFromMultihash(decode$y(tt.peerId)),nt=(tt.addresses??[]).map(it=>multiaddr(it.multiaddr)),ot=tt.seq;return new on({peerId:rt,multiaddrs:nt,seqNumber:ot})}),wt(on,"DOMAIN",ENVELOPE_DOMAIN_PEER_RECORD),wt(on,"CODEC",ENVELOPE_PAYLOAD_TYPE_PEER_RECORD);let PeerRecord=on;function isAsyncIterable$4(et){return et[Symbol.asyncIterator]!=null}function drain(et){if(isAsyncIterable$4(et))return(async()=>{for await(const o of et);})();for(const o of et);}const CustomEvent$1=globalThis.CustomEvent??Event;async function*parallel(et,o={}){let tt=o.concurrency??1/0;tt<1&&(tt=1/0);const rt=o.ordered==null?!1:o.ordered,nt=new EventTarget,ot=[];let it=pDefer(),st=pDefer(),at=!1,ct,lt=!1;nt.addEventListener("task-complete",()=>{st.resolve()}),Promise.resolve().then(async()=>{try{for await(const ft of et){if(ot.length===tt&&(it=pDefer(),await it.promise),lt)break;const pt={done:!1};ot.push(pt),ft().then(yt=>{pt.done=!0,pt.ok=!0,pt.value=yt,nt.dispatchEvent(new CustomEvent$1("task-complete"))},yt=>{pt.done=!0,pt.err=yt,nt.dispatchEvent(new CustomEvent$1("task-complete"))})}at=!0,nt.dispatchEvent(new CustomEvent$1("task-complete"))}catch(ft){ct=ft,nt.dispatchEvent(new CustomEvent$1("task-complete"))}});function dt(){var ft;return rt?(ft=ot[0])==null?void 0:ft.done:!!ot.find(pt=>pt.done)}function*ht(){for(;ot.length>0&&ot[0].done;){const ft=ot[0];if(ot.shift(),ft.ok)yield ft.value;else throw lt=!0,it.resolve(),ft.err;it.resolve()}}function*mt(){for(;dt();)for(let ft=0;ft<ot.length;ft++)if(ot[ft].done){const pt=ot[ft];if(ot.splice(ft,1),ft--,pt.ok)yield pt.value;else throw lt=!0,it.resolve(),pt.err;it.resolve()}}for(;;){if(dt()||(st=pDefer(),await st.promise),ct!=null)throw ct;if(rt?yield*ht():yield*mt(),at&&ot.length===0)break}}function pbStream(et,o){const tt=lpStream(et,o),rt={read:async(nt,ot)=>{const it=await tt.read(ot);return nt.decode(it)},write:async(nt,ot,it)=>{await tt.write(ot.encode(nt),it)},writeV:async(nt,ot,it)=>{await tt.writeV(nt.map(st=>ot.encode(st)),it)},pb:nt=>({read:async ot=>rt.read(nt,ot),write:async(ot,it)=>rt.write(ot,nt,it),writeV:async(ot,it)=>rt.writeV(ot,nt,it),unwrap:()=>rt}),unwrap:()=>tt.unwrap()};return rt}function coerce$d(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function fromString$i(et){return new TextEncoder().encode(et)}function toString$k(et){return new TextDecoder().decode(et)}function base$d(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt<tt.length;rt++)tt[rt]=255;for(var nt=0;nt<et.length;nt++){var ot=et.charAt(nt),it=ot.charCodeAt(0);if(tt[it]!==255)throw new TypeError(ot+" is ambiguous");tt[it]=nt}var st=et.length,at=et.charAt(0),ct=Math.log(st)/Math.log(256),lt=Math.log(256)/Math.log(st);function dt(ft){if(ft instanceof Uint8Array||(ArrayBuffer.isView(ft)?ft=new Uint8Array(ft.buffer,ft.byteOffset,ft.byteLength):Array.isArray(ft)&&(ft=Uint8Array.from(ft))),!(ft instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(ft.length===0)return"";for(var pt=0,yt=0,gt=0,bt=ft.length;gt!==bt&&ft[gt]===0;)gt++,pt++;for(var xt=(bt-gt)*lt+1>>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct<yt)&&St!==-1;St--,Ct++)Et+=256*vt[St]>>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At<xt;++At)kt+=et.charAt(vt[At]);return kt}function ht(ft){if(typeof ft!="string")throw new TypeError("Expected String");if(ft.length===0)return new Uint8Array;var pt=0;if(ft[pt]!==" "){for(var yt=0,gt=0;ft[pt]===at;)yt++,pt++;for(var bt=(ft.length-pt)*ct+1>>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et<gt)&&Ct!==-1;Ct--,Et++)vt+=st*xt[Ct]>>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$e=base$d,_brrp__multiformats_scope_baseX$d=src$e;let Encoder$e=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$e=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$e(this,o)}},ComposedDecoder$d=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$e(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$e(et,o){return new ComposedDecoder$d({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$d=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$e(o,tt,rt),this.decoder=new Decoder$e(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$e({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$d(et,o,tt,rt)}function baseX$d({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$d(tt,et);return from$e({prefix:o,name:et,encode:rt,decode:ot=>coerce$d(nt(ot))})}function decode$x(et,o,tt,rt){const nt={};for(let lt=0;lt<o.length;++lt)nt[o[lt]]=lt;let ot=et.length;for(;et[ot-1]==="=";)--ot;const it=new Uint8Array(ot*tt/8|0);let st=0,at=0,ct=0;for(let lt=0;lt<ot;++lt){const dt=nt[et[lt]];if(dt===void 0)throw new SyntaxError(`Non-${rt} character`);at=at<<tt|dt,st+=tt,st>=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$t(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<<tt)-1;let ot="",it=0,st=0;for(let at=0;at<et.length;++at)for(st=st<<8|et[at],it+=8;it>tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<<tt-it]),rt)for(;ot.length*tt&7;)ot+="=";return ot}function rfc4648$c({name:et,prefix:o,bitsPerChar:tt,alphabet:rt}){return from$e({prefix:o,name:et,encode(nt){return encode$t(nt,rt,tt)},decode(nt){return decode$x(nt,rt,tt,et)}})}const base10$i=baseX$d({prefix:"9",name:"base10",alphabet:"0123456789"}),base10$j=Object.freeze(Object.defineProperty({__proto__:null,base10:base10$i},Symbol.toStringTag,{value:"Module"})),base16$i=rfc4648$c({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper$9=rfc4648$c({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),base16$j=Object.freeze(Object.defineProperty({__proto__:null,base16:base16$i,base16upper:base16upper$9},Symbol.toStringTag,{value:"Module"})),base2$i=rfc4648$c({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),base2$j=Object.freeze(Object.defineProperty({__proto__:null,base2:base2$i},Symbol.toStringTag,{value:"Module"})),alphabet$9=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),alphabetBytesToChars$9=alphabet$9.reduce((et,o,tt)=>(et[tt]=o,et),[]),alphabetCharsToBytes$9=alphabet$9.reduce((et,o,tt)=>{const rt=o.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${o}`);return et[rt]=tt,et},[]);function encode$s(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars$9[tt],o),"")}function decode$w(et){const o=[];for(const tt of et){const rt=tt.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${tt}`);const nt=alphabetCharsToBytes$9[rt];if(nt==null)throw new Error(`Non-base256emoji character: ${tt}`);o.push(nt)}return new Uint8Array(o)}const base256emoji$i=from$e({prefix:"🚀",name:"base256emoji",encode:encode$s,decode:decode$w}),base256emoji$j=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:base256emoji$i},Symbol.toStringTag,{value:"Module"})),base32$m=rfc4648$c({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper$9=rfc4648$c({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad$9=rfc4648$c({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper$9=rfc4648$c({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex$9=rfc4648$c({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper$9=rfc4648$c({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad$9=rfc4648$c({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper$9=rfc4648$c({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z$9=rfc4648$c({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$n=Object.freeze(Object.defineProperty({__proto__:null,base32:base32$m,base32hex:base32hex$9,base32hexpad:base32hexpad$9,base32hexpadupper:base32hexpadupper$9,base32hexupper:base32hexupper$9,base32pad:base32pad$9,base32padupper:base32padupper$9,base32upper:base32upper$9,base32z:base32z$9},Symbol.toStringTag,{value:"Module"})),base36$j=baseX$d({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper$9=baseX$d({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$k=Object.freeze(Object.defineProperty({__proto__:null,base36:base36$j,base36upper:base36upper$9},Symbol.toStringTag,{value:"Module"})),base58btc$d=baseX$d({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr$9=baseX$d({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58$9=Object.freeze(Object.defineProperty({__proto__:null,base58btc:base58btc$d,base58flickr:base58flickr$9},Symbol.toStringTag,{value:"Module"})),base64$l=rfc4648$c({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad$9=rfc4648$c({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url$a=rfc4648$c({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad$9=rfc4648$c({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$m=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$l,base64pad:base64pad$9,base64url:base64url$a,base64urlpad:base64urlpad$9},Symbol.toStringTag,{value:"Module"})),base8$i=rfc4648$c({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$j=Object.freeze(Object.defineProperty({__proto__:null,base8:base8$i},Symbol.toStringTag,{value:"Module"})),identity$9=from$e({prefix:"\0",name:"identity",encode:et=>toString$k(et),decode:et=>fromString$i(et)}),identityBase$9=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$9},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const bases$9={...identityBase$9,...base2$j,...base8$j,...base10$j,...base16$j,...base32$n,...base36$k,...base58$9,...base64$m,...base256emoji$j};function allocUnsafe$8(et=0){return new Uint8Array(et)}function createCodec$9(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$d=createCodec$9("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii$9=createCodec$9("ascii","a",et=>{let o="a";for(let tt=0;tt<et.length;tt++)o+=String.fromCharCode(et[tt]);return o},et=>{et=et.substring(1);const o=allocUnsafe$8(et.length);for(let tt=0;tt<et.length;tt++)o[tt]=et.charCodeAt(tt);return o}),BASES$9={utf8:string$d,"utf-8":string$d,hex:bases$9.base16,latin1:ascii$9,ascii:ascii$9,binary:ascii$9,...bases$9};function fromString$h(et,o="utf8"){const tt=BASES$9[o];if(tt==null)throw new Error(`Unsupported encoding "${o}"`);return tt.decoder.decode(`${tt.prefix}${et}`)}const IDENTIFY_PROTOCOL_VERSION="0.1.0",MULTICODEC_IDENTIFY_PROTOCOL_NAME="id",MULTICODEC_IDENTIFY_PROTOCOL_VERSION="1.0.0",MAX_IDENTIFY_MESSAGE_SIZE=1024*8,MAX_PUSH_CONCURRENCY=32;var Identify$1;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{if(nt.lengthDelimited!==!1&&rt.fork(),tt.protocolVersion!=null&&(rt.uint32(42),rt.string(tt.protocolVersion)),tt.agentVersion!=null&&(rt.uint32(50),rt.string(tt.agentVersion)),tt.publicKey!=null&&(rt.uint32(10),rt.bytes(tt.publicKey)),tt.listenAddrs!=null)for(const ot of tt.listenAddrs)rt.uint32(18),rt.bytes(ot);if(tt.observedAddr!=null&&(rt.uint32(34),rt.bytes(tt.observedAddr)),tt.protocols!=null)for(const ot of tt.protocols)rt.uint32(26),rt.string(ot);tt.signedPeerRecord!=null&&(rt.uint32(66),rt.bytes(tt.signedPeerRecord)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st,at;const ot={listenAddrs:[],protocols:[]},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const ct=tt.uint32();switch(ct>>>3){case 5:{ot.protocolVersion=tt.string();break}case 6:{ot.agentVersion=tt.string();break}case 1:{ot.publicKey=tt.bytes();break}case 2:{if(((st=nt.limits)==null?void 0:st.listenAddrs)!=null&&ot.listenAddrs.length===nt.limits.listenAddrs)throw new MaxLengthError('Decode error - map field "listenAddrs" had too many elements');ot.listenAddrs.push(tt.bytes());break}case 4:{ot.observedAddr=tt.bytes();break}case 3:{if(((at=nt.limits)==null?void 0:at.protocols)!=null&&ot.protocols.length===nt.limits.protocols)throw new MaxLengthError('Decode error - map field "protocols" had too many elements');ot.protocols.push(tt.string());break}case 8:{ot.signedPeerRecord=tt.bytes();break}default:{tt.skipType(ct&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(Identify$1||(Identify$1={}));var define_process_default={env:{NODE_ENV:'"production"',VITE_WALLETCONNECT_PROJECT_ID:'"1d93edc21291f98e3bed6ff7617ff539"'},nextTick:"setImmediate",platform:'"browser"',version:'"v16.0.0"',browser:!0};function isElectron$1(){return!!(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof define_process_default<"u"&&typeof define_process_default.versions=="object"&&define_process_default.versions.electron||typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Electron")>=0)}var isElectron_1=isElectron$1;const detectElectron=getDefaultExportFromCjs(isElectron_1),isEnvWithDom=typeof window=="object"&&typeof document=="object"&&document.nodeType===9,isElectron=detectElectron(),isBrowser=isEnvWithDom&&!isElectron,isElectronMain=isElectron&&!isEnvWithDom,isElectronRenderer=isElectron&&isEnvWithDom,isNode=typeof globalThis.process<"u"&&typeof globalThis.process.release<"u"&&globalThis.process.release.name==="node"&&!isElectron,isWebWorker=typeof importScripts=="function"&&typeof self<"u"&&typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,isReactNative=typeof navigator<"u"&&navigator.product==="ReactNative",defaultValues={protocolPrefix:"ipfs",timeout:5e3,maxInboundStreams:1,maxOutboundStreams:1,maxObservedAddresses:10,maxMessageSize:MAX_IDENTIFY_MESSAGE_SIZE,runOnConnectionOpen:!0,runOnSelfUpdate:!0,runOnLimitedConnection:!0,concurrency:MAX_PUSH_CONCURRENCY};function getCleanMultiaddr(et){if(et!=null&&et.length>0)try{return multiaddr(et)}catch{}}function getAgentVersion(et,o){return o!=null||(o=`${et.name}/${et.version}`,isNode||isElectronMain?o+=` UserAgent=${globalThis.process.version}`:(isBrowser||isWebWorker||isElectronRenderer||isReactNative)&&(o+=` UserAgent=${globalThis.navigator.userAgent}`)),o}async function consumeIdentifyMessage(et,o,tt,rt,nt){if(tt("received identify from %p",rt.remotePeer),nt==null)throw new InvalidMessageError$2("message was null or undefined");const ot={};if(nt.listenAddrs.length>0&&(ot.addresses=nt.listenAddrs.map(at=>({isCertified:!1,multiaddr:multiaddr(at)}))),nt.protocols.length>0&&(ot.protocols=nt.protocols),nt.publicKey!=null){const at=publicKeyFromProtobuf(nt.publicKey);if(!peerIdFromPublicKey(at).equals(rt.remotePeer))throw new InvalidMessageError$2("public key did not match remote PeerId");ot.publicKey=at}let it;if(nt.signedPeerRecord!=null){tt.trace("received signedPeerRecord from %p",rt.remotePeer);let at=nt.signedPeerRecord;const ct=await RecordEnvelope.openAndCertify(at,PeerRecord.DOMAIN);let lt=PeerRecord.createFromProtobuf(ct.payload);const dt=peerIdFromCID(ct.publicKey.toCID());if(!lt.peerId.equals(dt))throw new InvalidMessageError$2("signing key does not match PeerId in the PeerRecord");if(!rt.remotePeer.equals(lt.peerId))throw new InvalidMessageError$2("signing key does not match remote PeerId");let ht;try{ht=await et.get(lt.peerId)}catch(mt){if(mt.name!=="NotFoundError")throw mt}if(ht!=null&&(ot.metadata=ht.metadata,ht.peerRecordEnvelope!=null)){const mt=await RecordEnvelope.createFromProtobuf(ht.peerRecordEnvelope),ft=PeerRecord.createFromProtobuf(mt.payload);ft.seqNumber>=lt.seqNumber&&(tt("sequence number was lower or equal to existing sequence number - stored: %d received: %d",ft.seqNumber,lt.seqNumber),lt=ft,at=ht.peerRecordEnvelope)}ot.peerRecordEnvelope=at,ot.addresses=lt.multiaddrs.map(mt=>({isCertified:!0,multiaddr:mt})),it={seq:lt.seqNumber,addresses:lt.multiaddrs}}else tt("%p did not send a signed peer record",rt.remotePeer);if(tt.trace("patching %p with",rt.remotePeer,ot),await et.patch(rt.remotePeer,ot),nt.agentVersion!=null||nt.protocolVersion!=null){const at={};nt.agentVersion!=null&&(at.AgentVersion=fromString$h(nt.agentVersion)),nt.protocolVersion!=null&&(at.ProtocolVersion=fromString$h(nt.protocolVersion)),tt.trace("merging %p metadata",rt.remotePeer,at),await et.merge(rt.remotePeer,{metadata:at})}const st={peerId:rt.remotePeer,protocolVersion:nt.protocolVersion,agentVersion:nt.agentVersion,publicKey:nt.publicKey,listenAddrs:nt.listenAddrs.map(at=>multiaddr(at)),observedAddr:nt.observedAddr==null?void 0:multiaddr(nt.observedAddr),protocols:nt.protocols,signedPeerRecord:it,connection:rt};return o.safeDispatchEvent("peer:identify",{detail:st}),st}class AbstractIdentify{constructor(o,tt){wt(this,"host");wt(this,"protocol");wt(this,"started");wt(this,"timeout");wt(this,"peerId");wt(this,"privateKey");wt(this,"peerStore");wt(this,"registrar");wt(this,"addressManager");wt(this,"maxInboundStreams");wt(this,"maxOutboundStreams");wt(this,"maxMessageSize");wt(this,"maxObservedAddresses");wt(this,"events");wt(this,"runOnLimitedConnection");wt(this,"log");this.protocol=tt.protocol,this.started=!1,this.peerId=o.peerId,this.privateKey=o.privateKey,this.peerStore=o.peerStore,this.registrar=o.registrar,this.addressManager=o.addressManager,this.events=o.events,this.log=tt.log,this.timeout=tt.timeout??defaultValues.timeout,this.maxInboundStreams=tt.maxInboundStreams??defaultValues.maxInboundStreams,this.maxOutboundStreams=tt.maxOutboundStreams??defaultValues.maxOutboundStreams,this.maxMessageSize=tt.maxMessageSize??defaultValues.maxMessageSize,this.maxObservedAddresses=tt.maxObservedAddresses??defaultValues.maxObservedAddresses,this.runOnLimitedConnection=tt.runOnLimitedConnection??defaultValues.runOnLimitedConnection,this.host={protocolVersion:`${tt.protocolPrefix??defaultValues.protocolPrefix}/${IDENTIFY_PROTOCOL_VERSION}`,agentVersion:getAgentVersion(o.nodeInfo,tt.agentVersion)}}isStarted(){return this.started}async start(){this.started||(await this.peerStore.merge(this.peerId,{metadata:{AgentVersion:fromString$h(this.host.agentVersion),ProtocolVersion:fromString$h(this.host.protocolVersion)}}),await this.registrar.handle(this.protocol,o=>{this.handleProtocol(o).catch(tt=>{this.log.error(tt)})},{maxInboundStreams:this.maxInboundStreams,maxOutboundStreams:this.maxOutboundStreams,runOnLimitedConnection:this.runOnLimitedConnection}),this.started=!0)}async stop(){await this.registrar.unhandle(this.protocol),this.started=!1}}var Netmask_1;(function(){var et,o,tt,rt,nt,ot,it,st;st=function(at){var ct,lt,dt,ht;return ct=(at&255<<24)>>>24,lt=(at&255<<16)>>>16,dt=(at&65280)>>>8,ht=at&255,[ct,lt,dt,ht].join(".")},it=function(at){var ct,lt,dt,ht,mt,ft;for(ct=[],dt=ht=0;ht<=3&&at.length!==0;dt=++ht){if(dt>0){if(at[0]!==".")throw new Error("Invalid IP");at=at.substring(1)}ft=o(at),mt=ft[0],lt=ft[1],at=at.substring(lt),ct.push(mt)}if(at.length!==0)throw new Error("Invalid IP");switch(ct.length){case 1:if(ct[0]>4294967295)throw new Error("Invalid IP");return ct[0]>>>0;case 2:if(ct[0]>255||ct[1]>16777215)throw new Error("Invalid IP");return(ct[0]<<24|ct[1])>>>0;case 3:if(ct[0]>255||ct[1]>255||ct[2]>65535)throw new Error("Invalid IP");return(ct[0]<<24|ct[1]<<16|ct[2])>>>0;case 4:if(ct[0]>255||ct[1]>255||ct[2]>255||ct[3]>255)throw new Error("Invalid IP");return(ct[0]<<24|ct[1]<<16|ct[2]<<8|ct[3])>>>0;default:throw new Error("Invalid IP")}},tt=function(at){return at.charCodeAt(0)},rt=tt("0"),ot=tt("a"),nt=tt("A"),o=function(at){var ct,lt,dt,ht,mt;for(ht=0,ct=10,lt="9",dt=0,at.length>1&&at[dt]==="0"&&(at[dt+1]==="x"||at[dt+1]==="X"?(dt+=2,ct=16):"0"<=at[dt+1]&&at[dt+1]<="9"&&(dt++,ct=8,lt="7")),mt=dt;dt<at.length;){if("0"<=at[dt]&&at[dt]<=lt)ht=ht*ct+(tt(at[dt])-rt)>>>0;else if(ct===16)if("a"<=at[dt]&&at[dt]<="f")ht=ht*ct+(10+tt(at[dt])-ot)>>>0;else if("A"<=at[dt]&&at[dt]<="F")ht=ht*ct+(10+tt(at[dt])-nt)>>>0;else break;else break;if(ht>4294967295)throw new Error("too large");dt++}if(dt===mt)throw new Error("empty octet");return[ht,dt]},et=function(){function at(ct,lt){var dt,ht,mt;if(typeof ct!="string")throw new Error("Missing `net' parameter");if(lt||(mt=ct.split("/",2),ct=mt[0],lt=mt[1]),lt||(lt=32),typeof lt=="string"&&lt.indexOf(".")>-1){try{this.maskLong=it(lt)}catch{throw new Error("Invalid mask: "+lt)}for(dt=ht=32;ht>=0;dt=--ht)if(this.maskLong===4294967295<<32-dt>>>0){this.bitmask=dt;break}}else if(lt||lt===0)this.bitmask=parseInt(lt,10),this.maskLong=0,this.bitmask>0&&(this.maskLong=4294967295<<32-this.bitmask>>>0);else throw new Error("Invalid mask: empty");try{this.netLong=(it(ct)&this.maskLong)>>>0}catch{throw new Error("Invalid net address: "+ct)}if(!(this.bitmask<=32))throw new Error("Invalid mask for ip4: "+lt);this.size=Math.pow(2,32-this.bitmask),this.base=st(this.netLong),this.mask=st(this.maskLong),this.hostmask=st(~this.maskLong),this.first=this.bitmask<=30?st(this.netLong+1):this.base,this.last=this.bitmask<=30?st(this.netLong+this.size-2):st(this.netLong+this.size-1),this.broadcast=this.bitmask<=30?st(this.netLong+this.size-1):void 0}return at.prototype.contains=function(ct){return typeof ct=="string"&&(ct.indexOf("/")>0||ct.split(".").length!==4)&&(ct=new at(ct)),ct instanceof at?this.contains(ct.base)&&this.contains(ct.broadcast||ct.last):(it(ct)&this.maskLong)>>>0===(this.netLong&this.maskLong)>>>0},at.prototype.next=function(ct){return ct==null&&(ct=1),new at(st(this.netLong+this.size*ct),this.mask)},at.prototype.forEach=function(ct){var lt,dt,ht;for(ht=it(this.first),dt=it(this.last),lt=0;ht<=dt;)ct(st(ht),ht,lt),lt++,ht++},at.prototype.toString=function(){return this.base+"/"+this.bitmask},at}(),Netmask_1=et}).call(commonjsGlobal);const PRIVATE_IP_RANGES=["0.0.0.0/8","10.0.0.0/8","100.64.0.0/10","127.0.0.0/8","169.254.0.0/16","172.16.0.0/12","192.0.0.0/24","192.0.0.0/29","192.0.0.8/32","192.0.0.9/32","192.0.0.10/32","192.0.0.170/32","192.0.0.171/32","192.0.2.0/24","192.31.196.0/24","192.52.193.0/24","192.88.99.0/24","192.168.0.0/16","192.175.48.0/24","198.18.0.0/15","198.51.100.0/24","203.0.113.0/24","240.0.0.0/4","255.255.255.255/32"],NETMASK_RANGES=PRIVATE_IP_RANGES.map(et=>new Netmask_1(et));function ipv4Check(et){for(const o of NETMASK_RANGES)if(o.contains(et))return!0;return!1}function isIpv4MappedIpv6(et){return/^::ffff:([0-9a-fA-F]{1,4}):([0-9a-fA-F]{1,4})$/.test(et)}function ipv4MappedIpv6Check(et){const o=et.split(":");if(o.length<2)return!1;const tt=o[o.length-1].padStart(4,"0"),rt=o[o.length-2].padStart(4,"0"),nt=`${parseInt(rt.substring(0,2),16)}.${parseInt(rt.substring(2),16)}.${parseInt(tt.substring(0,2),16)}.${parseInt(tt.substring(2),16)}`;return ipv4Check(nt)}function isIpv4EmbeddedIpv6(et){return/^::ffff:([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/.test(et)}function ipv4EmbeddedIpv6Check(et){const o=et.split(":"),tt=o[o.length-1];return ipv4Check(tt)}function ipv6Check(et){return/^::$/.test(et)||/^::1$/.test(et)||/^64:ff9b::([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/.test(et)||/^100::([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(et)||/^2001::([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(et)||/^2001:2[0-9a-fA-F]:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(et)||/^2001:db8:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(et)||/^2002:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(et)||/^f[c-d]([0-9a-fA-F]{2,2}):/i.test(et)||/^fe[8-9a-bA-B][0-9a-fA-F]:/i.test(et)||/^ff([0-9a-fA-F]{2,2}):/i.test(et)}function isPrivateIp(et){return isIPv4(et)?ipv4Check(et):isIpv4MappedIpv6(et)?ipv4MappedIpv6Check(et):isIpv4EmbeddedIpv6(et)?ipv4EmbeddedIpv6Check(et):isIPv6(et)?ipv6Check(et):void 0}function coerce$c(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function base$c(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt<tt.length;rt++)tt[rt]=255;for(var nt=0;nt<et.length;nt++){var ot=et.charAt(nt),it=ot.charCodeAt(0);if(tt[it]!==255)throw new TypeError(ot+" is ambiguous");tt[it]=nt}var st=et.length,at=et.charAt(0),ct=Math.log(st)/Math.log(256),lt=Math.log(256)/Math.log(st);function dt(ft){if(ft instanceof Uint8Array||(ArrayBuffer.isView(ft)?ft=new Uint8Array(ft.buffer,ft.byteOffset,ft.byteLength):Array.isArray(ft)&&(ft=Uint8Array.from(ft))),!(ft instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(ft.length===0)return"";for(var pt=0,yt=0,gt=0,bt=ft.length;gt!==bt&&ft[gt]===0;)gt++,pt++;for(var xt=(bt-gt)*lt+1>>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct<yt)&&St!==-1;St--,Ct++)Et+=256*vt[St]>>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At<xt;++At)kt+=et.charAt(vt[At]);return kt}function ht(ft){if(typeof ft!="string")throw new TypeError("Expected String");if(ft.length===0)return new Uint8Array;var pt=0;if(ft[pt]!==" "){for(var yt=0,gt=0;ft[pt]===at;)yt++,pt++;for(var bt=(ft.length-pt)*ct+1>>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et<gt)&&Ct!==-1;Ct--,Et++)vt+=st*xt[Ct]>>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$d=base$c,_brrp__multiformats_scope_baseX$c=src$d;let Encoder$d=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$d=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$d(this,o)}},ComposedDecoder$c=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$d(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$d(et,o){return new ComposedDecoder$c({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$c=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$d(o,tt,rt),this.decoder=new Decoder$d(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$d({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$c(et,o,tt,rt)}function baseX$c({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$c(tt,et);return from$d({prefix:o,name:et,encode:rt,decode:ot=>coerce$c(nt(ot))})}function decode$v(et,o,tt,rt){const nt={};for(let lt=0;lt<o.length;++lt)nt[o[lt]]=lt;let ot=et.length;for(;et[ot-1]==="=";)--ot;const it=new Uint8Array(ot*tt/8|0);let st=0,at=0,ct=0;for(let lt=0;lt<ot;++lt){const dt=nt[et[lt]];if(dt===void 0)throw new SyntaxError(`Non-${rt} character`);at=at<<tt|dt,st+=tt,st>=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$r(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<<tt)-1;let ot="",it=0,st=0;for(let at=0;at<et.length;++at)for(st=st<<8|et[at],it+=8;it>tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<<tt-it]),rt)for(;ot.length*tt&7;)ot+="=";return ot}function rfc4648$b({name:et,prefix:o,bitsPerChar:tt,alphabet:rt}){return from$d({prefix:o,name:et,encode(nt){return encode$r(nt,rt,tt)},decode(nt){return decode$v(nt,rt,tt,et)}})}const base58btc$c=baseX$c({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"});baseX$c({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});rfc4648$b({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6});rfc4648$b({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6});const base64url$9=rfc4648$b({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6});rfc4648$b({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});const toParts=et=>et.toString().split("/").slice(1),func=et=>({match:o=>o.length<1?!1:et(o[0])?o.slice(1):!1,pattern:"fn"}),literal=et=>({match:o=>func(tt=>tt===et).match(o),pattern:et}),string$c=()=>({match:et=>func(o=>typeof o=="string").match(et),pattern:"{string}"}),number$1=()=>({match:et=>func(o=>!isNaN(parseInt(o))).match(et),pattern:"{number}"}),peerId=()=>({match:et=>{if(et.length<2||et[0]!=="p2p"&&et[0]!=="ipfs")return!1;if(et[1].startsWith("Q")||et[1].startsWith("1"))try{base58btc$c.decode(`z${et[1]}`)}catch{return!1}else return!1;return et.slice(2)},pattern:"/p2p/{peerid}"}),certhash=()=>({match:et=>{if(et.length<2||et[0]!=="certhash")return!1;try{base64url$9.decode(et[1])}catch{return!1}return et.slice(2)},pattern:"/certhash/{certhash}"}),optional=et=>({match:o=>{const tt=et.match(o);return tt===!1?o:tt},pattern:`optional(${et.pattern})`}),or$c=(...et)=>({match:o=>{let tt;for(const rt of et){const nt=rt.match(o);nt!==!1&&(tt==null||nt.length<tt.length)&&(tt=nt)}return tt??!1},pattern:`or(${et.map(o=>o.pattern).join(", ")})`}),and=(...et)=>({match:o=>{for(const tt of et){const rt=tt.match(o);if(rt===!1)return!1;o=rt}return o},pattern:`and(${et.map(o=>o.pattern).join(", ")})`});function fmt(...et){function o(nt){let ot=toParts(nt);for(const it of et){const st=it.match(ot);if(st===!1)return!1;ot=st}return ot}function tt(nt){return o(nt)!==!1}function rt(nt){const ot=o(nt);return ot===!1?!1:ot.length===0}return{matchers:et,matches:tt,exactMatch:rt}}const _DNS4=and(literal("dns4"),string$c()),_DNS6=and(literal("dns6"),string$c()),_DNSADDR=and(literal("dnsaddr"),string$c()),_DNS=and(literal("dns"),string$c());fmt(_DNS4,optional(peerId()));fmt(_DNS6,optional(peerId()));fmt(_DNSADDR,optional(peerId()));fmt(or$c(_DNS,_DNSADDR,_DNS4,_DNS6),optional(peerId()));const _IP4=and(literal("ip4"),func(isIPv4)),_IP6=and(literal("ip6"),func(isIPv6)),_IP=or$c(_IP4,_IP6),_IP_OR_DOMAIN=or$c(_IP,_DNS,_DNS4,_DNS6,_DNSADDR),IP_OR_DOMAIN=fmt(or$c(_IP,and(or$c(_DNS,_DNSADDR,_DNS4,_DNS6),optional(peerId())))),_TCP=and(_IP_OR_DOMAIN,literal("tcp"),number$1()),_UDP=and(_IP_OR_DOMAIN,literal("udp"),number$1()),TCP=fmt(and(_TCP,optional(peerId()))),_QUIC=and(_UDP,literal("quic")),_QUICV1=and(_UDP,literal("quic-v1")),QUIC_V0_OR_V1=or$c(_QUIC,_QUICV1),_WEB=or$c(_IP_OR_DOMAIN,_TCP,_UDP,_QUIC,_QUICV1),_WebSockets=or$c(and(_WEB,literal("ws"),optional(peerId()))),WebSockets$1=fmt(_WebSockets),_WebSocketsSecure=or$c(and(_WEB,literal("wss"),optional(peerId())),and(_WEB,literal("tls"),literal("ws"),optional(peerId()))),WebSocketsSecure=fmt(_WebSocketsSecure),_WebRTCDirect=and(_UDP,literal("webrtc-direct"),optional(certhash()),optional(certhash()),optional(peerId())),WebRTCDirect=fmt(_WebRTCDirect),_WebTransport=and(_QUICV1,literal("webtransport"),optional(certhash()),optional(certhash()),optional(peerId())),WebTransport=fmt(_WebTransport),_P2P=or$c(_WebSockets,_WebSocketsSecure,and(_TCP,optional(peerId())),and(QUIC_V0_OR_V1,optional(peerId())),and(_IP_OR_DOMAIN,optional(peerId())),_WebRTCDirect,_WebTransport,peerId()),_Circuit=and(_P2P,literal("p2p-circuit"),peerId()),Circuit=fmt(_Circuit),_WebRTC=or$c(and(_P2P,literal("p2p-circuit"),literal("webrtc"),optional(peerId())),and(_P2P,literal("webrtc"),optional(peerId())),literal("webrtc")),WebRTC=fmt(_WebRTC);or$c(and(_IP_OR_DOMAIN,literal("tcp"),number$1(),literal("http"),optional(peerId())),and(_IP_OR_DOMAIN,literal("http"),optional(peerId())));or$c(and(_IP_OR_DOMAIN,literal("tcp"),or$c(and(literal("443"),literal("http")),and(number$1(),literal("https"))),optional(peerId())),and(_IP_OR_DOMAIN,literal("tls"),literal("http"),optional(peerId())),and(_IP_OR_DOMAIN,literal("https"),optional(peerId())));var Rl,_l;class Identify extends(_l=AbstractIdentify,Rl=serviceCapabilities$3,_l){constructor(tt,rt={}){super(tt,{...rt,protocol:`/${rt.protocolPrefix??defaultValues.protocolPrefix}/${MULTICODEC_IDENTIFY_PROTOCOL_NAME}/${MULTICODEC_IDENTIFY_PROTOCOL_VERSION}`,log:tt.logger.forComponent("libp2p:identify")});wt(this,Rl,["@libp2p/identify"]);(rt.runOnConnectionOpen??defaultValues.runOnConnectionOpen)&&tt.events.addEventListener("connection:open",nt=>{const ot=nt.detail;this.identify(ot).catch(it=>{it.name!==UnsupportedProtocolError$1.name&&this.log.error("error during identify trigged by connection:open",it)})})}async _identify(tt,rt={}){let nt;if(rt.signal==null){const ot=AbortSignal.timeout(this.timeout);setMaxListeners$4(1/0,ot),rt={...rt,signal:ot}}try{nt=await tt.newStream(this.protocol,{...rt,runOnLimitedConnection:this.runOnLimitedConnection});const it=await pbStream(nt,{maxDataLength:this.maxMessageSize}).pb(Identify$1).read(rt);return await nt.close(rt),it}catch(ot){throw nt==null||nt.abort(ot),ot}}async identify(tt,rt={}){const nt=await this._identify(tt,rt),{publicKey:ot,protocols:it,observedAddr:st}=nt;if(ot==null)throw new InvalidMessageError$2("public key was missing from identify message");const at=publicKeyFromProtobuf(ot),ct=peerIdFromCID(at.toCID());if(!tt.remotePeer.equals(ct))throw new InvalidMessageError$2("identified peer does not match the expected peer");if(this.peerId.equals(ct))throw new InvalidMessageError$2("identified peer is our own peer id?");const lt=getCleanMultiaddr(st);return this.log("identify completed for peer %p and protocols %o",ct,it),lt!=null&&(this.log("our observed address was %a",lt),isPrivateIp(lt==null?void 0:lt.nodeAddress().address)===!0?this.log("our observed address was private"):this.addressManager.getObservedAddrs().length<(this.maxObservedAddresses??1/0)&&(this.log("storing our observed address"),this.addressManager.addObservedAddr(lt))),consumeIdentifyMessage(this.peerStore,this.events,this.log,tt,nt)}async handleProtocol(tt){const{connection:rt,stream:nt}=tt,ot=AbortSignal.timeout(this.timeout);setMaxListeners$4(1/0,ot);try{const it=await this.peerStore.get(this.peerId),st=this.addressManager.getAddresses().map(dt=>dt.decapsulateCode(getProtocol("p2p").code));let at=it.peerRecordEnvelope;if(st.length>0&&at==null){const dt=new PeerRecord({peerId:this.peerId,multiaddrs:st});at=(await RecordEnvelope.seal(dt,this.privateKey)).marshal().subarray()}let ct=rt.remoteAddr.bytes;IP_OR_DOMAIN.matches(rt.remoteAddr)||(ct=void 0),await pbStream(nt).pb(Identify$1).write({protocolVersion:this.host.protocolVersion,agentVersion:this.host.agentVersion,publicKey:publicKeyToProtobuf(this.privateKey.publicKey),listenAddrs:st.map(dt=>dt.bytes),signedPeerRecord:at,observedAddr:ct,protocols:it.protocols},{signal:ot}),await nt.close({signal:ot})}catch(it){this.log.error("could not respond to identify request",it),nt.abort(it)}}}function identify(et={}){return o=>new Identify(o,et)}class MuxerClosedError extends Error{constructor(o="The muxer is closed"){super(o),this.name="MuxerClosedError"}}wt(MuxerClosedError,"name","MuxerClosedError");var xs;let InvalidMessageError$1=(xs=class extends Error{constructor(o="Invalid message"){super(o),this.name="InvalidMessageError"}},wt(xs,"name","InvalidMessageError"),xs);var vs;let TooManyOutboundProtocolStreamsError$1=(vs=class extends Error{constructor(o="Too many outbound protocol streams"){super(o),this.name="TooManyOutboundProtocolStreamsError"}},wt(vs,"name","TooManyOutboundProtocolStreamsError"),vs);const serviceCapabilities$2=Symbol.for("@libp2p/service-capabilities");function getIterator(et){if(et!=null){if(typeof et[Symbol.iterator]=="function")return et[Symbol.iterator]();if(typeof et[Symbol.asyncIterator]=="function")return et[Symbol.asyncIterator]();if(typeof et.next=="function")return et}throw new Error("argument is not an iterator or iterable")}function isPromise$2(et){return et==null?!1:typeof et.then=="function"&&typeof et.catch=="function"&&typeof et.finally=="function"}function closeSource(et,o){var rt,nt;const tt=(nt=(rt=getIterator(et)).return)==null?void 0:nt.call(rt);isPromise$2(tt)&&tt.catch(ot=>{o.error("could not cause iterator to return",ot)})}const createAbortError=()=>{const et=new Error("Delay aborted");return et.name="AbortError",et},clearMethods=new WeakMap;function createDelay({clearTimeout:et,setTimeout:o}={}){return(tt,{value:rt,signal:nt}={})=>{if(nt!=null&&nt.aborted)return Promise.reject(createAbortError());let ot,it,st;const at=et??clearTimeout,ct=()=>{at(ot),st(createAbortError())},lt=()=>{nt&&nt.removeEventListener("abort",ct)},dt=new Promise((ht,mt)=>{it=()=>{lt(),ht(rt)},st=mt,ot=(o??setTimeout)(it,tt)});return nt&&nt.addEventListener("abort",ct,{once:!0}),clearMethods.set(dt,()=>{at(ot),ot=null,it()}),dt}}const delay=createDelay();class RateLimitError extends Error{constructor(tt="Rate limit exceeded",rt){super(tt);wt(this,"remainingPoints");wt(this,"msBeforeNext");wt(this,"consumedPoints");wt(this,"isFirstInDuration");this.name="RateLimitError",this.remainingPoints=rt.remainingPoints,this.msBeforeNext=rt.msBeforeNext,this.consumedPoints=rt.consumedPoints,this.isFirstInDuration=rt.isFirstInDuration}}class QueueFullError extends Error{constructor(o="The queue was full"){super(o),this.name="QueueFullError"}}wt(QueueFullError,"name","QueueFullError");class RateLimiter{constructor(o={}){wt(this,"memoryStorage");wt(this,"points");wt(this,"duration");wt(this,"blockDuration");wt(this,"execEvenly");wt(this,"execEvenlyMinDelayMs");wt(this,"keyPrefix");this.points=o.points??4,this.duration=o.duration??1,this.blockDuration=o.blockDuration??0,this.execEvenly=o.execEvenly??!1,this.execEvenlyMinDelayMs=o.execEvenlyMinDelayMs??this.duration*1e3/this.points,this.keyPrefix=o.keyPrefix??"rlflx",this.memoryStorage=new MemoryStorage}async consume(o,tt=1,rt={}){const nt=this.getKey(o),ot=this._getKeySecDuration(rt);let it=this.memoryStorage.incrby(nt,tt,ot);if(it.remainingPoints=Math.max(this.points-it.consumedPoints,0),it.consumedPoints>this.points)throw this.blockDuration>0&&it.consumedPoints<=this.points+tt&&(it=this.memoryStorage.set(nt,it.consumedPoints,this.blockDuration)),new RateLimitError("Rate limit exceeded",it);if(this.execEvenly&&it.msBeforeNext>0&&!it.isFirstInDuration){let st=Math.ceil(it.msBeforeNext/(it.remainingPoints+2));st<this.execEvenlyMinDelayMs&&(st=it.consumedPoints*this.execEvenlyMinDelayMs),await delay(st)}return it}penalty(o,tt=1,rt={}){const nt=this.getKey(o),ot=this._getKeySecDuration(rt),it=this.memoryStorage.incrby(nt,tt,ot);return it.remainingPoints=Math.max(this.points-it.consumedPoints,0),it}reward(o,tt=1,rt={}){const nt=this.getKey(o),ot=this._getKeySecDuration(rt),it=this.memoryStorage.incrby(nt,-tt,ot);return it.remainingPoints=Math.max(this.points-it.consumedPoints,0),it}block(o,tt){const rt=tt*1e3,nt=this.points+1;return this.memoryStorage.set(this.getKey(o),nt,tt),{remainingPoints:0,msBeforeNext:rt===0?-1:rt,consumedPoints:nt,isFirstInDuration:!1}}set(o,tt,rt=0){const nt=(rt>=0?rt:this.duration)*1e3;return this.memoryStorage.set(this.getKey(o),tt,rt),{remainingPoints:0,msBeforeNext:nt===0?-1:nt,consumedPoints:tt,isFirstInDuration:!1}}get(o){const tt=this.memoryStorage.get(this.getKey(o));return tt!=null&&(tt.remainingPoints=Math.max(this.points-tt.consumedPoints,0)),tt}delete(o){this.memoryStorage.delete(this.getKey(o))}_getKeySecDuration(o){return(o==null?void 0:o.customDuration)!=null&&o.customDuration>=0?o.customDuration:this.duration}getKey(o){return this.keyPrefix.length>0?`${this.keyPrefix}:${o}`:o}parseKey(o){return o.substring(this.keyPrefix.length)}}class MemoryStorage{constructor(){wt(this,"storage");this.storage=new Map}incrby(o,tt,rt){const nt=this.storage.get(o);if(nt!=null){const ot=nt.expiresAt!=null?nt.expiresAt.getTime()-new Date().getTime():-1;return nt.expiresAt==null||ot>0?(nt.value+=tt,{remainingPoints:0,msBeforeNext:ot,consumedPoints:nt.value,isFirstInDuration:!1}):this.set(o,tt,rt)}return this.set(o,tt,rt)}set(o,tt,rt){const nt=rt*1e3,ot=this.storage.get(o);ot!=null&&clearTimeout(ot.timeoutId);const it={value:tt,expiresAt:nt>0?new Date(Date.now()+nt):void 0};return this.storage.set(o,it),nt>0&&(it.timeoutId=setTimeout(()=>{this.storage.delete(o)},nt),it.timeoutId.unref!=null&&it.timeoutId.unref()),{remainingPoints:0,msBeforeNext:nt===0?-1:nt,consumedPoints:it.value,isFirstInDuration:!0}}get(o){const tt=this.storage.get(o);if(tt!=null)return{remainingPoints:0,msBeforeNext:tt.expiresAt!=null?tt.expiresAt.getTime()-new Date().getTime():-1,consumedPoints:tt.value,isFirstInDuration:!1}}delete(o){const tt=this.storage.get(o);return tt!=null?(tt.timeoutId!=null&&clearTimeout(tt.timeoutId),this.storage.delete(o),!0):!1}}function allocUnsafe$7(et=0){return new Uint8Array(et)}function coerce$b(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function fromString$g(et){return new TextEncoder().encode(et)}function toString$j(et){return new TextDecoder().decode(et)}function base$b(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt<tt.length;rt++)tt[rt]=255;for(var nt=0;nt<et.length;nt++){var ot=et.charAt(nt),it=ot.charCodeAt(0);if(tt[it]!==255)throw new TypeError(ot+" is ambiguous");tt[it]=nt}var st=et.length,at=et.charAt(0),ct=Math.log(st)/Math.log(256),lt=Math.log(256)/Math.log(st);function dt(ft){if(ft instanceof Uint8Array||(ArrayBuffer.isView(ft)?ft=new Uint8Array(ft.buffer,ft.byteOffset,ft.byteLength):Array.isArray(ft)&&(ft=Uint8Array.from(ft))),!(ft instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(ft.length===0)return"";for(var pt=0,yt=0,gt=0,bt=ft.length;gt!==bt&&ft[gt]===0;)gt++,pt++;for(var xt=(bt-gt)*lt+1>>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct<yt)&&St!==-1;St--,Ct++)Et+=256*vt[St]>>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At<xt;++At)kt+=et.charAt(vt[At]);return kt}function ht(ft){if(typeof ft!="string")throw new TypeError("Expected String");if(ft.length===0)return new Uint8Array;var pt=0;if(ft[pt]!==" "){for(var yt=0,gt=0;ft[pt]===at;)yt++,pt++;for(var bt=(ft.length-pt)*ct+1>>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et<gt)&&Ct!==-1;Ct--,Et++)vt+=st*xt[Ct]>>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$c=base$b,_brrp__multiformats_scope_baseX$b=src$c;let Encoder$c=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$c=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$b(this,o)}},ComposedDecoder$b=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$b(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$b(et,o){return new ComposedDecoder$b({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$b=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$c(o,tt,rt),this.decoder=new Decoder$c(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$c({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$b(et,o,tt,rt)}function baseX$b({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$b(tt,et);return from$c({prefix:o,name:et,encode:rt,decode:ot=>coerce$b(nt(ot))})}function decode$u(et,o,tt,rt){const nt={};for(let lt=0;lt<o.length;++lt)nt[o[lt]]=lt;let ot=et.length;for(;et[ot-1]==="=";)--ot;const it=new Uint8Array(ot*tt/8|0);let st=0,at=0,ct=0;for(let lt=0;lt<ot;++lt){const dt=nt[et[lt]];if(dt===void 0)throw new SyntaxError(`Non-${rt} character`);at=at<<tt|dt,st+=tt,st>=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$q(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<<tt)-1;let ot="",it=0,st=0;for(let at=0;at<et.length;++at)for(st=st<<8|et[at],it+=8;it>tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<<tt-it]),rt)for(;ot.length*tt&7;)ot+="=";return ot}function rfc4648$a({name:et,prefix:o,bitsPerChar:tt,alphabet:rt}){return from$c({prefix:o,name:et,encode(nt){return encode$q(nt,rt,tt)},decode(nt){return decode$u(nt,rt,tt,et)}})}const base10$g=baseX$b({prefix:"9",name:"base10",alphabet:"0123456789"}),base10$h=Object.freeze(Object.defineProperty({__proto__:null,base10:base10$g},Symbol.toStringTag,{value:"Module"})),base16$g=rfc4648$a({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper$8=rfc4648$a({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),base16$h=Object.freeze(Object.defineProperty({__proto__:null,base16:base16$g,base16upper:base16upper$8},Symbol.toStringTag,{value:"Module"})),base2$g=rfc4648$a({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),base2$h=Object.freeze(Object.defineProperty({__proto__:null,base2:base2$g},Symbol.toStringTag,{value:"Module"})),alphabet$8=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),alphabetBytesToChars$8=alphabet$8.reduce((et,o,tt)=>(et[tt]=o,et),[]),alphabetCharsToBytes$8=alphabet$8.reduce((et,o,tt)=>{const rt=o.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${o}`);return et[rt]=tt,et},[]);function encode$p(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars$8[tt],o),"")}function decode$t(et){const o=[];for(const tt of et){const rt=tt.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${tt}`);const nt=alphabetCharsToBytes$8[rt];if(nt==null)throw new Error(`Non-base256emoji character: ${tt}`);o.push(nt)}return new Uint8Array(o)}const base256emoji$g=from$c({prefix:"🚀",name:"base256emoji",encode:encode$p,decode:decode$t}),base256emoji$h=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:base256emoji$g},Symbol.toStringTag,{value:"Module"})),base32$k=rfc4648$a({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper$8=rfc4648$a({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad$8=rfc4648$a({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper$8=rfc4648$a({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex$8=rfc4648$a({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper$8=rfc4648$a({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad$8=rfc4648$a({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper$8=rfc4648$a({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z$8=rfc4648$a({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$l=Object.freeze(Object.defineProperty({__proto__:null,base32:base32$k,base32hex:base32hex$8,base32hexpad:base32hexpad$8,base32hexpadupper:base32hexpadupper$8,base32hexupper:base32hexupper$8,base32pad:base32pad$8,base32padupper:base32padupper$8,base32upper:base32upper$8,base32z:base32z$8},Symbol.toStringTag,{value:"Module"})),base36$h=baseX$b({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper$8=baseX$b({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$i=Object.freeze(Object.defineProperty({__proto__:null,base36:base36$h,base36upper:base36upper$8},Symbol.toStringTag,{value:"Module"})),base58btc$b=baseX$b({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr$8=baseX$b({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58$8=Object.freeze(Object.defineProperty({__proto__:null,base58btc:base58btc$b,base58flickr:base58flickr$8},Symbol.toStringTag,{value:"Module"})),base64$j=rfc4648$a({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad$8=rfc4648$a({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url$8=rfc4648$a({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad$8=rfc4648$a({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$k=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$j,base64pad:base64pad$8,base64url:base64url$8,base64urlpad:base64urlpad$8},Symbol.toStringTag,{value:"Module"})),base8$g=rfc4648$a({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$h=Object.freeze(Object.defineProperty({__proto__:null,base8:base8$g},Symbol.toStringTag,{value:"Module"})),identity$8=from$c({prefix:"\0",name:"identity",encode:et=>toString$j(et),decode:et=>fromString$g(et)}),identityBase$8=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$8},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const bases$8={...identityBase$8,...base2$h,...base8$h,...base10$h,...base16$h,...base32$l,...base36$i,...base58$8,...base64$k,...base256emoji$h};function createCodec$8(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$b=createCodec$8("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii$8=createCodec$8("ascii","a",et=>{let o="a";for(let tt=0;tt<et.length;tt++)o+=String.fromCharCode(et[tt]);return o},et=>{et=et.substring(1);const o=allocUnsafe$7(et.length);for(let tt=0;tt<et.length;tt++)o[tt]=et.charCodeAt(tt);return o}),BASES$8={utf8:string$b,"utf-8":string$b,hex:bases$8.base16,latin1:ascii$8,ascii:ascii$8,binary:ascii$8,...bases$8};function fromString$f(et,o="utf8"){const tt=BASES$8[o];if(tt==null)throw new Error(`Unsupported encoding "${o}"`);return tt.decoder.decode(`${tt.prefix}${et}`)}function toString$i(et,o="utf8"){const tt=BASES$8[o];if(tt==null)throw new Error(`Unsupported encoding "${o}"`);return tt.encoder.encode(et).substring(1)}var MessageTypes;(function(et){et[et.NEW_STREAM=0]="NEW_STREAM",et[et.MESSAGE_RECEIVER=1]="MESSAGE_RECEIVER",et[et.MESSAGE_INITIATOR=2]="MESSAGE_INITIATOR",et[et.CLOSE_RECEIVER=3]="CLOSE_RECEIVER",et[et.CLOSE_INITIATOR=4]="CLOSE_INITIATOR",et[et.RESET_RECEIVER=5]="RESET_RECEIVER",et[et.RESET_INITIATOR=6]="RESET_INITIATOR"})(MessageTypes||(MessageTypes={}));const MessageTypeNames=Object.freeze({0:"NEW_STREAM",1:"MESSAGE_RECEIVER",2:"MESSAGE_INITIATOR",3:"CLOSE_RECEIVER",4:"CLOSE_INITIATOR",5:"RESET_RECEIVER",6:"RESET_INITIATOR"}),InitiatorMessageTypes=Object.freeze({NEW_STREAM:MessageTypes.NEW_STREAM,MESSAGE:MessageTypes.MESSAGE_INITIATOR,CLOSE:MessageTypes.CLOSE_INITIATOR,RESET:MessageTypes.RESET_INITIATOR}),ReceiverMessageTypes=Object.freeze({MESSAGE:MessageTypes.MESSAGE_RECEIVER,CLOSE:MessageTypes.CLOSE_RECEIVER,RESET:MessageTypes.RESET_RECEIVER}),MAX_MSG_SIZE=1<<20,MAX_MSG_QUEUE_SIZE=4<<20;let Decoder$b=class{constructor(o=MAX_MSG_SIZE,tt=MAX_MSG_QUEUE_SIZE){wt(this,"_buffer");wt(this,"_headerInfo");wt(this,"_maxMessageSize");wt(this,"_maxUnprocessedMessageQueueSize");this._buffer=new Uint8ArrayList,this._headerInfo=null,this._maxMessageSize=o,this._maxUnprocessedMessageQueueSize=tt}write(o){if(o==null||o.length===0)return[];if(this._buffer.append(o),this._buffer.byteLength>this._maxUnprocessedMessageQueueSize)throw new InvalidMessageError$1("Unprocessed message queue size too large!");const tt=[];for(;this._buffer.length!==0;){if(this._headerInfo==null)try{this._headerInfo=this._decodeHeader(this._buffer)}catch(ct){if(ct.name==="InvalidMessageError")throw ct;break}const{id:rt,type:nt,length:ot,offset:it}=this._headerInfo;if(this._buffer.length-it<ot)break;const at={id:rt,type:nt};(nt===MessageTypes.NEW_STREAM||nt===MessageTypes.MESSAGE_INITIATOR||nt===MessageTypes.MESSAGE_RECEIVER)&&(at.data=this._buffer.sublist(it,it+ot)),tt.push(at),this._buffer.consume(it+ot),this._headerInfo=null}return tt}_decodeHeader(o){const{value:tt,offset:rt}=readVarInt(o),{value:nt,offset:ot}=readVarInt(o,rt),it=tt&7;if(MessageTypeNames[it]==null)throw new Error(`Invalid type received: ${it}`);if(nt>this._maxMessageSize)throw new InvalidMessageError$1("Message size too large");return{id:tt>>3,type:it,offset:rt+ot,length:nt}}};const MSB$3=128,REST$3=127;function readVarInt(et,o=0){let tt=0,rt=0,nt=o,ot;const it=et.length;do{if(nt>=it||rt>49)throw o=0,new RangeError("Could not decode varint");ot=et.get(nt++),tt+=rt<28?(ot&REST$3)<<rt:(ot&REST$3)*Math.pow(2,rt),rt+=7}while(ot>=MSB$3);return o=nt-o,{value:tt,offset:o}}const POOL_SIZE=10*1024;let Encoder$b=class{constructor(){wt(this,"_pool");wt(this,"_poolOffset");this._pool=allocUnsafe$7(POOL_SIZE),this._poolOffset=0}write(o,tt){const rt=this._pool;let nt=this._poolOffset;encode$P(o.id<<3|o.type,rt,nt),nt+=encodingLength$6(o.id<<3|o.type),(o.type===MessageTypes.NEW_STREAM||o.type===MessageTypes.MESSAGE_INITIATOR||o.type===MessageTypes.MESSAGE_RECEIVER)&&o.data!=null?(encode$P(o.data.length,rt,nt),nt+=encodingLength$6(o.data.length)):(encode$P(0,rt,nt),nt+=encodingLength$6(0));const ot=rt.subarray(this._poolOffset,nt);POOL_SIZE-nt<100?(this._pool=allocUnsafe$7(POOL_SIZE),this._poolOffset=0):this._poolOffset=nt,tt.append(ot),(o.type===MessageTypes.NEW_STREAM||o.type===MessageTypes.MESSAGE_INITIATOR||o.type===MessageTypes.MESSAGE_RECEIVER)&&o.data!=null&&tt.append(o.data)}};const encoder$1=new Encoder$b;async function*encode$o(et){for await(const o of et){const tt=new Uint8ArrayList;encoder$1.write(o,tt),yield tt}}class StreamInputBufferError extends Error{constructor(o="Stream input buffer error"){super(o),this.name="StreamInputBufferError"}}var ws;let AbortError$6=(ws=class extends Error{constructor(o="The operation was aborted"){super(o),this.name="AbortError"}},wt(ws,"name","AbortError"),ws);class StreamResetError extends Error{constructor(o="The stream has been reset"){super(o),this.name="StreamResetError"}}wt(StreamResetError,"name","StreamResetError");class StreamStateError extends Error{constructor(o="The stream is in an invalid state"){super(o),this.name="StreamStateError"}}wt(StreamStateError,"name","StreamStateError");function setMaxListeners$3(){}const setMaxListeners$2=(et,...o)=>{try{[...o]}catch{}};var Jr,Tl;let TypedEventEmitter$1=(Tl=class extends EventTarget{constructor(){super();fr(this,Jr,new Map);setMaxListeners$2(1/0,this)}listenerCount(tt){const rt=Ot(this,Jr).get(tt);return rt==null?0:rt.length}addEventListener(tt,rt,nt){super.addEventListener(tt,rt,nt);let ot=Ot(this,Jr).get(tt);ot==null&&(ot=[],Ot(this,Jr).set(tt,ot)),ot.push({callback:rt,once:(nt!==!0&&nt!==!1&&(nt==null?void 0:nt.once))??!1})}removeEventListener(tt,rt,nt){super.removeEventListener(tt.toString(),rt??null,nt);let ot=Ot(this,Jr).get(tt);ot!=null&&(ot=ot.filter(({callback:it})=>it!==rt),Ot(this,Jr).set(tt,ot))}dispatchEvent(tt){const rt=super.dispatchEvent(tt);let nt=Ot(this,Jr).get(tt.type);return nt==null||(nt=nt.filter(({once:ot})=>!ot),Ot(this,Jr).set(tt.type,nt)),rt}safeDispatchEvent(tt,rt={}){return this.dispatchEvent(new CustomEvent(tt,rt))}},Jr=new WeakMap,Tl);const DEFAULT_SEND_CLOSE_WRITE_TIMEOUT=5e3;function isPromise$1(et){return et==null?!1:typeof et.then=="function"&&typeof et.catch=="function"&&typeof et.finally=="function"}class AbstractStream{constructor(o){wt(this,"id");wt(this,"direction");wt(this,"timeline");wt(this,"protocol");wt(this,"metadata");wt(this,"source");wt(this,"status");wt(this,"readStatus");wt(this,"writeStatus");wt(this,"log");wt(this,"sinkController");wt(this,"sinkEnd");wt(this,"closed");wt(this,"endErr");wt(this,"streamSource");wt(this,"onEnd");wt(this,"onCloseRead");wt(this,"onCloseWrite");wt(this,"onReset");wt(this,"onAbort");wt(this,"sendCloseWriteTimeout");wt(this,"sendingData");this.sinkController=new AbortController,this.sinkEnd=pDefer(),this.closed=pDefer(),this.log=o.log,this.status="open",this.readStatus="ready",this.writeStatus="ready",this.id=o.id,this.metadata=o.metadata??{},this.direction=o.direction,this.timeline={open:Date.now()},this.sendCloseWriteTimeout=o.sendCloseWriteTimeout??DEFAULT_SEND_CLOSE_WRITE_TIMEOUT,this.onEnd=o.onEnd,this.onCloseRead=o==null?void 0:o.onCloseRead,this.onCloseWrite=o==null?void 0:o.onCloseWrite,this.onReset=o==null?void 0:o.onReset,this.onAbort=o==null?void 0:o.onAbort,this.source=this.streamSource=pushable({onEnd:tt=>{tt!=null?this.log.trace("source ended with error",tt):this.log.trace("source ended"),this.onSourceEnd(tt)}}),this.sink=this.sink.bind(this)}async sink(o){if(this.writeStatus!=="ready")throw new StreamStateError(`writable end state is "${this.writeStatus}" not "ready"`);try{this.writeStatus="writing";const tt={signal:this.sinkController.signal};if(this.direction==="outbound"){const nt=this.sendNewStream(tt);isPromise$1(nt)&&await nt}const rt=()=>{closeSource(o,this.log)};try{this.sinkController.signal.addEventListener("abort",rt),this.log.trace("sink reading from source");for await(let nt of o){nt=nt instanceof Uint8Array?new Uint8ArrayList(nt):nt;const ot=this.sendData(nt,tt);isPromise$1(ot)&&(this.sendingData=pDefer(),await ot,this.sendingData.resolve(),this.sendingData=void 0)}}finally{this.sinkController.signal.removeEventListener("abort",rt)}this.log.trace('sink finished reading from source, write status is "%s"',this.writeStatus),this.writeStatus==="writing"&&(this.writeStatus="closing",this.log.trace("send close write to remote"),await this.sendCloseWrite({signal:AbortSignal.timeout(this.sendCloseWriteTimeout)}),this.writeStatus="closed"),this.onSinkEnd()}catch(tt){throw this.log.trace("sink ended with error, calling abort with error",tt),this.abort(tt),tt}finally{this.log.trace("resolve sink end"),this.sinkEnd.resolve()}}onSourceEnd(o){var tt;this.timeline.closeRead==null&&(this.timeline.closeRead=Date.now(),this.readStatus="closed",o!=null&&this.endErr==null&&(this.endErr=o),(tt=this.onCloseRead)==null||tt.call(this),this.timeline.closeWrite!=null?(this.log.trace("source and sink ended"),this.timeline.close=Date.now(),this.status!=="aborted"&&this.status!=="reset"&&(this.status="closed"),this.onEnd!=null&&this.onEnd(this.endErr),this.closed.resolve()):this.log.trace("source ended, waiting for sink to end"))}onSinkEnd(o){var tt;this.timeline.closeWrite==null&&(this.timeline.closeWrite=Date.now(),this.writeStatus="closed",o!=null&&this.endErr==null&&(this.endErr=o),(tt=this.onCloseWrite)==null||tt.call(this),this.timeline.closeRead!=null?(this.log.trace("sink and source ended"),this.timeline.close=Date.now(),this.status!=="aborted"&&this.status!=="reset"&&(this.status="closed"),this.onEnd!=null&&this.onEnd(this.endErr),this.closed.resolve()):this.log.trace("sink ended, waiting for source to end"))}async close(o){this.log.trace("closing gracefully"),this.status="closing",await raceSignal(Promise.all([this.closeWrite(o),this.closeRead(o),this.closed.promise]),o==null?void 0:o.signal),this.status="closed",this.log.trace("closed gracefully")}async closeRead(o={}){if(this.readStatus==="closing"||this.readStatus==="closed")return;this.log.trace('closing readable end of stream with starting read status "%s"',this.readStatus);const tt=this.readStatus;this.readStatus="closing",this.status!=="reset"&&this.status!=="aborted"&&this.timeline.closeRead==null&&(this.log.trace("send close read to remote"),await this.sendCloseRead(o)),tt==="ready"&&(this.log.trace("ending internal source queue with %d queued bytes",this.streamSource.readableLength),this.streamSource.end()),this.log.trace("closed readable end of stream")}async closeWrite(o={}){this.writeStatus==="closing"||this.writeStatus==="closed"||(this.log.trace('closing writable end of stream with starting write status "%s"',this.writeStatus),this.writeStatus==="ready"&&(this.log.trace("sink was never sunk, sink an empty array"),await raceSignal(this.sink([]),o.signal)),this.writeStatus==="writing"&&(this.sendingData!=null&&await raceSignal(this.sendingData.promise,o.signal),this.log.trace("aborting source passed to .sink"),this.sinkController.abort(),await raceSignal(this.sinkEnd.promise,o.signal)),this.writeStatus="closed",this.log.trace("closed writable end of stream"))}abort(o){var rt;if(this.status==="closed"||this.status==="aborted"||this.status==="reset")return;this.log("abort with error",o),this.log("try to send reset to remote");const tt=this.sendReset();isPromise$1(tt)&&tt.catch(nt=>{this.log.error("error sending reset message",nt)}),this.status="aborted",this.timeline.abort=Date.now(),this._closeSinkAndSource(o),(rt=this.onAbort)==null||rt.call(this,o)}reset(){var tt;if(this.status==="closed"||this.status==="aborted"||this.status==="reset")return;const o=new StreamResetError("stream reset");this.status="reset",this.timeline.reset=Date.now(),this._closeSinkAndSource(o),(tt=this.onReset)==null||tt.call(this)}_closeSinkAndSource(o){this._closeSink(o),this._closeSource(o)}_closeSink(o){this.writeStatus==="writing"&&(this.log.trace("end sink source"),this.sinkController.abort()),this.onSinkEnd(o)}_closeSource(o){this.readStatus!=="closing"&&this.readStatus!=="closed"&&(this.log.trace("ending source with %d bytes to be read by consumer",this.streamSource.readableLength),this.readStatus="closing",this.streamSource.end(o))}remoteCloseWrite(){if(this.readStatus==="closing"||this.readStatus==="closed"){this.log("received remote close write but local source is already closed");return}this.log.trace("remote close write"),this._closeSource()}remoteCloseRead(){if(this.writeStatus==="closing"||this.writeStatus==="closed"){this.log("received remote close read but local sink is already closed");return}this.log.trace("remote close read"),this._closeSink()}destroy(){if(this.status==="closed"||this.status==="aborted"||this.status==="reset"){this.log("received destroy but we are already closed");return}this.log.trace("stream destroyed"),this._closeSinkAndSource()}sourcePush(o){this.streamSource.push(o)}sourceReadableLength(){return this.streamSource.readableLength}}class MplexStream extends AbstractStream{constructor(tt){super(tt);wt(this,"name");wt(this,"streamId");wt(this,"send");wt(this,"types");wt(this,"maxDataSize");this.types=tt.direction==="outbound"?InitiatorMessageTypes:ReceiverMessageTypes,this.send=tt.send,this.name=tt.name,this.streamId=tt.streamId,this.maxDataSize=tt.maxDataSize}async sendNewStream(){await this.send({id:this.streamId,type:InitiatorMessageTypes.NEW_STREAM,data:new Uint8ArrayList(fromString$f(this.name))})}async sendData(tt){for(tt=tt.sublist();tt.byteLength>0;){const rt=Math.min(tt.byteLength,this.maxDataSize);await this.send({id:this.streamId,type:this.types.MESSAGE,data:tt.sublist(0,rt)}),tt.consume(rt)}}async sendReset(){await this.send({id:this.streamId,type:this.types.RESET})}async sendCloseWrite(){await this.send({id:this.streamId,type:this.types.CLOSE})}async sendCloseRead(){}}function createStream(et){const{id:o,name:tt,send:rt,onEnd:nt,type:ot="initiator",maxMsgSize:it=MAX_MSG_SIZE}=et;return new MplexStream({id:ot==="initiator"?`i${o}`:`r${o}`,streamId:o,name:`${tt??o}`,direction:ot==="initiator"?"outbound":"inbound",maxDataSize:it,onEnd:nt,send:rt,log:et.logger.forComponent(`libp2p:mplex:stream:${ot}:${o}`)})}const MAX_STREAMS_INBOUND_STREAMS_PER_CONNECTION=1024,MAX_STREAMS_OUTBOUND_STREAMS_PER_CONNECTION=1024,MAX_STREAM_BUFFER_SIZE=1024*1024*4,DISCONNECT_THRESHOLD=5,CLOSE_TIMEOUT$2=500;function printMessage(et){const o={...et,type:`${MessageTypeNames[et.type]} (${et.type})`};return et.type===MessageTypes.NEW_STREAM&&(o.data=toString$i(et.data instanceof Uint8Array?et.data:et.data.subarray())),(et.type===MessageTypes.MESSAGE_INITIATOR||et.type===MessageTypes.MESSAGE_RECEIVER)&&(o.data=toString$i(et.data instanceof Uint8Array?et.data:et.data.subarray(),"base16")),o}class MplexStreamMuxer{constructor(o,tt){wt(this,"protocol","/mplex/6.7.0");wt(this,"sink");wt(this,"source");wt(this,"log");wt(this,"_streamId");wt(this,"_streams");wt(this,"_init");wt(this,"_source");wt(this,"closeController");wt(this,"rateLimiter");wt(this,"closeTimeout");wt(this,"logger");tt=tt??{},this.log=o.logger.forComponent("libp2p:mplex"),this.logger=o.logger,this._streamId=0,this._streams={initiators:new Map,receivers:new Map},this._init=tt,this.closeTimeout=tt.closeTimeout??CLOSE_TIMEOUT$2,this.sink=this._createSink(),this._source=pushable({objectMode:!0,onEnd:()=>{for(const rt of this._streams.initiators.values())rt.destroy();for(const rt of this._streams.receivers.values())rt.destroy()}}),this.source=pipe(this._source,rt=>encode$o(rt)),this.closeController=new AbortController,this.rateLimiter=new RateLimiter({points:tt.disconnectThreshold??DISCONNECT_THRESHOLD,duration:1})}get streams(){const o=[];for(const tt of this._streams.initiators.values())o.push(tt);for(const tt of this._streams.receivers.values())o.push(tt);return o}newStream(o){if(this.closeController.signal.aborted)throw new MuxerClosedError("Muxer already closed");const tt=this._streamId++;o=o==null?tt.toString():o.toString();const rt=this._streams.initiators;return this._newStream({id:tt,name:o,type:"initiator",registry:rt})}async close(o){if(this.closeController.signal.aborted)return;const tt=(o==null?void 0:o.signal)??AbortSignal.timeout(this.closeTimeout);try{await Promise.all(this.streams.map(async rt=>rt.close({signal:tt}))),this._source.end(),await this._source.onEmpty({signal:tt}),this.closeController.abort()}catch(rt){this.abort(rt)}}abort(o){this.closeController.signal.aborted||(this.streams.forEach(tt=>{tt.abort(o)}),this.closeController.abort(o))}_newReceiverStream(o){const{id:tt,name:rt}=o,nt=this._streams.receivers;return this._newStream({id:tt,name:rt,type:"receiver",registry:nt})}_newStream(o){const{id:tt,name:rt,type:nt,registry:ot}=o;if(this.log("new %s stream %s",nt,tt),nt==="initiator"&&this._streams.initiators.size===(this._init.maxOutboundStreams??MAX_STREAMS_OUTBOUND_STREAMS_PER_CONNECTION))throw new TooManyOutboundProtocolStreamsError$1("Too many outbound streams open");if(ot.has(tt))throw new Error(`${nt} stream ${tt} already exists!`);const at=createStream({id:tt,name:rt,send:async ct=>{this.log.enabled&&this.log.trace("%s stream %s send",nt,tt,printMessage(ct)),this._source.push(ct)},type:nt,onEnd:()=>{this.log("%s stream with id %s and protocol %s ended",nt,tt,at.protocol),ot.delete(tt),this._init.onStreamEnd!=null&&this._init.onStreamEnd(at)},maxMsgSize:this._init.maxMsgSize,logger:this.logger});return ot.set(tt,at),at}_createSink(){return async tt=>{const rt=()=>{closeSource(tt,this.log)};this.closeController.signal.addEventListener("abort",rt);try{const nt=new Decoder$b(this._init.maxMsgSize,this._init.maxUnprocessedMessageQueueSize);for await(const ot of tt)for(const it of nt.write(ot))await this._handleIncoming(it);this._source.end()}catch(nt){this.log("error in sink",nt),this._source.end(nt)}finally{this.closeController.signal.removeEventListener("abort",rt)}}}async _handleIncoming(o){const{id:tt,type:rt}=o;if(this.log.enabled&&this.log.trace("incoming message",printMessage(o)),o.type===MessageTypes.NEW_STREAM){if(this._streams.receivers.size===(this._init.maxInboundStreams??MAX_STREAMS_INBOUND_STREAMS_PER_CONNECTION)){this.log("too many inbound streams open"),this._source.push({id:tt,type:MessageTypes.RESET_RECEIVER});try{await this.rateLimiter.consume("new-stream",1)}catch{this.log("rate limit hit when opening too many new streams over the inbound stream limit - closing remote connection"),this.abort(new Error("Too many open streams"));return}return}const st=this._newReceiverStream({id:tt,name:toString$i(o.data instanceof Uint8Array?o.data:o.data.subarray())});this._init.onIncomingStream!=null&&this._init.onIncomingStream(st);return}const ot=((rt&1)===1?this._streams.initiators:this._streams.receivers).get(tt);if(ot==null){this.log("missing stream %s for message type %s",tt,MessageTypeNames[rt]);try{await this.rateLimiter.consume("missing-stream",1)}catch{this.log("rate limit hit when receiving messages for streams that do not exist - closing remote connection"),this.abort(new Error("Too many messages for missing streams"));return}return}const it=this._init.maxStreamBufferSize??MAX_STREAM_BUFFER_SIZE;try{switch(rt){case MessageTypes.MESSAGE_INITIATOR:case MessageTypes.MESSAGE_RECEIVER:if(ot.sourceReadableLength()>it)throw this._source.push({id:o.id,type:rt===MessageTypes.MESSAGE_INITIATOR?MessageTypes.RESET_RECEIVER:MessageTypes.RESET_INITIATOR}),new StreamInputBufferError("Input buffer full - increase Mplex maxBufferSize to accommodate slow consumers");ot.sourcePush(o.data);break;case MessageTypes.CLOSE_INITIATOR:case MessageTypes.CLOSE_RECEIVER:ot.remoteCloseWrite();break;case MessageTypes.RESET_INITIATOR:case MessageTypes.RESET_RECEIVER:ot.reset();break;default:this.log("unknown message type %s",rt)}}catch(st){this.log.error("error while processing message",st),ot.abort(st)}}}var Il,Pl;Pl=Symbol.toStringTag,Il=serviceCapabilities$2;class Mplex{constructor(o,tt={}){wt(this,"protocol","/mplex/6.7.0");wt(this,"_init");wt(this,"components");wt(this,Pl,"@libp2p/mplex");wt(this,Il,["@libp2p/stream-multiplexing"]);this.components=o,this._init=tt}createStreamMuxer(o={}){return new MplexStreamMuxer(this.components,{...o,...this._init})}}function mplex(et={}){return o=>new Mplex(o,et)}function isAsyncIterable$3(et){return et[Symbol.asyncIterator]!=null}function first(et){if(isAsyncIterable$3(et))return(async()=>{for await(const o of et)return o})();for(const o of et)return o}function equals$4(et,o){if(et===o)return!0;if(et.byteLength!==o.byteLength)return!1;for(let tt=0;tt<et.byteLength;tt++)if(et[tt]!==o[tt])return!1;return!0}const PING_LENGTH$1=32,PROTOCOL_VERSION$1="1.0.0",PROTOCOL_NAME$1="ping",PROTOCOL_PREFIX$1="ipfs",TIMEOUT=1e4,MAX_INBOUND_STREAMS=2,MAX_OUTBOUND_STREAMS=1;var Nl;Nl=Symbol.toStringTag;class PingService{constructor(o,tt={}){wt(this,"protocol");wt(this,"components");wt(this,"started");wt(this,"timeout");wt(this,"maxInboundStreams");wt(this,"maxOutboundStreams");wt(this,"runOnLimitedConnection");wt(this,"log");wt(this,Nl,"@libp2p/ping");this.components=o,this.log=o.logger.forComponent("libp2p:ping"),this.started=!1,this.protocol=`/${tt.protocolPrefix??PROTOCOL_PREFIX$1}/${PROTOCOL_NAME$1}/${PROTOCOL_VERSION$1}`,this.timeout=tt.timeout??TIMEOUT,this.maxInboundStreams=tt.maxInboundStreams??MAX_INBOUND_STREAMS,this.maxOutboundStreams=tt.maxOutboundStreams??MAX_OUTBOUND_STREAMS,this.runOnLimitedConnection=tt.runOnLimitedConnection??!0,this.handleMessage=this.handleMessage.bind(this)}async start(){await this.components.registrar.handle(this.protocol,this.handleMessage,{maxInboundStreams:this.maxInboundStreams,maxOutboundStreams:this.maxOutboundStreams,runOnLimitedConnection:this.runOnLimitedConnection}),this.started=!0}async stop(){await this.components.registrar.unhandle(this.protocol),this.started=!1}isStarted(){return this.started}handleMessage(o){this.log("incoming ping from %p",o.connection.remotePeer);const{stream:tt}=o,rt=Date.now();AbortSignal.timeout(this.timeout).addEventListener("abort",()=>{tt==null||tt.abort(new TimeoutError$3("ping timeout"))}),pipe(tt,async function*(ot){let it=0;for await(const st of ot){if(it+=st.byteLength,it>PING_LENGTH$1){tt==null||tt.abort(new InvalidMessageError$3("Too much data received"));return}yield st}},tt).catch(ot=>{this.log.error("incoming ping from %p failed with error",o.connection.remotePeer,ot),tt==null||tt.abort(ot)}).finally(()=>{const ot=Date.now()-rt;this.log("incoming ping from %p complete in %dms",o.connection.remotePeer,ot)})}async ping(o,tt={}){var at,ct;this.log("pinging %p",o);const rt=Date.now(),nt=randomBytes(PING_LENGTH$1),ot=await this.components.connectionManager.openConnection(o,tt);let it,st=()=>{};if(tt.signal==null){const lt=AbortSignal.timeout(this.timeout);tt={...tt,signal:lt}}try{it=await ot.newStream(this.protocol,{...tt,runOnLimitedConnection:this.runOnLimitedConnection}),st=()=>{it==null||it.abort(new AbortError$9)},(at=tt.signal)==null||at.addEventListener("abort",st,{once:!0});const lt=await pipe([nt],it,async ht=>first(ht)),dt=Date.now()-rt;if(lt==null)throw new ProtocolError(`Did not receive a ping ack after ${dt}ms`);if(!equals$4(nt,lt.subarray()))throw new ProtocolError(`Received wrong ping ack after ${dt}ms`);return this.log("ping %p complete in %dms",ot.remotePeer,dt),dt}catch(lt){throw this.log.error("error while pinging %p",ot.remotePeer,lt),it==null||it.abort(lt),lt}finally{(ct=tt.signal)==null||ct.removeEventListener("abort",st),it!=null&&await it.close()}}}function ping(et={}){return o=>new PingService(o,et)}const transportSymbol=Symbol.for("@libp2p/transport");var FaultTolerance$1;(function(et){et[et.FATAL_ALL=0]="FATAL_ALL",et[et.NO_FATAL=1]="NO_FATAL"})(FaultTolerance$1||(FaultTolerance$1={}));var Es;let AbortError$5=(Es=class extends Error{constructor(o="The operation was aborted"){super(o),this.name="AbortError"}},wt(Es,"name","AbortError"),Es);class ConnectionFailedError extends Error{constructor(o="Connection failed"){super(o),this.name="ConnectionFailedError"}}wt(ConnectionFailedError,"name","ConnectionFailedError");const serviceCapabilities$1=Symbol.for("@libp2p/service-capabilities"),ASSUME_HTTP_CODES=[getProtocol("tcp").code,getProtocol("dns").code,getProtocol("dnsaddr").code,getProtocol("dns4").code,getProtocol("dns6").code];function extractSNI(et){let o;try{o=getProtocol("sni").code}catch{return null}for(const[tt,rt]of et)if(tt===o&&rt!==void 0)return rt;return null}function hasTLS(et){return et.some(([o,tt])=>o===getProtocol("tls").code)}function interpretNext(et,o,tt){const rt=interpreters[getProtocol(et).name];if(rt===void 0)throw new Error(`Can't interpret protocol ${getProtocol(et).name}`);const nt=rt(o,tt);return et===getProtocol("ip6").code?`[${nt}]`:nt}const interpreters={ip4:(et,o)=>et,ip6:(et,o)=>o.length===0?et:`[${et}]`,tcp:(et,o)=>{const tt=o.pop();if(tt===void 0)throw new Error("Unexpected end of multiaddr");return`tcp://${interpretNext(tt[0],tt[1]??"",o)}:${et}`},udp:(et,o)=>{const tt=o.pop();if(tt===void 0)throw new Error("Unexpected end of multiaddr");return`udp://${interpretNext(tt[0],tt[1]??"",o)}:${et}`},dnsaddr:(et,o)=>et,dns4:(et,o)=>et,dns6:(et,o)=>et,dns:(et,o)=>et,ipfs:(et,o)=>{const tt=o.pop();if(tt===void 0)throw new Error("Unexpected end of multiaddr");return`${interpretNext(tt[0],tt[1]??"",o)}/ipfs/${et}`},p2p:(et,o)=>{const tt=o.pop();if(tt===void 0)throw new Error("Unexpected end of multiaddr");return`${interpretNext(tt[0],tt[1]??"",o)}/p2p/${et}`},http:(et,o)=>{const tt=hasTLS(o),rt=extractSNI(o);if(tt&&rt!==null)return`https://${rt}`;const nt=tt?"https://":"http://",ot=o.pop();if(ot===void 0)throw new Error("Unexpected end of multiaddr");let it=interpretNext(ot[0],ot[1]??"",o);return it=it.replace("tcp://",""),`${nt}${it}`},"http-path":(et,o)=>{const tt=o.pop();if(tt===void 0)throw new Error("Unexpected end of multiaddr");const rt=interpretNext(tt[0],tt[1]??"",o),nt=decodeURIComponent(et);return`${rt}/${nt}`},tls:(et,o)=>{const tt=o.pop();if(tt===void 0)throw new Error("Unexpected end of multiaddr");return interpretNext(tt[0],tt[1]??"",o)},sni:(et,o)=>{const tt=o.pop();if(tt===void 0)throw new Error("Unexpected end of multiaddr");return interpretNext(tt[0],tt[1]??"",o)},https:(et,o)=>{const tt=o.pop();if(tt===void 0)throw new Error("Unexpected end of multiaddr");let rt=interpretNext(tt[0],tt[1]??"",o);return rt=rt.replace("tcp://",""),`https://${rt}`},ws:(et,o)=>{const tt=hasTLS(o),rt=extractSNI(o);if(tt&&rt!==null)return`wss://${rt}`;const nt=tt?"wss://":"ws://",ot=o.pop();if(ot===void 0)throw new Error("Unexpected end of multiaddr");let it=interpretNext(ot[0],ot[1]??"",o);return it=it.replace("tcp://",""),`${nt}${it}`},wss:(et,o)=>{const tt=o.pop();if(tt===void 0)throw new Error("Unexpected end of multiaddr");let rt=interpretNext(tt[0],tt[1]??"",o);return rt=rt.replace("tcp://",""),`wss://${rt}`},"p2p-websocket-star":(et,o)=>{const tt=o.pop();if(tt===void 0)throw new Error("Unexpected end of multiaddr");return`${interpretNext(tt[0],tt[1]??"",o)}/p2p-websocket-star`},"p2p-webrtc-star":(et,o)=>{const tt=o.pop();if(tt===void 0)throw new Error("Unexpected end of multiaddr");return`${interpretNext(tt[0],tt[1]??"",o)}/p2p-webrtc-star`},"p2p-webrtc-direct":(et,o)=>{const tt=o.pop();if(tt===void 0)throw new Error("Unexpected end of multiaddr");return`${interpretNext(tt[0],tt[1]??"",o)}/p2p-webrtc-direct`}};function multiaddrToUri(et,o){const rt=multiaddr(et).stringTuples(),nt=rt.pop();if(nt===void 0)throw new Error("Unexpected end of multiaddr");const ot=getProtocol(nt[0]),it=interpreters[ot.name];if(it==null)throw new Error(`No interpreter found for ${ot.name}`);let st=it(nt[1]??"",rt);return ASSUME_HTTP_CODES.includes(nt[0])&&(st=st.replace(/^.*:\/\//,""),nt[1]==="443"?st=`https://${st}`:st=`http://${st}`),(st.startsWith("http://")||st.startsWith("https://"))&&(st=new URL(st).toString(),st.endsWith("/")&&(st=st.substring(0,st.length-1))),st}const ready=async et=>{if(et.readyState>=2)throw new Error("socket closed");et.readyState!==1&&await new Promise((o,tt)=>{function rt(){et.removeEventListener("open",nt),et.removeEventListener("error",ot)}function nt(){rt(),o()}function ot(it){rt(),tt(it.error??new Error(`connect ECONNREFUSED ${et.url}`))}et.addEventListener("open",nt),et.addEventListener("error",ot)})},sink=(et,o)=>(o=o??{},o.closeOnEnd=o.closeOnEnd!==!1,async rt=>{for await(const nt of rt){try{await ready(et)}catch(ot){if(ot.message==="socket closed")break;throw ot}if(et.readyState===et.CLOSING||et.readyState===et.CLOSED)break;et.send(nt)}o.closeOnEnd!=null&&et.readyState<=1&&await new Promise((nt,ot)=>{et.addEventListener("close",it=>{if(it.wasClean||it.code===1006)nt();else{const st=Object.assign(new Error("ws error"),{event:it});ot(st)}}),setTimeout(()=>{et.close()})})});var dom={},eventIterator={};Object.defineProperty(eventIterator,"__esModule",{value:!0});class EventQueue{constructor(){this.pullQueue=[],this.pushQueue=[],this.eventHandlers={},this.isPaused=!1,this.isStopped=!1}push(o){if(this.isStopped)return;const tt={value:o,done:!1};if(this.pullQueue.length){const rt=this.pullQueue.shift();rt&&rt.resolve(tt)}else this.pushQueue.push(Promise.resolve(tt)),this.highWaterMark!==void 0&&this.pushQueue.length>=this.highWaterMark&&!this.isPaused&&(this.isPaused=!0,this.eventHandlers.highWater?this.eventHandlers.highWater():console&&console.warn(`EventIterator queue reached ${this.pushQueue.length} items`))}stop(){if(!this.isStopped){this.isStopped=!0,this.remove();for(const o of this.pullQueue)o.resolve({value:void 0,done:!0});this.pullQueue.length=0}}fail(o){if(!this.isStopped)if(this.isStopped=!0,this.remove(),this.pullQueue.length){for(const tt of this.pullQueue)tt.reject(o);this.pullQueue.length=0}else{const tt=Promise.reject(o);tt.catch(()=>{}),this.pushQueue.push(tt)}}remove(){Promise.resolve().then(()=>{this.removeCallback&&this.removeCallback()})}[Symbol.asyncIterator](){return{next:o=>{const tt=this.pushQueue.shift();return tt?(this.lowWaterMark!==void 0&&this.pushQueue.length<=this.lowWaterMark&&this.isPaused&&(this.isPaused=!1,this.eventHandlers.lowWater&&this.eventHandlers.lowWater()),tt):this.isStopped?Promise.resolve({value:void 0,done:!0}):new Promise((rt,nt)=>{this.pullQueue.push({resolve:rt,reject:nt})})},return:()=>(this.isStopped=!0,this.pushQueue.length=0,this.remove(),Promise.resolve({value:void 0,done:!0}))}}}let EventIterator$1=class{constructor(o,{highWaterMark:tt=100,lowWaterMark:rt=1}={}){const nt=new EventQueue;nt.highWaterMark=tt,nt.lowWaterMark=rt,nt.removeCallback=o({push:ot=>nt.push(ot),stop:()=>nt.stop(),fail:ot=>nt.fail(ot),on:(ot,it)=>{nt.eventHandlers[ot]=it}})||(()=>{}),this[Symbol.asyncIterator]=()=>nt[Symbol.asyncIterator](),Object.freeze(this)}};eventIterator.EventIterator=EventIterator$1;eventIterator.default=EventIterator$1;Object.defineProperty(dom,"__esModule",{value:!0});const event_iterator_1=eventIterator;var EventIterator=dom.EventIterator=event_iterator_1.EventIterator;function subscribe(et,o,tt){return new event_iterator_1.EventIterator(({push:rt})=>(this.addEventListener(et,rt,o),()=>this.removeEventListener(et,rt,o)),tt)}dom.subscribe=subscribe;dom.default=event_iterator_1.EventIterator;function coerce$a(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function fromString$e(et){return new TextEncoder().encode(et)}function toString$h(et){return new TextDecoder().decode(et)}function base$a(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt<tt.length;rt++)tt[rt]=255;for(var nt=0;nt<et.length;nt++){var ot=et.charAt(nt),it=ot.charCodeAt(0);if(tt[it]!==255)throw new TypeError(ot+" is ambiguous");tt[it]=nt}var st=et.length,at=et.charAt(0),ct=Math.log(st)/Math.log(256),lt=Math.log(256)/Math.log(st);function dt(ft){if(ft instanceof Uint8Array||(ArrayBuffer.isView(ft)?ft=new Uint8Array(ft.buffer,ft.byteOffset,ft.byteLength):Array.isArray(ft)&&(ft=Uint8Array.from(ft))),!(ft instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(ft.length===0)return"";for(var pt=0,yt=0,gt=0,bt=ft.length;gt!==bt&&ft[gt]===0;)gt++,pt++;for(var xt=(bt-gt)*lt+1>>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct<yt)&&St!==-1;St--,Ct++)Et+=256*vt[St]>>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At<xt;++At)kt+=et.charAt(vt[At]);return kt}function ht(ft){if(typeof ft!="string")throw new TypeError("Expected String");if(ft.length===0)return new Uint8Array;var pt=0;if(ft[pt]!==" "){for(var yt=0,gt=0;ft[pt]===at;)yt++,pt++;for(var bt=(ft.length-pt)*ct+1>>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et<gt)&&Ct!==-1;Ct--,Et++)vt+=st*xt[Ct]>>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$b=base$a,_brrp__multiformats_scope_baseX$a=src$b;let Encoder$a=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$a=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$a(this,o)}},ComposedDecoder$a=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$a(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$a(et,o){return new ComposedDecoder$a({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$a=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$a(o,tt,rt),this.decoder=new Decoder$a(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$b({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$a(et,o,tt,rt)}function baseX$a({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$a(tt,et);return from$b({prefix:o,name:et,encode:rt,decode:ot=>coerce$a(nt(ot))})}function decode$s(et,o,tt,rt){const nt={};for(let lt=0;lt<o.length;++lt)nt[o[lt]]=lt;let ot=et.length;for(;et[ot-1]==="=";)--ot;const it=new Uint8Array(ot*tt/8|0);let st=0,at=0,ct=0;for(let lt=0;lt<ot;++lt){const dt=nt[et[lt]];if(dt===void 0)throw new SyntaxError(`Non-${rt} character`);at=at<<tt|dt,st+=tt,st>=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$n(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<<tt)-1;let ot="",it=0,st=0;for(let at=0;at<et.length;++at)for(st=st<<8|et[at],it+=8;it>tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<<tt-it]),rt)for(;ot.length*tt&7;)ot+="=";return ot}function rfc4648$9({name:et,prefix:o,bitsPerChar:tt,alphabet:rt}){return from$b({prefix:o,name:et,encode(nt){return encode$n(nt,rt,tt)},decode(nt){return decode$s(nt,rt,tt,et)}})}const base10$e=baseX$a({prefix:"9",name:"base10",alphabet:"0123456789"}),base10$f=Object.freeze(Object.defineProperty({__proto__:null,base10:base10$e},Symbol.toStringTag,{value:"Module"})),base16$e=rfc4648$9({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper$7=rfc4648$9({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),base16$f=Object.freeze(Object.defineProperty({__proto__:null,base16:base16$e,base16upper:base16upper$7},Symbol.toStringTag,{value:"Module"})),base2$e=rfc4648$9({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),base2$f=Object.freeze(Object.defineProperty({__proto__:null,base2:base2$e},Symbol.toStringTag,{value:"Module"})),alphabet$7=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),alphabetBytesToChars$7=alphabet$7.reduce((et,o,tt)=>(et[tt]=o,et),[]),alphabetCharsToBytes$7=alphabet$7.reduce((et,o,tt)=>{const rt=o.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${o}`);return et[rt]=tt,et},[]);function encode$m(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars$7[tt],o),"")}function decode$r(et){const o=[];for(const tt of et){const rt=tt.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${tt}`);const nt=alphabetCharsToBytes$7[rt];if(nt==null)throw new Error(`Non-base256emoji character: ${tt}`);o.push(nt)}return new Uint8Array(o)}const base256emoji$e=from$b({prefix:"🚀",name:"base256emoji",encode:encode$m,decode:decode$r}),base256emoji$f=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:base256emoji$e},Symbol.toStringTag,{value:"Module"})),base32$i=rfc4648$9({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper$7=rfc4648$9({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad$7=rfc4648$9({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper$7=rfc4648$9({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex$7=rfc4648$9({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper$7=rfc4648$9({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad$7=rfc4648$9({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper$7=rfc4648$9({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z$7=rfc4648$9({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$j=Object.freeze(Object.defineProperty({__proto__:null,base32:base32$i,base32hex:base32hex$7,base32hexpad:base32hexpad$7,base32hexpadupper:base32hexpadupper$7,base32hexupper:base32hexupper$7,base32pad:base32pad$7,base32padupper:base32padupper$7,base32upper:base32upper$7,base32z:base32z$7},Symbol.toStringTag,{value:"Module"})),base36$f=baseX$a({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper$7=baseX$a({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$g=Object.freeze(Object.defineProperty({__proto__:null,base36:base36$f,base36upper:base36upper$7},Symbol.toStringTag,{value:"Module"})),base58btc$a=baseX$a({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr$7=baseX$a({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58$7=Object.freeze(Object.defineProperty({__proto__:null,base58btc:base58btc$a,base58flickr:base58flickr$7},Symbol.toStringTag,{value:"Module"})),base64$h=rfc4648$9({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad$7=rfc4648$9({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url$7=rfc4648$9({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad$7=rfc4648$9({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$i=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$h,base64pad:base64pad$7,base64url:base64url$7,base64urlpad:base64urlpad$7},Symbol.toStringTag,{value:"Module"})),base8$e=rfc4648$9({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$f=Object.freeze(Object.defineProperty({__proto__:null,base8:base8$e},Symbol.toStringTag,{value:"Module"})),identity$7=from$b({prefix:"\0",name:"identity",encode:et=>toString$h(et),decode:et=>fromString$e(et)}),identityBase$7=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$7},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const bases$7={...identityBase$7,...base2$f,...base8$f,...base10$f,...base16$f,...base32$j,...base36$g,...base58$7,...base64$i,...base256emoji$f};function allocUnsafe$6(et=0){return new Uint8Array(et)}function createCodec$7(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$a=createCodec$7("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii$7=createCodec$7("ascii","a",et=>{let o="a";for(let tt=0;tt<et.length;tt++)o+=String.fromCharCode(et[tt]);return o},et=>{et=et.substring(1);const o=allocUnsafe$6(et.length);for(let tt=0;tt<et.length;tt++)o[tt]=et.charCodeAt(tt);return o}),BASES$7={utf8:string$a,"utf-8":string$a,hex:bases$7.base16,latin1:ascii$7,ascii:ascii$7,binary:ascii$7,...bases$7};function fromString$d(et,o="utf8"){const tt=BASES$7[o];if(tt==null)throw new Error(`Unsupported encoding "${o}"`);return tt.decoder.decode(`${tt.prefix}${et}`)}function isArrayBuffer(et){var o;return et instanceof ArrayBuffer||((o=et==null?void 0:et.constructor)==null?void 0:o.name)==="ArrayBuffer"&&typeof(et==null?void 0:et.byteLength)=="number"}const source=et=>{et.binaryType="arraybuffer";const o=async()=>{await new Promise((ot,it)=>{if(rt){ot();return}if(nt!=null){it(nt);return}const st=lt=>{et.removeEventListener("open",at),et.removeEventListener("error",ct),lt()},at=()=>{st(ot)},ct=lt=>{st(()=>{it(lt.error??new Error(`connect ECONNREFUSED ${et.url}`))})};et.addEventListener("open",at),et.addEventListener("error",ct)})},tt=async function*(){const ot=new EventIterator(({push:it,stop:st,fail:at})=>{const ct=dt=>{let ht=null;typeof dt.data=="string"&&(ht=fromString$d(dt.data)),isArrayBuffer(dt.data)&&(ht=new Uint8Array(dt.data)),dt.data instanceof Uint8Array&&(ht=dt.data),ht!=null&&it(ht)},lt=dt=>{at(dt.error??new Error("Socket error"))};return et.addEventListener("message",ct),et.addEventListener("error",lt),et.addEventListener("close",st),()=>{et.removeEventListener("message",ct),et.removeEventListener("error",lt),et.removeEventListener("close",st)}},{highWaterMark:1/0});await o();for await(const it of ot)yield isArrayBuffer(it)?new Uint8Array(it):it}();let rt=et.readyState===1,nt;return et.addEventListener("open",()=>{rt=!0,nt=null}),et.addEventListener("close",()=>{rt=!1,nt=null}),et.addEventListener("error",ot=>{rt||(nt=ot.error??new Error(`connect ECONNREFUSED ${et.url}`))}),Object.assign(tt,{connected:o})},duplex=(et,o)=>{o=o??{};const tt=source(et);let rt=o.remoteAddress,nt=o.remotePort;if(et.url!=null)try{const it=new URL(et.url);rt=it.hostname,nt=parseInt(it.port,10)}catch{}if(rt==null||nt==null)throw new Error("Remote connection did not have address and/or port");return{sink:sink(et,o),source:tt,connected:async()=>{await tt.connected()},close:async()=>{(et.readyState===et.CONNECTING||et.readyState===et.OPEN)&&await new Promise(it=>{et.addEventListener("close",()=>{it()}),et.close()})},destroy:()=>{et.terminate!=null?et.terminate():et.close()},remoteAddress:rt,remotePort:nt,socket:et}},WebSocket$1=WebSocket,map={"http:":"ws:","https:":"wss:"},defaultProtocol="ws:",wsurl=(et,o)=>{if(et.startsWith("//")&&(et=`${(o==null?void 0:o.protocol)??defaultProtocol}${et}`),et.startsWith("/")&&o!=null){const rt=o.protocol??defaultProtocol,nt=o.host,ot=o.port!=null&&(nt==null?void 0:nt.endsWith(`:${o.port}`))!==!0?`:${o.port}`:"";et=`${rt}//${nt}${ot}${et}`}const tt=new URL(et);for(const[rt,nt]of Object.entries(map))tt.protocol===rt&&(tt.protocol=nt);return tt};function connect(et,o){const tt=typeof window>"u"?void 0:window.location;o=o??{};const rt=wsurl(et,tt),nt=new WebSocket$1(rt.toString(),o.websocket);return duplex(nt,o)}class CustomProgressEvent extends Event{constructor(tt,rt){super(tt);wt(this,"type");wt(this,"detail");this.type=tt,this.detail=rt}}const CODE_P2P=421,CODE_CIRCUIT=290,CLOSE_TIMEOUT$1=500;function all$1(et){return et.filter(o=>{if(o.protoCodes().includes(CODE_CIRCUIT))return!1;const tt=o.decapsulateCode(CODE_P2P);return WebSockets$2.matches(tt)||WebSocketsSecure$1.matches(tt)})}function wss(et){return et.filter(o=>{if(o.protoCodes().includes(CODE_CIRCUIT))return!1;const tt=o.decapsulateCode(CODE_P2P);return WebSocketsSecure$1.matches(tt)})}function createListener(){throw new Error("WebSocket Servers can not be created in the browser!")}function socketToMaConn(et,o,tt){const rt=tt.logger.forComponent("libp2p:websockets:maconn"),nt=tt.metrics,ot=tt.metricPrefix??"",it={log:rt,async sink(st){try{await et.sink(async function*(){for await(const at of st)at instanceof Uint8Array?yield at:yield at.subarray()}())}catch(at){at.type!=="aborted"&&rt.error(at)}},source:et.source,remoteAddr:o,timeline:{open:Date.now()},async close(st={}){var lt,dt;const at=Date.now();if(st.signal==null){const ht=AbortSignal.timeout(CLOSE_TIMEOUT$1);st={...st,signal:ht}}const ct=()=>{const{host:ht,port:mt}=it.remoteAddr.toOptions();rt("timeout closing stream to %s:%s after %dms, destroying it manually",ht,mt,Date.now()-at),this.abort(new AbortError$5("Socket close timeout"))};(lt=st.signal)==null||lt.addEventListener("abort",ct);try{await et.close()}catch(ht){rt.error("error closing WebSocket gracefully",ht),this.abort(ht)}finally{(dt=st.signal)==null||dt.removeEventListener("abort",ct),it.timeline.close=Date.now()}},abort(st){const{host:at,port:ct}=it.remoteAddr.toOptions();rt("timeout closing stream to %s:%s due to error",at,ct,st),et.destroy(),it.timeline.close=Date.now(),nt==null||nt.increment({[`${ot}error`]:!0})}};return et.socket.addEventListener("close",()=>{nt==null||nt.increment({[`${ot}close`]:!0}),it.timeline.close==null&&(it.timeline.close=Date.now())},{once:!0}),it}var Dl,Ll,Ol;Ol=transportSymbol,Ll=Symbol.toStringTag,Dl=serviceCapabilities$1;class WebSockets{constructor(o,tt){wt(this,"log");wt(this,"init");wt(this,"logger");wt(this,"metrics");wt(this,"components");wt(this,Ol,!0);wt(this,Ll,"@libp2p/websockets");wt(this,Dl,["@libp2p/transport"]);this.log=o.logger.forComponent("libp2p:websockets"),this.logger=o.logger,this.components=o,this.init=tt,o.metrics!=null&&(this.metrics={dialerEvents:o.metrics.registerCounterGroup("libp2p_websockets_dialer_events_total",{label:"event",help:"Total count of WebSockets dialer events by type"})})}async dial(o,tt){var it;this.log("dialing %s",o),tt=tt??{};const rt=await this._connect(o,tt),nt=socketToMaConn(rt,o,{logger:this.logger,metrics:(it=this.metrics)==null?void 0:it.dialerEvents});this.log("new outbound connection %s",nt.remoteAddr);const ot=await tt.upgrader.upgradeOutbound(nt,tt);return this.log("outbound connection %s upgraded",nt.remoteAddr),ot}async _connect(o,tt){var it,st,at,ct,lt;(it=tt==null?void 0:tt.signal)==null||it.throwIfAborted();const rt=o.toOptions();this.log("dialing %s:%s",rt.host,rt.port);const nt=pDefer(),ot=connect(multiaddrToUri(o),this.init);ot.socket.addEventListener("error",()=>{var ht;const dt=new ConnectionFailedError(`Could not connect to ${o.toString()}`);this.log.error("connection error:",dt),(ht=this.metrics)==null||ht.dialerEvents.increment({error:!0}),nt.reject(dt)});try{(st=tt.onProgress)==null||st.call(tt,new CustomProgressEvent("websockets:open-connection")),await raceSignal(Promise.race([ot.connected(),nt.promise]),tt.signal)}catch(dt){throw((at=tt.signal)==null?void 0:at.aborted)===!0&&((ct=this.metrics)==null||ct.dialerEvents.increment({abort:!0})),ot.close().catch(ht=>{this.log.error("error closing raw socket",ht)}),dt}return this.log("connected %s",o),(lt=this.metrics)==null||lt.dialerEvents.increment({connect:!0}),ot}createListener(o){return createListener({logger:this.logger,metrics:this.components.metrics},{...this.init,...o})}listenFilter(o){var tt,rt;return o=Array.isArray(o)?o:[o],((tt=this.init)==null?void 0:tt.filter)!=null?(rt=this.init)==null?void 0:rt.filter(o):isBrowser||isWebWorker?wss(o):all$1(o)}dialFilter(o){return this.listenFilter(o)}}function webSockets(et={}){return o=>new WebSockets(o,et)}const connectionSymbol=Symbol.for("@libp2p/connection"),contentRoutingSymbol=Symbol.for("@libp2p/content-routing"),peerDiscoverySymbol=Symbol.for("@libp2p/peer-discovery"),peerIdSymbol$1=Symbol.for("@libp2p/peer-id");function isPeerId$1(et){return!!(et!=null&&et[peerIdSymbol$1])}const peerRoutingSymbol=Symbol.for("@libp2p/peer-routing"),KEEP_ALIVE="keep-alive";var FaultTolerance;(function(et){et[et.FATAL_ALL=0]="FATAL_ALL",et[et.NO_FATAL=1]="NO_FATAL"})(FaultTolerance||(FaultTolerance={}));var Cs;let AbortError$4=(Cs=class extends Error{constructor(o="The operation was aborted"){super(o),this.name="AbortError"}},wt(Cs,"name","AbortError"),Cs);var Ss;let InvalidParametersError$1=(Ss=class extends Error{constructor(o="Invalid parameters"){super(o),this.name="InvalidParametersError"}},wt(Ss,"name","InvalidParametersError"),Ss);class ConnectionClosingError extends Error{constructor(o="The connection is closing"){super(o),this.name="ConnectionClosingError"}}wt(ConnectionClosingError,"name","ConnectionClosingError");class ConnectionClosedError extends Error{constructor(o="The connection is closed"){super(o),this.name="ConnectionClosedError"}}wt(ConnectionClosedError,"name","ConnectionClosedError");var As;let NotFoundError$1=(As=class extends Error{constructor(o="Not found"){super(o),this.name="NotFoundError"}},wt(As,"name","NotFoundError"),As);class InvalidPeerIdError extends Error{constructor(o="Invalid PeerID"){super(o),this.name="InvalidPeerIdError"}}wt(InvalidPeerIdError,"name","InvalidPeerIdError");class InvalidMultiaddrError extends Error{constructor(o="Invalid multiaddr"){super(o),this.name="InvalidMultiaddrError"}}wt(InvalidMultiaddrError,"name","InvalidMultiaddrError");var $s;let TimeoutError$2=($s=class extends Error{constructor(o="Timed out"){super(o),this.name="TimeoutError"}},wt($s,"name","TimeoutError"),$s);class NotStartedError extends Error{constructor(o="Not started"){super(o),this.name="NotStartedError"}}wt(NotStartedError,"name","NotStartedError");class DialError extends Error{constructor(o="Dial error"){super(o),this.name="DialError"}}wt(DialError,"name","DialError");class LimitedConnectionError extends Error{constructor(o="Limited connection"){super(o),this.name="LimitedConnectionError"}}wt(LimitedConnectionError,"name","LimitedConnectionError");class TooManyInboundProtocolStreamsError extends Error{constructor(o="Too many inbound protocol streams"){super(o),this.name="TooManyInboundProtocolStreamsError"}}wt(TooManyInboundProtocolStreamsError,"name","TooManyInboundProtocolStreamsError");class TooManyOutboundProtocolStreamsError extends Error{constructor(o="Too many outbound protocol streams"){super(o),this.name="TooManyOutboundProtocolStreamsError"}}wt(TooManyOutboundProtocolStreamsError,"name","TooManyOutboundProtocolStreamsError");function setMaxListeners$1(){}const setMaxListeners=(et,...o)=>{try{[...o]}catch{}};var en;class TypedEventEmitter extends EventTarget{constructor(){super();fr(this,en,new Map);setMaxListeners(1/0,this)}listenerCount(tt){const rt=Ot(this,en).get(tt);return rt==null?0:rt.length}addEventListener(tt,rt,nt){super.addEventListener(tt,rt,nt);let ot=Ot(this,en).get(tt);ot==null&&(ot=[],Ot(this,en).set(tt,ot)),ot.push({callback:rt,once:(nt!==!0&&nt!==!1&&(nt==null?void 0:nt.once))??!1})}removeEventListener(tt,rt,nt){super.removeEventListener(tt.toString(),rt??null,nt);let ot=Ot(this,en).get(tt);ot!=null&&(ot=ot.filter(({callback:it})=>it!==rt),Ot(this,en).set(tt,ot))}dispatchEvent(tt){const rt=super.dispatchEvent(tt);let nt=Ot(this,en).get(tt.type);return nt==null||(nt=nt.filter(({once:ot})=>!ot),Ot(this,en).set(tt.type,nt)),rt}safeDispatchEvent(tt,rt={}){return this.dispatchEvent(new CustomEvent(tt,rt))}}en=new WeakMap;function isStartable(et){return et!=null&&typeof et.start=="function"&&typeof et.stop=="function"}async function start(...et){const o=[];for(const tt of et)isStartable(tt)&&o.push(tt);await Promise.all(o.map(async tt=>{tt.beforeStart!=null&&await tt.beforeStart()})),await Promise.all(o.map(async tt=>{await tt.start()})),await Promise.all(o.map(async tt=>{tt.afterStart!=null&&await tt.afterStart()}))}async function stop(...et){const o=[];for(const tt of et)isStartable(tt)&&o.push(tt);await Promise.all(o.map(async tt=>{tt.beforeStop!=null&&await tt.beforeStop()})),await Promise.all(o.map(async tt=>{await tt.stop()})),await Promise.all(o.map(async tt=>{tt.afterStop!=null&&await tt.afterStop()}))}const serviceCapabilities=Symbol.for("@libp2p/service-capabilities"),serviceDependencies=Symbol.for("@libp2p/service-dependencies");let TimeoutError$1=class extends Error{constructor(o){super(o),this.name="TimeoutError"}},AbortError$3=class extends Error{constructor(o){super(),this.name="AbortError",this.message=o}};const getDOMException=et=>globalThis.DOMException===void 0?new AbortError$3(et):new DOMException(et),getAbortedReason=et=>{const o=et.reason===void 0?getDOMException("This operation was aborted."):et.reason;return o instanceof Error?o:getDOMException(o)};function pTimeout(et,o){const{milliseconds:tt,fallback:rt,message:nt,customTimers:ot={setTimeout,clearTimeout}}=o;let it;const at=new Promise((ct,lt)=>{if(typeof tt!="number"||Math.sign(tt)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${tt}\``);if(o.signal){const{signal:ht}=o;ht.aborted&&lt(getAbortedReason(ht));const mt=()=>{lt(getAbortedReason(ht))};ht.addEventListener("abort",mt,{once:!0}),et.finally(()=>{ht.removeEventListener("abort",mt)})}if(tt===Number.POSITIVE_INFINITY){et.then(ct,lt);return}const dt=new TimeoutError$1;it=ot.setTimeout.call(void 0,()=>{if(rt){try{ct(rt())}catch(ht){lt(ht)}return}typeof et.cancel=="function"&&et.cancel(),nt===!1?ct():nt instanceof Error?lt(nt):(dt.message=nt??`Promise timed out after ${tt} milliseconds`,lt(dt))},tt),(async()=>{try{ct(await et)}catch(ht){lt(ht)}})()}).finally(()=>{at.clear()});return at.clear=()=>{ot.clearTimeout.call(void 0,it),it=void 0},at}function lowerBound(et,o,tt){let rt=0,nt=et.length;for(;nt>0;){const ot=Math.trunc(nt/2);let it=rt+ot;tt(et[it],o)<=0?(rt=++it,nt-=ot+1):nt=ot}return rt}var tn,Ml;let PriorityQueue$1=(Ml=class{constructor(){fr(this,tn,[])}enqueue(o,tt){tt={priority:0,...tt};const rt={priority:tt.priority,run:o};if(this.size&&Ot(this,tn)[this.size-1].priority>=tt.priority){Ot(this,tn).push(rt);return}const nt=lowerBound(Ot(this,tn),rt,(ot,it)=>it.priority-ot.priority);Ot(this,tn).splice(nt,0,rt)}dequeue(){const o=Ot(this,tn).shift();return o==null?void 0:o.run}filter(o){return Ot(this,tn).filter(tt=>tt.priority===o.priority).map(tt=>tt.run)}get size(){return Ot(this,tn).length}},tn=new WeakMap,Ml);var Zn,Jn,En,ho,eo,fo,Hr,to,Ur,po,Wr,ro,an,mo,kr,ru,nu,ou,iu,su,es,Ms,Bs,ts,au,rs;class PQueue extends EventEmitter$1{constructor(tt){var rt,nt;super();fr(this,kr);fr(this,Zn);fr(this,Jn);fr(this,En,0);fr(this,ho);fr(this,eo);fr(this,fo,0);fr(this,Hr);fr(this,to);fr(this,Ur);fr(this,po);fr(this,Wr,0);fr(this,ro);fr(this,an);fr(this,mo);wt(this,"timeout");if(tt={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:PriorityQueue$1,...tt},!(typeof tt.intervalCap=="number"&&tt.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${((rt=tt.intervalCap)==null?void 0:rt.toString())??""}\` (${typeof tt.intervalCap})`);if(tt.interval===void 0||!(Number.isFinite(tt.interval)&&tt.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${((nt=tt.interval)==null?void 0:nt.toString())??""}\` (${typeof tt.interval})`);lr(this,Zn,tt.carryoverConcurrencyCount),lr(this,Jn,tt.intervalCap===Number.POSITIVE_INFINITY||tt.interval===0),lr(this,ho,tt.intervalCap),lr(this,eo,tt.interval),lr(this,Ur,new tt.queueClass),lr(this,po,tt.queueClass),this.concurrency=tt.concurrency,this.timeout=tt.timeout,lr(this,mo,tt.throwOnTimeout===!0),lr(this,an,tt.autoStart===!1)}get concurrency(){return Ot(this,ro)}set concurrency(tt){if(!(typeof tt=="number"&&tt>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${tt}\` (${typeof tt})`);lr(this,ro,tt),mr(this,kr,ts).call(this)}async add(tt,rt={}){return rt={timeout:this.timeout,throwOnTimeout:Ot(this,mo),...rt},new Promise((nt,ot)=>{Ot(this,Ur).enqueue(async()=>{var it;Cn(this,Wr)._++,Cn(this,En)._++;try{(it=rt.signal)==null||it.throwIfAborted();let st=tt({signal:rt.signal});rt.timeout&&(st=pTimeout(Promise.resolve(st),{milliseconds:rt.timeout})),rt.signal&&(st=Promise.race([st,mr(this,kr,au).call(this,rt.signal)]));const at=await st;nt(at),this.emit("completed",at)}catch(st){if(st instanceof TimeoutError$1&&!rt.throwOnTimeout){nt();return}ot(st),this.emit("error",st)}finally{mr(this,kr,ou).call(this)}},rt),this.emit("add"),mr(this,kr,es).call(this)})}async addAll(tt,rt){return Promise.all(tt.map(async nt=>this.add(nt,rt)))}start(){return Ot(this,an)?(lr(this,an,!1),mr(this,kr,ts).call(this),this):this}pause(){lr(this,an,!0)}clear(){lr(this,Ur,new(Ot(this,po)))}async onEmpty(){Ot(this,Ur).size!==0&&await mr(this,kr,rs).call(this,"empty")}async onSizeLessThan(tt){Ot(this,Ur).size<tt||await mr(this,kr,rs).call(this,"next",()=>Ot(this,Ur).size<tt)}async onIdle(){Ot(this,Wr)===0&&Ot(this,Ur).size===0||await mr(this,kr,rs).call(this,"idle")}get size(){return Ot(this,Ur).size}sizeBy(tt){return Ot(this,Ur).filter(tt).length}get pending(){return Ot(this,Wr)}get isPaused(){return Ot(this,an)}}Zn=new WeakMap,Jn=new WeakMap,En=new WeakMap,ho=new WeakMap,eo=new WeakMap,fo=new WeakMap,Hr=new WeakMap,to=new WeakMap,Ur=new WeakMap,po=new WeakMap,Wr=new WeakMap,ro=new WeakMap,an=new WeakMap,mo=new WeakMap,kr=new WeakSet,ru=function(){return Ot(this,Jn)||Ot(this,En)<Ot(this,ho)},nu=function(){return Ot(this,Wr)<Ot(this,ro)},ou=function(){Cn(this,Wr)._--,mr(this,kr,es).call(this),this.emit("next")},iu=function(){mr(this,kr,Bs).call(this),mr(this,kr,Ms).call(this),lr(this,to,void 0)},su=function(){const tt=Date.now();if(Ot(this,Hr)===void 0){const rt=Ot(this,fo)-tt;if(rt<0)lr(this,En,Ot(this,Zn)?Ot(this,Wr):0);else return Ot(this,to)===void 0&&lr(this,to,setTimeout(()=>{mr(this,kr,iu).call(this)},rt)),!0}return!1},es=function(){if(Ot(this,Ur).size===0)return Ot(this,Hr)&&clearInterval(Ot(this,Hr)),lr(this,Hr,void 0),this.emit("empty"),Ot(this,Wr)===0&&this.emit("idle"),!1;if(!Ot(this,an)){const tt=!Ot(this,kr,su);if(Ot(this,kr,ru)&&Ot(this,kr,nu)){const rt=Ot(this,Ur).dequeue();return rt?(this.emit("active"),rt(),tt&&mr(this,kr,Ms).call(this),!0):!1}}return!1},Ms=function(){Ot(this,Jn)||Ot(this,Hr)!==void 0||(lr(this,Hr,setInterval(()=>{mr(this,kr,Bs).call(this)},Ot(this,eo))),lr(this,fo,Date.now()+Ot(this,eo)))},Bs=function(){Ot(this,En)===0&&Ot(this,Wr)===0&&Ot(this,Hr)&&(clearInterval(Ot(this,Hr)),lr(this,Hr,void 0)),lr(this,En,Ot(this,Zn)?Ot(this,Wr):0),mr(this,kr,ts).call(this)},ts=function(){for(;mr(this,kr,es).call(this););},au=async function(tt){return new Promise((rt,nt)=>{tt.addEventListener("abort",()=>{nt(tt.reason)},{once:!0})})},rs=async function(tt,rt){return new Promise(nt=>{const ot=()=>{rt&&!rt()||(this.off(tt,ot),nt())};this.on(tt,ot)})};function getTypes(et){const o=[RecordType.A];return et==null?o:Array.isArray(et)?et.length===0?o:et:[et]}function coerce$9(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function fromString$c(et){return new TextEncoder().encode(et)}function toString$g(et){return new TextDecoder().decode(et)}function base$9(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt<tt.length;rt++)tt[rt]=255;for(var nt=0;nt<et.length;nt++){var ot=et.charAt(nt),it=ot.charCodeAt(0);if(tt[it]!==255)throw new TypeError(ot+" is ambiguous");tt[it]=nt}var st=et.length,at=et.charAt(0),ct=Math.log(st)/Math.log(256),lt=Math.log(256)/Math.log(st);function dt(ft){if(ft instanceof Uint8Array||(ArrayBuffer.isView(ft)?ft=new Uint8Array(ft.buffer,ft.byteOffset,ft.byteLength):Array.isArray(ft)&&(ft=Uint8Array.from(ft))),!(ft instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(ft.length===0)return"";for(var pt=0,yt=0,gt=0,bt=ft.length;gt!==bt&&ft[gt]===0;)gt++,pt++;for(var xt=(bt-gt)*lt+1>>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct<yt)&&St!==-1;St--,Ct++)Et+=256*vt[St]>>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At<xt;++At)kt+=et.charAt(vt[At]);return kt}function ht(ft){if(typeof ft!="string")throw new TypeError("Expected String");if(ft.length===0)return new Uint8Array;var pt=0;if(ft[pt]!==" "){for(var yt=0,gt=0;ft[pt]===at;)yt++,pt++;for(var bt=(ft.length-pt)*ct+1>>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et<gt)&&Ct!==-1;Ct--,Et++)vt+=st*xt[Ct]>>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$a=base$9,_brrp__multiformats_scope_baseX$9=src$a;let Encoder$9=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$9=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$9(this,o)}},ComposedDecoder$9=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$9(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$9(et,o){return new ComposedDecoder$9({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$9=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$9(o,tt,rt),this.decoder=new Decoder$9(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$a({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$9(et,o,tt,rt)}function baseX$9({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$9(tt,et);return from$a({prefix:o,name:et,encode:rt,decode:ot=>coerce$9(nt(ot))})}function decode$q(et,o,tt,rt){const nt={};for(let lt=0;lt<o.length;++lt)nt[o[lt]]=lt;let ot=et.length;for(;et[ot-1]==="=";)--ot;const it=new Uint8Array(ot*tt/8|0);let st=0,at=0,ct=0;for(let lt=0;lt<ot;++lt){const dt=nt[et[lt]];if(dt===void 0)throw new SyntaxError(`Non-${rt} character`);at=at<<tt|dt,st+=tt,st>=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$l(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<<tt)-1;let ot="",it=0,st=0;for(let at=0;at<et.length;++at)for(st=st<<8|et[at],it+=8;it>tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<<tt-it]),rt)for(;ot.length*tt&7;)ot+="=";return ot}function rfc4648$8({name:et,prefix:o,bitsPerChar:tt,alphabet:rt}){return from$a({prefix:o,name:et,encode(nt){return encode$l(nt,rt,tt)},decode(nt){return decode$q(nt,rt,tt,et)}})}const base10$c=baseX$9({prefix:"9",name:"base10",alphabet:"0123456789"}),base10$d=Object.freeze(Object.defineProperty({__proto__:null,base10:base10$c},Symbol.toStringTag,{value:"Module"})),base16$c=rfc4648$8({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper$6=rfc4648$8({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),base16$d=Object.freeze(Object.defineProperty({__proto__:null,base16:base16$c,base16upper:base16upper$6},Symbol.toStringTag,{value:"Module"})),base2$c=rfc4648$8({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),base2$d=Object.freeze(Object.defineProperty({__proto__:null,base2:base2$c},Symbol.toStringTag,{value:"Module"})),alphabet$6=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),alphabetBytesToChars$6=alphabet$6.reduce((et,o,tt)=>(et[tt]=o,et),[]),alphabetCharsToBytes$6=alphabet$6.reduce((et,o,tt)=>{const rt=o.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${o}`);return et[rt]=tt,et},[]);function encode$k(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars$6[tt],o),"")}function decode$p(et){const o=[];for(const tt of et){const rt=tt.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${tt}`);const nt=alphabetCharsToBytes$6[rt];if(nt==null)throw new Error(`Non-base256emoji character: ${tt}`);o.push(nt)}return new Uint8Array(o)}const base256emoji$c=from$a({prefix:"🚀",name:"base256emoji",encode:encode$k,decode:decode$p}),base256emoji$d=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:base256emoji$c},Symbol.toStringTag,{value:"Module"})),base32$g=rfc4648$8({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper$6=rfc4648$8({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad$6=rfc4648$8({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper$6=rfc4648$8({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex$6=rfc4648$8({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper$6=rfc4648$8({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad$6=rfc4648$8({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper$6=rfc4648$8({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z$6=rfc4648$8({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$h=Object.freeze(Object.defineProperty({__proto__:null,base32:base32$g,base32hex:base32hex$6,base32hexpad:base32hexpad$6,base32hexpadupper:base32hexpadupper$6,base32hexupper:base32hexupper$6,base32pad:base32pad$6,base32padupper:base32padupper$6,base32upper:base32upper$6,base32z:base32z$6},Symbol.toStringTag,{value:"Module"})),base36$d=baseX$9({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper$6=baseX$9({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$e=Object.freeze(Object.defineProperty({__proto__:null,base36:base36$d,base36upper:base36upper$6},Symbol.toStringTag,{value:"Module"})),base58btc$9=baseX$9({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr$6=baseX$9({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58$6=Object.freeze(Object.defineProperty({__proto__:null,base58btc:base58btc$9,base58flickr:base58flickr$6},Symbol.toStringTag,{value:"Module"})),base64$f=rfc4648$8({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad$6=rfc4648$8({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url$6=rfc4648$8({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad$6=rfc4648$8({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$g=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$f,base64pad:base64pad$6,base64url:base64url$6,base64urlpad:base64urlpad$6},Symbol.toStringTag,{value:"Module"})),base8$c=rfc4648$8({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$d=Object.freeze(Object.defineProperty({__proto__:null,base8:base8$c},Symbol.toStringTag,{value:"Module"})),identity$6=from$a({prefix:"\0",name:"identity",encode:et=>toString$g(et),decode:et=>fromString$c(et)}),identityBase$6=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$6},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const bases$6={...identityBase$6,...base2$d,...base8$d,...base10$d,...base16$d,...base32$h,...base36$e,...base58$6,...base64$g,...base256emoji$d};function allocUnsafe$5(et=0){return new Uint8Array(et)}function createCodec$6(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$9=createCodec$6("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii$6=createCodec$6("ascii","a",et=>{let o="a";for(let tt=0;tt<et.length;tt++)o+=String.fromCharCode(et[tt]);return o},et=>{et=et.substring(1);const o=allocUnsafe$5(et.length);for(let tt=0;tt<et.length;tt++)o[tt]=et.charCodeAt(tt);return o}),BASES$6={utf8:string$9,"utf-8":string$9,hex:bases$6.base16,latin1:ascii$6,ascii:ascii$6,binary:ascii$6,...bases$6};function toString$f(et,o="utf8"){const tt=BASES$6[o];if(tt==null)throw new Error(`Unsupported encoding "${o}"`);return tt.encoder.encode(et).substring(1)}const DEFAULT_TTL=60;function toDNSResponse(et){return{Status:et.Status??0,TC:et.TC??et.flag_tc??!1,RD:et.RD??et.flag_rd??!1,RA:et.RA??et.flag_ra??!1,AD:et.AD??et.flag_ad??!1,CD:et.CD??et.flag_cd??!1,Question:(et.Question??et.questions??[]).map(o=>({name:o.name,type:RecordType[o.type]})),Answer:(et.Answer??et.answers??[]).map(o=>({name:o.name,type:RecordType[o.type],TTL:o.TTL??o.ttl??DEFAULT_TTL,data:o.data instanceof Uint8Array?toString$f(o.data):o.data}))}}const DEFAULT_QUERY_CONCURRENCY=4;function dnsJsonOverHttps(et,o={}){const tt=new PQueue({concurrency:o.queryConcurrency??DEFAULT_QUERY_CONCURRENCY});return async(rt,nt={})=>{var st;const ot=new URLSearchParams;ot.set("name",rt),getTypes(nt.types).forEach(at=>{ot.append("type",RecordType[at])}),(st=nt.onProgress)==null||st.call(nt,new CustomProgressEvent("dns:query",{detail:rt}));const it=await tt.add(async()=>{var lt;const at=await fetch(`${et}?${ot}`,{headers:{accept:"application/dns-json"},signal:nt==null?void 0:nt.signal});if(at.status!==200)throw new Error(`Unexpected HTTP status: ${at.status} - ${at.statusText}`);const ct=toDNSResponse(await at.json());return(lt=nt.onProgress)==null||lt.call(nt,new CustomProgressEvent("dns:response",{detail:ct})),ct},{signal:nt.signal});if(it==null)throw new Error("No DNS response received");return it}}function defaultResolver(){return[dnsJsonOverHttps("https://cloudflare-dns.com/dns-query"),dnsJsonOverHttps("https://dns.google/resolve")]}var hashlru=function(et){if(!et)throw Error("hashlru must have a max value, of type number, greater than 0");var o=0,tt=Object.create(null),rt=Object.create(null);function nt(ot,it){tt[ot]=it,o++,o>=et&&(o=0,rt=tt,tt=Object.create(null))}return{has:function(ot){return tt[ot]!==void 0||rt[ot]!==void 0},remove:function(ot){tt[ot]!==void 0&&(tt[ot]=void 0),rt[ot]!==void 0&&(rt[ot]=void 0)},get:function(ot){var it=tt[ot];if(it!==void 0)return it;if((it=rt[ot])!==void 0)return nt(ot,it),it},set:function(ot,it){tt[ot]!==void 0?tt[ot]=it:nt(ot,it)},clear:function(){tt=Object.create(null),rt=Object.create(null)}}};const hashlru$1=getDefaultExportFromCjs(hashlru);class CachedAnswers{constructor(o){wt(this,"lru");this.lru=hashlru$1(o)}get(o,tt){let rt=!0;const nt=[];for(const ot of tt){const it=this.getAnswers(o,ot);if(it.length===0){rt=!1;break}nt.push(...it)}if(rt)return toDNSResponse({answers:nt})}getAnswers(o,tt){const rt=`${o.toLowerCase()}-${tt}`,nt=this.lru.get(rt);if(nt!=null){const ot=nt.filter(it=>it.expires>Date.now()).map(({expires:it,value:st})=>({...st,TTL:Math.round((it-Date.now())/1e3),type:RecordType[st.type]}));return ot.length===0&&this.lru.remove(rt),ot}return[]}add(o,tt){const rt=`${o.toLowerCase()}-${tt.type}`,nt=this.lru.get(rt)??[];nt.push({expires:Date.now()+(tt.TTL??DEFAULT_TTL)*1e3,value:tt}),this.lru.set(rt,nt)}remove(o,tt){const rt=`${o.toLowerCase()}-${tt}`;this.lru.remove(rt)}clear(){this.lru.clear()}}function cache$1(et){return new CachedAnswers(et)}const DEFAULT_ANSWER_CACHE_SIZE=1e3;class DNS{constructor(o){wt(this,"resolvers");wt(this,"cache");this.resolvers={},this.cache=cache$1(o.cacheSize??DEFAULT_ANSWER_CACHE_SIZE),Object.entries(o.resolvers??{}).forEach(([tt,rt])=>{Array.isArray(rt)||(rt=[rt]),tt.endsWith(".")||(tt=`${tt}.`),this.resolvers[tt]=rt}),this.resolvers["."]==null&&(this.resolvers["."]=defaultResolver())}async query(o,tt={}){var at,ct,lt;const rt=getTypes(tt.types),nt=tt.cached!==!1?this.cache.get(o,rt):void 0;if(nt!=null)return(at=tt.onProgress)==null||at.call(tt,new CustomProgressEvent("dns:cache",{detail:nt})),nt;const ot=`${o.split(".").pop()}.`,it=(this.resolvers[ot]??this.resolvers["."]).sort(()=>Math.random()>.5?-1:1),st=[];for(const dt of it){if(((ct=tt.signal)==null?void 0:ct.aborted)===!0)break;try{const ht=await dt(o,{...tt,types:rt});for(const mt of ht.Answer)this.cache.add(o,mt);return ht}catch(ht){st.push(ht),(lt=tt.onProgress)==null||lt.call(tt,new CustomProgressEvent("dns:error",{detail:ht}))}}throw st.length===1?st[0]:new AggregateError(st,`DNS lookup of ${o} ${rt} failed`)}}var RecordType;(function(et){et[et.A=1]="A",et[et.CNAME=5]="CNAME",et[et.TXT=16]="TXT",et[et.AAAA=28]="AAAA"})(RecordType||(RecordType={}));function dns(et={}){return new DNS(et)}const MAX_RECURSIVE_DEPTH=32,{code:dnsaddrCode}=getProtocol("dnsaddr");class RecursionLimitError extends Error{constructor(o="Max recursive depth reached"){super(o),this.name="RecursionLimitError"}}const dnsaddrResolver=async function(o,tt={}){const rt=tt.maxRecursiveDepth??MAX_RECURSIVE_DEPTH;if(rt===0)throw new RecursionLimitError("Max recursive depth reached");const[,nt]=o.stringTuples().find(([ct])=>ct===dnsaddrCode)??[],it=await((tt==null?void 0:tt.dns)??dns()).query(`_dnsaddr.${nt}`,{signal:tt==null?void 0:tt.signal,types:[RecordType.TXT]}),st=o.getPeerId(),at=[];for(const ct of it.Answer){const lt=ct.data.replace(/["']/g,"").trim().split("=")[1];if(lt==null||st!=null&&!lt.includes(st))continue;const dt=multiaddr(lt);if(lt.startsWith("/dnsaddr")){const ht=await dt.resolve({...tt,maxRecursiveDepth:rt-1});at.push(...ht.map(mt=>mt.toString()))}else at.push(dt.toString())}return at};var isPlainObj=et=>{if(Object.prototype.toString.call(et)!=="[object Object]")return!1;const o=Object.getPrototypeOf(et);return o===null||o===Object.prototype};const isOptionObject=isPlainObj,{hasOwnProperty:hasOwnProperty$1}=Object.prototype,{propertyIsEnumerable}=Object,defineProperty$1=(et,o,tt)=>Object.defineProperty(et,o,{value:tt,writable:!0,enumerable:!0,configurable:!0}),globalThis$1=commonjsGlobal,defaultMergeOptions={concatArrays:!1,ignoreUndefined:!1},getEnumerableOwnPropertyKeys=et=>{const o=[];for(const tt in et)hasOwnProperty$1.call(et,tt)&&o.push(tt);if(Object.getOwnPropertySymbols){const tt=Object.getOwnPropertySymbols(et);for(const rt of tt)propertyIsEnumerable.call(et,rt)&&o.push(rt)}return o};function clone(et){return Array.isArray(et)?cloneArray(et):isOptionObject(et)?cloneOptionObject(et):et}function cloneArray(et){const o=et.slice(0,0);return getEnumerableOwnPropertyKeys(et).forEach(tt=>{defineProperty$1(o,tt,clone(et[tt]))}),o}function cloneOptionObject(et){const o=Object.getPrototypeOf(et)===null?Object.create(null):{};return getEnumerableOwnPropertyKeys(et).forEach(tt=>{defineProperty$1(o,tt,clone(et[tt]))}),o}const mergeKeys=(et,o,tt,rt)=>(tt.forEach(nt=>{typeof o[nt]>"u"&&rt.ignoreUndefined||(nt in et&&et[nt]!==Object.getPrototypeOf(et)?defineProperty$1(et,nt,merge$1(et[nt],o[nt],rt)):defineProperty$1(et,nt,clone(o[nt])))}),et),concatArrays=(et,o,tt)=>{let rt=et.slice(0,0),nt=0;return[et,o].forEach(ot=>{const it=[];for(let st=0;st<ot.length;st++)hasOwnProperty$1.call(ot,st)&&(it.push(String(st)),ot===et?defineProperty$1(rt,nt++,ot[st]):defineProperty$1(rt,nt++,clone(ot[st])));rt=mergeKeys(rt,ot,getEnumerableOwnPropertyKeys(ot).filter(st=>!it.includes(st)),tt)}),rt};function merge$1(et,o,tt){return tt.concatArrays&&Array.isArray(et)&&Array.isArray(o)?concatArrays(et,o,tt):!isOptionObject(o)||!isOptionObject(et)?clone(o):mergeKeys(et,o,getEnumerableOwnPropertyKeys(o),tt)}var mergeOptions=function(...et){const o=merge$1(clone(defaultMergeOptions),this!==globalThis$1&&this||{},defaultMergeOptions);let tt={_:{}};for(const rt of et)if(rt!==void 0){if(!isOptionObject(rt))throw new TypeError("`"+rt+"` is not an Option Object");tt=merge$1(tt,{_:rt},o)}return tt._};const mergeOptions$1=getDefaultExportFromCjs(mergeOptions);var define_globalThis_process_env_default$1={};const DefaultConfig={addresses:{listen:[],announce:[],noAnnounce:[],announceFilter:et=>et},connectionManager:{resolvers:{dnsaddr:dnsaddrResolver}},transportManager:{faultTolerance:FaultTolerance.FATAL_ALL}};async function validateConfig(et){const o=mergeOptions$1(DefaultConfig,et);if(o.connectionProtector===null&&(define_globalThis_process_env_default$1==null?void 0:define_globalThis_process_env_default$1.LIBP2P_FORCE_PNET)!=null)throw new InvalidParametersError$1("Private network is enforced, but no protector was provided");return o}function coerce$8(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function base$8(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt<tt.length;rt++)tt[rt]=255;for(var nt=0;nt<et.length;nt++){var ot=et.charAt(nt),it=ot.charCodeAt(0);if(tt[it]!==255)throw new TypeError(ot+" is ambiguous");tt[it]=nt}var st=et.length,at=et.charAt(0),ct=Math.log(st)/Math.log(256),lt=Math.log(256)/Math.log(st);function dt(ft){if(ft instanceof Uint8Array||(ArrayBuffer.isView(ft)?ft=new Uint8Array(ft.buffer,ft.byteOffset,ft.byteLength):Array.isArray(ft)&&(ft=Uint8Array.from(ft))),!(ft instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(ft.length===0)return"";for(var pt=0,yt=0,gt=0,bt=ft.length;gt!==bt&&ft[gt]===0;)gt++,pt++;for(var xt=(bt-gt)*lt+1>>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct<yt)&&St!==-1;St--,Ct++)Et+=256*vt[St]>>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At<xt;++At)kt+=et.charAt(vt[At]);return kt}function ht(ft){if(typeof ft!="string")throw new TypeError("Expected String");if(ft.length===0)return new Uint8Array;var pt=0;if(ft[pt]!==" "){for(var yt=0,gt=0;ft[pt]===at;)yt++,pt++;for(var bt=(ft.length-pt)*ct+1>>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et<gt)&&Ct!==-1;Ct--,Et++)vt+=st*xt[Ct]>>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$9=base$8,_brrp__multiformats_scope_baseX$8=src$9;let Encoder$8=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$8=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$8(this,o)}},ComposedDecoder$8=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$8(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$8(et,o){return new ComposedDecoder$8({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$8=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$8(o,tt,rt),this.decoder=new Decoder$8(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$9({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$8(et,o,tt,rt)}function baseX$8({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$8(tt,et);return from$9({prefix:o,name:et,encode:rt,decode:ot=>coerce$8(nt(ot))})}function decode$o(et,o,tt,rt){const nt={};for(let lt=0;lt<o.length;++lt)nt[o[lt]]=lt;let ot=et.length;for(;et[ot-1]==="=";)--ot;const it=new Uint8Array(ot*tt/8|0);let st=0,at=0,ct=0;for(let lt=0;lt<ot;++lt){const dt=nt[et[lt]];if(dt===void 0)throw new SyntaxError(`Non-${rt} character`);at=at<<tt|dt,st+=tt,st>=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$j(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<<tt)-1;let ot="",it=0,st=0;for(let at=0;at<et.length;++at)for(st=st<<8|et[at],it+=8;it>tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<<tt-it]),rt)for(;ot.length*tt&7;)ot+="=";return ot}function rfc4648$7({name:et,prefix:o,bitsPerChar:tt,alphabet:rt}){return from$9({prefix:o,name:et,encode(nt){return encode$j(nt,rt,tt)},decode(nt){return decode$o(nt,rt,tt,et)}})}const base32$f=rfc4648$7({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5});rfc4648$7({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5});rfc4648$7({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5});rfc4648$7({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5});rfc4648$7({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5});rfc4648$7({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5});rfc4648$7({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5});rfc4648$7({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5});rfc4648$7({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});const base58btc$8=baseX$8({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"});baseX$8({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});const base64$e=rfc4648$7({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6});rfc4648$7({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6});rfc4648$7({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6});rfc4648$7({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});const s=1e3,m=s*60,h=m*60,d=h*24,w=d*7,y=d*365.25;function ms(et,o){try{if(typeof et=="string"&&et.length>0)return parse$3(et);if(typeof et=="number"&&isFinite(et))return o!=null&&o.long?fmtLong(et):fmtShort(et);throw new Error("Value is not a string or number.")}catch(tt){const rt=isError$1(tt)?`${tt.message}. value=${JSON.stringify(et)}`:"An unknown error has occured.";throw new Error(rt)}}function parse$3(et){if(et=String(et),et.length>100)throw new Error("Value exceeds the maximum length of 100 characters.");const o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(et);if(!o)return NaN;const tt=parseFloat(o[1]),rt=(o[2]||"ms").toLowerCase();switch(rt){case"years":case"year":case"yrs":case"yr":case"y":return tt*y;case"weeks":case"week":case"w":return tt*w;case"days":case"day":case"d":return tt*d;case"hours":case"hour":case"hrs":case"hr":case"h":return tt*h;case"minutes":case"minute":case"mins":case"min":case"m":return tt*m;case"seconds":case"second":case"secs":case"sec":case"s":return tt*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return tt;default:throw new Error(`The unit ${rt} was matched, but no matching case exists.`)}}function fmtShort(et){const o=Math.abs(et);return o>=d?`${Math.round(et/d)}d`:o>=h?`${Math.round(et/h)}h`:o>=m?`${Math.round(et/m)}m`:o>=s?`${Math.round(et/s)}s`:`${et}ms`}function fmtLong(et){const o=Math.abs(et);return o>=d?plural(et,o,d,"day"):o>=h?plural(et,o,h,"hour"):o>=m?plural(et,o,m,"minute"):o>=s?plural(et,o,s,"second"):`${et} ms`}function plural(et,o,tt,rt){const nt=o>=tt*1.5;return`${Math.round(et/tt)} ${rt}${nt?"s":""}`}function isError$1(et){return typeof et=="object"&&et!==null&&"message"in et}function setup(et){tt.debug=tt,tt.default=tt,tt.coerce=at,tt.disable=ot,tt.enable=nt,tt.enabled=it,tt.humanize=ms,tt.destroy=ct,Object.keys(et).forEach(lt=>{tt[lt]=et[lt]}),tt.names=[],tt.skips=[],tt.formatters={};function o(lt){let dt=0;for(let ht=0;ht<lt.length;ht++)dt=(dt<<5)-dt+lt.charCodeAt(ht),dt|=0;return tt.colors[Math.abs(dt)%tt.colors.length]}tt.selectColor=o;function tt(lt){let dt,ht=null,mt,ft;function pt(...yt){if(!pt.enabled)return;const gt=pt,bt=Number(new Date),xt=bt-(dt||bt);gt.diff=xt,gt.prev=dt,gt.curr=bt,dt=bt,yt[0]=tt.coerce(yt[0]),typeof yt[0]!="string"&&yt.unshift("%O");let vt=0;yt[0]=yt[0].replace(/%([a-zA-Z%])/g,(Ct,St)=>{if(Ct==="%%")return"%";vt++;const At=tt.formatters[St];if(typeof At=="function"){const kt=yt[vt];Ct=At.call(gt,kt),yt.splice(vt,1),vt--}return Ct}),tt.formatArgs.call(gt,yt),(gt.log||tt.log).apply(gt,yt)}return pt.namespace=lt,pt.useColors=tt.useColors(),pt.color=tt.selectColor(lt),pt.extend=rt,pt.destroy=tt.destroy,Object.defineProperty(pt,"enabled",{enumerable:!0,configurable:!1,get:()=>ht!==null?ht:(mt!==tt.namespaces&&(mt=tt.namespaces,ft=tt.enabled(lt)),ft),set:yt=>{ht=yt}}),typeof tt.init=="function"&&tt.init(pt),pt}function rt(lt,dt){const ht=tt(this.namespace+(typeof dt>"u"?":":dt)+lt);return ht.log=this.log,ht}function nt(lt){tt.save(lt),tt.namespaces=lt,tt.names=[],tt.skips=[];let dt;const ht=(typeof lt=="string"?lt:"").split(/[\s,]+/),mt=ht.length;for(dt=0;dt<mt;dt++)ht[dt]&&(lt=ht[dt].replace(/\*/g,".*?"),lt[0]==="-"?tt.skips.push(new RegExp("^"+lt.substr(1)+"$")):tt.names.push(new RegExp("^"+lt+"$")))}function ot(){const lt=[...tt.names.map(st),...tt.skips.map(st).map(dt=>"-"+dt)].join(",");return tt.enable(""),lt}function it(lt){if(lt[lt.length-1]==="*")return!0;let dt,ht;for(dt=0,ht=tt.skips.length;dt<ht;dt++)if(tt.skips[dt].test(lt))return!1;for(dt=0,ht=tt.names.length;dt<ht;dt++)if(tt.names[dt].test(lt))return!0;return!1}function st(lt){return lt.toString().substring(2,lt.toString().length-2).replace(/\.\*\?$/,"*")}function at(lt){return lt instanceof Error?lt.stack??lt.message:lt}function ct(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return tt.setupFormatters(tt.formatters),tt.enable(tt.load()),tt}var define_globalThis_process_env_default={};const storage=localstorage(),colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function useColors(){var et,o,tt,rt,nt;return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&((et=navigator.userAgent)==null?void 0:et.toLowerCase().match(/(edge|trident)\/(\d+)/))!=null?!1:typeof document<"u"&&((tt=(o=document.documentElement)==null?void 0:o.style)==null?void 0:tt.WebkitAppearance)||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&((rt=navigator.userAgent)==null?void 0:rt.toLowerCase().match(/firefox\/(\d+)/))!=null&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&((nt=navigator.userAgent)==null?void 0:nt.toLowerCase().match(/applewebkit\/(\d+)/))}function formatArgs(et){if(et[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+et[0]+(this.useColors?"%c ":" ")+"+"+ms(this.diff),!this.useColors)return;const o="color: "+this.color;et.splice(1,0,o,"color: inherit");let tt=0,rt=0;et[0].replace(/%[a-zA-Z%]/g,nt=>{nt!=="%%"&&(tt++,nt==="%c"&&(rt=tt))}),et.splice(rt,0,o)}const log$a=console.debug??console.log??(()=>{});function save(et){try{et?storage==null||storage.setItem("debug",et):storage==null||storage.removeItem("debug")}catch{}}function load$1(){let et;try{et=storage==null?void 0:storage.getItem("debug")}catch{}return!et&&typeof globalThis.process<"u"&&"env"in globalThis.process&&(et=define_globalThis_process_env_default.DEBUG),et}function localstorage(){try{return localStorage}catch{}}function setupFormatters(et){et.j=function(o){try{return JSON.stringify(o)}catch(tt){return"[UnexpectedJSONParseError]: "+tt.message}}}const weald=setup({formatArgs,save,load:load$1,useColors,setupFormatters,colors,storage,log:log$a});weald.formatters.b=et=>et==null?"undefined":base58btc$8.baseEncode(et);weald.formatters.t=et=>et==null?"undefined":base32$f.baseEncode(et);weald.formatters.m=et=>et==null?"undefined":base64$e.baseEncode(et);weald.formatters.p=et=>et==null?"undefined":et.toString();weald.formatters.c=et=>et==null?"undefined":et.toString();weald.formatters.k=et=>et==null?"undefined":et.toString();weald.formatters.a=et=>et==null?"undefined":et.toString();weald.formatters.e=et=>et==null?"undefined":notEmpty(et.stack)??notEmpty(et.message)??et.toString();function createDisabledLogger(et){const o=()=>{};return o.enabled=!1,o.color="",o.diff=0,o.log=()=>{},o.namespace=et,o.destroy=()=>!0,o.extend=()=>o,o}function defaultLogger(){return{forComponent(et){return logger$2(et)}}}function logger$2(et){let o=createDisabledLogger(`${et}:trace`);return weald.enabled(`${et}:trace`)&&weald.names.map(tt=>tt.toString()).find(tt=>tt.includes(":trace"))!=null&&(o=weald(`${et}:trace`)),Object.assign(weald(et),{error:weald(`${et}:error`),trace:o})}function notEmpty(et){if(et!=null&&(et=et.trim(),et.length!==0))return et}function coerce$7(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function base$7(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt<tt.length;rt++)tt[rt]=255;for(var nt=0;nt<et.length;nt++){var ot=et.charAt(nt),it=ot.charCodeAt(0);if(tt[it]!==255)throw new TypeError(ot+" is ambiguous");tt[it]=nt}var st=et.length,at=et.charAt(0),ct=Math.log(st)/Math.log(256),lt=Math.log(256)/Math.log(st);function dt(ft){if(ft instanceof Uint8Array||(ArrayBuffer.isView(ft)?ft=new Uint8Array(ft.buffer,ft.byteOffset,ft.byteLength):Array.isArray(ft)&&(ft=Uint8Array.from(ft))),!(ft instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(ft.length===0)return"";for(var pt=0,yt=0,gt=0,bt=ft.length;gt!==bt&&ft[gt]===0;)gt++,pt++;for(var xt=(bt-gt)*lt+1>>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct<yt)&&St!==-1;St--,Ct++)Et+=256*vt[St]>>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At<xt;++At)kt+=et.charAt(vt[At]);return kt}function ht(ft){if(typeof ft!="string")throw new TypeError("Expected String");if(ft.length===0)return new Uint8Array;var pt=0;if(ft[pt]!==" "){for(var yt=0,gt=0;ft[pt]===at;)yt++,pt++;for(var bt=(ft.length-pt)*ct+1>>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et<gt)&&Ct!==-1;Ct--,Et++)vt+=st*xt[Ct]>>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$8=base$7,_brrp__multiformats_scope_baseX$7=src$8;let Encoder$7=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$7=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$7(this,o)}},ComposedDecoder$7=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$7(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$7(et,o){return new ComposedDecoder$7({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$7=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$7(o,tt,rt),this.decoder=new Decoder$7(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$8({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$7(et,o,tt,rt)}function baseX$7({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$7(tt,et);return from$8({prefix:o,name:et,encode:rt,decode:ot=>coerce$7(nt(ot))})}const base58btc$7=baseX$7({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"});baseX$7({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var encode_1$1=encode$i,MSB$2=128,REST$2=127,MSBALL$1=~REST$2,INT$1=Math.pow(2,31);function encode$i(et,o,tt){o=o||[],tt=tt||0;for(var rt=tt;et>=INT$1;)o[tt++]=et&255|MSB$2,et/=128;for(;et&MSBALL$1;)o[tt++]=et&255|MSB$2,et>>>=7;return o[tt]=et|0,encode$i.bytes=tt-rt+1,o}var decode$n=read$2,MSB$1$1=128,REST$1$1=127;function read$2(et,rt){var tt=0,rt=rt||0,nt=0,ot=rt,it,st=et.length;do{if(ot>=st)throw read$2.bytes=0,new RangeError("Could not decode varint");it=et[ot++],tt+=nt<28?(it&REST$1$1)<<nt:(it&REST$1$1)*Math.pow(2,nt),nt+=7}while(it>=MSB$1$1);return read$2.bytes=ot-rt,tt}var N1$1=Math.pow(2,7),N2$1=Math.pow(2,14),N3$1=Math.pow(2,21),N4$1=Math.pow(2,28),N5$1=Math.pow(2,35),N6$1=Math.pow(2,42),N7$1=Math.pow(2,49),N8$1=Math.pow(2,56),N9$1=Math.pow(2,63),length$1=function(et){return et<N1$1?1:et<N2$1?2:et<N3$1?3:et<N4$1?4:et<N5$1?5:et<N6$1?6:et<N7$1?7:et<N8$1?8:et<N9$1?9:10},varint$1={encode:encode_1$1,decode:decode$n,encodingLength:length$1},_brrp_varint$1=varint$1;function decode$m(et,o=0){return[_brrp_varint$1.decode(et,o),_brrp_varint$1.decode.bytes]}function decode$l(et){const o=coerce$7(et),[tt,rt]=decode$m(o),[nt,ot]=decode$m(o.subarray(rt)),it=o.subarray(rt+ot);if(it.byteLength!==nt)throw new Error("Incorrect length");return new Digest$1(tt,nt,it,o)}let Digest$1=class{constructor(o,tt,rt,nt){wt(this,"code");wt(this,"size");wt(this,"digest");wt(this,"bytes");this.code=o,this.size=tt,this.digest=rt,this.bytes=nt}};function mapIterable(et,o){const tt={[Symbol.iterator]:()=>tt,next:()=>{const rt=et.next(),nt=rt.value;return rt.done===!0||nt==null?{done:!0,value:void 0}:{done:!1,value:o(nt)}}};return tt}function peerIdFromString(et){const o=decode$l(base58btc$7.decode(`z${et}`));return peerIdFromMultihash(o)}class PeerMap{constructor(o){wt(this,"map");if(this.map=new Map,o!=null)for(const[tt,rt]of o.entries())this.map.set(tt.toString(),{key:tt,value:rt})}[Symbol.iterator](){return this.entries()}clear(){this.map.clear()}delete(o){return this.map.delete(o.toString())}entries(){return mapIterable(this.map.entries(),o=>[o[1].key,o[1].value])}forEach(o){this.map.forEach((tt,rt)=>{o(tt.value,tt.key,this)})}get(o){var tt;return(tt=this.map.get(o.toString()))==null?void 0:tt.value}has(o){return this.map.has(o.toString())}set(o,tt){this.map.set(o.toString(),{key:o,value:tt})}keys(){return mapIterable(this.map.values(),o=>o.key)}values(){return mapIterable(this.map.values(),o=>o.value)}get size(){return this.map.size}}class PeerSet{constructor(o){wt(this,"set");if(this.set=new Set,o!=null)for(const tt of o)this.set.add(tt.toString())}get size(){return this.set.size}[Symbol.iterator](){return this.values()}add(o){this.set.add(o.toString())}clear(){this.set.clear()}delete(o){this.set.delete(o.toString())}entries(){return mapIterable(this.set.entries(),o=>{const tt=peerIdFromString(o[0]);return[tt,tt]})}forEach(o){this.set.forEach(tt=>{const rt=peerIdFromString(tt);o(rt,rt,this)})}has(o){return this.set.has(o.toString())}values(){return mapIterable(this.set.values(),o=>peerIdFromString(o))}intersection(o){const tt=new PeerSet;for(const rt of o)this.has(rt)&&tt.add(rt);return tt}difference(o){const tt=new PeerSet;for(const rt of this)o.has(rt)||tt.add(rt);return tt}union(o){const tt=new PeerSet;for(const rt of o)tt.add(rt);for(const rt of this)tt.add(rt);return tt}}var murmurHash3js={exports:{}};(function(et,o){(function(tt,rt){var nt={version:"3.0.0",x86:{},x64:{},inputValidation:!0};function ot(pt){if(!Array.isArray(pt)&&!ArrayBuffer.isView(pt))return!1;for(var yt=0;yt<pt.length;yt++)if(!Number.isInteger(pt[yt])||pt[yt]<0||pt[yt]>255)return!1;return!0}function it(pt,yt){return(pt&65535)*yt+(((pt>>>16)*yt&65535)<<16)}function st(pt,yt){return pt<<yt|pt>>>32-yt}function at(pt){return pt^=pt>>>16,pt=it(pt,2246822507),pt^=pt>>>13,pt=it(pt,3266489909),pt^=pt>>>16,pt}function ct(pt,yt){pt=[pt[0]>>>16,pt[0]&65535,pt[1]>>>16,pt[1]&65535],yt=[yt[0]>>>16,yt[0]&65535,yt[1]>>>16,yt[1]&65535];var gt=[0,0,0,0];return gt[3]+=pt[3]+yt[3],gt[2]+=gt[3]>>>16,gt[3]&=65535,gt[2]+=pt[2]+yt[2],gt[1]+=gt[2]>>>16,gt[2]&=65535,gt[1]+=pt[1]+yt[1],gt[0]+=gt[1]>>>16,gt[1]&=65535,gt[0]+=pt[0]+yt[0],gt[0]&=65535,[gt[0]<<16|gt[1],gt[2]<<16|gt[3]]}function lt(pt,yt){pt=[pt[0]>>>16,pt[0]&65535,pt[1]>>>16,pt[1]&65535],yt=[yt[0]>>>16,yt[0]&65535,yt[1]>>>16,yt[1]&65535];var gt=[0,0,0,0];return gt[3]+=pt[3]*yt[3],gt[2]+=gt[3]>>>16,gt[3]&=65535,gt[2]+=pt[2]*yt[3],gt[1]+=gt[2]>>>16,gt[2]&=65535,gt[2]+=pt[3]*yt[2],gt[1]+=gt[2]>>>16,gt[2]&=65535,gt[1]+=pt[1]*yt[3],gt[0]+=gt[1]>>>16,gt[1]&=65535,gt[1]+=pt[2]*yt[2],gt[0]+=gt[1]>>>16,gt[1]&=65535,gt[1]+=pt[3]*yt[1],gt[0]+=gt[1]>>>16,gt[1]&=65535,gt[0]+=pt[0]*yt[3]+pt[1]*yt[2]+pt[2]*yt[1]+pt[3]*yt[0],gt[0]&=65535,[gt[0]<<16|gt[1],gt[2]<<16|gt[3]]}function dt(pt,yt){return yt%=64,yt===32?[pt[1],pt[0]]:yt<32?[pt[0]<<yt|pt[1]>>>32-yt,pt[1]<<yt|pt[0]>>>32-yt]:(yt-=32,[pt[1]<<yt|pt[0]>>>32-yt,pt[0]<<yt|pt[1]>>>32-yt])}function ht(pt,yt){return yt%=64,yt===0?pt:yt<32?[pt[0]<<yt|pt[1]>>>32-yt,pt[1]<<yt]:[pt[1]<<yt-32,0]}function mt(pt,yt){return[pt[0]^yt[0],pt[1]^yt[1]]}function ft(pt){return pt=mt(pt,[0,pt[0]>>>1]),pt=lt(pt,[4283543511,3981806797]),pt=mt(pt,[0,pt[0]>>>1]),pt=lt(pt,[3301882366,444984403]),pt=mt(pt,[0,pt[0]>>>1]),pt}nt.x86.hash32=function(pt,yt){if(nt.inputValidation&&!ot(pt))return rt;yt=yt||0;for(var gt=pt.length%4,bt=pt.length-gt,xt=yt,vt=0,Et=3432918353,Ct=461845907,St=0;St<bt;St=St+4)vt=pt[St]|pt[St+1]<<8|pt[St+2]<<16|pt[St+3]<<24,vt=it(vt,Et),vt=st(vt,15),vt=it(vt,Ct),xt^=vt,xt=st(xt,13),xt=it(xt,5)+3864292196;switch(vt=0,gt){case 3:vt^=pt[St+2]<<16;case 2:vt^=pt[St+1]<<8;case 1:vt^=pt[St],vt=it(vt,Et),vt=st(vt,15),vt=it(vt,Ct),xt^=vt}return xt^=pt.length,xt=at(xt),xt>>>0},nt.x86.hash128=function(pt,yt){if(nt.inputValidation&&!ot(pt))return rt;yt=yt||0;for(var gt=pt.length%16,bt=pt.length-gt,xt=yt,vt=yt,Et=yt,Ct=yt,St=0,At=0,kt=0,It=0,Nt=597399067,Lt=2869860233,Mt=951274213,zt=2716044179,Ut=0;Ut<bt;Ut=Ut+16)St=pt[Ut]|pt[Ut+1]<<8|pt[Ut+2]<<16|pt[Ut+3]<<24,At=pt[Ut+4]|pt[Ut+5]<<8|pt[Ut+6]<<16|pt[Ut+7]<<24,kt=pt[Ut+8]|pt[Ut+9]<<8|pt[Ut+10]<<16|pt[Ut+11]<<24,It=pt[Ut+12]|pt[Ut+13]<<8|pt[Ut+14]<<16|pt[Ut+15]<<24,St=it(St,Nt),St=st(St,15),St=it(St,Lt),xt^=St,xt=st(xt,19),xt+=vt,xt=it(xt,5)+1444728091,At=it(At,Lt),At=st(At,16),At=it(At,Mt),vt^=At,vt=st(vt,17),vt+=Et,vt=it(vt,5)+197830471,kt=it(kt,Mt),kt=st(kt,17),kt=it(kt,zt),Et^=kt,Et=st(Et,15),Et+=Ct,Et=it(Et,5)+2530024501,It=it(It,zt),It=st(It,18),It=it(It,Nt),Ct^=It,Ct=st(Ct,13),Ct+=xt,Ct=it(Ct,5)+850148119;switch(St=0,At=0,kt=0,It=0,gt){case 15:It^=pt[Ut+14]<<16;case 14:It^=pt[Ut+13]<<8;case 13:It^=pt[Ut+12],It=it(It,zt),It=st(It,18),It=it(It,Nt),Ct^=It;case 12:kt^=pt[Ut+11]<<24;case 11:kt^=pt[Ut+10]<<16;case 10:kt^=pt[Ut+9]<<8;case 9:kt^=pt[Ut+8],kt=it(kt,Mt),kt=st(kt,17),kt=it(kt,zt),Et^=kt;case 8:At^=pt[Ut+7]<<24;case 7:At^=pt[Ut+6]<<16;case 6:At^=pt[Ut+5]<<8;case 5:At^=pt[Ut+4],At=it(At,Lt),At=st(At,16),At=it(At,Mt),vt^=At;case 4:St^=pt[Ut+3]<<24;case 3:St^=pt[Ut+2]<<16;case 2:St^=pt[Ut+1]<<8;case 1:St^=pt[Ut],St=it(St,Nt),St=st(St,15),St=it(St,Lt),xt^=St}return xt^=pt.length,vt^=pt.length,Et^=pt.length,Ct^=pt.length,xt+=vt,xt+=Et,xt+=Ct,vt+=xt,Et+=xt,Ct+=xt,xt=at(xt),vt=at(vt),Et=at(Et),Ct=at(Ct),xt+=vt,xt+=Et,xt+=Ct,vt+=xt,Et+=xt,Ct+=xt,("00000000"+(xt>>>0).toString(16)).slice(-8)+("00000000"+(vt>>>0).toString(16)).slice(-8)+("00000000"+(Et>>>0).toString(16)).slice(-8)+("00000000"+(Ct>>>0).toString(16)).slice(-8)},nt.x64.hash128=function(pt,yt){if(nt.inputValidation&&!ot(pt))return rt;yt=yt||0;for(var gt=pt.length%16,bt=pt.length-gt,xt=[0,yt],vt=[0,yt],Et=[0,0],Ct=[0,0],St=[2277735313,289559509],At=[1291169091,658871167],kt=0;kt<bt;kt=kt+16)Et=[pt[kt+4]|pt[kt+5]<<8|pt[kt+6]<<16|pt[kt+7]<<24,pt[kt]|pt[kt+1]<<8|pt[kt+2]<<16|pt[kt+3]<<24],Ct=[pt[kt+12]|pt[kt+13]<<8|pt[kt+14]<<16|pt[kt+15]<<24,pt[kt+8]|pt[kt+9]<<8|pt[kt+10]<<16|pt[kt+11]<<24],Et=lt(Et,St),Et=dt(Et,31),Et=lt(Et,At),xt=mt(xt,Et),xt=dt(xt,27),xt=ct(xt,vt),xt=ct(lt(xt,[0,5]),[0,1390208809]),Ct=lt(Ct,At),Ct=dt(Ct,33),Ct=lt(Ct,St),vt=mt(vt,Ct),vt=dt(vt,31),vt=ct(vt,xt),vt=ct(lt(vt,[0,5]),[0,944331445]);switch(Et=[0,0],Ct=[0,0],gt){case 15:Ct=mt(Ct,ht([0,pt[kt+14]],48));case 14:Ct=mt(Ct,ht([0,pt[kt+13]],40));case 13:Ct=mt(Ct,ht([0,pt[kt+12]],32));case 12:Ct=mt(Ct,ht([0,pt[kt+11]],24));case 11:Ct=mt(Ct,ht([0,pt[kt+10]],16));case 10:Ct=mt(Ct,ht([0,pt[kt+9]],8));case 9:Ct=mt(Ct,[0,pt[kt+8]]),Ct=lt(Ct,At),Ct=dt(Ct,33),Ct=lt(Ct,St),vt=mt(vt,Ct);case 8:Et=mt(Et,ht([0,pt[kt+7]],56));case 7:Et=mt(Et,ht([0,pt[kt+6]],48));case 6:Et=mt(Et,ht([0,pt[kt+5]],40));case 5:Et=mt(Et,ht([0,pt[kt+4]],32));case 4:Et=mt(Et,ht([0,pt[kt+3]],24));case 3:Et=mt(Et,ht([0,pt[kt+2]],16));case 2:Et=mt(Et,ht([0,pt[kt+1]],8));case 1:Et=mt(Et,[0,pt[kt]]),Et=lt(Et,St),Et=dt(Et,31),Et=lt(Et,At),xt=mt(xt,Et)}return xt=mt(xt,[0,pt.length]),vt=mt(vt,[0,pt.length]),xt=ct(xt,vt),vt=ct(vt,xt),xt=ft(xt),vt=ft(vt),xt=ct(xt,vt),vt=ct(vt,xt),("00000000"+(xt[0]>>>0).toString(16)).slice(-8)+("00000000"+(xt[1]>>>0).toString(16)).slice(-8)+("00000000"+(vt[0]>>>0).toString(16)).slice(-8)+("00000000"+(vt[1]>>>0).toString(16)).slice(-8)},et.exports&&(o=et.exports=nt),o.murmurHash3=nt})()})(murmurHash3js,murmurHash3js.exports);function alloc$2(et=0){return new Uint8Array(et)}function allocUnsafe$4(et=0){return new Uint8Array(et)}function coerce$6(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function fromString$b(et){return new TextEncoder().encode(et)}function toString$e(et){return new TextDecoder().decode(et)}function base$6(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt<tt.length;rt++)tt[rt]=255;for(var nt=0;nt<et.length;nt++){var ot=et.charAt(nt),it=ot.charCodeAt(0);if(tt[it]!==255)throw new TypeError(ot+" is ambiguous");tt[it]=nt}var st=et.length,at=et.charAt(0),ct=Math.log(st)/Math.log(256),lt=Math.log(256)/Math.log(st);function dt(ft){if(ft instanceof Uint8Array||(ArrayBuffer.isView(ft)?ft=new Uint8Array(ft.buffer,ft.byteOffset,ft.byteLength):Array.isArray(ft)&&(ft=Uint8Array.from(ft))),!(ft instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(ft.length===0)return"";for(var pt=0,yt=0,gt=0,bt=ft.length;gt!==bt&&ft[gt]===0;)gt++,pt++;for(var xt=(bt-gt)*lt+1>>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct<yt)&&St!==-1;St--,Ct++)Et+=256*vt[St]>>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At<xt;++At)kt+=et.charAt(vt[At]);return kt}function ht(ft){if(typeof ft!="string")throw new TypeError("Expected String");if(ft.length===0)return new Uint8Array;var pt=0;if(ft[pt]!==" "){for(var yt=0,gt=0;ft[pt]===at;)yt++,pt++;for(var bt=(ft.length-pt)*ct+1>>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et<gt)&&Ct!==-1;Ct--,Et++)vt+=st*xt[Ct]>>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$7=base$6,_brrp__multiformats_scope_baseX$6=src$7;let Encoder$6=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$6=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$6(this,o)}},ComposedDecoder$6=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$6(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$6(et,o){return new ComposedDecoder$6({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$6=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$6(o,tt,rt),this.decoder=new Decoder$6(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$7({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$6(et,o,tt,rt)}function baseX$6({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$6(tt,et);return from$7({prefix:o,name:et,encode:rt,decode:ot=>coerce$6(nt(ot))})}function decode$k(et,o,tt,rt){const nt={};for(let lt=0;lt<o.length;++lt)nt[o[lt]]=lt;let ot=et.length;for(;et[ot-1]==="=";)--ot;const it=new Uint8Array(ot*tt/8|0);let st=0,at=0,ct=0;for(let lt=0;lt<ot;++lt){const dt=nt[et[lt]];if(dt===void 0)throw new SyntaxError(`Non-${rt} character`);at=at<<tt|dt,st+=tt,st>=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$h(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<<tt)-1;let ot="",it=0,st=0;for(let at=0;at<et.length;++at)for(st=st<<8|et[at],it+=8;it>tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<<tt-it]),rt)for(;ot.length*tt&7;)ot+="=";return ot}function rfc4648$6({name:et,prefix:o,bitsPerChar:tt,alphabet:rt}){return from$7({prefix:o,name:et,encode(nt){return encode$h(nt,rt,tt)},decode(nt){return decode$k(nt,rt,tt,et)}})}const base10$a=baseX$6({prefix:"9",name:"base10",alphabet:"0123456789"}),base10$b=Object.freeze(Object.defineProperty({__proto__:null,base10:base10$a},Symbol.toStringTag,{value:"Module"})),base16$a=rfc4648$6({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper$5=rfc4648$6({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),base16$b=Object.freeze(Object.defineProperty({__proto__:null,base16:base16$a,base16upper:base16upper$5},Symbol.toStringTag,{value:"Module"})),base2$a=rfc4648$6({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),base2$b=Object.freeze(Object.defineProperty({__proto__:null,base2:base2$a},Symbol.toStringTag,{value:"Module"})),alphabet$5=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),alphabetBytesToChars$5=alphabet$5.reduce((et,o,tt)=>(et[tt]=o,et),[]),alphabetCharsToBytes$5=alphabet$5.reduce((et,o,tt)=>{const rt=o.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${o}`);return et[rt]=tt,et},[]);function encode$g(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars$5[tt],o),"")}function decode$j(et){const o=[];for(const tt of et){const rt=tt.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${tt}`);const nt=alphabetCharsToBytes$5[rt];if(nt==null)throw new Error(`Non-base256emoji character: ${tt}`);o.push(nt)}return new Uint8Array(o)}const base256emoji$a=from$7({prefix:"🚀",name:"base256emoji",encode:encode$g,decode:decode$j}),base256emoji$b=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:base256emoji$a},Symbol.toStringTag,{value:"Module"})),base32$d=rfc4648$6({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper$5=rfc4648$6({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad$5=rfc4648$6({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper$5=rfc4648$6({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex$5=rfc4648$6({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper$5=rfc4648$6({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad$5=rfc4648$6({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper$5=rfc4648$6({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z$5=rfc4648$6({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$e=Object.freeze(Object.defineProperty({__proto__:null,base32:base32$d,base32hex:base32hex$5,base32hexpad:base32hexpad$5,base32hexpadupper:base32hexpadupper$5,base32hexupper:base32hexupper$5,base32pad:base32pad$5,base32padupper:base32padupper$5,base32upper:base32upper$5,base32z:base32z$5},Symbol.toStringTag,{value:"Module"})),base36$b=baseX$6({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper$5=baseX$6({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$c=Object.freeze(Object.defineProperty({__proto__:null,base36:base36$b,base36upper:base36upper$5},Symbol.toStringTag,{value:"Module"})),base58btc$6=baseX$6({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr$5=baseX$6({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58$5=Object.freeze(Object.defineProperty({__proto__:null,base58btc:base58btc$6,base58flickr:base58flickr$5},Symbol.toStringTag,{value:"Module"})),base64$c=rfc4648$6({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad$5=rfc4648$6({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url$5=rfc4648$6({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad$5=rfc4648$6({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$d=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$c,base64pad:base64pad$5,base64url:base64url$5,base64urlpad:base64urlpad$5},Symbol.toStringTag,{value:"Module"})),base8$a=rfc4648$6({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$b=Object.freeze(Object.defineProperty({__proto__:null,base8:base8$a},Symbol.toStringTag,{value:"Module"})),identity$5=from$7({prefix:"\0",name:"identity",encode:et=>toString$e(et),decode:et=>fromString$b(et)}),identityBase$5=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$5},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const bases$5={...identityBase$5,...base2$b,...base8$b,...base10$b,...base16$b,...base32$e,...base36$c,...base58$5,...base64$d,...base256emoji$b};function createCodec$5(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$8=createCodec$5("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii$5=createCodec$5("ascii","a",et=>{let o="a";for(let tt=0;tt<et.length;tt++)o+=String.fromCharCode(et[tt]);return o},et=>{et=et.substring(1);const o=allocUnsafe$4(et.length);for(let tt=0;tt<et.length;tt++)o[tt]=et.charCodeAt(tt);return o}),BASES$5={utf8:string$8,"utf-8":string$8,hex:bases$5.base16,latin1:ascii$5,ascii:ascii$5,binary:ascii$5,...bases$5};function fromString$a(et,o="utf8"){const tt=BASES$5[o];if(tt==null)throw new Error(`Unsupported encoding "${o}"`);return tt.decoder.decode(`${tt.prefix}${et}`)}function equals$3(et,o){if(et===o)return!0;if(et.byteLength!==o.byteLength)return!1;for(let tt=0;tt<et.byteLength;tt++)if(et[tt]!==o[tt])return!1;return!0}const MAX_FINGERPRINT_SIZE=64;class Fingerprint{constructor(o,tt,rt,nt=2){wt(this,"fp");wt(this,"h");wt(this,"seed");if(nt>MAX_FINGERPRINT_SIZE)throw new TypeError("Invalid Fingerprint Size");const ot=tt.hashV(o,rt),it=alloc$2(nt);for(let st=0;st<it.length;st++)it[st]=ot[st];it.length===0&&(it[0]=7),this.fp=it,this.h=tt,this.seed=rt}hash(){return this.h.hash(this.fp,this.seed)}equals(o){return(o==null?void 0:o.fp)instanceof Uint8Array?equals$3(this.fp,o.fp):!1}}function getRandomInt(et,o){return Math.floor(Math.random()*(o-et))+et}class Bucket{constructor(o){wt(this,"contents");this.contents=new Array(o).fill(null)}has(o){if(!(o instanceof Fingerprint))throw new TypeError("Invalid Fingerprint");return this.contents.some(tt=>o.equals(tt))}add(o){if(!(o instanceof Fingerprint))throw new TypeError("Invalid Fingerprint");for(let tt=0;tt<this.contents.length;tt++)if(this.contents[tt]==null)return this.contents[tt]=o,!0;return!0}swap(o){if(!(o instanceof Fingerprint))throw new TypeError("Invalid Fingerprint");const tt=getRandomInt(0,this.contents.length-1),rt=this.contents[tt];return this.contents[tt]=o,rt}remove(o){if(!(o instanceof Fingerprint))throw new TypeError("Invalid Fingerprint");const tt=this.contents.findIndex(rt=>o.equals(rt));return tt>-1?(this.contents[tt]=null,!0):!1}}const FNV_PRIMES={32:16777619n,64:1099511628211n,128:309485009821345068724781371n,256:374144419156711147060143317175368453031918731002211n,512:35835915874844867368919076489095108449946327955754392558399825615420669938882575126094039892345713852759n,1024:5016456510113118655434598811035278955030765345404790744303017523831112055108147451509157692220295382716162651878526895249385292291816524375083746691371804094271873160484737966720260389217684476157468082573n},FNV_OFFSETS={32:2166136261n,64:14695981039346656037n,128:144066263297769815596495629667062367629n,256:100029257958052580907070968620625704837092796014241193945225284501741471925557n,512:9659303129496669498009435400716310466090418745672637896108374329434462657994582932197716438449813051892206539805784495328239340083876191928701583869517785n,1024:14197795064947621068722070641403218320880622795441933960878474914617582723252296732303717722150864096521202355549365628174669108571814760471015076148029755969804077320157692458563003215304957150157403644460363550505412711285966361610267868082893823963790439336411086884584107735010676915n},cachedEncoder=new globalThis.TextEncoder;function fnv1aUint8Array(et,o){const tt=FNV_PRIMES[o];let rt=FNV_OFFSETS[o];for(let nt=0;nt<et.length;nt++)rt^=BigInt(et[nt]),rt=BigInt.asUintN(o,rt*tt);return rt}function fnv1aEncodeInto(et,o,tt){if(tt.length===0)throw new Error("The `utf8Buffer` option must have a length greater than zero");const rt=FNV_PRIMES[o];let nt=FNV_OFFSETS[o],ot=et;for(;ot.length>0;){const it=cachedEncoder.encodeInto(ot,tt);ot=ot.slice(it.read);for(let st=0;st<it.written;st++)nt^=BigInt(tt[st]),nt=BigInt.asUintN(o,nt*rt)}return nt}function fnv1a$1(et,{size:o=32,utf8Buffer:tt}={}){if(!FNV_PRIMES[o])throw new Error("The `size` option must be one of 32, 64, 128, 256, 512, or 1024");if(typeof et=="string"){if(tt)return fnv1aEncodeInto(et,o,tt);et=cachedEncoder.encode(et)}return fnv1aUint8Array(et,o)}const fnv1a={hash:et=>Number(fnv1a$1(et,{size:32})),hashV:(et,o)=>numberToBuffer(fnv1a.hash(et,o))};function numberToBuffer(et){let o=et.toString(16);return o.length%2===1&&(o=`0${o}`),fromString$a(o,"base16")}const maxCuckooCount=500;class CuckooFilter{constructor(o){wt(this,"bucketSize");wt(this,"filterSize");wt(this,"fingerprintSize");wt(this,"buckets");wt(this,"count");wt(this,"hash");wt(this,"seed");this.filterSize=o.filterSize,this.bucketSize=o.bucketSize??4,this.fingerprintSize=o.fingerprintSize??2,this.count=0,this.buckets=[],this.hash=o.hash??fnv1a,this.seed=o.seed??getRandomInt(0,Math.pow(2,10))}add(o){typeof o=="string"&&(o=fromString$a(o));const tt=new Fingerprint(o,this.hash,this.seed,this.fingerprintSize),rt=this.hash.hash(o,this.seed)%this.filterSize,nt=(rt^tt.hash())%this.filterSize;if(this.buckets[rt]==null&&(this.buckets[rt]=new Bucket(this.bucketSize)),this.buckets[nt]==null&&(this.buckets[nt]=new Bucket(this.bucketSize)),this.buckets[rt].add(tt)||this.buckets[nt].add(tt))return this.count++,!0;const ot=[rt,nt];let it=ot[getRandomInt(0,ot.length-1)];this.buckets[it]==null&&(this.buckets[it]=new Bucket(this.bucketSize));for(let st=0;st<maxCuckooCount;st++){const at=this.buckets[it].swap(tt);if(at!=null&&(it=(it^at.hash())%this.filterSize,this.buckets[it]==null&&(this.buckets[it]=new Bucket(this.bucketSize)),this.buckets[it].add(at)))return this.count++,!0}return!1}has(o){var it,st;typeof o=="string"&&(o=fromString$a(o));const tt=new Fingerprint(o,this.hash,this.seed,this.fingerprintSize),rt=this.hash.hash(o,this.seed)%this.filterSize,nt=((it=this.buckets[rt])==null?void 0:it.has(tt))??!1;if(nt)return nt;const ot=(rt^tt.hash())%this.filterSize;return((st=this.buckets[ot])==null?void 0:st.has(tt))??!1}remove(o){var st,at;typeof o=="string"&&(o=fromString$a(o));const tt=new Fingerprint(o,this.hash,this.seed,this.fingerprintSize),rt=this.hash.hash(o,this.seed)%this.filterSize,nt=((st=this.buckets[rt])==null?void 0:st.remove(tt))??!1;if(nt)return this.count--,nt;const ot=(rt^tt.hash())%this.filterSize,it=((at=this.buckets[ot])==null?void 0:at.remove(tt))??!1;return it&&this.count--,it}get reliable(){return Math.floor(100*(this.count/this.filterSize))<=90}}const MAX_LOAD={1:.5,2:.84,4:.95,8:.98};function calculateBucketSize(et=.001){return et>.002?2:et>1e-5?4:8}function optimize(et,o=.001){const tt=calculateBucketSize(o),rt=MAX_LOAD[tt],nt=Math.round(et/rt),ot=Math.min(Math.ceil(Math.log2(1/o)+Math.log2(2*tt)),MAX_FINGERPRINT_SIZE);return{filterSize:nt,bucketSize:tt,fingerprintSize:ot}}class ScalableCuckooFilter{constructor(o){wt(this,"filterSize");wt(this,"bucketSize");wt(this,"fingerprintSize");wt(this,"scale");wt(this,"filterSeries");wt(this,"hash");wt(this,"seed");this.bucketSize=o.bucketSize??4,this.filterSize=o.filterSize??(1<<18)/this.bucketSize,this.fingerprintSize=o.fingerprintSize??2,this.scale=o.scale??2,this.hash=o.hash??fnv1a,this.seed=o.seed??getRandomInt(0,Math.pow(2,10)),this.filterSeries=[new CuckooFilter({filterSize:this.filterSize,bucketSize:this.bucketSize,fingerprintSize:this.fingerprintSize,hash:this.hash,seed:this.seed})]}add(o){if(typeof o=="string"&&(o=fromString$a(o)),this.has(o))return!0;let tt=this.filterSeries.find(rt=>rt.reliable);if(tt==null){const rt=this.filterSize*Math.pow(this.scale,this.filterSeries.length);tt=new CuckooFilter({filterSize:rt,bucketSize:this.bucketSize,fingerprintSize:this.fingerprintSize,hash:this.hash,seed:this.seed}),this.filterSeries.push(tt)}return tt.add(o)}has(o){typeof o=="string"&&(o=fromString$a(o));for(let tt=0;tt<this.filterSeries.length;tt++)if(this.filterSeries[tt].has(o))return!0;return!1}remove(o){typeof o=="string"&&(o=fromString$a(o));for(let tt=0;tt<this.filterSeries.length;tt++)if(this.filterSeries[tt].remove(o))return!0;return!1}get count(){return this.filterSeries.reduce((o,tt)=>o+tt.count,0)}}function createScalableCuckooFilter(et,o=.001,tt){return new ScalableCuckooFilter({...optimize(et,o)})}const peerIdSymbol=Symbol.for("@libp2p/peer-id");function isPeerId(et){return!!(et!=null&&et[peerIdSymbol])}class InvalidParametersError extends Error{constructor(o="Invalid parameters"){super(o),this.name="InvalidParametersError"}}wt(InvalidParametersError,"name","InvalidParametersError");const events={},observable=et=>{et.addEventListener("message",o=>{observable.dispatchEvent("message",et,o)}),et.port!=null&&et.port.addEventListener("message",o=>{observable.dispatchEvent("message",et,o)})};observable.addEventListener=(et,o)=>{events[et]==null&&(events[et]=[]),events[et].push(o)};observable.removeEventListener=(et,o)=>{events[et]!=null&&(events[et]=events[et].filter(tt=>tt===o))};observable.dispatchEvent=function(et,o,tt){events[et]!=null&&events[et].forEach(rt=>rt(o,tt))};const WORKER_REQUEST_READ_LOCK="lock:worker:request-read",WORKER_RELEASE_READ_LOCK="lock:worker:release-read",MASTER_GRANT_READ_LOCK="lock:master:grant-read",WORKER_REQUEST_WRITE_LOCK="lock:worker:request-write",WORKER_RELEASE_WRITE_LOCK="lock:worker:release-write",MASTER_GRANT_WRITE_LOCK="lock:master:grant-write",nanoid=(et=21)=>Math.random().toString().substring(2),handleWorkerLockRequest=(et,o,tt,rt,nt)=>(ot,it)=>{if(it.data.type!==tt)return;const st={type:it.data.type,name:it.data.name,identifier:it.data.identifier};et.dispatchEvent(new MessageEvent(o,{data:{name:st.name,handler:async()=>{ot.postMessage({type:nt,name:st.name,identifier:st.identifier}),await new Promise(at=>{const ct=lt=>{if((lt==null?void 0:lt.data)==null)return;const dt={type:lt.data.type,name:lt.data.name,identifier:lt.data.identifier};dt.type===rt&&dt.identifier===st.identifier&&(ot.removeEventListener("message",ct),at())};ot.addEventListener("message",ct)})}}}))},makeWorkerLockRequest=(et,o,tt,rt)=>async()=>{const nt=nanoid();return globalThis.postMessage({type:o,identifier:nt,name:et}),new Promise(ot=>{const it=st=>{if((st==null?void 0:st.data)==null)return;const at={type:st.data.type,identifier:st.data.identifier};at.type===tt&&at.identifier===nt&&(globalThis.removeEventListener("message",it),ot(()=>{globalThis.postMessage({type:rt,identifier:nt,name:et})}))};globalThis.addEventListener("message",it)})},defaultOptions$4={singleProcess:!1},impl=et=>{if(et=Object.assign({},defaultOptions$4,et),!!globalThis.document||et.singleProcess){const tt=new EventTarget;return observable.addEventListener("message",handleWorkerLockRequest(tt,"requestReadLock",WORKER_REQUEST_READ_LOCK,WORKER_RELEASE_READ_LOCK,MASTER_GRANT_READ_LOCK)),observable.addEventListener("message",handleWorkerLockRequest(tt,"requestWriteLock",WORKER_REQUEST_WRITE_LOCK,WORKER_RELEASE_WRITE_LOCK,MASTER_GRANT_WRITE_LOCK)),tt}return{isWorker:!0,readLock:tt=>makeWorkerLockRequest(tt,WORKER_REQUEST_READ_LOCK,MASTER_GRANT_READ_LOCK,WORKER_RELEASE_READ_LOCK),writeLock:tt=>makeWorkerLockRequest(tt,WORKER_REQUEST_WRITE_LOCK,MASTER_GRANT_WRITE_LOCK,WORKER_RELEASE_WRITE_LOCK)}},mutexes={};let implementation;async function createReleaseable(et,o){let tt;const rt=new Promise(nt=>{tt=nt});return et.add(async()=>pTimeout((async()=>{await new Promise(nt=>{tt(()=>{nt()})})})(),{milliseconds:o.timeout})),rt}const createMutex=(et,o)=>{if(implementation.isWorker===!0)return{readLock:implementation.readLock(et,o),writeLock:implementation.writeLock(et,o)};const tt=new PQueue({concurrency:1});let rt;return{async readLock(){if(rt!=null)return createReleaseable(rt,o);rt=new PQueue({concurrency:o.concurrency,autoStart:!1});const nt=rt,ot=createReleaseable(rt,o);return tt.add(async()=>{nt.start(),await nt.onIdle().then(()=>{rt===nt&&(rt=null)})}),ot},async writeLock(){return rt=null,createReleaseable(tt,o)}}},defaultOptions$3={name:"lock",concurrency:1/0,timeout:846e5,singleProcess:!1};function createMortice(et){const o=Object.assign({},defaultOptions$3,et);return implementation==null&&(implementation=impl(o),implementation.isWorker!==!0&&(implementation.addEventListener("requestReadLock",tt=>{mutexes[tt.data.name]!=null&&mutexes[tt.data.name].readLock().then(async rt=>tt.data.handler().finally(()=>{rt()}))}),implementation.addEventListener("requestWriteLock",async tt=>{mutexes[tt.data.name]!=null&&mutexes[tt.data.name].writeLock().then(async rt=>tt.data.handler().finally(()=>{rt()}))}))),mutexes[o.name]==null&&(mutexes[o.name]=createMutex(o.name,o)),mutexes[o.name]}function equals$2(et,o){if(et===o)return!0;if(et.byteLength!==o.byteLength)return!1;for(let tt=0;tt<et.byteLength;tt++)if(et[tt]!==o[tt])return!1;return!0}function coerce$5(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function base$5(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt<tt.length;rt++)tt[rt]=255;for(var nt=0;nt<et.length;nt++){var ot=et.charAt(nt),it=ot.charCodeAt(0);if(tt[it]!==255)throw new TypeError(ot+" is ambiguous");tt[it]=nt}var st=et.length,at=et.charAt(0),ct=Math.log(st)/Math.log(256),lt=Math.log(256)/Math.log(st);function dt(ft){if(ft instanceof Uint8Array||(ArrayBuffer.isView(ft)?ft=new Uint8Array(ft.buffer,ft.byteOffset,ft.byteLength):Array.isArray(ft)&&(ft=Uint8Array.from(ft))),!(ft instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(ft.length===0)return"";for(var pt=0,yt=0,gt=0,bt=ft.length;gt!==bt&&ft[gt]===0;)gt++,pt++;for(var xt=(bt-gt)*lt+1>>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct<yt)&&St!==-1;St--,Ct++)Et+=256*vt[St]>>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At<xt;++At)kt+=et.charAt(vt[At]);return kt}function ht(ft){if(typeof ft!="string")throw new TypeError("Expected String");if(ft.length===0)return new Uint8Array;var pt=0;if(ft[pt]!==" "){for(var yt=0,gt=0;ft[pt]===at;)yt++,pt++;for(var bt=(ft.length-pt)*ct+1>>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et<gt)&&Ct!==-1;Ct--,Et++)vt+=st*xt[Ct]>>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$6=base$5,_brrp__multiformats_scope_baseX$5=src$6;let Encoder$5=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$5=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$5(this,o)}},ComposedDecoder$5=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$5(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$5(et,o){return new ComposedDecoder$5({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$5=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$5(o,tt,rt),this.decoder=new Decoder$5(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$6({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$5(et,o,tt,rt)}function baseX$5({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$5(tt,et);return from$6({prefix:o,name:et,encode:rt,decode:ot=>coerce$5(nt(ot))})}function decode$i(et,o,tt,rt){const nt={};for(let lt=0;lt<o.length;++lt)nt[o[lt]]=lt;let ot=et.length;for(;et[ot-1]==="=";)--ot;const it=new Uint8Array(ot*tt/8|0);let st=0,at=0,ct=0;for(let lt=0;lt<ot;++lt){const dt=nt[et[lt]];if(dt===void 0)throw new SyntaxError(`Non-${rt} character`);at=at<<tt|dt,st+=tt,st>=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$f(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<<tt)-1;let ot="",it=0,st=0;for(let at=0;at<et.length;++at)for(st=st<<8|et[at],it+=8;it>tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<<tt-it]),rt)for(;ot.length*tt&7;)ot+="=";return ot}function rfc4648$5({name:et,prefix:o,bitsPerChar:tt,alphabet:rt}){return from$6({prefix:o,name:et,encode(nt){return encode$f(nt,rt,tt)},decode(nt){return decode$i(nt,rt,tt,et)}})}const base32$c=rfc4648$5({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5});rfc4648$5({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5});rfc4648$5({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5});rfc4648$5({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5});rfc4648$5({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5});rfc4648$5({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5});rfc4648$5({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5});rfc4648$5({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5});rfc4648$5({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});const base36$a=baseX$5({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"});baseX$5({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});const base58btc$5=baseX$5({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"});baseX$5({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var encode_1=encode$e,MSB=128,REST=127,MSBALL=~REST,INT=Math.pow(2,31);function encode$e(et,o,tt){o=o||[],tt=tt||0;for(var rt=tt;et>=INT;)o[tt++]=et&255|MSB,et/=128;for(;et&MSBALL;)o[tt++]=et&255|MSB,et>>>=7;return o[tt]=et|0,encode$e.bytes=tt-rt+1,o}var decode$h=read$1,MSB$1=128,REST$1=127;function read$1(et,rt){var tt=0,rt=rt||0,nt=0,ot=rt,it,st=et.length;do{if(ot>=st)throw read$1.bytes=0,new RangeError("Could not decode varint");it=et[ot++],tt+=nt<28?(it&REST$1)<<nt:(it&REST$1)*Math.pow(2,nt),nt+=7}while(it>=MSB$1);return read$1.bytes=ot-rt,tt}var N1=Math.pow(2,7),N2=Math.pow(2,14),N3=Math.pow(2,21),N4=Math.pow(2,28),N5=Math.pow(2,35),N6=Math.pow(2,42),N7=Math.pow(2,49),N8=Math.pow(2,56),N9=Math.pow(2,63),length=function(et){return et<N1?1:et<N2?2:et<N3?3:et<N4?4:et<N5?5:et<N6?6:et<N7?7:et<N8?8:et<N9?9:10},varint={encode:encode_1,decode:decode$h,encodingLength:length},_brrp_varint=varint;function decode$g(et,o=0){return[_brrp_varint.decode(et,o),_brrp_varint.decode.bytes]}function encodeTo(et,o,tt=0){return _brrp_varint.encode(et,o,tt),o}function encodingLength$2(et){return _brrp_varint.encodingLength(et)}function create$3(et,o){const tt=o.byteLength,rt=encodingLength$2(et),nt=rt+encodingLength$2(tt),ot=new Uint8Array(nt+tt);return encodeTo(et,ot,0),encodeTo(tt,ot,rt),ot.set(o,nt),new Digest(et,tt,o,ot)}function decode$f(et){const o=coerce$5(et),[tt,rt]=decode$g(o),[nt,ot]=decode$g(o.subarray(rt)),it=o.subarray(rt+ot);if(it.byteLength!==nt)throw new Error("Incorrect length");return new Digest(tt,nt,it,o)}function equals$1(et,o){if(et===o)return!0;{const tt=o;return et.code===tt.code&&et.size===tt.size&&tt.bytes instanceof Uint8Array&&equals$2(et.bytes,tt.bytes)}}class Digest{constructor(o,tt,rt,nt){wt(this,"code");wt(this,"size");wt(this,"digest");wt(this,"bytes");this.code=o,this.size=tt,this.digest=rt,this.bytes=nt}}function format(et,o){const{bytes:tt,version:rt}=et;switch(rt){case 0:return toStringV0(tt,baseCache(et),o??base58btc$5.encoder);default:return toStringV1(tt,baseCache(et),o??base32$c.encoder)}}const cache=new WeakMap;function baseCache(et){const o=cache.get(et);if(o==null){const tt=new Map;return cache.set(et,tt),tt}return o}var Bl;class CID{constructor(o,tt,rt,nt){wt(this,"code");wt(this,"version");wt(this,"multihash");wt(this,"bytes");wt(this,"/");wt(this,Bl,"CID");this.code=tt,this.version=o,this.multihash=rt,this.bytes=nt,this["/"]=nt}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{const{code:o,multihash:tt}=this;if(o!==DAG_PB_CODE)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(tt.code!==SHA_256_CODE)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return CID.createV0(tt)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{const{code:o,digest:tt}=this.multihash,rt=create$3(o,tt);return CID.createV1(this.code,rt)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(o){return CID.equals(this,o)}static equals(o,tt){const rt=tt;return rt!=null&&o.code===rt.code&&o.version===rt.version&&equals$1(o.multihash,rt.multihash)}toString(o){return format(this,o)}toJSON(){return{"/":format(this)}}link(){return this}[(Bl=Symbol.toStringTag,Symbol.for("nodejs.util.inspect.custom"))](){return`CID(${this.toString()})`}static asCID(o){if(o==null)return null;const tt=o;if(tt instanceof CID)return tt;if(tt["/"]!=null&&tt["/"]===tt.bytes||tt.asCID===tt){const{version:rt,code:nt,multihash:ot,bytes:it}=tt;return new CID(rt,nt,ot,it??encodeCID(rt,nt,ot.bytes))}else if(tt[cidSymbol]===!0){const{version:rt,multihash:nt,code:ot}=tt,it=decode$f(nt);return CID.create(rt,ot,it)}else return null}static create(o,tt,rt){if(typeof tt!="number")throw new Error("String codecs are no longer supported");if(!(rt.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(o){case 0:{if(tt!==DAG_PB_CODE)throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE}) block encoding`);return new CID(o,tt,rt,rt.bytes)}case 1:{const nt=encodeCID(o,tt,rt.bytes);return new CID(o,tt,rt,nt)}default:throw new Error("Invalid version")}}static createV0(o){return CID.create(0,DAG_PB_CODE,o)}static createV1(o,tt){return CID.create(1,o,tt)}static decode(o){const[tt,rt]=CID.decodeFirst(o);if(rt.length!==0)throw new Error("Incorrect length");return tt}static decodeFirst(o){const tt=CID.inspectBytes(o),rt=tt.size-tt.multihashSize,nt=coerce$5(o.subarray(rt,rt+tt.multihashSize));if(nt.byteLength!==tt.multihashSize)throw new Error("Incorrect length");const ot=nt.subarray(tt.multihashSize-tt.digestSize),it=new Digest(tt.multihashCode,tt.digestSize,ot,nt);return[tt.version===0?CID.createV0(it):CID.createV1(tt.codec,it),o.subarray(tt.size)]}static inspectBytes(o){let tt=0;const rt=()=>{const[dt,ht]=decode$g(o.subarray(tt));return tt+=ht,dt};let nt=rt(),ot=DAG_PB_CODE;if(nt===18?(nt=0,tt=0):ot=rt(),nt!==0&&nt!==1)throw new RangeError(`Invalid CID version ${nt}`);const it=tt,st=rt(),at=rt(),ct=tt+at,lt=ct-it;return{version:nt,codec:ot,multihashCode:st,digestSize:at,multihashSize:lt,size:ct}}static parse(o,tt){const[rt,nt]=parseCIDtoBytes(o,tt),ot=CID.decode(nt);if(ot.version===0&&o[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return baseCache(ot).set(rt,o),ot}}function parseCIDtoBytes(et,o){switch(et[0]){case"Q":{const tt=o??base58btc$5;return[base58btc$5.prefix,tt.decode(`${base58btc$5.prefix}${et}`)]}case base58btc$5.prefix:{const tt=o??base58btc$5;return[base58btc$5.prefix,tt.decode(et)]}case base32$c.prefix:{const tt=o??base32$c;return[base32$c.prefix,tt.decode(et)]}case base36$a.prefix:{const tt=o??base36$a;return[base36$a.prefix,tt.decode(et)]}default:{if(o==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[et[0],o.decode(et)]}}}function toStringV0(et,o,tt){const{prefix:rt}=tt;if(rt!==base58btc$5.prefix)throw Error(`Cannot string encode V0 in ${tt.name} encoding`);const nt=o.get(rt);if(nt==null){const ot=tt.encode(et).slice(1);return o.set(rt,ot),ot}else return nt}function toStringV1(et,o,tt){const{prefix:rt}=tt,nt=o.get(rt);if(nt==null){const ot=tt.encode(et);return o.set(rt,ot),ot}else return nt}const DAG_PB_CODE=112,SHA_256_CODE=18;function encodeCID(et,o,tt){const rt=encodingLength$2(et),nt=rt+encodingLength$2(o),ot=new Uint8Array(nt+tt.byteLength);return encodeTo(et,ot,0),encodeTo(o,ot,rt),ot.set(tt,nt),ot}const cidSymbol=Symbol.for("@ipld/js-cid/CID");function equals(et,o){if(et===o)return!0;if(et.byteLength!==o.byteLength)return!1;for(let tt=0;tt<et.byteLength;tt++)if(et[tt]!==o[tt])return!1;return!0}function alloc$1(et=0){return new Uint8Array(et)}var Peer;(function(et){(function(tt){let rt;tt.codec=()=>(rt==null&&(rt=message$1((nt,ot,it={})=>{it.lengthDelimited!==!1&&ot.fork(),nt.key!=null&&nt.key!==""&&(ot.uint32(10),ot.string(nt.key)),nt.value!=null&&nt.value.byteLength>0&&(ot.uint32(18),ot.bytes(nt.value)),it.lengthDelimited!==!1&&ot.ldelim()},(nt,ot,it={})=>{const st={key:"",value:alloc$1(0)},at=ot==null?nt.len:nt.pos+ot;for(;nt.pos<at;){const ct=nt.uint32();switch(ct>>>3){case 1:{st.key=nt.string();break}case 2:{st.value=nt.bytes();break}default:{nt.skipType(ct&7);break}}}return st})),rt),tt.encode=nt=>encodeMessage(nt,tt.codec()),tt.decode=(nt,ot)=>decodeMessage(nt,tt.codec(),ot)})(et.Peer$metadataEntry||(et.Peer$metadataEntry={})),function(tt){let rt;tt.codec=()=>(rt==null&&(rt=message$1((nt,ot,it={})=>{it.lengthDelimited!==!1&&ot.fork(),nt.key!=null&&nt.key!==""&&(ot.uint32(10),ot.string(nt.key)),nt.value!=null&&(ot.uint32(18),Tag.codec().encode(nt.value,ot)),it.lengthDelimited!==!1&&ot.ldelim()},(nt,ot,it={})=>{var ct;const st={key:""},at=ot==null?nt.len:nt.pos+ot;for(;nt.pos<at;){const lt=nt.uint32();switch(lt>>>3){case 1:{st.key=nt.string();break}case 2:{st.value=Tag.codec().decode(nt,nt.uint32(),{limits:(ct=it.limits)==null?void 0:ct.value});break}default:{nt.skipType(lt&7);break}}}return st})),rt),tt.encode=nt=>encodeMessage(nt,tt.codec()),tt.decode=(nt,ot)=>decodeMessage(nt,tt.codec(),ot)}(et.Peer$tagsEntry||(et.Peer$tagsEntry={}));let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{if(nt.lengthDelimited!==!1&&rt.fork(),tt.addresses!=null)for(const ot of tt.addresses)rt.uint32(10),Address.codec().encode(ot,rt);if(tt.protocols!=null)for(const ot of tt.protocols)rt.uint32(18),rt.string(ot);if(tt.publicKey!=null&&(rt.uint32(34),rt.bytes(tt.publicKey)),tt.peerRecordEnvelope!=null&&(rt.uint32(42),rt.bytes(tt.peerRecordEnvelope)),tt.metadata!=null&&tt.metadata.size!==0)for(const[ot,it]of tt.metadata.entries())rt.uint32(50),et.Peer$metadataEntry.codec().encode({key:ot,value:it},rt);if(tt.tags!=null&&tt.tags.size!==0)for(const[ot,it]of tt.tags.entries())rt.uint32(58),et.Peer$tagsEntry.codec().encode({key:ot,value:it},rt);nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st,at,ct,lt,dt,ht;const ot={addresses:[],protocols:[],metadata:new Map,tags:new Map},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const mt=tt.uint32();switch(mt>>>3){case 1:{if(((st=nt.limits)==null?void 0:st.addresses)!=null&&ot.addresses.length===nt.limits.addresses)throw new MaxLengthError('Decode error - map field "addresses" had too many elements');ot.addresses.push(Address.codec().decode(tt,tt.uint32(),{limits:(at=nt.limits)==null?void 0:at.addresses$}));break}case 2:{if(((ct=nt.limits)==null?void 0:ct.protocols)!=null&&ot.protocols.length===nt.limits.protocols)throw new MaxLengthError('Decode error - map field "protocols" had too many elements');ot.protocols.push(tt.string());break}case 4:{ot.publicKey=tt.bytes();break}case 5:{ot.peerRecordEnvelope=tt.bytes();break}case 6:{if(((lt=nt.limits)==null?void 0:lt.metadata)!=null&&ot.metadata.size===nt.limits.metadata)throw new MaxSizeError('Decode error - map field "metadata" had too many elements');const ft=et.Peer$metadataEntry.codec().decode(tt,tt.uint32());ot.metadata.set(ft.key,ft.value);break}case 7:{if(((dt=nt.limits)==null?void 0:dt.tags)!=null&&ot.tags.size===nt.limits.tags)throw new MaxSizeError('Decode error - map field "tags" had too many elements');const ft=et.Peer$tagsEntry.codec().decode(tt,tt.uint32(),{limits:{value:(ht=nt.limits)==null?void 0:ht.tags$value}});ot.tags.set(ft.key,ft.value);break}default:{tt.skipType(mt&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(Peer||(Peer={}));var Address;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.multiaddr!=null&&tt.multiaddr.byteLength>0&&(rt.uint32(10),rt.bytes(tt.multiaddr)),tt.isCertified!=null&&(rt.uint32(16),rt.bool(tt.isCertified)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{const ot={multiaddr:alloc$1(0)},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const st=tt.uint32();switch(st>>>3){case 1:{ot.multiaddr=tt.bytes();break}case 2:{ot.isCertified=tt.bool();break}default:{tt.skipType(st&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(Address||(Address={}));var Tag;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.value!=null&&tt.value!==0&&(rt.uint32(8),rt.uint32(tt.value)),tt.expiry!=null&&(rt.uint32(16),rt.uint64(tt.expiry)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{const ot={value:0},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos<it;){const st=tt.uint32();switch(st>>>3){case 1:{ot.value=tt.uint32();break}case 2:{ot.expiry=tt.uint64();break}default:{tt.skipType(st&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(Tag||(Tag={}));function bytesToPeer(et,o){const tt=Peer.decode(o);if(tt.publicKey!=null&&et.publicKey==null){const ot=publicKeyFromProtobuf(tt.publicKey);et=peerIdFromPublicKey(ot)}const rt=new Map,nt=BigInt(Date.now());for(const[ot,it]of tt.tags.entries())it.expiry!=null&&it.expiry<nt||rt.set(ot,it);return{...tt,id:et,addresses:tt.addresses.map(({multiaddr:ot,isCertified:it})=>({multiaddr:multiaddr(ot),isCertified:it??!1})),metadata:tt.metadata,peerRecordEnvelope:tt.peerRecordEnvelope??void 0,tags:rt}}function coerce$4(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function fromString$9(et){return new TextEncoder().encode(et)}function toString$d(et){return new TextDecoder().decode(et)}function base$4(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt<tt.length;rt++)tt[rt]=255;for(var nt=0;nt<et.length;nt++){var ot=et.charAt(nt),it=ot.charCodeAt(0);if(tt[it]!==255)throw new TypeError(ot+" is ambiguous");tt[it]=nt}var st=et.length,at=et.charAt(0),ct=Math.log(st)/Math.log(256),lt=Math.log(256)/Math.log(st);function dt(ft){if(ft instanceof Uint8Array||(ArrayBuffer.isView(ft)?ft=new Uint8Array(ft.buffer,ft.byteOffset,ft.byteLength):Array.isArray(ft)&&(ft=Uint8Array.from(ft))),!(ft instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(ft.length===0)return"";for(var pt=0,yt=0,gt=0,bt=ft.length;gt!==bt&&ft[gt]===0;)gt++,pt++;for(var xt=(bt-gt)*lt+1>>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct<yt)&&St!==-1;St--,Ct++)Et+=256*vt[St]>>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At<xt;++At)kt+=et.charAt(vt[At]);return kt}function ht(ft){if(typeof ft!="string")throw new TypeError("Expected String");if(ft.length===0)return new Uint8Array;var pt=0;if(ft[pt]!==" "){for(var yt=0,gt=0;ft[pt]===at;)yt++,pt++;for(var bt=(ft.length-pt)*ct+1>>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et<gt)&&Ct!==-1;Ct--,Et++)vt+=st*xt[Ct]>>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$5=base$4,_brrp__multiformats_scope_baseX$4=src$5;let Encoder$4=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$4=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$4(this,o)}},ComposedDecoder$4=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$4(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$4(et,o){return new ComposedDecoder$4({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$4=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$4(o,tt,rt),this.decoder=new Decoder$4(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$5({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$4(et,o,tt,rt)}function baseX$4({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$4(tt,et);return from$5({prefix:o,name:et,encode:rt,decode:ot=>coerce$4(nt(ot))})}function decode$e(et,o,tt,rt){const nt={};for(let lt=0;lt<o.length;++lt)nt[o[lt]]=lt;let ot=et.length;for(;et[ot-1]==="=";)--ot;const it=new Uint8Array(ot*tt/8|0);let st=0,at=0,ct=0;for(let lt=0;lt<ot;++lt){const dt=nt[et[lt]];if(dt===void 0)throw new SyntaxError(`Non-${rt} character`);at=at<<tt|dt,st+=tt,st>=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$d(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<<tt)-1;let ot="",it=0,st=0;for(let at=0;at<et.length;++at)for(st=st<<8|et[at],it+=8;it>tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<<tt-it]),rt)for(;ot.length*tt&7;)ot+="=";return ot}function rfc4648$4({name:et,prefix:o,bitsPerChar:tt,alphabet:rt}){return from$5({prefix:o,name:et,encode(nt){return encode$d(nt,rt,tt)},decode(nt){return decode$e(nt,rt,tt,et)}})}const base10$8=baseX$4({prefix:"9",name:"base10",alphabet:"0123456789"}),base10$9=Object.freeze(Object.defineProperty({__proto__:null,base10:base10$8},Symbol.toStringTag,{value:"Module"})),base16$8=rfc4648$4({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper$4=rfc4648$4({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),base16$9=Object.freeze(Object.defineProperty({__proto__:null,base16:base16$8,base16upper:base16upper$4},Symbol.toStringTag,{value:"Module"})),base2$8=rfc4648$4({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),base2$9=Object.freeze(Object.defineProperty({__proto__:null,base2:base2$8},Symbol.toStringTag,{value:"Module"})),alphabet$4=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),alphabetBytesToChars$4=alphabet$4.reduce((et,o,tt)=>(et[tt]=o,et),[]),alphabetCharsToBytes$4=alphabet$4.reduce((et,o,tt)=>{const rt=o.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${o}`);return et[rt]=tt,et},[]);function encode$c(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars$4[tt],o),"")}function decode$d(et){const o=[];for(const tt of et){const rt=tt.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${tt}`);const nt=alphabetCharsToBytes$4[rt];if(nt==null)throw new Error(`Non-base256emoji character: ${tt}`);o.push(nt)}return new Uint8Array(o)}const base256emoji$8=from$5({prefix:"🚀",name:"base256emoji",encode:encode$c,decode:decode$d}),base256emoji$9=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:base256emoji$8},Symbol.toStringTag,{value:"Module"})),base32$a=rfc4648$4({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper$4=rfc4648$4({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad$4=rfc4648$4({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper$4=rfc4648$4({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex$4=rfc4648$4({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper$4=rfc4648$4({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad$4=rfc4648$4({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper$4=rfc4648$4({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z$4=rfc4648$4({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$b=Object.freeze(Object.defineProperty({__proto__:null,base32:base32$a,base32hex:base32hex$4,base32hexpad:base32hexpad$4,base32hexpadupper:base32hexpadupper$4,base32hexupper:base32hexupper$4,base32pad:base32pad$4,base32padupper:base32padupper$4,base32upper:base32upper$4,base32z:base32z$4},Symbol.toStringTag,{value:"Module"})),base36$8=baseX$4({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper$4=baseX$4({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$9=Object.freeze(Object.defineProperty({__proto__:null,base36:base36$8,base36upper:base36upper$4},Symbol.toStringTag,{value:"Module"})),base58btc$4=baseX$4({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr$4=baseX$4({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58$4=Object.freeze(Object.defineProperty({__proto__:null,base58btc:base58btc$4,base58flickr:base58flickr$4},Symbol.toStringTag,{value:"Module"})),base64$a=rfc4648$4({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad$4=rfc4648$4({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url$4=rfc4648$4({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad$4=rfc4648$4({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$b=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$a,base64pad:base64pad$4,base64url:base64url$4,base64urlpad:base64urlpad$4},Symbol.toStringTag,{value:"Module"})),base8$8=rfc4648$4({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$9=Object.freeze(Object.defineProperty({__proto__:null,base8:base8$8},Symbol.toStringTag,{value:"Module"})),identity$4=from$5({prefix:"\0",name:"identity",encode:et=>toString$d(et),decode:et=>fromString$9(et)}),identityBase$4=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$4},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const bases$4={...identityBase$4,...base2$9,...base8$9,...base10$9,...base16$9,...base32$b,...base36$9,...base58$4,...base64$b,...base256emoji$9};function allocUnsafe$3(et=0){return new Uint8Array(et)}function createCodec$4(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$7=createCodec$4("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii$4=createCodec$4("ascii","a",et=>{let o="a";for(let tt=0;tt<et.length;tt++)o+=String.fromCharCode(et[tt]);return o},et=>{et=et.substring(1);const o=allocUnsafe$3(et.length);for(let tt=0;tt<et.length;tt++)o[tt]=et.charCodeAt(tt);return o}),BASES$4={utf8:string$7,"utf-8":string$7,hex:bases$4.base16,latin1:ascii$4,ascii:ascii$4,binary:ascii$4,...bases$4};function fromString$8(et,o="utf8"){const tt=BASES$4[o];if(tt==null)throw new Error(`Unsupported encoding "${o}"`);return tt.decoder.decode(`${tt.prefix}${et}`)}function toString$c(et,o="utf8"){const tt=BASES$4[o];if(tt==null)throw new Error(`Unsupported encoding "${o}"`);return tt.encoder.encode(et).substring(1)}const pathSepS="/",pathSepB=new TextEncoder().encode(pathSepS),pathSep=pathSepB[0];class Key{constructor(o,tt){wt(this,"_buf");if(typeof o=="string")this._buf=fromString$8(o);else if(o instanceof Uint8Array)this._buf=o;else throw new Error("Invalid key, should be String of Uint8Array");if(tt==null&&(tt=!0),tt&&this.clean(),this._buf.byteLength===0||this._buf[0]!==pathSep)throw new Error("Invalid key")}toString(o="utf8"){return toString$c(this._buf,o)}uint8Array(){return this._buf}get[Symbol.toStringTag](){return`Key(${this.toString()})`}static withNamespaces(o){return new Key(o.join(pathSepS))}static random(){return new Key(Math.random().toString().substring(2))}static asKey(o){return o instanceof Uint8Array||typeof o=="string"?new Key(o):typeof o.uint8Array=="function"?new Key(o.uint8Array()):null}clean(){if((this._buf==null||this._buf.byteLength===0)&&(this._buf=pathSepB),this._buf[0]!==pathSep){const o=new Uint8Array(this._buf.byteLength+1);o.fill(pathSep,0,1),o.set(this._buf,1),this._buf=o}for(;this._buf.byteLength>1&&this._buf[this._buf.byteLength-1]===pathSep;)this._buf=this._buf.subarray(0,-1)}less(o){const tt=this.list(),rt=o.list();for(let nt=0;nt<tt.length;nt++){if(rt.length<nt+1)return!1;const ot=tt[nt],it=rt[nt];if(ot<it)return!0;if(ot>it)return!1}return tt.length<rt.length}reverse(){return Key.withNamespaces(this.list().slice().reverse())}namespaces(){return this.list()}baseNamespace(){const o=this.namespaces();return o[o.length-1]}list(){return this.toString().split(pathSepS).slice(1)}type(){return namespaceType(this.baseNamespace())}name(){return namespaceValue(this.baseNamespace())}instance(o){return new Key(this.toString()+":"+o)}path(){let o=this.parent().toString();return o.endsWith(pathSepS)||(o+=pathSepS),o+=this.type(),new Key(o)}parent(){const o=this.list();return o.length===1?new Key(pathSepS):new Key(o.slice(0,-1).join(pathSepS))}child(o){return this.toString()===pathSepS?o:o.toString()===pathSepS?this:new Key(this.toString()+o.toString(),!1)}isAncestorOf(o){return o.toString()===this.toString()?!1:o.toString().startsWith(this.toString())}isDecendantOf(o){return o.toString()===this.toString()?!1:this.toString().startsWith(o.toString())}isTopLevel(){return this.list().length===1}concat(...o){return Key.withNamespaces([...this.namespaces(),...flatten(o.map(tt=>tt.namespaces()))])}}function namespaceType(et){const o=et.split(":");return o.length<2?"":o.slice(0,-1).join(":")}function namespaceValue(et){const o=et.split(":");return o[o.length-1]}function flatten(et){return[].concat(...et)}const NAMESPACE_COMMON="/peers/";function peerIdToDatastoreKey(et){if(!isPeerId(et)||et.type==null)throw new InvalidParametersError("Invalid PeerId");const o=et.toCID().toString();return new Key(`${NAMESPACE_COMMON}${o}`)}async function dedupeFilterAndSortAddresses(et,o,tt){const rt=new Map;for(const nt of tt){if(nt==null)continue;if(nt.multiaddr instanceof Uint8Array&&(nt.multiaddr=multiaddr(nt.multiaddr)),!isMultiaddr(nt.multiaddr))throw new InvalidParametersError("Multiaddr was invalid");if(!await o(et,nt.multiaddr))continue;const ot=nt.isCertified??!1,it=nt.multiaddr.toString(),st=rt.get(it);st!=null?nt.isCertified=st.isCertified||ot:rt.set(it,{multiaddr:nt.multiaddr,isCertified:ot})}return[...rt.values()].sort((nt,ot)=>nt.multiaddr.toString().localeCompare(ot.multiaddr.toString())).map(({isCertified:nt,multiaddr:ot})=>({isCertified:nt,multiaddr:ot.bytes}))}async function toPeerPB(et,o,tt,rt){if(o==null)throw new InvalidParametersError("Invalid PeerData");if(o.publicKey!=null&&et.publicKey!=null&&!o.publicKey.equals(et.publicKey))throw new InvalidParametersError("publicKey bytes do not match peer id publicKey bytes");const nt=rt.existingPeer;if(nt!=null&&!et.equals(nt.id))throw new InvalidParametersError("peer id did not match existing peer id");let ot=(nt==null?void 0:nt.addresses)??[],it=new Set((nt==null?void 0:nt.protocols)??[]),st=(nt==null?void 0:nt.metadata)??new Map,at=(nt==null?void 0:nt.tags)??new Map,ct=nt==null?void 0:nt.peerRecordEnvelope;if(tt==="patch"){if((o.multiaddrs!=null||o.addresses!=null)&&(ot=[],o.multiaddrs!=null&&ot.push(...o.multiaddrs.map(ht=>({isCertified:!1,multiaddr:ht}))),o.addresses!=null&&ot.push(...o.addresses)),o.protocols!=null&&(it=new Set(o.protocols)),o.metadata!=null){const ht=o.metadata instanceof Map?[...o.metadata.entries()]:Object.entries(o.metadata);st=createSortedMap(ht,{validate:validateMetadata})}if(o.tags!=null){const ht=o.tags instanceof Map?[...o.tags.entries()]:Object.entries(o.tags);at=createSortedMap(ht,{validate:validateTag,map:mapTag})}o.peerRecordEnvelope!=null&&(ct=o.peerRecordEnvelope)}if(tt==="merge"){if(o.multiaddrs!=null&&ot.push(...o.multiaddrs.map(ht=>({isCertified:!1,multiaddr:ht}))),o.addresses!=null&&ot.push(...o.addresses),o.protocols!=null&&(it=new Set([...it,...o.protocols])),o.metadata!=null){const ht=o.metadata instanceof Map?[...o.metadata.entries()]:Object.entries(o.metadata);for(const[mt,ft]of ht)ft==null?st.delete(mt):st.set(mt,ft);st=createSortedMap([...st.entries()],{validate:validateMetadata})}if(o.tags!=null){const ht=o.tags instanceof Map?[...o.tags.entries()]:Object.entries(o.tags),mt=new Map(at);for(const[ft,pt]of ht)pt==null?mt.delete(ft):mt.set(ft,pt);at=createSortedMap([...mt.entries()],{validate:validateTag,map:mapTag})}o.peerRecordEnvelope!=null&&(ct=o.peerRecordEnvelope)}let lt;(nt==null?void 0:nt.id.publicKey)!=null?lt=publicKeyToProtobuf(nt.id.publicKey):o.publicKey!=null?lt=publicKeyToProtobuf(o.publicKey):et.publicKey!=null&&(lt=publicKeyToProtobuf(et.publicKey));const dt={addresses:await dedupeFilterAndSortAddresses(et,rt.addressFilter??(async()=>!0),ot),protocols:[...it.values()].sort((ht,mt)=>ht.localeCompare(mt)),metadata:st,tags:at,publicKey:lt,peerRecordEnvelope:ct};return et.type!=="RSA"&&delete dt.publicKey,dt}function createSortedMap(et,o){var rt;const tt=new Map;for(const[nt,ot]of et)ot!=null&&o.validate(nt,ot);for(const[nt,ot]of et.sort(([it],[st])=>it.localeCompare(st)))ot!=null&&tt.set(nt,((rt=o.map)==null?void 0:rt.call(o,nt,ot))??ot);return tt}function validateMetadata(et,o){if(typeof et!="string")throw new InvalidParametersError("Metadata key must be a string");if(!(o instanceof Uint8Array))throw new InvalidParametersError("Metadata value must be a Uint8Array")}function validateTag(et,o){if(typeof et!="string")throw new InvalidParametersError("Tag name must be a string");if(o.value!=null){if(parseInt(`${o.value}`,10)!==o.value)throw new InvalidParametersError("Tag value must be an integer");if(o.value<0||o.value>100)throw new InvalidParametersError("Tag value must be between 0-100")}if(o.ttl!=null){if(parseInt(`${o.ttl}`,10)!==o.ttl)throw new InvalidParametersError("Tag ttl must be an integer");if(o.ttl<0)throw new InvalidParametersError("Tag ttl must be between greater than 0")}}function mapTag(et,o){let tt;return o.expiry!=null&&(tt=o.expiry),o.ttl!=null&&(tt=BigInt(Date.now()+Number(o.ttl))),{value:o.value??0,expiry:tt}}function decodePeer(et,o,tt){const rt=et.toString().split("/")[2],nt=CID.parse(rt,base32$c),ot=peerIdFromCID(nt),it=tt.get(ot);if(it!=null)return it;const st=bytesToPeer(ot,o);return tt.set(ot,st),st}function mapQuery(et,o){return et==null?{}:{prefix:NAMESPACE_COMMON,filters:(et.filters??[]).map(tt=>({key:rt,value:nt})=>tt(decodePeer(rt,nt,o))),orders:(et.orders??[]).map(tt=>(rt,nt)=>tt(decodePeer(rt.key,rt.value,o),decodePeer(nt.key,nt.value,o)))}}var rn,ns,os;class PersistentStore{constructor(o,tt={}){fr(this,rn);wt(this,"peerId");wt(this,"datastore");wt(this,"lock");wt(this,"addressFilter");this.peerId=o.peerId,this.datastore=o.datastore,this.addressFilter=tt.addressFilter,this.lock=createMortice({name:"peer-store",singleProcess:!0})}async has(o){return this.datastore.has(peerIdToDatastoreKey(o))}async delete(o){if(this.peerId.equals(o))throw new InvalidParametersError("Cannot delete self peer");await this.datastore.delete(peerIdToDatastoreKey(o))}async load(o){const tt=await this.datastore.get(peerIdToDatastoreKey(o));return bytesToPeer(o,tt)}async save(o,tt){const{existingBuf:rt,existingPeer:nt}=await mr(this,rn,ns).call(this,o),ot=await toPeerPB(o,tt,"patch",{addressFilter:this.addressFilter});return mr(this,rn,os).call(this,o,ot,rt,nt)}async patch(o,tt){const{existingBuf:rt,existingPeer:nt}=await mr(this,rn,ns).call(this,o),ot=await toPeerPB(o,tt,"patch",{addressFilter:this.addressFilter,existingPeer:nt});return mr(this,rn,os).call(this,o,ot,rt,nt)}async merge(o,tt){const{existingBuf:rt,existingPeer:nt}=await mr(this,rn,ns).call(this,o),ot=await toPeerPB(o,tt,"merge",{addressFilter:this.addressFilter,existingPeer:nt});return mr(this,rn,os).call(this,o,ot,rt,nt)}async*all(o){const tt=new PeerMap;for await(const{key:rt,value:nt}of this.datastore.query(mapQuery(o??{},tt))){const ot=decodePeer(rt,nt,tt);ot.id.equals(this.peerId)||(yield ot)}}}rn=new WeakSet,ns=async function(o){try{const tt=await this.datastore.get(peerIdToDatastoreKey(o)),rt=bytesToPeer(o,tt);return{existingBuf:tt,existingPeer:rt}}catch(tt){if(tt.name!=="NotFoundError")throw tt}return{}},os=async function(o,tt,rt,nt){const ot=Peer.encode(tt);return rt!=null&&equals(ot,rt)?{peer:bytesToPeer(o,ot),previous:nt,updated:!1}:(await this.datastore.put(peerIdToDatastoreKey(o),ot),{peer:bytesToPeer(o,ot),previous:nt,updated:!0})};var Fl,no,is;Fl=Symbol.toStringTag;class PersistentPeerStore{constructor(o,tt={}){fr(this,no);wt(this,"store");wt(this,"events");wt(this,"peerId");wt(this,"log");wt(this,Fl,"@libp2p/peer-store");this.log=o.logger.forComponent("libp2p:peer-store"),this.events=o.events,this.peerId=o.peerId,this.store=new PersistentStore(o,tt)}async forEach(o,tt){this.log.trace("forEach await read lock");const rt=await this.store.lock.readLock();this.log.trace("forEach got read lock");try{for await(const nt of this.store.all(tt))o(nt)}finally{this.log.trace("forEach release read lock"),rt()}}async all(o){this.log.trace("all await read lock");const tt=await this.store.lock.readLock();this.log.trace("all got read lock");try{return await all$2(this.store.all(o))}finally{this.log.trace("all release read lock"),tt()}}async delete(o){this.log.trace("delete await write lock");const tt=await this.store.lock.writeLock();this.log.trace("delete got write lock");try{await this.store.delete(o)}finally{this.log.trace("delete release write lock"),tt()}}async has(o){this.log.trace("has await read lock");const tt=await this.store.lock.readLock();this.log.trace("has got read lock");try{return await this.store.has(o)}finally{this.log.trace("has release read lock"),tt()}}async get(o){this.log.trace("get await read lock");const tt=await this.store.lock.readLock();this.log.trace("get got read lock");try{return await this.store.load(o)}finally{this.log.trace("get release read lock"),tt()}}async save(o,tt){this.log.trace("save await write lock");const rt=await this.store.lock.writeLock();this.log.trace("save got write lock");try{const nt=await this.store.save(o,tt);return mr(this,no,is).call(this,o,nt),nt.peer}finally{this.log.trace("save release write lock"),rt()}}async patch(o,tt){this.log.trace("patch await write lock");const rt=await this.store.lock.writeLock();this.log.trace("patch got write lock");try{const nt=await this.store.patch(o,tt);return mr(this,no,is).call(this,o,nt),nt.peer}finally{this.log.trace("patch release write lock"),rt()}}async merge(o,tt){this.log.trace("merge await write lock");const rt=await this.store.lock.writeLock();this.log.trace("merge got write lock");try{const nt=await this.store.merge(o,tt);return mr(this,no,is).call(this,o,nt),nt.peer}finally{this.log.trace("merge release write lock"),rt()}}async consumePeerRecord(o,tt){const rt=await RecordEnvelope.openAndCertify(o,PeerRecord.DOMAIN),nt=peerIdFromCID(rt.publicKey.toCID());if((tt==null?void 0:tt.equals(nt))===!1)return this.log("envelope peer id was not the expected peer id - expected: %p received: %p",tt,nt),!1;const ot=PeerRecord.createFromProtobuf(rt.payload);let it;try{it=await this.get(nt)}catch(st){if(st.name!=="NotFoundError")throw st}if((it==null?void 0:it.peerRecordEnvelope)!=null){const st=await RecordEnvelope.createFromProtobuf(it.peerRecordEnvelope),at=PeerRecord.createFromProtobuf(st.payload);if(at.seqNumber>=ot.seqNumber)return this.log("sequence number was lower or equal to existing sequence number - stored: %d received: %d",at.seqNumber,ot.seqNumber),!1}return await this.patch(ot.peerId,{peerRecordEnvelope:o,addresses:ot.multiaddrs.map(st=>({isCertified:!0,multiaddr:st}))}),!0}}no=new WeakSet,is=function(o,tt){tt.updated&&(this.peerId.equals(o)?this.events.safeDispatchEvent("self:peer:update",{detail:tt}):this.events.safeDispatchEvent("peer:update",{detail:tt}))};function persistentPeerStore(et,o={}){return new PersistentPeerStore(et,o)}const On=class On extends Error{constructor(tt="Not Found"){super(tt);wt(this,"name",On.name);wt(this,"code",On.code)}};wt(On,"name","NotFoundError"),wt(On,"code","ERR_NOT_FOUND");let NotFoundError=On;function peekable(et){const[o,tt]=et[Symbol.asyncIterator]!=null?[et[Symbol.asyncIterator](),Symbol.asyncIterator]:[et[Symbol.iterator](),Symbol.iterator],rt=[];return{peek:()=>o.next(),push:nt=>{rt.push(nt)},next:()=>rt.length>0?{done:!1,value:rt.shift()}:o.next(),[tt](){return this}}}function isAsyncIterable$2(et){return et[Symbol.asyncIterator]!=null}function filter(et,o){let tt=0;if(isAsyncIterable$2(et))return async function*(){for await(const at of et)await o(at,tt++)&&(yield at)}();const rt=peekable(et),{value:nt,done:ot}=rt.next();if(ot===!0)return function*(){}();const it=o(nt,tt++);if(typeof it.then=="function")return async function*(){await it&&(yield nt);for await(const at of rt)await o(at,tt++)&&(yield at)}();const st=o;return function*(){it===!0&&(yield nt);for(const at of rt)st(at,tt++)&&(yield at)}()}function isAsyncIterable$1(et){return et[Symbol.asyncIterator]!=null}function sort(et,o){return isAsyncIterable$1(et)?async function*(){yield*(await all$2(et)).sort(o)}():function*(){yield*all$2(et).sort(o)}()}function isAsyncIterable(et){return et[Symbol.asyncIterator]!=null}function take(et,o){return isAsyncIterable(et)?async function*(){let tt=0;if(!(o<1)){for await(const rt of et)if(yield rt,tt++,tt===o)return}}():function*(){let tt=0;if(!(o<1)){for(const rt of et)if(yield rt,tt++,tt===o)return}}()}class BaseDatastore{put(o,tt,rt){return Promise.reject(new Error(".put is not implemented"))}get(o,tt){return Promise.reject(new Error(".get is not implemented"))}has(o,tt){return Promise.reject(new Error(".has is not implemented"))}delete(o,tt){return Promise.reject(new Error(".delete is not implemented"))}async*putMany(o,tt={}){for await(const{key:rt,value:nt}of o)await this.put(rt,nt,tt),yield rt}async*getMany(o,tt={}){for await(const rt of o)yield{key:rt,value:await this.get(rt,tt)}}async*deleteMany(o,tt={}){for await(const rt of o)await this.delete(rt,tt),yield rt}batch(){let o=[],tt=[];return{put(rt,nt){o.push({key:rt,value:nt})},delete(rt){tt.push(rt)},commit:async rt=>{await drain(this.putMany(o,rt)),o=[],await drain(this.deleteMany(tt,rt)),tt=[]}}}async*_all(o,tt){throw new Error("._all is not implemented")}async*_allKeys(o,tt){throw new Error("._allKeys is not implemented")}query(o,tt){let rt=this._all(o,tt);if(o.prefix!=null){const nt=o.prefix;rt=filter(rt,ot=>ot.key.toString().startsWith(nt))}if(Array.isArray(o.filters)&&(rt=o.filters.reduce((nt,ot)=>filter(nt,ot),rt)),Array.isArray(o.orders)&&(rt=o.orders.reduce((nt,ot)=>sort(nt,ot),rt)),o.offset!=null){let nt=0;const ot=o.offset;rt=filter(rt,()=>nt++>=ot)}return o.limit!=null&&(rt=take(rt,o.limit)),rt}queryKeys(o,tt){let rt=this._allKeys(o,tt);if(o.prefix!=null){const nt=o.prefix;rt=filter(rt,ot=>ot.toString().startsWith(nt))}if(Array.isArray(o.filters)&&(rt=o.filters.reduce((nt,ot)=>filter(nt,ot),rt)),Array.isArray(o.orders)&&(rt=o.orders.reduce((nt,ot)=>sort(nt,ot),rt)),o.offset!=null){const nt=o.offset;let ot=0;rt=filter(rt,()=>ot++>=nt)}return o.limit!=null&&(rt=take(rt,o.limit)),rt}}class MemoryDatastore extends BaseDatastore{constructor(){super();wt(this,"data");this.data=new Map}put(tt,rt){return this.data.set(tt.toString(),rt),tt}get(tt){const rt=this.data.get(tt.toString());if(rt==null)throw new NotFoundError;return rt}has(tt){return this.data.has(tt.toString())}delete(tt){this.data.delete(tt.toString())}*_all(){for(const[tt,rt]of this.data.entries())yield{key:new Key(tt),value:rt}}*_allKeys(){for(const tt of this.data.keys())yield new Key(tt)}}function allocUnsafe$2(et=0){return new Uint8Array(et)}function asUint8Array(et){return et}function concat(et,o){o==null&&(o=et.reduce((nt,ot)=>nt+ot.length,0));const tt=allocUnsafe$2(o);let rt=0;for(const nt of et)tt.set(nt,rt),rt+=nt.length;return tt}function coerce$3(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function fromString$7(et){return new TextEncoder().encode(et)}function toString$b(et){return new TextDecoder().decode(et)}function base$3(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt<tt.length;rt++)tt[rt]=255;for(var nt=0;nt<et.length;nt++){var ot=et.charAt(nt),it=ot.charCodeAt(0);if(tt[it]!==255)throw new TypeError(ot+" is ambiguous");tt[it]=nt}var st=et.length,at=et.charAt(0),ct=Math.log(st)/Math.log(256),lt=Math.log(256)/Math.log(st);function dt(ft){if(ft instanceof Uint8Array||(ArrayBuffer.isView(ft)?ft=new Uint8Array(ft.buffer,ft.byteOffset,ft.byteLength):Array.isArray(ft)&&(ft=Uint8Array.from(ft))),!(ft instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(ft.length===0)return"";for(var pt=0,yt=0,gt=0,bt=ft.length;gt!==bt&&ft[gt]===0;)gt++,pt++;for(var xt=(bt-gt)*lt+1>>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct<yt)&&St!==-1;St--,Ct++)Et+=256*vt[St]>>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At<xt;++At)kt+=et.charAt(vt[At]);return kt}function ht(ft){if(typeof ft!="string")throw new TypeError("Expected String");if(ft.length===0)return new Uint8Array;var pt=0;if(ft[pt]!==" "){for(var yt=0,gt=0;ft[pt]===at;)yt++,pt++;for(var bt=(ft.length-pt)*ct+1>>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et<gt)&&Ct!==-1;Ct--,Et++)vt+=st*xt[Ct]>>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$4=base$3,_brrp__multiformats_scope_baseX$3=src$4;let Encoder$3=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$3=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$3(this,o)}},ComposedDecoder$3=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$3(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$3(et,o){return new ComposedDecoder$3({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$3=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$3(o,tt,rt),this.decoder=new Decoder$3(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$4({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$3(et,o,tt,rt)}function baseX$3({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$3(tt,et);return from$4({prefix:o,name:et,encode:rt,decode:ot=>coerce$3(nt(ot))})}function decode$c(et,o,tt,rt){const nt={};for(let lt=0;lt<o.length;++lt)nt[o[lt]]=lt;let ot=et.length;for(;et[ot-1]==="=";)--ot;const it=new Uint8Array(ot*tt/8|0);let st=0,at=0,ct=0;for(let lt=0;lt<ot;++lt){const dt=nt[et[lt]];if(dt===void 0)throw new SyntaxError(`Non-${rt} character`);at=at<<tt|dt,st+=tt,st>=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$b(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<<tt)-1;let ot="",it=0,st=0;for(let at=0;at<et.length;++at)for(st=st<<8|et[at],it+=8;it>tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<<tt-it]),rt)for(;ot.length*tt&7;)ot+="=";return ot}function rfc4648$3({name:et,prefix:o,bitsPerChar:tt,alphabet:rt}){return from$4({prefix:o,name:et,encode(nt){return encode$b(nt,rt,tt)},decode(nt){return decode$c(nt,rt,tt,et)}})}const base10$6=baseX$3({prefix:"9",name:"base10",alphabet:"0123456789"}),base10$7=Object.freeze(Object.defineProperty({__proto__:null,base10:base10$6},Symbol.toStringTag,{value:"Module"})),base16$6=rfc4648$3({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper$3=rfc4648$3({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),base16$7=Object.freeze(Object.defineProperty({__proto__:null,base16:base16$6,base16upper:base16upper$3},Symbol.toStringTag,{value:"Module"})),base2$6=rfc4648$3({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),base2$7=Object.freeze(Object.defineProperty({__proto__:null,base2:base2$6},Symbol.toStringTag,{value:"Module"})),alphabet$3=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),alphabetBytesToChars$3=alphabet$3.reduce((et,o,tt)=>(et[tt]=o,et),[]),alphabetCharsToBytes$3=alphabet$3.reduce((et,o,tt)=>{const rt=o.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${o}`);return et[rt]=tt,et},[]);function encode$a(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars$3[tt],o),"")}function decode$b(et){const o=[];for(const tt of et){const rt=tt.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${tt}`);const nt=alphabetCharsToBytes$3[rt];if(nt==null)throw new Error(`Non-base256emoji character: ${tt}`);o.push(nt)}return new Uint8Array(o)}const base256emoji$6=from$4({prefix:"🚀",name:"base256emoji",encode:encode$a,decode:decode$b}),base256emoji$7=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:base256emoji$6},Symbol.toStringTag,{value:"Module"})),base32$8=rfc4648$3({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper$3=rfc4648$3({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad$3=rfc4648$3({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper$3=rfc4648$3({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex$3=rfc4648$3({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper$3=rfc4648$3({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad$3=rfc4648$3({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper$3=rfc4648$3({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z$3=rfc4648$3({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$9=Object.freeze(Object.defineProperty({__proto__:null,base32:base32$8,base32hex:base32hex$3,base32hexpad:base32hexpad$3,base32hexpadupper:base32hexpadupper$3,base32hexupper:base32hexupper$3,base32pad:base32pad$3,base32padupper:base32padupper$3,base32upper:base32upper$3,base32z:base32z$3},Symbol.toStringTag,{value:"Module"})),base36$6=baseX$3({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper$3=baseX$3({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$7=Object.freeze(Object.defineProperty({__proto__:null,base36:base36$6,base36upper:base36upper$3},Symbol.toStringTag,{value:"Module"})),base58btc$3=baseX$3({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr$3=baseX$3({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58$3=Object.freeze(Object.defineProperty({__proto__:null,base58btc:base58btc$3,base58flickr:base58flickr$3},Symbol.toStringTag,{value:"Module"})),base64$8=rfc4648$3({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad$3=rfc4648$3({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url$3=rfc4648$3({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad$3=rfc4648$3({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$9=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$8,base64pad:base64pad$3,base64url:base64url$3,base64urlpad:base64urlpad$3},Symbol.toStringTag,{value:"Module"})),base8$6=rfc4648$3({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$7=Object.freeze(Object.defineProperty({__proto__:null,base8:base8$6},Symbol.toStringTag,{value:"Module"})),identity$3=from$4({prefix:"\0",name:"identity",encode:et=>toString$b(et),decode:et=>fromString$7(et)}),identityBase$3=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$3},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const bases$3={...identityBase$3,...base2$7,...base8$7,...base10$7,...base16$7,...base32$9,...base36$7,...base58$3,...base64$9,...base256emoji$7};function createCodec$3(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$6=createCodec$3("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii$3=createCodec$3("ascii","a",et=>{let o="a";for(let tt=0;tt<et.length;tt++)o+=String.fromCharCode(et[tt]);return o},et=>{et=et.substring(1);const o=allocUnsafe$2(et.length);for(let tt=0;tt<et.length;tt++)o[tt]=et.charCodeAt(tt);return o}),BASES$3={utf8:string$6,"utf-8":string$6,hex:bases$3.base16,latin1:ascii$3,ascii:ascii$3,binary:ascii$3,...bases$3};function fromString$6(et,o="utf8"){const tt=BASES$3[o];if(tt==null)throw new Error(`Unsupported encoding "${o}"`);return tt.decoder.decode(`${tt.prefix}${et}`)}function debounce(et,o){let tt;return function(){const rt=function(){tt=void 0,et()};clearTimeout(tt),tt=setTimeout(rt,o)}}const defaultAddressFilter=et=>et;function stripPeerId(et,o){const tt=et.getPeerId();return tt!=null&&peerIdFromString$1(tt).equals(o)&&(et=et.decapsulate(multiaddr(`/p2p/${o.toString()}`))),et}var Ul;Ul=Symbol.toStringTag;class DefaultAddressManager{constructor(o,tt={}){wt(this,"log");wt(this,"components");wt(this,"listen");wt(this,"announce");wt(this,"observed");wt(this,"announceFilter");wt(this,Ul,"@libp2p/address-manager");const{listen:rt=[],announce:nt=[]}=tt;this.components=o,this.log=o.logger.forComponent("libp2p:address-manager"),this.listen=rt.map(ot=>ot.toString()),this.announce=new Set(nt.map(ot=>ot.toString())),this.observed=new Map,this.announceFilter=tt.announceFilter??defaultAddressFilter,this._updatePeerStoreAddresses=debounce(this._updatePeerStoreAddresses.bind(this),1e3),o.events.addEventListener("transport:listening",()=>{this._updatePeerStoreAddresses()}),o.events.addEventListener("transport:close",()=>{this._updatePeerStoreAddresses()})}_updatePeerStoreAddresses(){const o=this.getAnnounceAddrs().concat(this.components.transportManager.getAddrs()).concat([...this.observed.entries()].filter(([tt,rt])=>rt.confident).map(([tt])=>multiaddr(tt))).map(tt=>tt.getPeerId()===this.components.peerId.toString()?tt.decapsulate(`/p2p/${this.components.peerId.toString()}`):tt);this.components.peerStore.patch(this.components.peerId,{multiaddrs:o}).catch(tt=>{this.log.error("error updating addresses",tt)})}getListenAddrs(){return Array.from(this.listen).map(o=>multiaddr(o))}getAnnounceAddrs(){return Array.from(this.announce).map(o=>multiaddr(o))}getObservedAddrs(){return Array.from(this.observed).map(([o])=>multiaddr(o))}addObservedAddr(o){o=stripPeerId(o,this.components.peerId);const tt=o.toString();this.observed.has(tt)||this.observed.set(tt,{confident:!1})}confirmObservedAddr(o){o=stripPeerId(o,this.components.peerId);const tt=o.toString(),nt=(this.observed.get(tt)??{confident:!1}).confident;this.observed.set(tt,{confident:!0}),nt||this._updatePeerStoreAddresses()}removeObservedAddr(o){o=stripPeerId(o,this.components.peerId);const tt=o.toString();this.observed.delete(tt)}getAddresses(){let o=this.getAnnounceAddrs().map(rt=>rt.toString());o.length===0&&(o=this.components.transportManager.getAddrs().map(rt=>rt.toString())),o=o.concat(Array.from(this.observed).filter(([rt,nt])=>nt.confident).map(([rt])=>rt));const tt=new Set(o);return this.announceFilter(Array.from(tt).map(rt=>multiaddr(rt))).map(rt=>{var nt;return((nt=rt.protos().pop())==null?void 0:nt.path)===!0||rt.getPeerId()===this.components.peerId.toString()?rt:rt.encapsulate(`/p2p/${this.components.peerId.toString()}`)})}}var messages;(function(et){et.NOT_STARTED_YET="The libp2p node is not started yet",et.NOT_FOUND="Not found"})(messages||(messages={}));class MissingServiceError extends Error{constructor(o="Missing service"){super(o),this.name="MissingServiceError"}}class UnmetServiceDependenciesError extends Error{constructor(o="Unmet service dependencies"){super(o),this.name="UnmetServiceDependenciesError"}}class NoContentRoutersError extends Error{constructor(o="No content routers available"){super(o),this.name="NoContentRoutersError"}}class NoPeerRoutersError extends Error{constructor(o="No peer routers available"){super(o),this.name="NoPeerRoutersError"}}class QueriedForSelfError extends Error{constructor(o="Should not try to find self"){super(o),this.name="QueriedForSelfError"}}class UnhandledProtocolError extends Error{constructor(o="Unhandled protocol error"){super(o),this.name="UnhandledProtocolError"}}class DuplicateProtocolHandlerError extends Error{constructor(o="Duplicate protocol handler error"){super(o),this.name="DuplicateProtocolHandlerError"}}class DialDeniedError extends Error{constructor(o="Dial denied error"){super(o),this.name="DialDeniedError"}}class NoValidAddressesError extends Error{constructor(o="No valid addresses"){super(o),this.name="NoValidAddressesError"}}class ConnectionInterceptedError extends Error{constructor(o="Connection intercepted"){super(o),this.name="ConnectionInterceptedError"}}class ConnectionDeniedError extends Error{constructor(o="Connection denied"){super(o),this.name="ConnectionDeniedError"}}class MuxerUnavailableError extends Error{constructor(o="Stream is not multiplexed"){super(o),this.name="MuxerUnavailableError"}}class EncryptionFailedError extends Error{constructor(o="Encryption failed"){super(o),this.name="EncryptionFailedError"}}class TransportUnavailableError extends Error{constructor(o="Transport unavailable"){super(o),this.name="TransportUnavailableError"}}class DefaultComponents{constructor(o={}){wt(this,"components",{});wt(this,"_started",!1);this.components={};for(const[tt,rt]of Object.entries(o))this.components[tt]=rt;this.components.logger==null&&(this.components.logger=defaultLogger())}isStarted(){return this._started}async _invokeStartableMethod(o){await Promise.all(Object.values(this.components).filter(tt=>isStartable(tt)).map(async tt=>{var rt;await((rt=tt[o])==null?void 0:rt.call(tt))}))}async beforeStart(){await this._invokeStartableMethod("beforeStart")}async start(){await this._invokeStartableMethod("start"),this._started=!0}async afterStart(){await this._invokeStartableMethod("afterStart")}async beforeStop(){await this._invokeStartableMethod("beforeStop")}async stop(){await this._invokeStartableMethod("stop"),this._started=!1}async afterStop(){await this._invokeStartableMethod("afterStop")}}const OPTIONAL_SERVICES=["metrics","connectionProtector","dns"],NON_SERVICE_PROPERTIES=["components","isStarted","beforeStart","start","afterStart","beforeStop","stop","afterStop","then","_invokeStartableMethod"];function defaultComponents(et={}){const o=new DefaultComponents(et);return new Proxy(o,{get(rt,nt,ot){if(typeof nt=="string"&&!NON_SERVICE_PROPERTIES.includes(nt)){const it=o.components[nt];if(it==null&&!OPTIONAL_SERVICES.includes(nt))throw new MissingServiceError(`${nt} not set`);return it}return Reflect.get(rt,nt,ot)},set(rt,nt,ot){return typeof nt=="string"?o.components[nt]=ot:Reflect.set(rt,nt,ot),!0}})}function checkServiceDependencies(et){const o={};for(const tt of Object.values(et.components))for(const rt of getServiceCapabilities(tt))o[rt]=!0;for(const tt of Object.values(et.components))for(const rt of getServiceDependencies(tt))if(o[rt]!==!0)throw new UnmetServiceDependenciesError(`Service "${getServiceName(tt)}" required capability "${rt}" but it was not provided by any component, you may need to add additional configuration when creating your node.`)}function getServiceCapabilities(et){return Array.isArray(et==null?void 0:et[serviceCapabilities])?et[serviceCapabilities]:[]}function getServiceDependencies(et){return Array.isArray(et==null?void 0:et[serviceDependencies])?et[serviceDependencies]:[]}function getServiceName(et){return(et==null?void 0:et[Symbol.toStringTag])??(et==null?void 0:et.toString())??"unknown"}function connectionGater(et={}){return{denyDialPeer:async()=>!1,denyDialMultiaddr:async o=>{const tt=o.stringTuples();return tt[0][0]===4||tt[0][0]===41?!!isPrivateIp(`${tt[0][1]}`):!1},denyInboundConnection:async()=>!1,denyOutboundConnection:async()=>!1,denyInboundEncryptedConnection:async()=>!1,denyOutboundEncryptedConnection:async()=>!1,denyInboundUpgradedConnection:async()=>!1,denyOutboundUpgradedConnection:async()=>!1,filterMultiaddrForPeer:async()=>!0,...et}}function getPeerAddress(et){if(isPeerId$1(et))return{peerId:et,multiaddrs:[]};Array.isArray(et)||(et=[et]);let o;if(et.length>0){const tt=et[0].getPeerId();o=tt==null?void 0:peerIdFromString$1(tt),et.forEach(rt=>{if(!isMultiaddr(rt))throw new InvalidMultiaddrError("Invalid multiaddr");const nt=rt.getPeerId();if(nt==null){if(o!=null)throw new InvalidParametersError$1("Multiaddrs must all have the same peer id or have no peer id")}else{const ot=peerIdFromString$1(nt);if((o==null?void 0:o.equals(ot))!==!0)throw new InvalidParametersError$1("Multiaddrs must all have the same peer id or have no peer id")}})}return{peerId:o,multiaddrs:et}}const DEFAULT_CLOSABLE_PROTOCOLS=["/ipfs/id/1.0.0","/ipfs/id/push/1.0.0","/libp2p/autonat/1.0.0","/libp2p/dcutr"];async function safelyCloseConnectionIfUnused(et,o){var nt;const tt=((nt=et==null?void 0:et.streams)==null?void 0:nt.map(ot=>ot.protocol))??[],rt=(o==null?void 0:o.closableProtocols)??DEFAULT_CLOSABLE_PROTOCOLS;if(!(tt.filter(ot=>ot!=null&&!rt.includes(ot)).length>0))try{await(et==null?void 0:et.close(o))}catch(ot){et==null||et.abort(ot)}}const DIAL_TIMEOUT=5e3,UPGRADE_TIMEOUT=3e3,PROTOCOL_NEGOTIATION_TIMEOUT=2e3,MAX_PEER_ADDRS_TO_DIAL=25,INBOUND_CONNECTION_THRESHOLD=5,MAX_INCOMING_PENDING_CONNECTIONS=10,MAX_PARALLEL_RECONNECTS=5,LAST_DIAL_FAILURE_KEY="last-dial-failure",LAST_DIAL_SUCCESS_KEY="last-dial-success",MAX_DIAL_QUEUE_LENGTH=500,MAX_CONNECTIONS=100,MAX_PARALLEL_DIALS=50,defaultOptions$2={maxConnections:MAX_CONNECTIONS,allow:[]};class ConnectionPruner{constructor(o,tt={}){wt(this,"maxConnections");wt(this,"connectionManager");wt(this,"peerStore");wt(this,"allow");wt(this,"events");wt(this,"log");this.maxConnections=tt.maxConnections??defaultOptions$2.maxConnections,this.allow=tt.allow??defaultOptions$2.allow,this.connectionManager=o.connectionManager,this.peerStore=o.peerStore,this.events=o.events,this.log=o.logger.forComponent("libp2p:connection-manager:connection-pruner"),this.maybePruneConnections=this.maybePruneConnections.bind(this)}start(){this.events.addEventListener("connection:open",this.maybePruneConnections)}stop(){this.events.removeEventListener("connection:open",this.maybePruneConnections)}maybePruneConnections(){this._maybePruneConnections().catch(o=>{this.log.error("error while pruning connections %e",o)})}async _maybePruneConnections(){const o=this.connectionManager.getConnections(),tt=o.length;if(this.log("checking max connections limit %d/%d",tt,this.maxConnections),tt<=this.maxConnections)return;const rt=new PeerMap;for(const st of o){const at=st.remotePeer;if(!rt.has(at)){rt.set(at,0);try{const ct=await this.peerStore.get(at);rt.set(at,[...ct.tags.values()].reduce((lt,dt)=>lt+dt.value,0))}catch(ct){ct.name!=="NotFoundError"&&this.log.error("error loading peer tags",ct)}}}const nt=this.sortConnections(o,rt),ot=Math.max(tt-this.maxConnections,0),it=[];for(const st of nt)if(this.log("too many connections open - closing a connection to %p",st.remotePeer),this.allow.some(ct=>st.remoteAddr.toString().startsWith(ct.toString()))||it.push(st),it.length===ot)break;await Promise.all(it.map(async st=>{await safelyCloseConnectionIfUnused(st,{signal:AbortSignal.timeout(1e3)})})),this.events.safeDispatchEvent("connection:prune",{detail:it})}sortConnections(o,tt){return o.sort((rt,nt)=>{const ot=rt.timeline.open,it=nt.timeline.open;return ot<it?1:ot>it?-1:0}).sort((rt,nt)=>rt.direction==="outbound"&&nt.direction==="inbound"?1:rt.direction==="inbound"&&nt.direction==="outbound"?-1:0).sort((rt,nt)=>rt.streams.length>nt.streams.length?1:rt.streams.length<nt.streams.length?-1:0).sort((rt,nt)=>{const ot=tt.get(rt.remotePeer)??0,it=tt.get(nt.remotePeer)??0;return ot>it?1:ot<it?-1:0})}}let AbortError$2=class extends Error{constructor(tt,rt){super(tt??"The operation was aborted");wt(this,"type");wt(this,"code");this.type="aborted",this.name="AbortError",this.code=rt??"ABORT_ERR"}};async function raceEvent(et,o,tt,rt){const nt=new AbortError$2(rt==null?void 0:rt.errorMessage,rt==null?void 0:rt.errorCode);return(tt==null?void 0:tt.aborted)===!0?Promise.reject(nt):new Promise((ot,it)=>{function st(){tt==null||tt.removeEventListener("abort",lt),et.removeEventListener(o,at),(rt==null?void 0:rt.errorEvent)!=null&&et.removeEventListener(rt.errorEvent,ct)}const at=dt=>{var ht;try{if(((ht=rt==null?void 0:rt.filter)==null?void 0:ht.call(rt,dt))===!1)return}catch(mt){st(),it(mt);return}st(),ot(dt)},ct=dt=>{st(),it(dt.detail)},lt=()=>{st(),it(nt)};tt==null||tt.addEventListener("abort",lt),et.addEventListener(o,at),(rt==null?void 0:rt.errorEvent)!=null&&et.addEventListener(rt.errorEvent,ct)})}class JobRecipient{constructor(o){wt(this,"deferred");wt(this,"signal");var tt;this.signal=o,this.deferred=pDefer(),this.onAbort=this.onAbort.bind(this),(tt=this.signal)==null||tt.addEventListener("abort",this.onAbort)}onAbort(){var o;this.deferred.reject(((o=this.signal)==null?void 0:o.reason)??new AbortError$6)}cleanup(){var o;(o=this.signal)==null||o.removeEventListener("abort",this.onAbort)}}function randomId(){return`${parseInt(String(Math.random()*1e9),10).toString()}${Date.now()}`}class Job{constructor(o,tt){wt(this,"id");wt(this,"fn");wt(this,"options");wt(this,"recipients");wt(this,"status");wt(this,"timeline");wt(this,"controller");this.id=randomId(),this.status="queued",this.fn=o,this.options=tt,this.recipients=[],this.timeline={created:Date.now()},this.controller=new AbortController,setMaxListeners$2(1/0,this.controller.signal),this.onAbort=this.onAbort.bind(this)}abort(o){this.controller.abort(o)}onAbort(){this.recipients.reduce((tt,rt)=>{var nt;return tt&&((nt=rt.signal)==null?void 0:nt.aborted)===!0},!0)&&(this.controller.abort(new AbortError$6),this.cleanup())}async join(o={}){var rt;const tt=new JobRecipient(o.signal);return this.recipients.push(tt),(rt=o.signal)==null||rt.addEventListener("abort",this.onAbort),tt.deferred.promise}async run(){this.status="running",this.timeline.started=Date.now();try{this.controller.signal.throwIfAborted();const o=await raceSignal(this.fn({...this.options??{},signal:this.controller.signal}),this.controller.signal);this.recipients.forEach(tt=>{tt.deferred.resolve(o)}),this.status="complete"}catch(o){this.recipients.forEach(tt=>{tt.deferred.reject(o)}),this.status="errored"}finally{this.timeline.finished=Date.now(),this.cleanup()}}cleanup(){this.recipients.forEach(o=>{var tt;o.cleanup(),(tt=o.signal)==null||tt.removeEventListener("abort",this.onAbort)})}}class Queue extends TypedEventEmitter$1{constructor(tt={}){var rt;super();wt(this,"concurrency");wt(this,"maxSize");wt(this,"queue");wt(this,"pending");wt(this,"sort");this.concurrency=tt.concurrency??Number.POSITIVE_INFINITY,this.maxSize=tt.maxSize??Number.POSITIVE_INFINITY,this.pending=0,tt.metricName!=null&&((rt=tt.metrics)==null||rt.registerMetricGroup(tt.metricName,{calculate:()=>({size:this.queue.length,running:this.pending,queued:this.queue.length-this.pending})})),this.sort=tt.sort,this.queue=[]}tryToStartAnother(){if(this.size===0)return queueMicrotask(()=>{this.safeDispatchEvent("empty")}),this.running===0&&queueMicrotask(()=>{this.safeDispatchEvent("idle")}),!1;if(this.pending<this.concurrency){let tt;for(const rt of this.queue)if(rt.status==="queued"){tt=rt;break}return tt==null?!1:(this.safeDispatchEvent("active"),this.pending++,tt.run().finally(()=>{for(let rt=0;rt<this.queue.length;rt++)if(this.queue[rt]===tt){this.queue.splice(rt,1);break}this.pending--,this.tryToStartAnother(),this.safeDispatchEvent("next")}),!0)}return!1}enqueue(tt){this.queue.push(tt),this.sort!=null&&this.queue.sort(this.sort)}async add(tt,rt){var ot;if((ot=rt==null?void 0:rt.signal)==null||ot.throwIfAborted(),this.size===this.maxSize)throw new QueueFullError;const nt=new Job(tt,rt);return this.enqueue(nt),this.safeDispatchEvent("add"),this.tryToStartAnother(),nt.join(rt).then(it=>(this.safeDispatchEvent("completed",{detail:it}),this.safeDispatchEvent("success",{detail:{job:nt,result:it}}),it)).catch(it=>{if(nt.status==="queued"){for(let st=0;st<this.queue.length;st++)if(this.queue[st]===nt){this.queue.splice(st,1);break}}throw this.safeDispatchEvent("error",{detail:it}),this.safeDispatchEvent("failure",{detail:{job:nt,error:it}}),it})}clear(){this.queue.splice(0,this.queue.length)}abort(){this.queue.forEach(tt=>{tt.abort(new AbortError$6)}),this.clear()}async onEmpty(tt){this.size!==0&&await raceEvent(this,"empty",tt==null?void 0:tt.signal)}async onSizeLessThan(tt,rt){this.size<tt||await raceEvent(this,"next",rt==null?void 0:rt.signal,{filter:()=>this.size<tt})}async onIdle(tt){this.pending===0&&this.size===0||await raceEvent(this,"idle",tt==null?void 0:tt.signal)}get size(){return this.queue.length}get queued(){return this.queue.length-this.pending}get running(){return this.pending}async*toGenerator(tt){var ct,lt,dt;(ct=tt==null?void 0:tt.signal)==null||ct.throwIfAborted();const rt=pushable({objectMode:!0}),nt=ht=>{ht!=null?this.abort():this.clear(),rt.end(ht)},ot=ht=>{ht.detail!=null&&rt.push(ht.detail)},it=ht=>{nt(ht.detail)},st=()=>{nt()},at=()=>{nt(new AbortError$6("Queue aborted"))};this.addEventListener("completed",ot),this.addEventListener("error",it),this.addEventListener("idle",st),(lt=tt==null?void 0:tt.signal)==null||lt.addEventListener("abort",at);try{yield*rt}finally{this.removeEventListener("completed",ot),this.removeEventListener("error",it),this.removeEventListener("idle",st),(dt=tt==null?void 0:tt.signal)==null||dt.removeEventListener("abort",at),nt()}}}class PriorityQueue extends Queue{constructor(o={}){super({...o,sort:(tt,rt)=>tt.options.priority>rt.options.priority?-1:tt.options.priority<rt.options.priority?1:0})}}function anySignal(et){const o=new globalThis.AbortController;function tt(){o.abort();for(const ot of et)(ot==null?void 0:ot.removeEventListener)!=null&&ot.removeEventListener("abort",tt)}for(const ot of et){if((ot==null?void 0:ot.aborted)===!0){tt();break}(ot==null?void 0:ot.addEventListener)!=null&&ot.addEventListener("abort",tt)}function rt(){for(const ot of et)(ot==null?void 0:ot.removeEventListener)!=null&&ot.removeEventListener("abort",tt)}const nt=o.signal;return nt.clear=rt,nt}function isPrivate(et){try{const{address:o}=et.nodeAddress();return!!isPrivateIp(o)}catch{return!0}}function reliableTransportsFirst(et,o){const tt=TCP.exactMatch(et.multiaddr),rt=TCP.exactMatch(o.multiaddr);if(tt&&!rt)return-1;if(!tt&&rt)return 1;const nt=WebSocketsSecure.exactMatch(et.multiaddr),ot=WebSocketsSecure.exactMatch(o.multiaddr);if(nt&&!ot)return-1;if(!nt&&ot)return 1;const it=WebSockets$1.exactMatch(et.multiaddr),st=WebSockets$1.exactMatch(o.multiaddr);if(it&&!st)return-1;if(!it&&st)return 1;const at=WebRTC.exactMatch(et.multiaddr),ct=WebRTC.exactMatch(o.multiaddr);if(at&&!ct)return-1;if(!at&&ct)return 1;const lt=WebRTCDirect.exactMatch(et.multiaddr),dt=WebRTCDirect.exactMatch(o.multiaddr);if(lt&&!dt)return-1;if(!lt&&dt)return 1;const ht=WebTransport.exactMatch(et.multiaddr),mt=WebTransport.exactMatch(o.multiaddr);return ht&&!mt?-1:!ht&&mt?1:0}function publicAddressesFirst(et,o){const tt=isPrivate(et.multiaddr),rt=isPrivate(o.multiaddr);return tt&&!rt?1:!tt&&rt?-1:0}function certifiedAddressesFirst(et,o){return et.isCertified&&!o.isCertified?-1:!et.isCertified&&o.isCertified?1:0}function circuitRelayAddressesLast(et,o){const tt=Circuit.exactMatch(et.multiaddr),rt=Circuit.exactMatch(o.multiaddr);return tt&&!rt?1:!tt&&rt?-1:0}function defaultAddressSorter(et){return et.sort(reliableTransportsFirst).sort(certifiedAddressesFirst).sort(circuitRelayAddressesLast).sort(publicAddressesFirst)}async function resolveMultiaddrs(et,o){let tt=!1;for(const nt of resolvers$1.keys())if(tt=et.protoNames().includes(nt),tt)break;if(!tt)return[et];const rt=await et.resolve(o);return o.log("resolved %s to",et,rt.map(nt=>nt.toString())),rt}const defaultOptions$1={maxParallelDials:MAX_PARALLEL_DIALS,maxDialQueueLength:MAX_DIAL_QUEUE_LENGTH,maxPeerAddrsToDial:MAX_PEER_ADDRS_TO_DIAL,dialTimeout:DIAL_TIMEOUT,resolvers:{dnsaddr:dnsaddrResolver}};class DialQueue{constructor(o,tt={}){wt(this,"queue");wt(this,"components");wt(this,"addressSorter");wt(this,"maxPeerAddrsToDial");wt(this,"maxDialQueueLength");wt(this,"dialTimeout");wt(this,"shutDownController");wt(this,"connections");wt(this,"log");this.addressSorter=tt.addressSorter,this.maxPeerAddrsToDial=tt.maxPeerAddrsToDial??defaultOptions$1.maxPeerAddrsToDial,this.maxDialQueueLength=tt.maxDialQueueLength??defaultOptions$1.maxDialQueueLength,this.dialTimeout=tt.dialTimeout??defaultOptions$1.dialTimeout,this.connections=tt.connections??new PeerMap,this.log=o.logger.forComponent("libp2p:connection-manager:dial-queue"),this.components=o,this.shutDownController=new AbortController,setMaxListeners(1/0,this.shutDownController.signal);for(const[rt,nt]of Object.entries(tt.resolvers??{}))resolvers$1.set(rt,nt);this.queue=new PriorityQueue({concurrency:tt.maxParallelDials??defaultOptions$1.maxParallelDials,metricName:"libp2p_dial_queue",metrics:o.metrics}),this.queue.addEventListener("error",rt=>{rt.detail.name!==AbortError$4.name&&this.log.error("error in dial queue - %e",rt.detail)})}start(){this.shutDownController=new AbortController,setMaxListeners(1/0,this.shutDownController.signal)}stop(){this.shutDownController.abort(),this.queue.abort()}async dial(o,tt={}){var st,at,ct;const{peerId:rt,multiaddrs:nt}=getPeerAddress(o),ot=Array.from(this.connections.values()).flat().find(lt=>tt.force===!0?!1:lt.remotePeer.equals(rt)?!0:nt.find(dt=>dt.equals(lt.remoteAddr)));if((ot==null?void 0:ot.status)==="open")return this.log("already connected to %a",ot.remoteAddr),(st=tt.onProgress)==null||st.call(tt,new CustomProgressEvent("dial-queue:already-connected")),ot;const it=this.queue.queue.find(lt=>{if((rt==null?void 0:rt.equals(lt.options.peerId))===!0)return!0;const dt=lt.options.multiaddrs;if(dt==null)return!1;for(const ht of nt)if(dt.has(ht.toString()))return!0;return!1});if(it!=null){this.log("joining existing dial target for %p",rt);for(const lt of nt)it.options.multiaddrs.add(lt.toString());return(at=tt.onProgress)==null||at.call(tt,new CustomProgressEvent("dial-queue:already-in-dial-queue")),it.join(tt)}if(this.queue.size>=this.maxDialQueueLength)throw new DialError("Dial queue is full");return this.log("creating dial target for %p",rt,nt.map(lt=>lt.toString())),(ct=tt.onProgress)==null||ct.call(tt,new CustomProgressEvent("dial-queue:add-to-dial-queue")),this.queue.add(async lt=>{var mt,ft;(mt=lt==null?void 0:lt.onProgress)==null||mt.call(lt,new CustomProgressEvent("dial-queue:start-dial"));const dt=this.createDialAbortController(lt==null?void 0:lt.signal);let ht;try{ht=await this.calculateMultiaddrs(rt,lt==null?void 0:lt.multiaddrs,{...lt,signal:dt}),(ft=lt==null?void 0:lt.onProgress)==null||ft.call(lt,new CustomProgressEvent("dial-queue:calculated-addresses",ht)),ht.map(({multiaddr:pt})=>pt.toString()).forEach(pt=>{lt==null||lt.multiaddrs.add(pt)})}catch(pt){throw dt.clear(),pt}try{let pt=0;const yt=[];for(const gt of ht){if(pt===this.maxPeerAddrsToDial)throw this.log("dialed maxPeerAddrsToDial (%d) addresses for %p, not trying any others",pt,rt),new DialError("Peer had more than maxPeerAddrsToDial");pt++;try{const bt=await this.components.transportManager.dial(gt.multiaddr,{...lt,signal:dt});this.log("dial to %a succeeded",gt.multiaddr);try{await this.components.peerStore.merge(bt.remotePeer,{multiaddrs:[bt.remoteAddr],metadata:{[LAST_DIAL_SUCCESS_KEY]:fromString$6(Date.now().toString())}})}catch(xt){this.log.error("could not update last dial failure key for %p",rt,xt)}return bt}catch(bt){if(this.log.error("dial failed to %a",gt.multiaddr,bt),rt!=null)try{await this.components.peerStore.merge(rt,{metadata:{[LAST_DIAL_FAILURE_KEY]:fromString$6(Date.now().toString())}})}catch(xt){this.log.error("could not update last dial failure key for %p",rt,xt)}if(dt.aborted)throw new TimeoutError$2(bt.message);yt.push(bt)}}throw yt.length===1?yt[0]:new AggregateError(yt,"All multiaddr dials failed")}finally{dt.clear()}},{peerId:rt,priority:tt.priority??DEFAULT_DIAL_PRIORITY,multiaddrs:new Set(nt.map(lt=>lt.toString())),signal:tt.signal,onProgress:tt.onProgress})}createDialAbortController(o){const tt=anySignal([AbortSignal.timeout(this.dialTimeout),this.shutDownController.signal,o]);return setMaxListeners(1/0,tt),tt}async calculateMultiaddrs(o,tt=new Set,rt={}){var dt,ht;const nt=[...tt].map(mt=>({multiaddr:multiaddr(mt),isCertified:!1}));if(o!=null){if(this.components.peerId.equals(o))throw new DialError("Tried to dial self");if(await((ht=(dt=this.components.connectionGater).denyDialPeer)==null?void 0:ht.call(dt,o))===!0)throw new DialDeniedError("The dial request is blocked by gater.allowDialPeer");if(nt.length===0){this.log("loading multiaddrs for %p",o);try{const mt=await this.components.peerStore.get(o);nt.push(...mt.addresses),this.log("loaded multiaddrs for %p",o,nt.map(({multiaddr:ft})=>ft.toString()))}catch(mt){if(mt.name!=="NotFoundError")throw mt}}if(nt.length===0){this.log("looking up multiaddrs for %p in the peer routing",o);try{const mt=await this.components.peerRouting.findPeer(o);this.log("found multiaddrs for %p in the peer routing",o,nt.map(({multiaddr:ft})=>ft.toString())),nt.push(...mt.multiaddrs.map(ft=>({multiaddr:ft,isCertified:!1})))}catch(mt){mt.name!=="NoPeerRoutersError"&&this.log.error("looking up multiaddrs for %p in the peer routing failed",o,mt)}}}let ot=(await Promise.all(nt.map(async mt=>{const ft=await resolveMultiaddrs(mt.multiaddr,{dns:this.components.dns,...rt,log:this.log});return ft.length===1&&ft[0].equals(mt.multiaddr)?mt:ft.map(pt=>({multiaddr:pt,isCertified:!1}))}))).flat();if(o!=null){const mt=`/p2p/${o.toString()}`;ot=ot.map(ft=>{const pt=ft.multiaddr.protos().pop();return(pt==null?void 0:pt.path)===!0?ft:ft.multiaddr.getPeerId()==null?{multiaddr:ft.multiaddr.encapsulate(mt),isCertified:ft.isCertified}:ft})}const it=ot.filter(mt=>{if(this.components.transportManager.dialTransportForMultiaddr(mt.multiaddr)==null)return!1;const ft=mt.multiaddr.getPeerId();return o!=null&&ft!=null?o.equals(ft):!0}),st=new Map;for(const mt of it){const ft=mt.multiaddr.toString(),pt=st.get(ft);if(pt!=null){pt.isCertified=pt.isCertified||mt.isCertified||!1;continue}st.set(ft,mt)}const at=[...st.values()];if(at.length===0)throw new NoValidAddressesError("The dial request has no valid addresses");const ct=[];for(const mt of at)this.components.connectionGater.denyDialMultiaddr!=null&&await this.components.connectionGater.denyDialMultiaddr(mt.multiaddr)||ct.push(mt);const lt=this.addressSorter==null?defaultAddressSorter(ct):ct.sort(this.addressSorter);if(lt.length===0)throw new DialDeniedError("The connection gater denied all addresses in the dial request");return this.log.trace("addresses for %p before filtering",o??"unknown peer",ot.map(({multiaddr:mt})=>mt.toString())),this.log.trace("addresses for %p after filtering",o??"unknown peer",lt.map(({multiaddr:mt})=>mt.toString())),lt}async isDialable(o,tt={}){Array.isArray(o)||(o=[o]);try{const rt=await this.calculateMultiaddrs(void 0,new Set(o.map(nt=>nt.toString())),tt);return tt.runOnLimitedConnection===!1?rt.find(nt=>!Circuit.matches(nt.multiaddr))!=null:!0}catch(rt){this.log.trace("error calculating if multiaddr(s) were dialable",rt)}return!1}}class PeerQueue extends Queue{has(o){return this.find(o)!=null}find(o){return this.queue.find(tt=>o.equals(tt.options.peerId))}}var retry$2={};function RetryOperation(et,o){typeof o=="boolean"&&(o={forever:o}),this._originalTimeouts=JSON.parse(JSON.stringify(et)),this._timeouts=et,this._options=o||{},this._maxRetryTime=o&&o.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var retry_operation=RetryOperation;RetryOperation.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};RetryOperation.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};RetryOperation.prototype.retry=function(et){if(this._timeout&&clearTimeout(this._timeout),!et)return!1;var o=new Date().getTime();if(et&&o-this._operationStart>=this._maxRetryTime)return this._errors.push(et),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(et);var tt=this._timeouts.shift();if(tt===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),tt=this._cachedTimeouts.slice(-1);else return!1;var rt=this;return this._timer=setTimeout(function(){rt._attempts++,rt._operationTimeoutCb&&(rt._timeout=setTimeout(function(){rt._operationTimeoutCb(rt._attempts)},rt._operationTimeout),rt._options.unref&&rt._timeout.unref()),rt._fn(rt._attempts)},tt),this._options.unref&&this._timer.unref(),!0};RetryOperation.prototype.attempt=function(et,o){this._fn=et,o&&(o.timeout&&(this._operationTimeout=o.timeout),o.cb&&(this._operationTimeoutCb=o.cb));var tt=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){tt._operationTimeoutCb()},tt._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};RetryOperation.prototype.try=function(et){console.log("Using RetryOperation.try() is deprecated"),this.attempt(et)};RetryOperation.prototype.start=function(et){console.log("Using RetryOperation.start() is deprecated"),this.attempt(et)};RetryOperation.prototype.start=RetryOperation.prototype.try;RetryOperation.prototype.errors=function(){return this._errors};RetryOperation.prototype.attempts=function(){return this._attempts};RetryOperation.prototype.mainError=function(){if(this._errors.length===0)return null;for(var et={},o=null,tt=0,rt=0;rt<this._errors.length;rt++){var nt=this._errors[rt],ot=nt.message,it=(et[ot]||0)+1;et[ot]=it,it>=tt&&(o=nt,tt=it)}return o};(function(et){var o=retry_operation;et.operation=function(tt){var rt=et.timeouts(tt);return new o(rt,{forever:tt&&(tt.forever||tt.retries===1/0),unref:tt&&tt.unref,maxRetryTime:tt&&tt.maxRetryTime})},et.timeouts=function(tt){if(tt instanceof Array)return[].concat(tt);var rt={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var nt in tt)rt[nt]=tt[nt];if(rt.minTimeout>rt.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var ot=[],it=0;it<rt.retries;it++)ot.push(this.createTimeout(it,rt));return tt&&tt.forever&&!ot.length&&ot.push(this.createTimeout(it,rt)),ot.sort(function(st,at){return st-at}),ot},et.createTimeout=function(tt,rt){var nt=rt.randomize?Math.random()+1:1,ot=Math.round(nt*Math.max(rt.minTimeout,1)*Math.pow(rt.factor,tt));return ot=Math.min(ot,rt.maxTimeout),ot},et.wrap=function(tt,rt,nt){if(rt instanceof Array&&(nt=rt,rt=null),!nt){nt=[];for(var ot in tt)typeof tt[ot]=="function"&&nt.push(ot)}for(var it=0;it<nt.length;it++){var st=nt[it],at=tt[st];tt[st]=(function(lt){var dt=et.operation(rt),ht=Array.prototype.slice.call(arguments,1),mt=ht.pop();ht.push(function(ft){dt.retry(ft)||(ft&&(arguments[0]=dt.mainError()),mt.apply(this,arguments))}),dt.attempt(function(){lt.apply(tt,ht)})}).bind(tt,at),tt[st].options=rt}}})(retry$2);var retry=retry$2;const retry$1=getDefaultExportFromCjs(retry),objectToString=Object.prototype.toString,isError=et=>objectToString.call(et)==="[object Error]",errorMessages=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Load failed","Network request failed","fetch failed","terminated"]);function isNetworkError(et){return et&&isError(et)&&et.name==="TypeError"&&typeof et.message=="string"?et.message==="Load failed"?et.stack===void 0:errorMessages.has(et.message):!1}let AbortError$1=class extends Error{constructor(o){super(),o instanceof Error?(this.originalError=o,{message:o}=o):(this.originalError=new Error(o),this.originalError.stack=this.stack),this.name="AbortError",this.message=o}};const decorateErrorWithCounts=(et,o,tt)=>{const rt=tt.retries-(o-1);return et.attemptNumber=o,et.retriesLeft=rt,et};async function pRetry(et,o){return new Promise((tt,rt)=>{o={onFailedAttempt(){},retries:10,shouldRetry:()=>!0,...o};const nt=retry$1.operation(o),ot=()=>{var st;nt.stop(),rt((st=o.signal)==null?void 0:st.reason)};o.signal&&!o.signal.aborted&&o.signal.addEventListener("abort",ot,{once:!0});const it=()=>{var st;(st=o.signal)==null||st.removeEventListener("abort",ot),nt.stop()};nt.attempt(async st=>{try{const at=await et(st);it(),tt(at)}catch(at){try{if(!(at instanceof Error))throw new TypeError(`Non-error was thrown: "${at}". You should only throw errors.`);if(at instanceof AbortError$1)throw at.originalError;if(at instanceof TypeError&&!isNetworkError(at))throw at;if(decorateErrorWithCounts(at,st,o),await o.shouldRetry(at)||(nt.stop(),rt(at)),await o.onFailedAttempt(at),!nt.retry(at))throw nt.mainError()}catch(ct){decorateErrorWithCounts(ct,st,o),it(),rt(ct)}}})})}class ReconnectQueue{constructor(o,tt={}){wt(this,"log");wt(this,"queue");wt(this,"started");wt(this,"peerStore");wt(this,"retries");wt(this,"retryInterval");wt(this,"backoffFactor");wt(this,"connectionManager");wt(this,"events");this.log=o.logger.forComponent("libp2p:reconnect-queue"),this.peerStore=o.peerStore,this.connectionManager=o.connectionManager,this.queue=new PeerQueue({concurrency:tt.maxParallelReconnects??MAX_PARALLEL_RECONNECTS,metricName:"libp2p_reconnect_queue",metrics:o.metrics}),this.started=!1,this.retries=tt.retries??5,this.backoffFactor=tt.backoffFactor,this.retryInterval=tt.retryInterval,this.events=o.events,o.events.addEventListener("peer:disconnect",rt=>{this.maybeReconnect(rt.detail).catch(nt=>{this.log.error("failed to maybe reconnect to %p - %e",rt.detail,nt)})})}async maybeReconnect(o){if(!this.started)return;const tt=await this.peerStore.get(o);hasKeepAliveTag(tt)&&(this.queue.has(o)||this.queue.add(async rt=>{await pRetry(async nt=>{if(this.started)try{await this.connectionManager.openConnection(o,{signal:rt==null?void 0:rt.signal})}catch(ot){throw this.log("reconnecting to %p attempt %d of %d failed - %e",o,nt,this.retries,ot),ot}},{signal:rt==null?void 0:rt.signal,retries:this.retries,factor:this.backoffFactor,minTimeout:this.retryInterval})},{peerId:o}).catch(async rt=>{this.log.error("failed to reconnect to %p - %e",o,rt);const nt={};[...tt.tags.keys()].forEach(ot=>{ot.startsWith(KEEP_ALIVE)&&(nt[ot]=void 0)}),await this.peerStore.merge(o,{tags:nt}),this.events.safeDispatchEvent("peer:reconnect-failure",{detail:o})}).catch(async rt=>{this.log.error("failed to remove keep-alive tag from %p - %e",o,rt)}))}start(){this.started=!0}async afterStart(){Promise.resolve().then(async()=>{const o=await this.peerStore.all({filters:[tt=>hasKeepAliveTag(tt)]});await Promise.all(o.map(async tt=>{await this.connectionManager.openConnection(tt.id).catch(rt=>{this.log.error(rt)})}))}).catch(o=>{this.log.error(o)})}stop(){this.started=!1,this.queue.abort()}}function hasKeepAliveTag(et){for(const o of et.tags.keys())if(o.startsWith(KEEP_ALIVE))return!0;return!1}const DEFAULT_DIAL_PRIORITY=50,defaultOptions={maxConnections:MAX_CONNECTIONS,inboundConnectionThreshold:INBOUND_CONNECTION_THRESHOLD,maxIncomingPendingConnections:MAX_INCOMING_PENDING_CONNECTIONS};var zl;zl=Symbol.toStringTag;class DefaultConnectionManager{constructor(o,tt={}){wt(this,"started");wt(this,"connections");wt(this,"allow");wt(this,"deny");wt(this,"maxIncomingPendingConnections");wt(this,"incomingPendingConnections");wt(this,"outboundPendingConnections");wt(this,"maxConnections");wt(this,"dialQueue");wt(this,"reconnectQueue");wt(this,"connectionPruner");wt(this,"inboundConnectionRateLimiter");wt(this,"peerStore");wt(this,"metrics");wt(this,"events");wt(this,"log");wt(this,"peerId");wt(this,zl,"@libp2p/connection-manager");if(this.maxConnections=tt.maxConnections??defaultOptions.maxConnections,this.maxConnections<1)throw new InvalidParametersError$1("Connection Manager maxConnections must be greater than 0");this.connections=new PeerMap,this.started=!1,this.peerId=o.peerId,this.peerStore=o.peerStore,this.metrics=o.metrics,this.events=o.events,this.log=o.logger.forComponent("libp2p:connection-manager"),this.onConnect=this.onConnect.bind(this),this.onDisconnect=this.onDisconnect.bind(this),this.allow=(tt.allow??[]).map(rt=>multiaddr(rt)),this.deny=(tt.deny??[]).map(rt=>multiaddr(rt)),this.incomingPendingConnections=0,this.maxIncomingPendingConnections=tt.maxIncomingPendingConnections??defaultOptions.maxIncomingPendingConnections,this.outboundPendingConnections=0,this.inboundConnectionRateLimiter=new RateLimiter({points:tt.inboundConnectionThreshold??defaultOptions.inboundConnectionThreshold,duration:1}),this.connectionPruner=new ConnectionPruner({connectionManager:this,peerStore:o.peerStore,events:o.events,logger:o.logger},{maxConnections:this.maxConnections,allow:this.allow}),this.dialQueue=new DialQueue(o,{addressSorter:tt.addressSorter,maxParallelDials:tt.maxParallelDials??MAX_PARALLEL_DIALS,maxDialQueueLength:tt.maxDialQueueLength??MAX_DIAL_QUEUE_LENGTH,maxPeerAddrsToDial:tt.maxPeerAddrsToDial??MAX_PEER_ADDRS_TO_DIAL,dialTimeout:tt.dialTimeout??DIAL_TIMEOUT,resolvers:tt.resolvers??{dnsaddr:dnsaddrResolver},connections:this.connections}),this.reconnectQueue=new ReconnectQueue({events:o.events,peerStore:o.peerStore,logger:o.logger,connectionManager:this},{retries:tt.reconnectRetries,retryInterval:tt.reconnectRetryInterval,backoffFactor:tt.reconnectBackoffFactor,maxParallelReconnects:tt.maxParallelReconnects})}async start(){var o,tt,rt;(o=this.metrics)==null||o.registerMetricGroup("libp2p_connection_manager_connections",{calculate:()=>{const nt={inbound:0,"inbound pending":this.incomingPendingConnections,outbound:0,"outbound pending":this.outboundPendingConnections};for(const ot of this.connections.values())for(const it of ot)nt[it.direction]++;return nt}}),(tt=this.metrics)==null||tt.registerMetricGroup("libp2p_protocol_streams_total",{label:"protocol",calculate:()=>{const nt={};for(const ot of this.connections.values())for(const it of ot)for(const st of it.streams){const at=`${st.direction} ${st.protocol??"unnegotiated"}`;nt[at]=(nt[at]??0)+1}return nt}}),(rt=this.metrics)==null||rt.registerMetricGroup("libp2p_connection_manager_protocol_streams_per_connection_90th_percentile",{label:"protocol",calculate:()=>{const nt={};for(const it of this.connections.values())for(const st of it){const at={};for(const ct of st.streams){const lt=`${ct.direction} ${ct.protocol??"unnegotiated"}`;at[lt]=(at[lt]??0)+1}for(const[ct,lt]of Object.entries(at))nt[ct]=nt[ct]??[],nt[ct].push(lt)}const ot={};for(let[it,st]of Object.entries(nt)){st=st.sort((ct,lt)=>ct-lt);const at=Math.floor(st.length*.9);ot[it]=st[at]}return ot}}),this.events.addEventListener("connection:open",this.onConnect),this.events.addEventListener("connection:close",this.onDisconnect),await start(this.dialQueue,this.reconnectQueue,this.connectionPruner),this.started=!0,this.log("started")}async stop(){this.events.removeEventListener("connection:open",this.onConnect),this.events.removeEventListener("connection:close",this.onDisconnect),await stop(this.reconnectQueue,this.dialQueue,this.connectionPruner);const o=[];for(const tt of this.connections.values())for(const rt of tt)o.push((async()=>{try{await rt.close()}catch(nt){this.log.error(nt)}})());this.log("closing %d connections",o.length),await Promise.all(o),this.connections.clear(),this.log("stopped")}onConnect(o){this._onConnect(o).catch(tt=>{this.log.error(tt)})}async _onConnect(o){const{detail:tt}=o;if(!this.started){await tt.close();return}if(tt.status!=="open")return;const rt=tt.remotePeer,nt=!this.connections.has(rt),ot=this.connections.get(rt)??[];ot.push(tt),this.connections.set(rt,ot),rt.publicKey!=null&&rt.type==="RSA"&&await this.peerStore.patch(rt,{publicKey:rt.publicKey}),nt&&this.events.safeDispatchEvent("peer:connect",{detail:tt.remotePeer})}onDisconnect(o){const{detail:tt}=o,rt=tt.remotePeer,ot=(this.connections.get(rt)??[]).filter(it=>it.id!==tt.id);this.connections.set(rt,ot),ot.length===0&&(this.log("onDisconnect remove all connections for peer %p",rt),this.connections.delete(rt),this.events.safeDispatchEvent("peer:disconnect",{detail:tt.remotePeer}))}getConnections(o){if(o!=null)return this.connections.get(o)??[];let tt=[];for(const rt of this.connections.values())tt=tt.concat(rt);return tt}getConnectionsMap(){return this.connections}async openConnection(o,tt={}){var rt,nt;if(!this.started)throw new NotStartedError("Not started");this.outboundPendingConnections++;try{(rt=tt.signal)==null||rt.throwIfAborted();const{peerId:ot}=getPeerAddress(o);if(this.peerId.equals(ot))throw new InvalidPeerIdError("Can not dial self");if(ot!=null&&tt.force!==!0){this.log("dial %p",ot);const ct=this.getConnections(ot).find(lt=>lt.limits==null);if(ct!=null)return this.log("had an existing non-limited connection to %p",ot),(nt=tt.onProgress)==null||nt.call(tt,new CustomProgressEvent("dial-queue:already-connected")),ct}const it=await this.dialQueue.dial(o,{...tt,priority:tt.priority??DEFAULT_DIAL_PRIORITY});if(it.status!=="open")throw new ConnectionClosedError("Remote closed connection during opening");let st=this.connections.get(it.remotePeer);st==null&&(st=[],this.connections.set(it.remotePeer,st));let at=!1;for(const ct of st)if(ct.id===it.id&&(at=!0),tt.force!==!0&&ct.id!==it.id&&ct.remoteAddr.equals(it.remoteAddr))return it.abort(new InvalidMultiaddrError("Duplicate multiaddr connection")),ct;return at||st.push(it),it}finally{this.outboundPendingConnections--}}async closeConnections(o,tt={}){const rt=this.connections.get(o)??[];await Promise.all(rt.map(async nt=>{try{await nt.close(tt)}catch(ot){nt.abort(ot)}}))}async acceptIncomingConnection(o){if(this.deny.some(nt=>o.remoteAddr.toString().startsWith(nt.toString())))return this.log("connection from %a refused - connection remote address was in deny list",o.remoteAddr),!1;if(this.allow.some(nt=>o.remoteAddr.toString().startsWith(nt.toString())))return this.incomingPendingConnections++,!0;if(this.incomingPendingConnections===this.maxIncomingPendingConnections)return this.log("connection from %a refused - incomingPendingConnections exceeded by host",o.remoteAddr),!1;if(o.remoteAddr.isThinWaistAddress()){const nt=o.remoteAddr.nodeAddress().address;try{await this.inboundConnectionRateLimiter.consume(nt,1)}catch{return this.log("connection from %a refused - inboundConnectionThreshold exceeded by host %s",o.remoteAddr,nt),!1}}return this.getConnections().length<this.maxConnections?(this.incomingPendingConnections++,!0):(this.log("connection from %a refused - maxConnections exceeded",o.remoteAddr),!1)}afterUpgradeInbound(){this.incomingPendingConnections--}getDialQueue(){const o={queued:"queued",running:"active",errored:"error",complete:"success"};return this.dialQueue.queue.queue.map(tt=>({id:tt.id,status:o[tt.status],peerId:tt.options.peerId,multiaddrs:[...tt.options.multiaddrs].map(rt=>multiaddr(rt))}))}async isDialable(o,tt={}){return this.dialQueue.isDialable(o,tt)}}class MovingAverage{constructor(o){wt(this,"movingAverage");wt(this,"variance");wt(this,"deviation");wt(this,"forecast");wt(this,"timespan");wt(this,"previousTime");this.timespan=o,this.movingAverage=0,this.variance=0,this.deviation=0,this.forecast=0}alpha(o,tt){return 1-Math.exp(-(o-tt)/this.timespan)}push(o,tt=Date.now()){if(this.previousTime!=null){const rt=this.alpha(tt,this.previousTime),nt=o-this.movingAverage,ot=rt*nt;this.movingAverage=rt*o+(1-rt)*this.movingAverage,this.variance=(1-rt)*(this.variance+nt*ot),this.deviation=Math.sqrt(this.variance),this.forecast=this.movingAverage+rt*nt}else this.movingAverage=o;this.previousTime=tt}}const DEFAULT_TIMEOUT_MULTIPLIER=1.2,DEFAULT_FAILURE_MULTIPLIER=2,DEFAULT_MIN_TIMEOUT=2e3;class AdaptiveTimeout{constructor(o={}){wt(this,"success");wt(this,"failure");wt(this,"next");wt(this,"metric");wt(this,"timeoutMultiplier");wt(this,"failureMultiplier");wt(this,"minTimeout");var tt;this.success=new MovingAverage(o.interval??5e3),this.failure=new MovingAverage(o.interval??5e3),this.next=new MovingAverage(o.interval??5e3),this.failureMultiplier=o.failureMultiplier??DEFAULT_FAILURE_MULTIPLIER,this.timeoutMultiplier=o.timeoutMultiplier??DEFAULT_TIMEOUT_MULTIPLIER,this.minTimeout=o.minTimeout??DEFAULT_MIN_TIMEOUT,o.metricName!=null&&(this.metric=(tt=o.metrics)==null?void 0:tt.registerMetricGroup(o.metricName))}getTimeoutSignal(o={}){const tt=Math.max(Math.round(this.next.movingAverage*(o.timeoutFactor??this.timeoutMultiplier)),this.minTimeout),rt=AbortSignal.timeout(tt),nt=anySignal([o.signal,rt]);return setMaxListeners$2(1/0,nt,rt),nt.start=Date.now(),nt.timeout=tt,nt}cleanUp(o){var rt,nt;const tt=Date.now()-o.start;o.aborted?(this.failure.push(tt),this.next.push(tt*this.failureMultiplier),(rt=this.metric)==null||rt.update({failureMovingAverage:this.failure.movingAverage,failureDeviation:this.failure.deviation,failureForecast:this.failure.forecast,failureVariance:this.failure.variance,failure:tt})):(this.success.push(tt),this.next.push(tt),(nt=this.metric)==null||nt.update({successMovingAverage:this.success.movingAverage,successDeviation:this.success.deviation,successForecast:this.success.forecast,successVariance:this.success.variance,success:tt}))}}const DEFAULT_PING_INTERVAL_MS=1e4,PROTOCOL_VERSION="1.0.0",PROTOCOL_NAME="ping",PROTOCOL_PREFIX="ipfs",PING_LENGTH=32,DEFAULT_ABORT_CONNECTION_ON_PING_FAILURE=!0;var Vl,Hl;Hl=Symbol.toStringTag,Vl=serviceCapabilities;class ConnectionMonitor{constructor(o,tt={}){wt(this,"protocol");wt(this,"components");wt(this,"log");wt(this,"heartbeatInterval");wt(this,"pingIntervalMs");wt(this,"abortController");wt(this,"timeout");wt(this,"abortConnectionOnPingFailure");wt(this,Hl,"@libp2p/connection-monitor");wt(this,Vl,["@libp2p/connection-monitor"]);this.components=o,this.protocol=`/${tt.protocolPrefix??PROTOCOL_PREFIX}/${PROTOCOL_NAME}/${PROTOCOL_VERSION}`,this.log=o.logger.forComponent("libp2p:connection-monitor"),this.pingIntervalMs=tt.pingInterval??DEFAULT_PING_INTERVAL_MS,this.abortConnectionOnPingFailure=tt.abortConnectionOnPingFailure??DEFAULT_ABORT_CONNECTION_ON_PING_FAILURE,this.timeout=new AdaptiveTimeout({...tt.pingTimeout??{},metrics:o.metrics,metricName:"libp2p_connection_monitor_ping_time_milliseconds"})}start(){this.abortController=new AbortController,setMaxListeners(1/0,this.abortController.signal),this.heartbeatInterval=setInterval(()=>{this.components.connectionManager.getConnections().forEach(o=>{Promise.resolve().then(async()=>{var rt;let tt=Date.now();try{const nt=this.timeout.getTimeoutSignal({signal:(rt=this.abortController)==null?void 0:rt.signal}),ot=await o.newStream(this.protocol,{signal:nt,runOnLimitedConnection:!0}),it=byteStream(ot);tt=Date.now(),await Promise.all([it.write(randomBytes(PING_LENGTH),{signal:nt}),it.read(PING_LENGTH,{signal:nt})]),o.rtt=Date.now()-tt,await it.unwrap().close({signal:nt})}catch(nt){if(nt.name!=="UnsupportedProtocolError")throw nt;o.rtt=(Date.now()-tt)/2}}).catch(tt=>{this.log.error("error during heartbeat",tt),this.abortConnectionOnPingFailure?(this.log.error("aborting connection due to ping failure"),o.abort(tt)):this.log("connection ping failed, but not aborting due to abortConnectionOnPingFailure flag")})})},this.pingIntervalMs)}stop(){var o;(o=this.abortController)==null||o.abort(),this.heartbeatInterval!=null&&clearInterval(this.heartbeatInterval)}}var Wl;Wl=Symbol.toStringTag;class CompoundContentRouting{constructor(o,tt){wt(this,"routers");wt(this,"started");wt(this,"components");wt(this,Wl,"@libp2p/content-routing");this.routers=tt.routers??[],this.started=!1,this.components=o}isStarted(){return this.started}async start(){this.started=!0}async stop(){this.started=!1}async*findProviders(o,tt={}){if(this.routers.length===0)throw new NoContentRoutersError("No content routers available");const rt=this,nt=new PeerSet;for await(const ot of merge$2(...rt.routers.map(it=>it.findProviders(o,tt))))ot!=null&&(ot.multiaddrs.length>0&&await this.components.peerStore.merge(ot.id,{multiaddrs:ot.multiaddrs}),!nt.has(ot.id)&&(nt.add(ot.id),yield ot))}async provide(o,tt={}){if(this.routers.length===0)throw new NoContentRoutersError("No content routers available");await Promise.all(this.routers.map(async rt=>{await rt.provide(o,tt)}))}async put(o,tt,rt){if(!this.isStarted())throw new NotStartedError;await Promise.all(this.routers.map(async nt=>{await nt.put(o,tt,rt)}))}async get(o,tt){if(!this.isStarted())throw new NotStartedError;return Promise.any(this.routers.map(async rt=>rt.get(o,tt)))}}var Gl;Gl=Symbol.toStringTag;class DefaultPeerRouting{constructor(o,tt={}){wt(this,"log");wt(this,"peerId");wt(this,"peerStore");wt(this,"routers");wt(this,Gl,"@libp2p/peer-routing");this.log=o.logger.forComponent("libp2p:peer-routing"),this.peerId=o.peerId,this.peerStore=o.peerStore,this.routers=tt.routers??[]}async findPeer(o,tt){if(this.routers.length===0)throw new NoPeerRoutersError("No peer routers available");if(o.toString()===this.peerId.toString())throw new QueriedForSelfError("Should not try to find self");const rt=this,nt=merge$2(...this.routers.map(ot=>async function*(){try{yield await ot.findPeer(o,tt)}catch(it){rt.log.error(it)}}()));for await(const ot of nt)if(ot!=null)return ot.multiaddrs.length>0&&await this.peerStore.merge(ot.id,{multiaddrs:ot.multiaddrs}),ot;throw new NotFoundError$1}async*getClosestPeers(o,tt={}){if(this.routers.length===0)throw new NoPeerRoutersError("No peer routers available");const rt=this,nt=createScalableCuckooFilter(1024);for await(const ot of parallel(async function*(){const it=merge$2(...rt.routers.map(st=>st.getClosestPeers(o,tt)));for await(let st of it)yield async()=>{if(st.multiaddrs.length===0)try{st=await rt.findPeer(st.id,{...tt,useCache:!1})}catch(at){rt.log.error("could not find peer multiaddrs",at);return}return st}}()))ot!=null&&(ot.multiaddrs.length>0&&await this.peerStore.merge(ot.id,{multiaddrs:ot.multiaddrs}),!nt.has(ot.id.toMultihash().bytes)&&(nt.add(ot.id.toMultihash().bytes),yield ot))}}var Kl,Ql;class RandomWalk extends(Ql=TypedEventEmitter,Kl=Symbol.toStringTag,Ql){constructor(tt){super();wt(this,"peerRouting");wt(this,"log");wt(this,"walking");wt(this,"walkers");wt(this,"shutdownController");wt(this,"walkController");wt(this,"needNext");wt(this,Kl,"@libp2p/random-walk");this.log=tt.logger.forComponent("libp2p:random-walk"),this.peerRouting=tt.peerRouting,this.walkers=0,this.walking=!1,this.shutdownController=new AbortController,setMaxListeners(1/0,this.shutdownController.signal)}start(){this.shutdownController=new AbortController,setMaxListeners(1/0,this.shutdownController.signal)}stop(){this.shutdownController.abort()}async*walk(tt){var nt,ot;this.walking||this.startWalk(),this.walkers++;const rt=anySignal([this.shutdownController.signal,tt==null?void 0:tt.signal]);setMaxListeners(1/0,rt);try{for(;;)(nt=this.needNext)==null||nt.resolve(),this.needNext=pDefer(),yield(await raceEvent(this,"walk:peer",rt,{errorEvent:"walk:error"})).detail}finally{rt.clear(),this.walkers--,this.walkers===0&&((ot=this.walkController)==null||ot.abort(),this.walkController=void 0)}}startWalk(){this.walking=!0,this.walkController=new AbortController,setMaxListeners(1/0,this.walkController.signal);const tt=anySignal([this.walkController.signal,this.shutdownController.signal]);setMaxListeners(1/0,tt);const rt=Date.now();let nt=0;Promise.resolve().then(async()=>{for(this.log("start walk");this.walkers>0;)try{const ot=randomBytes(32);let it=Date.now();for await(const st of this.peerRouting.getClosestPeers(ot,{signal:tt}))tt.aborted&&this.log("aborting walk"),tt.throwIfAborted(),this.log("found peer %p after %dms for %d walkers",st.id,Date.now()-it,this.walkers),nt++,this.safeDispatchEvent("walk:peer",{detail:st}),this.walkers===1&&this.needNext!=null&&(this.log("wait for need next"),await raceSignal(this.needNext.promise,tt)),it=Date.now();this.log("walk iteration for %b and %d walkers finished, found %d peers",ot,this.walkers,nt)}catch(ot){this.log.error("randomwalk errored",ot),this.safeDispatchEvent("walk:error",{detail:ot})}this.log("no walkers left, ended walk")}).catch(ot=>{this.log.error("randomwalk errored",ot)}).finally(()=>{this.log("finished walk, found %d peers after %dms",nt,Date.now()-rt),this.walking=!1})}}const DEFAULT_MAX_INBOUND_STREAMS=32,DEFAULT_MAX_OUTBOUND_STREAMS=64;var Xl;Xl=Symbol.toStringTag;class DefaultRegistrar{constructor(o){wt(this,"log");wt(this,"topologies");wt(this,"handlers");wt(this,"components");wt(this,Xl,"@libp2p/registrar");this.log=o.logger.forComponent("libp2p:registrar"),this.topologies=new Map,this.handlers=new Map,this.components=o,this._onDisconnect=this._onDisconnect.bind(this),this._onPeerUpdate=this._onPeerUpdate.bind(this),this._onPeerIdentify=this._onPeerIdentify.bind(this),this.components.events.addEventListener("peer:disconnect",this._onDisconnect),this.components.events.addEventListener("peer:update",this._onPeerUpdate),this.components.events.addEventListener("peer:identify",this._onPeerIdentify)}getProtocols(){return Array.from(new Set([...this.handlers.keys()])).sort()}getHandler(o){const tt=this.handlers.get(o);if(tt==null)throw new UnhandledProtocolError(`No handler registered for protocol ${o}`);return tt}getTopologies(o){const tt=this.topologies.get(o);return tt==null?[]:[...tt.values()]}async handle(o,tt,rt){if(this.handlers.has(o))throw new DuplicateProtocolHandlerError(`Handler already registered for protocol ${o}`);const nt=mergeOptions$1.bind({ignoreUndefined:!0})({maxInboundStreams:DEFAULT_MAX_INBOUND_STREAMS,maxOutboundStreams:DEFAULT_MAX_OUTBOUND_STREAMS},rt);this.handlers.set(o,{handler:tt,options:nt}),await this.components.peerStore.merge(this.components.peerId,{protocols:[o]})}async unhandle(o){(Array.isArray(o)?o:[o]).forEach(rt=>{this.handlers.delete(rt)}),await this.components.peerStore.patch(this.components.peerId,{protocols:this.getProtocols()})}async register(o,tt){if(tt==null)throw new InvalidParametersError$1("invalid topology");const rt=`${(Math.random()*1e9).toString(36)}${Date.now()}`;let nt=this.topologies.get(o);return nt==null&&(nt=new Map,this.topologies.set(o,nt)),nt.set(rt,tt),rt}unregister(o){for(const[tt,rt]of this.topologies.entries())rt.has(o)&&(rt.delete(o),rt.size===0&&this.topologies.delete(tt))}_onDisconnect(o){const tt=o.detail;this.components.peerStore.get(tt).then(rt=>{var nt,ot,it;for(const st of rt.protocols){const at=this.topologies.get(st);if(at!=null)for(const ct of at.values())((nt=ct.filter)==null?void 0:nt.has(tt))!==!1&&((ot=ct.filter)==null||ot.remove(tt),(it=ct.onDisconnect)==null||it.call(ct,tt))}}).catch(rt=>{rt.name!=="NotFoundError"&&this.log.error("could not inform topologies of disconnecting peer %p",tt,rt)})}_onPeerUpdate(o){var ot,it,st;const{peer:tt,previous:rt}=o.detail,nt=((rt==null?void 0:rt.protocols)??[]).filter(at=>!tt.protocols.includes(at));for(const at of nt){const ct=this.topologies.get(at);if(ct!=null)for(const lt of ct.values())((ot=lt.filter)==null?void 0:ot.has(tt.id))!==!1&&((it=lt.filter)==null||it.remove(tt.id),(st=lt.onDisconnect)==null||st.call(lt,tt.id))}}_onPeerIdentify(o){var ot,it,st;const tt=o.detail.protocols,rt=o.detail.connection,nt=o.detail.peerId;for(const at of tt){const ct=this.topologies.get(at);if(ct!=null)for(const lt of ct.values())rt.limits!=null&&lt.notifyOnLimitedConnection!==!0||((ot=lt.filter)==null?void 0:ot.has(nt))!==!0&&((it=lt.filter)==null||it.add(nt),(st=lt.onConnect)==null||st.call(lt,nt,rt))}}}class TrackedMap extends Map{constructor(tt){super();wt(this,"metric");const{name:rt,metrics:nt}=tt;this.metric=nt.registerMetric(rt),this.updateComponentMetric()}set(tt,rt){return super.set(tt,rt),this.updateComponentMetric(),this}delete(tt){const rt=super.delete(tt);return this.updateComponentMetric(),rt}clear(){super.clear(),this.updateComponentMetric()}updateComponentMetric(){this.metric.update(this.size)}}function trackedMap(et){const{name:o,metrics:tt}=et;let rt;return tt!=null?rt=new TrackedMap({name:o,metrics:tt}):rt=new Map,rt}var Yl;Yl=Symbol.toStringTag;class DefaultTransportManager{constructor(o,tt={}){wt(this,"log");wt(this,"components");wt(this,"transports");wt(this,"listeners");wt(this,"faultTolerance");wt(this,"started");wt(this,Yl,"@libp2p/transport-manager");this.log=o.logger.forComponent("libp2p:transports"),this.components=o,this.started=!1,this.transports=new Map,this.listeners=trackedMap({name:"libp2p_transport_manager_listeners",metrics:this.components.metrics}),this.faultTolerance=tt.faultTolerance??FaultTolerance.FATAL_ALL}add(o){const tt=o[Symbol.toStringTag];if(tt==null)throw new InvalidParametersError$1("Transport must have a valid tag");if(this.transports.has(tt))throw new InvalidParametersError$1(`There is already a transport with the tag ${tt}`);this.log("adding transport %s",tt),this.transports.set(tt,o),this.listeners.has(tt)||this.listeners.set(tt,[])}isStarted(){return this.started}start(){this.started=!0}async afterStart(){const o=this.components.addressManager.getListenAddrs();await this.listen(o)}async stop(){const o=[];for(const[tt,rt]of this.listeners)for(this.log("closing listeners for %s",tt);rt.length>0;){const nt=rt.pop();nt!=null&&o.push(nt.close())}await Promise.all(o),this.log("all listeners closed");for(const tt of this.listeners.keys())this.listeners.set(tt,[]);this.started=!1}async dial(o,tt){var nt;const rt=this.dialTransportForMultiaddr(o);if(rt==null)throw new TransportUnavailableError(`No transport available for address ${String(o)}`);return(nt=tt==null?void 0:tt.onProgress)==null||nt.call(tt,new CustomProgressEvent("transport-manager:selected-transport",rt[Symbol.toStringTag])),rt.dial(o,{...tt,upgrader:this.components.upgrader})}getAddrs(){let o=[];for(const tt of this.listeners.values())for(const rt of tt)o=[...o,...rt.getAddrs()];return o}getTransports(){return Array.of(...this.transports.values())}getListeners(){return Array.of(...this.listeners.values()).flat()}dialTransportForMultiaddr(o){for(const tt of this.transports.values())if(tt.dialFilter([o]).length>0)return tt}listenTransportForMultiaddr(o){for(const tt of this.transports.values())if(tt.listenFilter([o]).length>0)return tt}async listen(o){if(!this.isStarted())throw new NotStartedError("Not started");if(o==null||o.length===0){this.log("no addresses were provided for listening, this node is dial only");return}const tt=[];for(const[rt,nt]of this.transports.entries()){const ot=nt.listenFilter(o),it=[];for(const ct of ot){this.log("creating listener for %s on %a",rt,ct);const lt=nt.createListener({upgrader:this.components.upgrader});let dt=this.listeners.get(rt)??[];dt==null&&(dt=[],this.listeners.set(rt,dt)),dt.push(lt),lt.addEventListener("listening",()=>{this.components.events.safeDispatchEvent("transport:listening",{detail:lt})}),lt.addEventListener("close",()=>{const ht=dt.findIndex(mt=>mt===lt);dt.splice(ht,1),this.components.events.safeDispatchEvent("transport:close",{detail:lt})}),it.push(lt.listen(ct))}if(it.length===0){tt.push(rt);continue}if((await Promise.allSettled(it)).find(ct=>ct.status==="fulfilled")==null&&this.faultTolerance!==FaultTolerance.NO_FATAL)throw new NoValidAddressesError(`Transport (${rt}) could not listen on any available address`)}if(tt.length===this.transports.size){const rt=`no valid addresses were provided for transports [${tt.join(", ")}]`;if(this.faultTolerance===FaultTolerance.FATAL_ALL)throw new NoValidAddressesError(rt);this.log(`libp2p in dial mode only: ${rt}`)}}async remove(o){const tt=this.listeners.get(o)??[];this.log.trace("removing transport %s",o);const rt=[];for(this.log.trace("closing listeners for %s",o);tt.length>0;){const nt=tt.pop();nt!=null&&rt.push(nt.close())}await Promise.all(rt),this.transports.delete(o),this.listeners.delete(o)}async removeAll(){const o=[];for(const tt of this.transports.keys())o.push(this.remove(tt));await Promise.all(o)}}const PROTOCOL_ID="/multistream/1.0.0",MAX_PROTOCOL_LENGTH=1024;class UnsupportedProtocolError extends Error{constructor(o="Unsupported protocol error"){super(o),this.name="UnsupportedProtocolError"}}wt(UnsupportedProtocolError,"name","UnsupportedProtocolError");class InvalidMessageError extends Error{constructor(o="Invalid message"){super(o),this.name="InvalidMessageError"}}wt(InvalidMessageError,"name","InvalidMessageError");function coerce$2(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function fromString$5(et){return new TextEncoder().encode(et)}function toString$a(et){return new TextDecoder().decode(et)}function base$2(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt<tt.length;rt++)tt[rt]=255;for(var nt=0;nt<et.length;nt++){var ot=et.charAt(nt),it=ot.charCodeAt(0);if(tt[it]!==255)throw new TypeError(ot+" is ambiguous");tt[it]=nt}var st=et.length,at=et.charAt(0),ct=Math.log(st)/Math.log(256),lt=Math.log(256)/Math.log(st);function dt(ft){if(ft instanceof Uint8Array||(ArrayBuffer.isView(ft)?ft=new Uint8Array(ft.buffer,ft.byteOffset,ft.byteLength):Array.isArray(ft)&&(ft=Uint8Array.from(ft))),!(ft instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(ft.length===0)return"";for(var pt=0,yt=0,gt=0,bt=ft.length;gt!==bt&&ft[gt]===0;)gt++,pt++;for(var xt=(bt-gt)*lt+1>>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct<yt)&&St!==-1;St--,Ct++)Et+=256*vt[St]>>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At<xt;++At)kt+=et.charAt(vt[At]);return kt}function ht(ft){if(typeof ft!="string")throw new TypeError("Expected String");if(ft.length===0)return new Uint8Array;var pt=0;if(ft[pt]!==" "){for(var yt=0,gt=0;ft[pt]===at;)yt++,pt++;for(var bt=(ft.length-pt)*ct+1>>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et<gt)&&Ct!==-1;Ct--,Et++)vt+=st*xt[Ct]>>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$3=base$2,_brrp__multiformats_scope_baseX$2=src$3;let Encoder$2=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$2=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$2(this,o)}},ComposedDecoder$2=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$2(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$2(et,o){return new ComposedDecoder$2({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$2=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$2(o,tt,rt),this.decoder=new Decoder$2(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$3({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$2(et,o,tt,rt)}function baseX$2({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$2(tt,et);return from$3({prefix:o,name:et,encode:rt,decode:ot=>coerce$2(nt(ot))})}function decode$a(et,o,tt,rt){const nt={};for(let lt=0;lt<o.length;++lt)nt[o[lt]]=lt;let ot=et.length;for(;et[ot-1]==="=";)--ot;const it=new Uint8Array(ot*tt/8|0);let st=0,at=0,ct=0;for(let lt=0;lt<ot;++lt){const dt=nt[et[lt]];if(dt===void 0)throw new SyntaxError(`Non-${rt} character`);at=at<<tt|dt,st+=tt,st>=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$9(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<<tt)-1;let ot="",it=0,st=0;for(let at=0;at<et.length;++at)for(st=st<<8|et[at],it+=8;it>tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<<tt-it]),rt)for(;ot.length*tt&7;)ot+="=";return ot}function rfc4648$2({name:et,prefix:o,bitsPerChar:tt,alphabet:rt}){return from$3({prefix:o,name:et,encode(nt){return encode$9(nt,rt,tt)},decode(nt){return decode$a(nt,rt,tt,et)}})}const base10$4=baseX$2({prefix:"9",name:"base10",alphabet:"0123456789"}),base10$5=Object.freeze(Object.defineProperty({__proto__:null,base10:base10$4},Symbol.toStringTag,{value:"Module"})),base16$4=rfc4648$2({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper$2=rfc4648$2({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),base16$5=Object.freeze(Object.defineProperty({__proto__:null,base16:base16$4,base16upper:base16upper$2},Symbol.toStringTag,{value:"Module"})),base2$4=rfc4648$2({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),base2$5=Object.freeze(Object.defineProperty({__proto__:null,base2:base2$4},Symbol.toStringTag,{value:"Module"})),alphabet$2=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),alphabetBytesToChars$2=alphabet$2.reduce((et,o,tt)=>(et[tt]=o,et),[]),alphabetCharsToBytes$2=alphabet$2.reduce((et,o,tt)=>{const rt=o.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${o}`);return et[rt]=tt,et},[]);function encode$8(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars$2[tt],o),"")}function decode$9(et){const o=[];for(const tt of et){const rt=tt.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${tt}`);const nt=alphabetCharsToBytes$2[rt];if(nt==null)throw new Error(`Non-base256emoji character: ${tt}`);o.push(nt)}return new Uint8Array(o)}const base256emoji$4=from$3({prefix:"🚀",name:"base256emoji",encode:encode$8,decode:decode$9}),base256emoji$5=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:base256emoji$4},Symbol.toStringTag,{value:"Module"})),base32$6=rfc4648$2({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper$2=rfc4648$2({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad$2=rfc4648$2({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper$2=rfc4648$2({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex$2=rfc4648$2({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper$2=rfc4648$2({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad$2=rfc4648$2({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper$2=rfc4648$2({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z$2=rfc4648$2({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$7=Object.freeze(Object.defineProperty({__proto__:null,base32:base32$6,base32hex:base32hex$2,base32hexpad:base32hexpad$2,base32hexpadupper:base32hexpadupper$2,base32hexupper:base32hexupper$2,base32pad:base32pad$2,base32padupper:base32padupper$2,base32upper:base32upper$2,base32z:base32z$2},Symbol.toStringTag,{value:"Module"})),base36$4=baseX$2({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper$2=baseX$2({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$5=Object.freeze(Object.defineProperty({__proto__:null,base36:base36$4,base36upper:base36upper$2},Symbol.toStringTag,{value:"Module"})),base58btc$2=baseX$2({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr$2=baseX$2({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58$2=Object.freeze(Object.defineProperty({__proto__:null,base58btc:base58btc$2,base58flickr:base58flickr$2},Symbol.toStringTag,{value:"Module"})),base64$6=rfc4648$2({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad$2=rfc4648$2({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url$2=rfc4648$2({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad$2=rfc4648$2({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$7=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$6,base64pad:base64pad$2,base64url:base64url$2,base64urlpad:base64urlpad$2},Symbol.toStringTag,{value:"Module"})),base8$4=rfc4648$2({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$5=Object.freeze(Object.defineProperty({__proto__:null,base8:base8$4},Symbol.toStringTag,{value:"Module"})),identity$2=from$3({prefix:"\0",name:"identity",encode:et=>toString$a(et),decode:et=>fromString$5(et)}),identityBase$2=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$2},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const bases$2={...identityBase$2,...base2$5,...base8$5,...base10$5,...base16$5,...base32$7,...base36$5,...base58$2,...base64$7,...base256emoji$5};function allocUnsafe$1(et=0){return new Uint8Array(et)}function createCodec$2(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$5=createCodec$2("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii$2=createCodec$2("ascii","a",et=>{let o="a";for(let tt=0;tt<et.length;tt++)o+=String.fromCharCode(et[tt]);return o},et=>{et=et.substring(1);const o=allocUnsafe$1(et.length);for(let tt=0;tt<et.length;tt++)o[tt]=et.charCodeAt(tt);return o}),BASES$2={utf8:string$5,"utf-8":string$5,hex:bases$2.base16,latin1:ascii$2,ascii:ascii$2,binary:ascii$2,...bases$2};function fromString$4(et,o="utf8"){const tt=BASES$2[o];if(tt==null)throw new Error(`Unsupported encoding "${o}"`);return tt.decoder.decode(`${tt.prefix}${et}`)}function toString$9(et,o="utf8"){const tt=BASES$2[o];if(tt==null)throw new Error(`Unsupported encoding "${o}"`);return tt.encoder.encode(et).substring(1)}const NewLine=fromString$4(`
`);async function write$1(et,o,tt){await et.write(o,tt)}async function writeAll(et,o,tt){await et.writeV(o,tt)}async function read(et,o){const tt=await et.read(o);if(tt.byteLength===0||tt.get(tt.byteLength-1)!==NewLine[0])throw o.log.error("Invalid mss message - missing newline",tt),new InvalidMessageError("Missing newline");return tt.sublist(0,-1)}async function readString(et,o){const tt=await read(et,o);return toString$9(tt.subarray())}async function select(et,o,tt){if(o=Array.isArray(o)?[...o]:[o],o.length===1&&tt.negotiateFully===!1)return optimisticSelect(et,o[0],tt);const rt=lpStream(et,{...tt,maxDataLength:MAX_PROTOCOL_LENGTH}),nt=o.shift();if(nt==null)throw new Error("At least one protocol must be specified");tt.log.trace('select: write ["%s", "%s"]',PROTOCOL_ID,nt);const ot=fromString$4(`${PROTOCOL_ID}
`),it=fromString$4(`${nt}
`);await writeAll(rt,[ot,it],tt),tt.log.trace("select: reading multistream-select header");let st=await readString(rt,tt);if(tt.log.trace('select: read "%s"',st),st===PROTOCOL_ID&&(tt.log.trace("select: reading protocol response"),st=await readString(rt,tt),tt.log.trace('select: read "%s"',st)),st===nt)return{stream:rt.unwrap(),protocol:nt};for(const at of o){tt.log.trace('select: write "%s"',at),await write$1(rt,fromString$4(`${at}
`),tt),tt.log.trace("select: reading protocol response");const ct=await readString(rt,tt);if(tt.log.trace('select: read "%s" for "%s"',ct,at),ct===at)return{stream:rt.unwrap(),protocol:at}}throw new UnsupportedProtocolError("protocol selection failed")}function optimisticSelect(et,o,tt){const rt=et.sink.bind(et),nt=et.source;let ot=!1,it=!1;const st=pDefer();let at=!1,ct=!1;const lt=pDefer();let dt=!1,ht=!1;const mt=pDefer(),ft=lpStream({sink:rt,source:nt},{...tt,maxDataLength:MAX_PROTOCOL_LENGTH});et.sink=async bt=>{const{sink:xt}=ft.unwrap();await xt(async function*(){let vt=!1;for await(const Et of bt){if(ct&&await lt.promise,at)yield Et;else{ct=!0,tt.log.trace('optimistic: write ["%s", "%s", data(%d)] in sink',PROTOCOL_ID,o,Et.byteLength);const Ct=`${o}
`;yield new Uint8ArrayList(Uint8Array.from([19]),fromString$4(`${PROTOCOL_ID}
`),encode$P(Ct.length),fromString$4(Ct),Et).subarray(),tt.log.trace('optimistic: wrote ["%s", "%s", data(%d)] in sink',PROTOCOL_ID,o,Et.byteLength),at=!0,ct=!1,lt.resolve(),pt().catch(St=>{tt.log.error("could not finish optimistic protocol negotiation of %s",o,St)})}vt=!0}vt||await pt()}())};async function pt(){if(it){tt.log.trace("optimistic: already negotiating %s stream",o),await st.promise;return}it=!0;try{at||(tt.log.trace("optimistic: doing send protocol for %s stream",o),await yt()),dt||(tt.log.trace("optimistic: doing read protocol for %s stream",o),await gt())}finally{it=!1,ot=!0,st.resolve()}}async function yt(){if(ct){await lt.promise;return}ct=!0;try{tt.log.trace('optimistic: write ["%s", "%s", data] in source',PROTOCOL_ID,o),await ft.writeV([fromString$4(`${PROTOCOL_ID}
`),fromString$4(`${o}
`)]),tt.log.trace('optimistic: wrote ["%s", "%s", data] in source',PROTOCOL_ID,o)}finally{at=!0,ct=!1,lt.resolve()}}async function gt(){if(ht){await mt.promise;return}ht=!0;try{tt.log.trace("optimistic: reading multistream select header");let bt=await readString(ft,tt);if(tt.log.trace('optimistic: read multistream select header "%s"',bt),bt===PROTOCOL_ID&&(bt=await readString(ft,tt)),tt.log.trace('optimistic: read protocol "%s", expecting "%s"',bt,o),bt!==o)throw new UnsupportedProtocolError("protocol selection failed")}finally{dt=!0,ht=!1,mt.resolve()}}if(et.source=async function*(){await pt(),tt.log.trace('optimistic: reading data from "%s" stream',o),yield*ft.unwrap().source}(),et.closeRead!=null){const bt=et.closeRead.bind(et);et.closeRead=async xt=>{ot||await pt().catch(vt=>{tt.log.error("could not negotiate protocol before close read",vt)}),await bt(xt)}}if(et.closeWrite!=null){const bt=et.closeWrite.bind(et);et.closeWrite=async xt=>{ot||await pt().catch(vt=>{tt.log.error("could not negotiate protocol before close write",vt)}),await bt(xt)}}if(et.close!=null){const bt=et.close.bind(et);et.close=async xt=>{const vt=[];ct&&vt.push(lt.promise),ht&&vt.push(mt.promise),vt.length>0?await raceSignal(Promise.all(vt),xt==null?void 0:xt.signal):(ot=!0,it=!1,st.resolve()),await bt(xt)}}return{stream:et,protocol:o}}async function handle(et,o,tt){o=Array.isArray(o)?o:[o],tt.log.trace("handle: available protocols %s",o);const rt=lpStream(et,{...tt,maxDataLength:MAX_PROTOCOL_LENGTH,maxLengthLength:2});for(;;){tt.log.trace("handle: reading incoming string");const nt=await readString(rt,tt);if(tt.log.trace('handle: read "%s"',nt),nt===PROTOCOL_ID){tt.log.trace('handle: respond with "%s" for "%s"',PROTOCOL_ID,nt),await write$1(rt,fromString$4(`${PROTOCOL_ID}
`),tt),tt.log.trace('handle: responded with "%s" for "%s"',PROTOCOL_ID,nt);continue}if(o.includes(nt))return tt.log.trace('handle: respond with "%s" for "%s"',nt,nt),await write$1(rt,fromString$4(`${nt}
`),tt),tt.log.trace('handle: responded with "%s" for "%s"',nt,nt),{stream:rt.unwrap(),protocol:nt};if(nt==="ls"){const ot=new Uint8ArrayList(...o.map(it=>encode$K.single(fromString$4(`${it}
`))),fromString$4(`
`));tt.log.trace('handle: respond with "%s" for %s',o,nt),await write$1(rt,ot,tt),tt.log.trace('handle: responded with "%s" for %s',o,nt);continue}tt.log.trace('handle: respond with "na" for "%s"',nt),await write$1(rt,fromString$4(`na
`),tt),tt.log('handle: responded with "na" for "%s"',nt)}}const CLOSE_TIMEOUT=500;var Zl,Jl;Jl=Symbol.toStringTag,Zl=connectionSymbol;class ConnectionImpl{constructor(o){wt(this,"id");wt(this,"remoteAddr");wt(this,"remotePeer");wt(this,"direction");wt(this,"timeline");wt(this,"multiplexer");wt(this,"encryption");wt(this,"status");wt(this,"limits");wt(this,"log");wt(this,"tags");wt(this,"_newStream");wt(this,"_close");wt(this,"_abort");wt(this,"_getStreams");wt(this,Jl,"Connection");wt(this,Zl,!0);const{remoteAddr:tt,remotePeer:rt,newStream:nt,close:ot,abort:it,getStreams:st}=o;this.id=`${parseInt(String(Math.random()*1e9)).toString(36)}${Date.now()}`,this.remoteAddr=tt,this.remotePeer=rt,this.direction=o.direction,this.status="open",this.timeline=o.timeline,this.multiplexer=o.multiplexer,this.encryption=o.encryption,this.limits=o.limits,this.log=o.logger.forComponent(`libp2p:connection:${this.direction}:${this.id}`),this.remoteAddr.getPeerId()==null&&(this.remoteAddr=this.remoteAddr.encapsulate(`/p2p/${this.remotePeer}`)),this._newStream=nt,this._close=ot,this._abort=it,this._getStreams=st,this.tags=[]}get streams(){return this._getStreams()}async newStream(o,tt){if(this.status==="closing")throw new ConnectionClosingError("the connection is being closed");if(this.status==="closed")throw new ConnectionClosedError("the connection is closed");if(Array.isArray(o)||(o=[o]),this.limits!=null&&(tt==null?void 0:tt.runOnLimitedConnection)!==!0)throw new LimitedConnectionError("Cannot open protocol stream on limited connection");const rt=await this._newStream(o,tt);return rt.direction="outbound",rt}async close(o={}){if(!(this.status==="closed"||this.status==="closing")){if(this.log("closing connection to %a",this.remoteAddr),this.status="closing",o.signal==null){const tt=AbortSignal.timeout(CLOSE_TIMEOUT);setMaxListeners(1/0,tt),o={...o,signal:tt}}try{this.log.trace("closing underlying transport"),await this._close(o),this.log.trace("updating timeline with close time"),this.status="closed",this.timeline.close=Date.now()}catch(tt){this.log.error("error encountered during graceful close of connection to %a",this.remoteAddr,tt),this.abort(tt)}}}abort(o){this.status!=="closed"&&(this.log.error("aborting connection to %a due to error",this.remoteAddr,o),this.status="closing",this._abort(o),this.status="closed",this.timeline.close=Date.now())}}function createConnection(et){return new ConnectionImpl(et)}function findIncomingStreamLimit(et,o){try{const{options:tt}=o.getHandler(et);return tt.maxInboundStreams}catch(tt){if(tt.name!=="UnhandledProtocolError")throw tt}return DEFAULT_MAX_INBOUND_STREAMS}function findOutgoingStreamLimit(et,o,tt={}){try{const{options:rt}=o.getHandler(et);if(rt.maxOutboundStreams!=null)return rt.maxOutboundStreams}catch(rt){if(rt.name!=="UnhandledProtocolError")throw rt}return tt.maxOutboundStreams??DEFAULT_MAX_OUTBOUND_STREAMS}function countStreams(et,o,tt){let rt=0;return tt.streams.forEach(nt=>{nt.direction===o&&nt.protocol===et&&rt++}),rt}var eu;eu=Symbol.toStringTag;class DefaultUpgrader{constructor(o,tt){wt(this,"components");wt(this,"connectionEncrypters");wt(this,"streamMuxers");wt(this,"inboundUpgradeTimeout");wt(this,"outboundUpgradeTimeout");wt(this,"inboundStreamProtocolNegotiationTimeout");wt(this,"outboundStreamProtocolNegotiationTimeout");wt(this,"events");wt(this,"metrics");wt(this,eu,"@libp2p/upgrader");var rt,nt;this.components=o,this.connectionEncrypters=new Map,tt.connectionEncrypters.forEach(ot=>{this.connectionEncrypters.set(ot.protocol,ot)}),this.streamMuxers=new Map,tt.streamMuxers.forEach(ot=>{this.streamMuxers.set(ot.protocol,ot)}),this.inboundUpgradeTimeout=tt.inboundUpgradeTimeout??UPGRADE_TIMEOUT,this.outboundUpgradeTimeout=tt.outboundUpgradeTimeout??UPGRADE_TIMEOUT,this.inboundStreamProtocolNegotiationTimeout=tt.inboundStreamProtocolNegotiationTimeout??PROTOCOL_NEGOTIATION_TIMEOUT,this.outboundStreamProtocolNegotiationTimeout=tt.outboundStreamProtocolNegotiationTimeout??PROTOCOL_NEGOTIATION_TIMEOUT,this.events=o.events,this.metrics={dials:(rt=o.metrics)==null?void 0:rt.registerCounterGroup("libp2p_connection_manager_dials_total"),errors:(nt=o.metrics)==null?void 0:nt.registerCounterGroup("libp2p_connection_manager_dial_errors_total")}}async shouldBlockConnection(o,...tt){const rt=this.components.connectionGater[o];if(rt==null)return;if(await rt.apply(this.components.connectionGater,tt)===!0)throw new ConnectionInterceptedError(`The multiaddr connection is blocked by gater.${o}`)}async upgradeInbound(o,tt={}){var rt,nt;try{if((rt=this.metrics.dials)==null||rt.increment({inbound:!0}),!await this.components.connectionManager.acceptIncomingConnection(o))throw new ConnectionDeniedError("connection denied");return await this.shouldBlockConnection("denyInboundConnection",o),await this._performUpgrade(o,"inbound",tt)}catch(ot){throw(nt=this.metrics.errors)==null||nt.increment({inbound:!0}),ot}finally{this.components.connectionManager.afterUpgradeInbound()}}async upgradeOutbound(o,tt={}){var rt,nt;try{(rt=this.metrics.dials)==null||rt.increment({outbound:!0});const ot=o.remoteAddr.getPeerId();let it;return ot!=null&&(it=peerIdFromString$1(ot),await this.shouldBlockConnection("denyOutboundConnection",it,o)),await this._performUpgrade(o,"outbound",tt)}catch(ot){throw(nt=this.metrics.errors)==null||nt.increment({outbound:!0}),ot}}async _performUpgrade(o,tt,rt){var ht,mt,ft;let nt,ot,it,st,at;const ct=AbortSignal.timeout(tt==="inbound"?this.inboundUpgradeTimeout:this.outboundUpgradeTimeout),lt=anySignal([ct,rt.signal]);setMaxListeners(1/0,ct,lt),rt.signal=lt,(ht=this.components.metrics)==null||ht.trackMultiaddrConnection(o),o.log.trace("starting the %s connection upgrade",tt);let dt=o;if((rt==null?void 0:rt.skipProtection)!==!0){const pt=this.components.connectionProtector;pt!=null&&(o.log("protecting the %s connection",tt),dt=await pt.protect(o,rt))}try{if(nt=dt,(rt==null?void 0:rt.skipEncryption)!==!0){(mt=rt==null?void 0:rt.onProgress)==null||mt.call(rt,new CustomProgressEvent(`upgrader:encrypt-${tt}-connection`)),{conn:nt,remotePeer:ot,protocol:at}=await(tt==="inbound"?this._encryptInbound(dt,{...rt,signal:lt}):this._encryptOutbound(dt,{...rt,signal:lt}));const pt={...dt,...nt};await this.shouldBlockConnection(tt==="inbound"?"denyInboundEncryptedConnection":"denyOutboundEncryptedConnection",ot,pt)}else{const pt=o.remoteAddr.getPeerId();if(pt==null)throw new InvalidMultiaddrError(`${tt} connection that skipped encryption must have a peer id`);const yt=peerIdFromString$1(pt);at="native",ot=yt}if(ot.equals(this.components.peerId)){const pt=new InvalidPeerIdError("Can not dial self");throw o.abort(pt),pt}if(it=nt,(rt==null?void 0:rt.muxerFactory)!=null)st=rt.muxerFactory;else if(this.streamMuxers.size>0){(ft=rt==null?void 0:rt.onProgress)==null||ft.call(rt,new CustomProgressEvent(`upgrader:multiplex-${tt}-connection`));const pt=await(tt==="inbound"?this._multiplexInbound({...dt,...nt},this.streamMuxers,rt):this._multiplexOutbound({...dt,...nt},this.streamMuxers,rt));st=pt.muxerFactory,it=pt.stream}}catch(pt){throw o.log.error("failed to upgrade inbound connection %s %a - %e",tt==="inbound"?"from":"to",o.remoteAddr,pt),pt}finally{lt.clear()}return await this.shouldBlockConnection(tt==="inbound"?"denyInboundUpgradedConnection":"denyOutboundUpgradedConnection",ot,o),o.log("successfully upgraded %s connection",tt),this._createConnection({cryptoProtocol:at,direction:tt,maConn:o,upgradedConn:it,muxerFactory:st,remotePeer:ot,limits:rt==null?void 0:rt.limits})}_createConnection(o){const{cryptoProtocol:tt,direction:rt,maConn:nt,upgradedConn:ot,remotePeer:it,muxerFactory:st,limits:at}=o;let ct,lt,dt;st!=null&&(ct=st.createStreamMuxer({direction:rt,onIncomingStream:ft=>{dt!=null&&Promise.resolve().then(async()=>{var Et;const pt=this.components.registrar.getProtocols(),yt=AbortSignal.timeout(this.inboundStreamProtocolNegotiationTimeout);setMaxListeners(1/0,yt);const{stream:gt,protocol:bt}=await handle(ft,pt,{signal:yt,log:ft.log,yieldBytes:!1});if(dt==null)return;dt.log("incoming stream opened on %s",bt);const xt=findIncomingStreamLimit(bt,this.components.registrar);if(countStreams(bt,"inbound",dt)===xt){const Ct=new TooManyInboundProtocolStreamsError(`Too many inbound protocol streams for protocol "${bt}" - limit ${xt}`);throw ft.abort(Ct),Ct}ft.source=gt.source,ft.sink=gt.sink,ft.protocol=bt,gt.closeWrite!=null&&(ft.closeWrite=gt.closeWrite),gt.closeRead!=null&&(ft.closeRead=gt.closeRead),gt.close!=null&&(ft.close=gt.close),await this.components.peerStore.merge(it,{protocols:[bt]}),(Et=this.components.metrics)==null||Et.trackProtocolStream(ft,dt),this._onStream({connection:dt,stream:ft,protocol:bt})}).catch(async pt=>{dt.log.error("error handling incoming stream id %s - %e",ft.id,pt),ft.timeline.close==null&&await ft.close()})}}),lt=async(ft,pt={})=>{var gt;if(ct==null)throw new MuxerUnavailableError("Connection is not multiplexed");dt.log.trace("starting new stream for protocols %s",ft);const yt=await ct.newStream();dt.log.trace("started new stream %s for protocols %s",yt.id,ft);try{if(pt.signal==null){yt.log("no abort signal was passed while trying to negotiate protocols %s falling back to default timeout",ft);const Ct=AbortSignal.timeout(this.outboundStreamProtocolNegotiationTimeout);setMaxListeners(1/0,Ct),pt={...pt,signal:Ct}}yt.log.trace("selecting protocol from protocols %s",ft);const{stream:bt,protocol:xt}=await select(yt,ft,{...pt,log:yt.log,yieldBytes:!0});yt.log.trace("selected protocol %s",xt);const vt=findOutgoingStreamLimit(xt,this.components.registrar,pt),Et=countStreams(xt,"outbound",dt);if(Et>=vt){const Ct=new TooManyOutboundProtocolStreamsError(`Too many outbound protocol streams for protocol "${xt}" - ${Et}/${vt}`);throw yt.abort(Ct),Ct}return await this.components.peerStore.merge(it,{protocols:[xt]}),yt.source=bt.source,yt.sink=bt.sink,yt.protocol=xt,bt.closeWrite!=null&&(yt.closeWrite=bt.closeWrite),bt.closeRead!=null&&(yt.closeRead=bt.closeRead),bt.close!=null&&(yt.close=bt.close),(gt=this.components.metrics)==null||gt.trackProtocolStream(yt,dt),yt}catch(bt){throw dt.log.error("could not create new outbound stream on connection %s %a for protocols %s - %e",rt==="inbound"?"from":"to",o.maConn.remoteAddr,ft,bt),yt.timeline.close==null&&yt.abort(bt),bt}},Promise.all([ct.sink(ot.source),ot.sink(ct.source)]).catch(ft=>{dt.log.error("error piping data through muxer - %e",ft)}));const ht=nt.timeline;nt.timeline=new Proxy(ht,{set:(...ft)=>(ft[1]==="close"&&ft[2]!=null&&ht.close==null&&(async()=>{try{dt.status==="open"&&await dt.close()}catch(pt){dt.log.error("error closing connection after timeline close %e",pt)}finally{this.events.safeDispatchEvent("connection:close",{detail:dt})}})().catch(pt=>{dt.log.error("error thrown while dispatching connection:close event %e",pt)}),Reflect.set(...ft))}),nt.timeline.upgraded=Date.now();const mt=()=>{throw new MuxerUnavailableError("Connection is not multiplexed")};return dt=createConnection({remoteAddr:nt.remoteAddr,remotePeer:it,status:"open",direction:rt,timeline:nt.timeline,multiplexer:ct==null?void 0:ct.protocol,encryption:tt,limits:at,logger:this.components.logger,newStream:lt??mt,getStreams:()=>(ct==null?void 0:ct.streams)??[],close:async ft=>{await(ct==null?void 0:ct.close(ft)),await nt.close(ft)},abort:ft=>{nt.abort(ft),ct==null||ct.abort(ft)}}),this.events.safeDispatchEvent("connection:open",{detail:dt}),dt.__maConnTimeline=ht,dt}_onStream(o){const{connection:tt,stream:rt,protocol:nt}=o,{handler:ot,options:it}=this.components.registrar.getHandler(nt);if(tt.limits!=null&&it.runOnLimitedConnection!==!0)throw new LimitedConnectionError("Cannot open protocol stream on limited connection");ot({connection:tt,stream:rt})}async _encryptInbound(o,tt){const rt=Array.from(this.connectionEncrypters.keys());try{const{stream:nt,protocol:ot}=await handle(o,rt,{...tt,log:o.log}),it=this.connectionEncrypters.get(ot);if(it==null)throw new EncryptionFailedError(`no crypto module found for ${ot}`);return o.log("encrypting inbound connection to %a using %s",o.remoteAddr,ot),{...await it.secureInbound(nt,tt),protocol:ot}}catch(nt){throw o.log.error("encrypting inbound connection from %a failed",o.remoteAddr,nt),new EncryptionFailedError(nt.message)}}async _encryptOutbound(o,tt){const rt=Array.from(this.connectionEncrypters.keys());try{o.log.trace("selecting encrypter from %s",rt);const{stream:nt,protocol:ot}=await select(o,rt,{...tt,log:o.log,yieldBytes:!0}),it=this.connectionEncrypters.get(ot);if(it==null)throw new EncryptionFailedError(`no crypto module found for ${ot}`);return o.log("encrypting outbound connection to %a using %s",o.remoteAddr,ot),{...await it.secureOutbound(nt,tt),protocol:ot}}catch(nt){throw o.log.error("encrypting outbound connection to %a failed",o.remoteAddr,nt),new EncryptionFailedError(nt.message)}}async _multiplexOutbound(o,tt,rt){const nt=Array.from(tt.keys());o.log("outbound selecting muxer %s",nt);try{o.log.trace("selecting stream muxer from %s",nt);const{stream:ot,protocol:it}=await select(o,nt,{...rt,log:o.log,yieldBytes:!0});o.log("selected %s as muxer protocol",it);const st=tt.get(it);return{stream:ot,muxerFactory:st}}catch(ot){throw o.log.error("error multiplexing outbound connection",ot),new MuxerUnavailableError(String(ot))}}async _multiplexInbound(o,tt,rt){const nt=Array.from(tt.keys());o.log("inbound handling muxers %s",nt);try{const{stream:ot,protocol:it}=await handle(o,nt,{...rt,log:o.log}),st=tt.get(it);return{stream:ot,muxerFactory:st}}catch(ot){throw o.log.error("error multiplexing inbound connection",ot),new MuxerUnavailableError(String(ot))}}}const version$3="2.1.8",name$2="libp2p";var go,Fs;class Libp2p extends TypedEventEmitter{constructor(tt){var at,ct,lt,dt,ht,mt;super();fr(this,go);wt(this,"peerId");wt(this,"peerStore");wt(this,"contentRouting");wt(this,"peerRouting");wt(this,"metrics");wt(this,"services");wt(this,"logger");wt(this,"status");wt(this,"components");wt(this,"log");this.status="stopped";const rt=new TypedEventEmitter,nt=rt.dispatchEvent.bind(rt);rt.dispatchEvent=ft=>{const pt=nt(ft),yt=this.dispatchEvent(new CustomEvent(ft.type,{detail:ft.detail}));return pt||yt},setMaxListeners(1/0,rt),this.peerId=tt.peerId,this.logger=tt.logger??defaultLogger(),this.log=this.logger.forComponent("libp2p"),this.services={};const ot=this.components=defaultComponents({peerId:tt.peerId,privateKey:tt.privateKey,nodeInfo:tt.nodeInfo??{name:name$2,version:version$3},logger:this.logger,events:rt,datastore:tt.datastore??new MemoryDatastore,connectionGater:connectionGater(tt.connectionGater),dns:tt.dns});this.peerStore=this.configureComponent("peerStore",persistentPeerStore(ot,{addressFilter:this.components.connectionGater.filterMultiaddrForPeer,...tt.peerStore})),tt.metrics!=null&&(this.metrics=this.configureComponent("metrics",tt.metrics(this.components))),ot.events.addEventListener("peer:update",ft=>{if(ft.detail.previous==null){const pt={id:ft.detail.peer.id,multiaddrs:ft.detail.peer.addresses.map(yt=>yt.multiaddr)};ot.events.safeDispatchEvent("peer:discovery",{detail:pt})}}),tt.connectionProtector!=null&&this.configureComponent("connectionProtector",tt.connectionProtector(ot)),this.components.upgrader=new DefaultUpgrader(this.components,{connectionEncrypters:(tt.connectionEncrypters??[]).map((ft,pt)=>this.configureComponent(`connection-encryption-${pt}`,ft(this.components))),streamMuxers:(tt.streamMuxers??[]).map((ft,pt)=>this.configureComponent(`stream-muxers-${pt}`,ft(this.components))),inboundUpgradeTimeout:(at=tt.connectionManager)==null?void 0:at.inboundUpgradeTimeout,outboundUpgradeTimeout:(ct=tt.connectionManager)==null?void 0:ct.outboundUpgradeTimeout}),this.configureComponent("transportManager",new DefaultTransportManager(this.components,tt.transportManager)),this.configureComponent("connectionManager",new DefaultConnectionManager(this.components,tt.connectionManager)),((lt=tt.connectionMonitor)==null?void 0:lt.enabled)!==!1&&this.configureComponent("connectionMonitor",new ConnectionMonitor(this.components,tt.connectionMonitor)),this.configureComponent("registrar",new DefaultRegistrar(this.components)),this.configureComponent("addressManager",new DefaultAddressManager(this.components,tt.addresses));const it=(tt.peerRouters??[]).map((ft,pt)=>this.configureComponent(`peer-router-${pt}`,ft(this.components)));this.peerRouting=this.components.peerRouting=this.configureComponent("peerRouting",new DefaultPeerRouting(this.components,{routers:it}));const st=(tt.contentRouters??[]).map((ft,pt)=>this.configureComponent(`content-router-${pt}`,ft(this.components)));if(this.contentRouting=this.components.contentRouting=this.configureComponent("contentRouting",new CompoundContentRouting(this.components,{routers:st})),this.configureComponent("randomWalk",new RandomWalk(this.components)),(tt.peerDiscovery??[]).forEach((ft,pt)=>{this.configureComponent(`peer-discovery-${pt}`,ft(this.components)).addEventListener("peer",gt=>{mr(this,go,Fs).call(this,gt)})}),(dt=tt.transports)==null||dt.forEach((ft,pt)=>{this.components.transportManager.add(this.configureComponent(`transport-${pt}`,ft(this.components)))}),tt.services!=null)for(const ft of Object.keys(tt.services)){const pt=tt.services[ft],yt=pt(this.components);if(yt==null){this.log.error("service factory %s returned null or undefined instance",ft);continue}this.services[ft]=yt,this.configureComponent(ft,yt),yt[contentRoutingSymbol]!=null&&(this.log("registering service %s for content routing",ft),st.push(yt[contentRoutingSymbol])),yt[peerRoutingSymbol]!=null&&(this.log("registering service %s for peer routing",ft),it.push(yt[peerRoutingSymbol])),yt[peerDiscoverySymbol]!=null&&(this.log("registering service %s for peer discovery",ft),(mt=(ht=yt[peerDiscoverySymbol]).addEventListener)==null||mt.call(ht,"peer",gt=>{mr(this,go,Fs).call(this,gt)}))}checkServiceDependencies(ot)}configureComponent(tt,rt){return rt==null&&this.log.error("component %s was null or undefined",tt),this.components[tt]=rt,rt}async start(){var tt,rt,nt,ot;if(this.status==="stopped"){this.status="starting",this.log("libp2p is starting");try{await((rt=(tt=this.components).beforeStart)==null?void 0:rt.call(tt)),await this.components.start(),await((ot=(nt=this.components).afterStart)==null?void 0:ot.call(nt)),this.status="started",this.safeDispatchEvent("start",{detail:this}),this.log("libp2p has started")}catch(it){throw this.log.error("An error occurred starting libp2p",it),this.status="started",await this.stop(),it}}}async stop(){var tt,rt,nt,ot;this.status==="started"&&(this.log("libp2p is stopping"),this.status="stopping",await((rt=(tt=this.components).beforeStop)==null?void 0:rt.call(tt)),await this.components.stop(),await((ot=(nt=this.components).afterStop)==null?void 0:ot.call(nt)),this.status="stopped",this.safeDispatchEvent("stop",{detail:this}),this.log("libp2p has stopped"))}getConnections(tt){return this.components.connectionManager.getConnections(tt)}getDialQueue(){return this.components.connectionManager.getDialQueue()}getPeers(){const tt=new PeerSet;for(const rt of this.components.connectionManager.getConnections())tt.add(rt.remotePeer);return Array.from(tt)}async dial(tt,rt={}){return this.components.connectionManager.openConnection(tt,{priority:75,...rt})}async dialProtocol(tt,rt,nt={}){if(rt==null)throw new InvalidParametersError$1("no protocols were provided to open a stream");if(rt=Array.isArray(rt)?rt:[rt],rt.length===0)throw new InvalidParametersError$1("no protocols were provided to open a stream");return(await this.dial(tt,nt)).newStream(rt,nt)}getMultiaddrs(){return this.components.addressManager.getAddresses()}getProtocols(){return this.components.registrar.getProtocols()}async hangUp(tt,rt={}){isMultiaddr(tt)&&(tt=peerIdFromString$1(tt.getPeerId()??"")),await this.components.connectionManager.closeConnections(tt,rt)}async getPublicKey(tt,rt={}){if(this.log("getPublicKey %p",tt),tt.publicKey!=null)return tt.publicKey;try{const st=await this.peerStore.get(tt);if(st.id.publicKey!=null)return st.id.publicKey}catch(st){if(st.name!=="NotFoundError")throw st}const nt=concat([fromString$6("/pk/"),tt.toMultihash().bytes]),ot=await this.contentRouting.get(nt,rt),it=publicKeyFromProtobuf(ot);return await this.peerStore.patch(tt,{publicKey:it}),it}async handle(tt,rt,nt){Array.isArray(tt)||(tt=[tt]),await Promise.all(tt.map(async ot=>{await this.components.registrar.handle(ot,rt,nt)}))}async unhandle(tt){Array.isArray(tt)||(tt=[tt]),await Promise.all(tt.map(async rt=>{await this.components.registrar.unhandle(rt)}))}async register(tt,rt){return this.components.registrar.register(tt,rt)}unregister(tt){this.components.registrar.unregister(tt)}async isDialable(tt,rt={}){return this.components.connectionManager.isDialable(tt,rt)}}go=new WeakSet,Fs=function(tt){const{detail:rt}=tt;if(rt.id.toString()===this.peerId.toString()){this.log.error("peer discovery mechanism discovered self");return}this.components.peerStore.merge(rt.id,{multiaddrs:rt.multiaddrs}).catch(nt=>{this.log.error(nt)})};async function createLibp2p(et={}){et.privateKey??(et.privateKey=await generateKeyPair());const o=new Libp2p({...await validateConfig(et),peerId:peerIdFromPrivateKey(et.privateKey)});return et.start!==!1&&await o.start(),o}const enrTree={SANDBOX:"enrtree://AIRVQ5DDA4FFWLRBCHJWUWOO6X6S4ZTZ5B667LQ6AJU6PEYDLRD5O@sandbox.waku.nodes.status.im",TEST:"enrtree://AOGYWMBYOUIMOENHXCHILPKY3ZRFEULMFI4DOM442QSZ73TT2A7VI@test.waku.nodes.status.im"},DEFAULT_BOOTSTRAP_TAG_NAME="bootstrap",DEFAULT_BOOTSTRAP_TAG_VALUE=50,DEFAULT_BOOTSTRAP_TAG_TTL=1e8,DEFAULT_NODE_REQUIREMENTS={store:1,filter:2,lightPush:2},ERR_INVALID_ID="Invalid record id",MULTIADDR_LENGTH_SIZE=2,__viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"}));/*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */const _0n=BigInt(0),_1n=BigInt(1),_2n=BigInt(2),_3n=BigInt(3),_8n=BigInt(8),CURVE=Object.freeze({a:_0n,b:BigInt(7),P:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:_1n,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")}),divNearest=(et,o)=>(et+o/_2n)/o,endo={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar(et){const{n:o}=CURVE,tt=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),rt=-_1n*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),nt=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),ot=tt,it=BigInt("0x100000000000000000000000000000000"),st=divNearest(ot*et,o),at=divNearest(-rt*et,o);let ct=mod(et-st*tt-at*nt,o),lt=mod(-st*rt-at*ot,o);const dt=ct>it,ht=lt>it;if(dt&&(ct=o-ct),ht&&(lt=o-lt),ct>it||lt>it)throw new Error("splitScalarEndo: Endomorphism failed, k="+et);return{k1neg:dt,k1:ct,k2neg:ht,k2:lt}}},fieldLen=32,groupLen=32,hashLen=32,compressedLen=fieldLen+1,uncompressedLen=2*fieldLen+1;function weierstrass(et){const{a:o,b:tt}=CURVE,rt=mod(et*et),nt=mod(rt*et);return mod(nt+o*et+tt)}const USE_ENDOMORPHISM=CURVE.a===_0n;class ShaError extends Error{constructor(o){super(o)}}function assertJacPoint(et){if(!(et instanceof JacobianPoint))throw new TypeError("JacobianPoint expected")}class JacobianPoint{constructor(o,tt,rt){this.x=o,this.y=tt,this.z=rt}static fromAffine(o){if(!(o instanceof Point))throw new TypeError("JacobianPoint#fromAffine: expected Point");return o.equals(Point.ZERO)?JacobianPoint.ZERO:new JacobianPoint(o.x,o.y,_1n)}static toAffineBatch(o){const tt=invertBatch(o.map(rt=>rt.z));return o.map((rt,nt)=>rt.toAffine(tt[nt]))}static normalizeZ(o){return JacobianPoint.toAffineBatch(o).map(JacobianPoint.fromAffine)}equals(o){assertJacPoint(o);const{x:tt,y:rt,z:nt}=this,{x:ot,y:it,z:st}=o,at=mod(nt*nt),ct=mod(st*st),lt=mod(tt*ct),dt=mod(ot*at),ht=mod(mod(rt*st)*ct),mt=mod(mod(it*nt)*at);return lt===dt&&ht===mt}negate(){return new JacobianPoint(this.x,mod(-this.y),this.z)}double(){const{x:o,y:tt,z:rt}=this,nt=mod(o*o),ot=mod(tt*tt),it=mod(ot*ot),st=o+ot,at=mod(_2n*(mod(st*st)-nt-it)),ct=mod(_3n*nt),lt=mod(ct*ct),dt=mod(lt-_2n*at),ht=mod(ct*(at-dt)-_8n*it),mt=mod(_2n*tt*rt);return new JacobianPoint(dt,ht,mt)}add(o){assertJacPoint(o);const{x:tt,y:rt,z:nt}=this,{x:ot,y:it,z:st}=o;if(ot===_0n||it===_0n)return this;if(tt===_0n||rt===_0n)return o;const at=mod(nt*nt),ct=mod(st*st),lt=mod(tt*ct),dt=mod(ot*at),ht=mod(mod(rt*st)*ct),mt=mod(mod(it*nt)*at),ft=mod(dt-lt),pt=mod(mt-ht);if(ft===_0n)return pt===_0n?this.double():JacobianPoint.ZERO;const yt=mod(ft*ft),gt=mod(ft*yt),bt=mod(lt*yt),xt=mod(pt*pt-gt-_2n*bt),vt=mod(pt*(bt-xt)-ht*gt),Et=mod(nt*st*ft);return new JacobianPoint(xt,vt,Et)}subtract(o){return this.add(o.negate())}multiplyUnsafe(o){const tt=JacobianPoint.ZERO;if(typeof o=="bigint"&&o===_0n)return tt;let rt=normalizeScalar(o);if(rt===_1n)return this;if(!USE_ENDOMORPHISM){let dt=tt,ht=this;for(;rt>_0n;)rt&_1n&&(dt=dt.add(ht)),ht=ht.double(),rt>>=_1n;return dt}let{k1neg:nt,k1:ot,k2neg:it,k2:st}=endo.splitScalar(rt),at=tt,ct=tt,lt=this;for(;ot>_0n||st>_0n;)ot&_1n&&(at=at.add(lt)),st&_1n&&(ct=ct.add(lt)),lt=lt.double(),ot>>=_1n,st>>=_1n;return nt&&(at=at.negate()),it&&(ct=ct.negate()),ct=new JacobianPoint(mod(ct.x*endo.beta),ct.y,ct.z),at.add(ct)}precomputeWindow(o){const tt=USE_ENDOMORPHISM?128/o+1:256/o+1,rt=[];let nt=this,ot=nt;for(let it=0;it<tt;it++){ot=nt,rt.push(ot);for(let st=1;st<2**(o-1);st++)ot=ot.add(nt),rt.push(ot);nt=ot.double()}return rt}wNAF(o,tt){!tt&&this.equals(JacobianPoint.BASE)&&(tt=Point.BASE);const rt=tt&&tt._WINDOW_SIZE||1;if(256%rt)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let nt=tt&&pointPrecomputes.get(tt);nt||(nt=this.precomputeWindow(rt),tt&&rt!==1&&(nt=JacobianPoint.normalizeZ(nt),pointPrecomputes.set(tt,nt)));let ot=JacobianPoint.ZERO,it=JacobianPoint.BASE;const st=1+(USE_ENDOMORPHISM?128/rt:256/rt),at=2**(rt-1),ct=BigInt(2**rt-1),lt=2**rt,dt=BigInt(rt);for(let ht=0;ht<st;ht++){const mt=ht*at;let ft=Number(o&ct);o>>=dt,ft>at&&(ft-=lt,o+=_1n);const pt=mt,yt=mt+Math.abs(ft)-1,gt=ht%2!==0,bt=ft<0;ft===0?it=it.add(constTimeNegate(gt,nt[pt])):ot=ot.add(constTimeNegate(bt,nt[yt]))}return{p:ot,f:it}}multiply(o,tt){let rt=normalizeScalar(o),nt,ot;if(USE_ENDOMORPHISM){const{k1neg:it,k1:st,k2neg:at,k2:ct}=endo.splitScalar(rt);let{p:lt,f:dt}=this.wNAF(st,tt),{p:ht,f:mt}=this.wNAF(ct,tt);lt=constTimeNegate(it,lt),ht=constTimeNegate(at,ht),ht=new JacobianPoint(mod(ht.x*endo.beta),ht.y,ht.z),nt=lt.add(ht),ot=dt.add(mt)}else{const{p:it,f:st}=this.wNAF(rt,tt);nt=it,ot=st}return JacobianPoint.normalizeZ([nt,ot])[0]}toAffine(o){const{x:tt,y:rt,z:nt}=this,ot=this.equals(JacobianPoint.ZERO);o==null&&(o=ot?_8n:invert(nt));const it=o,st=mod(it*it),at=mod(st*it),ct=mod(tt*st),lt=mod(rt*at),dt=mod(nt*it);if(ot)return Point.ZERO;if(dt!==_1n)throw new Error("invZ was invalid");return new Point(ct,lt)}}JacobianPoint.BASE=new JacobianPoint(CURVE.Gx,CURVE.Gy,_1n);JacobianPoint.ZERO=new JacobianPoint(_0n,_1n,_0n);function constTimeNegate(et,o){const tt=o.negate();return et?tt:o}const pointPrecomputes=new WeakMap;class Point{constructor(o,tt){this.x=o,this.y=tt}_setWindowSize(o){this._WINDOW_SIZE=o,pointPrecomputes.delete(this)}hasEvenY(){return this.y%_2n===_0n}static fromCompressedHex(o){const tt=o.length===32,rt=bytesToNumber(tt?o:o.subarray(1));if(!isValidFieldElement(rt))throw new Error("Point is not on curve");const nt=weierstrass(rt);let ot=sqrtMod(nt);const it=(ot&_1n)===_1n;tt?it&&(ot=mod(-ot)):(o[0]&1)===1!==it&&(ot=mod(-ot));const st=new Point(rt,ot);return st.assertValidity(),st}static fromUncompressedHex(o){const tt=bytesToNumber(o.subarray(1,fieldLen+1)),rt=bytesToNumber(o.subarray(fieldLen+1,fieldLen*2+1)),nt=new Point(tt,rt);return nt.assertValidity(),nt}static fromHex(o){const tt=ensureBytes(o),rt=tt.length,nt=tt[0];if(rt===fieldLen)return this.fromCompressedHex(tt);if(rt===compressedLen&&(nt===2||nt===3))return this.fromCompressedHex(tt);if(rt===uncompressedLen&&nt===4)return this.fromUncompressedHex(tt);throw new Error(`Point.fromHex: received invalid point. Expected 32-${compressedLen} compressed bytes or ${uncompressedLen} uncompressed bytes, not ${rt}`)}static fromPrivateKey(o){return Point.BASE.multiply(normalizePrivateKey(o))}static fromSignature(o,tt,rt){const{r:nt,s:ot}=normalizeSignature(tt);if(![0,1,2,3].includes(rt))throw new Error("Cannot recover: invalid recovery bit");const it=truncateHash(ensureBytes(o)),{n:st}=CURVE,at=rt===2||rt===3?nt+st:nt,ct=invert(at,st),lt=mod(-it*ct,st),dt=mod(ot*ct,st),ht=rt&1?"03":"02",mt=Point.fromHex(ht+numTo32bStr(at)),ft=Point.BASE.multiplyAndAddUnsafe(mt,lt,dt);if(!ft)throw new Error("Cannot recover signature: point at infinify");return ft.assertValidity(),ft}toRawBytes(o=!1){return hexToBytes(this.toHex(o))}toHex(o=!1){const tt=numTo32bStr(this.x);return o?`${this.hasEvenY()?"02":"03"}${tt}`:`04${tt}${numTo32bStr(this.y)}`}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){const o="Point is not on elliptic curve",{x:tt,y:rt}=this;if(!isValidFieldElement(tt)||!isValidFieldElement(rt))throw new Error(o);const nt=mod(rt*rt),ot=weierstrass(tt);if(mod(nt-ot)!==_0n)throw new Error(o)}equals(o){return this.x===o.x&&this.y===o.y}negate(){return new Point(this.x,mod(-this.y))}double(){return JacobianPoint.fromAffine(this).double().toAffine()}add(o){return JacobianPoint.fromAffine(this).add(JacobianPoint.fromAffine(o)).toAffine()}subtract(o){return this.add(o.negate())}multiply(o){return JacobianPoint.fromAffine(this).multiply(o,this).toAffine()}multiplyAndAddUnsafe(o,tt,rt){const nt=JacobianPoint.fromAffine(this),ot=tt===_0n||tt===_1n||this!==Point.BASE?nt.multiplyUnsafe(tt):nt.multiply(tt),it=JacobianPoint.fromAffine(o).multiplyUnsafe(rt),st=ot.add(it);return st.equals(JacobianPoint.ZERO)?void 0:st.toAffine()}}Point.BASE=new Point(CURVE.Gx,CURVE.Gy);Point.ZERO=new Point(_0n,_0n);function sliceDER(et){return Number.parseInt(et[0],16)>=8?"00"+et:et}function parseDERInt(et){if(et.length<2||et[0]!==2)throw new Error(`Invalid signature integer tag: ${bytesToHex(et)}`);const o=et[1],tt=et.subarray(2,o+2);if(!o||tt.length!==o)throw new Error("Invalid signature integer: wrong length");if(tt[0]===0&&tt[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:bytesToNumber(tt),left:et.subarray(o+2)}}function parseDERSignature(et){if(et.length<2||et[0]!=48)throw new Error(`Invalid signature tag: ${bytesToHex(et)}`);if(et[1]!==et.length-2)throw new Error("Invalid signature: incorrect length");const{data:o,left:tt}=parseDERInt(et.subarray(2)),{data:rt,left:nt}=parseDERInt(tt);if(nt.length)throw new Error(`Invalid signature: left bytes after parsing: ${bytesToHex(nt)}`);return{r:o,s:rt}}class Signature{constructor(o,tt){this.r=o,this.s=tt,this.assertValidity()}static fromCompact(o){const tt=o instanceof Uint8Array,rt="Signature.fromCompact";if(typeof o!="string"&&!tt)throw new TypeError(`${rt}: Expected string or Uint8Array`);const nt=tt?bytesToHex(o):o;if(nt.length!==128)throw new Error(`${rt}: Expected 64-byte hex`);return new Signature(hexToNumber(nt.slice(0,64)),hexToNumber(nt.slice(64,128)))}static fromDER(o){const tt=o instanceof Uint8Array;if(typeof o!="string"&&!tt)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");const{r:rt,s:nt}=parseDERSignature(tt?o:hexToBytes(o));return new Signature(rt,nt)}static fromHex(o){return this.fromDER(o)}assertValidity(){const{r:o,s:tt}=this;if(!isWithinCurveOrder(o))throw new Error("Invalid Signature: r must be 0 < r < n");if(!isWithinCurveOrder(tt))throw new Error("Invalid Signature: s must be 0 < s < n")}hasHighS(){const o=CURVE.n>>_1n;return this.s>o}normalizeS(){return this.hasHighS()?new Signature(this.r,mod(-this.s,CURVE.n)):this}toDERRawBytes(){return hexToBytes(this.toDERHex())}toDERHex(){const o=sliceDER(numberToHexUnpadded(this.s)),tt=sliceDER(numberToHexUnpadded(this.r)),rt=o.length/2,nt=tt.length/2,ot=numberToHexUnpadded(rt),it=numberToHexUnpadded(nt);return`30${numberToHexUnpadded(nt+rt+4)}02${it}${tt}02${ot}${o}`}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return hexToBytes(this.toCompactHex())}toCompactHex(){return numTo32bStr(this.r)+numTo32bStr(this.s)}}function concatBytes(...et){if(!et.every(rt=>rt instanceof Uint8Array))throw new Error("Uint8Array list expected");if(et.length===1)return et[0];const o=et.reduce((rt,nt)=>rt+nt.length,0),tt=new Uint8Array(o);for(let rt=0,nt=0;rt<et.length;rt++){const ot=et[rt];tt.set(ot,nt),nt+=ot.length}return tt}const hexes=Array.from({length:256},(et,o)=>o.toString(16).padStart(2,"0"));function bytesToHex(et){if(!(et instanceof Uint8Array))throw new Error("Expected Uint8Array");let o="";for(let tt=0;tt<et.length;tt++)o+=hexes[et[tt]];return o}const POW_2_256=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000");function numTo32bStr(et){if(typeof et!="bigint")throw new Error("Expected bigint");if(!(_0n<=et&&et<POW_2_256))throw new Error("Expected number 0 <= n < 2^256");return et.toString(16).padStart(64,"0")}function numTo32b(et){const o=hexToBytes(numTo32bStr(et));if(o.length!==32)throw new Error("Error: expected 32 bytes");return o}function numberToHexUnpadded(et){const o=et.toString(16);return o.length&1?`0${o}`:o}function hexToNumber(et){if(typeof et!="string")throw new TypeError("hexToNumber: expected string, got "+typeof et);return BigInt(`0x${et}`)}function hexToBytes(et){if(typeof et!="string")throw new TypeError("hexToBytes: expected string, got "+typeof et);if(et.length%2)throw new Error("hexToBytes: received invalid unpadded hex"+et.length);const o=new Uint8Array(et.length/2);for(let tt=0;tt<o.length;tt++){const rt=tt*2,nt=et.slice(rt,rt+2),ot=Number.parseInt(nt,16);if(Number.isNaN(ot)||ot<0)throw new Error("Invalid byte sequence");o[tt]=ot}return o}function bytesToNumber(et){return hexToNumber(bytesToHex(et))}function ensureBytes(et){return et instanceof Uint8Array?Uint8Array.from(et):hexToBytes(et)}function normalizeScalar(et){if(typeof et=="number"&&Number.isSafeInteger(et)&&et>0)return BigInt(et);if(typeof et=="bigint"&&isWithinCurveOrder(et))return et;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function mod(et,o=CURVE.P){const tt=et%o;return tt>=_0n?tt:o+tt}function pow2(et,o){const{P:tt}=CURVE;let rt=et;for(;o-- >_0n;)rt*=rt,rt%=tt;return rt}function sqrtMod(et){const{P:o}=CURVE,tt=BigInt(6),rt=BigInt(11),nt=BigInt(22),ot=BigInt(23),it=BigInt(44),st=BigInt(88),at=et*et*et%o,ct=at*at*et%o,lt=pow2(ct,_3n)*ct%o,dt=pow2(lt,_3n)*ct%o,ht=pow2(dt,_2n)*at%o,mt=pow2(ht,rt)*ht%o,ft=pow2(mt,nt)*mt%o,pt=pow2(ft,it)*ft%o,yt=pow2(pt,st)*pt%o,gt=pow2(yt,it)*ft%o,bt=pow2(gt,_3n)*ct%o,xt=pow2(bt,ot)*mt%o,vt=pow2(xt,tt)*at%o,Et=pow2(vt,_2n);if(Et*Et%o!==et)throw new Error("Cannot find square root");return Et}function invert(et,o=CURVE.P){if(et===_0n||o<=_0n)throw new Error(`invert: expected positive integers, got n=${et} mod=${o}`);let tt=mod(et,o),rt=o,nt=_0n,ot=_1n;for(;tt!==_0n;){const st=rt/tt,at=rt%tt,ct=nt-ot*st;rt=tt,tt=at,nt=ot,ot=ct}if(rt!==_1n)throw new Error("invert: does not exist");return mod(nt,o)}function invertBatch(et,o=CURVE.P){const tt=new Array(et.length),rt=et.reduce((ot,it,st)=>it===_0n?ot:(tt[st]=ot,mod(ot*it,o)),_1n),nt=invert(rt,o);return et.reduceRight((ot,it,st)=>it===_0n?ot:(tt[st]=mod(ot*tt[st],o),mod(ot*it,o)),nt),tt}function bits2int_2(et){const o=et.length*8-groupLen*8,tt=bytesToNumber(et);return o>0?tt>>BigInt(o):tt}function truncateHash(et,o=!1){const tt=bits2int_2(et);if(o)return tt;const{n:rt}=CURVE;return tt>=rt?tt-rt:tt}let _sha256Sync,_hmacSha256Sync;class HmacDrbg{constructor(o,tt){if(this.hashLen=o,this.qByteLen=tt,typeof o!="number"||o<2)throw new Error("hashLen must be a number");if(typeof tt!="number"||tt<2)throw new Error("qByteLen must be a number");this.v=new Uint8Array(o).fill(1),this.k=new Uint8Array(o).fill(0),this.counter=0}hmac(...o){return utils.hmacSha256(this.k,...o)}hmacSync(...o){return _hmacSha256Sync(this.k,...o)}checkSync(){if(typeof _hmacSha256Sync!="function")throw new ShaError("hmacSha256Sync needs to be set")}incr(){if(this.counter>=1e3)throw new Error("Tried 1,000 k values for sign(), all were invalid");this.counter+=1}async reseed(o=new Uint8Array){this.k=await this.hmac(this.v,Uint8Array.from([0]),o),this.v=await this.hmac(this.v),o.length!==0&&(this.k=await this.hmac(this.v,Uint8Array.from([1]),o),this.v=await this.hmac(this.v))}reseedSync(o=new Uint8Array){this.checkSync(),this.k=this.hmacSync(this.v,Uint8Array.from([0]),o),this.v=this.hmacSync(this.v),o.length!==0&&(this.k=this.hmacSync(this.v,Uint8Array.from([1]),o),this.v=this.hmacSync(this.v))}async generate(){this.incr();let o=0;const tt=[];for(;o<this.qByteLen;){this.v=await this.hmac(this.v);const rt=this.v.slice();tt.push(rt),o+=this.v.length}return concatBytes(...tt)}generateSync(){this.checkSync(),this.incr();let o=0;const tt=[];for(;o<this.qByteLen;){this.v=this.hmacSync(this.v);const rt=this.v.slice();tt.push(rt),o+=this.v.length}return concatBytes(...tt)}}function isWithinCurveOrder(et){return _0n<et&&et<CURVE.n}function isValidFieldElement(et){return _0n<et&&et<CURVE.P}function kmdToSig(et,o,tt,rt=!0){const{n:nt}=CURVE,ot=truncateHash(et,!0);if(!isWithinCurveOrder(ot))return;const it=invert(ot,nt),st=Point.BASE.multiply(ot),at=mod(st.x,nt);if(at===_0n)return;const ct=mod(it*mod(o+tt*at,nt),nt);if(ct===_0n)return;let lt=new Signature(at,ct),dt=(st.x===lt.r?0:2)|Number(st.y&_1n);return rt&&lt.hasHighS()&&(lt=lt.normalizeS(),dt^=1),{sig:lt,recovery:dt}}function normalizePrivateKey(et){let o;if(typeof et=="bigint")o=et;else if(typeof et=="number"&&Number.isSafeInteger(et)&&et>0)o=BigInt(et);else if(typeof et=="string"){if(et.length!==2*groupLen)throw new Error("Expected 32 bytes of private key");o=hexToNumber(et)}else if(et instanceof Uint8Array){if(et.length!==groupLen)throw new Error("Expected 32 bytes of private key");o=bytesToNumber(et)}else throw new TypeError("Expected valid private key");if(!isWithinCurveOrder(o))throw new Error("Expected private key: 0 < key < n");return o}function normalizePublicKey(et){return et instanceof Point?(et.assertValidity(),et):Point.fromHex(et)}function normalizeSignature(et){if(et instanceof Signature)return et.assertValidity(),et;try{return Signature.fromDER(et)}catch{return Signature.fromCompact(et)}}function bits2int(et){const o=et.length>fieldLen?et.slice(0,fieldLen):et;return bytesToNumber(o)}function bits2octets(et){const o=bits2int(et),tt=mod(o,CURVE.n);return int2octets(tt<_0n?o:tt)}function int2octets(et){return numTo32b(et)}function initSigArgs(et,o,tt){if(et==null)throw new Error(`sign: expected valid message hash, not "${et}"`);const rt=ensureBytes(et),nt=normalizePrivateKey(o),ot=[int2octets(nt),bits2octets(rt)];if(tt!=null){tt===!0&&(tt=utils.randomBytes(fieldLen));const at=ensureBytes(tt);if(at.length!==fieldLen)throw new Error(`sign: Expected ${fieldLen} bytes of extra data`);ot.push(at)}const it=concatBytes(...ot),st=bits2int(rt);return{seed:it,m:st,d:nt}}function finalizeSig(et,o){const{sig:tt,recovery:rt}=et,{der:nt,recovered:ot}=Object.assign({canonical:!0,der:!0},o),it=nt?tt.toDERRawBytes():tt.toCompactRawBytes();return ot?[it,rt]:it}async function sign$1(et,o,tt={}){const{seed:rt,m:nt,d:ot}=initSigArgs(et,o,tt.extraEntropy),it=new HmacDrbg(hashLen,groupLen);await it.reseed(rt);let st;for(;!(st=kmdToSig(await it.generate(),nt,ot,tt.canonical));)await it.reseed();return finalizeSig(st,tt)}const vopts={strict:!0};function verify(et,o,tt,rt=vopts){let nt;try{nt=normalizeSignature(et),o=ensureBytes(o)}catch{return!1}const{r:ot,s:it}=nt;if(rt.strict&&nt.hasHighS())return!1;const st=truncateHash(o);let at;try{at=normalizePublicKey(tt)}catch{return!1}const{n:ct}=CURVE,lt=invert(it,ct),dt=mod(st*lt,ct),ht=mod(ot*lt,ct),mt=Point.BASE.multiplyAndAddUnsafe(at,dt,ht);return mt?mod(mt.x,ct)===ot:!1}Point.BASE._setWindowSize(8);const crypto$1={node:__viteBrowserExternal$1,web:typeof self=="object"&&"crypto"in self?self.crypto:void 0},TAGGED_HASH_PREFIXES={},utils={bytesToHex,hexToBytes,concatBytes,mod,invert,isValidPrivateKey(et){try{return normalizePrivateKey(et),!0}catch{return!1}},_bigintTo32Bytes:numTo32b,_normalizePrivateKey:normalizePrivateKey,hashToPrivateKey:et=>{et=ensureBytes(et);const o=groupLen+8;if(et.length<o||et.length>1024)throw new Error("Expected valid bytes of private key as per FIPS 186");const tt=mod(bytesToNumber(et),CURVE.n-_1n)+_1n;return numTo32b(tt)},randomBytes:(et=32)=>{if(crypto$1.web)return crypto$1.web.getRandomValues(new Uint8Array(et));if(crypto$1.node){const{randomBytes:o}=crypto$1.node;return Uint8Array.from(o(et))}else throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>utils.hashToPrivateKey(utils.randomBytes(groupLen+8)),precompute(et=8,o=Point.BASE){const tt=o===Point.BASE?o:new Point(o.x,o.y);return tt._setWindowSize(et),tt.multiply(_3n),tt},sha256:async(...et)=>{if(crypto$1.web){const o=await crypto$1.web.subtle.digest("SHA-256",concatBytes(...et));return new Uint8Array(o)}else if(crypto$1.node){const{createHash:o}=crypto$1.node,tt=o("sha256");return et.forEach(rt=>tt.update(rt)),Uint8Array.from(tt.digest())}else throw new Error("The environment doesn't have sha256 function")},hmacSha256:async(et,...o)=>{if(crypto$1.web){const tt=await crypto$1.web.subtle.importKey("raw",et,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),rt=concatBytes(...o),nt=await crypto$1.web.subtle.sign("HMAC",tt,rt);return new Uint8Array(nt)}else if(crypto$1.node){const{createHmac:tt}=crypto$1.node,rt=tt("sha256",et);return o.forEach(nt=>rt.update(nt)),Uint8Array.from(rt.digest())}else throw new Error("The environment doesn't have hmac-sha256 function")},sha256Sync:void 0,hmacSha256Sync:void 0,taggedHash:async(et,...o)=>{let tt=TAGGED_HASH_PREFIXES[et];if(tt===void 0){const rt=await utils.sha256(Uint8Array.from(et,nt=>nt.charCodeAt(0)));tt=concatBytes(rt,rt),TAGGED_HASH_PREFIXES[et]=tt}return utils.sha256(tt,...o)},taggedHashSync:(et,...o)=>{if(typeof _sha256Sync!="function")throw new ShaError("sha256Sync is undefined, you need to set it");let tt=TAGGED_HASH_PREFIXES[et];if(tt===void 0){const rt=_sha256Sync(Uint8Array.from(et,nt=>nt.charCodeAt(0)));tt=concatBytes(rt,rt),TAGGED_HASH_PREFIXES[et]=tt}return _sha256Sync(tt,...o)},_JacobianPoint:JacobianPoint};Object.defineProperties(utils,{sha256Sync:{configurable:!1,get(){return _sha256Sync},set(et){_sha256Sync||(_sha256Sync=et)}},hmacSha256Sync:{configurable:!1,get(){return _hmacSha256Sync},set(et){_hmacSha256Sync||(_hmacSha256Sync=et)}}});var sha3$1={exports:{}};(function(et){var o={env:{NODE_ENV:'"production"',VITE_WALLETCONNECT_PROJECT_ID:'"1d93edc21291f98e3bed6ff7617ff539"'},nextTick:"setImmediate",platform:'"browser"',version:'"v16.0.0"',browser:!0};/**
* [js-sha3]{@link https://github.com/emn178/js-sha3}
*
* @version 0.9.3
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2015-2023
* @license MIT
*/(function(){var tt="input is invalid type",rt="finalize already called",nt=typeof window=="object",ot=nt?window:{};ot.JS_SHA3_NO_WINDOW&&(nt=!1);var it=!nt&&typeof self=="object",st=!ot.JS_SHA3_NO_NODE_JS&&typeof o=="object"&&o.versions&&o.versions.node;st?ot=globalThis:it&&(ot=self);for(var at=!ot.JS_SHA3_NO_COMMON_JS&&!0&&et.exports,ct=!ot.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",lt="0123456789abcdef".split(""),dt=[31,7936,2031616,520093696],ht=[4,1024,262144,67108864],mt=[1,256,65536,16777216],ft=[6,1536,393216,100663296],pt=[0,8,16,24],yt=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],gt=[224,256,384,512],bt=[128,256],xt=["hex","buffer","arrayBuffer","array","digest"],vt={128:168,256:136},Et=ot.JS_SHA3_NO_NODE_JS||!Array.isArray?function(_t){return Object.prototype.toString.call(_t)==="[object Array]"}:Array.isArray,Ct=ct&&(ot.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)?function(_t){return typeof _t=="object"&&_t.buffer&&_t.buffer.constructor===ArrayBuffer}:ArrayBuffer.isView,St=function(_t){var Bt=typeof _t;if(Bt==="string")return[_t,!0];if(Bt!=="object"||_t===null)throw new Error(tt);if(ct&&_t.constructor===ArrayBuffer)return[new Uint8Array(_t),!1];if(!Et(_t)&&!Ct(_t))throw new Error(tt);return[_t,!1]},At=function(_t){return St(_t)[0].length===0},kt=function(_t){for(var Bt=[],Vt=0;Vt<_t.length;++Vt)Bt[Vt]=_t[Vt];return Bt},It=function(_t,Bt,Vt){return function(er){return new Zt(_t,Bt,_t).update(er)[Vt]()}},Nt=function(_t,Bt,Vt){return function(er,ar){return new Zt(_t,Bt,ar).update(er)[Vt]()}},Lt=function(_t,Bt,Vt){return function(er,ar,ur,cr){return Pt["cshake"+_t].update(er,ar,ur,cr)[Vt]()}},Mt=function(_t,Bt,Vt){return function(er,ar,ur,cr){return Pt["kmac"+_t].update(er,ar,ur,cr)[Vt]()}},zt=function(_t,Bt,Vt,er){for(var ar=0;ar<xt.length;++ar){var ur=xt[ar];_t[ur]=Bt(Vt,er,ur)}return _t},Ut=function(_t,Bt){var Vt=It(_t,Bt,"hex");return Vt.create=function(){return new Zt(_t,Bt,_t)},Vt.update=function(er){return Vt.create().update(er)},zt(Vt,It,_t,Bt)},Xt=function(_t,Bt){var Vt=Nt(_t,Bt,"hex");return Vt.create=function(er){return new Zt(_t,Bt,er)},Vt.update=function(er,ar){return Vt.create(ar).update(er)},zt(Vt,Nt,_t,Bt)},Wt=function(_t,Bt){var Vt=vt[_t],er=Lt(_t,Bt,"hex");return er.create=function(ar,ur,cr){return At(ur)&&At(cr)?Pt["shake"+_t].create(ar):new Zt(_t,Bt,ar).bytepad([ur,cr],Vt)},er.update=function(ar,ur,cr,hr){return er.create(ur,cr,hr).update(ar)},zt(er,Lt,_t,Bt)},Ft=function(_t,Bt){var Vt=vt[_t],er=Mt(_t,Bt,"hex");return er.create=function(ar,ur,cr){return new Jt(_t,Bt,ur).bytepad(["KMAC",cr],Vt).bytepad([ar],Vt)},er.update=function(ar,ur,cr,hr){return er.create(ar,cr,hr).update(ur)},zt(er,Mt,_t,Bt)},qt=[{name:"keccak",padding:mt,bits:gt,createMethod:Ut},{name:"sha3",padding:ft,bits:gt,createMethod:Ut},{name:"shake",padding:dt,bits:bt,createMethod:Xt},{name:"cshake",padding:ht,bits:bt,createMethod:Wt},{name:"kmac",padding:ht,bits:bt,createMethod:Ft}],Pt={},Yt=[],Qt=0;Qt<qt.length;++Qt)for(var jt=qt[Qt],Gt=jt.bits,rr=0;rr<Gt.length;++rr){var Ht=jt.name+"_"+Gt[rr];if(Yt.push(Ht),Pt[Ht]=jt.createMethod(Gt[rr],jt.padding),jt.name!=="sha3"){var dr=jt.name+Gt[rr];Yt.push(dr),Pt[dr]=Pt[Ht]}}function Zt(_t,Bt,Vt){this.blocks=[],this.s=[],this.padding=Bt,this.outputBits=Vt,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(_t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=Vt>>5,this.extraBytes=(Vt&31)>>3;for(var er=0;er<50;++er)this.s[er]=0}Zt.prototype.update=function(_t){if(this.finalized)throw new Error(rt);var Bt=St(_t);_t=Bt[0];for(var Vt=Bt[1],er=this.blocks,ar=this.byteCount,ur=_t.length,cr=this.blockCount,hr=0,Sr=this.s,pr,wr;hr<ur;){if(this.reset)for(this.reset=!1,er[0]=this.block,pr=1;pr<cr+1;++pr)er[pr]=0;if(Vt)for(pr=this.start;hr<ur&&pr<ar;++hr)wr=_t.charCodeAt(hr),wr<128?er[pr>>2]|=wr<<pt[pr++&3]:wr<2048?(er[pr>>2]|=(192|wr>>6)<<pt[pr++&3],er[pr>>2]|=(128|wr&63)<<pt[pr++&3]):wr<55296||wr>=57344?(er[pr>>2]|=(224|wr>>12)<<pt[pr++&3],er[pr>>2]|=(128|wr>>6&63)<<pt[pr++&3],er[pr>>2]|=(128|wr&63)<<pt[pr++&3]):(wr=65536+((wr&1023)<<10|_t.charCodeAt(++hr)&1023),er[pr>>2]|=(240|wr>>18)<<pt[pr++&3],er[pr>>2]|=(128|wr>>12&63)<<pt[pr++&3],er[pr>>2]|=(128|wr>>6&63)<<pt[pr++&3],er[pr>>2]|=(128|wr&63)<<pt[pr++&3]);else for(pr=this.start;hr<ur&&pr<ar;++hr)er[pr>>2]|=_t[hr]<<pt[pr++&3];if(this.lastByteIndex=pr,pr>=ar){for(this.start=pr-ar,this.block=er[cr],pr=0;pr<cr;++pr)Sr[pr]^=er[pr];tr(Sr),this.reset=!0}else this.start=pr}return this},Zt.prototype.encode=function(_t,Bt){var Vt=_t&255,er=1,ar=[Vt];for(_t=_t>>8,Vt=_t&255;Vt>0;)ar.unshift(Vt),_t=_t>>8,Vt=_t&255,++er;return Bt?ar.push(er):ar.unshift(er),this.update(ar),ar.length},Zt.prototype.encodeString=function(_t){var Bt=St(_t);_t=Bt[0];var Vt=Bt[1],er=0,ar=_t.length;if(Vt)for(var ur=0;ur<_t.length;++ur){var cr=_t.charCodeAt(ur);cr<128?er+=1:cr<2048?er+=2:cr<55296||cr>=57344?er+=3:(cr=65536+((cr&1023)<<10|_t.charCodeAt(++ur)&1023),er+=4)}else er=ar;return er+=this.encode(er*8),this.update(_t),er},Zt.prototype.bytepad=function(_t,Bt){for(var Vt=this.encode(Bt),er=0;er<_t.length;++er)Vt+=this.encodeString(_t[er]);var ar=(Bt-Vt%Bt)%Bt,ur=[];return ur.length=ar,this.update(ur),this},Zt.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var _t=this.blocks,Bt=this.lastByteIndex,Vt=this.blockCount,er=this.s;if(_t[Bt>>2]|=this.padding[Bt&3],this.lastByteIndex===this.byteCount)for(_t[0]=_t[Vt],Bt=1;Bt<Vt+1;++Bt)_t[Bt]=0;for(_t[Vt-1]|=2147483648,Bt=0;Bt<Vt;++Bt)er[Bt]^=_t[Bt];tr(er)}},Zt.prototype.toString=Zt.prototype.hex=function(){this.finalize();for(var _t=this.blockCount,Bt=this.s,Vt=this.outputBlocks,er=this.extraBytes,ar=0,ur=0,cr="",hr;ur<Vt;){for(ar=0;ar<_t&&ur<Vt;++ar,++ur)hr=Bt[ar],cr+=lt[hr>>4&15]+lt[hr&15]+lt[hr>>12&15]+lt[hr>>8&15]+lt[hr>>20&15]+lt[hr>>16&15]+lt[hr>>28&15]+lt[hr>>24&15];ur%_t===0&&(Bt=kt(Bt),tr(Bt),ar=0)}return er&&(hr=Bt[ar],cr+=lt[hr>>4&15]+lt[hr&15],er>1&&(cr+=lt[hr>>12&15]+lt[hr>>8&15]),er>2&&(cr+=lt[hr>>20&15]+lt[hr>>16&15])),cr},Zt.prototype.arrayBuffer=function(){this.finalize();var _t=this.blockCount,Bt=this.s,Vt=this.outputBlocks,er=this.extraBytes,ar=0,ur=0,cr=this.outputBits>>3,hr;er?hr=new ArrayBuffer(Vt+1<<2):hr=new ArrayBuffer(cr);for(var Sr=new Uint32Array(hr);ur<Vt;){for(ar=0;ar<_t&&ur<Vt;++ar,++ur)Sr[ur]=Bt[ar];ur%_t===0&&(Bt=kt(Bt),tr(Bt))}return er&&(Sr[ur]=Bt[ar],hr=hr.slice(0,cr)),hr},Zt.prototype.buffer=Zt.prototype.arrayBuffer,Zt.prototype.digest=Zt.prototype.array=function(){this.finalize();for(var _t=this.blockCount,Bt=this.s,Vt=this.outputBlocks,er=this.extraBytes,ar=0,ur=0,cr=[],hr,Sr;ur<Vt;){for(ar=0;ar<_t&&ur<Vt;++ar,++ur)hr=ur<<2,Sr=Bt[ar],cr[hr]=Sr&255,cr[hr+1]=Sr>>8&255,cr[hr+2]=Sr>>16&255,cr[hr+3]=Sr>>24&255;ur%_t===0&&(Bt=kt(Bt),tr(Bt))}return er&&(hr=ur<<2,Sr=Bt[ar],cr[hr]=Sr&255,er>1&&(cr[hr+1]=Sr>>8&255),er>2&&(cr[hr+2]=Sr>>16&255)),cr};function Jt(_t,Bt,Vt){Zt.call(this,_t,Bt,Vt)}Jt.prototype=new Zt,Jt.prototype.finalize=function(){return this.encode(this.outputBits,!0),Zt.prototype.finalize.call(this)};var tr=function(_t){var Bt,Vt,er,ar,ur,cr,hr,Sr,pr,wr,_r,Tr,gr,vr,ir,Tt,$t,Rt,Dt,Kt,nr,sr,br,$r,yr,Ar,xr,bo,yo,xo,vo,wo,Eo,Co,So,Ao,$o,ko,Ro,_o,To,Io,Po,jo,No,Do,Lo,Oo,Mo,Bo,Fo,Uo,zo,Vo,Ho,Wo,Go,qo,Ko,Qo,Xo,Yo,Zo;for(er=0;er<48;er+=2)ar=_t[0]^_t[10]^_t[20]^_t[30]^_t[40],ur=_t[1]^_t[11]^_t[21]^_t[31]^_t[41],cr=_t[2]^_t[12]^_t[22]^_t[32]^_t[42],hr=_t[3]^_t[13]^_t[23]^_t[33]^_t[43],Sr=_t[4]^_t[14]^_t[24]^_t[34]^_t[44],pr=_t[5]^_t[15]^_t[25]^_t[35]^_t[45],wr=_t[6]^_t[16]^_t[26]^_t[36]^_t[46],_r=_t[7]^_t[17]^_t[27]^_t[37]^_t[47],Tr=_t[8]^_t[18]^_t[28]^_t[38]^_t[48],gr=_t[9]^_t[19]^_t[29]^_t[39]^_t[49],Bt=Tr^(cr<<1|hr>>>31),Vt=gr^(hr<<1|cr>>>31),_t[0]^=Bt,_t[1]^=Vt,_t[10]^=Bt,_t[11]^=Vt,_t[20]^=Bt,_t[21]^=Vt,_t[30]^=Bt,_t[31]^=Vt,_t[40]^=Bt,_t[41]^=Vt,Bt=ar^(Sr<<1|pr>>>31),Vt=ur^(pr<<1|Sr>>>31),_t[2]^=Bt,_t[3]^=Vt,_t[12]^=Bt,_t[13]^=Vt,_t[22]^=Bt,_t[23]^=Vt,_t[32]^=Bt,_t[33]^=Vt,_t[42]^=Bt,_t[43]^=Vt,Bt=cr^(wr<<1|_r>>>31),Vt=hr^(_r<<1|wr>>>31),_t[4]^=Bt,_t[5]^=Vt,_t[14]^=Bt,_t[15]^=Vt,_t[24]^=Bt,_t[25]^=Vt,_t[34]^=Bt,_t[35]^=Vt,_t[44]^=Bt,_t[45]^=Vt,Bt=Sr^(Tr<<1|gr>>>31),Vt=pr^(gr<<1|Tr>>>31),_t[6]^=Bt,_t[7]^=Vt,_t[16]^=Bt,_t[17]^=Vt,_t[26]^=Bt,_t[27]^=Vt,_t[36]^=Bt,_t[37]^=Vt,_t[46]^=Bt,_t[47]^=Vt,Bt=wr^(ar<<1|ur>>>31),Vt=_r^(ur<<1|ar>>>31),_t[8]^=Bt,_t[9]^=Vt,_t[18]^=Bt,_t[19]^=Vt,_t[28]^=Bt,_t[29]^=Vt,_t[38]^=Bt,_t[39]^=Vt,_t[48]^=Bt,_t[49]^=Vt,vr=_t[0],ir=_t[1],Do=_t[11]<<4|_t[10]>>>28,Lo=_t[10]<<4|_t[11]>>>28,bo=_t[20]<<3|_t[21]>>>29,yo=_t[21]<<3|_t[20]>>>29,Qo=_t[31]<<9|_t[30]>>>23,Xo=_t[30]<<9|_t[31]>>>23,Io=_t[40]<<18|_t[41]>>>14,Po=_t[41]<<18|_t[40]>>>14,Co=_t[2]<<1|_t[3]>>>31,So=_t[3]<<1|_t[2]>>>31,Tt=_t[13]<<12|_t[12]>>>20,$t=_t[12]<<12|_t[13]>>>20,Oo=_t[22]<<10|_t[23]>>>22,Mo=_t[23]<<10|_t[22]>>>22,xo=_t[33]<<13|_t[32]>>>19,vo=_t[32]<<13|_t[33]>>>19,Yo=_t[42]<<2|_t[43]>>>30,Zo=_t[43]<<2|_t[42]>>>30,Vo=_t[5]<<30|_t[4]>>>2,Ho=_t[4]<<30|_t[5]>>>2,Ao=_t[14]<<6|_t[15]>>>26,$o=_t[15]<<6|_t[14]>>>26,Rt=_t[25]<<11|_t[24]>>>21,Dt=_t[24]<<11|_t[25]>>>21,Bo=_t[34]<<15|_t[35]>>>17,Fo=_t[35]<<15|_t[34]>>>17,wo=_t[45]<<29|_t[44]>>>3,Eo=_t[44]<<29|_t[45]>>>3,$r=_t[6]<<28|_t[7]>>>4,yr=_t[7]<<28|_t[6]>>>4,Wo=_t[17]<<23|_t[16]>>>9,Go=_t[16]<<23|_t[17]>>>9,ko=_t[26]<<25|_t[27]>>>7,Ro=_t[27]<<25|_t[26]>>>7,Kt=_t[36]<<21|_t[37]>>>11,nr=_t[37]<<21|_t[36]>>>11,Uo=_t[47]<<24|_t[46]>>>8,zo=_t[46]<<24|_t[47]>>>8,jo=_t[8]<<27|_t[9]>>>5,No=_t[9]<<27|_t[8]>>>5,Ar=_t[18]<<20|_t[19]>>>12,xr=_t[19]<<20|_t[18]>>>12,qo=_t[29]<<7|_t[28]>>>25,Ko=_t[28]<<7|_t[29]>>>25,_o=_t[38]<<8|_t[39]>>>24,To=_t[39]<<8|_t[38]>>>24,sr=_t[48]<<14|_t[49]>>>18,br=_t[49]<<14|_t[48]>>>18,_t[0]=vr^~Tt&Rt,_t[1]=ir^~$t&Dt,_t[10]=$r^~Ar&bo,_t[11]=yr^~xr&yo,_t[20]=Co^~Ao&ko,_t[21]=So^~$o&Ro,_t[30]=jo^~Do&Oo,_t[31]=No^~Lo&Mo,_t[40]=Vo^~Wo&qo,_t[41]=Ho^~Go&Ko,_t[2]=Tt^~Rt&Kt,_t[3]=$t^~Dt&nr,_t[12]=Ar^~bo&xo,_t[13]=xr^~yo&vo,_t[22]=Ao^~ko&_o,_t[23]=$o^~Ro&To,_t[32]=Do^~Oo&Bo,_t[33]=Lo^~Mo&Fo,_t[42]=Wo^~qo&Qo,_t[43]=Go^~Ko&Xo,_t[4]=Rt^~Kt&sr,_t[5]=Dt^~nr&br,_t[14]=bo^~xo&wo,_t[15]=yo^~vo&Eo,_t[24]=ko^~_o&Io,_t[25]=Ro^~To&Po,_t[34]=Oo^~Bo&Uo,_t[35]=Mo^~Fo&zo,_t[44]=qo^~Qo&Yo,_t[45]=Ko^~Xo&Zo,_t[6]=Kt^~sr&vr,_t[7]=nr^~br&ir,_t[16]=xo^~wo&$r,_t[17]=vo^~Eo&yr,_t[26]=_o^~Io&Co,_t[27]=To^~Po&So,_t[36]=Bo^~Uo&jo,_t[37]=Fo^~zo&No,_t[46]=Qo^~Yo&Vo,_t[47]=Xo^~Zo&Ho,_t[8]=sr^~vr&Tt,_t[9]=br^~ir&$t,_t[18]=wo^~$r&Ar,_t[19]=Eo^~yr&xr,_t[28]=Io^~Co&Ao,_t[29]=Po^~So&$o,_t[38]=Uo^~jo&Do,_t[39]=zo^~No&Lo,_t[48]=Yo^~Vo&Wo,_t[49]=Zo^~Ho&Go,_t[0]^=yt[er],_t[1]^=yt[er+1]};if(at)et.exports=Pt;else for(Qt=0;Qt<Yt.length;++Qt)ot[Yt[Qt]]=Pt[Yt[Qt]]})()})(sha3$1);var sha3Exports=sha3$1.exports;const sha3=getDefaultExportFromCjs(sha3Exports);function keccak256(et){return new Uint8Array(sha3.keccak256.arrayBuffer(et))}function verifySignature(et,o,tt){try{const rt=Signature.fromCompact(et.slice(0,64));return verify(rt,o,tt)}catch{return!1}}function multiaddrFromFields(et,o,tt,rt){let nt=multiaddr("/"+et+"/"+convertToString(et,tt));return nt=nt.encapsulate(multiaddr("/"+o+"/"+convertToString(o,rt))),nt}function locationMultiaddrFromEnrFields(et,o){switch(o){case"udp":return locationMultiaddrFromEnrFields(et,"udp4")||locationMultiaddrFromEnrFields(et,"udp6");case"tcp":return locationMultiaddrFromEnrFields(et,"tcp4")||locationMultiaddrFromEnrFields(et,"tcp6")}const tt=o.endsWith("6"),rt=et.get(tt?"ip6":"ip");if(!rt)return;const nt=o.slice(0,3);let ot;switch(nt){case"udp":ot=tt?et.get("udp6"):et.get("udp");break;case"tcp":ot=tt?et.get("tcp6"):et.get("tcp");break;default:return}if(ot)return multiaddrFromFields(tt?"ip6":"ip4",nt,rt,ot)}const ERR_TYPE_NOT_IMPLEMENTED="Keypair type not implemented";function createPeerIdFromPublicKey(et){const o=publicKeyFromRaw(et);if(o.type!=="secp256k1")throw new Error(ERR_TYPE_NOT_IMPLEMENTED);return peerIdFromPublicKey(o)}function decodeMultiaddrs(et){const o=[];let tt=0;for(;tt<et.length;){const nt=new DataView(et.buffer,tt,MULTIADDR_LENGTH_SIZE).getUint16(0);tt+=MULTIADDR_LENGTH_SIZE;const ot=et.slice(tt,tt+nt);tt+=nt,o.push(multiaddr(ot))}return o}function encodeMultiaddrs(et){const o=et.reduce((ot,it)=>ot+MULTIADDR_LENGTH_SIZE+it.bytes.length,0),tt=new Uint8Array(o),rt=new DataView(tt.buffer);let nt=0;return et.forEach(ot=>{if(ot.getPeerId())throw new Error("`multiaddr` field MUST not contain peer id");rt.setUint16(nt,ot.bytes.length),nt+=MULTIADDR_LENGTH_SIZE,tt.set(ot.bytes,nt),nt+=ot.bytes.length}),tt}function encodeWaku2(et){let o=0;return et.lightPush&&(o+=1),o=o<<1,et.filter&&(o+=1),o=o<<1,et.store&&(o+=1),o=o<<1,et.relay&&(o+=1),o}function decodeWaku2(et){const o={relay:!1,store:!1,filter:!1,lightPush:!1};return et%2&&(o.relay=!0),et=et>>1,et%2&&(o.store=!0),et=et>>1,et%2&&(o.filter=!0),et=et>>1,et%2&&(o.lightPush=!0),o}class RawEnr extends Map{constructor(tt={},rt=BigInt(1),nt){super(Object.entries(tt));wt(this,"seq");wt(this,"signature");this.seq=rt,this.signature=nt}set(tt,rt){return this.signature=void 0,this.seq++,super.set(tt,rt)}get id(){const tt=this.get("id");if(!tt)throw new Error("id not found.");return bytesToUtf8(tt)}get publicKey(){switch(this.id){case"v4":return this.get("secp256k1");default:throw new Error(ERR_INVALID_ID)}}get rs(){const tt=this.get("rs");if(tt)return decodeRelayShard(tt)}get rsv(){const tt=this.get("rsv");if(tt)return decodeRelayShard(tt)}get ip(){return getStringValue(this,"ip","ip4")}set ip(tt){setStringValue(this,"ip","ip4",tt)}get tcp(){return getNumberAsStringValue(this,"tcp","tcp")}set tcp(tt){setNumberAsStringValue(this,"tcp","tcp",tt)}get udp(){return getNumberAsStringValue(this,"udp","udp")}set udp(tt){setNumberAsStringValue(this,"udp","udp",tt)}get ip6(){return getStringValue(this,"ip6","ip6")}set ip6(tt){setStringValue(this,"ip6","ip6",tt)}get tcp6(){return getNumberAsStringValue(this,"tcp6","tcp")}set tcp6(tt){setNumberAsStringValue(this,"tcp6","tcp",tt)}get udp6(){return getNumberAsStringValue(this,"udp6","udp")}set udp6(tt){setNumberAsStringValue(this,"udp6","udp",tt)}get multiaddrs(){const tt=this.get("multiaddrs");if(tt)return decodeMultiaddrs(tt)}set multiaddrs(tt){deleteUndefined(this,"multiaddrs",tt,encodeMultiaddrs)}get waku2(){const tt=this.get("waku2");if(tt)return decodeWaku2(tt[0])}set waku2(tt){deleteUndefined(this,"waku2",tt,rt=>new Uint8Array([encodeWaku2(rt)]))}}function getStringValue(et,o,tt){const rt=et.get(o);if(rt)return convertToString(tt,rt)}function getNumberAsStringValue(et,o,tt){const rt=et.get(o);if(rt)return Number(convertToString(tt,rt))}function setStringValue(et,o,tt,rt){deleteUndefined(et,o,rt,convertToBytes.bind({},tt))}function setNumberAsStringValue(et,o,tt,rt){setStringValue(et,o,tt,rt==null?void 0:rt.toString(10))}function deleteUndefined(et,o,tt,rt){tt!==void 0?et.set(o,rt(tt)):et.delete(o)}async function sign(et,o){return sign$1(keccak256(o),et,{der:!1})}function nodeId(et){const tt=Point.fromHex(et).toRawBytes(!1);return bytesToHex$1(keccak256(tt.slice(1)))}const log$9=new Logger$1("enr");var TransportProtocol;(function(et){et.TCP="tcp",et.UDP="udp"})(TransportProtocol||(TransportProtocol={}));var TransportProtocolPerIpVersion;(function(et){et.TCP4="tcp4",et.UDP4="udp4",et.TCP6="tcp6",et.UDP6="udp6"})(TransportProtocolPerIpVersion||(TransportProtocolPerIpVersion={}));const as=class as extends RawEnr{constructor(){super(...arguments);wt(this,"peerId");wt(this,"getLocationMultiaddr",locationMultiaddrFromEnrFields.bind({},this))}static create(tt={},rt=BigInt(1),nt){const ot=new as(tt,rt,nt);try{const it=ot.publicKey;it&&(ot.peerId=createPeerIdFromPublicKey(it))}catch(it){log$9.error("Could not calculate peer id for ENR",it)}return ot}get nodeId(){switch(this.id){case"v4":return this.publicKey?nodeId(this.publicKey):void 0;default:throw new Error(ERR_INVALID_ID)}}get shardInfo(){return this.rs&&this.rsv&&log$9.warn("ENR contains both `rs` and `rsv` fields."),this.rs||this.rsv}setLocationMultiaddr(tt){const rt=tt.protoNames();if(rt.length!==2&&rt[1]!=="udp"&&rt[1]!=="tcp")throw new Error("Invalid multiaddr");const nt=tt.tuples();if(!nt[0][1]||!nt[1][1])throw new Error("Invalid multiaddr");nt[0][0]===4?(this.set("ip",nt[0][1]),this.set(rt[1],nt[1][1])):(this.set("ip6",nt[0][1]),this.set(rt[1]+"6",nt[1][1]))}getAllLocationMultiaddrs(){const tt=[];for(const nt of Object.values(TransportProtocolPerIpVersion)){const ot=this.getLocationMultiaddr(nt);ot&&tt.push(ot)}const rt=this.multiaddrs??[];return tt.concat(rt).map(nt=>this.peerId?nt.encapsulate(`/p2p/${this.peerId.toString()}`):nt)}get peerInfo(){const tt=this.peerId;if(tt)return{id:tt,multiaddrs:this.getAllLocationMultiaddrs()}}getFullMultiaddr(tt){if(this.peerId){const rt=this.getLocationMultiaddr(tt);if(rt)return rt.encapsulate(`/p2p/${this.peerId.toString()}`)}}getFullMultiaddrs(){if(this.peerId&&this.multiaddrs){const tt=this.peerId;return this.multiaddrs.map(rt=>rt.encapsulate(`/p2p/${tt.toString()}`))}return[]}verify(tt,rt){if(!this.get("id")||this.id!=="v4")throw new Error(ERR_INVALID_ID);if(!this.publicKey)throw new Error("Failed to verify ENR: No public key");return verifySignature(rt,keccak256(tt),this.publicKey)}async sign(tt,rt){switch(this.id){case"v4":this.signature=await sign(rt,tt);break;default:throw new Error(ERR_INVALID_ID)}return this.signature}};wt(as,"RECORD_PREFIX","enr:");let ENR=as;const version$2="logger/5.7.0";let _permanentCensorErrors=!1,_censorErrors=!1;const LogLevels={debug:1,default:2,info:2,warning:3,error:4,off:5};let _logLevel=LogLevels.default,_globalLogger=null;function _checkNormalize(){try{const et=[];if(["NFD","NFC","NFKD","NFKC"].forEach(o=>{try{if("test".normalize(o)!=="test")throw new Error("bad normalize")}catch{et.push(o)}}),et.length)throw new Error("missing "+et.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(et){return et.message}return null}const _normalizeError=_checkNormalize();var LogLevel;(function(et){et.DEBUG="DEBUG",et.INFO="INFO",et.WARNING="WARNING",et.ERROR="ERROR",et.OFF="OFF"})(LogLevel||(LogLevel={}));var ErrorCode;(function(et){et.UNKNOWN_ERROR="UNKNOWN_ERROR",et.NOT_IMPLEMENTED="NOT_IMPLEMENTED",et.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",et.NETWORK_ERROR="NETWORK_ERROR",et.SERVER_ERROR="SERVER_ERROR",et.TIMEOUT="TIMEOUT",et.BUFFER_OVERRUN="BUFFER_OVERRUN",et.NUMERIC_FAULT="NUMERIC_FAULT",et.MISSING_NEW="MISSING_NEW",et.INVALID_ARGUMENT="INVALID_ARGUMENT",et.MISSING_ARGUMENT="MISSING_ARGUMENT",et.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",et.CALL_EXCEPTION="CALL_EXCEPTION",et.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",et.NONCE_EXPIRED="NONCE_EXPIRED",et.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",et.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",et.TRANSACTION_REPLACED="TRANSACTION_REPLACED",et.ACTION_REJECTED="ACTION_REJECTED"})(ErrorCode||(ErrorCode={}));const HEX="0123456789abcdef";class Logger{constructor(o){Object.defineProperty(this,"version",{enumerable:!0,value:o,writable:!1})}_log(o,tt){const rt=o.toLowerCase();LogLevels[rt]==null&&this.throwArgumentError("invalid log level name","logLevel",o),!(_logLevel>LogLevels[rt])&&console.log.apply(console,tt)}debug(...o){this._log(Logger.levels.DEBUG,o)}info(...o){this._log(Logger.levels.INFO,o)}warn(...o){this._log(Logger.levels.WARNING,o)}makeError(o,tt,rt){if(_censorErrors)return this.makeError("censored error",tt,{});tt||(tt=Logger.errors.UNKNOWN_ERROR),rt||(rt={});const nt=[];Object.keys(rt).forEach(at=>{const ct=rt[at];try{if(ct instanceof Uint8Array){let lt="";for(let dt=0;dt<ct.length;dt++)lt+=HEX[ct[dt]>>4],lt+=HEX[ct[dt]&15];nt.push(at+"=Uint8Array(0x"+lt+")")}else nt.push(at+"="+JSON.stringify(ct))}catch{nt.push(at+"="+JSON.stringify(rt[at].toString()))}}),nt.push(`code=${tt}`),nt.push(`version=${this.version}`);const ot=o;let it="";switch(tt){case ErrorCode.NUMERIC_FAULT:{it="NUMERIC_FAULT";const at=o;switch(at){case"overflow":case"underflow":case"division-by-zero":it+="-"+at;break;case"negative-power":case"negative-width":it+="-unsupported";break;case"unbound-bitwise-result":it+="-unbound-result";break}break}case ErrorCode.CALL_EXCEPTION:case ErrorCode.INSUFFICIENT_FUNDS:case ErrorCode.MISSING_NEW:case ErrorCode.NONCE_EXPIRED:case ErrorCode.REPLACEMENT_UNDERPRICED:case ErrorCode.TRANSACTION_REPLACED:case ErrorCode.UNPREDICTABLE_GAS_LIMIT:it=tt;break}it&&(o+=" [ See: https://links.ethers.org/v5-errors-"+it+" ]"),nt.length&&(o+=" ("+nt.join(", ")+")");const st=new Error(o);return st.reason=ot,st.code=tt,Object.keys(rt).forEach(function(at){st[at]=rt[at]}),st}throwError(o,tt,rt){throw this.makeError(o,tt,rt)}throwArgumentError(o,tt,rt){return this.throwError(o,Logger.errors.INVALID_ARGUMENT,{argument:tt,value:rt})}assert(o,tt,rt,nt){o||this.throwError(tt,rt,nt)}assertArgument(o,tt,rt,nt){o||this.throwArgumentError(tt,rt,nt)}checkNormalize(o){_normalizeError&&this.throwError("platform missing String.prototype.normalize",Logger.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:_normalizeError})}checkSafeUint53(o,tt){typeof o=="number"&&(tt==null&&(tt="value not safe"),(o<0||o>=9007199254740991)&&this.throwError(tt,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:o}),o%1&&this.throwError(tt,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:o}))}checkArgumentCount(o,tt,rt){rt?rt=": "+rt:rt="",o<tt&&this.throwError("missing argument"+rt,Logger.errors.MISSING_ARGUMENT,{count:o,expectedCount:tt}),o>tt&&this.throwError("too many arguments"+rt,Logger.errors.UNEXPECTED_ARGUMENT,{count:o,expectedCount:tt})}checkNew(o,tt){(o===Object||o==null)&&this.throwError("missing new",Logger.errors.MISSING_NEW,{name:tt.name})}checkAbstract(o,tt){o===tt?this.throwError("cannot instantiate abstract class "+JSON.stringify(tt.name)+" directly; use a sub-class",Logger.errors.UNSUPPORTED_OPERATION,{name:o.name,operation:"new"}):(o===Object||o==null)&&this.throwError("missing new",Logger.errors.MISSING_NEW,{name:tt.name})}static globalLogger(){return _globalLogger||(_globalLogger=new Logger(version$2)),_globalLogger}static setCensorship(o,tt){if(!o&&tt&&this.globalLogger().throwError("cannot permanently disable censorship",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),_permanentCensorErrors){if(!o)return;this.globalLogger().throwError("error censorship permanent",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}_censorErrors=!!o,_permanentCensorErrors=!!tt}static setLogLevel(o){const tt=LogLevels[o.toLowerCase()];if(tt==null){Logger.globalLogger().warn("invalid log level - "+o);return}_logLevel=tt}static from(o){return new Logger(o)}}Logger.errors=ErrorCode;Logger.levels=LogLevel;const version$1="bytes/5.7.0",logger$1=new Logger(version$1);function isHexable(et){return!!et.toHexString}function addSlice(et){return et.slice||(et.slice=function(){const o=Array.prototype.slice.call(arguments);return addSlice(new Uint8Array(Array.prototype.slice.apply(et,o)))}),et}function isBytesLike(et){return isHexString(et)&&!(et.length%2)||isBytes(et)}function isInteger(et){return typeof et=="number"&&et==et&&et%1===0}function isBytes(et){if(et==null)return!1;if(et.constructor===Uint8Array)return!0;if(typeof et=="string"||!isInteger(et.length)||et.length<0)return!1;for(let o=0;o<et.length;o++){const tt=et[o];if(!isInteger(tt)||tt<0||tt>=256)return!1}return!0}function arrayify(et,o){if(o||(o={}),typeof et=="number"){logger$1.checkSafeUint53(et,"invalid arrayify value");const tt=[];for(;et;)tt.unshift(et&255),et=parseInt(String(et/256));return tt.length===0&&tt.push(0),addSlice(new Uint8Array(tt))}if(o.allowMissingPrefix&&typeof et=="string"&&et.substring(0,2)!=="0x"&&(et="0x"+et),isHexable(et)&&(et=et.toHexString()),isHexString(et)){let tt=et.substring(2);tt.length%2&&(o.hexPad==="left"?tt="0"+tt:o.hexPad==="right"?tt+="0":logger$1.throwArgumentError("hex data is odd-length","value",et));const rt=[];for(let nt=0;nt<tt.length;nt+=2)rt.push(parseInt(tt.substring(nt,nt+2),16));return addSlice(new Uint8Array(rt))}return isBytes(et)?addSlice(new Uint8Array(et)):logger$1.throwArgumentError("invalid arrayify value","value",et)}function isHexString(et,o){return!(typeof et!="string"||!et.match(/^0x[0-9A-Fa-f]*$/))}const HexCharacters="0123456789abcdef";function hexlify(et,o){if(o||(o={}),typeof et=="number"){logger$1.checkSafeUint53(et,"invalid hexlify value");let tt="";for(;et;)tt=HexCharacters[et&15]+tt,et=Math.floor(et/16);return tt.length?(tt.length%2&&(tt="0"+tt),"0x"+tt):"0x00"}if(typeof et=="bigint")return et=et.toString(16),et.length%2?"0x0"+et:"0x"+et;if(o.allowMissingPrefix&&typeof et=="string"&&et.substring(0,2)!=="0x"&&(et="0x"+et),isHexable(et))return et.toHexString();if(isHexString(et))return et.length%2&&(o.hexPad==="left"?et="0x0"+et.substring(2):o.hexPad==="right"?et+="0":logger$1.throwArgumentError("hex data is odd-length","value",et)),et.toLowerCase();if(isBytes(et)){let tt="0x";for(let rt=0;rt<et.length;rt++){let nt=et[rt];tt+=HexCharacters[(nt&240)>>4]+HexCharacters[nt&15]}return tt}return logger$1.throwArgumentError("invalid hexlify value","value",et)}const version="rlp/5.7.0",logger=new Logger(version);function arrayifyInteger(et){const o=[];for(;et;)o.unshift(et&255),et>>=8;return o}function unarrayifyInteger(et,o,tt){let rt=0;for(let nt=0;nt<tt;nt++)rt=rt*256+et[o+nt];return rt}function _encode(et){if(Array.isArray(et)){let rt=[];if(et.forEach(function(ot){rt=rt.concat(_encode(ot))}),rt.length<=55)return rt.unshift(192+rt.length),rt;const nt=arrayifyInteger(rt.length);return nt.unshift(247+nt.length),nt.concat(rt)}isBytesLike(et)||logger.throwArgumentError("RLP object must be BytesLike","object",et);const o=Array.prototype.slice.call(arrayify(et));if(o.length===1&&o[0]<=127)return o;if(o.length<=55)return o.unshift(128+o.length),o;const tt=arrayifyInteger(o.length);return tt.unshift(183+tt.length),tt.concat(o)}function encode$7(et){return hexlify(_encode(et))}function _decodeChildren(et,o,tt,rt){const nt=[];for(;tt<o+1+rt;){const ot=_decode(et,tt);nt.push(ot.result),tt+=ot.consumed,tt>o+1+rt&&logger.throwError("child data too short",Logger.errors.BUFFER_OVERRUN,{})}return{consumed:1+rt,result:nt}}function _decode(et,o){if(et.length===0&&logger.throwError("data too short",Logger.errors.BUFFER_OVERRUN,{}),et[o]>=248){const tt=et[o]-247;o+1+tt>et.length&&logger.throwError("data short segment too short",Logger.errors.BUFFER_OVERRUN,{});const rt=unarrayifyInteger(et,o+1,tt);return o+1+tt+rt>et.length&&logger.throwError("data long segment too short",Logger.errors.BUFFER_OVERRUN,{}),_decodeChildren(et,o,o+1+tt,tt+rt)}else if(et[o]>=192){const tt=et[o]-192;return o+1+tt>et.length&&logger.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{}),_decodeChildren(et,o,o+1,tt)}else if(et[o]>=184){const tt=et[o]-183;o+1+tt>et.length&&logger.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{});const rt=unarrayifyInteger(et,o+1,tt);o+1+tt+rt>et.length&&logger.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{});const nt=hexlify(et.slice(o+1+tt,o+1+tt+rt));return{consumed:1+tt+rt,result:nt}}else if(et[o]>=128){const tt=et[o]-128;o+1+tt>et.length&&logger.throwError("data too short",Logger.errors.BUFFER_OVERRUN,{});const rt=hexlify(et.slice(o+1,o+1+tt));return{consumed:1+tt,result:rt}}return{consumed:1,result:hexlify(et[o])}}function decode$8(et){const o=arrayify(et),tt=_decode(o,0);return tt.consumed!==o.length&&logger.throwArgumentError("invalid rlp data","data",et),tt.result}function base$1(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt<tt.length;rt++)tt[rt]=255;for(var nt=0;nt<et.length;nt++){var ot=et.charAt(nt),it=ot.charCodeAt(0);if(tt[it]!==255)throw new TypeError(ot+" is ambiguous");tt[it]=nt}var st=et.length,at=et.charAt(0),ct=Math.log(st)/Math.log(256),lt=Math.log(256)/Math.log(st);function dt(ft){if(ft instanceof Uint8Array||(ArrayBuffer.isView(ft)?ft=new Uint8Array(ft.buffer,ft.byteOffset,ft.byteLength):Array.isArray(ft)&&(ft=Uint8Array.from(ft))),!(ft instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(ft.length===0)return"";for(var pt=0,yt=0,gt=0,bt=ft.length;gt!==bt&&ft[gt]===0;)gt++,pt++;for(var xt=(bt-gt)*lt+1>>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct<yt)&&St!==-1;St--,Ct++)Et+=256*vt[St]>>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At<xt;++At)kt+=et.charAt(vt[At]);return kt}function ht(ft){if(typeof ft!="string")throw new TypeError("Expected String");if(ft.length===0)return new Uint8Array;var pt=0;if(ft[pt]!==" "){for(var yt=0,gt=0;ft[pt]===at;)yt++,pt++;for(var bt=(ft.length-pt)*ct+1>>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et<gt)&&Ct!==-1;Ct--,Et++)vt+=st*xt[Ct]>>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$2=base$1,_brrp__multiformats_scope_baseX$1=src$2;const coerce$1=et=>{if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")},fromString$3=et=>new TextEncoder().encode(et),toString$8=et=>new TextDecoder().decode(et);let Encoder$1=class{constructor(o,tt,rt){this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$1=class{constructor(o,tt,rt){if(this.name=o,this.prefix=tt,tt.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=tt.codePointAt(0),this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$1(this,o)}},ComposedDecoder$1=class{constructor(o){this.decoders=o}or(o){return or$1(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};const or$1=(et,o)=>new ComposedDecoder$1({...et.decoders||{[et.prefix]:et},...o.decoders||{[o.prefix]:o}});let Codec$1=class{constructor(o,tt,rt,nt){this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$1(o,tt,rt),this.decoder=new Decoder$1(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};const from$2=({name:et,prefix:o,encode:tt,decode:rt})=>new Codec$1(et,o,tt,rt),baseX$1=({prefix:et,name:o,alphabet:tt})=>{const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$1(tt,o);return from$2({prefix:et,name:o,encode:rt,decode:ot=>coerce$1(nt(ot))})},decode$7=(et,o,tt,rt)=>{const nt={};for(let lt=0;lt<o.length;++lt)nt[o[lt]]=lt;let ot=et.length;for(;et[ot-1]==="=";)--ot;const it=new Uint8Array(ot*tt/8|0);let st=0,at=0,ct=0;for(let lt=0;lt<ot;++lt){const dt=nt[et[lt]];if(dt===void 0)throw new SyntaxError(`Non-${rt} character`);at=at<<tt|dt,st+=tt,st>=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it},encode$6=(et,o,tt)=>{const rt=o[o.length-1]==="=",nt=(1<<tt)-1;let ot="",it=0,st=0;for(let at=0;at<et.length;++at)for(st=st<<8|et[at],it+=8;it>tt;)it-=tt,ot+=o[nt&st>>it];if(it&&(ot+=o[nt&st<<tt-it]),rt)for(;ot.length*tt&7;)ot+="=";return ot},rfc4648$1=({name:et,prefix:o,bitsPerChar:tt,alphabet:rt})=>from$2({prefix:o,name:et,encode(nt){return encode$6(nt,rt,tt)},decode(nt){return decode$7(nt,rt,tt,et)}}),identity$1=from$2({prefix:"\0",name:"identity",encode:et=>toString$8(et),decode:et=>fromString$3(et)}),identityBase$1=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$1},Symbol.toStringTag,{value:"Module"})),base2$2=rfc4648$1({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),base2$3=Object.freeze(Object.defineProperty({__proto__:null,base2:base2$2},Symbol.toStringTag,{value:"Module"})),base8$2=rfc4648$1({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$3=Object.freeze(Object.defineProperty({__proto__:null,base8:base8$2},Symbol.toStringTag,{value:"Module"})),base10$2=baseX$1({prefix:"9",name:"base10",alphabet:"0123456789"}),base10$3=Object.freeze(Object.defineProperty({__proto__:null,base10:base10$2},Symbol.toStringTag,{value:"Module"})),base16$2=rfc4648$1({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper$1=rfc4648$1({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),base16$3=Object.freeze(Object.defineProperty({__proto__:null,base16:base16$2,base16upper:base16upper$1},Symbol.toStringTag,{value:"Module"})),base32$4=rfc4648$1({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper$1=rfc4648$1({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad$1=rfc4648$1({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper$1=rfc4648$1({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex$1=rfc4648$1({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper$1=rfc4648$1({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad$1=rfc4648$1({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper$1=rfc4648$1({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z$1=rfc4648$1({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$5=Object.freeze(Object.defineProperty({__proto__:null,base32:base32$4,base32hex:base32hex$1,base32hexpad:base32hexpad$1,base32hexpadupper:base32hexpadupper$1,base32hexupper:base32hexupper$1,base32pad:base32pad$1,base32padupper:base32padupper$1,base32upper:base32upper$1,base32z:base32z$1},Symbol.toStringTag,{value:"Module"})),base36$2=baseX$1({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper$1=baseX$1({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$3=Object.freeze(Object.defineProperty({__proto__:null,base36:base36$2,base36upper:base36upper$1},Symbol.toStringTag,{value:"Module"})),base58btc$1=baseX$1({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr$1=baseX$1({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58$1=Object.freeze(Object.defineProperty({__proto__:null,base58btc:base58btc$1,base58flickr:base58flickr$1},Symbol.toStringTag,{value:"Module"})),base64$4=rfc4648$1({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad$1=rfc4648$1({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url$1=rfc4648$1({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad$1=rfc4648$1({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$5=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$4,base64pad:base64pad$1,base64url:base64url$1,base64urlpad:base64urlpad$1},Symbol.toStringTag,{value:"Module"})),alphabet$1=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),alphabetBytesToChars$1=alphabet$1.reduce((et,o,tt)=>(et[tt]=o,et),[]),alphabetCharsToBytes$1=alphabet$1.reduce((et,o,tt)=>(et[o.codePointAt(0)]=tt,et),[]);function encode$5(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars$1[tt],o),"")}function decode$6(et){const o=[];for(const tt of et){const rt=alphabetCharsToBytes$1[tt.codePointAt(0)];if(rt===void 0)throw new Error(`Non-base256emoji character: ${tt}`);o.push(rt)}return new Uint8Array(o)}const base256emoji$2=from$2({prefix:"🚀",name:"base256emoji",encode:encode$5,decode:decode$6}),base256emoji$3=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:base256emoji$2},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const bases$1={...identityBase$1,...base2$3,...base8$3,...base10$3,...base16$3,...base32$5,...base36$3,...base58$1,...base64$5,...base256emoji$3};function createCodec$1(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$4=createCodec$1("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii$1=createCodec$1("ascii","a",et=>{let o="a";for(let tt=0;tt<et.length;tt++)o+=String.fromCharCode(et[tt]);return o},et=>{et=et.substring(1);const o=allocUnsafe$h(et.length);for(let tt=0;tt<et.length;tt++)o[tt]=et.charCodeAt(tt);return o}),BASES$1={utf8:string$4,"utf-8":string$4,hex:bases$1.base16,latin1:ascii$1,ascii:ascii$1,binary:ascii$1,...bases$1};function fromString$2(et,o="utf8"){const tt=BASES$1[o];if(!tt)throw new Error(`Unsupported encoding "${o}"`);return(o==="utf8"||o==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(et,"utf8"):tt.decoder.decode(`${tt.prefix}${et}`)}const log$8=new Logger$1("enr:decoder");class EnrDecoder{static fromString(o){if(!o.startsWith(ENR.RECORD_PREFIX))throw new Error(`"string encoded ENR must start with '${ENR.RECORD_PREFIX}'`);return EnrDecoder.fromRLP(fromString$2(o.slice(4),"base64url"))}static fromRLP(o){const tt=decode$8(o).map(hexToBytes$1);return fromValues(tt)}}async function fromValues(et){const{signature:o,seq:tt,kvs:rt}=checkValues(et),nt={};for(let st=0;st<rt.length;st+=2)try{nt[bytesToUtf8(rt[st])]=rt[st+1]}catch(at){log$8.error("Failed to decode ENR key to UTF-8, skipping it",rt[st],at)}const ot=decodeSeq(tt),it=ENR.create(nt,ot,o);return checkSignature(tt,rt,it,o),it}function decodeSeq(et){return et.length?BigInt("0x"+bytesToHex$1(et)):BigInt(0)}function checkValues(et){if(!Array.isArray(et))throw new Error("Decoded ENR must be an array");if(et.length%2!==0)throw new Error("Decoded ENR must have an even number of elements");const[o,tt,...rt]=et;if(!o||Array.isArray(o))throw new Error("Decoded ENR invalid signature: must be a byte array");if(!tt||Array.isArray(tt))throw new Error("Decoded ENR invalid sequence number: must be a byte array");return{signature:o,seq:tt,kvs:rt}}function checkSignature(et,o,tt,rt){const nt=hexToBytes$1(encode$7([et,...o]));if(!tt.verify(nt,rt))throw new Error("Unable to verify ENR signature")}const v4Regex$1=/^(\d{1,3}\.){3,3}\d{1,3}$/,v4Size=4,v6Regex$1=/^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i,v6Size=16,v4$1={name:"v4",size:v4Size,isFormat:et=>v4Regex$1.test(et),encode(et,o,tt){tt=~~tt,o=o||new Uint8Array(tt+v4Size);const rt=et.length;let nt=0;for(let ot=0;ot<rt;){const it=et.charCodeAt(ot++);it===46?(o[tt++]=nt,nt=0):nt=nt*10+(it-48)}return o[tt]=nt,o},decode(et,o){return o=~~o,`${et[o++]}.${et[o++]}.${et[o++]}.${et[o]}`}},v6={name:"v6",size:v6Size,isFormat:et=>et.length>0&&v6Regex$1.test(et),encode(et,o,tt){tt=~~tt;let rt=tt+v6Size,nt=-1,ot=0,it=0,st=!0,at=!1;o=o||new Uint8Array(tt+v6Size);for(let ct=0;ct<et.length;ct++){let lt=et.charCodeAt(ct);lt===58?(st?nt!==-1?(tt<rt&&(o[tt]=0),tt<rt-1&&(o[tt+1]=0),tt+=2):tt<rt&&(nt=tt):(at===!0?(tt<rt&&(o[tt]=it),tt++):(tt<rt&&(o[tt]=ot>>8),tt<rt-1&&(o[tt+1]=ot&255),tt+=2),ot=0,it=0),st=!0,at=!1):lt===46?(tt<rt&&(o[tt]=it),tt++,it=0,ot=0,st=!1,at=!0):(st=!1,lt>=97?lt-=87:lt>=65?lt-=55:(lt-=48,it=it*10+lt),ot=(ot<<4)+lt)}if(st===!1)at===!0?(tt<rt&&(o[tt]=it),tt++):(tt<rt&&(o[tt]=ot>>8),tt<rt-1&&(o[tt+1]=ot&255),tt+=2);else if(nt===0)tt<rt&&(o[tt]=0),tt<rt-1&&(o[tt+1]=0),tt+=2;else if(nt!==-1){tt+=2;for(let ct=Math.min(tt-1,rt-1);ct>=nt+2;ct--)o[ct]=o[ct-2];o[nt]=0,o[nt+1]=0,nt=tt}if(nt!==tt&&nt!==-1)for(tt>rt-2&&(tt=rt-2);rt>nt;)o[--rt]=tt<rt&&tt>nt?o[--tt]:0;else for(;tt<rt;)o[tt++]=0;return o},decode(et,o){o=~~o;let tt="";for(let rt=0;rt<v6Size;rt+=2)rt!==0&&(tt+=":"),tt+=(et[o+rt]<<8|et[o+rt+1]).toString(16);return tt.replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}};function sizeOf(et){if(v4$1.isFormat(et))return v4$1.size;if(v6.isFormat(et))return v6.size;throw Error(`Invalid ip address: ${et}`)}function familyOf(et){return sizeOf(et)===v4$1.size?1:2}function encode$4(et,o,tt){tt=~~tt;const rt=sizeOf(et);return typeof o=="function"&&(o=o(tt+rt)),rt===v4$1.size?v4$1.encode(et,o,tt):v6.encode(et,o,tt)}function decode$5(et,o,tt){if(o=~~o,tt=tt||et.length-o,tt===v4$1.size)return v4$1.decode(et,o,tt);if(tt===v6.size)return v6.decode(et,o,tt);throw Error(`Invalid buffer size needs to be ${v4$1.size} for v4 or ${v6.size} for v6.`)}function toString$7(et){switch(et){case 1:return"A";case 10:return"NULL";case 28:return"AAAA";case 18:return"AFSDB";case 42:return"APL";case 257:return"CAA";case 60:return"CDNSKEY";case 59:return"CDS";case 37:return"CERT";case 5:return"CNAME";case 49:return"DHCID";case 32769:return"DLV";case 39:return"DNAME";case 48:return"DNSKEY";case 43:return"DS";case 55:return"HIP";case 13:return"HINFO";case 45:return"IPSECKEY";case 25:return"KEY";case 36:return"KX";case 29:return"LOC";case 15:return"MX";case 35:return"NAPTR";case 2:return"NS";case 47:return"NSEC";case 50:return"NSEC3";case 51:return"NSEC3PARAM";case 12:return"PTR";case 46:return"RRSIG";case 17:return"RP";case 24:return"SIG";case 6:return"SOA";case 99:return"SPF";case 33:return"SRV";case 44:return"SSHFP";case 32768:return"TA";case 249:return"TKEY";case 52:return"TLSA";case 250:return"TSIG";case 16:return"TXT";case 252:return"AXFR";case 251:return"IXFR";case 41:return"OPT";case 255:return"ANY"}return"UNKNOWN_"+et}function toType(et){switch(et.toUpperCase()){case"A":return 1;case"NULL":return 10;case"AAAA":return 28;case"AFSDB":return 18;case"APL":return 42;case"CAA":return 257;case"CDNSKEY":return 60;case"CDS":return 59;case"CERT":return 37;case"CNAME":return 5;case"DHCID":return 49;case"DLV":return 32769;case"DNAME":return 39;case"DNSKEY":return 48;case"DS":return 43;case"HIP":return 55;case"HINFO":return 13;case"IPSECKEY":return 45;case"KEY":return 25;case"KX":return 36;case"LOC":return 29;case"MX":return 15;case"NAPTR":return 35;case"NS":return 2;case"NSEC":return 47;case"NSEC3":return 50;case"NSEC3PARAM":return 51;case"PTR":return 12;case"RRSIG":return 46;case"RP":return 17;case"SIG":return 24;case"SOA":return 6;case"SPF":return 99;case"SRV":return 33;case"SSHFP":return 44;case"TA":return 32768;case"TKEY":return 249;case"TLSA":return 52;case"TSIG":return 250;case"TXT":return 16;case"AXFR":return 252;case"IXFR":return 251;case"OPT":return 41;case"ANY":return 255;case"*":return 255}return et.toUpperCase().startsWith("UNKNOWN_")?parseInt(et.slice(8)):0}function toString$6(et){switch(et){case 0:return"NOERROR";case 1:return"FORMERR";case 2:return"SERVFAIL";case 3:return"NXDOMAIN";case 4:return"NOTIMP";case 5:return"REFUSED";case 6:return"YXDOMAIN";case 7:return"YXRRSET";case 8:return"NXRRSET";case 9:return"NOTAUTH";case 10:return"NOTZONE";case 11:return"RCODE_11";case 12:return"RCODE_12";case 13:return"RCODE_13";case 14:return"RCODE_14";case 15:return"RCODE_15"}return"RCODE_"+et}function toString$5(et){switch(et){case 0:return"QUERY";case 1:return"IQUERY";case 2:return"STATUS";case 3:return"OPCODE_3";case 4:return"NOTIFY";case 5:return"UPDATE";case 6:return"OPCODE_6";case 7:return"OPCODE_7";case 8:return"OPCODE_8";case 9:return"OPCODE_9";case 10:return"OPCODE_10";case 11:return"OPCODE_11";case 12:return"OPCODE_12";case 13:return"OPCODE_13";case 14:return"OPCODE_14";case 15:return"OPCODE_15"}return"OPCODE_"+et}function toString$4(et){switch(et){case 1:return"IN";case 2:return"CS";case 3:return"CH";case 4:return"HS";case 255:return"ANY"}return"UNKNOWN_"+et}function toClass(et){switch(et.toUpperCase()){case"IN":return 1;case"CS":return 2;case"CH":return 3;case"HS":return 4;case"ANY":return 255}return 0}function toString$3(et){switch(et){case 1:return"LLQ";case 2:return"UL";case 3:return"NSID";case 5:return"DAU";case 6:return"DHU";case 7:return"N3U";case 8:return"CLIENT_SUBNET";case 9:return"EXPIRE";case 10:return"COOKIE";case 11:return"TCP_KEEPALIVE";case 12:return"PADDING";case 13:return"CHAIN";case 14:return"KEY_TAG";case 26946:return"DEVICEID"}return et<0?null:`OPTION_${et}`}function toCode(et){if(typeof et=="number")return et;if(!et)return-1;switch(et.toUpperCase()){case"OPTION_0":return 0;case"LLQ":return 1;case"UL":return 2;case"NSID":return 3;case"OPTION_4":return 4;case"DAU":return 5;case"DHU":return 6;case"N3U":return 7;case"CLIENT_SUBNET":return 8;case"EXPIRE":return 9;case"COOKIE":return 10;case"TCP_KEEPALIVE":return 11;case"PADDING":return 12;case"CHAIN":return 13;case"KEY_TAG":return 14;case"DEVICEID":return 26946;case"OPTION_65535":return 65535}const o=et.match(/_(\d+)$/);return o?parseInt(o[1],10):-1}const SURROGATE_A=55296,SURROGATE_B=56320;function encodingLength$1(et){let o=0;const tt=et.length;for(let rt=0;rt<tt;rt+=1){const nt=et.charCodeAt(rt);if(nt<=127)o+=1;else if(nt<=2047)o+=2;else if((nt&63488)!==SURROGATE_A)o+=3;else{const ot=rt+1;ot===tt||nt>=SURROGATE_B||(et.charCodeAt(ot)&64512)!==SURROGATE_B?o+=3:(rt=ot,o+=4)}}return o}function encode$3(et,o,tt){const rt=et.length;tt==null&&(tt=0),o===void 0&&(o=new Uint8Array(encodingLength$1(et)+tt));let nt=tt;for(let ot=0;ot<rt;ot+=1){let it=et.charCodeAt(ot);if(it<=127)o[nt++]=it;else if(it<=2047)o[nt++]=192|(it&1984)>>6,o[nt++]=128|it&63;else if((it&63488)!==SURROGATE_A)o[nt++]=224|(it&61440)>>12,o[nt++]=128|(it&4032)>>6,o[nt++]=128|it&63;else{const st=ot+1;if(st===rt||it>=SURROGATE_B)o[nt++]=239,o[nt++]=191,o[nt++]=189;else{const at=et.charCodeAt(st);(at&64512)!==SURROGATE_B?(o[nt++]=239,o[nt++]=191,o[nt++]=189):(ot=st,it=65536|(it&1023)<<10|at&1023,o[nt++]=240|(it&1835008)>>18,o[nt++]=128|(it&258048)>>12,o[nt++]=128|(it&4032)>>6,o[nt++]=128|it&63)}}}return encode$3.bytes=nt-tt,o}encode$3.bytes=0;function decode$4(et,o,tt){let rt="";o==null&&(o=0),tt==null&&(tt=et.length);for(let nt=o;nt<tt;){const ot=et[nt++];let it;if(ot<=128)it=ot;else if(ot>191&&ot<224)it=(ot&31)<<6|et[nt++]&63;else if(ot>239&&ot<365){it=((ot&7)<<18|(et[nt++]&63)<<12|(et[nt++]&63)<<6|et[nt++]&63)-65536;const st=SURROGATE_A|it>>10&1023;rt+=String.fromCharCode(st),it=SURROGATE_B|it&1023}else it=(ot&15)<<12|(et[nt++]&63)<<6|et[nt++]&63;rt+=String.fromCharCode(it)}return decode$4.bytes=tt-o,rt}decode$4.bytes=0;const isU8Arr=et=>et instanceof Uint8Array;function bytelength(et){return typeof et=="string"?encodingLength$1(et):et.byteLength}function from$1(et){return et instanceof Uint8Array?et:Array.isArray(et)?new Uint8Array(et):encode$3(et)}function write(et,o,tt){if(typeof o!="string")throw new Error("unknown input type");return encode$3(o,et,tt),encode$3.bytes}const P_24=Math.pow(2,24),P_16=Math.pow(2,16),P_8=Math.pow(2,8),readUInt32BE=(et,o)=>et[o]*P_24+et[o+1]*P_16+et[o+2]*P_8+et[o+3],readUInt16BE=(et,o)=>et[o]<<8|et[o+1],writeUInt32BE=(et,o,tt)=>(o=+o,et[tt+3]=o,o=o>>>8,et[tt+2]=o,o=o>>>8,et[tt+1]=o,o=o>>>8,et[tt]=o,tt+4),writeUInt16BE=(et,o,tt)=>(et[tt]=o>>8,et[tt+1]=o&255,tt+2);function copy(et,o,tt,rt,nt){return tt<0&&(rt-=tt,tt=0),rt<0&&(rt=0),nt<0?new Uint8Array(0):tt>=o.length||rt>=nt?0:_copyActual(et,o,tt,rt,nt)}function _copyActual(et,o,tt,rt,nt){nt-rt>o.length-tt&&(nt=rt+o.length-tt);let ot=nt-rt;const it=et.length-rt;return ot>it&&(ot=it),(rt!==0||nt<et.length)&&(et=new Uint8Array(et.buffer,et.byteOffset+rt,ot)),o.set(et,tt),ot}const QUERY_FLAG=0,RESPONSE_FLAG=32768,FLUSH_MASK=32768,NOT_FLUSH_MASK=~FLUSH_MASK,QU_MASK=32768,NOT_QU_MASK=~QU_MASK;function codec({bytes:et=0,encode:o,decode:tt,encodingLength:rt}){return o.bytes=et,tt.bytes=et,{encode:o,decode:tt,encodingLength:rt||(()=>et)}}const name$1=codec({encode(et,o,tt){o||(o=new Uint8Array(name$1.encodingLength(et))),tt||(tt=0);const rt=tt,nt=et.replace(/^\.|\.$/gm,"");if(nt.length){const ot=nt.split(".");for(let it=0;it<ot.length;it++){const st=write(o,ot[it],tt+1);o[tt]=st,tt+=st+1}}return o[tt++]=0,name$1.encode.bytes=tt-rt,o},decode(et,o){o||(o=0);const tt=[];let rt=o,nt=0,ot=0,it=!1;for(;;){if(o>=et.length)throw new Error("Cannot decode name (buffer overflow)");const st=et[o++];if(ot+=it?0:1,st===0)break;if(st&192)if((st&192)===192){if(o+1>et.length)throw new Error("Cannot decode name (buffer overflow)");const at=readUInt16BE(et,o-1)-49152;if(at>=rt)throw new Error("Cannot decode name (bad pointer)");o=at,rt=at,ot+=it?0:1,it=!0}else throw new Error("Cannot decode name (bad label)");else{if(o+st>et.length)throw new Error("Cannot decode name (buffer overflow)");if(nt+=st+1,nt>254)throw new Error("Cannot decode name (name too long)");tt.push(decode$4(et,o,o+st)),o+=st,ot+=it?0:st}}return name$1.decode.bytes=ot,tt.length===0?".":tt.join(".")},encodingLength(et){return et==="."||et===".."?1:bytelength(et.replace(/^\.|\.$/gm,""))+2}}),string$3=codec({encode(et,o,tt){o||(o=new Uint8Array(string$3.encodingLength(et))),tt||(tt=0);const rt=write(o,et,tt+1);return o[tt]=rt,string$3.encode.bytes=rt+1,o},decode(et,o){o||(o=0);const tt=et[o],rt=decode$4(et,o+1,o+1+tt);return string$3.decode.bytes=tt+1,rt},encodingLength(et){return bytelength(et)+1}}),header=codec({bytes:12,encode(et,o,tt){o||(o=new Uint8Array(header.encodingLength(et))),tt||(tt=0);const rt=(et.flags||0)&32767,nt=et.type==="response"?RESPONSE_FLAG:QUERY_FLAG;return writeUInt16BE(o,et.id||0,tt),writeUInt16BE(o,rt|nt,tt+2),writeUInt16BE(o,et.questions.length,tt+4),writeUInt16BE(o,et.answers.length,tt+6),writeUInt16BE(o,et.authorities.length,tt+8),writeUInt16BE(o,et.additionals.length,tt+10),o},decode(et,o){if(o||(o=0),et.length<12)throw new Error("Header must be 12 bytes");const tt=readUInt16BE(et,o+2);return{id:readUInt16BE(et,o),type:tt&RESPONSE_FLAG?"response":"query",flags:tt&32767,flag_qr:(tt>>15&1)===1,opcode:toString$5(tt>>11&15),flag_aa:(tt>>10&1)===1,flag_tc:(tt>>9&1)===1,flag_rd:(tt>>8&1)===1,flag_ra:(tt>>7&1)===1,flag_z:(tt>>6&1)===1,flag_ad:(tt>>5&1)===1,flag_cd:(tt>>4&1)===1,rcode:toString$6(tt&15),questions:new Array(readUInt16BE(et,o+4)),answers:new Array(readUInt16BE(et,o+6)),authorities:new Array(readUInt16BE(et,o+8)),additionals:new Array(readUInt16BE(et,o+10))}},encodingLength(){return 12}}),runknown=codec({encode(et,o,tt){o||(o=new Uint8Array(runknown.encodingLength(et))),tt||(tt=0);const rt=et.length;return writeUInt16BE(o,rt,tt),copy(et,o,tt+2,0,rt),runknown.encode.bytes=rt+2,o},decode(et,o){o||(o=0);const tt=readUInt16BE(et,o),rt=et.slice(o+2,o+2+tt);return runknown.decode.bytes=tt+2,rt},encodingLength(et){return et.length+2}}),rns=codec({encode(et,o,tt){return o||(o=new Uint8Array(rns.encodingLength(et))),tt||(tt=0),name$1.encode(et,o,tt+2),writeUInt16BE(o,name$1.encode.bytes,tt),rns.encode.bytes=name$1.encode.bytes+2,o},decode(et,o){o||(o=0);const tt=readUInt16BE(et,o),rt=name$1.decode(et,o+2);return rns.decode.bytes=tt+2,rt},encodingLength(et){return name$1.encodingLength(et)+2}}),rsoa=codec({encode(et,o,tt){o||(o=new Uint8Array(rsoa.encodingLength(et))),tt||(tt=0);const rt=tt;return tt+=2,name$1.encode(et.mname,o,tt),tt+=name$1.encode.bytes,name$1.encode(et.rname,o,tt),tt+=name$1.encode.bytes,writeUInt32BE(o,et.serial||0,tt),tt+=4,writeUInt32BE(o,et.refresh||0,tt),tt+=4,writeUInt32BE(o,et.retry||0,tt),tt+=4,writeUInt32BE(o,et.expire||0,tt),tt+=4,writeUInt32BE(o,et.minimum||0,tt),tt+=4,writeUInt16BE(o,tt-rt-2,rt),rsoa.encode.bytes=tt-rt,o},decode(et,o){o||(o=0);const tt=o,rt={};return o+=2,rt.mname=name$1.decode(et,o),o+=name$1.decode.bytes,rt.rname=name$1.decode(et,o),o+=name$1.decode.bytes,rt.serial=readUInt32BE(et,o),o+=4,rt.refresh=readUInt32BE(et,o),o+=4,rt.retry=readUInt32BE(et,o),o+=4,rt.expire=readUInt32BE(et,o),o+=4,rt.minimum=readUInt32BE(et,o),o+=4,rsoa.decode.bytes=o-tt,rt},encodingLength(et){return 22+name$1.encodingLength(et.mname)+name$1.encodingLength(et.rname)}}),rtxt=codec({encode(et,o,tt){Array.isArray(et)||(et=[et]);for(let nt=0;nt<et.length;nt++)if(typeof et[nt]=="string"&&(et[nt]=from$1(et[nt])),!isU8Arr(et[nt]))throw new Error("Must be a Buffer");o||(o=new Uint8Array(rtxt.encodingLength(et))),tt||(tt=0);const rt=tt;return tt+=2,et.forEach(function(nt){o[tt++]=nt.length,copy(nt,o,tt,0,nt.length),tt+=nt.length}),writeUInt16BE(o,tt-rt-2,rt),rtxt.encode.bytes=tt-rt,o},decode(et,o){o||(o=0);const tt=o;let rt=readUInt16BE(et,o);o+=2;const nt=[];for(;rt>0;){const ot=et[o++];if(--rt,rt<ot)throw new Error("Buffer overflow");nt.push(et.slice(o,o+ot)),o+=ot,rt-=ot}return rtxt.decode.bytes=o-tt,nt},encodingLength(et){Array.isArray(et)||(et=[et]);let o=2;return et.forEach(function(tt){typeof tt=="string"?o+=bytelength(tt)+1:o+=tt.length+1}),o}}),rnull=codec({encode(et,o,tt){o||(o=new Uint8Array(rnull.encodingLength(et))),tt||(tt=0),typeof et=="string"&&(et=from$1(et)),et||(et=new Uint8Array(0));const rt=tt;tt+=2;const nt=et.length;return copy(et,o,tt,0,nt),tt+=nt,writeUInt16BE(o,tt-rt-2,rt),rnull.encode.bytes=tt-rt,o},decode(et,o){o||(o=0);const tt=o,rt=readUInt16BE(et,o);o+=2;const nt=et.slice(o,o+rt);return o+=rt,rnull.decode.bytes=o-tt,nt},encodingLength(et){return et?(isU8Arr(et)?et.length:bytelength(et))+2:2}}),rhinfo=codec({encode(et,o,tt){o||(o=new Uint8Array(rhinfo.encodingLength(et))),tt||(tt=0);const rt=tt;return tt+=2,string$3.encode(et.cpu,o,tt),tt+=string$3.encode.bytes,string$3.encode(et.os,o,tt),tt+=string$3.encode.bytes,writeUInt16BE(o,tt-rt-2,rt),rhinfo.encode.bytes=tt-rt,o},decode(et,o){o||(o=0);const tt=o,rt={};return o+=2,rt.cpu=string$3.decode(et,o),o+=string$3.decode.bytes,rt.os=string$3.decode(et,o),o+=string$3.decode.bytes,rhinfo.decode.bytes=o-tt,rt},encodingLength(et){return string$3.encodingLength(et.cpu)+string$3.encodingLength(et.os)+2}}),rptr=codec({encode(et,o,tt){return o||(o=new Uint8Array(rptr.encodingLength(et))),tt||(tt=0),name$1.encode(et,o,tt+2),writeUInt16BE(o,name$1.encode.bytes,tt),rptr.encode.bytes=name$1.encode.bytes+2,o},decode(et,o){o||(o=0);const tt=name$1.decode(et,o+2);return rptr.decode.bytes=name$1.decode.bytes+2,tt},encodingLength(et){return name$1.encodingLength(et)+2}}),rsrv=codec({encode(et,o,tt){o||(o=new Uint8Array(rsrv.encodingLength(et))),tt||(tt=0),writeUInt16BE(o,et.priority||0,tt+2),writeUInt16BE(o,et.weight||0,tt+4),writeUInt16BE(o,et.port||0,tt+6),name$1.encode(et.target,o,tt+8);const rt=name$1.encode.bytes+6;return writeUInt16BE(o,rt,tt),rsrv.encode.bytes=rt+2,o},decode(et,o){o||(o=0);const tt=readUInt16BE(et,o),rt={};return rt.priority=readUInt16BE(et,o+2),rt.weight=readUInt16BE(et,o+4),rt.port=readUInt16BE(et,o+6),rt.target=name$1.decode(et,o+8),rsrv.decode.bytes=tt+2,rt},encodingLength(et){return 8+name$1.encodingLength(et.target)}}),rcaa=codec({encode(et,o,tt){const rt=rcaa.encodingLength(et);return o||(o=new Uint8Array(rcaa.encodingLength(et))),tt||(tt=0),et.issuerCritical&&(et.flags=rcaa.ISSUER_CRITICAL),writeUInt16BE(o,rt-2,tt),tt+=2,o[tt]=et.flags||0,tt+=1,string$3.encode(et.tag,o,tt),tt+=string$3.encode.bytes,write(o,et.value,tt),tt+=bytelength(et.value),rcaa.encode.bytes=rt,o},decode(et,o){o||(o=0);const tt=readUInt16BE(et,o);o+=2;const rt=o,nt={};return nt.flags=et[o],o+=1,nt.tag=string$3.decode(et,o),o+=string$3.decode.bytes,nt.value=decode$4(et,o,rt+tt),nt.issuerCritical=!!(nt.flags&rcaa.ISSUER_CRITICAL),rcaa.decode.bytes=tt+2,nt},encodingLength(et){return string$3.encodingLength(et.tag)+string$3.encodingLength(et.value)+2}});rcaa.ISSUER_CRITICAL=128;const rmx=codec({encode(et,o,tt){o||(o=new Uint8Array(rmx.encodingLength(et))),tt||(tt=0);const rt=tt;return tt+=2,writeUInt16BE(o,et.preference||0,tt),tt+=2,name$1.encode(et.exchange,o,tt),tt+=name$1.encode.bytes,writeUInt16BE(o,tt-rt-2,rt),rmx.encode.bytes=tt-rt,o},decode(et,o){o||(o=0);const tt=o,rt={};return o+=2,rt.preference=readUInt16BE(et,o),o+=2,rt.exchange=name$1.decode(et,o),o+=name$1.decode.bytes,rmx.decode.bytes=o-tt,rt},encodingLength(et){return 4+name$1.encodingLength(et.exchange)}}),ra=codec({encode(et,o,tt){return o||(o=new Uint8Array(ra.encodingLength(et))),tt||(tt=0),writeUInt16BE(o,4,tt),tt+=2,v4$1.encode(et,o,tt),o},decode(et,o){return o||(o=0),o+=2,v4$1.decode(et,o)},bytes:6}),raaaa=codec({encode(et,o,tt){return o||(o=new Uint8Array(raaaa.encodingLength(et))),tt||(tt=0),writeUInt16BE(o,16,tt),tt+=2,v6.encode(et,o,tt),raaaa.encode.bytes=18,o},decode(et,o){o||(o=0),o+=2;const tt=v6.decode(et,o);return raaaa.decode.bytes=18,tt},bytes:18}),alloc=et=>new Uint8Array(et),roption=codec({encode(et,o,tt){o||(o=new Uint8Array(roption.encodingLength(et))),tt||(tt=0);const rt=tt,nt=toCode(et.code);if(writeUInt16BE(o,nt,tt),tt+=2,et.data)writeUInt16BE(o,et.data.length,tt),tt+=2,copy(et.data,o,tt),tt+=et.data.length;else switch(nt){case 8:{const ot=et.sourcePrefixLength||0,it=et.family||familyOf(et.ip),st=encode$4(et.ip,alloc),at=Math.ceil(ot/8);writeUInt16BE(o,at+4,tt),tt+=2,writeUInt16BE(o,it,tt),tt+=2,o[tt++]=ot,o[tt++]=et.scopePrefixLength||0,copy(st,o,tt,0,at),tt+=at}break;case 11:et.timeout?(writeUInt16BE(o,2,tt),tt+=2,writeUInt16BE(o,et.timeout,tt),tt+=2):(writeUInt16BE(o,0,tt),tt+=2);break;case 12:{const ot=et.length||0;writeUInt16BE(o,ot,tt),tt+=2,o.fill(0,tt,tt+ot),tt+=ot}break;case 14:{const ot=et.tags.length*2;writeUInt16BE(o,ot,tt),tt+=2;for(const it of et.tags)writeUInt16BE(o,it,tt),tt+=2}break;default:throw new Error(`Unknown roption code: ${et.code}`)}return roption.encode.bytes=tt-rt,o},decode(et,o){o||(o=0);const tt={};tt.code=readUInt16BE(et,o),tt.type=toString$3(tt.code),o+=2;const rt=readUInt16BE(et,o);switch(o+=2,tt.data=et.slice(o,o+rt),tt.code){case 8:tt.family=readUInt16BE(et,o),o+=2,tt.sourcePrefixLength=et[o++],tt.scopePrefixLength=et[o++];{const nt=new Uint8Array(tt.family===1?4:16);copy(et,nt,0,o,o+rt-4),tt.ip=decode$5(nt)}break;case 11:rt>0&&(tt.timeout=readUInt16BE(et,o),o+=2);break;case 14:tt.tags=[];for(let nt=0;nt<rt;nt+=2)tt.tags.push(readUInt16BE(et,o)),o+=2}return roption.decode.bytes=rt+4,tt},encodingLength(et){if(et.data)return et.data.length+4;switch(toCode(et.code)){case 8:{const tt=et.sourcePrefixLength||0;return Math.ceil(tt/8)+8}case 11:return typeof et.timeout=="number"?6:4;case 12:return et.length+4;case 14:return 4+et.tags.length*2}throw new Error(`Unknown roption code: ${et.code}`)}}),ropt=codec({encode(et,o,tt){o||(o=new Uint8Array(ropt.encodingLength(et))),tt||(tt=0);const rt=tt,nt=encodingLengthList(et,roption);return writeUInt16BE(o,nt,tt),tt=encodeList(et,roption,o,tt+2),ropt.encode.bytes=tt-rt,o},decode(et,o){o||(o=0);const tt=o,rt=[];let nt=readUInt16BE(et,o);o+=2;let ot=0;for(;nt>0;)rt[ot++]=roption.decode(et,o),o+=roption.decode.bytes,nt-=roption.decode.bytes;return ropt.decode.bytes=o-tt,rt},encodingLength(et){return 2+encodingLengthList(et||[],roption)}}),rdnskey=codec({encode(et,o,tt){o||(o=new Uint8Array(rdnskey.encodingLength(et))),tt||(tt=0);const rt=tt,nt=et.key;if(!isU8Arr(nt))throw new Error("Key must be a Buffer");return tt+=2,writeUInt16BE(o,et.flags,tt),tt+=2,o[tt]=rdnskey.PROTOCOL_DNSSEC,tt+=1,o[tt]=et.algorithm,tt+=1,copy(nt,o,tt,0,nt.length),tt+=nt.length,rdnskey.encode.bytes=tt-rt,writeUInt16BE(o,rdnskey.encode.bytes-2,rt),o},decode(et,o){o||(o=0);const tt=o,rt={},nt=readUInt16BE(et,o);if(o+=2,rt.flags=readUInt16BE(et,o),o+=2,et[o]!==rdnskey.PROTOCOL_DNSSEC)throw new Error("Protocol must be 3");return o+=1,rt.algorithm=et[o],o+=1,rt.key=et.slice(o,tt+nt+2),o+=rt.key.length,rdnskey.decode.bytes=o-tt,rt},encodingLength(et){return 6+bytelength(et.key)}});rdnskey.PROTOCOL_DNSSEC=3;rdnskey.ZONE_KEY=128;rdnskey.SECURE_ENTRYPOINT=32768;const rrrsig=codec({encode(et,o,tt){o||(o=new Uint8Array(rrrsig.encodingLength(et))),tt||(tt=0);const rt=tt,nt=et.signature;if(!isU8Arr(nt))throw new Error("Signature must be a Buffer");return tt+=2,writeUInt16BE(o,toType(et.typeCovered),tt),tt+=2,o[tt]=et.algorithm,tt+=1,o[tt]=et.labels,tt+=1,writeUInt32BE(o,et.originalTTL,tt),tt+=4,writeUInt32BE(o,et.expiration,tt),tt+=4,writeUInt32BE(o,et.inception,tt),tt+=4,writeUInt16BE(o,et.keyTag,tt),tt+=2,name$1.encode(et.signersName,o,tt),tt+=name$1.encode.bytes,copy(nt,o,tt,0,nt.length),tt+=nt.length,rrrsig.encode.bytes=tt-rt,writeUInt16BE(o,rrrsig.encode.bytes-2,rt),o},decode(et,o){o||(o=0);const tt=o,rt={},nt=readUInt16BE(et,o);return o+=2,rt.typeCovered=toString$7(readUInt16BE(et,o)),o+=2,rt.algorithm=et[o],o+=1,rt.labels=et[o],o+=1,rt.originalTTL=readUInt32BE(et,o),o+=4,rt.expiration=readUInt32BE(et,o),o+=4,rt.inception=readUInt32BE(et,o),o+=4,rt.keyTag=readUInt16BE(et,o),o+=2,rt.signersName=name$1.decode(et,o),o+=name$1.decode.bytes,rt.signature=et.slice(o,tt+nt+2),o+=rt.signature.length,rrrsig.decode.bytes=o-tt,rt},encodingLength(et){return 20+name$1.encodingLength(et.signersName)+bytelength(et.signature)}}),rrp=codec({encode(et,o,tt){o||(o=new Uint8Array(rrp.encodingLength(et))),tt||(tt=0);const rt=tt;return tt+=2,name$1.encode(et.mbox||".",o,tt),tt+=name$1.encode.bytes,name$1.encode(et.txt||".",o,tt),tt+=name$1.encode.bytes,rrp.encode.bytes=tt-rt,writeUInt16BE(o,rrp.encode.bytes-2,rt),o},decode(et,o){o||(o=0);const tt=o,rt={};return o+=2,rt.mbox=name$1.decode(et,o)||".",o+=name$1.decode.bytes,rt.txt=name$1.decode(et,o)||".",o+=name$1.decode.bytes,rrp.decode.bytes=o-tt,rt},encodingLength(et){return 2+name$1.encodingLength(et.mbox||".")+name$1.encodingLength(et.txt||".")}}),typebitmap=codec({encode(et,o,tt){o||(o=new Uint8Array(typebitmap.encodingLength(et))),tt||(tt=0);const rt=tt,nt=[];for(let ot=0;ot<et.length;ot++){const it=toType(et[ot]);nt[it>>8]===void 0&&(nt[it>>8]=[]),nt[it>>8][it>>3&31]|=1<<7-(it&7)}for(let ot=0;ot<nt.length;ot++)if(nt[ot]!==void 0){const it=from$1(nt[ot]);o[tt]=ot,tt+=1,o[tt]=it.length,tt+=1,copy(it,o,tt,0,it.length),tt+=it.length}return typebitmap.encode.bytes=tt-rt,o},decode(et,o,tt){o||(o=0);const rt=o,nt=[];for(;o-rt<tt;){const ot=et[o];o+=1;const it=et[o];o+=1;for(let st=0;st<it;st++){const at=et[o+st];for(let ct=0;ct<8;ct++)if(at&1<<7-ct){const lt=toString$7(ot<<8|st<<3|ct);nt.push(lt)}}o+=it}return typebitmap.decode.bytes=o-rt,nt},encodingLength(et){const o=[];for(let rt=0;rt<et.length;rt++){const nt=toType(et[rt]);o[nt>>8]=Math.max(o[nt>>8]||0,nt&255)}let tt=0;for(let rt=0;rt<o.length;rt++)o[rt]!==void 0&&(tt+=2+Math.ceil((o[rt]+1)/8));return tt}}),rnsec=codec({encode(et,o,tt){o||(o=new Uint8Array(rnsec.encodingLength(et))),tt||(tt=0);const rt=tt;return tt+=2,name$1.encode(et.nextDomain,o,tt),tt+=name$1.encode.bytes,typebitmap.encode(et.rrtypes,o,tt),tt+=typebitmap.encode.bytes,rnsec.encode.bytes=tt-rt,writeUInt16BE(o,rnsec.encode.bytes-2,rt),o},decode(et,o){o||(o=0);const tt=o,rt={},nt=readUInt16BE(et,o);return o+=2,rt.nextDomain=name$1.decode(et,o),o+=name$1.decode.bytes,rt.rrtypes=typebitmap.decode(et,o,nt-(o-tt)),o+=typebitmap.decode.bytes,rnsec.decode.bytes=o-tt,rt},encodingLength(et){return 2+name$1.encodingLength(et.nextDomain)+typebitmap.encodingLength(et.rrtypes)}}),rnsec3=codec({encode(et,o,tt){o||(o=new Uint8Array(rnsec3.encodingLength(et))),tt||(tt=0);const rt=tt,nt=et.salt;if(!isU8Arr(nt))throw new Error("salt must be a Buffer");const ot=et.nextDomain;if(!isU8Arr(ot))throw new Error("nextDomain must be a Buffer");return tt+=2,o[tt]=et.algorithm,tt+=1,o[tt]=et.flags,tt+=1,writeUInt16BE(o,et.iterations,tt),tt+=2,o[tt]=nt.length,tt+=1,copy(nt,o,tt,0,nt.length),tt+=nt.length,o[tt]=ot.length,tt+=1,copy(ot,o,tt,0,ot.length),tt+=ot.length,typebitmap.encode(et.rrtypes,o,tt),tt+=typebitmap.encode.bytes,rnsec3.encode.bytes=tt-rt,writeUInt16BE(o,rnsec3.encode.bytes-2,rt),o},decode(et,o){o||(o=0);const tt=o,rt={},nt=readUInt16BE(et,o);o+=2,rt.algorithm=et[o],o+=1,rt.flags=et[o],o+=1,rt.iterations=readUInt16BE(et,o),o+=2;const ot=et[o];o+=1,rt.salt=et.slice(o,o+ot),o+=ot;const it=et[o];return o+=1,rt.nextDomain=et.slice(o,o+it),o+=it,rt.rrtypes=typebitmap.decode(et,o,nt-(o-tt)),o+=typebitmap.decode.bytes,rnsec3.decode.bytes=o-tt,rt},encodingLength(et){return 8+et.salt.length+et.nextDomain.length+typebitmap.encodingLength(et.rrtypes)}}),rds=codec({encode(et,o,tt){o||(o=new Uint8Array(rds.encodingLength(et))),tt||(tt=0);const rt=tt,nt=et.digest;if(!isU8Arr(nt))throw new Error("Digest must be a Buffer");return tt+=2,writeUInt16BE(o,et.keyTag,tt),tt+=2,o[tt]=et.algorithm,tt+=1,o[tt]=et.digestType,tt+=1,copy(nt,o,tt,0,nt.length),tt+=nt.length,rds.encode.bytes=tt-rt,writeUInt16BE(o,rds.encode.bytes-2,rt),o},decode(et,o){o||(o=0);const tt=o,rt={},nt=readUInt16BE(et,o);return o+=2,rt.keyTag=readUInt16BE(et,o),o+=2,rt.algorithm=et[o],o+=1,rt.digestType=et[o],o+=1,rt.digest=et.slice(o,tt+nt+2),o+=rt.digest.length,rds.decode.bytes=o-tt,rt},encodingLength(et){return 6+bytelength(et.digest)}});function renc(et){switch(et.toUpperCase()){case"A":return ra;case"PTR":return rptr;case"CNAME":return rptr;case"DNAME":return rptr;case"TXT":return rtxt;case"NULL":return rnull;case"AAAA":return raaaa;case"SRV":return rsrv;case"HINFO":return rhinfo;case"CAA":return rcaa;case"NS":return rns;case"SOA":return rsoa;case"MX":return rmx;case"OPT":return ropt;case"DNSKEY":return rdnskey;case"RRSIG":return rrrsig;case"RP":return rrp;case"NSEC":return rnsec;case"NSEC3":return rnsec3;case"DS":return rds}return runknown}const answer=codec({encode(et,o,tt){o||(o=new Uint8Array(answer.encodingLength(et))),tt||(tt=0);const rt=tt;if(name$1.encode(et.name,o,tt),tt+=name$1.encode.bytes,writeUInt16BE(o,toType(et.type),tt),et.type.toUpperCase()==="OPT"){if(et.name!==".")throw new Error("OPT name must be root.");writeUInt16BE(o,et.udpPayloadSize||4096,tt+2),o[tt+4]=et.extendedRcode||0,o[tt+5]=et.ednsVersion||0,writeUInt16BE(o,et.flags||0,tt+6),tt+=8,ropt.encode(et.options||[],o,tt),tt+=ropt.encode.bytes}else{let nt=toClass(et.class===void 0?"IN":et.class);et.flush&&(nt|=FLUSH_MASK),writeUInt16BE(o,nt,tt+2),writeUInt32BE(o,et.ttl||0,tt+4),tt+=8;const ot=renc(et.type);ot.encode(et.data,o,tt),tt+=ot.encode.bytes}return answer.encode.bytes=tt-rt,o},decode(et,o){o||(o=0);const tt={},rt=o;if(tt.name=name$1.decode(et,o),o+=name$1.decode.bytes,tt.type=toString$7(readUInt16BE(et,o)),tt.type==="OPT")tt.udpPayloadSize=readUInt16BE(et,o+2),tt.extendedRcode=et[o+4],tt.ednsVersion=et[o+5],tt.flags=readUInt16BE(et,o+6),tt.flag_do=(tt.flags>>15&1)===1,tt.options=ropt.decode(et,o+8),o+=8+ropt.decode.bytes;else{const nt=readUInt16BE(et,o+2);tt.ttl=readUInt32BE(et,o+4),tt.class=toString$4(nt&NOT_FLUSH_MASK),tt.flush=!!(nt&FLUSH_MASK);const ot=renc(tt.type);tt.data=ot.decode(et,o+8),o+=8+ot.decode.bytes}return answer.decode.bytes=o-rt,tt},encodingLength(et){const o=et.data!==null&&et.data!==void 0?et.data:et.options;return name$1.encodingLength(et.name)+8+renc(et.type).encodingLength(o)}}),question=codec({encode(et,o,tt){o||(o=new Uint8Array(question.encodingLength(et))),tt||(tt=0);const rt=tt;return name$1.encode(et.name,o,tt),tt+=name$1.encode.bytes,writeUInt16BE(o,toType(et.type),tt),tt+=2,writeUInt16BE(o,toClass(et.class===void 0?"IN":et.class),tt),tt+=2,question.encode.bytes=tt-rt,et},decode(et,o){o||(o=0);const tt=o,rt={};return rt.name=name$1.decode(et,o),o+=name$1.decode.bytes,rt.type=toString$7(readUInt16BE(et,o)),o+=2,rt.class=toString$4(readUInt16BE(et,o)),o+=2,!!(rt.class&QU_MASK)&&(rt.class&=NOT_QU_MASK),question.decode.bytes=o-tt,rt},encodingLength(et){return name$1.encodingLength(et.name)+4}}),RECURSION_DESIRED=256,packet={encode:function(et,o,tt){const rt=!o;rt&&(o=new Uint8Array(encodingLength(et))),tt||(tt=0);const nt=tt;return et.questions||(et.questions=[]),et.answers||(et.answers=[]),et.authorities||(et.authorities=[]),et.additionals||(et.additionals=[]),header.encode(et,o,tt),tt+=header.encode.bytes,tt=encodeList(et.questions,question,o,tt),tt=encodeList(et.answers,answer,o,tt),tt=encodeList(et.authorities,answer,o,tt),tt=encodeList(et.additionals,answer,o,tt),packet.encode.bytes=tt-nt,rt&&encode$2.bytes!==o.length?o.slice(0,encode$2.bytes):o},decode:function(et,o){o||(o=0);const tt=o,rt=header.decode(et,o);return o+=header.decode.bytes,o=decodeList(rt.questions,question,et,o),o=decodeList(rt.answers,answer,et,o),o=decodeList(rt.authorities,answer,et,o),o=decodeList(rt.additionals,answer,et,o),packet.decode.bytes=o-tt,rt},encodingLength:function(et){return header.encodingLength(et)+encodingLengthList(et.questions||[],question)+encodingLengthList(et.answers||[],answer)+encodingLengthList(et.authorities||[],answer)+encodingLengthList(et.additionals||[],answer)}};packet.encode.bytes=0;packet.decode.bytes=0;const encode$2=packet.encode,decode$3=packet.decode,encodingLength=packet.encodingLength;function encodingLengthList(et,o){let tt=0;for(let rt=0;rt<et.length;rt++)tt+=o.encodingLength(et[rt]);return tt}function encodeList(et,o,tt,rt){for(let nt=0;nt<et.length;nt++)o.encode(et[nt],tt,rt),rt+=o.encode.bytes;return rt}function decodeList(et,o,tt,rt){for(let nt=0;nt<et.length;nt++)et[nt]=o.decode(tt,rt),rt+=o.decode.bytes;return rt}const PREFERS_PADDING=1,PREFERS_NO_PADDING=2;function make(et,o,tt,rt){if(o.length!==64)throw new Error(`Charset needs to be 64 characters long! (${o.length})`);const nt=new Uint8Array(256),ot=new Uint8Array(64);for(let at=0;at<64;at+=1){const ct=o.charCodeAt(at);if(ct>255)throw new Error(`Character #${at} in charset [code=${ct}, char=${o.charAt(at)}] is too high! (max=255)`);if(nt[ct]!==0)throw new Error(`Character [code=${ct}, char=${o.charAt(at)}] is more than once in the charset!`);nt[ct]=at,ot[at]=ct}const it=tt.charCodeAt(0),st={name:et,encodingLength(at){const ct=at.length,lt=ct*.75|0;return at.charCodeAt(ct-1)===it?at.charCodeAt(ct-2)===it?lt-2:lt-1:lt},encode(at,ct,lt){ct==null&&(ct=new Uint8Array(st.encodingLength(at))),lt==null&&(lt=0);let dt=at.length;at.charCodeAt(dt-1)===it&&(at.charCodeAt(dt-2)===it?dt-=2:dt-=1);const ht=dt%4,mt=dt-ht;let ft=lt,pt=0;for(;pt<mt;){const yt=nt[at.charCodeAt(pt)]<<18|nt[at.charCodeAt(pt+1)]<<12|nt[at.charCodeAt(pt+2)]<<6|nt[at.charCodeAt(pt+3)];ct[ft++]=yt>>16,ct[ft++]=yt>>8,ct[ft++]=yt,pt+=4}if(ht===3){const yt=nt[at.charCodeAt(pt)]<<10|nt[at.charCodeAt(pt+1)]<<4|nt[at.charCodeAt(pt+2)]>>2;ct[ft++]=yt>>8,ct[ft++]=yt}else ht===2&&(ct[ft++]=nt[at.charCodeAt(pt)]<<2|nt[at.charCodeAt(pt+1)]>>4);return st.encode.bytes=ft-lt,ct},decode(at,ct,lt){ct==null&&(ct=0),lt==null&&(lt=at.length);const dt=lt-ct,ht=dt%3,mt=ct+dt-ht,ft=[];for(let pt=ct;pt<mt;pt+=3){const yt=at[pt]<<16|at[pt+1]<<8|at[pt+2];ft.push(ot[yt>>18&63],ot[yt>>12&63],ot[yt>>6&63],ot[yt&63])}if(ht===2){const pt=(at[lt-2]<<8)+at[lt-1];ft.push(ot[pt>>10],ot[pt>>4&63],ot[pt<<2&63]),rt===PREFERS_PADDING&&ft.push(it)}else if(ht===1){const pt=at[lt-1];ft.push(ot[pt>>2],ot[pt<<4&63]),rt===PREFERS_PADDING&&ft.push(it,it)}return st.decode.bytes=dt,String.fromCharCode.apply(String,ft)}};return st}make("base64","ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/","=",PREFERS_PADDING);const base64URL=make("base64-url","ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_","=",PREFERS_NO_PADDING);let AbortError=typeof globalThis<"u"?globalThis.AbortError:typeof window<"u"?window.AbortError:null;AbortError||(AbortError=class extends Error{constructor(o="Request aborted."){super(o)}});AbortError.prototype.name="AbortError";AbortError.prototype.code="ABORT_ERR";const URL$1=typeof globalThis<"u"&&globalThis.URL||require("url").URL;class HTTPStatusError extends Error{constructor(o,tt,rt){super("status="+tt+" while requesting "+o+" ["+rt+"]"),this.uri=o,this.status=tt,this.method=rt}toJSON(){return{code:this.code,uri:this.uri,status:this.status,method:this.method,endpoint:this.endpoint}}}HTTPStatusError.prototype.name="HTTPStatusError";HTTPStatusError.prototype.code="HTTP_STATUS";class ResponseError extends Error{constructor(o,tt){super(o),this.cause=tt}toJSON(){return{message:this.message,endpoint:this.endpoint,code:this.code,cause:reduceError(this.cause)}}}ResponseError.prototype.name="ResponseError";ResponseError.prototype.code="RESPONSE_ERR";class TimeoutError extends Error{constructor(o){super("Timeout (t="+o+")."),this.timeout=o}toJSON(){return{code:this.code,endpoint:this.endpoint,timeout:this.timeout}}}TimeoutError.prototype.name="TimeoutError";TimeoutError.prototype.code="ETIMEOUT";const v4Regex=/^((\d{1,3}\.){3,3}\d{1,3})(:(\d{2,5}))?$/,v6Regex=/^((::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?)(:(\d{2,5}))?$/i;function reduceError(et){if(typeof et=="string")return{message:et};try{const tt=JSON.stringify(et);if(tt!=="{}")return JSON.parse(tt)}catch{}const o={message:String(et.message||et)};return et.code!==void 0&&(o.code=String(et.code)),o}const baseParts=/^(([a-z0-9]+:)\/\/)?([^/[\s:]+|\[[^\]]+\])?(:([^/\s]+))?(\/[^\s]*)?(.*)$/,httpFlags=/\[(post|get|((ipv4|ipv6|name)=([^\]]+)))\]/ig,updFlags=/\[(((pk|name)=([^\]]+)))\]/ig;function parseEndpoint(et){const o=baseParts.exec(et),tt=o[2]||"https:",rt=o[3],nt=o[5],ot=o[6],it=o[7];if(tt==="https:"||tt==="http:"){const st=parseFlags(it,httpFlags);return{name:st.name,protocol:tt,ipv4:st.ipv4,ipv6:st.ipv6,host:rt,port:nt,path:ot,method:st.post?"POST":"GET"}}if(tt==="udp:"||tt==="udp4:"||tt==="udp6:"){const st=parseFlags(it,updFlags),at=/^\[(.*)\]$/.exec(rt);if(at&&tt==="udp4:")throw new Error(`Endpoint parsing error: Cannot use ipv6 host with udp4: (endpoint=${et})`);if(!at&&tt==="udp6:")throw new Error(`Endpoint parsing error: Incorrectly formatted host for udp6: (endpoint=${et})`);return at?new UDP6Endpoint({protocol:"udp6:",ipv6:at[1],port:nt,pk:st.pk,name:st.name}):new UDP4Endpoint({protocol:"udp4:",ipv4:rt,port:nt,pk:st.pk,name:st.name})}throw new InvalidProtocolError(tt,et)}function parseFlags(et,o){o.lastIndex=0;const tt={};for(;;){const rt=o.exec(et);if(!rt)break;rt[2]?tt[rt[3].toLowerCase()]=rt[4]:tt[rt[1].toLowerCase()]=!0}return tt}class InvalidProtocolError extends Error{constructor(o,tt){super(`Invalid Endpoint: unsupported protocol "${o}" for endpoint: ${tt}, supported protocols: ${supportedProtocols.join(", ")}`),this.protocol=o,this.endpoint=tt}toJSON(){return{code:this.code,endpoint:this.endpoint,timeout:this.timeout}}}InvalidProtocolError.prototype.name="InvalidProtocolError";InvalidProtocolError.prototype.code="EPROTOCOL";const supportedProtocols=["http:","https:","udp4:","udp6:"];class BaseEndpoint{constructor(o,tt){this.name=o.name||null,this.protocol=o.protocol;const rt=typeof o.port=="string"?o.port=parseInt(o.port,10):o.port;if(rt==null)this.port=tt?this.protocol==="https:"?443:80:o.pk?443:53;else{if(typeof rt!="number"&&!isNaN(rt))throw new Error(`Invalid Endpoint: port "${o.port}" needs to be a number: ${JSON.stringify(o)}`);this.port=rt}}toJSON(){return this.toString()}}class UDPEndpoint extends BaseEndpoint{constructor(o){super(o,!1),this.pk=o.pk||null}toString(){const o=this.port!==(this.pk?443:53)?`:${this.port}`:"",tt=this.pk?` [pk=${this.pk}]`:"",rt=this.name?` [name=${this.name}]`:"";return`udp://${this.ipv4||`[${this.ipv6}]`}${o}${tt}${rt}`}}class UDP4Endpoint extends UDPEndpoint{constructor(o){if(super(Object.assign({protocol:"udp4:"},o)),!o.ipv4||typeof o.ipv4!="string")throw new Error(`Invalid Endpoint: .ipv4 "${o.ipv4}" needs to be set: ${JSON.stringify(o)}`);this.ipv4=o.ipv4}}class UDP6Endpoint extends UDPEndpoint{constructor(o){if(super(Object.assign({protocol:"udp6:"},o)),!o.ipv6||typeof o.ipv6!="string")throw new Error(`Invalid Endpoint: .ipv6 "${o.ipv6}" needs to be set: ${JSON.stringify(o)}`);this.ipv6=o.ipv6}}function safeHost(et){return v6Regex.test(et)&&!v4Regex.test(et)?`[${et}]`:et}class HTTPEndpoint extends BaseEndpoint{constructor(o){if(super(Object.assign({protocol:"https:"},o),!0),o.host||(o.ipv4&&(o.host=o.ipv4),o.ipv6&&(o.host=`[${o.ipv6}]`)),!o.host||typeof o.host!="string")throw new Error(`Invalid Endpoint: host "${o.path}" needs to be set: ${JSON.stringify(o)}`);if(this.host=o.host,this.path=o.path||"/dns-query",this.method=/^post$/i.test(o.method)?"POST":"GET",this.ipv4=o.ipv4,this.ipv6=o.ipv6,!this.ipv6){const rt=v6Regex.exec(this.host);rt&&(this.ipv6=rt[1])}this.ipv4||v4Regex.test(this.host)&&(this.ipv4=this.host);const tt=`${this.protocol}//${safeHost(this.host)}:${this.port}${this.path}`;try{this.url=new URL$1(tt)}catch(rt){throw new Error(rt.message+` [${tt}]`)}}toString(){const o=this.protocol==="https:"?"":"http://",tt=this.port!==(this.protocol==="https:"?443:80)?`:${this.port}`:"",rt=this.method!=="GET"?" [post]":"",nt=this.path==="/dns-query"?"":this.path,ot=this.name?` [name=${this.name}]`:"",it=this.ipv4&&this.ipv4!==this.host?` [ipv4=${this.ipv4}]`:"",st=this.ipv6&&this.ipv6!==this.host?` [ipv6=${this.ipv6}]`:"";return`${o}${safeHost(this.host)}${tt}${nt}${rt}${it}${st}${ot}`}}function toEndpoint(et){let o;if(typeof et=="string")o=parseEndpoint(et);else{if(typeof et!="object"||et===null||Array.isArray(et))throw new Error(`Can not convert ${et} to an endpoint`);if(et instanceof BaseEndpoint)return et;o=et}(o.protocol===null||o.protocol===void 0)&&(o.protocol="https:");const tt=o.protocol;if(tt==="udp4:")return new UDP4Endpoint(o);if(tt==="udp6:")return new UDP6Endpoint(o);if(tt==="https:"||tt==="http:")return new HTTPEndpoint(o);throw new InvalidProtocolError(tt,JSON.stringify(o))}const contentType="application/dns-message";function noop$1(){}function queryDns(){throw new Error('Only "doh" endpoints are supported in the browser')}async function loadJSON(et,o,tt,rt){const nt=o?o.localStoragePrefix+o.name:null;if(nt)try{const st=JSON.parse(localStorage.getItem(nt));if(st&&st.time>o.maxTime)return st}catch{}const{data:ot}=await requestRaw(et,"GET",null,tt,rt),it={time:Date.now(),data:JSON.parse(decode$4(ot))};if(nt)try{localStorage.setItem(nt,JSON.stringify(it))}catch{it.time=null}return it}function requestRaw(et,o,tt,rt,nt){return new Promise((ot,it)=>{const st=new URL$1(et);o==="GET"&&tt&&(st.search="?dns="+base64URL.decode(tt));const at=st.toString(),ct=new XMLHttpRequest;ct.open(o,at,!0),ct.setRequestHeader("Accept",contentType),o==="POST"&&ct.setRequestHeader("Content-Type",contentType),ct.responseType="arraybuffer",ct.timeout=rt,ct.ontimeout=lt,ct.onreadystatechange=ht,ct.onerror=ft,ct.onload=dt,o==="POST"?ct.send(tt):ct.send(),nt&&nt.addEventListener("abort",pt);function lt(){mt(new TimeoutError(rt));try{ct.abort()}catch{}}function dt(){if(ct.status!==200)mt(new HTTPStatusError(at,ct.status,o));else{let yt;if(typeof ct.response=="string")yt=encode$3(ct.response);else if(ct.response instanceof Uint8Array)yt=ct.response;else if(Array.isArray(ct.response)||ct.response instanceof ArrayBuffer)yt=new Uint8Array(ct.response);else throw new Error("Unprocessable response "+ct.response);mt(null,yt)}}function ht(){if(ct.readyState>1&&ct.status!==200&&ct.status!==0){mt(new HTTPStatusError(at,ct.status,o));try{ct.abort()}catch{}}}let mt=function(yt,gt){mt=noop$1,nt&&nt.removeEventListener("abort",pt),ot(yt?{error:yt,response:ct}:{data:gt,response:ct})};function ft(){mt(ct.status===200?new Error("Inexplicable XHR Error"):new HTTPStatusError(at,ct.status,o))}function pt(){mt(new AbortError);try{ct.abort()}catch{}}})}function request(et,o,tt,rt,nt){return requestRaw(et,o,tt,rt,nt)}function processResolvers$1(et){return et.filter(o=>o.cors||o.endpoint.cors)}const resolvers={data:[{name:"adfree.usableprivacy.net",endpoint:{protocol:"https:",host:"adfree.usableprivacy.net"},description:`Public updns DoH service with advertising, tracker and malware filters.
Hosted in Europe by @usableprivacy, details see: https://docs.usableprivacy.com`,country:"Germany",location:{lat:51.2993,long:9.491},filter:!0},{name:"adguard-dns-doh",endpoint:{protocol:"https:",host:"dns.adguard.com",ipv4:"94.140.15.15"},description:"Remove ads and protect your computer from malware (over DoH)",country:"France",location:{lat:48.8582,long:2.3387},filter:!0},{name:"adguard-dns-family-doh",endpoint:{protocol:"https:",host:"dns-family.adguard.com",ipv4:"94.140.15.16"},description:"Adguard DNS with safesearch and adult content blocking (over DoH)",country:"France",location:{lat:48.8582,long:2.3387},filter:!0},{name:"adguard-dns-unfiltered-doh",endpoint:{protocol:"https:",host:"dns-unfiltered.adguard.com",ipv4:"94.140.14.140"},description:"AdGuard public DNS servers without filters (over DoH)",country:"France",location:{lat:48.8582,long:2.3387}},{name:"ahadns-doh-chi",endpoint:{protocol:"https:",host:"doh.chi.ahadns.net",cors:!0},description:`A zero logging DNS with support for DNS-over-HTTPS (DoH) & DNS-over-TLS (DoT). Blocks ads, malware, trackers, viruses, ransomware, telemetry and more. No persistent logs. DNSSEC. Hosted in Chicago, USA. By https://ahadns.com/
Server statistics can be seen at: https://statistics.ahadns.com/?server=chi`,country:"United States",location:{lat:41.8483,long:-87.6517},filter:!0,cors:!0},{name:"ahadns-doh-in",endpoint:{protocol:"https:",host:"doh.in.ahadns.net",cors:!0},description:`A zero logging DNS with support for DNS-over-HTTPS (DoH) & DNS-over-TLS (DoT). Blocks ads, malware, trackers, viruses, ransomware, telemetry and more. No persistent logs. DNSSEC. Hosted in Mumbai, India. By https://ahadns.com/
Server statistics can be seen at: https://statistics.ahadns.com/?server=in`,country:"India",location:{lat:19.0748,long:72.8856},filter:!0,cors:!0},{name:"ahadns-doh-la",endpoint:{protocol:"https:",host:"doh.la.ahadns.net",cors:!0},description:`A zero logging DNS with support for DNS-over-HTTPS (DoH) & DNS-over-TLS (DoT). Blocks ads, malware, trackers, viruses, ransomware, telemetry and more. No persistent logs. DNSSEC. Hosted in Los Angeles, USA. By https://ahadns.com/
Server statistics can be seen at: https://statistics.ahadns.com/?server=la`,country:"United States",location:{lat:34.0549,long:-118.2578},filter:!0,cors:!0},{name:"ahadns-doh-nl",endpoint:{protocol:"https:",host:"doh.nl.ahadns.net",cors:!0},description:`A zero logging DNS with support for DNS-over-HTTPS (DoH) & DNS-over-TLS (DoT). Blocks ads, malware, trackers, viruses, ransomware, telemetry and more. No persistent logs. DNSSEC. Hosted in Amsterdam, Netherlands. By https://ahadns.com/
Server statistics can be seen at: https://statistics.ahadns.com/?server=nl`,country:"Netherlands",location:{lat:52.3824,long:4.8995},filter:!0,cors:!0},{name:"ahadns-doh-ny",endpoint:{protocol:"https:",host:"doh.ny.ahadns.net",cors:!0},description:`A zero logging DNS with support for DNS-over-HTTPS (DoH) & DNS-over-TLS (DoT). Blocks ads, malware, trackers, viruses, ransomware, telemetry and more. No persistent logs. DNSSEC. Hosted in New York. By https://ahadns.com/
Server statistics can be seen at: https://statistics.ahadns.com/?server=ny`,country:"United States",location:{lat:40.7308,long:-73.9975},filter:!0,cors:!0},{name:"ahadns-doh-pl",endpoint:{protocol:"https:",host:"doh.pl.ahadns.net",cors:!0},description:`A zero logging DNS with support for DNS-over-HTTPS (DoH) & DNS-over-TLS (DoT). Blocks ads, malware, trackers, viruses, ransomware, telemetry and more. No persistent logs. DNSSEC. Hosted in Poland. By https://ahadns.com/
Server statistics can be seen at: https://statistics.ahadns.com/?server=pl`,country:"Netherlands",location:{lat:52.3824,long:4.8995},filter:!0,cors:!0},{name:"alidns-doh",endpoint:{protocol:"https:",host:"dns.alidns.com",ipv4:"223.5.5.5",cors:!0},description:`A public DNS resolver that supports DoH/DoT in mainland China, provided by Alibaba-Cloud.
Warning: GFW filtering rules are applied by that resolver.
Homepage: https://alidns.com/`,country:"China",location:{lat:34.7725,long:113.7266},filter:!0,log:!0,cors:!0},{name:"ams-ads-doh-nl",endpoint:{protocol:"https:",host:"dnsnl-noads.alekberg.net"},description:"Resolver in Amsterdam. DoH protocol. Non-logging. Blocks ads, malware and trackers. DNSSEC enabled.",country:"Romania",location:{lat:45.9968,long:24.997},filter:!0},{name:"ams-doh-nl",endpoint:{protocol:"https:",host:"dnsnl.alekberg.net"},description:"Resolver in Amsterdam. DoH protocol. Non-logging, non-filtering, DNSSEC.",country:"Romania",location:{lat:45.9968,long:24.997}},{name:"att",endpoint:{protocol:"https:",host:"dohtrial.att.net"},description:"AT&T test DoH server.",log:!0},{name:"bcn-ads-doh",endpoint:{protocol:"https:",host:"dnses-noads.alekberg.net"},description:"Resolver in Spain. DoH protocol. Non-logging, remove ads and malware, DNSSEC.",country:"Spain",location:{lat:41.3891,long:2.1611},filter:!0},{name:"bcn-doh",endpoint:{protocol:"https:",host:"dnses.alekberg.net"},description:"Resolver in Spain. DoH protocol. Non-logging, non-filtering, DNSSEC.",country:"Spain",location:{lat:41.3891,long:2.1611}},{name:"brahma-world",endpoint:{protocol:"https:",host:"dns.brahma.world"},description:`DNS-over-HTTPS server. Non Logging, filters ads, trackers and malware. DNSSEC ready, QNAME Minimization, No EDNS Client-Subnet.
Hosted in Stockholm, Sweden. (https://dns.brahma.world)`,country:"United States",location:{lat:37.751,long:-97.822},filter:!0},{name:"cisco-doh",endpoint:{protocol:"https:",host:"doh.opendns.com",ipv4:"146.112.41.2"},description:`Remove your DNS blind spot (DoH protocol)
Warning: modifies your queries to include a copy of your network
address when forwarding them to a selection of companies and organizations.`,country:"United States",location:{lat:37.751,long:-97.822},filter:!0,log:!0},{name:"cloudflare",endpoint:{protocol:"https:",host:"dns.cloudflare.com",ipv4:"1.0.0.1",cors:!0},description:"Cloudflare DNS (anycast) - aka 1.1.1.1 / 1.0.0.1",country:"Australia",location:{lat:-33.494,long:143.2104},cors:!0},{name:"cloudflare-family",endpoint:{protocol:"https:",host:"family.cloudflare-dns.com",ipv4:"1.0.0.3",cors:!0},description:"Cloudflare DNS (anycast) with malware protection and parental control - aka 1.1.1.3 / 1.0.0.3",country:"Australia",location:{lat:-33.494,long:143.2104},filter:!0,cors:!0},{name:"cloudflare-ipv6",endpoint:{protocol:"https:",host:"1dot1dot1dot1.cloudflare-dns.com",cors:!0},description:"Cloudflare DNS over IPv6 (anycast)",country:"United States",location:{lat:37.751,long:-97.822},cors:!0},{name:"cloudflare-security",endpoint:{protocol:"https:",host:"security.cloudflare-dns.com",ipv4:"1.0.0.2",cors:!0},description:"Cloudflare DNS (anycast) with malware blocking - aka 1.1.1.2 / 1.0.0.2",country:"Australia",location:{lat:-33.494,long:143.2104},filter:!0,cors:!0},{name:"controld-block-malware",endpoint:{protocol:"https:",host:"freedns.controld.com",path:"/p1"},description:`ControlD Free DNS. Take CONTROL of your Internet. Block unwanted content, bypass geo-restrictions and be more productive. DoH protocol and No logging. - https://controld.com/free-dns
This DNS blocks Malware domains.`,country:"Canada",location:{lat:43.6319,long:-79.3716},filter:!0},{name:"controld-block-malware-ad",endpoint:{protocol:"https:",host:"freedns.controld.com",path:"/p2"},description:`ControlD Free DNS. Take CONTROL of your Internet. Block unwanted content, bypass geo-restrictions and be more productive. DoH protocol and No logging. - https://controld.com/free-dns
This DNS blocks Malware, Ads & Tracking domains.`,country:"Canada",location:{lat:43.6319,long:-79.3716},filter:!0},{name:"controld-block-malware-ad-social",endpoint:{protocol:"https:",host:"freedns.controld.com",path:"/p3"},description:`ControlD Free DNS. Take CONTROL of your Internet. Block unwanted content, bypass geo-restrictions and be more productive. DoH protocol and No logging. - https://controld.com/free-dns
This DNS blocks Malware, Ads & Tracking and Social Networks domains.`,country:"Canada",location:{lat:43.6319,long:-79.3716},filter:!0},{name:"controld-family-friendly",endpoint:{protocol:"https:",host:"freedns.controld.com",path:"/family"},description:`ControlD Free DNS. Take CONTROL of your Internet. Block unwanted content, bypass geo-restrictions and be more productive. DoH protocol and No logging. - https://controld.com/free-dns
This DNS blocks Malware, Ads & Tracking, Adult Content and Drugs domains.`,country:"Canada",location:{lat:43.6319,long:-79.3716},filter:!0},{name:"controld-uncensored",endpoint:{protocol:"https:",host:"freedns.controld.com",path:"/uncensored"},description:`ControlD Free DNS. Take CONTROL of your Internet. Block unwanted content, bypass geo-restrictions and be more productive. DoH protocol and No logging. - https://controld.com/free-dns
This DNS unblocks censored domains from various countries.`,country:"Canada",location:{lat:43.6319,long:-79.3716}},{name:"controld-unfiltered",endpoint:{protocol:"https:",host:"freedns.controld.com",path:"/p0"},description:`ControlD Free DNS. Take CONTROL of your Internet. Block unwanted content, bypass geo-restrictions and be more productive. DoH protocol and No logging. - https://controld.com/free-dns
This is a Unfiltered DNS, no DNS record blocking or manipulation here, if you want to block Malware, Ads & Tracking or Social Network domains, use the other ControlD DNS configs.`,country:"Canada",location:{lat:43.6319,long:-79.3716}},{name:"dns.digitale-gesellschaft.ch",endpoint:{protocol:"https:",host:"dns.digitale-gesellschaft.ch"},description:`Public DoH resolver operated by the Digital Society (https://www.digitale-gesellschaft.ch).
Hosted in Zurich, Switzerland.
Non-logging, non-filtering, supports DNSSEC.`,country:"Switzerland",location:{lat:47.1449,long:8.1551}},{name:"dns.ryan-palmer",endpoint:{protocol:"https:",host:"dns1.ryan-palmer.com"},description:"Non-logging, non-filtering, DNSSEC DoH Server. Hosted in the UK.",country:"United Kingdom",location:{lat:51.5164,long:-.093}},{name:"dns.sb",endpoint:{protocol:"https:",host:"doh.sb",ipv4:"185.222.222.222",cors:!0},description:`DNSSEC-enabled DoH server by https://xtom.com/
https://dns.sb/doh/`,country:"Unknown",location:{lat:47,long:8},cors:!0},{name:"dns.therifleman.name",endpoint:{protocol:"https:",host:"dns.therifleman.name"},description:`DNS-over-HTTPS DNS forwarder from Mumbai, India. Blocks web and Android trackers and ads.
IP addresses are not logged, but queries are logged for 24 hours for debugging.
Report issues, send suggestions @ joker349 at protonmail.com.
Also supports DoT (for android) @ dns.therifleman.name and plain DNS @ 172.104.206.174`,country:"United States",location:{lat:37.751,long:-97.822},filter:!0},{name:"dnsforfamily-doh",endpoint:{protocol:"https:",host:"dns-doh.dnsforfamily.com"},description:`(DoH Protocol) (Now supports DNSSEC). Block adult websites, gambling websites, malwares and advertisements.
It also enforces safe search in: Google, YouTube, Bing, DuckDuckGo and Yandex.
Social websites like Facebook and Instagram are not blocked. No DNS queries are logged.
As of 26-May-2022 5.9 million websites are blocked and new websites are added to blacklist daily.
Completely free, no ads or any commercial motive. Operating for 4 years now.
Provided by: https://dnsforfamily.com`,country:"Finland",location:{lat:60.1758,long:24.9349},filter:!0},{name:"dnsforfamily-doh-no-safe-search",endpoint:{protocol:"https:",host:"dns-doh-no-safe-search.dnsforfamily.com"},description:`(DoH Protocol) (Now supports DNSSEC) Block adult websites, gambling websites, malwares and advertisements.
Unlike other dnsforfamily servers, this one does not enforces safe search. So Google, YouTube, Bing, DuckDuckGo and Yandex are completely accessible without any restriction.
Social websites like Facebook and Instagram are not blocked. No DNS queries are logged.
As of 26-May-2022 5.9 million websites are blocked and new websites are added to blacklist daily.
Completely free, no ads or any commercial motive. Operating for 4 years now.
Warning: This server is incompatible with anonymization.
Provided by: https://dnsforfamily.com`,country:"Finland",location:{lat:60.1758,long:24.9349},filter:!0},{name:"dnsforge.de",endpoint:{protocol:"https:",host:"dnsforge.de",cors:!0},description:`Public DoH resolver running with Pihole for Adblocking (https://dnsforge.de).
Non-logging, AD-filtering, supports DNSSEC. Hosted in Germany.`,country:"Germany",location:{lat:52.2998,long:9.447},filter:!0,cors:!0},{name:"dnshome-doh",endpoint:{protocol:"https:",host:"dns.dnshome.de"},description:"https://www.dnshome.de/ public resolver in Germany"},{name:"dnspod-doh",endpoint:{protocol:"https:",host:"doh.pub",cors:!0},description:`A public DNS resolver in mainland China provided by DNSPod (Tencent Cloud).
https://www.dnspod.cn/Products/Public.DNS?lang=en`,filter:!0,log:!0,cors:!0},{name:"dnswarden-asia-adblock-dohv4",endpoint:{protocol:"https:",host:"doh.asia.dnswarden.com",path:"/adblock"},description:"Hosted in Singapore. For more information look [here](https://github.com/bhanupratapys/dnswarden) or [here](https://dnswarden.com).",country:"Singapore",location:{lat:1.2929,long:103.8547},filter:!0},{name:"dnswarden-asia-adultfilter-dohv4",endpoint:{protocol:"https:",host:"doh.asia.dnswarden.com",path:"/adultfilter"},description:"Hosted in Singapore. For more information look [here](https://github.com/bhanupratapys/dnswarden) or [here](https://dnswarden.com).",country:"Singapore",location:{lat:1.2929,long:103.8547},filter:!0},{name:"dnswarden-asia-uncensor-dohv4",endpoint:{protocol:"https:",host:"doh.asia.dnswarden.com",path:"/uncensored"},description:"Hosted in Singapore. For more information look [here](https://github.com/bhanupratapys/dnswarden) or [here](https://dnswarden.com).",country:"Singapore",location:{lat:1.2929,long:103.8547}},{name:"dnswarden-eu-adblock-dohv4",endpoint:{protocol:"https:",host:"doh.eu.dnswarden.com"},description:"Hosted in Germany. For more information look [here](https://github.com/bhanupratapys/dnswarden) or [here](https://dnswarden.com).",country:"Germany",location:{lat:50.1103,long:8.7147},filter:!0},{name:"dnswarden-us-adblock-dohv4",endpoint:{protocol:"https:",host:"doh.us.dnswarden.com"},description:"Hosted in USA (Dallas) . For more information look [here](https://github.com/bhanupratapys/dnswarden) or [here](https://dnswarden.com).",country:"United States",location:{lat:32.7889,long:-96.8021},filter:!0},{name:"doh-ch-blahdns",endpoint:{protocol:"https:",host:"doh-ch.blahdns.com",cors:!0},description:"Blocks ad and Tracking, no Logging, DNSSEC, Hosted in Switzerland. By https://blahdns.com/",country:"Netherlands",location:{lat:52.3824,long:4.8995},filter:!0,cors:!0},{name:"doh-cleanbrowsing-adult",endpoint:{protocol:"https:",host:"doh.cleanbrowsing.org",path:"/doh/adult-filter/",cors:!0},description:`Blocks access to all adult, pornographic and explicit sites. It does
not block proxy or VPNs, nor mixed-content sites. Sites like Reddit
are allowed. Google and Bing are set to the Safe Mode.
By https://cleanbrowsing.org/`,filter:!0,cors:!0},{name:"doh-cleanbrowsing-family",endpoint:{protocol:"https:",host:"doh.cleanbrowsing.org",path:"/doh/family-filter/",cors:!0},description:`Blocks access to all adult, pornographic and explicit sites. It also
blocks proxy and VPN domains that are used to bypass the filters.
Mixed content sites (like Reddit) are also blocked. Google, Bing and
Youtube are set to the Safe Mode.
By https://cleanbrowsing.org/`,filter:!0,cors:!0},{name:"doh-cleanbrowsing-security",endpoint:{protocol:"https:",host:"doh.cleanbrowsing.org",path:"/doh/security-filter/",cors:!0},description:`Block access to phishing, malware and malicious domains. It does not block adult content.
By https://cleanbrowsing.org/`,filter:!0,cors:!0},{name:"doh-crypto-sx",endpoint:{protocol:"https:",host:"doh.crypto.sx",cors:!0},description:`DNS-over-HTTPS server. Anycast, no logs, no censorship, DNSSEC.
Backend hosted by Scaleway, globally cached via Cloudflare.
Maintained by Frank Denis.`,country:"United States",location:{lat:37.751,long:-97.822},cors:!0},{name:"doh-crypto-sx-ipv6",endpoint:{protocol:"https:",host:"doh-ipv6.crypto.sx",cors:!0},description:`DNS-over-HTTPS server accessible over IPv6. Anycast, no logs, no censorship, DNSSEC.
Backend hosted by Scaleway, globally cached via Cloudflare.
Maintained by Frank Denis.`,country:"United States",location:{lat:37.751,long:-97.822},cors:!0},{name:"doh-de-blahdns",endpoint:{protocol:"https:",host:"doh-de.blahdns.com",cors:!0},description:"Blocks ad and Tracking, no Logging, DNSSEC, Hosted in Germany. By https://blahdns.com/",country:"Germany",location:{lat:51.2993,long:9.491},filter:!0,cors:!0},{name:"doh-fi-blahdns",endpoint:{protocol:"https:",host:"doh-fi.blahdns.com",cors:!0},description:"Blocks ad and Tracking, no Logging, DNSSEC, Hosted in Finland. By https://blahdns.com/",country:"Finland",location:{lat:60.1758,long:24.9349},filter:!0,cors:!0},{name:"doh-ibksturm",endpoint:{protocol:"https:",host:"ibksturm.synology.me"},description:`DoH & DoT Server, No Logging, No Filters, DNSSEC
Running privately by ibksturm in Thurgau, Switzerland`},{name:"doh-jp-blahdns",endpoint:{protocol:"https:",host:"doh-jp.blahdns.com",cors:!0},description:"Blocks ad and Tracking, no Logging, DNSSEC, Hosted in Japan. By https://blahdns.com/",country:"Japan",location:{lat:35.6882,long:139.7532},filter:!0,cors:!0},{name:"doh.ffmuc.net",endpoint:{protocol:"https:",host:"doh.ffmuc.net"},description:`An open (non-logging, non-filtering, non-censoring) DoH resolver operated by Freifunk Munich with nodes in DE.
https://ffmuc.net/`,country:"Germany",location:{lat:51.2993,long:9.491}},{name:"doh.tiarap.org",endpoint:{protocol:"https:",host:"doh.tiarap.org"},description:`Non-Logging DNS-over-HTTPS server, cached via Cloudflare.
Filters out ads, trackers and malware, NO ECS, supports DNSSEC.`,country:"United States",location:{lat:37.751,long:-97.822},filter:!0},{name:"google",endpoint:{protocol:"https:",host:"dns.google",ipv4:"8.8.8.8",cors:!0},description:"Google DNS (anycast)",country:"United States",location:{lat:37.751,long:-97.822},log:!0,cors:!0},{name:"hdns",endpoint:{protocol:"https:",host:"query.hdns.io",cors:!0},description:`HDNS is a public DNS resolver that supports Handshake domains.
https://www.hdns.io`,country:"United States",location:{lat:37.7771,long:-122.406},cors:!0},{name:"he",endpoint:{protocol:"https:",host:"ordns.he.net"},description:`Hurricane Electric DoH server (anycast)
Unknown logging policy.`,country:"United States",location:{lat:37.751,long:-97.822},log:!0},{name:"id-gmail-doh",endpoint:{protocol:"https:",host:"doh.tiar.app"},description:`Non-Logging DNS-over-HTTPS server located in Singapore.
Filters out ads, trackers and malware, supports DNSSEC, provided by id-gmail.`,country:"Singapore",location:{lat:1.2929,long:103.8547},filter:!0},{name:"iij",endpoint:{protocol:"https:",host:"public.dns.iij.jp"},description:`DoH server operated by Internet Initiative Japan in Tokyo.
https://www.iij.ad.jp/`,country:"Japan",location:{lat:35.69,long:139.69},log:!0},{name:"iqdns-doh",endpoint:{protocol:"https:",host:"a.passcloud.xyz"},description:`Non-logging DoH service runned by V2EX.com user johnsonwil.
Returns "no such domain" for anti-Chinese government websites. Supports DNSSEC.
For more information: https://www.v2ex.com/t/785666`,filter:!0},{name:"jp.tiar.app-doh",endpoint:{protocol:"https:",host:"jp.tiar.app"},description:`Non-Logging, Non-Filtering DNS-over-HTTPS server in Japan.
No ECS, Support DNSSEC`,country:"Japan",location:{lat:35.6882,long:139.7532}},{name:"jp.tiarap.org",endpoint:{protocol:"https:",host:"jp.tiarap.org"},description:`DNS-over-HTTPS Server. Non-Logging, Non-Filtering, No ECS, Support DNSSEC.
Cached via Cloudflare.`},{name:"libredns",endpoint:{protocol:"https:",host:"doh.libredns.gr"},description:`DoH server in Germany. No logging, but no DNS padding and no DNSSEC support.
https://libredns.gr/`,country:"Germany",location:{lat:51.2993,long:9.491}},{name:"nextdns",endpoint:{protocol:"https:",host:"anycsast.dns.nextdns.io"},description:`NextDNS is a cloud-based private DNS service that gives you full control
over what is allowed and what is blocked on the Internet.
DNSSEC, Anycast, Non-logging, NoFilters
https://www.nextdns.io/`,country:"Netherlands",location:{lat:52.3891,long:4.6563}},{name:"nextdns-ultralow",endpoint:{protocol:"https:",host:"dns.nextdns.io",path:"/dnscrypt-proxy"},description:`NextDNS is a cloud-based private DNS service that gives you full control
over what is allowed and what is blocked on the Internet.
https://www.nextdns.io/
To select the server location, the "-ultralow" variant relies on bootstrap servers
instead of anycast.`},{name:"njalla-doh",endpoint:{protocol:"https:",host:"dns.njal.la",cors:!0},description:`Non-logging DoH server in Sweden operated by Njalla.
https://dns.njal.la/`,country:"Sweden",location:{lat:59.3247,long:18.056},cors:!0},{name:"odoh-cloudflare",endpoint:{protocol:"https:",host:"odoh.cloudflare-dns.com",cors:!0},description:`Cloudflare ODoH server.
https://cloudflare.com`,cors:!0},{name:"odoh-crypto-sx",endpoint:{protocol:"https:",host:"odoh.crypto.sx",cors:!0},description:`ODoH target server. Anycast, no logs.
Backend hosted by Scaleway. Maintained by Frank Denis.`,cors:!0},{name:"odoh-id-gmail",endpoint:{protocol:"https:",host:"doh.tiar.app",path:"/odoh"},description:`ODoH target server. Based in Singapore, no logs.
Filter ads, trackers and malware.`,filter:!0},{name:"odoh-jp.tiar.app",endpoint:{protocol:"https:",host:"jp.tiar.app",path:"/odoh"},description:"ODoH target server. no logs."},{name:"odoh-jp.tiarap.org",endpoint:{protocol:"https:",host:"jp.tiarap.org",path:"/odoh"},description:"ODoH target server via Cloudflare, no logs."},{name:"odoh-resolver4.dns.openinternet.io",endpoint:{protocol:"https:",host:"resolver4.dns.openinternet.io"},description:`ODoH target server. no logs, no filter, DNSSEC.
Running on dedicated hardware colocated at Sonic.net in Santa Rosa, CA in the United States.
Uses Sonic's recusrive DNS servers as upstream resolvers (but is not affiliated with Sonic
in any way). Provided by https://openinternet.io`},{name:"odoh-tiarap.org",endpoint:{protocol:"https:",host:"doh.tiarap.org",path:"/odoh"},description:`ODoH target server via Cloudflare, no logs.
Filter ads, trackers and malware.`,filter:!0},{name:"publicarray-au2-doh",endpoint:{protocol:"https:",host:"doh-2.seby.io",cors:!0},description:`DNSSEC • OpenNIC • Non-logging • Uncensored - hosted on ovh.com.au
Maintained by publicarray - https://dns.seby.io`,country:"Australia",location:{lat:-33.8591,long:151.2002},cors:!0},{name:"puredns-doh",endpoint:{protocol:"https:",host:"puredns.org",ipv4:"146.190.6.13",cors:!0},description:`Public uncensored DNS resolver in Singapore - https://puredns.org
** Only available in Indonesia and Singapore **`,country:"United States",location:{lat:37.751,long:-97.822},cors:!0},{name:"quad101",endpoint:{protocol:"https:",host:"dns.twnic.tw",cors:!0},description:`DNSSEC-aware public resolver by the Taiwan Network Information Center (TWNIC)
https://101.101.101.101/index_en.html`,cors:!0},{name:"quad9-doh-ip4-port443-filter-ecs-pri",endpoint:{protocol:"https:",host:"dns11.quad9.net",ipv4:"149.112.112.11"},description:"Quad9 (anycast) dnssec/no-log/filter/ecs 9.9.9.11 - 149.112.112.11",country:"United States",location:{lat:37.751,long:-97.822},filter:!0},{name:"quad9-doh-ip4-port443-filter-pri",endpoint:{protocol:"https:",host:"dns.quad9.net",ipv4:"149.112.112.112"},description:"Quad9 (anycast) dnssec/no-log/filter 9.9.9.9 - 149.112.112.9 - 149.112.112.112",country:"United States",location:{lat:37.751,long:-97.822},filter:!0},{name:"quad9-doh-ip4-port443-nofilter-ecs-pri",endpoint:{protocol:"https:",host:"dns12.quad9.net",ipv4:"9.9.9.12"},description:"Quad9 (anycast) no-dnssec/no-log/no-filter/ecs 9.9.9.12 - 149.112.112.12",country:"United States",location:{lat:37.751,long:-97.822}},{name:"quad9-doh-ip4-port443-nofilter-pri",endpoint:{protocol:"https:",host:"dns10.quad9.net",ipv4:"149.112.112.10"},description:"Quad9 (anycast) no-dnssec/no-log/no-filter 9.9.9.10 - 149.112.112.10",country:"United States",location:{lat:37.751,long:-97.822}},{name:"quad9-doh-ip6-port5053-filter-pri",endpoint:{protocol:"https:",host:"dns9.quad9.net"},description:"Quad9 (anycast) dnssec/no-log/filter 2620:fe::fe - 2620:fe::9 - 2620:fe::fe:9",country:"United States",location:{lat:37.751,long:-97.822},filter:!0},{name:"safesurfer-doh",endpoint:{protocol:"https:",host:"doh.safesurfer.io"},description:`Family safety focused blocklist for over 2 million adult sites, as well as phishing and malware and more.
Free to use, paid for customizing blocking for more categories+sites and viewing usage at my.safesurfer.io. Logs taken for viewing
usage, data never sold - https://safesurfer.io`,filter:!0,log:!0},{name:"sth-ads-doh-se",endpoint:{protocol:"https:",host:"dnsse-noads.alekberg.net"},description:"Resolver in Stockholm, Sweden. DoH server. Non-logging, remove ads and malware, DNSSEC.",country:"Bulgaria",location:{lat:42.696,long:23.332},filter:!0},{name:"sth-doh-se",endpoint:{protocol:"https:",host:"dnsse.alekberg.net"},description:"Resolver in Stockholm, Sweden. DoH server. Non-logging, non-filtering, DNSSEC.",country:"Bulgaria",location:{lat:42.696,long:23.332}},{name:"switch",endpoint:{protocol:"https:",host:"dns.switch.ch"},description:`Public DoH service provided by SWITCH in Switzerland
https://www.switch.ch
Provides protection against malware, but does not block ads.`,filter:!0},{name:"uncensoreddns-dk-ipv4",endpoint:{protocol:"https:",host:"unicast.uncensoreddns.org"},description:`Also known as censurfridns.
DoH, no logs, no filter, DNSSEC, unicast hosted in Denmark - https://blog.uncensoreddns.org`,country:"Denmark",location:{lat:55.7123,long:12.0564}},{name:"uncensoreddns-ipv4",endpoint:{protocol:"https:",host:"anycast.uncensoreddns.org"},description:`Also known as censurfridns.
DoH, no logs, no filter, DNSSEC, anycast - https://blog.uncensoreddns.org`,country:"Denmark",location:{lat:55.7123,long:12.0564}},{name:"v.dnscrypt.uk-doh-ipv4",endpoint:{protocol:"https:",host:"v.dnscrypt.uk"},description:`DoH, no logs, uncensored, DNSSEC. Hosted in London UK on Digital Ocean
https://www.dnscrypt.uk`,country:"United Kingdom",location:{lat:51.4964,long:-.1224}}],time:1654187067783};function processResolvers(et){const o=et.time===null||et.time===void 0?Date.now():et.time,tt=processResolvers$1(et.data.map(nt=>(nt.endpoint=toEndpoint(Object.assign({name:nt.name},nt.endpoint)),nt))),rt=tt.map(nt=>nt.endpoint);return{data:{resolvers:tt,resolverByName:tt.reduce((nt,ot)=>(nt[ot.name]=ot,nt),{}),endpoints:rt,endpointByName:rt.reduce((nt,ot)=>(nt[ot.name]=ot,nt),{})},time:o}}const backup=processResolvers(resolvers);function toMultiQuery(et){const o=Object.assign({type:"query"},et);return delete o.question,o.questions=[],et.question&&o.questions.push(et.question),o}function queryOne(et,o,tt,rt){return rt&&rt.aborted?Promise.reject(new AbortError):et.protocol==="udp4:"||et.protocol==="udp6:"?queryDns():queryDoh(et,o,tt,rt)}function queryDoh(et,o,tt,rt){return request(et.url,et.method,encode$2(Object.assign({flags:RECURSION_DESIRED},o)),tt,rt).then(function(nt){const ot=nt.data,it=nt.response;let st=nt.error;if(st===void 0)if(ot.length===0)st=new ResponseError("Empty.");else try{const at=decode$3(ot);return at.response=it,at}catch(at){st=new ResponseError("Invalid packet (cause="+at.message+")",at)}throw Object.assign(st,{response:it})})}const UPDATE_URL=new URL$1("https://martinheidegger.github.io/dns-query/resolvers.json");function isNameString(et){return/^@/.test(et)}class Wellknown{constructor(o){this.opts=Object.assign({timeout:5e3,update:!0,updateURL:UPDATE_URL,persist:!1,localStoragePrefix:"dnsquery_",maxAge:3e5},o),this._dataP=null}_data(o,tt){return!o&&this._dataP!==null?this._dataP.then(rt=>rt.time<Date.now()-this.opts.maxAge?this._data(!0,rt):rt):(this._dataP=this.opts.update?loadJSON(this.opts.updateURL,this.opts.persist?{name:"resolvers.json",localStoragePrefix:this.opts.localStoragePrefix,maxTime:Date.now()-this.opts.maxAge}:null,this.opts.timeout).then(rt=>processResolvers({data:rt.data.resolvers,time:rt.time})).catch(()=>tt||backup):Promise.resolve(backup),this._dataP)}data(){return this._data(!1).then(o=>o.data)}endpoints(o){if(o==null)return this.data().then(tt=>tt.endpoints);if(o==="doh"&&(o=filterDoh),o==="dns"&&(o=filterDns),typeof o=="function")return this.data().then(tt=>tt.endpoints.filter(o));if(typeof o=="string"||typeof o[Symbol.iterator]!="function")return Promise.reject(new Error(`Endpoints (${o}) needs to be iterable (array).`));if(o=Array.from(o).filter(Boolean),o.findIndex(isNameString)===-1)try{return Promise.resolve(o.map(toEndpoint))}catch(tt){return Promise.reject(tt)}return this.data().then(tt=>o.map(rt=>{if(isNameString(rt)){const nt=tt.endpointByName[rt.substring(1)];if(!nt)throw new Error(`Endpoint ${rt} is not known.`);return nt}return toEndpoint(rt)}))}}const wellknown=new Wellknown;function isPromise(et){return et===null||typeof et!="object"?!1:typeof et.then=="function"}function toPromise(et){return isPromise(et)?et:Promise.resolve(et)}function query(et,o){return o=Object.assign({retries:5,timeout:3e4},o),et.question?toPromise(o.endpoints).then(tt=>{if(!Array.isArray(tt)||tt.length===0)throw new Error("No endpoints defined to lookup dns records.");return queryN(tt.map(toEndpoint),toMultiQuery(et),o)}).then(tt=>(tt.question=tt.questions[0],delete tt.questions,tt)):Promise.reject(new Error("To request data you need to specify a .question!"))}function queryN(et,o,tt){const rt=et.length===1?et[0]:et[Math.floor(Math.random()*et.length)%et.length];return queryOne(rt,o,tt.timeout,tt.signal).then(nt=>(nt.endpoint=rt.toString(),nt),nt=>{if(nt.name==="AbortError"||tt.retries===0)throw nt.endpoint=rt.toString(),nt;return tt.retries>0&&(tt.retries-=1),queryN(et,o,tt)})}function filterDoh(et){return et.protocol==="https:"||et.protocol==="http:"}function filterDns(et){return et.protocol==="udp4:"||et.protocol==="udp6:"}const log$7=new Logger$1("dns-over-https");class DnsOverHttps{constructor(o,tt=3){wt(this,"endpoints");wt(this,"retries");this.endpoints=o,this.retries=tt}static async create(o,tt){const rt=o??await wellknown.endpoints("doh");return new DnsOverHttps(rt,tt)}async resolveTXT(o){let tt;try{tt=(await query({question:{type:"TXT",name:o}},{endpoints:this.endpoints,retries:this.retries})).answers}catch(ot){throw log$7.error("query failed: ",ot),new Error("DNS query failed")}if(!tt)throw new Error(`Could not resolve ${o}`);const rt=tt.map(ot=>ot.data),nt=[];return rt.forEach(ot=>{typeof ot=="string"?nt.push(ot):Array.isArray(ot)?ot.forEach(it=>{typeof it=="string"?nt.push(it):nt.push(bytesToUtf8(it))}):nt.push(bytesToUtf8(ot))}),nt}}var base32$3={exports:{}};(function(et){var o={env:{NODE_ENV:'"production"',VITE_WALLETCONNECT_PROJECT_ID:'"1d93edc21291f98e3bed6ff7617ff539"'},nextTick:"setImmediate",platform:'"browser"',version:'"v16.0.0"',browser:!0};/*
* [hi-base32]{@link https://github.com/emn178/hi-base32}
*
* @version 0.5.0
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2015-2018
* @license MIT
*/(function(){var tt=typeof window=="object"?window:{},rt=!tt.HI_BASE32_NO_NODE_JS&&typeof o=="object"&&o.versions&&o.versions.node;rt&&(tt=globalThis);var nt=!tt.HI_BASE32_NO_COMMON_JS&&!0&&et.exports,ot="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".split(""),it={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,2:26,3:27,4:28,5:29,6:30,7:31},st=[0,0,0,0,0,0,0,0],at=function(gt,bt){bt.length>10&&(bt="..."+bt.substr(-10));var xt=new Error("Decoded data is not valid UTF-8. Maybe try base32.decode.asBytes()? Partial data after reading "+gt+" bytes: "+bt+" <-");throw xt.position=gt,xt},ct=function(gt){for(var bt="",xt=gt.length,vt=0,Et=0,Ct,St;vt<xt;){if(Ct=gt[vt++],Ct<=127){bt+=String.fromCharCode(Ct);continue}else Ct>191&&Ct<=223?(St=Ct&31,Et=1):Ct<=239?(St=Ct&15,Et=2):Ct<=247?(St=Ct&7,Et=3):at(vt,bt);for(var At=0;At<Et;++At)Ct=gt[vt++],(Ct<128||Ct>191)&&at(vt,bt),St<<=6,St+=Ct&63;St>=55296&&St<=57343&&at(vt,bt),St>1114111&&at(vt,bt),St<=65535?bt+=String.fromCharCode(St):(St-=65536,bt+=String.fromCharCode((St>>10)+55296),bt+=String.fromCharCode((St&1023)+56320))}return bt},lt=function(gt){if(gt==="")return[];if(!/^[A-Z2-7=]+$/.test(gt))throw new Error("Invalid base32 characters");gt=gt.replace(/=/g,"");for(var bt,xt,vt,Et,Ct,St,At,kt,It=[],Nt=0,Lt=gt.length,Mt=0,zt=Lt>>3<<3;Mt<zt;)bt=it[gt.charAt(Mt++)],xt=it[gt.charAt(Mt++)],vt=it[gt.charAt(Mt++)],Et=it[gt.charAt(Mt++)],Ct=it[gt.charAt(Mt++)],St=it[gt.charAt(Mt++)],At=it[gt.charAt(Mt++)],kt=it[gt.charAt(Mt++)],It[Nt++]=(bt<<3|xt>>>2)&255,It[Nt++]=(xt<<6|vt<<1|Et>>>4)&255,It[Nt++]=(Et<<4|Ct>>>1)&255,It[Nt++]=(Ct<<7|St<<2|At>>>3)&255,It[Nt++]=(At<<5|kt)&255;var Ut=Lt-zt;return Ut===2?(bt=it[gt.charAt(Mt++)],xt=it[gt.charAt(Mt++)],It[Nt++]=(bt<<3|xt>>>2)&255):Ut===4?(bt=it[gt.charAt(Mt++)],xt=it[gt.charAt(Mt++)],vt=it[gt.charAt(Mt++)],Et=it[gt.charAt(Mt++)],It[Nt++]=(bt<<3|xt>>>2)&255,It[Nt++]=(xt<<6|vt<<1|Et>>>4)&255):Ut===5?(bt=it[gt.charAt(Mt++)],xt=it[gt.charAt(Mt++)],vt=it[gt.charAt(Mt++)],Et=it[gt.charAt(Mt++)],Ct=it[gt.charAt(Mt++)],It[Nt++]=(bt<<3|xt>>>2)&255,It[Nt++]=(xt<<6|vt<<1|Et>>>4)&255,It[Nt++]=(Et<<4|Ct>>>1)&255):Ut===7&&(bt=it[gt.charAt(Mt++)],xt=it[gt.charAt(Mt++)],vt=it[gt.charAt(Mt++)],Et=it[gt.charAt(Mt++)],Ct=it[gt.charAt(Mt++)],St=it[gt.charAt(Mt++)],At=it[gt.charAt(Mt++)],It[Nt++]=(bt<<3|xt>>>2)&255,It[Nt++]=(xt<<6|vt<<1|Et>>>4)&255,It[Nt++]=(Et<<4|Ct>>>1)&255,It[Nt++]=(Ct<<7|St<<2|At>>>3)&255),It},dt=function(gt){for(var bt,xt,vt,Et,Ct,St="",At=gt.length,kt=0,It=parseInt(At/5)*5;kt<It;)bt=gt.charCodeAt(kt++),xt=gt.charCodeAt(kt++),vt=gt.charCodeAt(kt++),Et=gt.charCodeAt(kt++),Ct=gt.charCodeAt(kt++),St+=ot[bt>>>3]+ot[(bt<<2|xt>>>6)&31]+ot[xt>>>1&31]+ot[(xt<<4|vt>>>4)&31]+ot[(vt<<1|Et>>>7)&31]+ot[Et>>>2&31]+ot[(Et<<3|Ct>>>5)&31]+ot[Ct&31];var Nt=At-It;return Nt===1?(bt=gt.charCodeAt(kt),St+=ot[bt>>>3]+ot[bt<<2&31]+"======"):Nt===2?(bt=gt.charCodeAt(kt++),xt=gt.charCodeAt(kt),St+=ot[bt>>>3]+ot[(bt<<2|xt>>>6)&31]+ot[xt>>>1&31]+ot[xt<<4&31]+"===="):Nt===3?(bt=gt.charCodeAt(kt++),xt=gt.charCodeAt(kt++),vt=gt.charCodeAt(kt),St+=ot[bt>>>3]+ot[(bt<<2|xt>>>6)&31]+ot[xt>>>1&31]+ot[(xt<<4|vt>>>4)&31]+ot[vt<<1&31]+"==="):Nt===4&&(bt=gt.charCodeAt(kt++),xt=gt.charCodeAt(kt++),vt=gt.charCodeAt(kt++),Et=gt.charCodeAt(kt),St+=ot[bt>>>3]+ot[(bt<<2|xt>>>6)&31]+ot[xt>>>1&31]+ot[(xt<<4|vt>>>4)&31]+ot[(vt<<1|Et>>>7)&31]+ot[Et>>>2&31]+ot[Et<<3&31]+"="),St},ht=function(gt){var bt,xt,vt,Et,Ct,St,At=!1,kt="",It=0,Nt,Lt=0,Mt=gt.length;if(gt==="")return kt;do{for(st[0]=st[5],st[1]=st[6],st[2]=st[7],Nt=Lt;It<Mt&&Nt<5;++It)St=gt.charCodeAt(It),St<128?st[Nt++]=St:St<2048?(st[Nt++]=192|St>>6,st[Nt++]=128|St&63):St<55296||St>=57344?(st[Nt++]=224|St>>12,st[Nt++]=128|St>>6&63,st[Nt++]=128|St&63):(St=65536+((St&1023)<<10|gt.charCodeAt(++It)&1023),st[Nt++]=240|St>>18,st[Nt++]=128|St>>12&63,st[Nt++]=128|St>>6&63,st[Nt++]=128|St&63);Lt=Nt-5,It===Mt&&++It,It>Mt&&Nt<6&&(At=!0),bt=st[0],Nt>4?(xt=st[1],vt=st[2],Et=st[3],Ct=st[4],kt+=ot[bt>>>3]+ot[(bt<<2|xt>>>6)&31]+ot[xt>>>1&31]+ot[(xt<<4|vt>>>4)&31]+ot[(vt<<1|Et>>>7)&31]+ot[Et>>>2&31]+ot[(Et<<3|Ct>>>5)&31]+ot[Ct&31]):Nt===1?kt+=ot[bt>>>3]+ot[bt<<2&31]+"======":Nt===2?(xt=st[1],kt+=ot[bt>>>3]+ot[(bt<<2|xt>>>6)&31]+ot[xt>>>1&31]+ot[xt<<4&31]+"===="):Nt===3?(xt=st[1],vt=st[2],kt+=ot[bt>>>3]+ot[(bt<<2|xt>>>6)&31]+ot[xt>>>1&31]+ot[(xt<<4|vt>>>4)&31]+ot[vt<<1&31]+"==="):(xt=st[1],vt=st[2],Et=st[3],kt+=ot[bt>>>3]+ot[(bt<<2|xt>>>6)&31]+ot[xt>>>1&31]+ot[(xt<<4|vt>>>4)&31]+ot[(vt<<1|Et>>>7)&31]+ot[Et>>>2&31]+ot[Et<<3&31]+"=")}while(!At);return kt},mt=function(gt){for(var bt,xt,vt,Et,Ct,St="",At=gt.length,kt=0,It=parseInt(At/5)*5;kt<It;)bt=gt[kt++],xt=gt[kt++],vt=gt[kt++],Et=gt[kt++],Ct=gt[kt++],St+=ot[bt>>>3]+ot[(bt<<2|xt>>>6)&31]+ot[xt>>>1&31]+ot[(xt<<4|vt>>>4)&31]+ot[(vt<<1|Et>>>7)&31]+ot[Et>>>2&31]+ot[(Et<<3|Ct>>>5)&31]+ot[Ct&31];var Nt=At-It;return Nt===1?(bt=gt[kt],St+=ot[bt>>>3]+ot[bt<<2&31]+"======"):Nt===2?(bt=gt[kt++],xt=gt[kt],St+=ot[bt>>>3]+ot[(bt<<2|xt>>>6)&31]+ot[xt>>>1&31]+ot[xt<<4&31]+"===="):Nt===3?(bt=gt[kt++],xt=gt[kt++],vt=gt[kt],St+=ot[bt>>>3]+ot[(bt<<2|xt>>>6)&31]+ot[xt>>>1&31]+ot[(xt<<4|vt>>>4)&31]+ot[vt<<1&31]+"==="):Nt===4&&(bt=gt[kt++],xt=gt[kt++],vt=gt[kt++],Et=gt[kt],St+=ot[bt>>>3]+ot[(bt<<2|xt>>>6)&31]+ot[xt>>>1&31]+ot[(xt<<4|vt>>>4)&31]+ot[(vt<<1|Et>>>7)&31]+ot[Et>>>2&31]+ot[Et<<3&31]+"="),St},ft=function(gt,bt){var xt=typeof gt!="string";return xt&&gt.constructor===ArrayBuffer&&(gt=new Uint8Array(gt)),xt?mt(gt):bt?dt(gt):ht(gt)},pt=function(gt,bt){if(!bt)return ct(lt(gt));if(gt==="")return"";if(!/^[A-Z2-7=]+$/.test(gt))throw new Error("Invalid base32 characters");var xt,vt,Et,Ct,St,At,kt,It,Nt="",Lt=gt.indexOf("=");Lt===-1&&(Lt=gt.length);for(var Mt=0,zt=Lt>>3<<3;Mt<zt;)xt=it[gt.charAt(Mt++)],vt=it[gt.charAt(Mt++)],Et=it[gt.charAt(Mt++)],Ct=it[gt.charAt(Mt++)],St=it[gt.charAt(Mt++)],At=it[gt.charAt(Mt++)],kt=it[gt.charAt(Mt++)],It=it[gt.charAt(Mt++)],Nt+=String.fromCharCode((xt<<3|vt>>>2)&255)+String.fromCharCode((vt<<6|Et<<1|Ct>>>4)&255)+String.fromCharCode((Ct<<4|St>>>1)&255)+String.fromCharCode((St<<7|At<<2|kt>>>3)&255)+String.fromCharCode((kt<<5|It)&255);var Ut=Lt-zt;return Ut===2?(xt=it[gt.charAt(Mt++)],vt=it[gt.charAt(Mt++)],Nt+=String.fromCharCode((xt<<3|vt>>>2)&255)):Ut===4?(xt=it[gt.charAt(Mt++)],vt=it[gt.charAt(Mt++)],Et=it[gt.charAt(Mt++)],Ct=it[gt.charAt(Mt++)],Nt+=String.fromCharCode((xt<<3|vt>>>2)&255)+String.fromCharCode((vt<<6|Et<<1|Ct>>>4)&255)):Ut===5?(xt=it[gt.charAt(Mt++)],vt=it[gt.charAt(Mt++)],Et=it[gt.charAt(Mt++)],Ct=it[gt.charAt(Mt++)],St=it[gt.charAt(Mt++)],Nt+=String.fromCharCode((xt<<3|vt>>>2)&255)+String.fromCharCode((vt<<6|Et<<1|Ct>>>4)&255)+String.fromCharCode((Ct<<4|St>>>1)&255)):Ut===7&&(xt=it[gt.charAt(Mt++)],vt=it[gt.charAt(Mt++)],Et=it[gt.charAt(Mt++)],Ct=it[gt.charAt(Mt++)],St=it[gt.charAt(Mt++)],At=it[gt.charAt(Mt++)],kt=it[gt.charAt(Mt++)],Nt+=String.fromCharCode((xt<<3|vt>>>2)&255)+String.fromCharCode((vt<<6|Et<<1|Ct>>>4)&255)+String.fromCharCode((Ct<<4|St>>>1)&255)+String.fromCharCode((St<<7|At<<2|kt>>>3)&255)),Nt},yt={encode:ft,decode:pt};pt.asBytes=lt,nt?et.exports=yt:tt.base32=yt})()})(base32$3);var base32Exports=base32$3.exports;const base32$2=getDefaultExportFromCjs(base32Exports);function coerce(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function fromString$1(et){return new TextEncoder().encode(et)}function toString$2(et){return new TextDecoder().decode(et)}function base(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt<tt.length;rt++)tt[rt]=255;for(var nt=0;nt<et.length;nt++){var ot=et.charAt(nt),it=ot.charCodeAt(0);if(tt[it]!==255)throw new TypeError(ot+" is ambiguous");tt[it]=nt}var st=et.length,at=et.charAt(0),ct=Math.log(st)/Math.log(256),lt=Math.log(256)/Math.log(st);function dt(ft){if(ft instanceof Uint8Array||(ArrayBuffer.isView(ft)?ft=new Uint8Array(ft.buffer,ft.byteOffset,ft.byteLength):Array.isArray(ft)&&(ft=Uint8Array.from(ft))),!(ft instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(ft.length===0)return"";for(var pt=0,yt=0,gt=0,bt=ft.length;gt!==bt&&ft[gt]===0;)gt++,pt++;for(var xt=(bt-gt)*lt+1>>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct<yt)&&St!==-1;St--,Ct++)Et+=256*vt[St]>>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At<xt;++At)kt+=et.charAt(vt[At]);return kt}function ht(ft){if(typeof ft!="string")throw new TypeError("Expected String");if(ft.length===0)return new Uint8Array;var pt=0;if(ft[pt]!==" "){for(var yt=0,gt=0;ft[pt]===at;)yt++,pt++;for(var bt=(ft.length-pt)*ct+1>>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et<gt)&&Ct!==-1;Ct--,Et++)vt+=st*xt[Ct]>>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$1=base,_brrp__multiformats_scope_baseX=src$1;class Encoder{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}}class Decoder{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or(this,o)}}class ComposedDecoder{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}function or(et,o){return new ComposedDecoder({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}class Codec{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder(o,tt,rt),this.decoder=new Decoder(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}}function from({name:et,prefix:o,encode:tt,decode:rt}){return new Codec(et,o,tt,rt)}function baseX({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX(tt,et);return from({prefix:o,name:et,encode:rt,decode:ot=>coerce(nt(ot))})}function decode$2(et,o,tt,rt){const nt={};for(let lt=0;lt<o.length;++lt)nt[o[lt]]=lt;let ot=et.length;for(;et[ot-1]==="=";)--ot;const it=new Uint8Array(ot*tt/8|0);let st=0,at=0,ct=0;for(let lt=0;lt<ot;++lt){const dt=nt[et[lt]];if(dt===void 0)throw new SyntaxError(`Non-${rt} character`);at=at<<tt|dt,st+=tt,st>=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$1(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<<tt)-1;let ot="",it=0,st=0;for(let at=0;at<et.length;++at)for(st=st<<8|et[at],it+=8;it>tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<<tt-it]),rt)for(;ot.length*tt&7;)ot+="=";return ot}function rfc4648({name:et,prefix:o,bitsPerChar:tt,alphabet:rt}){return from({prefix:o,name:et,encode(nt){return encode$1(nt,rt,tt)},decode(nt){return decode$2(nt,rt,tt,et)}})}const base10=baseX({prefix:"9",name:"base10",alphabet:"0123456789"}),base10$1=Object.freeze(Object.defineProperty({__proto__:null,base10},Symbol.toStringTag,{value:"Module"})),base16=rfc4648({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper=rfc4648({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),base16$1=Object.freeze(Object.defineProperty({__proto__:null,base16,base16upper},Symbol.toStringTag,{value:"Module"})),base2=rfc4648({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),base2$1=Object.freeze(Object.defineProperty({__proto__:null,base2},Symbol.toStringTag,{value:"Module"})),alphabet=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),alphabetBytesToChars=alphabet.reduce((et,o,tt)=>(et[tt]=o,et),[]),alphabetCharsToBytes=alphabet.reduce((et,o,tt)=>{const rt=o.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${o}`);return et[rt]=tt,et},[]);function encode(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars[tt],o),"")}function decode$1(et){const o=[];for(const tt of et){const rt=tt.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${tt}`);const nt=alphabetCharsToBytes[rt];if(nt==null)throw new Error(`Non-base256emoji character: ${tt}`);o.push(nt)}return new Uint8Array(o)}const base256emoji=from({prefix:"🚀",name:"base256emoji",encode,decode:decode$1}),base256emoji$1=Object.freeze(Object.defineProperty({__proto__:null,base256emoji},Symbol.toStringTag,{value:"Module"})),base32=rfc4648({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper=rfc4648({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad=rfc4648({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper=rfc4648({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex=rfc4648({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper=rfc4648({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad=rfc4648({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper=rfc4648({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z=rfc4648({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$1=Object.freeze(Object.defineProperty({__proto__:null,base32,base32hex,base32hexpad,base32hexpadupper,base32hexupper,base32pad,base32padupper,base32upper,base32z},Symbol.toStringTag,{value:"Module"})),base36=baseX({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper=baseX({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$1=Object.freeze(Object.defineProperty({__proto__:null,base36,base36upper},Symbol.toStringTag,{value:"Module"})),base58btc=baseX({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr=baseX({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58=Object.freeze(Object.defineProperty({__proto__:null,base58btc,base58flickr},Symbol.toStringTag,{value:"Module"})),base64$2=rfc4648({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad=rfc4648({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url=rfc4648({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad=rfc4648({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$3=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$2,base64pad,base64url,base64urlpad},Symbol.toStringTag,{value:"Module"})),base8=rfc4648({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$1=Object.freeze(Object.defineProperty({__proto__:null,base8},Symbol.toStringTag,{value:"Module"})),identity=from({prefix:"\0",name:"identity",encode:et=>toString$2(et),decode:et=>fromString$1(et)}),identityBase=Object.freeze(Object.defineProperty({__proto__:null,identity},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const bases={...identityBase,...base2$1,...base8$1,...base10$1,...base16$1,...base32$1,...base36$1,...base58,...base64$3,...base256emoji$1};function allocUnsafe(et=0){return new Uint8Array(et)}function createCodec(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$2=createCodec("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii=createCodec("ascii","a",et=>{let o="a";for(let tt=0;tt<et.length;tt++)o+=String.fromCharCode(et[tt]);return o},et=>{et=et.substring(1);const o=allocUnsafe(et.length);for(let tt=0;tt<et.length;tt++)o[tt]=et.charCodeAt(tt);return o}),BASES={utf8:string$2,"utf-8":string$2,hex:bases.base16,latin1:ascii,ascii,binary:ascii,...bases};function fromString(et,o="utf8"){const tt=BASES[o];if(tt==null)throw new Error(`Unsupported encoding "${o}"`);return tt.decoder.decode(`${tt.prefix}${et}`)}const $n=class $n{static parseAndVerifyRoot(o,tt){if(!o.startsWith(this.ROOT_PREFIX))throw new Error(`ENRTree root entry must start with '${this.ROOT_PREFIX}'`);const rt=$n.parseRootValues(o),nt=base32$2.decode.asBytes(tt),ot=o.split(" sig")[0],it=utf8ToBytes$1(ot),st=fromString(rt.signature,"base64url").slice(0,64);if(!verifySignature(st,keccak256(it),new Uint8Array(nt)))throw new Error("Unable to verify ENRTree root signature");return rt.eRoot}static parseRootValues(o){const tt=o.match(/^enrtree-root:v1 e=([^ ]+) l=([^ ]+) seq=(\d+) sig=([^ ]+)$/);if(!Array.isArray(tt))throw new Error("Could not parse ENRTree root entry");tt.shift();const[rt,nt,ot,it]=tt;if(!rt)throw new Error("Could not parse 'e' value from ENRTree root entry");if(!nt)throw new Error("Could not parse 'l' value from ENRTree root entry");if(!ot)throw new Error("Could not parse 'seq' value from ENRTree root entry");if(!it)throw new Error("Could not parse 'sig' value from ENRTree root entry");return{eRoot:rt,lRoot:nt,seq:Number(ot),signature:it}}static parseTree(o){if(!o.startsWith(this.TREE_PREFIX))throw new Error(`ENRTree tree entry must start with '${this.TREE_PREFIX}'`);const tt=o.match(/^enrtree:\/\/([^@]+)@(.+)$/);if(!Array.isArray(tt))throw new Error("Could not parse ENRTree tree entry");tt.shift();const[rt,nt]=tt;if(!rt)throw new Error("Could not parse public key from ENRTree tree entry");if(!nt)throw new Error("Could not parse domain from ENRTree tree entry");return{publicKey:rt,domain:nt}}static parseBranch(o){if(!o.startsWith(this.BRANCH_PREFIX))throw new Error(`ENRTree branch entry must start with '${this.BRANCH_PREFIX}'`);return o.split(this.BRANCH_PREFIX)[1].split(",")}};wt($n,"RECORD_PREFIX",ENR.RECORD_PREFIX),wt($n,"TREE_PREFIX","enrtree:"),wt($n,"BRANCH_PREFIX","enrtree-branch:"),wt($n,"ROOT_PREFIX","enrtree-root:");let ENRTree=$n;const log$6=new Logger$1("discovery:fetch_nodes");async function fetchNodesUntilCapabilitiesFulfilled(et,o,tt){const rt={relay:et.relay??0,store:et.store??0,filter:et.filter??0,lightPush:et.lightPush??0},nt=rt.relay+rt.store+rt.filter+rt.lightPush,ot={relay:0,store:0,filter:0,lightPush:0};let it=0;const st=[];for(;!isSatisfied(rt,ot)&&it<nt+o;){const at=await tt();at&&isNewPeer(at,st)&&(at.waku2&&helpsSatisfyCapabilities(at.waku2,rt,ot)&&(addCapabilities(at.waku2,ot),st.push(at)),log$6.info(`got new peer candidate from DNS address=${at.nodeId}@${at.ip}`)),it++}return st}async function*yieldNodesUntilCapabilitiesFulfilled(et,o,tt){const rt={relay:et.relay??0,store:et.store??0,filter:et.filter??0,lightPush:et.lightPush??0},nt=rt.relay+rt.store+rt.filter+rt.lightPush,ot={relay:0,store:0,filter:0,lightPush:0};let it=0;const st=new Set;for(;!isSatisfied(rt,ot)&&it<nt+o;){const at=await tt();at&&at.nodeId&&!st.has(at.nodeId)&&(st.add(at.nodeId),at.waku2&&helpsSatisfyCapabilities(at.waku2,rt,ot)&&(addCapabilities(at.waku2,ot),yield at),log$6.info(`got new peer candidate from DNS address=${at.nodeId}@${at.ip}`)),it++}}function isSatisfied(et,o){return o.relay>=et.relay&&o.store>=et.store&&o.filter>=et.filter&&o.lightPush>=et.lightPush}function isNewPeer(et,o){if(!et.nodeId)return!1;for(const tt of o)if(et.nodeId===tt.nodeId)return!1;return!0}function addCapabilities(et,o){et.relay&&(o.relay+=1),et.store&&(o.store+=1),et.filter&&(o.filter+=1),et.lightPush&&(o.lightPush+=1)}function helpsSatisfyCapabilities(et,o,tt){if(isSatisfied(o,tt))throw"Internal Error: Waku2 wanted capabilities are already fulfilled";const rt=missingCapabilities(o,tt);return rt.relay&&et.relay||rt.store&&et.store||rt.filter&&et.filter||rt.lightPush&&et.lightPush}function missingCapabilities(et,o){return{relay:o.relay<et.relay,store:o.store<et.store,filter:o.filter<et.filter,lightPush:o.lightPush<et.lightPush}}const log$5=new Logger$1("discovery:dns");class DnsNodeDiscovery{constructor(o){wt(this,"dns");wt(this,"_DNSTreeCache");wt(this,"_errorTolerance",10);this._DNSTreeCache={},this.dns=o}static async dnsOverHttp(o){return o||(o=await DnsOverHttps.create()),new DnsNodeDiscovery(o)}async getPeers(o,tt){const rt=Math.floor(Math.random()*o.length),{publicKey:nt,domain:ot}=ENRTree.parseTree(o[rt]),it={domain:ot,publicKey:nt,visits:{}},st=await fetchNodesUntilCapabilitiesFulfilled(tt,this._errorTolerance,()=>this._search(ot,it));return log$5.info("retrieved peers: ",st.map(at=>{var ct,lt;return{id:(ct=at.peerId)==null?void 0:ct.toString(),multiaddrs:(lt=at.multiaddrs)==null?void 0:lt.map(dt=>dt.toString())}})),st}async*getNextPeer(o,tt){const rt=Math.floor(Math.random()*o.length),{publicKey:nt,domain:ot}=ENRTree.parseTree(o[rt]),it={domain:ot,publicKey:nt,visits:{}};for await(const st of yieldNodesUntilCapabilitiesFulfilled(tt,this._errorTolerance,()=>this._search(ot,it)))yield st}async _search(o,tt){try{const rt=await this._getTXTRecord(o,tt);tt.visits[o]=!0;let nt,ot;const it=getEntryType(rt);try{switch(it){case ENRTree.ROOT_PREFIX:return nt=ENRTree.parseAndVerifyRoot(rt,tt.publicKey),await this._search(nt,tt);case ENRTree.BRANCH_PREFIX:return ot=ENRTree.parseBranch(rt),nt=selectRandomPath(ot,tt),await this._search(nt,tt);case ENRTree.RECORD_PREFIX:return EnrDecoder.fromString(rt);default:return null}}catch(st){return log$5.error(`Failed to search DNS tree ${it} at subdomain ${o}: ${st}`),null}}catch(rt){return log$5.error(`Failed to retrieve TXT record at subdomain ${o}: ${rt}`),null}}async _getTXTRecord(o,tt){if(this._DNSTreeCache[o])return this._DNSTreeCache[o];const rt=o!==tt.domain?`${o}.${tt.domain}`:tt.domain,nt=await this.dns.resolveTXT(rt);if(!nt.length)throw new Error("Received empty result array while fetching TXT record");if(!nt[0].length)throw new Error("Received empty TXT record");const ot=nt.join("");return this._DNSTreeCache[o]=ot,ot}}function getEntryType(et){return et.startsWith(ENRTree.ROOT_PREFIX)?ENRTree.ROOT_PREFIX:et.startsWith(ENRTree.BRANCH_PREFIX)?ENRTree.BRANCH_PREFIX:et.startsWith(ENRTree.RECORD_PREFIX)?ENRTree.RECORD_PREFIX:""}function selectRandomPath(et,o){const tt={};for(const[nt,ot]of et.entries())o.visits[ot]&&(tt[nt]=!0);if(Object.keys(tt).length===et.length)throw new Error("Unresolvable circular path detected");let rt;do rt=Math.floor(Math.random()*et.length);while(tt[rt]);return et[rt]}const log$4=new Logger$1("peer-discovery-dns");class PeerDiscoveryDns extends TypedEventEmitter$3{constructor(tt,rt){super();wt(this,"nextPeer");wt(this,"_started");wt(this,"_components");wt(this,"_options");this._started=!1,this._components=tt,this._options=rt;const{enrUrls:nt}=rt;log$4.info("Use following EIP-1459 ENR Tree URLs: ",nt)}async start(){log$4.info("Starting peer discovery via dns"),this._started=!0,await this.findPeers()}async findPeers(){if(!this.nextPeer){let{enrUrls:tt}=this._options;Array.isArray(tt)||(tt=[tt]);const{wantedNodeCapabilityCount:rt}=this._options,nt=await DnsNodeDiscovery.dnsOverHttp();this.nextPeer=nt.getNextPeer.bind(nt,tt,rt)}for await(const tt of this.nextPeer()){if(!this._started)return;const{peerInfo:rt,shardInfo:nt}=tt;if(!rt)continue;const ot={[DEFAULT_BOOTSTRAP_TAG_NAME]:{value:this._options.tagValue??DEFAULT_BOOTSTRAP_TAG_VALUE,ttl:this._options.tagTTL??DEFAULT_BOOTSTRAP_TAG_TTL}};let it=!1;await this._components.peerStore.has(rt.id)?(await this._components.peerStore.get(rt.id)).tags.has(DEFAULT_BOOTSTRAP_TAG_NAME)||(it=!0,await this._components.peerStore.merge(rt.id,{tags:ot})):(it=!0,await this._components.peerStore.save(rt.id,{tags:ot,...nt&&{metadata:{shardInfo:encodeRelayShard(nt)}}})),it&&this.dispatchEvent(new CustomEvent("peer",{detail:rt}))}}stop(){this._started=!1}get[peerDiscoverySymbol$2](){return!0}get[Symbol.toStringTag](){return DNS_DISCOVERY_TAG}}function wakuDnsDiscovery(et,o=DEFAULT_NODE_REQUIREMENTS){return tt=>new PeerDiscoveryDns(tt,{enrUrls:et,wantedNodeCapabilityCount:o})}class PeerExchangeRPC{constructor(o){wt(this,"proto");this.proto=o}static createRequest(o){const{numPeers:tt}=o;return new PeerExchangeRPC({query:{numPeers:tt},response:void 0})}encode(){return PeerExchangeRPC$1.encode(this.proto)}static decode(o){const tt=PeerExchangeRPC$1.decode(o);return new PeerExchangeRPC(tt)}get query(){return this.proto.query}get response(){return this.proto.response}}const PeerExchangeCodec="/vac/waku/peer-exchange/2.0.0-alpha1",log$3=new Logger$1("peer-exchange");class WakuPeerExchange extends BaseProtocol{constructor(o,tt){super(PeerExchangeCodec,o,log$3,tt)}async query(o){const{numPeers:tt,peerId:rt}=o,nt=PeerExchangeRPC.createRequest({numPeers:BigInt(tt)}),ot=await this.components.peerStore.get(rt);if(!ot)return{peerInfos:null,error:ProtocolError$1.NO_PEER_AVAILABLE};let it;try{it=await this.getStream(ot)}catch(at){return log$3.error("Failed to get stream",at),{peerInfos:null,error:ProtocolError$1.NO_STREAM_AVAILABLE}}const st=await pipe([nt.encode()],encode$K,it,decode$U,async at=>await all$2(at));try{const at=new Uint8ArrayList;st.forEach(dt=>{at.append(dt)});const{response:ct}=PeerExchangeRPC.decode(at);return ct?{peerInfos:await Promise.all(ct.peerInfos.map(dt=>dt.enr).filter(isDefined).map(async dt=>({ENR:await EnrDecoder.fromRLP(dt)}))),error:null}:(log$3.error("PeerExchangeRPC message did not contains a `response` field"),{peerInfos:null,error:ProtocolError$1.EMPTY_PAYLOAD})}catch(at){return log$3.error("Failed to decode push reply",at),{peerInfos:null,error:ProtocolError$1.DECODE_FAILED}}}}const log$2=new Logger$1("peer-exchange-discovery"),DEFAULT_PEER_EXCHANGE_REQUEST_NODES=10,DEFAULT_PEER_EXCHANGE_QUERY_INTERVAL_MS=10*1e3,DEFAULT_MAX_RETRIES=3,DEFAULT_PEER_EXCHANGE_TAG_NAME=Tags.PEER_EXCHANGE,DEFAULT_PEER_EXCHANGE_TAG_VALUE=50,DEFAULT_PEER_EXCHANGE_TAG_TTL=1e8;class PeerExchangeDiscovery extends TypedEventEmitter$3{constructor(tt,rt,nt={}){super();wt(this,"components");wt(this,"peerExchange");wt(this,"options");wt(this,"isStarted");wt(this,"queryingPeers",new Set);wt(this,"queryAttempts",new Map);wt(this,"handleDiscoveredPeer",tt=>{const{protocols:rt,peerId:nt}=tt.detail;!rt.includes(PeerExchangeCodec)||this.queryingPeers.has(nt.toString())||(this.queryingPeers.add(nt.toString()),this.startRecurringQueries(nt).catch(ot=>log$2.error(`Error querying peer ${ot}`)))});wt(this,"startRecurringQueries",async tt=>{const rt=tt.toString(),{queryInterval:nt=DEFAULT_PEER_EXCHANGE_QUERY_INTERVAL_MS,maxRetries:ot=DEFAULT_MAX_RETRIES}=this.options;log$2.info(`Querying peer: ${rt} (attempt ${this.queryAttempts.get(rt)??1})`),await this.query(tt);const it=this.queryAttempts.get(rt)??1;if(it>ot){this.abortQueriesForPeer(rt);return}setTimeout(()=>{this.queryAttempts.set(rt,it+1),this.startRecurringQueries(tt).catch(st=>{log$2.error(`Error in startRecurringQueries: ${st}`)})},nt*it)});this.components=tt,this.peerExchange=new WakuPeerExchange(tt,rt),this.options=nt,this.isStarted=!1}start(){this.isStarted||(this.dispatchEvent(new CustomEvent("waku:peer-exchange:started",{detail:!0})),log$2.info("Starting peer exchange node discovery, discovering peers"),this.components.events.addEventListener("peer:identify",this.handleDiscoveredPeer))}stop(){this.isStarted&&(log$2.info("Stopping peer exchange node discovery"),this.isStarted=!1,this.queryingPeers.clear(),this.components.events.removeEventListener("peer:identify",this.handleDiscoveredPeer))}get[peerDiscoverySymbol$2](){return!0}get[Symbol.toStringTag](){return"@waku/peer-exchange"}async query(tt){const{error:rt,peerInfos:nt}=await this.peerExchange.query({numPeers:DEFAULT_PEER_EXCHANGE_REQUEST_NODES,peerId:tt});if(rt)return log$2.error("Peer exchange query failed",rt),{error:rt,peerInfos:null};for(const ot of nt){const{ENR:it}=ot;if(!it){log$2.warn("No ENR in peerInfo object, skipping");continue}const{peerId:st,peerInfo:at,shardInfo:ct}=it;if(!st||!at)continue;if(await this.components.peerStore.has(st)){const{hasMultiaddrDiff:dt,hasShardDiff:ht}=await this.checkPeerInfoDiff(at,ct);if(dt||ht){log$2.info(`Peer ${st.toString()} has updated multiaddrs or shardInfo, updating`),dt&&(log$2.info(`Peer ${st.toString()} has updated multiaddrs, updating`),await this.components.peerStore.patch(st,{multiaddrs:at.multiaddrs})),ht&&ct&&(log$2.info(`Peer ${st.toString()} has updated shardInfo, updating`),await this.components.peerStore.merge(st,{metadata:{shardInfo:encodeRelayShard(ct)}}),this.dispatchEvent(new CustomEvent("peer",{detail:{id:st,multiaddrs:at.multiaddrs}})));continue}}await this.components.peerStore.save(st,{tags:{[DEFAULT_PEER_EXCHANGE_TAG_NAME]:{value:this.options.tagValue??DEFAULT_PEER_EXCHANGE_TAG_VALUE,ttl:this.options.tagTTL??DEFAULT_PEER_EXCHANGE_TAG_TTL}},...ct&&{metadata:{shardInfo:encodeRelayShard(ct)}},...at.multiaddrs&&{multiaddrs:at.multiaddrs}}),log$2.info(`Discovered peer: ${st.toString()}`),this.dispatchEvent(new CustomEvent("peer",{detail:{id:st,multiaddrs:at.multiaddrs}}))}return{error:null,peerInfos:nt}}abortQueriesForPeer(tt){log$2.info(`Aborting queries for peer: ${tt}`),this.queryingPeers.delete(tt),this.queryAttempts.delete(tt)}async checkPeerInfoDiff(tt,rt){const{id:nt}=tt,ot=await this.components.peerStore.get(nt),it=ot.addresses.map(dt=>dt.multiaddr.toString()),st=tt.multiaddrs.map(dt=>dt.toString()),at=it.some(dt=>!st.includes(dt));let ct=!1;const lt=ot.metadata.get("shardInfo");if(lt){const dt=decodeRelayShard(lt);(dt||rt)&&(ct=dt.clusterId!==(rt==null?void 0:rt.clusterId)||dt.shards.some(ht=>!(rt!=null&&rt.shards.includes(ht))))}return{hasMultiaddrDiff:at,hasShardDiff:ct}}}function wakuPeerExchangeDiscovery(et){return o=>new PeerExchangeDiscovery(o,et)}const log$1=new Logger$1("peer-exchange-discovery"),DEFAULT_LOCAL_TAG_NAME=Tags.LOCAL,DEFAULT_LOCAL_TAG_VALUE=50,DEFAULT_LOCAL_TAG_TTL=1e8;class LocalPeerCacheDiscovery extends TypedEventEmitter$3{constructor(tt,rt){super();wt(this,"components");wt(this,"options");wt(this,"isStarted");wt(this,"peers",[]);wt(this,"handleNewPeers",tt=>{const{peerId:rt,listenAddrs:nt}=tt.detail,ot=getWsMultiaddrFromMultiaddrs(nt),it=this.getPeersFromLocalStorage(),st=it.findIndex(at=>at.id===rt.toString());st>=0?it[st].address=ot.toString():it.push({id:rt.toString(),address:ot.toString()}),this.peers=it,this.savePeersToLocalStorage()});this.components=tt,this.options=rt,this.isStarted=!1,this.peers=this.getPeersFromLocalStorage()}get[Symbol.toStringTag](){return"@waku/local-peer-cache-discovery"}async start(){var tt,rt,nt;if(!this.isStarted){log$1.info("Starting Local Storage Discovery"),this.components.events.addEventListener("peer:identify",this.handleNewPeers);for(const{id:ot,address:it}of this.peers){const st=peerIdFromString$1(ot);await this.components.peerStore.has(st)||(await this.components.peerStore.save(st,{multiaddrs:[multiaddr(it)],tags:{[((tt=this.options)==null?void 0:tt.tagName)??DEFAULT_LOCAL_TAG_NAME]:{value:((rt=this.options)==null?void 0:rt.tagValue)??DEFAULT_LOCAL_TAG_VALUE,ttl:((nt=this.options)==null?void 0:nt.tagTTL)??DEFAULT_LOCAL_TAG_TTL}}}),this.dispatchEvent(new CustomEvent("peer",{detail:{id:st,multiaddrs:[multiaddr(it)]}})))}log$1.info(`Discovered ${this.peers.length} peers`),this.isStarted=!0}}stop(){this.isStarted&&(log$1.info("Stopping Local Storage Discovery"),this.components.events.removeEventListener("peer:identify",this.handleNewPeers),this.isStarted=!1,this.savePeersToLocalStorage())}getPeersFromLocalStorage(){try{const tt=localStorage.getItem("waku:peers");return tt?JSON.parse(tt).filter(isValidStoredPeer):[]}catch(tt){return log$1.error("Error parsing peers from local storage:",tt),[]}}savePeersToLocalStorage(){try{localStorage.setItem("waku:peers",JSON.stringify(this.peers))}catch(tt){log$1.error("Error saving peers to local storage:",tt)}}}function isValidStoredPeer(et){return et&&typeof et=="object"&&typeof et.id=="string"&&typeof et.address=="string"}function wakuLocalPeerCacheDiscovery(){return(et,o)=>new LocalPeerCacheDiscovery(et,o)}function defaultPeerDiscoveries(et){const o=[enrTree.SANDBOX,enrTree.TEST];return[wakuDnsDiscovery(o),wakuLocalPeerCacheDiscovery(),wakuPeerExchangeDiscovery(et)]}const log=new Logger$1("sdk:create");async function defaultLibp2p(et,o,tt){o!=null&&o.hideWebSocketInfo||(console.info("%cIgnore WebSocket connection failures","background: gray; color: white; font-size: x-large"),console.info("%cWaku tries to discover peers and some of them are expected to fail","background: gray; color: white; font-size: x-large"));const rt=et?{metadata:wakuMetadata(et)}:{},nt=(o==null?void 0:o.filterMultiaddrs)===!1?all$1:wss;return createLibp2p({transports:[webSockets({filter:nt})],streamMuxers:[mplex()],connectionEncrypters:[noise()],...o,services:{identify:identify({agentVersion:tt??DefaultUserAgent}),ping:ping({maxInboundStreams:(o==null?void 0:o.pingMaxInboundStreams)??DefaultPingMaxInboundStreams}),...rt,...o==null?void 0:o.services}})}async function createLibp2pAndUpdateOptions(et){const{networkConfig:o}=et,tt=derivePubsubTopicsFromNetworkConfig(o??DefaultNetworkConfig);log.info("Creating Waku node with pubsub topics",tt);const rt=(et==null?void 0:et.libp2p)??{},nt=rt.peerDiscovery??[];return et!=null&&et.defaultBootstrap&&nt.push(...defaultPeerDiscoveries(tt)),et!=null&&et.bootstrapPeers&&nt.push(bootstrap({list:et.bootstrapPeers})),rt.peerDiscovery=nt,{libp2p:await defaultLibp2p(tt,rt,et==null?void 0:et.userAgent),pubsubTopics:tt}}async function createLightNode(et={}){const{libp2p:o,pubsubTopics:tt}=await createLibp2pAndUpdateOptions(et);return new WakuNode(tt,et,o,{store:!0,lightpush:!0,filter:!0})}React.createContext({decoder:void 0,encoder:void 0});const useCreateNode=et=>{const{factory:o,options:tt,protocols:rt=[]}=et,[nt,ot]=React.useState(void 0),[it,st]=React.useState(!0),[at,ct]=React.useState(void 0);return React.useEffect(()=>{let lt=!1;return st(!0),o(tt).then(async dt=>{lt||(await dt.start(),await waitForRemotePeer(dt,rt),ot(dt),st(!1))}).catch(dt=>{st(!1),ct(`Failed at creating node: ${(dt==null?void 0:dt.message)||"no message"}`)}),()=>{lt=!0}},[]),{node:nt,error:at,isLoading:it}},useCreateLightNode=et=>useCreateNode({...et,factory:createLightNode}),WakuContext=React.createContext({node:void 0,isLoading:!1,error:void 0}),useWaku=()=>React.useContext(WakuContext),LightNodeProvider=et=>{const o=useCreateLightNode({options:et.options,protocols:et.protocols});return React.createElement(WakuContext.Provider,{value:o},et.children)};/**
* @license lucide-react v0.453.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const toKebabCase=et=>et.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),mergeClasses=(...et)=>et.filter((o,tt,rt)=>!!o&&rt.indexOf(o)===tt).join(" ");/**
* @license lucide-react v0.453.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var defaultAttributes={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
* @license lucide-react v0.453.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Icon=reactExports.forwardRef(({color:et="currentColor",size:o=24,strokeWidth:tt=2,absoluteStrokeWidth:rt,className:nt="",children:ot,iconNode:it,...st},at)=>reactExports.createElement("svg",{ref:at,...defaultAttributes,width:o,height:o,stroke:et,strokeWidth:rt?Number(tt)*24/Number(o):tt,className:mergeClasses("lucide",nt),...st},[...it.map(([ct,lt])=>reactExports.createElement(ct,lt)),...Array.isArray(ot)?ot:[ot]]));/**
* @license lucide-react v0.453.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const createLucideIcon=(et,o)=>{const tt=reactExports.forwardRef(({className:rt,...nt},ot)=>reactExports.createElement(Icon,{ref:ot,iconNode:o,className:mergeClasses(`lucide-${toKebabCase(et)}`,rt),...nt}));return tt.displayName=`${et}`,tt};/**
* @license lucide-react v0.453.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Check=createLucideIcon("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
* @license lucide-react v0.453.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Copy=createLucideIcon("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
* @license lucide-react v0.453.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const LoaderCircle=createLucideIcon("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),Header=({wakuStatus:et})=>{const{address:o,isConnected:tt}=useAccount(),{disconnect:rt}=useDisconnect(),{isLoading:nt,error:ot,node:it}=useWaku(),[st,at]=reactExports.useState(0),ct=useLocation(),{data:lt}=useEnsName({address:o});reactExports.useEffect(()=>{if(it){const ht=()=>{at(it.libp2p.getConnections().length)};return ht(),it.libp2p.addEventListener("peer:connect",ht),it.libp2p.addEventListener("peer:disconnect",ht),()=>{it.libp2p.removeEventListener("peer:connect",ht),it.libp2p.removeEventListener("peer:disconnect",ht)}}},[it]);const dt=ht=>{switch(ht){case"success":return"bg-green-500";case"in-progress":return"bg-yellow-500";case"error":return"bg-red-500"}};return jsxRuntimeExports.jsx("header",{className:"sticky top-0 z-50 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:jsxRuntimeExports.jsx("div",{className:"container",children:jsxRuntimeExports.jsx("div",{className:"h-14",children:jsxRuntimeExports.jsxs("div",{className:"flex h-14 items-center justify-between gap-4",children:[jsxRuntimeExports.jsxs("nav",{className:"flex items-center gap-2 md:gap-4",children:[jsxRuntimeExports.jsx(Link,{to:"",className:`text-sm font-medium ${ct.pathname===""?"text-foreground":"text-muted-foreground"}`,children:"Home"}),jsxRuntimeExports.jsx(Link,{to:"create",className:`text-sm font-medium ${ct.pathname==="/create"?"text-foreground":"text-muted-foreground"}`,children:"Create"}),jsxRuntimeExports.jsx(Link,{to:"view",className:`text-sm font-medium ${ct.pathname==="/view"?"text-foreground":"text-muted-foreground"}`,children:"View"})]}),jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2 md:gap-4",children:[jsxRuntimeExports.jsx("div",{className:"hidden md:flex items-center gap-2",children:!nt&&!ot&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-1",children:[jsxRuntimeExports.jsx("span",{className:"text-muted-foreground",children:"Filter:"}),jsxRuntimeExports.jsx("div",{className:`w-2 h-2 md:w-3 md:h-3 rounded-full ${dt(et.filter)}`})]}),jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-1",children:[jsxRuntimeExports.jsx("span",{className:"text-muted-foreground",children:"Store:"}),jsxRuntimeExports.jsx("div",{className:`w-2 h-2 md:w-3 md:h-3 rounded-full ${dt(et.store)}`})]})]})}),jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[nt?jsxRuntimeExports.jsx(LoaderCircle,{className:"h-4 w-4 animate-spin"}):ot?jsxRuntimeExports.jsx("span",{className:"text-xs text-red-500",children:"Error"}):jsxRuntimeExports.jsx("div",{className:`w-2 h-2 rounded-full ${st>0?"bg-green-500":"bg-yellow-500"}`}),tt?jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntimeExports.jsx("span",{className:"text-xs md:text-sm text-muted-foreground truncate max-w-[80px] md:max-w-[120px]",children:lt||(o?`${o.slice(0,4)}...${o.slice(-4)}`:"")}),jsxRuntimeExports.jsxs(Button,{variant:"outline",size:"sm",onClick:()=>rt(),children:[jsxRuntimeExports.jsx("span",{className:"md:hidden",children:"×"}),jsxRuntimeExports.jsx("span",{className:"hidden md:inline",children:"Logout"})]})]}):jsxRuntimeExports.jsx(ConnectKitButton,{})]})]})]})})})})},Input=reactExports.forwardRef(({className:et,type:o,...tt},rt)=>jsxRuntimeExports.jsx("input",{type:o,className:cn("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base md:text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50","touch-manipulation min-h-[44px] md:min-h-[36px]",et),ref:rt,...tt}));Input.displayName="Input";const Textarea=reactExports.forwardRef(({className:et,...o},tt)=>jsxRuntimeExports.jsx("textarea",{className:cn("flex min-h-[80px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base md:text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50","touch-manipulation resize-y",et),ref:tt,...o}));Textarea.displayName="Textarea";var NODES=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Primitive=NODES.reduce((et,o)=>{const tt=reactExports.forwardRef((rt,nt)=>{const{asChild:ot,...it}=rt,st=ot?Slot:o;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntimeExports.jsx(st,{...it,ref:nt})});return tt.displayName=`Primitive.${o}`,{...et,[o]:tt}},{});function dispatchDiscreteCustomEvent(et,o){et&&reactDomExports.flushSync(()=>et.dispatchEvent(o))}var NAME="Label",Label$1=reactExports.forwardRef((et,o)=>jsxRuntimeExports.jsx(Primitive.label,{...et,ref:o,onMouseDown:tt=>{var nt;tt.target.closest("button, input, select, textarea")||((nt=et.onMouseDown)==null||nt.call(et,tt),!tt.defaultPrevented&&tt.detail>1&&tt.preventDefault())}}));Label$1.displayName=NAME;var Root$3=Label$1;const labelVariants=cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Label=reactExports.forwardRef(({className:et,...o},tt)=>jsxRuntimeExports.jsx(Root$3,{ref:tt,className:cn(labelVariants(),et),...o}));Label.displayName=Root$3.displayName;const Card=reactExports.forwardRef(({className:et,...o},tt)=>jsxRuntimeExports.jsx("div",{ref:tt,className:cn("rounded-lg border bg-card text-card-foreground shadow-sm p-4 md:p-6 w-full max-w-[95vw] mx-auto",et),...o}));Card.displayName="Card";const CardHeader=reactExports.forwardRef(({className:et,...o},tt)=>jsxRuntimeExports.jsx("div",{ref:tt,className:cn("flex flex-col space-y-1.5 p-4 md:p-6",et),...o}));CardHeader.displayName="CardHeader";const CardTitle=reactExports.forwardRef(({className:et,...o},tt)=>jsxRuntimeExports.jsx("h3",{ref:tt,className:cn("font-semibold leading-none tracking-tight",et),...o}));CardTitle.displayName="CardTitle";const CardDescription=reactExports.forwardRef(({className:et,...o},tt)=>jsxRuntimeExports.jsx("p",{ref:tt,className:cn("text-sm text-muted-foreground",et),...o}));CardDescription.displayName="CardDescription";const CardContent=reactExports.forwardRef(({className:et,...o},tt)=>jsxRuntimeExports.jsx("div",{ref:tt,className:cn("p-6 pt-0",et),...o}));CardContent.displayName="CardContent";const CardFooter=reactExports.forwardRef(({className:et,...o},tt)=>jsxRuntimeExports.jsx("div",{ref:tt,className:cn("flex items-center p-6 pt-0",et),...o}));CardFooter.displayName="CardFooter";function composeEventHandlers(et,o,{checkForDefaultPrevented:tt=!0}={}){return function(nt){if(et==null||et(nt),tt===!1||!nt.defaultPrevented)return o==null?void 0:o(nt)}}function createContext2(et,o){const tt=reactExports.createContext(o),rt=ot=>{const{children:it,...st}=ot,at=reactExports.useMemo(()=>st,Object.values(st));return jsxRuntimeExports.jsx(tt.Provider,{value:at,children:it})};rt.displayName=et+"Provider";function nt(ot){const it=reactExports.useContext(tt);if(it)return it;if(o!==void 0)return o;throw new Error(`\`${ot}\` must be used within \`${et}\``)}return[rt,nt]}function createContextScope(et,o=[]){let tt=[];function rt(ot,it){const st=reactExports.createContext(it),at=tt.length;tt=[...tt,it];const ct=dt=>{var gt;const{scope:ht,children:mt,...ft}=dt,pt=((gt=ht==null?void 0:ht[et])==null?void 0:gt[at])||st,yt=reactExports.useMemo(()=>ft,Object.values(ft));return jsxRuntimeExports.jsx(pt.Provider,{value:yt,children:mt})};ct.displayName=ot+"Provider";function lt(dt,ht){var pt;const mt=((pt=ht==null?void 0:ht[et])==null?void 0:pt[at])||st,ft=reactExports.useContext(mt);if(ft)return ft;if(it!==void 0)return it;throw new Error(`\`${dt}\` must be used within \`${ot}\``)}return[ct,lt]}const nt=()=>{const ot=tt.map(it=>reactExports.createContext(it));return function(st){const at=(st==null?void 0:st[et])||ot;return reactExports.useMemo(()=>({[`__scope${et}`]:{...st,[et]:at}}),[st,at])}};return nt.scopeName=et,[rt,composeContextScopes(nt,...o)]}function composeContextScopes(...et){const o=et[0];if(et.length===1)return o;const tt=()=>{const rt=et.map(nt=>({useScope:nt(),scopeName:nt.scopeName}));return function(ot){const it=rt.reduce((st,{useScope:at,scopeName:ct})=>{const dt=at(ot)[`__scope${ct}`];return{...st,...dt}},{});return reactExports.useMemo(()=>({[`__scope${o.scopeName}`]:it}),[it])}};return tt.scopeName=o.scopeName,tt}var useLayoutEffect2=globalThis!=null&&globalThis.document?reactExports.useLayoutEffect:()=>{},useReactId=React$1.useId||(()=>{}),count$1=0;function useId(et){const[o,tt]=reactExports.useState(useReactId());return useLayoutEffect2(()=>{et||tt(rt=>rt??String(count$1++))},[et]),et||(o?`radix-${o}`:"")}function useCallbackRef$1(et){const o=reactExports.useRef(et);return reactExports.useEffect(()=>{o.current=et}),reactExports.useMemo(()=>(...tt)=>{var rt;return(rt=o.current)==null?void 0:rt.call(o,...tt)},[])}function useControllableState({prop:et,defaultProp:o,onChange:tt=()=>{}}){const[rt,nt]=useUncontrolledState({defaultProp:o,onChange:tt}),ot=et!==void 0,it=ot?et:rt,st=useCallbackRef$1(tt),at=reactExports.useCallback(ct=>{if(ot){const dt=typeof ct=="function"?ct(et):ct;dt!==et&&st(dt)}else nt(ct)},[ot,et,nt,st]);return[it,at]}function useUncontrolledState({defaultProp:et,onChange:o}){const tt=reactExports.useState(et),[rt]=tt,nt=reactExports.useRef(rt),ot=useCallbackRef$1(o);return reactExports.useEffect(()=>{nt.current!==rt&&(ot(rt),nt.current=rt)},[rt,nt,ot]),tt}function useEscapeKeydown(et,o=globalThis==null?void 0:globalThis.document){const tt=useCallbackRef$1(et);reactExports.useEffect(()=>{const rt=nt=>{nt.key==="Escape"&&tt(nt)};return o.addEventListener("keydown",rt,{capture:!0}),()=>o.removeEventListener("keydown",rt,{capture:!0})},[tt,o])}var DISMISSABLE_LAYER_NAME="DismissableLayer",CONTEXT_UPDATE="dismissableLayer.update",POINTER_DOWN_OUTSIDE="dismissableLayer.pointerDownOutside",FOCUS_OUTSIDE="dismissableLayer.focusOutside",originalBodyPointerEvents,DismissableLayerContext=reactExports.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),DismissableLayer=reactExports.forwardRef((et,o)=>{const{disableOutsidePointerEvents:tt=!1,onEscapeKeyDown:rt,onPointerDownOutside:nt,onFocusOutside:ot,onInteractOutside:it,onDismiss:st,...at}=et,ct=reactExports.useContext(DismissableLayerContext),[lt,dt]=reactExports.useState(null),ht=(lt==null?void 0:lt.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,mt]=reactExports.useState({}),ft=useComposedRefs(o,St=>dt(St)),pt=Array.from(ct.layers),[yt]=[...ct.layersWithOutsidePointerEventsDisabled].slice(-1),gt=pt.indexOf(yt),bt=lt?pt.indexOf(lt):-1,xt=ct.layersWithOutsidePointerEventsDisabled.size>0,vt=bt>=gt,Et=usePointerDownOutside(St=>{const At=St.target,kt=[...ct.branches].some(It=>It.contains(At));!vt||kt||(nt==null||nt(St),it==null||it(St),St.defaultPrevented||st==null||st())},ht),Ct=useFocusOutside(St=>{const At=St.target;[...ct.branches].some(It=>It.contains(At))||(ot==null||ot(St),it==null||it(St),St.defaultPrevented||st==null||st())},ht);return useEscapeKeydown(St=>{bt===ct.layers.size-1&&(rt==null||rt(St),!St.defaultPrevented&&st&&(St.preventDefault(),st()))},ht),reactExports.useEffect(()=>{if(lt)return tt&&(ct.layersWithOutsidePointerEventsDisabled.size===0&&(originalBodyPointerEvents=ht.body.style.pointerEvents,ht.body.style.pointerEvents="none"),ct.layersWithOutsidePointerEventsDisabled.add(lt)),ct.layers.add(lt),dispatchUpdate(),()=>{tt&&ct.layersWithOutsidePointerEventsDisabled.size===1&&(ht.body.style.pointerEvents=originalBodyPointerEvents)}},[lt,ht,tt,ct]),reactExports.useEffect(()=>()=>{lt&&(ct.layers.delete(lt),ct.layersWithOutsidePointerEventsDisabled.delete(lt),dispatchUpdate())},[lt,ct]),reactExports.useEffect(()=>{const St=()=>mt({});return document.addEventListener(CONTEXT_UPDATE,St),()=>document.removeEventListener(CONTEXT_UPDATE,St)},[]),jsxRuntimeExports.jsx(Primitive.div,{...at,ref:ft,style:{pointerEvents:xt?vt?"auto":"none":void 0,...et.style},onFocusCapture:composeEventHandlers(et.onFocusCapture,Ct.onFocusCapture),onBlurCapture:composeEventHandlers(et.onBlurCapture,Ct.onBlurCapture),onPointerDownCapture:composeEventHandlers(et.onPointerDownCapture,Et.onPointerDownCapture)})});DismissableLayer.displayName=DISMISSABLE_LAYER_NAME;var BRANCH_NAME="DismissableLayerBranch",DismissableLayerBranch=reactExports.forwardRef((et,o)=>{const tt=reactExports.useContext(DismissableLayerContext),rt=reactExports.useRef(null),nt=useComposedRefs(o,rt);return reactExports.useEffect(()=>{const ot=rt.current;if(ot)return tt.branches.add(ot),()=>{tt.branches.delete(ot)}},[tt.branches]),jsxRuntimeExports.jsx(Primitive.div,{...et,ref:nt})});DismissableLayerBranch.displayName=BRANCH_NAME;function usePointerDownOutside(et,o=globalThis==null?void 0:globalThis.document){const tt=useCallbackRef$1(et),rt=reactExports.useRef(!1),nt=reactExports.useRef(()=>{});return reactExports.useEffect(()=>{const ot=st=>{if(st.target&&!rt.current){let at=function(){handleAndDispatchCustomEvent(POINTER_DOWN_OUTSIDE,tt,ct,{discrete:!0})};const ct={originalEvent:st};st.pointerType==="touch"?(o.removeEventListener("click",nt.current),nt.current=at,o.addEventListener("click",nt.current,{once:!0})):at()}else o.removeEventListener("click",nt.current);rt.current=!1},it=window.setTimeout(()=>{o.addEventListener("pointerdown",ot)},0);return()=>{window.clearTimeout(it),o.removeEventListener("pointerdown",ot),o.removeEventListener("click",nt.current)}},[o,tt]),{onPointerDownCapture:()=>rt.current=!0}}function useFocusOutside(et,o=globalThis==null?void 0:globalThis.document){const tt=useCallbackRef$1(et),rt=reactExports.useRef(!1);return reactExports.useEffect(()=>{const nt=ot=>{ot.target&&!rt.current&&handleAndDispatchCustomEvent(FOCUS_OUTSIDE,tt,{originalEvent:ot},{discrete:!1})};return o.addEventListener("focusin",nt),()=>o.removeEventListener("focusin",nt)},[o,tt]),{onFocusCapture:()=>rt.current=!0,onBlurCapture:()=>rt.current=!1}}function dispatchUpdate(){const et=new CustomEvent(CONTEXT_UPDATE);document.dispatchEvent(et)}function handleAndDispatchCustomEvent(et,o,tt,{discrete:rt}){const nt=tt.originalEvent.target,ot=new CustomEvent(et,{bubbles:!1,cancelable:!0,detail:tt});o&&nt.addEventListener(et,o,{once:!0}),rt?dispatchDiscreteCustomEvent(nt,ot):nt.dispatchEvent(ot)}var AUTOFOCUS_ON_MOUNT="focusScope.autoFocusOnMount",AUTOFOCUS_ON_UNMOUNT="focusScope.autoFocusOnUnmount",EVENT_OPTIONS={bubbles:!1,cancelable:!0},FOCUS_SCOPE_NAME="FocusScope",FocusScope=reactExports.forwardRef((et,o)=>{const{loop:tt=!1,trapped:rt=!1,onMountAutoFocus:nt,onUnmountAutoFocus:ot,...it}=et,[st,at]=reactExports.useState(null),ct=useCallbackRef$1(nt),lt=useCallbackRef$1(ot),dt=reactExports.useRef(null),ht=useComposedRefs(o,pt=>at(pt)),mt=reactExports.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;reactExports.useEffect(()=>{if(rt){let pt=function(xt){if(mt.paused||!st)return;const vt=xt.target;st.contains(vt)?dt.current=vt:focus(dt.current,{select:!0})},yt=function(xt){if(mt.paused||!st)return;const vt=xt.relatedTarget;vt!==null&&(st.contains(vt)||focus(dt.current,{select:!0}))},gt=function(xt){if(document.activeElement===document.body)for(const Et of xt)Et.removedNodes.length>0&&focus(st)};document.addEventListener("focusin",pt),document.addEventListener("focusout",yt);const bt=new MutationObserver(gt);return st&&bt.observe(st,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",pt),document.removeEventListener("focusout",yt),bt.disconnect()}}},[rt,st,mt.paused]),reactExports.useEffect(()=>{if(st){focusScopesStack.add(mt);const pt=document.activeElement;if(!st.contains(pt)){const gt=new CustomEvent(AUTOFOCUS_ON_MOUNT,EVENT_OPTIONS);st.addEventListener(AUTOFOCUS_ON_MOUNT,ct),st.dispatchEvent(gt),gt.defaultPrevented||(focusFirst(removeLinks(getTabbableCandidates(st)),{select:!0}),document.activeElement===pt&&focus(st))}return()=>{st.removeEventListener(AUTOFOCUS_ON_MOUNT,ct),setTimeout(()=>{const gt=new CustomEvent(AUTOFOCUS_ON_UNMOUNT,EVENT_OPTIONS);st.addEventListener(AUTOFOCUS_ON_UNMOUNT,lt),st.dispatchEvent(gt),gt.defaultPrevented||focus(pt??document.body,{select:!0}),st.removeEventListener(AUTOFOCUS_ON_UNMOUNT,lt),focusScopesStack.remove(mt)},0)}}},[st,ct,lt,mt]);const ft=reactExports.useCallback(pt=>{if(!tt&&!rt||mt.paused)return;const yt=pt.key==="Tab"&&!pt.altKey&&!pt.ctrlKey&&!pt.metaKey,gt=document.activeElement;if(yt&&gt){const bt=pt.currentTarget,[xt,vt]=getTabbableEdges(bt);xt&&vt?!pt.shiftKey&&gt===vt?(pt.preventDefault(),tt&&focus(xt,{select:!0})):pt.shiftKey&&gt===xt&&(pt.preventDefault(),tt&&focus(vt,{select:!0})):gt===bt&&pt.preventDefault()}},[tt,rt,mt.paused]);return jsxRuntimeExports.jsx(Primitive.div,{tabIndex:-1,...it,ref:ht,onKeyDown:ft})});FocusScope.displayName=FOCUS_SCOPE_NAME;function focusFirst(et,{select:o=!1}={}){const tt=document.activeElement;for(const rt of et)if(focus(rt,{select:o}),document.activeElement!==tt)return}function getTabbableEdges(et){const o=getTabbableCandidates(et),tt=findVisible(o,et),rt=findVisible(o.reverse(),et);return[tt,rt]}function getTabbableCandidates(et){const o=[],tt=document.createTreeWalker(et,NodeFilter.SHOW_ELEMENT,{acceptNode:rt=>{const nt=rt.tagName==="INPUT"&&rt.type==="hidden";return rt.disabled||rt.hidden||nt?NodeFilter.FILTER_SKIP:rt.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;tt.nextNode();)o.push(tt.currentNode);return o}function findVisible(et,o){for(const tt of et)if(!isHidden(tt,{upTo:o}))return tt}function isHidden(et,{upTo:o}){if(getComputedStyle(et).visibility==="hidden")return!0;for(;et;){if(o!==void 0&&et===o)return!1;if(getComputedStyle(et).display==="none")return!0;et=et.parentElement}return!1}function isSelectableInput(et){return et instanceof HTMLInputElement&&"select"in et}function focus(et,{select:o=!1}={}){if(et&&et.focus){const tt=document.activeElement;et.focus({preventScroll:!0}),et!==tt&&isSelectableInput(et)&&o&&et.select()}}var focusScopesStack=createFocusScopesStack();function createFocusScopesStack(){let et=[];return{add(o){const tt=et[0];o!==tt&&(tt==null||tt.pause()),et=arrayRemove(et,o),et.unshift(o)},remove(o){var tt;et=arrayRemove(et,o),(tt=et[0])==null||tt.resume()}}}function arrayRemove(et,o){const tt=[...et],rt=tt.indexOf(o);return rt!==-1&&tt.splice(rt,1),tt}function removeLinks(et){return et.filter(o=>o.tagName!=="A")}function useStateMachine$1(et,o){return reactExports.useReducer((tt,rt)=>o[tt][rt]??tt,et)}var Presence=et=>{const{present:o,children:tt}=et,rt=usePresence(o),nt=typeof tt=="function"?tt({present:rt.isPresent}):reactExports.Children.only(tt),ot=useComposedRefs(rt.ref,getElementRef(nt));return typeof tt=="function"||rt.isPresent?reactExports.cloneElement(nt,{ref:ot}):null};Presence.displayName="Presence";function usePresence(et){const[o,tt]=reactExports.useState(),rt=reactExports.useRef({}),nt=reactExports.useRef(et),ot=reactExports.useRef("none"),it=et?"mounted":"unmounted",[st,at]=useStateMachine$1(it,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return reactExports.useEffect(()=>{const ct=getAnimationName(rt.current);ot.current=st==="mounted"?ct:"none"},[st]),useLayoutEffect2(()=>{const ct=rt.current,lt=nt.current;if(lt!==et){const ht=ot.current,mt=getAnimationName(ct);et?at("MOUNT"):mt==="none"||(ct==null?void 0:ct.display)==="none"?at("UNMOUNT"):at(lt&&ht!==mt?"ANIMATION_OUT":"UNMOUNT"),nt.current=et}},[et,at]),useLayoutEffect2(()=>{if(o){let ct;const lt=o.ownerDocument.defaultView??window,dt=mt=>{const pt=getAnimationName(rt.current).includes(mt.animationName);if(mt.target===o&&pt&&(at("ANIMATION_END"),!nt.current)){const yt=o.style.animationFillMode;o.style.animationFillMode="forwards",ct=lt.setTimeout(()=>{o.style.animationFillMode==="forwards"&&(o.style.animationFillMode=yt)})}},ht=mt=>{mt.target===o&&(ot.current=getAnimationName(rt.current))};return o.addEventListener("animationstart",ht),o.addEventListener("animationcancel",dt),o.addEventListener("animationend",dt),()=>{lt.clearTimeout(ct),o.removeEventListener("animationstart",ht),o.removeEventListener("animationcancel",dt),o.removeEventListener("animationend",dt)}}else at("ANIMATION_END")},[o,at]),{isPresent:["mounted","unmountSuspended"].includes(st),ref:reactExports.useCallback(ct=>{ct&&(rt.current=getComputedStyle(ct)),tt(ct)},[])}}function getAnimationName(et){return(et==null?void 0:et.animationName)||"none"}function getElementRef(et){var rt,nt;let o=(rt=Object.getOwnPropertyDescriptor(et.props,"ref"))==null?void 0:rt.get,tt=o&&"isReactWarning"in o&&o.isReactWarning;return tt?et.ref:(o=(nt=Object.getOwnPropertyDescriptor(et,"ref"))==null?void 0:nt.get,tt=o&&"isReactWarning"in o&&o.isReactWarning,tt?et.props.ref:et.props.ref||et.ref)}var count=0;function useFocusGuards(){reactExports.useEffect(()=>{const et=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",et[0]??createFocusGuard()),document.body.insertAdjacentElement("beforeend",et[1]??createFocusGuard()),count++,()=>{count===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(o=>o.remove()),count--}},[])}function createFocusGuard(){const et=document.createElement("span");return et.setAttribute("data-radix-focus-guard",""),et.tabIndex=0,et.style.outline="none",et.style.opacity="0",et.style.position="fixed",et.style.pointerEvents="none",et}var zeroRightClassName="right-scroll-bar-position",fullWidthClassName="width-before-scroll-bar",noScrollbarsClassName="with-scroll-bars-hidden",removedBarSizeVariable="--removed-body-scroll-bar-size";function assignRef(et,o){return typeof et=="function"?et(o):et&&(et.current=o),et}function useCallbackRef(et,o){var tt=reactExports.useState(function(){return{value:et,callback:o,facade:{get current(){return tt.value},set current(rt){var nt=tt.value;nt!==rt&&(tt.value=rt,tt.callback(rt,nt))}}}})[0];return tt.callback=o,tt.facade}var useIsomorphicLayoutEffect=typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect,currentValues=new WeakMap;function useMergeRefs(et,o){var tt=useCallbackRef(null,function(rt){return et.forEach(function(nt){return assignRef(nt,rt)})});return useIsomorphicLayoutEffect(function(){var rt=currentValues.get(tt);if(rt){var nt=new Set(rt),ot=new Set(et),it=tt.current;nt.forEach(function(st){ot.has(st)||assignRef(st,null)}),ot.forEach(function(st){nt.has(st)||assignRef(st,it)})}currentValues.set(tt,et)},[et]),tt}function ItoI(et){return et}function innerCreateMedium(et,o){o===void 0&&(o=ItoI);var tt=[],rt=!1,nt={read:function(){if(rt)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return tt.length?tt[tt.length-1]:et},useMedium:function(ot){var it=o(ot,rt);return tt.push(it),function(){tt=tt.filter(function(st){return st!==it})}},assignSyncMedium:function(ot){for(rt=!0;tt.length;){var it=tt;tt=[],it.forEach(ot)}tt={push:function(st){return ot(st)},filter:function(){return tt}}},assignMedium:function(ot){rt=!0;var it=[];if(tt.length){var st=tt;tt=[],st.forEach(ot),it=tt}var at=function(){var lt=it;it=[],lt.forEach(ot)},ct=function(){return Promise.resolve().then(at)};ct(),tt={push:function(lt){it.push(lt),ct()},filter:function(lt){return it=it.filter(lt),tt}}}};return nt}function createSidecarMedium(et){et===void 0&&(et={});var o=innerCreateMedium(null);return o.options=__assign({async:!0,ssr:!1},et),o}var SideCar$1=function(et){var o=et.sideCar,tt=__rest(et,["sideCar"]);if(!o)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var rt=o.read();if(!rt)throw new Error("Sidecar medium not found");return reactExports.createElement(rt,__assign({},tt))};SideCar$1.isSideCarExport=!0;function exportSidecar(et,o){return et.useMedium(o),SideCar$1}var effectCar=createSidecarMedium(),nothing=function(){},RemoveScroll=reactExports.forwardRef(function(et,o){var tt=reactExports.useRef(null),rt=reactExports.useState({onScrollCapture:nothing,onWheelCapture:nothing,onTouchMoveCapture:nothing}),nt=rt[0],ot=rt[1],it=et.forwardProps,st=et.children,at=et.className,ct=et.removeScrollBar,lt=et.enabled,dt=et.shards,ht=et.sideCar,mt=et.noIsolation,ft=et.inert,pt=et.allowPinchZoom,yt=et.as,gt=yt===void 0?"div":yt,bt=et.gapMode,xt=__rest(et,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),vt=ht,Et=useMergeRefs([tt,o]),Ct=__assign(__assign({},xt),nt);return reactExports.createElement(reactExports.Fragment,null,lt&&reactExports.createElement(vt,{sideCar:effectCar,removeScrollBar:ct,shards:dt,noIsolation:mt,inert:ft,setCallbacks:ot,allowPinchZoom:!!pt,lockRef:tt,gapMode:bt}),it?reactExports.cloneElement(reactExports.Children.only(st),__assign(__assign({},Ct),{ref:Et})):reactExports.createElement(gt,__assign({},Ct,{className:at,ref:Et}),st))});RemoveScroll.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};RemoveScroll.classNames={fullWidth:fullWidthClassName,zeroRight:zeroRightClassName};var getNonce=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function makeStyleTag(){if(!document)return null;var et=document.createElement("style");et.type="text/css";var o=getNonce();return o&&et.setAttribute("nonce",o),et}function injectStyles(et,o){et.styleSheet?et.styleSheet.cssText=o:et.appendChild(document.createTextNode(o))}function insertStyleTag(et){var o=document.head||document.getElementsByTagName("head")[0];o.appendChild(et)}var stylesheetSingleton=function(){var et=0,o=null;return{add:function(tt){et==0&&(o=makeStyleTag())&&(injectStyles(o,tt),insertStyleTag(o)),et++},remove:function(){et--,!et&&o&&(o.parentNode&&o.parentNode.removeChild(o),o=null)}}},styleHookSingleton=function(){var et=stylesheetSingleton();return function(o,tt){reactExports.useEffect(function(){return et.add(o),function(){et.remove()}},[o&&tt])}},styleSingleton=function(){var et=styleHookSingleton(),o=function(tt){var rt=tt.styles,nt=tt.dynamic;return et(rt,nt),null};return o},zeroGap={left:0,top:0,right:0,gap:0},parse$2=function(et){return parseInt(et||"",10)||0},getOffset=function(et){var o=window.getComputedStyle(document.body),tt=o[et==="padding"?"paddingLeft":"marginLeft"],rt=o[et==="padding"?"paddingTop":"marginTop"],nt=o[et==="padding"?"paddingRight":"marginRight"];return[parse$2(tt),parse$2(rt),parse$2(nt)]},getGapWidth=function(et){if(et===void 0&&(et="margin"),typeof window>"u")return zeroGap;var o=getOffset(et),tt=document.documentElement.clientWidth,rt=window.innerWidth;return{left:o[0],top:o[1],right:o[2],gap:Math.max(0,rt-tt+o[2]-o[0])}},Style=styleSingleton(),lockAttribute="data-scroll-locked",getStyles=function(et,o,tt,rt){var nt=et.left,ot=et.top,it=et.right,st=et.gap;return tt===void 0&&(tt="margin"),`
.`.concat(noScrollbarsClassName,` {
overflow: hidden `).concat(rt,`;
padding-right: `).concat(st,"px ").concat(rt,`;
}
body[`).concat(lockAttribute,`] {
overflow: hidden `).concat(rt,`;
overscroll-behavior: contain;
`).concat([o&&"position: relative ".concat(rt,";"),tt==="margin"&&`
padding-left: `.concat(nt,`px;
padding-top: `).concat(ot,`px;
padding-right: `).concat(it,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(st,"px ").concat(rt,`;
`),tt==="padding"&&"padding-right: ".concat(st,"px ").concat(rt,";")].filter(Boolean).join(""),`
}
.`).concat(zeroRightClassName,` {
right: `).concat(st,"px ").concat(rt,`;
}
.`).concat(fullWidthClassName,` {
margin-right: `).concat(st,"px ").concat(rt,`;
}
.`).concat(zeroRightClassName," .").concat(zeroRightClassName,` {
right: 0 `).concat(rt,`;
}
.`).concat(fullWidthClassName," .").concat(fullWidthClassName,` {
margin-right: 0 `).concat(rt,`;
}
body[`).concat(lockAttribute,`] {
`).concat(removedBarSizeVariable,": ").concat(st,`px;
}
`)},getCurrentUseCounter=function(){var et=parseInt(document.body.getAttribute(lockAttribute)||"0",10);return isFinite(et)?et:0},useLockAttribute=function(){reactExports.useEffect(function(){return document.body.setAttribute(lockAttribute,(getCurrentUseCounter()+1).toString()),function(){var et=getCurrentUseCounter()-1;et<=0?document.body.removeAttribute(lockAttribute):document.body.setAttribute(lockAttribute,et.toString())}},[])},RemoveScrollBar=function(et){var o=et.noRelative,tt=et.noImportant,rt=et.gapMode,nt=rt===void 0?"margin":rt;useLockAttribute();var ot=reactExports.useMemo(function(){return getGapWidth(nt)},[nt]);return reactExports.createElement(Style,{styles:getStyles(ot,!o,nt,tt?"":"!important")})},passiveSupported=!1;if(typeof window<"u")try{var options=Object.defineProperty({},"passive",{get:function(){return passiveSupported=!0,!0}});window.addEventListener("test",options,options),window.removeEventListener("test",options,options)}catch{passiveSupported=!1}var nonPassive=passiveSupported?{passive:!1}:!1,alwaysContainsScroll=function(et){return et.tagName==="TEXTAREA"},elementCanBeScrolled=function(et,o){if(!(et instanceof Element))return!1;var tt=window.getComputedStyle(et);return tt[o]!=="hidden"&&!(tt.overflowY===tt.overflowX&&!alwaysContainsScroll(et)&&tt[o]==="visible")},elementCouldBeVScrolled=function(et){return elementCanBeScrolled(et,"overflowY")},elementCouldBeHScrolled=function(et){return elementCanBeScrolled(et,"overflowX")},locationCouldBeScrolled=function(et,o){var tt=o.ownerDocument,rt=o;do{typeof ShadowRoot<"u"&&rt instanceof ShadowRoot&&(rt=rt.host);var nt=elementCouldBeScrolled(et,rt);if(nt){var ot=getScrollVariables(et,rt),it=ot[1],st=ot[2];if(it>st)return!0}rt=rt.parentNode}while(rt&&rt!==tt.body);return!1},getVScrollVariables=function(et){var o=et.scrollTop,tt=et.scrollHeight,rt=et.clientHeight;return[o,tt,rt]},getHScrollVariables=function(et){var o=et.scrollLeft,tt=et.scrollWidth,rt=et.clientWidth;return[o,tt,rt]},elementCouldBeScrolled=function(et,o){return et==="v"?elementCouldBeVScrolled(o):elementCouldBeHScrolled(o)},getScrollVariables=function(et,o){return et==="v"?getVScrollVariables(o):getHScrollVariables(o)},getDirectionFactor=function(et,o){return et==="h"&&o==="rtl"?-1:1},handleScroll=function(et,o,tt,rt,nt){var ot=getDirectionFactor(et,window.getComputedStyle(o).direction),it=ot*rt,st=tt.target,at=o.contains(st),ct=!1,lt=it>0,dt=0,ht=0;do{var mt=getScrollVariables(et,st),ft=mt[0],pt=mt[1],yt=mt[2],gt=pt-yt-ot*ft;(ft||gt)&&elementCouldBeScrolled(et,st)&&(dt+=gt,ht+=ft),st instanceof ShadowRoot?st=st.host:st=st.parentNode}while(!at&&st!==document.body||at&&(o.contains(st)||o===st));return(lt&&(Math.abs(dt)<1||!nt)||!lt&&(Math.abs(ht)<1||!nt))&&(ct=!0),ct},getTouchXY=function(et){return"changedTouches"in et?[et.changedTouches[0].clientX,et.changedTouches[0].clientY]:[0,0]},getDeltaXY=function(et){return[et.deltaX,et.deltaY]},extractRef=function(et){return et&&"current"in et?et.current:et},deltaCompare=function(et,o){return et[0]===o[0]&&et[1]===o[1]},generateStyle=function(et){return`
.block-interactivity-`.concat(et,` {pointer-events: none;}
.allow-interactivity-`).concat(et,` {pointer-events: all;}
`)},idCounter=0,lockStack=[];function RemoveScrollSideCar(et){var o=reactExports.useRef([]),tt=reactExports.useRef([0,0]),rt=reactExports.useRef(),nt=reactExports.useState(idCounter++)[0],ot=reactExports.useState(styleSingleton)[0],it=reactExports.useRef(et);reactExports.useEffect(function(){it.current=et},[et]),reactExports.useEffect(function(){if(et.inert){document.body.classList.add("block-interactivity-".concat(nt));var pt=__spreadArray([et.lockRef.current],(et.shards||[]).map(extractRef),!0).filter(Boolean);return pt.forEach(function(yt){return yt.classList.add("allow-interactivity-".concat(nt))}),function(){document.body.classList.remove("block-interactivity-".concat(nt)),pt.forEach(function(yt){return yt.classList.remove("allow-interactivity-".concat(nt))})}}},[et.inert,et.lockRef.current,et.shards]);var st=reactExports.useCallback(function(pt,yt){if("touches"in pt&&pt.touches.length===2||pt.type==="wheel"&&pt.ctrlKey)return!it.current.allowPinchZoom;var gt=getTouchXY(pt),bt=tt.current,xt="deltaX"in pt?pt.deltaX:bt[0]-gt[0],vt="deltaY"in pt?pt.deltaY:bt[1]-gt[1],Et,Ct=pt.target,St=Math.abs(xt)>Math.abs(vt)?"h":"v";if("touches"in pt&&St==="h"&&Ct.type==="range")return!1;var At=locationCouldBeScrolled(St,Ct);if(!At)return!0;if(At?Et=St:(Et=St==="v"?"h":"v",At=locationCouldBeScrolled(St,Ct)),!At)return!1;if(!rt.current&&"changedTouches"in pt&&(xt||vt)&&(rt.current=Et),!Et)return!0;var kt=rt.current||Et;return handleScroll(kt,yt,pt,kt==="h"?xt:vt,!0)},[]),at=reactExports.useCallback(function(pt){var yt=pt;if(!(!lockStack.length||lockStack[lockStack.length-1]!==ot)){var gt="deltaY"in yt?getDeltaXY(yt):getTouchXY(yt),bt=o.current.filter(function(Et){return Et.name===yt.type&&(Et.target===yt.target||yt.target===Et.shadowParent)&&deltaCompare(Et.delta,gt)})[0];if(bt&&bt.should){yt.cancelable&&yt.preventDefault();return}if(!bt){var xt=(it.current.shards||[]).map(extractRef).filter(Boolean).filter(function(Et){return Et.contains(yt.target)}),vt=xt.length>0?st(yt,xt[0]):!it.current.noIsolation;vt&&yt.cancelable&&yt.preventDefault()}}},[]),ct=reactExports.useCallback(function(pt,yt,gt,bt){var xt={name:pt,delta:yt,target:gt,should:bt,shadowParent:getOutermostShadowParent(gt)};o.current.push(xt),setTimeout(function(){o.current=o.current.filter(function(vt){return vt!==xt})},1)},[]),lt=reactExports.useCallback(function(pt){tt.current=getTouchXY(pt),rt.current=void 0},[]),dt=reactExports.useCallback(function(pt){ct(pt.type,getDeltaXY(pt),pt.target,st(pt,et.lockRef.current))},[]),ht=reactExports.useCallback(function(pt){ct(pt.type,getTouchXY(pt),pt.target,st(pt,et.lockRef.current))},[]);reactExports.useEffect(function(){return lockStack.push(ot),et.setCallbacks({onScrollCapture:dt,onWheelCapture:dt,onTouchMoveCapture:ht}),document.addEventListener("wheel",at,nonPassive),document.addEventListener("touchmove",at,nonPassive),document.addEventListener("touchstart",lt,nonPassive),function(){lockStack=lockStack.filter(function(pt){return pt!==ot}),document.removeEventListener("wheel",at,nonPassive),document.removeEventListener("touchmove",at,nonPassive),document.removeEventListener("touchstart",lt,nonPassive)}},[]);var mt=et.removeScrollBar,ft=et.inert;return reactExports.createElement(reactExports.Fragment,null,ft?reactExports.createElement(ot,{styles:generateStyle(nt)}):null,mt?reactExports.createElement(RemoveScrollBar,{gapMode:et.gapMode}):null)}function getOutermostShadowParent(et){for(var o=null;et!==null;)et instanceof ShadowRoot&&(o=et.host,et=et.host),et=et.parentNode;return o}const SideCar=exportSidecar(effectCar,RemoveScrollSideCar);var ReactRemoveScroll=reactExports.forwardRef(function(et,o){return reactExports.createElement(RemoveScroll,__assign({},et,{ref:o,sideCar:SideCar}))});ReactRemoveScroll.classNames=RemoveScroll.classNames;var getDefaultParent=function(et){if(typeof document>"u")return null;var o=Array.isArray(et)?et[0]:et;return o.ownerDocument.body},counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={},lockCount=0,unwrapHost=function(et){return et&&(et.host||unwrapHost(et.parentNode))},correctTargets=function(et,o){return o.map(function(tt){if(et.contains(tt))return tt;var rt=unwrapHost(tt);return rt&&et.contains(rt)?rt:(console.error("aria-hidden",tt,"in not contained inside",et,". Doing nothing"),null)}).filter(function(tt){return!!tt})},applyAttributeToOthers=function(et,o,tt,rt){var nt=correctTargets(o,Array.isArray(et)?et:[et]);markerMap[tt]||(markerMap[tt]=new WeakMap);var ot=markerMap[tt],it=[],st=new Set,at=new Set(nt),ct=function(dt){!dt||st.has(dt)||(st.add(dt),ct(dt.parentNode))};nt.forEach(ct);var lt=function(dt){!dt||at.has(dt)||Array.prototype.forEach.call(dt.children,function(ht){if(st.has(ht))lt(ht);else try{var mt=ht.getAttribute(rt),ft=mt!==null&&mt!=="false",pt=(counterMap.get(ht)||0)+1,yt=(ot.get(ht)||0)+1;counterMap.set(ht,pt),ot.set(ht,yt),it.push(ht),pt===1&&ft&&uncontrolledNodes.set(ht,!0),yt===1&&ht.setAttribute(tt,"true"),ft||ht.setAttribute(rt,"true")}catch(gt){console.error("aria-hidden: cannot operate on ",ht,gt)}})};return lt(o),st.clear(),lockCount++,function(){it.forEach(function(dt){var ht=counterMap.get(dt)-1,mt=ot.get(dt)-1;counterMap.set(dt,ht),ot.set(dt,mt),ht||(uncontrolledNodes.has(dt)||dt.removeAttribute(rt),uncontrolledNodes.delete(dt)),mt||dt.removeAttribute(tt)}),lockCount--,lockCount||(counterMap=new WeakMap,counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={})}},hideOthers=function(et,o,tt){tt===void 0&&(tt="data-aria-hidden");var rt=Array.from(Array.isArray(et)?et:[et]),nt=getDefaultParent(et);return nt?(rt.push.apply(rt,Array.from(nt.querySelectorAll("[aria-live]"))),applyAttributeToOthers(rt,nt,tt,"aria-hidden")):function(){return null}},DIALOG_NAME="Dialog",[createDialogContext,createDialogScope]=createContextScope(DIALOG_NAME),[DialogProvider,useDialogContext]=createDialogContext(DIALOG_NAME),Dialog$1=et=>{const{__scopeDialog:o,children:tt,open:rt,defaultOpen:nt,onOpenChange:ot,modal:it=!0}=et,st=reactExports.useRef(null),at=reactExports.useRef(null),[ct=!1,lt]=useControllableState({prop:rt,defaultProp:nt,onChange:ot});return jsxRuntimeExports.jsx(DialogProvider,{scope:o,triggerRef:st,contentRef:at,contentId:useId(),titleId:useId(),descriptionId:useId(),open:ct,onOpenChange:lt,onOpenToggle:reactExports.useCallback(()=>lt(dt=>!dt),[lt]),modal:it,children:tt})};Dialog$1.displayName=DIALOG_NAME;var TRIGGER_NAME="DialogTrigger",DialogTrigger$1=reactExports.forwardRef((et,o)=>{const{__scopeDialog:tt,...rt}=et,nt=useDialogContext(TRIGGER_NAME,tt),ot=useComposedRefs(o,nt.triggerRef);return jsxRuntimeExports.jsx(Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":nt.open,"aria-controls":nt.contentId,"data-state":getState(nt.open),...rt,ref:ot,onClick:composeEventHandlers(et.onClick,nt.onOpenToggle)})});DialogTrigger$1.displayName=TRIGGER_NAME;var PORTAL_NAME="DialogPortal",[PortalProvider,usePortalContext]=createDialogContext(PORTAL_NAME,{forceMount:void 0}),OVERLAY_NAME="DialogOverlay",DialogOverlay$1=reactExports.forwardRef((et,o)=>{const tt=usePortalContext(OVERLAY_NAME,et.__scopeDialog),{forceMount:rt=tt.forceMount,...nt}=et,ot=useDialogContext(OVERLAY_NAME,et.__scopeDialog);return ot.modal?jsxRuntimeExports.jsx(Presence,{present:rt||ot.open,children:jsxRuntimeExports.jsx(DialogOverlayImpl,{...nt,ref:o})}):null});DialogOverlay$1.displayName=OVERLAY_NAME;var DialogOverlayImpl=reactExports.forwardRef((et,o)=>{const{__scopeDialog:tt,...rt}=et,nt=useDialogContext(OVERLAY_NAME,tt);return jsxRuntimeExports.jsx(ReactRemoveScroll,{as:Slot,allowPinchZoom:!0,shards:[nt.contentRef],children:jsxRuntimeExports.jsx(Primitive.div,{"data-state":getState(nt.open),...rt,ref:o,style:{pointerEvents:"auto",...rt.style}})})}),CONTENT_NAME="DialogContent",DialogContent$1=reactExports.forwardRef((et,o)=>{const tt=usePortalContext(CONTENT_NAME,et.__scopeDialog),{forceMount:rt=tt.forceMount,...nt}=et,ot=useDialogContext(CONTENT_NAME,et.__scopeDialog);return jsxRuntimeExports.jsx(Presence,{present:rt||ot.open,children:ot.modal?jsxRuntimeExports.jsx(DialogContentModal,{...nt,ref:o}):jsxRuntimeExports.jsx(DialogContentNonModal,{...nt,ref:o})})});DialogContent$1.displayName=CONTENT_NAME;var DialogContentModal=reactExports.forwardRef((et,o)=>{const tt=useDialogContext(CONTENT_NAME,et.__scopeDialog),rt=reactExports.useRef(null),nt=useComposedRefs(o,tt.contentRef,rt);return reactExports.useEffect(()=>{const ot=rt.current;if(ot)return hideOthers(ot)},[]),jsxRuntimeExports.jsx(DialogContentImpl,{...et,ref:nt,trapFocus:tt.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:composeEventHandlers(et.onCloseAutoFocus,ot=>{var it;ot.preventDefault(),(it=tt.triggerRef.current)==null||it.focus()}),onPointerDownOutside:composeEventHandlers(et.onPointerDownOutside,ot=>{const it=ot.detail.originalEvent,st=it.button===0&&it.ctrlKey===!0;(it.button===2||st)&&ot.preventDefault()}),onFocusOutside:composeEventHandlers(et.onFocusOutside,ot=>ot.preventDefault())})}),DialogContentNonModal=reactExports.forwardRef((et,o)=>{const tt=useDialogContext(CONTENT_NAME,et.__scopeDialog),rt=reactExports.useRef(!1),nt=reactExports.useRef(!1);return jsxRuntimeExports.jsx(DialogContentImpl,{...et,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:ot=>{var it,st;(it=et.onCloseAutoFocus)==null||it.call(et,ot),ot.defaultPrevented||(rt.current||(st=tt.triggerRef.current)==null||st.focus(),ot.preventDefault()),rt.current=!1,nt.current=!1},onInteractOutside:ot=>{var at,ct;(at=et.onInteractOutside)==null||at.call(et,ot),ot.defaultPrevented||(rt.current=!0,ot.detail.originalEvent.type==="pointerdown"&&(nt.current=!0));const it=ot.target;((ct=tt.triggerRef.current)==null?void 0:ct.contains(it))&&ot.preventDefault(),ot.detail.originalEvent.type==="focusin"&&nt.current&&ot.preventDefault()}})}),DialogContentImpl=reactExports.forwardRef((et,o)=>{const{__scopeDialog:tt,trapFocus:rt,onOpenAutoFocus:nt,onCloseAutoFocus:ot,...it}=et,st=useDialogContext(CONTENT_NAME,tt),at=reactExports.useRef(null),ct=useComposedRefs(o,at);return useFocusGuards(),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(FocusScope,{asChild:!0,loop:!0,trapped:rt,onMountAutoFocus:nt,onUnmountAutoFocus:ot,children:jsxRuntimeExports.jsx(DismissableLayer,{role:"dialog",id:st.contentId,"aria-describedby":st.descriptionId,"aria-labelledby":st.titleId,"data-state":getState(st.open),...it,ref:ct,onDismiss:()=>st.onOpenChange(!1)})}),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(TitleWarning,{titleId:st.titleId}),jsxRuntimeExports.jsx(DescriptionWarning,{contentRef:at,descriptionId:st.descriptionId})]})]})}),TITLE_NAME="DialogTitle",DialogTitle$1=reactExports.forwardRef((et,o)=>{const{__scopeDialog:tt,...rt}=et,nt=useDialogContext(TITLE_NAME,tt);return jsxRuntimeExports.jsx(Primitive.h2,{id:nt.titleId,...rt,ref:o})});DialogTitle$1.displayName=TITLE_NAME;var DESCRIPTION_NAME="DialogDescription",DialogDescription$1=reactExports.forwardRef((et,o)=>{const{__scopeDialog:tt,...rt}=et,nt=useDialogContext(DESCRIPTION_NAME,tt);return jsxRuntimeExports.jsx(Primitive.p,{id:nt.descriptionId,...rt,ref:o})});DialogDescription$1.displayName=DESCRIPTION_NAME;var CLOSE_NAME="DialogClose",DialogClose=reactExports.forwardRef((et,o)=>{const{__scopeDialog:tt,...rt}=et,nt=useDialogContext(CLOSE_NAME,tt);return jsxRuntimeExports.jsx(Primitive.button,{type:"button",...rt,ref:o,onClick:composeEventHandlers(et.onClick,()=>nt.onOpenChange(!1))})});DialogClose.displayName=CLOSE_NAME;function getState(et){return et?"open":"closed"}var TITLE_WARNING_NAME="DialogTitleWarning",[WarningProvider,useWarningContext]=createContext2(TITLE_WARNING_NAME,{contentName:CONTENT_NAME,titleName:TITLE_NAME,docsSlug:"dialog"}),TitleWarning=({titleId:et})=>{const o=useWarningContext(TITLE_WARNING_NAME),tt=`\`${o.contentName}\` requires a \`${o.titleName}\` for the component to be accessible for screen reader users.
If you want to hide the \`${o.titleName}\`, you can wrap it with our VisuallyHidden component.
For more information, see https://radix-ui.com/primitives/docs/components/${o.docsSlug}`;return reactExports.useEffect(()=>{et&&(document.getElementById(et)||console.error(tt))},[tt,et]),null},DESCRIPTION_WARNING_NAME="DialogDescriptionWarning",DescriptionWarning=({contentRef:et,descriptionId:o})=>{const rt=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${useWarningContext(DESCRIPTION_WARNING_NAME).contentName}}.`;return reactExports.useEffect(()=>{var ot;const nt=(ot=et.current)==null?void 0:ot.getAttribute("aria-describedby");o&&nt&&(document.getElementById(o)||console.warn(rt))},[rt,et,o]),null},Root$2=Dialog$1,Trigger=DialogTrigger$1,Overlay=DialogOverlay$1,Content=DialogContent$1,Title=DialogTitle$1,Description=DialogDescription$1;const Dialog=Root$2,DialogTrigger=Trigger,DialogOverlay=reactExports.forwardRef(({className:et,...o},tt)=>jsxRuntimeExports.jsx(Overlay,{ref:tt,className:cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",et),...o}));DialogOverlay.displayName=Overlay.displayName;const DialogContent=reactExports.forwardRef(({className:et,...o},tt)=>jsxRuntimeExports.jsx(Content,{ref:tt,className:cn("fixed z-50 grid w-full gap-4 rounded-b-lg border bg-background p-6 shadow-lg animate-in data-[state=open]:fade-in-90 data-[state=open]:slide-in-from-bottom-10 sm:max-w-lg sm:rounded-lg sm:zoom-in-90 data-[state=open]:sm:slide-in-from-bottom-0","max-h-[85vh] overflow-y-auto",et),...o}));DialogContent.displayName=Content.displayName;const DialogHeader=({className:et,...o})=>jsxRuntimeExports.jsx("div",{className:cn("flex flex-col space-y-1.5 text-center sm:text-left",et),...o});DialogHeader.displayName="DialogHeader";const DialogFooter=({className:et,...o})=>jsxRuntimeExports.jsx("div",{className:cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",et),...o});DialogFooter.displayName="DialogFooter";const DialogTitle=reactExports.forwardRef(({className:et,...o},tt)=>jsxRuntimeExports.jsx(Title,{ref:tt,className:cn("text-lg font-semibold leading-none tracking-tight",et),...o}));DialogTitle.displayName=Title.displayName;const DialogDescription=reactExports.forwardRef(({className:et,...o},tt)=>jsxRuntimeExports.jsx(Description,{ref:tt,className:cn("text-sm text-muted-foreground",et),...o}));DialogDescription.displayName=Description.displayName;var __defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(et,o,tt)=>o in et?__defProp(et,o,{enumerable:!0,configurable:!0,writable:!0,value:tt}):et[o]=tt,__spreadValues=(et,o)=>{for(var tt in o||(o={}))__hasOwnProp.call(o,tt)&&__defNormalProp(et,tt,o[tt]);if(__getOwnPropSymbols)for(var tt of __getOwnPropSymbols(o))__propIsEnum.call(o,tt)&&__defNormalProp(et,tt,o[tt]);return et},__objRest=(et,o)=>{var tt={};for(var rt in et)__hasOwnProp.call(et,rt)&&o.indexOf(rt)<0&&(tt[rt]=et[rt]);if(et!=null&&__getOwnPropSymbols)for(var rt of __getOwnPropSymbols(et))o.indexOf(rt)<0&&__propIsEnum.call(et,rt)&&(tt[rt]=et[rt]);return tt};/**
* @license QR Code generator library (TypeScript)
* Copyright (c) Project Nayuki.
* SPDX-License-Identifier: MIT
*/var qrcodegen;(et=>{const o=class Er{constructor(at,ct,lt,dt){if(this.version=at,this.errorCorrectionLevel=ct,this.modules=[],this.isFunction=[],at<Er.MIN_VERSION||at>Er.MAX_VERSION)throw new RangeError("Version value out of range");if(dt<-1||dt>7)throw new RangeError("Mask value out of range");this.size=at*4+17;let ht=[];for(let ft=0;ft<this.size;ft++)ht.push(!1);for(let ft=0;ft<this.size;ft++)this.modules.push(ht.slice()),this.isFunction.push(ht.slice());this.drawFunctionPatterns();const mt=this.addEccAndInterleave(lt);if(this.drawCodewords(mt),dt==-1){let ft=1e9;for(let pt=0;pt<8;pt++){this.applyMask(pt),this.drawFormatBits(pt);const yt=this.getPenaltyScore();yt<ft&&(dt=pt,ft=yt),this.applyMask(pt)}}nt(0<=dt&&dt<=7),this.mask=dt,this.applyMask(dt),this.drawFormatBits(dt),this.isFunction=[]}static encodeText(at,ct){const lt=et.QrSegment.makeSegments(at);return Er.encodeSegments(lt,ct)}static encodeBinary(at,ct){const lt=et.QrSegment.makeBytes(at);return Er.encodeSegments([lt],ct)}static encodeSegments(at,ct,lt=1,dt=40,ht=-1,mt=!0){if(!(Er.MIN_VERSION<=lt&&lt<=dt&&dt<=Er.MAX_VERSION)||ht<-1||ht>7)throw new RangeError("Invalid value");let ft,pt;for(ft=lt;;ft++){const xt=Er.getNumDataCodewords(ft,ct)*8,vt=it.getTotalBits(at,ft);if(vt<=xt){pt=vt;break}if(ft>=dt)throw new RangeError("Data too long")}for(const xt of[Er.Ecc.MEDIUM,Er.Ecc.QUARTILE,Er.Ecc.HIGH])mt&&pt<=Er.getNumDataCodewords(ft,xt)*8&&(ct=xt);let yt=[];for(const xt of at){tt(xt.mode.modeBits,4,yt),tt(xt.numChars,xt.mode.numCharCountBits(ft),yt);for(const vt of xt.getData())yt.push(vt)}nt(yt.length==pt);const gt=Er.getNumDataCodewords(ft,ct)*8;nt(yt.length<=gt),tt(0,Math.min(4,gt-yt.length),yt),tt(0,(8-yt.length%8)%8,yt),nt(yt.length%8==0);for(let xt=236;yt.length<gt;xt^=253)tt(xt,8,yt);let bt=[];for(;bt.length*8<yt.length;)bt.push(0);return yt.forEach((xt,vt)=>bt[vt>>>3]|=xt<<7-(vt&7)),new Er(ft,ct,bt,ht)}getModule(at,ct){return 0<=at&&at<this.size&&0<=ct&&ct<this.size&&this.modules[ct][at]}getModules(){return this.modules}drawFunctionPatterns(){for(let lt=0;lt<this.size;lt++)this.setFunctionModule(6,lt,lt%2==0),this.setFunctionModule(lt,6,lt%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const at=this.getAlignmentPatternPositions(),ct=at.length;for(let lt=0;lt<ct;lt++)for(let dt=0;dt<ct;dt++)lt==0&&dt==0||lt==0&&dt==ct-1||lt==ct-1&&dt==0||this.drawAlignmentPattern(at[lt],at[dt]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(at){const ct=this.errorCorrectionLevel.formatBits<<3|at;let lt=ct;for(let ht=0;ht<10;ht++)lt=lt<<1^(lt>>>9)*1335;const dt=(ct<<10|lt)^21522;nt(dt>>>15==0);for(let ht=0;ht<=5;ht++)this.setFunctionModule(8,ht,rt(dt,ht));this.setFunctionModule(8,7,rt(dt,6)),this.setFunctionModule(8,8,rt(dt,7)),this.setFunctionModule(7,8,rt(dt,8));for(let ht=9;ht<15;ht++)this.setFunctionModule(14-ht,8,rt(dt,ht));for(let ht=0;ht<8;ht++)this.setFunctionModule(this.size-1-ht,8,rt(dt,ht));for(let ht=8;ht<15;ht++)this.setFunctionModule(8,this.size-15+ht,rt(dt,ht));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let at=this.version;for(let lt=0;lt<12;lt++)at=at<<1^(at>>>11)*7973;const ct=this.version<<12|at;nt(ct>>>18==0);for(let lt=0;lt<18;lt++){const dt=rt(ct,lt),ht=this.size-11+lt%3,mt=Math.floor(lt/3);this.setFunctionModule(ht,mt,dt),this.setFunctionModule(mt,ht,dt)}}drawFinderPattern(at,ct){for(let lt=-4;lt<=4;lt++)for(let dt=-4;dt<=4;dt++){const ht=Math.max(Math.abs(dt),Math.abs(lt)),mt=at+dt,ft=ct+lt;0<=mt&&mt<this.size&&0<=ft&&ft<this.size&&this.setFunctionModule(mt,ft,ht!=2&&ht!=4)}}drawAlignmentPattern(at,ct){for(let lt=-2;lt<=2;lt++)for(let dt=-2;dt<=2;dt++)this.setFunctionModule(at+dt,ct+lt,Math.max(Math.abs(dt),Math.abs(lt))!=1)}setFunctionModule(at,ct,lt){this.modules[ct][at]=lt,this.isFunction[ct][at]=!0}addEccAndInterleave(at){const ct=this.version,lt=this.errorCorrectionLevel;if(at.length!=Er.getNumDataCodewords(ct,lt))throw new RangeError("Invalid argument");const dt=Er.NUM_ERROR_CORRECTION_BLOCKS[lt.ordinal][ct],ht=Er.ECC_CODEWORDS_PER_BLOCK[lt.ordinal][ct],mt=Math.floor(Er.getNumRawDataModules(ct)/8),ft=dt-mt%dt,pt=Math.floor(mt/dt);let yt=[];const gt=Er.reedSolomonComputeDivisor(ht);for(let xt=0,vt=0;xt<dt;xt++){let Et=at.slice(vt,vt+pt-ht+(xt<ft?0:1));vt+=Et.length;const Ct=Er.reedSolomonComputeRemainder(Et,gt);xt<ft&&Et.push(0),yt.push(Et.concat(Ct))}let bt=[];for(let xt=0;xt<yt[0].length;xt++)yt.forEach((vt,Et)=>{(xt!=pt-ht||Et>=ft)&&bt.push(vt[xt])});return nt(bt.length==mt),bt}drawCodewords(at){if(at.length!=Math.floor(Er.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let ct=0;for(let lt=this.size-1;lt>=1;lt-=2){lt==6&&(lt=5);for(let dt=0;dt<this.size;dt++)for(let ht=0;ht<2;ht++){const mt=lt-ht,pt=(lt+1&2)==0?this.size-1-dt:dt;!this.isFunction[pt][mt]&&ct<at.length*8&&(this.modules[pt][mt]=rt(at[ct>>>3],7-(ct&7)),ct++)}}nt(ct==at.length*8)}applyMask(at){if(at<0||at>7)throw new RangeError("Mask value out of range");for(let ct=0;ct<this.size;ct++)for(let lt=0;lt<this.size;lt++){let dt;switch(at){case 0:dt=(lt+ct)%2==0;break;case 1:dt=ct%2==0;break;case 2:dt=lt%3==0;break;case 3:dt=(lt+ct)%3==0;break;case 4:dt=(Math.floor(lt/3)+Math.floor(ct/2))%2==0;break;case 5:dt=lt*ct%2+lt*ct%3==0;break;case 6:dt=(lt*ct%2+lt*ct%3)%2==0;break;case 7:dt=((lt+ct)%2+lt*ct%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[ct][lt]&&dt&&(this.modules[ct][lt]=!this.modules[ct][lt])}}getPenaltyScore(){let at=0;for(let ht=0;ht<this.size;ht++){let mt=!1,ft=0,pt=[0,0,0,0,0,0,0];for(let yt=0;yt<this.size;yt++)this.modules[ht][yt]==mt?(ft++,ft==5?at+=Er.PENALTY_N1:ft>5&&at++):(this.finderPenaltyAddHistory(ft,pt),mt||(at+=this.finderPenaltyCountPatterns(pt)*Er.PENALTY_N3),mt=this.modules[ht][yt],ft=1);at+=this.finderPenaltyTerminateAndCount(mt,ft,pt)*Er.PENALTY_N3}for(let ht=0;ht<this.size;ht++){let mt=!1,ft=0,pt=[0,0,0,0,0,0,0];for(let yt=0;yt<this.size;yt++)this.modules[yt][ht]==mt?(ft++,ft==5?at+=Er.PENALTY_N1:ft>5&&at++):(this.finderPenaltyAddHistory(ft,pt),mt||(at+=this.finderPenaltyCountPatterns(pt)*Er.PENALTY_N3),mt=this.modules[yt][ht],ft=1);at+=this.finderPenaltyTerminateAndCount(mt,ft,pt)*Er.PENALTY_N3}for(let ht=0;ht<this.size-1;ht++)for(let mt=0;mt<this.size-1;mt++){const ft=this.modules[ht][mt];ft==this.modules[ht][mt+1]&&ft==this.modules[ht+1][mt]&&ft==this.modules[ht+1][mt+1]&&(at+=Er.PENALTY_N2)}let ct=0;for(const ht of this.modules)ct=ht.reduce((mt,ft)=>mt+(ft?1:0),ct);const lt=this.size*this.size,dt=Math.ceil(Math.abs(ct*20-lt*10)/lt)-1;return nt(0<=dt&&dt<=9),at+=dt*Er.PENALTY_N4,nt(0<=at&&at<=2568888),at}getAlignmentPatternPositions(){if(this.version==1)return[];{const at=Math.floor(this.version/7)+2,ct=this.version==32?26:Math.ceil((this.version*4+4)/(at*2-2))*2;let lt=[6];for(let dt=this.size-7;lt.length<at;dt-=ct)lt.splice(1,0,dt);return lt}}static getNumRawDataModules(at){if(at<Er.MIN_VERSION||at>Er.MAX_VERSION)throw new RangeError("Version number out of range");let ct=(16*at+128)*at+64;if(at>=2){const lt=Math.floor(at/7)+2;ct-=(25*lt-10)*lt-55,at>=7&&(ct-=36)}return nt(208<=ct&&ct<=29648),ct}static getNumDataCodewords(at,ct){return Math.floor(Er.getNumRawDataModules(at)/8)-Er.ECC_CODEWORDS_PER_BLOCK[ct.ordinal][at]*Er.NUM_ERROR_CORRECTION_BLOCKS[ct.ordinal][at]}static reedSolomonComputeDivisor(at){if(at<1||at>255)throw new RangeError("Degree out of range");let ct=[];for(let dt=0;dt<at-1;dt++)ct.push(0);ct.push(1);let lt=1;for(let dt=0;dt<at;dt++){for(let ht=0;ht<ct.length;ht++)ct[ht]=Er.reedSolomonMultiply(ct[ht],lt),ht+1<ct.length&&(ct[ht]^=ct[ht+1]);lt=Er.reedSolomonMultiply(lt,2)}return ct}static reedSolomonComputeRemainder(at,ct){let lt=ct.map(dt=>0);for(const dt of at){const ht=dt^lt.shift();lt.push(0),ct.forEach((mt,ft)=>lt[ft]^=Er.reedSolomonMultiply(mt,ht))}return lt}static reedSolomonMultiply(at,ct){if(at>>>8||ct>>>8)throw new RangeError("Byte out of range");let lt=0;for(let dt=7;dt>=0;dt--)lt=lt<<1^(lt>>>7)*285,lt^=(ct>>>dt&1)*at;return nt(lt>>>8==0),lt}finderPenaltyCountPatterns(at){const ct=at[1];nt(ct<=this.size*3);const lt=ct>0&&at[2]==ct&&at[3]==ct*3&&at[4]==ct&&at[5]==ct;return(lt&&at[0]>=ct*4&&at[6]>=ct?1:0)+(lt&&at[6]>=ct*4&&at[0]>=ct?1:0)}finderPenaltyTerminateAndCount(at,ct,lt){return at&&(this.finderPenaltyAddHistory(ct,lt),ct=0),ct+=this.size,this.finderPenaltyAddHistory(ct,lt),this.finderPenaltyCountPatterns(lt)}finderPenaltyAddHistory(at,ct){ct[0]==0&&(at+=this.size),ct.pop(),ct.unshift(at)}};o.MIN_VERSION=1,o.MAX_VERSION=40,o.PENALTY_N1=3,o.PENALTY_N2=3,o.PENALTY_N3=40,o.PENALTY_N4=10,o.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],o.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],et.QrCode=o;function tt(st,at,ct){if(at<0||at>31||st>>>at)throw new RangeError("Value out of range");for(let lt=at-1;lt>=0;lt--)ct.push(st>>>lt&1)}function rt(st,at){return(st>>>at&1)!=0}function nt(st){if(!st)throw new Error("Assertion error")}const ot=class Ir{constructor(at,ct,lt){if(this.mode=at,this.numChars=ct,this.bitData=lt,ct<0)throw new RangeError("Invalid argument");this.bitData=lt.slice()}static makeBytes(at){let ct=[];for(const lt of at)tt(lt,8,ct);return new Ir(Ir.Mode.BYTE,at.length,ct)}static makeNumeric(at){if(!Ir.isNumeric(at))throw new RangeError("String contains non-numeric characters");let ct=[];for(let lt=0;lt<at.length;){const dt=Math.min(at.length-lt,3);tt(parseInt(at.substring(lt,lt+dt),10),dt*3+1,ct),lt+=dt}return new Ir(Ir.Mode.NUMERIC,at.length,ct)}static makeAlphanumeric(at){if(!Ir.isAlphanumeric(at))throw new RangeError("String contains unencodable characters in alphanumeric mode");let ct=[],lt;for(lt=0;lt+2<=at.length;lt+=2){let dt=Ir.ALPHANUMERIC_CHARSET.indexOf(at.charAt(lt))*45;dt+=Ir.ALPHANUMERIC_CHARSET.indexOf(at.charAt(lt+1)),tt(dt,11,ct)}return lt<at.length&&tt(Ir.ALPHANUMERIC_CHARSET.indexOf(at.charAt(lt)),6,ct),new Ir(Ir.Mode.ALPHANUMERIC,at.length,ct)}static makeSegments(at){return at==""?[]:Ir.isNumeric(at)?[Ir.makeNumeric(at)]:Ir.isAlphanumeric(at)?[Ir.makeAlphanumeric(at)]:[Ir.makeBytes(Ir.toUtf8ByteArray(at))]}static makeEci(at){let ct=[];if(at<0)throw new RangeError("ECI assignment value out of range");if(at<128)tt(at,8,ct);else if(at<16384)tt(2,2,ct),tt(at,14,ct);else if(at<1e6)tt(6,3,ct),tt(at,21,ct);else throw new RangeError("ECI assignment value out of range");return new Ir(Ir.Mode.ECI,0,ct)}static isNumeric(at){return Ir.NUMERIC_REGEX.test(at)}static isAlphanumeric(at){return Ir.ALPHANUMERIC_REGEX.test(at)}getData(){return this.bitData.slice()}static getTotalBits(at,ct){let lt=0;for(const dt of at){const ht=dt.mode.numCharCountBits(ct);if(dt.numChars>=1<<ht)return 1/0;lt+=4+ht+dt.bitData.length}return lt}static toUtf8ByteArray(at){at=encodeURI(at);let ct=[];for(let lt=0;lt<at.length;lt++)at.charAt(lt)!="%"?ct.push(at.charCodeAt(lt)):(ct.push(parseInt(at.substring(lt+1,lt+3),16)),lt+=2);return ct}};ot.NUMERIC_REGEX=/^[0-9]*$/,ot.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,ot.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let it=ot;et.QrSegment=ot})(qrcodegen||(qrcodegen={}));(et=>{(o=>{const tt=class{constructor(nt,ot){this.ordinal=nt,this.formatBits=ot}};tt.LOW=new tt(0,1),tt.MEDIUM=new tt(1,0),tt.QUARTILE=new tt(2,3),tt.HIGH=new tt(3,2),o.Ecc=tt})(et.QrCode||(et.QrCode={}))})(qrcodegen||(qrcodegen={}));(et=>{(o=>{const tt=class{constructor(nt,ot){this.modeBits=nt,this.numBitsCharCount=ot}numCharCountBits(nt){return this.numBitsCharCount[Math.floor((nt+7)/17)]}};tt.NUMERIC=new tt(1,[10,12,14]),tt.ALPHANUMERIC=new tt(2,[9,11,13]),tt.BYTE=new tt(4,[8,16,16]),tt.KANJI=new tt(8,[8,10,12]),tt.ECI=new tt(7,[0,0,0]),o.Mode=tt})(et.QrSegment||(et.QrSegment={}))})(qrcodegen||(qrcodegen={}));var qrcodegen_default=qrcodegen;/**
* @license qrcode.react
* Copyright (c) Paul O'Shannessy
* SPDX-License-Identifier: ISC
*/var ERROR_LEVEL_MAP={L:qrcodegen_default.QrCode.Ecc.LOW,M:qrcodegen_default.QrCode.Ecc.MEDIUM,Q:qrcodegen_default.QrCode.Ecc.QUARTILE,H:qrcodegen_default.QrCode.Ecc.HIGH},DEFAULT_SIZE=128,DEFAULT_LEVEL="L",DEFAULT_BGCOLOR="#FFFFFF",DEFAULT_FGCOLOR="#000000",DEFAULT_INCLUDEMARGIN=!1,DEFAULT_MINVERSION=1,SPEC_MARGIN_SIZE=4,DEFAULT_MARGIN_SIZE=0,DEFAULT_IMG_SCALE=.1;function generatePath(et,o=0){const tt=[];return et.forEach(function(rt,nt){let ot=null;rt.forEach(function(it,st){if(!it&&ot!==null){tt.push(`M${ot+o} ${nt+o}h${st-ot}v1H${ot+o}z`),ot=null;return}if(st===rt.length-1){if(!it)return;ot===null?tt.push(`M${st+o},${nt+o} h1v1H${st+o}z`):tt.push(`M${ot+o},${nt+o} h${st+1-ot}v1H${ot+o}z`);return}it&&ot===null&&(ot=st)})}),tt.join("")}function excavateModules(et,o){return et.slice().map((tt,rt)=>rt<o.y||rt>=o.y+o.h?tt:tt.map((nt,ot)=>ot<o.x||ot>=o.x+o.w?nt:!1))}function getImageSettings(et,o,tt,rt){if(rt==null)return null;const nt=et.length+tt*2,ot=Math.floor(o*DEFAULT_IMG_SCALE),it=nt/o,st=(rt.width||ot)*it,at=(rt.height||ot)*it,ct=rt.x==null?et.length/2-st/2:rt.x*it,lt=rt.y==null?et.length/2-at/2:rt.y*it,dt=rt.opacity==null?1:rt.opacity;let ht=null;if(rt.excavate){let ft=Math.floor(ct),pt=Math.floor(lt),yt=Math.ceil(st+ct-ft),gt=Math.ceil(at+lt-pt);ht={x:ft,y:pt,w:yt,h:gt}}const mt=rt.crossOrigin;return{x:ct,y:lt,h:at,w:st,excavation:ht,opacity:dt,crossOrigin:mt}}function getMarginSize(et,o){return o!=null?Math.max(Math.floor(o),0):et?SPEC_MARGIN_SIZE:DEFAULT_MARGIN_SIZE}function useQRCode({value:et,level:o,minVersion:tt,includeMargin:rt,marginSize:nt,imageSettings:ot,size:it}){let st=React.useMemo(()=>{const ht=qrcodegen_default.QrSegment.makeSegments(et);return qrcodegen_default.QrCode.encodeSegments(ht,ERROR_LEVEL_MAP[o],tt)},[et,o,tt]);const{cells:at,margin:ct,numCells:lt,calculatedImageSettings:dt}=React.useMemo(()=>{let ht=st.getModules();const mt=getMarginSize(rt,nt),ft=ht.length+mt*2,pt=getImageSettings(ht,it,mt,ot);return{cells:ht,margin:mt,numCells:ft,calculatedImageSettings:pt}},[st,it,ot,rt,nt]);return{qrcode:st,margin:ct,cells:at,numCells:lt,calculatedImageSettings:dt}}var SUPPORTS_PATH2D=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),QRCodeCanvas=React.forwardRef(function(o,tt){const rt=o,{value:nt,size:ot=DEFAULT_SIZE,level:it=DEFAULT_LEVEL,bgColor:st=DEFAULT_BGCOLOR,fgColor:at=DEFAULT_FGCOLOR,includeMargin:ct=DEFAULT_INCLUDEMARGIN,minVersion:lt=DEFAULT_MINVERSION,marginSize:dt,imageSettings:ht}=rt,ft=__objRest(rt,["value","size","level","bgColor","fgColor","includeMargin","minVersion","marginSize","imageSettings"]),{style:pt}=ft,yt=__objRest(ft,["style"]),gt=ht==null?void 0:ht.src,bt=React.useRef(null),xt=React.useRef(null),vt=React.useCallback(Mt=>{bt.current=Mt,typeof tt=="function"?tt(Mt):tt&&(tt.current=Mt)},[tt]),[Et,Ct]=React.useState(!1),{margin:St,cells:At,numCells:kt,calculatedImageSettings:It}=useQRCode({value:nt,level:it,minVersion:lt,includeMargin:ct,marginSize:dt,imageSettings:ht,size:ot});React.useEffect(()=>{if(bt.current!=null){const Mt=bt.current,zt=Mt.getContext("2d");if(!zt)return;let Ut=At;const Xt=xt.current,Wt=It!=null&&Xt!==null&&Xt.complete&&Xt.naturalHeight!==0&&Xt.naturalWidth!==0;Wt&&It.excavation!=null&&(Ut=excavateModules(At,It.excavation));const Ft=window.devicePixelRatio||1;Mt.height=Mt.width=ot*Ft;const qt=ot/kt*Ft;zt.scale(qt,qt),zt.fillStyle=st,zt.fillRect(0,0,kt,kt),zt.fillStyle=at,SUPPORTS_PATH2D?zt.fill(new Path2D(generatePath(Ut,St))):At.forEach(function(Pt,Yt){Pt.forEach(function(Qt,jt){Qt&&zt.fillRect(jt+St,Yt+St,1,1)})}),It&&(zt.globalAlpha=It.opacity),Wt&&zt.drawImage(Xt,It.x+St,It.y+St,It.w,It.h)}}),React.useEffect(()=>{Ct(!1)},[gt]);const Nt=__spreadValues({height:ot,width:ot},pt);let Lt=null;return gt!=null&&(Lt=React.createElement("img",{src:gt,key:gt,style:{display:"none"},onLoad:()=>{Ct(!0)},ref:xt,crossOrigin:It==null?void 0:It.crossOrigin})),React.createElement(React.Fragment,null,React.createElement("canvas",__spreadValues({style:Nt,height:ot,width:ot,ref:vt,role:"img"},yt)),Lt)});QRCodeCanvas.displayName="QRCodeCanvas";var QRCodeSVG=React.forwardRef(function(o,tt){const rt=o,{value:nt,size:ot=DEFAULT_SIZE,level:it=DEFAULT_LEVEL,bgColor:st=DEFAULT_BGCOLOR,fgColor:at=DEFAULT_FGCOLOR,includeMargin:ct=DEFAULT_INCLUDEMARGIN,minVersion:lt=DEFAULT_MINVERSION,title:dt,marginSize:ht,imageSettings:mt}=rt,ft=__objRest(rt,["value","size","level","bgColor","fgColor","includeMargin","minVersion","title","marginSize","imageSettings"]),{margin:pt,cells:yt,numCells:gt,calculatedImageSettings:bt}=useQRCode({value:nt,level:it,minVersion:lt,includeMargin:ct,marginSize:ht,imageSettings:mt,size:ot});let xt=yt,vt=null;mt!=null&&bt!=null&&(bt.excavation!=null&&(xt=excavateModules(yt,bt.excavation)),vt=React.createElement("image",{href:mt.src,height:bt.h,width:bt.w,x:bt.x+pt,y:bt.y+pt,preserveAspectRatio:"none",opacity:bt.opacity,crossOrigin:bt.crossOrigin}));const Et=generatePath(xt,pt);return React.createElement("svg",__spreadValues({height:ot,width:ot,viewBox:`0 0 ${gt} ${gt}`,ref:tt,role:"img"},ft),!!dt&&React.createElement("title",null,dt),React.createElement("path",{fill:st,d:`M0,0 h${gt}v${gt}H0z`,shapeRendering:"crispEdges"}),React.createElement("path",{fill:at,d:Et,shapeRendering:"crispEdges"}),vt)});QRCodeSVG.displayName="QRCodeSVG";const QRCode=({text:et,width:o=256,height:tt=256})=>{const[rt,nt]=reactExports.useState(!1),ot=window.innerWidth<640,it=async()=>{await navigator.clipboard.writeText(et),nt(!0),setTimeout(()=>nt(!1),2e3)};return jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[jsxRuntimeExports.jsx(QRCodeSVG,{value:et,size:ot?Math.min(o*.8,window.innerWidth-64):Math.min(o,tt)}),jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2 w-full max-w-[300px]",children:[jsxRuntimeExports.jsx("input",{type:"text",value:et,readOnly:!0,className:"flex-1 px-3 py-2 text-xs sm:text-sm border rounded-md bg-muted truncate"}),jsxRuntimeExports.jsx(Button,{variant:"outline",size:"icon",onClick:it,className:"shrink-0",children:rt?jsxRuntimeExports.jsx(Check,{className:"h-4 w-4"}):jsxRuntimeExports.jsx(Copy,{className:"h-4 w-4"})})]})]})};var byteToHex=[];for(var i=0;i<256;++i)byteToHex.push((i+256).toString(16).slice(1));function unsafeStringify(et,o=0){return(byteToHex[et[o+0]]+byteToHex[et[o+1]]+byteToHex[et[o+2]]+byteToHex[et[o+3]]+"-"+byteToHex[et[o+4]]+byteToHex[et[o+5]]+"-"+byteToHex[et[o+6]]+byteToHex[et[o+7]]+"-"+byteToHex[et[o+8]]+byteToHex[et[o+9]]+"-"+byteToHex[et[o+10]]+byteToHex[et[o+11]]+byteToHex[et[o+12]]+byteToHex[et[o+13]]+byteToHex[et[o+14]]+byteToHex[et[o+15]]).toLowerCase()}var getRandomValues,rnds8=new Uint8Array(16);function rng(){if(!getRandomValues&&(getRandomValues=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!getRandomValues))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return getRandomValues(rnds8)}var randomUUID=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const native={randomUUID};function v4(et,o,tt){if(native.randomUUID&&!o&&!et)return native.randomUUID();et=et||{};var rt=et.random||(et.rng||rng)();return rt[6]=rt[6]&15|64,rt[8]=rt[8]&63|128,unsafeStringify(rt)}var src={exports:{}},indexLight={exports:{}},indexMinimal={},minimal={},aspromise=asPromise$1;function asPromise$1(et,o){for(var tt=new Array(arguments.length-1),rt=0,nt=2,ot=!0;nt<arguments.length;)tt[rt++]=arguments[nt++];return new Promise(function(st,at){tt[rt]=function(lt){if(ot)if(ot=!1,lt)at(lt);else{for(var dt=new Array(arguments.length-1),ht=0;ht<dt.length;)dt[ht++]=arguments[ht];st.apply(null,dt)}};try{et.apply(o||null,tt)}catch(ct){ot&&(ot=!1,at(ct))}})}var base64$1={};(function(et){var o=et;o.length=function(st){var at=st.length;if(!at)return 0;for(var ct=0;--at%4>1&&st.charAt(at)==="=";)++ct;return Math.ceil(st.length*3)/4-ct};for(var tt=new Array(64),rt=new Array(123),nt=0;nt<64;)rt[tt[nt]=nt<26?nt+65:nt<52?nt+71:nt<62?nt-4:nt-59|43]=nt++;o.encode=function(st,at,ct){for(var lt=null,dt=[],ht=0,mt=0,ft;at<ct;){var pt=st[at++];switch(mt){case 0:dt[ht++]=tt[pt>>2],ft=(pt&3)<<4,mt=1;break;case 1:dt[ht++]=tt[ft|pt>>4],ft=(pt&15)<<2,mt=2;break;case 2:dt[ht++]=tt[ft|pt>>6],dt[ht++]=tt[pt&63],mt=0;break}ht>8191&&((lt||(lt=[])).push(String.fromCharCode.apply(String,dt)),ht=0)}return mt&&(dt[ht++]=tt[ft],dt[ht++]=61,mt===1&&(dt[ht++]=61)),lt?(ht&&lt.push(String.fromCharCode.apply(String,dt.slice(0,ht))),lt.join("")):String.fromCharCode.apply(String,dt.slice(0,ht))};var ot="invalid encoding";o.decode=function(st,at,ct){for(var lt=ct,dt=0,ht,mt=0;mt<st.length;){var ft=st.charCodeAt(mt++);if(ft===61&&dt>1)break;if((ft=rt[ft])===void 0)throw Error(ot);switch(dt){case 0:ht=ft,dt=1;break;case 1:at[ct++]=ht<<2|(ft&48)>>4,ht=ft,dt=2;break;case 2:at[ct++]=(ht&15)<<4|(ft&60)>>2,ht=ft,dt=3;break;case 3:at[ct++]=(ht&3)<<6|ft,dt=0;break}}if(dt===1)throw Error(ot);return ct-lt},o.test=function(st){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(st)}})(base64$1);var eventemitter=EventEmitter;function EventEmitter(){this._listeners={}}EventEmitter.prototype.on=function(o,tt,rt){return(this._listeners[o]||(this._listeners[o]=[])).push({fn:tt,ctx:rt||this}),this};EventEmitter.prototype.off=function(o,tt){if(o===void 0)this._listeners={};else if(tt===void 0)this._listeners[o]=[];else for(var rt=this._listeners[o],nt=0;nt<rt.length;)rt[nt].fn===tt?rt.splice(nt,1):++nt;return this};EventEmitter.prototype.emit=function(o){var tt=this._listeners[o];if(tt){for(var rt=[],nt=1;nt<arguments.length;)rt.push(arguments[nt++]);for(nt=0;nt<tt.length;)tt[nt].fn.apply(tt[nt++].ctx,rt)}return this};var float=factory(factory);function factory(et){return typeof Float32Array<"u"?function(){var o=new Float32Array([-0]),tt=new Uint8Array(o.buffer),rt=tt[3]===128;function nt(at,ct,lt){o[0]=at,ct[lt]=tt[0],ct[lt+1]=tt[1],ct[lt+2]=tt[2],ct[lt+3]=tt[3]}function ot(at,ct,lt){o[0]=at,ct[lt]=tt[3],ct[lt+1]=tt[2],ct[lt+2]=tt[1],ct[lt+3]=tt[0]}et.writeFloatLE=rt?nt:ot,et.writeFloatBE=rt?ot:nt;function it(at,ct){return tt[0]=at[ct],tt[1]=at[ct+1],tt[2]=at[ct+2],tt[3]=at[ct+3],o[0]}function st(at,ct){return tt[3]=at[ct],tt[2]=at[ct+1],tt[1]=at[ct+2],tt[0]=at[ct+3],o[0]}et.readFloatLE=rt?it:st,et.readFloatBE=rt?st:it}():function(){function o(rt,nt,ot,it){var st=nt<0?1:0;if(st&&(nt=-nt),nt===0)rt(1/nt>0?0:2147483648,ot,it);else if(isNaN(nt))rt(2143289344,ot,it);else if(nt>34028234663852886e22)rt((st<<31|2139095040)>>>0,ot,it);else if(nt<11754943508222875e-54)rt((st<<31|Math.round(nt/1401298464324817e-60))>>>0,ot,it);else{var at=Math.floor(Math.log(nt)/Math.LN2),ct=Math.round(nt*Math.pow(2,-at)*8388608)&8388607;rt((st<<31|at+127<<23|ct)>>>0,ot,it)}}et.writeFloatLE=o.bind(null,writeUintLE),et.writeFloatBE=o.bind(null,writeUintBE);function tt(rt,nt,ot){var it=rt(nt,ot),st=(it>>31)*2+1,at=it>>>23&255,ct=it&8388607;return at===255?ct?NaN:st*(1/0):at===0?st*1401298464324817e-60*ct:st*Math.pow(2,at-150)*(ct+8388608)}et.readFloatLE=tt.bind(null,readUintLE),et.readFloatBE=tt.bind(null,readUintBE)}(),typeof Float64Array<"u"?function(){var o=new Float64Array([-0]),tt=new Uint8Array(o.buffer),rt=tt[7]===128;function nt(at,ct,lt){o[0]=at,ct[lt]=tt[0],ct[lt+1]=tt[1],ct[lt+2]=tt[2],ct[lt+3]=tt[3],ct[lt+4]=tt[4],ct[lt+5]=tt[5],ct[lt+6]=tt[6],ct[lt+7]=tt[7]}function ot(at,ct,lt){o[0]=at,ct[lt]=tt[7],ct[lt+1]=tt[6],ct[lt+2]=tt[5],ct[lt+3]=tt[4],ct[lt+4]=tt[3],ct[lt+5]=tt[2],ct[lt+6]=tt[1],ct[lt+7]=tt[0]}et.writeDoubleLE=rt?nt:ot,et.writeDoubleBE=rt?ot:nt;function it(at,ct){return tt[0]=at[ct],tt[1]=at[ct+1],tt[2]=at[ct+2],tt[3]=at[ct+3],tt[4]=at[ct+4],tt[5]=at[ct+5],tt[6]=at[ct+6],tt[7]=at[ct+7],o[0]}function st(at,ct){return tt[7]=at[ct],tt[6]=at[ct+1],tt[5]=at[ct+2],tt[4]=at[ct+3],tt[3]=at[ct+4],tt[2]=at[ct+5],tt[1]=at[ct+6],tt[0]=at[ct+7],o[0]}et.readDoubleLE=rt?it:st,et.readDoubleBE=rt?st:it}():function(){function o(rt,nt,ot,it,st,at){var ct=it<0?1:0;if(ct&&(it=-it),it===0)rt(0,st,at+nt),rt(1/it>0?0:2147483648,st,at+ot);else if(isNaN(it))rt(0,st,at+nt),rt(2146959360,st,at+ot);else if(it>17976931348623157e292)rt(0,st,at+nt),rt((ct<<31|2146435072)>>>0,st,at+ot);else{var lt;if(it<22250738585072014e-324)lt=it/5e-324,rt(lt>>>0,st,at+nt),rt((ct<<31|lt/4294967296)>>>0,st,at+ot);else{var dt=Math.floor(Math.log(it)/Math.LN2);dt===1024&&(dt=1023),lt=it*Math.pow(2,-dt),rt(lt*4503599627370496>>>0,st,at+nt),rt((ct<<31|dt+1023<<20|lt*1048576&1048575)>>>0,st,at+ot)}}}et.writeDoubleLE=o.bind(null,writeUintLE,0,4),et.writeDoubleBE=o.bind(null,writeUintBE,4,0);function tt(rt,nt,ot,it,st){var at=rt(it,st+nt),ct=rt(it,st+ot),lt=(ct>>31)*2+1,dt=ct>>>20&2047,ht=4294967296*(ct&1048575)+at;return dt===2047?ht?NaN:lt*(1/0):dt===0?lt*5e-324*ht:lt*Math.pow(2,dt-1075)*(ht+4503599627370496)}et.readDoubleLE=tt.bind(null,readUintLE,0,4),et.readDoubleBE=tt.bind(null,readUintBE,4,0)}(),et}function writeUintLE(et,o,tt){o[tt]=et&255,o[tt+1]=et>>>8&255,o[tt+2]=et>>>16&255,o[tt+3]=et>>>24}function writeUintBE(et,o,tt){o[tt]=et>>>24,o[tt+1]=et>>>16&255,o[tt+2]=et>>>8&255,o[tt+3]=et&255}function readUintLE(et,o){return(et[o]|et[o+1]<<8|et[o+2]<<16|et[o+3]<<24)>>>0}function readUintBE(et,o){return(et[o]<<24|et[o+1]<<16|et[o+2]<<8|et[o+3])>>>0}var inquire_1=inquire$1;function inquire$1(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(et){}return null}var utf8$2={};(function(et){var o=et;o.length=function(rt){for(var nt=0,ot=0,it=0;it<rt.length;++it)ot=rt.charCodeAt(it),ot<128?nt+=1:ot<2048?nt+=2:(ot&64512)===55296&&(rt.charCodeAt(it+1)&64512)===56320?(++it,nt+=4):nt+=3;return nt},o.read=function(rt,nt,ot){var it=ot-nt;if(it<1)return"";for(var st=null,at=[],ct=0,lt;nt<ot;)lt=rt[nt++],lt<128?at[ct++]=lt:lt>191&&lt<224?at[ct++]=(lt&31)<<6|rt[nt++]&63:lt>239&&lt<365?(lt=((lt&7)<<18|(rt[nt++]&63)<<12|(rt[nt++]&63)<<6|rt[nt++]&63)-65536,at[ct++]=55296+(lt>>10),at[ct++]=56320+(lt&1023)):at[ct++]=(lt&15)<<12|(rt[nt++]&63)<<6|rt[nt++]&63,ct>8191&&((st||(st=[])).push(String.fromCharCode.apply(String,at)),ct=0);return st?(ct&&st.push(String.fromCharCode.apply(String,at.slice(0,ct))),st.join("")):String.fromCharCode.apply(String,at.slice(0,ct))},o.write=function(rt,nt,ot){for(var it=ot,st,at,ct=0;ct<rt.length;++ct)st=rt.charCodeAt(ct),st<128?nt[ot++]=st:st<2048?(nt[ot++]=st>>6|192,nt[ot++]=st&63|128):(st&64512)===55296&&((at=rt.charCodeAt(ct+1))&64512)===56320?(st=65536+((st&1023)<<10)+(at&1023),++ct,nt[ot++]=st>>18|240,nt[ot++]=st>>12&63|128,nt[ot++]=st>>6&63|128,nt[ot++]=st&63|128):(nt[ot++]=st>>12|224,nt[ot++]=st>>6&63|128,nt[ot++]=st&63|128);return ot-it}})(utf8$2);var pool_1=pool;function pool(et,o,tt){var rt=tt||8192,nt=rt>>>1,ot=null,it=rt;return function(at){if(at<1||at>nt)return et(at);it+at>rt&&(ot=et(rt),it=0);var ct=o.call(ot,it,it+=at);return it&7&&(it=(it|7)+1),ct}}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=o;var et=requireMinimal();function o(ot,it){this.lo=ot>>>0,this.hi=it>>>0}var tt=o.zero=new o(0,0);tt.toNumber=function(){return 0},tt.zzEncode=tt.zzDecode=function(){return this},tt.length=function(){return 1};var rt=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(it){if(it===0)return tt;var st=it<0;st&&(it=-it);var at=it>>>0,ct=(it-at)/4294967296>>>0;return st&&(ct=~ct>>>0,at=~at>>>0,++at>4294967295&&(at=0,++ct>4294967295&&(ct=0))),new o(at,ct)},o.from=function(it){if(typeof it=="number")return o.fromNumber(it);if(et.isString(it))if(et.Long)it=et.Long.fromString(it);else return o.fromNumber(parseInt(it,10));return it.low||it.high?new o(it.low>>>0,it.high>>>0):tt},o.prototype.toNumber=function(it){if(!it&&this.hi>>>31){var st=~this.lo+1>>>0,at=~this.hi>>>0;return st||(at=at+1>>>0),-(st+at*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(it){return et.Long?new et.Long(this.lo|0,this.hi|0,!!it):{low:this.lo|0,high:this.hi|0,unsigned:!!it}};var nt=String.prototype.charCodeAt;return o.fromHash=function(it){return it===rt?tt:new o((nt.call(it,0)|nt.call(it,1)<<8|nt.call(it,2)<<16|nt.call(it,3)<<24)>>>0,(nt.call(it,4)|nt.call(it,5)<<8|nt.call(it,6)<<16|nt.call(it,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var it=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^it)>>>0,this.lo=(this.lo<<1^it)>>>0,this},o.prototype.zzDecode=function(){var it=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^it)>>>0,this.hi=(this.hi>>>1^it)>>>0,this},o.prototype.length=function(){var it=this.lo,st=(this.lo>>>28|this.hi<<4)>>>0,at=this.hi>>>24;return at===0?st===0?it<16384?it<128?1:2:it<2097152?3:4:st<16384?st<128?5:6:st<2097152?7:8:at<128?9:10},longbits}var hasRequiredMinimal;function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,function(et){var o=et;o.asPromise=aspromise,o.base64=base64$1,o.EventEmitter=eventemitter,o.float=float,o.inquire=inquire_1,o.utf8=utf8$2,o.pool=pool_1,o.LongBits=requireLongbits(),o.isNode=!!(typeof globalThis<"u"&&globalThis&&globalThis.process&&globalThis.process.versions&&globalThis.process.versions.node),o.global=o.isNode&&globalThis||typeof window<"u"&&window||typeof self<"u"&&self||commonjsGlobal,o.emptyArray=Object.freeze?Object.freeze([]):[],o.emptyObject=Object.freeze?Object.freeze({}):{},o.isInteger=Number.isInteger||function(ot){return typeof ot=="number"&&isFinite(ot)&&Math.floor(ot)===ot},o.isString=function(ot){return typeof ot=="string"||ot instanceof String},o.isObject=function(ot){return ot&&typeof ot=="object"},o.isset=o.isSet=function(ot,it){var st=ot[it];return st!=null&&ot.hasOwnProperty(it)?typeof st!="object"||(Array.isArray(st)?st.length:Object.keys(st).length)>0:!1},o.Buffer=function(){try{var nt=o.inquire("buffer").Buffer;return nt.prototype.utf8Write?nt:null}catch{return null}}(),o._Buffer_from=null,o._Buffer_allocUnsafe=null,o.newBuffer=function(ot){return typeof ot=="number"?o.Buffer?o._Buffer_allocUnsafe(ot):new o.Array(ot):o.Buffer?o._Buffer_from(ot):typeof Uint8Array>"u"?ot:new Uint8Array(ot)},o.Array=typeof Uint8Array<"u"?Uint8Array:Array,o.Long=o.global.dcodeIO&&o.global.dcodeIO.Long||o.global.Long||o.inquire("long"),o.key2Re=/^true|false|0|1$/,o.key32Re=/^-?(?:0|[1-9][0-9]*)$/,o.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,o.longToHash=function(ot){return ot?o.LongBits.from(ot).toHash():o.LongBits.zeroHash},o.longFromHash=function(ot,it){var st=o.LongBits.fromHash(ot);return o.Long?o.Long.fromBits(st.lo,st.hi,it):st.toNumber(!!it)};function tt(nt,ot,it){for(var st=Object.keys(ot),at=0;at<st.length;++at)(nt[st[at]]===void 0||!it)&&(nt[st[at]]=ot[st[at]]);return nt}o.merge=tt,o.lcFirst=function(ot){return ot.charAt(0).toLowerCase()+ot.substring(1)};function rt(nt){function ot(it,st){if(!(this instanceof ot))return new ot(it,st);Object.defineProperty(this,"message",{get:function(){return it}}),Error.captureStackTrace?Error.captureStackTrace(this,ot):Object.defineProperty(this,"stack",{value:new Error().stack||""}),st&&tt(this,st)}return ot.prototype=Object.create(Error.prototype,{constructor:{value:ot,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return nt},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),ot}o.newError=rt,o.ProtocolError=rt("ProtocolError"),o.oneOfGetter=function(ot){for(var it={},st=0;st<ot.length;++st)it[ot[st]]=1;return function(){for(var at=Object.keys(this),ct=at.length-1;ct>-1;--ct)if(it[at[ct]]===1&&this[at[ct]]!==void 0&&this[at[ct]]!==null)return at[ct]}},o.oneOfSetter=function(ot){return function(it){for(var st=0;st<ot.length;++st)ot[st]!==it&&delete this[ot[st]]}},o.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},o._configure=function(){var nt=o.Buffer;if(!nt){o._Buffer_from=o._Buffer_allocUnsafe=null;return}o._Buffer_from=nt.from!==Uint8Array.from&&nt.from||function(it,st){return new nt(it,st)},o._Buffer_allocUnsafe=nt.allocUnsafe||function(it){return new nt(it)}}}(minimal)),minimal}var writer=Writer$1,util$7=requireMinimal(),BufferWriter$1,LongBits$1=util$7.LongBits,base64=util$7.base64,utf8$1=util$7.utf8;function Op(et,o,tt){this.fn=et,this.len=o,this.next=void 0,this.val=tt}function noop(){}function State(et){this.head=et.head,this.tail=et.tail,this.len=et.len,this.next=et.states}function Writer$1(){this.len=0,this.head=new Op(noop,0,0),this.tail=this.head,this.states=null}var create$2=function et(){return util$7.Buffer?function(){return(Writer$1.create=function(){return new BufferWriter$1})()}:function(){return new Writer$1}};Writer$1.create=create$2();Writer$1.alloc=function et(o){return new util$7.Array(o)};util$7.Array!==Array&&(Writer$1.alloc=util$7.pool(Writer$1.alloc,util$7.Array.prototype.subarray));Writer$1.prototype._push=function et(o,tt,rt){return this.tail=this.tail.next=new Op(o,tt,rt),this.len+=tt,this};function writeByte(et,o,tt){o[tt]=et&255}function writeVarint32(et,o,tt){for(;et>127;)o[tt++]=et&127|128,et>>>=7;o[tt]=et}function VarintOp(et,o){this.len=et,this.next=void 0,this.val=o}VarintOp.prototype=Object.create(Op.prototype);VarintOp.prototype.fn=writeVarint32;Writer$1.prototype.uint32=function et(o){return this.len+=(this.tail=this.tail.next=new VarintOp((o=o>>>0)<128?1:o<16384?2:o<2097152?3:o<268435456?4:5,o)).len,this};Writer$1.prototype.int32=function et(o){return o<0?this._push(writeVarint64,10,LongBits$1.fromNumber(o)):this.uint32(o)};Writer$1.prototype.sint32=function et(o){return this.uint32((o<<1^o>>31)>>>0)};function writeVarint64(et,o,tt){for(;et.hi;)o[tt++]=et.lo&127|128,et.lo=(et.lo>>>7|et.hi<<25)>>>0,et.hi>>>=7;for(;et.lo>127;)o[tt++]=et.lo&127|128,et.lo=et.lo>>>7;o[tt++]=et.lo}Writer$1.prototype.uint64=function et(o){var tt=LongBits$1.from(o);return this._push(writeVarint64,tt.length(),tt)};Writer$1.prototype.int64=Writer$1.prototype.uint64;Writer$1.prototype.sint64=function et(o){var tt=LongBits$1.from(o).zzEncode();return this._push(writeVarint64,tt.length(),tt)};Writer$1.prototype.bool=function et(o){return this._push(writeByte,1,o?1:0)};function writeFixed32(et,o,tt){o[tt]=et&255,o[tt+1]=et>>>8&255,o[tt+2]=et>>>16&255,o[tt+3]=et>>>24}Writer$1.prototype.fixed32=function et(o){return this._push(writeFixed32,4,o>>>0)};Writer$1.prototype.sfixed32=Writer$1.prototype.fixed32;Writer$1.prototype.fixed64=function et(o){var tt=LongBits$1.from(o);return this._push(writeFixed32,4,tt.lo)._push(writeFixed32,4,tt.hi)};Writer$1.prototype.sfixed64=Writer$1.prototype.fixed64;Writer$1.prototype.float=function et(o){return this._push(util$7.float.writeFloatLE,4,o)};Writer$1.prototype.double=function et(o){return this._push(util$7.float.writeDoubleLE,8,o)};var writeBytes=util$7.Array.prototype.set?function et(o,tt,rt){tt.set(o,rt)}:function et(o,tt,rt){for(var nt=0;nt<o.length;++nt)tt[rt+nt]=o[nt]};Writer$1.prototype.bytes=function et(o){var tt=o.length>>>0;if(!tt)return this._push(writeByte,1,0);if(util$7.isString(o)){var rt=Writer$1.alloc(tt=base64.length(o));base64.decode(o,rt,0),o=rt}return this.uint32(tt)._push(writeBytes,tt,o)};Writer$1.prototype.string=function et(o){var tt=utf8$1.length(o);return tt?this.uint32(tt)._push(utf8$1.write,tt,o):this._push(writeByte,1,0)};Writer$1.prototype.fork=function et(){return this.states=new State(this),this.head=this.tail=new Op(noop,0,0),this.len=0,this};Writer$1.prototype.reset=function et(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Op(noop,0,0),this.len=0),this};Writer$1.prototype.ldelim=function et(){var o=this.head,tt=this.tail,rt=this.len;return this.reset().uint32(rt),rt&&(this.tail.next=o.next,this.tail=tt,this.len+=rt),this};Writer$1.prototype.finish=function et(){for(var o=this.head.next,tt=this.constructor.alloc(this.len),rt=0;o;)o.fn(o.val,tt,rt),rt+=o.len,o=o.next;return tt};Writer$1._configure=function(et){BufferWriter$1=et,Writer$1.create=create$2(),BufferWriter$1._configure()};var writer_buffer=BufferWriter,Writer=writer;(BufferWriter.prototype=Object.create(Writer.prototype)).constructor=BufferWriter;var util$6=requireMinimal();function BufferWriter(){Writer.call(this)}BufferWriter._configure=function(){BufferWriter.alloc=util$6._Buffer_allocUnsafe,BufferWriter.writeBytesBuffer=util$6.Buffer&&util$6.Buffer.prototype instanceof Uint8Array&&util$6.Buffer.prototype.set.name==="set"?function(o,tt,rt){tt.set(o,rt)}:function(o,tt,rt){if(o.copy)o.copy(tt,rt,0,o.length);else for(var nt=0;nt<o.length;)tt[rt++]=o[nt++]}};BufferWriter.prototype.bytes=function et(o){util$6.isString(o)&&(o=util$6._Buffer_from(o,"base64"));var tt=o.length>>>0;return this.uint32(tt),tt&&this._push(BufferWriter.writeBytesBuffer,tt,o),this};function writeStringBuffer(et,o,tt){et.length<40?util$6.utf8.write(et,o,tt):o.utf8Write?o.utf8Write(et,tt):o.write(et,tt)}BufferWriter.prototype.string=function et(o){var tt=util$6.Buffer.byteLength(o);return this.uint32(tt),tt&&this._push(writeStringBuffer,tt,o),this};BufferWriter._configure();var reader=Reader$1,util$5=requireMinimal(),BufferReader$1,LongBits=util$5.LongBits,utf8=util$5.utf8;function indexOutOfRange(et,o){return RangeError("index out of range: "+et.pos+" + "+(o||1)+" > "+et.len)}function Reader$1(et){this.buf=et,this.pos=0,this.len=et.length}var create_array=typeof Uint8Array<"u"?function et(o){if(o instanceof Uint8Array||Array.isArray(o))return new Reader$1(o);throw Error("illegal buffer")}:function et(o){if(Array.isArray(o))return new Reader$1(o);throw Error("illegal buffer")},create$1=function et(){return util$5.Buffer?function(tt){return(Reader$1.create=function(nt){return util$5.Buffer.isBuffer(nt)?new BufferReader$1(nt):create_array(nt)})(tt)}:create_array};Reader$1.create=create$1();Reader$1.prototype._slice=util$5.Array.prototype.subarray||util$5.Array.prototype.slice;Reader$1.prototype.uint32=function et(){var o=4294967295;return function(){if(o=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(o=(o|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(o=(o|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(o=(o|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(o=(o|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return o;if((this.pos+=5)>this.len)throw this.pos=this.len,indexOutOfRange(this,10);return o}}();Reader$1.prototype.int32=function et(){return this.uint32()|0};Reader$1.prototype.sint32=function et(){var o=this.uint32();return o>>>1^-(o&1)|0};function readLongVarint(){var et=new LongBits(0,0),o=0;if(this.len-this.pos>4){for(;o<4;++o)if(et.lo=(et.lo|(this.buf[this.pos]&127)<<o*7)>>>0,this.buf[this.pos++]<128)return et;if(et.lo=(et.lo|(this.buf[this.pos]&127)<<28)>>>0,et.hi=(et.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return et;o=0}else{for(;o<3;++o){if(this.pos>=this.len)throw indexOutOfRange(this);if(et.lo=(et.lo|(this.buf[this.pos]&127)<<o*7)>>>0,this.buf[this.pos++]<128)return et}return et.lo=(et.lo|(this.buf[this.pos++]&127)<<o*7)>>>0,et}if(this.len-this.pos>4){for(;o<5;++o)if(et.hi=(et.hi|(this.buf[this.pos]&127)<<o*7+3)>>>0,this.buf[this.pos++]<128)return et}else for(;o<5;++o){if(this.pos>=this.len)throw indexOutOfRange(this);if(et.hi=(et.hi|(this.buf[this.pos]&127)<<o*7+3)>>>0,this.buf[this.pos++]<128)return et}throw Error("invalid varint encoding")}Reader$1.prototype.bool=function et(){return this.uint32()!==0};function readFixed32_end(et,o){return(et[o-4]|et[o-3]<<8|et[o-2]<<16|et[o-1]<<24)>>>0}Reader$1.prototype.fixed32=function et(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)};Reader$1.prototype.sfixed32=function et(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)|0};function readFixed64(){if(this.pos+8>this.len)throw indexOutOfRange(this,8);return new LongBits(readFixed32_end(this.buf,this.pos+=4),readFixed32_end(this.buf,this.pos+=4))}Reader$1.prototype.float=function et(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);var o=util$5.float.readFloatLE(this.buf,this.pos);return this.pos+=4,o};Reader$1.prototype.double=function et(){if(this.pos+8>this.len)throw indexOutOfRange(this,4);var o=util$5.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,o};Reader$1.prototype.bytes=function et(){var o=this.uint32(),tt=this.pos,rt=this.pos+o;if(rt>this.len)throw indexOutOfRange(this,o);if(this.pos+=o,Array.isArray(this.buf))return this.buf.slice(tt,rt);if(tt===rt){var nt=util$5.Buffer;return nt?nt.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,tt,rt)};Reader$1.prototype.string=function et(){var o=this.bytes();return utf8.read(o,0,o.length)};Reader$1.prototype.skip=function et(o){if(typeof o=="number"){if(this.pos+o>this.len)throw indexOutOfRange(this,o);this.pos+=o}else do if(this.pos>=this.len)throw indexOutOfRange(this);while(this.buf[this.pos++]&128);return this};Reader$1.prototype.skipType=function(et){switch(et){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(et=this.uint32()&7)!==4;)this.skipType(et);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+et+" at offset "+this.pos)}return this};Reader$1._configure=function(et){BufferReader$1=et,Reader$1.create=create$1(),BufferReader$1._configure();var o=util$5.Long?"toLong":"toNumber";util$5.merge(Reader$1.prototype,{int64:function(){return readLongVarint.call(this)[o](!1)},uint64:function(){return readLongVarint.call(this)[o](!0)},sint64:function(){return readLongVarint.call(this).zzDecode()[o](!1)},fixed64:function(){return readFixed64.call(this)[o](!0)},sfixed64:function(){return readFixed64.call(this)[o](!1)}})};var reader_buffer=BufferReader,Reader=reader;(BufferReader.prototype=Object.create(Reader.prototype)).constructor=BufferReader;var util$4=requireMinimal();function BufferReader(et){Reader.call(this,et)}BufferReader._configure=function(){util$4.Buffer&&(BufferReader.prototype._slice=util$4.Buffer.prototype.slice)};BufferReader.prototype.string=function et(){var o=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+o,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+o,this.len))};BufferReader._configure();var rpc={},service$1=Service$1,util$3=requireMinimal();(Service$1.prototype=Object.create(util$3.EventEmitter.prototype)).constructor=Service$1;function Service$1(et,o,tt){if(typeof et!="function")throw TypeError("rpcImpl must be a function");util$3.EventEmitter.call(this),this.rpcImpl=et,this.requestDelimited=!!o,this.responseDelimited=!!tt}Service$1.prototype.rpcCall=function et(o,tt,rt,nt,ot){if(!nt)throw TypeError("request must be specified");var it=this;if(!ot)return util$3.asPromise(et,it,o,tt,rt,nt);if(!it.rpcImpl){setTimeout(function(){ot(Error("already ended"))},0);return}try{return it.rpcImpl(o,tt[it.requestDelimited?"encodeDelimited":"encode"](nt).finish(),function(at,ct){if(at)return it.emit("error",at,o),ot(at);if(ct===null){it.end(!0);return}if(!(ct instanceof rt))try{ct=rt[it.responseDelimited?"decodeDelimited":"decode"](ct)}catch(lt){return it.emit("error",lt,o),ot(lt)}return it.emit("data",ct,o),ot(null,ct)})}catch(st){it.emit("error",st,o),setTimeout(function(){ot(st)},0);return}};Service$1.prototype.end=function et(o){return this.rpcImpl&&(o||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this};(function(et){var o=et;o.Service=service$1})(rpc);var roots={};(function(et){var o=et;o.build="minimal",o.Writer=writer,o.BufferWriter=writer_buffer,o.Reader=reader,o.BufferReader=reader_buffer,o.util=requireMinimal(),o.rpc=rpc,o.roots=roots,o.configure=tt;function tt(){o.util._configure(),o.Writer._configure(o.BufferWriter),o.Reader._configure(o.BufferReader)}tt()})(indexMinimal);var util$2={exports:{}},codegen_1=codegen;function codegen(et,o){typeof et=="string"&&(o=et,et=void 0);var tt=[];function rt(ot){if(typeof ot!="string"){var it=nt();if(codegen.verbose&&console.log("codegen: "+it),it="return "+it,ot){for(var st=Object.keys(ot),at=new Array(st.length+1),ct=new Array(st.length),lt=0;lt<st.length;)at[lt]=st[lt],ct[lt]=ot[st[lt++]];return at[lt]=it,Function.apply(null,at).apply(null,ct)}return Function(it)()}for(var dt=new Array(arguments.length-1),ht=0;ht<dt.length;)dt[ht]=arguments[++ht];if(ht=0,ot=ot.replace(/%([%dfijs])/g,function(ft,pt){var yt=dt[ht++];switch(pt){case"d":case"f":return String(Number(yt));case"i":return String(Math.floor(yt));case"j":return JSON.stringify(yt);case"s":return String(yt)}return"%"}),ht!==dt.length)throw Error("parameter count mismatch");return tt.push(ot),rt}function nt(ot){return"function "+(ot||o||"")+"("+(et&&et.join(",")||"")+`){
`+tt.join(`
`)+`
}`}return rt.toString=nt,rt}codegen.verbose=!1;var fetch_1=fetch$1,asPromise=aspromise,inquire=inquire_1,fs=inquire("fs");function fetch$1(et,o,tt){return typeof o=="function"?(tt=o,o={}):o||(o={}),tt?!o.xhr&&fs&&fs.readFile?fs.readFile(et,function(nt,ot){return nt&&typeof XMLHttpRequest<"u"?fetch$1.xhr(et,o,tt):nt?tt(nt):tt(null,o.binary?ot:ot.toString("utf8"))}):fetch$1.xhr(et,o,tt):asPromise(fetch$1,this,et,o)}fetch$1.xhr=function et(o,tt,rt){var nt=new XMLHttpRequest;nt.onreadystatechange=function(){if(nt.readyState===4){if(nt.status!==0&&nt.status!==200)return rt(Error("status "+nt.status));if(tt.binary){var it=nt.response;if(!it){it=[];for(var st=0;st<nt.responseText.length;++st)it.push(nt.responseText.charCodeAt(st)&255)}return rt(null,typeof Uint8Array<"u"?new Uint8Array(it):it)}return rt(null,nt.responseText)}},tt.binary&&("overrideMimeType"in nt&&nt.overrideMimeType("text/plain; charset=x-user-defined"),nt.responseType="arraybuffer"),nt.open("GET",o),nt.send()};var path={};(function(et){var o=et,tt=o.isAbsolute=function(ot){return/^(?:\/|\w+:)/.test(ot)},rt=o.normalize=function(ot){ot=ot.replace(/\\/g,"/").replace(/\/{2,}/g,"/");var it=ot.split("/"),st=tt(ot),at="";st&&(at=it.shift()+"/");for(var ct=0;ct<it.length;)it[ct]===".."?ct>0&&it[ct-1]!==".."?it.splice(--ct,2):st?it.splice(ct,1):++ct:it[ct]==="."?it.splice(ct,1):++ct;return at+it.join("/")};o.resolve=function(ot,it,st){return st||(it=rt(it)),tt(it)?it:(st||(ot=rt(ot)),(ot=ot.replace(/(?:\/|^)[^/]+$/,"")).length?rt(ot+"/"+it):it)}})(path);var types$2={},hasRequiredTypes;function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1,function(et){var o=et,tt=requireUtil(),rt=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function nt(ot,it){var st=0,at={};for(it|=0;st<ot.length;)at[rt[st+it]]=ot[st++];return at}o.basic=nt([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),o.defaults=nt([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",tt.emptyArray,null]),o.long=nt([0,0,0,1,1],7),o.mapKey=nt([0,0,0,5,5,0,0,0,1,1,0,2],2),o.packed=nt([1,5,0,0,0,5,5,0,0,0,1,1,0])}(types$2)),types$2}var field,hasRequiredField;function requireField(){if(hasRequiredField)return field;hasRequiredField=1,field=it;var et=requireObject();((it.prototype=Object.create(et.prototype)).constructor=it).className="Field";var o=require_enum(),tt=requireTypes(),rt=requireUtil(),nt,ot=/^required|optional|repeated$/;it.fromJSON=function(at,ct){return new it(at,ct.id,ct.type,ct.rule,ct.extend,ct.options,ct.comment)};function it(st,at,ct,lt,dt,ht,mt){if(rt.isObject(lt)?(mt=dt,ht=lt,lt=dt=void 0):rt.isObject(dt)&&(mt=ht,ht=dt,dt=void 0),et.call(this,st,ht),!rt.isInteger(at)||at<0)throw TypeError("id must be a non-negative integer");if(!rt.isString(ct))throw TypeError("type must be a string");if(lt!==void 0&&!ot.test(lt=lt.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(dt!==void 0&&!rt.isString(dt))throw TypeError("extend must be a string");lt==="proto3_optional"&&(lt="optional"),this.rule=lt&&lt!=="optional"?lt:void 0,this.type=ct,this.id=at,this.extend=dt||void 0,this.required=lt==="required",this.optional=!this.required,this.repeated=lt==="repeated",this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=rt.Long?tt.long[ct]!==void 0:!1,this.bytes=ct==="bytes",this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=mt}return Object.defineProperty(it.prototype,"packed",{get:function(){return this._packed===null&&(this._packed=this.getOption("packed")!==!1),this._packed}}),it.prototype.setOption=function(at,ct,lt){return at==="packed"&&(this._packed=null),et.prototype.setOption.call(this,at,ct,lt)},it.prototype.toJSON=function(at){var ct=at?!!at.keepComments:!1;return rt.toObject(["rule",this.rule!=="optional"&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",ct?this.comment:void 0])},it.prototype.resolve=function(){if(this.resolved)return this;if((this.typeDefault=tt.defaults[this.type])===void 0?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof nt?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&this.options.default!=null&&(this.typeDefault=this.options.default,this.resolvedType instanceof o&&typeof this.typeDefault=="string"&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&((this.options.packed===!0||this.options.packed!==void 0&&this.resolvedType&&!(this.resolvedType instanceof o))&&delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=rt.Long.fromNumber(this.typeDefault,this.type.charAt(0)==="u"),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&typeof this.typeDefault=="string"){var at;rt.base64.test(this.typeDefault)?rt.base64.decode(this.typeDefault,at=rt.newBuffer(rt.base64.length(this.typeDefault)),0):rt.utf8.write(this.typeDefault,at=rt.newBuffer(rt.utf8.length(this.typeDefault)),0),this.typeDefault=at}return this.map?this.defaultValue=rt.emptyObject:this.repeated?this.defaultValue=rt.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof nt&&(this.parent.ctor.prototype[this.name]=this.defaultValue),et.prototype.resolve.call(this)},it.d=function(at,ct,lt,dt){return typeof ct=="function"?ct=rt.decorateType(ct).name:ct&&typeof ct=="object"&&(ct=rt.decorateEnum(ct).name),function(mt,ft){rt.decorateType(mt.constructor).add(new it(ft,at,ct,lt,{default:dt}))}},it._configure=function(at){nt=at},field}var oneof,hasRequiredOneof;function requireOneof(){if(hasRequiredOneof)return oneof;hasRequiredOneof=1,oneof=rt;var et=requireObject();((rt.prototype=Object.create(et.prototype)).constructor=rt).className="OneOf";var o=requireField(),tt=requireUtil();function rt(ot,it,st,at){if(Array.isArray(it)||(st=it,it=void 0),et.call(this,ot,st),!(it===void 0||Array.isArray(it)))throw TypeError("fieldNames must be an Array");this.oneof=it||[],this.fieldsArray=[],this.comment=at}rt.fromJSON=function(it,st){return new rt(it,st.oneof,st.options,st.comment)},rt.prototype.toJSON=function(it){var st=it?!!it.keepComments:!1;return tt.toObject(["options",this.options,"oneof",this.oneof,"comment",st?this.comment:void 0])};function nt(ot){if(ot.parent)for(var it=0;it<ot.fieldsArray.length;++it)ot.fieldsArray[it].parent||ot.parent.add(ot.fieldsArray[it])}return rt.prototype.add=function(it){if(!(it instanceof o))throw TypeError("field must be a Field");return it.parent&&it.parent!==this.parent&&it.parent.remove(it),this.oneof.push(it.name),this.fieldsArray.push(it),it.partOf=this,nt(this),this},rt.prototype.remove=function(it){if(!(it instanceof o))throw TypeError("field must be a Field");var st=this.fieldsArray.indexOf(it);if(st<0)throw Error(it+" is not a member of "+this);return this.fieldsArray.splice(st,1),st=this.oneof.indexOf(it.name),st>-1&&this.oneof.splice(st,1),it.partOf=null,this},rt.prototype.onAdd=function(it){et.prototype.onAdd.call(this,it);for(var st=this,at=0;at<this.oneof.length;++at){var ct=it.get(this.oneof[at]);ct&&!ct.partOf&&(ct.partOf=st,st.fieldsArray.push(ct))}nt(this)},rt.prototype.onRemove=function(it){for(var st=0,at;st<this.fieldsArray.length;++st)(at=this.fieldsArray[st]).parent&&at.parent.remove(at);et.prototype.onRemove.call(this,it)},rt.d=function(){for(var it=new Array(arguments.length),st=0;st<arguments.length;)it[st]=arguments[st++];return function(ct,lt){tt.decorateType(ct.constructor).add(new rt(lt,it)),Object.defineProperty(ct,lt,{get:tt.oneOfGetter(it),set:tt.oneOfSetter(it)})}},oneof}var namespace,hasRequiredNamespace;function requireNamespace(){if(hasRequiredNamespace)return namespace;hasRequiredNamespace=1,namespace=at;var et=requireObject();((at.prototype=Object.create(et.prototype)).constructor=at).className="Namespace";var o=requireField(),tt=requireUtil(),rt=requireOneof(),nt,ot,it;at.fromJSON=function(dt,ht){return new at(dt,ht.options).addJSON(ht.nested)};function st(lt,dt){if(lt&&lt.length){for(var ht={},mt=0;mt<lt.length;++mt)ht[lt[mt].name]=lt[mt].toJSON(dt);return ht}}at.arrayToJSON=st,at.isReservedId=function(dt,ht){if(dt){for(var mt=0;mt<dt.length;++mt)if(typeof dt[mt]!="string"&&dt[mt][0]<=ht&&dt[mt][1]>ht)return!0}return!1},at.isReservedName=function(dt,ht){if(dt){for(var mt=0;mt<dt.length;++mt)if(dt[mt]===ht)return!0}return!1};function at(lt,dt){et.call(this,lt,dt),this.nested=void 0,this._nestedArray=null}function ct(lt){return lt._nestedArray=null,lt}return Object.defineProperty(at.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=tt.toArray(this.nested))}}),at.prototype.toJSON=function(dt){return tt.toObject(["options",this.options,"nested",st(this.nestedArray,dt)])},at.prototype.addJSON=function(dt){var ht=this;if(dt)for(var mt=Object.keys(dt),ft=0,pt;ft<mt.length;++ft)pt=dt[mt[ft]],ht.add((pt.fields!==void 0?nt.fromJSON:pt.values!==void 0?it.fromJSON:pt.methods!==void 0?ot.fromJSON:pt.id!==void 0?o.fromJSON:at.fromJSON)(mt[ft],pt));return this},at.prototype.get=function(dt){return this.nested&&this.nested[dt]||null},at.prototype.getEnum=function(dt){if(this.nested&&this.nested[dt]instanceof it)return this.nested[dt].values;throw Error("no such enum: "+dt)},at.prototype.add=function(dt){if(!(dt instanceof o&&dt.extend!==void 0||dt instanceof nt||dt instanceof rt||dt instanceof it||dt instanceof ot||dt instanceof at))throw TypeError("object must be a valid nested object");if(!this.nested)this.nested={};else{var ht=this.get(dt.name);if(ht)if(ht instanceof at&&dt instanceof at&&!(ht instanceof nt||ht instanceof ot)){for(var mt=ht.nestedArray,ft=0;ft<mt.length;++ft)dt.add(mt[ft]);this.remove(ht),this.nested||(this.nested={}),dt.setOptions(ht.options,!0)}else throw Error("duplicate name '"+dt.name+"' in "+this)}return this.nested[dt.name]=dt,dt.onAdd(this),ct(this)},at.prototype.remove=function(dt){if(!(dt instanceof et))throw TypeError("object must be a ReflectionObject");if(dt.parent!==this)throw Error(dt+" is not a member of "+this);return delete this.nested[dt.name],Object.keys(this.nested).length||(this.nested=void 0),dt.onRemove(this),ct(this)},at.prototype.define=function(dt,ht){if(tt.isString(dt))dt=dt.split(".");else if(!Array.isArray(dt))throw TypeError("illegal path");if(dt&&dt.length&&dt[0]==="")throw Error("path must be relative");for(var mt=this;dt.length>0;){var ft=dt.shift();if(mt.nested&&mt.nested[ft]){if(mt=mt.nested[ft],!(mt instanceof at))throw Error("path conflicts with non-namespace objects")}else mt.add(mt=new at(ft))}return ht&&mt.addJSON(ht),mt},at.prototype.resolveAll=function(){for(var dt=this.nestedArray,ht=0;ht<dt.length;)dt[ht]instanceof at?dt[ht++].resolveAll():dt[ht++].resolve();return this.resolve()},at.prototype.lookup=function(dt,ht,mt){if(typeof ht=="boolean"?(mt=ht,ht=void 0):ht&&!Array.isArray(ht)&&(ht=[ht]),tt.isString(dt)&&dt.length){if(dt===".")return this.root;dt=dt.split(".")}else if(!dt.length)return this;if(dt[0]==="")return this.root.lookup(dt.slice(1),ht);var ft=this.get(dt[0]);if(ft){if(dt.length===1){if(!ht||ht.indexOf(ft.constructor)>-1)return ft}else if(ft instanceof at&&(ft=ft.lookup(dt.slice(1),ht,!0)))return ft}else for(var pt=0;pt<this.nestedArray.length;++pt)if(this._nestedArray[pt]instanceof at&&(ft=this._nestedArray[pt].lookup(dt,ht,!0)))return ft;return this.parent===null||mt?null:this.parent.lookup(dt,ht)},at.prototype.lookupType=function(dt){var ht=this.lookup(dt,[nt]);if(!ht)throw Error("no such type: "+dt);return ht},at.prototype.lookupEnum=function(dt){var ht=this.lookup(dt,[it]);if(!ht)throw Error("no such Enum '"+dt+"' in "+this);return ht},at.prototype.lookupTypeOrEnum=function(dt){var ht=this.lookup(dt,[nt,it]);if(!ht)throw Error("no such Type or Enum '"+dt+"' in "+this);return ht},at.prototype.lookupService=function(dt){var ht=this.lookup(dt,[ot]);if(!ht)throw Error("no such Service '"+dt+"' in "+this);return ht},at._configure=function(lt,dt,ht){nt=lt,ot=dt,it=ht},namespace}var mapfield,hasRequiredMapfield;function requireMapfield(){if(hasRequiredMapfield)return mapfield;hasRequiredMapfield=1,mapfield=rt;var et=requireField();((rt.prototype=Object.create(et.prototype)).constructor=rt).className="MapField";var o=requireTypes(),tt=requireUtil();function rt(nt,ot,it,st,at,ct){if(et.call(this,nt,ot,st,void 0,void 0,at,ct),!tt.isString(it))throw TypeError("keyType must be a string");this.keyType=it,this.resolvedKeyType=null,this.map=!0}return rt.fromJSON=function(ot,it){return new rt(ot,it.id,it.keyType,it.type,it.options,it.comment)},rt.prototype.toJSON=function(ot){var it=ot?!!ot.keepComments:!1;return tt.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",it?this.comment:void 0])},rt.prototype.resolve=function(){if(this.resolved)return this;if(o.mapKey[this.keyType]===void 0)throw Error("invalid key type: "+this.keyType);return et.prototype.resolve.call(this)},rt.d=function(ot,it,st){return typeof st=="function"?st=tt.decorateType(st).name:st&&typeof st=="object"&&(st=tt.decorateEnum(st).name),function(ct,lt){tt.decorateType(ct.constructor).add(new rt(lt,ot,it,st))}},mapfield}var method,hasRequiredMethod;function requireMethod(){if(hasRequiredMethod)return method;hasRequiredMethod=1,method=tt;var et=requireObject();((tt.prototype=Object.create(et.prototype)).constructor=tt).className="Method";var o=requireUtil();function tt(rt,nt,ot,it,st,at,ct,lt,dt){if(o.isObject(st)?(ct=st,st=at=void 0):o.isObject(at)&&(ct=at,at=void 0),!(nt===void 0||o.isString(nt)))throw TypeError("type must be a string");if(!o.isString(ot))throw TypeError("requestType must be a string");if(!o.isString(it))throw TypeError("responseType must be a string");et.call(this,rt,ct),this.type=nt||"rpc",this.requestType=ot,this.requestStream=st?!0:void 0,this.responseType=it,this.responseStream=at?!0:void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=lt,this.parsedOptions=dt}return tt.fromJSON=function(nt,ot){return new tt(nt,ot.type,ot.requestType,ot.responseType,ot.requestStream,ot.responseStream,ot.options,ot.comment,ot.parsedOptions)},tt.prototype.toJSON=function(nt){var ot=nt?!!nt.keepComments:!1;return o.toObject(["type",this.type!=="rpc"&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",ot?this.comment:void 0,"parsedOptions",this.parsedOptions])},tt.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),et.prototype.resolve.call(this))},method}var service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=nt;var et=requireNamespace();((nt.prototype=Object.create(et.prototype)).constructor=nt).className="Service";var o=requireMethod(),tt=requireUtil(),rt=rpc;function nt(it,st){et.call(this,it,st),this.methods={},this._methodsArray=null}nt.fromJSON=function(st,at){var ct=new nt(st,at.options);if(at.methods)for(var lt=Object.keys(at.methods),dt=0;dt<lt.length;++dt)ct.add(o.fromJSON(lt[dt],at.methods[lt[dt]]));return at.nested&&ct.addJSON(at.nested),ct.comment=at.comment,ct},nt.prototype.toJSON=function(st){var at=et.prototype.toJSON.call(this,st),ct=st?!!st.keepComments:!1;return tt.toObject(["options",at&&at.options||void 0,"methods",et.arrayToJSON(this.methodsArray,st)||{},"nested",at&&at.nested||void 0,"comment",ct?this.comment:void 0])},Object.defineProperty(nt.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=tt.toArray(this.methods))}});function ot(it){return it._methodsArray=null,it}return nt.prototype.get=function(st){return this.methods[st]||et.prototype.get.call(this,st)},nt.prototype.resolveAll=function(){for(var st=this.methodsArray,at=0;at<st.length;++at)st[at].resolve();return et.prototype.resolve.call(this)},nt.prototype.add=function(st){if(this.get(st.name))throw Error("duplicate name '"+st.name+"' in "+this);return st instanceof o?(this.methods[st.name]=st,st.parent=this,ot(this)):et.prototype.add.call(this,st)},nt.prototype.remove=function(st){if(st instanceof o){if(this.methods[st.name]!==st)throw Error(st+" is not a member of "+this);return delete this.methods[st.name],st.parent=null,ot(this)}return et.prototype.remove.call(this,st)},nt.prototype.create=function(st,at,ct){for(var lt=new rt.Service(st,at,ct),dt=0,ht;dt<this.methodsArray.length;++dt){var mt=tt.lcFirst((ht=this._methodsArray[dt]).resolve().name).replace(/[^$\w_]/g,"");lt[mt]=tt.codegen(["r","c"],tt.isReserved(mt)?mt+"_":mt)("return this.rpcCall(m,q,s,r,c)")({m:ht,q:ht.resolvedRequestType.ctor,s:ht.resolvedResponseType.ctor})}return lt},service}var message=Message,util$1=requireMinimal();function Message(et){if(et)for(var o=Object.keys(et),tt=0;tt<o.length;++tt)this[o[tt]]=et[o[tt]]}Message.create=function et(o){return this.$type.create(o)};Message.encode=function et(o,tt){return this.$type.encode(o,tt)};Message.encodeDelimited=function et(o,tt){return this.$type.encodeDelimited(o,tt)};Message.decode=function et(o){return this.$type.decode(o)};Message.decodeDelimited=function et(o){return this.$type.decodeDelimited(o)};Message.verify=function et(o){return this.$type.verify(o)};Message.fromObject=function et(o){return this.$type.fromObject(o)};Message.toObject=function et(o,tt){return this.$type.toObject(o,tt)};Message.prototype.toJSON=function et(){return this.$type.toObject(this,util$1.toJSONOptions)};var decoder_1,hasRequiredDecoder;function requireDecoder(){if(hasRequiredDecoder)return decoder_1;hasRequiredDecoder=1,decoder_1=nt;var et=require_enum(),o=requireTypes(),tt=requireUtil();function rt(ot){return"missing required '"+ot.name+"'"}function nt(ot){var it=tt.codegen(["r","l"],ot.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(ot.fieldsArray.filter(function(ht){return ht.map}).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");ot.group&&it("if((t&7)===4)")("break"),it("switch(t>>>3){");for(var st=0;st<ot.fieldsArray.length;++st){var at=ot._fieldsArray[st].resolve(),ct=at.resolvedType instanceof et?"int32":at.type,lt="m"+tt.safeProp(at.name);it("case %i: {",at.id),at.map?(it("if(%s===util.emptyObject)",lt)("%s={}",lt)("var c2 = r.uint32()+r.pos"),o.defaults[at.keyType]!==void 0?it("k=%j",o.defaults[at.keyType]):it("k=null"),o.defaults[ct]!==void 0?it("value=%j",o.defaults[ct]):it("value=null"),it("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",at.keyType)("case 2:"),o.basic[ct]===void 0?it("value=types[%i].decode(r,r.uint32())",st):it("value=r.%s()",ct),it("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),o.long[at.keyType]!==void 0?it('%s[typeof k==="object"?util.longToHash(k):k]=value',lt):it("%s[k]=value",lt)):at.repeated?(it("if(!(%s&&%s.length))",lt,lt)("%s=[]",lt),o.packed[ct]!==void 0&&it("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",lt,ct)("}else"),o.basic[ct]===void 0?it(at.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",lt,st):it("%s.push(r.%s())",lt,ct)):o.basic[ct]===void 0?it(at.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",lt,st):it("%s=r.%s()",lt,ct),it("break")("}")}for(it("default:")("r.skipType(t&7)")("break")("}")("}"),st=0;st<ot._fieldsArray.length;++st){var dt=ot._fieldsArray[st];dt.required&&it("if(!m.hasOwnProperty(%j))",dt.name)("throw util.ProtocolError(%j,{instance:m})",rt(dt))}return it("return m")}return decoder_1}var verifier_1,hasRequiredVerifier;function requireVerifier(){if(hasRequiredVerifier)return verifier_1;hasRequiredVerifier=1,verifier_1=ot;var et=require_enum(),o=requireUtil();function tt(it,st){return it.name+": "+st+(it.repeated&&st!=="array"?"[]":it.map&&st!=="object"?"{k:"+it.keyType+"}":"")+" expected"}function rt(it,st,at,ct){if(st.resolvedType)if(st.resolvedType instanceof et){it("switch(%s){",ct)("default:")("return%j",tt(st,"enum value"));for(var lt=Object.keys(st.resolvedType.values),dt=0;dt<lt.length;++dt)it("case %i:",st.resolvedType.values[lt[dt]]);it("break")("}")}else it("{")("var e=types[%i].verify(%s);",at,ct)("if(e)")("return%j+e",st.name+".")("}");else switch(st.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":it("if(!util.isInteger(%s))",ct)("return%j",tt(st,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":it("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",ct,ct,ct,ct)("return%j",tt(st,"integer|Long"));break;case"float":case"double":it('if(typeof %s!=="number")',ct)("return%j",tt(st,"number"));break;case"bool":it('if(typeof %s!=="boolean")',ct)("return%j",tt(st,"boolean"));break;case"string":it("if(!util.isString(%s))",ct)("return%j",tt(st,"string"));break;case"bytes":it('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',ct,ct,ct)("return%j",tt(st,"buffer"));break}return it}function nt(it,st,at){switch(st.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":it("if(!util.key32Re.test(%s))",at)("return%j",tt(st,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":it("if(!util.key64Re.test(%s))",at)("return%j",tt(st,"integer|Long key"));break;case"bool":it("if(!util.key2Re.test(%s))",at)("return%j",tt(st,"boolean key"));break}return it}function ot(it){var st=o.codegen(["m"],it.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),at=it.oneofsArray,ct={};at.length&&st("var p={}");for(var lt=0;lt<it.fieldsArray.length;++lt){var dt=it._fieldsArray[lt].resolve(),ht="m"+o.safeProp(dt.name);if(dt.optional&&st("if(%s!=null&&m.hasOwnProperty(%j)){",ht,dt.name),dt.map)st("if(!util.isObject(%s))",ht)("return%j",tt(dt,"object"))("var k=Object.keys(%s)",ht)("for(var i=0;i<k.length;++i){"),nt(st,dt,"k[i]"),rt(st,dt,lt,ht+"[k[i]]")("}");else if(dt.repeated)st("if(!Array.isArray(%s))",ht)("return%j",tt(dt,"array"))("for(var i=0;i<%s.length;++i){",ht),rt(st,dt,lt,ht+"[i]")("}");else{if(dt.partOf){var mt=o.safeProp(dt.partOf.name);ct[dt.partOf.name]===1&&st("if(p%s===1)",mt)("return%j",dt.partOf.name+": multiple values"),ct[dt.partOf.name]=1,st("p%s=1",mt)}rt(st,dt,lt,ht)}dt.optional&&st("}")}return st("return null")}return verifier_1}var converter={},hasRequiredConverter;function requireConverter(){return hasRequiredConverter||(hasRequiredConverter=1,function(et){var o=et,tt=require_enum(),rt=requireUtil();function nt(it,st,at,ct){var lt=!1;if(st.resolvedType)if(st.resolvedType instanceof tt){it("switch(d%s){",ct);for(var dt=st.resolvedType.values,ht=Object.keys(dt),mt=0;mt<ht.length;++mt)dt[ht[mt]]===st.typeDefault&&!lt&&(it("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',ct,ct,ct),st.repeated||it("break"),lt=!0),it("case%j:",ht[mt])("case %i:",dt[ht[mt]])("m%s=%j",ct,dt[ht[mt]])("break");it("}")}else it('if(typeof d%s!=="object")',ct)("throw TypeError(%j)",st.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",ct,at,ct);else{var ft=!1;switch(st.type){case"double":case"float":it("m%s=Number(d%s)",ct,ct);break;case"uint32":case"fixed32":it("m%s=d%s>>>0",ct,ct);break;case"int32":case"sint32":case"sfixed32":it("m%s=d%s|0",ct,ct);break;case"uint64":ft=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":it("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",ct,ct,ft)('else if(typeof d%s==="string")',ct)("m%s=parseInt(d%s,10)",ct,ct)('else if(typeof d%s==="number")',ct)("m%s=d%s",ct,ct)('else if(typeof d%s==="object")',ct)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",ct,ct,ct,ft?"true":"");break;case"bytes":it('if(typeof d%s==="string")',ct)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",ct,ct,ct)("else if(d%s.length >= 0)",ct)("m%s=d%s",ct,ct);break;case"string":it("m%s=String(d%s)",ct,ct);break;case"bool":it("m%s=Boolean(d%s)",ct,ct);break}}return it}o.fromObject=function(st){var at=st.fieldsArray,ct=rt.codegen(["d"],st.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!at.length)return ct("return new this.ctor");ct("var m=new this.ctor");for(var lt=0;lt<at.length;++lt){var dt=at[lt].resolve(),ht=rt.safeProp(dt.name);dt.map?(ct("if(d%s){",ht)('if(typeof d%s!=="object")',ht)("throw TypeError(%j)",dt.fullName+": object expected")("m%s={}",ht)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",ht),nt(ct,dt,lt,ht+"[ks[i]]")("}")("}")):dt.repeated?(ct("if(d%s){",ht)("if(!Array.isArray(d%s))",ht)("throw TypeError(%j)",dt.fullName+": array expected")("m%s=[]",ht)("for(var i=0;i<d%s.length;++i){",ht),nt(ct,dt,lt,ht+"[i]")("}")("}")):(dt.resolvedType instanceof tt||ct("if(d%s!=null){",ht),nt(ct,dt,lt,ht),dt.resolvedType instanceof tt||ct("}"))}return ct("return m")};function ot(it,st,at,ct){if(st.resolvedType)st.resolvedType instanceof tt?it("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",ct,at,ct,ct,at,ct,ct):it("d%s=types[%i].toObject(m%s,o)",ct,at,ct);else{var lt=!1;switch(st.type){case"double":case"float":it("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",ct,ct,ct,ct);break;case"uint64":lt=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":it('if(typeof m%s==="number")',ct)("d%s=o.longs===String?String(m%s):m%s",ct,ct,ct)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",ct,ct,ct,ct,lt?"true":"",ct);break;case"bytes":it("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",ct,ct,ct,ct,ct);break;default:it("d%s=m%s",ct,ct);break}}return it}o.toObject=function(st){var at=st.fieldsArray.slice().sort(rt.compareFieldsById);if(!at.length)return rt.codegen()("return {}");for(var ct=rt.codegen(["m","o"],st.name+"$toObject")("if(!o)")("o={}")("var d={}"),lt=[],dt=[],ht=[],mt=0;mt<at.length;++mt)at[mt].partOf||(at[mt].resolve().repeated?lt:at[mt].map?dt:ht).push(at[mt]);if(lt.length){for(ct("if(o.arrays||o.defaults){"),mt=0;mt<lt.length;++mt)ct("d%s=[]",rt.safeProp(lt[mt].name));ct("}")}if(dt.length){for(ct("if(o.objects||o.defaults){"),mt=0;mt<dt.length;++mt)ct("d%s={}",rt.safeProp(dt[mt].name));ct("}")}if(ht.length){for(ct("if(o.defaults){"),mt=0;mt<ht.length;++mt){var ft=ht[mt],pt=rt.safeProp(ft.name);if(ft.resolvedType instanceof tt)ct("d%s=o.enums===String?%j:%j",pt,ft.resolvedType.valuesById[ft.typeDefault],ft.typeDefault);else if(ft.long)ct("if(util.Long){")("var n=new util.Long(%i,%i,%j)",ft.typeDefault.low,ft.typeDefault.high,ft.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",pt)("}else")("d%s=o.longs===String?%j:%i",pt,ft.typeDefault.toString(),ft.typeDefault.toNumber());else if(ft.bytes){var yt="["+Array.prototype.slice.call(ft.typeDefault).join(",")+"]";ct("if(o.bytes===String)d%s=%j",pt,String.fromCharCode.apply(String,ft.typeDefault))("else{")("d%s=%s",pt,yt)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",pt,pt)("}")}else ct("d%s=%j",pt,ft.typeDefault)}ct("}")}var gt=!1;for(mt=0;mt<at.length;++mt){var ft=at[mt],bt=st._fieldsArray.indexOf(ft),pt=rt.safeProp(ft.name);ft.map?(gt||(gt=!0,ct("var ks2")),ct("if(m%s&&(ks2=Object.keys(m%s)).length){",pt,pt)("d%s={}",pt)("for(var j=0;j<ks2.length;++j){"),ot(ct,ft,bt,pt+"[ks2[j]]")("}")):ft.repeated?(ct("if(m%s&&m%s.length){",pt,pt)("d%s=[]",pt)("for(var j=0;j<m%s.length;++j){",pt),ot(ct,ft,bt,pt+"[j]")("}")):(ct("if(m%s!=null&&m.hasOwnProperty(%j)){",pt,ft.name),ot(ct,ft,bt,pt),ft.partOf&&ct("if(o.oneofs)")("d%s=%j",rt.safeProp(ft.partOf.name),ft.name)),ct("}")}return ct("return d")}}(converter)),converter}var wrappers={};(function(et){var o=et,tt=message;o[".google.protobuf.Any"]={fromObject:function(rt){if(rt&&rt["@type"]){var nt=rt["@type"].substring(rt["@type"].lastIndexOf("/")+1),ot=this.lookup(nt);if(ot){var it=rt["@type"].charAt(0)==="."?rt["@type"].slice(1):rt["@type"];return it.indexOf("/")===-1&&(it="/"+it),this.create({type_url:it,value:ot.encode(ot.fromObject(rt)).finish()})}}return this.fromObject(rt)},toObject:function(rt,nt){var ot="type.googleapis.com/",it="",st="";if(nt&&nt.json&&rt.type_url&&rt.value){st=rt.type_url.substring(rt.type_url.lastIndexOf("/")+1),it=rt.type_url.substring(0,rt.type_url.lastIndexOf("/")+1);var at=this.lookup(st);at&&(rt=at.decode(rt.value))}if(!(rt instanceof this.ctor)&&rt instanceof tt){var ct=rt.$type.toObject(rt,nt),lt=rt.$type.fullName[0]==="."?rt.$type.fullName.slice(1):rt.$type.fullName;return it===""&&(it=ot),st=it+lt,ct["@type"]=st,ct}return this.toObject(rt,nt)}}})(wrappers);var type,hasRequiredType;function requireType(){if(hasRequiredType)return type;hasRequiredType=1,type=pt;var et=requireNamespace();((pt.prototype=Object.create(et.prototype)).constructor=pt).className="Type";var o=require_enum(),tt=requireOneof(),rt=requireField(),nt=requireMapfield(),ot=requireService(),it=message,st=reader,at=writer,ct=requireUtil(),lt=requireEncoder(),dt=requireDecoder(),ht=requireVerifier(),mt=requireConverter(),ft=wrappers;function pt(gt,bt){et.call(this,gt,bt),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}Object.defineProperties(pt.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var gt=Object.keys(this.fields),bt=0;bt<gt.length;++bt){var xt=this.fields[gt[bt]],vt=xt.id;if(this._fieldsById[vt])throw Error("duplicate id "+vt+" in "+this);this._fieldsById[vt]=xt}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=ct.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=ct.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=pt.generateConstructor(this)())},set:function(gt){var bt=gt.prototype;bt instanceof it||((gt.prototype=new it).constructor=gt,ct.merge(gt.prototype,bt)),gt.$type=gt.prototype.$type=this,ct.merge(gt,it,!0),this._ctor=gt;for(var xt=0;xt<this.fieldsArray.length;++xt)this._fieldsArray[xt].resolve();var vt={};for(xt=0;xt<this.oneofsArray.length;++xt)vt[this._oneofsArray[xt].resolve().name]={get:ct.oneOfGetter(this._oneofsArray[xt].oneof),set:ct.oneOfSetter(this._oneofsArray[xt].oneof)};xt&&Object.defineProperties(gt.prototype,vt)}}}),pt.generateConstructor=function(bt){for(var xt=ct.codegen(["p"],bt.name),vt=0,Et;vt<bt.fieldsArray.length;++vt)(Et=bt._fieldsArray[vt]).map?xt("this%s={}",ct.safeProp(Et.name)):Et.repeated&&xt("this%s=[]",ct.safeProp(Et.name));return xt("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")};function yt(gt){return gt._fieldsById=gt._fieldsArray=gt._oneofsArray=null,delete gt.encode,delete gt.decode,delete gt.verify,gt}return pt.fromJSON=function(bt,xt){var vt=new pt(bt,xt.options);vt.extensions=xt.extensions,vt.reserved=xt.reserved;for(var Et=Object.keys(xt.fields),Ct=0;Ct<Et.length;++Ct)vt.add((typeof xt.fields[Et[Ct]].keyType<"u"?nt.fromJSON:rt.fromJSON)(Et[Ct],xt.fields[Et[Ct]]));if(xt.oneofs)for(Et=Object.keys(xt.oneofs),Ct=0;Ct<Et.length;++Ct)vt.add(tt.fromJSON(Et[Ct],xt.oneofs[Et[Ct]]));if(xt.nested)for(Et=Object.keys(xt.nested),Ct=0;Ct<Et.length;++Ct){var St=xt.nested[Et[Ct]];vt.add((St.id!==void 0?rt.fromJSON:St.fields!==void 0?pt.fromJSON:St.values!==void 0?o.fromJSON:St.methods!==void 0?ot.fromJSON:et.fromJSON)(Et[Ct],St))}return xt.extensions&&xt.extensions.length&&(vt.extensions=xt.extensions),xt.reserved&&xt.reserved.length&&(vt.reserved=xt.reserved),xt.group&&(vt.group=!0),xt.comment&&(vt.comment=xt.comment),vt},pt.prototype.toJSON=function(bt){var xt=et.prototype.toJSON.call(this,bt),vt=bt?!!bt.keepComments:!1;return ct.toObject(["options",xt&&xt.options||void 0,"oneofs",et.arrayToJSON(this.oneofsArray,bt),"fields",et.arrayToJSON(this.fieldsArray.filter(function(Et){return!Et.declaringField}),bt)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",xt&&xt.nested||void 0,"comment",vt?this.comment:void 0])},pt.prototype.resolveAll=function(){for(var bt=this.fieldsArray,xt=0;xt<bt.length;)bt[xt++].resolve();var vt=this.oneofsArray;for(xt=0;xt<vt.length;)vt[xt++].resolve();return et.prototype.resolveAll.call(this)},pt.prototype.get=function(bt){return this.fields[bt]||this.oneofs&&this.oneofs[bt]||this.nested&&this.nested[bt]||null},pt.prototype.add=function(bt){if(this.get(bt.name))throw Error("duplicate name '"+bt.name+"' in "+this);if(bt instanceof rt&&bt.extend===void 0){if(this._fieldsById?this._fieldsById[bt.id]:this.fieldsById[bt.id])throw Error("duplicate id "+bt.id+" in "+this);if(this.isReservedId(bt.id))throw Error("id "+bt.id+" is reserved in "+this);if(this.isReservedName(bt.name))throw Error("name '"+bt.name+"' is reserved in "+this);return bt.parent&&bt.parent.remove(bt),this.fields[bt.name]=bt,bt.message=this,bt.onAdd(this),yt(this)}return bt instanceof tt?(this.oneofs||(this.oneofs={}),this.oneofs[bt.name]=bt,bt.onAdd(this),yt(this)):et.prototype.add.call(this,bt)},pt.prototype.remove=function(bt){if(bt instanceof rt&&bt.extend===void 0){if(!this.fields||this.fields[bt.name]!==bt)throw Error(bt+" is not a member of "+this);return delete this.fields[bt.name],bt.parent=null,bt.onRemove(this),yt(this)}if(bt instanceof tt){if(!this.oneofs||this.oneofs[bt.name]!==bt)throw Error(bt+" is not a member of "+this);return delete this.oneofs[bt.name],bt.parent=null,bt.onRemove(this),yt(this)}return et.prototype.remove.call(this,bt)},pt.prototype.isReservedId=function(bt){return et.isReservedId(this.reserved,bt)},pt.prototype.isReservedName=function(bt){return et.isReservedName(this.reserved,bt)},pt.prototype.create=function(bt){return new this.ctor(bt)},pt.prototype.setup=function(){for(var bt=this.fullName,xt=[],vt=0;vt<this.fieldsArray.length;++vt)xt.push(this._fieldsArray[vt].resolve().resolvedType);this.encode=lt(this)({Writer:at,types:xt,util:ct}),this.decode=dt(this)({Reader:st,types:xt,util:ct}),this.verify=ht(this)({types:xt,util:ct}),this.fromObject=mt.fromObject(this)({types:xt,util:ct}),this.toObject=mt.toObject(this)({types:xt,util:ct});var Et=ft[bt];if(Et){var Ct=Object.create(this);Ct.fromObject=this.fromObject,this.fromObject=Et.fromObject.bind(Ct),Ct.toObject=this.toObject,this.toObject=Et.toObject.bind(Ct)}return this},pt.prototype.encode=function(bt,xt){return this.setup().encode(bt,xt)},pt.prototype.encodeDelimited=function(bt,xt){return this.encode(bt,xt&&xt.len?xt.fork():xt).ldelim()},pt.prototype.decode=function(bt,xt){return this.setup().decode(bt,xt)},pt.prototype.decodeDelimited=function(bt){return bt instanceof st||(bt=st.create(bt)),this.decode(bt,bt.uint32())},pt.prototype.verify=function(bt){return this.setup().verify(bt)},pt.prototype.fromObject=function(bt){return this.setup().fromObject(bt)},pt.prototype.toObject=function(bt,xt){return this.setup().toObject(bt,xt)},pt.d=function(bt){return function(vt){ct.decorateType(vt,bt)}},type}var root$2,hasRequiredRoot;function requireRoot(){if(hasRequiredRoot)return root$2;hasRequiredRoot=1,root$2=at;var et=requireNamespace();((at.prototype=Object.create(et.prototype)).constructor=at).className="Root";var o=requireField(),tt=require_enum(),rt=requireOneof(),nt=requireUtil(),ot,it,st;function at(ht){et.call(this,"",ht),this.deferred=[],this.files=[]}at.fromJSON=function(mt,ft){return ft||(ft=new at),mt.options&&ft.setOptions(mt.options),ft.addJSON(mt.nested)},at.prototype.resolvePath=nt.path.resolve,at.prototype.fetch=nt.fetch;function ct(){}at.prototype.load=function ht(mt,ft,pt){typeof ft=="function"&&(pt=ft,ft=void 0);var yt=this;if(!pt)return nt.asPromise(ht,yt,mt,ft);var gt=pt===ct;function bt(kt,It){if(pt){if(gt)throw kt;var Nt=pt;pt=null,Nt(kt,It)}}function xt(kt){var It=kt.lastIndexOf("google/protobuf/");if(It>-1){var Nt=kt.substring(It);if(Nt in st)return Nt}return null}function vt(kt,It){try{if(nt.isString(It)&&It.charAt(0)==="{"&&(It=JSON.parse(It)),!nt.isString(It))yt.setOptions(It.options).addJSON(It.nested);else{it.filename=kt;var Nt=it(It,yt,ft),Lt,Mt=0;if(Nt.imports)for(;Mt<Nt.imports.length;++Mt)(Lt=xt(Nt.imports[Mt])||yt.resolvePath(kt,Nt.imports[Mt]))&&Et(Lt);if(Nt.weakImports)for(Mt=0;Mt<Nt.weakImports.length;++Mt)(Lt=xt(Nt.weakImports[Mt])||yt.resolvePath(kt,Nt.weakImports[Mt]))&&Et(Lt,!0)}}catch(zt){bt(zt)}!gt&&!Ct&&bt(null,yt)}function Et(kt,It){if(kt=xt(kt)||kt,!(yt.files.indexOf(kt)>-1)){if(yt.files.push(kt),kt in st){gt?vt(kt,st[kt]):(++Ct,setTimeout(function(){--Ct,vt(kt,st[kt])}));return}if(gt){var Nt;try{Nt=nt.fs.readFileSync(kt).toString("utf8")}catch(Lt){It||bt(Lt);return}vt(kt,Nt)}else++Ct,yt.fetch(kt,function(Lt,Mt){if(--Ct,!!pt){if(Lt){It?Ct||bt(null,yt):bt(Lt);return}vt(kt,Mt)}})}}var Ct=0;nt.isString(mt)&&(mt=[mt]);for(var St=0,At;St<mt.length;++St)(At=yt.resolvePath("",mt[St]))&&Et(At);if(gt)return yt;Ct||bt(null,yt)},at.prototype.loadSync=function(mt,ft){if(!nt.isNode)throw Error("not supported");return this.load(mt,ft,ct)},at.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map(function(mt){return"'extend "+mt.extend+"' in "+mt.parent.fullName}).join(", "));return et.prototype.resolveAll.call(this)};var lt=/^[A-Z]/;function dt(ht,mt){var ft=mt.parent.lookup(mt.extend);if(ft){var pt=new o(mt.fullName,mt.id,mt.type,mt.rule,void 0,mt.options);return ft.get(pt.name)||(pt.declaringField=mt,mt.extensionField=pt,ft.add(pt)),!0}return!1}return at.prototype._handleAdd=function(mt){if(mt instanceof o)mt.extend!==void 0&&!mt.extensionField&&(dt(this,mt)||this.deferred.push(mt));else if(mt instanceof tt)lt.test(mt.name)&&(mt.parent[mt.name]=mt.values);else if(!(mt instanceof rt)){if(mt instanceof ot)for(var ft=0;ft<this.deferred.length;)dt(this,this.deferred[ft])?this.deferred.splice(ft,1):++ft;for(var pt=0;pt<mt.nestedArray.length;++pt)this._handleAdd(mt._nestedArray[pt]);lt.test(mt.name)&&(mt.parent[mt.name]=mt)}},at.prototype._handleRemove=function(mt){if(mt instanceof o){if(mt.extend!==void 0)if(mt.extensionField)mt.extensionField.parent.remove(mt.extensionField),mt.extensionField=null;else{var ft=this.deferred.indexOf(mt);ft>-1&&this.deferred.splice(ft,1)}}else if(mt instanceof tt)lt.test(mt.name)&&delete mt.parent[mt.name];else if(mt instanceof et){for(var pt=0;pt<mt.nestedArray.length;++pt)this._handleRemove(mt._nestedArray[pt]);lt.test(mt.name)&&delete mt.parent[mt.name]}},at._configure=function(ht,mt,ft){ot=ht,it=mt,st=ft},root$2}var hasRequiredUtil;function requireUtil(){if(hasRequiredUtil)return util$2.exports;hasRequiredUtil=1;var et=util$2.exports=requireMinimal(),o=roots,tt,rt;et.codegen=codegen_1,et.fetch=fetch_1,et.path=path,et.fs=et.inquire("fs"),et.toArray=function(ct){if(ct){for(var lt=Object.keys(ct),dt=new Array(lt.length),ht=0;ht<lt.length;)dt[ht]=ct[lt[ht++]];return dt}return[]},et.toObject=function(ct){for(var lt={},dt=0;dt<ct.length;){var ht=ct[dt++],mt=ct[dt++];mt!==void 0&&(lt[ht]=mt)}return lt};var nt=/\\/g,ot=/"/g;et.isReserved=function(ct){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(ct)},et.safeProp=function(ct){return!/^[$\w_]+$/.test(ct)||et.isReserved(ct)?'["'+ct.replace(nt,"\\\\").replace(ot,'\\"')+'"]':"."+ct},et.ucFirst=function(ct){return ct.charAt(0).toUpperCase()+ct.substring(1)};var it=/_([a-z])/g;et.camelCase=function(ct){return ct.substring(0,1)+ct.substring(1).replace(it,function(lt,dt){return dt.toUpperCase()})},et.compareFieldsById=function(ct,lt){return ct.id-lt.id},et.decorateType=function(ct,lt){if(ct.$type)return lt&&ct.$type.name!==lt&&(et.decorateRoot.remove(ct.$type),ct.$type.name=lt,et.decorateRoot.add(ct.$type)),ct.$type;tt||(tt=requireType());var dt=new tt(lt||ct.name);return et.decorateRoot.add(dt),dt.ctor=ct,Object.defineProperty(ct,"$type",{value:dt,enumerable:!1}),Object.defineProperty(ct.prototype,"$type",{value:dt,enumerable:!1}),dt};var st=0;return et.decorateEnum=function(ct){if(ct.$type)return ct.$type;rt||(rt=require_enum());var lt=new rt("Enum"+st++,ct);return et.decorateRoot.add(lt),Object.defineProperty(ct,"$type",{value:lt,enumerable:!1}),lt},et.setProperty=function(ct,lt,dt){function ht(mt,ft,pt){var yt=ft.shift();if(yt==="__proto__"||yt==="prototype")return mt;if(ft.length>0)mt[yt]=ht(mt[yt]||{},ft,pt);else{var gt=mt[yt];gt&&(pt=[].concat(gt).concat(pt)),mt[yt]=pt}return mt}if(typeof ct!="object")throw TypeError("dst must be an object");if(!lt)throw TypeError("path must be specified");return lt=lt.split("."),ht(ct,lt,dt)},Object.defineProperty(et,"decorateRoot",{get:function(){return o.decorated||(o.decorated=new(requireRoot()))}}),util$2.exports}var object,hasRequiredObject;function requireObject(){if(hasRequiredObject)return object;hasRequiredObject=1,object=tt,tt.className="ReflectionObject";var et=requireUtil(),o;function tt(rt,nt){if(!et.isString(rt))throw TypeError("name must be a string");if(nt&&!et.isObject(nt))throw TypeError("options must be an object");this.options=nt,this.parsedOptions=null,this.name=rt,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}return Object.defineProperties(tt.prototype,{root:{get:function(){for(var rt=this;rt.parent!==null;)rt=rt.parent;return rt}},fullName:{get:function(){for(var rt=[this.name],nt=this.parent;nt;)rt.unshift(nt.name),nt=nt.parent;return rt.join(".")}}}),tt.prototype.toJSON=function(){throw Error()},tt.prototype.onAdd=function(nt){this.parent&&this.parent!==nt&&this.parent.remove(this),this.parent=nt,this.resolved=!1;var ot=nt.root;ot instanceof o&&ot._handleAdd(this)},tt.prototype.onRemove=function(nt){var ot=nt.root;ot instanceof o&&ot._handleRemove(this),this.parent=null,this.resolved=!1},tt.prototype.resolve=function(){return this.resolved?this:(this.root instanceof o&&(this.resolved=!0),this)},tt.prototype.getOption=function(nt){if(this.options)return this.options[nt]},tt.prototype.setOption=function(nt,ot,it){return(!it||!this.options||this.options[nt]===void 0)&&((this.options||(this.options={}))[nt]=ot),this},tt.prototype.setParsedOption=function(nt,ot,it){this.parsedOptions||(this.parsedOptions=[]);var st=this.parsedOptions;if(it){var at=st.find(function(dt){return Object.prototype.hasOwnProperty.call(dt,nt)});if(at){var ct=at[nt];et.setProperty(ct,it,ot)}else at={},at[nt]=et.setProperty({},it,ot),st.push(at)}else{var lt={};lt[nt]=ot,st.push(lt)}return this},tt.prototype.setOptions=function(nt,ot){if(nt)for(var it=Object.keys(nt),st=0;st<it.length;++st)this.setOption(it[st],nt[it[st]],ot);return this},tt.prototype.toString=function(){var nt=this.constructor.className,ot=this.fullName;return ot.length?nt+" "+ot:nt},tt._configure=function(rt){o=rt},object}var _enum,hasRequired_enum;function require_enum(){if(hasRequired_enum)return _enum;hasRequired_enum=1,_enum=rt;var et=requireObject();((rt.prototype=Object.create(et.prototype)).constructor=rt).className="Enum";var o=requireNamespace(),tt=requireUtil();function rt(nt,ot,it,st,at,ct){if(et.call(this,nt,it),ot&&typeof ot!="object")throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=st,this.comments=at||{},this.valuesOptions=ct,this.reserved=void 0,ot)for(var lt=Object.keys(ot),dt=0;dt<lt.length;++dt)typeof ot[lt[dt]]=="number"&&(this.valuesById[this.values[lt[dt]]=ot[lt[dt]]]=lt[dt])}return rt.fromJSON=function(ot,it){var st=new rt(ot,it.values,it.options,it.comment,it.comments);return st.reserved=it.reserved,st},rt.prototype.toJSON=function(ot){var it=ot?!!ot.keepComments:!1;return tt.toObject(["options",this.options,"valuesOptions",this.valuesOptions,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",it?this.comment:void 0,"comments",it?this.comments:void 0])},rt.prototype.add=function(ot,it,st,at){if(!tt.isString(ot))throw TypeError("name must be a string");if(!tt.isInteger(it))throw TypeError("id must be an integer");if(this.values[ot]!==void 0)throw Error("duplicate name '"+ot+"' in "+this);if(this.isReservedId(it))throw Error("id "+it+" is reserved in "+this);if(this.isReservedName(ot))throw Error("name '"+ot+"' is reserved in "+this);if(this.valuesById[it]!==void 0){if(!(this.options&&this.options.allow_alias))throw Error("duplicate id "+it+" in "+this);this.values[ot]=it}else this.valuesById[this.values[ot]=it]=ot;return at&&(this.valuesOptions===void 0&&(this.valuesOptions={}),this.valuesOptions[ot]=at||null),this.comments[ot]=st||null,this},rt.prototype.remove=function(ot){if(!tt.isString(ot))throw TypeError("name must be a string");var it=this.values[ot];if(it==null)throw Error("name '"+ot+"' does not exist in "+this);return delete this.valuesById[it],delete this.values[ot],delete this.comments[ot],this.valuesOptions&&delete this.valuesOptions[ot],this},rt.prototype.isReservedId=function(ot){return o.isReservedId(this.reserved,ot)},rt.prototype.isReservedName=function(ot){return o.isReservedName(this.reserved,ot)},_enum}var encoder_1,hasRequiredEncoder;function requireEncoder(){if(hasRequiredEncoder)return encoder_1;hasRequiredEncoder=1,encoder_1=nt;var et=require_enum(),o=requireTypes(),tt=requireUtil();function rt(ot,it,st,at){return it.resolvedType.group?ot("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",st,at,(it.id<<3|3)>>>0,(it.id<<3|4)>>>0):ot("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",st,at,(it.id<<3|2)>>>0)}function nt(ot){for(var it=tt.codegen(["m","w"],ot.name+"$encode")("if(!w)")("w=Writer.create()"),st,at,ct=ot.fieldsArray.slice().sort(tt.compareFieldsById),st=0;st<ct.length;++st){var lt=ct[st].resolve(),dt=ot._fieldsArray.indexOf(lt),ht=lt.resolvedType instanceof et?"int32":lt.type,mt=o.basic[ht];at="m"+tt.safeProp(lt.name),lt.map?(it("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",at,lt.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",at)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(lt.id<<3|2)>>>0,8|o.mapKey[lt.keyType],lt.keyType),mt===void 0?it("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",dt,at):it(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|mt,ht,at),it("}")("}")):lt.repeated?(it("if(%s!=null&&%s.length){",at,at),lt.packed&&o.packed[ht]!==void 0?it("w.uint32(%i).fork()",(lt.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",at)("w.%s(%s[i])",ht,at)("w.ldelim()"):(it("for(var i=0;i<%s.length;++i)",at),mt===void 0?rt(it,lt,dt,at+"[i]"):it("w.uint32(%i).%s(%s[i])",(lt.id<<3|mt)>>>0,ht,at)),it("}")):(lt.optional&&it("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",at,lt.name),mt===void 0?rt(it,lt,dt,at):it("w.uint32(%i).%s(%s)",(lt.id<<3|mt)>>>0,ht,at))}return it("return w")}return encoder_1}var protobuf$2=indexLight.exports=indexMinimal;protobuf$2.build="light";function load(et,o,tt){return typeof o=="function"?(tt=o,o=new protobuf$2.Root):o||(o=new protobuf$2.Root),o.load(et,tt)}protobuf$2.load=load;function loadSync(et,o){return o||(o=new protobuf$2.Root),o.loadSync(et)}protobuf$2.loadSync=loadSync;protobuf$2.encoder=requireEncoder();protobuf$2.decoder=requireDecoder();protobuf$2.verifier=requireVerifier();protobuf$2.converter=requireConverter();protobuf$2.ReflectionObject=requireObject();protobuf$2.Namespace=requireNamespace();protobuf$2.Root=requireRoot();protobuf$2.Enum=require_enum();protobuf$2.Type=requireType();protobuf$2.Field=requireField();protobuf$2.OneOf=requireOneof();protobuf$2.MapField=requireMapfield();protobuf$2.Service=requireService();protobuf$2.Method=requireMethod();protobuf$2.Message=message;protobuf$2.wrappers=wrappers;protobuf$2.types=requireTypes();protobuf$2.util=requireUtil();protobuf$2.ReflectionObject._configure(protobuf$2.Root);protobuf$2.Namespace._configure(protobuf$2.Type,protobuf$2.Service,protobuf$2.Enum);protobuf$2.Root._configure(protobuf$2.Type);protobuf$2.Field._configure(protobuf$2.Type);var indexLightExports=indexLight.exports,tokenize_1=tokenize$1,delimRe=/[\s{}=;:[\],'"()<>]/g,stringDoubleRe=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,stringSingleRe=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,setCommentRe=/^ *[*/]+ */,setCommentAltRe=/^\s*\*?\/*/,setCommentSplitRe=/\n/g,whitespaceRe=/\s/,unescapeRe=/\\(.?)/g,unescapeMap={0:"\0",r:"\r",n:`
`,t:" "};function unescape$1(et){return et.replace(unescapeRe,function(o,tt){switch(tt){case"\\":case"":return tt;default:return unescapeMap[tt]||""}})}tokenize$1.unescape=unescape$1;function tokenize$1(et,o){et=et.toString();var tt=0,rt=et.length,nt=1,ot=0,it={},st=[],at=null;function ct(vt){return Error("illegal "+vt+" (line "+nt+")")}function lt(){var vt=at==="'"?stringSingleRe:stringDoubleRe;vt.lastIndex=tt-1;var Et=vt.exec(et);if(!Et)throw ct("string");return tt=vt.lastIndex,yt(at),at=null,unescape$1(Et[1])}function dt(vt){return et.charAt(vt)}function ht(vt,Et,Ct){var St={type:et.charAt(vt++),lineEmpty:!1,leading:Ct},At;o?At=2:At=3;var kt=vt-At,It;do if(--kt<0||(It=et.charAt(kt))===`
`){St.lineEmpty=!0;break}while(It===" "||It===" ");for(var Nt=et.substring(vt,Et).split(setCommentSplitRe),Lt=0;Lt<Nt.length;++Lt)Nt[Lt]=Nt[Lt].replace(o?setCommentAltRe:setCommentRe,"").trim();St.text=Nt.join(`
`).trim(),it[nt]=St,ot=nt}function mt(vt){var Et=ft(vt),Ct=et.substring(vt,Et),St=/^\s*\/\//.test(Ct);return St}function ft(vt){for(var Et=vt;Et<rt&&dt(Et)!==`
`;)Et++;return Et}function pt(){if(st.length>0)return st.shift();if(at)return lt();var vt,Et,Ct,St,At,kt=tt===0;do{if(tt===rt)return null;for(vt=!1;whitespaceRe.test(Ct=dt(tt));)if(Ct===`
`&&(kt=!0,++nt),++tt===rt)return null;if(dt(tt)==="/"){if(++tt===rt)throw ct("comment");if(dt(tt)==="/")if(o){if(St=tt,At=!1,mt(tt-1)){At=!0;do if(tt=ft(tt),tt===rt||(tt++,!kt))break;while(mt(tt))}else tt=Math.min(rt,ft(tt)+1);At&&(ht(St,tt,kt),kt=!0),nt++,vt=!0}else{for(At=dt(St=tt+1)==="/";dt(++tt)!==`
`;)if(tt===rt)return null;++tt,At&&(ht(St,tt-1,kt),kt=!0),++nt,vt=!0}else if((Ct=dt(tt))==="*"){St=tt+1,At=o||dt(St)==="*";do{if(Ct===`
`&&++nt,++tt===rt)throw ct("comment");Et=Ct,Ct=dt(tt)}while(Et!=="*"||Ct!=="/");++tt,At&&(ht(St,tt-2,kt),kt=!0),vt=!0}else return"/"}}while(vt);var It=tt;delimRe.lastIndex=0;var Nt=delimRe.test(dt(It++));if(!Nt)for(;It<rt&&!delimRe.test(dt(It));)++It;var Lt=et.substring(tt,tt=It);return(Lt==='"'||Lt==="'")&&(at=Lt),Lt}function yt(vt){st.push(vt)}function gt(){if(!st.length){var vt=pt();if(vt===null)return null;yt(vt)}return st[0]}function bt(vt,Et){var Ct=gt(),St=Ct===vt;if(St)return pt(),!0;if(!Et)throw ct("token '"+Ct+"', '"+vt+"' expected");return!1}function xt(vt){var Et=null,Ct;return vt===void 0?(Ct=it[nt-1],delete it[nt-1],Ct&&(o||Ct.type==="*"||Ct.lineEmpty)&&(Et=Ct.leading?Ct.text:null)):(ot<vt&&gt(),Ct=it[vt],delete it[vt],Ct&&!Ct.lineEmpty&&(o||Ct.type==="/")&&(Et=Ct.leading?null:Ct.text)),Et}return Object.defineProperty({next:pt,peek:gt,push:yt,skip:bt,cmnt:xt},"line",{get:function(){return nt}})}var parse_1=parse$1;parse$1.filename=null;parse$1.defaults={keepCase:!1};var tokenize=tokenize_1,Root$1=requireRoot(),Type=requireType(),Field=requireField(),MapField=requireMapfield(),OneOf=requireOneof(),Enum=require_enum(),Service=requireService(),Method=requireMethod(),types$1=requireTypes(),util=requireUtil(),base10Re=/^[1-9][0-9]*$/,base10NegRe=/^-?[1-9][0-9]*$/,base16Re=/^0[x][0-9a-fA-F]+$/,base16NegRe=/^-?0[x][0-9a-fA-F]+$/,base8Re=/^0[0-7]+$/,base8NegRe=/^-?0[0-7]+$/,numberRe=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,nameRe$1=/^[a-zA-Z_][a-zA-Z_0-9]*$/,typeRefRe=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,fqTypeRefRe=/^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/;function parse$1(et,o,tt){o instanceof Root$1||(tt=o,o=new Root$1),tt||(tt=parse$1.defaults);var rt=tt.preferTrailingComment||!1,nt=tokenize(et,tt.alternateCommentMode||!1),ot=nt.next,it=nt.push,st=nt.peek,at=nt.skip,ct=nt.cmnt,lt=!0,dt,ht,mt,ft,pt=!1,yt=o,gt=tt.keepCase?function(Jt){return Jt}:util.camelCase;function bt(Jt,tr,_t){var Bt=parse$1.filename;return _t||(parse$1.filename=null),Error("illegal "+(tr||"token")+" '"+Jt+"' ("+(Bt?Bt+", ":"")+"line "+nt.line+")")}function xt(){var Jt=[],tr;do{if((tr=ot())!=='"'&&tr!=="'")throw bt(tr);Jt.push(ot()),at(tr),tr=st()}while(tr==='"'||tr==="'");return Jt.join("")}function vt(Jt){var tr=ot();switch(tr){case"'":case'"':return it(tr),xt();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return Ct(tr,!0)}catch{if(typeRefRe.test(tr))return tr;throw bt(tr,"value")}}function Et(Jt,tr){var _t,Bt;do tr&&((_t=st())==='"'||_t==="'")?Jt.push(xt()):Jt.push([Bt=St(ot()),at("to",!0)?St(ot()):Bt]);while(at(",",!0));var Vt={options:void 0};Vt.setOption=function(er,ar){this.options===void 0&&(this.options={}),this.options[er]=ar},Lt(Vt,function(ar){if(ar==="option")Pt(Vt,ar),at(";");else throw bt(ar)},function(){Gt(Vt)})}function Ct(Jt,tr){var _t=1;switch(Jt.charAt(0)==="-"&&(_t=-1,Jt=Jt.substring(1)),Jt){case"inf":case"INF":case"Inf":return _t*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(base10Re.test(Jt))return _t*parseInt(Jt,10);if(base16Re.test(Jt))return _t*parseInt(Jt,16);if(base8Re.test(Jt))return _t*parseInt(Jt,8);if(numberRe.test(Jt))return _t*parseFloat(Jt);throw bt(Jt,"number",tr)}function St(Jt,tr){switch(Jt){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!tr&&Jt.charAt(0)==="-")throw bt(Jt,"id");if(base10NegRe.test(Jt))return parseInt(Jt,10);if(base16NegRe.test(Jt))return parseInt(Jt,16);if(base8NegRe.test(Jt))return parseInt(Jt,8);throw bt(Jt,"id")}function At(){if(dt!==void 0)throw bt("package");if(dt=ot(),!typeRefRe.test(dt))throw bt(dt,"name");yt=yt.define(dt),at(";")}function kt(){var Jt=st(),tr;switch(Jt){case"weak":tr=mt||(mt=[]),ot();break;case"public":ot();default:tr=ht||(ht=[]);break}Jt=xt(),at(";"),tr.push(Jt)}function It(){if(at("="),ft=xt(),pt=ft==="proto3",!pt&&ft!=="proto2")throw bt(ft,"syntax");o.setOption("syntax",ft),at(";")}function Nt(Jt,tr){switch(tr){case"option":return Pt(Jt,tr),at(";"),!0;case"message":return Mt(Jt,tr),!0;case"enum":return Ft(Jt,tr),!0;case"service":return rr(Jt,tr),!0;case"extend":return dr(Jt,tr),!0}return!1}function Lt(Jt,tr,_t){var Bt=nt.line;if(Jt&&(typeof Jt.comment!="string"&&(Jt.comment=ct()),Jt.filename=parse$1.filename),at("{",!0)){for(var Vt;(Vt=ot())!=="}";)tr(Vt);at(";",!0)}else _t&&_t(),at(";"),Jt&&(typeof Jt.comment!="string"||rt)&&(Jt.comment=ct(Bt)||Jt.comment)}function Mt(Jt,tr){if(!nameRe$1.test(tr=ot()))throw bt(tr,"type name");var _t=new Type(tr);Lt(_t,function(Vt){if(!Nt(_t,Vt))switch(Vt){case"map":Xt(_t);break;case"required":case"repeated":zt(_t,Vt);break;case"optional":pt?zt(_t,"proto3_optional"):zt(_t,"optional");break;case"oneof":Wt(_t,Vt);break;case"extensions":Et(_t.extensions||(_t.extensions=[]));break;case"reserved":Et(_t.reserved||(_t.reserved=[]),!0);break;default:if(!pt||!typeRefRe.test(Vt))throw bt(Vt);it(Vt),zt(_t,"optional");break}}),Jt.add(_t)}function zt(Jt,tr,_t){var Bt=ot();if(Bt==="group"){Ut(Jt,tr);return}for(;Bt.endsWith(".")||st().startsWith(".");)Bt+=ot();if(!typeRefRe.test(Bt))throw bt(Bt,"type");var Vt=ot();if(!nameRe$1.test(Vt))throw bt(Vt,"name");Vt=gt(Vt),at("=");var er=new Field(Vt,St(ot()),Bt,tr,_t);if(Lt(er,function(cr){if(cr==="option")Pt(er,cr),at(";");else throw bt(cr)},function(){Gt(er)}),tr==="proto3_optional"){var ar=new OneOf("_"+Vt);er.setOption("proto3_optional",!0),ar.add(er),Jt.add(ar)}else Jt.add(er);!pt&&er.repeated&&(types$1.packed[Bt]!==void 0||types$1.basic[Bt]===void 0)&&er.setOption("packed",!1,!0)}function Ut(Jt,tr){var _t=ot();if(!nameRe$1.test(_t))throw bt(_t,"name");var Bt=util.lcFirst(_t);_t===Bt&&(_t=util.ucFirst(_t)),at("=");var Vt=St(ot()),er=new Type(_t);er.group=!0;var ar=new Field(Bt,Vt,_t,tr);ar.filename=parse$1.filename,Lt(er,function(cr){switch(cr){case"option":Pt(er,cr),at(";");break;case"required":case"repeated":zt(er,cr);break;case"optional":pt?zt(er,"proto3_optional"):zt(er,"optional");break;case"message":Mt(er,cr);break;case"enum":Ft(er,cr);break;default:throw bt(cr)}}),Jt.add(er).add(ar)}function Xt(Jt){at("<");var tr=ot();if(types$1.mapKey[tr]===void 0)throw bt(tr,"type");at(",");var _t=ot();if(!typeRefRe.test(_t))throw bt(_t,"type");at(">");var Bt=ot();if(!nameRe$1.test(Bt))throw bt(Bt,"name");at("=");var Vt=new MapField(gt(Bt),St(ot()),tr,_t);Lt(Vt,function(ar){if(ar==="option")Pt(Vt,ar),at(";");else throw bt(ar)},function(){Gt(Vt)}),Jt.add(Vt)}function Wt(Jt,tr){if(!nameRe$1.test(tr=ot()))throw bt(tr,"name");var _t=new OneOf(gt(tr));Lt(_t,function(Vt){Vt==="option"?(Pt(_t,Vt),at(";")):(it(Vt),zt(_t,"optional"))}),Jt.add(_t)}function Ft(Jt,tr){if(!nameRe$1.test(tr=ot()))throw bt(tr,"name");var _t=new Enum(tr);Lt(_t,function(Vt){switch(Vt){case"option":Pt(_t,Vt),at(";");break;case"reserved":Et(_t.reserved||(_t.reserved=[]),!0);break;default:qt(_t,Vt)}}),Jt.add(_t)}function qt(Jt,tr){if(!nameRe$1.test(tr))throw bt(tr,"name");at("=");var _t=St(ot(),!0),Bt={options:void 0};Bt.setOption=function(Vt,er){this.options===void 0&&(this.options={}),this.options[Vt]=er},Lt(Bt,function(er){if(er==="option")Pt(Bt,er),at(";");else throw bt(er)},function(){Gt(Bt)}),Jt.add(tr,_t,Bt.comment,Bt.options)}function Pt(Jt,tr){var _t=at("(",!0);if(!typeRefRe.test(tr=ot()))throw bt(tr,"name");var Bt=tr,Vt=Bt,er;_t&&(at(")"),Bt="("+Bt+")",Vt=Bt,tr=st(),fqTypeRefRe.test(tr)&&(er=tr.slice(1),Bt+=tr,ot())),at("=");var ar=Yt(Jt,Bt);jt(Jt,Vt,ar,er)}function Yt(Jt,tr){if(at("{",!0)){for(var _t={};!at("}",!0);){if(!nameRe$1.test(Zt=ot()))throw bt(Zt,"name");if(Zt===null)throw bt(Zt,"end of input");var Bt,Vt=Zt;if(at(":",!0),st()==="{")Bt=Yt(Jt,tr+"."+Zt);else if(st()==="["){Bt=[];var er;if(at("[",!0)){do er=vt(),Bt.push(er);while(at(",",!0));at("]"),typeof er<"u"&&Qt(Jt,tr+"."+Zt,er)}}else Bt=vt(),Qt(Jt,tr+"."+Zt,Bt);var ar=_t[Vt];ar&&(Bt=[].concat(ar).concat(Bt)),_t[Vt]=Bt,at(",",!0),at(";",!0)}return _t}var ur=vt();return Qt(Jt,tr,ur),ur}function Qt(Jt,tr,_t){Jt.setOption&&Jt.setOption(tr,_t)}function jt(Jt,tr,_t,Bt){Jt.setParsedOption&&Jt.setParsedOption(tr,_t,Bt)}function Gt(Jt){if(at("[",!0)){do Pt(Jt,"option");while(at(",",!0));at("]")}return Jt}function rr(Jt,tr){if(!nameRe$1.test(tr=ot()))throw bt(tr,"service name");var _t=new Service(tr);Lt(_t,function(Vt){if(!Nt(_t,Vt))if(Vt==="rpc")Ht(_t,Vt);else throw bt(Vt)}),Jt.add(_t)}function Ht(Jt,tr){var _t=ct(),Bt=tr;if(!nameRe$1.test(tr=ot()))throw bt(tr,"name");var Vt=tr,er,ar,ur,cr;if(at("("),at("stream",!0)&&(ar=!0),!typeRefRe.test(tr=ot())||(er=tr,at(")"),at("returns"),at("("),at("stream",!0)&&(cr=!0),!typeRefRe.test(tr=ot())))throw bt(tr);ur=tr,at(")");var hr=new Method(Vt,Bt,er,ur,ar,cr);hr.comment=_t,Lt(hr,function(pr){if(pr==="option")Pt(hr,pr),at(";");else throw bt(pr)}),Jt.add(hr)}function dr(Jt,tr){if(!typeRefRe.test(tr=ot()))throw bt(tr,"reference");var _t=tr;Lt(null,function(Vt){switch(Vt){case"required":case"repeated":zt(Jt,Vt,_t);break;case"optional":pt?zt(Jt,"proto3_optional",_t):zt(Jt,"optional",_t);break;default:if(!pt||!typeRefRe.test(Vt))throw bt(Vt);it(Vt),zt(Jt,"optional",_t);break}})}for(var Zt;(Zt=ot())!==null;)switch(Zt){case"package":if(!lt)throw bt(Zt);At();break;case"import":if(!lt)throw bt(Zt);kt();break;case"syntax":if(!lt)throw bt(Zt);It();break;case"option":Pt(yt,Zt),at(";");break;default:if(Nt(yt,Zt)){lt=!1;continue}throw bt(Zt)}return parse$1.filename=null,{package:dt,imports:ht,weakImports:mt,syntax:ft,root:o}}var common_1=common,commonRe=/\/|\./;function common(et,o){commonRe.test(et)||(et="google/protobuf/"+et+".proto",o={nested:{google:{nested:{protobuf:{nested:o}}}}}),common[et]=o}common("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}});var timeType;common("duration",{Duration:timeType={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}});common("timestamp",{Timestamp:timeType});common("empty",{Empty:{fields:{}}});common("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}});common("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}});common("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}});common.get=function et(o){return common[o]||null};var protobuf$1=src.exports=indexLightExports;protobuf$1.build="full";protobuf$1.tokenize=tokenize_1;protobuf$1.parse=parse_1;protobuf$1.common=common_1;protobuf$1.Root._configure(protobuf$1.Type,protobuf$1.parse,protobuf$1.common);var srcExports=src.exports,protobufjs=srcExports;const protobuf=getDefaultExportFromCjs(protobufjs),contentTopic="/buddybook-dogfood/1/chain/proto",encoder=createEncoder({contentTopic,ephemeral:!1}),decoder=createDecoder(contentTopic),block=new protobuf.Type("block").add(new protobuf.Field("chainUUID",1,"string")).add(new protobuf.Field("blockUUID",2,"string")).add(new protobuf.Field("title",3,"string")).add(new protobuf.Field("description",4,"string")).add(new protobuf.Field("signedMessage",5,"string")).add(new protobuf.Field("timestamp",6,"uint64")).add(new protobuf.Field("signatures",7,"string","repeated")).add(new protobuf.Field("parentBlockUUID",8,"string"));function createMessage({chainUUID:et,blockUUID:o,title:tt,description:rt,signedMessage:nt,timestamp:ot,signatures:it,parentBlockUUID:st}){const at=block.create({chainUUID:et,blockUUID:o,title:tt,description:rt,signedMessage:nt,timestamp:ot,signatures:it.map(lt=>JSON.stringify(lt)),parentBlockUUID:st});return{payload:block.encode(at).finish()}}async function*getMessagesFromStore(et){console.time("getMessagesFromStore");for await(const o of et.store.queryGenerator([decoder])){const tt=await Promise.all(o);for(const rt of tt){if(console.log(rt),!(rt!=null&&rt.payload))continue;const nt=block.decode(rt.payload);nt.signatures=nt.signatures.map(ot=>JSON.parse(ot)),yield nt}}console.timeEnd("getMessagesFromStore")}async function subscribeToFilter(et,o){const{error:tt,subscription:rt,results:nt}=await et.filter.subscribe([decoder],ot=>{if(console.log("message received from filter",ot),ot.payload){const it=block.decode(ot.payload);it.signatures=it.signatures.map(st=>JSON.parse(st)),o(it)}},{forceUseAllPeers:!0});if(console.log("results",nt),tt&&console.log("Error subscribing to filter",tt),!rt||tt||nt.successes.length===0||nt.failures.length>0)throw new Error("Failed to subscribe to filter")}function useWalletPrompt(){const{isConnected:et}=useAccount(),{connect:o,connectors:tt}=useConnect$1();return{ensureWalletConnected:async()=>{if(!et)try{const nt=tt[0];return nt&&await o({connector:nt}),await new Promise(ot=>setTimeout(ot,1e3)),!0}catch(nt){return console.error("Error connecting wallet:",nt),!1}return!0}}}const DEFAULT_FORM_DATA={title:"Devcon24 DeFi Dynamo",description:"A revolutionary blockchain for Devcon 24, focusing on scalable DeFi solutions and cross-chain interoperability.",uuid:v4()},ChainCreationForm=()=>{const[et,o]=reactExports.useState(DEFAULT_FORM_DATA),[tt,rt]=reactExports.useState({}),[nt,ot]=reactExports.useState(!1),[it,st]=reactExports.useState(!1),[at,ct]=reactExports.useState(!1),[lt,dt]=reactExports.useState(null),[ht,mt]=reactExports.useState(null),[ft,pt]=reactExports.useState(null),{node:yt}=useWaku(),{address:gt}=useAccount(),{signMessage:bt}=useSignMessage({mutation:{async onSuccess(kt){if(!gt||!yt)return;mt(kt);const It=v4();pt(It);const Nt=createMessage({chainUUID:et.uuid,blockUUID:It,title:et.title,description:et.description,signedMessage:kt,timestamp:Date.now(),signatures:[{address:gt,signature:kt}],parentBlockUUID:null});await(yt==null?void 0:yt.lightPush.send(encoder,Nt)),ct(!0),st(!1)},onError(kt){console.error("Error signing message:",kt),st(!1),dt("Error signing message. Please try again.")}}}),{ensureWalletConnected:xt}=useWalletPrompt(),vt=kt=>{const{name:It,value:Nt}=kt.target;o(Lt=>({...Lt,[It]:Nt})),tt[It]&&rt(Lt=>({...Lt,[It]:void 0}))},Et=()=>{const kt={};return et.title.trim()||(kt.title="Title is required"),et.description.trim()||(kt.description="Description is required"),rt(kt),Object.keys(kt).length===0},Ct=kt=>{kt.preventDefault(),xt()&&Et()&&ot(!0)},St=async()=>{st(!0),dt(null);const kt=`Create Chain:
Chain UUID: ${et.uuid}
Title: ${et.title}
Description: ${et.description}
Timestamp: ${new Date().getTime()}
Signed by: ${gt}`;bt({message:kt})},At=()=>{ot(!1),ct(!1),st(!1),dt(null),pt(null)};return jsxRuntimeExports.jsxs(Card,{className:"w-full max-w-2xl mx-auto",children:[jsxRuntimeExports.jsx(CardHeader,{children:jsxRuntimeExports.jsx(CardTitle,{children:"Create a New Chain"})}),jsxRuntimeExports.jsx(CardContent,{children:jsxRuntimeExports.jsxs("form",{onSubmit:Ct,className:"space-y-6",children:[jsxRuntimeExports.jsxs("div",{className:"space-y-2",children:[jsxRuntimeExports.jsx(Label,{htmlFor:"title",children:"Chain Title"}),jsxRuntimeExports.jsx(Input,{type:"text",id:"title",name:"title",value:et.title,onChange:vt,maxLength:50,className:"text-base sm:text-sm"}),tt.title&&jsxRuntimeExports.jsx("p",{className:"text-sm text-destructive",children:tt.title})]}),jsxRuntimeExports.jsxs("div",{className:"space-y-2",children:[jsxRuntimeExports.jsx(Label,{htmlFor:"description",children:"Chain Description"}),jsxRuntimeExports.jsx(Textarea,{id:"description",name:"description",value:et.description,onChange:vt,maxLength:500,className:"min-h-[100px] text-base sm:text-sm"}),tt.description&&jsxRuntimeExports.jsx("p",{className:"text-sm text-destructive",children:tt.description})]}),jsxRuntimeExports.jsx(Button,{type:"submit",className:"w-full py-6 text-base sm:py-2 sm:text-sm",children:"Create Chain"})]})}),jsxRuntimeExports.jsx(Dialog,{open:nt,onOpenChange:At,children:jsxRuntimeExports.jsxs(DialogContent,{children:[jsxRuntimeExports.jsx(DialogHeader,{children:jsxRuntimeExports.jsx(DialogTitle,{children:at?"Chain Created":"Chain Preview"})}),at?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:ht&&ft&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[jsxRuntimeExports.jsx(QRCode,{text:`${window.location.origin}/buddybook/sign/${et.uuid}/${ft}`,width:200,height:200}),jsxRuntimeExports.jsx("p",{className:"text-sm text-center break-all",children:`${window.location.origin}/buddybook/sign/${et.uuid}/${ft}`}),jsxRuntimeExports.jsx(Button,{onClick:()=>navigator.clipboard.writeText(`${window.location.origin}/buddybook/sign/${et.uuid}/${ft}`),variant:"outline",children:"Copy Link"})]})})}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:"space-y-4",children:[jsxRuntimeExports.jsx("h4",{className:"text-xl font-semibold",children:et.title}),jsxRuntimeExports.jsx("p",{className:"text-muted-foreground",children:et.description}),lt&&jsxRuntimeExports.jsx("p",{className:"text-sm text-destructive",children:lt})]}),jsxRuntimeExports.jsxs(DialogFooter,{className:"sm:justify-start",children:[jsxRuntimeExports.jsx(Button,{type:"button",variant:"secondary",onClick:At,children:"Edit"}),jsxRuntimeExports.jsx(Button,{type:"button",onClick:St,disabled:it,children:it?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Signing..."]}):"Sign"})]})]})]})})]})},SignChain=({block:et,chainsData:o,onSuccess:tt})=>{const[rt,nt]=reactExports.useState(!1),[ot,it]=reactExports.useState(!1),[st,at]=reactExports.useState(null),[ct,lt]=reactExports.useState(!1),{address:dt}=useAccount(),{data:ht}=useEnsName({address:dt}),{node:mt}=useWaku(),{ensureWalletConnected:ft}=useWalletPrompt();reactExports.useEffect(()=>{if(dt){const gt=xt=>{if(xt.signatures.some(Ct=>Ct.address.toLowerCase()===dt.toLowerCase()))return!0;const vt=o.find(Ct=>Ct.blockUUID===xt.parentBlockUUID);return vt&&gt(vt)?!0:o.filter(Ct=>Ct.parentBlockUUID===xt.blockUUID).some(Ct=>gt(Ct))},bt=gt(et);lt(bt)}},[dt,et,o]);const{signMessage:pt}=useSignMessage({mutation:{onMutate(){at(null),it(!0)},async onSuccess(gt){if(!(!dt||!mt))try{if(et.signatures.some(Ct=>Ct.address.toLowerCase()===dt.toLowerCase())){at("You have already signed this chain.");return}const bt={chainUUID:et.chainUUID,blockUUID:v4(),title:et.title,description:et.description,signedMessage:gt,timestamp:Date.now(),signatures:[{address:dt,signature:gt}],parentBlockUUID:et.blockUUID},xt=createMessage(bt),{failures:vt,successes:Et}=await mt.lightPush.send(encoder,xt);if(vt.length>0||Et.length===0)throw new Error("Failed to send message to Waku network");tt(bt),nt(!1)}catch(bt){console.error("Error creating new block:",bt),at("Failed to create new block. Please try again.")}},onError(gt){console.error("Error signing message:",gt),at("Error signing message. Please try again. If using a mobile wallet, please ensure your wallet app is open.")},onSettled(){it(!1)}}}),yt=async()=>{try{if(!dt&&!await ft())return;if(ct){at("You have already signed this chain.");return}const gt=`Sign Block:
Chain UUID: ${et.chainUUID}
Block UUID: ${et.blockUUID}
Title: ${et.title}
Description: ${et.description}
Timestamp: ${new Date().getTime()}
Parent Block UUID: ${et.parentBlockUUID}
Signed by: ${ht||dt}`;pt({message:gt})}catch(gt){console.error("Error in sign flow:",gt),at("Failed to initiate signing. Please try again."),it(!1)}};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Button,{onClick:()=>nt(!0),disabled:ct,children:ct?"Already Signed":dt?"Sign Chain":"Connect Wallet"}),jsxRuntimeExports.jsx(Dialog,{open:rt,onOpenChange:nt,children:jsxRuntimeExports.jsxs(DialogContent,{className:"sm:max-w-md",children:[jsxRuntimeExports.jsxs(DialogHeader,{children:[jsxRuntimeExports.jsx(DialogTitle,{children:"Sign Chain"}),jsxRuntimeExports.jsx(DialogDescription,{children:ct?"You have already signed this chain.":"Review the block details and sign to add your signature to the chain."})]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-col space-y-4",children:[jsxRuntimeExports.jsxs("div",{className:"space-y-2",children:[jsxRuntimeExports.jsx("h4",{className:"font-medium",children:"Block Details"}),jsxRuntimeExports.jsx("p",{className:"text-sm text-muted-foreground",children:et.title}),jsxRuntimeExports.jsx("p",{className:"text-sm text-muted-foreground",children:et.description})]}),jsxRuntimeExports.jsx(QRCode,{text:`${window.location.origin}/sign/${et.chainUUID}/${et.blockUUID}`})]}),st&&jsxRuntimeExports.jsx("p",{className:"text-sm text-destructive",children:st}),jsxRuntimeExports.jsxs(DialogFooter,{children:[jsxRuntimeExports.jsx(Button,{variant:"secondary",onClick:()=>nt(!1),children:"Cancel"}),jsxRuntimeExports.jsx(Button,{onClick:yt,disabled:ot||ct,children:ot?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Signing..."]}):ct?"Already Signed":dt?"Sign":"Connect Wallet"})]})]})})]})},ChainList=({chainsData:et,onChainUpdate:o,isLoading:tt})=>{const rt=it=>{o(it)},nt=(it,st=0)=>{const at=et.filter(dt=>dt.parentBlockUUID===it.blockUUID),ct=it.signatures.length+at.reduce((dt,ht)=>dt+ht.signatures.length,0),lt=`${window.location.origin}/buddybook/sign/${it.chainUUID??it.blockUUID}/${it.blockUUID}`;return jsxRuntimeExports.jsxs("li",{className:"mb-4",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-start",children:[jsxRuntimeExports.jsx("div",{className:"mr-4 mt-2",children:st>0&&jsxRuntimeExports.jsx("div",{className:"w-6 h-6 border-l-2 border-b-2 border-gray-300"})}),st===0?jsxRuntimeExports.jsxs(Card,{className:"flex-grow",children:[jsxRuntimeExports.jsx(CardHeader,{children:jsxRuntimeExports.jsx(CardTitle,{children:it.title})}),jsxRuntimeExports.jsxs(CardContent,{children:[jsxRuntimeExports.jsx("p",{children:it.description}),jsxRuntimeExports.jsxs("p",{className:"text-sm text-muted-foreground mt-2",children:["Created at: ",new Date(it.timestamp).toLocaleString()]}),jsxRuntimeExports.jsxs("p",{className:"text-sm text-muted-foreground",children:["Total Signatures: ",ct]}),jsxRuntimeExports.jsxs("p",{className:"text-sm text-muted-foreground",children:["Block UUID: ",it.blockUUID]}),jsxRuntimeExports.jsxs("div",{className:"mt-2 space-x-2",children:[jsxRuntimeExports.jsx(SignChain,{block:it,chainsData:et,onSuccess:rt}),jsxRuntimeExports.jsxs(Dialog,{children:[jsxRuntimeExports.jsx(DialogTrigger,{asChild:!0,children:jsxRuntimeExports.jsx(Button,{variant:"outline",children:"Share"})}),jsxRuntimeExports.jsxs(DialogContent,{className:"sm:max-w-md",children:[jsxRuntimeExports.jsxs(DialogHeader,{children:[jsxRuntimeExports.jsx(DialogTitle,{children:"Share this Chain"}),jsxRuntimeExports.jsx(DialogDescription,{children:"Share this chain with others to collect their signatures."})]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[jsxRuntimeExports.jsx(QRCode,{text:lt,width:200,height:200}),jsxRuntimeExports.jsx("p",{className:"text-sm text-center break-all",children:lt}),jsxRuntimeExports.jsx(Button,{onClick:()=>navigator.clipboard.writeText(lt),variant:"outline",children:"Copy Link"})]})]})]})]})]})]}):jsxRuntimeExports.jsx("div",{className:"flex-grow",children:jsxRuntimeExports.jsx(SignerName,{address:it.signatures[0].address})})]}),at.length>0&&jsxRuntimeExports.jsx("ul",{className:"ml-8 mt-2",children:at.map(dt=>nt(dt,st+1))})]},`${it.blockUUID}-${st}`)},ot=et.filter(it=>!it.parentBlockUUID);return jsxRuntimeExports.jsxs(Card,{className:"w-full max-w-4xl mx-auto",children:[jsxRuntimeExports.jsx(CardHeader,{children:jsxRuntimeExports.jsxs(CardTitle,{children:["Existing Chains",tt&&jsxRuntimeExports.jsxs("span",{className:"ml-2 inline-flex items-center text-muted-foreground text-sm font-normal",children:[jsxRuntimeExports.jsx(LoaderCircle,{className:"h-4 w-4 animate-spin mr-2"}),"Loading more chains..."]})]})}),jsxRuntimeExports.jsx(CardContent,{children:ot.length===0&&!tt?jsxRuntimeExports.jsx("p",{children:"No chains found."}):jsxRuntimeExports.jsx("ul",{className:"space-y-4",children:ot.map(it=>nt(it,0))})})]})},SignerName=({address:et})=>{const{data:o}=useEnsName({address:et});return jsxRuntimeExports.jsxs("p",{className:"text-sm",children:["Signed by: ",o||`${et.slice(0,6)}...${et.slice(-4)}`]})};var DirectionContext=reactExports.createContext(void 0);function useDirection(et){const o=reactExports.useContext(DirectionContext);return et||o||"ltr"}function clamp(et,[o,tt]){return Math.min(tt,Math.max(o,et))}function useStateMachine(et,o){return reactExports.useReducer((tt,rt)=>o[tt][rt]??tt,et)}var SCROLL_AREA_NAME="ScrollArea",[createScrollAreaContext,createScrollAreaScope]=createContextScope(SCROLL_AREA_NAME),[ScrollAreaProvider,useScrollAreaContext]=createScrollAreaContext(SCROLL_AREA_NAME),ScrollArea$1=reactExports.forwardRef((et,o)=>{const{__scopeScrollArea:tt,type:rt="hover",dir:nt,scrollHideDelay:ot=600,...it}=et,[st,at]=reactExports.useState(null),[ct,lt]=reactExports.useState(null),[dt,ht]=reactExports.useState(null),[mt,ft]=reactExports.useState(null),[pt,yt]=reactExports.useState(null),[gt,bt]=reactExports.useState(0),[xt,vt]=reactExports.useState(0),[Et,Ct]=reactExports.useState(!1),[St,At]=reactExports.useState(!1),kt=useComposedRefs(o,Nt=>at(Nt)),It=useDirection(nt);return jsxRuntimeExports.jsx(ScrollAreaProvider,{scope:tt,type:rt,dir:It,scrollHideDelay:ot,scrollArea:st,viewport:ct,onViewportChange:lt,content:dt,onContentChange:ht,scrollbarX:mt,onScrollbarXChange:ft,scrollbarXEnabled:Et,onScrollbarXEnabledChange:Ct,scrollbarY:pt,onScrollbarYChange:yt,scrollbarYEnabled:St,onScrollbarYEnabledChange:At,onCornerWidthChange:bt,onCornerHeightChange:vt,children:jsxRuntimeExports.jsx(Primitive.div,{dir:It,...it,ref:kt,style:{position:"relative","--radix-scroll-area-corner-width":gt+"px","--radix-scroll-area-corner-height":xt+"px",...et.style}})})});ScrollArea$1.displayName=SCROLL_AREA_NAME;var VIEWPORT_NAME="ScrollAreaViewport",ScrollAreaViewport=reactExports.forwardRef((et,o)=>{const{__scopeScrollArea:tt,children:rt,asChild:nt,nonce:ot,...it}=et,st=useScrollAreaContext(VIEWPORT_NAME,tt),at=reactExports.useRef(null),ct=useComposedRefs(o,at,st.onViewportChange);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("style",{dangerouslySetInnerHTML:{__html:`
[data-radix-scroll-area-viewport] {
scrollbar-width: none;
-ms-overflow-style: none;
-webkit-overflow-scrolling: touch;
}
[data-radix-scroll-area-viewport]::-webkit-scrollbar {
display: none;
}
:where([data-radix-scroll-area-viewport]) {
display: flex;
flex-direction: column;
align-items: stretch;
}
:where([data-radix-scroll-area-content]) {
flex-grow: 1;
}
`},nonce:ot}),jsxRuntimeExports.jsx(Primitive.div,{"data-radix-scroll-area-viewport":"",...it,asChild:nt,ref:ct,style:{overflowX:st.scrollbarXEnabled?"scroll":"hidden",overflowY:st.scrollbarYEnabled?"scroll":"hidden",...et.style},children:getSubtree({asChild:nt,children:rt},lt=>jsxRuntimeExports.jsx("div",{"data-radix-scroll-area-content":"",ref:st.onContentChange,style:{minWidth:st.scrollbarXEnabled?"fit-content":void 0},children:lt}))})]})});ScrollAreaViewport.displayName=VIEWPORT_NAME;var SCROLLBAR_NAME="ScrollAreaScrollbar",ScrollAreaScrollbar=reactExports.forwardRef((et,o)=>{const{forceMount:tt,...rt}=et,nt=useScrollAreaContext(SCROLLBAR_NAME,et.__scopeScrollArea),{onScrollbarXEnabledChange:ot,onScrollbarYEnabledChange:it}=nt,st=et.orientation==="horizontal";return reactExports.useEffect(()=>(st?ot(!0):it(!0),()=>{st?ot(!1):it(!1)}),[st,ot,it]),nt.type==="hover"?jsxRuntimeExports.jsx(ScrollAreaScrollbarHover,{...rt,ref:o,forceMount:tt}):nt.type==="scroll"?jsxRuntimeExports.jsx(ScrollAreaScrollbarScroll,{...rt,ref:o,forceMount:tt}):nt.type==="auto"?jsxRuntimeExports.jsx(ScrollAreaScrollbarAuto,{...rt,ref:o,forceMount:tt}):nt.type==="always"?jsxRuntimeExports.jsx(ScrollAreaScrollbarVisible,{...rt,ref:o}):null});ScrollAreaScrollbar.displayName=SCROLLBAR_NAME;var ScrollAreaScrollbarHover=reactExports.forwardRef((et,o)=>{const{forceMount:tt,...rt}=et,nt=useScrollAreaContext(SCROLLBAR_NAME,et.__scopeScrollArea),[ot,it]=reactExports.useState(!1);return reactExports.useEffect(()=>{const st=nt.scrollArea;let at=0;if(st){const ct=()=>{window.clearTimeout(at),it(!0)},lt=()=>{at=window.setTimeout(()=>it(!1),nt.scrollHideDelay)};return st.addEventListener("pointerenter",ct),st.addEventListener("pointerleave",lt),()=>{window.clearTimeout(at),st.removeEventListener("pointerenter",ct),st.removeEventListener("pointerleave",lt)}}},[nt.scrollArea,nt.scrollHideDelay]),jsxRuntimeExports.jsx(Presence,{present:tt||ot,children:jsxRuntimeExports.jsx(ScrollAreaScrollbarAuto,{"data-state":ot?"visible":"hidden",...rt,ref:o})})}),ScrollAreaScrollbarScroll=reactExports.forwardRef((et,o)=>{const{forceMount:tt,...rt}=et,nt=useScrollAreaContext(SCROLLBAR_NAME,et.__scopeScrollArea),ot=et.orientation==="horizontal",it=useDebounceCallback(()=>at("SCROLL_END"),100),[st,at]=useStateMachine("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return reactExports.useEffect(()=>{if(st==="idle"){const ct=window.setTimeout(()=>at("HIDE"),nt.scrollHideDelay);return()=>window.clearTimeout(ct)}},[st,nt.scrollHideDelay,at]),reactExports.useEffect(()=>{const ct=nt.viewport,lt=ot?"scrollLeft":"scrollTop";if(ct){let dt=ct[lt];const ht=()=>{const mt=ct[lt];dt!==mt&&(at("SCROLL"),it()),dt=mt};return ct.addEventListener("scroll",ht),()=>ct.removeEventListener("scroll",ht)}},[nt.viewport,ot,at,it]),jsxRuntimeExports.jsx(Presence,{present:tt||st!=="hidden",children:jsxRuntimeExports.jsx(ScrollAreaScrollbarVisible,{"data-state":st==="hidden"?"hidden":"visible",...rt,ref:o,onPointerEnter:composeEventHandlers(et.onPointerEnter,()=>at("POINTER_ENTER")),onPointerLeave:composeEventHandlers(et.onPointerLeave,()=>at("POINTER_LEAVE"))})})}),ScrollAreaScrollbarAuto=reactExports.forwardRef((et,o)=>{const tt=useScrollAreaContext(SCROLLBAR_NAME,et.__scopeScrollArea),{forceMount:rt,...nt}=et,[ot,it]=reactExports.useState(!1),st=et.orientation==="horizontal",at=useDebounceCallback(()=>{if(tt.viewport){const ct=tt.viewport.offsetWidth<tt.viewport.scrollWidth,lt=tt.viewport.offsetHeight<tt.viewport.scrollHeight;it(st?ct:lt)}},10);return useResizeObserver(tt.viewport,at),useResizeObserver(tt.content,at),jsxRuntimeExports.jsx(Presence,{present:rt||ot,children:jsxRuntimeExports.jsx(ScrollAreaScrollbarVisible,{"data-state":ot?"visible":"hidden",...nt,ref:o})})}),ScrollAreaScrollbarVisible=reactExports.forwardRef((et,o)=>{const{orientation:tt="vertical",...rt}=et,nt=useScrollAreaContext(SCROLLBAR_NAME,et.__scopeScrollArea),ot=reactExports.useRef(null),it=reactExports.useRef(0),[st,at]=reactExports.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),ct=getThumbRatio(st.viewport,st.content),lt={...rt,sizes:st,onSizesChange:at,hasThumb:ct>0&&ct<1,onThumbChange:ht=>ot.current=ht,onThumbPointerUp:()=>it.current=0,onThumbPointerDown:ht=>it.current=ht};function dt(ht,mt){return getScrollPositionFromPointer(ht,it.current,st,mt)}return tt==="horizontal"?jsxRuntimeExports.jsx(ScrollAreaScrollbarX,{...lt,ref:o,onThumbPositionChange:()=>{if(nt.viewport&&ot.current){const ht=nt.viewport.scrollLeft,mt=getThumbOffsetFromScroll(ht,st,nt.dir);ot.current.style.transform=`translate3d(${mt}px, 0, 0)`}},onWheelScroll:ht=>{nt.viewport&&(nt.viewport.scrollLeft=ht)},onDragScroll:ht=>{nt.viewport&&(nt.viewport.scrollLeft=dt(ht,nt.dir))}}):tt==="vertical"?jsxRuntimeExports.jsx(ScrollAreaScrollbarY,{...lt,ref:o,onThumbPositionChange:()=>{if(nt.viewport&&ot.current){const ht=nt.viewport.scrollTop,mt=getThumbOffsetFromScroll(ht,st);ot.current.style.transform=`translate3d(0, ${mt}px, 0)`}},onWheelScroll:ht=>{nt.viewport&&(nt.viewport.scrollTop=ht)},onDragScroll:ht=>{nt.viewport&&(nt.viewport.scrollTop=dt(ht))}}):null}),ScrollAreaScrollbarX=reactExports.forwardRef((et,o)=>{const{sizes:tt,onSizesChange:rt,...nt}=et,ot=useScrollAreaContext(SCROLLBAR_NAME,et.__scopeScrollArea),[it,st]=reactExports.useState(),at=reactExports.useRef(null),ct=useComposedRefs(o,at,ot.onScrollbarXChange);return reactExports.useEffect(()=>{at.current&&st(getComputedStyle(at.current))},[at]),jsxRuntimeExports.jsx(ScrollAreaScrollbarImpl,{"data-orientation":"horizontal",...nt,ref:ct,sizes:tt,style:{bottom:0,left:ot.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:ot.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":getThumbSize(tt)+"px",...et.style},onThumbPointerDown:lt=>et.onThumbPointerDown(lt.x),onDragScroll:lt=>et.onDragScroll(lt.x),onWheelScroll:(lt,dt)=>{if(ot.viewport){const ht=ot.viewport.scrollLeft+lt.deltaX;et.onWheelScroll(ht),isScrollingWithinScrollbarBounds(ht,dt)&&lt.preventDefault()}},onResize:()=>{at.current&&ot.viewport&&it&&rt({content:ot.viewport.scrollWidth,viewport:ot.viewport.offsetWidth,scrollbar:{size:at.current.clientWidth,paddingStart:toInt(it.paddingLeft),paddingEnd:toInt(it.paddingRight)}})}})}),ScrollAreaScrollbarY=reactExports.forwardRef((et,o)=>{const{sizes:tt,onSizesChange:rt,...nt}=et,ot=useScrollAreaContext(SCROLLBAR_NAME,et.__scopeScrollArea),[it,st]=reactExports.useState(),at=reactExports.useRef(null),ct=useComposedRefs(o,at,ot.onScrollbarYChange);return reactExports.useEffect(()=>{at.current&&st(getComputedStyle(at.current))},[at]),jsxRuntimeExports.jsx(ScrollAreaScrollbarImpl,{"data-orientation":"vertical",...nt,ref:ct,sizes:tt,style:{top:0,right:ot.dir==="ltr"?0:void 0,left:ot.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":getThumbSize(tt)+"px",...et.style},onThumbPointerDown:lt=>et.onThumbPointerDown(lt.y),onDragScroll:lt=>et.onDragScroll(lt.y),onWheelScroll:(lt,dt)=>{if(ot.viewport){const ht=ot.viewport.scrollTop+lt.deltaY;et.onWheelScroll(ht),isScrollingWithinScrollbarBounds(ht,dt)&&lt.preventDefault()}},onResize:()=>{at.current&&ot.viewport&&it&&rt({content:ot.viewport.scrollHeight,viewport:ot.viewport.offsetHeight,scrollbar:{size:at.current.clientHeight,paddingStart:toInt(it.paddingTop),paddingEnd:toInt(it.paddingBottom)}})}})}),[ScrollbarProvider,useScrollbarContext]=createScrollAreaContext(SCROLLBAR_NAME),ScrollAreaScrollbarImpl=reactExports.forwardRef((et,o)=>{const{__scopeScrollArea:tt,sizes:rt,hasThumb:nt,onThumbChange:ot,onThumbPointerUp:it,onThumbPointerDown:st,onThumbPositionChange:at,onDragScroll:ct,onWheelScroll:lt,onResize:dt,...ht}=et,mt=useScrollAreaContext(SCROLLBAR_NAME,tt),[ft,pt]=reactExports.useState(null),yt=useComposedRefs(o,kt=>pt(kt)),gt=reactExports.useRef(null),bt=reactExports.useRef(""),xt=mt.viewport,vt=rt.content-rt.viewport,Et=useCallbackRef$1(lt),Ct=useCallbackRef$1(at),St=useDebounceCallback(dt,10);function At(kt){if(gt.current){const It=kt.clientX-gt.current.left,Nt=kt.clientY-gt.current.top;ct({x:It,y:Nt})}}return reactExports.useEffect(()=>{const kt=It=>{const Nt=It.target;(ft==null?void 0:ft.contains(Nt))&&Et(It,vt)};return document.addEventListener("wheel",kt,{passive:!1}),()=>document.removeEventListener("wheel",kt,{passive:!1})},[xt,ft,vt,Et]),reactExports.useEffect(Ct,[rt,Ct]),useResizeObserver(ft,St),useResizeObserver(mt.content,St),jsxRuntimeExports.jsx(ScrollbarProvider,{scope:tt,scrollbar:ft,hasThumb:nt,onThumbChange:useCallbackRef$1(ot),onThumbPointerUp:useCallbackRef$1(it),onThumbPositionChange:Ct,onThumbPointerDown:useCallbackRef$1(st),children:jsxRuntimeExports.jsx(Primitive.div,{...ht,ref:yt,style:{position:"absolute",...ht.style},onPointerDown:composeEventHandlers(et.onPointerDown,kt=>{kt.button===0&&(kt.target.setPointerCapture(kt.pointerId),gt.current=ft.getBoundingClientRect(),bt.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",mt.viewport&&(mt.viewport.style.scrollBehavior="auto"),At(kt))}),onPointerMove:composeEventHandlers(et.onPointerMove,At),onPointerUp:composeEventHandlers(et.onPointerUp,kt=>{const It=kt.target;It.hasPointerCapture(kt.pointerId)&&It.releasePointerCapture(kt.pointerId),document.body.style.webkitUserSelect=bt.current,mt.viewport&&(mt.viewport.style.scrollBehavior=""),gt.current=null})})})}),THUMB_NAME="ScrollAreaThumb",ScrollAreaThumb=reactExports.forwardRef((et,o)=>{const{forceMount:tt,...rt}=et,nt=useScrollbarContext(THUMB_NAME,et.__scopeScrollArea);return jsxRuntimeExports.jsx(Presence,{present:tt||nt.hasThumb,children:jsxRuntimeExports.jsx(ScrollAreaThumbImpl,{ref:o,...rt})})}),ScrollAreaThumbImpl=reactExports.forwardRef((et,o)=>{const{__scopeScrollArea:tt,style:rt,...nt}=et,ot=useScrollAreaContext(THUMB_NAME,tt),it=useScrollbarContext(THUMB_NAME,tt),{onThumbPositionChange:st}=it,at=useComposedRefs(o,dt=>it.onThumbChange(dt)),ct=reactExports.useRef(),lt=useDebounceCallback(()=>{ct.current&&(ct.current(),ct.current=void 0)},100);return reactExports.useEffect(()=>{const dt=ot.viewport;if(dt){const ht=()=>{if(lt(),!ct.current){const mt=addUnlinkedScrollListener(dt,st);ct.current=mt,st()}};return st(),dt.addEventListener("scroll",ht),()=>dt.removeEventListener("scroll",ht)}},[ot.viewport,lt,st]),jsxRuntimeExports.jsx(Primitive.div,{"data-state":it.hasThumb?"visible":"hidden",...nt,ref:at,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...rt},onPointerDownCapture:composeEventHandlers(et.onPointerDownCapture,dt=>{const mt=dt.target.getBoundingClientRect(),ft=dt.clientX-mt.left,pt=dt.clientY-mt.top;it.onThumbPointerDown({x:ft,y:pt})}),onPointerUp:composeEventHandlers(et.onPointerUp,it.onThumbPointerUp)})});ScrollAreaThumb.displayName=THUMB_NAME;var CORNER_NAME="ScrollAreaCorner",ScrollAreaCorner=reactExports.forwardRef((et,o)=>{const tt=useScrollAreaContext(CORNER_NAME,et.__scopeScrollArea),rt=!!(tt.scrollbarX&&tt.scrollbarY);return tt.type!=="scroll"&&rt?jsxRuntimeExports.jsx(ScrollAreaCornerImpl,{...et,ref:o}):null});ScrollAreaCorner.displayName=CORNER_NAME;var ScrollAreaCornerImpl=reactExports.forwardRef((et,o)=>{const{__scopeScrollArea:tt,...rt}=et,nt=useScrollAreaContext(CORNER_NAME,tt),[ot,it]=reactExports.useState(0),[st,at]=reactExports.useState(0),ct=!!(ot&&st);return useResizeObserver(nt.scrollbarX,()=>{var dt;const lt=((dt=nt.scrollbarX)==null?void 0:dt.offsetHeight)||0;nt.onCornerHeightChange(lt),at(lt)}),useResizeObserver(nt.scrollbarY,()=>{var dt;const lt=((dt=nt.scrollbarY)==null?void 0:dt.offsetWidth)||0;nt.onCornerWidthChange(lt),it(lt)}),ct?jsxRuntimeExports.jsx(Primitive.div,{...rt,ref:o,style:{width:ot,height:st,position:"absolute",right:nt.dir==="ltr"?0:void 0,left:nt.dir==="rtl"?0:void 0,bottom:0,...et.style}}):null});function toInt(et){return et?parseInt(et,10):0}function getThumbRatio(et,o){const tt=et/o;return isNaN(tt)?0:tt}function getThumbSize(et){const o=getThumbRatio(et.viewport,et.content),tt=et.scrollbar.paddingStart+et.scrollbar.paddingEnd,rt=(et.scrollbar.size-tt)*o;return Math.max(rt,18)}function getScrollPositionFromPointer(et,o,tt,rt="ltr"){const nt=getThumbSize(tt),ot=nt/2,it=o||ot,st=nt-it,at=tt.scrollbar.paddingStart+it,ct=tt.scrollbar.size-tt.scrollbar.paddingEnd-st,lt=tt.content-tt.viewport,dt=rt==="ltr"?[0,lt]:[lt*-1,0];return linearScale([at,ct],dt)(et)}function getThumbOffsetFromScroll(et,o,tt="ltr"){const rt=getThumbSize(o),nt=o.scrollbar.paddingStart+o.scrollbar.paddingEnd,ot=o.scrollbar.size-nt,it=o.content-o.viewport,st=ot-rt,at=tt==="ltr"?[0,it]:[it*-1,0],ct=clamp(et,at);return linearScale([0,it],[0,st])(ct)}function linearScale(et,o){return tt=>{if(et[0]===et[1]||o[0]===o[1])return o[0];const rt=(o[1]-o[0])/(et[1]-et[0]);return o[0]+rt*(tt-et[0])}}function isScrollingWithinScrollbarBounds(et,o){return et>0&&et<o}var addUnlinkedScrollListener=(et,o=()=>{})=>{let tt={left:et.scrollLeft,top:et.scrollTop},rt=0;return function nt(){const ot={left:et.scrollLeft,top:et.scrollTop},it=tt.left!==ot.left,st=tt.top!==ot.top;(it||st)&&o(),tt=ot,rt=window.requestAnimationFrame(nt)}(),()=>window.cancelAnimationFrame(rt)};function useDebounceCallback(et,o){const tt=useCallbackRef$1(et),rt=reactExports.useRef(0);return reactExports.useEffect(()=>()=>window.clearTimeout(rt.current),[]),reactExports.useCallback(()=>{window.clearTimeout(rt.current),rt.current=window.setTimeout(tt,o)},[tt,o])}function useResizeObserver(et,o){const tt=useCallbackRef$1(o);useLayoutEffect2(()=>{let rt=0;if(et){const nt=new ResizeObserver(()=>{cancelAnimationFrame(rt),rt=window.requestAnimationFrame(tt)});return nt.observe(et),()=>{window.cancelAnimationFrame(rt),nt.unobserve(et)}}},[et,tt])}function getSubtree(et,o){const{asChild:tt,children:rt}=et;if(!tt)return typeof o=="function"?o(rt):o;const nt=reactExports.Children.only(rt);return reactExports.cloneElement(nt,{children:typeof o=="function"?o(nt.props.children):o})}var Root=ScrollArea$1,Viewport=ScrollAreaViewport,Corner=ScrollAreaCorner;const ScrollArea=reactExports.forwardRef(({className:et,children:o,...tt},rt)=>jsxRuntimeExports.jsxs(Root,{ref:rt,className:cn("relative overflow-hidden",et),...tt,children:[jsxRuntimeExports.jsx(Viewport,{className:"h-full w-full rounded-[inherit]",children:o}),jsxRuntimeExports.jsx(ScrollBar,{}),jsxRuntimeExports.jsx(Corner,{})]}));ScrollArea.displayName=Root.displayName;const ScrollBar=reactExports.forwardRef(({className:et,orientation:o="vertical",...tt},rt)=>jsxRuntimeExports.jsx(ScrollAreaScrollbar,{ref:rt,orientation:o,className:cn("flex touch-none select-none transition-colors",o==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",o==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",et),...tt,children:jsxRuntimeExports.jsx(ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));ScrollBar.displayName=ScrollAreaScrollbar.displayName;const privacyPolicy=`
# Waku - Dogfooding Website
*Last updated: 22 August 2024*
This Privacy Policy is intended to inform users of our approach to privacy in respect of this website ("Website"). In this regard, if you are visiting or interacting with our Website, this Privacy Policy applies to you.
This Website has been set-up by us for the purposes of gathering telemetry data from users of the Website about the reliability protocols utilised by Waku (such activity and related activity, being referred to as "Dogfooding").
Waku is a family of robust, censorship-resistant communication protocols designed to enable privacy-focused messaging for web3 apps. You can read more about Waku here: https://waku.org/.
## Who we are
For the purposes of this Privacy Policy and the collection and processing of personal data as a controller, the relevant entity is the Logos Collective Association, which has its registered office in Zug and its legal domicile address at
Logos Collective Association
c/o PST Consulting GmbH
Baarerstrasse 10
6300 Zug
Switzerland
Whenever we refer to "Logos", "we" or other similar references, we are referring to the Logos Collective Association.
## We limit the collection and processing of personal data from your use of the Website and for "Dogfooding" purposes
We aim to limit the collection and processing of personal data from users of the Website and your participation in Dogfooding. We only collect and process certain personal data for specific purposes and where we have the legal basis to do so under applicable privacy legislation. We will not collect or process any personal data that we don't need and where we do store any personal data, we will only store it for the least amount of time needed for the indicated purpose and in any event no longer than thirty (30) days.
In this regard, we collect and process the following personal data from your use of the Website and your participation in Dogfooding:
**IP address**: As part of such use of the Website, we briefly process your IP address. We however have a legitimate interest in processing such IP addresses to ensure the technical functionality and enhance the security measures of the Website. This IP address is not stored by us over time.
**Telemetry data**: We collect certain technical information (also referred to as telemetry data) to primarily determine the reliability (including, the performance and usage patterns) of the Waku reliability protocols for light clients. This information is only collected once you have accepted the prompt on the Website to participate in Dogfooding. Once you've accepted this prompt, a Waku node will start operating on your browser and then the technical information will start being collected by us.
The information collected includes:
- timestamps of receiving and sending messages;
- size of message packets;
- content topics/pubsub topics of the messages;
- code logs of errors and warnings; and
- a randomly generated temporary peer ID that represents your Waku node.
The temporary peer ID is a seeded identifier used for the duration of your participation in Dogfooding and allows us to correlate the obtained technical information with a particular session and with the additional information collected, could be potentially considered personal data. We process such data based on our legitimate interest to improve our software and the user's experience in respect of Waku.
If you do not agree to this data collection and processing, please do not interact with the Website or proceed with your participation in Dogfooding.
## Personal data sharing with third party service providers
We may share personal data with third party service providers in order for us to fulfil the above purposes. Such third party service providers act as data processors on our behalf and are only permitted to process personal data in accordance with our instructions and for the purposes specified above.
## Security measures we take in respect of the Website
As a general approach, we take data security seriously and we have implemented a variety of security measures on the Website that are reasonably designed to maintain the safety of your personal data when you submit such information to us.
In addition to the security measures of the Website, personal data is also protected by Waku (protocol) itself. You can read more about the security features implemented by the Waku protocol here.
## Exporting data outside the European Union and Switzerland
We are obliged to protect the privacy of personal data that you may have submitted in the unlikely event that we export your personal data to places outside the European Union or Switzerland. This means that personal data will only be processed in countries or by parties that provide an adequate level of protection as deemed by Switzerland or the European Commission. Otherwise, we will use other forms of protections, such as specific forms of contractual clauses to ensure such personal data is provided the same protection as required in Switzerland or Europe. In any event, the transmission of personal data outside the European Union and Switzerland will always occur in conformity with applicable privacy legislation.
## Your choices and rights
As explained in this Privacy Policy, we limit our collection and processing of your personal data wherever possible. Nonetheless, you still have certain choices and rights in respect of the personal data which we do collect and process. As laid out in relevant privacy legislation, you have the right to:
- Ask us to correct or update your personal data (where reasonably possible);
- Ask us to remove your personal data from our systems;
- Ask us for a copy of your personal data, which may also be transferred to another data controller at your request;
- Withdraw your consent to process your personal data (only if consent was asked for a processing activity), which only affects processing activities that are based on your consent and doesn't affect the validity of such processing activities before you have withdrawn your consent;
- Object to the processing of your personal data; and
- File a complaint with the Federal Data Protection and Information Commissioner (FDPIC), if you believe that your personal data has been processed unlawfully.
## Third party links
On this Website, you may come across links to third party websites. These third party sites have separate and independent privacy policies. We therefore have no responsibility or liability for the content and activities of these third party websites.
## This Privacy Policy might change
We may modify or replace any part of this Privacy Policy at any time and without notice. Please check the Website periodically for any changes. The new Privacy Policy will be effective immediately upon its posting on our Website.
## Contact information
To the extent that you have any questions about the Privacy Policy, please contact us at legal@free.technology.
This document is licensed under CC-BY-SA.
`;function ok$1(){}function unreachable(){}function stringify$1(et,o){const tt={};return(et[et.length-1]===""?[...et,""]:et).join((tt.padRight?" ":"")+","+(tt.padLeft===!1?"":" ")).trim()}const nameRe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,nameReJsx=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,emptyOptions$2={};function name(et,o){return(emptyOptions$2.jsx?nameReJsx:nameRe).test(et)}const re=/[ \t\n\f\r]/g;function whitespace(et){return typeof et=="object"?et.type==="text"?empty$1(et.value):!1:empty$1(et)}function empty$1(et){return et.replace(re,"")===""}class Schema{constructor(o,tt,rt){this.property=o,this.normal=tt,rt&&(this.space=rt)}}Schema.prototype.property={};Schema.prototype.normal={};Schema.prototype.space=null;function merge(et,o){const tt={},rt={};let nt=-1;for(;++nt<et.length;)Object.assign(tt,et[nt].property),Object.assign(rt,et[nt].normal);return new Schema(tt,rt,o)}function normalize$1(et){return et.toLowerCase()}class Info{constructor(o,tt){this.property=o,this.attribute=tt}}Info.prototype.space=null;Info.prototype.boolean=!1;Info.prototype.booleanish=!1;Info.prototype.overloadedBoolean=!1;Info.prototype.number=!1;Info.prototype.commaSeparated=!1;Info.prototype.spaceSeparated=!1;Info.prototype.commaOrSpaceSeparated=!1;Info.prototype.mustUseProperty=!1;Info.prototype.defined=!1;let powers=0;const boolean=increment(),booleanish=increment(),overloadedBoolean=increment(),number=increment(),spaceSeparated=increment(),commaSeparated=increment(),commaOrSpaceSeparated=increment();function increment(){return 2**++powers}const types=Object.freeze(Object.defineProperty({__proto__:null,boolean,booleanish,commaOrSpaceSeparated,commaSeparated,number,overloadedBoolean,spaceSeparated},Symbol.toStringTag,{value:"Module"})),checks=Object.keys(types);class DefinedInfo extends Info{constructor(o,tt,rt,nt){let ot=-1;if(super(o,tt),mark(this,"space",nt),typeof rt=="number")for(;++ot<checks.length;){const it=checks[ot];mark(this,checks[ot],(rt&types[it])===types[it])}}}DefinedInfo.prototype.defined=!0;function mark(et,o,tt){tt&&(et[o]=tt)}const own$4={}.hasOwnProperty;function create(et){const o={},tt={};let rt;for(rt in et.properties)if(own$4.call(et.properties,rt)){const nt=et.properties[rt],ot=new DefinedInfo(rt,et.transform(et.attributes||{},rt),nt,et.space);et.mustUseProperty&&et.mustUseProperty.includes(rt)&&(ot.mustUseProperty=!0),o[rt]=ot,tt[normalize$1(rt)]=rt,tt[normalize$1(ot.attribute)]=rt}return new Schema(o,tt,et.space)}const xlink=create({space:"xlink",transform(et,o){return"xlink:"+o.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),xml=create({space:"xml",transform(et,o){return"xml:"+o.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function caseSensitiveTransform(et,o){return o in et?et[o]:o}function caseInsensitiveTransform(et,o){return caseSensitiveTransform(et,o.toLowerCase())}const xmlns=create({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:caseInsensitiveTransform,properties:{xmlns:null,xmlnsXLink:null}}),aria=create({transform(et,o){return o==="role"?o:"aria-"+o.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:booleanish,ariaAutoComplete:null,ariaBusy:booleanish,ariaChecked:booleanish,ariaColCount:number,ariaColIndex:number,ariaColSpan:number,ariaControls:spaceSeparated,ariaCurrent:null,ariaDescribedBy:spaceSeparated,ariaDetails:null,ariaDisabled:booleanish,ariaDropEffect:spaceSeparated,ariaErrorMessage:null,ariaExpanded:booleanish,ariaFlowTo:spaceSeparated,ariaGrabbed:booleanish,ariaHasPopup:null,ariaHidden:booleanish,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:spaceSeparated,ariaLevel:number,ariaLive:null,ariaModal:booleanish,ariaMultiLine:booleanish,ariaMultiSelectable:booleanish,ariaOrientation:null,ariaOwns:spaceSeparated,ariaPlaceholder:null,ariaPosInSet:number,ariaPressed:booleanish,ariaReadOnly:booleanish,ariaRelevant:null,ariaRequired:booleanish,ariaRoleDescription:spaceSeparated,ariaRowCount:number,ariaRowIndex:number,ariaRowSpan:number,ariaSelected:booleanish,ariaSetSize:number,ariaSort:null,ariaValueMax:number,ariaValueMin:number,ariaValueNow:number,ariaValueText:null,role:null}}),html$2=create({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:caseInsensitiveTransform,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:commaSeparated,acceptCharset:spaceSeparated,accessKey:spaceSeparated,action:null,allow:null,allowFullScreen:boolean,allowPaymentRequest:boolean,allowUserMedia:boolean,alt:null,as:null,async:boolean,autoCapitalize:null,autoComplete:spaceSeparated,autoFocus:boolean,autoPlay:boolean,blocking:spaceSeparated,capture:null,charSet:null,checked:boolean,cite:null,className:spaceSeparated,cols:number,colSpan:null,content:null,contentEditable:booleanish,controls:boolean,controlsList:spaceSeparated,coords:number|commaSeparated,crossOrigin:null,data:null,dateTime:null,decoding:null,default:boolean,defer:boolean,dir:null,dirName:null,disabled:boolean,download:overloadedBoolean,draggable:booleanish,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:boolean,formTarget:null,headers:spaceSeparated,height:number,hidden:boolean,high:number,href:null,hrefLang:null,htmlFor:spaceSeparated,httpEquiv:spaceSeparated,id:null,imageSizes:null,imageSrcSet:null,inert:boolean,inputMode:null,integrity:null,is:null,isMap:boolean,itemId:null,itemProp:spaceSeparated,itemRef:spaceSeparated,itemScope:boolean,itemType:spaceSeparated,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:boolean,low:number,manifest:null,max:null,maxLength:number,media:null,method:null,min:null,minLength:number,multiple:boolean,muted:boolean,name:null,nonce:null,noModule:boolean,noValidate:boolean,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:boolean,optimum:number,pattern:null,ping:spaceSeparated,placeholder:null,playsInline:boolean,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:boolean,referrerPolicy:null,rel:spaceSeparated,required:boolean,reversed:boolean,rows:number,rowSpan:number,sandbox:spaceSeparated,scope:null,scoped:boolean,seamless:boolean,selected:boolean,shadowRootClonable:boolean,shadowRootDelegatesFocus:boolean,shadowRootMode:null,shape:null,size:number,sizes:null,slot:null,span:number,spellCheck:booleanish,src:null,srcDoc:null,srcLang:null,srcSet:null,start:number,step:null,style:null,tabIndex:number,target:null,title:null,translate:null,type:null,typeMustMatch:boolean,useMap:null,value:booleanish,width:number,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:spaceSeparated,axis:null,background:null,bgColor:null,border:number,borderColor:null,bottomMargin:number,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:boolean,declare:boolean,event:null,face:null,frame:null,frameBorder:null,hSpace:number,leftMargin:number,link:null,longDesc:null,lowSrc:null,marginHeight:number,marginWidth:number,noResize:boolean,noHref:boolean,noShade:boolean,noWrap:boolean,object:null,profile:null,prompt:null,rev:null,rightMargin:number,rules:null,scheme:null,scrolling:booleanish,standby:null,summary:null,text:null,topMargin:number,valueType:null,version:null,vAlign:null,vLink:null,vSpace:number,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:boolean,disableRemotePlayback:boolean,prefix:null,property:null,results:number,security:null,unselectable:null}}),svg$1=create({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:caseSensitiveTransform,properties:{about:commaOrSpaceSeparated,accentHeight:number,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:number,amplitude:number,arabicForm:null,ascent:number,attributeName:null,attributeType:null,azimuth:number,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:number,by:null,calcMode:null,capHeight:number,className:spaceSeparated,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:number,diffuseConstant:number,direction:null,display:null,dur:null,divisor:number,dominantBaseline:null,download:boolean,dx:null,dy:null,edgeMode:null,editable:null,elevation:number,enableBackground:null,end:null,event:null,exponent:number,externalResourcesRequired:null,fill:null,fillOpacity:number,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:commaSeparated,g2:commaSeparated,glyphName:commaSeparated,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:number,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:number,horizOriginX:number,horizOriginY:number,id:null,ideographic:number,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:number,k:number,k1:number,k2:number,k3:number,k4:number,kernelMatrix:commaOrSpaceSeparated,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:number,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:number,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:number,overlineThickness:number,paintOrder:null,panose1:null,path:null,pathLength:number,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:spaceSeparated,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:number,pointsAtY:number,pointsAtZ:number,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:commaOrSpaceSeparated,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:commaOrSpaceSeparated,rev:commaOrSpaceSeparated,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:commaOrSpaceSeparated,requiredFeatures:commaOrSpaceSeparated,requiredFonts:commaOrSpaceSeparated,requiredFormats:commaOrSpaceSeparated,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:number,specularExponent:number,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:number,strikethroughThickness:number,string:null,stroke:null,strokeDashArray:commaOrSpaceSeparated,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:number,strokeOpacity:number,strokeWidth:null,style:null,surfaceScale:number,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:commaOrSpaceSeparated,tabIndex:number,tableValues:null,target:null,targetX:number,targetY:number,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:commaOrSpaceSeparated,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:number,underlineThickness:number,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:number,values:null,vAlphabetic:number,vMathematical:number,vectorEffect:null,vHanging:number,vIdeographic:number,version:null,vertAdvY:number,vertOriginX:number,vertOriginY:number,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:number,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),valid=/^data[-\w.:]+$/i,dash=/-[a-z]/g,cap$1=/[A-Z]/g;function find(et,o){const tt=normalize$1(o);let rt=o,nt=Info;if(tt in et.normal)return et.property[et.normal[tt]];if(tt.length>4&&tt.slice(0,4)==="data"&&valid.test(o)){if(o.charAt(4)==="-"){const ot=o.slice(5).replace(dash,camelcase);rt="data"+ot.charAt(0).toUpperCase()+ot.slice(1)}else{const ot=o.slice(4);if(!dash.test(ot)){let it=ot.replace(cap$1,kebab);it.charAt(0)!=="-"&&(it="-"+it),o="data"+it}}nt=DefinedInfo}return new nt(rt,o)}function kebab(et){return"-"+et.toLowerCase()}function camelcase(et){return et.charAt(1).toUpperCase()}const hastToReact={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},html$1=merge([xml,xlink,xmlns,aria,html$2],"html"),svg=merge([xml,xlink,xmlns,aria,svg$1],"svg");function stringify(et){return et.join(" ").trim()}var cjs={},COMMENT_REGEX=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,NEWLINE_REGEX=/\n/g,WHITESPACE_REGEX=/^\s*/,PROPERTY_REGEX=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,COLON_REGEX=/^:\s*/,VALUE_REGEX=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,SEMICOLON_REGEX=/^[;\s]*/,TRIM_REGEX=/^\s+|\s+$/g,NEWLINE=`
`,FORWARD_SLASH="/",ASTERISK="*",EMPTY_STRING="",TYPE_COMMENT="comment",TYPE_DECLARATION="declaration",inlineStyleParser=function(et,o){if(typeof et!="string")throw new TypeError("First argument must be a string");if(!et)return[];o=o||{};var tt=1,rt=1;function nt(ft){var pt=ft.match(NEWLINE_REGEX);pt&&(tt+=pt.length);var yt=ft.lastIndexOf(NEWLINE);rt=~yt?ft.length-yt:rt+ft.length}function ot(){var ft={line:tt,column:rt};return function(pt){return pt.position=new it(ft),ct(),pt}}function it(ft){this.start=ft,this.end={line:tt,column:rt},this.source=o.source}it.prototype.content=et;function st(ft){var pt=new Error(o.source+":"+tt+":"+rt+": "+ft);if(pt.reason=ft,pt.filename=o.source,pt.line=tt,pt.column=rt,pt.source=et,!o.silent)throw pt}function at(ft){var pt=ft.exec(et);if(pt){var yt=pt[0];return nt(yt),et=et.slice(yt.length),pt}}function ct(){at(WHITESPACE_REGEX)}function lt(ft){var pt;for(ft=ft||[];pt=dt();)pt!==!1&&ft.push(pt);return ft}function dt(){var ft=ot();if(!(FORWARD_SLASH!=et.charAt(0)||ASTERISK!=et.charAt(1))){for(var pt=2;EMPTY_STRING!=et.charAt(pt)&&(ASTERISK!=et.charAt(pt)||FORWARD_SLASH!=et.charAt(pt+1));)++pt;if(pt+=2,EMPTY_STRING===et.charAt(pt-1))return st("End of comment missing");var yt=et.slice(2,pt-2);return rt+=2,nt(yt),et=et.slice(pt),rt+=2,ft({type:TYPE_COMMENT,comment:yt})}}function ht(){var ft=ot(),pt=at(PROPERTY_REGEX);if(pt){if(dt(),!at(COLON_REGEX))return st("property missing ':'");var yt=at(VALUE_REGEX),gt=ft({type:TYPE_DECLARATION,property:trim(pt[0].replace(COMMENT_REGEX,EMPTY_STRING)),value:yt?trim(yt[0].replace(COMMENT_REGEX,EMPTY_STRING)):EMPTY_STRING});return at(SEMICOLON_REGEX),gt}}function mt(){var ft=[];lt(ft);for(var pt;pt=ht();)pt!==!1&&(ft.push(pt),lt(ft));return ft}return ct(),mt()};function trim(et){return et?et.replace(TRIM_REGEX,EMPTY_STRING):EMPTY_STRING}var __importDefault=commonjsGlobal&&commonjsGlobal.__importDefault||function(et){return et&&et.__esModule?et:{default:et}};Object.defineProperty(cjs,"__esModule",{value:!0});var _default=cjs.default=StyleToObject,inline_style_parser_1=__importDefault(inlineStyleParser);function StyleToObject(et,o){var tt=null;if(!et||typeof et!="string")return tt;var rt=(0,inline_style_parser_1.default)(et),nt=typeof o=="function";return rt.forEach(function(ot){if(ot.type==="declaration"){var it=ot.property,st=ot.value;nt?o(it,st,ot):st&&(tt=tt||{},tt[it]=st)}}),tt}const styleToObject=_default.default||_default,pointEnd=point$2("end"),pointStart=point$2("start");function point$2(et){return o;function o(tt){const rt=tt&&tt.position&&tt.position[et]||{};if(typeof rt.line=="number"&&rt.line>0&&typeof rt.column=="number"&&rt.column>0)return{line:rt.line,column:rt.column,offset:typeof rt.offset=="number"&&rt.offset>-1?rt.offset:void 0}}}function position$1(et){const o=pointStart(et),tt=pointEnd(et);if(o&&tt)return{start:o,end:tt}}function stringifyPosition(et){return!et||typeof et!="object"?"":"position"in et||"type"in et?position(et.position):"start"in et||"end"in et?position(et):"line"in et||"column"in et?point$1(et):""}function point$1(et){return index(et&&et.line)+":"+index(et&&et.column)}function position(et){return point$1(et&&et.start)+"-"+point$1(et&&et.end)}function index(et){return et&&typeof et=="number"?et:1}class VFileMessage extends Error{constructor(o,tt,rt){super(),typeof tt=="string"&&(rt=tt,tt=void 0);let nt="",ot={},it=!1;if(tt&&("line"in tt&&"column"in tt?ot={place:tt}:"start"in tt&&"end"in tt?ot={place:tt}:"type"in tt?ot={ancestors:[tt],place:tt.position}:ot={...tt}),typeof o=="string"?nt=o:!ot.cause&&o&&(it=!0,nt=o.message,ot.cause=o),!ot.ruleId&&!ot.source&&typeof rt=="string"){const at=rt.indexOf(":");at===-1?ot.ruleId=rt:(ot.source=rt.slice(0,at),ot.ruleId=rt.slice(at+1))}if(!ot.place&&ot.ancestors&&ot.ancestors){const at=ot.ancestors[ot.ancestors.length-1];at&&(ot.place=at.position)}const st=ot.place&&"start"in ot.place?ot.place.start:ot.place;this.ancestors=ot.ancestors||void 0,this.cause=ot.cause||void 0,this.column=st?st.column:void 0,this.fatal=void 0,this.file,this.message=nt,this.line=st?st.line:void 0,this.name=stringifyPosition(ot.place)||"1:1",this.place=ot.place||void 0,this.reason=this.message,this.ruleId=ot.ruleId||void 0,this.source=ot.source||void 0,this.stack=it&&ot.cause&&typeof ot.cause.stack=="string"?ot.cause.stack:"",this.actual,this.expected,this.note,this.url}}VFileMessage.prototype.file="";VFileMessage.prototype.name="";VFileMessage.prototype.reason="";VFileMessage.prototype.message="";VFileMessage.prototype.stack="";VFileMessage.prototype.column=void 0;VFileMessage.prototype.line=void 0;VFileMessage.prototype.ancestors=void 0;VFileMessage.prototype.cause=void 0;VFileMessage.prototype.fatal=void 0;VFileMessage.prototype.place=void 0;VFileMessage.prototype.ruleId=void 0;VFileMessage.prototype.source=void 0;const own$3={}.hasOwnProperty,emptyMap=new Map,cap=/[A-Z]/g,dashSomething=/-([a-z])/g,tableElements=new Set(["table","tbody","thead","tfoot","tr"]),tableCellElement=new Set(["td","th"]),docs="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function toJsxRuntime(et,o){if(!o||o.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const tt=o.filePath||void 0;let rt;if(o.development){if(typeof o.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");rt=developmentCreate(tt,o.jsxDEV)}else{if(typeof o.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof o.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");rt=productionCreate(tt,o.jsx,o.jsxs)}const nt={Fragment:o.Fragment,ancestors:[],components:o.components||{},create:rt,elementAttributeNameCase:o.elementAttributeNameCase||"react",evaluater:o.createEvaluater?o.createEvaluater():void 0,filePath:tt,ignoreInvalidStyle:o.ignoreInvalidStyle||!1,passKeys:o.passKeys!==!1,passNode:o.passNode||!1,schema:o.space==="svg"?svg:html$1,stylePropertyNameCase:o.stylePropertyNameCase||"dom",tableCellAlignToStyle:o.tableCellAlignToStyle!==!1},ot=one$1(nt,et,void 0);return ot&&typeof ot!="string"?ot:nt.create(et,nt.Fragment,{children:ot||void 0},void 0)}function one$1(et,o,tt){if(o.type==="element")return element$1(et,o,tt);if(o.type==="mdxFlowExpression"||o.type==="mdxTextExpression")return mdxExpression(et,o);if(o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement")return mdxJsxElement(et,o,tt);if(o.type==="mdxjsEsm")return mdxEsm(et,o);if(o.type==="root")return root$1(et,o,tt);if(o.type==="text")return text$3(et,o)}function element$1(et,o,tt){const rt=et.schema;let nt=rt;o.tagName.toLowerCase()==="svg"&&rt.space==="html"&&(nt=svg,et.schema=nt),et.ancestors.push(o);const ot=findComponentFromName(et,o.tagName,!1),it=createElementProps(et,o);let st=createChildren(et,o);return tableElements.has(o.tagName)&&(st=st.filter(function(at){return typeof at=="string"?!whitespace(at):!0})),addNode(et,it,ot,o),addChildren(it,st),et.ancestors.pop(),et.schema=rt,et.create(o,ot,it,tt)}function mdxExpression(et,o){if(o.data&&o.data.estree&&et.evaluater){const rt=o.data.estree.body[0];return rt.type,et.evaluater.evaluateExpression(rt.expression)}crashEstree(et,o.position)}function mdxEsm(et,o){if(o.data&&o.data.estree&&et.evaluater)return et.evaluater.evaluateProgram(o.data.estree);crashEstree(et,o.position)}function mdxJsxElement(et,o,tt){const rt=et.schema;let nt=rt;o.name==="svg"&&rt.space==="html"&&(nt=svg,et.schema=nt),et.ancestors.push(o);const ot=o.name===null?et.Fragment:findComponentFromName(et,o.name,!0),it=createJsxElementProps(et,o),st=createChildren(et,o);return addNode(et,it,ot,o),addChildren(it,st),et.ancestors.pop(),et.schema=rt,et.create(o,ot,it,tt)}function root$1(et,o,tt){const rt={};return addChildren(rt,createChildren(et,o)),et.create(o,et.Fragment,rt,tt)}function text$3(et,o){return o.value}function addNode(et,o,tt,rt){typeof tt!="string"&&tt!==et.Fragment&&et.passNode&&(o.node=rt)}function addChildren(et,o){if(o.length>0){const tt=o.length>1?o:o[0];tt&&(et.children=tt)}}function productionCreate(et,o,tt){return rt;function rt(nt,ot,it,st){const ct=Array.isArray(it.children)?tt:o;return st?ct(ot,it,st):ct(ot,it)}}function developmentCreate(et,o){return tt;function tt(rt,nt,ot,it){const st=Array.isArray(ot.children),at=pointStart(rt);return o(nt,ot,it,st,{columnNumber:at?at.column-1:void 0,fileName:et,lineNumber:at?at.line:void 0},void 0)}}function createElementProps(et,o){const tt={};let rt,nt;for(nt in o.properties)if(nt!=="children"&&own$3.call(o.properties,nt)){const ot=createProperty(et,nt,o.properties[nt]);if(ot){const[it,st]=ot;et.tableCellAlignToStyle&&it==="align"&&typeof st=="string"&&tableCellElement.has(o.tagName)?rt=st:tt[it]=st}}if(rt){const ot=tt.style||(tt.style={});ot[et.stylePropertyNameCase==="css"?"text-align":"textAlign"]=rt}return tt}function createJsxElementProps(et,o){const tt={};for(const rt of o.attributes)if(rt.type==="mdxJsxExpressionAttribute")if(rt.data&&rt.data.estree&&et.evaluater){const ot=rt.data.estree.body[0];ot.type;const it=ot.expression;it.type;const st=it.properties[0];st.type,Object.assign(tt,et.evaluater.evaluateExpression(st.argument))}else crashEstree(et,o.position);else{const nt=rt.name;let ot;if(rt.value&&typeof rt.value=="object")if(rt.value.data&&rt.value.data.estree&&et.evaluater){const st=rt.value.data.estree.body[0];st.type,ot=et.evaluater.evaluateExpression(st.expression)}else crashEstree(et,o.position);else ot=rt.value===null?!0:rt.value;tt[nt]=ot}return tt}function createChildren(et,o){const tt=[];let rt=-1;const nt=et.passKeys?new Map:emptyMap;for(;++rt<o.children.length;){const ot=o.children[rt];let it;if(et.passKeys){const at=ot.type==="element"?ot.tagName:ot.type==="mdxJsxFlowElement"||ot.type==="mdxJsxTextElement"?ot.name:void 0;if(at){const ct=nt.get(at)||0;it=at+"-"+ct,nt.set(at,ct+1)}}const st=one$1(et,ot,it);st!==void 0&&tt.push(st)}return tt}function createProperty(et,o,tt){const rt=find(et.schema,o);if(!(tt==null||typeof tt=="number"&&Number.isNaN(tt))){if(Array.isArray(tt)&&(tt=rt.commaSeparated?stringify$1(tt):stringify(tt)),rt.property==="style"){let nt=typeof tt=="object"?tt:parseStyle(et,String(tt));return et.stylePropertyNameCase==="css"&&(nt=transformStylesToCssCasing(nt)),["style",nt]}return[et.elementAttributeNameCase==="react"&&rt.space?hastToReact[rt.property]||rt.property:rt.attribute,tt]}}function parseStyle(et,o){const tt={};try{styleToObject(o,rt)}catch(nt){if(!et.ignoreInvalidStyle){const ot=nt,it=new VFileMessage("Cannot parse `style` attribute",{ancestors:et.ancestors,cause:ot,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw it.file=et.filePath||void 0,it.url=docs+"#cannot-parse-style-attribute",it}}return tt;function rt(nt,ot){let it=nt;it.slice(0,2)!=="--"&&(it.slice(0,4)==="-ms-"&&(it="ms-"+it.slice(4)),it=it.replace(dashSomething,toCamel)),tt[it]=ot}}function findComponentFromName(et,o,tt){let rt;if(!tt)rt={type:"Literal",value:o};else if(o.includes(".")){const nt=o.split(".");let ot=-1,it;for(;++ot<nt.length;){const st=name(nt[ot])?{type:"Identifier",name:nt[ot]}:{type:"Literal",value:nt[ot]};it=it?{type:"MemberExpression",object:it,property:st,computed:!!(ot&&st.type==="Literal"),optional:!1}:st}rt=it}else rt=name(o)&&!/^[a-z]/.test(o)?{type:"Identifier",name:o}:{type:"Literal",value:o};if(rt.type==="Literal"){const nt=rt.value;return own$3.call(et.components,nt)?et.components[nt]:nt}if(et.evaluater)return et.evaluater.evaluateExpression(rt);crashEstree(et)}function crashEstree(et,o){const tt=new VFileMessage("Cannot handle MDX estrees without `createEvaluater`",{ancestors:et.ancestors,place:o,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw tt.file=et.filePath||void 0,tt.url=docs+"#cannot-handle-mdx-estrees-without-createevaluater",tt}function transformStylesToCssCasing(et){const o={};let tt;for(tt in et)own$3.call(et,tt)&&(o[transformStyleToCssCasing(tt)]=et[tt]);return o}function transformStyleToCssCasing(et){let o=et.replace(cap,toDash);return o.slice(0,3)==="ms-"&&(o="-"+o),o}function toCamel(et,o){return o.toUpperCase()}function toDash(et){return"-"+et.toLowerCase()}const urlAttributes={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},emptyOptions$1={};function toString$1(et,o){const tt=emptyOptions$1,rt=typeof tt.includeImageAlt=="boolean"?tt.includeImageAlt:!0,nt=typeof tt.includeHtml=="boolean"?tt.includeHtml:!0;return one(et,rt,nt)}function one(et,o,tt){if(node(et)){if("value"in et)return et.type==="html"&&!tt?"":et.value;if(o&&"alt"in et&&et.alt)return et.alt;if("children"in et)return all(et.children,o,tt)}return Array.isArray(et)?all(et,o,tt):""}function all(et,o,tt){const rt=[];let nt=-1;for(;++nt<et.length;)rt[nt]=one(et[nt],o,tt);return rt.join("")}function node(et){return!!(et&&typeof et=="object")}const element=document.createElement("i");function decodeNamedCharacterReference(et){const o="&"+et+";";element.innerHTML=o;const tt=element.textContent;return tt.charCodeAt(tt.length-1)===59&&et!=="semi"||tt===o?!1:tt}function splice(et,o,tt,rt){const nt=et.length;let ot=0,it;if(o<0?o=-o>nt?0:nt+o:o=o>nt?nt:o,tt=tt>0?tt:0,rt.length<1e4)it=Array.from(rt),it.unshift(o,tt),et.splice(...it);else for(tt&&et.splice(o,tt);ot<rt.length;)it=rt.slice(ot,ot+1e4),it.unshift(o,0),et.splice(...it),ot+=1e4,o+=1e4}function push(et,o){return et.length>0?(splice(et,et.length,0,o),et):o}const hasOwnProperty={}.hasOwnProperty;function combineExtensions(et){const o={};let tt=-1;for(;++tt<et.length;)syntaxExtension(o,et[tt]);return o}function syntaxExtension(et,o){let tt;for(tt in o){const nt=(hasOwnProperty.call(et,tt)?et[tt]:void 0)||(et[tt]={}),ot=o[tt];let it;if(ot)for(it in ot){hasOwnProperty.call(nt,it)||(nt[it]=[]);const st=ot[it];constructs(nt[it],Array.isArray(st)?st:st?[st]:[])}}}function constructs(et,o){let tt=-1;const rt=[];for(;++tt<o.length;)(o[tt].add==="after"?et:rt).push(o[tt]);splice(et,0,0,rt)}function decodeNumericCharacterReference(et,o){const tt=Number.parseInt(et,o);return tt<9||tt===11||tt>13&&tt<32||tt>126&&tt<160||tt>55295&&tt<57344||tt>64975&&tt<65008||(tt&65535)===65535||(tt&65535)===65534||tt>1114111?"<22>":String.fromCodePoint(tt)}function normalizeIdentifier(et){return et.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const asciiAlpha=regexCheck(/[A-Za-z]/),asciiAlphanumeric=regexCheck(/[\dA-Za-z]/),asciiAtext=regexCheck(/[#-'*+\--9=?A-Z^-~]/);function asciiControl(et){return et!==null&&(et<32||et===127)}const asciiDigit=regexCheck(/\d/),asciiHexDigit=regexCheck(/[\dA-Fa-f]/),asciiPunctuation=regexCheck(/[!-/:-@[-`{-~]/);function markdownLineEnding(et){return et!==null&&et<-2}function markdownLineEndingOrSpace(et){return et!==null&&(et<0||et===32)}function markdownSpace(et){return et===-2||et===-1||et===32}const unicodePunctuation=regexCheck(new RegExp("\\p{P}|\\p{S}","u")),unicodeWhitespace=regexCheck(/\s/);function regexCheck(et){return o;function o(tt){return tt!==null&&tt>-1&&et.test(String.fromCharCode(tt))}}function normalizeUri(et){const o=[];let tt=-1,rt=0,nt=0;for(;++tt<et.length;){const ot=et.charCodeAt(tt);let it="";if(ot===37&&asciiAlphanumeric(et.charCodeAt(tt+1))&&asciiAlphanumeric(et.charCodeAt(tt+2)))nt=2;else if(ot<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(ot))||(it=String.fromCharCode(ot));else if(ot>55295&&ot<57344){const st=et.charCodeAt(tt+1);ot<56320&&st>56319&&st<57344?(it=String.fromCharCode(ot,st),nt=1):it="<22>"}else it=String.fromCharCode(ot);it&&(o.push(et.slice(rt,tt),encodeURIComponent(it)),rt=tt+nt+1,it=""),nt&&(tt+=nt,nt=0)}return o.join("")+et.slice(rt)}function factorySpace(et,o,tt,rt){const nt=rt?rt-1:Number.POSITIVE_INFINITY;let ot=0;return it;function it(at){return markdownSpace(at)?(et.enter(tt),st(at)):o(at)}function st(at){return markdownSpace(at)&&ot++<nt?(et.consume(at),st):(et.exit(tt),o(at))}}const content$1={tokenize:initializeContent};function initializeContent(et){const o=et.attempt(this.parser.constructs.contentInitial,rt,nt);let tt;return o;function rt(st){if(st===null){et.consume(st);return}return et.enter("lineEnding"),et.consume(st),et.exit("lineEnding"),factorySpace(et,o,"linePrefix")}function nt(st){return et.enter("paragraph"),ot(st)}function ot(st){const at=et.enter("chunkText",{contentType:"text",previous:tt});return tt&&(tt.next=at),tt=at,it(st)}function it(st){if(st===null){et.exit("chunkText"),et.exit("paragraph"),et.consume(st);return}return markdownLineEnding(st)?(et.consume(st),et.exit("chunkText"),ot):(et.consume(st),it)}}const document$2={tokenize:initializeDocument},containerConstruct={tokenize:tokenizeContainer};function initializeDocument(et){const o=this,tt=[];let rt=0,nt,ot,it;return st;function st(xt){if(rt<tt.length){const vt=tt[rt];return o.containerState=vt[1],et.attempt(vt[0].continuation,at,ct)(xt)}return ct(xt)}function at(xt){if(rt++,o.containerState._closeFlow){o.containerState._closeFlow=void 0,nt&&bt();const vt=o.events.length;let Et=vt,Ct;for(;Et--;)if(o.events[Et][0]==="exit"&&o.events[Et][1].type==="chunkFlow"){Ct=o.events[Et][1].end;break}gt(rt);let St=vt;for(;St<o.events.length;)o.events[St][1].end=Object.assign({},Ct),St++;return splice(o.events,Et+1,0,o.events.slice(vt)),o.events.length=St,ct(xt)}return st(xt)}function ct(xt){if(rt===tt.length){if(!nt)return ht(xt);if(nt.currentConstruct&&nt.currentConstruct.concrete)return ft(xt);o.interrupt=!!(nt.currentConstruct&&!nt._gfmTableDynamicInterruptHack)}return o.containerState={},et.check(containerConstruct,lt,dt)(xt)}function lt(xt){return nt&&bt(),gt(rt),ht(xt)}function dt(xt){return o.parser.lazy[o.now().line]=rt!==tt.length,it=o.now().offset,ft(xt)}function ht(xt){return o.containerState={},et.attempt(containerConstruct,mt,ft)(xt)}function mt(xt){return rt++,tt.push([o.currentConstruct,o.containerState]),ht(xt)}function ft(xt){if(xt===null){nt&&bt(),gt(0),et.consume(xt);return}return nt=nt||o.parser.flow(o.now()),et.enter("chunkFlow",{contentType:"flow",previous:ot,_tokenizer:nt}),pt(xt)}function pt(xt){if(xt===null){yt(et.exit("chunkFlow"),!0),gt(0),et.consume(xt);return}return markdownLineEnding(xt)?(et.consume(xt),yt(et.exit("chunkFlow")),rt=0,o.interrupt=void 0,st):(et.consume(xt),pt)}function yt(xt,vt){const Et=o.sliceStream(xt);if(vt&&Et.push(null),xt.previous=ot,ot&&(ot.next=xt),ot=xt,nt.defineSkip(xt.start),nt.write(Et),o.parser.lazy[xt.start.line]){let Ct=nt.events.length;for(;Ct--;)if(nt.events[Ct][1].start.offset<it&&(!nt.events[Ct][1].end||nt.events[Ct][1].end.offset>it))return;const St=o.events.length;let At=St,kt,It;for(;At--;)if(o.events[At][0]==="exit"&&o.events[At][1].type==="chunkFlow"){if(kt){It=o.events[At][1].end;break}kt=!0}for(gt(rt),Ct=St;Ct<o.events.length;)o.events[Ct][1].end=Object.assign({},It),Ct++;splice(o.events,At+1,0,o.events.slice(St)),o.events.length=Ct}}function gt(xt){let vt=tt.length;for(;vt-- >xt;){const Et=tt[vt];o.containerState=Et[1],Et[0].exit.call(o,et)}tt.length=xt}function bt(){nt.write([null]),ot=void 0,nt=void 0,o.containerState._closeFlow=void 0}}function tokenizeContainer(et,o,tt){return factorySpace(et,et.attempt(this.parser.constructs.document,o,tt),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function classifyCharacter(et){if(et===null||markdownLineEndingOrSpace(et)||unicodeWhitespace(et))return 1;if(unicodePunctuation(et))return 2}function resolveAll(et,o,tt){const rt=[];let nt=-1;for(;++nt<et.length;){const ot=et[nt].resolveAll;ot&&!rt.includes(ot)&&(o=ot(o,tt),rt.push(ot))}return o}const attention={name:"attention",tokenize:tokenizeAttention,resolveAll:resolveAllAttention};function resolveAllAttention(et,o){let tt=-1,rt,nt,ot,it,st,at,ct,lt;for(;++tt<et.length;)if(et[tt][0]==="enter"&&et[tt][1].type==="attentionSequence"&&et[tt][1]._close){for(rt=tt;rt--;)if(et[rt][0]==="exit"&&et[rt][1].type==="attentionSequence"&&et[rt][1]._open&&o.sliceSerialize(et[rt][1]).charCodeAt(0)===o.sliceSerialize(et[tt][1]).charCodeAt(0)){if((et[rt][1]._close||et[tt][1]._open)&&(et[tt][1].end.offset-et[tt][1].start.offset)%3&&!((et[rt][1].end.offset-et[rt][1].start.offset+et[tt][1].end.offset-et[tt][1].start.offset)%3))continue;at=et[rt][1].end.offset-et[rt][1].start.offset>1&&et[tt][1].end.offset-et[tt][1].start.offset>1?2:1;const dt=Object.assign({},et[rt][1].end),ht=Object.assign({},et[tt][1].start);movePoint(dt,-at),movePoint(ht,at),it={type:at>1?"strongSequence":"emphasisSequence",start:dt,end:Object.assign({},et[rt][1].end)},st={type:at>1?"strongSequence":"emphasisSequence",start:Object.assign({},et[tt][1].start),end:ht},ot={type:at>1?"strongText":"emphasisText",start:Object.assign({},et[rt][1].end),end:Object.assign({},et[tt][1].start)},nt={type:at>1?"strong":"emphasis",start:Object.assign({},it.start),end:Object.assign({},st.end)},et[rt][1].end=Object.assign({},it.start),et[tt][1].start=Object.assign({},st.end),ct=[],et[rt][1].end.offset-et[rt][1].start.offset&&(ct=push(ct,[["enter",et[rt][1],o],["exit",et[rt][1],o]])),ct=push(ct,[["enter",nt,o],["enter",it,o],["exit",it,o],["enter",ot,o]]),ct=push(ct,resolveAll(o.parser.constructs.insideSpan.null,et.slice(rt+1,tt),o)),ct=push(ct,[["exit",ot,o],["enter",st,o],["exit",st,o],["exit",nt,o]]),et[tt][1].end.offset-et[tt][1].start.offset?(lt=2,ct=push(ct,[["enter",et[tt][1],o],["exit",et[tt][1],o]])):lt=0,splice(et,rt-1,tt-rt+3,ct),tt=rt+ct.length-lt-2;break}}for(tt=-1;++tt<et.length;)et[tt][1].type==="attentionSequence"&&(et[tt][1].type="data");return et}function tokenizeAttention(et,o){const tt=this.parser.constructs.attentionMarkers.null,rt=this.previous,nt=classifyCharacter(rt);let ot;return it;function it(at){return ot=at,et.enter("attentionSequence"),st(at)}function st(at){if(at===ot)return et.consume(at),st;const ct=et.exit("attentionSequence"),lt=classifyCharacter(at),dt=!lt||lt===2&&nt||tt.includes(at),ht=!nt||nt===2&&lt||tt.includes(rt);return ct._open=!!(ot===42?dt:dt&&(nt||!ht)),ct._close=!!(ot===42?ht:ht&&(lt||!dt)),o(at)}}function movePoint(et,o){et.column+=o,et.offset+=o,et._bufferIndex+=o}const autolink={name:"autolink",tokenize:tokenizeAutolink};function tokenizeAutolink(et,o,tt){let rt=0;return nt;function nt(mt){return et.enter("autolink"),et.enter("autolinkMarker"),et.consume(mt),et.exit("autolinkMarker"),et.enter("autolinkProtocol"),ot}function ot(mt){return asciiAlpha(mt)?(et.consume(mt),it):mt===64?tt(mt):ct(mt)}function it(mt){return mt===43||mt===45||mt===46||asciiAlphanumeric(mt)?(rt=1,st(mt)):ct(mt)}function st(mt){return mt===58?(et.consume(mt),rt=0,at):(mt===43||mt===45||mt===46||asciiAlphanumeric(mt))&&rt++<32?(et.consume(mt),st):(rt=0,ct(mt))}function at(mt){return mt===62?(et.exit("autolinkProtocol"),et.enter("autolinkMarker"),et.consume(mt),et.exit("autolinkMarker"),et.exit("autolink"),o):mt===null||mt===32||mt===60||asciiControl(mt)?tt(mt):(et.consume(mt),at)}function ct(mt){return mt===64?(et.consume(mt),lt):asciiAtext(mt)?(et.consume(mt),ct):tt(mt)}function lt(mt){return asciiAlphanumeric(mt)?dt(mt):tt(mt)}function dt(mt){return mt===46?(et.consume(mt),rt=0,lt):mt===62?(et.exit("autolinkProtocol").type="autolinkEmail",et.enter("autolinkMarker"),et.consume(mt),et.exit("autolinkMarker"),et.exit("autolink"),o):ht(mt)}function ht(mt){if((mt===45||asciiAlphanumeric(mt))&&rt++<63){const ft=mt===45?ht:dt;return et.consume(mt),ft}return tt(mt)}}const blankLine={tokenize:tokenizeBlankLine,partial:!0};function tokenizeBlankLine(et,o,tt){return rt;function rt(ot){return markdownSpace(ot)?factorySpace(et,nt,"linePrefix")(ot):nt(ot)}function nt(ot){return ot===null||markdownLineEnding(ot)?o(ot):tt(ot)}}const blockQuote={name:"blockQuote",tokenize:tokenizeBlockQuoteStart,continuation:{tokenize:tokenizeBlockQuoteContinuation},exit};function tokenizeBlockQuoteStart(et,o,tt){const rt=this;return nt;function nt(it){if(it===62){const st=rt.containerState;return st.open||(et.enter("blockQuote",{_container:!0}),st.open=!0),et.enter("blockQuotePrefix"),et.enter("blockQuoteMarker"),et.consume(it),et.exit("blockQuoteMarker"),ot}return tt(it)}function ot(it){return markdownSpace(it)?(et.enter("blockQuotePrefixWhitespace"),et.consume(it),et.exit("blockQuotePrefixWhitespace"),et.exit("blockQuotePrefix"),o):(et.exit("blockQuotePrefix"),o(it))}}function tokenizeBlockQuoteContinuation(et,o,tt){const rt=this;return nt;function nt(it){return markdownSpace(it)?factorySpace(et,ot,"linePrefix",rt.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(it):ot(it)}function ot(it){return et.attempt(blockQuote,o,tt)(it)}}function exit(et){et.exit("blockQuote")}const characterEscape={name:"characterEscape",tokenize:tokenizeCharacterEscape};function tokenizeCharacterEscape(et,o,tt){return rt;function rt(ot){return et.enter("characterEscape"),et.enter("escapeMarker"),et.consume(ot),et.exit("escapeMarker"),nt}function nt(ot){return asciiPunctuation(ot)?(et.enter("characterEscapeValue"),et.consume(ot),et.exit("characterEscapeValue"),et.exit("characterEscape"),o):tt(ot)}}const characterReference={name:"characterReference",tokenize:tokenizeCharacterReference};function tokenizeCharacterReference(et,o,tt){const rt=this;let nt=0,ot,it;return st;function st(dt){return et.enter("characterReference"),et.enter("characterReferenceMarker"),et.consume(dt),et.exit("characterReferenceMarker"),at}function at(dt){return dt===35?(et.enter("characterReferenceMarkerNumeric"),et.consume(dt),et.exit("characterReferenceMarkerNumeric"),ct):(et.enter("characterReferenceValue"),ot=31,it=asciiAlphanumeric,lt(dt))}function ct(dt){return dt===88||dt===120?(et.enter("characterReferenceMarkerHexadecimal"),et.consume(dt),et.exit("characterReferenceMarkerHexadecimal"),et.enter("characterReferenceValue"),ot=6,it=asciiHexDigit,lt):(et.enter("characterReferenceValue"),ot=7,it=asciiDigit,lt(dt))}function lt(dt){if(dt===59&&nt){const ht=et.exit("characterReferenceValue");return it===asciiAlphanumeric&&!decodeNamedCharacterReference(rt.sliceSerialize(ht))?tt(dt):(et.enter("characterReferenceMarker"),et.consume(dt),et.exit("characterReferenceMarker"),et.exit("characterReference"),o)}return it(dt)&&nt++<ot?(et.consume(dt),lt):tt(dt)}}const nonLazyContinuation={tokenize:tokenizeNonLazyContinuation,partial:!0},codeFenced={name:"codeFenced",tokenize:tokenizeCodeFenced,concrete:!0};function tokenizeCodeFenced(et,o,tt){const rt=this,nt={tokenize:Et,partial:!0};let ot=0,it=0,st;return at;function at(Ct){return ct(Ct)}function ct(Ct){const St=rt.events[rt.events.length-1];return ot=St&&St[1].type==="linePrefix"?St[2].sliceSerialize(St[1],!0).length:0,st=Ct,et.enter("codeFenced"),et.enter("codeFencedFence"),et.enter("codeFencedFenceSequence"),lt(Ct)}function lt(Ct){return Ct===st?(it++,et.consume(Ct),lt):it<3?tt(Ct):(et.exit("codeFencedFenceSequence"),markdownSpace(Ct)?factorySpace(et,dt,"whitespace")(Ct):dt(Ct))}function dt(Ct){return Ct===null||markdownLineEnding(Ct)?(et.exit("codeFencedFence"),rt.interrupt?o(Ct):et.check(nonLazyContinuation,pt,vt)(Ct)):(et.enter("codeFencedFenceInfo"),et.enter("chunkString",{contentType:"string"}),ht(Ct))}function ht(Ct){return Ct===null||markdownLineEnding(Ct)?(et.exit("chunkString"),et.exit("codeFencedFenceInfo"),dt(Ct)):markdownSpace(Ct)?(et.exit("chunkString"),et.exit("codeFencedFenceInfo"),factorySpace(et,mt,"whitespace")(Ct)):Ct===96&&Ct===st?tt(Ct):(et.consume(Ct),ht)}function mt(Ct){return Ct===null||markdownLineEnding(Ct)?dt(Ct):(et.enter("codeFencedFenceMeta"),et.enter("chunkString",{contentType:"string"}),ft(Ct))}function ft(Ct){return Ct===null||markdownLineEnding(Ct)?(et.exit("chunkString"),et.exit("codeFencedFenceMeta"),dt(Ct)):Ct===96&&Ct===st?tt(Ct):(et.consume(Ct),ft)}function pt(Ct){return et.attempt(nt,vt,yt)(Ct)}function yt(Ct){return et.enter("lineEnding"),et.consume(Ct),et.exit("lineEnding"),gt}function gt(Ct){return ot>0&&markdownSpace(Ct)?factorySpace(et,bt,"linePrefix",ot+1)(Ct):bt(Ct)}function bt(Ct){return Ct===null||markdownLineEnding(Ct)?et.check(nonLazyContinuation,pt,vt)(Ct):(et.enter("codeFlowValue"),xt(Ct))}function xt(Ct){return Ct===null||markdownLineEnding(Ct)?(et.exit("codeFlowValue"),bt(Ct)):(et.consume(Ct),xt)}function vt(Ct){return et.exit("codeFenced"),o(Ct)}function Et(Ct,St,At){let kt=0;return It;function It(Ut){return Ct.enter("lineEnding"),Ct.consume(Ut),Ct.exit("lineEnding"),Nt}function Nt(Ut){return Ct.enter("codeFencedFence"),markdownSpace(Ut)?factorySpace(Ct,Lt,"linePrefix",rt.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Ut):Lt(Ut)}function Lt(Ut){return Ut===st?(Ct.enter("codeFencedFenceSequence"),Mt(Ut)):At(Ut)}function Mt(Ut){return Ut===st?(kt++,Ct.consume(Ut),Mt):kt>=it?(Ct.exit("codeFencedFenceSequence"),markdownSpace(Ut)?factorySpace(Ct,zt,"whitespace")(Ut):zt(Ut)):At(Ut)}function zt(Ut){return Ut===null||markdownLineEnding(Ut)?(Ct.exit("codeFencedFence"),St(Ut)):At(Ut)}}}function tokenizeNonLazyContinuation(et,o,tt){const rt=this;return nt;function nt(it){return it===null?tt(it):(et.enter("lineEnding"),et.consume(it),et.exit("lineEnding"),ot)}function ot(it){return rt.parser.lazy[rt.now().line]?tt(it):o(it)}}const codeIndented={name:"codeIndented",tokenize:tokenizeCodeIndented},furtherStart={tokenize:tokenizeFurtherStart,partial:!0};function tokenizeCodeIndented(et,o,tt){const rt=this;return nt;function nt(ct){return et.enter("codeIndented"),factorySpace(et,ot,"linePrefix",5)(ct)}function ot(ct){const lt=rt.events[rt.events.length-1];return lt&&lt[1].type==="linePrefix"&&lt[2].sliceSerialize(lt[1],!0).length>=4?it(ct):tt(ct)}function it(ct){return ct===null?at(ct):markdownLineEnding(ct)?et.attempt(furtherStart,it,at)(ct):(et.enter("codeFlowValue"),st(ct))}function st(ct){return ct===null||markdownLineEnding(ct)?(et.exit("codeFlowValue"),it(ct)):(et.consume(ct),st)}function at(ct){return et.exit("codeIndented"),o(ct)}}function tokenizeFurtherStart(et,o,tt){const rt=this;return nt;function nt(it){return rt.parser.lazy[rt.now().line]?tt(it):markdownLineEnding(it)?(et.enter("lineEnding"),et.consume(it),et.exit("lineEnding"),nt):factorySpace(et,ot,"linePrefix",5)(it)}function ot(it){const st=rt.events[rt.events.length-1];return st&&st[1].type==="linePrefix"&&st[2].sliceSerialize(st[1],!0).length>=4?o(it):markdownLineEnding(it)?nt(it):tt(it)}}const codeText={name:"codeText",tokenize:tokenizeCodeText,resolve:resolveCodeText,previous};function resolveCodeText(et){let o=et.length-4,tt=3,rt,nt;if((et[tt][1].type==="lineEnding"||et[tt][1].type==="space")&&(et[o][1].type==="lineEnding"||et[o][1].type==="space")){for(rt=tt;++rt<o;)if(et[rt][1].type==="codeTextData"){et[tt][1].type="codeTextPadding",et[o][1].type="codeTextPadding",tt+=2,o-=2;break}}for(rt=tt-1,o++;++rt<=o;)nt===void 0?rt!==o&&et[rt][1].type!=="lineEnding"&&(nt=rt):(rt===o||et[rt][1].type==="lineEnding")&&(et[nt][1].type="codeTextData",rt!==nt+2&&(et[nt][1].end=et[rt-1][1].end,et.splice(nt+2,rt-nt-2),o-=rt-nt-2,rt=nt+2),nt=void 0);return et}function previous(et){return et!==96||this.events[this.events.length-1][1].type==="characterEscape"}function tokenizeCodeText(et,o,tt){let rt=0,nt,ot;return it;function it(dt){return et.enter("codeText"),et.enter("codeTextSequence"),st(dt)}function st(dt){return dt===96?(et.consume(dt),rt++,st):(et.exit("codeTextSequence"),at(dt))}function at(dt){return dt===null?tt(dt):dt===32?(et.enter("space"),et.consume(dt),et.exit("space"),at):dt===96?(ot=et.enter("codeTextSequence"),nt=0,lt(dt)):markdownLineEnding(dt)?(et.enter("lineEnding"),et.consume(dt),et.exit("lineEnding"),at):(et.enter("codeTextData"),ct(dt))}function ct(dt){return dt===null||dt===32||dt===96||markdownLineEnding(dt)?(et.exit("codeTextData"),at(dt)):(et.consume(dt),ct)}function lt(dt){return dt===96?(et.consume(dt),nt++,lt):nt===rt?(et.exit("codeTextSequence"),et.exit("codeText"),o(dt)):(ot.type="codeTextData",ct(dt))}}class SpliceBuffer{constructor(o){this.left=o?[...o]:[],this.right=[]}get(o){if(o<0||o>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+o+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return o<this.left.length?this.left[o]:this.right[this.right.length-o+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(o,tt){const rt=tt??Number.POSITIVE_INFINITY;return rt<this.left.length?this.left.slice(o,rt):o>this.left.length?this.right.slice(this.right.length-rt+this.left.length,this.right.length-o+this.left.length).reverse():this.left.slice(o).concat(this.right.slice(this.right.length-rt+this.left.length).reverse())}splice(o,tt,rt){const nt=tt||0;this.setCursor(Math.trunc(o));const ot=this.right.splice(this.right.length-nt,Number.POSITIVE_INFINITY);return rt&&chunkedPush(this.left,rt),ot.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(o){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(o)}pushMany(o){this.setCursor(Number.POSITIVE_INFINITY),chunkedPush(this.left,o)}unshift(o){this.setCursor(0),this.right.push(o)}unshiftMany(o){this.setCursor(0),chunkedPush(this.right,o.reverse())}setCursor(o){if(!(o===this.left.length||o>this.left.length&&this.right.length===0||o<0&&this.left.length===0))if(o<this.left.length){const tt=this.left.splice(o,Number.POSITIVE_INFINITY);chunkedPush(this.right,tt.reverse())}else{const tt=this.right.splice(this.left.length+this.right.length-o,Number.POSITIVE_INFINITY);chunkedPush(this.left,tt.reverse())}}}function chunkedPush(et,o){let tt=0;if(o.length<1e4)et.push(...o);else for(;tt<o.length;)et.push(...o.slice(tt,tt+1e4)),tt+=1e4}function subtokenize(et){const o={};let tt=-1,rt,nt,ot,it,st,at,ct;const lt=new SpliceBuffer(et);for(;++tt<lt.length;){for(;tt in o;)tt=o[tt];if(rt=lt.get(tt),tt&&rt[1].type==="chunkFlow"&&lt.get(tt-1)[1].type==="listItemPrefix"&&(at=rt[1]._tokenizer.events,ot=0,ot<at.length&&at[ot][1].type==="lineEndingBlank"&&(ot+=2),ot<at.length&&at[ot][1].type==="content"))for(;++ot<at.length&&at[ot][1].type!=="content";)at[ot][1].type==="chunkText"&&(at[ot][1]._isInFirstContentOfListItem=!0,ot++);if(rt[0]==="enter")rt[1].contentType&&(Object.assign(o,subcontent(lt,tt)),tt=o[tt],ct=!0);else if(rt[1]._container){for(ot=tt,nt=void 0;ot--&&(it=lt.get(ot),it[1].type==="lineEnding"||it[1].type==="lineEndingBlank");)it[0]==="enter"&&(nt&&(lt.get(nt)[1].type="lineEndingBlank"),it[1].type="lineEnding",nt=ot);nt&&(rt[1].end=Object.assign({},lt.get(nt)[1].start),st=lt.slice(nt,tt),st.unshift(rt),lt.splice(nt,tt-nt+1,st))}}return splice(et,0,Number.POSITIVE_INFINITY,lt.slice(0)),!ct}function subcontent(et,o){const tt=et.get(o)[1],rt=et.get(o)[2];let nt=o-1;const ot=[],it=tt._tokenizer||rt.parser[tt.contentType](tt.start),st=it.events,at=[],ct={};let lt,dt,ht=-1,mt=tt,ft=0,pt=0;const yt=[pt];for(;mt;){for(;et.get(++nt)[1]!==mt;);ot.push(nt),mt._tokenizer||(lt=rt.sliceStream(mt),mt.next||lt.push(null),dt&&it.defineSkip(mt.start),mt._isInFirstContentOfListItem&&(it._gfmTasklistFirstContentOfListItem=!0),it.write(lt),mt._isInFirstContentOfListItem&&(it._gfmTasklistFirstContentOfListItem=void 0)),dt=mt,mt=mt.next}for(mt=tt;++ht<st.length;)st[ht][0]==="exit"&&st[ht-1][0]==="enter"&&st[ht][1].type===st[ht-1][1].type&&st[ht][1].start.line!==st[ht][1].end.line&&(pt=ht+1,yt.push(pt),mt._tokenizer=void 0,mt.previous=void 0,mt=mt.next);for(it.events=[],mt?(mt._tokenizer=void 0,mt.previous=void 0):yt.pop(),ht=yt.length;ht--;){const gt=st.slice(yt[ht],yt[ht+1]),bt=ot.pop();at.push([bt,bt+gt.length-1]),et.splice(bt,2,gt)}for(at.reverse(),ht=-1;++ht<at.length;)ct[ft+at[ht][0]]=ft+at[ht][1],ft+=at[ht][1]-at[ht][0]-1;return ct}const content={tokenize:tokenizeContent,resolve:resolveContent},continuationConstruct={tokenize:tokenizeContinuation,partial:!0};function resolveContent(et){return subtokenize(et),et}function tokenizeContent(et,o){let tt;return rt;function rt(st){return et.enter("content"),tt=et.enter("chunkContent",{contentType:"content"}),nt(st)}function nt(st){return st===null?ot(st):markdownLineEnding(st)?et.check(continuationConstruct,it,ot)(st):(et.consume(st),nt)}function ot(st){return et.exit("chunkContent"),et.exit("content"),o(st)}function it(st){return et.consume(st),et.exit("chunkContent"),tt.next=et.enter("chunkContent",{contentType:"content",previous:tt}),tt=tt.next,nt}}function tokenizeContinuation(et,o,tt){const rt=this;return nt;function nt(it){return et.exit("chunkContent"),et.enter("lineEnding"),et.consume(it),et.exit("lineEnding"),factorySpace(et,ot,"linePrefix")}function ot(it){if(it===null||markdownLineEnding(it))return tt(it);const st=rt.events[rt.events.length-1];return!rt.parser.constructs.disable.null.includes("codeIndented")&&st&&st[1].type==="linePrefix"&&st[2].sliceSerialize(st[1],!0).length>=4?o(it):et.interrupt(rt.parser.constructs.flow,tt,o)(it)}}function factoryDestination(et,o,tt,rt,nt,ot,it,st,at){const ct=at||Number.POSITIVE_INFINITY;let lt=0;return dt;function dt(gt){return gt===60?(et.enter(rt),et.enter(nt),et.enter(ot),et.consume(gt),et.exit(ot),ht):gt===null||gt===32||gt===41||asciiControl(gt)?tt(gt):(et.enter(rt),et.enter(it),et.enter(st),et.enter("chunkString",{contentType:"string"}),pt(gt))}function ht(gt){return gt===62?(et.enter(ot),et.consume(gt),et.exit(ot),et.exit(nt),et.exit(rt),o):(et.enter(st),et.enter("chunkString",{contentType:"string"}),mt(gt))}function mt(gt){return gt===62?(et.exit("chunkString"),et.exit(st),ht(gt)):gt===null||gt===60||markdownLineEnding(gt)?tt(gt):(et.consume(gt),gt===92?ft:mt)}function ft(gt){return gt===60||gt===62||gt===92?(et.consume(gt),mt):mt(gt)}function pt(gt){return!lt&&(gt===null||gt===41||markdownLineEndingOrSpace(gt))?(et.exit("chunkString"),et.exit(st),et.exit(it),et.exit(rt),o(gt)):lt<ct&&gt===40?(et.consume(gt),lt++,pt):gt===41?(et.consume(gt),lt--,pt):gt===null||gt===32||gt===40||asciiControl(gt)?tt(gt):(et.consume(gt),gt===92?yt:pt)}function yt(gt){return gt===40||gt===41||gt===92?(et.consume(gt),pt):pt(gt)}}function factoryLabel(et,o,tt,rt,nt,ot){const it=this;let st=0,at;return ct;function ct(mt){return et.enter(rt),et.enter(nt),et.consume(mt),et.exit(nt),et.enter(ot),lt}function lt(mt){return st>999||mt===null||mt===91||mt===93&&!at||mt===94&&!st&&"_hiddenFootnoteSupport"in it.parser.constructs?tt(mt):mt===93?(et.exit(ot),et.enter(nt),et.consume(mt),et.exit(nt),et.exit(rt),o):markdownLineEnding(mt)?(et.enter("lineEnding"),et.consume(mt),et.exit("lineEnding"),lt):(et.enter("chunkString",{contentType:"string"}),dt(mt))}function dt(mt){return mt===null||mt===91||mt===93||markdownLineEnding(mt)||st++>999?(et.exit("chunkString"),lt(mt)):(et.consume(mt),at||(at=!markdownSpace(mt)),mt===92?ht:dt)}function ht(mt){return mt===91||mt===92||mt===93?(et.consume(mt),st++,dt):dt(mt)}}function factoryTitle(et,o,tt,rt,nt,ot){let it;return st;function st(ht){return ht===34||ht===39||ht===40?(et.enter(rt),et.enter(nt),et.consume(ht),et.exit(nt),it=ht===40?41:ht,at):tt(ht)}function at(ht){return ht===it?(et.enter(nt),et.consume(ht),et.exit(nt),et.exit(rt),o):(et.enter(ot),ct(ht))}function ct(ht){return ht===it?(et.exit(ot),at(it)):ht===null?tt(ht):markdownLineEnding(ht)?(et.enter("lineEnding"),et.consume(ht),et.exit("lineEnding"),factorySpace(et,ct,"linePrefix")):(et.enter("chunkString",{contentType:"string"}),lt(ht))}function lt(ht){return ht===it||ht===null||markdownLineEnding(ht)?(et.exit("chunkString"),ct(ht)):(et.consume(ht),ht===92?dt:lt)}function dt(ht){return ht===it||ht===92?(et.consume(ht),lt):lt(ht)}}function factoryWhitespace(et,o){let tt;return rt;function rt(nt){return markdownLineEnding(nt)?(et.enter("lineEnding"),et.consume(nt),et.exit("lineEnding"),tt=!0,rt):markdownSpace(nt)?factorySpace(et,rt,tt?"linePrefix":"lineSuffix")(nt):o(nt)}}const definition={name:"definition",tokenize:tokenizeDefinition},titleBefore={tokenize:tokenizeTitleBefore,partial:!0};function tokenizeDefinition(et,o,tt){const rt=this;let nt;return ot;function ot(mt){return et.enter("definition"),it(mt)}function it(mt){return factoryLabel.call(rt,et,st,tt,"definitionLabel","definitionLabelMarker","definitionLabelString")(mt)}function st(mt){return nt=normalizeIdentifier(rt.sliceSerialize(rt.events[rt.events.length-1][1]).slice(1,-1)),mt===58?(et.enter("definitionMarker"),et.consume(mt),et.exit("definitionMarker"),at):tt(mt)}function at(mt){return markdownLineEndingOrSpace(mt)?factoryWhitespace(et,ct)(mt):ct(mt)}function ct(mt){return factoryDestination(et,lt,tt,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(mt)}function lt(mt){return et.attempt(titleBefore,dt,dt)(mt)}function dt(mt){return markdownSpace(mt)?factorySpace(et,ht,"whitespace")(mt):ht(mt)}function ht(mt){return mt===null||markdownLineEnding(mt)?(et.exit("definition"),rt.parser.defined.push(nt),o(mt)):tt(mt)}}function tokenizeTitleBefore(et,o,tt){return rt;function rt(st){return markdownLineEndingOrSpace(st)?factoryWhitespace(et,nt)(st):tt(st)}function nt(st){return factoryTitle(et,ot,tt,"definitionTitle","definitionTitleMarker","definitionTitleString")(st)}function ot(st){return markdownSpace(st)?factorySpace(et,it,"whitespace")(st):it(st)}function it(st){return st===null||markdownLineEnding(st)?o(st):tt(st)}}const hardBreakEscape={name:"hardBreakEscape",tokenize:tokenizeHardBreakEscape};function tokenizeHardBreakEscape(et,o,tt){return rt;function rt(ot){return et.enter("hardBreakEscape"),et.consume(ot),nt}function nt(ot){return markdownLineEnding(ot)?(et.exit("hardBreakEscape"),o(ot)):tt(ot)}}const headingAtx={name:"headingAtx",tokenize:tokenizeHeadingAtx,resolve:resolveHeadingAtx};function resolveHeadingAtx(et,o){let tt=et.length-2,rt=3,nt,ot;return et[rt][1].type==="whitespace"&&(rt+=2),tt-2>rt&&et[tt][1].type==="whitespace"&&(tt-=2),et[tt][1].type==="atxHeadingSequence"&&(rt===tt-1||tt-4>rt&&et[tt-2][1].type==="whitespace")&&(tt-=rt+1===tt?2:4),tt>rt&&(nt={type:"atxHeadingText",start:et[rt][1].start,end:et[tt][1].end},ot={type:"chunkText",start:et[rt][1].start,end:et[tt][1].end,contentType:"text"},splice(et,rt,tt-rt+1,[["enter",nt,o],["enter",ot,o],["exit",ot,o],["exit",nt,o]])),et}function tokenizeHeadingAtx(et,o,tt){let rt=0;return nt;function nt(lt){return et.enter("atxHeading"),ot(lt)}function ot(lt){return et.enter("atxHeadingSequence"),it(lt)}function it(lt){return lt===35&&rt++<6?(et.consume(lt),it):lt===null||markdownLineEndingOrSpace(lt)?(et.exit("atxHeadingSequence"),st(lt)):tt(lt)}function st(lt){return lt===35?(et.enter("atxHeadingSequence"),at(lt)):lt===null||markdownLineEnding(lt)?(et.exit("atxHeading"),o(lt)):markdownSpace(lt)?factorySpace(et,st,"whitespace")(lt):(et.enter("atxHeadingText"),ct(lt))}function at(lt){return lt===35?(et.consume(lt),at):(et.exit("atxHeadingSequence"),st(lt))}function ct(lt){return lt===null||lt===35||markdownLineEndingOrSpace(lt)?(et.exit("atxHeadingText"),st(lt)):(et.consume(lt),ct)}}const htmlBlockNames=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],htmlRawNames=["pre","script","style","textarea"],htmlFlow={name:"htmlFlow",tokenize:tokenizeHtmlFlow,resolveTo:resolveToHtmlFlow,concrete:!0},blankLineBefore={tokenize:tokenizeBlankLineBefore,partial:!0},nonLazyContinuationStart={tokenize:tokenizeNonLazyContinuationStart,partial:!0};function resolveToHtmlFlow(et){let o=et.length;for(;o--&&!(et[o][0]==="enter"&&et[o][1].type==="htmlFlow"););return o>1&&et[o-2][1].type==="linePrefix"&&(et[o][1].start=et[o-2][1].start,et[o+1][1].start=et[o-2][1].start,et.splice(o-2,2)),et}function tokenizeHtmlFlow(et,o,tt){const rt=this;let nt,ot,it,st,at;return ct;function ct(jt){return lt(jt)}function lt(jt){return et.enter("htmlFlow"),et.enter("htmlFlowData"),et.consume(jt),dt}function dt(jt){return jt===33?(et.consume(jt),ht):jt===47?(et.consume(jt),ot=!0,pt):jt===63?(et.consume(jt),nt=3,rt.interrupt?o:Pt):asciiAlpha(jt)?(et.consume(jt),it=String.fromCharCode(jt),yt):tt(jt)}function ht(jt){return jt===45?(et.consume(jt),nt=2,mt):jt===91?(et.consume(jt),nt=5,st=0,ft):asciiAlpha(jt)?(et.consume(jt),nt=4,rt.interrupt?o:Pt):tt(jt)}function mt(jt){return jt===45?(et.consume(jt),rt.interrupt?o:Pt):tt(jt)}function ft(jt){const Gt="CDATA[";return jt===Gt.charCodeAt(st++)?(et.consume(jt),st===Gt.length?rt.interrupt?o:Lt:ft):tt(jt)}function pt(jt){return asciiAlpha(jt)?(et.consume(jt),it=String.fromCharCode(jt),yt):tt(jt)}function yt(jt){if(jt===null||jt===47||jt===62||markdownLineEndingOrSpace(jt)){const Gt=jt===47,rr=it.toLowerCase();return!Gt&&!ot&&htmlRawNames.includes(rr)?(nt=1,rt.interrupt?o(jt):Lt(jt)):htmlBlockNames.includes(it.toLowerCase())?(nt=6,Gt?(et.consume(jt),gt):rt.interrupt?o(jt):Lt(jt)):(nt=7,rt.interrupt&&!rt.parser.lazy[rt.now().line]?tt(jt):ot?bt(jt):xt(jt))}return jt===45||asciiAlphanumeric(jt)?(et.consume(jt),it+=String.fromCharCode(jt),yt):tt(jt)}function gt(jt){return jt===62?(et.consume(jt),rt.interrupt?o:Lt):tt(jt)}function bt(jt){return markdownSpace(jt)?(et.consume(jt),bt):It(jt)}function xt(jt){return jt===47?(et.consume(jt),It):jt===58||jt===95||asciiAlpha(jt)?(et.consume(jt),vt):markdownSpace(jt)?(et.consume(jt),xt):It(jt)}function vt(jt){return jt===45||jt===46||jt===58||jt===95||asciiAlphanumeric(jt)?(et.consume(jt),vt):Et(jt)}function Et(jt){return jt===61?(et.consume(jt),Ct):markdownSpace(jt)?(et.consume(jt),Et):xt(jt)}function Ct(jt){return jt===null||jt===60||jt===61||jt===62||jt===96?tt(jt):jt===34||jt===39?(et.consume(jt),at=jt,St):markdownSpace(jt)?(et.consume(jt),Ct):At(jt)}function St(jt){return jt===at?(et.consume(jt),at=null,kt):jt===null||markdownLineEnding(jt)?tt(jt):(et.consume(jt),St)}function At(jt){return jt===null||jt===34||jt===39||jt===47||jt===60||jt===61||jt===62||jt===96||markdownLineEndingOrSpace(jt)?Et(jt):(et.consume(jt),At)}function kt(jt){return jt===47||jt===62||markdownSpace(jt)?xt(jt):tt(jt)}function It(jt){return jt===62?(et.consume(jt),Nt):tt(jt)}function Nt(jt){return jt===null||markdownLineEnding(jt)?Lt(jt):markdownSpace(jt)?(et.consume(jt),Nt):tt(jt)}function Lt(jt){return jt===45&&nt===2?(et.consume(jt),Xt):jt===60&&nt===1?(et.consume(jt),Wt):jt===62&&nt===4?(et.consume(jt),Yt):jt===63&&nt===3?(et.consume(jt),Pt):jt===93&&nt===5?(et.consume(jt),qt):markdownLineEnding(jt)&&(nt===6||nt===7)?(et.exit("htmlFlowData"),et.check(blankLineBefore,Qt,Mt)(jt)):jt===null||markdownLineEnding(jt)?(et.exit("htmlFlowData"),Mt(jt)):(et.consume(jt),Lt)}function Mt(jt){return et.check(nonLazyContinuationStart,zt,Qt)(jt)}function zt(jt){return et.enter("lineEnding"),et.consume(jt),et.exit("lineEnding"),Ut}function Ut(jt){return jt===null||markdownLineEnding(jt)?Mt(jt):(et.enter("htmlFlowData"),Lt(jt))}function Xt(jt){return jt===45?(et.consume(jt),Pt):Lt(jt)}function Wt(jt){return jt===47?(et.consume(jt),it="",Ft):Lt(jt)}function Ft(jt){if(jt===62){const Gt=it.toLowerCase();return htmlRawNames.includes(Gt)?(et.consume(jt),Yt):Lt(jt)}return asciiAlpha(jt)&&it.length<8?(et.consume(jt),it+=String.fromCharCode(jt),Ft):Lt(jt)}function qt(jt){return jt===93?(et.consume(jt),Pt):Lt(jt)}function Pt(jt){return jt===62?(et.consume(jt),Yt):jt===45&&nt===2?(et.consume(jt),Pt):Lt(jt)}function Yt(jt){return jt===null||markdownLineEnding(jt)?(et.exit("htmlFlowData"),Qt(jt)):(et.consume(jt),Yt)}function Qt(jt){return et.exit("htmlFlow"),o(jt)}}function tokenizeNonLazyContinuationStart(et,o,tt){const rt=this;return nt;function nt(it){return markdownLineEnding(it)?(et.enter("lineEnding"),et.consume(it),et.exit("lineEnding"),ot):tt(it)}function ot(it){return rt.parser.lazy[rt.now().line]?tt(it):o(it)}}function tokenizeBlankLineBefore(et,o,tt){return rt;function rt(nt){return et.enter("lineEnding"),et.consume(nt),et.exit("lineEnding"),et.attempt(blankLine,o,tt)}}const htmlText={name:"htmlText",tokenize:tokenizeHtmlText};function tokenizeHtmlText(et,o,tt){const rt=this;let nt,ot,it;return st;function st(Pt){return et.enter("htmlText"),et.enter("htmlTextData"),et.consume(Pt),at}function at(Pt){return Pt===33?(et.consume(Pt),ct):Pt===47?(et.consume(Pt),Et):Pt===63?(et.consume(Pt),xt):asciiAlpha(Pt)?(et.consume(Pt),At):tt(Pt)}function ct(Pt){return Pt===45?(et.consume(Pt),lt):Pt===91?(et.consume(Pt),ot=0,ft):asciiAlpha(Pt)?(et.consume(Pt),bt):tt(Pt)}function lt(Pt){return Pt===45?(et.consume(Pt),mt):tt(Pt)}function dt(Pt){return Pt===null?tt(Pt):Pt===45?(et.consume(Pt),ht):markdownLineEnding(Pt)?(it=dt,Wt(Pt)):(et.consume(Pt),dt)}function ht(Pt){return Pt===45?(et.consume(Pt),mt):dt(Pt)}function mt(Pt){return Pt===62?Xt(Pt):Pt===45?ht(Pt):dt(Pt)}function ft(Pt){const Yt="CDATA[";return Pt===Yt.charCodeAt(ot++)?(et.consume(Pt),ot===Yt.length?pt:ft):tt(Pt)}function pt(Pt){return Pt===null?tt(Pt):Pt===93?(et.consume(Pt),yt):markdownLineEnding(Pt)?(it=pt,Wt(Pt)):(et.consume(Pt),pt)}function yt(Pt){return Pt===93?(et.consume(Pt),gt):pt(Pt)}function gt(Pt){return Pt===62?Xt(Pt):Pt===93?(et.consume(Pt),gt):pt(Pt)}function bt(Pt){return Pt===null||Pt===62?Xt(Pt):markdownLineEnding(Pt)?(it=bt,Wt(Pt)):(et.consume(Pt),bt)}function xt(Pt){return Pt===null?tt(Pt):Pt===63?(et.consume(Pt),vt):markdownLineEnding(Pt)?(it=xt,Wt(Pt)):(et.consume(Pt),xt)}function vt(Pt){return Pt===62?Xt(Pt):xt(Pt)}function Et(Pt){return asciiAlpha(Pt)?(et.consume(Pt),Ct):tt(Pt)}function Ct(Pt){return Pt===45||asciiAlphanumeric(Pt)?(et.consume(Pt),Ct):St(Pt)}function St(Pt){return markdownLineEnding(Pt)?(it=St,Wt(Pt)):markdownSpace(Pt)?(et.consume(Pt),St):Xt(Pt)}function At(Pt){return Pt===45||asciiAlphanumeric(Pt)?(et.consume(Pt),At):Pt===47||Pt===62||markdownLineEndingOrSpace(Pt)?kt(Pt):tt(Pt)}function kt(Pt){return Pt===47?(et.consume(Pt),Xt):Pt===58||Pt===95||asciiAlpha(Pt)?(et.consume(Pt),It):markdownLineEnding(Pt)?(it=kt,Wt(Pt)):markdownSpace(Pt)?(et.consume(Pt),kt):Xt(Pt)}function It(Pt){return Pt===45||Pt===46||Pt===58||Pt===95||asciiAlphanumeric(Pt)?(et.consume(Pt),It):Nt(Pt)}function Nt(Pt){return Pt===61?(et.consume(Pt),Lt):markdownLineEnding(Pt)?(it=Nt,Wt(Pt)):markdownSpace(Pt)?(et.consume(Pt),Nt):kt(Pt)}function Lt(Pt){return Pt===null||Pt===60||Pt===61||Pt===62||Pt===96?tt(Pt):Pt===34||Pt===39?(et.consume(Pt),nt=Pt,Mt):markdownLineEnding(Pt)?(it=Lt,Wt(Pt)):markdownSpace(Pt)?(et.consume(Pt),Lt):(et.consume(Pt),zt)}function Mt(Pt){return Pt===nt?(et.consume(Pt),nt=void 0,Ut):Pt===null?tt(Pt):markdownLineEnding(Pt)?(it=Mt,Wt(Pt)):(et.consume(Pt),Mt)}function zt(Pt){return Pt===null||Pt===34||Pt===39||Pt===60||Pt===61||Pt===96?tt(Pt):Pt===47||Pt===62||markdownLineEndingOrSpace(Pt)?kt(Pt):(et.consume(Pt),zt)}function Ut(Pt){return Pt===47||Pt===62||markdownLineEndingOrSpace(Pt)?kt(Pt):tt(Pt)}function Xt(Pt){return Pt===62?(et.consume(Pt),et.exit("htmlTextData"),et.exit("htmlText"),o):tt(Pt)}function Wt(Pt){return et.exit("htmlTextData"),et.enter("lineEnding"),et.consume(Pt),et.exit("lineEnding"),Ft}function Ft(Pt){return markdownSpace(Pt)?factorySpace(et,qt,"linePrefix",rt.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Pt):qt(Pt)}function qt(Pt){return et.enter("htmlTextData"),it(Pt)}}const labelEnd={name:"labelEnd",tokenize:tokenizeLabelEnd,resolveTo:resolveToLabelEnd,resolveAll:resolveAllLabelEnd},resourceConstruct={tokenize:tokenizeResource},referenceFullConstruct={tokenize:tokenizeReferenceFull},referenceCollapsedConstruct={tokenize:tokenizeReferenceCollapsed};function resolveAllLabelEnd(et){let o=-1;for(;++o<et.length;){const tt=et[o][1];(tt.type==="labelImage"||tt.type==="labelLink"||tt.type==="labelEnd")&&(et.splice(o+1,tt.type==="labelImage"?4:2),tt.type="data",o++)}return et}function resolveToLabelEnd(et,o){let tt=et.length,rt=0,nt,ot,it,st;for(;tt--;)if(nt=et[tt][1],ot){if(nt.type==="link"||nt.type==="labelLink"&&nt._inactive)break;et[tt][0]==="enter"&&nt.type==="labelLink"&&(nt._inactive=!0)}else if(it){if(et[tt][0]==="enter"&&(nt.type==="labelImage"||nt.type==="labelLink")&&!nt._balanced&&(ot=tt,nt.type!=="labelLink")){rt=2;break}}else nt.type==="labelEnd"&&(it=tt);const at={type:et[ot][1].type==="labelLink"?"link":"image",start:Object.assign({},et[ot][1].start),end:Object.assign({},et[et.length-1][1].end)},ct={type:"label",start:Object.assign({},et[ot][1].start),end:Object.assign({},et[it][1].end)},lt={type:"labelText",start:Object.assign({},et[ot+rt+2][1].end),end:Object.assign({},et[it-2][1].start)};return st=[["enter",at,o],["enter",ct,o]],st=push(st,et.slice(ot+1,ot+rt+3)),st=push(st,[["enter",lt,o]]),st=push(st,resolveAll(o.parser.constructs.insideSpan.null,et.slice(ot+rt+4,it-3),o)),st=push(st,[["exit",lt,o],et[it-2],et[it-1],["exit",ct,o]]),st=push(st,et.slice(it+1)),st=push(st,[["exit",at,o]]),splice(et,ot,et.length,st),et}function tokenizeLabelEnd(et,o,tt){const rt=this;let nt=rt.events.length,ot,it;for(;nt--;)if((rt.events[nt][1].type==="labelImage"||rt.events[nt][1].type==="labelLink")&&!rt.events[nt][1]._balanced){ot=rt.events[nt][1];break}return st;function st(ht){return ot?ot._inactive?dt(ht):(it=rt.parser.defined.includes(normalizeIdentifier(rt.sliceSerialize({start:ot.end,end:rt.now()}))),et.enter("labelEnd"),et.enter("labelMarker"),et.consume(ht),et.exit("labelMarker"),et.exit("labelEnd"),at):tt(ht)}function at(ht){return ht===40?et.attempt(resourceConstruct,lt,it?lt:dt)(ht):ht===91?et.attempt(referenceFullConstruct,lt,it?ct:dt)(ht):it?lt(ht):dt(ht)}function ct(ht){return et.attempt(referenceCollapsedConstruct,lt,dt)(ht)}function lt(ht){return o(ht)}function dt(ht){return ot._balanced=!0,tt(ht)}}function tokenizeResource(et,o,tt){return rt;function rt(dt){return et.enter("resource"),et.enter("resourceMarker"),et.consume(dt),et.exit("resourceMarker"),nt}function nt(dt){return markdownLineEndingOrSpace(dt)?factoryWhitespace(et,ot)(dt):ot(dt)}function ot(dt){return dt===41?lt(dt):factoryDestination(et,it,st,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(dt)}function it(dt){return markdownLineEndingOrSpace(dt)?factoryWhitespace(et,at)(dt):lt(dt)}function st(dt){return tt(dt)}function at(dt){return dt===34||dt===39||dt===40?factoryTitle(et,ct,tt,"resourceTitle","resourceTitleMarker","resourceTitleString")(dt):lt(dt)}function ct(dt){return markdownLineEndingOrSpace(dt)?factoryWhitespace(et,lt)(dt):lt(dt)}function lt(dt){return dt===41?(et.enter("resourceMarker"),et.consume(dt),et.exit("resourceMarker"),et.exit("resource"),o):tt(dt)}}function tokenizeReferenceFull(et,o,tt){const rt=this;return nt;function nt(st){return factoryLabel.call(rt,et,ot,it,"reference","referenceMarker","referenceString")(st)}function ot(st){return rt.parser.defined.includes(normalizeIdentifier(rt.sliceSerialize(rt.events[rt.events.length-1][1]).slice(1,-1)))?o(st):tt(st)}function it(st){return tt(st)}}function tokenizeReferenceCollapsed(et,o,tt){return rt;function rt(ot){return et.enter("reference"),et.enter("referenceMarker"),et.consume(ot),et.exit("referenceMarker"),nt}function nt(ot){return ot===93?(et.enter("referenceMarker"),et.consume(ot),et.exit("referenceMarker"),et.exit("reference"),o):tt(ot)}}const labelStartImage={name:"labelStartImage",tokenize:tokenizeLabelStartImage,resolveAll:labelEnd.resolveAll};function tokenizeLabelStartImage(et,o,tt){const rt=this;return nt;function nt(st){return et.enter("labelImage"),et.enter("labelImageMarker"),et.consume(st),et.exit("labelImageMarker"),ot}function ot(st){return st===91?(et.enter("labelMarker"),et.consume(st),et.exit("labelMarker"),et.exit("labelImage"),it):tt(st)}function it(st){return st===94&&"_hiddenFootnoteSupport"in rt.parser.constructs?tt(st):o(st)}}const labelStartLink={name:"labelStartLink",tokenize:tokenizeLabelStartLink,resolveAll:labelEnd.resolveAll};function tokenizeLabelStartLink(et,o,tt){const rt=this;return nt;function nt(it){return et.enter("labelLink"),et.enter("labelMarker"),et.consume(it),et.exit("labelMarker"),et.exit("labelLink"),ot}function ot(it){return it===94&&"_hiddenFootnoteSupport"in rt.parser.constructs?tt(it):o(it)}}const lineEnding={name:"lineEnding",tokenize:tokenizeLineEnding};function tokenizeLineEnding(et,o){return tt;function tt(rt){return et.enter("lineEnding"),et.consume(rt),et.exit("lineEnding"),factorySpace(et,o,"linePrefix")}}const thematicBreak$1={name:"thematicBreak",tokenize:tokenizeThematicBreak};function tokenizeThematicBreak(et,o,tt){let rt=0,nt;return ot;function ot(ct){return et.enter("thematicBreak"),it(ct)}function it(ct){return nt=ct,st(ct)}function st(ct){return ct===nt?(et.enter("thematicBreakSequence"),at(ct)):rt>=3&&(ct===null||markdownLineEnding(ct))?(et.exit("thematicBreak"),o(ct)):tt(ct)}function at(ct){return ct===nt?(et.consume(ct),rt++,at):(et.exit("thematicBreakSequence"),markdownSpace(ct)?factorySpace(et,st,"whitespace")(ct):st(ct))}}const list$1={name:"list",tokenize:tokenizeListStart,continuation:{tokenize:tokenizeListContinuation},exit:tokenizeListEnd},listItemPrefixWhitespaceConstruct={tokenize:tokenizeListItemPrefixWhitespace,partial:!0},indentConstruct={tokenize:tokenizeIndent,partial:!0};function tokenizeListStart(et,o,tt){const rt=this,nt=rt.events[rt.events.length-1];let ot=nt&&nt[1].type==="linePrefix"?nt[2].sliceSerialize(nt[1],!0).length:0,it=0;return st;function st(mt){const ft=rt.containerState.type||(mt===42||mt===43||mt===45?"listUnordered":"listOrdered");if(ft==="listUnordered"?!rt.containerState.marker||mt===rt.containerState.marker:asciiDigit(mt)){if(rt.containerState.type||(rt.containerState.type=ft,et.enter(ft,{_container:!0})),ft==="listUnordered")return et.enter("listItemPrefix"),mt===42||mt===45?et.check(thematicBreak$1,tt,ct)(mt):ct(mt);if(!rt.interrupt||mt===49)return et.enter("listItemPrefix"),et.enter("listItemValue"),at(mt)}return tt(mt)}function at(mt){return asciiDigit(mt)&&++it<10?(et.consume(mt),at):(!rt.interrupt||it<2)&&(rt.containerState.marker?mt===rt.containerState.marker:mt===41||mt===46)?(et.exit("listItemValue"),ct(mt)):tt(mt)}function ct(mt){return et.enter("listItemMarker"),et.consume(mt),et.exit("listItemMarker"),rt.containerState.marker=rt.containerState.marker||mt,et.check(blankLine,rt.interrupt?tt:lt,et.attempt(listItemPrefixWhitespaceConstruct,ht,dt))}function lt(mt){return rt.containerState.initialBlankLine=!0,ot++,ht(mt)}function dt(mt){return markdownSpace(mt)?(et.enter("listItemPrefixWhitespace"),et.consume(mt),et.exit("listItemPrefixWhitespace"),ht):tt(mt)}function ht(mt){return rt.containerState.size=ot+rt.sliceSerialize(et.exit("listItemPrefix"),!0).length,o(mt)}}function tokenizeListContinuation(et,o,tt){const rt=this;return rt.containerState._closeFlow=void 0,et.check(blankLine,nt,ot);function nt(st){return rt.containerState.furtherBlankLines=rt.containerState.furtherBlankLines||rt.containerState.initialBlankLine,factorySpace(et,o,"listItemIndent",rt.containerState.size+1)(st)}function ot(st){return rt.containerState.furtherBlankLines||!markdownSpace(st)?(rt.containerState.furtherBlankLines=void 0,rt.containerState.initialBlankLine=void 0,it(st)):(rt.containerState.furtherBlankLines=void 0,rt.containerState.initialBlankLine=void 0,et.attempt(indentConstruct,o,it)(st))}function it(st){return rt.containerState._closeFlow=!0,rt.interrupt=void 0,factorySpace(et,et.attempt(list$1,o,tt),"linePrefix",rt.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(st)}}function tokenizeIndent(et,o,tt){const rt=this;return factorySpace(et,nt,"listItemIndent",rt.containerState.size+1);function nt(ot){const it=rt.events[rt.events.length-1];return it&&it[1].type==="listItemIndent"&&it[2].sliceSerialize(it[1],!0).length===rt.containerState.size?o(ot):tt(ot)}}function tokenizeListEnd(et){et.exit(this.containerState.type)}function tokenizeListItemPrefixWhitespace(et,o,tt){const rt=this;return factorySpace(et,nt,"listItemPrefixWhitespace",rt.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function nt(ot){const it=rt.events[rt.events.length-1];return!markdownSpace(ot)&&it&&it[1].type==="listItemPrefixWhitespace"?o(ot):tt(ot)}}const setextUnderline={name:"setextUnderline",tokenize:tokenizeSetextUnderline,resolveTo:resolveToSetextUnderline};function resolveToSetextUnderline(et,o){let tt=et.length,rt,nt,ot;for(;tt--;)if(et[tt][0]==="enter"){if(et[tt][1].type==="content"){rt=tt;break}et[tt][1].type==="paragraph"&&(nt=tt)}else et[tt][1].type==="content"&&et.splice(tt,1),!ot&&et[tt][1].type==="definition"&&(ot=tt);const it={type:"setextHeading",start:Object.assign({},et[nt][1].start),end:Object.assign({},et[et.length-1][1].end)};return et[nt][1].type="setextHeadingText",ot?(et.splice(nt,0,["enter",it,o]),et.splice(ot+1,0,["exit",et[rt][1],o]),et[rt][1].end=Object.assign({},et[ot][1].end)):et[rt][1]=it,et.push(["exit",it,o]),et}function tokenizeSetextUnderline(et,o,tt){const rt=this;let nt;return ot;function ot(ct){let lt=rt.events.length,dt;for(;lt--;)if(rt.events[lt][1].type!=="lineEnding"&&rt.events[lt][1].type!=="linePrefix"&&rt.events[lt][1].type!=="content"){dt=rt.events[lt][1].type==="paragraph";break}return!rt.parser.lazy[rt.now().line]&&(rt.interrupt||dt)?(et.enter("setextHeadingLine"),nt=ct,it(ct)):tt(ct)}function it(ct){return et.enter("setextHeadingLineSequence"),st(ct)}function st(ct){return ct===nt?(et.consume(ct),st):(et.exit("setextHeadingLineSequence"),markdownSpace(ct)?factorySpace(et,at,"lineSuffix")(ct):at(ct))}function at(ct){return ct===null||markdownLineEnding(ct)?(et.exit("setextHeadingLine"),o(ct)):tt(ct)}}const flow$1={tokenize:initializeFlow};function initializeFlow(et){const o=this,tt=et.attempt(blankLine,rt,et.attempt(this.parser.constructs.flowInitial,nt,factorySpace(et,et.attempt(this.parser.constructs.flow,nt,et.attempt(content,nt)),"linePrefix")));return tt;function rt(ot){if(ot===null){et.consume(ot);return}return et.enter("lineEndingBlank"),et.consume(ot),et.exit("lineEndingBlank"),o.currentConstruct=void 0,tt}function nt(ot){if(ot===null){et.consume(ot);return}return et.enter("lineEnding"),et.consume(ot),et.exit("lineEnding"),o.currentConstruct=void 0,tt}}const resolver={resolveAll:createResolver()},string$1=initializeFactory("string"),text$2=initializeFactory("text");function initializeFactory(et){return{tokenize:o,resolveAll:createResolver(et==="text"?resolveAllLineSuffixes:void 0)};function o(tt){const rt=this,nt=this.parser.constructs[et],ot=tt.attempt(nt,it,st);return it;function it(lt){return ct(lt)?ot(lt):st(lt)}function st(lt){if(lt===null){tt.consume(lt);return}return tt.enter("data"),tt.consume(lt),at}function at(lt){return ct(lt)?(tt.exit("data"),ot(lt)):(tt.consume(lt),at)}function ct(lt){if(lt===null)return!0;const dt=nt[lt];let ht=-1;if(dt)for(;++ht<dt.length;){const mt=dt[ht];if(!mt.previous||mt.previous.call(rt,rt.previous))return!0}return!1}}}function createResolver(et){return o;function o(tt,rt){let nt=-1,ot;for(;++nt<=tt.length;)ot===void 0?tt[nt]&&tt[nt][1].type==="data"&&(ot=nt,nt++):(!tt[nt]||tt[nt][1].type!=="data")&&(nt!==ot+2&&(tt[ot][1].end=tt[nt-1][1].end,tt.splice(ot+2,nt-ot-2),nt=ot+2),ot=void 0);return et?et(tt,rt):tt}}function resolveAllLineSuffixes(et,o){let tt=0;for(;++tt<=et.length;)if((tt===et.length||et[tt][1].type==="lineEnding")&&et[tt-1][1].type==="data"){const rt=et[tt-1][1],nt=o.sliceStream(rt);let ot=nt.length,it=-1,st=0,at;for(;ot--;){const ct=nt[ot];if(typeof ct=="string"){for(it=ct.length;ct.charCodeAt(it-1)===32;)st++,it--;if(it)break;it=-1}else if(ct===-2)at=!0,st++;else if(ct!==-1){ot++;break}}if(st){const ct={type:tt===et.length||at||st<2?"lineSuffix":"hardBreakTrailing",start:{line:rt.end.line,column:rt.end.column-st,offset:rt.end.offset-st,_index:rt.start._index+ot,_bufferIndex:ot?it:rt.start._bufferIndex+it},end:Object.assign({},rt.end)};rt.end=Object.assign({},ct.start),rt.start.offset===rt.end.offset?Object.assign(rt,ct):(et.splice(tt,0,["enter",ct,o],["exit",ct,o]),tt+=2)}tt++}return et}function createTokenizer(et,o,tt){let rt=Object.assign(tt?Object.assign({},tt):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const nt={},ot=[];let it=[],st=[];const at={consume:bt,enter:xt,exit:vt,attempt:St(Et),check:St(Ct),interrupt:St(Ct,{interrupt:!0})},ct={previous:null,code:null,containerState:{},events:[],parser:et,sliceStream:mt,sliceSerialize:ht,now:ft,defineSkip:pt,write:dt};let lt=o.tokenize.call(ct,at);return o.resolveAll&&ot.push(o),ct;function dt(Nt){return it=push(it,Nt),yt(),it[it.length-1]!==null?[]:(At(o,0),ct.events=resolveAll(ot,ct.events,ct),ct.events)}function ht(Nt,Lt){return serializeChunks(mt(Nt),Lt)}function mt(Nt){return sliceChunks(it,Nt)}function ft(){const{line:Nt,column:Lt,offset:Mt,_index:zt,_bufferIndex:Ut}=rt;return{line:Nt,column:Lt,offset:Mt,_index:zt,_bufferIndex:Ut}}function pt(Nt){nt[Nt.line]=Nt.column,It()}function yt(){let Nt;for(;rt._index<it.length;){const Lt=it[rt._index];if(typeof Lt=="string")for(Nt=rt._index,rt._bufferIndex<0&&(rt._bufferIndex=0);rt._index===Nt&&rt._bufferIndex<Lt.length;)gt(Lt.charCodeAt(rt._bufferIndex));else gt(Lt)}}function gt(Nt){lt=lt(Nt)}function bt(Nt){markdownLineEnding(Nt)?(rt.line++,rt.column=1,rt.offset+=Nt===-3?2:1,It()):Nt!==-1&&(rt.column++,rt.offset++),rt._bufferIndex<0?rt._index++:(rt._bufferIndex++,rt._bufferIndex===it[rt._index].length&&(rt._bufferIndex=-1,rt._index++)),ct.previous=Nt}function xt(Nt,Lt){const Mt=Lt||{};return Mt.type=Nt,Mt.start=ft(),ct.events.push(["enter",Mt,ct]),st.push(Mt),Mt}function vt(Nt){const Lt=st.pop();return Lt.end=ft(),ct.events.push(["exit",Lt,ct]),Lt}function Et(Nt,Lt){At(Nt,Lt.from)}function Ct(Nt,Lt){Lt.restore()}function St(Nt,Lt){return Mt;function Mt(zt,Ut,Xt){let Wt,Ft,qt,Pt;return Array.isArray(zt)?Qt(zt):"tokenize"in zt?Qt([zt]):Yt(zt);function Yt(Ht){return dr;function dr(Zt){const Jt=Zt!==null&&Ht[Zt],tr=Zt!==null&&Ht.null,_t=[...Array.isArray(Jt)?Jt:Jt?[Jt]:[],...Array.isArray(tr)?tr:tr?[tr]:[]];return Qt(_t)(Zt)}}function Qt(Ht){return Wt=Ht,Ft=0,Ht.length===0?Xt:jt(Ht[Ft])}function jt(Ht){return dr;function dr(Zt){return Pt=kt(),qt=Ht,Ht.partial||(ct.currentConstruct=Ht),Ht.name&&ct.parser.constructs.disable.null.includes(Ht.name)?rr():Ht.tokenize.call(Lt?Object.assign(Object.create(ct),Lt):ct,at,Gt,rr)(Zt)}}function Gt(Ht){return Nt(qt,Pt),Ut}function rr(Ht){return Pt.restore(),++Ft<Wt.length?jt(Wt[Ft]):Xt}}}function At(Nt,Lt){Nt.resolveAll&&!ot.includes(Nt)&&ot.push(Nt),Nt.resolve&&splice(ct.events,Lt,ct.events.length-Lt,Nt.resolve(ct.events.slice(Lt),ct)),Nt.resolveTo&&(ct.events=Nt.resolveTo(ct.events,ct))}function kt(){const Nt=ft(),Lt=ct.previous,Mt=ct.currentConstruct,zt=ct.events.length,Ut=Array.from(st);return{restore:Xt,from:zt};function Xt(){rt=Nt,ct.previous=Lt,ct.currentConstruct=Mt,ct.events.length=zt,st=Ut,It()}}function It(){rt.line in nt&&rt.column<2&&(rt.column=nt[rt.line],rt.offset+=nt[rt.line]-1)}}function sliceChunks(et,o){const tt=o.start._index,rt=o.start._bufferIndex,nt=o.end._index,ot=o.end._bufferIndex;let it;if(tt===nt)it=[et[tt].slice(rt,ot)];else{if(it=et.slice(tt,nt),rt>-1){const st=it[0];typeof st=="string"?it[0]=st.slice(rt):it.shift()}ot>0&&it.push(et[nt].slice(0,ot))}return it}function serializeChunks(et,o){let tt=-1;const rt=[];let nt;for(;++tt<et.length;){const ot=et[tt];let it;if(typeof ot=="string")it=ot;else switch(ot){case-5:{it="\r";break}case-4:{it=`
`;break}case-3:{it=`\r
`;break}case-2:{it=o?" ":" ";break}case-1:{if(!o&&nt)continue;it=" ";break}default:it=String.fromCharCode(ot)}nt=ot===-2,rt.push(it)}return rt.join("")}const document$1={42:list$1,43:list$1,45:list$1,48:list$1,49:list$1,50:list$1,51:list$1,52:list$1,53:list$1,54:list$1,55:list$1,56:list$1,57:list$1,62:blockQuote},contentInitial={91:definition},flowInitial={[-2]:codeIndented,[-1]:codeIndented,32:codeIndented},flow={35:headingAtx,42:thematicBreak$1,45:[setextUnderline,thematicBreak$1],60:htmlFlow,61:setextUnderline,95:thematicBreak$1,96:codeFenced,126:codeFenced},string={38:characterReference,92:characterEscape},text$1={[-5]:lineEnding,[-4]:lineEnding,[-3]:lineEnding,33:labelStartImage,38:characterReference,42:attention,60:[autolink,htmlText],91:labelStartLink,92:[hardBreakEscape,characterEscape],93:labelEnd,95:attention,96:codeText},insideSpan={null:[attention,resolver]},attentionMarkers={null:[42,95]},disable={null:[]},defaultConstructs=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers,contentInitial,disable,document:document$1,flow,flowInitial,insideSpan,string,text:text$1},Symbol.toStringTag,{value:"Module"}));function parse(et){const tt=combineExtensions([defaultConstructs,...(et||{}).extensions||[]]),rt={defined:[],lazy:{},constructs:tt,content:nt(content$1),document:nt(document$2),flow:nt(flow$1),string:nt(string$1),text:nt(text$2)};return rt;function nt(ot){return it;function it(st){return createTokenizer(rt,ot,st)}}}function postprocess(et){for(;!subtokenize(et););return et}const search=/[\0\t\n\r]/g;function preprocess(){let et=1,o="",tt=!0,rt;return nt;function nt(ot,it,st){const at=[];let ct,lt,dt,ht,mt;for(ot=o+(typeof ot=="string"?ot.toString():new TextDecoder(it||void 0).decode(ot)),dt=0,o="",tt&&(ot.charCodeAt(0)===65279&&dt++,tt=void 0);dt<ot.length;){if(search.lastIndex=dt,ct=search.exec(ot),ht=ct&&ct.index!==void 0?ct.index:ot.length,mt=ot.charCodeAt(ht),!ct){o=ot.slice(dt);break}if(mt===10&&dt===ht&&rt)at.push(-3),rt=void 0;else switch(rt&&(at.push(-5),rt=void 0),dt<ht&&(at.push(ot.slice(dt,ht)),et+=ht-dt),mt){case 0:{at.push(65533),et++;break}case 9:{for(lt=Math.ceil(et/4)*4,at.push(-2);et++<lt;)at.push(-1);break}case 10:{at.push(-4),et=1;break}default:rt=!0,et=1}dt=ht+1}return st&&(rt&&at.push(-5),o&&at.push(o),at.push(null)),at}}const characterEscapeOrReference=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function decodeString(et){return et.replace(characterEscapeOrReference,decode)}function decode(et,o,tt){if(o)return o;if(tt.charCodeAt(0)===35){const nt=tt.charCodeAt(1),ot=nt===120||nt===88;return decodeNumericCharacterReference(tt.slice(ot?2:1),ot?16:10)}return decodeNamedCharacterReference(tt)||et}const own$2={}.hasOwnProperty;function fromMarkdown(et,o,tt){return typeof o!="string"&&(tt=o,o=void 0),compiler(tt)(postprocess(parse(tt).document().write(preprocess()(et,o,!0))))}function compiler(et){const o={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:ot(Sr),autolinkProtocol:kt,autolinkEmail:kt,atxHeading:ot(ar),blockQuote:ot(tr),characterEscape:kt,characterReference:kt,codeFenced:ot(_t),codeFencedFenceInfo:it,codeFencedFenceMeta:it,codeIndented:ot(_t,it),codeText:ot(Bt,it),codeTextData:kt,data:kt,codeFlowValue:kt,definition:ot(Vt),definitionDestinationString:it,definitionLabelString:it,definitionTitleString:it,emphasis:ot(er),hardBreakEscape:ot(ur),hardBreakTrailing:ot(ur),htmlFlow:ot(cr,it),htmlFlowData:kt,htmlText:ot(cr,it),htmlTextData:kt,image:ot(hr),label:it,link:ot(Sr),listItem:ot(wr),listItemValue:ht,listOrdered:ot(pr,dt),listUnordered:ot(pr),paragraph:ot(_r),reference:jt,referenceString:it,resourceDestinationString:it,resourceTitleString:it,setextHeading:ot(ar),strong:ot(Tr),thematicBreak:ot(vr)},exit:{atxHeading:at(),atxHeadingSequence:Et,autolink:at(),autolinkEmail:Jt,autolinkProtocol:Zt,blockQuote:at(),characterEscapeValue:It,characterReferenceMarkerHexadecimal:rr,characterReferenceMarkerNumeric:rr,characterReferenceValue:Ht,characterReference:dr,codeFenced:at(yt),codeFencedFence:pt,codeFencedFenceInfo:mt,codeFencedFenceMeta:ft,codeFlowValue:It,codeIndented:at(gt),codeText:at(Ut),codeTextData:It,data:It,definition:at(),definitionDestinationString:vt,definitionLabelString:bt,definitionTitleString:xt,emphasis:at(),hardBreakEscape:at(Lt),hardBreakTrailing:at(Lt),htmlFlow:at(Mt),htmlFlowData:It,htmlText:at(zt),htmlTextData:It,image:at(Wt),label:qt,labelText:Ft,lineEnding:Nt,link:at(Xt),listItem:at(),listOrdered:at(),listUnordered:at(),paragraph:at(),referenceString:Gt,resourceDestinationString:Pt,resourceTitleString:Yt,resource:Qt,setextHeading:at(At),setextHeadingLineSequence:St,setextHeadingText:Ct,strong:at(),thematicBreak:at()}};configure(o,(et||{}).mdastExtensions||[]);const tt={};return rt;function rt(ir){let Tt={type:"root",children:[]};const $t={stack:[Tt],tokenStack:[],config:o,enter:st,exit:ct,buffer:it,resume:lt,data:tt},Rt=[];let Dt=-1;for(;++Dt<ir.length;)if(ir[Dt][1].type==="listOrdered"||ir[Dt][1].type==="listUnordered")if(ir[Dt][0]==="enter")Rt.push(Dt);else{const Kt=Rt.pop();Dt=nt(ir,Kt,Dt)}for(Dt=-1;++Dt<ir.length;){const Kt=o[ir[Dt][0]];own$2.call(Kt,ir[Dt][1].type)&&Kt[ir[Dt][1].type].call(Object.assign({sliceSerialize:ir[Dt][2].sliceSerialize},$t),ir[Dt][1])}if($t.tokenStack.length>0){const Kt=$t.tokenStack[$t.tokenStack.length-1];(Kt[1]||defaultOnError).call($t,void 0,Kt[0])}for(Tt.position={start:point(ir.length>0?ir[0][1].start:{line:1,column:1,offset:0}),end:point(ir.length>0?ir[ir.length-2][1].end:{line:1,column:1,offset:0})},Dt=-1;++Dt<o.transforms.length;)Tt=o.transforms[Dt](Tt)||Tt;return Tt}function nt(ir,Tt,$t){let Rt=Tt-1,Dt=-1,Kt=!1,nr,sr,br,$r;for(;++Rt<=$t;){const yr=ir[Rt];switch(yr[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{yr[0]==="enter"?Dt++:Dt--,$r=void 0;break}case"lineEndingBlank":{yr[0]==="enter"&&(nr&&!$r&&!Dt&&!br&&(br=Rt),$r=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:$r=void 0}if(!Dt&&yr[0]==="enter"&&yr[1].type==="listItemPrefix"||Dt===-1&&yr[0]==="exit"&&(yr[1].type==="listUnordered"||yr[1].type==="listOrdered")){if(nr){let Ar=Rt;for(sr=void 0;Ar--;){const xr=ir[Ar];if(xr[1].type==="lineEnding"||xr[1].type==="lineEndingBlank"){if(xr[0]==="exit")continue;sr&&(ir[sr][1].type="lineEndingBlank",Kt=!0),xr[1].type="lineEnding",sr=Ar}else if(!(xr[1].type==="linePrefix"||xr[1].type==="blockQuotePrefix"||xr[1].type==="blockQuotePrefixWhitespace"||xr[1].type==="blockQuoteMarker"||xr[1].type==="listItemIndent"))break}br&&(!sr||br<sr)&&(nr._spread=!0),nr.end=Object.assign({},sr?ir[sr][1].start:yr[1].end),ir.splice(sr||Rt,0,["exit",nr,yr[2]]),Rt++,$t++}if(yr[1].type==="listItemPrefix"){const Ar={type:"listItem",_spread:!1,start:Object.assign({},yr[1].start),end:void 0};nr=Ar,ir.splice(Rt,0,["enter",Ar,yr[2]]),Rt++,$t++,br=void 0,$r=!0}}}return ir[Tt][1]._spread=Kt,$t}function ot(ir,Tt){return $t;function $t(Rt){st.call(this,ir(Rt),Rt),Tt&&Tt.call(this,Rt)}}function it(){this.stack.push({type:"fragment",children:[]})}function st(ir,Tt,$t){this.stack[this.stack.length-1].children.push(ir),this.stack.push(ir),this.tokenStack.push([Tt,$t]),ir.position={start:point(Tt.start),end:void 0}}function at(ir){return Tt;function Tt($t){ir&&ir.call(this,$t),ct.call(this,$t)}}function ct(ir,Tt){const $t=this.stack.pop(),Rt=this.tokenStack.pop();if(Rt)Rt[0].type!==ir.type&&(Tt?Tt.call(this,ir,Rt[0]):(Rt[1]||defaultOnError).call(this,ir,Rt[0]));else throw new Error("Cannot close `"+ir.type+"` ("+stringifyPosition({start:ir.start,end:ir.end})+"): its not open");$t.position.end=point(ir.end)}function lt(){return toString$1(this.stack.pop())}function dt(){this.data.expectingFirstListItemValue=!0}function ht(ir){if(this.data.expectingFirstListItemValue){const Tt=this.stack[this.stack.length-2];Tt.start=Number.parseInt(this.sliceSerialize(ir),10),this.data.expectingFirstListItemValue=void 0}}function mt(){const ir=this.resume(),Tt=this.stack[this.stack.length-1];Tt.lang=ir}function ft(){const ir=this.resume(),Tt=this.stack[this.stack.length-1];Tt.meta=ir}function pt(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function yt(){const ir=this.resume(),Tt=this.stack[this.stack.length-1];Tt.value=ir.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function gt(){const ir=this.resume(),Tt=this.stack[this.stack.length-1];Tt.value=ir.replace(/(\r?\n|\r)$/g,"")}function bt(ir){const Tt=this.resume(),$t=this.stack[this.stack.length-1];$t.label=Tt,$t.identifier=normalizeIdentifier(this.sliceSerialize(ir)).toLowerCase()}function xt(){const ir=this.resume(),Tt=this.stack[this.stack.length-1];Tt.title=ir}function vt(){const ir=this.resume(),Tt=this.stack[this.stack.length-1];Tt.url=ir}function Et(ir){const Tt=this.stack[this.stack.length-1];if(!Tt.depth){const $t=this.sliceSerialize(ir).length;Tt.depth=$t}}function Ct(){this.data.setextHeadingSlurpLineEnding=!0}function St(ir){const Tt=this.stack[this.stack.length-1];Tt.depth=this.sliceSerialize(ir).codePointAt(0)===61?1:2}function At(){this.data.setextHeadingSlurpLineEnding=void 0}function kt(ir){const $t=this.stack[this.stack.length-1].children;let Rt=$t[$t.length-1];(!Rt||Rt.type!=="text")&&(Rt=gr(),Rt.position={start:point(ir.start),end:void 0},$t.push(Rt)),this.stack.push(Rt)}function It(ir){const Tt=this.stack.pop();Tt.value+=this.sliceSerialize(ir),Tt.position.end=point(ir.end)}function Nt(ir){const Tt=this.stack[this.stack.length-1];if(this.data.atHardBreak){const $t=Tt.children[Tt.children.length-1];$t.position.end=point(ir.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&o.canContainEols.includes(Tt.type)&&(kt.call(this,ir),It.call(this,ir))}function Lt(){this.data.atHardBreak=!0}function Mt(){const ir=this.resume(),Tt=this.stack[this.stack.length-1];Tt.value=ir}function zt(){const ir=this.resume(),Tt=this.stack[this.stack.length-1];Tt.value=ir}function Ut(){const ir=this.resume(),Tt=this.stack[this.stack.length-1];Tt.value=ir}function Xt(){const ir=this.stack[this.stack.length-1];if(this.data.inReference){const Tt=this.data.referenceType||"shortcut";ir.type+="Reference",ir.referenceType=Tt,delete ir.url,delete ir.title}else delete ir.identifier,delete ir.label;this.data.referenceType=void 0}function Wt(){const ir=this.stack[this.stack.length-1];if(this.data.inReference){const Tt=this.data.referenceType||"shortcut";ir.type+="Reference",ir.referenceType=Tt,delete ir.url,delete ir.title}else delete ir.identifier,delete ir.label;this.data.referenceType=void 0}function Ft(ir){const Tt=this.sliceSerialize(ir),$t=this.stack[this.stack.length-2];$t.label=decodeString(Tt),$t.identifier=normalizeIdentifier(Tt).toLowerCase()}function qt(){const ir=this.stack[this.stack.length-1],Tt=this.resume(),$t=this.stack[this.stack.length-1];if(this.data.inReference=!0,$t.type==="link"){const Rt=ir.children;$t.children=Rt}else $t.alt=Tt}function Pt(){const ir=this.resume(),Tt=this.stack[this.stack.length-1];Tt.url=ir}function Yt(){const ir=this.resume(),Tt=this.stack[this.stack.length-1];Tt.title=ir}function Qt(){this.data.inReference=void 0}function jt(){this.data.referenceType="collapsed"}function Gt(ir){const Tt=this.resume(),$t=this.stack[this.stack.length-1];$t.label=Tt,$t.identifier=normalizeIdentifier(this.sliceSerialize(ir)).toLowerCase(),this.data.referenceType="full"}function rr(ir){this.data.characterReferenceType=ir.type}function Ht(ir){const Tt=this.sliceSerialize(ir),$t=this.data.characterReferenceType;let Rt;$t?(Rt=decodeNumericCharacterReference(Tt,$t==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Rt=decodeNamedCharacterReference(Tt);const Dt=this.stack[this.stack.length-1];Dt.value+=Rt}function dr(ir){const Tt=this.stack.pop();Tt.position.end=point(ir.end)}function Zt(ir){It.call(this,ir);const Tt=this.stack[this.stack.length-1];Tt.url=this.sliceSerialize(ir)}function Jt(ir){It.call(this,ir);const Tt=this.stack[this.stack.length-1];Tt.url="mailto:"+this.sliceSerialize(ir)}function tr(){return{type:"blockquote",children:[]}}function _t(){return{type:"code",lang:null,meta:null,value:""}}function Bt(){return{type:"inlineCode",value:""}}function Vt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function er(){return{type:"emphasis",children:[]}}function ar(){return{type:"heading",depth:0,children:[]}}function ur(){return{type:"break"}}function cr(){return{type:"html",value:""}}function hr(){return{type:"image",title:null,url:"",alt:null}}function Sr(){return{type:"link",title:null,url:"",children:[]}}function pr(ir){return{type:"list",ordered:ir.type==="listOrdered",start:null,spread:ir._spread,children:[]}}function wr(ir){return{type:"listItem",spread:ir._spread,checked:null,children:[]}}function _r(){return{type:"paragraph",children:[]}}function Tr(){return{type:"strong",children:[]}}function gr(){return{type:"text",value:""}}function vr(){return{type:"thematicBreak"}}}function point(et){return{line:et.line,column:et.column,offset:et.offset}}function configure(et,o){let tt=-1;for(;++tt<o.length;){const rt=o[tt];Array.isArray(rt)?configure(et,rt):extension(et,rt)}}function extension(et,o){let tt;for(tt in o)if(own$2.call(o,tt))switch(tt){case"canContainEols":{const rt=o[tt];rt&&et[tt].push(...rt);break}case"transforms":{const rt=o[tt];rt&&et[tt].push(...rt);break}case"enter":case"exit":{const rt=o[tt];rt&&Object.assign(et[tt],rt);break}}}function defaultOnError(et,o){throw et?new Error("Cannot close `"+et.type+"` ("+stringifyPosition({start:et.start,end:et.end})+"): a different token (`"+o.type+"`, "+stringifyPosition({start:o.start,end:o.end})+") is open"):new Error("Cannot close document, a token (`"+o.type+"`, "+stringifyPosition({start:o.start,end:o.end})+") is still open")}function remarkParse(et){const o=this;o.parser=tt;function tt(rt){return fromMarkdown(rt,{...o.data("settings"),...et,extensions:o.data("micromarkExtensions")||[],mdastExtensions:o.data("fromMarkdownExtensions")||[]})}}function blockquote(et,o){const tt={type:"element",tagName:"blockquote",properties:{},children:et.wrap(et.all(o),!0)};return et.patch(o,tt),et.applyData(o,tt)}function hardBreak(et,o){const tt={type:"element",tagName:"br",properties:{},children:[]};return et.patch(o,tt),[et.applyData(o,tt),{type:"text",value:`
`}]}function code(et,o){const tt=o.value?o.value+`
`:"",rt={};o.lang&&(rt.className=["language-"+o.lang]);let nt={type:"element",tagName:"code",properties:rt,children:[{type:"text",value:tt}]};return o.meta&&(nt.data={meta:o.meta}),et.patch(o,nt),nt=et.applyData(o,nt),nt={type:"element",tagName:"pre",properties:{},children:[nt]},et.patch(o,nt),nt}function strikethrough(et,o){const tt={type:"element",tagName:"del",properties:{},children:et.all(o)};return et.patch(o,tt),et.applyData(o,tt)}function emphasis(et,o){const tt={type:"element",tagName:"em",properties:{},children:et.all(o)};return et.patch(o,tt),et.applyData(o,tt)}function footnoteReference(et,o){const tt=typeof et.options.clobberPrefix=="string"?et.options.clobberPrefix:"user-content-",rt=String(o.identifier).toUpperCase(),nt=normalizeUri(rt.toLowerCase()),ot=et.footnoteOrder.indexOf(rt);let it,st=et.footnoteCounts.get(rt);st===void 0?(st=0,et.footnoteOrder.push(rt),it=et.footnoteOrder.length):it=ot+1,st+=1,et.footnoteCounts.set(rt,st);const at={type:"element",tagName:"a",properties:{href:"#"+tt+"fn-"+nt,id:tt+"fnref-"+nt+(st>1?"-"+st:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(it)}]};et.patch(o,at);const ct={type:"element",tagName:"sup",properties:{},children:[at]};return et.patch(o,ct),et.applyData(o,ct)}function heading(et,o){const tt={type:"element",tagName:"h"+o.depth,properties:{},children:et.all(o)};return et.patch(o,tt),et.applyData(o,tt)}function html(et,o){if(et.options.allowDangerousHtml){const tt={type:"raw",value:o.value};return et.patch(o,tt),et.applyData(o,tt)}}function revert(et,o){const tt=o.referenceType;let rt="]";if(tt==="collapsed"?rt+="[]":tt==="full"&&(rt+="["+(o.label||o.identifier)+"]"),o.type==="imageReference")return[{type:"text",value:"!["+o.alt+rt}];const nt=et.all(o),ot=nt[0];ot&&ot.type==="text"?ot.value="["+ot.value:nt.unshift({type:"text",value:"["});const it=nt[nt.length-1];return it&&it.type==="text"?it.value+=rt:nt.push({type:"text",value:rt}),nt}function imageReference(et,o){const tt=String(o.identifier).toUpperCase(),rt=et.definitionById.get(tt);if(!rt)return revert(et,o);const nt={src:normalizeUri(rt.url||""),alt:o.alt};rt.title!==null&&rt.title!==void 0&&(nt.title=rt.title);const ot={type:"element",tagName:"img",properties:nt,children:[]};return et.patch(o,ot),et.applyData(o,ot)}function image(et,o){const tt={src:normalizeUri(o.url)};o.alt!==null&&o.alt!==void 0&&(tt.alt=o.alt),o.title!==null&&o.title!==void 0&&(tt.title=o.title);const rt={type:"element",tagName:"img",properties:tt,children:[]};return et.patch(o,rt),et.applyData(o,rt)}function inlineCode(et,o){const tt={type:"text",value:o.value.replace(/\r?\n|\r/g," ")};et.patch(o,tt);const rt={type:"element",tagName:"code",properties:{},children:[tt]};return et.patch(o,rt),et.applyData(o,rt)}function linkReference(et,o){const tt=String(o.identifier).toUpperCase(),rt=et.definitionById.get(tt);if(!rt)return revert(et,o);const nt={href:normalizeUri(rt.url||"")};rt.title!==null&&rt.title!==void 0&&(nt.title=rt.title);const ot={type:"element",tagName:"a",properties:nt,children:et.all(o)};return et.patch(o,ot),et.applyData(o,ot)}function link(et,o){const tt={href:normalizeUri(o.url)};o.title!==null&&o.title!==void 0&&(tt.title=o.title);const rt={type:"element",tagName:"a",properties:tt,children:et.all(o)};return et.patch(o,rt),et.applyData(o,rt)}function listItem(et,o,tt){const rt=et.all(o),nt=tt?listLoose(tt):listItemLoose(o),ot={},it=[];if(typeof o.checked=="boolean"){const lt=rt[0];let dt;lt&&lt.type==="element"&&lt.tagName==="p"?dt=lt:(dt={type:"element",tagName:"p",properties:{},children:[]},rt.unshift(dt)),dt.children.length>0&&dt.children.unshift({type:"text",value:" "}),dt.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:o.checked,disabled:!0},children:[]}),ot.className=["task-list-item"]}let st=-1;for(;++st<rt.length;){const lt=rt[st];(nt||st!==0||lt.type!=="element"||lt.tagName!=="p")&&it.push({type:"text",value:`
`}),lt.type==="element"&&lt.tagName==="p"&&!nt?it.push(...lt.children):it.push(lt)}const at=rt[rt.length-1];at&&(nt||at.type!=="element"||at.tagName!=="p")&&it.push({type:"text",value:`
`});const ct={type:"element",tagName:"li",properties:ot,children:it};return et.patch(o,ct),et.applyData(o,ct)}function listLoose(et){let o=!1;if(et.type==="list"){o=et.spread||!1;const tt=et.children;let rt=-1;for(;!o&&++rt<tt.length;)o=listItemLoose(tt[rt])}return o}function listItemLoose(et){const o=et.spread;return o??et.children.length>1}function list(et,o){const tt={},rt=et.all(o);let nt=-1;for(typeof o.start=="number"&&o.start!==1&&(tt.start=o.start);++nt<rt.length;){const it=rt[nt];if(it.type==="element"&&it.tagName==="li"&&it.properties&&Array.isArray(it.properties.className)&&it.properties.className.includes("task-list-item")){tt.className=["contains-task-list"];break}}const ot={type:"element",tagName:o.ordered?"ol":"ul",properties:tt,children:et.wrap(rt,!0)};return et.patch(o,ot),et.applyData(o,ot)}function paragraph(et,o){const tt={type:"element",tagName:"p",properties:{},children:et.all(o)};return et.patch(o,tt),et.applyData(o,tt)}function root(et,o){const tt={type:"root",children:et.wrap(et.all(o))};return et.patch(o,tt),et.applyData(o,tt)}function strong(et,o){const tt={type:"element",tagName:"strong",properties:{},children:et.all(o)};return et.patch(o,tt),et.applyData(o,tt)}function table(et,o){const tt=et.all(o),rt=tt.shift(),nt=[];if(rt){const it={type:"element",tagName:"thead",properties:{},children:et.wrap([rt],!0)};et.patch(o.children[0],it),nt.push(it)}if(tt.length>0){const it={type:"element",tagName:"tbody",properties:{},children:et.wrap(tt,!0)},st=pointStart(o.children[1]),at=pointEnd(o.children[o.children.length-1]);st&&at&&(it.position={start:st,end:at}),nt.push(it)}const ot={type:"element",tagName:"table",properties:{},children:et.wrap(nt,!0)};return et.patch(o,ot),et.applyData(o,ot)}function tableRow(et,o,tt){const rt=tt?tt.children:void 0,ot=(rt?rt.indexOf(o):1)===0?"th":"td",it=tt&&tt.type==="table"?tt.align:void 0,st=it?it.length:o.children.length;let at=-1;const ct=[];for(;++at<st;){const dt=o.children[at],ht={},mt=it?it[at]:void 0;mt&&(ht.align=mt);let ft={type:"element",tagName:ot,properties:ht,children:[]};dt&&(ft.children=et.all(dt),et.patch(dt,ft),ft=et.applyData(dt,ft)),ct.push(ft)}const lt={type:"element",tagName:"tr",properties:{},children:et.wrap(ct,!0)};return et.patch(o,lt),et.applyData(o,lt)}function tableCell(et,o){const tt={type:"element",tagName:"td",properties:{},children:et.all(o)};return et.patch(o,tt),et.applyData(o,tt)}const tab=9,space=32;function trimLines(et){const o=String(et),tt=/\r?\n|\r/g;let rt=tt.exec(o),nt=0;const ot=[];for(;rt;)ot.push(trimLine(o.slice(nt,rt.index),nt>0,!0),rt[0]),nt=rt.index+rt[0].length,rt=tt.exec(o);return ot.push(trimLine(o.slice(nt),nt>0,!1)),ot.join("")}function trimLine(et,o,tt){let rt=0,nt=et.length;if(o){let ot=et.codePointAt(rt);for(;ot===tab||ot===space;)rt++,ot=et.codePointAt(rt)}if(tt){let ot=et.codePointAt(nt-1);for(;ot===tab||ot===space;)nt--,ot=et.codePointAt(nt-1)}return nt>rt?et.slice(rt,nt):""}function text(et,o){const tt={type:"text",value:trimLines(String(o.value))};return et.patch(o,tt),et.applyData(o,tt)}function thematicBreak(et,o){const tt={type:"element",tagName:"hr",properties:{},children:[]};return et.patch(o,tt),et.applyData(o,tt)}const handlers={blockquote,break:hardBreak,code,delete:strikethrough,emphasis,footnoteReference,heading,html,imageReference,image,inlineCode,linkReference,link,listItem,list,paragraph,root,strong,table,tableCell,tableRow,text,thematicBreak,toml:ignore,yaml:ignore,definition:ignore,footnoteDefinition:ignore};function ignore(){}const VOID=-1,PRIMITIVE=0,ARRAY=1,OBJECT=2,DATE=3,REGEXP=4,MAP=5,SET=6,ERROR=7,BIGINT=8,env=typeof self=="object"?self:globalThis,deserializer=(et,o)=>{const tt=(nt,ot)=>(et.set(ot,nt),nt),rt=nt=>{if(et.has(nt))return et.get(nt);const[ot,it]=o[nt];switch(ot){case PRIMITIVE:case VOID:return tt(it,nt);case ARRAY:{const st=tt([],nt);for(const at of it)st.push(rt(at));return st}case OBJECT:{const st=tt({},nt);for(const[at,ct]of it)st[rt(at)]=rt(ct);return st}case DATE:return tt(new Date(it),nt);case REGEXP:{const{source:st,flags:at}=it;return tt(new RegExp(st,at),nt)}case MAP:{const st=tt(new Map,nt);for(const[at,ct]of it)st.set(rt(at),rt(ct));return st}case SET:{const st=tt(new Set,nt);for(const at of it)st.add(rt(at));return st}case ERROR:{const{name:st,message:at}=it;return tt(new env[st](at),nt)}case BIGINT:return tt(BigInt(it),nt);case"BigInt":return tt(Object(BigInt(it)),nt)}return tt(new env[ot](it),nt)};return rt},deserialize=et=>deserializer(new Map,et)(0),EMPTY="",{toString}={},{keys}=Object,typeOf=et=>{const o=typeof et;if(o!=="object"||!et)return[PRIMITIVE,o];const tt=toString.call(et).slice(8,-1);switch(tt){case"Array":return[ARRAY,EMPTY];case"Object":return[OBJECT,EMPTY];case"Date":return[DATE,EMPTY];case"RegExp":return[REGEXP,EMPTY];case"Map":return[MAP,EMPTY];case"Set":return[SET,EMPTY]}return tt.includes("Array")?[ARRAY,tt]:tt.includes("Error")?[ERROR,tt]:[OBJECT,tt]},shouldSkip=([et,o])=>et===PRIMITIVE&&(o==="function"||o==="symbol"),serializer=(et,o,tt,rt)=>{const nt=(it,st)=>{const at=rt.push(it)-1;return tt.set(st,at),at},ot=it=>{if(tt.has(it))return tt.get(it);let[st,at]=typeOf(it);switch(st){case PRIMITIVE:{let lt=it;switch(at){case"bigint":st=BIGINT,lt=it.toString();break;case"function":case"symbol":if(et)throw new TypeError("unable to serialize "+at);lt=null;break;case"undefined":return nt([VOID],it)}return nt([st,lt],it)}case ARRAY:{if(at)return nt([at,[...it]],it);const lt=[],dt=nt([st,lt],it);for(const ht of it)lt.push(ot(ht));return dt}case OBJECT:{if(at)switch(at){case"BigInt":return nt([at,it.toString()],it);case"Boolean":case"Number":case"String":return nt([at,it.valueOf()],it)}if(o&&"toJSON"in it)return ot(it.toJSON());const lt=[],dt=nt([st,lt],it);for(const ht of keys(it))(et||!shouldSkip(typeOf(it[ht])))&&lt.push([ot(ht),ot(it[ht])]);return dt}case DATE:return nt([st,it.toISOString()],it);case REGEXP:{const{source:lt,flags:dt}=it;return nt([st,{source:lt,flags:dt}],it)}case MAP:{const lt=[],dt=nt([st,lt],it);for(const[ht,mt]of it)(et||!(shouldSkip(typeOf(ht))||shouldSkip(typeOf(mt))))&&lt.push([ot(ht),ot(mt)]);return dt}case SET:{const lt=[],dt=nt([st,lt],it);for(const ht of it)(et||!shouldSkip(typeOf(ht)))&&lt.push(ot(ht));return dt}}const{message:ct}=it;return nt([st,{name:at,message:ct}],it)};return ot},serialize=(et,{json:o,lossy:tt}={})=>{const rt=[];return serializer(!(o||tt),!!o,new Map,rt)(et),rt},structuredClone$1=typeof structuredClone=="function"?(et,o)=>o&&("json"in o||"lossy"in o)?deserialize(serialize(et,o)):structuredClone(et):(et,o)=>deserialize(serialize(et,o));function defaultFootnoteBackContent(et,o){const tt=[{type:"text",value:"↩"}];return o>1&&tt.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(o)}]}),tt}function defaultFootnoteBackLabel(et,o){return"Back to reference "+(et+1)+(o>1?"-"+o:"")}function footer(et){const o=typeof et.options.clobberPrefix=="string"?et.options.clobberPrefix:"user-content-",tt=et.options.footnoteBackContent||defaultFootnoteBackContent,rt=et.options.footnoteBackLabel||defaultFootnoteBackLabel,nt=et.options.footnoteLabel||"Footnotes",ot=et.options.footnoteLabelTagName||"h2",it=et.options.footnoteLabelProperties||{className:["sr-only"]},st=[];let at=-1;for(;++at<et.footnoteOrder.length;){const ct=et.footnoteById.get(et.footnoteOrder[at]);if(!ct)continue;const lt=et.all(ct),dt=String(ct.identifier).toUpperCase(),ht=normalizeUri(dt.toLowerCase());let mt=0;const ft=[],pt=et.footnoteCounts.get(dt);for(;pt!==void 0&&++mt<=pt;){ft.length>0&&ft.push({type:"text",value:" "});let bt=typeof tt=="string"?tt:tt(at,mt);typeof bt=="string"&&(bt={type:"text",value:bt}),ft.push({type:"element",tagName:"a",properties:{href:"#"+o+"fnref-"+ht+(mt>1?"-"+mt:""),dataFootnoteBackref:"",ariaLabel:typeof rt=="string"?rt:rt(at,mt),className:["data-footnote-backref"]},children:Array.isArray(bt)?bt:[bt]})}const yt=lt[lt.length-1];if(yt&&yt.type==="element"&&yt.tagName==="p"){const bt=yt.children[yt.children.length-1];bt&&bt.type==="text"?bt.value+=" ":yt.children.push({type:"text",value:" "}),yt.children.push(...ft)}else lt.push(...ft);const gt={type:"element",tagName:"li",properties:{id:o+"fn-"+ht},children:et.wrap(lt,!0)};et.patch(ct,gt),st.push(gt)}if(st.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:ot,properties:{...structuredClone$1(it),id:"footnote-label"},children:[{type:"text",value:nt}]},{type:"text",value:`
`},{type:"element",tagName:"ol",properties:{},children:et.wrap(st,!0)},{type:"text",value:`
`}]}}const convert=function(et){if(et==null)return ok;if(typeof et=="function")return castFactory(et);if(typeof et=="object")return Array.isArray(et)?anyFactory(et):propsFactory(et);if(typeof et=="string")return typeFactory(et);throw new Error("Expected function, string, or object as test")};function anyFactory(et){const o=[];let tt=-1;for(;++tt<et.length;)o[tt]=convert(et[tt]);return castFactory(rt);function rt(...nt){let ot=-1;for(;++ot<o.length;)if(o[ot].apply(this,nt))return!0;return!1}}function propsFactory(et){const o=et;return castFactory(tt);function tt(rt){const nt=rt;let ot;for(ot in et)if(nt[ot]!==o[ot])return!1;return!0}}function typeFactory(et){return castFactory(o);function o(tt){return tt&&tt.type===et}}function castFactory(et){return o;function o(tt,rt,nt){return!!(looksLikeANode(tt)&&et.call(this,tt,typeof rt=="number"?rt:void 0,nt||void 0))}}function ok(){return!0}function looksLikeANode(et){return et!==null&&typeof et=="object"&&"type"in et}function color(et){return et}const empty=[],CONTINUE=!0,EXIT=!1,SKIP="skip";function visitParents(et,o,tt,rt){let nt;typeof o=="function"&&typeof tt!="function"?(rt=tt,tt=o):nt=o;const ot=convert(nt),it=rt?-1:1;st(et,void 0,[])();function st(at,ct,lt){const dt=at&&typeof at=="object"?at:{};if(typeof dt.type=="string"){const mt=typeof dt.tagName=="string"?dt.tagName:typeof dt.name=="string"?dt.name:void 0;Object.defineProperty(ht,"name",{value:"node ("+(at.type+(mt?"<"+mt+">":""))+")"})}return ht;function ht(){let mt=empty,ft,pt,yt;if((!o||ot(at,ct,lt[lt.length-1]||void 0))&&(mt=toResult(tt(at,lt)),mt[0]===EXIT))return mt;if("children"in at&&at.children){const gt=at;if(gt.children&&mt[0]!==SKIP)for(pt=(rt?gt.children.length:-1)+it,yt=lt.concat(gt);pt>-1&&pt<gt.children.length;){const bt=gt.children[pt];if(ft=st(bt,pt,yt)(),ft[0]===EXIT)return ft;pt=typeof ft[1]=="number"?ft[1]:pt+it}}return mt}}}function toResult(et){return Array.isArray(et)?et:typeof et=="number"?[CONTINUE,et]:et==null?empty:[et]}function visit(et,o,tt,rt){let nt,ot,it;typeof o=="function"&&typeof tt!="function"?(ot=void 0,it=o,nt=tt):(ot=o,it=tt,nt=rt),visitParents(et,ot,st,nt);function st(at,ct){const lt=ct[ct.length-1],dt=lt?lt.children.indexOf(at):void 0;return it(at,dt,lt)}}const own$1={}.hasOwnProperty,emptyOptions={};function createState(et,o){const tt=o||emptyOptions,rt=new Map,nt=new Map,ot=new Map,it={...handlers,...tt.handlers},st={all:ct,applyData,definitionById:rt,footnoteById:nt,footnoteCounts:ot,footnoteOrder:[],handlers:it,one:at,options:tt,patch,wrap:wrap$1};return visit(et,function(lt){if(lt.type==="definition"||lt.type==="footnoteDefinition"){const dt=lt.type==="definition"?rt:nt,ht=String(lt.identifier).toUpperCase();dt.has(ht)||dt.set(ht,lt)}}),st;function at(lt,dt){const ht=lt.type,mt=st.handlers[ht];if(own$1.call(st.handlers,ht)&&mt)return mt(st,lt,dt);if(st.options.passThrough&&st.options.passThrough.includes(ht)){if("children"in lt){const{children:pt,...yt}=lt,gt=structuredClone$1(yt);return gt.children=st.all(lt),gt}return structuredClone$1(lt)}return(st.options.unknownHandler||defaultUnknownHandler)(st,lt,dt)}function ct(lt){const dt=[];if("children"in lt){const ht=lt.children;let mt=-1;for(;++mt<ht.length;){const ft=st.one(ht[mt],lt);if(ft){if(mt&&ht[mt-1].type==="break"&&(!Array.isArray(ft)&&ft.type==="text"&&(ft.value=trimMarkdownSpaceStart(ft.value)),!Array.isArray(ft)&&ft.type==="element")){const pt=ft.children[0];pt&&pt.type==="text"&&(pt.value=trimMarkdownSpaceStart(pt.value))}Array.isArray(ft)?dt.push(...ft):dt.push(ft)}}}return dt}}function patch(et,o){et.position&&(o.position=position$1(et))}function applyData(et,o){let tt=o;if(et&&et.data){const rt=et.data.hName,nt=et.data.hChildren,ot=et.data.hProperties;if(typeof rt=="string")if(tt.type==="element")tt.tagName=rt;else{const it="children"in tt?tt.children:[tt];tt={type:"element",tagName:rt,properties:{},children:it}}tt.type==="element"&&ot&&Object.assign(tt.properties,structuredClone$1(ot)),"children"in tt&&tt.children&&nt!==null&&nt!==void 0&&(tt.children=nt)}return tt}function defaultUnknownHandler(et,o){const tt=o.data||{},rt="value"in o&&!(own$1.call(tt,"hProperties")||own$1.call(tt,"hChildren"))?{type:"text",value:o.value}:{type:"element",tagName:"div",properties:{},children:et.all(o)};return et.patch(o,rt),et.applyData(o,rt)}function wrap$1(et,o){const tt=[];let rt=-1;for(o&&tt.push({type:"text",value:`
`});++rt<et.length;)rt&&tt.push({type:"text",value:`
`}),tt.push(et[rt]);return o&&et.length>0&&tt.push({type:"text",value:`
`}),tt}function trimMarkdownSpaceStart(et){let o=0,tt=et.charCodeAt(o);for(;tt===9||tt===32;)o++,tt=et.charCodeAt(o);return et.slice(o)}function toHast(et,o){const tt=createState(et,o),rt=tt.one(et,void 0),nt=footer(tt),ot=Array.isArray(rt)?{type:"root",children:rt}:rt||{type:"root",children:[]};return nt&&ot.children.push({type:"text",value:`
`},nt),ot}function remarkRehype(et,o){return et&&"run"in et?async function(tt,rt){const nt=toHast(tt,{file:rt,...o});await et.run(nt,rt)}:function(tt,rt){return toHast(tt,{file:rt,...et||o})}}function bail(et){if(et)throw et}var hasOwn=Object.prototype.hasOwnProperty,toStr=Object.prototype.toString,defineProperty=Object.defineProperty,gOPD=Object.getOwnPropertyDescriptor,isArray=function et(o){return typeof Array.isArray=="function"?Array.isArray(o):toStr.call(o)==="[object Array]"},isPlainObject$1=function et(o){if(!o||toStr.call(o)!=="[object Object]")return!1;var tt=hasOwn.call(o,"constructor"),rt=o.constructor&&o.constructor.prototype&&hasOwn.call(o.constructor.prototype,"isPrototypeOf");if(o.constructor&&!tt&&!rt)return!1;var nt;for(nt in o);return typeof nt>"u"||hasOwn.call(o,nt)},setProperty=function et(o,tt){defineProperty&&tt.name==="__proto__"?defineProperty(o,tt.name,{enumerable:!0,configurable:!0,value:tt.newValue,writable:!0}):o[tt.name]=tt.newValue},getProperty=function et(o,tt){if(tt==="__proto__")if(hasOwn.call(o,tt)){if(gOPD)return gOPD(o,tt).value}else return;return o[tt]},extend=function et(){var o,tt,rt,nt,ot,it,st=arguments[0],at=1,ct=arguments.length,lt=!1;for(typeof st=="boolean"&&(lt=st,st=arguments[1]||{},at=2),(st==null||typeof st!="object"&&typeof st!="function")&&(st={});at<ct;++at)if(o=arguments[at],o!=null)for(tt in o)rt=getProperty(st,tt),nt=getProperty(o,tt),st!==nt&&(lt&&nt&&(isPlainObject$1(nt)||(ot=isArray(nt)))?(ot?(ot=!1,it=rt&&isArray(rt)?rt:[]):it=rt&&isPlainObject$1(rt)?rt:{},setProperty(st,{name:tt,newValue:et(lt,it,nt)})):typeof nt<"u"&&setProperty(st,{name:tt,newValue:nt}));return st};const extend$1=getDefaultExportFromCjs(extend);function isPlainObject(et){if(typeof et!="object"||et===null)return!1;const o=Object.getPrototypeOf(et);return(o===null||o===Object.prototype||Object.getPrototypeOf(o)===null)&&!(Symbol.toStringTag in et)&&!(Symbol.iterator in et)}function trough(){const et=[],o={run:tt,use:rt};return o;function tt(...nt){let ot=-1;const it=nt.pop();if(typeof it!="function")throw new TypeError("Expected function as last argument, not "+it);st(null,...nt);function st(at,...ct){const lt=et[++ot];let dt=-1;if(at){it(at);return}for(;++dt<nt.length;)(ct[dt]===null||ct[dt]===void 0)&&(ct[dt]=nt[dt]);nt=ct,lt?wrap(lt,st)(...ct):it(null,...ct)}}function rt(nt){if(typeof nt!="function")throw new TypeError("Expected `middelware` to be a function, not "+nt);return et.push(nt),o}}function wrap(et,o){let tt;return rt;function rt(...it){const st=et.length>it.length;let at;st&&it.push(nt);try{at=et.apply(this,it)}catch(ct){const lt=ct;if(st&&tt)throw lt;return nt(lt)}st||(at&&at.then&&typeof at.then=="function"?at.then(ot,nt):at instanceof Error?nt(at):ot(at))}function nt(it,...st){tt||(tt=!0,o(it,...st))}function ot(it){nt(null,it)}}const minpath={basename,dirname,extname,join,sep:"/"};function basename(et,o){if(o!==void 0&&typeof o!="string")throw new TypeError('"ext" argument must be a string');assertPath$1(et);let tt=0,rt=-1,nt=et.length,ot;if(o===void 0||o.length===0||o.length>et.length){for(;nt--;)if(et.codePointAt(nt)===47){if(ot){tt=nt+1;break}}else rt<0&&(ot=!0,rt=nt+1);return rt<0?"":et.slice(tt,rt)}if(o===et)return"";let it=-1,st=o.length-1;for(;nt--;)if(et.codePointAt(nt)===47){if(ot){tt=nt+1;break}}else it<0&&(ot=!0,it=nt+1),st>-1&&(et.codePointAt(nt)===o.codePointAt(st--)?st<0&&(rt=nt):(st=-1,rt=it));return tt===rt?rt=it:rt<0&&(rt=et.length),et.slice(tt,rt)}function dirname(et){if(assertPath$1(et),et.length===0)return".";let o=-1,tt=et.length,rt;for(;--tt;)if(et.codePointAt(tt)===47){if(rt){o=tt;break}}else rt||(rt=!0);return o<0?et.codePointAt(0)===47?"/":".":o===1&&et.codePointAt(0)===47?"//":et.slice(0,o)}function extname(et){assertPath$1(et);let o=et.length,tt=-1,rt=0,nt=-1,ot=0,it;for(;o--;){const st=et.codePointAt(o);if(st===47){if(it){rt=o+1;break}continue}tt<0&&(it=!0,tt=o+1),st===46?nt<0?nt=o:ot!==1&&(ot=1):nt>-1&&(ot=-1)}return nt<0||tt<0||ot===0||ot===1&&nt===tt-1&&nt===rt+1?"":et.slice(nt,tt)}function join(...et){let o=-1,tt;for(;++o<et.length;)assertPath$1(et[o]),et[o]&&(tt=tt===void 0?et[o]:tt+"/"+et[o]);return tt===void 0?".":normalize(tt)}function normalize(et){assertPath$1(et);const o=et.codePointAt(0)===47;let tt=normalizeString(et,!o);return tt.length===0&&!o&&(tt="."),tt.length>0&&et.codePointAt(et.length-1)===47&&(tt+="/"),o?"/"+tt:tt}function normalizeString(et,o){let tt="",rt=0,nt=-1,ot=0,it=-1,st,at;for(;++it<=et.length;){if(it<et.length)st=et.codePointAt(it);else{if(st===47)break;st=47}if(st===47){if(!(nt===it-1||ot===1))if(nt!==it-1&&ot===2){if(tt.length<2||rt!==2||tt.codePointAt(tt.length-1)!==46||tt.codePointAt(tt.length-2)!==46){if(tt.length>2){if(at=tt.lastIndexOf("/"),at!==tt.length-1){at<0?(tt="",rt=0):(tt=tt.slice(0,at),rt=tt.length-1-tt.lastIndexOf("/")),nt=it,ot=0;continue}}else if(tt.length>0){tt="",rt=0,nt=it,ot=0;continue}}o&&(tt=tt.length>0?tt+"/..":"..",rt=2)}else tt.length>0?tt+="/"+et.slice(nt+1,it):tt=et.slice(nt+1,it),rt=it-nt-1;nt=it,ot=0}else st===46&&ot>-1?ot++:ot=-1}return tt}function assertPath$1(et){if(typeof et!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(et))}const minproc={cwd};function cwd(){return"/"}function isUrl(et){return!!(et!==null&&typeof et=="object"&&"href"in et&&et.href&&"protocol"in et&&et.protocol&&et.auth===void 0)}function urlToPath(et){if(typeof et=="string")et=new URL(et);else if(!isUrl(et)){const o=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+et+"`");throw o.code="ERR_INVALID_ARG_TYPE",o}if(et.protocol!=="file:"){const o=new TypeError("The URL must be of scheme file");throw o.code="ERR_INVALID_URL_SCHEME",o}return getPathFromURLPosix(et)}function getPathFromURLPosix(et){if(et.hostname!==""){const rt=new TypeError('File URL host must be "localhost" or empty on darwin');throw rt.code="ERR_INVALID_FILE_URL_HOST",rt}const o=et.pathname;let tt=-1;for(;++tt<o.length;)if(o.codePointAt(tt)===37&&o.codePointAt(tt+1)===50){const rt=o.codePointAt(tt+2);if(rt===70||rt===102){const nt=new TypeError("File URL path must not include encoded / characters");throw nt.code="ERR_INVALID_FILE_URL_PATH",nt}}return decodeURIComponent(o)}const order=["history","path","basename","stem","extname","dirname"];class VFile{constructor(o){let tt;o?isUrl(o)?tt={path:o}:typeof o=="string"||isUint8Array$1(o)?tt={value:o}:tt=o:tt={},this.cwd="cwd"in tt?"":minproc.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let rt=-1;for(;++rt<order.length;){const ot=order[rt];ot in tt&&tt[ot]!==void 0&&tt[ot]!==null&&(this[ot]=ot==="history"?[...tt[ot]]:tt[ot])}let nt;for(nt in tt)order.includes(nt)||(this[nt]=tt[nt])}get basename(){return typeof this.path=="string"?minpath.basename(this.path):void 0}set basename(o){assertNonEmpty(o,"basename"),assertPart(o,"basename"),this.path=minpath.join(this.dirname||"",o)}get dirname(){return typeof this.path=="string"?minpath.dirname(this.path):void 0}set dirname(o){assertPath(this.basename,"dirname"),this.path=minpath.join(o||"",this.basename)}get extname(){return typeof this.path=="string"?minpath.extname(this.path):void 0}set extname(o){if(assertPart(o,"extname"),assertPath(this.dirname,"extname"),o){if(o.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(o.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=minpath.join(this.dirname,this.stem+(o||""))}get path(){return this.history[this.history.length-1]}set path(o){isUrl(o)&&(o=urlToPath(o)),assertNonEmpty(o,"path"),this.path!==o&&this.history.push(o)}get stem(){return typeof this.path=="string"?minpath.basename(this.path,this.extname):void 0}set stem(o){assertNonEmpty(o,"stem"),assertPart(o,"stem"),this.path=minpath.join(this.dirname||"",o+(this.extname||""))}fail(o,tt,rt){const nt=this.message(o,tt,rt);throw nt.fatal=!0,nt}info(o,tt,rt){const nt=this.message(o,tt,rt);return nt.fatal=void 0,nt}message(o,tt,rt){const nt=new VFileMessage(o,tt,rt);return this.path&&(nt.name=this.path+":"+nt.name,nt.file=this.path),nt.fatal=!1,this.messages.push(nt),nt}toString(o){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(o||void 0).decode(this.value)}}function assertPart(et,o){if(et&&et.includes(minpath.sep))throw new Error("`"+o+"` cannot be a path: did not expect `"+minpath.sep+"`")}function assertNonEmpty(et,o){if(!et)throw new Error("`"+o+"` cannot be empty")}function assertPath(et,o){if(!et)throw new Error("Setting `"+o+"` requires `path` to be set too")}function isUint8Array$1(et){return!!(et&&typeof et=="object"&&"byteLength"in et&&"byteOffset"in et)}const CallableInstance=function(et){const rt=this.constructor.prototype,nt=rt[et],ot=function(){return nt.apply(ot,arguments)};return Object.setPrototypeOf(ot,rt),ot},own={}.hasOwnProperty;class Processor extends CallableInstance{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=trough()}copy(){const o=new Processor;let tt=-1;for(;++tt<this.attachers.length;){const rt=this.attachers[tt];o.use(...rt)}return o.data(extend$1(!0,{},this.namespace)),o}data(o,tt){return typeof o=="string"?arguments.length===2?(assertUnfrozen("data",this.frozen),this.namespace[o]=tt,this):own.call(this.namespace,o)&&this.namespace[o]||void 0:o?(assertUnfrozen("data",this.frozen),this.namespace=o,this):this.namespace}freeze(){if(this.frozen)return this;const o=this;for(;++this.freezeIndex<this.attachers.length;){const[tt,...rt]=this.attachers[this.freezeIndex];if(rt[0]===!1)continue;rt[0]===!0&&(rt[0]=void 0);const nt=tt.call(o,...rt);typeof nt=="function"&&this.transformers.use(nt)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(o){this.freeze();const tt=vfile(o),rt=this.parser||this.Parser;return assertParser("parse",rt),rt(String(tt),tt)}process(o,tt){const rt=this;return this.freeze(),assertParser("process",this.parser||this.Parser),assertCompiler("process",this.compiler||this.Compiler),tt?nt(void 0,tt):new Promise(nt);function nt(ot,it){const st=vfile(o),at=rt.parse(st);rt.run(at,st,function(lt,dt,ht){if(lt||!dt||!ht)return ct(lt);const mt=dt,ft=rt.stringify(mt,ht);looksLikeAValue(ft)?ht.value=ft:ht.result=ft,ct(lt,ht)});function ct(lt,dt){lt||!dt?it(lt):ot?ot(dt):tt(void 0,dt)}}}processSync(o){let tt=!1,rt;return this.freeze(),assertParser("processSync",this.parser||this.Parser),assertCompiler("processSync",this.compiler||this.Compiler),this.process(o,nt),assertDone("processSync","process",tt),rt;function nt(ot,it){tt=!0,bail(ot),rt=it}}run(o,tt,rt){assertNode(o),this.freeze();const nt=this.transformers;return!rt&&typeof tt=="function"&&(rt=tt,tt=void 0),rt?ot(void 0,rt):new Promise(ot);function ot(it,st){const at=vfile(tt);nt.run(o,at,ct);function ct(lt,dt,ht){const mt=dt||o;lt?st(lt):it?it(mt):rt(void 0,mt,ht)}}}runSync(o,tt){let rt=!1,nt;return this.run(o,tt,ot),assertDone("runSync","run",rt),nt;function ot(it,st){bail(it),nt=st,rt=!0}}stringify(o,tt){this.freeze();const rt=vfile(tt),nt=this.compiler||this.Compiler;return assertCompiler("stringify",nt),assertNode(o),nt(o,rt)}use(o,...tt){const rt=this.attachers,nt=this.namespace;if(assertUnfrozen("use",this.frozen),o!=null)if(typeof o=="function")at(o,tt);else if(typeof o=="object")Array.isArray(o)?st(o):it(o);else throw new TypeError("Expected usable value, not `"+o+"`");return this;function ot(ct){if(typeof ct=="function")at(ct,[]);else if(typeof ct=="object")if(Array.isArray(ct)){const[lt,...dt]=ct;at(lt,dt)}else it(ct);else throw new TypeError("Expected usable value, not `"+ct+"`")}function it(ct){if(!("plugins"in ct)&&!("settings"in ct))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");st(ct.plugins),ct.settings&&(nt.settings=extend$1(!0,nt.settings,ct.settings))}function st(ct){let lt=-1;if(ct!=null)if(Array.isArray(ct))for(;++lt<ct.length;){const dt=ct[lt];ot(dt)}else throw new TypeError("Expected a list of plugins, not `"+ct+"`")}function at(ct,lt){let dt=-1,ht=-1;for(;++dt<rt.length;)if(rt[dt][0]===ct){ht=dt;break}if(ht===-1)rt.push([ct,...lt]);else if(lt.length>0){let[mt,...ft]=lt;const pt=rt[ht][1];isPlainObject(pt)&&isPlainObject(mt)&&(mt=extend$1(!0,pt,mt)),rt[ht]=[ct,mt,...ft]}}}}const unified=new Processor().freeze();function assertParser(et,o){if(typeof o!="function")throw new TypeError("Cannot `"+et+"` without `parser`")}function assertCompiler(et,o){if(typeof o!="function")throw new TypeError("Cannot `"+et+"` without `compiler`")}function assertUnfrozen(et,o){if(o)throw new Error("Cannot call `"+et+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function assertNode(et){if(!isPlainObject(et)||typeof et.type!="string")throw new TypeError("Expected node, got `"+et+"`")}function assertDone(et,o,tt){if(!tt)throw new Error("`"+et+"` finished async. Use `"+o+"` instead")}function vfile(et){return looksLikeAVFile(et)?et:new VFile(et)}function looksLikeAVFile(et){return!!(et&&typeof et=="object"&&"message"in et&&"messages"in et)}function looksLikeAValue(et){return typeof et=="string"||isUint8Array(et)}function isUint8Array(et){return!!(et&&typeof et=="object"&&"byteLength"in et&&"byteOffset"in et)}const changelog="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",emptyPlugins=[],emptyRemarkRehypeOptions={allowDangerousHtml:!0},safeProtocol=/^(https?|ircs?|mailto|xmpp)$/i,deprecations=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Markdown(et){const o=et.allowedElements,tt=et.allowElement,rt=et.children||"",nt=et.className,ot=et.components,it=et.disallowedElements,st=et.rehypePlugins||emptyPlugins,at=et.remarkPlugins||emptyPlugins,ct=et.remarkRehypeOptions?{...et.remarkRehypeOptions,...emptyRemarkRehypeOptions}:emptyRemarkRehypeOptions,lt=et.skipHtml,dt=et.unwrapDisallowed,ht=et.urlTransform||defaultUrlTransform,mt=unified().use(remarkParse).use(at).use(remarkRehype,ct).use(st),ft=new VFile;typeof rt=="string"&&(ft.value=rt);for(const bt of deprecations)Object.hasOwn(et,bt.from)&&(""+bt.from+(bt.to?"use `"+bt.to+"` instead":"remove it")+changelog+bt.id,void 0);const pt=mt.parse(ft);let yt=mt.runSync(pt,ft);return nt&&(yt={type:"element",tagName:"div",properties:{className:nt},children:yt.type==="root"?yt.children:[yt]}),visit(yt,gt),toJsxRuntime(yt,{Fragment:jsxRuntimeExports.Fragment,components:ot,ignoreInvalidStyle:!0,jsx:jsxRuntimeExports.jsx,jsxs:jsxRuntimeExports.jsxs,passKeys:!0,passNode:!0});function gt(bt,xt,vt){if(bt.type==="raw"&&vt&&typeof xt=="number")return lt?vt.children.splice(xt,1):vt.children[xt]={type:"text",value:bt.value},xt;if(bt.type==="element"){let Et;for(Et in urlAttributes)if(Object.hasOwn(urlAttributes,Et)&&Object.hasOwn(bt.properties,Et)){const Ct=bt.properties[Et],St=urlAttributes[Et];(St===null||St.includes(bt.tagName))&&(bt.properties[Et]=ht(String(Ct||""),Et,bt))}}if(bt.type==="element"){let Et=o?!o.includes(bt.tagName):it?it.includes(bt.tagName):!1;if(!Et&&tt&&typeof xt=="number"&&(Et=!tt(bt,xt,vt)),Et&&vt&&typeof xt=="number")return dt&&bt.children?vt.children.splice(xt,1,...bt.children):vt.children.splice(xt,1),xt}}}function defaultUrlTransform(et){const o=et.indexOf(":"),tt=et.indexOf("?"),rt=et.indexOf("#"),nt=et.indexOf("/");return o<0||nt>-1&&o>nt||tt>-1&&o>tt||rt>-1&&o>rt||safeProtocol.test(et.slice(0,o))?et:""}const PrivacyPolicyOptIn=({onOptIn:et})=>{const[o,tt]=reactExports.useState(!1);return jsxRuntimeExports.jsxs("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:[jsxRuntimeExports.jsxs(Card,{className:"w-full max-w-md",children:[jsxRuntimeExports.jsx(CardHeader,{className:"space-y-2",children:jsxRuntimeExports.jsx(CardTitle,{className:"text-xl sm:text-2xl",children:"Privacy Policy & Data Collection"})}),jsxRuntimeExports.jsx(CardContent,{children:jsxRuntimeExports.jsxs("div",{className:"space-y-4",children:[jsxRuntimeExports.jsx("p",{className:"text-sm sm:text-base text-muted-foreground",children:"We collect data to improve our services. This data is anonymous and helps us understand how our application is used. You can opt-in or opt-out of this data collection."}),jsxRuntimeExports.jsx(Button,{variant:"link",onClick:()=>tt(!0),className:"px-0 text-sm sm:text-base",children:"View Full Privacy Policy"})]})}),jsxRuntimeExports.jsxs(CardFooter,{className:"flex flex-col sm:flex-row gap-3 sm:gap-4",children:[jsxRuntimeExports.jsx(Button,{variant:"outline",onClick:()=>et(!1),className:"w-full sm:w-auto",children:"Opt Out"}),jsxRuntimeExports.jsx(Button,{onClick:()=>et(!0),className:"w-full sm:w-auto",children:"Opt In"})]})]}),jsxRuntimeExports.jsx(Dialog,{open:o,onOpenChange:tt,children:jsxRuntimeExports.jsxs(DialogContent,{className:"w-[95vw] max-w-4xl max-h-[90vh] p-4 sm:p-6",children:[jsxRuntimeExports.jsx(DialogHeader,{children:jsxRuntimeExports.jsx(DialogTitle,{className:"text-xl sm:text-2xl",children:"Privacy Policy"})}),jsxRuntimeExports.jsx(ScrollArea,{className:"mt-4 h-[50vh] sm:h-[60vh]",children:jsxRuntimeExports.jsx(DialogDescription,{className:"space-y-4",children:jsxRuntimeExports.jsx(Markdown,{className:"prose dark:prose-invert max-w-none text-sm sm:text-base",children:privacyPolicy})})})]})})]})},PrivacyPolicyPage=()=>{const[et,o]=reactExports.useState(!1);reactExports.useEffect(()=>{const rt=localStorage.getItem("privacyPolicyOptIn");rt!==null&&o(rt==="true")},[]);const tt=()=>{const rt=!et;o(rt),localStorage.setItem("privacyPolicyOptIn",rt.toString())};return jsxRuntimeExports.jsxs(Card,{className:"w-full max-w-4xl mx-auto p-4 sm:p-6",children:[jsxRuntimeExports.jsx(CardHeader,{className:"space-y-2",children:jsxRuntimeExports.jsx(CardTitle,{className:"text-2xl sm:text-3xl",children:"Privacy Policy Settings"})}),jsxRuntimeExports.jsx(CardContent,{children:jsxRuntimeExports.jsxs("div",{className:"space-y-6 sm:space-y-8",children:[jsxRuntimeExports.jsxs("div",{className:"space-y-4",children:[jsxRuntimeExports.jsx("p",{className:"text-sm sm:text-base text-muted-foreground",children:"We collect data to improve our services. This data is anonymous and helps us understand how our application is used."}),jsxRuntimeExports.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[jsxRuntimeExports.jsxs("p",{className:"font-semibold",children:["Current status: ",et?"Opted In":"Opted Out"]}),jsxRuntimeExports.jsx(Button,{onClick:tt,className:"w-full sm:w-auto",children:et?"Opt Out":"Opt In"})]})]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("h3",{className:"text-lg sm:text-xl font-semibold mb-4",children:"Privacy Policy"}),jsxRuntimeExports.jsx(ScrollArea,{className:"h-[50vh] sm:h-[60vh] border rounded-md p-2 sm:p-4",children:jsxRuntimeExports.jsx(Markdown,{className:"prose dark:prose-invert max-w-none text-sm sm:text-base",children:privacyPolicy})})]})]})})]})},SignSharedChain=({chainsData:et,onChainUpdate:o,isLoading:tt})=>{const{chainUUID:rt,blockUUID:nt}=useParams(),[ot,it]=reactExports.useState(null),st=useNavigate();return reactExports.useEffect(()=>{const at=et.find(ct=>ct.chainUUID===rt&&ct.blockUUID===nt);at&&it(at)},[et,rt,nt]),tt&&!ot?jsxRuntimeExports.jsx(Card,{className:"w-full max-w-md mx-auto",children:jsxRuntimeExports.jsxs(CardContent,{className:"flex flex-col items-center justify-center py-8 space-y-4",children:[jsxRuntimeExports.jsx(LoaderCircle,{className:"h-8 w-8 animate-spin"}),jsxRuntimeExports.jsx("p",{className:"text-sm text-muted-foreground",children:"Looking for chain..."})]})}):ot?jsxRuntimeExports.jsxs(Card,{className:"w-full max-w-2xl mx-auto",children:[jsxRuntimeExports.jsx(CardHeader,{children:jsxRuntimeExports.jsx(CardTitle,{children:"Sign Shared Chain"})}),jsxRuntimeExports.jsxs(CardContent,{children:[jsxRuntimeExports.jsx("h2",{className:"text-xl font-semibold mb-2",children:ot.title}),jsxRuntimeExports.jsx("p",{className:"mb-4",children:ot.description}),jsxRuntimeExports.jsx(SignChain,{block:ot,chainsData:et,onSuccess:o})]})]}):jsxRuntimeExports.jsxs(Card,{className:"w-full max-w-md mx-auto",children:[jsxRuntimeExports.jsx(CardHeader,{children:jsxRuntimeExports.jsx(CardTitle,{children:"Chain Not Found"})}),jsxRuntimeExports.jsxs(CardContent,{children:[jsxRuntimeExports.jsx("p",{className:"mb-4",children:"The requested chain or block could not be found."}),jsxRuntimeExports.jsx(Button,{onClick:()=>st("/view"),children:"View All Chains"})]})]})};function App(){const[et,o]=reactExports.useState(!1),[tt,rt]=reactExports.useState([]),{isLoading:nt,error:ot,node:it}=useWaku(),[st,at]=reactExports.useState({filter:"in-progress",store:"in-progress"}),[ct,lt]=reactExports.useState(null),[dt,ht]=reactExports.useState(!0);reactExports.useEffect(()=>{const yt=localStorage.getItem("telemetryOptIn");yt!==null&&lt(yt==="true")},[]),reactExports.useEffect(()=>{nt||!it||it.libp2p.getConnections().length===0||tt.length>0||et||(o(!0),ft())},[it,nt,st]);const mt=yt=>{lt(yt),localStorage.setItem("telemetryOptIn",yt.toString())};if(nt)return jsxRuntimeExports.jsx("div",{className:"min-h-screen bg-background text-foreground",children:jsxRuntimeExports.jsxs("div",{className:"container mx-auto px-4 py-16 flex flex-col items-center justify-center space-y-4",children:[jsxRuntimeExports.jsx("h1",{className:"text-2xl md:text-4xl font-bold",children:"BuddyBook"}),jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[jsxRuntimeExports.jsx(LoaderCircle,{className:"h-8 w-8 animate-spin"}),jsxRuntimeExports.jsx("p",{className:"text-muted-foreground",children:"Connecting to Waku's decentralized network..."})]})]})});const ft=async()=>{console.log("Starting message listening");try{at(gt=>({...gt,store:"in-progress"})),ht(!0);const yt=getMessagesFromStore(it);try{for await(const gt of yt)rt(bt=>bt.some(vt=>vt.blockUUID===gt.blockUUID)?bt:[...bt,gt])}catch(gt){console.error("Error processing message:",gt)}at(gt=>({...gt,store:"success"}))}catch(yt){console.error("Error fetching messages from store:",yt),at(gt=>({...gt,store:"error"}))}finally{ht(!1)}try{at(yt=>({...yt,filter:"in-progress"})),await subscribeToFilter(it,yt=>{pt(yt)}),at(yt=>({...yt,filter:"success"}))}catch(yt){console.error("Error subscribing to filter:",yt),at(gt=>({...gt,filter:"error"}))}};if(ot)return console.error("Waku error:",ot),jsxRuntimeExports.jsxs("div",{className:"min-h-screen bg-background text-foreground flex flex-col justify-center items-center",children:[jsxRuntimeExports.jsx("p",{className:"text-red-500",children:"Error connecting to Waku network"}),jsxRuntimeExports.jsx("p",{className:"text-sm text-muted-foreground",children:ot.toString()})]});const pt=yt=>{rt(gt=>gt.some(xt=>xt.blockUUID===yt.blockUUID)?gt:[...gt,yt])};return ct===null?jsxRuntimeExports.jsx(PrivacyPolicyOptIn,{onOptIn:mt}):jsxRuntimeExports.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[jsxRuntimeExports.jsx(Header,{wakuStatus:st}),jsxRuntimeExports.jsx("main",{className:"container mx-auto px-4 py-4 md:py-8 max-w-7xl",children:jsxRuntimeExports.jsxs(Routes,{children:[jsxRuntimeExports.jsx(Route,{path:"",element:jsxRuntimeExports.jsx(Home,{})}),jsxRuntimeExports.jsx(Route,{path:"create",element:jsxRuntimeExports.jsx(ChainCreationForm,{})}),jsxRuntimeExports.jsx(Route,{path:"view",element:jsxRuntimeExports.jsx(ChainList,{chainsData:tt,onChainUpdate:pt,isLoading:dt})}),jsxRuntimeExports.jsx(Route,{path:"sign/:chainUUID/:blockUUID",element:jsxRuntimeExports.jsx(SignSharedChain,{chainsData:tt,onChainUpdate:pt,isLoading:dt})}),jsxRuntimeExports.jsx(Route,{path:"telemetry",element:jsxRuntimeExports.jsx(PrivacyPolicyPage,{})}),jsxRuntimeExports.jsx(Route,{path:"*",element:jsxRuntimeExports.jsx(Navigate,{to:"",replace:!0})})]})})]})}const Home=()=>jsxRuntimeExports.jsxs("div",{className:"space-y-4 md:space-y-6 p-4 md:p-6",children:[jsxRuntimeExports.jsx("h1",{className:"text-2xl md:text-4xl font-bold",children:"BuddyBook"}),jsxRuntimeExports.jsxs("div",{className:"w-full max-w-sm mx-auto p-4 md:p-6 bg-card rounded-lg shadow-md",children:[jsxRuntimeExports.jsx(Link,{to:"create",children:jsxRuntimeExports.jsx(Button,{className:"w-full mb-4",children:"Create New Chain"})}),jsxRuntimeExports.jsx("p",{className:"text-sm md:text-base text-muted-foreground",children:"Click the button above to start creating a new chain."})]}),jsxRuntimeExports.jsx("p",{className:"text-xs md:text-sm text-muted-foreground text-center",children:"Welcome to BuddyBook - Create and share your chains!"})]}),projectId="1d93edc21291f98e3bed6ff7617ff539",config=createConfig(defaultConfig({appName:"BuddyBook",walletConnectProjectId:projectId,chains:[mainnet],transports:{[mainnet.id]:http()}})),WAKU_NODE_OPTIONS={defaultBootstrap:!0,libp2p:{addresses:{listen:[]},connectionManager:{minConnections:2}},protocols:[Protocols.Store,Protocols.Filter,Protocols.LightPush]};typeof globalThis>"u"&&(window.global=window);typeof buffer$2.Buffer>"u"&&(window.Buffer=buffer$2.Buffer);const queryClient=new QueryClient;createRoot(document.getElementById("root")).render(jsxRuntimeExports.jsx(reactExports.StrictMode,{children:jsxRuntimeExports.jsx(WagmiProvider,{config,children:jsxRuntimeExports.jsx(QueryClientProvider,{client:queryClient,children:jsxRuntimeExports.jsx(ConnectKitProvider,{children:jsxRuntimeExports.jsx(LightNodeProvider,{options:WAKU_NODE_OPTIONS,children:jsxRuntimeExports.jsx(BrowserRouter,{basename:"/buddybook/",children:jsxRuntimeExports.jsx(App,{})})})})})})}));export{isHex as A,BytesSizeMismatchError as B,dijkstraExports as C,EventEmitter$1 as E,HttpRequestError as H,InvalidAddressError as I,__vitePreload as _,stringToHex as a,bytesToHex$3 as b,concat$6 as c,commonjsGlobal as d,encodeAbiParameters as e,encodeFunctionData as f,getAugmentedNamespace as g,getDefaultExportFromCjs as h,isAddress as i,browserExports as j,keccak256$1 as k,tslib_es6$1 as l,buffer$2 as m,numberToHex as n,allocUnsafe$h as o,BASES$1 as p,fromString$2 as q,detect as r,size$2 as s,toHex as t,__viteBrowserExternal$1 as u,BaseError$3 as v,getUrl as w,stringify$2 as x,decodeErrorResult as y,call as z};